aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/8253pit.h7
-rw-r--r--arch/alpha/include/asm/errno.h2
-rw-r--r--arch/alpha/include/asm/kmap_types.h24
-rw-r--r--arch/alpha/kernel/init_task.c3
-rw-r--r--arch/alpha/kernel/irq_alpha.c2
-rw-r--r--arch/alpha/kernel/irq_i8259.c2
-rw-r--r--arch/alpha/kernel/irq_impl.h2
-rw-r--r--arch/alpha/kernel/irq_pyxis.c2
-rw-r--r--arch/alpha/kernel/irq_srm.c2
-rw-r--r--arch/alpha/kernel/setup.c6
-rw-r--r--arch/alpha/kernel/sys_alcor.c2
-rw-r--r--arch/alpha/kernel/sys_cabriolet.c2
-rw-r--r--arch/alpha/kernel/sys_dp264.c6
-rw-r--r--arch/alpha/kernel/sys_eb64p.c2
-rw-r--r--arch/alpha/kernel/sys_eiger.c2
-rw-r--r--arch/alpha/kernel/sys_jensen.c2
-rw-r--r--arch/alpha/kernel/sys_marvel.c10
-rw-r--r--arch/alpha/kernel/sys_mikasa.c2
-rw-r--r--arch/alpha/kernel/sys_noritake.c2
-rw-r--r--arch/alpha/kernel/sys_rawhide.c2
-rw-r--r--arch/alpha/kernel/sys_ruffian.c1
-rw-r--r--arch/alpha/kernel/sys_rx164.c2
-rw-r--r--arch/alpha/kernel/sys_sable.c2
-rw-r--r--arch/alpha/kernel/sys_takara.c2
-rw-r--r--arch/alpha/kernel/sys_titan.c4
-rw-r--r--arch/alpha/kernel/sys_wildfire.c2
-rw-r--r--arch/alpha/mm/numa.c6
-rw-r--r--arch/arm/kernel/init_task.c4
-rw-r--r--arch/arm/kernel/signal.c6
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c23
-rw-r--r--arch/arm/mach-pxa/tosa-bt.c30
-rw-r--r--arch/arm/mach-pxa/tosa.c1
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h50
-rw-r--r--arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h377
-rw-r--r--arch/avr32/kernel/init_task.c4
-rw-r--r--arch/avr32/kernel/signal.c4
-rw-r--r--arch/blackfin/Kconfig60
-rw-r--r--arch/blackfin/Makefile7
-rw-r--r--arch/blackfin/boot/.gitignore3
-rw-r--r--arch/blackfin/boot/Makefile31
-rw-r--r--arch/blackfin/include/asm/atomic.h16
-rw-r--r--arch/blackfin/include/asm/bfin-global.h11
-rw-r--r--arch/blackfin/include/asm/bitops.h3
-rw-r--r--arch/blackfin/include/asm/bug.h57
-rw-r--r--arch/blackfin/include/asm/cache.h11
-rw-r--r--arch/blackfin/include/asm/cacheflush.h3
-rw-r--r--arch/blackfin/include/asm/cpu.h1
-rw-r--r--arch/blackfin/include/asm/ftrace.h14
-rw-r--r--arch/blackfin/include/asm/ipipe.h28
-rw-r--r--arch/blackfin/include/asm/irq.h271
-rw-r--r--arch/blackfin/include/asm/irqflags.h63
-rw-r--r--arch/blackfin/include/asm/kmap_types.h17
-rw-r--r--arch/blackfin/include/asm/mutex-dec.h112
-rw-r--r--arch/blackfin/include/asm/sections.h11
-rw-r--r--arch/blackfin/include/asm/system.h4
-rw-r--r--arch/blackfin/include/asm/unistd.h3
-rw-r--r--arch/blackfin/kernel/Makefile5
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c4
-rw-r--r--arch/blackfin/kernel/bfin_ksyms.c5
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cplbmgr.c2
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbmgr.c54
-rw-r--r--arch/blackfin/kernel/early_printk.c8
-rw-r--r--arch/blackfin/kernel/ftrace-entry.S140
-rw-r--r--arch/blackfin/kernel/ftrace.c42
-rw-r--r--arch/blackfin/kernel/init_task.c4
-rw-r--r--arch/blackfin/kernel/ipipe.c42
-rw-r--r--arch/blackfin/kernel/setup.c16
-rw-r--r--arch/blackfin/kernel/stacktrace.c53
-rw-r--r--arch/blackfin/kernel/traps.c128
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S17
-rw-r--r--arch/blackfin/lib/checksum.c2
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c12
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c5
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c5
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c5
-rw-r--r--arch/blackfin/mach-bf533/boards/H8606.c5
-rw-r--r--arch/blackfin/mach-bf533/boards/blackstamp.c5
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c5
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c5
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c5
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537.c7
-rw-r--r--arch/blackfin/mach-bf537/boards/minotaur.c5
-rw-r--r--arch/blackfin/mach-bf537/boards/pnav10.c7
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c2
-rw-r--r--arch/blackfin/mach-bf537/boards/tcm_bf537.c5
-rw-r--r--arch/blackfin/mach-bf538/boards/ezkit.c10
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c10
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c23
-rw-r--r--arch/blackfin/mach-bf561/boards/cm_bf561.c7
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c5
-rw-r--r--arch/blackfin/mach-common/cache-c.c14
-rw-r--r--arch/blackfin/mach-common/entry.S12
-rw-r--r--arch/blackfin/mach-common/smp.c24
-rw-r--r--arch/cris/include/asm/kmap_types.h17
-rw-r--r--arch/cris/kernel/process.c4
-rw-r--r--arch/frv/kernel/init_task.c4
-rw-r--r--arch/h8300/include/asm/kmap_types.h17
-rw-r--r--arch/h8300/kernel/init_task.c4
-rw-r--r--arch/ia64/hp/common/sba_iommu.c2
-rw-r--r--arch/ia64/include/asm/kmap_types.h24
-rw-r--r--arch/ia64/kernel/init_task.c4
-rw-r--r--arch/ia64/kernel/mca.c3
-rw-r--r--arch/ia64/kernel/perfmon.c2
-rw-r--r--arch/ia64/kernel/uncached.c3
-rw-r--r--arch/ia64/mm/extable.c4
-rw-r--r--arch/ia64/sn/pci/pci_dma.c3
-rw-r--r--arch/m32r/include/asm/kmap_types.h23
-rw-r--r--arch/m32r/kernel/init_task.c4
-rw-r--r--arch/m32r/mm/discontig.c6
-rw-r--r--arch/m32r/platforms/m32104ut/setup.c2
-rw-r--r--arch/m32r/platforms/m32700ut/setup.c8
-rw-r--r--arch/m32r/platforms/mappi/setup.c2
-rw-r--r--arch/m32r/platforms/mappi2/setup.c2
-rw-r--r--arch/m32r/platforms/mappi3/setup.c2
-rw-r--r--arch/m32r/platforms/oaks32r/setup.c2
-rw-r--r--arch/m32r/platforms/opsput/setup.c8
-rw-r--r--arch/m32r/platforms/usrv/setup.c4
-rw-r--r--arch/m68k/include/asm/kmap_types.h17
-rw-r--r--arch/m68k/kernel/process.c4
-rw-r--r--arch/m68knommu/kernel/init_task.c4
-rw-r--r--arch/microblaze/include/asm/kmap_types.h25
-rw-r--r--arch/mips/Kconfig17
-rw-r--r--arch/mips/Makefile9
-rw-r--r--arch/mips/alchemy/Kconfig19
-rw-r--r--arch/mips/alchemy/common/Makefile9
-rw-r--r--arch/mips/alchemy/common/gpio.c201
-rw-r--r--arch/mips/alchemy/common/gpiolib-au1000.c130
-rw-r--r--arch/mips/alchemy/common/reset.c5
-rw-r--r--arch/mips/alchemy/devboards/db1x00/board_setup.c12
-rw-r--r--arch/mips/alchemy/devboards/pb1000/board_setup.c10
-rw-r--r--arch/mips/alchemy/devboards/pb1100/board_setup.c3
-rw-r--r--arch/mips/alchemy/devboards/pb1500/board_setup.c10
-rw-r--r--arch/mips/alchemy/devboards/pm.c3
-rw-r--r--arch/mips/alchemy/mtx-1/board_setup.c24
-rw-r--r--arch/mips/alchemy/xxs1500/board_setup.c21
-rw-r--r--arch/mips/cavium-octeon/Makefile4
-rw-r--r--arch/mips/cavium-octeon/dma-octeon.c311
-rw-r--r--arch/mips/cavium-octeon/executive/Makefile1
-rw-r--r--arch/mips/cavium-octeon/executive/cvmx-bootmem.c104
-rw-r--r--arch/mips/cavium-octeon/executive/cvmx-helper-errata.c73
-rw-r--r--arch/mips/cavium-octeon/executive/cvmx-helper-jtag.c144
-rw-r--r--arch/mips/cavium-octeon/executive/cvmx-sysinfo.c2
-rw-r--r--arch/mips/cavium-octeon/msi.c288
-rw-r--r--arch/mips/cavium-octeon/octeon-irq.c2
-rw-r--r--arch/mips/cavium-octeon/pci-common.c137
-rw-r--r--arch/mips/cavium-octeon/pci-common.h39
-rw-r--r--arch/mips/cavium-octeon/pci.c568
-rw-r--r--arch/mips/cavium-octeon/pcie.c1370
-rw-r--r--arch/mips/configs/bigsur_defconfig2
-rw-r--r--arch/mips/configs/mtx1_defconfig2
-rw-r--r--arch/mips/include/asm/cpu-features.h8
-rw-r--r--arch/mips/include/asm/delay.h2
-rw-r--r--arch/mips/include/asm/errno.h2
-rw-r--r--arch/mips/include/asm/hugetlb.h114
-rw-r--r--arch/mips/include/asm/i8253.h2
-rw-r--r--arch/mips/include/asm/ioctl.h85
-rw-r--r--arch/mips/include/asm/kmap_types.h24
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1000_gpio.h56
-rw-r--r--arch/mips/include/asm/mach-au1x00/gpio-au1000.h604
-rw-r--r--arch/mips/include/asm/mach-au1x00/gpio.h35
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/gpio.h3
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h2
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h6
-rw-r--r--arch/mips/include/asm/mach-generic/dma-coherence.h6
-rw-r--r--arch/mips/include/asm/mach-ip27/dma-coherence.h6
-rw-r--r--arch/mips/include/asm/mach-ip32/dma-coherence.h6
-rw-r--r--arch/mips/include/asm/mach-jazz/dma-coherence.h6
-rw-r--r--arch/mips/include/asm/mach-lemote/dma-coherence.h6
-rw-r--r--arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h5
-rw-r--r--arch/mips/include/asm/mipsregs.h16
-rw-r--r--arch/mips/include/asm/octeon/cvmx-bootinfo.h13
-rw-r--r--arch/mips/include/asm/octeon/cvmx-bootmem.h85
-rw-r--r--arch/mips/include/asm/octeon/cvmx-helper-errata.h33
-rw-r--r--arch/mips/include/asm/octeon/cvmx-helper-jtag.h43
-rw-r--r--arch/mips/include/asm/octeon/cvmx-npei-defs.h2560
-rw-r--r--arch/mips/include/asm/octeon/cvmx-npi-defs.h1735
-rw-r--r--arch/mips/include/asm/octeon/cvmx-pci-defs.h1645
-rw-r--r--arch/mips/include/asm/octeon/cvmx-pcieep-defs.h1365
-rw-r--r--arch/mips/include/asm/octeon/cvmx-pciercx-defs.h1397
-rw-r--r--arch/mips/include/asm/octeon/cvmx-pescx-defs.h410
-rw-r--r--arch/mips/include/asm/octeon/cvmx-pexp-defs.h229
-rw-r--r--arch/mips/include/asm/octeon/cvmx.h12
-rw-r--r--arch/mips/include/asm/octeon/octeon-feature.h27
-rw-r--r--arch/mips/include/asm/octeon/octeon.h2
-rw-r--r--arch/mips/include/asm/page.h5
-rw-r--r--arch/mips/include/asm/pgtable-bits.h1
-rw-r--r--arch/mips/include/asm/pgtable.h10
-rw-r--r--arch/mips/include/asm/r4kcache.h1
-rw-r--r--arch/mips/include/asm/suspend.h9
-rw-r--r--arch/mips/include/asm/txx9/dmac.h51
-rw-r--r--arch/mips/include/asm/txx9/generic.h6
-rw-r--r--arch/mips/include/asm/txx9/tx4927.h4
-rw-r--r--arch/mips/include/asm/txx9/tx4938.h3
-rw-r--r--arch/mips/include/asm/txx9/tx4939.h6
-rw-r--r--arch/mips/kernel/asm-offsets.c13
-rw-r--r--arch/mips/kernel/cevt-txx9.c67
-rw-r--r--arch/mips/kernel/init_task.c4
-rw-r--r--arch/mips/kernel/smtc.c1
-rw-r--r--arch/mips/kernel/traps.c6
-rw-r--r--arch/mips/lib/delay.c4
-rw-r--r--arch/mips/mm/Makefile1
-rw-r--r--arch/mips/mm/c-r4k.c12
-rw-r--r--arch/mips/mm/dma-default.c23
-rw-r--r--arch/mips/mm/hugetlbpage.c101
-rw-r--r--arch/mips/mm/tlb-r4k.c43
-rw-r--r--arch/mips/mm/tlbex.c282
-rw-r--r--arch/mips/power/Makefile1
-rw-r--r--arch/mips/power/cpu.c43
-rw-r--r--arch/mips/power/hibernate.S70
-rw-r--r--arch/mips/rb532/irq.c5
-rw-r--r--arch/mips/sibyte/Kconfig31
-rw-r--r--arch/mips/sibyte/cfe/Makefile2
-rw-r--r--arch/mips/sibyte/common/Makefile4
-rw-r--r--arch/mips/sibyte/common/cfe.c (renamed from arch/mips/sibyte/cfe/setup.c)0
-rw-r--r--arch/mips/sibyte/common/cfe_console.c (renamed from arch/mips/sibyte/cfe/console.c)0
-rw-r--r--arch/mips/sibyte/sb1250/Makefile1
-rw-r--r--arch/mips/sibyte/sb1250/irq.c5
-rw-r--r--arch/mips/sibyte/sb1250/prom.c96
-rw-r--r--arch/mips/sibyte/swarm/setup.c14
-rw-r--r--arch/mips/sni/eisa.c2
-rw-r--r--arch/mips/txx9/Kconfig3
-rw-r--r--arch/mips/txx9/generic/setup.c175
-rw-r--r--arch/mips/txx9/generic/setup_tx4927.c55
-rw-r--r--arch/mips/txx9/generic/setup_tx4938.c38
-rw-r--r--arch/mips/txx9/generic/setup_tx4939.c53
-rw-r--r--arch/mips/txx9/rbtx4927/setup.c8
-rw-r--r--arch/mips/txx9/rbtx4938/setup.c4
-rw-r--r--arch/mips/txx9/rbtx4939/setup.c5
-rw-r--r--arch/mn10300/include/asm/kmap_types.h27
-rw-r--r--arch/mn10300/kernel/init_task.c3
-rw-r--r--arch/parisc/include/asm/errno.h1
-rw-r--r--arch/parisc/include/asm/kmap_types.h24
-rw-r--r--arch/parisc/kernel/init_task.c4
-rw-r--r--arch/powerpc/Kconfig21
-rw-r--r--arch/powerpc/Kconfig.debug13
-rw-r--r--arch/powerpc/Makefile1
-rw-r--r--arch/powerpc/boot/dts/gef_ppc9a.dts14
-rw-r--r--arch/powerpc/boot/dts/gef_sbc310.dts14
-rw-r--r--arch/powerpc/boot/dts/gef_sbc610.dts14
-rw-r--r--arch/powerpc/boot/dts/ksi8560.dts13
-rw-r--r--arch/powerpc/boot/dts/mpc832x_mds.dts3
-rw-r--r--arch/powerpc/boot/dts/mpc832x_rdb.dts3
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitx.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitxgp.dts1
-rw-r--r--arch/powerpc/boot/dts/mpc834x_mds.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc836x_mds.dts3
-rw-r--r--arch/powerpc/boot/dts/mpc836x_rdk.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8377_mds.dts1
-rw-r--r--arch/powerpc/boot/dts/mpc8378_mds.dts1
-rw-r--r--arch/powerpc/boot/dts/mpc8379_mds.dts1
-rw-r--r--arch/powerpc/boot/dts/mpc8536ds.dts18
-rw-r--r--arch/powerpc/boot/dts/mpc8540ads.dts15
-rw-r--r--arch/powerpc/boot/dts/mpc8541cds.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8544ds.dts18
-rw-r--r--arch/powerpc/boot/dts/mpc8548cds.dts17
-rw-r--r--arch/powerpc/boot/dts/mpc8555cds.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8560ads.dts15
-rw-r--r--arch/powerpc/boot/dts/mpc8568mds.dts51
-rw-r--r--arch/powerpc/boot/dts/mpc8569mds.dts583
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds.dts17
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_36b.dts39
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc8610_hpcd.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8641_hpcn.dts16
-rw-r--r--arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts609
-rw-r--r--arch/powerpc/boot/dts/p2020ds.dts704
-rw-r--r--arch/powerpc/boot/dts/sbc8349.dts1
-rw-r--r--arch/powerpc/boot/dts/sbc8548.dts16
-rw-r--r--arch/powerpc/boot/dts/sbc8560.dts15
-rw-r--r--arch/powerpc/boot/dts/sbc8641d.dts16
-rw-r--r--arch/powerpc/boot/dts/sequoia.dts22
-rw-r--r--arch/powerpc/boot/dts/socrates.dts15
-rw-r--r--arch/powerpc/boot/dts/stx_gp3_8560.dts15
-rw-r--r--arch/powerpc/boot/dts/tqm8540.dts15
-rw-r--r--arch/powerpc/boot/dts/tqm8541.dts15
-rw-r--r--arch/powerpc/boot/dts/tqm8548-bigflash.dts16
-rw-r--r--arch/powerpc/boot/dts/tqm8548.dts16
-rw-r--r--arch/powerpc/boot/dts/tqm8555.dts15
-rw-r--r--arch/powerpc/boot/dts/tqm8560.dts15
-rw-r--r--arch/powerpc/boot/dts/virtex440-ml510.dts465
-rw-r--r--arch/powerpc/boot/dts/warp.dts27
-rw-r--r--arch/powerpc/boot/install.sh3
-rw-r--r--arch/powerpc/configs/40x/acadia_defconfig2
-rw-r--r--arch/powerpc/configs/40x/ep405_defconfig2
-rw-r--r--arch/powerpc/configs/40x/kilauea_defconfig81
-rw-r--r--arch/powerpc/configs/40x/makalu_defconfig81
-rw-r--r--arch/powerpc/configs/40x/virtex_defconfig2
-rw-r--r--arch/powerpc/configs/44x/arches_defconfig2
-rw-r--r--arch/powerpc/configs/44x/bamboo_defconfig2
-rw-r--r--arch/powerpc/configs/44x/canyonlands_defconfig6
-rw-r--r--arch/powerpc/configs/44x/ebony_defconfig2
-rw-r--r--arch/powerpc/configs/44x/katmai_defconfig2
-rw-r--r--arch/powerpc/configs/44x/rainier_defconfig2
-rw-r--r--arch/powerpc/configs/44x/redwood_defconfig2
-rw-r--r--arch/powerpc/configs/44x/sam440ep_defconfig2
-rw-r--r--arch/powerpc/configs/44x/sequoia_defconfig111
-rw-r--r--arch/powerpc/configs/44x/taishan_defconfig2
-rw-r--r--arch/powerpc/configs/44x/virtex5_defconfig2
-rw-r--r--arch/powerpc/configs/ppc6xx_defconfig2
-rw-r--r--arch/powerpc/include/asm/8253pit.h7
-rw-r--r--arch/powerpc/include/asm/atomic.h3
-rw-r--r--arch/powerpc/include/asm/cpm2.h4
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h11
-rw-r--r--arch/powerpc/include/asm/elf.h4
-rw-r--r--arch/powerpc/include/asm/emulated_ops.h73
-rw-r--r--arch/powerpc/include/asm/feature-fixups.h25
-rw-r--r--arch/powerpc/include/asm/hw_irq.h5
-rw-r--r--arch/powerpc/include/asm/iommu.h10
-rw-r--r--arch/powerpc/include/asm/lppaca.h6
-rw-r--r--arch/powerpc/include/asm/machdep.h4
-rw-r--r--arch/powerpc/include/asm/mmu.h9
-rw-r--r--arch/powerpc/include/asm/mpc86xx.h33
-rw-r--r--arch/powerpc/include/asm/paca.h12
-rw-r--r--arch/powerpc/include/asm/page.h5
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h13
-rw-r--r--arch/powerpc/include/asm/pgtable-ppc64.h5
-rw-r--r--arch/powerpc/include/asm/ppc-opcode.h25
-rw-r--r--arch/powerpc/include/asm/ppc_asm.h10
-rw-r--r--arch/powerpc/include/asm/ps3.h18
-rw-r--r--arch/powerpc/include/asm/ps3gpu.h86
-rw-r--r--arch/powerpc/include/asm/ptrace.h4
-rw-r--r--arch/powerpc/include/asm/qe.h23
-rw-r--r--arch/powerpc/include/asm/reg.h4
-rw-r--r--arch/powerpc/include/asm/scatterlist.h6
-rw-r--r--arch/powerpc/include/asm/swiotlb.h27
-rw-r--r--arch/powerpc/include/asm/systbl.h1
-rw-r--r--arch/powerpc/include/asm/system.h2
-rw-r--r--arch/powerpc/include/asm/unistd.h3
-rw-r--r--arch/powerpc/include/asm/xilinx_pci.h21
-rw-r--r--arch/powerpc/kernel/Makefile6
-rw-r--r--arch/powerpc/kernel/align.c20
-rw-r--r--arch/powerpc/kernel/asm-offsets.c32
-rw-r--r--arch/powerpc/kernel/cputable.c6
-rw-r--r--arch/powerpc/kernel/dma-swiotlb.c163
-rw-r--r--arch/powerpc/kernel/dma.c2
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S978
-rw-r--r--arch/powerpc/kernel/ftrace.c29
-rw-r--r--arch/powerpc/kernel/head_32.S101
-rw-r--r--arch/powerpc/kernel/head_64.S1095
-rw-r--r--arch/powerpc/kernel/head_booke.h10
-rw-r--r--arch/powerpc/kernel/init_task.c4
-rw-r--r--arch/powerpc/kernel/irq.c123
-rw-r--r--arch/powerpc/kernel/lparcfg.c40
-rw-r--r--arch/powerpc/kernel/misc_64.S92
-rw-r--r--arch/powerpc/kernel/paca.c14
-rw-r--r--arch/powerpc/kernel/pci-common.c3
-rw-r--r--arch/powerpc/kernel/pci_32.c19
-rw-r--r--arch/powerpc/kernel/pci_64.c17
-rw-r--r--arch/powerpc/kernel/pci_dn.c28
-rw-r--r--arch/powerpc/kernel/process.c2
-rw-r--r--arch/powerpc/kernel/prom.c2
-rw-r--r--arch/powerpc/kernel/prom_init.c3
-rw-r--r--arch/powerpc/kernel/ptrace.c23
-rw-r--r--arch/powerpc/kernel/rtas_pci.c10
-rw-r--r--arch/powerpc/kernel/setup_32.c6
-rw-r--r--arch/powerpc/kernel/setup_64.c15
-rw-r--r--arch/powerpc/kernel/time.c31
-rw-r--r--arch/powerpc/kernel/traps.c130
-rw-r--r--arch/powerpc/kernel/vector.S210
-rw-r--r--arch/powerpc/mm/Makefile7
-rw-r--r--arch/powerpc/mm/hash_native_64.c13
-rw-r--r--arch/powerpc/mm/init_64.c2
-rw-r--r--arch/powerpc/mm/mmu_context_nohash.c19
-rw-r--r--arch/powerpc/mm/numa.c2
-rw-r--r--arch/powerpc/oprofile/op_model_fsl_emb.c14
-rw-r--r--arch/powerpc/platforms/40x/Kconfig2
-rw-r--r--arch/powerpc/platforms/40x/Makefile2
-rw-r--r--arch/powerpc/platforms/40x/kilauea.c60
-rw-r--r--arch/powerpc/platforms/40x/makalu.c60
-rw-r--r--arch/powerpc/platforms/40x/ppc40x_simple.c5
-rw-r--r--arch/powerpc/platforms/40x/virtex.c2
-rw-r--r--arch/powerpc/platforms/44x/Kconfig13
-rw-r--r--arch/powerpc/platforms/44x/Makefile1
-rw-r--r--arch/powerpc/platforms/44x/virtex.c2
-rw-r--r--arch/powerpc/platforms/44x/virtex_ml510.c29
-rw-r--r--arch/powerpc/platforms/44x/warp.c76
-rw-r--r--arch/powerpc/platforms/52xx/efika.c4
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pci.c4
-rw-r--r--arch/powerpc/platforms/82xx/ep8248e.c9
-rw-r--r--arch/powerpc/platforms/82xx/pq2ads.h13
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c43
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c52
-rw-r--r--arch/powerpc/platforms/86xx/gef_ppc9a.c1
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc310.c1
-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/mpc86xx_smp.c8
-rw-r--r--arch/powerpc/platforms/86xx/sbc8641d.c1
-rw-r--r--arch/powerpc/platforms/8xx/mpc885ads.h4
-rw-r--r--arch/powerpc/platforms/Kconfig4
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype26
-rw-r--r--arch/powerpc/platforms/cell/axon_msi.c4
-rw-r--r--arch/powerpc/platforms/cell/celleb_pci.c10
-rw-r--r--arch/powerpc/platforms/cell/celleb_scc_epci.c13
-rw-r--r--arch/powerpc/platforms/cell/celleb_scc_pciex.c12
-rw-r--r--arch/powerpc/platforms/cell/iommu.c37
-rw-r--r--arch/powerpc/platforms/cell/ras.c4
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c11
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c6
-rw-r--r--arch/powerpc/platforms/chrp/pci.c8
-rw-r--r--arch/powerpc/platforms/fsl_uli1575.c24
-rw-r--r--arch/powerpc/platforms/iseries/dt.c3
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c2
-rw-r--r--arch/powerpc/platforms/iseries/mf.c3
-rw-r--r--arch/powerpc/platforms/iseries/pci.c8
-rw-r--r--arch/powerpc/platforms/pasemi/gpio_mdio.c32
-rw-r--r--arch/powerpc/platforms/powermac/pic.c2
-rw-r--r--arch/powerpc/platforms/powermac/setup.c2
-rw-r--r--arch/powerpc/platforms/ps3/mm.c12
-rw-r--r--arch/powerpc/platforms/ps3/os-area.c142
-rw-r--r--arch/powerpc/platforms/ps3/platform.h10
-rw-r--r--arch/powerpc/platforms/ps3/setup.c1
-rw-r--r--arch/powerpc/platforms/ps3/smp.c16
-rw-r--r--arch/powerpc/platforms/ps3/system-bus.c15
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c4
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c52
-rw-r--r--arch/powerpc/platforms/pseries/rtasd.c76
-rw-r--r--arch/powerpc/platforms/pseries/setup.c25
-rw-r--r--arch/powerpc/sysdev/Makefile1
-rw-r--r--arch/powerpc/sysdev/cpm2.c2
-rw-r--r--arch/powerpc/sysdev/fsl_msi.c9
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c138
-rw-r--r--arch/powerpc/sysdev/fsl_pci.h6
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c15
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c14
-rw-r--r--arch/powerpc/sysdev/indirect_pci.c4
-rw-r--r--arch/powerpc/sysdev/mpic.c23
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.c4
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c75
-rw-r--r--arch/powerpc/sysdev/tsi108_pci.c4
-rw-r--r--arch/powerpc/sysdev/xilinx_intc.c81
-rw-r--r--arch/powerpc/sysdev/xilinx_pci.c132
-rw-r--r--arch/powerpc/xmon/xmon.c47
-rw-r--r--arch/s390/Kconfig9
-rw-r--r--arch/s390/Makefile4
-rw-r--r--arch/s390/appldata/appldata_base.c119
-rw-r--r--arch/s390/include/asm/ccwdev.h19
-rw-r--r--arch/s390/include/asm/ccwgroup.h10
-rw-r--r--arch/s390/include/asm/kmap_types.h17
-rw-r--r--arch/s390/include/asm/suspend.h10
-rw-r--r--arch/s390/include/asm/system.h22
-rw-r--r--arch/s390/kernel/early.c6
-rw-r--r--arch/s390/kernel/init_task.c4
-rw-r--r--arch/s390/kernel/mem_detect.c19
-rw-r--r--arch/s390/kernel/smp.c38
-rw-r--r--arch/s390/mm/pgtable.c19
-rw-r--r--arch/s390/power/Makefile8
-rw-r--r--arch/s390/power/suspend.c40
-rw-r--r--arch/s390/power/swsusp.c30
-rw-r--r--arch/s390/power/swsusp_64.c17
-rw-r--r--arch/s390/power/swsusp_asm64.S199
-rw-r--r--arch/sh/include/asm/kmap_types.h24
-rw-r--r--arch/sh/kernel/init_task.c3
-rw-r--r--arch/sparc/Kconfig5
-rw-r--r--arch/sparc/configs/sparc64_defconfig63
-rw-r--r--arch/sparc/include/asm/cpudata_64.h197
-rw-r--r--arch/sparc/include/asm/dma-mapping.h168
-rw-r--r--arch/sparc/include/asm/dma-mapping_32.h60
-rw-r--r--arch/sparc/include/asm/dma-mapping_64.h154
-rw-r--r--arch/sparc/include/asm/errno.h2
-rw-r--r--arch/sparc/include/asm/ftrace.h11
-rw-r--r--arch/sparc/include/asm/kmap_types.h17
-rw-r--r--arch/sparc/include/asm/mdesc.h3
-rw-r--r--arch/sparc/include/asm/percpu_64.h8
-rw-r--r--arch/sparc/include/asm/prom.h2
-rw-r--r--arch/sparc/include/asm/trap_block.h207
-rw-r--r--arch/sparc/include/asm/unistd.h3
-rw-r--r--arch/sparc/kernel/Makefile2
-rw-r--r--arch/sparc/kernel/cpumap.c431
-rw-r--r--arch/sparc/kernel/cpumap.h16
-rw-r--r--arch/sparc/kernel/dma.c127
-rw-r--r--arch/sparc/kernel/ds.c3
-rw-r--r--arch/sparc/kernel/ftrace.c47
-rw-r--r--arch/sparc/kernel/head_64.S22
-rw-r--r--arch/sparc/kernel/init_task.c3
-rw-r--r--arch/sparc/kernel/iommu.c15
-rw-r--r--arch/sparc/kernel/irq_64.c29
-rw-r--r--arch/sparc/kernel/mdesc.c149
-rw-r--r--arch/sparc/kernel/of_device_32.c195
-rw-r--r--arch/sparc/kernel/of_device_64.c188
-rw-r--r--arch/sparc/kernel/of_device_common.c174
-rw-r--r--arch/sparc/kernel/of_device_common.h36
-rw-r--r--arch/sparc/kernel/pci_sun4v.c15
-rw-r--r--arch/sparc/kernel/prom.h1
-rw-r--r--arch/sparc/kernel/prom_64.c232
-rw-r--r--arch/sparc/kernel/prom_common.c2
-rw-r--r--arch/sparc/kernel/smp_64.c196
-rw-r--r--arch/sparc/kernel/systbls_32.S4
-rw-r--r--arch/sparc/kernel/systbls_64.S6
-rw-r--r--arch/sparc/kernel/traps_64.c170
-rw-r--r--arch/sparc/mm/init_32.c1
-rw-r--r--arch/sparc/mm/init_64.c16
-rw-r--r--arch/sparc/mm/srmmu.c3
-rw-r--r--arch/um/drivers/net_kern.c4
-rw-r--r--arch/um/drivers/ubd_kern.c4
-rw-r--r--arch/um/include/shared/init.h2
-rw-r--r--arch/um/include/shared/net_user.h2
-rw-r--r--arch/um/kernel/init_task.c3
-rw-r--r--arch/um/kernel/irq.c6
-rw-r--r--arch/um/sys-i386/stub.S2
-rw-r--r--arch/um/sys-x86_64/asm/elf.h44
-rw-r--r--arch/um/sys-x86_64/stub.S2
-rw-r--r--arch/x86/Kconfig1
-rw-r--r--arch/x86/Makefile5
-rw-r--r--arch/x86/include/asm/dma-mapping.h7
-rw-r--r--arch/x86/include/asm/kmap_types.h23
-rw-r--r--arch/x86/include/asm/kmemcheck.h42
-rw-r--r--arch/x86/include/asm/pgtable.h5
-rw-r--r--arch/x86/include/asm/pgtable_types.h9
-rw-r--r--arch/x86/include/asm/string_32.h8
-rw-r--r--arch/x86/include/asm/string_64.h8
-rw-r--r--arch/x86/include/asm/thread_info.h4
-rw-r--r--arch/x86/include/asm/timex.h4
-rw-r--r--arch/x86/include/asm/xor.h5
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c2
-rw-r--r--arch/x86/kernel/cpu/common.c11
-rw-r--r--arch/x86/kernel/cpu/intel.c23
-rw-r--r--arch/x86/kernel/cpuid.c6
-rw-r--r--arch/x86/kernel/i8253.c1
-rw-r--r--arch/x86/kernel/init_task.c1
-rw-r--r--arch/x86/kernel/microcode_core.c1
-rw-r--r--arch/x86/kernel/msr.c6
-rw-r--r--arch/x86/kernel/process.c2
-rw-r--r--arch/x86/kernel/stacktrace.c7
-rw-r--r--arch/x86/kernel/traps.c5
-rw-r--r--arch/x86/kernel/tsc.c1
-rw-r--r--arch/x86/kvm/vmx.c2
-rw-r--r--arch/x86/mm/Makefile2
-rw-r--r--arch/x86/mm/fault.c18
-rw-r--r--arch/x86/mm/init.c2
-rw-r--r--arch/x86/mm/init_32.c2
-rw-r--r--arch/x86/mm/init_64.c4
-rw-r--r--arch/x86/mm/kmemcheck/Makefile1
-rw-r--r--arch/x86/mm/kmemcheck/error.c228
-rw-r--r--arch/x86/mm/kmemcheck/error.h15
-rw-r--r--arch/x86/mm/kmemcheck/kmemcheck.c640
-rw-r--r--arch/x86/mm/kmemcheck/opcode.c106
-rw-r--r--arch/x86/mm/kmemcheck/opcode.h9
-rw-r--r--arch/x86/mm/kmemcheck/pte.c22
-rw-r--r--arch/x86/mm/kmemcheck/pte.h10
-rw-r--r--arch/x86/mm/kmemcheck/selftest.c69
-rw-r--r--arch/x86/mm/kmemcheck/selftest.h6
-rw-r--r--arch/x86/mm/kmemcheck/shadow.c162
-rw-r--r--arch/x86/mm/kmemcheck/shadow.h16
-rw-r--r--arch/x86/mm/pageattr.c2
-rw-r--r--arch/x86/mm/pgtable.c12
-rw-r--r--arch/xtensa/include/asm/kmap_types.h27
-rw-r--r--arch/xtensa/kernel/init_task.c4
551 files changed, 25827 insertions, 5536 deletions
diff --git a/arch/alpha/include/asm/8253pit.h b/arch/alpha/include/asm/8253pit.h
index fef5c1450e47..a71c9c1455a7 100644
--- a/arch/alpha/include/asm/8253pit.h
+++ b/arch/alpha/include/asm/8253pit.h
@@ -1,10 +1,3 @@
1/* 1/*
2 * 8253/8254 Programmable Interval Timer 2 * 8253/8254 Programmable Interval Timer
3 */ 3 */
4
5#ifndef _8253PIT_H
6#define _8253PIT_H
7
8#define PIT_TICK_RATE 1193180UL
9
10#endif
diff --git a/arch/alpha/include/asm/errno.h b/arch/alpha/include/asm/errno.h
index 69e2655249d2..98099bda9370 100644
--- a/arch/alpha/include/asm/errno.h
+++ b/arch/alpha/include/asm/errno.h
@@ -120,4 +120,6 @@
120#define EOWNERDEAD 136 /* Owner died */ 120#define EOWNERDEAD 136 /* Owner died */
121#define ENOTRECOVERABLE 137 /* State not recoverable */ 121#define ENOTRECOVERABLE 137 /* State not recoverable */
122 122
123#define ERFKILL 138 /* Operation not possible due to RF-kill */
124
123#endif 125#endif
diff --git a/arch/alpha/include/asm/kmap_types.h b/arch/alpha/include/asm/kmap_types.h
index 3e6735a34c57..a8d4ec8ea4b6 100644
--- a/arch/alpha/include/asm/kmap_types.h
+++ b/arch/alpha/include/asm/kmap_types.h
@@ -3,30 +3,12 @@
3 3
4/* Dummy header just to define km_type. */ 4/* Dummy header just to define km_type. */
5 5
6
7#ifdef CONFIG_DEBUG_HIGHMEM 6#ifdef CONFIG_DEBUG_HIGHMEM
8# define D(n) __KM_FENCE_##n , 7#define __WITH_KM_FENCE
9#else
10# define D(n)
11#endif 8#endif
12 9
13enum km_type { 10#include <asm-generic/kmap_types.h>
14D(0) KM_BOUNCE_READ,
15D(1) KM_SKB_SUNRPC_DATA,
16D(2) KM_SKB_DATA_SOFTIRQ,
17D(3) KM_USER0,
18D(4) KM_USER1,
19D(5) KM_BIO_SRC_IRQ,
20D(6) KM_BIO_DST_IRQ,
21D(7) KM_PTE0,
22D(8) KM_PTE1,
23D(9) KM_IRQ0,
24D(10) KM_IRQ1,
25D(11) KM_SOFTIRQ0,
26D(12) KM_SOFTIRQ1,
27D(13) KM_TYPE_NR
28};
29 11
30#undef D 12#undef __WITH_KM_FENCE
31 13
32#endif 14#endif
diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c
index c2938e574a40..19b86328ffd7 100644
--- a/arch/alpha/kernel/init_task.c
+++ b/arch/alpha/kernel/init_task.c
@@ -10,10 +10,7 @@
10 10
11static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 11static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
12static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 12static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
13struct mm_struct init_mm = INIT_MM(init_mm);
14struct task_struct init_task = INIT_TASK(init_task); 13struct task_struct init_task = INIT_TASK(init_task);
15
16EXPORT_SYMBOL(init_mm);
17EXPORT_SYMBOL(init_task); 14EXPORT_SYMBOL(init_task);
18 15
19union thread_union init_thread_union 16union thread_union init_thread_union
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index 67c19f8a9944..38c805dfc544 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -227,7 +227,7 @@ struct irqaction timer_irqaction = {
227 .name = "timer", 227 .name = "timer",
228}; 228};
229 229
230static struct hw_interrupt_type rtc_irq_type = { 230static struct irq_chip rtc_irq_type = {
231 .typename = "RTC", 231 .typename = "RTC",
232 .startup = rtc_startup, 232 .startup = rtc_startup,
233 .shutdown = rtc_enable_disable, 233 .shutdown = rtc_enable_disable,
diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c
index 9405bee9894e..50bfec9b588f 100644
--- a/arch/alpha/kernel/irq_i8259.c
+++ b/arch/alpha/kernel/irq_i8259.c
@@ -83,7 +83,7 @@ i8259a_end_irq(unsigned int irq)
83 i8259a_enable_irq(irq); 83 i8259a_enable_irq(irq);
84} 84}
85 85
86struct hw_interrupt_type i8259a_irq_type = { 86struct irq_chip i8259a_irq_type = {
87 .typename = "XT-PIC", 87 .typename = "XT-PIC",
88 .startup = i8259a_startup_irq, 88 .startup = i8259a_startup_irq,
89 .shutdown = i8259a_disable_irq, 89 .shutdown = i8259a_disable_irq,
diff --git a/arch/alpha/kernel/irq_impl.h b/arch/alpha/kernel/irq_impl.h
index cc9a8a7aa279..b63ccd7386f1 100644
--- a/arch/alpha/kernel/irq_impl.h
+++ b/arch/alpha/kernel/irq_impl.h
@@ -36,7 +36,7 @@ extern void i8259a_disable_irq(unsigned int);
36extern void i8259a_mask_and_ack_irq(unsigned int); 36extern void i8259a_mask_and_ack_irq(unsigned int);
37extern unsigned int i8259a_startup_irq(unsigned int); 37extern unsigned int i8259a_startup_irq(unsigned int);
38extern void i8259a_end_irq(unsigned int); 38extern void i8259a_end_irq(unsigned int);
39extern struct hw_interrupt_type i8259a_irq_type; 39extern struct irq_chip i8259a_irq_type;
40extern void init_i8259a_irqs(void); 40extern void init_i8259a_irqs(void);
41 41
42extern void handle_irq(int irq); 42extern void handle_irq(int irq);
diff --git a/arch/alpha/kernel/irq_pyxis.c b/arch/alpha/kernel/irq_pyxis.c
index d53edbccbfe5..69199a76ec4a 100644
--- a/arch/alpha/kernel/irq_pyxis.c
+++ b/arch/alpha/kernel/irq_pyxis.c
@@ -70,7 +70,7 @@ pyxis_mask_and_ack_irq(unsigned int irq)
70 *(vulp)PYXIS_INT_MASK; 70 *(vulp)PYXIS_INT_MASK;
71} 71}
72 72
73static struct hw_interrupt_type pyxis_irq_type = { 73static struct irq_chip pyxis_irq_type = {
74 .typename = "PYXIS", 74 .typename = "PYXIS",
75 .startup = pyxis_startup_irq, 75 .startup = pyxis_startup_irq,
76 .shutdown = pyxis_disable_irq, 76 .shutdown = pyxis_disable_irq,
diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c
index a03fbca4940e..85229369a1f8 100644
--- a/arch/alpha/kernel/irq_srm.c
+++ b/arch/alpha/kernel/irq_srm.c
@@ -48,7 +48,7 @@ srm_end_irq(unsigned int irq)
48} 48}
49 49
50/* Handle interrupts from the SRM, assuming no additional weirdness. */ 50/* Handle interrupts from the SRM, assuming no additional weirdness. */
51static struct hw_interrupt_type srm_irq_type = { 51static struct irq_chip srm_irq_type = {
52 .typename = "SRM", 52 .typename = "SRM",
53 .startup = srm_startup_irq, 53 .startup = srm_startup_irq,
54 .shutdown = srm_disable_irq, 54 .shutdown = srm_disable_irq,
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index 80df86cd746b..d2634e4476b4 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -252,9 +252,9 @@ reserve_std_resources(void)
252} 252}
253 253
254#define PFN_MAX PFN_DOWN(0x80000000) 254#define PFN_MAX PFN_DOWN(0x80000000)
255#define for_each_mem_cluster(memdesc, cluster, i) \ 255#define for_each_mem_cluster(memdesc, _cluster, i) \
256 for ((cluster) = (memdesc)->cluster, (i) = 0; \ 256 for ((_cluster) = (memdesc)->cluster, (i) = 0; \
257 (i) < (memdesc)->numclusters; (i)++, (cluster)++) 257 (i) < (memdesc)->numclusters; (i)++, (_cluster)++)
258 258
259static unsigned long __init 259static unsigned long __init
260get_mem_size_limit(char *s) 260get_mem_size_limit(char *s)
diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c
index e53a1e1c2f21..382035ef7394 100644
--- a/arch/alpha/kernel/sys_alcor.c
+++ b/arch/alpha/kernel/sys_alcor.c
@@ -89,7 +89,7 @@ alcor_end_irq(unsigned int irq)
89 alcor_enable_irq(irq); 89 alcor_enable_irq(irq);
90} 90}
91 91
92static struct hw_interrupt_type alcor_irq_type = { 92static struct irq_chip alcor_irq_type = {
93 .typename = "ALCOR", 93 .typename = "ALCOR",
94 .startup = alcor_startup_irq, 94 .startup = alcor_startup_irq,
95 .shutdown = alcor_disable_irq, 95 .shutdown = alcor_disable_irq,
diff --git a/arch/alpha/kernel/sys_cabriolet.c b/arch/alpha/kernel/sys_cabriolet.c
index ace475c124f6..ed349436732b 100644
--- a/arch/alpha/kernel/sys_cabriolet.c
+++ b/arch/alpha/kernel/sys_cabriolet.c
@@ -71,7 +71,7 @@ cabriolet_end_irq(unsigned int irq)
71 cabriolet_enable_irq(irq); 71 cabriolet_enable_irq(irq);
72} 72}
73 73
74static struct hw_interrupt_type cabriolet_irq_type = { 74static struct irq_chip cabriolet_irq_type = {
75 .typename = "CABRIOLET", 75 .typename = "CABRIOLET",
76 .startup = cabriolet_startup_irq, 76 .startup = cabriolet_startup_irq,
77 .shutdown = cabriolet_disable_irq, 77 .shutdown = cabriolet_disable_irq,
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index 5bd5259324b7..46e70ece5176 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -198,7 +198,7 @@ clipper_set_affinity(unsigned int irq, const struct cpumask *affinity)
198 return 0; 198 return 0;
199} 199}
200 200
201static struct hw_interrupt_type dp264_irq_type = { 201static struct irq_chip dp264_irq_type = {
202 .typename = "DP264", 202 .typename = "DP264",
203 .startup = dp264_startup_irq, 203 .startup = dp264_startup_irq,
204 .shutdown = dp264_disable_irq, 204 .shutdown = dp264_disable_irq,
@@ -209,7 +209,7 @@ static struct hw_interrupt_type dp264_irq_type = {
209 .set_affinity = dp264_set_affinity, 209 .set_affinity = dp264_set_affinity,
210}; 210};
211 211
212static struct hw_interrupt_type clipper_irq_type = { 212static struct irq_chip clipper_irq_type = {
213 .typename = "CLIPPER", 213 .typename = "CLIPPER",
214 .startup = clipper_startup_irq, 214 .startup = clipper_startup_irq,
215 .shutdown = clipper_disable_irq, 215 .shutdown = clipper_disable_irq,
@@ -298,7 +298,7 @@ clipper_srm_device_interrupt(unsigned long vector)
298} 298}
299 299
300static void __init 300static void __init
301init_tsunami_irqs(struct hw_interrupt_type * ops, int imin, int imax) 301init_tsunami_irqs(struct irq_chip * ops, int imin, int imax)
302{ 302{
303 long i; 303 long i;
304 for (i = imin; i <= imax; ++i) { 304 for (i = imin; i <= imax; ++i) {
diff --git a/arch/alpha/kernel/sys_eb64p.c b/arch/alpha/kernel/sys_eb64p.c
index 9c5a306dc0ee..660c23ef661f 100644
--- a/arch/alpha/kernel/sys_eb64p.c
+++ b/arch/alpha/kernel/sys_eb64p.c
@@ -69,7 +69,7 @@ eb64p_end_irq(unsigned int irq)
69 eb64p_enable_irq(irq); 69 eb64p_enable_irq(irq);
70} 70}
71 71
72static struct hw_interrupt_type eb64p_irq_type = { 72static struct irq_chip eb64p_irq_type = {
73 .typename = "EB64P", 73 .typename = "EB64P",
74 .startup = eb64p_startup_irq, 74 .startup = eb64p_startup_irq,
75 .shutdown = eb64p_disable_irq, 75 .shutdown = eb64p_disable_irq,
diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c
index baf60f36cbd7..b99ea488d844 100644
--- a/arch/alpha/kernel/sys_eiger.c
+++ b/arch/alpha/kernel/sys_eiger.c
@@ -80,7 +80,7 @@ eiger_end_irq(unsigned int irq)
80 eiger_enable_irq(irq); 80 eiger_enable_irq(irq);
81} 81}
82 82
83static struct hw_interrupt_type eiger_irq_type = { 83static struct irq_chip eiger_irq_type = {
84 .typename = "EIGER", 84 .typename = "EIGER",
85 .startup = eiger_startup_irq, 85 .startup = eiger_startup_irq,
86 .shutdown = eiger_disable_irq, 86 .shutdown = eiger_disable_irq,
diff --git a/arch/alpha/kernel/sys_jensen.c b/arch/alpha/kernel/sys_jensen.c
index 2b5caf3d9b15..ef0b83a070ac 100644
--- a/arch/alpha/kernel/sys_jensen.c
+++ b/arch/alpha/kernel/sys_jensen.c
@@ -118,7 +118,7 @@ jensen_local_end(unsigned int irq)
118 i8259a_end_irq(1); 118 i8259a_end_irq(1);
119} 119}
120 120
121static struct hw_interrupt_type jensen_local_irq_type = { 121static struct irq_chip jensen_local_irq_type = {
122 .typename = "LOCAL", 122 .typename = "LOCAL",
123 .startup = jensen_local_startup, 123 .startup = jensen_local_startup,
124 .shutdown = jensen_local_shutdown, 124 .shutdown = jensen_local_shutdown,
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index c5a1a2438c67..bbfc4f20ca72 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -169,7 +169,7 @@ marvel_irq_noop_return(unsigned int irq)
169 return 0; 169 return 0;
170} 170}
171 171
172static struct hw_interrupt_type marvel_legacy_irq_type = { 172static struct irq_chip marvel_legacy_irq_type = {
173 .typename = "LEGACY", 173 .typename = "LEGACY",
174 .startup = marvel_irq_noop_return, 174 .startup = marvel_irq_noop_return,
175 .shutdown = marvel_irq_noop, 175 .shutdown = marvel_irq_noop,
@@ -179,7 +179,7 @@ static struct hw_interrupt_type marvel_legacy_irq_type = {
179 .end = marvel_irq_noop, 179 .end = marvel_irq_noop,
180}; 180};
181 181
182static struct hw_interrupt_type io7_lsi_irq_type = { 182static struct irq_chip io7_lsi_irq_type = {
183 .typename = "LSI", 183 .typename = "LSI",
184 .startup = io7_startup_irq, 184 .startup = io7_startup_irq,
185 .shutdown = io7_disable_irq, 185 .shutdown = io7_disable_irq,
@@ -189,7 +189,7 @@ static struct hw_interrupt_type io7_lsi_irq_type = {
189 .end = io7_end_irq, 189 .end = io7_end_irq,
190}; 190};
191 191
192static struct hw_interrupt_type io7_msi_irq_type = { 192static struct irq_chip io7_msi_irq_type = {
193 .typename = "MSI", 193 .typename = "MSI",
194 .startup = io7_startup_irq, 194 .startup = io7_startup_irq,
195 .shutdown = io7_disable_irq, 195 .shutdown = io7_disable_irq,
@@ -273,8 +273,8 @@ init_one_io7_msi(struct io7 *io7, unsigned int which, unsigned int where)
273 273
274static void __init 274static void __init
275init_io7_irqs(struct io7 *io7, 275init_io7_irqs(struct io7 *io7,
276 struct hw_interrupt_type *lsi_ops, 276 struct irq_chip *lsi_ops,
277 struct hw_interrupt_type *msi_ops) 277 struct irq_chip *msi_ops)
278{ 278{
279 long base = (io7->pe << MARVEL_IRQ_VEC_PE_SHIFT) + 16; 279 long base = (io7->pe << MARVEL_IRQ_VEC_PE_SHIFT) + 16;
280 long i; 280 long i;
diff --git a/arch/alpha/kernel/sys_mikasa.c b/arch/alpha/kernel/sys_mikasa.c
index 8d3e9429c5ee..4e366641a08e 100644
--- a/arch/alpha/kernel/sys_mikasa.c
+++ b/arch/alpha/kernel/sys_mikasa.c
@@ -68,7 +68,7 @@ mikasa_end_irq(unsigned int irq)
68 mikasa_enable_irq(irq); 68 mikasa_enable_irq(irq);
69} 69}
70 70
71static struct hw_interrupt_type mikasa_irq_type = { 71static struct irq_chip mikasa_irq_type = {
72 .typename = "MIKASA", 72 .typename = "MIKASA",
73 .startup = mikasa_startup_irq, 73 .startup = mikasa_startup_irq,
74 .shutdown = mikasa_disable_irq, 74 .shutdown = mikasa_disable_irq,
diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c
index 538876b62449..35753a173bac 100644
--- a/arch/alpha/kernel/sys_noritake.c
+++ b/arch/alpha/kernel/sys_noritake.c
@@ -73,7 +73,7 @@ noritake_end_irq(unsigned int irq)
73 noritake_enable_irq(irq); 73 noritake_enable_irq(irq);
74} 74}
75 75
76static struct hw_interrupt_type noritake_irq_type = { 76static struct irq_chip noritake_irq_type = {
77 .typename = "NORITAKE", 77 .typename = "NORITAKE",
78 .startup = noritake_startup_irq, 78 .startup = noritake_startup_irq,
79 .shutdown = noritake_disable_irq, 79 .shutdown = noritake_disable_irq,
diff --git a/arch/alpha/kernel/sys_rawhide.c b/arch/alpha/kernel/sys_rawhide.c
index 672cb2df53df..f3aec7e085c8 100644
--- a/arch/alpha/kernel/sys_rawhide.c
+++ b/arch/alpha/kernel/sys_rawhide.c
@@ -135,7 +135,7 @@ rawhide_end_irq(unsigned int irq)
135 rawhide_enable_irq(irq); 135 rawhide_enable_irq(irq);
136} 136}
137 137
138static struct hw_interrupt_type rawhide_irq_type = { 138static struct irq_chip rawhide_irq_type = {
139 .typename = "RAWHIDE", 139 .typename = "RAWHIDE",
140 .startup = rawhide_startup_irq, 140 .startup = rawhide_startup_irq,
141 .shutdown = rawhide_disable_irq, 141 .shutdown = rawhide_disable_irq,
diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c
index f15a329b6011..d9f9cfeb9931 100644
--- a/arch/alpha/kernel/sys_ruffian.c
+++ b/arch/alpha/kernel/sys_ruffian.c
@@ -14,6 +14,7 @@
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <linux/ioport.h> 16#include <linux/ioport.h>
17#include <linux/timex.h>
17#include <linux/init.h> 18#include <linux/init.h>
18 19
19#include <asm/ptrace.h> 20#include <asm/ptrace.h>
diff --git a/arch/alpha/kernel/sys_rx164.c b/arch/alpha/kernel/sys_rx164.c
index ce1faa6f1df1..fc9246373452 100644
--- a/arch/alpha/kernel/sys_rx164.c
+++ b/arch/alpha/kernel/sys_rx164.c
@@ -72,7 +72,7 @@ rx164_end_irq(unsigned int irq)
72 rx164_enable_irq(irq); 72 rx164_enable_irq(irq);
73} 73}
74 74
75static struct hw_interrupt_type rx164_irq_type = { 75static struct irq_chip rx164_irq_type = {
76 .typename = "RX164", 76 .typename = "RX164",
77 .startup = rx164_startup_irq, 77 .startup = rx164_startup_irq,
78 .shutdown = rx164_disable_irq, 78 .shutdown = rx164_disable_irq,
diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c
index 9e263256a42d..426eb6906d01 100644
--- a/arch/alpha/kernel/sys_sable.c
+++ b/arch/alpha/kernel/sys_sable.c
@@ -501,7 +501,7 @@ sable_lynx_mask_and_ack_irq(unsigned int irq)
501 spin_unlock(&sable_lynx_irq_lock); 501 spin_unlock(&sable_lynx_irq_lock);
502} 502}
503 503
504static struct hw_interrupt_type sable_lynx_irq_type = { 504static struct irq_chip sable_lynx_irq_type = {
505 .typename = "SABLE/LYNX", 505 .typename = "SABLE/LYNX",
506 .startup = sable_lynx_startup_irq, 506 .startup = sable_lynx_startup_irq,
507 .shutdown = sable_lynx_disable_irq, 507 .shutdown = sable_lynx_disable_irq,
diff --git a/arch/alpha/kernel/sys_takara.c b/arch/alpha/kernel/sys_takara.c
index 9bd9a31450c6..830318c21661 100644
--- a/arch/alpha/kernel/sys_takara.c
+++ b/arch/alpha/kernel/sys_takara.c
@@ -74,7 +74,7 @@ takara_end_irq(unsigned int irq)
74 takara_enable_irq(irq); 74 takara_enable_irq(irq);
75} 75}
76 76
77static struct hw_interrupt_type takara_irq_type = { 77static struct irq_chip takara_irq_type = {
78 .typename = "TAKARA", 78 .typename = "TAKARA",
79 .startup = takara_startup_irq, 79 .startup = takara_startup_irq,
80 .shutdown = takara_disable_irq, 80 .shutdown = takara_disable_irq,
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index 8dd239ebdb9e..88978fc60f83 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -185,7 +185,7 @@ titan_srm_device_interrupt(unsigned long vector)
185 185
186 186
187static void __init 187static void __init
188init_titan_irqs(struct hw_interrupt_type * ops, int imin, int imax) 188init_titan_irqs(struct irq_chip * ops, int imin, int imax)
189{ 189{
190 long i; 190 long i;
191 for (i = imin; i <= imax; ++i) { 191 for (i = imin; i <= imax; ++i) {
@@ -194,7 +194,7 @@ init_titan_irqs(struct hw_interrupt_type * ops, int imin, int imax)
194 } 194 }
195} 195}
196 196
197static struct hw_interrupt_type titan_irq_type = { 197static struct irq_chip titan_irq_type = {
198 .typename = "TITAN", 198 .typename = "TITAN",
199 .startup = titan_startup_irq, 199 .startup = titan_startup_irq,
200 .shutdown = titan_disable_irq, 200 .shutdown = titan_disable_irq,
diff --git a/arch/alpha/kernel/sys_wildfire.c b/arch/alpha/kernel/sys_wildfire.c
index 42c3eede4d09..e91b4c3838a8 100644
--- a/arch/alpha/kernel/sys_wildfire.c
+++ b/arch/alpha/kernel/sys_wildfire.c
@@ -157,7 +157,7 @@ wildfire_end_irq(unsigned int irq)
157 wildfire_enable_irq(irq); 157 wildfire_enable_irq(irq);
158} 158}
159 159
160static struct hw_interrupt_type wildfire_irq_type = { 160static struct irq_chip wildfire_irq_type = {
161 .typename = "WILDFIRE", 161 .typename = "WILDFIRE",
162 .startup = wildfire_startup_irq, 162 .startup = wildfire_startup_irq,
163 .shutdown = wildfire_disable_irq, 163 .shutdown = wildfire_disable_irq,
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c
index a13de49d1265..0eab55749423 100644
--- a/arch/alpha/mm/numa.c
+++ b/arch/alpha/mm/numa.c
@@ -28,9 +28,9 @@ EXPORT_SYMBOL(node_data);
28#define DBGDCONT(args...) 28#define DBGDCONT(args...)
29#endif 29#endif
30 30
31#define for_each_mem_cluster(memdesc, cluster, i) \ 31#define for_each_mem_cluster(memdesc, _cluster, i) \
32 for ((cluster) = (memdesc)->cluster, (i) = 0; \ 32 for ((_cluster) = (memdesc)->cluster, (i) = 0; \
33 (i) < (memdesc)->numclusters; (i)++, (cluster)++) 33 (i) < (memdesc)->numclusters; (i)++, (_cluster)++)
34 34
35static void __init show_mem_layout(void) 35static void __init show_mem_layout(void)
36{ 36{
diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
index e859af349467..3f470866bb89 100644
--- a/arch/arm/kernel/init_task.c
+++ b/arch/arm/kernel/init_task.c
@@ -14,10 +14,6 @@
14 14
15static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 15static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
16static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 16static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
17struct mm_struct init_mm = INIT_MM(init_mm);
18
19EXPORT_SYMBOL(init_mm);
20
21/* 17/*
22 * Initial thread structure. 18 * Initial thread structure.
23 * 19 *
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 442b87476f97..93bb4247b7ed 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -536,7 +536,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
536 return err; 536 return err;
537} 537}
538 538
539static inline void restart_syscall(struct pt_regs *regs) 539static inline void setup_syscall_restart(struct pt_regs *regs)
540{ 540{
541 regs->ARM_r0 = regs->ARM_ORIG_r0; 541 regs->ARM_r0 = regs->ARM_ORIG_r0;
542 regs->ARM_pc -= thumb_mode(regs) ? 2 : 4; 542 regs->ARM_pc -= thumb_mode(regs) ? 2 : 4;
@@ -571,7 +571,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
571 } 571 }
572 /* fallthrough */ 572 /* fallthrough */
573 case -ERESTARTNOINTR: 573 case -ERESTARTNOINTR:
574 restart_syscall(regs); 574 setup_syscall_restart(regs);
575 } 575 }
576 } 576 }
577 577
@@ -695,7 +695,7 @@ static int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
695 if (regs->ARM_r0 == -ERESTARTNOHAND || 695 if (regs->ARM_r0 == -ERESTARTNOHAND ||
696 regs->ARM_r0 == -ERESTARTSYS || 696 regs->ARM_r0 == -ERESTARTSYS ||
697 regs->ARM_r0 == -ERESTARTNOINTR) { 697 regs->ARM_r0 == -ERESTARTNOINTR) {
698 restart_syscall(regs); 698 setup_syscall_restart(regs);
699 } 699 }
700 } 700 }
701 single_step_set(current); 701 single_step_set(current);
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 095521e9ee24..01791d74e08e 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -380,12 +380,12 @@ static struct pca953x_platform_data pca9536_data = {
380 .gpio_base = NR_BUILTIN_GPIO, 380 .gpio_base = NR_BUILTIN_GPIO,
381}; 381};
382 382
383static int gpio_bus_switch; 383static int gpio_bus_switch = -EINVAL;
384 384
385static int pcm990_camera_set_bus_param(struct soc_camera_link *link, 385static int pcm990_camera_set_bus_param(struct soc_camera_link *link,
386 unsigned long flags) 386 unsigned long flags)
387{ 387{
388 if (gpio_bus_switch <= 0) { 388 if (gpio_bus_switch < 0) {
389 if (flags == SOCAM_DATAWIDTH_10) 389 if (flags == SOCAM_DATAWIDTH_10)
390 return 0; 390 return 0;
391 else 391 else
@@ -404,25 +404,34 @@ static unsigned long pcm990_camera_query_bus_param(struct soc_camera_link *link)
404{ 404{
405 int ret; 405 int ret;
406 406
407 if (!gpio_bus_switch) { 407 if (gpio_bus_switch < 0) {
408 ret = gpio_request(NR_BUILTIN_GPIO, "camera"); 408 ret = gpio_request(NR_BUILTIN_GPIO, "camera");
409 if (!ret) { 409 if (!ret) {
410 gpio_bus_switch = NR_BUILTIN_GPIO; 410 gpio_bus_switch = NR_BUILTIN_GPIO;
411 gpio_direction_output(gpio_bus_switch, 0); 411 gpio_direction_output(gpio_bus_switch, 0);
412 } else 412 }
413 gpio_bus_switch = -EINVAL;
414 } 413 }
415 414
416 if (gpio_bus_switch > 0) 415 if (gpio_bus_switch >= 0)
417 return SOCAM_DATAWIDTH_8 | SOCAM_DATAWIDTH_10; 416 return SOCAM_DATAWIDTH_8 | SOCAM_DATAWIDTH_10;
418 else 417 else
419 return SOCAM_DATAWIDTH_10; 418 return SOCAM_DATAWIDTH_10;
420} 419}
421 420
421static void pcm990_camera_free_bus(struct soc_camera_link *link)
422{
423 if (gpio_bus_switch < 0)
424 return;
425
426 gpio_free(gpio_bus_switch);
427 gpio_bus_switch = -EINVAL;
428}
429
422static struct soc_camera_link iclink = { 430static struct soc_camera_link iclink = {
423 .bus_id = 0, /* Must match with the camera ID above */ 431 .bus_id = 0, /* Must match with the camera ID above */
424 .query_bus_param = pcm990_camera_query_bus_param, 432 .query_bus_param = pcm990_camera_query_bus_param,
425 .set_bus_param = pcm990_camera_set_bus_param, 433 .set_bus_param = pcm990_camera_set_bus_param,
434 .free_bus = pcm990_camera_free_bus,
426}; 435};
427 436
428/* Board I2C devices. */ 437/* Board I2C devices. */
diff --git a/arch/arm/mach-pxa/tosa-bt.c b/arch/arm/mach-pxa/tosa-bt.c
index fb0294bd4310..c31e601eb49c 100644
--- a/arch/arm/mach-pxa/tosa-bt.c
+++ b/arch/arm/mach-pxa/tosa-bt.c
@@ -35,21 +35,25 @@ static void tosa_bt_off(struct tosa_bt_data *data)
35 gpio_set_value(data->gpio_reset, 0); 35 gpio_set_value(data->gpio_reset, 0);
36} 36}
37 37
38static int tosa_bt_toggle_radio(void *data, enum rfkill_state state) 38static int tosa_bt_set_block(void *data, bool blocked)
39{ 39{
40 pr_info("BT_RADIO going: %s\n", 40 pr_info("BT_RADIO going: %s\n", blocked ? "off" : "on");
41 state == RFKILL_STATE_ON ? "on" : "off");
42 41
43 if (state == RFKILL_STATE_ON) { 42 if (!blocked) {
44 pr_info("TOSA_BT: going ON\n"); 43 pr_info("TOSA_BT: going ON\n");
45 tosa_bt_on(data); 44 tosa_bt_on(data);
46 } else { 45 } else {
47 pr_info("TOSA_BT: going OFF\n"); 46 pr_info("TOSA_BT: going OFF\n");
48 tosa_bt_off(data); 47 tosa_bt_off(data);
49 } 48 }
49
50 return 0; 50 return 0;
51} 51}
52 52
53static const struct rfkill_ops tosa_bt_rfkill_ops = {
54 .set_block = tosa_bt_set_block,
55};
56
53static int tosa_bt_probe(struct platform_device *dev) 57static int tosa_bt_probe(struct platform_device *dev)
54{ 58{
55 int rc; 59 int rc;
@@ -70,18 +74,14 @@ static int tosa_bt_probe(struct platform_device *dev)
70 if (rc) 74 if (rc)
71 goto err_pwr_dir; 75 goto err_pwr_dir;
72 76
73 rfk = rfkill_allocate(&dev->dev, RFKILL_TYPE_BLUETOOTH); 77 rfk = rfkill_alloc("tosa-bt", &dev->dev, RFKILL_TYPE_BLUETOOTH,
78 &tosa_bt_rfkill_ops, data);
74 if (!rfk) { 79 if (!rfk) {
75 rc = -ENOMEM; 80 rc = -ENOMEM;
76 goto err_rfk_alloc; 81 goto err_rfk_alloc;
77 } 82 }
78 83
79 rfk->name = "tosa-bt"; 84 rfkill_set_led_trigger_name(rfk, "tosa-bt");
80 rfk->toggle_radio = tosa_bt_toggle_radio;
81 rfk->data = data;
82#ifdef CONFIG_RFKILL_LEDS
83 rfk->led_trigger.name = "tosa-bt";
84#endif
85 85
86 rc = rfkill_register(rfk); 86 rc = rfkill_register(rfk);
87 if (rc) 87 if (rc)
@@ -92,9 +92,7 @@ static int tosa_bt_probe(struct platform_device *dev)
92 return 0; 92 return 0;
93 93
94err_rfkill: 94err_rfkill:
95 if (rfk) 95 rfkill_destroy(rfk);
96 rfkill_free(rfk);
97 rfk = NULL;
98err_rfk_alloc: 96err_rfk_alloc:
99 tosa_bt_off(data); 97 tosa_bt_off(data);
100err_pwr_dir: 98err_pwr_dir:
@@ -113,8 +111,10 @@ static int __devexit tosa_bt_remove(struct platform_device *dev)
113 111
114 platform_set_drvdata(dev, NULL); 112 platform_set_drvdata(dev, NULL);
115 113
116 if (rfk) 114 if (rfk) {
117 rfkill_unregister(rfk); 115 rfkill_unregister(rfk);
116 rfkill_destroy(rfk);
117 }
118 rfk = NULL; 118 rfk = NULL;
119 119
120 tosa_bt_off(data); 120 tosa_bt_off(data);
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 168267a5dfb3..117ad5920e53 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -31,7 +31,6 @@
31#include <linux/input.h> 31#include <linux/input.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/pda_power.h> 33#include <linux/pda_power.h>
34#include <linux/rfkill.h>
35#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
36 35
37#include <asm/setup.h> 36#include <asm/setup.h>
diff --git a/arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h b/arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
new file mode 100644
index 000000000000..36a85f5000c8
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
@@ -0,0 +1,50 @@
1/* arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C - USB2.0 Highspeed/OtG device PHY registers
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15/* Note, this is a seperate header file as some of the clock framework
16 * needs to touch this if the clk_48m is used as the USB OHCI or other
17 * peripheral source.
18*/
19
20#ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H
21#define __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H __FILE__
22
23/* S3C64XX_PA_USB_HSPHY */
24
25#define S3C_HSOTG_PHYREG(x) ((x) + S3C_VA_USB_HSPHY)
26
27#define S3C_PHYPWR S3C_HSOTG_PHYREG(0x00)
28#define SRC_PHYPWR_OTG_DISABLE (1 << 4)
29#define SRC_PHYPWR_ANALOG_POWERDOWN (1 << 3)
30#define SRC_PHYPWR_FORCE_SUSPEND (1 << 1)
31
32#define S3C_PHYCLK S3C_HSOTG_PHYREG(0x04)
33#define S3C_PHYCLK_MODE_USB11 (1 << 6)
34#define S3C_PHYCLK_EXT_OSC (1 << 5)
35#define S3C_PHYCLK_CLK_FORCE (1 << 4)
36#define S3C_PHYCLK_ID_PULL (1 << 2)
37#define S3C_PHYCLK_CLKSEL_MASK (0x3 << 0)
38#define S3C_PHYCLK_CLKSEL_SHIFT (0)
39#define S3C_PHYCLK_CLKSEL_48M (0x0 << 0)
40#define S3C_PHYCLK_CLKSEL_12M (0x2 << 0)
41#define S3C_PHYCLK_CLKSEL_24M (0x3 << 0)
42
43#define S3C_RSTCON S3C_HSOTG_PHYREG(0x08)
44#define S3C_RSTCON_PHYCLK (1 << 2)
45#define S3C_RSTCON_HCLK (1 << 2)
46#define S3C_RSTCON_PHY (1 << 0)
47
48#define S3C_PHYTUNE S3C_HSOTG_PHYREG(0x20)
49
50#endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_PHY_H */
diff --git a/arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h b/arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h
new file mode 100644
index 000000000000..8d18d9d4d148
--- /dev/null
+++ b/arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h
@@ -0,0 +1,377 @@
1/* arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C - USB2.0 Highspeed/OtG device block registers
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __PLAT_S3C64XX_REGS_USB_HSOTG_H
16#define __PLAT_S3C64XX_REGS_USB_HSOTG_H __FILE__
17
18#define S3C_HSOTG_REG(x) (x)
19
20#define S3C_GOTGCTL S3C_HSOTG_REG(0x000)
21#define S3C_GOTGCTL_BSESVLD (1 << 19)
22#define S3C_GOTGCTL_ASESVLD (1 << 18)
23#define S3C_GOTGCTL_DBNC_SHORT (1 << 17)
24#define S3C_GOTGCTL_CONID_B (1 << 16)
25#define S3C_GOTGCTL_DEVHNPEN (1 << 11)
26#define S3C_GOTGCTL_HSSETHNPEN (1 << 10)
27#define S3C_GOTGCTL_HNPREQ (1 << 9)
28#define S3C_GOTGCTL_HSTNEGSCS (1 << 8)
29#define S3C_GOTGCTL_SESREQ (1 << 1)
30#define S3C_GOTGCTL_SESREQSCS (1 << 0)
31
32#define S3C_GOTGINT S3C_HSOTG_REG(0x004)
33#define S3C_GOTGINT_DbnceDone (1 << 19)
34#define S3C_GOTGINT_ADevTOUTChg (1 << 18)
35#define S3C_GOTGINT_HstNegDet (1 << 17)
36#define S3C_GOTGINT_HstnegSucStsChng (1 << 9)
37#define S3C_GOTGINT_SesReqSucStsChng (1 << 8)
38#define S3C_GOTGINT_SesEndDet (1 << 2)
39
40#define S3C_GAHBCFG S3C_HSOTG_REG(0x008)
41#define S3C_GAHBCFG_PTxFEmpLvl (1 << 8)
42#define S3C_GAHBCFG_NPTxFEmpLvl (1 << 7)
43#define S3C_GAHBCFG_DMAEn (1 << 5)
44#define S3C_GAHBCFG_HBstLen_MASK (0xf << 1)
45#define S3C_GAHBCFG_HBstLen_SHIFT (1)
46#define S3C_GAHBCFG_HBstLen_Single (0x0 << 1)
47#define S3C_GAHBCFG_HBstLen_Incr (0x1 << 1)
48#define S3C_GAHBCFG_HBstLen_Incr4 (0x3 << 1)
49#define S3C_GAHBCFG_HBstLen_Incr8 (0x5 << 1)
50#define S3C_GAHBCFG_HBstLen_Incr16 (0x7 << 1)
51#define S3C_GAHBCFG_GlblIntrEn (1 << 0)
52
53#define S3C_GUSBCFG S3C_HSOTG_REG(0x00C)
54#define S3C_GUSBCFG_PHYLPClkSel (1 << 15)
55#define S3C_GUSBCFG_HNPCap (1 << 9)
56#define S3C_GUSBCFG_SRPCap (1 << 8)
57#define S3C_GUSBCFG_PHYIf16 (1 << 3)
58#define S3C_GUSBCFG_TOutCal_MASK (0x7 << 0)
59#define S3C_GUSBCFG_TOutCal_SHIFT (0)
60#define S3C_GUSBCFG_TOutCal_LIMIT (0x7)
61#define S3C_GUSBCFG_TOutCal(_x) ((_x) << 0)
62
63#define S3C_GRSTCTL S3C_HSOTG_REG(0x010)
64
65#define S3C_GRSTCTL_AHBIdle (1 << 31)
66#define S3C_GRSTCTL_DMAReq (1 << 30)
67#define S3C_GRSTCTL_TxFNum_MASK (0x1f << 6)
68#define S3C_GRSTCTL_TxFNum_SHIFT (6)
69#define S3C_GRSTCTL_TxFNum_LIMIT (0x1f)
70#define S3C_GRSTCTL_TxFNum(_x) ((_x) << 6)
71#define S3C_GRSTCTL_TxFFlsh (1 << 5)
72#define S3C_GRSTCTL_RxFFlsh (1 << 4)
73#define S3C_GRSTCTL_INTknQFlsh (1 << 3)
74#define S3C_GRSTCTL_FrmCntrRst (1 << 2)
75#define S3C_GRSTCTL_HSftRst (1 << 1)
76#define S3C_GRSTCTL_CSftRst (1 << 0)
77
78#define S3C_GINTSTS S3C_HSOTG_REG(0x014)
79#define S3C_GINTMSK S3C_HSOTG_REG(0x018)
80
81#define S3C_GINTSTS_WkUpInt (1 << 31)
82#define S3C_GINTSTS_SessReqInt (1 << 30)
83#define S3C_GINTSTS_DisconnInt (1 << 29)
84#define S3C_GINTSTS_ConIDStsChng (1 << 28)
85#define S3C_GINTSTS_PTxFEmp (1 << 26)
86#define S3C_GINTSTS_HChInt (1 << 25)
87#define S3C_GINTSTS_PrtInt (1 << 24)
88#define S3C_GINTSTS_FetSusp (1 << 22)
89#define S3C_GINTSTS_incompIP (1 << 21)
90#define S3C_GINTSTS_IncomplSOIN (1 << 20)
91#define S3C_GINTSTS_OEPInt (1 << 19)
92#define S3C_GINTSTS_IEPInt (1 << 18)
93#define S3C_GINTSTS_EPMis (1 << 17)
94#define S3C_GINTSTS_EOPF (1 << 15)
95#define S3C_GINTSTS_ISOutDrop (1 << 14)
96#define S3C_GINTSTS_EnumDone (1 << 13)
97#define S3C_GINTSTS_USBRst (1 << 12)
98#define S3C_GINTSTS_USBSusp (1 << 11)
99#define S3C_GINTSTS_ErlySusp (1 << 10)
100#define S3C_GINTSTS_GOUTNakEff (1 << 7)
101#define S3C_GINTSTS_GINNakEff (1 << 6)
102#define S3C_GINTSTS_NPTxFEmp (1 << 5)
103#define S3C_GINTSTS_RxFLvl (1 << 4)
104#define S3C_GINTSTS_SOF (1 << 3)
105#define S3C_GINTSTS_OTGInt (1 << 2)
106#define S3C_GINTSTS_ModeMis (1 << 1)
107#define S3C_GINTSTS_CurMod_Host (1 << 0)
108
109#define S3C_GRXSTSR S3C_HSOTG_REG(0x01C)
110#define S3C_GRXSTSP S3C_HSOTG_REG(0x020)
111
112#define S3C_GRXSTS_FN_MASK (0x7f << 25)
113#define S3C_GRXSTS_FN_SHIFT (25)
114
115#define S3C_GRXSTS_PktSts_MASK (0xf << 17)
116#define S3C_GRXSTS_PktSts_SHIFT (17)
117#define S3C_GRXSTS_PktSts_GlobalOutNAK (0x1 << 17)
118#define S3C_GRXSTS_PktSts_OutRX (0x2 << 17)
119#define S3C_GRXSTS_PktSts_OutDone (0x3 << 17)
120#define S3C_GRXSTS_PktSts_SetupDone (0x4 << 17)
121#define S3C_GRXSTS_PktSts_SetupRX (0x6 << 17)
122
123#define S3C_GRXSTS_DPID_MASK (0x3 << 15)
124#define S3C_GRXSTS_DPID_SHIFT (15)
125#define S3C_GRXSTS_ByteCnt_MASK (0x7ff << 4)
126#define S3C_GRXSTS_ByteCnt_SHIFT (4)
127#define S3C_GRXSTS_EPNum_MASK (0xf << 0)
128#define S3C_GRXSTS_EPNum_SHIFT (0)
129
130#define S3C_GRXFSIZ S3C_HSOTG_REG(0x024)
131
132#define S3C_GNPTXFSIZ S3C_HSOTG_REG(0x028)
133
134#define S3C_GNPTXFSIZ_NPTxFDep_MASK (0xffff << 16)
135#define S3C_GNPTXFSIZ_NPTxFDep_SHIFT (16)
136#define S3C_GNPTXFSIZ_NPTxFDep_LIMIT (0xffff)
137#define S3C_GNPTXFSIZ_NPTxFDep(_x) ((_x) << 16)
138#define S3C_GNPTXFSIZ_NPTxFStAddr_MASK (0xffff << 0)
139#define S3C_GNPTXFSIZ_NPTxFStAddr_SHIFT (0)
140#define S3C_GNPTXFSIZ_NPTxFStAddr_LIMIT (0xffff)
141#define S3C_GNPTXFSIZ_NPTxFStAddr(_x) ((_x) << 0)
142
143#define S3C_GNPTXSTS S3C_HSOTG_REG(0x02C)
144
145#define S3C_GNPTXSTS_NPtxQTop_MASK (0x7f << 24)
146#define S3C_GNPTXSTS_NPtxQTop_SHIFT (24)
147
148#define S3C_GNPTXSTS_NPTxQSpcAvail_MASK (0xff << 16)
149#define S3C_GNPTXSTS_NPTxQSpcAvail_SHIFT (16)
150#define S3C_GNPTXSTS_NPTxQSpcAvail_GET(_v) (((_v) >> 16) & 0xff)
151
152#define S3C_GNPTXSTS_NPTxFSpcAvail_MASK (0xffff << 0)
153#define S3C_GNPTXSTS_NPTxFSpcAvail_SHIFT (0)
154#define S3C_GNPTXSTS_NPTxFSpcAvail_GET(_v) (((_v) >> 0) & 0xffff)
155
156
157#define S3C_HPTXFSIZ S3C_HSOTG_REG(0x100)
158
159#define S3C_DPTXFSIZn(_a) S3C_HSOTG_REG(0x104 + (((_a) - 1) * 4))
160
161#define S3C_DPTXFSIZn_DPTxFSize_MASK (0xffff << 16)
162#define S3C_DPTXFSIZn_DPTxFSize_SHIFT (16)
163#define S3C_DPTXFSIZn_DPTxFSize_GET(_v) (((_v) >> 16) & 0xffff)
164#define S3C_DPTXFSIZn_DPTxFSize_LIMIT (0xffff)
165#define S3C_DPTXFSIZn_DPTxFSize(_x) ((_x) << 16)
166
167#define S3C_DPTXFSIZn_DPTxFStAddr_MASK (0xffff << 0)
168#define S3C_DPTXFSIZn_DPTxFStAddr_SHIFT (0)
169
170/* Device mode registers */
171#define S3C_DCFG S3C_HSOTG_REG(0x800)
172
173#define S3C_DCFG_EPMisCnt_MASK (0x1f << 18)
174#define S3C_DCFG_EPMisCnt_SHIFT (18)
175#define S3C_DCFG_EPMisCnt_LIMIT (0x1f)
176#define S3C_DCFG_EPMisCnt(_x) ((_x) << 18)
177
178#define S3C_DCFG_PerFrInt_MASK (0x3 << 11)
179#define S3C_DCFG_PerFrInt_SHIFT (11)
180#define S3C_DCFG_PerFrInt_LIMIT (0x3)
181#define S3C_DCFG_PerFrInt(_x) ((_x) << 11)
182
183#define S3C_DCFG_DevAddr_MASK (0x7f << 4)
184#define S3C_DCFG_DevAddr_SHIFT (4)
185#define S3C_DCFG_DevAddr_LIMIT (0x7f)
186#define S3C_DCFG_DevAddr(_x) ((_x) << 4)
187
188#define S3C_DCFG_NZStsOUTHShk (1 << 2)
189
190#define S3C_DCFG_DevSpd_MASK (0x3 << 0)
191#define S3C_DCFG_DevSpd_SHIFT (0)
192#define S3C_DCFG_DevSpd_HS (0x0 << 0)
193#define S3C_DCFG_DevSpd_FS (0x1 << 0)
194#define S3C_DCFG_DevSpd_LS (0x2 << 0)
195#define S3C_DCFG_DevSpd_FS48 (0x3 << 0)
196
197#define S3C_DCTL S3C_HSOTG_REG(0x804)
198
199#define S3C_DCTL_PWROnPrgDone (1 << 11)
200#define S3C_DCTL_CGOUTNak (1 << 10)
201#define S3C_DCTL_SGOUTNak (1 << 9)
202#define S3C_DCTL_CGNPInNAK (1 << 8)
203#define S3C_DCTL_SGNPInNAK (1 << 7)
204#define S3C_DCTL_TstCtl_MASK (0x7 << 4)
205#define S3C_DCTL_TstCtl_SHIFT (4)
206#define S3C_DCTL_GOUTNakSts (1 << 3)
207#define S3C_DCTL_GNPINNakSts (1 << 2)
208#define S3C_DCTL_SftDiscon (1 << 1)
209#define S3C_DCTL_RmtWkUpSig (1 << 0)
210
211#define S3C_DSTS S3C_HSOTG_REG(0x808)
212
213#define S3C_DSTS_SOFFN_MASK (0x3fff << 8)
214#define S3C_DSTS_SOFFN_SHIFT (8)
215#define S3C_DSTS_SOFFN_LIMIT (0x3fff)
216#define S3C_DSTS_SOFFN(_x) ((_x) << 8)
217#define S3C_DSTS_ErraticErr (1 << 3)
218#define S3C_DSTS_EnumSpd_MASK (0x3 << 1)
219#define S3C_DSTS_EnumSpd_SHIFT (1)
220#define S3C_DSTS_EnumSpd_HS (0x0 << 1)
221#define S3C_DSTS_EnumSpd_FS (0x1 << 1)
222#define S3C_DSTS_EnumSpd_LS (0x2 << 1)
223#define S3C_DSTS_EnumSpd_FS48 (0x3 << 1)
224
225#define S3C_DSTS_SuspSts (1 << 0)
226
227#define S3C_DIEPMSK S3C_HSOTG_REG(0x810)
228
229#define S3C_DIEPMSK_INEPNakEffMsk (1 << 6)
230#define S3C_DIEPMSK_INTknEPMisMsk (1 << 5)
231#define S3C_DIEPMSK_INTknTXFEmpMsk (1 << 4)
232#define S3C_DIEPMSK_TimeOUTMsk (1 << 3)
233#define S3C_DIEPMSK_AHBErrMsk (1 << 2)
234#define S3C_DIEPMSK_EPDisbldMsk (1 << 1)
235#define S3C_DIEPMSK_XferComplMsk (1 << 0)
236
237#define S3C_DOEPMSK S3C_HSOTG_REG(0x814)
238
239#define S3C_DOEPMSK_Back2BackSetup (1 << 6)
240#define S3C_DOEPMSK_OUTTknEPdisMsk (1 << 4)
241#define S3C_DOEPMSK_SetupMsk (1 << 3)
242#define S3C_DOEPMSK_AHBErrMsk (1 << 2)
243#define S3C_DOEPMSK_EPDisbldMsk (1 << 1)
244#define S3C_DOEPMSK_XferComplMsk (1 << 0)
245
246#define S3C_DAINT S3C_HSOTG_REG(0x818)
247#define S3C_DAINTMSK S3C_HSOTG_REG(0x81C)
248
249#define S3C_DAINT_OutEP_SHIFT (16)
250#define S3C_DAINT_OutEP(x) (1 << ((x) + 16))
251#define S3C_DAINT_InEP(x) (1 << (x))
252
253#define S3C_DTKNQR1 S3C_HSOTG_REG(0x820)
254#define S3C_DTKNQR2 S3C_HSOTG_REG(0x824)
255#define S3C_DTKNQR3 S3C_HSOTG_REG(0x830)
256#define S3C_DTKNQR4 S3C_HSOTG_REG(0x834)
257
258#define S3C_DVBUSDIS S3C_HSOTG_REG(0x828)
259#define S3C_DVBUSPULSE S3C_HSOTG_REG(0x82C)
260
261#define S3C_DIEPCTL0 S3C_HSOTG_REG(0x900)
262#define S3C_DOEPCTL0 S3C_HSOTG_REG(0xB00)
263#define S3C_DIEPCTL(_a) S3C_HSOTG_REG(0x900 + ((_a) * 0x20))
264#define S3C_DOEPCTL(_a) S3C_HSOTG_REG(0xB00 + ((_a) * 0x20))
265
266/* EP0 specialness:
267 * bits[29..28] - reserved (no SetD0PID, SetD1PID)
268 * bits[25..22] - should always be zero, this isn't a periodic endpoint
269 * bits[10..0] - MPS setting differenct for EP0
270*/
271#define S3C_D0EPCTL_MPS_MASK (0x3 << 0)
272#define S3C_D0EPCTL_MPS_SHIFT (0)
273#define S3C_D0EPCTL_MPS_64 (0x0 << 0)
274#define S3C_D0EPCTL_MPS_32 (0x1 << 0)
275#define S3C_D0EPCTL_MPS_16 (0x2 << 0)
276#define S3C_D0EPCTL_MPS_8 (0x3 << 0)
277
278#define S3C_DxEPCTL_EPEna (1 << 31)
279#define S3C_DxEPCTL_EPDis (1 << 30)
280#define S3C_DxEPCTL_SetD1PID (1 << 29)
281#define S3C_DxEPCTL_SetOddFr (1 << 29)
282#define S3C_DxEPCTL_SetD0PID (1 << 28)
283#define S3C_DxEPCTL_SetEvenFr (1 << 28)
284#define S3C_DxEPCTL_SNAK (1 << 27)
285#define S3C_DxEPCTL_CNAK (1 << 26)
286#define S3C_DxEPCTL_TxFNum_MASK (0xf << 22)
287#define S3C_DxEPCTL_TxFNum_SHIFT (22)
288#define S3C_DxEPCTL_TxFNum_LIMIT (0xf)
289#define S3C_DxEPCTL_TxFNum(_x) ((_x) << 22)
290
291#define S3C_DxEPCTL_Stall (1 << 21)
292#define S3C_DxEPCTL_Snp (1 << 20)
293#define S3C_DxEPCTL_EPType_MASK (0x3 << 18)
294#define S3C_DxEPCTL_EPType_SHIFT (18)
295#define S3C_DxEPCTL_EPType_Control (0x0 << 18)
296#define S3C_DxEPCTL_EPType_Iso (0x1 << 18)
297#define S3C_DxEPCTL_EPType_Bulk (0x2 << 18)
298#define S3C_DxEPCTL_EPType_Intterupt (0x3 << 18)
299
300#define S3C_DxEPCTL_NAKsts (1 << 17)
301#define S3C_DxEPCTL_DPID (1 << 16)
302#define S3C_DxEPCTL_EOFrNum (1 << 16)
303#define S3C_DxEPCTL_USBActEp (1 << 15)
304#define S3C_DxEPCTL_NextEp_MASK (0xf << 11)
305#define S3C_DxEPCTL_NextEp_SHIFT (11)
306#define S3C_DxEPCTL_NextEp_LIMIT (0xf)
307#define S3C_DxEPCTL_NextEp(_x) ((_x) << 11)
308
309#define S3C_DxEPCTL_MPS_MASK (0x7ff << 0)
310#define S3C_DxEPCTL_MPS_SHIFT (0)
311#define S3C_DxEPCTL_MPS_LIMIT (0x7ff)
312#define S3C_DxEPCTL_MPS(_x) ((_x) << 0)
313
314#define S3C_DIEPINT(_a) S3C_HSOTG_REG(0x908 + ((_a) * 0x20))
315#define S3C_DOEPINT(_a) S3C_HSOTG_REG(0xB08 + ((_a) * 0x20))
316
317#define S3C_DxEPINT_INEPNakEff (1 << 6)
318#define S3C_DxEPINT_Back2BackSetup (1 << 6)
319#define S3C_DxEPINT_INTknEPMis (1 << 5)
320#define S3C_DxEPINT_INTknTXFEmp (1 << 4)
321#define S3C_DxEPINT_OUTTknEPdis (1 << 4)
322#define S3C_DxEPINT_Timeout (1 << 3)
323#define S3C_DxEPINT_Setup (1 << 3)
324#define S3C_DxEPINT_AHBErr (1 << 2)
325#define S3C_DxEPINT_EPDisbld (1 << 1)
326#define S3C_DxEPINT_XferCompl (1 << 0)
327
328#define S3C_DIEPTSIZ0 S3C_HSOTG_REG(0x910)
329
330#define S3C_DIEPTSIZ0_PktCnt_MASK (0x3 << 19)
331#define S3C_DIEPTSIZ0_PktCnt_SHIFT (19)
332#define S3C_DIEPTSIZ0_PktCnt_LIMIT (0x3)
333#define S3C_DIEPTSIZ0_PktCnt(_x) ((_x) << 19)
334
335#define S3C_DIEPTSIZ0_XferSize_MASK (0x7f << 0)
336#define S3C_DIEPTSIZ0_XferSize_SHIFT (0)
337#define S3C_DIEPTSIZ0_XferSize_LIMIT (0x7f)
338#define S3C_DIEPTSIZ0_XferSize(_x) ((_x) << 0)
339
340
341#define DOEPTSIZ0 S3C_HSOTG_REG(0xB10)
342#define S3C_DOEPTSIZ0_SUPCnt_MASK (0x3 << 29)
343#define S3C_DOEPTSIZ0_SUPCnt_SHIFT (29)
344#define S3C_DOEPTSIZ0_SUPCnt_LIMIT (0x3)
345#define S3C_DOEPTSIZ0_SUPCnt(_x) ((_x) << 29)
346
347#define S3C_DOEPTSIZ0_PktCnt (1 << 19)
348#define S3C_DOEPTSIZ0_XferSize_MASK (0x7f << 0)
349#define S3C_DOEPTSIZ0_XferSize_SHIFT (0)
350
351#define S3C_DIEPTSIZ(_a) S3C_HSOTG_REG(0x910 + ((_a) * 0x20))
352#define S3C_DOEPTSIZ(_a) S3C_HSOTG_REG(0xB10 + ((_a) * 0x20))
353
354#define S3C_DxEPTSIZ_MC_MASK (0x3 << 29)
355#define S3C_DxEPTSIZ_MC_SHIFT (29)
356#define S3C_DxEPTSIZ_MC_LIMIT (0x3)
357#define S3C_DxEPTSIZ_MC(_x) ((_x) << 29)
358
359#define S3C_DxEPTSIZ_PktCnt_MASK (0x3ff << 19)
360#define S3C_DxEPTSIZ_PktCnt_SHIFT (19)
361#define S3C_DxEPTSIZ_PktCnt_GET(_v) (((_v) >> 19) & 0x3ff)
362#define S3C_DxEPTSIZ_PktCnt_LIMIT (0x3ff)
363#define S3C_DxEPTSIZ_PktCnt(_x) ((_x) << 19)
364
365#define S3C_DxEPTSIZ_XferSize_MASK (0x7ffff << 0)
366#define S3C_DxEPTSIZ_XferSize_SHIFT (0)
367#define S3C_DxEPTSIZ_XferSize_GET(_v) (((_v) >> 0) & 0x7ffff)
368#define S3C_DxEPTSIZ_XferSize_LIMIT (0x7ffff)
369#define S3C_DxEPTSIZ_XferSize(_x) ((_x) << 0)
370
371
372#define S3C_DIEPDMA(_a) S3C_HSOTG_REG(0x914 + ((_a) * 0x20))
373#define S3C_DOEPDMA(_a) S3C_HSOTG_REG(0xB14 + ((_a) * 0x20))
374
375#define S3C_EPFIFO(_a) S3C_HSOTG_REG(0x1000 + ((_a) * 0x1000))
376
377#endif /* __PLAT_S3C64XX_REGS_USB_HSOTG_H */
diff --git a/arch/avr32/kernel/init_task.c b/arch/avr32/kernel/init_task.c
index 993d56ee3cf3..57ec9f2dcd95 100644
--- a/arch/avr32/kernel/init_task.c
+++ b/arch/avr32/kernel/init_task.c
@@ -15,10 +15,6 @@
15 15
16static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 16static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
17static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 17static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
18struct mm_struct init_mm = INIT_MM(init_mm);
19
20EXPORT_SYMBOL(init_mm);
21
22/* 18/*
23 * Initial thread structure. Must be aligned on an 8192-byte boundary. 19 * Initial thread structure. Must be aligned on an 8192-byte boundary.
24 */ 20 */
diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c
index 803d7be0938f..27227561bad6 100644
--- a/arch/avr32/kernel/signal.c
+++ b/arch/avr32/kernel/signal.c
@@ -212,7 +212,7 @@ out:
212 return err; 212 return err;
213} 213}
214 214
215static inline void restart_syscall(struct pt_regs *regs) 215static inline void setup_syscall_restart(struct pt_regs *regs)
216{ 216{
217 if (regs->r12 == -ERESTART_RESTARTBLOCK) 217 if (regs->r12 == -ERESTART_RESTARTBLOCK)
218 regs->r8 = __NR_restart_syscall; 218 regs->r8 = __NR_restart_syscall;
@@ -296,7 +296,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int syscall)
296 } 296 }
297 /* fall through */ 297 /* fall through */
298 case -ERESTARTNOINTR: 298 case -ERESTARTNOINTR:
299 restart_syscall(regs); 299 setup_syscall_restart(regs);
300 } 300 }
301 } 301 }
302 302
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index a60cfe757914..8ea0d942cdea 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -6,59 +6,65 @@
6mainmenu "Blackfin Kernel Configuration" 6mainmenu "Blackfin Kernel Configuration"
7 7
8config MMU 8config MMU
9 bool 9 def_bool n
10 default n
11 10
12config FPU 11config FPU
13 bool 12 def_bool n
14 default n
15 13
16config RWSEM_GENERIC_SPINLOCK 14config RWSEM_GENERIC_SPINLOCK
17 bool 15 def_bool y
18 default y
19 16
20config RWSEM_XCHGADD_ALGORITHM 17config RWSEM_XCHGADD_ALGORITHM
21 bool 18 def_bool n
22 default n
23 19
24config BLACKFIN 20config BLACKFIN
25 bool 21 def_bool y
26 default y 22 select HAVE_FUNCTION_GRAPH_TRACER
23 select HAVE_FUNCTION_TRACER
27 select HAVE_IDE 24 select HAVE_IDE
25 select HAVE_KERNEL_GZIP
26 select HAVE_KERNEL_BZIP2
27 select HAVE_KERNEL_LZMA
28 select HAVE_OPROFILE 28 select HAVE_OPROFILE
29 select ARCH_WANT_OPTIONAL_GPIOLIB 29 select ARCH_WANT_OPTIONAL_GPIOLIB
30 30
31config GENERIC_BUG
32 def_bool y
33 depends on BUG
34
31config ZONE_DMA 35config ZONE_DMA
32 bool 36 def_bool y
33 default y
34 37
35config GENERIC_FIND_NEXT_BIT 38config GENERIC_FIND_NEXT_BIT
36 bool 39 def_bool y
37 default y
38 40
39config GENERIC_HWEIGHT 41config GENERIC_HWEIGHT
40 bool 42 def_bool y
41 default y
42 43
43config GENERIC_HARDIRQS 44config GENERIC_HARDIRQS
44 bool 45 def_bool y
45 default y
46 46
47config GENERIC_IRQ_PROBE 47config GENERIC_IRQ_PROBE
48 bool 48 def_bool y
49 default y
50 49
51config GENERIC_GPIO 50config GENERIC_GPIO
52 bool 51 def_bool y
53 default y
54 52
55config FORCE_MAX_ZONEORDER 53config FORCE_MAX_ZONEORDER
56 int 54 int
57 default "14" 55 default "14"
58 56
59config GENERIC_CALIBRATE_DELAY 57config GENERIC_CALIBRATE_DELAY
60 bool 58 def_bool y
61 default y 59
60config LOCKDEP_SUPPORT
61 def_bool y
62
63config STACKTRACE_SUPPORT
64 def_bool y
65
66config TRACE_IRQFLAGS_SUPPORT
67 def_bool y
62 68
63source "init/Kconfig" 69source "init/Kconfig"
64 70
@@ -408,12 +414,12 @@ comment "Clock/PLL Setup"
408 414
409config CLKIN_HZ 415config CLKIN_HZ
410 int "Frequency of the crystal on the board in Hz" 416 int "Frequency of the crystal on the board in Hz"
417 default "10000000" if BFIN532_IP0X
411 default "11059200" if BFIN533_STAMP 418 default "11059200" if BFIN533_STAMP
419 default "24576000" if PNAV10
420 default "25000000" # most people use this
412 default "27000000" if BFIN533_EZKIT 421 default "27000000" if BFIN533_EZKIT
413 default "25000000" if (BFIN537_STAMP || BFIN527_EZKIT || H8606_HVSISTEMAS || BLACKSTAMP || BFIN526_EZBRD || BFIN538_EZKIT || BFIN518F-EZBRD)
414 default "30000000" if BFIN561_EZKIT 422 default "30000000" if BFIN561_EZKIT
415 default "24576000" if PNAV10
416 default "10000000" if BFIN532_IP0X
417 help 423 help
418 The frequency of CLKIN crystal oscillator on the board in Hz. 424 The frequency of CLKIN crystal oscillator on the board in Hz.
419 Warning: This value should match the crystal on the board. Otherwise, 425 Warning: This value should match the crystal on the board. Otherwise,
diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index d54c8283825c..6f9533c3d752 100644
--- a/arch/blackfin/Makefile
+++ b/arch/blackfin/Makefile
@@ -137,7 +137,7 @@ archclean:
137 137
138INSTALL_PATH ?= /tftpboot 138INSTALL_PATH ?= /tftpboot
139boot := arch/$(ARCH)/boot 139boot := arch/$(ARCH)/boot
140BOOT_TARGETS = vmImage 140BOOT_TARGETS = vmImage vmImage.bz2 vmImage.gz vmImage.lzma
141PHONY += $(BOOT_TARGETS) install 141PHONY += $(BOOT_TARGETS) install
142KBUILD_IMAGE := $(boot)/vmImage 142KBUILD_IMAGE := $(boot)/vmImage
143 143
@@ -150,7 +150,10 @@ install:
150 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install 150 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
151 151
152define archhelp 152define archhelp
153 echo '* vmImage - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage)' 153 echo '* vmImage - Alias to selected kernel format (vmImage.gz by default)'
154 echo ' vmImage.bz2 - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.bz2)'
155 echo '* vmImage.gz - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.gz)'
156 echo ' vmImage.lzma - Kernel-only image for U-Boot (arch/$(ARCH)/boot/vmImage.lzma)'
154 echo ' install - Install kernel using' 157 echo ' install - Install kernel using'
155 echo ' (your) ~/bin/$(CROSS_COMPILE)installkernel or' 158 echo ' (your) ~/bin/$(CROSS_COMPILE)installkernel or'
156 echo ' (distribution) PATH: $(CROSS_COMPILE)installkernel or' 159 echo ' (distribution) PATH: $(CROSS_COMPILE)installkernel or'
diff --git a/arch/blackfin/boot/.gitignore b/arch/blackfin/boot/.gitignore
index 3ae03994b88d..229e50808677 100644
--- a/arch/blackfin/boot/.gitignore
+++ b/arch/blackfin/boot/.gitignore
@@ -1 +1,2 @@
1+vmImage 1vmImage*
2vmlinux*
diff --git a/arch/blackfin/boot/Makefile b/arch/blackfin/boot/Makefile
index e028d13481a9..3ab6f23561dd 100644
--- a/arch/blackfin/boot/Makefile
+++ b/arch/blackfin/boot/Makefile
@@ -8,24 +8,41 @@
8 8
9MKIMAGE := $(srctree)/scripts/mkuboot.sh 9MKIMAGE := $(srctree)/scripts/mkuboot.sh
10 10
11targets := vmImage 11targets := vmImage vmImage.bz2 vmImage.gz vmImage.lzma
12extra-y += vmlinux.bin vmlinux.gz 12extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma
13 13
14quiet_cmd_uimage = UIMAGE $@ 14quiet_cmd_uimage = UIMAGE $@
15 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \ 15 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \
16 -C gzip -n 'Linux-$(KERNELRELEASE)' -a $(CONFIG_BOOT_LOAD) \ 16 -C $(2) -n 'Linux-$(KERNELRELEASE)' -a $(CONFIG_BOOT_LOAD) \
17 -e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') \ 17 -e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') \
18 -d $< $@ 18 -d $< $@
19 19
20$(obj)/vmlinux.bin: vmlinux FORCE 20$(obj)/vmlinux.bin: vmlinux FORCE
21 $(call if_changed,objcopy) 21 $(call if_changed,objcopy)
22 22
23$(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE 23$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
24 $(call if_changed,gzip) 24 $(call if_changed,gzip)
25 25
26$(obj)/vmImage: $(obj)/vmlinux.gz 26$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
27 $(call if_changed,uimage) 27 $(call if_changed,bzip2)
28 @$(kecho) 'Kernel: $@ is ready' 28
29$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
30 $(call if_changed,lzma)
31
32$(obj)/vmImage.bz2: $(obj)/vmlinux.bin.bz2
33 $(call if_changed,uimage,bzip2)
34
35$(obj)/vmImage.gz: $(obj)/vmlinux.bin.gz
36 $(call if_changed,uimage,gzip)
37
38$(obj)/vmImage.lzma: $(obj)/vmlinux.bin.lzma
39 $(call if_changed,uimage,lzma)
40
41suffix-$(CONFIG_KERNEL_GZIP) := gz
42suffix-$(CONFIG_KERNEL_BZIP2) := bz2
43suffix-$(CONFIG_KERNEL_LZMA) := lzma
44$(obj)/vmImage: $(obj)/vmImage.$(suffix-y)
45 @ln -sf $(notdir $<) $@
29 46
30install: 47install:
31 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" 48 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
diff --git a/arch/blackfin/include/asm/atomic.h b/arch/blackfin/include/asm/atomic.h
index 7bbf44e4ddf9..b1d92f13ef96 100644
--- a/arch/blackfin/include/asm/atomic.h
+++ b/arch/blackfin/include/asm/atomic.h
@@ -90,7 +90,7 @@ static inline int atomic_test_mask(int mask, atomic_t *v)
90 90
91static inline void atomic_add(int i, atomic_t *v) 91static inline void atomic_add(int i, atomic_t *v)
92{ 92{
93 long flags; 93 unsigned long flags;
94 94
95 local_irq_save_hw(flags); 95 local_irq_save_hw(flags);
96 v->counter += i; 96 v->counter += i;
@@ -99,7 +99,7 @@ static inline void atomic_add(int i, atomic_t *v)
99 99
100static inline void atomic_sub(int i, atomic_t *v) 100static inline void atomic_sub(int i, atomic_t *v)
101{ 101{
102 long flags; 102 unsigned long flags;
103 103
104 local_irq_save_hw(flags); 104 local_irq_save_hw(flags);
105 v->counter -= i; 105 v->counter -= i;
@@ -110,7 +110,7 @@ static inline void atomic_sub(int i, atomic_t *v)
110static inline int atomic_add_return(int i, atomic_t *v) 110static inline int atomic_add_return(int i, atomic_t *v)
111{ 111{
112 int __temp = 0; 112 int __temp = 0;
113 long flags; 113 unsigned long flags;
114 114
115 local_irq_save_hw(flags); 115 local_irq_save_hw(flags);
116 v->counter += i; 116 v->counter += i;
@@ -124,7 +124,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
124static inline int atomic_sub_return(int i, atomic_t *v) 124static inline int atomic_sub_return(int i, atomic_t *v)
125{ 125{
126 int __temp = 0; 126 int __temp = 0;
127 long flags; 127 unsigned long flags;
128 128
129 local_irq_save_hw(flags); 129 local_irq_save_hw(flags);
130 v->counter -= i; 130 v->counter -= i;
@@ -136,7 +136,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
136 136
137static inline void atomic_inc(volatile atomic_t *v) 137static inline void atomic_inc(volatile atomic_t *v)
138{ 138{
139 long flags; 139 unsigned long flags;
140 140
141 local_irq_save_hw(flags); 141 local_irq_save_hw(flags);
142 v->counter++; 142 v->counter++;
@@ -145,7 +145,7 @@ static inline void atomic_inc(volatile atomic_t *v)
145 145
146static inline void atomic_dec(volatile atomic_t *v) 146static inline void atomic_dec(volatile atomic_t *v)
147{ 147{
148 long flags; 148 unsigned long flags;
149 149
150 local_irq_save_hw(flags); 150 local_irq_save_hw(flags);
151 v->counter--; 151 v->counter--;
@@ -154,7 +154,7 @@ static inline void atomic_dec(volatile atomic_t *v)
154 154
155static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) 155static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
156{ 156{
157 long flags; 157 unsigned long flags;
158 158
159 local_irq_save_hw(flags); 159 local_irq_save_hw(flags);
160 v->counter &= ~mask; 160 v->counter &= ~mask;
@@ -163,7 +163,7 @@ static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
163 163
164static inline void atomic_set_mask(unsigned int mask, atomic_t *v) 164static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
165{ 165{
166 long flags; 166 unsigned long flags;
167 167
168 local_irq_save_hw(flags); 168 local_irq_save_hw(flags);
169 v->counter |= mask; 169 v->counter |= mask;
diff --git a/arch/blackfin/include/asm/bfin-global.h b/arch/blackfin/include/asm/bfin-global.h
index daffc0684e75..e39277ea43e8 100644
--- a/arch/blackfin/include/asm/bfin-global.h
+++ b/arch/blackfin/include/asm/bfin-global.h
@@ -31,7 +31,7 @@
31 31
32#ifndef __ASSEMBLY__ 32#ifndef __ASSEMBLY__
33 33
34#include <asm-generic/sections.h> 34#include <asm/sections.h>
35#include <asm/ptrace.h> 35#include <asm/ptrace.h>
36#include <asm/user.h> 36#include <asm/user.h>
37#include <linux/linkage.h> 37#include <linux/linkage.h>
@@ -99,15 +99,6 @@ extern const char bfin_board_name[];
99extern unsigned long bfin_sic_iwr[]; 99extern unsigned long bfin_sic_iwr[];
100extern unsigned vr_wakeup; 100extern unsigned vr_wakeup;
101extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */ 101extern u16 _bfin_swrst; /* shadow for Software Reset Register (SWRST) */
102extern unsigned long _ramstart, _ramend, _rambase;
103extern unsigned long memory_start, memory_end, physical_mem_end;
104extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
105 _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _sbss_b_l1[], _ebss_b_l1[],
106 _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
107 _ebss_l2[], _l2_lma_start[];
108
109/* only used when MTD_UCLINUX */
110extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
111 102
112#ifdef CONFIG_BFIN_ICACHE_LOCK 103#ifdef CONFIG_BFIN_ICACHE_LOCK
113extern void cache_grab_lock(int way); 104extern void cache_grab_lock(int way);
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index 21b036eadab1..75fee2f7d9f2 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -109,7 +109,8 @@ static inline void clear_bit(int nr, volatile unsigned long *addr)
109 109
110static inline void change_bit(int nr, volatile unsigned long *addr) 110static inline void change_bit(int nr, volatile unsigned long *addr)
111{ 111{
112 int mask, flags; 112 int mask;
113 unsigned long flags;
113 unsigned long *ADDR = (unsigned long *)addr; 114 unsigned long *ADDR = (unsigned long *)addr;
114 115
115 ADDR += nr >> 5; 116 ADDR += nr >> 5;
diff --git a/arch/blackfin/include/asm/bug.h b/arch/blackfin/include/asm/bug.h
index 6d3e11b1fc57..655e49540e41 100644
--- a/arch/blackfin/include/asm/bug.h
+++ b/arch/blackfin/include/asm/bug.h
@@ -2,13 +2,58 @@
2#define _BLACKFIN_BUG_H 2#define _BLACKFIN_BUG_H
3 3
4#ifdef CONFIG_BUG 4#ifdef CONFIG_BUG
5#define HAVE_ARCH_BUG
6 5
7#define BUG() do { \ 6#define BFIN_BUG_OPCODE 0xefcd
8 dump_bfin_trace_buffer(); \ 7
9 printk(KERN_EMERG "BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ 8#ifdef CONFIG_DEBUG_BUGVERBOSE
10 panic("BUG!"); \ 9
11} while (0) 10#define _BUG_OR_WARN(flags) \
11 asm volatile( \
12 "1: .hword %0\n" \
13 " .section __bug_table,\"a\",@progbits\n" \
14 "2: .long 1b\n" \
15 " .long %1\n" \
16 " .short %2\n" \
17 " .short %3\n" \
18 " .org 2b + %4\n" \
19 " .previous" \
20 : \
21 : "i"(BFIN_BUG_OPCODE), "i"(__FILE__), \
22 "i"(__LINE__), "i"(flags), \
23 "i"(sizeof(struct bug_entry)))
24
25#else
26
27#define _BUG_OR_WARN(flags) \
28 asm volatile( \
29 "1: .hword %0\n" \
30 " .section __bug_table,\"a\",@progbits\n" \
31 "2: .long 1b\n" \
32 " .short %1\n" \
33 " .org 2b + %2\n" \
34 " .previous" \
35 : \
36 : "i"(BFIN_BUG_OPCODE), "i"(flags), \
37 "i"(sizeof(struct bug_entry)))
38
39#endif /* CONFIG_DEBUG_BUGVERBOSE */
40
41#define BUG() \
42 do { \
43 _BUG_OR_WARN(0); \
44 for (;;); \
45 } while (0)
46
47#define WARN_ON(condition) \
48 ({ \
49 int __ret_warn_on = !!(condition); \
50 if (unlikely(__ret_warn_on)) \
51 _BUG_OR_WARN(BUGFLAG_WARNING); \
52 unlikely(__ret_warn_on); \
53 })
54
55#define HAVE_ARCH_BUG
56#define HAVE_ARCH_WARN_ON
12 57
13#endif 58#endif
14 59
diff --git a/arch/blackfin/include/asm/cache.h b/arch/blackfin/include/asm/cache.h
index 86637814cf25..2ef669ed9222 100644
--- a/arch/blackfin/include/asm/cache.h
+++ b/arch/blackfin/include/asm/cache.h
@@ -34,9 +34,13 @@
34#define L1_CACHE_SHIFT_MAX 5 34#define L1_CACHE_SHIFT_MAX 5
35 35
36#if defined(CONFIG_SMP) && \ 36#if defined(CONFIG_SMP) && \
37 !defined(CONFIG_BFIN_CACHE_COHERENT) && \ 37 !defined(CONFIG_BFIN_CACHE_COHERENT)
38 defined(CONFIG_BFIN_DCACHE) 38# if defined(CONFIG_BFIN_ICACHE)
39#define __ARCH_SYNC_CORE_DCACHE 39# define __ARCH_SYNC_CORE_ICACHE
40# endif
41# if defined(CONFIG_BFIN_DCACHE)
42# define __ARCH_SYNC_CORE_DCACHE
43# endif
40#ifndef __ASSEMBLY__ 44#ifndef __ASSEMBLY__
41asmlinkage void __raw_smp_mark_barrier_asm(void); 45asmlinkage void __raw_smp_mark_barrier_asm(void);
42asmlinkage void __raw_smp_check_barrier_asm(void); 46asmlinkage void __raw_smp_check_barrier_asm(void);
@@ -51,6 +55,7 @@ static inline void smp_check_barrier(void)
51} 55}
52 56
53void resync_core_dcache(void); 57void resync_core_dcache(void);
58void resync_core_icache(void);
54#endif 59#endif
55#endif 60#endif
56 61
diff --git a/arch/blackfin/include/asm/cacheflush.h b/arch/blackfin/include/asm/cacheflush.h
index 94697f0f6f40..5c17dee53b5d 100644
--- a/arch/blackfin/include/asm/cacheflush.h
+++ b/arch/blackfin/include/asm/cacheflush.h
@@ -37,6 +37,7 @@ extern void blackfin_dcache_flush_range(unsigned long start_address, unsigned lo
37extern void blackfin_dcache_invalidate_range(unsigned long start_address, unsigned long end_address); 37extern void blackfin_dcache_invalidate_range(unsigned long start_address, unsigned long end_address);
38extern void blackfin_dflush_page(void *page); 38extern void blackfin_dflush_page(void *page);
39extern void blackfin_invalidate_entire_dcache(void); 39extern void blackfin_invalidate_entire_dcache(void);
40extern void blackfin_invalidate_entire_icache(void);
40 41
41#define flush_dcache_mmap_lock(mapping) do { } while (0) 42#define flush_dcache_mmap_lock(mapping) do { } while (0)
42#define flush_dcache_mmap_unlock(mapping) do { } while (0) 43#define flush_dcache_mmap_unlock(mapping) do { } while (0)
@@ -97,7 +98,7 @@ do { memcpy(dst, src, len); \
97extern unsigned long reserved_mem_dcache_on; 98extern unsigned long reserved_mem_dcache_on;
98extern unsigned long reserved_mem_icache_on; 99extern unsigned long reserved_mem_icache_on;
99 100
100static inline int bfin_addr_dcachable(unsigned long addr) 101static inline int bfin_addr_dcacheable(unsigned long addr)
101{ 102{
102#ifdef CONFIG_BFIN_DCACHE 103#ifdef CONFIG_BFIN_DCACHE
103 if (addr < (_ramend - DMA_UNCACHED_REGION)) 104 if (addr < (_ramend - DMA_UNCACHED_REGION))
diff --git a/arch/blackfin/include/asm/cpu.h b/arch/blackfin/include/asm/cpu.h
index c2594ef877f6..565b8136855e 100644
--- a/arch/blackfin/include/asm/cpu.h
+++ b/arch/blackfin/include/asm/cpu.h
@@ -34,6 +34,7 @@ struct blackfin_cpudata {
34 unsigned int dmemctl; 34 unsigned int dmemctl;
35 unsigned long loops_per_jiffy; 35 unsigned long loops_per_jiffy;
36 unsigned long dcache_invld_count; 36 unsigned long dcache_invld_count;
37 unsigned long icache_invld_count;
37}; 38};
38 39
39DECLARE_PER_CPU(struct blackfin_cpudata, cpu_data); 40DECLARE_PER_CPU(struct blackfin_cpudata, cpu_data);
diff --git a/arch/blackfin/include/asm/ftrace.h b/arch/blackfin/include/asm/ftrace.h
index 40a8c178f10d..8643680f0f78 100644
--- a/arch/blackfin/include/asm/ftrace.h
+++ b/arch/blackfin/include/asm/ftrace.h
@@ -1 +1,13 @@
1/* empty */ 1/*
2 * Blackfin ftrace code
3 *
4 * Copyright 2009 Analog Devices Inc.
5 * Licensed under the GPL-2 or later.
6 */
7
8#ifndef __ASM_BFIN_FTRACE_H__
9#define __ASM_BFIN_FTRACE_H__
10
11#define MCOUNT_INSN_SIZE 8 /* sizeof mcount call: LINK + CALL */
12
13#endif
diff --git a/arch/blackfin/include/asm/ipipe.h b/arch/blackfin/include/asm/ipipe.h
index 51d0bf5e2899..bbe1c3726b69 100644
--- a/arch/blackfin/include/asm/ipipe.h
+++ b/arch/blackfin/include/asm/ipipe.h
@@ -35,10 +35,10 @@
35#include <asm/atomic.h> 35#include <asm/atomic.h>
36#include <asm/traps.h> 36#include <asm/traps.h>
37 37
38#define IPIPE_ARCH_STRING "1.9-01" 38#define IPIPE_ARCH_STRING "1.10-00"
39#define IPIPE_MAJOR_NUMBER 1 39#define IPIPE_MAJOR_NUMBER 1
40#define IPIPE_MINOR_NUMBER 9 40#define IPIPE_MINOR_NUMBER 10
41#define IPIPE_PATCH_NUMBER 1 41#define IPIPE_PATCH_NUMBER 0
42 42
43#ifdef CONFIG_SMP 43#ifdef CONFIG_SMP
44#error "I-pipe/blackfin: SMP not implemented" 44#error "I-pipe/blackfin: SMP not implemented"
@@ -54,10 +54,11 @@ do { \
54 54
55#define task_hijacked(p) \ 55#define task_hijacked(p) \
56 ({ \ 56 ({ \
57 int __x__ = ipipe_current_domain != ipipe_root_domain; \ 57 int __x__ = __ipipe_root_domain_p; \
58 /* We would need to clear the SYNC flag for the root domain */ \ 58 __clear_bit(IPIPE_SYNC_FLAG, &ipipe_root_cpudom_var(status)); \
59 /* over the current processor in SMP mode. */ \ 59 if (__x__) \
60 local_irq_enable_hw(); __x__; \ 60 local_irq_enable_hw(); \
61 !__x__; \
61 }) 62 })
62 63
63struct ipipe_domain; 64struct ipipe_domain;
@@ -179,23 +180,24 @@ static inline unsigned long __ipipe_ffnz(unsigned long ul)
179 180
180#define __ipipe_run_isr(ipd, irq) \ 181#define __ipipe_run_isr(ipd, irq) \
181 do { \ 182 do { \
182 if (ipd == ipipe_root_domain) { \ 183 if (!__ipipe_pipeline_head_p(ipd)) \
183 local_irq_enable_hw(); \ 184 local_irq_enable_hw(); \
184 if (ipipe_virtual_irq_p(irq)) \ 185 if (ipd == ipipe_root_domain) { \
186 if (unlikely(ipipe_virtual_irq_p(irq))) { \
187 irq_enter(); \
185 ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \ 188 ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \
186 else \ 189 irq_exit(); \
190 } else \
187 ipd->irqs[irq].handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs)); \ 191 ipd->irqs[irq].handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs)); \
188 local_irq_disable_hw(); \
189 } else { \ 192 } else { \
190 __clear_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \ 193 __clear_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \
191 local_irq_enable_nohead(ipd); \
192 ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \ 194 ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \
193 /* Attempt to exit the outer interrupt level before \ 195 /* Attempt to exit the outer interrupt level before \
194 * starting the deferred IRQ processing. */ \ 196 * starting the deferred IRQ processing. */ \
195 local_irq_disable_nohead(ipd); \
196 __ipipe_run_irqtail(); \ 197 __ipipe_run_irqtail(); \
197 __set_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \ 198 __set_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \
198 } \ 199 } \
200 local_irq_disable_hw(); \
199 } while (0) 201 } while (0)
200 202
201#define __ipipe_syscall_watched_p(p, sc) \ 203#define __ipipe_syscall_watched_p(p, sc) \
diff --git a/arch/blackfin/include/asm/irq.h b/arch/blackfin/include/asm/irq.h
index 7645e85a5f6f..400bdd52ce87 100644
--- a/arch/blackfin/include/asm/irq.h
+++ b/arch/blackfin/include/asm/irq.h
@@ -17,270 +17,17 @@
17#ifndef _BFIN_IRQ_H_ 17#ifndef _BFIN_IRQ_H_
18#define _BFIN_IRQ_H_ 18#define _BFIN_IRQ_H_
19 19
20/* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h>*/ 20#include <linux/irqflags.h>
21#include <mach/irq.h>
22#include <asm/pda.h>
23#include <asm/processor.h>
24
25#ifdef CONFIG_SMP
26/* Forward decl needed due to cdef inter dependencies */
27static inline uint32_t __pure bfin_dspid(void);
28# define blackfin_core_id() (bfin_dspid() & 0xff)
29# define bfin_irq_flags cpu_pda[blackfin_core_id()].imask
30#else
31extern unsigned long bfin_irq_flags;
32#endif
33
34#ifdef CONFIG_IPIPE
35
36#include <linux/ipipe_trace.h>
37 21
38void __ipipe_unstall_root(void); 22/* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h> */
39 23#include <mach/irq.h>
40void __ipipe_restore_root(unsigned long flags);
41
42#ifdef CONFIG_DEBUG_HWERR
43# define __all_masked_irq_flags 0x3f
44# define __save_and_cli_hw(x) \
45 __asm__ __volatile__( \
46 "cli %0;" \
47 "sti %1;" \
48 : "=&d"(x) \
49 : "d" (0x3F) \
50 )
51#else
52# define __all_masked_irq_flags 0x1f
53# define __save_and_cli_hw(x) \
54 __asm__ __volatile__( \
55 "cli %0;" \
56 : "=&d"(x) \
57 )
58#endif
59
60#define irqs_enabled_from_flags_hw(x) ((x) != __all_masked_irq_flags)
61#define raw_irqs_disabled_flags(flags) (!irqs_enabled_from_flags_hw(flags))
62#define local_test_iflag_hw(x) irqs_enabled_from_flags_hw(x)
63
64#define local_save_flags(x) \
65 do { \
66 (x) = __ipipe_test_root() ? \
67 __all_masked_irq_flags : bfin_irq_flags; \
68 barrier(); \
69 } while (0)
70
71#define local_irq_save(x) \
72 do { \
73 (x) = __ipipe_test_and_stall_root() ? \
74 __all_masked_irq_flags : bfin_irq_flags; \
75 barrier(); \
76 } while (0)
77
78static inline void local_irq_restore(unsigned long x)
79{
80 barrier();
81 __ipipe_restore_root(x == __all_masked_irq_flags);
82}
83
84#define local_irq_disable() \
85 do { \
86 __ipipe_stall_root(); \
87 barrier(); \
88 } while (0)
89
90static inline void local_irq_enable(void)
91{
92 barrier();
93 __ipipe_unstall_root();
94}
95
96#define irqs_disabled() __ipipe_test_root()
97
98#define local_save_flags_hw(x) \
99 __asm__ __volatile__( \
100 "cli %0;" \
101 "sti %0;" \
102 : "=d"(x) \
103 )
104
105#define irqs_disabled_hw() \
106 ({ \
107 unsigned long flags; \
108 local_save_flags_hw(flags); \
109 !irqs_enabled_from_flags_hw(flags); \
110 })
111
112static inline unsigned long raw_mangle_irq_bits(int virt, unsigned long real)
113{
114 /* Merge virtual and real interrupt mask bits into a single
115 32bit word. */
116 return (real & ~(1 << 31)) | ((virt != 0) << 31);
117}
118
119static inline int raw_demangle_irq_bits(unsigned long *x)
120{
121 int virt = (*x & (1 << 31)) != 0;
122 *x &= ~(1L << 31);
123 return virt;
124}
125
126#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
127
128#define local_irq_disable_hw() \
129 do { \
130 int _tmp_dummy; \
131 if (!irqs_disabled_hw()) \
132 ipipe_trace_begin(0x80000000); \
133 __asm__ __volatile__ ("cli %0;" : "=d" (_tmp_dummy) : ); \
134 } while (0)
135
136#define local_irq_enable_hw() \
137 do { \
138 if (irqs_disabled_hw()) \
139 ipipe_trace_end(0x80000000); \
140 __asm__ __volatile__ ("sti %0;" : : "d"(bfin_irq_flags)); \
141 } while (0)
142
143#define local_irq_save_hw(x) \
144 do { \
145 __save_and_cli_hw(x); \
146 if (local_test_iflag_hw(x)) \
147 ipipe_trace_begin(0x80000001); \
148 } while (0)
149
150#define local_irq_restore_hw(x) \
151 do { \
152 if (local_test_iflag_hw(x)) { \
153 ipipe_trace_end(0x80000001); \
154 local_irq_enable_hw_notrace(); \
155 } \
156 } while (0)
157
158#define local_irq_disable_hw_notrace() \
159 do { \
160 int _tmp_dummy; \
161 __asm__ __volatile__ ("cli %0;" : "=d" (_tmp_dummy) : ); \
162 } while (0)
163
164#define local_irq_enable_hw_notrace() \
165 __asm__ __volatile__( \
166 "sti %0;" \
167 : \
168 : "d"(bfin_irq_flags) \
169 )
170
171#define local_irq_save_hw_notrace(x) __save_and_cli_hw(x)
172
173#define local_irq_restore_hw_notrace(x) \
174 do { \
175 if (local_test_iflag_hw(x)) \
176 local_irq_enable_hw_notrace(); \
177 } while (0)
178
179#else /* CONFIG_IPIPE_TRACE_IRQSOFF */
180
181#define local_irq_enable_hw() \
182 __asm__ __volatile__( \
183 "sti %0;" \
184 : \
185 : "d"(bfin_irq_flags) \
186 )
187
188#define local_irq_disable_hw() \
189 do { \
190 int _tmp_dummy; \
191 __asm__ __volatile__ ( \
192 "cli %0;" \
193 : "=d" (_tmp_dummy)); \
194 } while (0)
195
196#define local_irq_restore_hw(x) \
197 do { \
198 if (irqs_enabled_from_flags_hw(x)) \
199 local_irq_enable_hw(); \
200 } while (0)
201
202#define local_irq_save_hw(x) __save_and_cli_hw(x)
203
204#define local_irq_disable_hw_notrace() local_irq_disable_hw()
205#define local_irq_enable_hw_notrace() local_irq_enable_hw()
206#define local_irq_save_hw_notrace(x) local_irq_save_hw(x)
207#define local_irq_restore_hw_notrace(x) local_irq_restore_hw(x)
208
209#endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
210
211#else /* !CONFIG_IPIPE */
212
213/*
214 * Interrupt configuring macros.
215 */
216#define local_irq_disable() \
217 do { \
218 int __tmp_dummy; \
219 __asm__ __volatile__( \
220 "cli %0;" \
221 : "=d" (__tmp_dummy) \
222 ); \
223 } while (0)
224
225#define local_irq_enable() \
226 __asm__ __volatile__( \
227 "sti %0;" \
228 : \
229 : "d" (bfin_irq_flags) \
230 )
231
232#ifdef CONFIG_DEBUG_HWERR
233# define __save_and_cli(x) \
234 __asm__ __volatile__( \
235 "cli %0;" \
236 "sti %1;" \
237 : "=&d" (x) \
238 : "d" (0x3F) \
239 )
240#else
241# define __save_and_cli(x) \
242 __asm__ __volatile__( \
243 "cli %0;" \
244 : "=&d" (x) \
245 )
246#endif
247
248#define local_save_flags(x) \
249 __asm__ __volatile__( \
250 "cli %0;" \
251 "sti %0;" \
252 : "=d" (x) \
253 )
254
255#ifdef CONFIG_DEBUG_HWERR
256#define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0)
257#else
258#define irqs_enabled_from_flags(x) ((x) != 0x1f)
259#endif
260
261#define local_irq_restore(x) \
262 do { \
263 if (irqs_enabled_from_flags(x)) \
264 local_irq_enable(); \
265 } while (0)
266
267/* For spinlocks etc */
268#define local_irq_save(x) __save_and_cli(x)
269
270#define irqs_disabled() \
271({ \
272 unsigned long flags; \
273 local_save_flags(flags); \
274 !irqs_enabled_from_flags(flags); \
275})
276
277#define local_irq_save_hw(x) local_irq_save(x)
278#define local_irq_restore_hw(x) local_irq_restore(x)
279#define local_irq_enable_hw() local_irq_enable()
280#define local_irq_disable_hw() local_irq_disable()
281#define irqs_disabled_hw() irqs_disabled()
282 24
283#endif /* !CONFIG_IPIPE */ 25/* Xenomai IPIPE helpers */
26#define local_irq_restore_hw(x) local_irq_restore(x)
27#define local_irq_save_hw(x) local_irq_save(x)
28#define local_irq_enable_hw(x) local_irq_enable(x)
29#define local_irq_disable_hw(x) local_irq_disable(x)
30#define irqs_disabled_hw(x) irqs_disabled(x)
284 31
285#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE) 32#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE)
286# define NOP_PAD_ANOMALY_05000244 "nop; nop;" 33# define NOP_PAD_ANOMALY_05000244 "nop; nop;"
diff --git a/arch/blackfin/include/asm/irqflags.h b/arch/blackfin/include/asm/irqflags.h
new file mode 100644
index 000000000000..139cba4651b1
--- /dev/null
+++ b/arch/blackfin/include/asm/irqflags.h
@@ -0,0 +1,63 @@
1/*
2 * interface to Blackfin CEC
3 *
4 * Copyright 2009 Analog Devices Inc.
5 * Licensed under the GPL-2 or later.
6 */
7
8#ifndef __ASM_BFIN_IRQFLAGS_H__
9#define __ASM_BFIN_IRQFLAGS_H__
10
11#ifdef CONFIG_SMP
12# include <asm/pda.h>
13# include <asm/processor.h>
14/* Forward decl needed due to cdef inter dependencies */
15static inline uint32_t __pure bfin_dspid(void);
16# define blackfin_core_id() (bfin_dspid() & 0xff)
17# define bfin_irq_flags cpu_pda[blackfin_core_id()].imask
18#else
19extern unsigned long bfin_irq_flags;
20#endif
21
22static inline void bfin_sti(unsigned long flags)
23{
24 asm volatile("sti %0;" : : "d" (flags));
25}
26
27static inline unsigned long bfin_cli(void)
28{
29 unsigned long flags;
30 asm volatile("cli %0;" : "=d" (flags));
31 return flags;
32}
33
34static inline void raw_local_irq_disable(void)
35{
36 bfin_cli();
37}
38static inline void raw_local_irq_enable(void)
39{
40 bfin_sti(bfin_irq_flags);
41}
42
43#define raw_local_save_flags(flags) do { (flags) = bfin_read_IMASK(); } while (0)
44
45#define raw_irqs_disabled_flags(flags) (((flags) & ~0x3f) == 0)
46
47static inline void raw_local_irq_restore(unsigned long flags)
48{
49 if (!raw_irqs_disabled_flags(flags))
50 raw_local_irq_enable();
51}
52
53static inline unsigned long __raw_local_irq_save(void)
54{
55 unsigned long flags = bfin_cli();
56#ifdef CONFIG_DEBUG_HWERR
57 bfin_sti(0x3f);
58#endif
59 return flags;
60}
61#define raw_local_irq_save(flags) do { (flags) = __raw_local_irq_save(); } while (0)
62
63#endif
diff --git a/arch/blackfin/include/asm/kmap_types.h b/arch/blackfin/include/asm/kmap_types.h
index e215f7104974..0a88622339ee 100644
--- a/arch/blackfin/include/asm/kmap_types.h
+++ b/arch/blackfin/include/asm/kmap_types.h
@@ -1,21 +1,6 @@
1#ifndef _ASM_KMAP_TYPES_H 1#ifndef _ASM_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H 2#define _ASM_KMAP_TYPES_H
3 3
4enum km_type { 4#include <asm-generic/kmap_types.h>
5 KM_BOUNCE_READ,
6 KM_SKB_SUNRPC_DATA,
7 KM_SKB_DATA_SOFTIRQ,
8 KM_USER0,
9 KM_USER1,
10 KM_BIO_SRC_IRQ,
11 KM_BIO_DST_IRQ,
12 KM_PTE0,
13 KM_PTE1,
14 KM_IRQ0,
15 KM_IRQ1,
16 KM_SOFTIRQ0,
17 KM_SOFTIRQ1,
18 KM_TYPE_NR
19};
20 5
21#endif 6#endif
diff --git a/arch/blackfin/include/asm/mutex-dec.h b/arch/blackfin/include/asm/mutex-dec.h
deleted file mode 100644
index 0134151656af..000000000000
--- a/arch/blackfin/include/asm/mutex-dec.h
+++ /dev/null
@@ -1,112 +0,0 @@
1/*
2 * include/asm-generic/mutex-dec.h
3 *
4 * Generic implementation of the mutex fastpath, based on atomic
5 * decrement/increment.
6 */
7#ifndef _ASM_GENERIC_MUTEX_DEC_H
8#define _ASM_GENERIC_MUTEX_DEC_H
9
10/**
11 * __mutex_fastpath_lock - try to take the lock by moving the count
12 * from 1 to a 0 value
13 * @count: pointer of type atomic_t
14 * @fail_fn: function to call if the original value was not 1
15 *
16 * Change the count from 1 to a value lower than 1, and call <fail_fn> if
17 * it wasn't 1 originally. This function MUST leave the value lower than
18 * 1 even when the "1" assertion wasn't true.
19 */
20static inline void
21__mutex_fastpath_lock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
22{
23 if (unlikely(atomic_dec_return(count) < 0))
24 fail_fn(count);
25 else
26 smp_mb();
27}
28
29/**
30 * __mutex_fastpath_lock_retval - try to take the lock by moving the count
31 * from 1 to a 0 value
32 * @count: pointer of type atomic_t
33 * @fail_fn: function to call if the original value was not 1
34 *
35 * Change the count from 1 to a value lower than 1, and call <fail_fn> if
36 * it wasn't 1 originally. This function returns 0 if the fastpath succeeds,
37 * or anything the slow path function returns.
38 */
39static inline int
40__mutex_fastpath_lock_retval(atomic_t *count, fastcall int (*fail_fn)(atomic_t *))
41{
42 if (unlikely(atomic_dec_return(count) < 0))
43 return fail_fn(count);
44 else {
45 smp_mb();
46 return 0;
47 }
48}
49
50/**
51 * __mutex_fastpath_unlock - try to promote the count from 0 to 1
52 * @count: pointer of type atomic_t
53 * @fail_fn: function to call if the original value was not 0
54 *
55 * Try to promote the count from 0 to 1. If it wasn't 0, call <fail_fn>.
56 * In the failure case, this function is allowed to either set the value to
57 * 1, or to set it to a value lower than 1.
58 *
59 * If the implementation sets it to a value of lower than 1, then the
60 * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs
61 * to return 0 otherwise.
62 */
63static inline void
64__mutex_fastpath_unlock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
65{
66 smp_mb();
67 if (unlikely(atomic_inc_return(count) <= 0))
68 fail_fn(count);
69}
70
71#define __mutex_slowpath_needs_to_unlock() 1
72
73/**
74 * __mutex_fastpath_trylock - try to acquire the mutex, without waiting
75 *
76 * @count: pointer of type atomic_t
77 * @fail_fn: fallback function
78 *
79 * Change the count from 1 to a value lower than 1, and return 0 (failure)
80 * if it wasn't 1 originally, or return 1 (success) otherwise. This function
81 * MUST leave the value lower than 1 even when the "1" assertion wasn't true.
82 * Additionally, if the value was < 0 originally, this function must not leave
83 * it to 0 on failure.
84 *
85 * If the architecture has no effective trylock variant, it should call the
86 * <fail_fn> spinlock-based trylock variant unconditionally.
87 */
88static inline int
89__mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
90{
91 /*
92 * We have two variants here. The cmpxchg based one is the best one
93 * because it never induce a false contention state. It is included
94 * here because architectures using the inc/dec algorithms over the
95 * xchg ones are much more likely to support cmpxchg natively.
96 *
97 * If not we fall back to the spinlock based variant - that is
98 * just as efficient (and simpler) as a 'destructive' probing of
99 * the mutex state would be.
100 */
101#ifdef __HAVE_ARCH_CMPXCHG
102 if (likely(atomic_cmpxchg(count, 1, 0) == 1)) {
103 smp_mb();
104 return 1;
105 }
106 return 0;
107#else
108 return fail_fn(count);
109#endif
110}
111
112#endif
diff --git a/arch/blackfin/include/asm/sections.h b/arch/blackfin/include/asm/sections.h
index 1443c3353a8c..e7fd0ecd73f7 100644
--- a/arch/blackfin/include/asm/sections.h
+++ b/arch/blackfin/include/asm/sections.h
@@ -4,4 +4,15 @@
4/* nothing to see, move along */ 4/* nothing to see, move along */
5#include <asm-generic/sections.h> 5#include <asm-generic/sections.h>
6 6
7/* only used when MTD_UCLINUX */
8extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
9
10extern unsigned long _ramstart, _ramend, _rambase;
11extern unsigned long memory_start, memory_end, physical_mem_end;
12
13extern char _stext_l1[], _etext_l1[], _sdata_l1[], _edata_l1[], _sbss_l1[],
14 _ebss_l1[], _l1_lma_start[], _sdata_b_l1[], _sbss_b_l1[], _ebss_b_l1[],
15 _stext_l2[], _etext_l2[], _sdata_l2[], _edata_l2[], _sbss_l2[],
16 _ebss_l2[], _l2_lma_start[];
17
7#endif 18#endif
diff --git a/arch/blackfin/include/asm/system.h b/arch/blackfin/include/asm/system.h
index a4c8254bec55..294dbda24164 100644
--- a/arch/blackfin/include/asm/system.h
+++ b/arch/blackfin/include/asm/system.h
@@ -35,10 +35,10 @@
35#define _BLACKFIN_SYSTEM_H 35#define _BLACKFIN_SYSTEM_H
36 36
37#include <linux/linkage.h> 37#include <linux/linkage.h>
38#include <linux/compiler.h> 38#include <linux/irqflags.h>
39#include <mach/anomaly.h> 39#include <mach/anomaly.h>
40#include <asm/cache.h>
40#include <asm/pda.h> 41#include <asm/pda.h>
41#include <asm/processor.h>
42#include <asm/irq.h> 42#include <asm/irq.h>
43 43
44/* 44/*
diff --git a/arch/blackfin/include/asm/unistd.h b/arch/blackfin/include/asm/unistd.h
index cf5066d3efd2..da35133c171d 100644
--- a/arch/blackfin/include/asm/unistd.h
+++ b/arch/blackfin/include/asm/unistd.h
@@ -380,8 +380,9 @@
380#define __NR_inotify_init1 365 380#define __NR_inotify_init1 365
381#define __NR_preadv 366 381#define __NR_preadv 366
382#define __NR_pwritev 367 382#define __NR_pwritev 367
383#define __NR_rt_tgsigqueueinfo 368
383 384
384#define __NR_syscall 368 385#define __NR_syscall 369
385#define NR_syscalls __NR_syscall 386#define NR_syscalls __NR_syscall
386 387
387/* Old optional stuff no one actually uses */ 388/* Old optional stuff no one actually uses */
diff --git a/arch/blackfin/kernel/Makefile b/arch/blackfin/kernel/Makefile
index fd4d4328a0f2..3731088e181b 100644
--- a/arch/blackfin/kernel/Makefile
+++ b/arch/blackfin/kernel/Makefile
@@ -15,6 +15,10 @@ else
15 obj-y += time.o 15 obj-y += time.o
16endif 16endif
17 17
18obj-$(CONFIG_FUNCTION_TRACER) += ftrace-entry.o
19obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
20CFLAGS_REMOVE_ftrace.o = -pg
21
18obj-$(CONFIG_IPIPE) += ipipe.o 22obj-$(CONFIG_IPIPE) += ipipe.o
19obj-$(CONFIG_IPIPE_TRACE_MCOUNT) += mcount.o 23obj-$(CONFIG_IPIPE_TRACE_MCOUNT) += mcount.o
20obj-$(CONFIG_BFIN_GPTIMERS) += gptimers.o 24obj-$(CONFIG_BFIN_GPTIMERS) += gptimers.o
@@ -23,6 +27,7 @@ obj-$(CONFIG_MODULES) += module.o
23obj-$(CONFIG_KGDB) += kgdb.o 27obj-$(CONFIG_KGDB) += kgdb.o
24obj-$(CONFIG_KGDB_TESTS) += kgdb_test.o 28obj-$(CONFIG_KGDB_TESTS) += kgdb_test.o
25obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 29obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
30obj-$(CONFIG_STACKTRACE) += stacktrace.o
26 31
27# the kgdb test puts code into L2 and without linker 32# the kgdb test puts code into L2 and without linker
28# relaxation, we need to force long calls to/from it 33# relaxation, we need to force long calls to/from it
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 763ed84ba459..e0bf8cc06907 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -453,10 +453,10 @@ void *dma_memcpy(void *pdst, const void *psrc, size_t size)
453 unsigned long src = (unsigned long)psrc; 453 unsigned long src = (unsigned long)psrc;
454 size_t bulk, rest; 454 size_t bulk, rest;
455 455
456 if (bfin_addr_dcachable(src)) 456 if (bfin_addr_dcacheable(src))
457 blackfin_dcache_flush_range(src, src + size); 457 blackfin_dcache_flush_range(src, src + size);
458 458
459 if (bfin_addr_dcachable(dst)) 459 if (bfin_addr_dcacheable(dst))
460 blackfin_dcache_invalidate_range(dst, dst + size); 460 blackfin_dcache_invalidate_range(dst, dst + size);
461 461
462 bulk = size & ~0xffff; 462 bulk = size & ~0xffff;
diff --git a/arch/blackfin/kernel/bfin_ksyms.c b/arch/blackfin/kernel/bfin_ksyms.c
index 53e893ff708a..aa05e638fb7c 100644
--- a/arch/blackfin/kernel/bfin_ksyms.c
+++ b/arch/blackfin/kernel/bfin_ksyms.c
@@ -103,3 +103,8 @@ EXPORT_SYMBOL(__raw_smp_mark_barrier_asm);
103EXPORT_SYMBOL(__raw_smp_check_barrier_asm); 103EXPORT_SYMBOL(__raw_smp_check_barrier_asm);
104#endif 104#endif
105#endif 105#endif
106
107#ifdef CONFIG_FUNCTION_TRACER
108extern void _mcount(void);
109EXPORT_SYMBOL(_mcount);
110#endif
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbmgr.c b/arch/blackfin/kernel/cplb-mpu/cplbmgr.c
index 87463ce87f5a..784923e52a9a 100644
--- a/arch/blackfin/kernel/cplb-mpu/cplbmgr.c
+++ b/arch/blackfin/kernel/cplb-mpu/cplbmgr.c
@@ -151,7 +151,7 @@ static noinline int dcplb_miss(unsigned int cpu)
151 151
152 d_data = CPLB_SUPV_WR | CPLB_VALID | CPLB_DIRTY | PAGE_SIZE_4KB; 152 d_data = CPLB_SUPV_WR | CPLB_VALID | CPLB_DIRTY | PAGE_SIZE_4KB;
153#ifdef CONFIG_BFIN_DCACHE 153#ifdef CONFIG_BFIN_DCACHE
154 if (bfin_addr_dcachable(addr)) { 154 if (bfin_addr_dcacheable(addr)) {
155 d_data |= CPLB_L1_CHBL | ANOMALY_05000158_WORKAROUND; 155 d_data |= CPLB_L1_CHBL | ANOMALY_05000158_WORKAROUND;
156#ifdef CONFIG_BFIN_WT 156#ifdef CONFIG_BFIN_WT
157 d_data |= CPLB_L1_AOW | CPLB_WT; 157 d_data |= CPLB_L1_AOW | CPLB_WT;
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbmgr.c b/arch/blackfin/kernel/cplb-nompu/cplbmgr.c
index 8cbb47c7b663..12b030842fdb 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbmgr.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbmgr.c
@@ -28,6 +28,7 @@
28#include <asm/cplbinit.h> 28#include <asm/cplbinit.h>
29#include <asm/cplb.h> 29#include <asm/cplb.h>
30#include <asm/mmu_context.h> 30#include <asm/mmu_context.h>
31#include <asm/traps.h>
31 32
32/* 33/*
33 * WARNING 34 * WARNING
@@ -100,28 +101,6 @@ static inline void write_icplb_data(int cpu, int idx, unsigned long data,
100#endif 101#endif
101} 102}
102 103
103/*
104 * Given the contents of the status register, return the index of the
105 * CPLB that caused the fault.
106 */
107static inline int faulting_cplb_index(int status)
108{
109 int signbits = __builtin_bfin_norm_fr1x32(status & 0xFFFF);
110 return 30 - signbits;
111}
112
113/*
114 * Given the contents of the status register and the DCPLB_DATA contents,
115 * return true if a write access should be permitted.
116 */
117static inline int write_permitted(int status, unsigned long data)
118{
119 if (status & FAULT_USERSUPV)
120 return !!(data & CPLB_SUPV_WR);
121 else
122 return !!(data & CPLB_USER_WR);
123}
124
125/* Counters to implement round-robin replacement. */ 104/* Counters to implement round-robin replacement. */
126static int icplb_rr_index[NR_CPUS] PDT_ATTR; 105static int icplb_rr_index[NR_CPUS] PDT_ATTR;
127static int dcplb_rr_index[NR_CPUS] PDT_ATTR; 106static int dcplb_rr_index[NR_CPUS] PDT_ATTR;
@@ -245,43 +224,16 @@ MGR_ATTR static int dcplb_miss(int cpu)
245 return CPLB_RELOADED; 224 return CPLB_RELOADED;
246} 225}
247 226
248MGR_ATTR static noinline int dcplb_protection_fault(int cpu)
249{
250 int status = bfin_read_DCPLB_STATUS();
251
252 nr_dcplb_prot[cpu]++;
253
254 if (likely(status & FAULT_RW)) {
255 int idx = faulting_cplb_index(status);
256 unsigned long regaddr = DCPLB_DATA0 + idx * 4;
257 unsigned long data = bfin_read32(regaddr);
258
259 /* Check if fault is to dirty a clean page */
260 if (!(data & CPLB_WT) && !(data & CPLB_DIRTY) &&
261 write_permitted(status, data)) {
262
263 dcplb_tbl[cpu][idx].data = data;
264 bfin_write32(regaddr, data);
265 return CPLB_RELOADED;
266 }
267 }
268
269 return CPLB_PROT_VIOL;
270}
271
272MGR_ATTR int cplb_hdr(int seqstat, struct pt_regs *regs) 227MGR_ATTR int cplb_hdr(int seqstat, struct pt_regs *regs)
273{ 228{
274 int cause = seqstat & 0x3f; 229 int cause = seqstat & 0x3f;
275 unsigned int cpu = smp_processor_id(); 230 unsigned int cpu = smp_processor_id();
276 switch (cause) { 231 switch (cause) {
277 case 0x2C: 232 case VEC_CPLB_I_M:
278 return icplb_miss(cpu); 233 return icplb_miss(cpu);
279 case 0x26: 234 case VEC_CPLB_M:
280 return dcplb_miss(cpu); 235 return dcplb_miss(cpu);
281 default: 236 default:
282 if (unlikely(cause == 0x23))
283 return dcplb_protection_fault(cpu);
284
285 return CPLB_UNKNOWN_ERR; 237 return CPLB_UNKNOWN_ERR;
286 } 238 }
287} 239}
diff --git a/arch/blackfin/kernel/early_printk.c b/arch/blackfin/kernel/early_printk.c
index 3302719173ca..2ab56811841c 100644
--- a/arch/blackfin/kernel/early_printk.c
+++ b/arch/blackfin/kernel/early_printk.c
@@ -202,11 +202,15 @@ asmlinkage void __init init_early_exception_vectors(void)
202asmlinkage void __init early_trap_c(struct pt_regs *fp, void *retaddr) 202asmlinkage void __init early_trap_c(struct pt_regs *fp, void *retaddr)
203{ 203{
204 /* This can happen before the uart is initialized, so initialize 204 /* This can happen before the uart is initialized, so initialize
205 * the UART now 205 * the UART now (but only if we are running on the processor we think
206 * we are compiled for - otherwise we write to MMRs that don't exist,
207 * and cause other problems. Nothing comes out the UART, but it does
208 * end up in the __buf_log.
206 */ 209 */
207 if (likely(early_console == NULL)) 210 if (likely(early_console == NULL) && CPUID == bfin_cpuid())
208 setup_early_printk(DEFAULT_EARLY_PORT); 211 setup_early_printk(DEFAULT_EARLY_PORT);
209 212
213 printk(KERN_EMERG "Early panic\n");
210 dump_bfin_mem(fp); 214 dump_bfin_mem(fp);
211 show_regs(fp); 215 show_regs(fp);
212 dump_bfin_trace_buffer(); 216 dump_bfin_trace_buffer();
diff --git a/arch/blackfin/kernel/ftrace-entry.S b/arch/blackfin/kernel/ftrace-entry.S
new file mode 100644
index 000000000000..6980b7a0615d
--- /dev/null
+++ b/arch/blackfin/kernel/ftrace-entry.S
@@ -0,0 +1,140 @@
1/*
2 * mcount and friends -- ftrace stuff
3 *
4 * Copyright (C) 2009 Analog Devices Inc.
5 * Licensed under the GPL-2 or later.
6 */
7
8#include <linux/linkage.h>
9#include <asm/ftrace.h>
10
11.text
12
13/* GCC will have called us before setting up the function prologue, so we
14 * can clobber the normal scratch registers, but we need to make sure to
15 * save/restore the registers used for argument passing (R0-R2) in case
16 * the profiled function is using them. With data registers, R3 is the
17 * only one we can blow away. With pointer registers, we have P0-P2.
18 *
19 * Upon entry, the RETS will point to the top of the current profiled
20 * function. And since GCC setup the frame for us, the previous function
21 * will be waiting there. mmmm pie.
22 */
23ENTRY(__mcount)
24 /* save third function arg early so we can do testing below */
25 [--sp] = r2;
26
27 /* load the function pointer to the tracer */
28 p0.l = _ftrace_trace_function;
29 p0.h = _ftrace_trace_function;
30 r3 = [p0];
31
32 /* optional micro optimization: don't call the stub tracer */
33 r2.l = _ftrace_stub;
34 r2.h = _ftrace_stub;
35 cc = r2 == r3;
36 if ! cc jump .Ldo_trace;
37
38#ifdef CONFIG_FUNCTION_GRAPH_TRACER
39 /* if the ftrace_graph_return function pointer is not set to
40 * the ftrace_stub entry, call prepare_ftrace_return().
41 */
42 p0.l = _ftrace_graph_return;
43 p0.h = _ftrace_graph_return;
44 r3 = [p0];
45 cc = r2 == r3;
46 if ! cc jump _ftrace_graph_caller;
47
48 /* similarly, if the ftrace_graph_entry function pointer is not
49 * set to the ftrace_graph_entry_stub entry, ...
50 */
51 p0.l = _ftrace_graph_entry;
52 p0.h = _ftrace_graph_entry;
53 r2.l = _ftrace_graph_entry_stub;
54 r2.h = _ftrace_graph_entry_stub;
55 r3 = [p0];
56 cc = r2 == r3;
57 if ! cc jump _ftrace_graph_caller;
58#endif
59
60 r2 = [sp++];
61 rts;
62
63.Ldo_trace:
64
65 /* save first/second function arg and the return register */
66 [--sp] = r0;
67 [--sp] = r1;
68 [--sp] = rets;
69
70 /* setup the tracer function */
71 p0 = r3;
72
73 /* tracer(ulong frompc, ulong selfpc):
74 * frompc: the pc that did the call to ...
75 * selfpc: ... this location
76 * the selfpc itself will need adjusting for the mcount call
77 */
78 r1 = rets;
79 r0 = [fp + 4];
80 r1 += -MCOUNT_INSN_SIZE;
81
82 /* call the tracer */
83 call (p0);
84
85 /* restore state and get out of dodge */
86.Lfinish_trace:
87 rets = [sp++];
88 r1 = [sp++];
89 r0 = [sp++];
90 r2 = [sp++];
91
92.globl _ftrace_stub
93_ftrace_stub:
94 rts;
95ENDPROC(__mcount)
96
97#ifdef CONFIG_FUNCTION_GRAPH_TRACER
98/* The prepare_ftrace_return() function is similar to the trace function
99 * except it takes a pointer to the location of the frompc. This is so
100 * the prepare_ftrace_return() can hijack it temporarily for probing
101 * purposes.
102 */
103ENTRY(_ftrace_graph_caller)
104 /* save first/second function arg and the return register */
105 [--sp] = r0;
106 [--sp] = r1;
107 [--sp] = rets;
108
109 r0 = fp;
110 r1 = rets;
111 r0 += 4;
112 r1 += -MCOUNT_INSN_SIZE;
113 call _prepare_ftrace_return;
114
115 jump .Lfinish_trace;
116ENDPROC(_ftrace_graph_caller)
117
118/* Undo the rewrite caused by ftrace_graph_caller(). The common function
119 * ftrace_return_to_handler() will return the original rets so we can
120 * restore it and be on our way.
121 */
122ENTRY(_return_to_handler)
123 /* make sure original return values are saved */
124 [--sp] = p0;
125 [--sp] = r0;
126 [--sp] = r1;
127
128 /* get original return address */
129 call _ftrace_return_to_handler;
130 rets = r0;
131
132 /* anomaly 05000371 - make sure we have at least three instructions
133 * between rets setting and the return
134 */
135 r1 = [sp++];
136 r0 = [sp++];
137 p0 = [sp++];
138 rts;
139ENDPROC(_return_to_handler)
140#endif
diff --git a/arch/blackfin/kernel/ftrace.c b/arch/blackfin/kernel/ftrace.c
new file mode 100644
index 000000000000..905bfc40a00b
--- /dev/null
+++ b/arch/blackfin/kernel/ftrace.c
@@ -0,0 +1,42 @@
1/*
2 * ftrace graph code
3 *
4 * Copyright (C) 2009 Analog Devices Inc.
5 * Licensed under the GPL-2 or later.
6 */
7
8#include <linux/ftrace.h>
9#include <linux/kernel.h>
10#include <linux/sched.h>
11#include <asm/atomic.h>
12
13#ifdef CONFIG_FUNCTION_GRAPH_TRACER
14
15/*
16 * Hook the return address and push it in the stack of return addrs
17 * in current thread info.
18 */
19void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
20{
21 struct ftrace_graph_ent trace;
22 unsigned long return_hooker = (unsigned long)&return_to_handler;
23
24 if (unlikely(atomic_read(&current->tracing_graph_pause)))
25 return;
26
27 if (ftrace_push_return_trace(*parent, self_addr, &trace.depth) == -EBUSY)
28 return;
29
30 trace.func = self_addr;
31
32 /* Only trace if the calling function expects to */
33 if (!ftrace_graph_entry(&trace)) {
34 current->curr_ret_stack--;
35 return;
36 }
37
38 /* all is well in the world ! hijack RETS ... */
39 *parent = return_hooker;
40}
41
42#endif
diff --git a/arch/blackfin/kernel/init_task.c b/arch/blackfin/kernel/init_task.c
index 2c228c020978..c26c34de9f3c 100644
--- a/arch/blackfin/kernel/init_task.c
+++ b/arch/blackfin/kernel/init_task.c
@@ -35,10 +35,6 @@
35 35
36static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 36static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
37static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 37static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
38
39struct mm_struct init_mm = INIT_MM(init_mm);
40EXPORT_SYMBOL(init_mm);
41
42/* 38/*
43 * Initial task structure. 39 * Initial task structure.
44 * 40 *
diff --git a/arch/blackfin/kernel/ipipe.c b/arch/blackfin/kernel/ipipe.c
index 5fc424803a17..d8cde1fc5cb9 100644
--- a/arch/blackfin/kernel/ipipe.c
+++ b/arch/blackfin/kernel/ipipe.c
@@ -99,7 +99,7 @@ void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs)
99 * interrupt. 99 * interrupt.
100 */ 100 */
101 m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR); 101 m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR);
102 this_domain = ipipe_current_domain; 102 this_domain = __ipipe_current_domain;
103 103
104 if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control))) 104 if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control)))
105 head = &this_domain->p_link; 105 head = &this_domain->p_link;
@@ -212,7 +212,9 @@ void __ipipe_unstall_root_raw(void)
212 212
213int __ipipe_syscall_root(struct pt_regs *regs) 213int __ipipe_syscall_root(struct pt_regs *regs)
214{ 214{
215 struct ipipe_percpu_domain_data *p;
215 unsigned long flags; 216 unsigned long flags;
217 int ret;
216 218
217 /* 219 /*
218 * We need to run the IRQ tail hook whenever we don't 220 * We need to run the IRQ tail hook whenever we don't
@@ -231,29 +233,31 @@ int __ipipe_syscall_root(struct pt_regs *regs)
231 /* 233 /*
232 * This routine either returns: 234 * This routine either returns:
233 * 0 -- if the syscall is to be passed to Linux; 235 * 0 -- if the syscall is to be passed to Linux;
234 * 1 -- if the syscall should not be passed to Linux, and no 236 * >0 -- if the syscall should not be passed to Linux, and no
235 * tail work should be performed; 237 * tail work should be performed;
236 * -1 -- if the syscall should not be passed to Linux but the 238 * <0 -- if the syscall should not be passed to Linux but the
237 * tail work has to be performed (for handling signals etc). 239 * tail work has to be performed (for handling signals etc).
238 */ 240 */
239 241
240 if (__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL) && 242 if (!__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL))
241 __ipipe_dispatch_event(IPIPE_EVENT_SYSCALL, regs) > 0) { 243 return 0;
242 if (ipipe_root_domain_p && !in_atomic()) { 244
243 /* 245 ret = __ipipe_dispatch_event(IPIPE_EVENT_SYSCALL, regs);
244 * Sync pending VIRQs before _TIF_NEED_RESCHED 246
245 * is tested. 247 local_irq_save_hw(flags);
246 */ 248
247 local_irq_save_hw(flags); 249 if (!__ipipe_root_domain_p) {
248 if ((ipipe_root_cpudom_var(irqpend_himask) & IPIPE_IRQMASK_VIRT) != 0) 250 local_irq_restore_hw(flags);
249 __ipipe_sync_pipeline(IPIPE_IRQMASK_VIRT);
250 local_irq_restore_hw(flags);
251 return -1;
252 }
253 return 1; 251 return 1;
254 } 252 }
255 253
256 return 0; 254 p = ipipe_root_cpudom_ptr();
255 if ((p->irqpend_himask & IPIPE_IRQMASK_VIRT) != 0)
256 __ipipe_sync_pipeline(IPIPE_IRQMASK_VIRT);
257
258 local_irq_restore_hw(flags);
259
260 return -ret;
257} 261}
258 262
259unsigned long ipipe_critical_enter(void (*syncfn) (void)) 263unsigned long ipipe_critical_enter(void (*syncfn) (void))
@@ -329,9 +333,7 @@ asmlinkage void __ipipe_sync_root(void)
329 333
330void ___ipipe_sync_pipeline(unsigned long syncmask) 334void ___ipipe_sync_pipeline(unsigned long syncmask)
331{ 335{
332 struct ipipe_domain *ipd = ipipe_current_domain; 336 if (__ipipe_root_domain_p) {
333
334 if (ipd == ipipe_root_domain) {
335 if (test_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status))) 337 if (test_bit(IPIPE_SYNCDEFER_FLAG, &ipipe_root_cpudom_var(status)))
336 return; 338 return;
337 } 339 }
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 80447f99c2b5..6454babdfaff 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -1098,7 +1098,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1098 CPUID, bfin_cpuid()); 1098 CPUID, bfin_cpuid());
1099 1099
1100 seq_printf(m, "model name\t: ADSP-%s %lu(MHz CCLK) %lu(MHz SCLK) (%s)\n" 1100 seq_printf(m, "model name\t: ADSP-%s %lu(MHz CCLK) %lu(MHz SCLK) (%s)\n"
1101 "stepping\t: %d\n", 1101 "stepping\t: %d ",
1102 cpu, cclk/1000000, sclk/1000000, 1102 cpu, cclk/1000000, sclk/1000000,
1103#ifdef CONFIG_MPU 1103#ifdef CONFIG_MPU
1104 "mpu on", 1104 "mpu on",
@@ -1107,7 +1107,16 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1107#endif 1107#endif
1108 revid); 1108 revid);
1109 1109
1110 seq_printf(m, "cpu MHz\t\t: %lu.%03lu/%lu.%03lu\n", 1110 if (bfin_revid() != bfin_compiled_revid()) {
1111 if (bfin_compiled_revid() == -1)
1112 seq_printf(m, "(Compiled for Rev none)");
1113 else if (bfin_compiled_revid() == 0xffff)
1114 seq_printf(m, "(Compiled for Rev any)");
1115 else
1116 seq_printf(m, "(Compiled for Rev %d)", bfin_compiled_revid());
1117 }
1118
1119 seq_printf(m, "\ncpu MHz\t\t: %lu.%03lu/%lu.%03lu\n",
1111 cclk/1000000, cclk%1000000, 1120 cclk/1000000, cclk%1000000,
1112 sclk/1000000, sclk%1000000); 1121 sclk/1000000, sclk%1000000);
1113 seq_printf(m, "bogomips\t: %lu.%02lu\n" 1122 seq_printf(m, "bogomips\t: %lu.%02lu\n"
@@ -1172,6 +1181,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1172#ifdef __ARCH_SYNC_CORE_DCACHE 1181#ifdef __ARCH_SYNC_CORE_DCACHE
1173 seq_printf(m, "SMP Dcache Flushes\t: %lu\n\n", cpudata->dcache_invld_count); 1182 seq_printf(m, "SMP Dcache Flushes\t: %lu\n\n", cpudata->dcache_invld_count);
1174#endif 1183#endif
1184#ifdef __ARCH_SYNC_CORE_ICACHE
1185 seq_printf(m, "SMP Icache Flushes\t: %lu\n\n", cpudata->icache_invld_count);
1186#endif
1175#ifdef CONFIG_BFIN_ICACHE_LOCK 1187#ifdef CONFIG_BFIN_ICACHE_LOCK
1176 switch ((cpudata->imemctl >> 3) & WAYALL_L) { 1188 switch ((cpudata->imemctl >> 3) & WAYALL_L) {
1177 case WAY0_L: 1189 case WAY0_L:
diff --git a/arch/blackfin/kernel/stacktrace.c b/arch/blackfin/kernel/stacktrace.c
new file mode 100644
index 000000000000..30301e1eace5
--- /dev/null
+++ b/arch/blackfin/kernel/stacktrace.c
@@ -0,0 +1,53 @@
1/*
2 * Blackfin stacktrace code (mostly copied from avr32)
3 *
4 * Copyright 2009 Analog Devices Inc.
5 * Licensed under the GPL-2 or later.
6 */
7
8#include <linux/sched.h>
9#include <linux/stacktrace.h>
10#include <linux/thread_info.h>
11#include <linux/module.h>
12
13register unsigned long current_frame_pointer asm("FP");
14
15struct stackframe {
16 unsigned long fp;
17 unsigned long rets;
18};
19
20/*
21 * Save stack-backtrace addresses into a stack_trace buffer.
22 */
23void save_stack_trace(struct stack_trace *trace)
24{
25 unsigned long low, high;
26 unsigned long fp;
27 struct stackframe *frame;
28 int skip = trace->skip;
29
30 low = (unsigned long)task_stack_page(current);
31 high = low + THREAD_SIZE;
32 fp = current_frame_pointer;
33
34 while (fp >= low && fp <= (high - sizeof(*frame))) {
35 frame = (struct stackframe *)fp;
36
37 if (skip) {
38 skip--;
39 } else {
40 trace->entries[trace->nr_entries++] = frame->rets;
41 if (trace->nr_entries >= trace->max_entries)
42 break;
43 }
44
45 /*
46 * The next frame must be at a higher address than the
47 * current frame.
48 */
49 low = fp + sizeof(*frame);
50 fp = frame->fp;
51 }
52}
53EXPORT_SYMBOL_GPL(save_stack_trace);
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index aa76dfb0226e..d279552fe9b0 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -27,6 +27,7 @@
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */ 28 */
29 29
30#include <linux/bug.h>
30#include <linux/uaccess.h> 31#include <linux/uaccess.h>
31#include <linux/interrupt.h> 32#include <linux/interrupt.h>
32#include <linux/module.h> 33#include <linux/module.h>
@@ -238,6 +239,11 @@ asmlinkage void double_fault_c(struct pt_regs *fp)
238 239
239} 240}
240 241
242static int kernel_mode_regs(struct pt_regs *regs)
243{
244 return regs->ipend & 0xffc0;
245}
246
241asmlinkage void trap_c(struct pt_regs *fp) 247asmlinkage void trap_c(struct pt_regs *fp)
242{ 248{
243#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON 249#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
@@ -246,6 +252,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
246#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO 252#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
247 unsigned int cpu = smp_processor_id(); 253 unsigned int cpu = smp_processor_id();
248#endif 254#endif
255 const char *strerror = NULL;
249 int sig = 0; 256 int sig = 0;
250 siginfo_t info; 257 siginfo_t info;
251 unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE; 258 unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE;
@@ -259,27 +266,10 @@ asmlinkage void trap_c(struct pt_regs *fp)
259 * double faults if the stack has become corrupt 266 * double faults if the stack has become corrupt
260 */ 267 */
261 268
262 /* If the fault was caused by a kernel thread, or interrupt handler 269#ifndef CONFIG_KGDB
263 * we will kernel panic, so the system reboots. 270 /* IPEND is skipped if KGDB isn't enabled (see entry code) */
264 * If KGDB is enabled, don't set this for kernel breakpoints 271 fp->ipend = bfin_read_IPEND();
265 */
266
267 /* TODO: check to see if we are in some sort of deferred HWERR
268 * that we should be able to recover from, not kernel panic
269 */
270 if ((bfin_read_IPEND() & 0xFFC0) && (trapnr != VEC_STEP)
271#ifdef CONFIG_KGDB
272 && (trapnr != VEC_EXCPT02)
273#endif 272#endif
274 ){
275 console_verbose();
276 oops_in_progress = 1;
277 } else if (current) {
278 if (current->mm == NULL) {
279 console_verbose();
280 oops_in_progress = 1;
281 }
282 }
283 273
284 /* trap_c() will be called for exceptions. During exceptions 274 /* trap_c() will be called for exceptions. During exceptions
285 * processing, the pc value should be set with retx value. 275 * processing, the pc value should be set with retx value.
@@ -307,15 +297,15 @@ asmlinkage void trap_c(struct pt_regs *fp)
307 sig = SIGTRAP; 297 sig = SIGTRAP;
308 CHK_DEBUGGER_TRAP_MAYBE(); 298 CHK_DEBUGGER_TRAP_MAYBE();
309 /* Check if this is a breakpoint in kernel space */ 299 /* Check if this is a breakpoint in kernel space */
310 if (fp->ipend & 0xffc0) 300 if (kernel_mode_regs(fp))
311 return; 301 goto traps_done;
312 else 302 else
313 break; 303 break;
314 /* 0x03 - User Defined, userspace stack overflow */ 304 /* 0x03 - User Defined, userspace stack overflow */
315 case VEC_EXCPT03: 305 case VEC_EXCPT03:
316 info.si_code = SEGV_STACKFLOW; 306 info.si_code = SEGV_STACKFLOW;
317 sig = SIGSEGV; 307 sig = SIGSEGV;
318 verbose_printk(KERN_NOTICE EXC_0x03(KERN_NOTICE)); 308 strerror = KERN_NOTICE EXC_0x03(KERN_NOTICE);
319 CHK_DEBUGGER_TRAP_MAYBE(); 309 CHK_DEBUGGER_TRAP_MAYBE();
320 break; 310 break;
321 /* 0x02 - KGDB initial connection and break signal trap */ 311 /* 0x02 - KGDB initial connection and break signal trap */
@@ -324,7 +314,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
324 info.si_code = TRAP_ILLTRAP; 314 info.si_code = TRAP_ILLTRAP;
325 sig = SIGTRAP; 315 sig = SIGTRAP;
326 CHK_DEBUGGER_TRAP(); 316 CHK_DEBUGGER_TRAP();
327 return; 317 goto traps_done;
328#endif 318#endif
329 /* 0x04 - User Defined */ 319 /* 0x04 - User Defined */
330 /* 0x05 - User Defined */ 320 /* 0x05 - User Defined */
@@ -344,7 +334,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
344 case VEC_EXCPT04 ... VEC_EXCPT15: 334 case VEC_EXCPT04 ... VEC_EXCPT15:
345 info.si_code = ILL_ILLPARAOP; 335 info.si_code = ILL_ILLPARAOP;
346 sig = SIGILL; 336 sig = SIGILL;
347 verbose_printk(KERN_NOTICE EXC_0x04(KERN_NOTICE)); 337 strerror = KERN_NOTICE EXC_0x04(KERN_NOTICE);
348 CHK_DEBUGGER_TRAP_MAYBE(); 338 CHK_DEBUGGER_TRAP_MAYBE();
349 break; 339 break;
350 /* 0x10 HW Single step, handled here */ 340 /* 0x10 HW Single step, handled here */
@@ -353,15 +343,15 @@ asmlinkage void trap_c(struct pt_regs *fp)
353 sig = SIGTRAP; 343 sig = SIGTRAP;
354 CHK_DEBUGGER_TRAP_MAYBE(); 344 CHK_DEBUGGER_TRAP_MAYBE();
355 /* Check if this is a single step in kernel space */ 345 /* Check if this is a single step in kernel space */
356 if (fp->ipend & 0xffc0) 346 if (kernel_mode_regs(fp))
357 return; 347 goto traps_done;
358 else 348 else
359 break; 349 break;
360 /* 0x11 - Trace Buffer Full, handled here */ 350 /* 0x11 - Trace Buffer Full, handled here */
361 case VEC_OVFLOW: 351 case VEC_OVFLOW:
362 info.si_code = TRAP_TRACEFLOW; 352 info.si_code = TRAP_TRACEFLOW;
363 sig = SIGTRAP; 353 sig = SIGTRAP;
364 verbose_printk(KERN_NOTICE EXC_0x11(KERN_NOTICE)); 354 strerror = KERN_NOTICE EXC_0x11(KERN_NOTICE);
365 CHK_DEBUGGER_TRAP_MAYBE(); 355 CHK_DEBUGGER_TRAP_MAYBE();
366 break; 356 break;
367 /* 0x12 - Reserved, Caught by default */ 357 /* 0x12 - Reserved, Caught by default */
@@ -381,37 +371,54 @@ asmlinkage void trap_c(struct pt_regs *fp)
381 /* 0x20 - Reserved, Caught by default */ 371 /* 0x20 - Reserved, Caught by default */
382 /* 0x21 - Undefined Instruction, handled here */ 372 /* 0x21 - Undefined Instruction, handled here */
383 case VEC_UNDEF_I: 373 case VEC_UNDEF_I:
374#ifdef CONFIG_BUG
375 if (kernel_mode_regs(fp)) {
376 switch (report_bug(fp->pc, fp)) {
377 case BUG_TRAP_TYPE_NONE:
378 break;
379 case BUG_TRAP_TYPE_WARN:
380 dump_bfin_trace_buffer();
381 fp->pc += 2;
382 goto traps_done;
383 case BUG_TRAP_TYPE_BUG:
384 /* call to panic() will dump trace, and it is
385 * off at this point, so it won't be clobbered
386 */
387 panic("BUG()");
388 }
389 }
390#endif
384 info.si_code = ILL_ILLOPC; 391 info.si_code = ILL_ILLOPC;
385 sig = SIGILL; 392 sig = SIGILL;
386 verbose_printk(KERN_NOTICE EXC_0x21(KERN_NOTICE)); 393 strerror = KERN_NOTICE EXC_0x21(KERN_NOTICE);
387 CHK_DEBUGGER_TRAP_MAYBE(); 394 CHK_DEBUGGER_TRAP_MAYBE();
388 break; 395 break;
389 /* 0x22 - Illegal Instruction Combination, handled here */ 396 /* 0x22 - Illegal Instruction Combination, handled here */
390 case VEC_ILGAL_I: 397 case VEC_ILGAL_I:
391 info.si_code = ILL_ILLPARAOP; 398 info.si_code = ILL_ILLPARAOP;
392 sig = SIGILL; 399 sig = SIGILL;
393 verbose_printk(KERN_NOTICE EXC_0x22(KERN_NOTICE)); 400 strerror = KERN_NOTICE EXC_0x22(KERN_NOTICE);
394 CHK_DEBUGGER_TRAP_MAYBE(); 401 CHK_DEBUGGER_TRAP_MAYBE();
395 break; 402 break;
396 /* 0x23 - Data CPLB protection violation, handled here */ 403 /* 0x23 - Data CPLB protection violation, handled here */
397 case VEC_CPLB_VL: 404 case VEC_CPLB_VL:
398 info.si_code = ILL_CPLB_VI; 405 info.si_code = ILL_CPLB_VI;
399 sig = SIGBUS; 406 sig = SIGBUS;
400 verbose_printk(KERN_NOTICE EXC_0x23(KERN_NOTICE)); 407 strerror = KERN_NOTICE EXC_0x23(KERN_NOTICE);
401 CHK_DEBUGGER_TRAP_MAYBE(); 408 CHK_DEBUGGER_TRAP_MAYBE();
402 break; 409 break;
403 /* 0x24 - Data access misaligned, handled here */ 410 /* 0x24 - Data access misaligned, handled here */
404 case VEC_MISALI_D: 411 case VEC_MISALI_D:
405 info.si_code = BUS_ADRALN; 412 info.si_code = BUS_ADRALN;
406 sig = SIGBUS; 413 sig = SIGBUS;
407 verbose_printk(KERN_NOTICE EXC_0x24(KERN_NOTICE)); 414 strerror = KERN_NOTICE EXC_0x24(KERN_NOTICE);
408 CHK_DEBUGGER_TRAP_MAYBE(); 415 CHK_DEBUGGER_TRAP_MAYBE();
409 break; 416 break;
410 /* 0x25 - Unrecoverable Event, handled here */ 417 /* 0x25 - Unrecoverable Event, handled here */
411 case VEC_UNCOV: 418 case VEC_UNCOV:
412 info.si_code = ILL_ILLEXCPT; 419 info.si_code = ILL_ILLEXCPT;
413 sig = SIGILL; 420 sig = SIGILL;
414 verbose_printk(KERN_NOTICE EXC_0x25(KERN_NOTICE)); 421 strerror = KERN_NOTICE EXC_0x25(KERN_NOTICE);
415 CHK_DEBUGGER_TRAP_MAYBE(); 422 CHK_DEBUGGER_TRAP_MAYBE();
416 break; 423 break;
417 /* 0x26 - Data CPLB Miss, normal case is handled in _cplb_hdr, 424 /* 0x26 - Data CPLB Miss, normal case is handled in _cplb_hdr,
@@ -419,7 +426,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
419 case VEC_CPLB_M: 426 case VEC_CPLB_M:
420 info.si_code = BUS_ADRALN; 427 info.si_code = BUS_ADRALN;
421 sig = SIGBUS; 428 sig = SIGBUS;
422 verbose_printk(KERN_NOTICE EXC_0x26(KERN_NOTICE)); 429 strerror = KERN_NOTICE EXC_0x26(KERN_NOTICE);
423 break; 430 break;
424 /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero, handled here */ 431 /* 0x27 - Data CPLB Multiple Hits - Linux Trap Zero, handled here */
425 case VEC_CPLB_MHIT: 432 case VEC_CPLB_MHIT:
@@ -427,10 +434,10 @@ asmlinkage void trap_c(struct pt_regs *fp)
427 sig = SIGSEGV; 434 sig = SIGSEGV;
428#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO 435#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
429 if (cpu_pda[cpu].dcplb_fault_addr < FIXED_CODE_START) 436 if (cpu_pda[cpu].dcplb_fault_addr < FIXED_CODE_START)
430 verbose_printk(KERN_NOTICE "NULL pointer access\n"); 437 strerror = KERN_NOTICE "NULL pointer access\n";
431 else 438 else
432#endif 439#endif
433 verbose_printk(KERN_NOTICE EXC_0x27(KERN_NOTICE)); 440 strerror = KERN_NOTICE EXC_0x27(KERN_NOTICE);
434 CHK_DEBUGGER_TRAP_MAYBE(); 441 CHK_DEBUGGER_TRAP_MAYBE();
435 break; 442 break;
436 /* 0x28 - Emulation Watchpoint, handled here */ 443 /* 0x28 - Emulation Watchpoint, handled here */
@@ -440,8 +447,8 @@ asmlinkage void trap_c(struct pt_regs *fp)
440 pr_debug(EXC_0x28(KERN_DEBUG)); 447 pr_debug(EXC_0x28(KERN_DEBUG));
441 CHK_DEBUGGER_TRAP_MAYBE(); 448 CHK_DEBUGGER_TRAP_MAYBE();
442 /* Check if this is a watchpoint in kernel space */ 449 /* Check if this is a watchpoint in kernel space */
443 if (fp->ipend & 0xffc0) 450 if (kernel_mode_regs(fp))
444 return; 451 goto traps_done;
445 else 452 else
446 break; 453 break;
447#ifdef CONFIG_BF535 454#ifdef CONFIG_BF535
@@ -449,7 +456,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
449 case VEC_ISTRU_VL: /* ADSP-BF535 only (MH) */ 456 case VEC_ISTRU_VL: /* ADSP-BF535 only (MH) */
450 info.si_code = BUS_OPFETCH; 457 info.si_code = BUS_OPFETCH;
451 sig = SIGBUS; 458 sig = SIGBUS;
452 verbose_printk(KERN_NOTICE "BF535: VEC_ISTRU_VL\n"); 459 strerror = KERN_NOTICE "BF535: VEC_ISTRU_VL\n";
453 CHK_DEBUGGER_TRAP_MAYBE(); 460 CHK_DEBUGGER_TRAP_MAYBE();
454 break; 461 break;
455#else 462#else
@@ -459,21 +466,21 @@ asmlinkage void trap_c(struct pt_regs *fp)
459 case VEC_MISALI_I: 466 case VEC_MISALI_I:
460 info.si_code = BUS_ADRALN; 467 info.si_code = BUS_ADRALN;
461 sig = SIGBUS; 468 sig = SIGBUS;
462 verbose_printk(KERN_NOTICE EXC_0x2A(KERN_NOTICE)); 469 strerror = KERN_NOTICE EXC_0x2A(KERN_NOTICE);
463 CHK_DEBUGGER_TRAP_MAYBE(); 470 CHK_DEBUGGER_TRAP_MAYBE();
464 break; 471 break;
465 /* 0x2B - Instruction CPLB protection violation, handled here */ 472 /* 0x2B - Instruction CPLB protection violation, handled here */
466 case VEC_CPLB_I_VL: 473 case VEC_CPLB_I_VL:
467 info.si_code = ILL_CPLB_VI; 474 info.si_code = ILL_CPLB_VI;
468 sig = SIGBUS; 475 sig = SIGBUS;
469 verbose_printk(KERN_NOTICE EXC_0x2B(KERN_NOTICE)); 476 strerror = KERN_NOTICE EXC_0x2B(KERN_NOTICE);
470 CHK_DEBUGGER_TRAP_MAYBE(); 477 CHK_DEBUGGER_TRAP_MAYBE();
471 break; 478 break;
472 /* 0x2C - Instruction CPLB miss, handled in _cplb_hdr */ 479 /* 0x2C - Instruction CPLB miss, handled in _cplb_hdr */
473 case VEC_CPLB_I_M: 480 case VEC_CPLB_I_M:
474 info.si_code = ILL_CPLB_MISS; 481 info.si_code = ILL_CPLB_MISS;
475 sig = SIGBUS; 482 sig = SIGBUS;
476 verbose_printk(KERN_NOTICE EXC_0x2C(KERN_NOTICE)); 483 strerror = KERN_NOTICE EXC_0x2C(KERN_NOTICE);
477 break; 484 break;
478 /* 0x2D - Instruction CPLB Multiple Hits, handled here */ 485 /* 0x2D - Instruction CPLB Multiple Hits, handled here */
479 case VEC_CPLB_I_MHIT: 486 case VEC_CPLB_I_MHIT:
@@ -481,17 +488,17 @@ asmlinkage void trap_c(struct pt_regs *fp)
481 sig = SIGSEGV; 488 sig = SIGSEGV;
482#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO 489#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
483 if (cpu_pda[cpu].icplb_fault_addr < FIXED_CODE_START) 490 if (cpu_pda[cpu].icplb_fault_addr < FIXED_CODE_START)
484 verbose_printk(KERN_NOTICE "Jump to NULL address\n"); 491 strerror = KERN_NOTICE "Jump to NULL address\n";
485 else 492 else
486#endif 493#endif
487 verbose_printk(KERN_NOTICE EXC_0x2D(KERN_NOTICE)); 494 strerror = KERN_NOTICE EXC_0x2D(KERN_NOTICE);
488 CHK_DEBUGGER_TRAP_MAYBE(); 495 CHK_DEBUGGER_TRAP_MAYBE();
489 break; 496 break;
490 /* 0x2E - Illegal use of Supervisor Resource, handled here */ 497 /* 0x2E - Illegal use of Supervisor Resource, handled here */
491 case VEC_ILL_RES: 498 case VEC_ILL_RES:
492 info.si_code = ILL_PRVOPC; 499 info.si_code = ILL_PRVOPC;
493 sig = SIGILL; 500 sig = SIGILL;
494 verbose_printk(KERN_NOTICE EXC_0x2E(KERN_NOTICE)); 501 strerror = KERN_NOTICE EXC_0x2E(KERN_NOTICE);
495 CHK_DEBUGGER_TRAP_MAYBE(); 502 CHK_DEBUGGER_TRAP_MAYBE();
496 break; 503 break;
497 /* 0x2F - Reserved, Caught by default */ 504 /* 0x2F - Reserved, Caught by default */
@@ -519,17 +526,17 @@ asmlinkage void trap_c(struct pt_regs *fp)
519 case (SEQSTAT_HWERRCAUSE_SYSTEM_MMR): 526 case (SEQSTAT_HWERRCAUSE_SYSTEM_MMR):
520 info.si_code = BUS_ADRALN; 527 info.si_code = BUS_ADRALN;
521 sig = SIGBUS; 528 sig = SIGBUS;
522 verbose_printk(KERN_NOTICE HWC_x2(KERN_NOTICE)); 529 strerror = KERN_NOTICE HWC_x2(KERN_NOTICE);
523 break; 530 break;
524 /* External Memory Addressing Error */ 531 /* External Memory Addressing Error */
525 case (SEQSTAT_HWERRCAUSE_EXTERN_ADDR): 532 case (SEQSTAT_HWERRCAUSE_EXTERN_ADDR):
526 info.si_code = BUS_ADRERR; 533 info.si_code = BUS_ADRERR;
527 sig = SIGBUS; 534 sig = SIGBUS;
528 verbose_printk(KERN_NOTICE HWC_x3(KERN_NOTICE)); 535 strerror = KERN_NOTICE HWC_x3(KERN_NOTICE);
529 break; 536 break;
530 /* Performance Monitor Overflow */ 537 /* Performance Monitor Overflow */
531 case (SEQSTAT_HWERRCAUSE_PERF_FLOW): 538 case (SEQSTAT_HWERRCAUSE_PERF_FLOW):
532 verbose_printk(KERN_NOTICE HWC_x12(KERN_NOTICE)); 539 strerror = KERN_NOTICE HWC_x12(KERN_NOTICE);
533 break; 540 break;
534 /* RAISE 5 instruction */ 541 /* RAISE 5 instruction */
535 case (SEQSTAT_HWERRCAUSE_RAISE_5): 542 case (SEQSTAT_HWERRCAUSE_RAISE_5):
@@ -546,7 +553,6 @@ asmlinkage void trap_c(struct pt_regs *fp)
546 * if we get here we hit a reserved one, so panic 553 * if we get here we hit a reserved one, so panic
547 */ 554 */
548 default: 555 default:
549 oops_in_progress = 1;
550 info.si_code = ILL_ILLPARAOP; 556 info.si_code = ILL_ILLPARAOP;
551 sig = SIGILL; 557 sig = SIGILL;
552 verbose_printk(KERN_EMERG "Caught Unhandled Exception, code = %08lx\n", 558 verbose_printk(KERN_EMERG "Caught Unhandled Exception, code = %08lx\n",
@@ -557,6 +563,16 @@ asmlinkage void trap_c(struct pt_regs *fp)
557 563
558 BUG_ON(sig == 0); 564 BUG_ON(sig == 0);
559 565
566 /* If the fault was caused by a kernel thread, or interrupt handler
567 * we will kernel panic, so the system reboots.
568 */
569 if (kernel_mode_regs(fp) || (current && !current->mm)) {
570 console_verbose();
571 oops_in_progress = 1;
572 if (strerror)
573 verbose_printk(strerror);
574 }
575
560 if (sig != SIGTRAP) { 576 if (sig != SIGTRAP) {
561 dump_bfin_process(fp); 577 dump_bfin_process(fp);
562 dump_bfin_mem(fp); 578 dump_bfin_mem(fp);
@@ -606,8 +622,8 @@ asmlinkage void trap_c(struct pt_regs *fp)
606 if (ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8)) 622 if (ANOMALY_05000461 && trapnr == VEC_HWERR && !access_ok(VERIFY_READ, fp->pc, 8))
607 fp->pc = SAFE_USER_INSTRUCTION; 623 fp->pc = SAFE_USER_INSTRUCTION;
608 624
625 traps_done:
609 trace_buffer_restore(j); 626 trace_buffer_restore(j);
610 return;
611} 627}
612 628
613/* Typical exception handling routines */ 629/* Typical exception handling routines */
@@ -792,6 +808,18 @@ void dump_bfin_trace_buffer(void)
792} 808}
793EXPORT_SYMBOL(dump_bfin_trace_buffer); 809EXPORT_SYMBOL(dump_bfin_trace_buffer);
794 810
811#ifdef CONFIG_BUG
812int is_valid_bugaddr(unsigned long addr)
813{
814 unsigned short opcode;
815
816 if (!get_instruction(&opcode, (unsigned short *)addr))
817 return 0;
818
819 return opcode == BFIN_BUG_OPCODE;
820}
821#endif
822
795/* 823/*
796 * Checks to see if the address pointed to is either a 824 * Checks to see if the address pointed to is either a
797 * 16-bit CALL instruction, or a 32-bit CALL instruction 825 * 16-bit CALL instruction, or a 32-bit CALL instruction
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 8b67167cb4f4..6ac307ca0d80 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -54,6 +54,7 @@ SECTIONS
54 SCHED_TEXT 54 SCHED_TEXT
55#endif 55#endif
56 LOCK_TEXT 56 LOCK_TEXT
57 IRQENTRY_TEXT
57 KPROBES_TEXT 58 KPROBES_TEXT
58 *(.text.*) 59 *(.text.*)
59 *(.fixup) 60 *(.fixup)
@@ -166,6 +167,20 @@ SECTIONS
166 } 167 }
167 PERCPU(4) 168 PERCPU(4)
168 SECURITY_INIT 169 SECURITY_INIT
170
171 /* we have to discard exit text and such at runtime, not link time, to
172 * handle embedded cross-section references (alt instructions, bug
173 * table, eh_frame, etc...)
174 */
175 .exit.text :
176 {
177 EXIT_TEXT
178 }
179 .exit.data :
180 {
181 EXIT_DATA
182 }
183
169 .init.ramfs : 184 .init.ramfs :
170 { 185 {
171 . = ALIGN(4); 186 . = ALIGN(4);
@@ -264,8 +279,6 @@ SECTIONS
264 279
265 /DISCARD/ : 280 /DISCARD/ :
266 { 281 {
267 EXIT_TEXT
268 EXIT_DATA
269 *(.exitcall.exit) 282 *(.exitcall.exit)
270 } 283 }
271} 284}
diff --git a/arch/blackfin/lib/checksum.c b/arch/blackfin/lib/checksum.c
index 762a7f02970a..cd605e7d8518 100644
--- a/arch/blackfin/lib/checksum.c
+++ b/arch/blackfin/lib/checksum.c
@@ -116,6 +116,7 @@ __sum16 ip_compute_csum(const void *buff, int len)
116{ 116{
117 return (__force __sum16)~do_csum(buff, len); 117 return (__force __sum16)~do_csum(buff, len);
118} 118}
119EXPORT_SYMBOL(ip_compute_csum);
119 120
120/* 121/*
121 * copy from fs while checksumming, otherwise like csum_partial 122 * copy from fs while checksumming, otherwise like csum_partial
@@ -130,6 +131,7 @@ csum_partial_copy_from_user(const void __user *src, void *dst,
130 memcpy(dst, (__force void *)src, len); 131 memcpy(dst, (__force void *)src, len);
131 return csum_partial(dst, len, sum); 132 return csum_partial(dst, len, sum);
132} 133}
134EXPORT_SYMBOL(csum_partial_copy_from_user);
133 135
134/* 136/*
135 * copy from ds while checksumming, otherwise like csum_partial 137 * copy from ds while checksumming, otherwise like csum_partial
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c
index 62bba09bcce6..1382f0382359 100644
--- a/arch/blackfin/mach-bf518/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf518/boards/ezbrd.c
@@ -246,7 +246,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
246 .modalias = "m25p80", /* Name of spi_driver for this device */ 246 .modalias = "m25p80", /* Name of spi_driver for this device */
247 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 247 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
248 .bus_num = 0, /* Framework bus number */ 248 .bus_num = 0, /* Framework bus number */
249 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ 249 .chip_select = 2, /* On BF518F-EZBRD it's SPI0_SSEL2 */
250 .platform_data = &bfin_spi_flash_data, 250 .platform_data = &bfin_spi_flash_data,
251 .controller_data = &spi_flash_chip_info, 251 .controller_data = &spi_flash_chip_info,
252 .mode = SPI_MODE_3, 252 .mode = SPI_MODE_3,
@@ -369,6 +369,11 @@ static struct resource bfin_spi0_resource[] = {
369 [1] = { 369 [1] = {
370 .start = CH_SPI0, 370 .start = CH_SPI0,
371 .end = CH_SPI0, 371 .end = CH_SPI0,
372 .flags = IORESOURCE_DMA,
373 },
374 [2] = {
375 .start = IRQ_SPI0,
376 .end = IRQ_SPI0,
372 .flags = IORESOURCE_IRQ, 377 .flags = IORESOURCE_IRQ,
373 }, 378 },
374}; 379};
@@ -399,6 +404,11 @@ static struct resource bfin_spi1_resource[] = {
399 [1] = { 404 [1] = {
400 .start = CH_SPI1, 405 .start = CH_SPI1,
401 .end = CH_SPI1, 406 .end = CH_SPI1,
407 .flags = IORESOURCE_DMA,
408 },
409 [2] = {
410 .start = IRQ_SPI1,
411 .end = IRQ_SPI1,
402 .flags = IORESOURCE_IRQ, 412 .flags = IORESOURCE_IRQ,
403 }, 413 },
404}; 414};
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index 6d6f9effa0bb..1eaf27ff722e 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -664,6 +664,11 @@ static struct resource bfin_spi0_resource[] = {
664 [1] = { 664 [1] = {
665 .start = CH_SPI, 665 .start = CH_SPI,
666 .end = CH_SPI, 666 .end = CH_SPI,
667 .flags = IORESOURCE_DMA,
668 },
669 [2] = {
670 .start = IRQ_SPI,
671 .end = IRQ_SPI,
667 .flags = IORESOURCE_IRQ, 672 .flags = IORESOURCE_IRQ,
668 }, 673 },
669}; 674};
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c
index 1435c5d38cd5..9f9c0005dcf1 100644
--- a/arch/blackfin/mach-bf527/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf527/boards/ezbrd.c
@@ -467,6 +467,11 @@ static struct resource bfin_spi0_resource[] = {
467 [1] = { 467 [1] = {
468 .start = CH_SPI, 468 .start = CH_SPI,
469 .end = CH_SPI, 469 .end = CH_SPI,
470 .flags = IORESOURCE_DMA,
471 },
472 [2] = {
473 .start = IRQ_SPI,
474 .end = IRQ_SPI,
470 .flags = IORESOURCE_IRQ, 475 .flags = IORESOURCE_IRQ,
471 }, 476 },
472}; 477};
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index 147edd1eb1ad..3e5b7db6b065 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -723,6 +723,11 @@ static struct resource bfin_spi0_resource[] = {
723 [1] = { 723 [1] = {
724 .start = CH_SPI, 724 .start = CH_SPI,
725 .end = CH_SPI, 725 .end = CH_SPI,
726 .flags = IORESOURCE_DMA,
727 },
728 [2] = {
729 .start = IRQ_SPI,
730 .end = IRQ_SPI,
726 .flags = IORESOURCE_IRQ, 731 .flags = IORESOURCE_IRQ,
727 }, 732 },
728}; 733};
diff --git a/arch/blackfin/mach-bf533/boards/H8606.c b/arch/blackfin/mach-bf533/boards/H8606.c
index 895f213ea454..38cf8ffd6d74 100644
--- a/arch/blackfin/mach-bf533/boards/H8606.c
+++ b/arch/blackfin/mach-bf533/boards/H8606.c
@@ -266,6 +266,11 @@ static struct resource bfin_spi0_resource[] = {
266 [1] = { 266 [1] = {
267 .start = CH_SPI, 267 .start = CH_SPI,
268 .end = CH_SPI, 268 .end = CH_SPI,
269 .flags = IORESOURCE_DMA,
270 },
271 [2] = {
272 .start = IRQ_SPI,
273 .end = IRQ_SPI,
269 .flags = IORESOURCE_IRQ, 274 .flags = IORESOURCE_IRQ,
270 } 275 }
271}; 276};
diff --git a/arch/blackfin/mach-bf533/boards/blackstamp.c b/arch/blackfin/mach-bf533/boards/blackstamp.c
index 0765872a8ada..9ecdc361fa6d 100644
--- a/arch/blackfin/mach-bf533/boards/blackstamp.c
+++ b/arch/blackfin/mach-bf533/boards/blackstamp.c
@@ -162,6 +162,11 @@ static struct resource bfin_spi0_resource[] = {
162 [1] = { 162 [1] = {
163 .start = CH_SPI, 163 .start = CH_SPI,
164 .end = CH_SPI, 164 .end = CH_SPI,
165 .flags = IORESOURCE_DMA,
166 },
167 [2] = {
168 .start = IRQ_SPI,
169 .end = IRQ_SPI,
165 .flags = IORESOURCE_IRQ, 170 .flags = IORESOURCE_IRQ,
166 } 171 }
167}; 172};
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
index a727e538fa28..1443e92d8b62 100644
--- a/arch/blackfin/mach-bf533/boards/cm_bf533.c
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -160,6 +160,11 @@ static struct resource bfin_spi0_resource[] = {
160 [1] = { 160 [1] = {
161 .start = CH_SPI, 161 .start = CH_SPI,
162 .end = CH_SPI, 162 .end = CH_SPI,
163 .flags = IORESOURCE_DMA,
164 },
165 [2] = {
166 .start = IRQ_SPI,
167 .end = IRQ_SPI,
163 .flags = IORESOURCE_IRQ, 168 .flags = IORESOURCE_IRQ,
164 } 169 }
165}; 170};
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index 842f1c9c2393..89a5ec4ca048 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -196,6 +196,11 @@ static struct resource bfin_spi0_resource[] = {
196 [1] = { 196 [1] = {
197 .start = CH_SPI, 197 .start = CH_SPI,
198 .end = CH_SPI, 198 .end = CH_SPI,
199 .flags = IORESOURCE_DMA,
200 },
201 [2] = {
202 .start = IRQ_SPI,
203 .end = IRQ_SPI,
199 .flags = IORESOURCE_IRQ, 204 .flags = IORESOURCE_IRQ,
200 } 205 }
201}; 206};
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index e19c565ade16..a68ade8a3ca2 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -299,6 +299,11 @@ static struct resource bfin_spi0_resource[] = {
299 [1] = { 299 [1] = {
300 .start = CH_SPI, 300 .start = CH_SPI,
301 .end = CH_SPI, 301 .end = CH_SPI,
302 .flags = IORESOURCE_DMA,
303 },
304 [2] = {
305 .start = IRQ_SPI,
306 .end = IRQ_SPI,
302 .flags = IORESOURCE_IRQ, 307 .flags = IORESOURCE_IRQ,
303 } 308 }
304}; 309};
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537.c b/arch/blackfin/mach-bf537/boards/cm_bf537.c
index 4fee19673127..2a87d1cfcd06 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537.c
@@ -182,8 +182,13 @@ static struct resource bfin_spi0_resource[] = {
182 [1] = { 182 [1] = {
183 .start = CH_SPI, 183 .start = CH_SPI,
184 .end = CH_SPI, 184 .end = CH_SPI,
185 .flags = IORESOURCE_DMA,
186 },
187 [2] = {
188 .start = IRQ_SPI,
189 .end = IRQ_SPI,
185 .flags = IORESOURCE_IRQ, 190 .flags = IORESOURCE_IRQ,
186 } 191 },
187}; 192};
188 193
189/* SPI controller data */ 194/* SPI controller data */
diff --git a/arch/blackfin/mach-bf537/boards/minotaur.c b/arch/blackfin/mach-bf537/boards/minotaur.c
index 3c159819e555..399f81da7b93 100644
--- a/arch/blackfin/mach-bf537/boards/minotaur.c
+++ b/arch/blackfin/mach-bf537/boards/minotaur.c
@@ -184,6 +184,11 @@ static struct resource bfin_spi0_resource[] = {
184 [1] = { 184 [1] = {
185 .start = CH_SPI, 185 .start = CH_SPI,
186 .end = CH_SPI, 186 .end = CH_SPI,
187 .flags = IORESOURCE_DMA,
188 },
189 [2] = {
190 .start = IRQ_SPI,
191 .end = IRQ_SPI,
187 .flags = IORESOURCE_IRQ, 192 .flags = IORESOURCE_IRQ,
188 }, 193 },
189}; 194};
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c
index 26707ce39f29..838240f151f5 100644
--- a/arch/blackfin/mach-bf537/boards/pnav10.c
+++ b/arch/blackfin/mach-bf537/boards/pnav10.c
@@ -398,8 +398,13 @@ static struct resource bfin_spi0_resource[] = {
398 [1] = { 398 [1] = {
399 .start = CH_SPI, 399 .start = CH_SPI,
400 .end = CH_SPI, 400 .end = CH_SPI,
401 .flags = IORESOURCE_DMA,
402 },
403 [2] = {
404 .start = IRQ_SPI,
405 .end = IRQ_SPI,
401 .flags = IORESOURCE_IRQ, 406 .flags = IORESOURCE_IRQ,
402 } 407 },
403}; 408};
404 409
405/* SPI controller data */ 410/* SPI controller data */
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index dfb5036f8a6b..ff7228caa7da 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -1345,7 +1345,7 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
1345#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE) 1345#if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1346 { 1346 {
1347 I2C_BOARD_INFO("pmic-adp5520", 0x32), 1347 I2C_BOARD_INFO("pmic-adp5520", 0x32),
1348 .irq = IRQ_PF7, 1348 .irq = IRQ_PG0,
1349 .platform_data = (void *)&adp5520_pdev_data, 1349 .platform_data = (void *)&adp5520_pdev_data,
1350 }, 1350 },
1351#endif 1351#endif
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
index 280574591201..e523e6e610d0 100644
--- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
@@ -182,6 +182,11 @@ static struct resource bfin_spi0_resource[] = {
182 [1] = { 182 [1] = {
183 .start = CH_SPI, 183 .start = CH_SPI,
184 .end = CH_SPI, 184 .end = CH_SPI,
185 .flags = IORESOURCE_DMA,
186 },
187 [2] = {
188 .start = IRQ_SPI,
189 .end = IRQ_SPI,
185 .flags = IORESOURCE_IRQ, 190 .flags = IORESOURCE_IRQ,
186 } 191 }
187}; 192};
diff --git a/arch/blackfin/mach-bf538/boards/ezkit.c b/arch/blackfin/mach-bf538/boards/ezkit.c
index e37cb9378884..57695b4c3c09 100644
--- a/arch/blackfin/mach-bf538/boards/ezkit.c
+++ b/arch/blackfin/mach-bf538/boards/ezkit.c
@@ -352,6 +352,11 @@ static struct resource bfin_spi0_resource[] = {
352 [1] = { 352 [1] = {
353 .start = CH_SPI0, 353 .start = CH_SPI0,
354 .end = CH_SPI0, 354 .end = CH_SPI0,
355 .flags = IORESOURCE_DMA,
356 },
357 [2] = {
358 .start = IRQ_SPI0,
359 .end = IRQ_SPI0,
355 .flags = IORESOURCE_IRQ, 360 .flags = IORESOURCE_IRQ,
356 } 361 }
357}; 362};
@@ -366,6 +371,11 @@ static struct resource bfin_spi1_resource[] = {
366 [1] = { 371 [1] = {
367 .start = CH_SPI1, 372 .start = CH_SPI1,
368 .end = CH_SPI1, 373 .end = CH_SPI1,
374 .flags = IORESOURCE_DMA,
375 },
376 [2] = {
377 .start = IRQ_SPI1,
378 .end = IRQ_SPI1,
369 .flags = IORESOURCE_IRQ, 379 .flags = IORESOURCE_IRQ,
370 } 380 }
371}; 381};
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index f53ad682530b..f5a3c30a41bd 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -612,6 +612,11 @@ static struct resource bfin_spi0_resource[] = {
612 [1] = { 612 [1] = {
613 .start = CH_SPI0, 613 .start = CH_SPI0,
614 .end = CH_SPI0, 614 .end = CH_SPI0,
615 .flags = IORESOURCE_DMA,
616 },
617 [2] = {
618 .start = IRQ_SPI0,
619 .end = IRQ_SPI0,
615 .flags = IORESOURCE_IRQ, 620 .flags = IORESOURCE_IRQ,
616 } 621 }
617}; 622};
@@ -626,6 +631,11 @@ static struct resource bfin_spi1_resource[] = {
626 [1] = { 631 [1] = {
627 .start = CH_SPI1, 632 .start = CH_SPI1,
628 .end = CH_SPI1, 633 .end = CH_SPI1,
634 .flags = IORESOURCE_DMA,
635 },
636 [2] = {
637 .start = IRQ_SPI1,
638 .end = IRQ_SPI1,
629 .flags = IORESOURCE_IRQ, 639 .flags = IORESOURCE_IRQ,
630 } 640 }
631}; 641};
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index add5a17452ce..805a57b5e650 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -396,6 +396,8 @@ static struct platform_device bfin_sir3_device = {
396#endif 396#endif
397 397
398#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 398#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
399#include <linux/smsc911x.h>
400
399static struct resource smsc911x_resources[] = { 401static struct resource smsc911x_resources[] = {
400 { 402 {
401 .name = "smsc911x-memory", 403 .name = "smsc911x-memory",
@@ -409,11 +411,22 @@ static struct resource smsc911x_resources[] = {
409 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, 411 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
410 }, 412 },
411}; 413};
414
415static struct smsc911x_platform_config smsc911x_config = {
416 .flags = SMSC911X_USE_32BIT,
417 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
418 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
419 .phy_interface = PHY_INTERFACE_MODE_MII,
420};
421
412static struct platform_device smsc911x_device = { 422static struct platform_device smsc911x_device = {
413 .name = "smsc911x", 423 .name = "smsc911x",
414 .id = 0, 424 .id = 0,
415 .num_resources = ARRAY_SIZE(smsc911x_resources), 425 .num_resources = ARRAY_SIZE(smsc911x_resources),
416 .resource = smsc911x_resources, 426 .resource = smsc911x_resources,
427 .dev = {
428 .platform_data = &smsc911x_config,
429 },
417}; 430};
418#endif 431#endif
419 432
@@ -741,6 +754,11 @@ static struct resource bfin_spi0_resource[] = {
741 [1] = { 754 [1] = {
742 .start = CH_SPI0, 755 .start = CH_SPI0,
743 .end = CH_SPI0, 756 .end = CH_SPI0,
757 .flags = IORESOURCE_DMA,
758 },
759 [2] = {
760 .start = IRQ_SPI0,
761 .end = IRQ_SPI0,
744 .flags = IORESOURCE_IRQ, 762 .flags = IORESOURCE_IRQ,
745 } 763 }
746}; 764};
@@ -755,6 +773,11 @@ static struct resource bfin_spi1_resource[] = {
755 [1] = { 773 [1] = {
756 .start = CH_SPI1, 774 .start = CH_SPI1,
757 .end = CH_SPI1, 775 .end = CH_SPI1,
776 .flags = IORESOURCE_DMA,
777 },
778 [2] = {
779 .start = IRQ_SPI1,
780 .end = IRQ_SPI1,
758 .flags = IORESOURCE_IRQ, 781 .flags = IORESOURCE_IRQ,
759 } 782 }
760}; 783};
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c
index 0dd9685e5d53..0c9d72c5f5ba 100644
--- a/arch/blackfin/mach-bf561/boards/cm_bf561.c
+++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c
@@ -177,8 +177,13 @@ static struct resource bfin_spi0_resource[] = {
177 [1] = { 177 [1] = {
178 .start = CH_SPI, 178 .start = CH_SPI,
179 .end = CH_SPI, 179 .end = CH_SPI,
180 .flags = IORESOURCE_DMA,
181 },
182 [2] = {
183 .start = IRQ_SPI,
184 .end = IRQ_SPI,
180 .flags = IORESOURCE_IRQ, 185 .flags = IORESOURCE_IRQ,
181 } 186 },
182}; 187};
183 188
184/* SPI controller data */ 189/* SPI controller data */
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 0e2178a1aec5..b5ef7ff7b7bd 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -304,6 +304,11 @@ static struct resource bfin_spi0_resource[] = {
304 [1] = { 304 [1] = {
305 .start = CH_SPI, 305 .start = CH_SPI,
306 .end = CH_SPI, 306 .end = CH_SPI,
307 .flags = IORESOURCE_DMA,
308 },
309 [2] = {
310 .start = IRQ_SPI,
311 .end = IRQ_SPI,
307 .flags = IORESOURCE_IRQ, 312 .flags = IORESOURCE_IRQ,
308 } 313 }
309}; 314};
diff --git a/arch/blackfin/mach-common/cache-c.c b/arch/blackfin/mach-common/cache-c.c
index e6ab1f815123..b59ce3cb3807 100644
--- a/arch/blackfin/mach-common/cache-c.c
+++ b/arch/blackfin/mach-common/cache-c.c
@@ -16,9 +16,21 @@
16void blackfin_invalidate_entire_dcache(void) 16void blackfin_invalidate_entire_dcache(void)
17{ 17{
18 u32 dmem = bfin_read_DMEM_CONTROL(); 18 u32 dmem = bfin_read_DMEM_CONTROL();
19 SSYNC();
20 bfin_write_DMEM_CONTROL(dmem & ~0xc); 19 bfin_write_DMEM_CONTROL(dmem & ~0xc);
21 SSYNC(); 20 SSYNC();
22 bfin_write_DMEM_CONTROL(dmem); 21 bfin_write_DMEM_CONTROL(dmem);
23 SSYNC(); 22 SSYNC();
24} 23}
24
25/* Invalidate the Entire Instruction cache by
26 * clearing IMC bit
27 */
28void blackfin_invalidate_entire_icache(void)
29{
30 u32 imem = bfin_read_IMEM_CONTROL();
31 bfin_write_IMEM_CONTROL(imem & ~0x4);
32 SSYNC();
33 bfin_write_IMEM_CONTROL(imem);
34 SSYNC();
35}
36
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index da0558ad1b1a..31fa313e81cf 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -42,6 +42,7 @@
42#include <asm/thread_info.h> /* TIF_NEED_RESCHED */ 42#include <asm/thread_info.h> /* TIF_NEED_RESCHED */
43#include <asm/asm-offsets.h> 43#include <asm/asm-offsets.h>
44#include <asm/trace.h> 44#include <asm/trace.h>
45#include <asm/traps.h>
45 46
46#include <asm/context.S> 47#include <asm/context.S>
47 48
@@ -84,13 +85,15 @@ ENTRY(_ex_workaround_261)
84 if !cc jump _bfin_return_from_exception; 85 if !cc jump _bfin_return_from_exception;
85 /* fall through */ 86 /* fall through */
86 R7 = P4; 87 R7 = P4;
87 R6 = 0x26; /* Data CPLB Miss */ 88 R6 = VEC_CPLB_M; /* Data CPLB Miss */
88 cc = R6 == R7; 89 cc = R6 == R7;
89 if cc jump _ex_dcplb_miss (BP); 90 if cc jump _ex_dcplb_miss (BP);
90 R6 = 0x23; /* Data CPLB Miss */ 91#ifdef CONFIG_MPU
92 R6 = VEC_CPLB_VL; /* Data CPLB Violation */
91 cc = R6 == R7; 93 cc = R6 == R7;
92 if cc jump _ex_dcplb_viol (BP); 94 if cc jump _ex_dcplb_viol (BP);
93 /* Handle 0x23 Data CPLB Protection Violation 95#endif
96 /* Handle Data CPLB Protection Violation
94 * and Data CPLB Multiple Hits - Linux Trap Zero 97 * and Data CPLB Multiple Hits - Linux Trap Zero
95 */ 98 */
96 jump _ex_trap_c; 99 jump _ex_trap_c;
@@ -270,7 +273,7 @@ ENTRY(_bfin_return_from_exception)
270 r6.l = lo(SEQSTAT_EXCAUSE); 273 r6.l = lo(SEQSTAT_EXCAUSE);
271 r6.h = hi(SEQSTAT_EXCAUSE); 274 r6.h = hi(SEQSTAT_EXCAUSE);
272 r7 = r7 & r6; 275 r7 = r7 & r6;
273 r6 = 0x25; 276 r6 = VEC_UNCOV;
274 CC = R7 == R6; 277 CC = R7 == R6;
275 if CC JUMP _double_fault; 278 if CC JUMP _double_fault;
276#endif 279#endif
@@ -1605,6 +1608,7 @@ ENTRY(_sys_call_table)
1605 .long _sys_inotify_init1 /* 365 */ 1608 .long _sys_inotify_init1 /* 365 */
1606 .long _sys_preadv 1609 .long _sys_preadv
1607 .long _sys_pwritev 1610 .long _sys_pwritev
1611 .long _sys_rt_tgsigqueueinfo
1608 1612
1609 .rept NR_syscalls-(.-_sys_call_table)/4 1613 .rept NR_syscalls-(.-_sys_call_table)/4
1610 .long _sys_ni_syscall 1614 .long _sys_ni_syscall
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index 3b8ebaee77f2..61840059dfac 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -144,7 +144,7 @@ static void ipi_call_function(unsigned int cpu, struct ipi_message *msg)
144 144
145static irqreturn_t ipi_handler(int irq, void *dev_instance) 145static irqreturn_t ipi_handler(int irq, void *dev_instance)
146{ 146{
147 struct ipi_message *msg, *mg; 147 struct ipi_message *msg;
148 struct ipi_message_queue *msg_queue; 148 struct ipi_message_queue *msg_queue;
149 unsigned int cpu = smp_processor_id(); 149 unsigned int cpu = smp_processor_id();
150 150
@@ -154,7 +154,8 @@ static irqreturn_t ipi_handler(int irq, void *dev_instance)
154 msg_queue->count++; 154 msg_queue->count++;
155 155
156 spin_lock(&msg_queue->lock); 156 spin_lock(&msg_queue->lock);
157 list_for_each_entry_safe(msg, mg, &msg_queue->head, list) { 157 while (!list_empty(&msg_queue->head)) {
158 msg = list_entry(msg_queue->head.next, typeof(*msg), list);
158 list_del(&msg->list); 159 list_del(&msg->list);
159 switch (msg->type) { 160 switch (msg->type) {
160 case BFIN_IPI_RESCHEDULE: 161 case BFIN_IPI_RESCHEDULE:
@@ -221,7 +222,7 @@ int smp_call_function(void (*func)(void *info), void *info, int wait)
221 for_each_cpu_mask(cpu, callmap) { 222 for_each_cpu_mask(cpu, callmap) {
222 msg_queue = &per_cpu(ipi_msg_queue, cpu); 223 msg_queue = &per_cpu(ipi_msg_queue, cpu);
223 spin_lock_irqsave(&msg_queue->lock, flags); 224 spin_lock_irqsave(&msg_queue->lock, flags);
224 list_add(&msg->list, &msg_queue->head); 225 list_add_tail(&msg->list, &msg_queue->head);
225 spin_unlock_irqrestore(&msg_queue->lock, flags); 226 spin_unlock_irqrestore(&msg_queue->lock, flags);
226 platform_send_ipi_cpu(cpu); 227 platform_send_ipi_cpu(cpu);
227 } 228 }
@@ -261,7 +262,7 @@ int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
261 262
262 msg_queue = &per_cpu(ipi_msg_queue, cpu); 263 msg_queue = &per_cpu(ipi_msg_queue, cpu);
263 spin_lock_irqsave(&msg_queue->lock, flags); 264 spin_lock_irqsave(&msg_queue->lock, flags);
264 list_add(&msg->list, &msg_queue->head); 265 list_add_tail(&msg->list, &msg_queue->head);
265 spin_unlock_irqrestore(&msg_queue->lock, flags); 266 spin_unlock_irqrestore(&msg_queue->lock, flags);
266 platform_send_ipi_cpu(cpu); 267 platform_send_ipi_cpu(cpu);
267 268
@@ -292,7 +293,7 @@ void smp_send_reschedule(int cpu)
292 293
293 msg_queue = &per_cpu(ipi_msg_queue, cpu); 294 msg_queue = &per_cpu(ipi_msg_queue, cpu);
294 spin_lock_irqsave(&msg_queue->lock, flags); 295 spin_lock_irqsave(&msg_queue->lock, flags);
295 list_add(&msg->list, &msg_queue->head); 296 list_add_tail(&msg->list, &msg_queue->head);
296 spin_unlock_irqrestore(&msg_queue->lock, flags); 297 spin_unlock_irqrestore(&msg_queue->lock, flags);
297 platform_send_ipi_cpu(cpu); 298 platform_send_ipi_cpu(cpu);
298 299
@@ -320,7 +321,7 @@ void smp_send_stop(void)
320 for_each_cpu_mask(cpu, callmap) { 321 for_each_cpu_mask(cpu, callmap) {
321 msg_queue = &per_cpu(ipi_msg_queue, cpu); 322 msg_queue = &per_cpu(ipi_msg_queue, cpu);
322 spin_lock_irqsave(&msg_queue->lock, flags); 323 spin_lock_irqsave(&msg_queue->lock, flags);
323 list_add(&msg->list, &msg_queue->head); 324 list_add_tail(&msg->list, &msg_queue->head);
324 spin_unlock_irqrestore(&msg_queue->lock, flags); 325 spin_unlock_irqrestore(&msg_queue->lock, flags);
325 platform_send_ipi_cpu(cpu); 326 platform_send_ipi_cpu(cpu);
326 } 327 }
@@ -468,6 +469,17 @@ void smp_icache_flush_range_others(unsigned long start, unsigned long end)
468} 469}
469EXPORT_SYMBOL_GPL(smp_icache_flush_range_others); 470EXPORT_SYMBOL_GPL(smp_icache_flush_range_others);
470 471
472#ifdef __ARCH_SYNC_CORE_ICACHE
473void resync_core_icache(void)
474{
475 unsigned int cpu = get_cpu();
476 blackfin_invalidate_entire_icache();
477 ++per_cpu(cpu_data, cpu).icache_invld_count;
478 put_cpu();
479}
480EXPORT_SYMBOL(resync_core_icache);
481#endif
482
471#ifdef __ARCH_SYNC_CORE_DCACHE 483#ifdef __ARCH_SYNC_CORE_DCACHE
472unsigned long barrier_mask __attribute__ ((__section__(".l2.bss"))); 484unsigned long barrier_mask __attribute__ ((__section__(".l2.bss")));
473 485
diff --git a/arch/cris/include/asm/kmap_types.h b/arch/cris/include/asm/kmap_types.h
index 492988cb9077..d2d643c4ea59 100644
--- a/arch/cris/include/asm/kmap_types.h
+++ b/arch/cris/include/asm/kmap_types.h
@@ -5,21 +5,6 @@
5 * is actually used on cris. 5 * is actually used on cris.
6 */ 6 */
7 7
8enum km_type { 8#include <asm-generic/kmap_types.h>
9 KM_BOUNCE_READ,
10 KM_SKB_SUNRPC_DATA,
11 KM_SKB_DATA_SOFTIRQ,
12 KM_USER0,
13 KM_USER1,
14 KM_BIO_SRC_IRQ,
15 KM_BIO_DST_IRQ,
16 KM_PTE0,
17 KM_PTE1,
18 KM_IRQ0,
19 KM_IRQ1,
20 KM_SOFTIRQ0,
21 KM_SOFTIRQ1,
22 KM_TYPE_NR
23};
24 9
25#endif 10#endif
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 4df0b320d524..51dcd04d2777 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -38,10 +38,6 @@
38 38
39static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 39static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
40static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 40static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
41struct mm_struct init_mm = INIT_MM(init_mm);
42
43EXPORT_SYMBOL(init_mm);
44
45/* 41/*
46 * Initial thread structure. 42 * Initial thread structure.
47 * 43 *
diff --git a/arch/frv/kernel/init_task.c b/arch/frv/kernel/init_task.c
index 29429a8b7f6a..1d3df1d9495c 100644
--- a/arch/frv/kernel/init_task.c
+++ b/arch/frv/kernel/init_task.c
@@ -12,10 +12,6 @@
12 12
13static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 13static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
14static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 14static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
15struct mm_struct init_mm = INIT_MM(init_mm);
16
17EXPORT_SYMBOL(init_mm);
18
19/* 15/*
20 * Initial thread structure. 16 * Initial thread structure.
21 * 17 *
diff --git a/arch/h8300/include/asm/kmap_types.h b/arch/h8300/include/asm/kmap_types.h
index 1ec8a3427120..be12a7160116 100644
--- a/arch/h8300/include/asm/kmap_types.h
+++ b/arch/h8300/include/asm/kmap_types.h
@@ -1,21 +1,6 @@
1#ifndef _ASM_H8300_KMAP_TYPES_H 1#ifndef _ASM_H8300_KMAP_TYPES_H
2#define _ASM_H8300_KMAP_TYPES_H 2#define _ASM_H8300_KMAP_TYPES_H
3 3
4enum km_type { 4#include <asm-generic/kmap_types.h>
5 KM_BOUNCE_READ,
6 KM_SKB_SUNRPC_DATA,
7 KM_SKB_DATA_SOFTIRQ,
8 KM_USER0,
9 KM_USER1,
10 KM_BIO_SRC_IRQ,
11 KM_BIO_DST_IRQ,
12 KM_PTE0,
13 KM_PTE1,
14 KM_IRQ0,
15 KM_IRQ1,
16 KM_SOFTIRQ0,
17 KM_SOFTIRQ1,
18 KM_TYPE_NR
19};
20 5
21#endif 6#endif
diff --git a/arch/h8300/kernel/init_task.c b/arch/h8300/kernel/init_task.c
index cb5dc552da97..089c65ed6eb3 100644
--- a/arch/h8300/kernel/init_task.c
+++ b/arch/h8300/kernel/init_task.c
@@ -14,10 +14,6 @@
14 14
15static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 15static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
16static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 16static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
17struct mm_struct init_mm = INIT_MM(init_mm);
18
19EXPORT_SYMBOL(init_mm);
20
21/* 17/*
22 * Initial task structure. 18 * Initial task structure.
23 * 19 *
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 56ceb68eb99d..fe63b2dc9d07 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -1131,7 +1131,7 @@ sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp
1131#ifdef CONFIG_NUMA 1131#ifdef CONFIG_NUMA
1132 { 1132 {
1133 struct page *page; 1133 struct page *page;
1134 page = alloc_pages_node(ioc->node == MAX_NUMNODES ? 1134 page = alloc_pages_exact_node(ioc->node == MAX_NUMNODES ?
1135 numa_node_id() : ioc->node, flags, 1135 numa_node_id() : ioc->node, flags,
1136 get_order(size)); 1136 get_order(size));
1137 1137
diff --git a/arch/ia64/include/asm/kmap_types.h b/arch/ia64/include/asm/kmap_types.h
index 5d1658aa2b3b..05d5f9996105 100644
--- a/arch/ia64/include/asm/kmap_types.h
+++ b/arch/ia64/include/asm/kmap_types.h
@@ -1,30 +1,12 @@
1#ifndef _ASM_IA64_KMAP_TYPES_H 1#ifndef _ASM_IA64_KMAP_TYPES_H
2#define _ASM_IA64_KMAP_TYPES_H 2#define _ASM_IA64_KMAP_TYPES_H
3 3
4
5#ifdef CONFIG_DEBUG_HIGHMEM 4#ifdef CONFIG_DEBUG_HIGHMEM
6# define D(n) __KM_FENCE_##n , 5#define __WITH_KM_FENCE
7#else
8# define D(n)
9#endif 6#endif
10 7
11enum km_type { 8#include <asm-generic/kmap_types.h>
12D(0) KM_BOUNCE_READ,
13D(1) KM_SKB_SUNRPC_DATA,
14D(2) KM_SKB_DATA_SOFTIRQ,
15D(3) KM_USER0,
16D(4) KM_USER1,
17D(5) KM_BIO_SRC_IRQ,
18D(6) KM_BIO_DST_IRQ,
19D(7) KM_PTE0,
20D(8) KM_PTE1,
21D(9) KM_IRQ0,
22D(10) KM_IRQ1,
23D(11) KM_SOFTIRQ0,
24D(12) KM_SOFTIRQ1,
25D(13) KM_TYPE_NR
26};
27 9
28#undef D 10#undef __WITH_KM_FENCE
29 11
30#endif /* _ASM_IA64_KMAP_TYPES_H */ 12#endif /* _ASM_IA64_KMAP_TYPES_H */
diff --git a/arch/ia64/kernel/init_task.c b/arch/ia64/kernel/init_task.c
index 5b0e830c6f33..c475fc281be7 100644
--- a/arch/ia64/kernel/init_task.c
+++ b/arch/ia64/kernel/init_task.c
@@ -19,10 +19,6 @@
19 19
20static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 20static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
21static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 21static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
22struct mm_struct init_mm = INIT_MM(init_mm);
23
24EXPORT_SYMBOL(init_mm);
25
26/* 22/*
27 * Initial task structure. 23 * Initial task structure.
28 * 24 *
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 8f33a8840422..5b17bd402275 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -1829,8 +1829,7 @@ ia64_mca_cpu_init(void *cpu_data)
1829 data = mca_bootmem(); 1829 data = mca_bootmem();
1830 first_time = 0; 1830 first_time = 0;
1831 } else 1831 } else
1832 data = page_address(alloc_pages_node(numa_node_id(), 1832 data = __get_free_pages(GFP_KERNEL, get_order(sz));
1833 GFP_KERNEL, get_order(sz)));
1834 if (!data) 1833 if (!data)
1835 panic("Could not allocate MCA memory for cpu %d\n", 1834 panic("Could not allocate MCA memory for cpu %d\n",
1836 cpu); 1835 cpu);
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 8a06dc480594..bdc176cb5e85 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -5595,7 +5595,7 @@ pfm_interrupt_handler(int irq, void *arg)
5595 (*pfm_alt_intr_handler->handler)(irq, arg, regs); 5595 (*pfm_alt_intr_handler->handler)(irq, arg, regs);
5596 } 5596 }
5597 5597
5598 put_cpu_no_resched(); 5598 put_cpu();
5599 return IRQ_HANDLED; 5599 return IRQ_HANDLED;
5600} 5600}
5601 5601
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c
index 8eff8c1d40a6..6ba72ab42fcc 100644
--- a/arch/ia64/kernel/uncached.c
+++ b/arch/ia64/kernel/uncached.c
@@ -98,7 +98,8 @@ static int uncached_add_chunk(struct uncached_pool *uc_pool, int nid)
98 98
99 /* attempt to allocate a granule's worth of cached memory pages */ 99 /* attempt to allocate a granule's worth of cached memory pages */
100 100
101 page = alloc_pages_node(nid, GFP_KERNEL | __GFP_ZERO | GFP_THISNODE, 101 page = alloc_pages_exact_node(nid,
102 GFP_KERNEL | __GFP_ZERO | GFP_THISNODE,
102 IA64_GRANULE_SHIFT-PAGE_SHIFT); 103 IA64_GRANULE_SHIFT-PAGE_SHIFT);
103 if (!page) { 104 if (!page) {
104 mutex_unlock(&uc_pool->add_chunk_mutex); 105 mutex_unlock(&uc_pool->add_chunk_mutex);
diff --git a/arch/ia64/mm/extable.c b/arch/ia64/mm/extable.c
index e95d5ad9285d..c99a41e29fe8 100644
--- a/arch/ia64/mm/extable.c
+++ b/arch/ia64/mm/extable.c
@@ -8,7 +8,7 @@
8#include <linux/sort.h> 8#include <linux/sort.h>
9 9
10#include <asm/uaccess.h> 10#include <asm/uaccess.h>
11#include <asm/module.h> 11#include <linux/module.h>
12 12
13static int cmp_ex(const void *a, const void *b) 13static int cmp_ex(const void *a, const void *b)
14{ 14{
@@ -55,7 +55,7 @@ void sort_extable (struct exception_table_entry *start,
55 55
56static inline unsigned long ex_to_addr(const struct exception_table_entry *x) 56static inline unsigned long ex_to_addr(const struct exception_table_entry *x)
57{ 57{
58 return (unsigned long)&x->insn + x->insn; 58 return (unsigned long)&x->addr + x->addr;
59} 59}
60 60
61#ifdef CONFIG_MODULES 61#ifdef CONFIG_MODULES
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index d876423e4e75..98b684928e12 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -90,7 +90,8 @@ static void *sn_dma_alloc_coherent(struct device *dev, size_t size,
90 */ 90 */
91 node = pcibus_to_node(pdev->bus); 91 node = pcibus_to_node(pdev->bus);
92 if (likely(node >=0)) { 92 if (likely(node >=0)) {
93 struct page *p = alloc_pages_node(node, flags, get_order(size)); 93 struct page *p = alloc_pages_exact_node(node,
94 flags, get_order(size));
94 95
95 if (likely(p)) 96 if (likely(p))
96 cpuaddr = page_address(p); 97 cpuaddr = page_address(p);
diff --git a/arch/m32r/include/asm/kmap_types.h b/arch/m32r/include/asm/kmap_types.h
index fa94dc6410ea..4cdb5e3a06bf 100644
--- a/arch/m32r/include/asm/kmap_types.h
+++ b/arch/m32r/include/asm/kmap_types.h
@@ -2,28 +2,11 @@
2#define __M32R_KMAP_TYPES_H 2#define __M32R_KMAP_TYPES_H
3 3
4#ifdef CONFIG_DEBUG_HIGHMEM 4#ifdef CONFIG_DEBUG_HIGHMEM
5# define D(n) __KM_FENCE_##n , 5#define __WITH_KM_FENCE
6#else
7# define D(n)
8#endif 6#endif
9 7
10enum km_type { 8#include <asm-generic/kmap_types.h>
11D(0) KM_BOUNCE_READ,
12D(1) KM_SKB_SUNRPC_DATA,
13D(2) KM_SKB_DATA_SOFTIRQ,
14D(3) KM_USER0,
15D(4) KM_USER1,
16D(5) KM_BIO_SRC_IRQ,
17D(6) KM_BIO_DST_IRQ,
18D(7) KM_PTE0,
19D(8) KM_PTE1,
20D(9) KM_IRQ0,
21D(10) KM_IRQ1,
22D(11) KM_SOFTIRQ0,
23D(12) KM_SOFTIRQ1,
24D(13) KM_TYPE_NR
25};
26 9
27#undef D 10#undef __WITH_KM_FENCE
28 11
29#endif /* __M32R_KMAP_TYPES_H */ 12#endif /* __M32R_KMAP_TYPES_H */
diff --git a/arch/m32r/kernel/init_task.c b/arch/m32r/kernel/init_task.c
index 016885c6f260..fce57e5d3f91 100644
--- a/arch/m32r/kernel/init_task.c
+++ b/arch/m32r/kernel/init_task.c
@@ -13,10 +13,6 @@
13 13
14static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 14static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
15static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 15static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
16struct mm_struct init_mm = INIT_MM(init_mm);
17
18EXPORT_SYMBOL(init_mm);
19
20/* 16/*
21 * Initial thread structure. 17 * Initial thread structure.
22 * 18 *
diff --git a/arch/m32r/mm/discontig.c b/arch/m32r/mm/discontig.c
index 7daf897292cf..b7a78ad429b7 100644
--- a/arch/m32r/mm/discontig.c
+++ b/arch/m32r/mm/discontig.c
@@ -154,9 +154,9 @@ unsigned long __init zone_sizes_init(void)
154 * Use all area of internal RAM. 154 * Use all area of internal RAM.
155 * see __alloc_pages() 155 * see __alloc_pages()
156 */ 156 */
157 NODE_DATA(1)->node_zones->pages_min = 0; 157 NODE_DATA(1)->node_zones->watermark[WMARK_MIN] = 0;
158 NODE_DATA(1)->node_zones->pages_low = 0; 158 NODE_DATA(1)->node_zones->watermark[WMARK_LOW] = 0;
159 NODE_DATA(1)->node_zones->pages_high = 0; 159 NODE_DATA(1)->node_zones->watermark[WMARK_HIGH] = 0;
160 160
161 return holes; 161 return holes;
162} 162}
diff --git a/arch/m32r/platforms/m32104ut/setup.c b/arch/m32r/platforms/m32104ut/setup.c
index 98138b4e9220..922fdfdadeaa 100644
--- a/arch/m32r/platforms/m32104ut/setup.c
+++ b/arch/m32r/platforms/m32104ut/setup.c
@@ -63,7 +63,7 @@ static void shutdown_m32104ut_irq(unsigned int irq)
63 outl(M32R_ICUCR_ILEVEL7, port); 63 outl(M32R_ICUCR_ILEVEL7, port);
64} 64}
65 65
66static struct hw_interrupt_type m32104ut_irq_type = 66static struct irq_chip m32104ut_irq_type =
67{ 67{
68 .typename = "M32104UT-IRQ", 68 .typename = "M32104UT-IRQ",
69 .startup = startup_m32104ut_irq, 69 .startup = startup_m32104ut_irq,
diff --git a/arch/m32r/platforms/m32700ut/setup.c b/arch/m32r/platforms/m32700ut/setup.c
index 77b0ae9379e9..9c1bc7487c1e 100644
--- a/arch/m32r/platforms/m32700ut/setup.c
+++ b/arch/m32r/platforms/m32700ut/setup.c
@@ -69,7 +69,7 @@ static void shutdown_m32700ut_irq(unsigned int irq)
69 outl(M32R_ICUCR_ILEVEL7, port); 69 outl(M32R_ICUCR_ILEVEL7, port);
70} 70}
71 71
72static struct hw_interrupt_type m32700ut_irq_type = 72static struct irq_chip m32700ut_irq_type =
73{ 73{
74 .typename = "M32700UT-IRQ", 74 .typename = "M32700UT-IRQ",
75 .startup = startup_m32700ut_irq, 75 .startup = startup_m32700ut_irq,
@@ -146,7 +146,7 @@ static void shutdown_m32700ut_pld_irq(unsigned int irq)
146 outw(PLD_ICUCR_ILEVEL7, port); 146 outw(PLD_ICUCR_ILEVEL7, port);
147} 147}
148 148
149static struct hw_interrupt_type m32700ut_pld_irq_type = 149static struct irq_chip m32700ut_pld_irq_type =
150{ 150{
151 .typename = "M32700UT-PLD-IRQ", 151 .typename = "M32700UT-PLD-IRQ",
152 .startup = startup_m32700ut_pld_irq, 152 .startup = startup_m32700ut_pld_irq,
@@ -215,7 +215,7 @@ static void shutdown_m32700ut_lanpld_irq(unsigned int irq)
215 outw(PLD_ICUCR_ILEVEL7, port); 215 outw(PLD_ICUCR_ILEVEL7, port);
216} 216}
217 217
218static struct hw_interrupt_type m32700ut_lanpld_irq_type = 218static struct irq_chip m32700ut_lanpld_irq_type =
219{ 219{
220 .typename = "M32700UT-PLD-LAN-IRQ", 220 .typename = "M32700UT-PLD-LAN-IRQ",
221 .startup = startup_m32700ut_lanpld_irq, 221 .startup = startup_m32700ut_lanpld_irq,
@@ -284,7 +284,7 @@ static void shutdown_m32700ut_lcdpld_irq(unsigned int irq)
284 outw(PLD_ICUCR_ILEVEL7, port); 284 outw(PLD_ICUCR_ILEVEL7, port);
285} 285}
286 286
287static struct hw_interrupt_type m32700ut_lcdpld_irq_type = 287static struct irq_chip m32700ut_lcdpld_irq_type =
288{ 288{
289 .typename = "M32700UT-PLD-LCD-IRQ", 289 .typename = "M32700UT-PLD-LCD-IRQ",
290 .startup = startup_m32700ut_lcdpld_irq, 290 .startup = startup_m32700ut_lcdpld_irq,
diff --git a/arch/m32r/platforms/mappi/setup.c b/arch/m32r/platforms/mappi/setup.c
index 3ec087ff2214..fb4b17799b66 100644
--- a/arch/m32r/platforms/mappi/setup.c
+++ b/arch/m32r/platforms/mappi/setup.c
@@ -63,7 +63,7 @@ static void shutdown_mappi_irq(unsigned int irq)
63 outl(M32R_ICUCR_ILEVEL7, port); 63 outl(M32R_ICUCR_ILEVEL7, port);
64} 64}
65 65
66static struct hw_interrupt_type mappi_irq_type = 66static struct irq_chip mappi_irq_type =
67{ 67{
68 .typename = "MAPPI-IRQ", 68 .typename = "MAPPI-IRQ",
69 .startup = startup_mappi_irq, 69 .startup = startup_mappi_irq,
diff --git a/arch/m32r/platforms/mappi2/setup.c b/arch/m32r/platforms/mappi2/setup.c
index d87969c6356e..6a65eda0a056 100644
--- a/arch/m32r/platforms/mappi2/setup.c
+++ b/arch/m32r/platforms/mappi2/setup.c
@@ -70,7 +70,7 @@ static void shutdown_mappi2_irq(unsigned int irq)
70 outl(M32R_ICUCR_ILEVEL7, port); 70 outl(M32R_ICUCR_ILEVEL7, port);
71} 71}
72 72
73static struct hw_interrupt_type mappi2_irq_type = 73static struct irq_chip mappi2_irq_type =
74{ 74{
75 .typename = "MAPPI2-IRQ", 75 .typename = "MAPPI2-IRQ",
76 .startup = startup_mappi2_irq, 76 .startup = startup_mappi2_irq,
diff --git a/arch/m32r/platforms/mappi3/setup.c b/arch/m32r/platforms/mappi3/setup.c
index 785b4bd6d9fd..9c337aeac94b 100644
--- a/arch/m32r/platforms/mappi3/setup.c
+++ b/arch/m32r/platforms/mappi3/setup.c
@@ -70,7 +70,7 @@ static void shutdown_mappi3_irq(unsigned int irq)
70 outl(M32R_ICUCR_ILEVEL7, port); 70 outl(M32R_ICUCR_ILEVEL7, port);
71} 71}
72 72
73static struct hw_interrupt_type mappi3_irq_type = 73static struct irq_chip mappi3_irq_type =
74{ 74{
75 .typename = "MAPPI3-IRQ", 75 .typename = "MAPPI3-IRQ",
76 .startup = startup_mappi3_irq, 76 .startup = startup_mappi3_irq,
diff --git a/arch/m32r/platforms/oaks32r/setup.c b/arch/m32r/platforms/oaks32r/setup.c
index 6faa5db68e95..ed865741c38d 100644
--- a/arch/m32r/platforms/oaks32r/setup.c
+++ b/arch/m32r/platforms/oaks32r/setup.c
@@ -61,7 +61,7 @@ static void shutdown_oaks32r_irq(unsigned int irq)
61 outl(M32R_ICUCR_ILEVEL7, port); 61 outl(M32R_ICUCR_ILEVEL7, port);
62} 62}
63 63
64static struct hw_interrupt_type oaks32r_irq_type = 64static struct irq_chip oaks32r_irq_type =
65{ 65{
66 .typename = "OAKS32R-IRQ", 66 .typename = "OAKS32R-IRQ",
67 .startup = startup_oaks32r_irq, 67 .startup = startup_oaks32r_irq,
diff --git a/arch/m32r/platforms/opsput/setup.c b/arch/m32r/platforms/opsput/setup.c
index fab13fd85422..80d680657019 100644
--- a/arch/m32r/platforms/opsput/setup.c
+++ b/arch/m32r/platforms/opsput/setup.c
@@ -70,7 +70,7 @@ static void shutdown_opsput_irq(unsigned int irq)
70 outl(M32R_ICUCR_ILEVEL7, port); 70 outl(M32R_ICUCR_ILEVEL7, port);
71} 71}
72 72
73static struct hw_interrupt_type opsput_irq_type = 73static struct irq_chip opsput_irq_type =
74{ 74{
75 .typename = "OPSPUT-IRQ", 75 .typename = "OPSPUT-IRQ",
76 .startup = startup_opsput_irq, 76 .startup = startup_opsput_irq,
@@ -147,7 +147,7 @@ static void shutdown_opsput_pld_irq(unsigned int irq)
147 outw(PLD_ICUCR_ILEVEL7, port); 147 outw(PLD_ICUCR_ILEVEL7, port);
148} 148}
149 149
150static struct hw_interrupt_type opsput_pld_irq_type = 150static struct irq_chip opsput_pld_irq_type =
151{ 151{
152 .typename = "OPSPUT-PLD-IRQ", 152 .typename = "OPSPUT-PLD-IRQ",
153 .startup = startup_opsput_pld_irq, 153 .startup = startup_opsput_pld_irq,
@@ -216,7 +216,7 @@ static void shutdown_opsput_lanpld_irq(unsigned int irq)
216 outw(PLD_ICUCR_ILEVEL7, port); 216 outw(PLD_ICUCR_ILEVEL7, port);
217} 217}
218 218
219static struct hw_interrupt_type opsput_lanpld_irq_type = 219static struct irq_chip opsput_lanpld_irq_type =
220{ 220{
221 .typename = "OPSPUT-PLD-LAN-IRQ", 221 .typename = "OPSPUT-PLD-LAN-IRQ",
222 .startup = startup_opsput_lanpld_irq, 222 .startup = startup_opsput_lanpld_irq,
@@ -285,7 +285,7 @@ static void shutdown_opsput_lcdpld_irq(unsigned int irq)
285 outw(PLD_ICUCR_ILEVEL7, port); 285 outw(PLD_ICUCR_ILEVEL7, port);
286} 286}
287 287
288static struct hw_interrupt_type opsput_lcdpld_irq_type = 288static struct irq_chip opsput_lcdpld_irq_type =
289{ 289{
290 "OPSPUT-PLD-LCD-IRQ", 290 "OPSPUT-PLD-LCD-IRQ",
291 startup_opsput_lcdpld_irq, 291 startup_opsput_lcdpld_irq,
diff --git a/arch/m32r/platforms/usrv/setup.c b/arch/m32r/platforms/usrv/setup.c
index 89588d649eb7..757302660af8 100644
--- a/arch/m32r/platforms/usrv/setup.c
+++ b/arch/m32r/platforms/usrv/setup.c
@@ -61,7 +61,7 @@ static void shutdown_mappi_irq(unsigned int irq)
61 outl(M32R_ICUCR_ILEVEL7, port); 61 outl(M32R_ICUCR_ILEVEL7, port);
62} 62}
63 63
64static struct hw_interrupt_type mappi_irq_type = 64static struct irq_chip mappi_irq_type =
65{ 65{
66 .typename = "M32700-IRQ", 66 .typename = "M32700-IRQ",
67 .startup = startup_mappi_irq, 67 .startup = startup_mappi_irq,
@@ -134,7 +134,7 @@ static void shutdown_m32700ut_pld_irq(unsigned int irq)
134 outw(PLD_ICUCR_ILEVEL7, port); 134 outw(PLD_ICUCR_ILEVEL7, port);
135} 135}
136 136
137static struct hw_interrupt_type m32700ut_pld_irq_type = 137static struct irq_chip m32700ut_pld_irq_type =
138{ 138{
139 .typename = "USRV-PLD-IRQ", 139 .typename = "USRV-PLD-IRQ",
140 .startup = startup_m32700ut_pld_irq, 140 .startup = startup_m32700ut_pld_irq,
diff --git a/arch/m68k/include/asm/kmap_types.h b/arch/m68k/include/asm/kmap_types.h
index c843c63d3801..3413cc1390ec 100644
--- a/arch/m68k/include/asm/kmap_types.h
+++ b/arch/m68k/include/asm/kmap_types.h
@@ -1,21 +1,6 @@
1#ifndef __ASM_M68K_KMAP_TYPES_H 1#ifndef __ASM_M68K_KMAP_TYPES_H
2#define __ASM_M68K_KMAP_TYPES_H 2#define __ASM_M68K_KMAP_TYPES_H
3 3
4enum km_type { 4#include <asm-generic/kmap_types.h>
5 KM_BOUNCE_READ,
6 KM_SKB_SUNRPC_DATA,
7 KM_SKB_DATA_SOFTIRQ,
8 KM_USER0,
9 KM_USER1,
10 KM_BIO_SRC_IRQ,
11 KM_BIO_DST_IRQ,
12 KM_PTE0,
13 KM_PTE1,
14 KM_IRQ0,
15 KM_IRQ1,
16 KM_SOFTIRQ0,
17 KM_SOFTIRQ1,
18 KM_TYPE_NR
19};
20 5
21#endif /* __ASM_M68K_KMAP_TYPES_H */ 6#endif /* __ASM_M68K_KMAP_TYPES_H */
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index ec37fb56c127..72bad65dba3a 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -42,10 +42,6 @@
42 */ 42 */
43static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 43static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
44static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 44static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
45struct mm_struct init_mm = INIT_MM(init_mm);
46
47EXPORT_SYMBOL(init_mm);
48
49union thread_union init_thread_union 45union thread_union init_thread_union
50__attribute__((section(".data.init_task"), aligned(THREAD_SIZE))) 46__attribute__((section(".data.init_task"), aligned(THREAD_SIZE)))
51 = { INIT_THREAD_INFO(init_task) }; 47 = { INIT_THREAD_INFO(init_task) };
diff --git a/arch/m68knommu/kernel/init_task.c b/arch/m68knommu/kernel/init_task.c
index fe282de1d596..45e97a207fed 100644
--- a/arch/m68knommu/kernel/init_task.c
+++ b/arch/m68knommu/kernel/init_task.c
@@ -14,10 +14,6 @@
14 14
15static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 15static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
16static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 16static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
17struct mm_struct init_mm = INIT_MM(init_mm);
18
19EXPORT_SYMBOL(init_mm);
20
21/* 17/*
22 * Initial task structure. 18 * Initial task structure.
23 * 19 *
diff --git a/arch/microblaze/include/asm/kmap_types.h b/arch/microblaze/include/asm/kmap_types.h
index 4d7e222f5dd7..25975252d83d 100644
--- a/arch/microblaze/include/asm/kmap_types.h
+++ b/arch/microblaze/include/asm/kmap_types.h
@@ -1,29 +1,6 @@
1/*
2 * Copyright (C) 2006 Atmark Techno, Inc.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 */
8
9#ifndef _ASM_MICROBLAZE_KMAP_TYPES_H 1#ifndef _ASM_MICROBLAZE_KMAP_TYPES_H
10#define _ASM_MICROBLAZE_KMAP_TYPES_H 2#define _ASM_MICROBLAZE_KMAP_TYPES_H
11 3
12enum km_type { 4#include <asm-generic/kmap_types.h>
13 KM_BOUNCE_READ,
14 KM_SKB_SUNRPC_DATA,
15 KM_SKB_DATA_SOFTIRQ,
16 KM_USER0,
17 KM_USER1,
18 KM_BIO_SRC_IRQ,
19 KM_BIO_DST_IRQ,
20 KM_PTE0,
21 KM_PTE1,
22 KM_IRQ0,
23 KM_IRQ1,
24 KM_SOFTIRQ0,
25 KM_SOFTIRQ1,
26 KM_TYPE_NR,
27};
28 5
29#endif /* _ASM_MICROBLAZE_KMAP_TYPES_H */ 6#endif /* _ASM_MICROBLAZE_KMAP_TYPES_H */
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 25f3b0a11ca8..b29f0280d712 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -618,6 +618,8 @@ config CAVIUM_OCTEON_REFERENCE_BOARD
618 select SYS_HAS_EARLY_PRINTK 618 select SYS_HAS_EARLY_PRINTK
619 select SYS_HAS_CPU_CAVIUM_OCTEON 619 select SYS_HAS_CPU_CAVIUM_OCTEON
620 select SWAP_IO_SPACE 620 select SWAP_IO_SPACE
621 select HW_HAS_PCI
622 select ARCH_SUPPORTS_MSI
621 help 623 help
622 This option supports all of the Octeon reference boards from Cavium 624 This option supports all of the Octeon reference boards from Cavium
623 Networks. It builds a kernel that dynamically determines the Octeon 625 Networks. It builds a kernel that dynamically determines the Octeon
@@ -851,6 +853,11 @@ config SYS_SUPPORTS_BIG_ENDIAN
851config SYS_SUPPORTS_LITTLE_ENDIAN 853config SYS_SUPPORTS_LITTLE_ENDIAN
852 bool 854 bool
853 855
856config SYS_SUPPORTS_HUGETLBFS
857 bool
858 depends on CPU_SUPPORTS_HUGEPAGES && 64BIT
859 default y
860
854config IRQ_CPU 861config IRQ_CPU
855 bool 862 bool
856 863
@@ -1055,6 +1062,7 @@ config CPU_MIPS64_R1
1055 select CPU_SUPPORTS_32BIT_KERNEL 1062 select CPU_SUPPORTS_32BIT_KERNEL
1056 select CPU_SUPPORTS_64BIT_KERNEL 1063 select CPU_SUPPORTS_64BIT_KERNEL
1057 select CPU_SUPPORTS_HIGHMEM 1064 select CPU_SUPPORTS_HIGHMEM
1065 select CPU_SUPPORTS_HUGEPAGES
1058 help 1066 help
1059 Choose this option to build a kernel for release 1 or later of the 1067 Choose this option to build a kernel for release 1 or later of the
1060 MIPS64 architecture. Many modern embedded systems with a 64-bit 1068 MIPS64 architecture. Many modern embedded systems with a 64-bit
@@ -1074,6 +1082,7 @@ config CPU_MIPS64_R2
1074 select CPU_SUPPORTS_32BIT_KERNEL 1082 select CPU_SUPPORTS_32BIT_KERNEL
1075 select CPU_SUPPORTS_64BIT_KERNEL 1083 select CPU_SUPPORTS_64BIT_KERNEL
1076 select CPU_SUPPORTS_HIGHMEM 1084 select CPU_SUPPORTS_HIGHMEM
1085 select CPU_SUPPORTS_HUGEPAGES
1077 help 1086 help
1078 Choose this option to build a kernel for release 2 or later of the 1087 Choose this option to build a kernel for release 2 or later of the
1079 MIPS64 architecture. Many modern embedded systems with a 64-bit 1088 MIPS64 architecture. Many modern embedded systems with a 64-bit
@@ -1160,6 +1169,7 @@ config CPU_R5500
1160 select CPU_HAS_LLSC 1169 select CPU_HAS_LLSC
1161 select CPU_SUPPORTS_32BIT_KERNEL 1170 select CPU_SUPPORTS_32BIT_KERNEL
1162 select CPU_SUPPORTS_64BIT_KERNEL 1171 select CPU_SUPPORTS_64BIT_KERNEL
1172 select CPU_SUPPORTS_HUGEPAGES
1163 help 1173 help
1164 NEC VR5500 and VR5500A series processors implement 64-bit MIPS IV 1174 NEC VR5500 and VR5500A series processors implement 64-bit MIPS IV
1165 instruction set. 1175 instruction set.
@@ -1245,6 +1255,7 @@ config CPU_CAVIUM_OCTEON
1245 select WEAK_ORDERING 1255 select WEAK_ORDERING
1246 select WEAK_REORDERING_BEYOND_LLSC 1256 select WEAK_REORDERING_BEYOND_LLSC
1247 select CPU_SUPPORTS_HIGHMEM 1257 select CPU_SUPPORTS_HIGHMEM
1258 select CPU_SUPPORTS_HUGEPAGES
1248 help 1259 help
1249 The Cavium Octeon processor is a highly integrated chip containing 1260 The Cavium Octeon processor is a highly integrated chip containing
1250 many ethernet hardware widgets for networking tasks. The processor 1261 many ethernet hardware widgets for networking tasks. The processor
@@ -1364,6 +1375,8 @@ config CPU_SUPPORTS_32BIT_KERNEL
1364 bool 1375 bool
1365config CPU_SUPPORTS_64BIT_KERNEL 1376config CPU_SUPPORTS_64BIT_KERNEL
1366 bool 1377 bool
1378config CPU_SUPPORTS_HUGEPAGES
1379 bool
1367 1380
1368# 1381#
1369# Set to y for ptrace access to watch registers. 1382# Set to y for ptrace access to watch registers.
@@ -2121,6 +2134,10 @@ endmenu
2121 2134
2122menu "Power management options" 2135menu "Power management options"
2123 2136
2137config ARCH_HIBERNATION_POSSIBLE
2138 def_bool y
2139 depends on !SMP
2140
2124config ARCH_SUSPEND_POSSIBLE 2141config ARCH_SUSPEND_POSSIBLE
2125 def_bool y 2142 def_bool y
2126 depends on !SMP 2143 depends on !SMP
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index c4cae9e6b802..807572a6a4d2 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -167,7 +167,6 @@ libs-$(CONFIG_ARC) += arch/mips/fw/arc/
167libs-$(CONFIG_CFE) += arch/mips/fw/cfe/ 167libs-$(CONFIG_CFE) += arch/mips/fw/cfe/
168libs-$(CONFIG_SNIPROM) += arch/mips/fw/sni/ 168libs-$(CONFIG_SNIPROM) += arch/mips/fw/sni/
169libs-y += arch/mips/fw/lib/ 169libs-y += arch/mips/fw/lib/
170libs-$(CONFIG_SIBYTE_CFE) += arch/mips/sibyte/cfe/
171 170
172# 171#
173# Board-dependent options and extra files 172# Board-dependent options and extra files
@@ -184,7 +183,6 @@ load-$(CONFIG_MACH_JAZZ) += 0xffffffff80080000
184# Common Alchemy Au1x00 stuff 183# Common Alchemy Au1x00 stuff
185# 184#
186core-$(CONFIG_SOC_AU1X00) += arch/mips/alchemy/common/ 185core-$(CONFIG_SOC_AU1X00) += arch/mips/alchemy/common/
187cflags-$(CONFIG_SOC_AU1X00) += -I$(srctree)/arch/mips/include/asm/mach-au1x00
188 186
189# 187#
190# AMD Alchemy Pb1000 eval board 188# AMD Alchemy Pb1000 eval board
@@ -282,6 +280,10 @@ load-$(CONFIG_MIPS_MTX1) += 0xffffffff80100000
282libs-$(CONFIG_MIPS_XXS1500) += arch/mips/alchemy/xxs1500/ 280libs-$(CONFIG_MIPS_XXS1500) += arch/mips/alchemy/xxs1500/
283load-$(CONFIG_MIPS_XXS1500) += 0xffffffff80100000 281load-$(CONFIG_MIPS_XXS1500) += 0xffffffff80100000
284 282
283# must be last for Alchemy systems for GPIO to work properly
284cflags-$(CONFIG_SOC_AU1X00) += -I$(srctree)/arch/mips/include/asm/mach-au1x00
285
286
285# 287#
286# Cobalt Server 288# Cobalt Server
287# 289#
@@ -675,6 +677,9 @@ core-y += arch/mips/kernel/ arch/mips/mm/ arch/mips/math-emu/
675 677
676drivers-$(CONFIG_OPROFILE) += arch/mips/oprofile/ 678drivers-$(CONFIG_OPROFILE) += arch/mips/oprofile/
677 679
680# suspend and hibernation support
681drivers-$(CONFIG_PM) += arch/mips/power/
682
678ifdef CONFIG_LASAT 683ifdef CONFIG_LASAT
679rom.bin rom.sw: vmlinux 684rom.bin rom.sw: vmlinux
680 $(Q)$(MAKE) $(build)=arch/mips/lasat/image $@ 685 $(Q)$(MAKE) $(build)=arch/mips/lasat/image $@
diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig
index 8128aebfb155..00b498e97c83 100644
--- a/arch/mips/alchemy/Kconfig
+++ b/arch/mips/alchemy/Kconfig
@@ -1,3 +1,14 @@
1# au1000-style gpio
2config ALCHEMY_GPIO_AU1000
3 bool
4
5# select this in your board config if you don't want to use the gpio
6# namespace as documented in the manuals. In this case however you need
7# to create the necessary gpio_* functions in your board code/headers!
8# see arch/mips/include/asm/mach-au1x00/gpio.h for more information.
9config ALCHEMY_GPIO_INDIRECT
10 def_bool n
11
1choice 12choice
2 prompt "Machine type" 13 prompt "Machine type"
3 depends on MACH_ALCHEMY 14 depends on MACH_ALCHEMY
@@ -108,22 +119,27 @@ endchoice
108config SOC_AU1000 119config SOC_AU1000
109 bool 120 bool
110 select SOC_AU1X00 121 select SOC_AU1X00
122 select ALCHEMY_GPIO_AU1000
111 123
112config SOC_AU1100 124config SOC_AU1100
113 bool 125 bool
114 select SOC_AU1X00 126 select SOC_AU1X00
127 select ALCHEMY_GPIO_AU1000
115 128
116config SOC_AU1500 129config SOC_AU1500
117 bool 130 bool
118 select SOC_AU1X00 131 select SOC_AU1X00
132 select ALCHEMY_GPIO_AU1000
119 133
120config SOC_AU1550 134config SOC_AU1550
121 bool 135 bool
122 select SOC_AU1X00 136 select SOC_AU1X00
137 select ALCHEMY_GPIO_AU1000
123 138
124config SOC_AU1200 139config SOC_AU1200
125 bool 140 bool
126 select SOC_AU1X00 141 select SOC_AU1X00
142 select ALCHEMY_GPIO_AU1000
127 143
128config SOC_AU1X00 144config SOC_AU1X00
129 bool 145 bool
@@ -134,4 +150,5 @@ config SOC_AU1X00
134 select SYS_HAS_CPU_MIPS32_R1 150 select SYS_HAS_CPU_MIPS32_R1
135 select SYS_SUPPORTS_32BIT_KERNEL 151 select SYS_SUPPORTS_32BIT_KERNEL
136 select SYS_SUPPORTS_APM_EMULATION 152 select SYS_SUPPORTS_APM_EMULATION
137 select ARCH_REQUIRE_GPIOLIB 153 select GENERIC_GPIO
154 select ARCH_WANT_OPTIONAL_GPIOLIB
diff --git a/arch/mips/alchemy/common/Makefile b/arch/mips/alchemy/common/Makefile
index d50d4764eafe..b67fb512529d 100644
--- a/arch/mips/alchemy/common/Makefile
+++ b/arch/mips/alchemy/common/Makefile
@@ -7,7 +7,14 @@
7 7
8obj-y += prom.o irq.o puts.o time.o reset.o \ 8obj-y += prom.o irq.o puts.o time.o reset.o \
9 clocks.o platform.o power.o setup.o \ 9 clocks.o platform.o power.o setup.o \
10 sleeper.o dma.o dbdma.o gpio.o 10 sleeper.o dma.o dbdma.o
11
12# optional gpiolib support
13ifeq ($(CONFIG_ALCHEMY_GPIO_INDIRECT),)
14 ifeq ($(CONFIG_GPIOLIB),y)
15 obj-$(CONFIG_ALCHEMY_GPIO_AU1000) += gpiolib-au1000.o
16 endif
17endif
11 18
12obj-$(CONFIG_PCI) += pci.o 19obj-$(CONFIG_PCI) += pci.o
13 20
diff --git a/arch/mips/alchemy/common/gpio.c b/arch/mips/alchemy/common/gpio.c
deleted file mode 100644
index 91a9c4436c39..000000000000
--- a/arch/mips/alchemy/common/gpio.c
+++ /dev/null
@@ -1,201 +0,0 @@
1/*
2 * Copyright (C) 2007-2009, OpenWrt.org, Florian Fainelli <florian@openwrt.org>
3 * Architecture specific GPIO support
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
11 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
13 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
15 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
16 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
17 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
19 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 * Notes :
26 * au1000 SoC have only one GPIO line : GPIO1
27 * others have a second one : GPIO2
28 */
29
30#include <linux/kernel.h>
31#include <linux/module.h>
32#include <linux/types.h>
33#include <linux/platform_device.h>
34#include <linux/gpio.h>
35
36#include <asm/mach-au1x00/au1000.h>
37#include <asm/gpio.h>
38
39struct au1000_gpio_chip {
40 struct gpio_chip chip;
41 void __iomem *regbase;
42};
43
44#if !defined(CONFIG_SOC_AU1000)
45static int au1000_gpio2_get(struct gpio_chip *chip, unsigned offset)
46{
47 u32 mask = 1 << offset;
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;
52}
53
54static void au1000_gpio2_set(struct gpio_chip *chip,
55 unsigned offset, int value)
56{
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);
62
63 local_irq_save(flags);
64 writel(mask, gpch->regbase + AU1000_GPIO2_OUT);
65 local_irq_restore(flags);
66}
67
68static int au1000_gpio2_direction_input(struct gpio_chip *chip, unsigned offset)
69{
70 u32 mask = 1 << offset;
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
83 return 0;
84}
85
86static int au1000_gpio2_direction_output(struct gpio_chip *chip,
87 unsigned offset, int value)
88{
89 u32 mask = 1 << offset;
90 u32 out_mask = ((GPIO2_OUT_EN_MASK << offset) | (!!value << offset));
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
104 return 0;
105}
106#endif /* !defined(CONFIG_SOC_AU1000) */
107
108static int au1000_gpio1_get(struct gpio_chip *chip, unsigned offset)
109{
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;
115}
116
117static void au1000_gpio1_set(struct gpio_chip *chip,
118 unsigned offset, int value)
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
127 if (value)
128 reg_offset = AU1000_GPIO1_OUT;
129 else
130 reg_offset = AU1000_GPIO1_CLR;
131
132 local_irq_save(flags);
133 writel(mask, gpch->regbase + reg_offset);
134 local_irq_restore(flags);
135}
136
137static int au1000_gpio1_direction_input(struct gpio_chip *chip, unsigned offset)
138{
139 u32 mask = 1 << offset;
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
145 return 0;
146}
147
148static int au1000_gpio1_direction_output(struct gpio_chip *chip,
149 unsigned offset, int value)
150{
151 u32 mask = 1 << offset;
152 struct au1000_gpio_chip *gpch;
153
154 gpch = container_of(chip, struct au1000_gpio_chip, chip);
155
156 writel(mask, gpch->regbase + AU1000_GPIO1_TRI_OUT);
157 au1000_gpio1_set(chip, offset, value);
158
159 return 0;
160}
161
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)
192{
193 gpiochip_add(&au1000_gpio_chip[0].chip);
194#if !defined(CONFIG_SOC_AU1000)
195 gpiochip_add(&au1000_gpio_chip[1].chip);
196#endif
197
198 return 0;
199}
200arch_initcall(au1000_gpio_init);
201
diff --git a/arch/mips/alchemy/common/gpiolib-au1000.c b/arch/mips/alchemy/common/gpiolib-au1000.c
new file mode 100644
index 000000000000..1bfa91f939f4
--- /dev/null
+++ b/arch/mips/alchemy/common/gpiolib-au1000.c
@@ -0,0 +1,130 @@
1/*
2 * Copyright (C) 2007-2009, OpenWrt.org, Florian Fainelli <florian@openwrt.org>
3 * GPIOLIB support for Au1000, Au1500, Au1100, Au1550 and Au12x0.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
11 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
13 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
15 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
16 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
17 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
19 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 * Notes :
26 * au1000 SoC have only one GPIO block : GPIO1
27 * Au1100, Au15x0, Au12x0 have a second one : GPIO2
28 */
29
30#include <linux/kernel.h>
31#include <linux/module.h>
32#include <linux/types.h>
33#include <linux/platform_device.h>
34#include <linux/gpio.h>
35
36#include <asm/mach-au1x00/au1000.h>
37#include <asm/mach-au1x00/gpio.h>
38
39#if !defined(CONFIG_SOC_AU1000)
40static int gpio2_get(struct gpio_chip *chip, unsigned offset)
41{
42 return alchemy_gpio2_get_value(offset + ALCHEMY_GPIO2_BASE);
43}
44
45static void gpio2_set(struct gpio_chip *chip, unsigned offset, int value)
46{
47 alchemy_gpio2_set_value(offset + ALCHEMY_GPIO2_BASE, value);
48}
49
50static int gpio2_direction_input(struct gpio_chip *chip, unsigned offset)
51{
52 return alchemy_gpio2_direction_input(offset + ALCHEMY_GPIO2_BASE);
53}
54
55static int gpio2_direction_output(struct gpio_chip *chip, unsigned offset,
56 int value)
57{
58 return alchemy_gpio2_direction_output(offset + ALCHEMY_GPIO2_BASE,
59 value);
60}
61
62static int gpio2_to_irq(struct gpio_chip *chip, unsigned offset)
63{
64 return alchemy_gpio2_to_irq(offset + ALCHEMY_GPIO2_BASE);
65}
66#endif /* !defined(CONFIG_SOC_AU1000) */
67
68static int gpio1_get(struct gpio_chip *chip, unsigned offset)
69{
70 return alchemy_gpio1_get_value(offset + ALCHEMY_GPIO1_BASE);
71}
72
73static void gpio1_set(struct gpio_chip *chip,
74 unsigned offset, int value)
75{
76 alchemy_gpio1_set_value(offset + ALCHEMY_GPIO1_BASE, value);
77}
78
79static int gpio1_direction_input(struct gpio_chip *chip, unsigned offset)
80{
81 return alchemy_gpio1_direction_input(offset + ALCHEMY_GPIO1_BASE);
82}
83
84static int gpio1_direction_output(struct gpio_chip *chip,
85 unsigned offset, int value)
86{
87 return alchemy_gpio1_direction_output(offset + ALCHEMY_GPIO1_BASE,
88 value);
89}
90
91static int gpio1_to_irq(struct gpio_chip *chip, unsigned offset)
92{
93 return alchemy_gpio1_to_irq(offset + ALCHEMY_GPIO1_BASE);
94}
95
96struct gpio_chip alchemy_gpio_chip[] = {
97 [0] = {
98 .label = "alchemy-gpio1",
99 .direction_input = gpio1_direction_input,
100 .direction_output = gpio1_direction_output,
101 .get = gpio1_get,
102 .set = gpio1_set,
103 .to_irq = gpio1_to_irq,
104 .base = ALCHEMY_GPIO1_BASE,
105 .ngpio = ALCHEMY_GPIO1_NUM,
106 },
107#if !defined(CONFIG_SOC_AU1000)
108 [1] = {
109 .label = "alchemy-gpio2",
110 .direction_input = gpio2_direction_input,
111 .direction_output = gpio2_direction_output,
112 .get = gpio2_get,
113 .set = gpio2_set,
114 .to_irq = gpio2_to_irq,
115 .base = ALCHEMY_GPIO2_BASE,
116 .ngpio = ALCHEMY_GPIO2_NUM,
117 },
118#endif
119};
120
121static int __init alchemy_gpiolib_init(void)
122{
123 gpiochip_add(&alchemy_gpio_chip[0]);
124#if !defined(CONFIG_SOC_AU1000)
125 gpiochip_add(&alchemy_gpio_chip[1]);
126#endif
127
128 return 0;
129}
130arch_initcall(alchemy_gpiolib_init);
diff --git a/arch/mips/alchemy/common/reset.c b/arch/mips/alchemy/common/reset.c
index 0191c936cb5e..4791011e8f92 100644
--- a/arch/mips/alchemy/common/reset.c
+++ b/arch/mips/alchemy/common/reset.c
@@ -27,8 +27,9 @@
27 * 675 Mass Ave, Cambridge, MA 02139, USA. 27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */ 28 */
29 29
30#include <asm/cacheflush.h> 30#include <linux/gpio.h>
31 31
32#include <asm/cacheflush.h>
32#include <asm/mach-au1x00/au1000.h> 33#include <asm/mach-au1x00/au1000.h>
33 34
34void au1000_restart(char *command) 35void au1000_restart(char *command)
@@ -161,7 +162,7 @@ void au1000_halt(void)
161#else 162#else
162 printk(KERN_NOTICE "\n** You can safely turn off the power\n"); 163 printk(KERN_NOTICE "\n** You can safely turn off the power\n");
163#ifdef CONFIG_MIPS_MIRAGE 164#ifdef CONFIG_MIPS_MIRAGE
164 au_writel((1 << 26) | (1 << 10), GPIO2_OUTPUT); 165 gpio_direction_output(210, 1);
165#endif 166#endif
166#ifdef CONFIG_MIPS_DB1200 167#ifdef CONFIG_MIPS_DB1200
167 au_writew(au_readw(0xB980001C) | (1 << 14), 0xB980001C); 168 au_writew(au_readw(0xB980001C) | (1 << 14), 0xB980001C);
diff --git a/arch/mips/alchemy/devboards/db1x00/board_setup.c b/arch/mips/alchemy/devboards/db1x00/board_setup.c
index a75ffbf99f25..de30d8ea7176 100644
--- a/arch/mips/alchemy/devboards/db1x00/board_setup.c
+++ b/arch/mips/alchemy/devboards/db1x00/board_setup.c
@@ -27,6 +27,7 @@
27 * 675 Mass Ave, Cambridge, MA 02139, USA. 27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */ 28 */
29 29
30#include <linux/gpio.h>
30#include <linux/init.h> 31#include <linux/init.h>
31 32
32#include <asm/mach-au1x00/au1000.h> 33#include <asm/mach-au1x00/au1000.h>
@@ -94,12 +95,12 @@ void __init board_setup(void)
94#endif 95#endif
95 bcsr->pcmcia = 0x0000; /* turn off PCMCIA power */ 96 bcsr->pcmcia = 0x0000; /* turn off PCMCIA power */
96 97
97#ifdef CONFIG_MIPS_MIRAGE
98 /* Enable GPIO[31:0] inputs */ 98 /* Enable GPIO[31:0] inputs */
99 au_writel(0, SYS_PININPUTEN); 99 alchemy_gpio1_input_enable();
100 100
101 /* GPIO[20] is output, tristate the other input primary GPIOs */ 101#ifdef CONFIG_MIPS_MIRAGE
102 au_writel(~(1 << 20), SYS_TRIOUTCLR); 102 /* GPIO[20] is output */
103 alchemy_gpio_direction_output(20, 0);
103 104
104 /* Set GPIO[210:208] instead of SSI_0 */ 105 /* Set GPIO[210:208] instead of SSI_0 */
105 pin_func = au_readl(SYS_PINFUNC) | SYS_PF_S0; 106 pin_func = au_readl(SYS_PINFUNC) | SYS_PF_S0;
@@ -118,8 +119,7 @@ void __init board_setup(void)
118 * Enable speaker amplifier. This should 119 * Enable speaker amplifier. This should
119 * be part of the audio driver. 120 * be part of the audio driver.
120 */ 121 */
121 au_writel(au_readl(GPIO2_DIR) | 0x200, GPIO2_DIR); 122 alchemy_gpio_direction_output(209, 1);
122 au_writel(0x02000200, GPIO2_OUTPUT);
123#endif 123#endif
124 124
125 au_sync(); 125 au_sync();
diff --git a/arch/mips/alchemy/devboards/pb1000/board_setup.c b/arch/mips/alchemy/devboards/pb1000/board_setup.c
index aed2fdecc709..cd273545e810 100644
--- a/arch/mips/alchemy/devboards/pb1000/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1000/board_setup.c
@@ -24,6 +24,7 @@
24 */ 24 */
25 25
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/gpio.h>
27#include <linux/init.h> 28#include <linux/init.h>
28#include <linux/interrupt.h> 29#include <linux/interrupt.h>
29#include <asm/mach-au1x00/au1000.h> 30#include <asm/mach-au1x00/au1000.h>
@@ -130,8 +131,11 @@ void __init board_setup(void)
130 pin_func |= SYS_PF_USB; 131 pin_func |= SYS_PF_USB;
131 132
132 au_writel(pin_func, SYS_PINFUNC); 133 au_writel(pin_func, SYS_PINFUNC);
133 au_writel(0x2800, SYS_TRIOUTCLR); 134
134 au_writel(0x0030, SYS_OUTPUTCLR); 135 alchemy_gpio_direction_input(11);
136 alchemy_gpio_direction_input(13);
137 alchemy_gpio_direction_output(4, 0);
138 alchemy_gpio_direction_output(5, 0);
135#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ 139#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */
136 140
137 /* Make GPIO 15 an input (for interrupt line) */ 141 /* Make GPIO 15 an input (for interrupt line) */
@@ -140,7 +144,7 @@ void __init board_setup(void)
140 pin_func |= SYS_PF_I2S; 144 pin_func |= SYS_PF_I2S;
141 au_writel(pin_func, SYS_PINFUNC); 145 au_writel(pin_func, SYS_PINFUNC);
142 146
143 au_writel(0x8000, SYS_TRIOUTCLR); 147 alchemy_gpio_direction_input(15);
144 148
145 static_cfg0 = au_readl(MEM_STCFG0) & ~0xc00; 149 static_cfg0 = au_readl(MEM_STCFG0) & ~0xc00;
146 au_writel(static_cfg0, MEM_STCFG0); 150 au_writel(static_cfg0, MEM_STCFG0);
diff --git a/arch/mips/alchemy/devboards/pb1100/board_setup.c b/arch/mips/alchemy/devboards/pb1100/board_setup.c
index 4df57fae15d4..61263081ef58 100644
--- a/arch/mips/alchemy/devboards/pb1100/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1100/board_setup.c
@@ -23,6 +23,7 @@
23 * 675 Mass Ave, Cambridge, MA 02139, USA. 23 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 */ 24 */
25 25
26#include <linux/gpio.h>
26#include <linux/init.h> 27#include <linux/init.h>
27#include <linux/delay.h> 28#include <linux/delay.h>
28#include <linux/interrupt.h> 29#include <linux/interrupt.h>
@@ -88,7 +89,7 @@ void __init board_setup(void)
88 89
89 /* Set AUX clock to 12 MHz * 8 = 96 MHz */ 90 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
90 au_writel(8, SYS_AUXPLL); 91 au_writel(8, SYS_AUXPLL);
91 au_writel(0, SYS_PININPUTEN); 92 alchemy_gpio1_input_enable();
92 udelay(100); 93 udelay(100);
93 94
94#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 95#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
diff --git a/arch/mips/alchemy/devboards/pb1500/board_setup.c b/arch/mips/alchemy/devboards/pb1500/board_setup.c
index fed3b093156a..d7a56569e7ed 100644
--- a/arch/mips/alchemy/devboards/pb1500/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1500/board_setup.c
@@ -23,8 +23,9 @@
23 * 675 Mass Ave, Cambridge, MA 02139, USA. 23 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 */ 24 */
25 25
26#include <linux/init.h>
27#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/gpio.h>
28#include <linux/init.h>
28#include <linux/interrupt.h> 29#include <linux/interrupt.h>
29 30
30#include <asm/mach-au1x00/au1000.h> 31#include <asm/mach-au1x00/au1000.h>
@@ -90,11 +91,12 @@ void __init board_setup(void)
90 au_writel(0, SYS_PINSTATERD); 91 au_writel(0, SYS_PINSTATERD);
91 udelay(100); 92 udelay(100);
92 93
93#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
94
95 /* GPIO201 is input for PCMCIA card detect */ 94 /* GPIO201 is input for PCMCIA card detect */
96 /* GPIO203 is input for PCMCIA interrupt request */ 95 /* GPIO203 is input for PCMCIA interrupt request */
97 au_writel(au_readl(GPIO2_DIR) & ~((1 << 1) | (1 << 3)), GPIO2_DIR); 96 alchemy_gpio_direction_input(201);
97 alchemy_gpio_direction_input(203);
98
99#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
98 100
99 /* Zero and disable FREQ2 */ 101 /* Zero and disable FREQ2 */
100 sys_freqctrl = au_readl(SYS_FREQCTRL0); 102 sys_freqctrl = au_readl(SYS_FREQCTRL0);
diff --git a/arch/mips/alchemy/devboards/pm.c b/arch/mips/alchemy/devboards/pm.c
index d5eb9c325ed0..632f9862a0fb 100644
--- a/arch/mips/alchemy/devboards/pm.c
+++ b/arch/mips/alchemy/devboards/pm.c
@@ -9,6 +9,7 @@
9#include <linux/suspend.h> 9#include <linux/suspend.h>
10#include <linux/sysfs.h> 10#include <linux/sysfs.h>
11#include <asm/mach-au1x00/au1000.h> 11#include <asm/mach-au1x00/au1000.h>
12#include <asm/mach-au1x00/gpio.h>
12 13
13/* 14/*
14 * Generic suspend userspace interface for Alchemy development boards. 15 * Generic suspend userspace interface for Alchemy development boards.
@@ -26,7 +27,7 @@ static unsigned long db1x_pm_last_wakesrc;
26static int db1x_pm_enter(suspend_state_t state) 27static int db1x_pm_enter(suspend_state_t state)
27{ 28{
28 /* enable GPIO based wakeup */ 29 /* enable GPIO based wakeup */
29 au_writel(1, SYS_PININPUTEN); 30 alchemy_gpio1_input_enable();
30 31
31 /* clear and setup wake cause and source */ 32 /* clear and setup wake cause and source */
32 au_writel(0, SYS_WAKEMSK); 33 au_writel(0, SYS_WAKEMSK);
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c
index 8ed1ae12bc55..cc32c69a74ad 100644
--- a/arch/mips/alchemy/mtx-1/board_setup.c
+++ b/arch/mips/alchemy/mtx-1/board_setup.c
@@ -28,6 +28,7 @@
28 * 675 Mass Ave, Cambridge, MA 02139, USA. 28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */ 29 */
30 30
31#include <linux/gpio.h>
31#include <linux/init.h> 32#include <linux/init.h>
32 33
33#include <asm/mach-au1x00/au1000.h> 34#include <asm/mach-au1x00/au1000.h>
@@ -55,10 +56,11 @@ void __init board_setup(void)
55 } 56 }
56#endif 57#endif
57 58
59 alchemy_gpio2_enable();
60
58#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 61#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
59 /* Enable USB power switch */ 62 /* Enable USB power switch */
60 au_writel(au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR); 63 alchemy_gpio_direction_output(204, 0);
61 au_writel(0x100000, GPIO2_OUTPUT);
62#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ 64#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */
63 65
64#ifdef CONFIG_PCI 66#ifdef CONFIG_PCI
@@ -74,14 +76,14 @@ void __init board_setup(void)
74 76
75 /* Initialize GPIO */ 77 /* Initialize GPIO */
76 au_writel(0xFFFFFFFF, SYS_TRIOUTCLR); 78 au_writel(0xFFFFFFFF, SYS_TRIOUTCLR);
77 au_writel(0x00000001, SYS_OUTPUTCLR); /* set M66EN (PCI 66MHz) to OFF */ 79 alchemy_gpio_direction_output(0, 0); /* Disable M66EN (PCI 66MHz) */
78 au_writel(0x00000008, SYS_OUTPUTSET); /* set PCI CLKRUN# to OFF */ 80 alchemy_gpio_direction_output(3, 1); /* Disable PCI CLKRUN# */
79 au_writel(0x00000002, SYS_OUTPUTSET); /* set EXT_IO3 ON */ 81 alchemy_gpio_direction_output(1, 1); /* Enable EXT_IO3 */
80 au_writel(0x00000020, SYS_OUTPUTCLR); /* set eth PHY TX_ER to OFF */ 82 alchemy_gpio_direction_output(5, 0); /* Disable eth PHY TX_ER */
81 83
82 /* Enable LED and set it to green */ 84 /* Enable LED and set it to green */
83 au_writel(au_readl(GPIO2_DIR) | 0x1800, GPIO2_DIR); 85 alchemy_gpio_direction_output(211, 1); /* green on */
84 au_writel(0x18000800, GPIO2_OUTPUT); 86 alchemy_gpio_direction_output(212, 0); /* red off */
85 87
86 board_pci_idsel = mtx1_pci_idsel; 88 board_pci_idsel = mtx1_pci_idsel;
87 89
@@ -101,10 +103,10 @@ mtx1_pci_idsel(unsigned int devsel, int assert)
101 103
102 if (assert && devsel != 0) 104 if (assert && devsel != 0)
103 /* Suppress signal to Cardbus */ 105 /* Suppress signal to Cardbus */
104 au_writel(0x00000002, SYS_OUTPUTCLR); /* set EXT_IO3 OFF */ 106 gpio_set_value(1, 0); /* set EXT_IO3 OFF */
105 else 107 else
106 au_writel(0x00000002, SYS_OUTPUTSET); /* set EXT_IO3 ON */ 108 gpio_set_value(1, 1); /* set EXT_IO3 ON */
109
107 au_sync_udelay(1); 110 au_sync_udelay(1);
108 return 1; 111 return 1;
109} 112}
110
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c b/arch/mips/alchemy/xxs1500/board_setup.c
index a2634fabc50d..4de2d48caed8 100644
--- a/arch/mips/alchemy/xxs1500/board_setup.c
+++ b/arch/mips/alchemy/xxs1500/board_setup.c
@@ -23,6 +23,7 @@
23 * 675 Mass Ave, Cambridge, MA 02139, USA. 23 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 */ 24 */
25 25
26#include <linux/gpio.h>
26#include <linux/init.h> 27#include <linux/init.h>
27#include <linux/delay.h> 28#include <linux/delay.h>
28 29
@@ -50,6 +51,9 @@ void __init board_setup(void)
50 } 51 }
51#endif 52#endif
52 53
54 alchemy_gpio1_input_enable();
55 alchemy_gpio2_enable();
56
53 /* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */ 57 /* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */
54 pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3; 58 pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3;
55 pin_func |= SYS_PF_UR3; 59 pin_func |= SYS_PF_UR3;
@@ -65,20 +69,19 @@ void __init board_setup(void)
65 au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */ 69 au_writel(0x01, UART3_ADDR + UART_MCR); /* UART_MCR_DTR is 0x01??? */
66 70
67#ifdef CONFIG_PCMCIA_XXS1500 71#ifdef CONFIG_PCMCIA_XXS1500
68 /* Setup PCMCIA signals */
69 au_writel(0, SYS_PININPUTEN);
70
71 /* GPIO 0, 1, and 4 are inputs */ 72 /* GPIO 0, 1, and 4 are inputs */
72 au_writel(1 | (1 << 1) | (1 << 4), SYS_TRIOUTCLR); 73 alchemy_gpio_direction_input(0);
74 alchemy_gpio_direction_input(1);
75 alchemy_gpio_direction_input(4);
73 76
74 /* Enable GPIO2 if not already enabled */
75 au_writel(1, GPIO2_ENABLE);
76 /* GPIO2 208/9/10/11 are inputs */ 77 /* GPIO2 208/9/10/11 are inputs */
77 au_writel((1 << 8) | (1 << 9) | (1 << 10) | (1 << 11), GPIO2_DIR); 78 alchemy_gpio_direction_input(208);
79 alchemy_gpio_direction_input(209);
80 alchemy_gpio_direction_input(210);
81 alchemy_gpio_direction_input(211);
78 82
79 /* Turn off power */ 83 /* Turn off power */
80 au_writel((au_readl(GPIO2_PINSTATE) & ~(1 << 14)) | (1 << 30), 84 alchemy_gpio_direction_output(214, 0);
81 GPIO2_OUTPUT);
82#endif 85#endif
83 86
84#ifdef CONFIG_PCI 87#ifdef CONFIG_PCI
diff --git a/arch/mips/cavium-octeon/Makefile b/arch/mips/cavium-octeon/Makefile
index d6903c3f3d51..7c0528b0e34c 100644
--- a/arch/mips/cavium-octeon/Makefile
+++ b/arch/mips/cavium-octeon/Makefile
@@ -14,5 +14,9 @@ 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
17obj-$(CONFIG_PCI) += pci-common.o
18obj-$(CONFIG_PCI) += pci.o
19obj-$(CONFIG_PCI) += pcie.o
20obj-$(CONFIG_PCI_MSI) += msi.o
17 21
18EXTRA_CFLAGS += -Werror 22EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
index 01b1ef94b361..627c162a6159 100644
--- a/arch/mips/cavium-octeon/dma-octeon.c
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -13,20 +13,327 @@
13 */ 13 */
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/mm.h> 15#include <linux/mm.h>
16#include <linux/module.h>
17#include <linux/string.h>
18#include <linux/dma-mapping.h>
19#include <linux/platform_device.h>
20#include <linux/scatterlist.h>
21
22#include <linux/cache.h>
23#include <linux/io.h>
24
25#include <asm/octeon/octeon.h>
26#include <asm/octeon/cvmx-npi-defs.h>
27#include <asm/octeon/cvmx-pci-defs.h>
16 28
17#include <dma-coherence.h> 29#include <dma-coherence.h>
18 30
31#ifdef CONFIG_PCI
32#include "pci-common.h"
33#endif
34
35#define BAR2_PCI_ADDRESS 0x8000000000ul
36
37struct bar1_index_state {
38 int16_t ref_count; /* Number of PCI mappings using this index */
39 uint16_t address_bits; /* Upper bits of physical address. This is
40 shifted 22 bits */
41};
42
43#ifdef CONFIG_PCI
44static DEFINE_SPINLOCK(bar1_lock);
45static struct bar1_index_state bar1_state[32];
46#endif
47
19dma_addr_t octeon_map_dma_mem(struct device *dev, void *ptr, size_t size) 48dma_addr_t octeon_map_dma_mem(struct device *dev, void *ptr, size_t size)
20{ 49{
50#ifndef CONFIG_PCI
21 /* Without PCI/PCIe this function can be called for Octeon internal 51 /* Without PCI/PCIe this function can be called for Octeon internal
22 devices such as USB. These devices all support 64bit addressing */ 52 devices such as USB. These devices all support 64bit addressing */
23 mb(); 53 mb();
24 return virt_to_phys(ptr); 54 return virt_to_phys(ptr);
55#else
56 unsigned long flags;
57 uint64_t dma_mask;
58 int64_t start_index;
59 dma_addr_t result = -1;
60 uint64_t physical = virt_to_phys(ptr);
61 int64_t index;
62
63 mb();
64 /*
65 * Use the DMA masks to determine the allowed memory
66 * region. For us it doesn't limit the actual memory, just the
67 * address visible over PCI. Devices with limits need to use
68 * lower indexed Bar1 entries.
69 */
70 if (dev) {
71 dma_mask = dev->coherent_dma_mask;
72 if (dev->dma_mask)
73 dma_mask = *dev->dma_mask;
74 } else {
75 dma_mask = 0xfffffffful;
76 }
77
78 /*
79 * Platform devices, such as the internal USB, skip all
80 * translation and use Octeon physical addresses directly.
81 */
82 if (!dev || dev->bus == &platform_bus_type)
83 return physical;
84
85 switch (octeon_dma_bar_type) {
86 case OCTEON_DMA_BAR_TYPE_PCIE:
87 if (unlikely(physical < (16ul << 10)))
88 panic("dma_map_single: Not allowed to map first 16KB."
89 " It interferes with BAR0 special area\n");
90 else if ((physical + size >= (256ul << 20)) &&
91 (physical < (512ul << 20)))
92 panic("dma_map_single: Not allowed to map bootbus\n");
93 else if ((physical + size >= 0x400000000ull) &&
94 physical < 0x410000000ull)
95 panic("dma_map_single: "
96 "Attempt to map illegal memory address 0x%llx\n",
97 physical);
98 else if (physical >= 0x420000000ull)
99 panic("dma_map_single: "
100 "Attempt to map illegal memory address 0x%llx\n",
101 physical);
102 else if ((physical + size >=
103 (4ull<<30) - (OCTEON_PCI_BAR1_HOLE_SIZE<<20))
104 && physical < (4ull<<30))
105 pr_warning("dma_map_single: Warning: "
106 "Mapping memory address that might "
107 "conflict with devices 0x%llx-0x%llx\n",
108 physical, physical+size-1);
109 /* The 2nd 256MB is mapped at 256<<20 instead of 0x410000000 */
110 if ((physical >= 0x410000000ull) && physical < 0x420000000ull)
111 result = physical - 0x400000000ull;
112 else
113 result = physical;
114 if (((result+size-1) & dma_mask) != result+size-1)
115 panic("dma_map_single: Attempt to map address "
116 "0x%llx-0x%llx, which can't be accessed "
117 "according to the dma mask 0x%llx\n",
118 physical, physical+size-1, dma_mask);
119 goto done;
120
121 case OCTEON_DMA_BAR_TYPE_BIG:
122#ifdef CONFIG_64BIT
123 /* If the device supports 64bit addressing, then use BAR2 */
124 if (dma_mask > BAR2_PCI_ADDRESS) {
125 result = physical + BAR2_PCI_ADDRESS;
126 goto done;
127 }
128#endif
129 if (unlikely(physical < (4ul << 10))) {
130 panic("dma_map_single: Not allowed to map first 4KB. "
131 "It interferes with BAR0 special area\n");
132 } else if (physical < (256ul << 20)) {
133 if (unlikely(physical + size > (256ul << 20)))
134 panic("dma_map_single: Requested memory spans "
135 "Bar0 0:256MB and bootbus\n");
136 result = physical;
137 goto done;
138 } else if (unlikely(physical < (512ul << 20))) {
139 panic("dma_map_single: Not allowed to map bootbus\n");
140 } else if (physical < (2ul << 30)) {
141 if (unlikely(physical + size > (2ul << 30)))
142 panic("dma_map_single: Requested memory spans "
143 "Bar0 512MB:2GB and BAR1\n");
144 result = physical;
145 goto done;
146 } else if (physical < (2ul << 30) + (128 << 20)) {
147 /* Fall through */
148 } else if (physical <
149 (4ul << 30) - (OCTEON_PCI_BAR1_HOLE_SIZE << 20)) {
150 if (unlikely
151 (physical + size >
152 (4ul << 30) - (OCTEON_PCI_BAR1_HOLE_SIZE << 20)))
153 panic("dma_map_single: Requested memory "
154 "extends past Bar1 (4GB-%luMB)\n",
155 OCTEON_PCI_BAR1_HOLE_SIZE);
156 result = physical;
157 goto done;
158 } else if ((physical >= 0x410000000ull) &&
159 (physical < 0x420000000ull)) {
160 if (unlikely(physical + size > 0x420000000ull))
161 panic("dma_map_single: Requested memory spans "
162 "non existant memory\n");
163 /* BAR0 fixed mapping 256MB:512MB ->
164 * 16GB+256MB:16GB+512MB */
165 result = physical - 0x400000000ull;
166 goto done;
167 } else {
168 /* Continued below switch statement */
169 }
170 break;
171
172 case OCTEON_DMA_BAR_TYPE_SMALL:
173#ifdef CONFIG_64BIT
174 /* If the device supports 64bit addressing, then use BAR2 */
175 if (dma_mask > BAR2_PCI_ADDRESS) {
176 result = physical + BAR2_PCI_ADDRESS;
177 goto done;
178 }
179#endif
180 /* Continued below switch statement */
181 break;
182
183 default:
184 panic("dma_map_single: Invalid octeon_dma_bar_type\n");
185 }
186
187 /* Don't allow mapping to span multiple Bar entries. The hardware guys
188 won't guarantee that DMA across boards work */
189 if (unlikely((physical >> 22) != ((physical + size - 1) >> 22)))
190 panic("dma_map_single: "
191 "Requested memory spans more than one Bar1 entry\n");
192
193 if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_BIG)
194 start_index = 31;
195 else if (unlikely(dma_mask < (1ul << 27)))
196 start_index = (dma_mask >> 22);
197 else
198 start_index = 31;
199
200 /* Only one processor can access the Bar register at once */
201 spin_lock_irqsave(&bar1_lock, flags);
202
203 /* Look through Bar1 for existing mapping that will work */
204 for (index = start_index; index >= 0; index--) {
205 if ((bar1_state[index].address_bits == physical >> 22) &&
206 (bar1_state[index].ref_count)) {
207 /* An existing mapping will work, use it */
208 bar1_state[index].ref_count++;
209 if (unlikely(bar1_state[index].ref_count < 0))
210 panic("dma_map_single: "
211 "Bar1[%d] reference count overflowed\n",
212 (int) index);
213 result = (index << 22) | (physical & ((1 << 22) - 1));
214 /* Large BAR1 is offset at 2GB */
215 if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_BIG)
216 result += 2ul << 30;
217 goto done_unlock;
218 }
219 }
220
221 /* No existing mappings, look for a free entry */
222 for (index = start_index; index >= 0; index--) {
223 if (unlikely(bar1_state[index].ref_count == 0)) {
224 union cvmx_pci_bar1_indexx bar1_index;
225 /* We have a free entry, use it */
226 bar1_state[index].ref_count = 1;
227 bar1_state[index].address_bits = physical >> 22;
228 bar1_index.u32 = 0;
229 /* Address bits[35:22] sent to L2C */
230 bar1_index.s.addr_idx = physical >> 22;
231 /* Don't put PCI accesses in L2. */
232 bar1_index.s.ca = 1;
233 /* Endian Swap Mode */
234 bar1_index.s.end_swp = 1;
235 /* Set '1' when the selected address range is valid. */
236 bar1_index.s.addr_v = 1;
237 octeon_npi_write32(CVMX_NPI_PCI_BAR1_INDEXX(index),
238 bar1_index.u32);
239 /* An existing mapping will work, use it */
240 result = (index << 22) | (physical & ((1 << 22) - 1));
241 /* Large BAR1 is offset at 2GB */
242 if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_BIG)
243 result += 2ul << 30;
244 goto done_unlock;
245 }
246 }
247
248 pr_err("dma_map_single: "
249 "Can't find empty BAR1 index for physical mapping 0x%llx\n",
250 (unsigned long long) physical);
251
252done_unlock:
253 spin_unlock_irqrestore(&bar1_lock, flags);
254done:
255 pr_debug("dma_map_single 0x%llx->0x%llx\n", physical, result);
256 return result;
257#endif
25} 258}
26 259
27void octeon_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 260void octeon_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
28{ 261{
29 /* Without PCI/PCIe this function can be called for Octeon internal 262#ifndef CONFIG_PCI
30 * devices such as USB. These devices all support 64bit addressing */ 263 /*
264 * Without PCI/PCIe this function can be called for Octeon internal
265 * devices such as USB. These devices all support 64bit addressing.
266 */
267 return;
268#else
269 unsigned long flags;
270 uint64_t index;
271
272 /*
273 * Platform devices, such as the internal USB, skip all
274 * translation and use Octeon physical addresses directly.
275 */
276 if (dev->bus == &platform_bus_type)
277 return;
278
279 switch (octeon_dma_bar_type) {
280 case OCTEON_DMA_BAR_TYPE_PCIE:
281 /* Nothing to do, all mappings are static */
282 goto done;
283
284 case OCTEON_DMA_BAR_TYPE_BIG:
285#ifdef CONFIG_64BIT
286 /* Nothing to do for addresses using BAR2 */
287 if (dma_addr >= BAR2_PCI_ADDRESS)
288 goto done;
289#endif
290 if (unlikely(dma_addr < (4ul << 10)))
291 panic("dma_unmap_single: Unexpect DMA address 0x%llx\n",
292 dma_addr);
293 else if (dma_addr < (2ul << 30))
294 /* Nothing to do for addresses using BAR0 */
295 goto done;
296 else if (dma_addr < (2ul << 30) + (128ul << 20))
297 /* Need to unmap, fall through */
298 index = (dma_addr - (2ul << 30)) >> 22;
299 else if (dma_addr <
300 (4ul << 30) - (OCTEON_PCI_BAR1_HOLE_SIZE << 20))
301 goto done; /* Nothing to do for the rest of BAR1 */
302 else
303 panic("dma_unmap_single: Unexpect DMA address 0x%llx\n",
304 dma_addr);
305 /* Continued below switch statement */
306 break;
307
308 case OCTEON_DMA_BAR_TYPE_SMALL:
309#ifdef CONFIG_64BIT
310 /* Nothing to do for addresses using BAR2 */
311 if (dma_addr >= BAR2_PCI_ADDRESS)
312 goto done;
313#endif
314 index = dma_addr >> 22;
315 /* Continued below switch statement */
316 break;
317
318 default:
319 panic("dma_unmap_single: Invalid octeon_dma_bar_type\n");
320 }
321
322 if (unlikely(index > 31))
323 panic("dma_unmap_single: "
324 "Attempt to unmap an invalid address (0x%llx)\n",
325 dma_addr);
326
327 spin_lock_irqsave(&bar1_lock, flags);
328 bar1_state[index].ref_count--;
329 if (bar1_state[index].ref_count == 0)
330 octeon_npi_write32(CVMX_NPI_PCI_BAR1_INDEXX(index), 0);
331 else if (unlikely(bar1_state[index].ref_count < 0))
332 panic("dma_unmap_single: Bar1[%u] reference count < 0\n",
333 (int) index);
334 spin_unlock_irqrestore(&bar1_lock, flags);
335done:
336 pr_debug("dma_unmap_single 0x%llx\n", dma_addr);
31 return; 337 return;
338#endif
32} 339}
diff --git a/arch/mips/cavium-octeon/executive/Makefile b/arch/mips/cavium-octeon/executive/Makefile
index 80d6cb26766b..2fd66db6939e 100644
--- a/arch/mips/cavium-octeon/executive/Makefile
+++ b/arch/mips/cavium-octeon/executive/Makefile
@@ -11,3 +11,4 @@
11 11
12obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o 12obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o
13 13
14obj-$(CONFIG_PCI) += cvmx-helper-errata.o cvmx-helper-jtag.o
diff --git a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
index 4f5a08b37ccd..25666da17b22 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
@@ -31,6 +31,7 @@
31 */ 31 */
32 32
33#include <linux/kernel.h> 33#include <linux/kernel.h>
34#include <linux/module.h>
34 35
35#include <asm/octeon/cvmx.h> 36#include <asm/octeon/cvmx.h>
36#include <asm/octeon/cvmx-spinlock.h> 37#include <asm/octeon/cvmx-spinlock.h>
@@ -97,6 +98,33 @@ void *cvmx_bootmem_alloc(uint64_t size, uint64_t alignment)
97 return cvmx_bootmem_alloc_range(size, alignment, 0, 0); 98 return cvmx_bootmem_alloc_range(size, alignment, 0, 0);
98} 99}
99 100
101void *cvmx_bootmem_alloc_named_range(uint64_t size, uint64_t min_addr,
102 uint64_t max_addr, uint64_t align,
103 char *name)
104{
105 int64_t addr;
106
107 addr = cvmx_bootmem_phy_named_block_alloc(size, min_addr, max_addr,
108 align, name, 0);
109 if (addr >= 0)
110 return cvmx_phys_to_ptr(addr);
111 else
112 return NULL;
113}
114
115void *cvmx_bootmem_alloc_named_address(uint64_t size, uint64_t address,
116 char *name)
117{
118 return cvmx_bootmem_alloc_named_range(size, address, address + size,
119 0, name);
120}
121
122void *cvmx_bootmem_alloc_named(uint64_t size, uint64_t alignment, char *name)
123{
124 return cvmx_bootmem_alloc_named_range(size, 0, 0, alignment, name);
125}
126EXPORT_SYMBOL(cvmx_bootmem_alloc_named);
127
100int cvmx_bootmem_free_named(char *name) 128int cvmx_bootmem_free_named(char *name)
101{ 129{
102 return cvmx_bootmem_phy_named_block_free(name, 0); 130 return cvmx_bootmem_phy_named_block_free(name, 0);
@@ -106,6 +134,7 @@ struct cvmx_bootmem_named_block_desc *cvmx_bootmem_find_named_block(char *name)
106{ 134{
107 return cvmx_bootmem_phy_named_block_find(name, 0); 135 return cvmx_bootmem_phy_named_block_find(name, 0);
108} 136}
137EXPORT_SYMBOL(cvmx_bootmem_find_named_block);
109 138
110void cvmx_bootmem_lock(void) 139void cvmx_bootmem_lock(void)
111{ 140{
@@ -584,3 +613,78 @@ int cvmx_bootmem_phy_named_block_free(char *name, uint32_t flags)
584 cvmx_bootmem_unlock(); 613 cvmx_bootmem_unlock();
585 return named_block_ptr != NULL; /* 0 on failure, 1 on success */ 614 return named_block_ptr != NULL; /* 0 on failure, 1 on success */
586} 615}
616
617int64_t cvmx_bootmem_phy_named_block_alloc(uint64_t size, uint64_t min_addr,
618 uint64_t max_addr,
619 uint64_t alignment,
620 char *name,
621 uint32_t flags)
622{
623 int64_t addr_allocated;
624 struct cvmx_bootmem_named_block_desc *named_block_desc_ptr;
625
626#ifdef DEBUG
627 cvmx_dprintf("cvmx_bootmem_phy_named_block_alloc: size: 0x%llx, min: "
628 "0x%llx, max: 0x%llx, align: 0x%llx, name: %s\n",
629 (unsigned long long)size,
630 (unsigned long long)min_addr,
631 (unsigned long long)max_addr,
632 (unsigned long long)alignment,
633 name);
634#endif
635 if (cvmx_bootmem_desc->major_version != 3) {
636 cvmx_dprintf("ERROR: Incompatible bootmem descriptor version: "
637 "%d.%d at addr: %p\n",
638 (int)cvmx_bootmem_desc->major_version,
639 (int)cvmx_bootmem_desc->minor_version,
640 cvmx_bootmem_desc);
641 return -1;
642 }
643
644 /*
645 * Take lock here, as name lookup/block alloc/name add need to
646 * be atomic.
647 */
648 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
649 cvmx_spinlock_lock((cvmx_spinlock_t *)&(cvmx_bootmem_desc->lock));
650
651 /* Get pointer to first available named block descriptor */
652 named_block_desc_ptr =
653 cvmx_bootmem_phy_named_block_find(NULL,
654 flags | CVMX_BOOTMEM_FLAG_NO_LOCKING);
655
656 /*
657 * Check to see if name already in use, return error if name
658 * not available or no more room for blocks.
659 */
660 if (cvmx_bootmem_phy_named_block_find(name,
661 flags | CVMX_BOOTMEM_FLAG_NO_LOCKING) || !named_block_desc_ptr) {
662 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
663 cvmx_spinlock_unlock((cvmx_spinlock_t *)&(cvmx_bootmem_desc->lock));
664 return -1;
665 }
666
667
668 /*
669 * Round size up to mult of minimum alignment bytes We need
670 * the actual size allocated to allow for blocks to be
671 * coallesced when they are freed. The alloc routine does the
672 * same rounding up on all allocations.
673 */
674 size = __ALIGN_MASK(size, (CVMX_BOOTMEM_ALIGNMENT_SIZE - 1));
675
676 addr_allocated = cvmx_bootmem_phy_alloc(size, min_addr, max_addr,
677 alignment,
678 flags | CVMX_BOOTMEM_FLAG_NO_LOCKING);
679 if (addr_allocated >= 0) {
680 named_block_desc_ptr->base_addr = addr_allocated;
681 named_block_desc_ptr->size = size;
682 strncpy(named_block_desc_ptr->name, name,
683 cvmx_bootmem_desc->named_block_name_len);
684 named_block_desc_ptr->name[cvmx_bootmem_desc->named_block_name_len - 1] = 0;
685 }
686
687 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
688 cvmx_spinlock_unlock((cvmx_spinlock_t *)&(cvmx_bootmem_desc->lock));
689 return addr_allocated;
690}
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-errata.c b/arch/mips/cavium-octeon/executive/cvmx-helper-errata.c
new file mode 100644
index 000000000000..868659e64d4a
--- /dev/null
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-errata.c
@@ -0,0 +1,73 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/**
29 *
30 * Fixes and workaround for Octeon chip errata. This file
31 * contains functions called by cvmx-helper to workaround known
32 * chip errata. For the most part, code doesn't need to call
33 * these functions directly.
34 *
35 */
36#include <linux/module.h>
37
38#include <asm/octeon/octeon.h>
39
40#include <asm/octeon/cvmx-helper-jtag.h>
41
42/**
43 * Due to errata G-720, the 2nd order CDR circuit on CN52XX pass
44 * 1 doesn't work properly. The following code disables 2nd order
45 * CDR for the specified QLM.
46 *
47 * @qlm: QLM to disable 2nd order CDR for.
48 */
49void __cvmx_helper_errata_qlm_disable_2nd_order_cdr(int qlm)
50{
51 int lane;
52 cvmx_helper_qlm_jtag_init();
53 /* We need to load all four lanes of the QLM, a total of 1072 bits */
54 for (lane = 0; lane < 4; lane++) {
55 /*
56 * Each lane has 268 bits. We need to set
57 * cfg_cdr_incx<67:64> = 3 and cfg_cdr_secord<77> =
58 * 1. All other bits are zero. Bits go in LSB first,
59 * so start off with the zeros for bits <63:0>.
60 */
61 cvmx_helper_qlm_jtag_shift_zeros(qlm, 63 - 0 + 1);
62 /* cfg_cdr_incx<67:64>=3 */
63 cvmx_helper_qlm_jtag_shift(qlm, 67 - 64 + 1, 3);
64 /* Zeros for bits <76:68> */
65 cvmx_helper_qlm_jtag_shift_zeros(qlm, 76 - 68 + 1);
66 /* cfg_cdr_secord<77>=1 */
67 cvmx_helper_qlm_jtag_shift(qlm, 77 - 77 + 1, 1);
68 /* Zeros for bits <267:78> */
69 cvmx_helper_qlm_jtag_shift_zeros(qlm, 267 - 78 + 1);
70 }
71 cvmx_helper_qlm_jtag_update(qlm);
72}
73EXPORT_SYMBOL(__cvmx_helper_errata_qlm_disable_2nd_order_cdr);
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-jtag.c b/arch/mips/cavium-octeon/executive/cvmx-helper-jtag.c
new file mode 100644
index 000000000000..c1c54890bae0
--- /dev/null
+++ b/arch/mips/cavium-octeon/executive/cvmx-helper-jtag.c
@@ -0,0 +1,144 @@
1
2/***********************license start***************
3 * Author: Cavium Networks
4 *
5 * Contact: support@caviumnetworks.com
6 * This file is part of the OCTEON SDK
7 *
8 * Copyright (c) 2003-2008 Cavium Networks
9 *
10 * This file is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License, Version 2, as
12 * published by the Free Software Foundation.
13 *
14 * This file is distributed in the hope that it will be useful, but
15 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
17 * NONINFRINGEMENT. See the GNU General Public License for more
18 * details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this file; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 * or visit http://www.gnu.org/licenses/.
24 *
25 * This file may also be available under a different license from Cavium.
26 * Contact Cavium Networks for more information
27 ***********************license end**************************************/
28
29/**
30 *
31 * Helper utilities for qlm_jtag.
32 *
33 */
34
35#include <asm/octeon/octeon.h>
36#include <asm/octeon/cvmx-helper-jtag.h>
37
38
39/**
40 * Initialize the internal QLM JTAG logic to allow programming
41 * of the JTAG chain by the cvmx_helper_qlm_jtag_*() functions.
42 * These functions should only be used at the direction of Cavium
43 * Networks. Programming incorrect values into the JTAG chain
44 * can cause chip damage.
45 */
46void cvmx_helper_qlm_jtag_init(void)
47{
48 union cvmx_ciu_qlm_jtgc jtgc;
49 uint32_t clock_div = 0;
50 uint32_t divisor = cvmx_sysinfo_get()->cpu_clock_hz / (25 * 1000000);
51 divisor = (divisor - 1) >> 2;
52 /* Convert the divisor into a power of 2 shift */
53 while (divisor) {
54 clock_div++;
55 divisor = divisor >> 1;
56 }
57
58 /*
59 * Clock divider for QLM JTAG operations. eclk is divided by
60 * 2^(CLK_DIV + 2)
61 */
62 jtgc.u64 = 0;
63 jtgc.s.clk_div = clock_div;
64 jtgc.s.mux_sel = 0;
65 if (OCTEON_IS_MODEL(OCTEON_CN52XX))
66 jtgc.s.bypass = 0x3;
67 else
68 jtgc.s.bypass = 0xf;
69 cvmx_write_csr(CVMX_CIU_QLM_JTGC, jtgc.u64);
70 cvmx_read_csr(CVMX_CIU_QLM_JTGC);
71}
72
73/**
74 * Write up to 32bits into the QLM jtag chain. Bits are shifted
75 * into the MSB and out the LSB, so you should shift in the low
76 * order bits followed by the high order bits. The JTAG chain is
77 * 4 * 268 bits long, or 1072.
78 *
79 * @qlm: QLM to shift value into
80 * @bits: Number of bits to shift in (1-32).
81 * @data: Data to shift in. Bit 0 enters the chain first, followed by
82 * bit 1, etc.
83 *
84 * Returns The low order bits of the JTAG chain that shifted out of the
85 * circle.
86 */
87uint32_t cvmx_helper_qlm_jtag_shift(int qlm, int bits, uint32_t data)
88{
89 union cvmx_ciu_qlm_jtgd jtgd;
90 jtgd.u64 = 0;
91 jtgd.s.shift = 1;
92 jtgd.s.shft_cnt = bits - 1;
93 jtgd.s.shft_reg = data;
94 if (!OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X))
95 jtgd.s.select = 1 << qlm;
96 cvmx_write_csr(CVMX_CIU_QLM_JTGD, jtgd.u64);
97 do {
98 jtgd.u64 = cvmx_read_csr(CVMX_CIU_QLM_JTGD);
99 } while (jtgd.s.shift);
100 return jtgd.s.shft_reg >> (32 - bits);
101}
102
103/**
104 * Shift long sequences of zeros into the QLM JTAG chain. It is
105 * common to need to shift more than 32 bits of zeros into the
106 * chain. This function is a convience wrapper around
107 * cvmx_helper_qlm_jtag_shift() to shift more than 32 bits of
108 * zeros at a time.
109 *
110 * @qlm: QLM to shift zeros into
111 * @bits:
112 */
113void cvmx_helper_qlm_jtag_shift_zeros(int qlm, int bits)
114{
115 while (bits > 0) {
116 int n = bits;
117 if (n > 32)
118 n = 32;
119 cvmx_helper_qlm_jtag_shift(qlm, n, 0);
120 bits -= n;
121 }
122}
123
124/**
125 * Program the QLM JTAG chain into all lanes of the QLM. You must
126 * have already shifted in 268*4, or 1072 bits into the JTAG
127 * chain. Updating invalid values can possibly cause chip damage.
128 *
129 * @qlm: QLM to program
130 */
131void cvmx_helper_qlm_jtag_update(int qlm)
132{
133 union cvmx_ciu_qlm_jtgd jtgd;
134
135 /* Update the new data */
136 jtgd.u64 = 0;
137 jtgd.s.update = 1;
138 if (!OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X))
139 jtgd.s.select = 1 << qlm;
140 cvmx_write_csr(CVMX_CIU_QLM_JTGD, jtgd.u64);
141 do {
142 jtgd.u64 = cvmx_read_csr(CVMX_CIU_QLM_JTGD);
143 } while (jtgd.s.update);
144}
diff --git a/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c b/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c
index 4812370706a1..e5838890cba5 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c
@@ -29,6 +29,7 @@
29 * This module provides system/board/application information obtained 29 * This module provides system/board/application information obtained
30 * by the bootloader. 30 * by the bootloader.
31 */ 31 */
32#include <linux/module.h>
32 33
33#include <asm/octeon/cvmx.h> 34#include <asm/octeon/cvmx.h>
34#include <asm/octeon/cvmx-spinlock.h> 35#include <asm/octeon/cvmx-spinlock.h>
@@ -69,6 +70,7 @@ struct cvmx_sysinfo *cvmx_sysinfo_get(void)
69{ 70{
70 return &(state.sysinfo); 71 return &(state.sysinfo);
71} 72}
73EXPORT_SYMBOL(cvmx_sysinfo_get);
72 74
73/** 75/**
74 * This function is used in non-simple executive environments (such as 76 * This function is used in non-simple executive environments (such as
diff --git a/arch/mips/cavium-octeon/msi.c b/arch/mips/cavium-octeon/msi.c
new file mode 100644
index 000000000000..964b03b75a8f
--- /dev/null
+++ b/arch/mips/cavium-octeon/msi.c
@@ -0,0 +1,288 @@
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 * Copyright (C) 2005-2007 Cavium Networks
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/msi.h>
11#include <linux/spinlock.h>
12#include <linux/interrupt.h>
13
14#include <asm/octeon/octeon.h>
15#include <asm/octeon/cvmx-npi-defs.h>
16#include <asm/octeon/cvmx-pci-defs.h>
17#include <asm/octeon/cvmx-npei-defs.h>
18#include <asm/octeon/cvmx-pexp-defs.h>
19
20#include "pci-common.h"
21
22/*
23 * Each bit in msi_free_irq_bitmask represents a MSI interrupt that is
24 * in use.
25 */
26static uint64_t msi_free_irq_bitmask;
27
28/*
29 * Each bit in msi_multiple_irq_bitmask tells that the device using
30 * this bit in msi_free_irq_bitmask is also using the next bit. This
31 * is used so we can disable all of the MSI interrupts when a device
32 * uses multiple.
33 */
34static uint64_t msi_multiple_irq_bitmask;
35
36/*
37 * This lock controls updates to msi_free_irq_bitmask and
38 * msi_multiple_irq_bitmask.
39 */
40static DEFINE_SPINLOCK(msi_free_irq_bitmask_lock);
41
42
43/**
44 * Called when a driver request MSI interrupts instead of the
45 * legacy INT A-D. This routine will allocate multiple interrupts
46 * for MSI devices that support them. A device can override this by
47 * programming the MSI control bits [6:4] before calling
48 * pci_enable_msi().
49 *
50 * @param dev Device requesting MSI interrupts
51 * @param desc MSI descriptor
52 *
53 * Returns 0 on success.
54 */
55int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
56{
57 struct msi_msg msg;
58 uint16_t control;
59 int configured_private_bits;
60 int request_private_bits;
61 int irq;
62 int irq_step;
63 uint64_t search_mask;
64
65 /*
66 * Read the MSI config to figure out how many IRQs this device
67 * wants. Most devices only want 1, which will give
68 * configured_private_bits and request_private_bits equal 0.
69 */
70 pci_read_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS,
71 &control);
72
73 /*
74 * If the number of private bits has been configured then use
75 * that value instead of the requested number. This gives the
76 * driver the chance to override the number of interrupts
77 * before calling pci_enable_msi().
78 */
79 configured_private_bits = (control & PCI_MSI_FLAGS_QSIZE) >> 4;
80 if (configured_private_bits == 0) {
81 /* Nothing is configured, so use the hardware requested size */
82 request_private_bits = (control & PCI_MSI_FLAGS_QMASK) >> 1;
83 } else {
84 /*
85 * Use the number of configured bits, assuming the
86 * driver wanted to override the hardware request
87 * value.
88 */
89 request_private_bits = configured_private_bits;
90 }
91
92 /*
93 * The PCI 2.3 spec mandates that there are at most 32
94 * interrupts. If this device asks for more, only give it one.
95 */
96 if (request_private_bits > 5)
97 request_private_bits = 0;
98
99try_only_one:
100 /*
101 * The IRQs have to be aligned on a power of two based on the
102 * number being requested.
103 */
104 irq_step = 1 << request_private_bits;
105
106 /* Mask with one bit for each IRQ */
107 search_mask = (1 << irq_step) - 1;
108
109 /*
110 * We're going to search msi_free_irq_bitmask_lock for zero
111 * bits. This represents an MSI interrupt number that isn't in
112 * use.
113 */
114 spin_lock(&msi_free_irq_bitmask_lock);
115 for (irq = 0; irq < 64; irq += irq_step) {
116 if ((msi_free_irq_bitmask & (search_mask << irq)) == 0) {
117 msi_free_irq_bitmask |= search_mask << irq;
118 msi_multiple_irq_bitmask |= (search_mask >> 1) << irq;
119 break;
120 }
121 }
122 spin_unlock(&msi_free_irq_bitmask_lock);
123
124 /* Make sure the search for available interrupts didn't fail */
125 if (irq >= 64) {
126 if (request_private_bits) {
127 pr_err("arch_setup_msi_irq: Unable to find %d free "
128 "interrupts, trying just one",
129 1 << request_private_bits);
130 request_private_bits = 0;
131 goto try_only_one;
132 } else
133 panic("arch_setup_msi_irq: Unable to find a free MSI "
134 "interrupt");
135 }
136
137 /* MSI interrupts start at logical IRQ OCTEON_IRQ_MSI_BIT0 */
138 irq += OCTEON_IRQ_MSI_BIT0;
139
140 switch (octeon_dma_bar_type) {
141 case OCTEON_DMA_BAR_TYPE_SMALL:
142 /* When not using big bar, Bar 0 is based at 128MB */
143 msg.address_lo =
144 ((128ul << 20) + CVMX_PCI_MSI_RCV) & 0xffffffff;
145 msg.address_hi = ((128ul << 20) + CVMX_PCI_MSI_RCV) >> 32;
146 case OCTEON_DMA_BAR_TYPE_BIG:
147 /* When using big bar, Bar 0 is based at 0 */
148 msg.address_lo = (0 + CVMX_PCI_MSI_RCV) & 0xffffffff;
149 msg.address_hi = (0 + CVMX_PCI_MSI_RCV) >> 32;
150 break;
151 case OCTEON_DMA_BAR_TYPE_PCIE:
152 /* When using PCIe, Bar 0 is based at 0 */
153 /* FIXME CVMX_NPEI_MSI_RCV* other than 0? */
154 msg.address_lo = (0 + CVMX_NPEI_PCIE_MSI_RCV) & 0xffffffff;
155 msg.address_hi = (0 + CVMX_NPEI_PCIE_MSI_RCV) >> 32;
156 break;
157 default:
158 panic("arch_setup_msi_irq: Invalid octeon_dma_bar_type\n");
159 }
160 msg.data = irq - OCTEON_IRQ_MSI_BIT0;
161
162 /* Update the number of IRQs the device has available to it */
163 control &= ~PCI_MSI_FLAGS_QSIZE;
164 control |= request_private_bits << 4;
165 pci_write_config_word(dev, desc->msi_attrib.pos + PCI_MSI_FLAGS,
166 control);
167
168 set_irq_msi(irq, desc);
169 write_msi_msg(irq, &msg);
170 return 0;
171}
172
173
174/**
175 * Called when a device no longer needs its MSI interrupts. All
176 * MSI interrupts for the device are freed.
177 *
178 * @irq: The devices first irq number. There may be multple in sequence.
179 */
180void arch_teardown_msi_irq(unsigned int irq)
181{
182 int number_irqs;
183 uint64_t bitmask;
184
185 if ((irq < OCTEON_IRQ_MSI_BIT0) || (irq > OCTEON_IRQ_MSI_BIT63))
186 panic("arch_teardown_msi_irq: Attempted to teardown illegal "
187 "MSI interrupt (%d)", irq);
188 irq -= OCTEON_IRQ_MSI_BIT0;
189
190 /*
191 * Count the number of IRQs we need to free by looking at the
192 * msi_multiple_irq_bitmask. Each bit set means that the next
193 * IRQ is also owned by this device.
194 */
195 number_irqs = 0;
196 while ((irq+number_irqs < 64) &&
197 (msi_multiple_irq_bitmask & (1ull << (irq + number_irqs))))
198 number_irqs++;
199 number_irqs++;
200 /* Mask with one bit for each IRQ */
201 bitmask = (1 << number_irqs) - 1;
202 /* Shift the mask to the correct bit location */
203 bitmask <<= irq;
204 if ((msi_free_irq_bitmask & bitmask) != bitmask)
205 panic("arch_teardown_msi_irq: Attempted to teardown MSI "
206 "interrupt (%d) not in use", irq);
207
208 /* Checks are done, update the in use bitmask */
209 spin_lock(&msi_free_irq_bitmask_lock);
210 msi_free_irq_bitmask &= ~bitmask;
211 msi_multiple_irq_bitmask &= ~bitmask;
212 spin_unlock(&msi_free_irq_bitmask_lock);
213}
214
215
216/**
217 * Called by the interrupt handling code when an MSI interrupt
218 * occurs.
219 *
220 * @param cpl
221 * @param dev_id
222 *
223 * @return
224 */
225static irqreturn_t octeon_msi_interrupt(int cpl, void *dev_id)
226{
227 uint64_t msi_bits;
228 int irq;
229
230 if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE)
231 msi_bits = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_RCV0);
232 else
233 msi_bits = cvmx_read_csr(CVMX_NPI_NPI_MSI_RCV);
234 irq = fls64(msi_bits);
235 if (irq) {
236 irq += OCTEON_IRQ_MSI_BIT0 - 1;
237 if (irq_desc[irq].action) {
238 do_IRQ(irq);
239 return IRQ_HANDLED;
240 } else {
241 pr_err("Spurious MSI interrupt %d\n", irq);
242 if (octeon_has_feature(OCTEON_FEATURE_PCIE)) {
243 /* These chips have PCIe */
244 cvmx_write_csr(CVMX_PEXP_NPEI_MSI_RCV0,
245 1ull << (irq -
246 OCTEON_IRQ_MSI_BIT0));
247 } else {
248 /* These chips have PCI */
249 cvmx_write_csr(CVMX_NPI_NPI_MSI_RCV,
250 1ull << (irq -
251 OCTEON_IRQ_MSI_BIT0));
252 }
253 }
254 }
255 return IRQ_NONE;
256}
257
258
259/**
260 * Initializes the MSI interrupt handling code
261 *
262 * @return
263 */
264int octeon_msi_initialize(void)
265{
266 int r;
267 if (octeon_has_feature(OCTEON_FEATURE_PCIE)) {
268 r = request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt,
269 IRQF_SHARED,
270 "MSI[0:63]", octeon_msi_interrupt);
271 } else if (octeon_is_pci_host()) {
272 r = request_irq(OCTEON_IRQ_PCI_MSI0, octeon_msi_interrupt,
273 IRQF_SHARED,
274 "MSI[0:15]", octeon_msi_interrupt);
275 r += request_irq(OCTEON_IRQ_PCI_MSI1, octeon_msi_interrupt,
276 IRQF_SHARED,
277 "MSI[16:31]", octeon_msi_interrupt);
278 r += request_irq(OCTEON_IRQ_PCI_MSI2, octeon_msi_interrupt,
279 IRQF_SHARED,
280 "MSI[32:47]", octeon_msi_interrupt);
281 r += request_irq(OCTEON_IRQ_PCI_MSI3, octeon_msi_interrupt,
282 IRQF_SHARED,
283 "MSI[48:63]", octeon_msi_interrupt);
284 }
285 return 0;
286}
287
288subsys_initcall(octeon_msi_initialize);
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index d3a0c8154bec..8dfa009e0070 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -10,6 +10,8 @@
10#include <linux/hardirq.h> 10#include <linux/hardirq.h>
11 11
12#include <asm/octeon/octeon.h> 12#include <asm/octeon/octeon.h>
13#include <asm/octeon/cvmx-pexp-defs.h>
14#include <asm/octeon/cvmx-npi-defs.h>
13 15
14DEFINE_RWLOCK(octeon_irq_ciu0_rwlock); 16DEFINE_RWLOCK(octeon_irq_ciu0_rwlock);
15DEFINE_RWLOCK(octeon_irq_ciu1_rwlock); 17DEFINE_RWLOCK(octeon_irq_ciu1_rwlock);
diff --git a/arch/mips/cavium-octeon/pci-common.c b/arch/mips/cavium-octeon/pci-common.c
new file mode 100644
index 000000000000..cd029f88da7f
--- /dev/null
+++ b/arch/mips/cavium-octeon/pci-common.c
@@ -0,0 +1,137 @@
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 * Copyright (C) 2005-2007 Cavium Networks
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/pci.h>
11#include <linux/interrupt.h>
12#include <linux/time.h>
13#include <linux/delay.h>
14#include "pci-common.h"
15
16typeof(pcibios_map_irq) *octeon_pcibios_map_irq;
17enum octeon_dma_bar_type octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_INVALID;
18
19/**
20 * Map a PCI device to the appropriate interrupt line
21 *
22 * @param dev The Linux PCI device structure for the device to map
23 * @param slot The slot number for this device on __BUS 0__. Linux
24 * enumerates through all the bridges and figures out the
25 * slot on Bus 0 where this device eventually hooks to.
26 * @param pin The PCI interrupt pin read from the device, then swizzled
27 * as it goes through each bridge.
28 * @return Interrupt number for the device
29 */
30int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
31{
32 if (octeon_pcibios_map_irq)
33 return octeon_pcibios_map_irq(dev, slot, pin);
34 else
35 panic("octeon_pcibios_map_irq doesn't point to a "
36 "pcibios_map_irq() function");
37}
38
39
40/**
41 * Called to perform platform specific PCI setup
42 *
43 * @param dev
44 * @return
45 */
46int pcibios_plat_dev_init(struct pci_dev *dev)
47{
48 uint16_t config;
49 uint32_t dconfig;
50 int pos;
51 /*
52 * Force the Cache line setting to 64 bytes. The standard
53 * Linux bus scan doesn't seem to set it. Octeon really has
54 * 128 byte lines, but Intel bridges get really upset if you
55 * try and set values above 64 bytes. Value is specified in
56 * 32bit words.
57 */
58 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 64 / 4);
59 /* Set latency timers for all devices */
60 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 48);
61
62 /* Enable reporting System errors and parity errors on all devices */
63 /* Enable parity checking and error reporting */
64 pci_read_config_word(dev, PCI_COMMAND, &config);
65 config |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
66 pci_write_config_word(dev, PCI_COMMAND, config);
67
68 if (dev->subordinate) {
69 /* Set latency timers on sub bridges */
70 pci_write_config_byte(dev, PCI_SEC_LATENCY_TIMER, 48);
71 /* More bridge error detection */
72 pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &config);
73 config |= PCI_BRIDGE_CTL_PARITY | PCI_BRIDGE_CTL_SERR;
74 pci_write_config_word(dev, PCI_BRIDGE_CONTROL, config);
75 }
76
77 /* Enable the PCIe normal error reporting */
78 pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
79 if (pos) {
80 /* Update Device Control */
81 pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &config);
82 /* Correctable Error Reporting */
83 config |= PCI_EXP_DEVCTL_CERE;
84 /* Non-Fatal Error Reporting */
85 config |= PCI_EXP_DEVCTL_NFERE;
86 /* Fatal Error Reporting */
87 config |= PCI_EXP_DEVCTL_FERE;
88 /* Unsupported Request */
89 config |= PCI_EXP_DEVCTL_URRE;
90 pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, config);
91 }
92
93 /* Find the Advanced Error Reporting capability */
94 pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
95 if (pos) {
96 /* Clear Uncorrectable Error Status */
97 pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS,
98 &dconfig);
99 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS,
100 dconfig);
101 /* Enable reporting of all uncorrectable errors */
102 /* Uncorrectable Error Mask - turned on bits disable errors */
103 pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, 0);
104 /*
105 * Leave severity at HW default. This only controls if
106 * errors are reported as uncorrectable or
107 * correctable, not if the error is reported.
108 */
109 /* PCI_ERR_UNCOR_SEVER - Uncorrectable Error Severity */
110 /* Clear Correctable Error Status */
111 pci_read_config_dword(dev, pos + PCI_ERR_COR_STATUS, &dconfig);
112 pci_write_config_dword(dev, pos + PCI_ERR_COR_STATUS, dconfig);
113 /* Enable reporting of all correctable errors */
114 /* Correctable Error Mask - turned on bits disable errors */
115 pci_write_config_dword(dev, pos + PCI_ERR_COR_MASK, 0);
116 /* Advanced Error Capabilities */
117 pci_read_config_dword(dev, pos + PCI_ERR_CAP, &dconfig);
118 /* ECRC Generation Enable */
119 if (config & PCI_ERR_CAP_ECRC_GENC)
120 config |= PCI_ERR_CAP_ECRC_GENE;
121 /* ECRC Check Enable */
122 if (config & PCI_ERR_CAP_ECRC_CHKC)
123 config |= PCI_ERR_CAP_ECRC_CHKE;
124 pci_write_config_dword(dev, pos + PCI_ERR_CAP, dconfig);
125 /* PCI_ERR_HEADER_LOG - Header Log Register (16 bytes) */
126 /* Report all errors to the root complex */
127 pci_write_config_dword(dev, pos + PCI_ERR_ROOT_COMMAND,
128 PCI_ERR_ROOT_CMD_COR_EN |
129 PCI_ERR_ROOT_CMD_NONFATAL_EN |
130 PCI_ERR_ROOT_CMD_FATAL_EN);
131 /* Clear the Root status register */
132 pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &dconfig);
133 pci_write_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, dconfig);
134 }
135
136 return 0;
137}
diff --git a/arch/mips/cavium-octeon/pci-common.h b/arch/mips/cavium-octeon/pci-common.h
new file mode 100644
index 000000000000..74ae79991e45
--- /dev/null
+++ b/arch/mips/cavium-octeon/pci-common.h
@@ -0,0 +1,39 @@
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 * Copyright (C) 2005-2007 Cavium Networks
7 */
8#ifndef __OCTEON_PCI_COMMON_H__
9#define __OCTEON_PCI_COMMON_H__
10
11#include <linux/pci.h>
12
13/* Some PCI cards require delays when accessing config space. */
14#define PCI_CONFIG_SPACE_DELAY 10000
15
16/* pcibios_map_irq() is defined inside pci-common.c. All it does is call the
17 Octeon specific version pointed to by this variable. This function needs to
18 change for PCI or PCIe based hosts */
19extern typeof(pcibios_map_irq) *octeon_pcibios_map_irq;
20
21/* The following defines are only used when octeon_dma_bar_type =
22 OCTEON_DMA_BAR_TYPE_BIG */
23#define OCTEON_PCI_BAR1_HOLE_BITS 5
24#define OCTEON_PCI_BAR1_HOLE_SIZE (1ul<<(OCTEON_PCI_BAR1_HOLE_BITS+3))
25
26enum octeon_dma_bar_type {
27 OCTEON_DMA_BAR_TYPE_INVALID,
28 OCTEON_DMA_BAR_TYPE_SMALL,
29 OCTEON_DMA_BAR_TYPE_BIG,
30 OCTEON_DMA_BAR_TYPE_PCIE
31};
32
33/**
34 * This is a variable to tell the DMA mapping system in dma-octeon.c
35 * how to map PCI DMA addresses.
36 */
37extern enum octeon_dma_bar_type octeon_dma_bar_type;
38
39#endif
diff --git a/arch/mips/cavium-octeon/pci.c b/arch/mips/cavium-octeon/pci.c
new file mode 100644
index 000000000000..67c0ff5e92f1
--- /dev/null
+++ b/arch/mips/cavium-octeon/pci.c
@@ -0,0 +1,568 @@
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 * Copyright (C) 2005-2007 Cavium Networks
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/pci.h>
11#include <linux/interrupt.h>
12#include <linux/time.h>
13#include <linux/delay.h>
14
15#include <asm/time.h>
16
17#include <asm/octeon/octeon.h>
18#include <asm/octeon/cvmx-npi-defs.h>
19#include <asm/octeon/cvmx-pci-defs.h>
20
21#include "pci-common.h"
22
23#define USE_OCTEON_INTERNAL_ARBITER
24
25/*
26 * Octeon's PCI controller uses did=3, subdid=2 for PCI IO
27 * addresses. Use PCI endian swapping 1 so no address swapping is
28 * necessary. The Linux io routines will endian swap the data.
29 */
30#define OCTEON_PCI_IOSPACE_BASE 0x80011a0400000000ull
31#define OCTEON_PCI_IOSPACE_SIZE (1ull<<32)
32
33/* Octeon't PCI controller uses did=3, subdid=3 for PCI memory. */
34#define OCTEON_PCI_MEMSPACE_OFFSET (0x00011b0000000000ull)
35
36/**
37 * This is the bit decoding used for the Octeon PCI controller addresses
38 */
39union octeon_pci_address {
40 uint64_t u64;
41 struct {
42 uint64_t upper:2;
43 uint64_t reserved:13;
44 uint64_t io:1;
45 uint64_t did:5;
46 uint64_t subdid:3;
47 uint64_t reserved2:4;
48 uint64_t endian_swap:2;
49 uint64_t reserved3:10;
50 uint64_t bus:8;
51 uint64_t dev:5;
52 uint64_t func:3;
53 uint64_t reg:8;
54 } s;
55};
56
57/**
58 * Return the mapping of PCI device number to IRQ line. Each
59 * character in the return string represents the interrupt
60 * line for the device at that position. Device 1 maps to the
61 * first character, etc. The characters A-D are used for PCI
62 * interrupts.
63 *
64 * Returns PCI interrupt mapping
65 */
66const char *octeon_get_pci_interrupts(void)
67{
68 /*
69 * Returning an empty string causes the interrupts to be
70 * routed based on the PCI specification. From the PCI spec:
71 *
72 * INTA# of Device Number 0 is connected to IRQW on the system
73 * board. (Device Number has no significance regarding being
74 * located on the system board or in a connector.) INTA# of
75 * Device Number 1 is connected to IRQX on the system
76 * board. INTA# of Device Number 2 is connected to IRQY on the
77 * system board. INTA# of Device Number 3 is connected to IRQZ
78 * on the system board. The table below describes how each
79 * agent's INTx# lines are connected to the system board
80 * interrupt lines. The following equation can be used to
81 * determine to which INTx# signal on the system board a given
82 * device's INTx# line(s) is connected.
83 *
84 * MB = (D + I) MOD 4 MB = System board Interrupt (IRQW = 0,
85 * IRQX = 1, IRQY = 2, and IRQZ = 3) D = Device Number I =
86 * Interrupt Number (INTA# = 0, INTB# = 1, INTC# = 2, and
87 * INTD# = 3)
88 */
89 switch (octeon_bootinfo->board_type) {
90 case CVMX_BOARD_TYPE_NAO38:
91 /* This is really the NAC38 */
92 return "AAAAADABAAAAAAAAAAAAAAAAAAAAAAAA";
93 case CVMX_BOARD_TYPE_THUNDER:
94 return "";
95 case CVMX_BOARD_TYPE_EBH3000:
96 return "";
97 case CVMX_BOARD_TYPE_EBH3100:
98 case CVMX_BOARD_TYPE_CN3010_EVB_HS5:
99 case CVMX_BOARD_TYPE_CN3005_EVB_HS5:
100 return "AAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
101 case CVMX_BOARD_TYPE_BBGW_REF:
102 return "AABCD";
103 default:
104 return "";
105 }
106}
107
108/**
109 * Map a PCI device to the appropriate interrupt line
110 *
111 * @dev: The Linux PCI device structure for the device to map
112 * @slot: The slot number for this device on __BUS 0__. Linux
113 * enumerates through all the bridges and figures out the
114 * slot on Bus 0 where this device eventually hooks to.
115 * @pin: The PCI interrupt pin read from the device, then swizzled
116 * as it goes through each bridge.
117 * Returns Interrupt number for the device
118 */
119int __init octeon_pci_pcibios_map_irq(const struct pci_dev *dev,
120 u8 slot, u8 pin)
121{
122 int irq_num;
123 const char *interrupts;
124 int dev_num;
125
126 /* Get the board specific interrupt mapping */
127 interrupts = octeon_get_pci_interrupts();
128
129 dev_num = dev->devfn >> 3;
130 if (dev_num < strlen(interrupts))
131 irq_num = ((interrupts[dev_num] - 'A' + pin - 1) & 3) +
132 OCTEON_IRQ_PCI_INT0;
133 else
134 irq_num = ((slot + pin - 3) & 3) + OCTEON_IRQ_PCI_INT0;
135 return irq_num;
136}
137
138
139/**
140 * Read a value from configuration space
141 *
142 */
143static int octeon_read_config(struct pci_bus *bus, unsigned int devfn,
144 int reg, int size, u32 *val)
145{
146 union octeon_pci_address pci_addr;
147
148 pci_addr.u64 = 0;
149 pci_addr.s.upper = 2;
150 pci_addr.s.io = 1;
151 pci_addr.s.did = 3;
152 pci_addr.s.subdid = 1;
153 pci_addr.s.endian_swap = 1;
154 pci_addr.s.bus = bus->number;
155 pci_addr.s.dev = devfn >> 3;
156 pci_addr.s.func = devfn & 0x7;
157 pci_addr.s.reg = reg;
158
159#if PCI_CONFIG_SPACE_DELAY
160 udelay(PCI_CONFIG_SPACE_DELAY);
161#endif
162 switch (size) {
163 case 4:
164 *val = le32_to_cpu(cvmx_read64_uint32(pci_addr.u64));
165 return PCIBIOS_SUCCESSFUL;
166 case 2:
167 *val = le16_to_cpu(cvmx_read64_uint16(pci_addr.u64));
168 return PCIBIOS_SUCCESSFUL;
169 case 1:
170 *val = cvmx_read64_uint8(pci_addr.u64);
171 return PCIBIOS_SUCCESSFUL;
172 }
173 return PCIBIOS_FUNC_NOT_SUPPORTED;
174}
175
176
177/**
178 * Write a value to PCI configuration space
179 *
180 * @bus:
181 * @devfn:
182 * @reg:
183 * @size:
184 * @val:
185 * Returns
186 */
187static int octeon_write_config(struct pci_bus *bus, unsigned int devfn,
188 int reg, int size, u32 val)
189{
190 union octeon_pci_address pci_addr;
191
192 pci_addr.u64 = 0;
193 pci_addr.s.upper = 2;
194 pci_addr.s.io = 1;
195 pci_addr.s.did = 3;
196 pci_addr.s.subdid = 1;
197 pci_addr.s.endian_swap = 1;
198 pci_addr.s.bus = bus->number;
199 pci_addr.s.dev = devfn >> 3;
200 pci_addr.s.func = devfn & 0x7;
201 pci_addr.s.reg = reg;
202
203#if PCI_CONFIG_SPACE_DELAY
204 udelay(PCI_CONFIG_SPACE_DELAY);
205#endif
206 switch (size) {
207 case 4:
208 cvmx_write64_uint32(pci_addr.u64, cpu_to_le32(val));
209 return PCIBIOS_SUCCESSFUL;
210 case 2:
211 cvmx_write64_uint16(pci_addr.u64, cpu_to_le16(val));
212 return PCIBIOS_SUCCESSFUL;
213 case 1:
214 cvmx_write64_uint8(pci_addr.u64, val);
215 return PCIBIOS_SUCCESSFUL;
216 }
217 return PCIBIOS_FUNC_NOT_SUPPORTED;
218}
219
220
221static struct pci_ops octeon_pci_ops = {
222 octeon_read_config,
223 octeon_write_config,
224};
225
226static struct resource octeon_pci_mem_resource = {
227 .start = 0,
228 .end = 0,
229 .name = "Octeon PCI MEM",
230 .flags = IORESOURCE_MEM,
231};
232
233/*
234 * PCI ports must be above 16KB so the ISA bus filtering in the PCI-X to PCI
235 * bridge
236 */
237static struct resource octeon_pci_io_resource = {
238 .start = 0x4000,
239 .end = OCTEON_PCI_IOSPACE_SIZE - 1,
240 .name = "Octeon PCI IO",
241 .flags = IORESOURCE_IO,
242};
243
244static struct pci_controller octeon_pci_controller = {
245 .pci_ops = &octeon_pci_ops,
246 .mem_resource = &octeon_pci_mem_resource,
247 .mem_offset = OCTEON_PCI_MEMSPACE_OFFSET,
248 .io_resource = &octeon_pci_io_resource,
249 .io_offset = 0,
250 .io_map_base = OCTEON_PCI_IOSPACE_BASE,
251};
252
253
254/**
255 * Low level initialize the Octeon PCI controller
256 *
257 * Returns
258 */
259static void octeon_pci_initialize(void)
260{
261 union cvmx_pci_cfg01 cfg01;
262 union cvmx_npi_ctl_status ctl_status;
263 union cvmx_pci_ctl_status_2 ctl_status_2;
264 union cvmx_pci_cfg19 cfg19;
265 union cvmx_pci_cfg16 cfg16;
266 union cvmx_pci_cfg22 cfg22;
267 union cvmx_pci_cfg56 cfg56;
268
269 /* Reset the PCI Bus */
270 cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x1);
271 cvmx_read_csr(CVMX_CIU_SOFT_PRST);
272
273 udelay(2000); /* Hold PCI reset for 2 ms */
274
275 ctl_status.u64 = 0; /* cvmx_read_csr(CVMX_NPI_CTL_STATUS); */
276 ctl_status.s.max_word = 1;
277 ctl_status.s.timer = 1;
278 cvmx_write_csr(CVMX_NPI_CTL_STATUS, ctl_status.u64);
279
280 /* Deassert PCI reset and advertize PCX Host Mode Device Capability
281 (64b) */
282 cvmx_write_csr(CVMX_CIU_SOFT_PRST, 0x4);
283 cvmx_read_csr(CVMX_CIU_SOFT_PRST);
284
285 udelay(2000); /* Wait 2 ms after deasserting PCI reset */
286
287 ctl_status_2.u32 = 0;
288 ctl_status_2.s.tsr_hwm = 1; /* Initializes to 0. Must be set
289 before any PCI reads. */
290 ctl_status_2.s.bar2pres = 1; /* Enable BAR2 */
291 ctl_status_2.s.bar2_enb = 1;
292 ctl_status_2.s.bar2_cax = 1; /* Don't use L2 */
293 ctl_status_2.s.bar2_esx = 1;
294 ctl_status_2.s.pmo_amod = 1; /* Round robin priority */
295 if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_BIG) {
296 /* BAR1 hole */
297 ctl_status_2.s.bb1_hole = OCTEON_PCI_BAR1_HOLE_BITS;
298 ctl_status_2.s.bb1_siz = 1; /* BAR1 is 2GB */
299 ctl_status_2.s.bb_ca = 1; /* Don't use L2 with big bars */
300 ctl_status_2.s.bb_es = 1; /* Big bar in byte swap mode */
301 ctl_status_2.s.bb1 = 1; /* BAR1 is big */
302 ctl_status_2.s.bb0 = 1; /* BAR0 is big */
303 }
304
305 octeon_npi_write32(CVMX_NPI_PCI_CTL_STATUS_2, ctl_status_2.u32);
306 udelay(2000); /* Wait 2 ms before doing PCI reads */
307
308 ctl_status_2.u32 = octeon_npi_read32(CVMX_NPI_PCI_CTL_STATUS_2);
309 pr_notice("PCI Status: %s %s-bit\n",
310 ctl_status_2.s.ap_pcix ? "PCI-X" : "PCI",
311 ctl_status_2.s.ap_64ad ? "64" : "32");
312
313 if (OCTEON_IS_MODEL(OCTEON_CN58XX) || OCTEON_IS_MODEL(OCTEON_CN50XX)) {
314 union cvmx_pci_cnt_reg cnt_reg_start;
315 union cvmx_pci_cnt_reg cnt_reg_end;
316 unsigned long cycles, pci_clock;
317
318 cnt_reg_start.u64 = cvmx_read_csr(CVMX_NPI_PCI_CNT_REG);
319 cycles = read_c0_cvmcount();
320 udelay(1000);
321 cnt_reg_end.u64 = cvmx_read_csr(CVMX_NPI_PCI_CNT_REG);
322 cycles = read_c0_cvmcount() - cycles;
323 pci_clock = (cnt_reg_end.s.pcicnt - cnt_reg_start.s.pcicnt) /
324 (cycles / (mips_hpt_frequency / 1000000));
325 pr_notice("PCI Clock: %lu MHz\n", pci_clock);
326 }
327
328 /*
329 * TDOMC must be set to one in PCI mode. TDOMC should be set to 4
330 * in PCI-X mode to allow four oustanding splits. Otherwise,
331 * should not change from its reset value. Don't write PCI_CFG19
332 * in PCI mode (0x82000001 reset value), write it to 0x82000004
333 * after PCI-X mode is known. MRBCI,MDWE,MDRE -> must be zero.
334 * MRBCM -> must be one.
335 */
336 if (ctl_status_2.s.ap_pcix) {
337 cfg19.u32 = 0;
338 /*
339 * Target Delayed/Split request outstanding maximum
340 * count. [1..31] and 0=32. NOTE: If the user
341 * programs these bits beyond the Designed Maximum
342 * outstanding count, then the designed maximum table
343 * depth will be used instead. No additional
344 * Deferred/Split transactions will be accepted if
345 * this outstanding maximum count is
346 * reached. Furthermore, no additional deferred/split
347 * transactions will be accepted if the I/O delay/ I/O
348 * Split Request outstanding maximum is reached.
349 */
350 cfg19.s.tdomc = 4;
351 /*
352 * Master Deferred Read Request Outstanding Max Count
353 * (PCI only). CR4C[26:24] Max SAC cycles MAX DAC
354 * cycles 000 8 4 001 1 0 010 2 1 011 3 1 100 4 2 101
355 * 5 2 110 6 3 111 7 3 For example, if these bits are
356 * programmed to 100, the core can support 2 DAC
357 * cycles, 4 SAC cycles or a combination of 1 DAC and
358 * 2 SAC cycles. NOTE: For the PCI-X maximum
359 * outstanding split transactions, refer to
360 * CRE0[22:20].
361 */
362 cfg19.s.mdrrmc = 2;
363 /*
364 * Master Request (Memory Read) Byte Count/Byte Enable
365 * select. 0 = Byte Enables valid. In PCI mode, a
366 * burst transaction cannot be performed using Memory
367 * Read command=4?h6. 1 = DWORD Byte Count valid
368 * (default). In PCI Mode, the memory read byte
369 * enables are automatically generated by the
370 * core. Note: N3 Master Request transaction sizes are
371 * always determined through the
372 * am_attr[<35:32>|<7:0>] field.
373 */
374 cfg19.s.mrbcm = 1;
375 octeon_npi_write32(CVMX_NPI_PCI_CFG19, cfg19.u32);
376 }
377
378
379 cfg01.u32 = 0;
380 cfg01.s.msae = 1; /* Memory Space Access Enable */
381 cfg01.s.me = 1; /* Master Enable */
382 cfg01.s.pee = 1; /* PERR# Enable */
383 cfg01.s.see = 1; /* System Error Enable */
384 cfg01.s.fbbe = 1; /* Fast Back to Back Transaction Enable */
385
386 octeon_npi_write32(CVMX_NPI_PCI_CFG01, cfg01.u32);
387
388#ifdef USE_OCTEON_INTERNAL_ARBITER
389 /*
390 * When OCTEON is a PCI host, most systems will use OCTEON's
391 * internal arbiter, so must enable it before any PCI/PCI-X
392 * traffic can occur.
393 */
394 {
395 union cvmx_npi_pci_int_arb_cfg pci_int_arb_cfg;
396
397 pci_int_arb_cfg.u64 = 0;
398 pci_int_arb_cfg.s.en = 1; /* Internal arbiter enable */
399 cvmx_write_csr(CVMX_NPI_PCI_INT_ARB_CFG, pci_int_arb_cfg.u64);
400 }
401#endif /* USE_OCTEON_INTERNAL_ARBITER */
402
403 /*
404 * Preferrably written to 1 to set MLTD. [RDSATI,TRTAE,
405 * TWTAE,TMAE,DPPMR -> must be zero. TILT -> must not be set to
406 * 1..7.
407 */
408 cfg16.u32 = 0;
409 cfg16.s.mltd = 1; /* Master Latency Timer Disable */
410 octeon_npi_write32(CVMX_NPI_PCI_CFG16, cfg16.u32);
411
412 /*
413 * Should be written to 0x4ff00. MTTV -> must be zero.
414 * FLUSH -> must be 1. MRV -> should be 0xFF.
415 */
416 cfg22.u32 = 0;
417 /* Master Retry Value [1..255] and 0=infinite */
418 cfg22.s.mrv = 0xff;
419 /*
420 * AM_DO_FLUSH_I control NOTE: This bit MUST BE ONE for proper
421 * N3K operation.
422 */
423 cfg22.s.flush = 1;
424 octeon_npi_write32(CVMX_NPI_PCI_CFG22, cfg22.u32);
425
426 /*
427 * MOST Indicates the maximum number of outstanding splits (in -1
428 * notation) when OCTEON is in PCI-X mode. PCI-X performance is
429 * affected by the MOST selection. Should generally be written
430 * with one of 0x3be807, 0x2be807, 0x1be807, or 0x0be807,
431 * depending on the desired MOST of 3, 2, 1, or 0, respectively.
432 */
433 cfg56.u32 = 0;
434 cfg56.s.pxcid = 7; /* RO - PCI-X Capability ID */
435 cfg56.s.ncp = 0xe8; /* RO - Next Capability Pointer */
436 cfg56.s.dpere = 1; /* Data Parity Error Recovery Enable */
437 cfg56.s.roe = 1; /* Relaxed Ordering Enable */
438 cfg56.s.mmbc = 1; /* Maximum Memory Byte Count
439 [0=512B,1=1024B,2=2048B,3=4096B] */
440 cfg56.s.most = 3; /* Maximum outstanding Split transactions [0=1
441 .. 7=32] */
442
443 octeon_npi_write32(CVMX_NPI_PCI_CFG56, cfg56.u32);
444
445 /*
446 * Affects PCI performance when OCTEON services reads to its
447 * BAR1/BAR2. Refer to Section 10.6.1. The recommended values are
448 * 0x22, 0x33, and 0x33 for PCI_READ_CMD_6, PCI_READ_CMD_C, and
449 * PCI_READ_CMD_E, respectively. Unfortunately due to errata DDR-700,
450 * these values need to be changed so they won't possibly prefetch off
451 * of the end of memory if PCI is DMAing a buffer at the end of
452 * memory. Note that these values differ from their reset values.
453 */
454 octeon_npi_write32(CVMX_NPI_PCI_READ_CMD_6, 0x21);
455 octeon_npi_write32(CVMX_NPI_PCI_READ_CMD_C, 0x31);
456 octeon_npi_write32(CVMX_NPI_PCI_READ_CMD_E, 0x31);
457}
458
459
460/**
461 * Initialize the Octeon PCI controller
462 *
463 * Returns
464 */
465static int __init octeon_pci_setup(void)
466{
467 union cvmx_npi_mem_access_subidx mem_access;
468 int index;
469
470 /* Only these chips have PCI */
471 if (octeon_has_feature(OCTEON_FEATURE_PCIE))
472 return 0;
473
474 /* Point pcibios_map_irq() to the PCI version of it */
475 octeon_pcibios_map_irq = octeon_pci_pcibios_map_irq;
476
477 /* Only use the big bars on chips that support it */
478 if (OCTEON_IS_MODEL(OCTEON_CN31XX) ||
479 OCTEON_IS_MODEL(OCTEON_CN38XX_PASS2) ||
480 OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1))
481 octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_SMALL;
482 else
483 octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_BIG;
484
485 /* PCI I/O and PCI MEM values */
486 set_io_port_base(OCTEON_PCI_IOSPACE_BASE);
487 ioport_resource.start = 0;
488 ioport_resource.end = OCTEON_PCI_IOSPACE_SIZE - 1;
489 if (!octeon_is_pci_host()) {
490 pr_notice("Not in host mode, PCI Controller not initialized\n");
491 return 0;
492 }
493
494 pr_notice("%s Octeon big bar support\n",
495 (octeon_dma_bar_type ==
496 OCTEON_DMA_BAR_TYPE_BIG) ? "Enabling" : "Disabling");
497
498 octeon_pci_initialize();
499
500 mem_access.u64 = 0;
501 mem_access.s.esr = 1; /* Endian-Swap on read. */
502 mem_access.s.esw = 1; /* Endian-Swap on write. */
503 mem_access.s.nsr = 0; /* No-Snoop on read. */
504 mem_access.s.nsw = 0; /* No-Snoop on write. */
505 mem_access.s.ror = 0; /* Relax Read on read. */
506 mem_access.s.row = 0; /* Relax Order on write. */
507 mem_access.s.ba = 0; /* PCI Address bits [63:36]. */
508 cvmx_write_csr(CVMX_NPI_MEM_ACCESS_SUBID3, mem_access.u64);
509
510 /*
511 * Remap the Octeon BAR 2 above all 32 bit devices
512 * (0x8000000000ul). This is done here so it is remapped
513 * before the readl()'s below. We don't want BAR2 overlapping
514 * with BAR0/BAR1 during these reads.
515 */
516 octeon_npi_write32(CVMX_NPI_PCI_CFG08, 0);
517 octeon_npi_write32(CVMX_NPI_PCI_CFG09, 0x80);
518
519 /* Disable the BAR1 movable mappings */
520 for (index = 0; index < 32; index++)
521 octeon_npi_write32(CVMX_NPI_PCI_BAR1_INDEXX(index), 0);
522
523 if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_BIG) {
524 /* Remap the Octeon BAR 0 to 0-2GB */
525 octeon_npi_write32(CVMX_NPI_PCI_CFG04, 0);
526 octeon_npi_write32(CVMX_NPI_PCI_CFG05, 0);
527
528 /*
529 * Remap the Octeon BAR 1 to map 2GB-4GB (minus the
530 * BAR 1 hole).
531 */
532 octeon_npi_write32(CVMX_NPI_PCI_CFG06, 2ul << 30);
533 octeon_npi_write32(CVMX_NPI_PCI_CFG07, 0);
534
535 /* Devices go after BAR1 */
536 octeon_pci_mem_resource.start =
537 OCTEON_PCI_MEMSPACE_OFFSET + (4ul << 30) -
538 (OCTEON_PCI_BAR1_HOLE_SIZE << 20);
539 octeon_pci_mem_resource.end =
540 octeon_pci_mem_resource.start + (1ul << 30);
541 } else {
542 /* Remap the Octeon BAR 0 to map 128MB-(128MB+4KB) */
543 octeon_npi_write32(CVMX_NPI_PCI_CFG04, 128ul << 20);
544 octeon_npi_write32(CVMX_NPI_PCI_CFG05, 0);
545
546 /* Remap the Octeon BAR 1 to map 0-128MB */
547 octeon_npi_write32(CVMX_NPI_PCI_CFG06, 0);
548 octeon_npi_write32(CVMX_NPI_PCI_CFG07, 0);
549
550 /* Devices go after BAR0 */
551 octeon_pci_mem_resource.start =
552 OCTEON_PCI_MEMSPACE_OFFSET + (128ul << 20) +
553 (4ul << 10);
554 octeon_pci_mem_resource.end =
555 octeon_pci_mem_resource.start + (1ul << 30);
556 }
557
558 register_pci_controller(&octeon_pci_controller);
559
560 /*
561 * Clear any errors that might be pending from before the bus
562 * was setup properly.
563 */
564 cvmx_write_csr(CVMX_NPI_PCI_INT_SUM2, -1);
565 return 0;
566}
567
568arch_initcall(octeon_pci_setup);
diff --git a/arch/mips/cavium-octeon/pcie.c b/arch/mips/cavium-octeon/pcie.c
new file mode 100644
index 000000000000..49d14081b3b5
--- /dev/null
+++ b/arch/mips/cavium-octeon/pcie.c
@@ -0,0 +1,1370 @@
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 * Copyright (C) 2007, 2008 Cavium Networks
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/pci.h>
11#include <linux/interrupt.h>
12#include <linux/time.h>
13#include <linux/delay.h>
14
15#include <asm/octeon/octeon.h>
16#include <asm/octeon/cvmx-npei-defs.h>
17#include <asm/octeon/cvmx-pciercx-defs.h>
18#include <asm/octeon/cvmx-pescx-defs.h>
19#include <asm/octeon/cvmx-pexp-defs.h>
20#include <asm/octeon/cvmx-helper-errata.h>
21
22#include "pci-common.h"
23
24union cvmx_pcie_address {
25 uint64_t u64;
26 struct {
27 uint64_t upper:2; /* Normally 2 for XKPHYS */
28 uint64_t reserved_49_61:13; /* Must be zero */
29 uint64_t io:1; /* 1 for IO space access */
30 uint64_t did:5; /* PCIe DID = 3 */
31 uint64_t subdid:3; /* PCIe SubDID = 1 */
32 uint64_t reserved_36_39:4; /* Must be zero */
33 uint64_t es:2; /* Endian swap = 1 */
34 uint64_t port:2; /* PCIe port 0,1 */
35 uint64_t reserved_29_31:3; /* Must be zero */
36 /*
37 * Selects the type of the configuration request (0 = type 0,
38 * 1 = type 1).
39 */
40 uint64_t ty:1;
41 /* Target bus number sent in the ID in the request. */
42 uint64_t bus:8;
43 /*
44 * Target device number sent in the ID in the
45 * request. Note that Dev must be zero for type 0
46 * configuration requests.
47 */
48 uint64_t dev:5;
49 /* Target function number sent in the ID in the request. */
50 uint64_t func:3;
51 /*
52 * Selects a register in the configuration space of
53 * the target.
54 */
55 uint64_t reg:12;
56 } config;
57 struct {
58 uint64_t upper:2; /* Normally 2 for XKPHYS */
59 uint64_t reserved_49_61:13; /* Must be zero */
60 uint64_t io:1; /* 1 for IO space access */
61 uint64_t did:5; /* PCIe DID = 3 */
62 uint64_t subdid:3; /* PCIe SubDID = 2 */
63 uint64_t reserved_36_39:4; /* Must be zero */
64 uint64_t es:2; /* Endian swap = 1 */
65 uint64_t port:2; /* PCIe port 0,1 */
66 uint64_t address:32; /* PCIe IO address */
67 } io;
68 struct {
69 uint64_t upper:2; /* Normally 2 for XKPHYS */
70 uint64_t reserved_49_61:13; /* Must be zero */
71 uint64_t io:1; /* 1 for IO space access */
72 uint64_t did:5; /* PCIe DID = 3 */
73 uint64_t subdid:3; /* PCIe SubDID = 3-6 */
74 uint64_t reserved_36_39:4; /* Must be zero */
75 uint64_t address:36; /* PCIe Mem address */
76 } mem;
77};
78
79/**
80 * Return the Core virtual base address for PCIe IO access. IOs are
81 * read/written as an offset from this address.
82 *
83 * @pcie_port: PCIe port the IO is for
84 *
85 * Returns 64bit Octeon IO base address for read/write
86 */
87static inline uint64_t cvmx_pcie_get_io_base_address(int pcie_port)
88{
89 union cvmx_pcie_address pcie_addr;
90 pcie_addr.u64 = 0;
91 pcie_addr.io.upper = 0;
92 pcie_addr.io.io = 1;
93 pcie_addr.io.did = 3;
94 pcie_addr.io.subdid = 2;
95 pcie_addr.io.es = 1;
96 pcie_addr.io.port = pcie_port;
97 return pcie_addr.u64;
98}
99
100/**
101 * Size of the IO address region returned at address
102 * cvmx_pcie_get_io_base_address()
103 *
104 * @pcie_port: PCIe port the IO is for
105 *
106 * Returns Size of the IO window
107 */
108static inline uint64_t cvmx_pcie_get_io_size(int pcie_port)
109{
110 return 1ull << 32;
111}
112
113/**
114 * Return the Core virtual base address for PCIe MEM access. Memory is
115 * read/written as an offset from this address.
116 *
117 * @pcie_port: PCIe port the IO is for
118 *
119 * Returns 64bit Octeon IO base address for read/write
120 */
121static inline uint64_t cvmx_pcie_get_mem_base_address(int pcie_port)
122{
123 union cvmx_pcie_address pcie_addr;
124 pcie_addr.u64 = 0;
125 pcie_addr.mem.upper = 0;
126 pcie_addr.mem.io = 1;
127 pcie_addr.mem.did = 3;
128 pcie_addr.mem.subdid = 3 + pcie_port;
129 return pcie_addr.u64;
130}
131
132/**
133 * Size of the Mem address region returned at address
134 * cvmx_pcie_get_mem_base_address()
135 *
136 * @pcie_port: PCIe port the IO is for
137 *
138 * Returns Size of the Mem window
139 */
140static inline uint64_t cvmx_pcie_get_mem_size(int pcie_port)
141{
142 return 1ull << 36;
143}
144
145/**
146 * Read a PCIe config space register indirectly. This is used for
147 * registers of the form PCIEEP_CFG??? and PCIERC?_CFG???.
148 *
149 * @pcie_port: PCIe port to read from
150 * @cfg_offset: Address to read
151 *
152 * Returns Value read
153 */
154static uint32_t cvmx_pcie_cfgx_read(int pcie_port, uint32_t cfg_offset)
155{
156 union cvmx_pescx_cfg_rd pescx_cfg_rd;
157 pescx_cfg_rd.u64 = 0;
158 pescx_cfg_rd.s.addr = cfg_offset;
159 cvmx_write_csr(CVMX_PESCX_CFG_RD(pcie_port), pescx_cfg_rd.u64);
160 pescx_cfg_rd.u64 = cvmx_read_csr(CVMX_PESCX_CFG_RD(pcie_port));
161 return pescx_cfg_rd.s.data;
162}
163
164/**
165 * Write a PCIe config space register indirectly. This is used for
166 * registers of the form PCIEEP_CFG??? and PCIERC?_CFG???.
167 *
168 * @pcie_port: PCIe port to write to
169 * @cfg_offset: Address to write
170 * @val: Value to write
171 */
172static void cvmx_pcie_cfgx_write(int pcie_port, uint32_t cfg_offset,
173 uint32_t val)
174{
175 union cvmx_pescx_cfg_wr pescx_cfg_wr;
176 pescx_cfg_wr.u64 = 0;
177 pescx_cfg_wr.s.addr = cfg_offset;
178 pescx_cfg_wr.s.data = val;
179 cvmx_write_csr(CVMX_PESCX_CFG_WR(pcie_port), pescx_cfg_wr.u64);
180}
181
182/**
183 * Build a PCIe config space request address for a device
184 *
185 * @pcie_port: PCIe port to access
186 * @bus: Sub bus
187 * @dev: Device ID
188 * @fn: Device sub function
189 * @reg: Register to access
190 *
191 * Returns 64bit Octeon IO address
192 */
193static inline uint64_t __cvmx_pcie_build_config_addr(int pcie_port, int bus,
194 int dev, int fn, int reg)
195{
196 union cvmx_pcie_address pcie_addr;
197 union cvmx_pciercx_cfg006 pciercx_cfg006;
198
199 pciercx_cfg006.u32 =
200 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG006(pcie_port));
201 if ((bus <= pciercx_cfg006.s.pbnum) && (dev != 0))
202 return 0;
203
204 pcie_addr.u64 = 0;
205 pcie_addr.config.upper = 2;
206 pcie_addr.config.io = 1;
207 pcie_addr.config.did = 3;
208 pcie_addr.config.subdid = 1;
209 pcie_addr.config.es = 1;
210 pcie_addr.config.port = pcie_port;
211 pcie_addr.config.ty = (bus > pciercx_cfg006.s.pbnum);
212 pcie_addr.config.bus = bus;
213 pcie_addr.config.dev = dev;
214 pcie_addr.config.func = fn;
215 pcie_addr.config.reg = reg;
216 return pcie_addr.u64;
217}
218
219/**
220 * Read 8bits from a Device's config space
221 *
222 * @pcie_port: PCIe port the device is on
223 * @bus: Sub bus
224 * @dev: Device ID
225 * @fn: Device sub function
226 * @reg: Register to access
227 *
228 * Returns Result of the read
229 */
230static uint8_t cvmx_pcie_config_read8(int pcie_port, int bus, int dev,
231 int fn, int reg)
232{
233 uint64_t address =
234 __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg);
235 if (address)
236 return cvmx_read64_uint8(address);
237 else
238 return 0xff;
239}
240
241/**
242 * Read 16bits from a Device's config space
243 *
244 * @pcie_port: PCIe port the device is on
245 * @bus: Sub bus
246 * @dev: Device ID
247 * @fn: Device sub function
248 * @reg: Register to access
249 *
250 * Returns Result of the read
251 */
252static uint16_t cvmx_pcie_config_read16(int pcie_port, int bus, int dev,
253 int fn, int reg)
254{
255 uint64_t address =
256 __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg);
257 if (address)
258 return le16_to_cpu(cvmx_read64_uint16(address));
259 else
260 return 0xffff;
261}
262
263/**
264 * Read 32bits from a Device's config space
265 *
266 * @pcie_port: PCIe port the device is on
267 * @bus: Sub bus
268 * @dev: Device ID
269 * @fn: Device sub function
270 * @reg: Register to access
271 *
272 * Returns Result of the read
273 */
274static uint32_t cvmx_pcie_config_read32(int pcie_port, int bus, int dev,
275 int fn, int reg)
276{
277 uint64_t address =
278 __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg);
279 if (address)
280 return le32_to_cpu(cvmx_read64_uint32(address));
281 else
282 return 0xffffffff;
283}
284
285/**
286 * Write 8bits to a Device's config space
287 *
288 * @pcie_port: PCIe port the device is on
289 * @bus: Sub bus
290 * @dev: Device ID
291 * @fn: Device sub function
292 * @reg: Register to access
293 * @val: Value to write
294 */
295static void cvmx_pcie_config_write8(int pcie_port, int bus, int dev, int fn,
296 int reg, uint8_t val)
297{
298 uint64_t address =
299 __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg);
300 if (address)
301 cvmx_write64_uint8(address, val);
302}
303
304/**
305 * Write 16bits to a Device's config space
306 *
307 * @pcie_port: PCIe port the device is on
308 * @bus: Sub bus
309 * @dev: Device ID
310 * @fn: Device sub function
311 * @reg: Register to access
312 * @val: Value to write
313 */
314static void cvmx_pcie_config_write16(int pcie_port, int bus, int dev, int fn,
315 int reg, uint16_t val)
316{
317 uint64_t address =
318 __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg);
319 if (address)
320 cvmx_write64_uint16(address, cpu_to_le16(val));
321}
322
323/**
324 * Write 32bits to a Device's config space
325 *
326 * @pcie_port: PCIe port the device is on
327 * @bus: Sub bus
328 * @dev: Device ID
329 * @fn: Device sub function
330 * @reg: Register to access
331 * @val: Value to write
332 */
333static void cvmx_pcie_config_write32(int pcie_port, int bus, int dev, int fn,
334 int reg, uint32_t val)
335{
336 uint64_t address =
337 __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg);
338 if (address)
339 cvmx_write64_uint32(address, cpu_to_le32(val));
340}
341
342/**
343 * Initialize the RC config space CSRs
344 *
345 * @pcie_port: PCIe port to initialize
346 */
347static void __cvmx_pcie_rc_initialize_config_space(int pcie_port)
348{
349 union cvmx_pciercx_cfg030 pciercx_cfg030;
350 union cvmx_npei_ctl_status2 npei_ctl_status2;
351 union cvmx_pciercx_cfg070 pciercx_cfg070;
352 union cvmx_pciercx_cfg001 pciercx_cfg001;
353 union cvmx_pciercx_cfg032 pciercx_cfg032;
354 union cvmx_pciercx_cfg006 pciercx_cfg006;
355 union cvmx_pciercx_cfg008 pciercx_cfg008;
356 union cvmx_pciercx_cfg009 pciercx_cfg009;
357 union cvmx_pciercx_cfg010 pciercx_cfg010;
358 union cvmx_pciercx_cfg011 pciercx_cfg011;
359 union cvmx_pciercx_cfg035 pciercx_cfg035;
360 union cvmx_pciercx_cfg075 pciercx_cfg075;
361 union cvmx_pciercx_cfg034 pciercx_cfg034;
362
363 /* Max Payload Size (PCIE*_CFG030[MPS]) */
364 /* Max Read Request Size (PCIE*_CFG030[MRRS]) */
365 /* Relaxed-order, no-snoop enables (PCIE*_CFG030[RO_EN,NS_EN] */
366 /* Error Message Enables (PCIE*_CFG030[CE_EN,NFE_EN,FE_EN,UR_EN]) */
367 pciercx_cfg030.u32 =
368 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG030(pcie_port));
369 /*
370 * Max payload size = 128 bytes for best Octeon DMA
371 * performance.
372 */
373 pciercx_cfg030.s.mps = 0;
374 /*
375 * Max read request size = 128 bytes for best Octeon DMA
376 * performance.
377 */
378 pciercx_cfg030.s.mrrs = 0;
379 /* Enable relaxed ordering. */
380 pciercx_cfg030.s.ro_en = 1;
381 /* Enable no snoop. */
382 pciercx_cfg030.s.ns_en = 1;
383 /* Correctable error reporting enable. */
384 pciercx_cfg030.s.ce_en = 1;
385 /* Non-fatal error reporting enable. */
386 pciercx_cfg030.s.nfe_en = 1;
387 /* Fatal error reporting enable. */
388 pciercx_cfg030.s.fe_en = 1;
389 /* Unsupported request reporting enable. */
390 pciercx_cfg030.s.ur_en = 1;
391 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG030(pcie_port),
392 pciercx_cfg030.u32);
393
394 /*
395 * Max Payload Size (NPEI_CTL_STATUS2[MPS]) must match
396 * PCIE*_CFG030[MPS]
397 *
398 * Max Read Request Size (NPEI_CTL_STATUS2[MRRS]) must not
399 * exceed PCIE*_CFG030[MRRS].
400 */
401 npei_ctl_status2.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_STATUS2);
402 /* Max payload size = 128 bytes for best Octeon DMA performance */
403 npei_ctl_status2.s.mps = 0;
404 /* Max read request size = 128 bytes for best Octeon DMA performance */
405 npei_ctl_status2.s.mrrs = 0;
406 cvmx_write_csr(CVMX_PEXP_NPEI_CTL_STATUS2, npei_ctl_status2.u64);
407
408 /* ECRC Generation (PCIE*_CFG070[GE,CE]) */
409 pciercx_cfg070.u32 =
410 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG070(pcie_port));
411 pciercx_cfg070.s.ge = 1; /* ECRC generation enable. */
412 pciercx_cfg070.s.ce = 1; /* ECRC check enable. */
413 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG070(pcie_port),
414 pciercx_cfg070.u32);
415
416 /*
417 * Access Enables (PCIE*_CFG001[MSAE,ME]) ME and MSAE should
418 * always be set.
419 *
420 * Interrupt Disable (PCIE*_CFG001[I_DIS]) System Error
421 * Message Enable (PCIE*_CFG001[SEE])
422 */
423 pciercx_cfg001.u32 =
424 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG001(pcie_port));
425 pciercx_cfg001.s.msae = 1; /* Memory space enable. */
426 pciercx_cfg001.s.me = 1; /* Bus master enable. */
427 pciercx_cfg001.s.i_dis = 1; /* INTx assertion disable. */
428 pciercx_cfg001.s.see = 1; /* SERR# enable */
429 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG001(pcie_port),
430 pciercx_cfg001.u32);
431
432 /* Advanced Error Recovery Message Enables */
433 /* (PCIE*_CFG066,PCIE*_CFG067,PCIE*_CFG069) */
434 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG066(pcie_port), 0);
435 /* Use CVMX_PCIERCX_CFG067 hardware default */
436 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG069(pcie_port), 0);
437
438 /* Active State Power Management (PCIE*_CFG032[ASLPC]) */
439 pciercx_cfg032.u32 =
440 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port));
441 pciercx_cfg032.s.aslpc = 0; /* Active state Link PM control. */
442 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG032(pcie_port),
443 pciercx_cfg032.u32);
444
445 /* Entrance Latencies (PCIE*_CFG451[L0EL,L1EL]) */
446
447 /*
448 * Link Width Mode (PCIERCn_CFG452[LME]) - Set during
449 * cvmx_pcie_rc_initialize_link()
450 *
451 * Primary Bus Number (PCIERCn_CFG006[PBNUM])
452 *
453 * We set the primary bus number to 1 so IDT bridges are
454 * happy. They don't like zero.
455 */
456 pciercx_cfg006.u32 = 0;
457 pciercx_cfg006.s.pbnum = 1;
458 pciercx_cfg006.s.sbnum = 1;
459 pciercx_cfg006.s.subbnum = 1;
460 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG006(pcie_port),
461 pciercx_cfg006.u32);
462
463 /*
464 * Memory-mapped I/O BAR (PCIERCn_CFG008)
465 * Most applications should disable the memory-mapped I/O BAR by
466 * setting PCIERCn_CFG008[ML_ADDR] < PCIERCn_CFG008[MB_ADDR]
467 */
468 pciercx_cfg008.u32 = 0;
469 pciercx_cfg008.s.mb_addr = 0x100;
470 pciercx_cfg008.s.ml_addr = 0;
471 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG008(pcie_port),
472 pciercx_cfg008.u32);
473
474 /*
475 * Prefetchable BAR (PCIERCn_CFG009,PCIERCn_CFG010,PCIERCn_CFG011)
476 * Most applications should disable the prefetchable BAR by setting
477 * PCIERCn_CFG011[UMEM_LIMIT],PCIERCn_CFG009[LMEM_LIMIT] <
478 * PCIERCn_CFG010[UMEM_BASE],PCIERCn_CFG009[LMEM_BASE]
479 */
480 pciercx_cfg009.u32 =
481 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG009(pcie_port));
482 pciercx_cfg010.u32 =
483 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG010(pcie_port));
484 pciercx_cfg011.u32 =
485 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG011(pcie_port));
486 pciercx_cfg009.s.lmem_base = 0x100;
487 pciercx_cfg009.s.lmem_limit = 0;
488 pciercx_cfg010.s.umem_base = 0x100;
489 pciercx_cfg011.s.umem_limit = 0;
490 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG009(pcie_port),
491 pciercx_cfg009.u32);
492 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG010(pcie_port),
493 pciercx_cfg010.u32);
494 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG011(pcie_port),
495 pciercx_cfg011.u32);
496
497 /*
498 * System Error Interrupt Enables (PCIERCn_CFG035[SECEE,SEFEE,SENFEE])
499 * PME Interrupt Enables (PCIERCn_CFG035[PMEIE])
500 */
501 pciercx_cfg035.u32 =
502 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG035(pcie_port));
503 /* System error on correctable error enable. */
504 pciercx_cfg035.s.secee = 1;
505 /* System error on fatal error enable. */
506 pciercx_cfg035.s.sefee = 1;
507 /* System error on non-fatal error enable. */
508 pciercx_cfg035.s.senfee = 1;
509 /* PME interrupt enable. */
510 pciercx_cfg035.s.pmeie = 1;
511 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG035(pcie_port),
512 pciercx_cfg035.u32);
513
514 /*
515 * Advanced Error Recovery Interrupt Enables
516 * (PCIERCn_CFG075[CERE,NFERE,FERE])
517 */
518 pciercx_cfg075.u32 =
519 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG075(pcie_port));
520 /* Correctable error reporting enable. */
521 pciercx_cfg075.s.cere = 1;
522 /* Non-fatal error reporting enable. */
523 pciercx_cfg075.s.nfere = 1;
524 /* Fatal error reporting enable. */
525 pciercx_cfg075.s.fere = 1;
526 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG075(pcie_port),
527 pciercx_cfg075.u32);
528
529 /* HP Interrupt Enables (PCIERCn_CFG034[HPINT_EN],
530 * PCIERCn_CFG034[DLLS_EN,CCINT_EN])
531 */
532 pciercx_cfg034.u32 =
533 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG034(pcie_port));
534 /* Hot-plug interrupt enable. */
535 pciercx_cfg034.s.hpint_en = 1;
536 /* Data Link Layer state changed enable */
537 pciercx_cfg034.s.dlls_en = 1;
538 /* Command completed interrupt enable. */
539 pciercx_cfg034.s.ccint_en = 1;
540 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG034(pcie_port),
541 pciercx_cfg034.u32);
542}
543
544/**
545 * Initialize a host mode PCIe link. This function takes a PCIe
546 * port from reset to a link up state. Software can then begin
547 * configuring the rest of the link.
548 *
549 * @pcie_port: PCIe port to initialize
550 *
551 * Returns Zero on success
552 */
553static int __cvmx_pcie_rc_initialize_link(int pcie_port)
554{
555 uint64_t start_cycle;
556 union cvmx_pescx_ctl_status pescx_ctl_status;
557 union cvmx_pciercx_cfg452 pciercx_cfg452;
558 union cvmx_pciercx_cfg032 pciercx_cfg032;
559 union cvmx_pciercx_cfg448 pciercx_cfg448;
560
561 /* Set the lane width */
562 pciercx_cfg452.u32 =
563 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG452(pcie_port));
564 pescx_ctl_status.u64 = cvmx_read_csr(CVMX_PESCX_CTL_STATUS(pcie_port));
565 if (pescx_ctl_status.s.qlm_cfg == 0) {
566 /* We're in 8 lane (56XX) or 4 lane (54XX) mode */
567 pciercx_cfg452.s.lme = 0xf;
568 } else {
569 /* We're in 4 lane (56XX) or 2 lane (52XX) mode */
570 pciercx_cfg452.s.lme = 0x7;
571 }
572 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG452(pcie_port),
573 pciercx_cfg452.u32);
574
575 /*
576 * CN52XX pass 1.x has an errata where length mismatches on UR
577 * responses can cause bus errors on 64bit memory
578 * reads. Turning off length error checking fixes this.
579 */
580 if (OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X)) {
581 union cvmx_pciercx_cfg455 pciercx_cfg455;
582 pciercx_cfg455.u32 =
583 cvmx_pcie_cfgx_read(pcie_port,
584 CVMX_PCIERCX_CFG455(pcie_port));
585 pciercx_cfg455.s.m_cpl_len_err = 1;
586 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG455(pcie_port),
587 pciercx_cfg455.u32);
588 }
589
590 /* Lane swap needs to be manually enabled for CN52XX */
591 if (OCTEON_IS_MODEL(OCTEON_CN52XX) && (pcie_port == 1)) {
592 pescx_ctl_status.s.lane_swp = 1;
593 cvmx_write_csr(CVMX_PESCX_CTL_STATUS(pcie_port),
594 pescx_ctl_status.u64);
595 }
596
597 /* Bring up the link */
598 pescx_ctl_status.u64 = cvmx_read_csr(CVMX_PESCX_CTL_STATUS(pcie_port));
599 pescx_ctl_status.s.lnk_enb = 1;
600 cvmx_write_csr(CVMX_PESCX_CTL_STATUS(pcie_port), pescx_ctl_status.u64);
601
602 /*
603 * CN52XX pass 1.0: Due to a bug in 2nd order CDR, it needs to
604 * be disabled.
605 */
606 if (OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_0))
607 __cvmx_helper_errata_qlm_disable_2nd_order_cdr(0);
608
609 /* Wait for the link to come up */
610 cvmx_dprintf("PCIe: Waiting for port %d link\n", pcie_port);
611 start_cycle = cvmx_get_cycle();
612 do {
613 if (cvmx_get_cycle() - start_cycle >
614 2 * cvmx_sysinfo_get()->cpu_clock_hz) {
615 cvmx_dprintf("PCIe: Port %d link timeout\n",
616 pcie_port);
617 return -1;
618 }
619 cvmx_wait(10000);
620 pciercx_cfg032.u32 =
621 cvmx_pcie_cfgx_read(pcie_port,
622 CVMX_PCIERCX_CFG032(pcie_port));
623 } while (pciercx_cfg032.s.dlla == 0);
624
625 /* Display the link status */
626 cvmx_dprintf("PCIe: Port %d link active, %d lanes\n", pcie_port,
627 pciercx_cfg032.s.nlw);
628
629 /*
630 * Update the Replay Time Limit. Empirically, some PCIe
631 * devices take a little longer to respond than expected under
632 * load. As a workaround for this we configure the Replay Time
633 * Limit to the value expected for a 512 byte MPS instead of
634 * our actual 256 byte MPS. The numbers below are directly
635 * from the PCIe spec table 3-4.
636 */
637 pciercx_cfg448.u32 =
638 cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG448(pcie_port));
639 switch (pciercx_cfg032.s.nlw) {
640 case 1: /* 1 lane */
641 pciercx_cfg448.s.rtl = 1677;
642 break;
643 case 2: /* 2 lanes */
644 pciercx_cfg448.s.rtl = 867;
645 break;
646 case 4: /* 4 lanes */
647 pciercx_cfg448.s.rtl = 462;
648 break;
649 case 8: /* 8 lanes */
650 pciercx_cfg448.s.rtl = 258;
651 break;
652 }
653 cvmx_pcie_cfgx_write(pcie_port, CVMX_PCIERCX_CFG448(pcie_port),
654 pciercx_cfg448.u32);
655
656 return 0;
657}
658
659/**
660 * Initialize a PCIe port for use in host(RC) mode. It doesn't
661 * enumerate the bus.
662 *
663 * @pcie_port: PCIe port to initialize
664 *
665 * Returns Zero on success
666 */
667static int cvmx_pcie_rc_initialize(int pcie_port)
668{
669 int i;
670 union cvmx_ciu_soft_prst ciu_soft_prst;
671 union cvmx_pescx_bist_status pescx_bist_status;
672 union cvmx_pescx_bist_status2 pescx_bist_status2;
673 union cvmx_npei_ctl_status npei_ctl_status;
674 union cvmx_npei_mem_access_ctl npei_mem_access_ctl;
675 union cvmx_npei_mem_access_subidx mem_access_subid;
676 union cvmx_npei_dbg_data npei_dbg_data;
677 union cvmx_pescx_ctl_status2 pescx_ctl_status2;
678
679 /*
680 * Make sure we aren't trying to setup a target mode interface
681 * in host mode.
682 */
683 npei_ctl_status.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_STATUS);
684 if ((pcie_port == 0) && !npei_ctl_status.s.host_mode) {
685 cvmx_dprintf("PCIe: ERROR: cvmx_pcie_rc_initialize() called "
686 "on port0, but port0 is not in host mode\n");
687 return -1;
688 }
689
690 /*
691 * Make sure a CN52XX isn't trying to bring up port 1 when it
692 * is disabled.
693 */
694 if (OCTEON_IS_MODEL(OCTEON_CN52XX)) {
695 npei_dbg_data.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_DBG_DATA);
696 if ((pcie_port == 1) && npei_dbg_data.cn52xx.qlm0_link_width) {
697 cvmx_dprintf("PCIe: ERROR: cvmx_pcie_rc_initialize() "
698 "called on port1, but port1 is "
699 "disabled\n");
700 return -1;
701 }
702 }
703
704 /*
705 * PCIe switch arbitration mode. '0' == fixed priority NPEI,
706 * PCIe0, then PCIe1. '1' == round robin.
707 */
708 npei_ctl_status.s.arb = 1;
709 /* Allow up to 0x20 config retries */
710 npei_ctl_status.s.cfg_rtry = 0x20;
711 /*
712 * CN52XX pass1.x has an errata where P0_NTAGS and P1_NTAGS
713 * don't reset.
714 */
715 if (OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X)) {
716 npei_ctl_status.s.p0_ntags = 0x20;
717 npei_ctl_status.s.p1_ntags = 0x20;
718 }
719 cvmx_write_csr(CVMX_PEXP_NPEI_CTL_STATUS, npei_ctl_status.u64);
720
721 /* Bring the PCIe out of reset */
722 if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBH5200) {
723 /*
724 * The EBH5200 board swapped the PCIe reset lines on
725 * the board. As a workaround for this bug, we bring
726 * both PCIe ports out of reset at the same time
727 * instead of on separate calls. So for port 0, we
728 * bring both out of reset and do nothing on port 1.
729 */
730 if (pcie_port == 0) {
731 ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST);
732 /*
733 * After a chip reset the PCIe will also be in
734 * reset. If it isn't, most likely someone is
735 * trying to init it again without a proper
736 * PCIe reset.
737 */
738 if (ciu_soft_prst.s.soft_prst == 0) {
739 /* Reset the ports */
740 ciu_soft_prst.s.soft_prst = 1;
741 cvmx_write_csr(CVMX_CIU_SOFT_PRST,
742 ciu_soft_prst.u64);
743 ciu_soft_prst.u64 =
744 cvmx_read_csr(CVMX_CIU_SOFT_PRST1);
745 ciu_soft_prst.s.soft_prst = 1;
746 cvmx_write_csr(CVMX_CIU_SOFT_PRST1,
747 ciu_soft_prst.u64);
748 /* Wait until pcie resets the ports. */
749 udelay(2000);
750 }
751 ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST1);
752 ciu_soft_prst.s.soft_prst = 0;
753 cvmx_write_csr(CVMX_CIU_SOFT_PRST1, ciu_soft_prst.u64);
754 ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST);
755 ciu_soft_prst.s.soft_prst = 0;
756 cvmx_write_csr(CVMX_CIU_SOFT_PRST, ciu_soft_prst.u64);
757 }
758 } else {
759 /*
760 * The normal case: The PCIe ports are completely
761 * separate and can be brought out of reset
762 * independently.
763 */
764 if (pcie_port)
765 ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST1);
766 else
767 ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST);
768 /*
769 * After a chip reset the PCIe will also be in
770 * reset. If it isn't, most likely someone is trying
771 * to init it again without a proper PCIe reset.
772 */
773 if (ciu_soft_prst.s.soft_prst == 0) {
774 /* Reset the port */
775 ciu_soft_prst.s.soft_prst = 1;
776 if (pcie_port)
777 cvmx_write_csr(CVMX_CIU_SOFT_PRST1,
778 ciu_soft_prst.u64);
779 else
780 cvmx_write_csr(CVMX_CIU_SOFT_PRST,
781 ciu_soft_prst.u64);
782 /* Wait until pcie resets the ports. */
783 udelay(2000);
784 }
785 if (pcie_port) {
786 ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST1);
787 ciu_soft_prst.s.soft_prst = 0;
788 cvmx_write_csr(CVMX_CIU_SOFT_PRST1, ciu_soft_prst.u64);
789 } else {
790 ciu_soft_prst.u64 = cvmx_read_csr(CVMX_CIU_SOFT_PRST);
791 ciu_soft_prst.s.soft_prst = 0;
792 cvmx_write_csr(CVMX_CIU_SOFT_PRST, ciu_soft_prst.u64);
793 }
794 }
795
796 /*
797 * Wait for PCIe reset to complete. Due to errata PCIE-700, we
798 * don't poll PESCX_CTL_STATUS2[PCIERST], but simply wait a
799 * fixed number of cycles.
800 */
801 cvmx_wait(400000);
802
803 /* PESCX_BIST_STATUS2[PCLK_RUN] was missing on pass 1 of CN56XX and
804 CN52XX, so we only probe it on newer chips */
805 if (!OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X)
806 && !OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X)) {
807 /* Clear PCLK_RUN so we can check if the clock is running */
808 pescx_ctl_status2.u64 =
809 cvmx_read_csr(CVMX_PESCX_CTL_STATUS2(pcie_port));
810 pescx_ctl_status2.s.pclk_run = 1;
811 cvmx_write_csr(CVMX_PESCX_CTL_STATUS2(pcie_port),
812 pescx_ctl_status2.u64);
813 /*
814 * Now that we cleared PCLK_RUN, wait for it to be set
815 * again telling us the clock is running.
816 */
817 if (CVMX_WAIT_FOR_FIELD64(CVMX_PESCX_CTL_STATUS2(pcie_port),
818 union cvmx_pescx_ctl_status2,
819 pclk_run, ==, 1, 10000)) {
820 cvmx_dprintf("PCIe: Port %d isn't clocked, skipping.\n",
821 pcie_port);
822 return -1;
823 }
824 }
825
826 /*
827 * Check and make sure PCIe came out of reset. If it doesn't
828 * the board probably hasn't wired the clocks up and the
829 * interface should be skipped.
830 */
831 pescx_ctl_status2.u64 =
832 cvmx_read_csr(CVMX_PESCX_CTL_STATUS2(pcie_port));
833 if (pescx_ctl_status2.s.pcierst) {
834 cvmx_dprintf("PCIe: Port %d stuck in reset, skipping.\n",
835 pcie_port);
836 return -1;
837 }
838
839 /*
840 * Check BIST2 status. If any bits are set skip this interface. This
841 * is an attempt to catch PCIE-813 on pass 1 parts.
842 */
843 pescx_bist_status2.u64 =
844 cvmx_read_csr(CVMX_PESCX_BIST_STATUS2(pcie_port));
845 if (pescx_bist_status2.u64) {
846 cvmx_dprintf("PCIe: Port %d BIST2 failed. Most likely this "
847 "port isn't hooked up, skipping.\n",
848 pcie_port);
849 return -1;
850 }
851
852 /* Check BIST status */
853 pescx_bist_status.u64 =
854 cvmx_read_csr(CVMX_PESCX_BIST_STATUS(pcie_port));
855 if (pescx_bist_status.u64)
856 cvmx_dprintf("PCIe: BIST FAILED for port %d (0x%016llx)\n",
857 pcie_port, CAST64(pescx_bist_status.u64));
858
859 /* Initialize the config space CSRs */
860 __cvmx_pcie_rc_initialize_config_space(pcie_port);
861
862 /* Bring the link up */
863 if (__cvmx_pcie_rc_initialize_link(pcie_port)) {
864 cvmx_dprintf
865 ("PCIe: ERROR: cvmx_pcie_rc_initialize_link() failed\n");
866 return -1;
867 }
868
869 /* Store merge control (NPEI_MEM_ACCESS_CTL[TIMER,MAX_WORD]) */
870 npei_mem_access_ctl.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_MEM_ACCESS_CTL);
871 /* Allow 16 words to combine */
872 npei_mem_access_ctl.s.max_word = 0;
873 /* Wait up to 127 cycles for more data */
874 npei_mem_access_ctl.s.timer = 127;
875 cvmx_write_csr(CVMX_PEXP_NPEI_MEM_ACCESS_CTL, npei_mem_access_ctl.u64);
876
877 /* Setup Mem access SubDIDs */
878 mem_access_subid.u64 = 0;
879 /* Port the request is sent to. */
880 mem_access_subid.s.port = pcie_port;
881 /* Due to an errata on pass 1 chips, no merging is allowed. */
882 mem_access_subid.s.nmerge = 1;
883 /* Endian-swap for Reads. */
884 mem_access_subid.s.esr = 1;
885 /* Endian-swap for Writes. */
886 mem_access_subid.s.esw = 1;
887 /* No Snoop for Reads. */
888 mem_access_subid.s.nsr = 1;
889 /* No Snoop for Writes. */
890 mem_access_subid.s.nsw = 1;
891 /* Disable Relaxed Ordering for Reads. */
892 mem_access_subid.s.ror = 0;
893 /* Disable Relaxed Ordering for Writes. */
894 mem_access_subid.s.row = 0;
895 /* PCIe Adddress Bits <63:34>. */
896 mem_access_subid.s.ba = 0;
897
898 /*
899 * Setup mem access 12-15 for port 0, 16-19 for port 1,
900 * supplying 36 bits of address space.
901 */
902 for (i = 12 + pcie_port * 4; i < 16 + pcie_port * 4; i++) {
903 cvmx_write_csr(CVMX_PEXP_NPEI_MEM_ACCESS_SUBIDX(i),
904 mem_access_subid.u64);
905 /* Set each SUBID to extend the addressable range */
906 mem_access_subid.s.ba += 1;
907 }
908
909 /*
910 * Disable the peer to peer forwarding register. This must be
911 * setup by the OS after it enumerates the bus and assigns
912 * addresses to the PCIe busses.
913 */
914 for (i = 0; i < 4; i++) {
915 cvmx_write_csr(CVMX_PESCX_P2P_BARX_START(i, pcie_port), -1);
916 cvmx_write_csr(CVMX_PESCX_P2P_BARX_END(i, pcie_port), -1);
917 }
918
919 /* Set Octeon's BAR0 to decode 0-16KB. It overlaps with Bar2 */
920 cvmx_write_csr(CVMX_PESCX_P2N_BAR0_START(pcie_port), 0);
921
922 /*
923 * Disable Octeon's BAR1. It isn't needed in RC mode since
924 * BAR2 maps all of memory. BAR2 also maps 256MB-512MB into
925 * the 2nd 256MB of memory.
926 */
927 cvmx_write_csr(CVMX_PESCX_P2N_BAR1_START(pcie_port), -1);
928
929 /*
930 * Set Octeon's BAR2 to decode 0-2^39. Bar0 and Bar1 take
931 * precedence where they overlap. It also overlaps with the
932 * device addresses, so make sure the peer to peer forwarding
933 * is set right.
934 */
935 cvmx_write_csr(CVMX_PESCX_P2N_BAR2_START(pcie_port), 0);
936
937 /*
938 * Setup BAR2 attributes
939 *
940 * Relaxed Ordering (NPEI_CTL_PORTn[PTLP_RO,CTLP_RO, WAIT_COM])
941 * - PTLP_RO,CTLP_RO should normally be set (except for debug).
942 * - WAIT_COM=0 will likely work for all applications.
943 *
944 * Load completion relaxed ordering (NPEI_CTL_PORTn[WAITL_COM]).
945 */
946 if (pcie_port) {
947 union cvmx_npei_ctl_port1 npei_ctl_port;
948 npei_ctl_port.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_PORT1);
949 npei_ctl_port.s.bar2_enb = 1;
950 npei_ctl_port.s.bar2_esx = 1;
951 npei_ctl_port.s.bar2_cax = 0;
952 npei_ctl_port.s.ptlp_ro = 1;
953 npei_ctl_port.s.ctlp_ro = 1;
954 npei_ctl_port.s.wait_com = 0;
955 npei_ctl_port.s.waitl_com = 0;
956 cvmx_write_csr(CVMX_PEXP_NPEI_CTL_PORT1, npei_ctl_port.u64);
957 } else {
958 union cvmx_npei_ctl_port0 npei_ctl_port;
959 npei_ctl_port.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_PORT0);
960 npei_ctl_port.s.bar2_enb = 1;
961 npei_ctl_port.s.bar2_esx = 1;
962 npei_ctl_port.s.bar2_cax = 0;
963 npei_ctl_port.s.ptlp_ro = 1;
964 npei_ctl_port.s.ctlp_ro = 1;
965 npei_ctl_port.s.wait_com = 0;
966 npei_ctl_port.s.waitl_com = 0;
967 cvmx_write_csr(CVMX_PEXP_NPEI_CTL_PORT0, npei_ctl_port.u64);
968 }
969 return 0;
970}
971
972
973/* Above was cvmx-pcie.c, below original pcie.c */
974
975
976/**
977 * Map a PCI device to the appropriate interrupt line
978 *
979 * @param dev The Linux PCI device structure for the device to map
980 * @param slot The slot number for this device on __BUS 0__. Linux
981 * enumerates through all the bridges and figures out the
982 * slot on Bus 0 where this device eventually hooks to.
983 * @param pin The PCI interrupt pin read from the device, then swizzled
984 * as it goes through each bridge.
985 * @return Interrupt number for the device
986 */
987int __init octeon_pcie_pcibios_map_irq(const struct pci_dev *dev,
988 u8 slot, u8 pin)
989{
990 /*
991 * The EBH5600 board with the PCI to PCIe bridge mistakenly
992 * wires the first slot for both device id 2 and interrupt
993 * A. According to the PCI spec, device id 2 should be C. The
994 * following kludge attempts to fix this.
995 */
996 if (strstr(octeon_board_type_string(), "EBH5600") &&
997 dev->bus && dev->bus->parent) {
998 /*
999 * Iterate all the way up the device chain and find
1000 * the root bus.
1001 */
1002 while (dev->bus && dev->bus->parent)
1003 dev = to_pci_dev(dev->bus->bridge);
1004 /* If the root bus is number 0 and the PEX 8114 is the
1005 * root, assume we are behind the miswired bus. We
1006 * need to correct the swizzle level by two. Yuck.
1007 */
1008 if ((dev->bus->number == 0) &&
1009 (dev->vendor == 0x10b5) && (dev->device == 0x8114)) {
1010 /*
1011 * The pin field is one based, not zero. We
1012 * need to swizzle it by minus two.
1013 */
1014 pin = ((pin - 3) & 3) + 1;
1015 }
1016 }
1017 /*
1018 * The -1 is because pin starts with one, not zero. It might
1019 * be that this equation needs to include the slot number, but
1020 * I don't have hardware to check that against.
1021 */
1022 return pin - 1 + OCTEON_IRQ_PCI_INT0;
1023}
1024
1025/**
1026 * Read a value from configuration space
1027 *
1028 * @param bus
1029 * @param devfn
1030 * @param reg
1031 * @param size
1032 * @param val
1033 * @return
1034 */
1035static inline int octeon_pcie_read_config(int pcie_port, struct pci_bus *bus,
1036 unsigned int devfn, int reg, int size,
1037 u32 *val)
1038{
1039 union octeon_cvmemctl cvmmemctl;
1040 union octeon_cvmemctl cvmmemctl_save;
1041 int bus_number = bus->number;
1042
1043 /*
1044 * We need to force the bus number to be zero on the root
1045 * bus. Linux numbers the 2nd root bus to start after all
1046 * buses on root 0.
1047 */
1048 if (bus->parent == NULL)
1049 bus_number = 0;
1050
1051 /*
1052 * PCIe only has a single device connected to Octeon. It is
1053 * always device ID 0. Don't bother doing reads for other
1054 * device IDs on the first segment.
1055 */
1056 if ((bus_number == 0) && (devfn >> 3 != 0))
1057 return PCIBIOS_FUNC_NOT_SUPPORTED;
1058
1059 /*
1060 * The following is a workaround for the CN57XX, CN56XX,
1061 * CN55XX, and CN54XX errata with PCIe config reads from non
1062 * existent devices. These chips will hang the PCIe link if a
1063 * config read is performed that causes a UR response.
1064 */
1065 if (OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1) ||
1066 OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_1)) {
1067 /*
1068 * For our EBH5600 board, port 0 has a bridge with two
1069 * PCI-X slots. We need a new special checks to make
1070 * sure we only probe valid stuff. The PCIe->PCI-X
1071 * bridge only respondes to device ID 0, function
1072 * 0-1
1073 */
1074 if ((bus_number == 0) && (devfn >= 2))
1075 return PCIBIOS_FUNC_NOT_SUPPORTED;
1076 /*
1077 * The PCI-X slots are device ID 2,3. Choose one of
1078 * the below "if" blocks based on what is plugged into
1079 * the board.
1080 */
1081#if 1
1082 /* Use this option if you aren't using either slot */
1083 if (bus_number == 1)
1084 return PCIBIOS_FUNC_NOT_SUPPORTED;
1085#elif 0
1086 /*
1087 * Use this option if you are using the first slot but
1088 * not the second.
1089 */
1090 if ((bus_number == 1) && (devfn >> 3 != 2))
1091 return PCIBIOS_FUNC_NOT_SUPPORTED;
1092#elif 0
1093 /*
1094 * Use this option if you are using the second slot
1095 * but not the first.
1096 */
1097 if ((bus_number == 1) && (devfn >> 3 != 3))
1098 return PCIBIOS_FUNC_NOT_SUPPORTED;
1099#elif 0
1100 /* Use this opion if you are using both slots */
1101 if ((bus_number == 1) &&
1102 !((devfn == (2 << 3)) || (devfn == (3 << 3))))
1103 return PCIBIOS_FUNC_NOT_SUPPORTED;
1104#endif
1105
1106 /*
1107 * Shorten the DID timeout so bus errors for PCIe
1108 * config reads from non existent devices happen
1109 * faster. This allows us to continue booting even if
1110 * the above "if" checks are wrong. Once one of these
1111 * errors happens, the PCIe port is dead.
1112 */
1113 cvmmemctl_save.u64 = __read_64bit_c0_register($11, 7);
1114 cvmmemctl.u64 = cvmmemctl_save.u64;
1115 cvmmemctl.s.didtto = 2;
1116 __write_64bit_c0_register($11, 7, cvmmemctl.u64);
1117 }
1118
1119 switch (size) {
1120 case 4:
1121 *val = cvmx_pcie_config_read32(pcie_port, bus_number,
1122 devfn >> 3, devfn & 0x7, reg);
1123 break;
1124 case 2:
1125 *val = cvmx_pcie_config_read16(pcie_port, bus_number,
1126 devfn >> 3, devfn & 0x7, reg);
1127 break;
1128 case 1:
1129 *val = cvmx_pcie_config_read8(pcie_port, bus_number, devfn >> 3,
1130 devfn & 0x7, reg);
1131 break;
1132 default:
1133 return PCIBIOS_FUNC_NOT_SUPPORTED;
1134 }
1135
1136 if (OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1) ||
1137 OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_1))
1138 __write_64bit_c0_register($11, 7, cvmmemctl_save.u64);
1139 return PCIBIOS_SUCCESSFUL;
1140}
1141
1142static int octeon_pcie0_read_config(struct pci_bus *bus, unsigned int devfn,
1143 int reg, int size, u32 *val)
1144{
1145 return octeon_pcie_read_config(0, bus, devfn, reg, size, val);
1146}
1147
1148static int octeon_pcie1_read_config(struct pci_bus *bus, unsigned int devfn,
1149 int reg, int size, u32 *val)
1150{
1151 return octeon_pcie_read_config(1, bus, devfn, reg, size, val);
1152}
1153
1154
1155
1156/**
1157 * Write a value to PCI configuration space
1158 *
1159 * @param bus
1160 * @param devfn
1161 * @param reg
1162 * @param size
1163 * @param val
1164 * @return
1165 */
1166static inline int octeon_pcie_write_config(int pcie_port, struct pci_bus *bus,
1167 unsigned int devfn, int reg,
1168 int size, u32 val)
1169{
1170 int bus_number = bus->number;
1171 /*
1172 * We need to force the bus number to be zero on the root
1173 * bus. Linux numbers the 2nd root bus to start after all
1174 * busses on root 0.
1175 */
1176 if (bus->parent == NULL)
1177 bus_number = 0;
1178
1179 switch (size) {
1180 case 4:
1181 cvmx_pcie_config_write32(pcie_port, bus_number, devfn >> 3,
1182 devfn & 0x7, reg, val);
1183 return PCIBIOS_SUCCESSFUL;
1184 case 2:
1185 cvmx_pcie_config_write16(pcie_port, bus_number, devfn >> 3,
1186 devfn & 0x7, reg, val);
1187 return PCIBIOS_SUCCESSFUL;
1188 case 1:
1189 cvmx_pcie_config_write8(pcie_port, bus_number, devfn >> 3,
1190 devfn & 0x7, reg, val);
1191 return PCIBIOS_SUCCESSFUL;
1192 }
1193#if PCI_CONFIG_SPACE_DELAY
1194 udelay(PCI_CONFIG_SPACE_DELAY);
1195#endif
1196 return PCIBIOS_FUNC_NOT_SUPPORTED;
1197}
1198
1199static int octeon_pcie0_write_config(struct pci_bus *bus, unsigned int devfn,
1200 int reg, int size, u32 val)
1201{
1202 return octeon_pcie_write_config(0, bus, devfn, reg, size, val);
1203}
1204
1205static int octeon_pcie1_write_config(struct pci_bus *bus, unsigned int devfn,
1206 int reg, int size, u32 val)
1207{
1208 return octeon_pcie_write_config(1, bus, devfn, reg, size, val);
1209}
1210
1211static struct pci_ops octeon_pcie0_ops = {
1212 octeon_pcie0_read_config,
1213 octeon_pcie0_write_config,
1214};
1215
1216static struct resource octeon_pcie0_mem_resource = {
1217 .name = "Octeon PCIe0 MEM",
1218 .flags = IORESOURCE_MEM,
1219};
1220
1221static struct resource octeon_pcie0_io_resource = {
1222 .name = "Octeon PCIe0 IO",
1223 .flags = IORESOURCE_IO,
1224};
1225
1226static struct pci_controller octeon_pcie0_controller = {
1227 .pci_ops = &octeon_pcie0_ops,
1228 .mem_resource = &octeon_pcie0_mem_resource,
1229 .io_resource = &octeon_pcie0_io_resource,
1230};
1231
1232static struct pci_ops octeon_pcie1_ops = {
1233 octeon_pcie1_read_config,
1234 octeon_pcie1_write_config,
1235};
1236
1237static struct resource octeon_pcie1_mem_resource = {
1238 .name = "Octeon PCIe1 MEM",
1239 .flags = IORESOURCE_MEM,
1240};
1241
1242static struct resource octeon_pcie1_io_resource = {
1243 .name = "Octeon PCIe1 IO",
1244 .flags = IORESOURCE_IO,
1245};
1246
1247static struct pci_controller octeon_pcie1_controller = {
1248 .pci_ops = &octeon_pcie1_ops,
1249 .mem_resource = &octeon_pcie1_mem_resource,
1250 .io_resource = &octeon_pcie1_io_resource,
1251};
1252
1253
1254/**
1255 * Initialize the Octeon PCIe controllers
1256 *
1257 * @return
1258 */
1259static int __init octeon_pcie_setup(void)
1260{
1261 union cvmx_npei_ctl_status npei_ctl_status;
1262 int result;
1263
1264 /* These chips don't have PCIe */
1265 if (!octeon_has_feature(OCTEON_FEATURE_PCIE))
1266 return 0;
1267
1268 /* Point pcibios_map_irq() to the PCIe version of it */
1269 octeon_pcibios_map_irq = octeon_pcie_pcibios_map_irq;
1270
1271 /* Use the PCIe based DMA mappings */
1272 octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_PCIE;
1273
1274 /*
1275 * PCIe I/O range. It is based on port 0 but includes up until
1276 * port 1's end.
1277 */
1278 set_io_port_base(CVMX_ADD_IO_SEG(cvmx_pcie_get_io_base_address(0)));
1279 ioport_resource.start = 0;
1280 ioport_resource.end =
1281 cvmx_pcie_get_io_base_address(1) -
1282 cvmx_pcie_get_io_base_address(0) + cvmx_pcie_get_io_size(1) - 1;
1283
1284 npei_ctl_status.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_STATUS);
1285 if (npei_ctl_status.s.host_mode) {
1286 pr_notice("PCIe: Initializing port 0\n");
1287 result = cvmx_pcie_rc_initialize(0);
1288 if (result == 0) {
1289 /* Memory offsets are physical addresses */
1290 octeon_pcie0_controller.mem_offset =
1291 cvmx_pcie_get_mem_base_address(0);
1292 /* IO offsets are Mips virtual addresses */
1293 octeon_pcie0_controller.io_map_base =
1294 CVMX_ADD_IO_SEG(cvmx_pcie_get_io_base_address
1295 (0));
1296 octeon_pcie0_controller.io_offset = 0;
1297 /*
1298 * To keep things similar to PCI, we start
1299 * device addresses at the same place as PCI
1300 * uisng big bar support. This normally
1301 * translates to 4GB-256MB, which is the same
1302 * as most x86 PCs.
1303 */
1304 octeon_pcie0_controller.mem_resource->start =
1305 cvmx_pcie_get_mem_base_address(0) +
1306 (4ul << 30) - (OCTEON_PCI_BAR1_HOLE_SIZE << 20);
1307 octeon_pcie0_controller.mem_resource->end =
1308 cvmx_pcie_get_mem_base_address(0) +
1309 cvmx_pcie_get_mem_size(0) - 1;
1310 /*
1311 * Ports must be above 16KB for the ISA bus
1312 * filtering in the PCI-X to PCI bridge.
1313 */
1314 octeon_pcie0_controller.io_resource->start = 4 << 10;
1315 octeon_pcie0_controller.io_resource->end =
1316 cvmx_pcie_get_io_size(0) - 1;
1317 register_pci_controller(&octeon_pcie0_controller);
1318 }
1319 } else {
1320 pr_notice("PCIe: Port 0 in endpoint mode, skipping.\n");
1321 }
1322
1323 /* Skip the 2nd port on CN52XX if port 0 is in 4 lane mode */
1324 if (OCTEON_IS_MODEL(OCTEON_CN52XX)) {
1325 union cvmx_npei_dbg_data npei_dbg_data;
1326 npei_dbg_data.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_DBG_DATA);
1327 if (npei_dbg_data.cn52xx.qlm0_link_width)
1328 return 0;
1329 }
1330
1331 pr_notice("PCIe: Initializing port 1\n");
1332 result = cvmx_pcie_rc_initialize(1);
1333 if (result == 0) {
1334 /* Memory offsets are physical addresses */
1335 octeon_pcie1_controller.mem_offset =
1336 cvmx_pcie_get_mem_base_address(1);
1337 /* IO offsets are Mips virtual addresses */
1338 octeon_pcie1_controller.io_map_base =
1339 CVMX_ADD_IO_SEG(cvmx_pcie_get_io_base_address(1));
1340 octeon_pcie1_controller.io_offset =
1341 cvmx_pcie_get_io_base_address(1) -
1342 cvmx_pcie_get_io_base_address(0);
1343 /*
1344 * To keep things similar to PCI, we start device
1345 * addresses at the same place as PCI uisng big bar
1346 * support. This normally translates to 4GB-256MB,
1347 * which is the same as most x86 PCs.
1348 */
1349 octeon_pcie1_controller.mem_resource->start =
1350 cvmx_pcie_get_mem_base_address(1) + (4ul << 30) -
1351 (OCTEON_PCI_BAR1_HOLE_SIZE << 20);
1352 octeon_pcie1_controller.mem_resource->end =
1353 cvmx_pcie_get_mem_base_address(1) +
1354 cvmx_pcie_get_mem_size(1) - 1;
1355 /*
1356 * Ports must be above 16KB for the ISA bus filtering
1357 * in the PCI-X to PCI bridge.
1358 */
1359 octeon_pcie1_controller.io_resource->start =
1360 cvmx_pcie_get_io_base_address(1) -
1361 cvmx_pcie_get_io_base_address(0);
1362 octeon_pcie1_controller.io_resource->end =
1363 octeon_pcie1_controller.io_resource->start +
1364 cvmx_pcie_get_io_size(1) - 1;
1365 register_pci_controller(&octeon_pcie1_controller);
1366 }
1367 return 0;
1368}
1369
1370arch_initcall(octeon_pcie_setup);
diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig
index 783da855a2e3..d6d35b2e5fe8 100644
--- a/arch/mips/configs/bigsur_defconfig
+++ b/arch/mips/configs/bigsur_defconfig
@@ -963,7 +963,7 @@ CONFIG_EEPROM_LEGACY=y
963CONFIG_SENSORS_PCF8574=y 963CONFIG_SENSORS_PCF8574=y
964# CONFIG_PCF8575 is not set 964# CONFIG_PCF8575 is not set
965CONFIG_SENSORS_PCF8591=y 965CONFIG_SENSORS_PCF8591=y
966CONFIG_SENSORS_MAX6875=y 966CONFIG_EEPROM_MAX6875=y
967# CONFIG_SENSORS_TSL2550 is not set 967# CONFIG_SENSORS_TSL2550 is not set
968CONFIG_I2C_DEBUG_CORE=y 968CONFIG_I2C_DEBUG_CORE=y
969CONFIG_I2C_DEBUG_ALGO=y 969CONFIG_I2C_DEBUG_ALGO=y
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
index 8426d3b9501c..fadb351d249b 100644
--- a/arch/mips/configs/mtx1_defconfig
+++ b/arch/mips/configs/mtx1_defconfig
@@ -1849,7 +1849,7 @@ CONFIG_EEPROM_LEGACY=m
1849CONFIG_SENSORS_PCF8574=m 1849CONFIG_SENSORS_PCF8574=m
1850CONFIG_SENSORS_PCA9539=m 1850CONFIG_SENSORS_PCA9539=m
1851CONFIG_SENSORS_PCF8591=m 1851CONFIG_SENSORS_PCF8591=m
1852CONFIG_SENSORS_MAX6875=m 1852CONFIG_EEPROM_MAX6875=m
1853# CONFIG_SENSORS_TSL2550 is not set 1853# CONFIG_SENSORS_TSL2550 is not set
1854# CONFIG_I2C_DEBUG_CORE is not set 1854# CONFIG_I2C_DEBUG_CORE is not set
1855# CONFIG_I2C_DEBUG_ALGO is not set 1855# CONFIG_I2C_DEBUG_ALGO is not set
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index c0047f861337..8ab1d12ba7f4 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -147,6 +147,10 @@
147#define cpu_has_mips_r (cpu_has_mips32r1 | cpu_has_mips32r2 | \ 147#define cpu_has_mips_r (cpu_has_mips32r1 | cpu_has_mips32r2 | \
148 cpu_has_mips64r1 | cpu_has_mips64r2) 148 cpu_has_mips64r1 | cpu_has_mips64r2)
149 149
150#ifndef cpu_has_mips_r2_exec_hazard
151#define cpu_has_mips_r2_exec_hazard cpu_has_mips_r2
152#endif
153
150/* 154/*
151 * MIPS32, MIPS64, VR5500, IDT32332, IDT32334 and maybe a few other 155 * MIPS32, MIPS64, VR5500, IDT32332, IDT32334 and maybe a few other
152 * pre-MIPS32/MIPS53 processors have CLO, CLZ. For 64-bit kernels 156 * pre-MIPS32/MIPS53 processors have CLO, CLZ. For 64-bit kernels
@@ -230,4 +234,8 @@
230#define cpu_scache_line_size() cpu_data[0].scache.linesz 234#define cpu_scache_line_size() cpu_data[0].scache.linesz
231#endif 235#endif
232 236
237#ifndef cpu_hwrena_impl_bits
238#define cpu_hwrena_impl_bits 0
239#endif
240
233#endif /* __ASM_CPU_FEATURES_H */ 241#endif /* __ASM_CPU_FEATURES_H */
diff --git a/arch/mips/include/asm/delay.h b/arch/mips/include/asm/delay.h
index a07e51b2be13..d2d8949be6b7 100644
--- a/arch/mips/include/asm/delay.h
+++ b/arch/mips/include/asm/delay.h
@@ -15,7 +15,7 @@ extern void __delay(unsigned int loops);
15extern void __ndelay(unsigned int ns); 15extern void __ndelay(unsigned int ns);
16extern void __udelay(unsigned int us); 16extern void __udelay(unsigned int us);
17 17
18#define ndelay(ns) __udelay(ns) 18#define ndelay(ns) __ndelay(ns)
19#define udelay(us) __udelay(us) 19#define udelay(us) __udelay(us)
20 20
21/* make sure "usecs *= ..." in udelay do not overflow. */ 21/* make sure "usecs *= ..." in udelay do not overflow. */
diff --git a/arch/mips/include/asm/errno.h b/arch/mips/include/asm/errno.h
index 3c0d840e4577..a0efc73819e4 100644
--- a/arch/mips/include/asm/errno.h
+++ b/arch/mips/include/asm/errno.h
@@ -119,6 +119,8 @@
119#define EOWNERDEAD 165 /* Owner died */ 119#define EOWNERDEAD 165 /* Owner died */
120#define ENOTRECOVERABLE 166 /* State not recoverable */ 120#define ENOTRECOVERABLE 166 /* State not recoverable */
121 121
122#define ERFKILL 167 /* Operation not possible due to RF-kill */
123
122#define EDQUOT 1133 /* Quota exceeded */ 124#define EDQUOT 1133 /* Quota exceeded */
123 125
124#ifdef __KERNEL__ 126#ifdef __KERNEL__
diff --git a/arch/mips/include/asm/hugetlb.h b/arch/mips/include/asm/hugetlb.h
new file mode 100644
index 000000000000..f5e856015329
--- /dev/null
+++ b/arch/mips/include/asm/hugetlb.h
@@ -0,0 +1,114 @@
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 * Copyright (C) 2008, 2009 Cavium Networks, Inc.
7 */
8
9#ifndef __ASM_HUGETLB_H
10#define __ASM_HUGETLB_H
11
12#include <asm/page.h>
13
14
15static inline int is_hugepage_only_range(struct mm_struct *mm,
16 unsigned long addr,
17 unsigned long len)
18{
19 return 0;
20}
21
22static inline int prepare_hugepage_range(struct file *file,
23 unsigned long addr,
24 unsigned long len)
25{
26 unsigned long task_size = STACK_TOP;
27 struct hstate *h = hstate_file(file);
28
29 if (len & ~huge_page_mask(h))
30 return -EINVAL;
31 if (addr & ~huge_page_mask(h))
32 return -EINVAL;
33 if (len > task_size)
34 return -ENOMEM;
35 if (task_size - len < addr)
36 return -EINVAL;
37 return 0;
38}
39
40static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
41{
42}
43
44static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
45 unsigned long addr,
46 unsigned long end,
47 unsigned long floor,
48 unsigned long ceiling)
49{
50 free_pgd_range(tlb, addr, end, floor, ceiling);
51}
52
53static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
54 pte_t *ptep, pte_t pte)
55{
56 set_pte_at(mm, addr, ptep, pte);
57}
58
59static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
60 unsigned long addr, pte_t *ptep)
61{
62 pte_t clear;
63 pte_t pte = *ptep;
64
65 pte_val(clear) = (unsigned long)invalid_pte_table;
66 set_pte_at(mm, addr, ptep, clear);
67 return pte;
68}
69
70static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
71 unsigned long addr, pte_t *ptep)
72{
73}
74
75static inline int huge_pte_none(pte_t pte)
76{
77 unsigned long val = pte_val(pte) & ~_PAGE_GLOBAL;
78 return !val || (val == (unsigned long)invalid_pte_table);
79}
80
81static inline pte_t huge_pte_wrprotect(pte_t pte)
82{
83 return pte_wrprotect(pte);
84}
85
86static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
87 unsigned long addr, pte_t *ptep)
88{
89 ptep_set_wrprotect(mm, addr, ptep);
90}
91
92static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
93 unsigned long addr,
94 pte_t *ptep, pte_t pte,
95 int dirty)
96{
97 return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
98}
99
100static inline pte_t huge_ptep_get(pte_t *ptep)
101{
102 return *ptep;
103}
104
105static inline int arch_prepare_hugepage(struct page *page)
106{
107 return 0;
108}
109
110static inline void arch_release_hugepage(struct page *page)
111{
112}
113
114#endif /* __ASM_HUGETLB_H */
diff --git a/arch/mips/include/asm/i8253.h b/arch/mips/include/asm/i8253.h
index 5dabc870b322..032ca73f181b 100644
--- a/arch/mips/include/asm/i8253.h
+++ b/arch/mips/include/asm/i8253.h
@@ -12,8 +12,6 @@
12#define PIT_CH0 0x40 12#define PIT_CH0 0x40
13#define PIT_CH2 0x42 13#define PIT_CH2 0x42
14 14
15#define PIT_TICK_RATE 1193182UL
16
17extern spinlock_t i8253_lock; 15extern spinlock_t i8253_lock;
18 16
19extern void setup_pit_timer(void); 17extern void setup_pit_timer(void);
diff --git a/arch/mips/include/asm/ioctl.h b/arch/mips/include/asm/ioctl.h
index 916163401b2c..c515a1a4c47c 100644
--- a/arch/mips/include/asm/ioctl.h
+++ b/arch/mips/include/asm/ioctl.h
@@ -3,40 +3,16 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1995, 96, 99, 2001 Ralf Baechle 6 * Copyright (C) 1995, 96, 99, 2001 Ralf Baechle <ralf@linux-mips.org>
7 * Copyright (C) 2009 Wind River Systems
8 * Written by Ralf Baechle <ralf@linux-mips.org>
7 */ 9 */
8#ifndef _ASM_IOCTL_H 10#ifndef __ASM_IOCTL_H
9#define _ASM_IOCTL_H 11#define __ASM_IOCTL_H
10 12
11/*
12 * The original linux ioctl numbering scheme was just a general
13 * "anything goes" setup, where more or less random numbers were
14 * assigned. Sorry, I was clueless when I started out on this.
15 *
16 * On the alpha, we'll try to clean it up a bit, using a more sane
17 * ioctl numbering, and also trying to be compatible with OSF/1 in
18 * the process. I'd like to clean it up for the i386 as well, but
19 * it's so painful recognizing both the new and the old numbers..
20 *
21 * The same applies for for the MIPS ABI; in fact even the macros
22 * from Linux/Alpha fit almost perfectly.
23 */
24
25#define _IOC_NRBITS 8
26#define _IOC_TYPEBITS 8
27#define _IOC_SIZEBITS 13 13#define _IOC_SIZEBITS 13
28#define _IOC_DIRBITS 3 14#define _IOC_DIRBITS 3
29 15
30#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
31#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
32#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
33#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
34
35#define _IOC_NRSHIFT 0
36#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
37#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
38#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
39
40/* 16/*
41 * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit. 17 * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit.
42 * And this turns out useful to catch old ioctl numbers in header 18 * And this turns out useful to catch old ioctl numbers in header
@@ -46,53 +22,6 @@
46#define _IOC_READ 2U 22#define _IOC_READ 2U
47#define _IOC_WRITE 4U 23#define _IOC_WRITE 4U
48 24
49/* 25#include <asm-generic/ioctl.h>
50 * The following are included for compatibility
51 */
52#define _IOC_VOID 0x20000000
53#define _IOC_OUT 0x40000000
54#define _IOC_IN 0x80000000
55#define _IOC_INOUT (IOC_IN|IOC_OUT)
56
57#define _IOC(dir, type, nr, size) \
58 (((dir) << _IOC_DIRSHIFT) | \
59 ((type) << _IOC_TYPESHIFT) | \
60 ((nr) << _IOC_NRSHIFT) | \
61 ((size) << _IOC_SIZESHIFT))
62
63#ifdef __KERNEL__
64/* provoke compile error for invalid uses of size argument */
65extern unsigned int __invalid_size_argument_for_IOC;
66#define _IOC_TYPECHECK(t) \
67 ((sizeof(t) == sizeof(t[1]) && \
68 sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
69 sizeof(t) : __invalid_size_argument_for_IOC)
70#else
71#define _IOC_TYPECHECK(t) (sizeof(t))
72#endif
73
74/* used to create numbers */
75#define _IO(type, nr) _IOC(_IOC_NONE, (type), (nr), 0)
76#define _IOR(type, nr, size) _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
77#define _IOW(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
78#define _IOWR(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
79#define _IOR_BAD(type, nr, size) _IOC(_IOC_READ, (type), (nr), sizeof(size))
80#define _IOW_BAD(type, nr, size) _IOC(_IOC_WRITE, (type), (nr), sizeof(size))
81#define _IOWR_BAD(type, nr, size) _IOC(_IOC_READ|_IOC_WRITE, (type), (nr), sizeof(size))
82
83
84/* used to decode them.. */
85#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
86#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
87#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
88#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
89
90/* ...and for the drivers/sound files... */
91
92#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
93#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
94#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
95#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
96#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
97 26
98#endif /* _ASM_IOCTL_H */ 27#endif /* __ASM_IOCTL_H */
diff --git a/arch/mips/include/asm/kmap_types.h b/arch/mips/include/asm/kmap_types.h
index 806aae3c5338..58e91ed0388f 100644
--- a/arch/mips/include/asm/kmap_types.h
+++ b/arch/mips/include/asm/kmap_types.h
@@ -1,30 +1,12 @@
1#ifndef _ASM_KMAP_TYPES_H 1#ifndef _ASM_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H 2#define _ASM_KMAP_TYPES_H
3 3
4
5#ifdef CONFIG_DEBUG_HIGHMEM 4#ifdef CONFIG_DEBUG_HIGHMEM
6# define D(n) __KM_FENCE_##n , 5#define __WITH_KM_FENCE
7#else
8# define D(n)
9#endif 6#endif
10 7
11enum km_type { 8#include <asm-generic/kmap_types.h>
12D(0) KM_BOUNCE_READ,
13D(1) KM_SKB_SUNRPC_DATA,
14D(2) KM_SKB_DATA_SOFTIRQ,
15D(3) KM_USER0,
16D(4) KM_USER1,
17D(5) KM_BIO_SRC_IRQ,
18D(6) KM_BIO_DST_IRQ,
19D(7) KM_PTE0,
20D(8) KM_PTE1,
21D(9) KM_IRQ0,
22D(10) KM_IRQ1,
23D(11) KM_SOFTIRQ0,
24D(12) KM_SOFTIRQ1,
25D(13) KM_TYPE_NR
26};
27 9
28#undef D 10#undef __WITH_KM_FENCE
29 11
30#endif 12#endif
diff --git a/arch/mips/include/asm/mach-au1x00/au1000_gpio.h b/arch/mips/include/asm/mach-au1x00/au1000_gpio.h
deleted file mode 100644
index d8c96fda5549..000000000000
--- a/arch/mips/include/asm/mach-au1x00/au1000_gpio.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * FILE NAME au1000_gpio.h
3 *
4 * BRIEF MODULE DESCRIPTION
5 * API to Alchemy Au1xx0 GPIO device.
6 *
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 * Steve Longerbeam
9 *
10 * Copyright 2001, 2008 MontaVista Software Inc.
11 *
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
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 675 Mass Ave, Cambridge, MA 02139, USA.
31 */
32
33#ifndef __AU1000_GPIO_H
34#define __AU1000_GPIO_H
35
36#include <linux/ioctl.h>
37
38#define AU1000GPIO_IOC_MAGIC 'A'
39
40#define AU1000GPIO_IN _IOR(AU1000GPIO_IOC_MAGIC, 0, int)
41#define AU1000GPIO_SET _IOW(AU1000GPIO_IOC_MAGIC, 1, int)
42#define AU1000GPIO_CLEAR _IOW(AU1000GPIO_IOC_MAGIC, 2, int)
43#define AU1000GPIO_OUT _IOW(AU1000GPIO_IOC_MAGIC, 3, int)
44#define AU1000GPIO_TRISTATE _IOW(AU1000GPIO_IOC_MAGIC, 4, int)
45#define AU1000GPIO_AVAIL_MASK _IOR(AU1000GPIO_IOC_MAGIC, 5, int)
46
47#ifdef __KERNEL__
48extern u32 get_au1000_avail_gpio_mask(void);
49extern int au1000gpio_tristate(u32 data);
50extern int au1000gpio_in(u32 *data);
51extern int au1000gpio_set(u32 data);
52extern int au1000gpio_clear(u32 data);
53extern int au1000gpio_out(u32 data);
54#endif
55
56#endif
diff --git a/arch/mips/include/asm/mach-au1x00/gpio-au1000.h b/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
new file mode 100644
index 000000000000..127d4ed9f073
--- /dev/null
+++ b/arch/mips/include/asm/mach-au1x00/gpio-au1000.h
@@ -0,0 +1,604 @@
1/*
2 * GPIO functions for Au1000, Au1500, Au1100, Au1550, Au1200
3 *
4 * Copyright (c) 2009 Manuel Lauss.
5 *
6 * Licensed under the terms outlined in the file COPYING.
7 */
8
9#ifndef _ALCHEMY_GPIO_AU1000_H_
10#define _ALCHEMY_GPIO_AU1000_H_
11
12#include <asm/mach-au1x00/au1000.h>
13
14/* The default GPIO numberspace as documented in the Alchemy manuals.
15 * GPIO0-31 from GPIO1 block, GPIO200-215 from GPIO2 block.
16 */
17#define ALCHEMY_GPIO1_BASE 0
18#define ALCHEMY_GPIO2_BASE 200
19
20#define ALCHEMY_GPIO1_NUM 32
21#define ALCHEMY_GPIO2_NUM 16
22#define ALCHEMY_GPIO1_MAX (ALCHEMY_GPIO1_BASE + ALCHEMY_GPIO1_NUM - 1)
23#define ALCHEMY_GPIO2_MAX (ALCHEMY_GPIO2_BASE + ALCHEMY_GPIO2_NUM - 1)
24
25#define MAKE_IRQ(intc, off) (AU1000_INTC##intc##_INT_BASE + (off))
26
27
28static inline int au1000_gpio1_to_irq(int gpio)
29{
30 return MAKE_IRQ(1, gpio - ALCHEMY_GPIO1_BASE);
31}
32
33static inline int au1000_gpio2_to_irq(int gpio)
34{
35 return -ENXIO;
36}
37
38#ifdef CONFIG_SOC_AU1000
39static inline int au1000_irq_to_gpio(int irq)
40{
41 if ((irq >= AU1000_GPIO_0) && (irq <= AU1000_GPIO_31))
42 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0;
43
44 return -ENXIO;
45}
46#endif
47
48static inline int au1500_gpio1_to_irq(int gpio)
49{
50 gpio -= ALCHEMY_GPIO1_BASE;
51
52 switch (gpio) {
53 case 0 ... 15:
54 case 20:
55 case 23 ... 28: return MAKE_IRQ(1, gpio);
56 }
57
58 return -ENXIO;
59}
60
61static inline int au1500_gpio2_to_irq(int gpio)
62{
63 gpio -= ALCHEMY_GPIO2_BASE;
64
65 switch (gpio) {
66 case 0 ... 3: return MAKE_IRQ(1, 16 + gpio - 0);
67 case 4 ... 5: return MAKE_IRQ(1, 21 + gpio - 4);
68 case 6 ... 7: return MAKE_IRQ(1, 29 + gpio - 6);
69 }
70
71 return -ENXIO;
72}
73
74#ifdef CONFIG_SOC_AU1500
75static inline int au1500_irq_to_gpio(int irq)
76{
77 switch (irq) {
78 case AU1000_GPIO_0 ... AU1000_GPIO_15:
79 case AU1500_GPIO_20:
80 case AU1500_GPIO_23 ... AU1500_GPIO_28:
81 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0;
82 case AU1500_GPIO_200 ... AU1500_GPIO_203:
83 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_200) + 0;
84 case AU1500_GPIO_204 ... AU1500_GPIO_205:
85 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_204) + 4;
86 case AU1500_GPIO_206 ... AU1500_GPIO_207:
87 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_206) + 6;
88 case AU1500_GPIO_208_215:
89 return ALCHEMY_GPIO2_BASE + 8;
90 }
91
92 return -ENXIO;
93}
94#endif
95
96static inline int au1100_gpio1_to_irq(int gpio)
97{
98 return MAKE_IRQ(1, gpio - ALCHEMY_GPIO1_BASE);
99}
100
101static inline int au1100_gpio2_to_irq(int gpio)
102{
103 gpio -= ALCHEMY_GPIO2_BASE;
104
105 if ((gpio >= 8) && (gpio <= 15))
106 return MAKE_IRQ(0, 29); /* shared GPIO208_215 */
107}
108
109#ifdef CONFIG_SOC_AU1100
110static inline int au1100_irq_to_gpio(int irq)
111{
112 switch (irq) {
113 case AU1000_GPIO_0 ... AU1000_GPIO_31:
114 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0;
115 case AU1100_GPIO_208_215:
116 return ALCHEMY_GPIO2_BASE + 8;
117 }
118
119 return -ENXIO;
120}
121#endif
122
123static inline int au1550_gpio1_to_irq(int gpio)
124{
125 gpio -= ALCHEMY_GPIO1_BASE;
126
127 switch (gpio) {
128 case 0 ... 15:
129 case 20 ... 28: return MAKE_IRQ(1, gpio);
130 case 16 ... 17: return MAKE_IRQ(1, 18 + gpio - 16);
131 }
132
133 return -ENXIO;
134}
135
136static inline int au1550_gpio2_to_irq(int gpio)
137{
138 gpio -= ALCHEMY_GPIO2_BASE;
139
140 switch (gpio) {
141 case 0: return MAKE_IRQ(1, 16);
142 case 1 ... 5: return MAKE_IRQ(1, 17); /* shared GPIO201_205 */
143 case 6 ... 7: return MAKE_IRQ(1, 29 + gpio - 6);
144 case 8 ... 15: return MAKE_IRQ(1, 31); /* shared GPIO208_215 */
145 }
146
147 return -ENXIO;
148}
149
150#ifdef CONFIG_SOC_AU1550
151static inline int au1550_irq_to_gpio(int irq)
152{
153 switch (irq) {
154 case AU1000_GPIO_0 ... AU1000_GPIO_15:
155 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0;
156 case AU1550_GPIO_200:
157 case AU1500_GPIO_201_205:
158 return ALCHEMY_GPIO2_BASE + (irq - AU1550_GPIO_200) + 0;
159 case AU1500_GPIO_16 ... AU1500_GPIO_28:
160 return ALCHEMY_GPIO1_BASE + (irq - AU1500_GPIO_16) + 16;
161 case AU1500_GPIO_206 ... AU1500_GPIO_208_218:
162 return ALCHEMY_GPIO2_BASE + (irq - AU1500_GPIO_206) + 6;
163 }
164
165 return -ENXIO;
166}
167#endif
168
169static inline int au1200_gpio1_to_irq(int gpio)
170{
171 return MAKE_IRQ(1, gpio - ALCHEMY_GPIO1_BASE);
172}
173
174static inline int au1200_gpio2_to_irq(int gpio)
175{
176 gpio -= ALCHEMY_GPIO2_BASE;
177
178 switch (gpio) {
179 case 0 ... 2: return MAKE_IRQ(0, 5 + gpio - 0);
180 case 3: return MAKE_IRQ(0, 22);
181 case 4 ... 7: return MAKE_IRQ(0, 24 + gpio - 4);
182 case 8 ... 15: return MAKE_IRQ(0, 28); /* shared GPIO208_215 */
183 }
184
185 return -ENXIO;
186}
187
188#ifdef CONFIG_SOC_AU1200
189static inline int au1200_irq_to_gpio(int irq)
190{
191 switch (irq) {
192 case AU1000_GPIO_0 ... AU1000_GPIO_31:
193 return ALCHEMY_GPIO1_BASE + (irq - AU1000_GPIO_0) + 0;
194 case AU1200_GPIO_200 ... AU1200_GPIO_202:
195 return ALCHEMY_GPIO2_BASE + (irq - AU1200_GPIO_200) + 0;
196 case AU1200_GPIO_203:
197 return ALCHEMY_GPIO2_BASE + 3;
198 case AU1200_GPIO_204 ... AU1200_GPIO_208_215:
199 return ALCHEMY_GPIO2_BASE + (irq - AU1200_GPIO_204) + 4;
200 }
201
202 return -ENXIO;
203}
204#endif
205
206/*
207 * GPIO1 block macros for common linux gpio functions.
208 */
209static inline void alchemy_gpio1_set_value(int gpio, int v)
210{
211 unsigned long mask = 1 << (gpio - ALCHEMY_GPIO1_BASE);
212 unsigned long r = v ? SYS_OUTPUTSET : SYS_OUTPUTCLR;
213 au_writel(mask, r);
214 au_sync();
215}
216
217static inline int alchemy_gpio1_get_value(int gpio)
218{
219 unsigned long mask = 1 << (gpio - ALCHEMY_GPIO1_BASE);
220 return au_readl(SYS_PINSTATERD) & mask;
221}
222
223static inline int alchemy_gpio1_direction_input(int gpio)
224{
225 unsigned long mask = 1 << (gpio - ALCHEMY_GPIO1_BASE);
226 au_writel(mask, SYS_TRIOUTCLR);
227 au_sync();
228 return 0;
229}
230
231static inline int alchemy_gpio1_direction_output(int gpio, int v)
232{
233 /* hardware switches to "output" mode when one of the two
234 * "set_value" registers is accessed.
235 */
236 alchemy_gpio1_set_value(gpio, v);
237 return 0;
238}
239
240static inline int alchemy_gpio1_is_valid(int gpio)
241{
242 return ((gpio >= ALCHEMY_GPIO1_BASE) && (gpio <= ALCHEMY_GPIO1_MAX));
243}
244
245static inline int alchemy_gpio1_to_irq(int gpio)
246{
247#if defined(CONFIG_SOC_AU1000)
248 return au1000_gpio1_to_irq(gpio);
249#elif defined(CONFIG_SOC_AU1100)
250 return au1100_gpio1_to_irq(gpio);
251#elif defined(CONFIG_SOC_AU1500)
252 return au1500_gpio1_to_irq(gpio);
253#elif defined(CONFIG_SOC_AU1550)
254 return au1550_gpio1_to_irq(gpio);
255#elif defined(CONFIG_SOC_AU1200)
256 return au1200_gpio1_to_irq(gpio);
257#else
258 return -ENXIO;
259#endif
260}
261
262/*
263 * GPIO2 block macros for common linux GPIO functions. The 'gpio'
264 * parameter must be in range of ALCHEMY_GPIO2_BASE..ALCHEMY_GPIO2_MAX.
265 */
266static inline void __alchemy_gpio2_mod_dir(int gpio, int to_out)
267{
268 unsigned long mask = 1 << (gpio - ALCHEMY_GPIO2_BASE);
269 unsigned long d = au_readl(GPIO2_DIR);
270 if (to_out)
271 d |= mask;
272 else
273 d &= ~mask;
274 au_writel(d, GPIO2_DIR);
275 au_sync();
276}
277
278static inline void alchemy_gpio2_set_value(int gpio, int v)
279{
280 unsigned long mask;
281 mask = ((v) ? 0x00010001 : 0x00010000) << (gpio - ALCHEMY_GPIO2_BASE);
282 au_writel(mask, GPIO2_OUTPUT);
283 au_sync();
284}
285
286static inline int alchemy_gpio2_get_value(int gpio)
287{
288 return au_readl(GPIO2_PINSTATE) & (1 << (gpio - ALCHEMY_GPIO2_BASE));
289}
290
291static inline int alchemy_gpio2_direction_input(int gpio)
292{
293 unsigned long flags;
294 local_irq_save(flags);
295 __alchemy_gpio2_mod_dir(gpio, 0);
296 local_irq_restore(flags);
297 return 0;
298}
299
300static inline int alchemy_gpio2_direction_output(int gpio, int v)
301{
302 unsigned long flags;
303 alchemy_gpio2_set_value(gpio, v);
304 local_irq_save(flags);
305 __alchemy_gpio2_mod_dir(gpio, 1);
306 local_irq_restore(flags);
307 return 0;
308}
309
310static inline int alchemy_gpio2_is_valid(int gpio)
311{
312 return ((gpio >= ALCHEMY_GPIO2_BASE) && (gpio <= ALCHEMY_GPIO2_MAX));
313}
314
315static inline int alchemy_gpio2_to_irq(int gpio)
316{
317#if defined(CONFIG_SOC_AU1000)
318 return au1000_gpio2_to_irq(gpio);
319#elif defined(CONFIG_SOC_AU1100)
320 return au1100_gpio2_to_irq(gpio);
321#elif defined(CONFIG_SOC_AU1500)
322 return au1500_gpio2_to_irq(gpio);
323#elif defined(CONFIG_SOC_AU1550)
324 return au1550_gpio2_to_irq(gpio);
325#elif defined(CONFIG_SOC_AU1200)
326 return au1200_gpio2_to_irq(gpio);
327#else
328 return -ENXIO;
329#endif
330}
331
332/**********************************************************************/
333
334/* On Au1000, Au1500 and Au1100 GPIOs won't work as inputs before
335 * SYS_PININPUTEN is written to at least once. On Au1550/Au1200 this
336 * register enables use of GPIOs as wake source.
337 */
338static inline void alchemy_gpio1_input_enable(void)
339{
340 au_writel(0, SYS_PININPUTEN); /* the write op is key */
341 au_sync();
342}
343
344/* GPIO2 shared interrupts and control */
345
346static inline void __alchemy_gpio2_mod_int(int gpio2, int en)
347{
348 unsigned long r = au_readl(GPIO2_INTENABLE);
349 if (en)
350 r |= 1 << gpio2;
351 else
352 r &= ~(1 << gpio2);
353 au_writel(r, GPIO2_INTENABLE);
354 au_sync();
355}
356
357/**
358 * alchemy_gpio2_enable_int - Enable a GPIO2 pins' shared irq contribution.
359 * @gpio2: The GPIO2 pin to activate (200...215).
360 *
361 * GPIO208-215 have one shared interrupt line to the INTC. They are
362 * and'ed with a per-pin enable bit and finally or'ed together to form
363 * a single irq request (useful for active-high sources).
364 * With this function, a pins' individual contribution to the int request
365 * can be enabled. As with all other GPIO-based interrupts, the INTC
366 * must be programmed to accept the GPIO208_215 interrupt as well.
367 *
368 * NOTE: Calling this macro is only necessary for GPIO208-215; all other
369 * GPIO2-based interrupts have their own request to the INTC. Please
370 * consult your Alchemy databook for more information!
371 *
372 * NOTE: On the Au1550, GPIOs 201-205 also have a shared interrupt request
373 * line to the INTC, GPIO201_205. This function can be used for those
374 * as well.
375 *
376 * NOTE: 'gpio2' parameter must be in range of the GPIO2 numberspace
377 * (200-215 by default). No sanity checks are made,
378 */
379static inline void alchemy_gpio2_enable_int(int gpio2)
380{
381 unsigned long flags;
382
383 gpio2 -= ALCHEMY_GPIO2_BASE;
384
385#if defined(CONFIG_SOC_AU1100) || defined(CONFIG_SOC_AU1500)
386 /* Au1100/Au1500 have GPIO208-215 enable bits at 0..7 */
387 gpio2 -= 8;
388#endif
389 local_irq_save(flags);
390 __alchemy_gpio2_mod_int(gpio2, 1);
391 local_irq_restore(flags);
392}
393
394/**
395 * alchemy_gpio2_disable_int - Disable a GPIO2 pins' shared irq contribution.
396 * @gpio2: The GPIO2 pin to activate (200...215).
397 *
398 * see function alchemy_gpio2_enable_int() for more information.
399 */
400static inline void alchemy_gpio2_disable_int(int gpio2)
401{
402 unsigned long flags;
403
404 gpio2 -= ALCHEMY_GPIO2_BASE;
405
406#if defined(CONFIG_SOC_AU1100) || defined(CONFIG_SOC_AU1500)
407 /* Au1100/Au1500 have GPIO208-215 enable bits at 0..7 */
408 gpio2 -= 8;
409#endif
410 local_irq_save(flags);
411 __alchemy_gpio2_mod_int(gpio2, 0);
412 local_irq_restore(flags);
413}
414
415/**
416 * alchemy_gpio2_enable - Activate GPIO2 block.
417 *
418 * The GPIO2 block must be enabled excplicitly to work. On systems
419 * where this isn't done by the bootloader, this macro can be used.
420 */
421static inline void alchemy_gpio2_enable(void)
422{
423 au_writel(3, GPIO2_ENABLE); /* reset, clock enabled */
424 au_sync();
425 au_writel(1, GPIO2_ENABLE); /* clock enabled */
426 au_sync();
427}
428
429/**
430 * alchemy_gpio2_disable - disable GPIO2 block.
431 *
432 * Disable and put GPIO2 block in low-power mode.
433 */
434static inline void alchemy_gpio2_disable(void)
435{
436 au_writel(2, GPIO2_ENABLE); /* reset, clock disabled */
437 au_sync();
438}
439
440/**********************************************************************/
441
442/* wrappers for on-chip gpios; can be used before gpio chips have been
443 * registered with gpiolib.
444 */
445static inline int alchemy_gpio_direction_input(int gpio)
446{
447 return (gpio >= ALCHEMY_GPIO2_BASE) ?
448 alchemy_gpio2_direction_input(gpio) :
449 alchemy_gpio1_direction_input(gpio);
450}
451
452static inline int alchemy_gpio_direction_output(int gpio, int v)
453{
454 return (gpio >= ALCHEMY_GPIO2_BASE) ?
455 alchemy_gpio2_direction_output(gpio, v) :
456 alchemy_gpio1_direction_output(gpio, v);
457}
458
459static inline int alchemy_gpio_get_value(int gpio)
460{
461 return (gpio >= ALCHEMY_GPIO2_BASE) ?
462 alchemy_gpio2_get_value(gpio) :
463 alchemy_gpio1_get_value(gpio);
464}
465
466static inline void alchemy_gpio_set_value(int gpio, int v)
467{
468 if (gpio >= ALCHEMY_GPIO2_BASE)
469 alchemy_gpio2_set_value(gpio, v);
470 else
471 alchemy_gpio1_set_value(gpio, v);
472}
473
474static inline int alchemy_gpio_is_valid(int gpio)
475{
476 return (gpio >= ALCHEMY_GPIO2_BASE) ?
477 alchemy_gpio2_is_valid(gpio) :
478 alchemy_gpio1_is_valid(gpio);
479}
480
481static inline int alchemy_gpio_cansleep(int gpio)
482{
483 return 0; /* Alchemy never gets tired */
484}
485
486static inline int alchemy_gpio_to_irq(int gpio)
487{
488 return (gpio >= ALCHEMY_GPIO2_BASE) ?
489 alchemy_gpio2_to_irq(gpio) :
490 alchemy_gpio1_to_irq(gpio);
491}
492
493static inline int alchemy_irq_to_gpio(int irq)
494{
495#if defined(CONFIG_SOC_AU1000)
496 return au1000_irq_to_gpio(irq);
497#elif defined(CONFIG_SOC_AU1100)
498 return au1100_irq_to_gpio(irq);
499#elif defined(CONFIG_SOC_AU1500)
500 return au1500_irq_to_gpio(irq);
501#elif defined(CONFIG_SOC_AU1550)
502 return au1550_irq_to_gpio(irq);
503#elif defined(CONFIG_SOC_AU1200)
504 return au1200_irq_to_gpio(irq);
505#else
506 return -ENXIO;
507#endif
508}
509
510/**********************************************************************/
511
512/* Linux gpio framework integration.
513 *
514 * 4 use cases of Au1000-Au1200 GPIOS:
515 *(1) GPIOLIB=y, ALCHEMY_GPIO_INDIRECT=y:
516 * Board must register gpiochips.
517 *(2) GPIOLIB=y, ALCHEMY_GPIO_INDIRECT=n:
518 * 2 (1 for Au1000) gpio_chips are registered.
519 *
520 *(3) GPIOLIB=n, ALCHEMY_GPIO_INDIRECT=y:
521 * the boards' gpio.h must provide the linux gpio wrapper functions,
522 *
523 *(4) GPIOLIB=n, ALCHEMY_GPIO_INDIRECT=n:
524 * inlinable gpio functions are provided which enable access to the
525 * Au1000 gpios only by using the numbers straight out of the data-
526 * sheets.
527
528 * Cases 1 and 3 are intended for boards which want to provide their own
529 * GPIO namespace and -operations (i.e. for example you have 8 GPIOs
530 * which are in part provided by spare Au1000 GPIO pins and in part by
531 * an external FPGA but you still want them to be accssible in linux
532 * as gpio0-7. The board can of course use the alchemy_gpioX_* functions
533 * as required).
534 */
535
536#ifndef CONFIG_GPIOLIB
537
538
539#ifndef CONFIG_ALCHEMY_GPIO_INDIRECT /* case (4) */
540
541static inline int gpio_direction_input(int gpio)
542{
543 return alchemy_gpio_direction_input(gpio);
544}
545
546static inline int gpio_direction_output(int gpio, int v)
547{
548 return alchemy_gpio_direction_output(gpio, v);
549}
550
551static inline int gpio_get_value(int gpio)
552{
553 return alchemy_gpio_get_value(gpio);
554}
555
556static inline void gpio_set_value(int gpio, int v)
557{
558 alchemy_gpio_set_value(gpio, v);
559}
560
561static inline int gpio_is_valid(int gpio)
562{
563 return alchemy_gpio_is_valid(gpio);
564}
565
566static inline int gpio_cansleep(int gpio)
567{
568 return alchemy_gpio_cansleep(gpio);
569}
570
571static inline int gpio_to_irq(int gpio)
572{
573 return alchemy_gpio_to_irq(gpio);
574}
575
576static inline int irq_to_gpio(int irq)
577{
578 return alchemy_irq_to_gpio(irq);
579}
580
581#endif /* !CONFIG_ALCHEMY_GPIO_INDIRECT */
582
583
584#else /* CONFIG GPIOLIB */
585
586
587 /* using gpiolib to provide up to 2 gpio_chips for on-chip gpios */
588#ifndef CONFIG_ALCHEMY_GPIO_INDIRECT /* case (2) */
589
590/* get everything through gpiolib */
591#define gpio_to_irq __gpio_to_irq
592#define gpio_get_value __gpio_get_value
593#define gpio_set_value __gpio_set_value
594#define gpio_cansleep __gpio_cansleep
595#define irq_to_gpio alchemy_irq_to_gpio
596
597#include <asm-generic/gpio.h>
598
599#endif /* !CONFIG_ALCHEMY_GPIO_INDIRECT */
600
601
602#endif /* !CONFIG_GPIOLIB */
603
604#endif /* _ALCHEMY_GPIO_AU1000_H_ */
diff --git a/arch/mips/include/asm/mach-au1x00/gpio.h b/arch/mips/include/asm/mach-au1x00/gpio.h
index 34d9b7279024..f9b7d41c659a 100644
--- a/arch/mips/include/asm/mach-au1x00/gpio.h
+++ b/arch/mips/include/asm/mach-au1x00/gpio.h
@@ -1,33 +1,10 @@
1#ifndef _AU1XXX_GPIO_H_ 1#ifndef _ALCHEMY_GPIO_H_
2#define _AU1XXX_GPIO_H_ 2#define _ALCHEMY_GPIO_H_
3 3
4#include <linux/types.h> 4#if defined(CONFIG_ALCHEMY_GPIO_AU1000)
5 5
6#define AU1XXX_GPIO_BASE 200 6#include <asm/mach-au1x00/gpio-au1000.h>
7 7
8/* GPIO bank 1 offsets */ 8#endif
9#define AU1000_GPIO1_TRI_OUT 0x0100
10#define AU1000_GPIO1_OUT 0x0108
11#define AU1000_GPIO1_ST 0x0110
12#define AU1000_GPIO1_CLR 0x010C
13 9
14/* GPIO bank 2 offsets */ 10#endif /* _ALCHEMY_GPIO_H_ */
15#define AU1000_GPIO2_DIR 0x00
16#define AU1000_GPIO2_RSVD 0x04
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
22#define GPIO2_OUT_EN_MASK 0x00010000
23
24#define gpio_to_irq(gpio) NULL
25
26#define gpio_get_value __gpio_get_value
27#define gpio_set_value __gpio_set_value
28
29#define gpio_cansleep __gpio_cansleep
30
31#include <asm-generic/gpio.h>
32
33#endif /* _AU1XXX_GPIO_H_ */
diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h b/arch/mips/include/asm/mach-bcm47xx/gpio.h
index 1784fde2e28f..98504142124e 100644
--- a/arch/mips/include/asm/mach-bcm47xx/gpio.h
+++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h
@@ -37,6 +37,9 @@ static inline int gpio_direction_input(unsigned gpio)
37 37
38static inline int gpio_direction_output(unsigned gpio, int value) 38static inline int gpio_direction_output(unsigned gpio, int value)
39{ 39{
40 /* first set the gpio out value */
41 ssb_gpio_out(&ssb_bcm47xx, 1 << gpio, value ? 1 << gpio : 0);
42 /* then set the gpio mode */
40 ssb_gpio_outen(&ssb_bcm47xx, 1 << gpio, 1 << gpio); 43 ssb_gpio_outen(&ssb_bcm47xx, 1 << gpio, 1 << gpio);
41 return 0; 44 return 0;
42} 45}
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
index 04ce6e6569da..3d830756b13a 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
@@ -47,11 +47,13 @@
47#define cpu_has_mips32r2 0 47#define cpu_has_mips32r2 0
48#define cpu_has_mips64r1 0 48#define cpu_has_mips64r1 0
49#define cpu_has_mips64r2 1 49#define cpu_has_mips64r2 1
50#define cpu_has_mips_r2_exec_hazard 0
50#define cpu_has_dsp 0 51#define cpu_has_dsp 0
51#define cpu_has_mipsmt 0 52#define cpu_has_mipsmt 0
52#define cpu_has_userlocal 0 53#define cpu_has_userlocal 0
53#define cpu_has_vint 0 54#define cpu_has_vint 0
54#define cpu_has_veic 0 55#define cpu_has_veic 0
56#define cpu_hwrena_impl_bits 0xc0000000
55#define ARCH_HAS_READ_CURRENT_TIMER 1 57#define ARCH_HAS_READ_CURRENT_TIMER 1
56#define ARCH_HAS_IRQ_PER_CPU 1 58#define ARCH_HAS_IRQ_PER_CPU 1
57#define ARCH_HAS_SPINLOCK_PREFETCH 1 59#define ARCH_HAS_SPINLOCK_PREFETCH 1
diff --git a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
index f30fce92aabb..17d579471ec4 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
@@ -30,12 +30,14 @@ static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
30 return octeon_map_dma_mem(dev, page_address(page), PAGE_SIZE); 30 return octeon_map_dma_mem(dev, page_address(page), PAGE_SIZE);
31} 31}
32 32
33static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 33static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
34 dma_addr_t dma_addr)
34{ 35{
35 return dma_addr; 36 return dma_addr;
36} 37}
37 38
38static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 39static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
40 size_t size, enum dma_data_direction direction)
39{ 41{
40 octeon_unmap_dma_mem(dev, dma_addr); 42 octeon_unmap_dma_mem(dev, dma_addr);
41} 43}
diff --git a/arch/mips/include/asm/mach-generic/dma-coherence.h b/arch/mips/include/asm/mach-generic/dma-coherence.h
index 36c611b6c597..8da98073e952 100644
--- a/arch/mips/include/asm/mach-generic/dma-coherence.h
+++ b/arch/mips/include/asm/mach-generic/dma-coherence.h
@@ -23,12 +23,14 @@ static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
23 return page_to_phys(page); 23 return page_to_phys(page);
24} 24}
25 25
26static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 26static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
27 dma_addr_t dma_addr)
27{ 28{
28 return dma_addr; 29 return dma_addr;
29} 30}
30 31
31static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 32static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
33 size_t size, enum dma_data_direction direction)
32{ 34{
33} 35}
34 36
diff --git a/arch/mips/include/asm/mach-ip27/dma-coherence.h b/arch/mips/include/asm/mach-ip27/dma-coherence.h
index 4c21bfca10c3..d3d04018a858 100644
--- a/arch/mips/include/asm/mach-ip27/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h
@@ -33,12 +33,14 @@ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
33 return pa; 33 return pa;
34} 34}
35 35
36static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 36static unsigned long plat_dma_addr_to_phys(struct device *dev,
37 dma_addr_t dma_addr)
37{ 38{
38 return dma_addr & ~(0xffUL << 56); 39 return dma_addr & ~(0xffUL << 56);
39} 40}
40 41
41static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 42static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
43 size_t size, enum dma_data_direction direction)
42{ 44{
43} 45}
44 46
diff --git a/arch/mips/include/asm/mach-ip32/dma-coherence.h b/arch/mips/include/asm/mach-ip32/dma-coherence.h
index 7ae40f4b1c80..37855955b313 100644
--- a/arch/mips/include/asm/mach-ip32/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h
@@ -50,7 +50,8 @@ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
50} 50}
51 51
52/* This is almost certainly wrong but it's what dma-ip32.c used to use */ 52/* This is almost certainly wrong but it's what dma-ip32.c used to use */
53static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 53static unsigned long plat_dma_addr_to_phys(struct device *dev,
54 dma_addr_t dma_addr)
54{ 55{
55 unsigned long addr = dma_addr & RAM_OFFSET_MASK; 56 unsigned long addr = dma_addr & RAM_OFFSET_MASK;
56 57
@@ -60,7 +61,8 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
60 return addr; 61 return addr;
61} 62}
62 63
63static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 64static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
65 size_t size, enum dma_data_direction direction)
64{ 66{
65} 67}
66 68
diff --git a/arch/mips/include/asm/mach-jazz/dma-coherence.h b/arch/mips/include/asm/mach-jazz/dma-coherence.h
index 1c7cd27efa7b..f93aee59454a 100644
--- a/arch/mips/include/asm/mach-jazz/dma-coherence.h
+++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h
@@ -22,12 +22,14 @@ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
22 return vdma_alloc(page_to_phys(page), PAGE_SIZE); 22 return vdma_alloc(page_to_phys(page), PAGE_SIZE);
23} 23}
24 24
25static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 25static unsigned long plat_dma_addr_to_phys(struct device *dev,
26 dma_addr_t dma_addr)
26{ 27{
27 return vdma_log2phys(dma_addr); 28 return vdma_log2phys(dma_addr);
28} 29}
29 30
30static void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 31static void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
32 size_t size, enum dma_data_direction direction)
31{ 33{
32 vdma_free(dma_addr); 34 vdma_free(dma_addr);
33} 35}
diff --git a/arch/mips/include/asm/mach-lemote/dma-coherence.h b/arch/mips/include/asm/mach-lemote/dma-coherence.h
index 38fad7dfe7da..c8de5e750777 100644
--- a/arch/mips/include/asm/mach-lemote/dma-coherence.h
+++ b/arch/mips/include/asm/mach-lemote/dma-coherence.h
@@ -25,12 +25,14 @@ static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
25 return page_to_phys(page) | 0x80000000; 25 return page_to_phys(page) | 0x80000000;
26} 26}
27 27
28static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) 28static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
29 dma_addr_t dma_addr)
29{ 30{
30 return dma_addr & 0x7fffffff; 31 return dma_addr & 0x7fffffff;
31} 32}
32 33
33static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr) 34static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
35 size_t size, enum dma_data_direction direction)
34{ 36{
35} 37}
36 38
diff --git a/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h b/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h
index f3bc7efa2608..c3e4d3a4c95d 100644
--- a/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-rc32434/cpu-feature-overrides.h
@@ -53,11 +53,6 @@
53#define cpu_has_smartmips 0 53#define cpu_has_smartmips 0
54 54
55#define cpu_has_vtag_icache 0 55#define cpu_has_vtag_icache 0
56/* #define cpu_has_dc_aliases ? */
57/* #define cpu_has_ic_fills_f_dc ? */
58/* #define cpu_has_pindexed_dcache ? */
59
60/* #define cpu_icache_snoops_remote_store ? */
61 56
62#define cpu_has_mips32r1 1 57#define cpu_has_mips32r1 1
63#define cpu_has_mips32r2 0 58#define cpu_has_mips32r2 0
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 32ef8bec5c85..a581d60cbcc2 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -220,6 +220,22 @@
220#error Bad page size configuration! 220#error Bad page size configuration!
221#endif 221#endif
222 222
223/*
224 * Default huge tlb size for a given kernel configuration
225 */
226#ifdef CONFIG_PAGE_SIZE_4KB
227#define PM_HUGE_MASK PM_1M
228#elif defined(CONFIG_PAGE_SIZE_8KB)
229#define PM_HUGE_MASK PM_4M
230#elif defined(CONFIG_PAGE_SIZE_16KB)
231#define PM_HUGE_MASK PM_16M
232#elif defined(CONFIG_PAGE_SIZE_32KB)
233#define PM_HUGE_MASK PM_64M
234#elif defined(CONFIG_PAGE_SIZE_64KB)
235#define PM_HUGE_MASK PM_256M
236#elif defined(CONFIG_HUGETLB_PAGE)
237#error Bad page size configuration for hugetlbfs!
238#endif
223 239
224/* 240/*
225 * Values used for computation of new tlb entries 241 * Values used for computation of new tlb entries
diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
index 692989acd8a9..f3c23a43f845 100644
--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h
+++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
@@ -157,6 +157,13 @@ enum cvmx_board_types_enum {
157 CVMX_BOARD_TYPE_NIC_XLE_4G = 21, 157 CVMX_BOARD_TYPE_NIC_XLE_4G = 21,
158 CVMX_BOARD_TYPE_EBT5600 = 22, 158 CVMX_BOARD_TYPE_EBT5600 = 22,
159 CVMX_BOARD_TYPE_EBH5201 = 23, 159 CVMX_BOARD_TYPE_EBH5201 = 23,
160 CVMX_BOARD_TYPE_EBT5200 = 24,
161 CVMX_BOARD_TYPE_CB5600 = 25,
162 CVMX_BOARD_TYPE_CB5601 = 26,
163 CVMX_BOARD_TYPE_CB5200 = 27,
164 /* Special 'generic' board type, supports many boards */
165 CVMX_BOARD_TYPE_GENERIC = 28,
166 CVMX_BOARD_TYPE_EBH5610 = 29,
160 CVMX_BOARD_TYPE_MAX, 167 CVMX_BOARD_TYPE_MAX,
161 168
162 /* 169 /*
@@ -228,6 +235,12 @@ static inline const char *cvmx_board_type_to_string(enum
228 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_4G) 235 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_4G)
229 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5600) 236 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5600)
230 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5201) 237 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5201)
238 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5200)
239 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5600)
240 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5601)
241 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CB5200)
242 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_GENERIC)
243 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5610)
231 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX) 244 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX)
232 245
233 /* Customer boards listed here */ 246 /* Customer boards listed here */
diff --git a/arch/mips/include/asm/octeon/cvmx-bootmem.h b/arch/mips/include/asm/octeon/cvmx-bootmem.h
index 1cbe4b55889d..8e708bdb43f7 100644
--- a/arch/mips/include/asm/octeon/cvmx-bootmem.h
+++ b/arch/mips/include/asm/octeon/cvmx-bootmem.h
@@ -183,6 +183,64 @@ extern void *cvmx_bootmem_alloc_range(uint64_t size, uint64_t alignment,
183 * Returns 0 on failure, 183 * Returns 0 on failure,
184 * !0 on success 184 * !0 on success
185 */ 185 */
186
187
188/**
189 * Allocate a block of memory from the free list that was passed
190 * to the application by the bootloader, and assign it a name in the
191 * global named block table. (part of the cvmx_bootmem_descriptor_t structure)
192 * Named blocks can later be freed.
193 *
194 * @size: Size in bytes of block to allocate
195 * @alignment: Alignment required - must be power of 2
196 * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN bytes
197 *
198 * Returns a pointer to block of memory, NULL on error
199 */
200extern void *cvmx_bootmem_alloc_named(uint64_t size, uint64_t alignment,
201 char *name);
202
203
204
205/**
206 * Allocate a block of memory from the free list that was passed
207 * to the application by the bootloader, and assign it a name in the
208 * global named block table. (part of the cvmx_bootmem_descriptor_t structure)
209 * Named blocks can later be freed.
210 *
211 * @size: Size in bytes of block to allocate
212 * @address: Physical address to allocate memory at. If this
213 * memory is not available, the allocation fails.
214 * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN
215 * bytes
216 *
217 * Returns a pointer to block of memory, NULL on error
218 */
219extern void *cvmx_bootmem_alloc_named_address(uint64_t size, uint64_t address,
220 char *name);
221
222
223
224/**
225 * Allocate a block of memory from a specific range of the free list
226 * that was passed to the application by the bootloader, and assign it
227 * a name in the global named block table. (part of the
228 * cvmx_bootmem_descriptor_t structure) Named blocks can later be
229 * freed. If request cannot be satisfied within the address range
230 * specified, NULL is returned
231 *
232 * @size: Size in bytes of block to allocate
233 * @min_addr: minimum address of range
234 * @max_addr: maximum address of range
235 * @align: Alignment of memory to be allocated. (must be a power of 2)
236 * @name: name of block - must be less than CVMX_BOOTMEM_NAME_LEN bytes
237 *
238 * Returns a pointer to block of memory, NULL on error
239 */
240extern void *cvmx_bootmem_alloc_named_range(uint64_t size, uint64_t min_addr,
241 uint64_t max_addr, uint64_t align,
242 char *name);
243
186extern int cvmx_bootmem_free_named(char *name); 244extern int cvmx_bootmem_free_named(char *name);
187 245
188/** 246/**
@@ -224,6 +282,33 @@ int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min,
224 uint32_t flags); 282 uint32_t flags);
225 283
226/** 284/**
285 * Allocates a named block of physical memory from the free list, at
286 * (optional) requested address and alignment.
287 *
288 * @param size size of region to allocate. All requests are rounded
289 * up to be a multiple CVMX_BOOTMEM_ALIGNMENT_SIZE
290 * bytes size
291 * @param min_addr Minimum address that block can occupy.
292 * @param max_addr Specifies the maximum address_min (inclusive) that
293 * the allocation can use.
294 * @param alignment Requested alignment of the block. If this
295 * alignment cannot be met, the allocation fails.
296 * This must be a power of 2. (Note: Alignment of
297 * CVMX_BOOTMEM_ALIGNMENT_SIZE bytes is required, and
298 * internally enforced. Requested alignments of less
299 * than CVMX_BOOTMEM_ALIGNMENT_SIZE are set to
300 * CVMX_BOOTMEM_ALIGNMENT_SIZE.)
301 * @param name name to assign to named block
302 * @param flags Flags to control options for the allocation.
303 *
304 * @return physical address of block allocated, or -1 on failure
305 */
306int64_t cvmx_bootmem_phy_named_block_alloc(uint64_t size, uint64_t min_addr,
307 uint64_t max_addr,
308 uint64_t alignment,
309 char *name, uint32_t flags);
310
311/**
227 * Finds a named memory block by name. 312 * Finds a named memory block by name.
228 * Also used for finding an unused entry in the named block table. 313 * Also used for finding an unused entry in the named block table.
229 * 314 *
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-errata.h b/arch/mips/include/asm/octeon/cvmx-helper-errata.h
new file mode 100644
index 000000000000..5fc99189ff58
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-helper-errata.h
@@ -0,0 +1,33 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_HELPER_ERRATA_H__
29#define __CVMX_HELPER_ERRATA_H__
30
31extern void __cvmx_helper_errata_qlm_disable_2nd_order_cdr(int qlm);
32
33#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-helper-jtag.h b/arch/mips/include/asm/octeon/cvmx-helper-jtag.h
new file mode 100644
index 000000000000..29f016ddb895
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-helper-jtag.h
@@ -0,0 +1,43 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/**
29 * @file
30 *
31 * Helper utilities for qlm_jtag.
32 *
33 */
34
35#ifndef __CVMX_HELPER_JTAG_H__
36#define __CVMX_HELPER_JTAG_H__
37
38extern void cvmx_helper_qlm_jtag_init(void);
39extern uint32_t cvmx_helper_qlm_jtag_shift(int qlm, int bits, uint32_t data);
40extern void cvmx_helper_qlm_jtag_shift_zeros(int qlm, int bits);
41extern void cvmx_helper_qlm_jtag_update(int qlm);
42
43#endif /* __CVMX_HELPER_JTAG_H__ */
diff --git a/arch/mips/include/asm/octeon/cvmx-npei-defs.h b/arch/mips/include/asm/octeon/cvmx-npei-defs.h
new file mode 100644
index 000000000000..4b347bb8ce80
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-npei-defs.h
@@ -0,0 +1,2560 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_NPEI_DEFS_H__
29#define __CVMX_NPEI_DEFS_H__
30
31#define CVMX_NPEI_BAR1_INDEXX(offset) \
32 (0x0000000000000000ull + (((offset) & 31) * 16))
33#define CVMX_NPEI_BIST_STATUS \
34 (0x0000000000000580ull)
35#define CVMX_NPEI_BIST_STATUS2 \
36 (0x0000000000000680ull)
37#define CVMX_NPEI_CTL_PORT0 \
38 (0x0000000000000250ull)
39#define CVMX_NPEI_CTL_PORT1 \
40 (0x0000000000000260ull)
41#define CVMX_NPEI_CTL_STATUS \
42 (0x0000000000000570ull)
43#define CVMX_NPEI_CTL_STATUS2 \
44 (0x0000000000003C00ull)
45#define CVMX_NPEI_DATA_OUT_CNT \
46 (0x00000000000005F0ull)
47#define CVMX_NPEI_DBG_DATA \
48 (0x0000000000000510ull)
49#define CVMX_NPEI_DBG_SELECT \
50 (0x0000000000000500ull)
51#define CVMX_NPEI_DMA0_INT_LEVEL \
52 (0x00000000000005C0ull)
53#define CVMX_NPEI_DMA1_INT_LEVEL \
54 (0x00000000000005D0ull)
55#define CVMX_NPEI_DMAX_COUNTS(offset) \
56 (0x0000000000000450ull + (((offset) & 7) * 16))
57#define CVMX_NPEI_DMAX_DBELL(offset) \
58 (0x00000000000003B0ull + (((offset) & 7) * 16))
59#define CVMX_NPEI_DMAX_IBUFF_SADDR(offset) \
60 (0x0000000000000400ull + (((offset) & 7) * 16))
61#define CVMX_NPEI_DMAX_NADDR(offset) \
62 (0x00000000000004A0ull + (((offset) & 7) * 16))
63#define CVMX_NPEI_DMA_CNTS \
64 (0x00000000000005E0ull)
65#define CVMX_NPEI_DMA_CONTROL \
66 (0x00000000000003A0ull)
67#define CVMX_NPEI_INT_A_ENB \
68 (0x0000000000000560ull)
69#define CVMX_NPEI_INT_A_ENB2 \
70 (0x0000000000003CE0ull)
71#define CVMX_NPEI_INT_A_SUM \
72 (0x0000000000000550ull)
73#define CVMX_NPEI_INT_ENB \
74 (0x0000000000000540ull)
75#define CVMX_NPEI_INT_ENB2 \
76 (0x0000000000003CD0ull)
77#define CVMX_NPEI_INT_INFO \
78 (0x0000000000000590ull)
79#define CVMX_NPEI_INT_SUM \
80 (0x0000000000000530ull)
81#define CVMX_NPEI_INT_SUM2 \
82 (0x0000000000003CC0ull)
83#define CVMX_NPEI_LAST_WIN_RDATA0 \
84 (0x0000000000000600ull)
85#define CVMX_NPEI_LAST_WIN_RDATA1 \
86 (0x0000000000000610ull)
87#define CVMX_NPEI_MEM_ACCESS_CTL \
88 (0x00000000000004F0ull)
89#define CVMX_NPEI_MEM_ACCESS_SUBIDX(offset) \
90 (0x0000000000000340ull + (((offset) & 31) * 16) - 16 * 12)
91#define CVMX_NPEI_MSI_ENB0 \
92 (0x0000000000003C50ull)
93#define CVMX_NPEI_MSI_ENB1 \
94 (0x0000000000003C60ull)
95#define CVMX_NPEI_MSI_ENB2 \
96 (0x0000000000003C70ull)
97#define CVMX_NPEI_MSI_ENB3 \
98 (0x0000000000003C80ull)
99#define CVMX_NPEI_MSI_RCV0 \
100 (0x0000000000003C10ull)
101#define CVMX_NPEI_MSI_RCV1 \
102 (0x0000000000003C20ull)
103#define CVMX_NPEI_MSI_RCV2 \
104 (0x0000000000003C30ull)
105#define CVMX_NPEI_MSI_RCV3 \
106 (0x0000000000003C40ull)
107#define CVMX_NPEI_MSI_RD_MAP \
108 (0x0000000000003CA0ull)
109#define CVMX_NPEI_MSI_W1C_ENB0 \
110 (0x0000000000003CF0ull)
111#define CVMX_NPEI_MSI_W1C_ENB1 \
112 (0x0000000000003D00ull)
113#define CVMX_NPEI_MSI_W1C_ENB2 \
114 (0x0000000000003D10ull)
115#define CVMX_NPEI_MSI_W1C_ENB3 \
116 (0x0000000000003D20ull)
117#define CVMX_NPEI_MSI_W1S_ENB0 \
118 (0x0000000000003D30ull)
119#define CVMX_NPEI_MSI_W1S_ENB1 \
120 (0x0000000000003D40ull)
121#define CVMX_NPEI_MSI_W1S_ENB2 \
122 (0x0000000000003D50ull)
123#define CVMX_NPEI_MSI_W1S_ENB3 \
124 (0x0000000000003D60ull)
125#define CVMX_NPEI_MSI_WR_MAP \
126 (0x0000000000003C90ull)
127#define CVMX_NPEI_PCIE_CREDIT_CNT \
128 (0x0000000000003D70ull)
129#define CVMX_NPEI_PCIE_MSI_RCV \
130 (0x0000000000003CB0ull)
131#define CVMX_NPEI_PCIE_MSI_RCV_B1 \
132 (0x0000000000000650ull)
133#define CVMX_NPEI_PCIE_MSI_RCV_B2 \
134 (0x0000000000000660ull)
135#define CVMX_NPEI_PCIE_MSI_RCV_B3 \
136 (0x0000000000000670ull)
137#define CVMX_NPEI_PKTX_CNTS(offset) \
138 (0x0000000000002400ull + (((offset) & 31) * 16))
139#define CVMX_NPEI_PKTX_INSTR_BADDR(offset) \
140 (0x0000000000002800ull + (((offset) & 31) * 16))
141#define CVMX_NPEI_PKTX_INSTR_BAOFF_DBELL(offset) \
142 (0x0000000000002C00ull + (((offset) & 31) * 16))
143#define CVMX_NPEI_PKTX_INSTR_FIFO_RSIZE(offset) \
144 (0x0000000000003000ull + (((offset) & 31) * 16))
145#define CVMX_NPEI_PKTX_INSTR_HEADER(offset) \
146 (0x0000000000003400ull + (((offset) & 31) * 16))
147#define CVMX_NPEI_PKTX_IN_BP(offset) \
148 (0x0000000000003800ull + (((offset) & 31) * 16))
149#define CVMX_NPEI_PKTX_SLIST_BADDR(offset) \
150 (0x0000000000001400ull + (((offset) & 31) * 16))
151#define CVMX_NPEI_PKTX_SLIST_BAOFF_DBELL(offset) \
152 (0x0000000000001800ull + (((offset) & 31) * 16))
153#define CVMX_NPEI_PKTX_SLIST_FIFO_RSIZE(offset) \
154 (0x0000000000001C00ull + (((offset) & 31) * 16))
155#define CVMX_NPEI_PKT_CNT_INT \
156 (0x0000000000001110ull)
157#define CVMX_NPEI_PKT_CNT_INT_ENB \
158 (0x0000000000001130ull)
159#define CVMX_NPEI_PKT_DATA_OUT_ES \
160 (0x00000000000010B0ull)
161#define CVMX_NPEI_PKT_DATA_OUT_NS \
162 (0x00000000000010A0ull)
163#define CVMX_NPEI_PKT_DATA_OUT_ROR \
164 (0x0000000000001090ull)
165#define CVMX_NPEI_PKT_DPADDR \
166 (0x0000000000001080ull)
167#define CVMX_NPEI_PKT_INPUT_CONTROL \
168 (0x0000000000001150ull)
169#define CVMX_NPEI_PKT_INSTR_ENB \
170 (0x0000000000001000ull)
171#define CVMX_NPEI_PKT_INSTR_RD_SIZE \
172 (0x0000000000001190ull)
173#define CVMX_NPEI_PKT_INSTR_SIZE \
174 (0x0000000000001020ull)
175#define CVMX_NPEI_PKT_INT_LEVELS \
176 (0x0000000000001100ull)
177#define CVMX_NPEI_PKT_IN_BP \
178 (0x00000000000006B0ull)
179#define CVMX_NPEI_PKT_IN_DONEX_CNTS(offset) \
180 (0x0000000000002000ull + (((offset) & 31) * 16))
181#define CVMX_NPEI_PKT_IN_INSTR_COUNTS \
182 (0x00000000000006A0ull)
183#define CVMX_NPEI_PKT_IN_PCIE_PORT \
184 (0x00000000000011A0ull)
185#define CVMX_NPEI_PKT_IPTR \
186 (0x0000000000001070ull)
187#define CVMX_NPEI_PKT_OUTPUT_WMARK \
188 (0x0000000000001160ull)
189#define CVMX_NPEI_PKT_OUT_BMODE \
190 (0x00000000000010D0ull)
191#define CVMX_NPEI_PKT_OUT_ENB \
192 (0x0000000000001010ull)
193#define CVMX_NPEI_PKT_PCIE_PORT \
194 (0x00000000000010E0ull)
195#define CVMX_NPEI_PKT_PORT_IN_RST \
196 (0x0000000000000690ull)
197#define CVMX_NPEI_PKT_SLIST_ES \
198 (0x0000000000001050ull)
199#define CVMX_NPEI_PKT_SLIST_ID_SIZE \
200 (0x0000000000001180ull)
201#define CVMX_NPEI_PKT_SLIST_NS \
202 (0x0000000000001040ull)
203#define CVMX_NPEI_PKT_SLIST_ROR \
204 (0x0000000000001030ull)
205#define CVMX_NPEI_PKT_TIME_INT \
206 (0x0000000000001120ull)
207#define CVMX_NPEI_PKT_TIME_INT_ENB \
208 (0x0000000000001140ull)
209#define CVMX_NPEI_RSL_INT_BLOCKS \
210 (0x0000000000000520ull)
211#define CVMX_NPEI_SCRATCH_1 \
212 (0x0000000000000270ull)
213#define CVMX_NPEI_STATE1 \
214 (0x0000000000000620ull)
215#define CVMX_NPEI_STATE2 \
216 (0x0000000000000630ull)
217#define CVMX_NPEI_STATE3 \
218 (0x0000000000000640ull)
219#define CVMX_NPEI_WINDOW_CTL \
220 (0x0000000000000380ull)
221#define CVMX_NPEI_WIN_RD_ADDR \
222 (0x0000000000000210ull)
223#define CVMX_NPEI_WIN_RD_DATA \
224 (0x0000000000000240ull)
225#define CVMX_NPEI_WIN_WR_ADDR \
226 (0x0000000000000200ull)
227#define CVMX_NPEI_WIN_WR_DATA \
228 (0x0000000000000220ull)
229#define CVMX_NPEI_WIN_WR_MASK \
230 (0x0000000000000230ull)
231
232union cvmx_npei_bar1_indexx {
233 uint32_t u32;
234 struct cvmx_npei_bar1_indexx_s {
235 uint32_t reserved_18_31:14;
236 uint32_t addr_idx:14;
237 uint32_t ca:1;
238 uint32_t end_swp:2;
239 uint32_t addr_v:1;
240 } s;
241 struct cvmx_npei_bar1_indexx_s cn52xx;
242 struct cvmx_npei_bar1_indexx_s cn52xxp1;
243 struct cvmx_npei_bar1_indexx_s cn56xx;
244 struct cvmx_npei_bar1_indexx_s cn56xxp1;
245};
246
247union cvmx_npei_bist_status {
248 uint64_t u64;
249 struct cvmx_npei_bist_status_s {
250 uint64_t pkt_rdf:1;
251 uint64_t pkt_pmem:1;
252 uint64_t pkt_p1:1;
253 uint64_t reserved_60_60:1;
254 uint64_t pcr_gim:1;
255 uint64_t pkt_pif:1;
256 uint64_t pcsr_int:1;
257 uint64_t pcsr_im:1;
258 uint64_t pcsr_cnt:1;
259 uint64_t pcsr_id:1;
260 uint64_t pcsr_sl:1;
261 uint64_t reserved_50_52:3;
262 uint64_t pkt_ind:1;
263 uint64_t pkt_slm:1;
264 uint64_t reserved_36_47:12;
265 uint64_t d0_pst:1;
266 uint64_t d1_pst:1;
267 uint64_t d2_pst:1;
268 uint64_t d3_pst:1;
269 uint64_t reserved_31_31:1;
270 uint64_t n2p0_c:1;
271 uint64_t n2p0_o:1;
272 uint64_t n2p1_c:1;
273 uint64_t n2p1_o:1;
274 uint64_t cpl_p0:1;
275 uint64_t cpl_p1:1;
276 uint64_t p2n1_po:1;
277 uint64_t p2n1_no:1;
278 uint64_t p2n1_co:1;
279 uint64_t p2n0_po:1;
280 uint64_t p2n0_no:1;
281 uint64_t p2n0_co:1;
282 uint64_t p2n0_c0:1;
283 uint64_t p2n0_c1:1;
284 uint64_t p2n0_n:1;
285 uint64_t p2n0_p0:1;
286 uint64_t p2n0_p1:1;
287 uint64_t p2n1_c0:1;
288 uint64_t p2n1_c1:1;
289 uint64_t p2n1_n:1;
290 uint64_t p2n1_p0:1;
291 uint64_t p2n1_p1:1;
292 uint64_t csm0:1;
293 uint64_t csm1:1;
294 uint64_t dif0:1;
295 uint64_t dif1:1;
296 uint64_t dif2:1;
297 uint64_t dif3:1;
298 uint64_t reserved_2_2:1;
299 uint64_t msi:1;
300 uint64_t ncb_cmd:1;
301 } s;
302 struct cvmx_npei_bist_status_cn52xx {
303 uint64_t pkt_rdf:1;
304 uint64_t pkt_pmem:1;
305 uint64_t pkt_p1:1;
306 uint64_t reserved_60_60:1;
307 uint64_t pcr_gim:1;
308 uint64_t pkt_pif:1;
309 uint64_t pcsr_int:1;
310 uint64_t pcsr_im:1;
311 uint64_t pcsr_cnt:1;
312 uint64_t pcsr_id:1;
313 uint64_t pcsr_sl:1;
314 uint64_t pkt_imem:1;
315 uint64_t pkt_pfm:1;
316 uint64_t pkt_pof:1;
317 uint64_t reserved_48_49:2;
318 uint64_t pkt_pop0:1;
319 uint64_t pkt_pop1:1;
320 uint64_t d0_mem:1;
321 uint64_t d1_mem:1;
322 uint64_t d2_mem:1;
323 uint64_t d3_mem:1;
324 uint64_t d4_mem:1;
325 uint64_t ds_mem:1;
326 uint64_t reserved_36_39:4;
327 uint64_t d0_pst:1;
328 uint64_t d1_pst:1;
329 uint64_t d2_pst:1;
330 uint64_t d3_pst:1;
331 uint64_t d4_pst:1;
332 uint64_t n2p0_c:1;
333 uint64_t n2p0_o:1;
334 uint64_t n2p1_c:1;
335 uint64_t n2p1_o:1;
336 uint64_t cpl_p0:1;
337 uint64_t cpl_p1:1;
338 uint64_t p2n1_po:1;
339 uint64_t p2n1_no:1;
340 uint64_t p2n1_co:1;
341 uint64_t p2n0_po:1;
342 uint64_t p2n0_no:1;
343 uint64_t p2n0_co:1;
344 uint64_t p2n0_c0:1;
345 uint64_t p2n0_c1:1;
346 uint64_t p2n0_n:1;
347 uint64_t p2n0_p0:1;
348 uint64_t p2n0_p1:1;
349 uint64_t p2n1_c0:1;
350 uint64_t p2n1_c1:1;
351 uint64_t p2n1_n:1;
352 uint64_t p2n1_p0:1;
353 uint64_t p2n1_p1:1;
354 uint64_t csm0:1;
355 uint64_t csm1:1;
356 uint64_t dif0:1;
357 uint64_t dif1:1;
358 uint64_t dif2:1;
359 uint64_t dif3:1;
360 uint64_t dif4:1;
361 uint64_t msi:1;
362 uint64_t ncb_cmd:1;
363 } cn52xx;
364 struct cvmx_npei_bist_status_cn52xxp1 {
365 uint64_t reserved_46_63:18;
366 uint64_t d0_mem0:1;
367 uint64_t d1_mem1:1;
368 uint64_t d2_mem2:1;
369 uint64_t d3_mem3:1;
370 uint64_t dr0_mem:1;
371 uint64_t d0_mem:1;
372 uint64_t d1_mem:1;
373 uint64_t d2_mem:1;
374 uint64_t d3_mem:1;
375 uint64_t dr1_mem:1;
376 uint64_t d0_pst:1;
377 uint64_t d1_pst:1;
378 uint64_t d2_pst:1;
379 uint64_t d3_pst:1;
380 uint64_t dr2_mem:1;
381 uint64_t n2p0_c:1;
382 uint64_t n2p0_o:1;
383 uint64_t n2p1_c:1;
384 uint64_t n2p1_o:1;
385 uint64_t cpl_p0:1;
386 uint64_t cpl_p1:1;
387 uint64_t p2n1_po:1;
388 uint64_t p2n1_no:1;
389 uint64_t p2n1_co:1;
390 uint64_t p2n0_po:1;
391 uint64_t p2n0_no:1;
392 uint64_t p2n0_co:1;
393 uint64_t p2n0_c0:1;
394 uint64_t p2n0_c1:1;
395 uint64_t p2n0_n:1;
396 uint64_t p2n0_p0:1;
397 uint64_t p2n0_p1:1;
398 uint64_t p2n1_c0:1;
399 uint64_t p2n1_c1:1;
400 uint64_t p2n1_n:1;
401 uint64_t p2n1_p0:1;
402 uint64_t p2n1_p1:1;
403 uint64_t csm0:1;
404 uint64_t csm1:1;
405 uint64_t dif0:1;
406 uint64_t dif1:1;
407 uint64_t dif2:1;
408 uint64_t dif3:1;
409 uint64_t dr3_mem:1;
410 uint64_t msi:1;
411 uint64_t ncb_cmd:1;
412 } cn52xxp1;
413 struct cvmx_npei_bist_status_cn56xx {
414 uint64_t pkt_rdf:1;
415 uint64_t reserved_60_62:3;
416 uint64_t pcr_gim:1;
417 uint64_t pkt_pif:1;
418 uint64_t pcsr_int:1;
419 uint64_t pcsr_im:1;
420 uint64_t pcsr_cnt:1;
421 uint64_t pcsr_id:1;
422 uint64_t pcsr_sl:1;
423 uint64_t pkt_imem:1;
424 uint64_t pkt_pfm:1;
425 uint64_t pkt_pof:1;
426 uint64_t reserved_48_49:2;
427 uint64_t pkt_pop0:1;
428 uint64_t pkt_pop1:1;
429 uint64_t d0_mem:1;
430 uint64_t d1_mem:1;
431 uint64_t d2_mem:1;
432 uint64_t d3_mem:1;
433 uint64_t d4_mem:1;
434 uint64_t ds_mem:1;
435 uint64_t reserved_36_39:4;
436 uint64_t d0_pst:1;
437 uint64_t d1_pst:1;
438 uint64_t d2_pst:1;
439 uint64_t d3_pst:1;
440 uint64_t d4_pst:1;
441 uint64_t n2p0_c:1;
442 uint64_t n2p0_o:1;
443 uint64_t n2p1_c:1;
444 uint64_t n2p1_o:1;
445 uint64_t cpl_p0:1;
446 uint64_t cpl_p1:1;
447 uint64_t p2n1_po:1;
448 uint64_t p2n1_no:1;
449 uint64_t p2n1_co:1;
450 uint64_t p2n0_po:1;
451 uint64_t p2n0_no:1;
452 uint64_t p2n0_co:1;
453 uint64_t p2n0_c0:1;
454 uint64_t p2n0_c1:1;
455 uint64_t p2n0_n:1;
456 uint64_t p2n0_p0:1;
457 uint64_t p2n0_p1:1;
458 uint64_t p2n1_c0:1;
459 uint64_t p2n1_c1:1;
460 uint64_t p2n1_n:1;
461 uint64_t p2n1_p0:1;
462 uint64_t p2n1_p1:1;
463 uint64_t csm0:1;
464 uint64_t csm1:1;
465 uint64_t dif0:1;
466 uint64_t dif1:1;
467 uint64_t dif2:1;
468 uint64_t dif3:1;
469 uint64_t dif4:1;
470 uint64_t msi:1;
471 uint64_t ncb_cmd:1;
472 } cn56xx;
473 struct cvmx_npei_bist_status_cn56xxp1 {
474 uint64_t reserved_58_63:6;
475 uint64_t pcsr_int:1;
476 uint64_t pcsr_im:1;
477 uint64_t pcsr_cnt:1;
478 uint64_t pcsr_id:1;
479 uint64_t pcsr_sl:1;
480 uint64_t pkt_pout:1;
481 uint64_t pkt_imem:1;
482 uint64_t pkt_cntm:1;
483 uint64_t pkt_ind:1;
484 uint64_t pkt_slm:1;
485 uint64_t pkt_odf:1;
486 uint64_t pkt_oif:1;
487 uint64_t pkt_out:1;
488 uint64_t pkt_i0:1;
489 uint64_t pkt_i1:1;
490 uint64_t pkt_s0:1;
491 uint64_t pkt_s1:1;
492 uint64_t d0_mem:1;
493 uint64_t d1_mem:1;
494 uint64_t d2_mem:1;
495 uint64_t d3_mem:1;
496 uint64_t d4_mem:1;
497 uint64_t d0_pst:1;
498 uint64_t d1_pst:1;
499 uint64_t d2_pst:1;
500 uint64_t d3_pst:1;
501 uint64_t d4_pst:1;
502 uint64_t n2p0_c:1;
503 uint64_t n2p0_o:1;
504 uint64_t n2p1_c:1;
505 uint64_t n2p1_o:1;
506 uint64_t cpl_p0:1;
507 uint64_t cpl_p1:1;
508 uint64_t p2n1_po:1;
509 uint64_t p2n1_no:1;
510 uint64_t p2n1_co:1;
511 uint64_t p2n0_po:1;
512 uint64_t p2n0_no:1;
513 uint64_t p2n0_co:1;
514 uint64_t p2n0_c0:1;
515 uint64_t p2n0_c1:1;
516 uint64_t p2n0_n:1;
517 uint64_t p2n0_p0:1;
518 uint64_t p2n0_p1:1;
519 uint64_t p2n1_c0:1;
520 uint64_t p2n1_c1:1;
521 uint64_t p2n1_n:1;
522 uint64_t p2n1_p0:1;
523 uint64_t p2n1_p1:1;
524 uint64_t csm0:1;
525 uint64_t csm1:1;
526 uint64_t dif0:1;
527 uint64_t dif1:1;
528 uint64_t dif2:1;
529 uint64_t dif3:1;
530 uint64_t dif4:1;
531 uint64_t msi:1;
532 uint64_t ncb_cmd:1;
533 } cn56xxp1;
534};
535
536union cvmx_npei_bist_status2 {
537 uint64_t u64;
538 struct cvmx_npei_bist_status2_s {
539 uint64_t reserved_5_63:59;
540 uint64_t psc_p0:1;
541 uint64_t psc_p1:1;
542 uint64_t pkt_gd:1;
543 uint64_t pkt_gl:1;
544 uint64_t pkt_blk:1;
545 } s;
546 struct cvmx_npei_bist_status2_s cn52xx;
547 struct cvmx_npei_bist_status2_s cn56xx;
548};
549
550union cvmx_npei_ctl_port0 {
551 uint64_t u64;
552 struct cvmx_npei_ctl_port0_s {
553 uint64_t reserved_21_63:43;
554 uint64_t waitl_com:1;
555 uint64_t intd:1;
556 uint64_t intc:1;
557 uint64_t intb:1;
558 uint64_t inta:1;
559 uint64_t intd_map:2;
560 uint64_t intc_map:2;
561 uint64_t intb_map:2;
562 uint64_t inta_map:2;
563 uint64_t ctlp_ro:1;
564 uint64_t reserved_6_6:1;
565 uint64_t ptlp_ro:1;
566 uint64_t bar2_enb:1;
567 uint64_t bar2_esx:2;
568 uint64_t bar2_cax:1;
569 uint64_t wait_com:1;
570 } s;
571 struct cvmx_npei_ctl_port0_s cn52xx;
572 struct cvmx_npei_ctl_port0_s cn52xxp1;
573 struct cvmx_npei_ctl_port0_s cn56xx;
574 struct cvmx_npei_ctl_port0_s cn56xxp1;
575};
576
577union cvmx_npei_ctl_port1 {
578 uint64_t u64;
579 struct cvmx_npei_ctl_port1_s {
580 uint64_t reserved_21_63:43;
581 uint64_t waitl_com:1;
582 uint64_t intd:1;
583 uint64_t intc:1;
584 uint64_t intb:1;
585 uint64_t inta:1;
586 uint64_t intd_map:2;
587 uint64_t intc_map:2;
588 uint64_t intb_map:2;
589 uint64_t inta_map:2;
590 uint64_t ctlp_ro:1;
591 uint64_t reserved_6_6:1;
592 uint64_t ptlp_ro:1;
593 uint64_t bar2_enb:1;
594 uint64_t bar2_esx:2;
595 uint64_t bar2_cax:1;
596 uint64_t wait_com:1;
597 } s;
598 struct cvmx_npei_ctl_port1_s cn52xx;
599 struct cvmx_npei_ctl_port1_s cn52xxp1;
600 struct cvmx_npei_ctl_port1_s cn56xx;
601 struct cvmx_npei_ctl_port1_s cn56xxp1;
602};
603
604union cvmx_npei_ctl_status {
605 uint64_t u64;
606 struct cvmx_npei_ctl_status_s {
607 uint64_t reserved_44_63:20;
608 uint64_t p1_ntags:6;
609 uint64_t p0_ntags:6;
610 uint64_t cfg_rtry:16;
611 uint64_t ring_en:1;
612 uint64_t lnk_rst:1;
613 uint64_t arb:1;
614 uint64_t pkt_bp:4;
615 uint64_t host_mode:1;
616 uint64_t chip_rev:8;
617 } s;
618 struct cvmx_npei_ctl_status_s cn52xx;
619 struct cvmx_npei_ctl_status_cn52xxp1 {
620 uint64_t reserved_44_63:20;
621 uint64_t p1_ntags:6;
622 uint64_t p0_ntags:6;
623 uint64_t cfg_rtry:16;
624 uint64_t reserved_15_15:1;
625 uint64_t lnk_rst:1;
626 uint64_t arb:1;
627 uint64_t reserved_9_12:4;
628 uint64_t host_mode:1;
629 uint64_t chip_rev:8;
630 } cn52xxp1;
631 struct cvmx_npei_ctl_status_s cn56xx;
632 struct cvmx_npei_ctl_status_cn56xxp1 {
633 uint64_t reserved_16_63:48;
634 uint64_t ring_en:1;
635 uint64_t lnk_rst:1;
636 uint64_t arb:1;
637 uint64_t pkt_bp:4;
638 uint64_t host_mode:1;
639 uint64_t chip_rev:8;
640 } cn56xxp1;
641};
642
643union cvmx_npei_ctl_status2 {
644 uint64_t u64;
645 struct cvmx_npei_ctl_status2_s {
646 uint64_t reserved_16_63:48;
647 uint64_t mps:1;
648 uint64_t mrrs:3;
649 uint64_t c1_w_flt:1;
650 uint64_t c0_w_flt:1;
651 uint64_t c1_b1_s:3;
652 uint64_t c0_b1_s:3;
653 uint64_t c1_wi_d:1;
654 uint64_t c1_b0_d:1;
655 uint64_t c0_wi_d:1;
656 uint64_t c0_b0_d:1;
657 } s;
658 struct cvmx_npei_ctl_status2_s cn52xx;
659 struct cvmx_npei_ctl_status2_s cn52xxp1;
660 struct cvmx_npei_ctl_status2_s cn56xx;
661 struct cvmx_npei_ctl_status2_s cn56xxp1;
662};
663
664union cvmx_npei_data_out_cnt {
665 uint64_t u64;
666 struct cvmx_npei_data_out_cnt_s {
667 uint64_t reserved_44_63:20;
668 uint64_t p1_ucnt:16;
669 uint64_t p1_fcnt:6;
670 uint64_t p0_ucnt:16;
671 uint64_t p0_fcnt:6;
672 } s;
673 struct cvmx_npei_data_out_cnt_s cn52xx;
674 struct cvmx_npei_data_out_cnt_s cn52xxp1;
675 struct cvmx_npei_data_out_cnt_s cn56xx;
676 struct cvmx_npei_data_out_cnt_s cn56xxp1;
677};
678
679union cvmx_npei_dbg_data {
680 uint64_t u64;
681 struct cvmx_npei_dbg_data_s {
682 uint64_t reserved_28_63:36;
683 uint64_t qlm0_rev_lanes:1;
684 uint64_t reserved_25_26:2;
685 uint64_t qlm1_spd:2;
686 uint64_t c_mul:5;
687 uint64_t dsel_ext:1;
688 uint64_t data:17;
689 } s;
690 struct cvmx_npei_dbg_data_cn52xx {
691 uint64_t reserved_29_63:35;
692 uint64_t qlm0_link_width:1;
693 uint64_t qlm0_rev_lanes:1;
694 uint64_t qlm1_mode:2;
695 uint64_t qlm1_spd:2;
696 uint64_t c_mul:5;
697 uint64_t dsel_ext:1;
698 uint64_t data:17;
699 } cn52xx;
700 struct cvmx_npei_dbg_data_cn52xx cn52xxp1;
701 struct cvmx_npei_dbg_data_cn56xx {
702 uint64_t reserved_29_63:35;
703 uint64_t qlm2_rev_lanes:1;
704 uint64_t qlm0_rev_lanes:1;
705 uint64_t qlm3_spd:2;
706 uint64_t qlm1_spd:2;
707 uint64_t c_mul:5;
708 uint64_t dsel_ext:1;
709 uint64_t data:17;
710 } cn56xx;
711 struct cvmx_npei_dbg_data_cn56xx cn56xxp1;
712};
713
714union cvmx_npei_dbg_select {
715 uint64_t u64;
716 struct cvmx_npei_dbg_select_s {
717 uint64_t reserved_16_63:48;
718 uint64_t dbg_sel:16;
719 } s;
720 struct cvmx_npei_dbg_select_s cn52xx;
721 struct cvmx_npei_dbg_select_s cn52xxp1;
722 struct cvmx_npei_dbg_select_s cn56xx;
723 struct cvmx_npei_dbg_select_s cn56xxp1;
724};
725
726union cvmx_npei_dmax_counts {
727 uint64_t u64;
728 struct cvmx_npei_dmax_counts_s {
729 uint64_t reserved_39_63:25;
730 uint64_t fcnt:7;
731 uint64_t dbell:32;
732 } s;
733 struct cvmx_npei_dmax_counts_s cn52xx;
734 struct cvmx_npei_dmax_counts_s cn52xxp1;
735 struct cvmx_npei_dmax_counts_s cn56xx;
736 struct cvmx_npei_dmax_counts_s cn56xxp1;
737};
738
739union cvmx_npei_dmax_dbell {
740 uint32_t u32;
741 struct cvmx_npei_dmax_dbell_s {
742 uint32_t reserved_16_31:16;
743 uint32_t dbell:16;
744 } s;
745 struct cvmx_npei_dmax_dbell_s cn52xx;
746 struct cvmx_npei_dmax_dbell_s cn52xxp1;
747 struct cvmx_npei_dmax_dbell_s cn56xx;
748 struct cvmx_npei_dmax_dbell_s cn56xxp1;
749};
750
751union cvmx_npei_dmax_ibuff_saddr {
752 uint64_t u64;
753 struct cvmx_npei_dmax_ibuff_saddr_s {
754 uint64_t reserved_37_63:27;
755 uint64_t idle:1;
756 uint64_t saddr:29;
757 uint64_t reserved_0_6:7;
758 } s;
759 struct cvmx_npei_dmax_ibuff_saddr_cn52xx {
760 uint64_t reserved_36_63:28;
761 uint64_t saddr:29;
762 uint64_t reserved_0_6:7;
763 } cn52xx;
764 struct cvmx_npei_dmax_ibuff_saddr_cn52xx cn52xxp1;
765 struct cvmx_npei_dmax_ibuff_saddr_s cn56xx;
766 struct cvmx_npei_dmax_ibuff_saddr_cn52xx cn56xxp1;
767};
768
769union cvmx_npei_dmax_naddr {
770 uint64_t u64;
771 struct cvmx_npei_dmax_naddr_s {
772 uint64_t reserved_36_63:28;
773 uint64_t addr:36;
774 } s;
775 struct cvmx_npei_dmax_naddr_s cn52xx;
776 struct cvmx_npei_dmax_naddr_s cn52xxp1;
777 struct cvmx_npei_dmax_naddr_s cn56xx;
778 struct cvmx_npei_dmax_naddr_s cn56xxp1;
779};
780
781union cvmx_npei_dma0_int_level {
782 uint64_t u64;
783 struct cvmx_npei_dma0_int_level_s {
784 uint64_t time:32;
785 uint64_t cnt:32;
786 } s;
787 struct cvmx_npei_dma0_int_level_s cn52xx;
788 struct cvmx_npei_dma0_int_level_s cn52xxp1;
789 struct cvmx_npei_dma0_int_level_s cn56xx;
790 struct cvmx_npei_dma0_int_level_s cn56xxp1;
791};
792
793union cvmx_npei_dma1_int_level {
794 uint64_t u64;
795 struct cvmx_npei_dma1_int_level_s {
796 uint64_t time:32;
797 uint64_t cnt:32;
798 } s;
799 struct cvmx_npei_dma1_int_level_s cn52xx;
800 struct cvmx_npei_dma1_int_level_s cn52xxp1;
801 struct cvmx_npei_dma1_int_level_s cn56xx;
802 struct cvmx_npei_dma1_int_level_s cn56xxp1;
803};
804
805union cvmx_npei_dma_cnts {
806 uint64_t u64;
807 struct cvmx_npei_dma_cnts_s {
808 uint64_t dma1:32;
809 uint64_t dma0:32;
810 } s;
811 struct cvmx_npei_dma_cnts_s cn52xx;
812 struct cvmx_npei_dma_cnts_s cn52xxp1;
813 struct cvmx_npei_dma_cnts_s cn56xx;
814 struct cvmx_npei_dma_cnts_s cn56xxp1;
815};
816
817union cvmx_npei_dma_control {
818 uint64_t u64;
819 struct cvmx_npei_dma_control_s {
820 uint64_t reserved_39_63:25;
821 uint64_t dma4_enb:1;
822 uint64_t dma3_enb:1;
823 uint64_t dma2_enb:1;
824 uint64_t dma1_enb:1;
825 uint64_t dma0_enb:1;
826 uint64_t b0_lend:1;
827 uint64_t dwb_denb:1;
828 uint64_t dwb_ichk:9;
829 uint64_t fpa_que:3;
830 uint64_t o_add1:1;
831 uint64_t o_ro:1;
832 uint64_t o_ns:1;
833 uint64_t o_es:2;
834 uint64_t o_mode:1;
835 uint64_t csize:14;
836 } s;
837 struct cvmx_npei_dma_control_s cn52xx;
838 struct cvmx_npei_dma_control_cn52xxp1 {
839 uint64_t reserved_38_63:26;
840 uint64_t dma3_enb:1;
841 uint64_t dma2_enb:1;
842 uint64_t dma1_enb:1;
843 uint64_t dma0_enb:1;
844 uint64_t b0_lend:1;
845 uint64_t dwb_denb:1;
846 uint64_t dwb_ichk:9;
847 uint64_t fpa_que:3;
848 uint64_t o_add1:1;
849 uint64_t o_ro:1;
850 uint64_t o_ns:1;
851 uint64_t o_es:2;
852 uint64_t o_mode:1;
853 uint64_t csize:14;
854 } cn52xxp1;
855 struct cvmx_npei_dma_control_s cn56xx;
856 struct cvmx_npei_dma_control_s cn56xxp1;
857};
858
859union cvmx_npei_int_a_enb {
860 uint64_t u64;
861 struct cvmx_npei_int_a_enb_s {
862 uint64_t reserved_10_63:54;
863 uint64_t pout_err:1;
864 uint64_t pin_bp:1;
865 uint64_t p1_rdlk:1;
866 uint64_t p0_rdlk:1;
867 uint64_t pgl_err:1;
868 uint64_t pdi_err:1;
869 uint64_t pop_err:1;
870 uint64_t pins_err:1;
871 uint64_t dma1_cpl:1;
872 uint64_t dma0_cpl:1;
873 } s;
874 struct cvmx_npei_int_a_enb_cn52xx {
875 uint64_t reserved_8_63:56;
876 uint64_t p1_rdlk:1;
877 uint64_t p0_rdlk:1;
878 uint64_t pgl_err:1;
879 uint64_t pdi_err:1;
880 uint64_t pop_err:1;
881 uint64_t pins_err:1;
882 uint64_t dma1_cpl:1;
883 uint64_t dma0_cpl:1;
884 } cn52xx;
885 struct cvmx_npei_int_a_enb_cn52xxp1 {
886 uint64_t reserved_2_63:62;
887 uint64_t dma1_cpl:1;
888 uint64_t dma0_cpl:1;
889 } cn52xxp1;
890 struct cvmx_npei_int_a_enb_s cn56xx;
891};
892
893union cvmx_npei_int_a_enb2 {
894 uint64_t u64;
895 struct cvmx_npei_int_a_enb2_s {
896 uint64_t reserved_10_63:54;
897 uint64_t pout_err:1;
898 uint64_t pin_bp:1;
899 uint64_t p1_rdlk:1;
900 uint64_t p0_rdlk:1;
901 uint64_t pgl_err:1;
902 uint64_t pdi_err:1;
903 uint64_t pop_err:1;
904 uint64_t pins_err:1;
905 uint64_t dma1_cpl:1;
906 uint64_t dma0_cpl:1;
907 } s;
908 struct cvmx_npei_int_a_enb2_cn52xx {
909 uint64_t reserved_8_63:56;
910 uint64_t p1_rdlk:1;
911 uint64_t p0_rdlk:1;
912 uint64_t pgl_err:1;
913 uint64_t pdi_err:1;
914 uint64_t pop_err:1;
915 uint64_t pins_err:1;
916 uint64_t reserved_0_1:2;
917 } cn52xx;
918 struct cvmx_npei_int_a_enb2_cn52xxp1 {
919 uint64_t reserved_2_63:62;
920 uint64_t dma1_cpl:1;
921 uint64_t dma0_cpl:1;
922 } cn52xxp1;
923 struct cvmx_npei_int_a_enb2_s cn56xx;
924};
925
926union cvmx_npei_int_a_sum {
927 uint64_t u64;
928 struct cvmx_npei_int_a_sum_s {
929 uint64_t reserved_10_63:54;
930 uint64_t pout_err:1;
931 uint64_t pin_bp:1;
932 uint64_t p1_rdlk:1;
933 uint64_t p0_rdlk:1;
934 uint64_t pgl_err:1;
935 uint64_t pdi_err:1;
936 uint64_t pop_err:1;
937 uint64_t pins_err:1;
938 uint64_t dma1_cpl:1;
939 uint64_t dma0_cpl:1;
940 } s;
941 struct cvmx_npei_int_a_sum_cn52xx {
942 uint64_t reserved_8_63:56;
943 uint64_t p1_rdlk:1;
944 uint64_t p0_rdlk:1;
945 uint64_t pgl_err:1;
946 uint64_t pdi_err:1;
947 uint64_t pop_err:1;
948 uint64_t pins_err:1;
949 uint64_t dma1_cpl:1;
950 uint64_t dma0_cpl:1;
951 } cn52xx;
952 struct cvmx_npei_int_a_sum_cn52xxp1 {
953 uint64_t reserved_2_63:62;
954 uint64_t dma1_cpl:1;
955 uint64_t dma0_cpl:1;
956 } cn52xxp1;
957 struct cvmx_npei_int_a_sum_s cn56xx;
958};
959
960union cvmx_npei_int_enb {
961 uint64_t u64;
962 struct cvmx_npei_int_enb_s {
963 uint64_t mio_inta:1;
964 uint64_t reserved_62_62:1;
965 uint64_t int_a:1;
966 uint64_t c1_ldwn:1;
967 uint64_t c0_ldwn:1;
968 uint64_t c1_exc:1;
969 uint64_t c0_exc:1;
970 uint64_t c1_up_wf:1;
971 uint64_t c0_up_wf:1;
972 uint64_t c1_un_wf:1;
973 uint64_t c0_un_wf:1;
974 uint64_t c1_un_bx:1;
975 uint64_t c1_un_wi:1;
976 uint64_t c1_un_b2:1;
977 uint64_t c1_un_b1:1;
978 uint64_t c1_un_b0:1;
979 uint64_t c1_up_bx:1;
980 uint64_t c1_up_wi:1;
981 uint64_t c1_up_b2:1;
982 uint64_t c1_up_b1:1;
983 uint64_t c1_up_b0:1;
984 uint64_t c0_un_bx:1;
985 uint64_t c0_un_wi:1;
986 uint64_t c0_un_b2:1;
987 uint64_t c0_un_b1:1;
988 uint64_t c0_un_b0:1;
989 uint64_t c0_up_bx:1;
990 uint64_t c0_up_wi:1;
991 uint64_t c0_up_b2:1;
992 uint64_t c0_up_b1:1;
993 uint64_t c0_up_b0:1;
994 uint64_t c1_hpint:1;
995 uint64_t c1_pmei:1;
996 uint64_t c1_wake:1;
997 uint64_t crs1_dr:1;
998 uint64_t c1_se:1;
999 uint64_t crs1_er:1;
1000 uint64_t c1_aeri:1;
1001 uint64_t c0_hpint:1;
1002 uint64_t c0_pmei:1;
1003 uint64_t c0_wake:1;
1004 uint64_t crs0_dr:1;
1005 uint64_t c0_se:1;
1006 uint64_t crs0_er:1;
1007 uint64_t c0_aeri:1;
1008 uint64_t ptime:1;
1009 uint64_t pcnt:1;
1010 uint64_t pidbof:1;
1011 uint64_t psldbof:1;
1012 uint64_t dtime1:1;
1013 uint64_t dtime0:1;
1014 uint64_t dcnt1:1;
1015 uint64_t dcnt0:1;
1016 uint64_t dma1fi:1;
1017 uint64_t dma0fi:1;
1018 uint64_t dma4dbo:1;
1019 uint64_t dma3dbo:1;
1020 uint64_t dma2dbo:1;
1021 uint64_t dma1dbo:1;
1022 uint64_t dma0dbo:1;
1023 uint64_t iob2big:1;
1024 uint64_t bar0_to:1;
1025 uint64_t rml_wto:1;
1026 uint64_t rml_rto:1;
1027 } s;
1028 struct cvmx_npei_int_enb_s cn52xx;
1029 struct cvmx_npei_int_enb_cn52xxp1 {
1030 uint64_t mio_inta:1;
1031 uint64_t reserved_62_62:1;
1032 uint64_t int_a:1;
1033 uint64_t c1_ldwn:1;
1034 uint64_t c0_ldwn:1;
1035 uint64_t c1_exc:1;
1036 uint64_t c0_exc:1;
1037 uint64_t c1_up_wf:1;
1038 uint64_t c0_up_wf:1;
1039 uint64_t c1_un_wf:1;
1040 uint64_t c0_un_wf:1;
1041 uint64_t c1_un_bx:1;
1042 uint64_t c1_un_wi:1;
1043 uint64_t c1_un_b2:1;
1044 uint64_t c1_un_b1:1;
1045 uint64_t c1_un_b0:1;
1046 uint64_t c1_up_bx:1;
1047 uint64_t c1_up_wi:1;
1048 uint64_t c1_up_b2:1;
1049 uint64_t c1_up_b1:1;
1050 uint64_t c1_up_b0:1;
1051 uint64_t c0_un_bx:1;
1052 uint64_t c0_un_wi:1;
1053 uint64_t c0_un_b2:1;
1054 uint64_t c0_un_b1:1;
1055 uint64_t c0_un_b0:1;
1056 uint64_t c0_up_bx:1;
1057 uint64_t c0_up_wi:1;
1058 uint64_t c0_up_b2:1;
1059 uint64_t c0_up_b1:1;
1060 uint64_t c0_up_b0:1;
1061 uint64_t c1_hpint:1;
1062 uint64_t c1_pmei:1;
1063 uint64_t c1_wake:1;
1064 uint64_t crs1_dr:1;
1065 uint64_t c1_se:1;
1066 uint64_t crs1_er:1;
1067 uint64_t c1_aeri:1;
1068 uint64_t c0_hpint:1;
1069 uint64_t c0_pmei:1;
1070 uint64_t c0_wake:1;
1071 uint64_t crs0_dr:1;
1072 uint64_t c0_se:1;
1073 uint64_t crs0_er:1;
1074 uint64_t c0_aeri:1;
1075 uint64_t ptime:1;
1076 uint64_t pcnt:1;
1077 uint64_t pidbof:1;
1078 uint64_t psldbof:1;
1079 uint64_t dtime1:1;
1080 uint64_t dtime0:1;
1081 uint64_t dcnt1:1;
1082 uint64_t dcnt0:1;
1083 uint64_t dma1fi:1;
1084 uint64_t dma0fi:1;
1085 uint64_t reserved_8_8:1;
1086 uint64_t dma3dbo:1;
1087 uint64_t dma2dbo:1;
1088 uint64_t dma1dbo:1;
1089 uint64_t dma0dbo:1;
1090 uint64_t iob2big:1;
1091 uint64_t bar0_to:1;
1092 uint64_t rml_wto:1;
1093 uint64_t rml_rto:1;
1094 } cn52xxp1;
1095 struct cvmx_npei_int_enb_s cn56xx;
1096 struct cvmx_npei_int_enb_cn56xxp1 {
1097 uint64_t mio_inta:1;
1098 uint64_t reserved_61_62:2;
1099 uint64_t c1_ldwn:1;
1100 uint64_t c0_ldwn:1;
1101 uint64_t c1_exc:1;
1102 uint64_t c0_exc:1;
1103 uint64_t c1_up_wf:1;
1104 uint64_t c0_up_wf:1;
1105 uint64_t c1_un_wf:1;
1106 uint64_t c0_un_wf:1;
1107 uint64_t c1_un_bx:1;
1108 uint64_t c1_un_wi:1;
1109 uint64_t c1_un_b2:1;
1110 uint64_t c1_un_b1:1;
1111 uint64_t c1_un_b0:1;
1112 uint64_t c1_up_bx:1;
1113 uint64_t c1_up_wi:1;
1114 uint64_t c1_up_b2:1;
1115 uint64_t c1_up_b1:1;
1116 uint64_t c1_up_b0:1;
1117 uint64_t c0_un_bx:1;
1118 uint64_t c0_un_wi:1;
1119 uint64_t c0_un_b2:1;
1120 uint64_t c0_un_b1:1;
1121 uint64_t c0_un_b0:1;
1122 uint64_t c0_up_bx:1;
1123 uint64_t c0_up_wi:1;
1124 uint64_t c0_up_b2:1;
1125 uint64_t c0_up_b1:1;
1126 uint64_t c0_up_b0:1;
1127 uint64_t c1_hpint:1;
1128 uint64_t c1_pmei:1;
1129 uint64_t c1_wake:1;
1130 uint64_t reserved_29_29:1;
1131 uint64_t c1_se:1;
1132 uint64_t reserved_27_27:1;
1133 uint64_t c1_aeri:1;
1134 uint64_t c0_hpint:1;
1135 uint64_t c0_pmei:1;
1136 uint64_t c0_wake:1;
1137 uint64_t reserved_22_22:1;
1138 uint64_t c0_se:1;
1139 uint64_t reserved_20_20:1;
1140 uint64_t c0_aeri:1;
1141 uint64_t ptime:1;
1142 uint64_t pcnt:1;
1143 uint64_t pidbof:1;
1144 uint64_t psldbof:1;
1145 uint64_t dtime1:1;
1146 uint64_t dtime0:1;
1147 uint64_t dcnt1:1;
1148 uint64_t dcnt0:1;
1149 uint64_t dma1fi:1;
1150 uint64_t dma0fi:1;
1151 uint64_t dma4dbo:1;
1152 uint64_t dma3dbo:1;
1153 uint64_t dma2dbo:1;
1154 uint64_t dma1dbo:1;
1155 uint64_t dma0dbo:1;
1156 uint64_t iob2big:1;
1157 uint64_t bar0_to:1;
1158 uint64_t rml_wto:1;
1159 uint64_t rml_rto:1;
1160 } cn56xxp1;
1161};
1162
1163union cvmx_npei_int_enb2 {
1164 uint64_t u64;
1165 struct cvmx_npei_int_enb2_s {
1166 uint64_t reserved_62_63:2;
1167 uint64_t int_a:1;
1168 uint64_t c1_ldwn:1;
1169 uint64_t c0_ldwn:1;
1170 uint64_t c1_exc:1;
1171 uint64_t c0_exc:1;
1172 uint64_t c1_up_wf:1;
1173 uint64_t c0_up_wf:1;
1174 uint64_t c1_un_wf:1;
1175 uint64_t c0_un_wf:1;
1176 uint64_t c1_un_bx:1;
1177 uint64_t c1_un_wi:1;
1178 uint64_t c1_un_b2:1;
1179 uint64_t c1_un_b1:1;
1180 uint64_t c1_un_b0:1;
1181 uint64_t c1_up_bx:1;
1182 uint64_t c1_up_wi:1;
1183 uint64_t c1_up_b2:1;
1184 uint64_t c1_up_b1:1;
1185 uint64_t c1_up_b0:1;
1186 uint64_t c0_un_bx:1;
1187 uint64_t c0_un_wi:1;
1188 uint64_t c0_un_b2:1;
1189 uint64_t c0_un_b1:1;
1190 uint64_t c0_un_b0:1;
1191 uint64_t c0_up_bx:1;
1192 uint64_t c0_up_wi:1;
1193 uint64_t c0_up_b2:1;
1194 uint64_t c0_up_b1:1;
1195 uint64_t c0_up_b0:1;
1196 uint64_t c1_hpint:1;
1197 uint64_t c1_pmei:1;
1198 uint64_t c1_wake:1;
1199 uint64_t crs1_dr:1;
1200 uint64_t c1_se:1;
1201 uint64_t crs1_er:1;
1202 uint64_t c1_aeri:1;
1203 uint64_t c0_hpint:1;
1204 uint64_t c0_pmei:1;
1205 uint64_t c0_wake:1;
1206 uint64_t crs0_dr:1;
1207 uint64_t c0_se:1;
1208 uint64_t crs0_er:1;
1209 uint64_t c0_aeri:1;
1210 uint64_t ptime:1;
1211 uint64_t pcnt:1;
1212 uint64_t pidbof:1;
1213 uint64_t psldbof:1;
1214 uint64_t dtime1:1;
1215 uint64_t dtime0:1;
1216 uint64_t dcnt1:1;
1217 uint64_t dcnt0:1;
1218 uint64_t dma1fi:1;
1219 uint64_t dma0fi:1;
1220 uint64_t dma4dbo:1;
1221 uint64_t dma3dbo:1;
1222 uint64_t dma2dbo:1;
1223 uint64_t dma1dbo:1;
1224 uint64_t dma0dbo:1;
1225 uint64_t iob2big:1;
1226 uint64_t bar0_to:1;
1227 uint64_t rml_wto:1;
1228 uint64_t rml_rto:1;
1229 } s;
1230 struct cvmx_npei_int_enb2_s cn52xx;
1231 struct cvmx_npei_int_enb2_cn52xxp1 {
1232 uint64_t reserved_62_63:2;
1233 uint64_t int_a:1;
1234 uint64_t c1_ldwn:1;
1235 uint64_t c0_ldwn:1;
1236 uint64_t c1_exc:1;
1237 uint64_t c0_exc:1;
1238 uint64_t c1_up_wf:1;
1239 uint64_t c0_up_wf:1;
1240 uint64_t c1_un_wf:1;
1241 uint64_t c0_un_wf:1;
1242 uint64_t c1_un_bx:1;
1243 uint64_t c1_un_wi:1;
1244 uint64_t c1_un_b2:1;
1245 uint64_t c1_un_b1:1;
1246 uint64_t c1_un_b0:1;
1247 uint64_t c1_up_bx:1;
1248 uint64_t c1_up_wi:1;
1249 uint64_t c1_up_b2:1;
1250 uint64_t c1_up_b1:1;
1251 uint64_t c1_up_b0:1;
1252 uint64_t c0_un_bx:1;
1253 uint64_t c0_un_wi:1;
1254 uint64_t c0_un_b2:1;
1255 uint64_t c0_un_b1:1;
1256 uint64_t c0_un_b0:1;
1257 uint64_t c0_up_bx:1;
1258 uint64_t c0_up_wi:1;
1259 uint64_t c0_up_b2:1;
1260 uint64_t c0_up_b1:1;
1261 uint64_t c0_up_b0:1;
1262 uint64_t c1_hpint:1;
1263 uint64_t c1_pmei:1;
1264 uint64_t c1_wake:1;
1265 uint64_t crs1_dr:1;
1266 uint64_t c1_se:1;
1267 uint64_t crs1_er:1;
1268 uint64_t c1_aeri:1;
1269 uint64_t c0_hpint:1;
1270 uint64_t c0_pmei:1;
1271 uint64_t c0_wake:1;
1272 uint64_t crs0_dr:1;
1273 uint64_t c0_se:1;
1274 uint64_t crs0_er:1;
1275 uint64_t c0_aeri:1;
1276 uint64_t ptime:1;
1277 uint64_t pcnt:1;
1278 uint64_t pidbof:1;
1279 uint64_t psldbof:1;
1280 uint64_t dtime1:1;
1281 uint64_t dtime0:1;
1282 uint64_t dcnt1:1;
1283 uint64_t dcnt0:1;
1284 uint64_t dma1fi:1;
1285 uint64_t dma0fi:1;
1286 uint64_t reserved_8_8:1;
1287 uint64_t dma3dbo:1;
1288 uint64_t dma2dbo:1;
1289 uint64_t dma1dbo:1;
1290 uint64_t dma0dbo:1;
1291 uint64_t iob2big:1;
1292 uint64_t bar0_to:1;
1293 uint64_t rml_wto:1;
1294 uint64_t rml_rto:1;
1295 } cn52xxp1;
1296 struct cvmx_npei_int_enb2_s cn56xx;
1297 struct cvmx_npei_int_enb2_cn56xxp1 {
1298 uint64_t reserved_61_63:3;
1299 uint64_t c1_ldwn:1;
1300 uint64_t c0_ldwn:1;
1301 uint64_t c1_exc:1;
1302 uint64_t c0_exc:1;
1303 uint64_t c1_up_wf:1;
1304 uint64_t c0_up_wf:1;
1305 uint64_t c1_un_wf:1;
1306 uint64_t c0_un_wf:1;
1307 uint64_t c1_un_bx:1;
1308 uint64_t c1_un_wi:1;
1309 uint64_t c1_un_b2:1;
1310 uint64_t c1_un_b1:1;
1311 uint64_t c1_un_b0:1;
1312 uint64_t c1_up_bx:1;
1313 uint64_t c1_up_wi:1;
1314 uint64_t c1_up_b2:1;
1315 uint64_t c1_up_b1:1;
1316 uint64_t c1_up_b0:1;
1317 uint64_t c0_un_bx:1;
1318 uint64_t c0_un_wi:1;
1319 uint64_t c0_un_b2:1;
1320 uint64_t c0_un_b1:1;
1321 uint64_t c0_un_b0:1;
1322 uint64_t c0_up_bx:1;
1323 uint64_t c0_up_wi:1;
1324 uint64_t c0_up_b2:1;
1325 uint64_t c0_up_b1:1;
1326 uint64_t c0_up_b0:1;
1327 uint64_t c1_hpint:1;
1328 uint64_t c1_pmei:1;
1329 uint64_t c1_wake:1;
1330 uint64_t reserved_29_29:1;
1331 uint64_t c1_se:1;
1332 uint64_t reserved_27_27:1;
1333 uint64_t c1_aeri:1;
1334 uint64_t c0_hpint:1;
1335 uint64_t c0_pmei:1;
1336 uint64_t c0_wake:1;
1337 uint64_t reserved_22_22:1;
1338 uint64_t c0_se:1;
1339 uint64_t reserved_20_20:1;
1340 uint64_t c0_aeri:1;
1341 uint64_t ptime:1;
1342 uint64_t pcnt:1;
1343 uint64_t pidbof:1;
1344 uint64_t psldbof:1;
1345 uint64_t dtime1:1;
1346 uint64_t dtime0:1;
1347 uint64_t dcnt1:1;
1348 uint64_t dcnt0:1;
1349 uint64_t dma1fi:1;
1350 uint64_t dma0fi:1;
1351 uint64_t dma4dbo:1;
1352 uint64_t dma3dbo:1;
1353 uint64_t dma2dbo:1;
1354 uint64_t dma1dbo:1;
1355 uint64_t dma0dbo:1;
1356 uint64_t iob2big:1;
1357 uint64_t bar0_to:1;
1358 uint64_t rml_wto:1;
1359 uint64_t rml_rto:1;
1360 } cn56xxp1;
1361};
1362
1363union cvmx_npei_int_info {
1364 uint64_t u64;
1365 struct cvmx_npei_int_info_s {
1366 uint64_t reserved_12_63:52;
1367 uint64_t pidbof:6;
1368 uint64_t psldbof:6;
1369 } s;
1370 struct cvmx_npei_int_info_s cn52xx;
1371 struct cvmx_npei_int_info_s cn56xx;
1372 struct cvmx_npei_int_info_s cn56xxp1;
1373};
1374
1375union cvmx_npei_int_sum {
1376 uint64_t u64;
1377 struct cvmx_npei_int_sum_s {
1378 uint64_t mio_inta:1;
1379 uint64_t reserved_62_62:1;
1380 uint64_t int_a:1;
1381 uint64_t c1_ldwn:1;
1382 uint64_t c0_ldwn:1;
1383 uint64_t c1_exc:1;
1384 uint64_t c0_exc:1;
1385 uint64_t c1_up_wf:1;
1386 uint64_t c0_up_wf:1;
1387 uint64_t c1_un_wf:1;
1388 uint64_t c0_un_wf:1;
1389 uint64_t c1_un_bx:1;
1390 uint64_t c1_un_wi:1;
1391 uint64_t c1_un_b2:1;
1392 uint64_t c1_un_b1:1;
1393 uint64_t c1_un_b0:1;
1394 uint64_t c1_up_bx:1;
1395 uint64_t c1_up_wi:1;
1396 uint64_t c1_up_b2:1;
1397 uint64_t c1_up_b1:1;
1398 uint64_t c1_up_b0:1;
1399 uint64_t c0_un_bx:1;
1400 uint64_t c0_un_wi:1;
1401 uint64_t c0_un_b2:1;
1402 uint64_t c0_un_b1:1;
1403 uint64_t c0_un_b0:1;
1404 uint64_t c0_up_bx:1;
1405 uint64_t c0_up_wi:1;
1406 uint64_t c0_up_b2:1;
1407 uint64_t c0_up_b1:1;
1408 uint64_t c0_up_b0:1;
1409 uint64_t c1_hpint:1;
1410 uint64_t c1_pmei:1;
1411 uint64_t c1_wake:1;
1412 uint64_t crs1_dr:1;
1413 uint64_t c1_se:1;
1414 uint64_t crs1_er:1;
1415 uint64_t c1_aeri:1;
1416 uint64_t c0_hpint:1;
1417 uint64_t c0_pmei:1;
1418 uint64_t c0_wake:1;
1419 uint64_t crs0_dr:1;
1420 uint64_t c0_se:1;
1421 uint64_t crs0_er:1;
1422 uint64_t c0_aeri:1;
1423 uint64_t ptime:1;
1424 uint64_t pcnt:1;
1425 uint64_t pidbof:1;
1426 uint64_t psldbof:1;
1427 uint64_t dtime1:1;
1428 uint64_t dtime0:1;
1429 uint64_t dcnt1:1;
1430 uint64_t dcnt0:1;
1431 uint64_t dma1fi:1;
1432 uint64_t dma0fi:1;
1433 uint64_t dma4dbo:1;
1434 uint64_t dma3dbo:1;
1435 uint64_t dma2dbo:1;
1436 uint64_t dma1dbo:1;
1437 uint64_t dma0dbo:1;
1438 uint64_t iob2big:1;
1439 uint64_t bar0_to:1;
1440 uint64_t rml_wto:1;
1441 uint64_t rml_rto:1;
1442 } s;
1443 struct cvmx_npei_int_sum_s cn52xx;
1444 struct cvmx_npei_int_sum_cn52xxp1 {
1445 uint64_t mio_inta:1;
1446 uint64_t reserved_62_62:1;
1447 uint64_t int_a:1;
1448 uint64_t c1_ldwn:1;
1449 uint64_t c0_ldwn:1;
1450 uint64_t c1_exc:1;
1451 uint64_t c0_exc:1;
1452 uint64_t c1_up_wf:1;
1453 uint64_t c0_up_wf:1;
1454 uint64_t c1_un_wf:1;
1455 uint64_t c0_un_wf:1;
1456 uint64_t c1_un_bx:1;
1457 uint64_t c1_un_wi:1;
1458 uint64_t c1_un_b2:1;
1459 uint64_t c1_un_b1:1;
1460 uint64_t c1_un_b0:1;
1461 uint64_t c1_up_bx:1;
1462 uint64_t c1_up_wi:1;
1463 uint64_t c1_up_b2:1;
1464 uint64_t c1_up_b1:1;
1465 uint64_t c1_up_b0:1;
1466 uint64_t c0_un_bx:1;
1467 uint64_t c0_un_wi:1;
1468 uint64_t c0_un_b2:1;
1469 uint64_t c0_un_b1:1;
1470 uint64_t c0_un_b0:1;
1471 uint64_t c0_up_bx:1;
1472 uint64_t c0_up_wi:1;
1473 uint64_t c0_up_b2:1;
1474 uint64_t c0_up_b1:1;
1475 uint64_t c0_up_b0:1;
1476 uint64_t c1_hpint:1;
1477 uint64_t c1_pmei:1;
1478 uint64_t c1_wake:1;
1479 uint64_t crs1_dr:1;
1480 uint64_t c1_se:1;
1481 uint64_t crs1_er:1;
1482 uint64_t c1_aeri:1;
1483 uint64_t c0_hpint:1;
1484 uint64_t c0_pmei:1;
1485 uint64_t c0_wake:1;
1486 uint64_t crs0_dr:1;
1487 uint64_t c0_se:1;
1488 uint64_t crs0_er:1;
1489 uint64_t c0_aeri:1;
1490 uint64_t reserved_15_18:4;
1491 uint64_t dtime1:1;
1492 uint64_t dtime0:1;
1493 uint64_t dcnt1:1;
1494 uint64_t dcnt0:1;
1495 uint64_t dma1fi:1;
1496 uint64_t dma0fi:1;
1497 uint64_t reserved_8_8:1;
1498 uint64_t dma3dbo:1;
1499 uint64_t dma2dbo:1;
1500 uint64_t dma1dbo:1;
1501 uint64_t dma0dbo:1;
1502 uint64_t iob2big:1;
1503 uint64_t bar0_to:1;
1504 uint64_t rml_wto:1;
1505 uint64_t rml_rto:1;
1506 } cn52xxp1;
1507 struct cvmx_npei_int_sum_s cn56xx;
1508 struct cvmx_npei_int_sum_cn56xxp1 {
1509 uint64_t mio_inta:1;
1510 uint64_t reserved_61_62:2;
1511 uint64_t c1_ldwn:1;
1512 uint64_t c0_ldwn:1;
1513 uint64_t c1_exc:1;
1514 uint64_t c0_exc:1;
1515 uint64_t c1_up_wf:1;
1516 uint64_t c0_up_wf:1;
1517 uint64_t c1_un_wf:1;
1518 uint64_t c0_un_wf:1;
1519 uint64_t c1_un_bx:1;
1520 uint64_t c1_un_wi:1;
1521 uint64_t c1_un_b2:1;
1522 uint64_t c1_un_b1:1;
1523 uint64_t c1_un_b0:1;
1524 uint64_t c1_up_bx:1;
1525 uint64_t c1_up_wi:1;
1526 uint64_t c1_up_b2:1;
1527 uint64_t c1_up_b1:1;
1528 uint64_t c1_up_b0:1;
1529 uint64_t c0_un_bx:1;
1530 uint64_t c0_un_wi:1;
1531 uint64_t c0_un_b2:1;
1532 uint64_t c0_un_b1:1;
1533 uint64_t c0_un_b0:1;
1534 uint64_t c0_up_bx:1;
1535 uint64_t c0_up_wi:1;
1536 uint64_t c0_up_b2:1;
1537 uint64_t c0_up_b1:1;
1538 uint64_t c0_up_b0:1;
1539 uint64_t c1_hpint:1;
1540 uint64_t c1_pmei:1;
1541 uint64_t c1_wake:1;
1542 uint64_t reserved_29_29:1;
1543 uint64_t c1_se:1;
1544 uint64_t reserved_27_27:1;
1545 uint64_t c1_aeri:1;
1546 uint64_t c0_hpint:1;
1547 uint64_t c0_pmei:1;
1548 uint64_t c0_wake:1;
1549 uint64_t reserved_22_22:1;
1550 uint64_t c0_se:1;
1551 uint64_t reserved_20_20:1;
1552 uint64_t c0_aeri:1;
1553 uint64_t ptime:1;
1554 uint64_t pcnt:1;
1555 uint64_t pidbof:1;
1556 uint64_t psldbof:1;
1557 uint64_t dtime1:1;
1558 uint64_t dtime0:1;
1559 uint64_t dcnt1:1;
1560 uint64_t dcnt0:1;
1561 uint64_t dma1fi:1;
1562 uint64_t dma0fi:1;
1563 uint64_t dma4dbo:1;
1564 uint64_t dma3dbo:1;
1565 uint64_t dma2dbo:1;
1566 uint64_t dma1dbo:1;
1567 uint64_t dma0dbo:1;
1568 uint64_t iob2big:1;
1569 uint64_t bar0_to:1;
1570 uint64_t rml_wto:1;
1571 uint64_t rml_rto:1;
1572 } cn56xxp1;
1573};
1574
1575union cvmx_npei_int_sum2 {
1576 uint64_t u64;
1577 struct cvmx_npei_int_sum2_s {
1578 uint64_t mio_inta:1;
1579 uint64_t reserved_62_62:1;
1580 uint64_t int_a:1;
1581 uint64_t c1_ldwn:1;
1582 uint64_t c0_ldwn:1;
1583 uint64_t c1_exc:1;
1584 uint64_t c0_exc:1;
1585 uint64_t c1_up_wf:1;
1586 uint64_t c0_up_wf:1;
1587 uint64_t c1_un_wf:1;
1588 uint64_t c0_un_wf:1;
1589 uint64_t c1_un_bx:1;
1590 uint64_t c1_un_wi:1;
1591 uint64_t c1_un_b2:1;
1592 uint64_t c1_un_b1:1;
1593 uint64_t c1_un_b0:1;
1594 uint64_t c1_up_bx:1;
1595 uint64_t c1_up_wi:1;
1596 uint64_t c1_up_b2:1;
1597 uint64_t c1_up_b1:1;
1598 uint64_t c1_up_b0:1;
1599 uint64_t c0_un_bx:1;
1600 uint64_t c0_un_wi:1;
1601 uint64_t c0_un_b2:1;
1602 uint64_t c0_un_b1:1;
1603 uint64_t c0_un_b0:1;
1604 uint64_t c0_up_bx:1;
1605 uint64_t c0_up_wi:1;
1606 uint64_t c0_up_b2:1;
1607 uint64_t c0_up_b1:1;
1608 uint64_t c0_up_b0:1;
1609 uint64_t c1_hpint:1;
1610 uint64_t c1_pmei:1;
1611 uint64_t c1_wake:1;
1612 uint64_t crs1_dr:1;
1613 uint64_t c1_se:1;
1614 uint64_t crs1_er:1;
1615 uint64_t c1_aeri:1;
1616 uint64_t c0_hpint:1;
1617 uint64_t c0_pmei:1;
1618 uint64_t c0_wake:1;
1619 uint64_t crs0_dr:1;
1620 uint64_t c0_se:1;
1621 uint64_t crs0_er:1;
1622 uint64_t c0_aeri:1;
1623 uint64_t reserved_15_18:4;
1624 uint64_t dtime1:1;
1625 uint64_t dtime0:1;
1626 uint64_t dcnt1:1;
1627 uint64_t dcnt0:1;
1628 uint64_t dma1fi:1;
1629 uint64_t dma0fi:1;
1630 uint64_t reserved_8_8:1;
1631 uint64_t dma3dbo:1;
1632 uint64_t dma2dbo:1;
1633 uint64_t dma1dbo:1;
1634 uint64_t dma0dbo:1;
1635 uint64_t iob2big:1;
1636 uint64_t bar0_to:1;
1637 uint64_t rml_wto:1;
1638 uint64_t rml_rto:1;
1639 } s;
1640 struct cvmx_npei_int_sum2_s cn52xx;
1641 struct cvmx_npei_int_sum2_s cn52xxp1;
1642 struct cvmx_npei_int_sum2_s cn56xx;
1643};
1644
1645union cvmx_npei_last_win_rdata0 {
1646 uint64_t u64;
1647 struct cvmx_npei_last_win_rdata0_s {
1648 uint64_t data:64;
1649 } s;
1650 struct cvmx_npei_last_win_rdata0_s cn52xx;
1651 struct cvmx_npei_last_win_rdata0_s cn52xxp1;
1652 struct cvmx_npei_last_win_rdata0_s cn56xx;
1653 struct cvmx_npei_last_win_rdata0_s cn56xxp1;
1654};
1655
1656union cvmx_npei_last_win_rdata1 {
1657 uint64_t u64;
1658 struct cvmx_npei_last_win_rdata1_s {
1659 uint64_t data:64;
1660 } s;
1661 struct cvmx_npei_last_win_rdata1_s cn52xx;
1662 struct cvmx_npei_last_win_rdata1_s cn52xxp1;
1663 struct cvmx_npei_last_win_rdata1_s cn56xx;
1664 struct cvmx_npei_last_win_rdata1_s cn56xxp1;
1665};
1666
1667union cvmx_npei_mem_access_ctl {
1668 uint64_t u64;
1669 struct cvmx_npei_mem_access_ctl_s {
1670 uint64_t reserved_14_63:50;
1671 uint64_t max_word:4;
1672 uint64_t timer:10;
1673 } s;
1674 struct cvmx_npei_mem_access_ctl_s cn52xx;
1675 struct cvmx_npei_mem_access_ctl_s cn52xxp1;
1676 struct cvmx_npei_mem_access_ctl_s cn56xx;
1677 struct cvmx_npei_mem_access_ctl_s cn56xxp1;
1678};
1679
1680union cvmx_npei_mem_access_subidx {
1681 uint64_t u64;
1682 struct cvmx_npei_mem_access_subidx_s {
1683 uint64_t reserved_42_63:22;
1684 uint64_t zero:1;
1685 uint64_t port:2;
1686 uint64_t nmerge:1;
1687 uint64_t esr:2;
1688 uint64_t esw:2;
1689 uint64_t nsr:1;
1690 uint64_t nsw:1;
1691 uint64_t ror:1;
1692 uint64_t row:1;
1693 uint64_t ba:30;
1694 } s;
1695 struct cvmx_npei_mem_access_subidx_s cn52xx;
1696 struct cvmx_npei_mem_access_subidx_s cn52xxp1;
1697 struct cvmx_npei_mem_access_subidx_s cn56xx;
1698 struct cvmx_npei_mem_access_subidx_s cn56xxp1;
1699};
1700
1701union cvmx_npei_msi_enb0 {
1702 uint64_t u64;
1703 struct cvmx_npei_msi_enb0_s {
1704 uint64_t enb:64;
1705 } s;
1706 struct cvmx_npei_msi_enb0_s cn52xx;
1707 struct cvmx_npei_msi_enb0_s cn52xxp1;
1708 struct cvmx_npei_msi_enb0_s cn56xx;
1709 struct cvmx_npei_msi_enb0_s cn56xxp1;
1710};
1711
1712union cvmx_npei_msi_enb1 {
1713 uint64_t u64;
1714 struct cvmx_npei_msi_enb1_s {
1715 uint64_t enb:64;
1716 } s;
1717 struct cvmx_npei_msi_enb1_s cn52xx;
1718 struct cvmx_npei_msi_enb1_s cn52xxp1;
1719 struct cvmx_npei_msi_enb1_s cn56xx;
1720 struct cvmx_npei_msi_enb1_s cn56xxp1;
1721};
1722
1723union cvmx_npei_msi_enb2 {
1724 uint64_t u64;
1725 struct cvmx_npei_msi_enb2_s {
1726 uint64_t enb:64;
1727 } s;
1728 struct cvmx_npei_msi_enb2_s cn52xx;
1729 struct cvmx_npei_msi_enb2_s cn52xxp1;
1730 struct cvmx_npei_msi_enb2_s cn56xx;
1731 struct cvmx_npei_msi_enb2_s cn56xxp1;
1732};
1733
1734union cvmx_npei_msi_enb3 {
1735 uint64_t u64;
1736 struct cvmx_npei_msi_enb3_s {
1737 uint64_t enb:64;
1738 } s;
1739 struct cvmx_npei_msi_enb3_s cn52xx;
1740 struct cvmx_npei_msi_enb3_s cn52xxp1;
1741 struct cvmx_npei_msi_enb3_s cn56xx;
1742 struct cvmx_npei_msi_enb3_s cn56xxp1;
1743};
1744
1745union cvmx_npei_msi_rcv0 {
1746 uint64_t u64;
1747 struct cvmx_npei_msi_rcv0_s {
1748 uint64_t intr:64;
1749 } s;
1750 struct cvmx_npei_msi_rcv0_s cn52xx;
1751 struct cvmx_npei_msi_rcv0_s cn52xxp1;
1752 struct cvmx_npei_msi_rcv0_s cn56xx;
1753 struct cvmx_npei_msi_rcv0_s cn56xxp1;
1754};
1755
1756union cvmx_npei_msi_rcv1 {
1757 uint64_t u64;
1758 struct cvmx_npei_msi_rcv1_s {
1759 uint64_t intr:64;
1760 } s;
1761 struct cvmx_npei_msi_rcv1_s cn52xx;
1762 struct cvmx_npei_msi_rcv1_s cn52xxp1;
1763 struct cvmx_npei_msi_rcv1_s cn56xx;
1764 struct cvmx_npei_msi_rcv1_s cn56xxp1;
1765};
1766
1767union cvmx_npei_msi_rcv2 {
1768 uint64_t u64;
1769 struct cvmx_npei_msi_rcv2_s {
1770 uint64_t intr:64;
1771 } s;
1772 struct cvmx_npei_msi_rcv2_s cn52xx;
1773 struct cvmx_npei_msi_rcv2_s cn52xxp1;
1774 struct cvmx_npei_msi_rcv2_s cn56xx;
1775 struct cvmx_npei_msi_rcv2_s cn56xxp1;
1776};
1777
1778union cvmx_npei_msi_rcv3 {
1779 uint64_t u64;
1780 struct cvmx_npei_msi_rcv3_s {
1781 uint64_t intr:64;
1782 } s;
1783 struct cvmx_npei_msi_rcv3_s cn52xx;
1784 struct cvmx_npei_msi_rcv3_s cn52xxp1;
1785 struct cvmx_npei_msi_rcv3_s cn56xx;
1786 struct cvmx_npei_msi_rcv3_s cn56xxp1;
1787};
1788
1789union cvmx_npei_msi_rd_map {
1790 uint64_t u64;
1791 struct cvmx_npei_msi_rd_map_s {
1792 uint64_t reserved_16_63:48;
1793 uint64_t rd_int:8;
1794 uint64_t msi_int:8;
1795 } s;
1796 struct cvmx_npei_msi_rd_map_s cn52xx;
1797 struct cvmx_npei_msi_rd_map_s cn52xxp1;
1798 struct cvmx_npei_msi_rd_map_s cn56xx;
1799 struct cvmx_npei_msi_rd_map_s cn56xxp1;
1800};
1801
1802union cvmx_npei_msi_w1c_enb0 {
1803 uint64_t u64;
1804 struct cvmx_npei_msi_w1c_enb0_s {
1805 uint64_t clr:64;
1806 } s;
1807 struct cvmx_npei_msi_w1c_enb0_s cn52xx;
1808 struct cvmx_npei_msi_w1c_enb0_s cn56xx;
1809};
1810
1811union cvmx_npei_msi_w1c_enb1 {
1812 uint64_t u64;
1813 struct cvmx_npei_msi_w1c_enb1_s {
1814 uint64_t clr:64;
1815 } s;
1816 struct cvmx_npei_msi_w1c_enb1_s cn52xx;
1817 struct cvmx_npei_msi_w1c_enb1_s cn56xx;
1818};
1819
1820union cvmx_npei_msi_w1c_enb2 {
1821 uint64_t u64;
1822 struct cvmx_npei_msi_w1c_enb2_s {
1823 uint64_t clr:64;
1824 } s;
1825 struct cvmx_npei_msi_w1c_enb2_s cn52xx;
1826 struct cvmx_npei_msi_w1c_enb2_s cn56xx;
1827};
1828
1829union cvmx_npei_msi_w1c_enb3 {
1830 uint64_t u64;
1831 struct cvmx_npei_msi_w1c_enb3_s {
1832 uint64_t clr:64;
1833 } s;
1834 struct cvmx_npei_msi_w1c_enb3_s cn52xx;
1835 struct cvmx_npei_msi_w1c_enb3_s cn56xx;
1836};
1837
1838union cvmx_npei_msi_w1s_enb0 {
1839 uint64_t u64;
1840 struct cvmx_npei_msi_w1s_enb0_s {
1841 uint64_t set:64;
1842 } s;
1843 struct cvmx_npei_msi_w1s_enb0_s cn52xx;
1844 struct cvmx_npei_msi_w1s_enb0_s cn56xx;
1845};
1846
1847union cvmx_npei_msi_w1s_enb1 {
1848 uint64_t u64;
1849 struct cvmx_npei_msi_w1s_enb1_s {
1850 uint64_t set:64;
1851 } s;
1852 struct cvmx_npei_msi_w1s_enb1_s cn52xx;
1853 struct cvmx_npei_msi_w1s_enb1_s cn56xx;
1854};
1855
1856union cvmx_npei_msi_w1s_enb2 {
1857 uint64_t u64;
1858 struct cvmx_npei_msi_w1s_enb2_s {
1859 uint64_t set:64;
1860 } s;
1861 struct cvmx_npei_msi_w1s_enb2_s cn52xx;
1862 struct cvmx_npei_msi_w1s_enb2_s cn56xx;
1863};
1864
1865union cvmx_npei_msi_w1s_enb3 {
1866 uint64_t u64;
1867 struct cvmx_npei_msi_w1s_enb3_s {
1868 uint64_t set:64;
1869 } s;
1870 struct cvmx_npei_msi_w1s_enb3_s cn52xx;
1871 struct cvmx_npei_msi_w1s_enb3_s cn56xx;
1872};
1873
1874union cvmx_npei_msi_wr_map {
1875 uint64_t u64;
1876 struct cvmx_npei_msi_wr_map_s {
1877 uint64_t reserved_16_63:48;
1878 uint64_t ciu_int:8;
1879 uint64_t msi_int:8;
1880 } s;
1881 struct cvmx_npei_msi_wr_map_s cn52xx;
1882 struct cvmx_npei_msi_wr_map_s cn52xxp1;
1883 struct cvmx_npei_msi_wr_map_s cn56xx;
1884 struct cvmx_npei_msi_wr_map_s cn56xxp1;
1885};
1886
1887union cvmx_npei_pcie_credit_cnt {
1888 uint64_t u64;
1889 struct cvmx_npei_pcie_credit_cnt_s {
1890 uint64_t reserved_48_63:16;
1891 uint64_t p1_ccnt:8;
1892 uint64_t p1_ncnt:8;
1893 uint64_t p1_pcnt:8;
1894 uint64_t p0_ccnt:8;
1895 uint64_t p0_ncnt:8;
1896 uint64_t p0_pcnt:8;
1897 } s;
1898 struct cvmx_npei_pcie_credit_cnt_s cn52xx;
1899 struct cvmx_npei_pcie_credit_cnt_s cn56xx;
1900};
1901
1902union cvmx_npei_pcie_msi_rcv {
1903 uint64_t u64;
1904 struct cvmx_npei_pcie_msi_rcv_s {
1905 uint64_t reserved_8_63:56;
1906 uint64_t intr:8;
1907 } s;
1908 struct cvmx_npei_pcie_msi_rcv_s cn52xx;
1909 struct cvmx_npei_pcie_msi_rcv_s cn52xxp1;
1910 struct cvmx_npei_pcie_msi_rcv_s cn56xx;
1911 struct cvmx_npei_pcie_msi_rcv_s cn56xxp1;
1912};
1913
1914union cvmx_npei_pcie_msi_rcv_b1 {
1915 uint64_t u64;
1916 struct cvmx_npei_pcie_msi_rcv_b1_s {
1917 uint64_t reserved_16_63:48;
1918 uint64_t intr:8;
1919 uint64_t reserved_0_7:8;
1920 } s;
1921 struct cvmx_npei_pcie_msi_rcv_b1_s cn52xx;
1922 struct cvmx_npei_pcie_msi_rcv_b1_s cn52xxp1;
1923 struct cvmx_npei_pcie_msi_rcv_b1_s cn56xx;
1924 struct cvmx_npei_pcie_msi_rcv_b1_s cn56xxp1;
1925};
1926
1927union cvmx_npei_pcie_msi_rcv_b2 {
1928 uint64_t u64;
1929 struct cvmx_npei_pcie_msi_rcv_b2_s {
1930 uint64_t reserved_24_63:40;
1931 uint64_t intr:8;
1932 uint64_t reserved_0_15:16;
1933 } s;
1934 struct cvmx_npei_pcie_msi_rcv_b2_s cn52xx;
1935 struct cvmx_npei_pcie_msi_rcv_b2_s cn52xxp1;
1936 struct cvmx_npei_pcie_msi_rcv_b2_s cn56xx;
1937 struct cvmx_npei_pcie_msi_rcv_b2_s cn56xxp1;
1938};
1939
1940union cvmx_npei_pcie_msi_rcv_b3 {
1941 uint64_t u64;
1942 struct cvmx_npei_pcie_msi_rcv_b3_s {
1943 uint64_t reserved_32_63:32;
1944 uint64_t intr:8;
1945 uint64_t reserved_0_23:24;
1946 } s;
1947 struct cvmx_npei_pcie_msi_rcv_b3_s cn52xx;
1948 struct cvmx_npei_pcie_msi_rcv_b3_s cn52xxp1;
1949 struct cvmx_npei_pcie_msi_rcv_b3_s cn56xx;
1950 struct cvmx_npei_pcie_msi_rcv_b3_s cn56xxp1;
1951};
1952
1953union cvmx_npei_pktx_cnts {
1954 uint64_t u64;
1955 struct cvmx_npei_pktx_cnts_s {
1956 uint64_t reserved_54_63:10;
1957 uint64_t timer:22;
1958 uint64_t cnt:32;
1959 } s;
1960 struct cvmx_npei_pktx_cnts_s cn52xx;
1961 struct cvmx_npei_pktx_cnts_s cn56xx;
1962 struct cvmx_npei_pktx_cnts_s cn56xxp1;
1963};
1964
1965union cvmx_npei_pktx_in_bp {
1966 uint64_t u64;
1967 struct cvmx_npei_pktx_in_bp_s {
1968 uint64_t wmark:32;
1969 uint64_t cnt:32;
1970 } s;
1971 struct cvmx_npei_pktx_in_bp_s cn52xx;
1972 struct cvmx_npei_pktx_in_bp_s cn56xx;
1973 struct cvmx_npei_pktx_in_bp_s cn56xxp1;
1974};
1975
1976union cvmx_npei_pktx_instr_baddr {
1977 uint64_t u64;
1978 struct cvmx_npei_pktx_instr_baddr_s {
1979 uint64_t addr:61;
1980 uint64_t reserved_0_2:3;
1981 } s;
1982 struct cvmx_npei_pktx_instr_baddr_s cn52xx;
1983 struct cvmx_npei_pktx_instr_baddr_s cn56xx;
1984 struct cvmx_npei_pktx_instr_baddr_s cn56xxp1;
1985};
1986
1987union cvmx_npei_pktx_instr_baoff_dbell {
1988 uint64_t u64;
1989 struct cvmx_npei_pktx_instr_baoff_dbell_s {
1990 uint64_t aoff:32;
1991 uint64_t dbell:32;
1992 } s;
1993 struct cvmx_npei_pktx_instr_baoff_dbell_s cn52xx;
1994 struct cvmx_npei_pktx_instr_baoff_dbell_s cn56xx;
1995 struct cvmx_npei_pktx_instr_baoff_dbell_s cn56xxp1;
1996};
1997
1998union cvmx_npei_pktx_instr_fifo_rsize {
1999 uint64_t u64;
2000 struct cvmx_npei_pktx_instr_fifo_rsize_s {
2001 uint64_t max:9;
2002 uint64_t rrp:9;
2003 uint64_t wrp:9;
2004 uint64_t fcnt:5;
2005 uint64_t rsize:32;
2006 } s;
2007 struct cvmx_npei_pktx_instr_fifo_rsize_s cn52xx;
2008 struct cvmx_npei_pktx_instr_fifo_rsize_s cn56xx;
2009 struct cvmx_npei_pktx_instr_fifo_rsize_s cn56xxp1;
2010};
2011
2012union cvmx_npei_pktx_instr_header {
2013 uint64_t u64;
2014 struct cvmx_npei_pktx_instr_header_s {
2015 uint64_t reserved_44_63:20;
2016 uint64_t pbp:1;
2017 uint64_t rsv_f:5;
2018 uint64_t rparmode:2;
2019 uint64_t rsv_e:1;
2020 uint64_t rskp_len:7;
2021 uint64_t rsv_d:6;
2022 uint64_t use_ihdr:1;
2023 uint64_t rsv_c:5;
2024 uint64_t par_mode:2;
2025 uint64_t rsv_b:1;
2026 uint64_t skp_len:7;
2027 uint64_t rsv_a:6;
2028 } s;
2029 struct cvmx_npei_pktx_instr_header_s cn52xx;
2030 struct cvmx_npei_pktx_instr_header_s cn56xx;
2031 struct cvmx_npei_pktx_instr_header_s cn56xxp1;
2032};
2033
2034union cvmx_npei_pktx_slist_baddr {
2035 uint64_t u64;
2036 struct cvmx_npei_pktx_slist_baddr_s {
2037 uint64_t addr:60;
2038 uint64_t reserved_0_3:4;
2039 } s;
2040 struct cvmx_npei_pktx_slist_baddr_s cn52xx;
2041 struct cvmx_npei_pktx_slist_baddr_s cn56xx;
2042 struct cvmx_npei_pktx_slist_baddr_s cn56xxp1;
2043};
2044
2045union cvmx_npei_pktx_slist_baoff_dbell {
2046 uint64_t u64;
2047 struct cvmx_npei_pktx_slist_baoff_dbell_s {
2048 uint64_t aoff:32;
2049 uint64_t dbell:32;
2050 } s;
2051 struct cvmx_npei_pktx_slist_baoff_dbell_s cn52xx;
2052 struct cvmx_npei_pktx_slist_baoff_dbell_s cn56xx;
2053 struct cvmx_npei_pktx_slist_baoff_dbell_s cn56xxp1;
2054};
2055
2056union cvmx_npei_pktx_slist_fifo_rsize {
2057 uint64_t u64;
2058 struct cvmx_npei_pktx_slist_fifo_rsize_s {
2059 uint64_t reserved_32_63:32;
2060 uint64_t rsize:32;
2061 } s;
2062 struct cvmx_npei_pktx_slist_fifo_rsize_s cn52xx;
2063 struct cvmx_npei_pktx_slist_fifo_rsize_s cn56xx;
2064 struct cvmx_npei_pktx_slist_fifo_rsize_s cn56xxp1;
2065};
2066
2067union cvmx_npei_pkt_cnt_int {
2068 uint64_t u64;
2069 struct cvmx_npei_pkt_cnt_int_s {
2070 uint64_t reserved_32_63:32;
2071 uint64_t port:32;
2072 } s;
2073 struct cvmx_npei_pkt_cnt_int_s cn52xx;
2074 struct cvmx_npei_pkt_cnt_int_s cn56xx;
2075 struct cvmx_npei_pkt_cnt_int_s cn56xxp1;
2076};
2077
2078union cvmx_npei_pkt_cnt_int_enb {
2079 uint64_t u64;
2080 struct cvmx_npei_pkt_cnt_int_enb_s {
2081 uint64_t reserved_32_63:32;
2082 uint64_t port:32;
2083 } s;
2084 struct cvmx_npei_pkt_cnt_int_enb_s cn52xx;
2085 struct cvmx_npei_pkt_cnt_int_enb_s cn56xx;
2086 struct cvmx_npei_pkt_cnt_int_enb_s cn56xxp1;
2087};
2088
2089union cvmx_npei_pkt_data_out_es {
2090 uint64_t u64;
2091 struct cvmx_npei_pkt_data_out_es_s {
2092 uint64_t es:64;
2093 } s;
2094 struct cvmx_npei_pkt_data_out_es_s cn52xx;
2095 struct cvmx_npei_pkt_data_out_es_s cn56xx;
2096 struct cvmx_npei_pkt_data_out_es_s cn56xxp1;
2097};
2098
2099union cvmx_npei_pkt_data_out_ns {
2100 uint64_t u64;
2101 struct cvmx_npei_pkt_data_out_ns_s {
2102 uint64_t reserved_32_63:32;
2103 uint64_t nsr:32;
2104 } s;
2105 struct cvmx_npei_pkt_data_out_ns_s cn52xx;
2106 struct cvmx_npei_pkt_data_out_ns_s cn56xx;
2107 struct cvmx_npei_pkt_data_out_ns_s cn56xxp1;
2108};
2109
2110union cvmx_npei_pkt_data_out_ror {
2111 uint64_t u64;
2112 struct cvmx_npei_pkt_data_out_ror_s {
2113 uint64_t reserved_32_63:32;
2114 uint64_t ror:32;
2115 } s;
2116 struct cvmx_npei_pkt_data_out_ror_s cn52xx;
2117 struct cvmx_npei_pkt_data_out_ror_s cn56xx;
2118 struct cvmx_npei_pkt_data_out_ror_s cn56xxp1;
2119};
2120
2121union cvmx_npei_pkt_dpaddr {
2122 uint64_t u64;
2123 struct cvmx_npei_pkt_dpaddr_s {
2124 uint64_t reserved_32_63:32;
2125 uint64_t dptr:32;
2126 } s;
2127 struct cvmx_npei_pkt_dpaddr_s cn52xx;
2128 struct cvmx_npei_pkt_dpaddr_s cn56xx;
2129 struct cvmx_npei_pkt_dpaddr_s cn56xxp1;
2130};
2131
2132union cvmx_npei_pkt_in_bp {
2133 uint64_t u64;
2134 struct cvmx_npei_pkt_in_bp_s {
2135 uint64_t reserved_32_63:32;
2136 uint64_t bp:32;
2137 } s;
2138 struct cvmx_npei_pkt_in_bp_s cn56xx;
2139};
2140
2141union cvmx_npei_pkt_in_donex_cnts {
2142 uint64_t u64;
2143 struct cvmx_npei_pkt_in_donex_cnts_s {
2144 uint64_t reserved_32_63:32;
2145 uint64_t cnt:32;
2146 } s;
2147 struct cvmx_npei_pkt_in_donex_cnts_s cn52xx;
2148 struct cvmx_npei_pkt_in_donex_cnts_s cn56xx;
2149 struct cvmx_npei_pkt_in_donex_cnts_s cn56xxp1;
2150};
2151
2152union cvmx_npei_pkt_in_instr_counts {
2153 uint64_t u64;
2154 struct cvmx_npei_pkt_in_instr_counts_s {
2155 uint64_t wr_cnt:32;
2156 uint64_t rd_cnt:32;
2157 } s;
2158 struct cvmx_npei_pkt_in_instr_counts_s cn52xx;
2159 struct cvmx_npei_pkt_in_instr_counts_s cn56xx;
2160};
2161
2162union cvmx_npei_pkt_in_pcie_port {
2163 uint64_t u64;
2164 struct cvmx_npei_pkt_in_pcie_port_s {
2165 uint64_t pp:64;
2166 } s;
2167 struct cvmx_npei_pkt_in_pcie_port_s cn52xx;
2168 struct cvmx_npei_pkt_in_pcie_port_s cn56xx;
2169};
2170
2171union cvmx_npei_pkt_input_control {
2172 uint64_t u64;
2173 struct cvmx_npei_pkt_input_control_s {
2174 uint64_t reserved_23_63:41;
2175 uint64_t pkt_rr:1;
2176 uint64_t pbp_dhi:13;
2177 uint64_t d_nsr:1;
2178 uint64_t d_esr:2;
2179 uint64_t d_ror:1;
2180 uint64_t use_csr:1;
2181 uint64_t nsr:1;
2182 uint64_t esr:2;
2183 uint64_t ror:1;
2184 } s;
2185 struct cvmx_npei_pkt_input_control_s cn52xx;
2186 struct cvmx_npei_pkt_input_control_s cn56xx;
2187 struct cvmx_npei_pkt_input_control_s cn56xxp1;
2188};
2189
2190union cvmx_npei_pkt_instr_enb {
2191 uint64_t u64;
2192 struct cvmx_npei_pkt_instr_enb_s {
2193 uint64_t reserved_32_63:32;
2194 uint64_t enb:32;
2195 } s;
2196 struct cvmx_npei_pkt_instr_enb_s cn52xx;
2197 struct cvmx_npei_pkt_instr_enb_s cn56xx;
2198 struct cvmx_npei_pkt_instr_enb_s cn56xxp1;
2199};
2200
2201union cvmx_npei_pkt_instr_rd_size {
2202 uint64_t u64;
2203 struct cvmx_npei_pkt_instr_rd_size_s {
2204 uint64_t rdsize:64;
2205 } s;
2206 struct cvmx_npei_pkt_instr_rd_size_s cn52xx;
2207 struct cvmx_npei_pkt_instr_rd_size_s cn56xx;
2208};
2209
2210union cvmx_npei_pkt_instr_size {
2211 uint64_t u64;
2212 struct cvmx_npei_pkt_instr_size_s {
2213 uint64_t reserved_32_63:32;
2214 uint64_t is_64b:32;
2215 } s;
2216 struct cvmx_npei_pkt_instr_size_s cn52xx;
2217 struct cvmx_npei_pkt_instr_size_s cn56xx;
2218 struct cvmx_npei_pkt_instr_size_s cn56xxp1;
2219};
2220
2221union cvmx_npei_pkt_int_levels {
2222 uint64_t u64;
2223 struct cvmx_npei_pkt_int_levels_s {
2224 uint64_t reserved_54_63:10;
2225 uint64_t time:22;
2226 uint64_t cnt:32;
2227 } s;
2228 struct cvmx_npei_pkt_int_levels_s cn52xx;
2229 struct cvmx_npei_pkt_int_levels_s cn56xx;
2230 struct cvmx_npei_pkt_int_levels_s cn56xxp1;
2231};
2232
2233union cvmx_npei_pkt_iptr {
2234 uint64_t u64;
2235 struct cvmx_npei_pkt_iptr_s {
2236 uint64_t reserved_32_63:32;
2237 uint64_t iptr:32;
2238 } s;
2239 struct cvmx_npei_pkt_iptr_s cn52xx;
2240 struct cvmx_npei_pkt_iptr_s cn56xx;
2241 struct cvmx_npei_pkt_iptr_s cn56xxp1;
2242};
2243
2244union cvmx_npei_pkt_out_bmode {
2245 uint64_t u64;
2246 struct cvmx_npei_pkt_out_bmode_s {
2247 uint64_t reserved_32_63:32;
2248 uint64_t bmode:32;
2249 } s;
2250 struct cvmx_npei_pkt_out_bmode_s cn52xx;
2251 struct cvmx_npei_pkt_out_bmode_s cn56xx;
2252 struct cvmx_npei_pkt_out_bmode_s cn56xxp1;
2253};
2254
2255union cvmx_npei_pkt_out_enb {
2256 uint64_t u64;
2257 struct cvmx_npei_pkt_out_enb_s {
2258 uint64_t reserved_32_63:32;
2259 uint64_t enb:32;
2260 } s;
2261 struct cvmx_npei_pkt_out_enb_s cn52xx;
2262 struct cvmx_npei_pkt_out_enb_s cn56xx;
2263 struct cvmx_npei_pkt_out_enb_s cn56xxp1;
2264};
2265
2266union cvmx_npei_pkt_output_wmark {
2267 uint64_t u64;
2268 struct cvmx_npei_pkt_output_wmark_s {
2269 uint64_t reserved_32_63:32;
2270 uint64_t wmark:32;
2271 } s;
2272 struct cvmx_npei_pkt_output_wmark_s cn52xx;
2273 struct cvmx_npei_pkt_output_wmark_s cn56xx;
2274};
2275
2276union cvmx_npei_pkt_pcie_port {
2277 uint64_t u64;
2278 struct cvmx_npei_pkt_pcie_port_s {
2279 uint64_t pp:64;
2280 } s;
2281 struct cvmx_npei_pkt_pcie_port_s cn52xx;
2282 struct cvmx_npei_pkt_pcie_port_s cn56xx;
2283 struct cvmx_npei_pkt_pcie_port_s cn56xxp1;
2284};
2285
2286union cvmx_npei_pkt_port_in_rst {
2287 uint64_t u64;
2288 struct cvmx_npei_pkt_port_in_rst_s {
2289 uint64_t in_rst:32;
2290 uint64_t out_rst:32;
2291 } s;
2292 struct cvmx_npei_pkt_port_in_rst_s cn52xx;
2293 struct cvmx_npei_pkt_port_in_rst_s cn56xx;
2294};
2295
2296union cvmx_npei_pkt_slist_es {
2297 uint64_t u64;
2298 struct cvmx_npei_pkt_slist_es_s {
2299 uint64_t es:64;
2300 } s;
2301 struct cvmx_npei_pkt_slist_es_s cn52xx;
2302 struct cvmx_npei_pkt_slist_es_s cn56xx;
2303 struct cvmx_npei_pkt_slist_es_s cn56xxp1;
2304};
2305
2306union cvmx_npei_pkt_slist_id_size {
2307 uint64_t u64;
2308 struct cvmx_npei_pkt_slist_id_size_s {
2309 uint64_t reserved_23_63:41;
2310 uint64_t isize:7;
2311 uint64_t bsize:16;
2312 } s;
2313 struct cvmx_npei_pkt_slist_id_size_s cn52xx;
2314 struct cvmx_npei_pkt_slist_id_size_s cn56xx;
2315 struct cvmx_npei_pkt_slist_id_size_s cn56xxp1;
2316};
2317
2318union cvmx_npei_pkt_slist_ns {
2319 uint64_t u64;
2320 struct cvmx_npei_pkt_slist_ns_s {
2321 uint64_t reserved_32_63:32;
2322 uint64_t nsr:32;
2323 } s;
2324 struct cvmx_npei_pkt_slist_ns_s cn52xx;
2325 struct cvmx_npei_pkt_slist_ns_s cn56xx;
2326 struct cvmx_npei_pkt_slist_ns_s cn56xxp1;
2327};
2328
2329union cvmx_npei_pkt_slist_ror {
2330 uint64_t u64;
2331 struct cvmx_npei_pkt_slist_ror_s {
2332 uint64_t reserved_32_63:32;
2333 uint64_t ror:32;
2334 } s;
2335 struct cvmx_npei_pkt_slist_ror_s cn52xx;
2336 struct cvmx_npei_pkt_slist_ror_s cn56xx;
2337 struct cvmx_npei_pkt_slist_ror_s cn56xxp1;
2338};
2339
2340union cvmx_npei_pkt_time_int {
2341 uint64_t u64;
2342 struct cvmx_npei_pkt_time_int_s {
2343 uint64_t reserved_32_63:32;
2344 uint64_t port:32;
2345 } s;
2346 struct cvmx_npei_pkt_time_int_s cn52xx;
2347 struct cvmx_npei_pkt_time_int_s cn56xx;
2348 struct cvmx_npei_pkt_time_int_s cn56xxp1;
2349};
2350
2351union cvmx_npei_pkt_time_int_enb {
2352 uint64_t u64;
2353 struct cvmx_npei_pkt_time_int_enb_s {
2354 uint64_t reserved_32_63:32;
2355 uint64_t port:32;
2356 } s;
2357 struct cvmx_npei_pkt_time_int_enb_s cn52xx;
2358 struct cvmx_npei_pkt_time_int_enb_s cn56xx;
2359 struct cvmx_npei_pkt_time_int_enb_s cn56xxp1;
2360};
2361
2362union cvmx_npei_rsl_int_blocks {
2363 uint64_t u64;
2364 struct cvmx_npei_rsl_int_blocks_s {
2365 uint64_t reserved_31_63:33;
2366 uint64_t iob:1;
2367 uint64_t lmc1:1;
2368 uint64_t agl:1;
2369 uint64_t reserved_24_27:4;
2370 uint64_t asxpcs1:1;
2371 uint64_t asxpcs0:1;
2372 uint64_t reserved_21_21:1;
2373 uint64_t pip:1;
2374 uint64_t reserved_18_19:2;
2375 uint64_t lmc0:1;
2376 uint64_t l2c:1;
2377 uint64_t usb1:1;
2378 uint64_t rad:1;
2379 uint64_t usb:1;
2380 uint64_t pow:1;
2381 uint64_t tim:1;
2382 uint64_t pko:1;
2383 uint64_t ipd:1;
2384 uint64_t reserved_8_8:1;
2385 uint64_t zip:1;
2386 uint64_t reserved_6_6:1;
2387 uint64_t fpa:1;
2388 uint64_t key:1;
2389 uint64_t npei:1;
2390 uint64_t gmx1:1;
2391 uint64_t gmx0:1;
2392 uint64_t mio:1;
2393 } s;
2394 struct cvmx_npei_rsl_int_blocks_s cn52xx;
2395 struct cvmx_npei_rsl_int_blocks_s cn52xxp1;
2396 struct cvmx_npei_rsl_int_blocks_cn56xx {
2397 uint64_t reserved_31_63:33;
2398 uint64_t iob:1;
2399 uint64_t lmc1:1;
2400 uint64_t agl:1;
2401 uint64_t reserved_24_27:4;
2402 uint64_t asxpcs1:1;
2403 uint64_t asxpcs0:1;
2404 uint64_t reserved_21_21:1;
2405 uint64_t pip:1;
2406 uint64_t reserved_18_19:2;
2407 uint64_t lmc0:1;
2408 uint64_t l2c:1;
2409 uint64_t reserved_15_15:1;
2410 uint64_t rad:1;
2411 uint64_t usb:1;
2412 uint64_t pow:1;
2413 uint64_t tim:1;
2414 uint64_t pko:1;
2415 uint64_t ipd:1;
2416 uint64_t reserved_8_8:1;
2417 uint64_t zip:1;
2418 uint64_t reserved_6_6:1;
2419 uint64_t fpa:1;
2420 uint64_t key:1;
2421 uint64_t npei:1;
2422 uint64_t gmx1:1;
2423 uint64_t gmx0:1;
2424 uint64_t mio:1;
2425 } cn56xx;
2426 struct cvmx_npei_rsl_int_blocks_cn56xx cn56xxp1;
2427};
2428
2429union cvmx_npei_scratch_1 {
2430 uint64_t u64;
2431 struct cvmx_npei_scratch_1_s {
2432 uint64_t data:64;
2433 } s;
2434 struct cvmx_npei_scratch_1_s cn52xx;
2435 struct cvmx_npei_scratch_1_s cn52xxp1;
2436 struct cvmx_npei_scratch_1_s cn56xx;
2437 struct cvmx_npei_scratch_1_s cn56xxp1;
2438};
2439
2440union cvmx_npei_state1 {
2441 uint64_t u64;
2442 struct cvmx_npei_state1_s {
2443 uint64_t cpl1:12;
2444 uint64_t cpl0:12;
2445 uint64_t arb:1;
2446 uint64_t csr:39;
2447 } s;
2448 struct cvmx_npei_state1_s cn52xx;
2449 struct cvmx_npei_state1_s cn52xxp1;
2450 struct cvmx_npei_state1_s cn56xx;
2451 struct cvmx_npei_state1_s cn56xxp1;
2452};
2453
2454union cvmx_npei_state2 {
2455 uint64_t u64;
2456 struct cvmx_npei_state2_s {
2457 uint64_t reserved_48_63:16;
2458 uint64_t npei:1;
2459 uint64_t rac:1;
2460 uint64_t csm1:15;
2461 uint64_t csm0:15;
2462 uint64_t nnp0:8;
2463 uint64_t nnd:8;
2464 } s;
2465 struct cvmx_npei_state2_s cn52xx;
2466 struct cvmx_npei_state2_s cn52xxp1;
2467 struct cvmx_npei_state2_s cn56xx;
2468 struct cvmx_npei_state2_s cn56xxp1;
2469};
2470
2471union cvmx_npei_state3 {
2472 uint64_t u64;
2473 struct cvmx_npei_state3_s {
2474 uint64_t reserved_56_63:8;
2475 uint64_t psm1:15;
2476 uint64_t psm0:15;
2477 uint64_t nsm1:13;
2478 uint64_t nsm0:13;
2479 } s;
2480 struct cvmx_npei_state3_s cn52xx;
2481 struct cvmx_npei_state3_s cn52xxp1;
2482 struct cvmx_npei_state3_s cn56xx;
2483 struct cvmx_npei_state3_s cn56xxp1;
2484};
2485
2486union cvmx_npei_win_rd_addr {
2487 uint64_t u64;
2488 struct cvmx_npei_win_rd_addr_s {
2489 uint64_t reserved_51_63:13;
2490 uint64_t ld_cmd:2;
2491 uint64_t iobit:1;
2492 uint64_t rd_addr:48;
2493 } s;
2494 struct cvmx_npei_win_rd_addr_s cn52xx;
2495 struct cvmx_npei_win_rd_addr_s cn52xxp1;
2496 struct cvmx_npei_win_rd_addr_s cn56xx;
2497 struct cvmx_npei_win_rd_addr_s cn56xxp1;
2498};
2499
2500union cvmx_npei_win_rd_data {
2501 uint64_t u64;
2502 struct cvmx_npei_win_rd_data_s {
2503 uint64_t rd_data:64;
2504 } s;
2505 struct cvmx_npei_win_rd_data_s cn52xx;
2506 struct cvmx_npei_win_rd_data_s cn52xxp1;
2507 struct cvmx_npei_win_rd_data_s cn56xx;
2508 struct cvmx_npei_win_rd_data_s cn56xxp1;
2509};
2510
2511union cvmx_npei_win_wr_addr {
2512 uint64_t u64;
2513 struct cvmx_npei_win_wr_addr_s {
2514 uint64_t reserved_49_63:15;
2515 uint64_t iobit:1;
2516 uint64_t wr_addr:46;
2517 uint64_t reserved_0_1:2;
2518 } s;
2519 struct cvmx_npei_win_wr_addr_s cn52xx;
2520 struct cvmx_npei_win_wr_addr_s cn52xxp1;
2521 struct cvmx_npei_win_wr_addr_s cn56xx;
2522 struct cvmx_npei_win_wr_addr_s cn56xxp1;
2523};
2524
2525union cvmx_npei_win_wr_data {
2526 uint64_t u64;
2527 struct cvmx_npei_win_wr_data_s {
2528 uint64_t wr_data:64;
2529 } s;
2530 struct cvmx_npei_win_wr_data_s cn52xx;
2531 struct cvmx_npei_win_wr_data_s cn52xxp1;
2532 struct cvmx_npei_win_wr_data_s cn56xx;
2533 struct cvmx_npei_win_wr_data_s cn56xxp1;
2534};
2535
2536union cvmx_npei_win_wr_mask {
2537 uint64_t u64;
2538 struct cvmx_npei_win_wr_mask_s {
2539 uint64_t reserved_8_63:56;
2540 uint64_t wr_mask:8;
2541 } s;
2542 struct cvmx_npei_win_wr_mask_s cn52xx;
2543 struct cvmx_npei_win_wr_mask_s cn52xxp1;
2544 struct cvmx_npei_win_wr_mask_s cn56xx;
2545 struct cvmx_npei_win_wr_mask_s cn56xxp1;
2546};
2547
2548union cvmx_npei_window_ctl {
2549 uint64_t u64;
2550 struct cvmx_npei_window_ctl_s {
2551 uint64_t reserved_32_63:32;
2552 uint64_t time:32;
2553 } s;
2554 struct cvmx_npei_window_ctl_s cn52xx;
2555 struct cvmx_npei_window_ctl_s cn52xxp1;
2556 struct cvmx_npei_window_ctl_s cn56xx;
2557 struct cvmx_npei_window_ctl_s cn56xxp1;
2558};
2559
2560#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-npi-defs.h b/arch/mips/include/asm/octeon/cvmx-npi-defs.h
new file mode 100644
index 000000000000..4e03cd8561e3
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-npi-defs.h
@@ -0,0 +1,1735 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_NPI_DEFS_H__
29#define __CVMX_NPI_DEFS_H__
30
31#define CVMX_NPI_BASE_ADDR_INPUT0 \
32 CVMX_ADD_IO_SEG(0x00011F0000000070ull)
33#define CVMX_NPI_BASE_ADDR_INPUT1 \
34 CVMX_ADD_IO_SEG(0x00011F0000000080ull)
35#define CVMX_NPI_BASE_ADDR_INPUT2 \
36 CVMX_ADD_IO_SEG(0x00011F0000000090ull)
37#define CVMX_NPI_BASE_ADDR_INPUT3 \
38 CVMX_ADD_IO_SEG(0x00011F00000000A0ull)
39#define CVMX_NPI_BASE_ADDR_INPUTX(offset) \
40 CVMX_ADD_IO_SEG(0x00011F0000000070ull + (((offset) & 3) * 16))
41#define CVMX_NPI_BASE_ADDR_OUTPUT0 \
42 CVMX_ADD_IO_SEG(0x00011F00000000B8ull)
43#define CVMX_NPI_BASE_ADDR_OUTPUT1 \
44 CVMX_ADD_IO_SEG(0x00011F00000000C0ull)
45#define CVMX_NPI_BASE_ADDR_OUTPUT2 \
46 CVMX_ADD_IO_SEG(0x00011F00000000C8ull)
47#define CVMX_NPI_BASE_ADDR_OUTPUT3 \
48 CVMX_ADD_IO_SEG(0x00011F00000000D0ull)
49#define CVMX_NPI_BASE_ADDR_OUTPUTX(offset) \
50 CVMX_ADD_IO_SEG(0x00011F00000000B8ull + (((offset) & 3) * 8))
51#define CVMX_NPI_BIST_STATUS \
52 CVMX_ADD_IO_SEG(0x00011F00000003F8ull)
53#define CVMX_NPI_BUFF_SIZE_OUTPUT0 \
54 CVMX_ADD_IO_SEG(0x00011F00000000E0ull)
55#define CVMX_NPI_BUFF_SIZE_OUTPUT1 \
56 CVMX_ADD_IO_SEG(0x00011F00000000E8ull)
57#define CVMX_NPI_BUFF_SIZE_OUTPUT2 \
58 CVMX_ADD_IO_SEG(0x00011F00000000F0ull)
59#define CVMX_NPI_BUFF_SIZE_OUTPUT3 \
60 CVMX_ADD_IO_SEG(0x00011F00000000F8ull)
61#define CVMX_NPI_BUFF_SIZE_OUTPUTX(offset) \
62 CVMX_ADD_IO_SEG(0x00011F00000000E0ull + (((offset) & 3) * 8))
63#define CVMX_NPI_COMP_CTL \
64 CVMX_ADD_IO_SEG(0x00011F0000000218ull)
65#define CVMX_NPI_CTL_STATUS \
66 CVMX_ADD_IO_SEG(0x00011F0000000010ull)
67#define CVMX_NPI_DBG_SELECT \
68 CVMX_ADD_IO_SEG(0x00011F0000000008ull)
69#define CVMX_NPI_DMA_CONTROL \
70 CVMX_ADD_IO_SEG(0x00011F0000000128ull)
71#define CVMX_NPI_DMA_HIGHP_COUNTS \
72 CVMX_ADD_IO_SEG(0x00011F0000000148ull)
73#define CVMX_NPI_DMA_HIGHP_NADDR \
74 CVMX_ADD_IO_SEG(0x00011F0000000158ull)
75#define CVMX_NPI_DMA_LOWP_COUNTS \
76 CVMX_ADD_IO_SEG(0x00011F0000000140ull)
77#define CVMX_NPI_DMA_LOWP_NADDR \
78 CVMX_ADD_IO_SEG(0x00011F0000000150ull)
79#define CVMX_NPI_HIGHP_DBELL \
80 CVMX_ADD_IO_SEG(0x00011F0000000120ull)
81#define CVMX_NPI_HIGHP_IBUFF_SADDR \
82 CVMX_ADD_IO_SEG(0x00011F0000000110ull)
83#define CVMX_NPI_INPUT_CONTROL \
84 CVMX_ADD_IO_SEG(0x00011F0000000138ull)
85#define CVMX_NPI_INT_ENB \
86 CVMX_ADD_IO_SEG(0x00011F0000000020ull)
87#define CVMX_NPI_INT_SUM \
88 CVMX_ADD_IO_SEG(0x00011F0000000018ull)
89#define CVMX_NPI_LOWP_DBELL \
90 CVMX_ADD_IO_SEG(0x00011F0000000118ull)
91#define CVMX_NPI_LOWP_IBUFF_SADDR \
92 CVMX_ADD_IO_SEG(0x00011F0000000108ull)
93#define CVMX_NPI_MEM_ACCESS_SUBID3 \
94 CVMX_ADD_IO_SEG(0x00011F0000000028ull)
95#define CVMX_NPI_MEM_ACCESS_SUBID4 \
96 CVMX_ADD_IO_SEG(0x00011F0000000030ull)
97#define CVMX_NPI_MEM_ACCESS_SUBID5 \
98 CVMX_ADD_IO_SEG(0x00011F0000000038ull)
99#define CVMX_NPI_MEM_ACCESS_SUBID6 \
100 CVMX_ADD_IO_SEG(0x00011F0000000040ull)
101#define CVMX_NPI_MEM_ACCESS_SUBIDX(offset) \
102 CVMX_ADD_IO_SEG(0x00011F0000000028ull + (((offset) & 7) * 8) - 8 * 3)
103#define CVMX_NPI_MSI_RCV \
104 (0x0000000000000190ull)
105#define CVMX_NPI_NPI_MSI_RCV \
106 CVMX_ADD_IO_SEG(0x00011F0000001190ull)
107#define CVMX_NPI_NUM_DESC_OUTPUT0 \
108 CVMX_ADD_IO_SEG(0x00011F0000000050ull)
109#define CVMX_NPI_NUM_DESC_OUTPUT1 \
110 CVMX_ADD_IO_SEG(0x00011F0000000058ull)
111#define CVMX_NPI_NUM_DESC_OUTPUT2 \
112 CVMX_ADD_IO_SEG(0x00011F0000000060ull)
113#define CVMX_NPI_NUM_DESC_OUTPUT3 \
114 CVMX_ADD_IO_SEG(0x00011F0000000068ull)
115#define CVMX_NPI_NUM_DESC_OUTPUTX(offset) \
116 CVMX_ADD_IO_SEG(0x00011F0000000050ull + (((offset) & 3) * 8))
117#define CVMX_NPI_OUTPUT_CONTROL \
118 CVMX_ADD_IO_SEG(0x00011F0000000100ull)
119#define CVMX_NPI_P0_DBPAIR_ADDR \
120 CVMX_ADD_IO_SEG(0x00011F0000000180ull)
121#define CVMX_NPI_P0_INSTR_ADDR \
122 CVMX_ADD_IO_SEG(0x00011F00000001C0ull)
123#define CVMX_NPI_P0_INSTR_CNTS \
124 CVMX_ADD_IO_SEG(0x00011F00000001A0ull)
125#define CVMX_NPI_P0_PAIR_CNTS \
126 CVMX_ADD_IO_SEG(0x00011F0000000160ull)
127#define CVMX_NPI_P1_DBPAIR_ADDR \
128 CVMX_ADD_IO_SEG(0x00011F0000000188ull)
129#define CVMX_NPI_P1_INSTR_ADDR \
130 CVMX_ADD_IO_SEG(0x00011F00000001C8ull)
131#define CVMX_NPI_P1_INSTR_CNTS \
132 CVMX_ADD_IO_SEG(0x00011F00000001A8ull)
133#define CVMX_NPI_P1_PAIR_CNTS \
134 CVMX_ADD_IO_SEG(0x00011F0000000168ull)
135#define CVMX_NPI_P2_DBPAIR_ADDR \
136 CVMX_ADD_IO_SEG(0x00011F0000000190ull)
137#define CVMX_NPI_P2_INSTR_ADDR \
138 CVMX_ADD_IO_SEG(0x00011F00000001D0ull)
139#define CVMX_NPI_P2_INSTR_CNTS \
140 CVMX_ADD_IO_SEG(0x00011F00000001B0ull)
141#define CVMX_NPI_P2_PAIR_CNTS \
142 CVMX_ADD_IO_SEG(0x00011F0000000170ull)
143#define CVMX_NPI_P3_DBPAIR_ADDR \
144 CVMX_ADD_IO_SEG(0x00011F0000000198ull)
145#define CVMX_NPI_P3_INSTR_ADDR \
146 CVMX_ADD_IO_SEG(0x00011F00000001D8ull)
147#define CVMX_NPI_P3_INSTR_CNTS \
148 CVMX_ADD_IO_SEG(0x00011F00000001B8ull)
149#define CVMX_NPI_P3_PAIR_CNTS \
150 CVMX_ADD_IO_SEG(0x00011F0000000178ull)
151#define CVMX_NPI_PCI_BAR1_INDEXX(offset) \
152 CVMX_ADD_IO_SEG(0x00011F0000001100ull + (((offset) & 31) * 4))
153#define CVMX_NPI_PCI_BIST_REG \
154 CVMX_ADD_IO_SEG(0x00011F00000011C0ull)
155#define CVMX_NPI_PCI_BURST_SIZE \
156 CVMX_ADD_IO_SEG(0x00011F00000000D8ull)
157#define CVMX_NPI_PCI_CFG00 \
158 CVMX_ADD_IO_SEG(0x00011F0000001800ull)
159#define CVMX_NPI_PCI_CFG01 \
160 CVMX_ADD_IO_SEG(0x00011F0000001804ull)
161#define CVMX_NPI_PCI_CFG02 \
162 CVMX_ADD_IO_SEG(0x00011F0000001808ull)
163#define CVMX_NPI_PCI_CFG03 \
164 CVMX_ADD_IO_SEG(0x00011F000000180Cull)
165#define CVMX_NPI_PCI_CFG04 \
166 CVMX_ADD_IO_SEG(0x00011F0000001810ull)
167#define CVMX_NPI_PCI_CFG05 \
168 CVMX_ADD_IO_SEG(0x00011F0000001814ull)
169#define CVMX_NPI_PCI_CFG06 \
170 CVMX_ADD_IO_SEG(0x00011F0000001818ull)
171#define CVMX_NPI_PCI_CFG07 \
172 CVMX_ADD_IO_SEG(0x00011F000000181Cull)
173#define CVMX_NPI_PCI_CFG08 \
174 CVMX_ADD_IO_SEG(0x00011F0000001820ull)
175#define CVMX_NPI_PCI_CFG09 \
176 CVMX_ADD_IO_SEG(0x00011F0000001824ull)
177#define CVMX_NPI_PCI_CFG10 \
178 CVMX_ADD_IO_SEG(0x00011F0000001828ull)
179#define CVMX_NPI_PCI_CFG11 \
180 CVMX_ADD_IO_SEG(0x00011F000000182Cull)
181#define CVMX_NPI_PCI_CFG12 \
182 CVMX_ADD_IO_SEG(0x00011F0000001830ull)
183#define CVMX_NPI_PCI_CFG13 \
184 CVMX_ADD_IO_SEG(0x00011F0000001834ull)
185#define CVMX_NPI_PCI_CFG15 \
186 CVMX_ADD_IO_SEG(0x00011F000000183Cull)
187#define CVMX_NPI_PCI_CFG16 \
188 CVMX_ADD_IO_SEG(0x00011F0000001840ull)
189#define CVMX_NPI_PCI_CFG17 \
190 CVMX_ADD_IO_SEG(0x00011F0000001844ull)
191#define CVMX_NPI_PCI_CFG18 \
192 CVMX_ADD_IO_SEG(0x00011F0000001848ull)
193#define CVMX_NPI_PCI_CFG19 \
194 CVMX_ADD_IO_SEG(0x00011F000000184Cull)
195#define CVMX_NPI_PCI_CFG20 \
196 CVMX_ADD_IO_SEG(0x00011F0000001850ull)
197#define CVMX_NPI_PCI_CFG21 \
198 CVMX_ADD_IO_SEG(0x00011F0000001854ull)
199#define CVMX_NPI_PCI_CFG22 \
200 CVMX_ADD_IO_SEG(0x00011F0000001858ull)
201#define CVMX_NPI_PCI_CFG56 \
202 CVMX_ADD_IO_SEG(0x00011F00000018E0ull)
203#define CVMX_NPI_PCI_CFG57 \
204 CVMX_ADD_IO_SEG(0x00011F00000018E4ull)
205#define CVMX_NPI_PCI_CFG58 \
206 CVMX_ADD_IO_SEG(0x00011F00000018E8ull)
207#define CVMX_NPI_PCI_CFG59 \
208 CVMX_ADD_IO_SEG(0x00011F00000018ECull)
209#define CVMX_NPI_PCI_CFG60 \
210 CVMX_ADD_IO_SEG(0x00011F00000018F0ull)
211#define CVMX_NPI_PCI_CFG61 \
212 CVMX_ADD_IO_SEG(0x00011F00000018F4ull)
213#define CVMX_NPI_PCI_CFG62 \
214 CVMX_ADD_IO_SEG(0x00011F00000018F8ull)
215#define CVMX_NPI_PCI_CFG63 \
216 CVMX_ADD_IO_SEG(0x00011F00000018FCull)
217#define CVMX_NPI_PCI_CNT_REG \
218 CVMX_ADD_IO_SEG(0x00011F00000011B8ull)
219#define CVMX_NPI_PCI_CTL_STATUS_2 \
220 CVMX_ADD_IO_SEG(0x00011F000000118Cull)
221#define CVMX_NPI_PCI_INT_ARB_CFG \
222 CVMX_ADD_IO_SEG(0x00011F0000000130ull)
223#define CVMX_NPI_PCI_INT_ENB2 \
224 CVMX_ADD_IO_SEG(0x00011F00000011A0ull)
225#define CVMX_NPI_PCI_INT_SUM2 \
226 CVMX_ADD_IO_SEG(0x00011F0000001198ull)
227#define CVMX_NPI_PCI_READ_CMD \
228 CVMX_ADD_IO_SEG(0x00011F0000000048ull)
229#define CVMX_NPI_PCI_READ_CMD_6 \
230 CVMX_ADD_IO_SEG(0x00011F0000001180ull)
231#define CVMX_NPI_PCI_READ_CMD_C \
232 CVMX_ADD_IO_SEG(0x00011F0000001184ull)
233#define CVMX_NPI_PCI_READ_CMD_E \
234 CVMX_ADD_IO_SEG(0x00011F0000001188ull)
235#define CVMX_NPI_PCI_SCM_REG \
236 CVMX_ADD_IO_SEG(0x00011F00000011A8ull)
237#define CVMX_NPI_PCI_TSR_REG \
238 CVMX_ADD_IO_SEG(0x00011F00000011B0ull)
239#define CVMX_NPI_PORT32_INSTR_HDR \
240 CVMX_ADD_IO_SEG(0x00011F00000001F8ull)
241#define CVMX_NPI_PORT33_INSTR_HDR \
242 CVMX_ADD_IO_SEG(0x00011F0000000200ull)
243#define CVMX_NPI_PORT34_INSTR_HDR \
244 CVMX_ADD_IO_SEG(0x00011F0000000208ull)
245#define CVMX_NPI_PORT35_INSTR_HDR \
246 CVMX_ADD_IO_SEG(0x00011F0000000210ull)
247#define CVMX_NPI_PORT_BP_CONTROL \
248 CVMX_ADD_IO_SEG(0x00011F00000001F0ull)
249#define CVMX_NPI_PX_DBPAIR_ADDR(offset) \
250 CVMX_ADD_IO_SEG(0x00011F0000000180ull + (((offset) & 3) * 8))
251#define CVMX_NPI_PX_INSTR_ADDR(offset) \
252 CVMX_ADD_IO_SEG(0x00011F00000001C0ull + (((offset) & 3) * 8))
253#define CVMX_NPI_PX_INSTR_CNTS(offset) \
254 CVMX_ADD_IO_SEG(0x00011F00000001A0ull + (((offset) & 3) * 8))
255#define CVMX_NPI_PX_PAIR_CNTS(offset) \
256 CVMX_ADD_IO_SEG(0x00011F0000000160ull + (((offset) & 3) * 8))
257#define CVMX_NPI_RSL_INT_BLOCKS \
258 CVMX_ADD_IO_SEG(0x00011F0000000000ull)
259#define CVMX_NPI_SIZE_INPUT0 \
260 CVMX_ADD_IO_SEG(0x00011F0000000078ull)
261#define CVMX_NPI_SIZE_INPUT1 \
262 CVMX_ADD_IO_SEG(0x00011F0000000088ull)
263#define CVMX_NPI_SIZE_INPUT2 \
264 CVMX_ADD_IO_SEG(0x00011F0000000098ull)
265#define CVMX_NPI_SIZE_INPUT3 \
266 CVMX_ADD_IO_SEG(0x00011F00000000A8ull)
267#define CVMX_NPI_SIZE_INPUTX(offset) \
268 CVMX_ADD_IO_SEG(0x00011F0000000078ull + (((offset) & 3) * 16))
269#define CVMX_NPI_WIN_READ_TO \
270 CVMX_ADD_IO_SEG(0x00011F00000001E0ull)
271
272union cvmx_npi_base_addr_inputx {
273 uint64_t u64;
274 struct cvmx_npi_base_addr_inputx_s {
275 uint64_t baddr:61;
276 uint64_t reserved_0_2:3;
277 } s;
278 struct cvmx_npi_base_addr_inputx_s cn30xx;
279 struct cvmx_npi_base_addr_inputx_s cn31xx;
280 struct cvmx_npi_base_addr_inputx_s cn38xx;
281 struct cvmx_npi_base_addr_inputx_s cn38xxp2;
282 struct cvmx_npi_base_addr_inputx_s cn50xx;
283 struct cvmx_npi_base_addr_inputx_s cn58xx;
284 struct cvmx_npi_base_addr_inputx_s cn58xxp1;
285};
286
287union cvmx_npi_base_addr_outputx {
288 uint64_t u64;
289 struct cvmx_npi_base_addr_outputx_s {
290 uint64_t baddr:61;
291 uint64_t reserved_0_2:3;
292 } s;
293 struct cvmx_npi_base_addr_outputx_s cn30xx;
294 struct cvmx_npi_base_addr_outputx_s cn31xx;
295 struct cvmx_npi_base_addr_outputx_s cn38xx;
296 struct cvmx_npi_base_addr_outputx_s cn38xxp2;
297 struct cvmx_npi_base_addr_outputx_s cn50xx;
298 struct cvmx_npi_base_addr_outputx_s cn58xx;
299 struct cvmx_npi_base_addr_outputx_s cn58xxp1;
300};
301
302union cvmx_npi_bist_status {
303 uint64_t u64;
304 struct cvmx_npi_bist_status_s {
305 uint64_t reserved_20_63:44;
306 uint64_t csr_bs:1;
307 uint64_t dif_bs:1;
308 uint64_t rdp_bs:1;
309 uint64_t pcnc_bs:1;
310 uint64_t pcn_bs:1;
311 uint64_t rdn_bs:1;
312 uint64_t pcac_bs:1;
313 uint64_t pcad_bs:1;
314 uint64_t rdnl_bs:1;
315 uint64_t pgf_bs:1;
316 uint64_t pig_bs:1;
317 uint64_t pof0_bs:1;
318 uint64_t pof1_bs:1;
319 uint64_t pof2_bs:1;
320 uint64_t pof3_bs:1;
321 uint64_t pos_bs:1;
322 uint64_t nus_bs:1;
323 uint64_t dob_bs:1;
324 uint64_t pdf_bs:1;
325 uint64_t dpi_bs:1;
326 } s;
327 struct cvmx_npi_bist_status_cn30xx {
328 uint64_t reserved_20_63:44;
329 uint64_t csr_bs:1;
330 uint64_t dif_bs:1;
331 uint64_t rdp_bs:1;
332 uint64_t pcnc_bs:1;
333 uint64_t pcn_bs:1;
334 uint64_t rdn_bs:1;
335 uint64_t pcac_bs:1;
336 uint64_t pcad_bs:1;
337 uint64_t rdnl_bs:1;
338 uint64_t pgf_bs:1;
339 uint64_t pig_bs:1;
340 uint64_t pof0_bs:1;
341 uint64_t reserved_5_7:3;
342 uint64_t pos_bs:1;
343 uint64_t nus_bs:1;
344 uint64_t dob_bs:1;
345 uint64_t pdf_bs:1;
346 uint64_t dpi_bs:1;
347 } cn30xx;
348 struct cvmx_npi_bist_status_s cn31xx;
349 struct cvmx_npi_bist_status_s cn38xx;
350 struct cvmx_npi_bist_status_s cn38xxp2;
351 struct cvmx_npi_bist_status_cn50xx {
352 uint64_t reserved_20_63:44;
353 uint64_t csr_bs:1;
354 uint64_t dif_bs:1;
355 uint64_t rdp_bs:1;
356 uint64_t pcnc_bs:1;
357 uint64_t pcn_bs:1;
358 uint64_t rdn_bs:1;
359 uint64_t pcac_bs:1;
360 uint64_t pcad_bs:1;
361 uint64_t rdnl_bs:1;
362 uint64_t pgf_bs:1;
363 uint64_t pig_bs:1;
364 uint64_t pof0_bs:1;
365 uint64_t pof1_bs:1;
366 uint64_t reserved_5_6:2;
367 uint64_t pos_bs:1;
368 uint64_t nus_bs:1;
369 uint64_t dob_bs:1;
370 uint64_t pdf_bs:1;
371 uint64_t dpi_bs:1;
372 } cn50xx;
373 struct cvmx_npi_bist_status_s cn58xx;
374 struct cvmx_npi_bist_status_s cn58xxp1;
375};
376
377union cvmx_npi_buff_size_outputx {
378 uint64_t u64;
379 struct cvmx_npi_buff_size_outputx_s {
380 uint64_t reserved_23_63:41;
381 uint64_t isize:7;
382 uint64_t bsize:16;
383 } s;
384 struct cvmx_npi_buff_size_outputx_s cn30xx;
385 struct cvmx_npi_buff_size_outputx_s cn31xx;
386 struct cvmx_npi_buff_size_outputx_s cn38xx;
387 struct cvmx_npi_buff_size_outputx_s cn38xxp2;
388 struct cvmx_npi_buff_size_outputx_s cn50xx;
389 struct cvmx_npi_buff_size_outputx_s cn58xx;
390 struct cvmx_npi_buff_size_outputx_s cn58xxp1;
391};
392
393union cvmx_npi_comp_ctl {
394 uint64_t u64;
395 struct cvmx_npi_comp_ctl_s {
396 uint64_t reserved_10_63:54;
397 uint64_t pctl:5;
398 uint64_t nctl:5;
399 } s;
400 struct cvmx_npi_comp_ctl_s cn50xx;
401 struct cvmx_npi_comp_ctl_s cn58xx;
402 struct cvmx_npi_comp_ctl_s cn58xxp1;
403};
404
405union cvmx_npi_ctl_status {
406 uint64_t u64;
407 struct cvmx_npi_ctl_status_s {
408 uint64_t reserved_63_63:1;
409 uint64_t chip_rev:8;
410 uint64_t dis_pniw:1;
411 uint64_t out3_enb:1;
412 uint64_t out2_enb:1;
413 uint64_t out1_enb:1;
414 uint64_t out0_enb:1;
415 uint64_t ins3_enb:1;
416 uint64_t ins2_enb:1;
417 uint64_t ins1_enb:1;
418 uint64_t ins0_enb:1;
419 uint64_t ins3_64b:1;
420 uint64_t ins2_64b:1;
421 uint64_t ins1_64b:1;
422 uint64_t ins0_64b:1;
423 uint64_t pci_wdis:1;
424 uint64_t wait_com:1;
425 uint64_t reserved_37_39:3;
426 uint64_t max_word:5;
427 uint64_t reserved_10_31:22;
428 uint64_t timer:10;
429 } s;
430 struct cvmx_npi_ctl_status_cn30xx {
431 uint64_t reserved_63_63:1;
432 uint64_t chip_rev:8;
433 uint64_t dis_pniw:1;
434 uint64_t reserved_51_53:3;
435 uint64_t out0_enb:1;
436 uint64_t reserved_47_49:3;
437 uint64_t ins0_enb:1;
438 uint64_t reserved_43_45:3;
439 uint64_t ins0_64b:1;
440 uint64_t pci_wdis:1;
441 uint64_t wait_com:1;
442 uint64_t reserved_37_39:3;
443 uint64_t max_word:5;
444 uint64_t reserved_10_31:22;
445 uint64_t timer:10;
446 } cn30xx;
447 struct cvmx_npi_ctl_status_cn31xx {
448 uint64_t reserved_63_63:1;
449 uint64_t chip_rev:8;
450 uint64_t dis_pniw:1;
451 uint64_t reserved_52_53:2;
452 uint64_t out1_enb:1;
453 uint64_t out0_enb:1;
454 uint64_t reserved_48_49:2;
455 uint64_t ins1_enb:1;
456 uint64_t ins0_enb:1;
457 uint64_t reserved_44_45:2;
458 uint64_t ins1_64b:1;
459 uint64_t ins0_64b:1;
460 uint64_t pci_wdis:1;
461 uint64_t wait_com:1;
462 uint64_t reserved_37_39:3;
463 uint64_t max_word:5;
464 uint64_t reserved_10_31:22;
465 uint64_t timer:10;
466 } cn31xx;
467 struct cvmx_npi_ctl_status_s cn38xx;
468 struct cvmx_npi_ctl_status_s cn38xxp2;
469 struct cvmx_npi_ctl_status_cn31xx cn50xx;
470 struct cvmx_npi_ctl_status_s cn58xx;
471 struct cvmx_npi_ctl_status_s cn58xxp1;
472};
473
474union cvmx_npi_dbg_select {
475 uint64_t u64;
476 struct cvmx_npi_dbg_select_s {
477 uint64_t reserved_16_63:48;
478 uint64_t dbg_sel:16;
479 } s;
480 struct cvmx_npi_dbg_select_s cn30xx;
481 struct cvmx_npi_dbg_select_s cn31xx;
482 struct cvmx_npi_dbg_select_s cn38xx;
483 struct cvmx_npi_dbg_select_s cn38xxp2;
484 struct cvmx_npi_dbg_select_s cn50xx;
485 struct cvmx_npi_dbg_select_s cn58xx;
486 struct cvmx_npi_dbg_select_s cn58xxp1;
487};
488
489union cvmx_npi_dma_control {
490 uint64_t u64;
491 struct cvmx_npi_dma_control_s {
492 uint64_t reserved_36_63:28;
493 uint64_t b0_lend:1;
494 uint64_t dwb_denb:1;
495 uint64_t dwb_ichk:9;
496 uint64_t fpa_que:3;
497 uint64_t o_add1:1;
498 uint64_t o_ro:1;
499 uint64_t o_ns:1;
500 uint64_t o_es:2;
501 uint64_t o_mode:1;
502 uint64_t hp_enb:1;
503 uint64_t lp_enb:1;
504 uint64_t csize:14;
505 } s;
506 struct cvmx_npi_dma_control_s cn30xx;
507 struct cvmx_npi_dma_control_s cn31xx;
508 struct cvmx_npi_dma_control_s cn38xx;
509 struct cvmx_npi_dma_control_s cn38xxp2;
510 struct cvmx_npi_dma_control_s cn50xx;
511 struct cvmx_npi_dma_control_s cn58xx;
512 struct cvmx_npi_dma_control_s cn58xxp1;
513};
514
515union cvmx_npi_dma_highp_counts {
516 uint64_t u64;
517 struct cvmx_npi_dma_highp_counts_s {
518 uint64_t reserved_39_63:25;
519 uint64_t fcnt:7;
520 uint64_t dbell:32;
521 } s;
522 struct cvmx_npi_dma_highp_counts_s cn30xx;
523 struct cvmx_npi_dma_highp_counts_s cn31xx;
524 struct cvmx_npi_dma_highp_counts_s cn38xx;
525 struct cvmx_npi_dma_highp_counts_s cn38xxp2;
526 struct cvmx_npi_dma_highp_counts_s cn50xx;
527 struct cvmx_npi_dma_highp_counts_s cn58xx;
528 struct cvmx_npi_dma_highp_counts_s cn58xxp1;
529};
530
531union cvmx_npi_dma_highp_naddr {
532 uint64_t u64;
533 struct cvmx_npi_dma_highp_naddr_s {
534 uint64_t reserved_40_63:24;
535 uint64_t state:4;
536 uint64_t addr:36;
537 } s;
538 struct cvmx_npi_dma_highp_naddr_s cn30xx;
539 struct cvmx_npi_dma_highp_naddr_s cn31xx;
540 struct cvmx_npi_dma_highp_naddr_s cn38xx;
541 struct cvmx_npi_dma_highp_naddr_s cn38xxp2;
542 struct cvmx_npi_dma_highp_naddr_s cn50xx;
543 struct cvmx_npi_dma_highp_naddr_s cn58xx;
544 struct cvmx_npi_dma_highp_naddr_s cn58xxp1;
545};
546
547union cvmx_npi_dma_lowp_counts {
548 uint64_t u64;
549 struct cvmx_npi_dma_lowp_counts_s {
550 uint64_t reserved_39_63:25;
551 uint64_t fcnt:7;
552 uint64_t dbell:32;
553 } s;
554 struct cvmx_npi_dma_lowp_counts_s cn30xx;
555 struct cvmx_npi_dma_lowp_counts_s cn31xx;
556 struct cvmx_npi_dma_lowp_counts_s cn38xx;
557 struct cvmx_npi_dma_lowp_counts_s cn38xxp2;
558 struct cvmx_npi_dma_lowp_counts_s cn50xx;
559 struct cvmx_npi_dma_lowp_counts_s cn58xx;
560 struct cvmx_npi_dma_lowp_counts_s cn58xxp1;
561};
562
563union cvmx_npi_dma_lowp_naddr {
564 uint64_t u64;
565 struct cvmx_npi_dma_lowp_naddr_s {
566 uint64_t reserved_40_63:24;
567 uint64_t state:4;
568 uint64_t addr:36;
569 } s;
570 struct cvmx_npi_dma_lowp_naddr_s cn30xx;
571 struct cvmx_npi_dma_lowp_naddr_s cn31xx;
572 struct cvmx_npi_dma_lowp_naddr_s cn38xx;
573 struct cvmx_npi_dma_lowp_naddr_s cn38xxp2;
574 struct cvmx_npi_dma_lowp_naddr_s cn50xx;
575 struct cvmx_npi_dma_lowp_naddr_s cn58xx;
576 struct cvmx_npi_dma_lowp_naddr_s cn58xxp1;
577};
578
579union cvmx_npi_highp_dbell {
580 uint64_t u64;
581 struct cvmx_npi_highp_dbell_s {
582 uint64_t reserved_16_63:48;
583 uint64_t dbell:16;
584 } s;
585 struct cvmx_npi_highp_dbell_s cn30xx;
586 struct cvmx_npi_highp_dbell_s cn31xx;
587 struct cvmx_npi_highp_dbell_s cn38xx;
588 struct cvmx_npi_highp_dbell_s cn38xxp2;
589 struct cvmx_npi_highp_dbell_s cn50xx;
590 struct cvmx_npi_highp_dbell_s cn58xx;
591 struct cvmx_npi_highp_dbell_s cn58xxp1;
592};
593
594union cvmx_npi_highp_ibuff_saddr {
595 uint64_t u64;
596 struct cvmx_npi_highp_ibuff_saddr_s {
597 uint64_t reserved_36_63:28;
598 uint64_t saddr:36;
599 } s;
600 struct cvmx_npi_highp_ibuff_saddr_s cn30xx;
601 struct cvmx_npi_highp_ibuff_saddr_s cn31xx;
602 struct cvmx_npi_highp_ibuff_saddr_s cn38xx;
603 struct cvmx_npi_highp_ibuff_saddr_s cn38xxp2;
604 struct cvmx_npi_highp_ibuff_saddr_s cn50xx;
605 struct cvmx_npi_highp_ibuff_saddr_s cn58xx;
606 struct cvmx_npi_highp_ibuff_saddr_s cn58xxp1;
607};
608
609union cvmx_npi_input_control {
610 uint64_t u64;
611 struct cvmx_npi_input_control_s {
612 uint64_t reserved_23_63:41;
613 uint64_t pkt_rr:1;
614 uint64_t pbp_dhi:13;
615 uint64_t d_nsr:1;
616 uint64_t d_esr:2;
617 uint64_t d_ror:1;
618 uint64_t use_csr:1;
619 uint64_t nsr:1;
620 uint64_t esr:2;
621 uint64_t ror:1;
622 } s;
623 struct cvmx_npi_input_control_cn30xx {
624 uint64_t reserved_22_63:42;
625 uint64_t pbp_dhi:13;
626 uint64_t d_nsr:1;
627 uint64_t d_esr:2;
628 uint64_t d_ror:1;
629 uint64_t use_csr:1;
630 uint64_t nsr:1;
631 uint64_t esr:2;
632 uint64_t ror:1;
633 } cn30xx;
634 struct cvmx_npi_input_control_cn30xx cn31xx;
635 struct cvmx_npi_input_control_s cn38xx;
636 struct cvmx_npi_input_control_cn30xx cn38xxp2;
637 struct cvmx_npi_input_control_s cn50xx;
638 struct cvmx_npi_input_control_s cn58xx;
639 struct cvmx_npi_input_control_s cn58xxp1;
640};
641
642union cvmx_npi_int_enb {
643 uint64_t u64;
644 struct cvmx_npi_int_enb_s {
645 uint64_t reserved_62_63:2;
646 uint64_t q1_a_f:1;
647 uint64_t q1_s_e:1;
648 uint64_t pdf_p_f:1;
649 uint64_t pdf_p_e:1;
650 uint64_t pcf_p_f:1;
651 uint64_t pcf_p_e:1;
652 uint64_t rdx_s_e:1;
653 uint64_t rwx_s_e:1;
654 uint64_t pnc_a_f:1;
655 uint64_t pnc_s_e:1;
656 uint64_t com_a_f:1;
657 uint64_t com_s_e:1;
658 uint64_t q3_a_f:1;
659 uint64_t q3_s_e:1;
660 uint64_t q2_a_f:1;
661 uint64_t q2_s_e:1;
662 uint64_t pcr_a_f:1;
663 uint64_t pcr_s_e:1;
664 uint64_t fcr_a_f:1;
665 uint64_t fcr_s_e:1;
666 uint64_t iobdma:1;
667 uint64_t p_dperr:1;
668 uint64_t win_rto:1;
669 uint64_t i3_pperr:1;
670 uint64_t i2_pperr:1;
671 uint64_t i1_pperr:1;
672 uint64_t i0_pperr:1;
673 uint64_t p3_ptout:1;
674 uint64_t p2_ptout:1;
675 uint64_t p1_ptout:1;
676 uint64_t p0_ptout:1;
677 uint64_t p3_pperr:1;
678 uint64_t p2_pperr:1;
679 uint64_t p1_pperr:1;
680 uint64_t p0_pperr:1;
681 uint64_t g3_rtout:1;
682 uint64_t g2_rtout:1;
683 uint64_t g1_rtout:1;
684 uint64_t g0_rtout:1;
685 uint64_t p3_perr:1;
686 uint64_t p2_perr:1;
687 uint64_t p1_perr:1;
688 uint64_t p0_perr:1;
689 uint64_t p3_rtout:1;
690 uint64_t p2_rtout:1;
691 uint64_t p1_rtout:1;
692 uint64_t p0_rtout:1;
693 uint64_t i3_overf:1;
694 uint64_t i2_overf:1;
695 uint64_t i1_overf:1;
696 uint64_t i0_overf:1;
697 uint64_t i3_rtout:1;
698 uint64_t i2_rtout:1;
699 uint64_t i1_rtout:1;
700 uint64_t i0_rtout:1;
701 uint64_t po3_2sml:1;
702 uint64_t po2_2sml:1;
703 uint64_t po1_2sml:1;
704 uint64_t po0_2sml:1;
705 uint64_t pci_rsl:1;
706 uint64_t rml_wto:1;
707 uint64_t rml_rto:1;
708 } s;
709 struct cvmx_npi_int_enb_cn30xx {
710 uint64_t reserved_62_63:2;
711 uint64_t q1_a_f:1;
712 uint64_t q1_s_e:1;
713 uint64_t pdf_p_f:1;
714 uint64_t pdf_p_e:1;
715 uint64_t pcf_p_f:1;
716 uint64_t pcf_p_e:1;
717 uint64_t rdx_s_e:1;
718 uint64_t rwx_s_e:1;
719 uint64_t pnc_a_f:1;
720 uint64_t pnc_s_e:1;
721 uint64_t com_a_f:1;
722 uint64_t com_s_e:1;
723 uint64_t q3_a_f:1;
724 uint64_t q3_s_e:1;
725 uint64_t q2_a_f:1;
726 uint64_t q2_s_e:1;
727 uint64_t pcr_a_f:1;
728 uint64_t pcr_s_e:1;
729 uint64_t fcr_a_f:1;
730 uint64_t fcr_s_e:1;
731 uint64_t iobdma:1;
732 uint64_t p_dperr:1;
733 uint64_t win_rto:1;
734 uint64_t reserved_36_38:3;
735 uint64_t i0_pperr:1;
736 uint64_t reserved_32_34:3;
737 uint64_t p0_ptout:1;
738 uint64_t reserved_28_30:3;
739 uint64_t p0_pperr:1;
740 uint64_t reserved_24_26:3;
741 uint64_t g0_rtout:1;
742 uint64_t reserved_20_22:3;
743 uint64_t p0_perr:1;
744 uint64_t reserved_16_18:3;
745 uint64_t p0_rtout:1;
746 uint64_t reserved_12_14:3;
747 uint64_t i0_overf:1;
748 uint64_t reserved_8_10:3;
749 uint64_t i0_rtout:1;
750 uint64_t reserved_4_6:3;
751 uint64_t po0_2sml:1;
752 uint64_t pci_rsl:1;
753 uint64_t rml_wto:1;
754 uint64_t rml_rto:1;
755 } cn30xx;
756 struct cvmx_npi_int_enb_cn31xx {
757 uint64_t reserved_62_63:2;
758 uint64_t q1_a_f:1;
759 uint64_t q1_s_e:1;
760 uint64_t pdf_p_f:1;
761 uint64_t pdf_p_e:1;
762 uint64_t pcf_p_f:1;
763 uint64_t pcf_p_e:1;
764 uint64_t rdx_s_e:1;
765 uint64_t rwx_s_e:1;
766 uint64_t pnc_a_f:1;
767 uint64_t pnc_s_e:1;
768 uint64_t com_a_f:1;
769 uint64_t com_s_e:1;
770 uint64_t q3_a_f:1;
771 uint64_t q3_s_e:1;
772 uint64_t q2_a_f:1;
773 uint64_t q2_s_e:1;
774 uint64_t pcr_a_f:1;
775 uint64_t pcr_s_e:1;
776 uint64_t fcr_a_f:1;
777 uint64_t fcr_s_e:1;
778 uint64_t iobdma:1;
779 uint64_t p_dperr:1;
780 uint64_t win_rto:1;
781 uint64_t reserved_37_38:2;
782 uint64_t i1_pperr:1;
783 uint64_t i0_pperr:1;
784 uint64_t reserved_33_34:2;
785 uint64_t p1_ptout:1;
786 uint64_t p0_ptout:1;
787 uint64_t reserved_29_30:2;
788 uint64_t p1_pperr:1;
789 uint64_t p0_pperr:1;
790 uint64_t reserved_25_26:2;
791 uint64_t g1_rtout:1;
792 uint64_t g0_rtout:1;
793 uint64_t reserved_21_22:2;
794 uint64_t p1_perr:1;
795 uint64_t p0_perr:1;
796 uint64_t reserved_17_18:2;
797 uint64_t p1_rtout:1;
798 uint64_t p0_rtout:1;
799 uint64_t reserved_13_14:2;
800 uint64_t i1_overf:1;
801 uint64_t i0_overf:1;
802 uint64_t reserved_9_10:2;
803 uint64_t i1_rtout:1;
804 uint64_t i0_rtout:1;
805 uint64_t reserved_5_6:2;
806 uint64_t po1_2sml:1;
807 uint64_t po0_2sml:1;
808 uint64_t pci_rsl:1;
809 uint64_t rml_wto:1;
810 uint64_t rml_rto:1;
811 } cn31xx;
812 struct cvmx_npi_int_enb_s cn38xx;
813 struct cvmx_npi_int_enb_cn38xxp2 {
814 uint64_t reserved_42_63:22;
815 uint64_t iobdma:1;
816 uint64_t p_dperr:1;
817 uint64_t win_rto:1;
818 uint64_t i3_pperr:1;
819 uint64_t i2_pperr:1;
820 uint64_t i1_pperr:1;
821 uint64_t i0_pperr:1;
822 uint64_t p3_ptout:1;
823 uint64_t p2_ptout:1;
824 uint64_t p1_ptout:1;
825 uint64_t p0_ptout:1;
826 uint64_t p3_pperr:1;
827 uint64_t p2_pperr:1;
828 uint64_t p1_pperr:1;
829 uint64_t p0_pperr:1;
830 uint64_t g3_rtout:1;
831 uint64_t g2_rtout:1;
832 uint64_t g1_rtout:1;
833 uint64_t g0_rtout:1;
834 uint64_t p3_perr:1;
835 uint64_t p2_perr:1;
836 uint64_t p1_perr:1;
837 uint64_t p0_perr:1;
838 uint64_t p3_rtout:1;
839 uint64_t p2_rtout:1;
840 uint64_t p1_rtout:1;
841 uint64_t p0_rtout:1;
842 uint64_t i3_overf:1;
843 uint64_t i2_overf:1;
844 uint64_t i1_overf:1;
845 uint64_t i0_overf:1;
846 uint64_t i3_rtout:1;
847 uint64_t i2_rtout:1;
848 uint64_t i1_rtout:1;
849 uint64_t i0_rtout:1;
850 uint64_t po3_2sml:1;
851 uint64_t po2_2sml:1;
852 uint64_t po1_2sml:1;
853 uint64_t po0_2sml:1;
854 uint64_t pci_rsl:1;
855 uint64_t rml_wto:1;
856 uint64_t rml_rto:1;
857 } cn38xxp2;
858 struct cvmx_npi_int_enb_cn31xx cn50xx;
859 struct cvmx_npi_int_enb_s cn58xx;
860 struct cvmx_npi_int_enb_s cn58xxp1;
861};
862
863union cvmx_npi_int_sum {
864 uint64_t u64;
865 struct cvmx_npi_int_sum_s {
866 uint64_t reserved_62_63:2;
867 uint64_t q1_a_f:1;
868 uint64_t q1_s_e:1;
869 uint64_t pdf_p_f:1;
870 uint64_t pdf_p_e:1;
871 uint64_t pcf_p_f:1;
872 uint64_t pcf_p_e:1;
873 uint64_t rdx_s_e:1;
874 uint64_t rwx_s_e:1;
875 uint64_t pnc_a_f:1;
876 uint64_t pnc_s_e:1;
877 uint64_t com_a_f:1;
878 uint64_t com_s_e:1;
879 uint64_t q3_a_f:1;
880 uint64_t q3_s_e:1;
881 uint64_t q2_a_f:1;
882 uint64_t q2_s_e:1;
883 uint64_t pcr_a_f:1;
884 uint64_t pcr_s_e:1;
885 uint64_t fcr_a_f:1;
886 uint64_t fcr_s_e:1;
887 uint64_t iobdma:1;
888 uint64_t p_dperr:1;
889 uint64_t win_rto:1;
890 uint64_t i3_pperr:1;
891 uint64_t i2_pperr:1;
892 uint64_t i1_pperr:1;
893 uint64_t i0_pperr:1;
894 uint64_t p3_ptout:1;
895 uint64_t p2_ptout:1;
896 uint64_t p1_ptout:1;
897 uint64_t p0_ptout:1;
898 uint64_t p3_pperr:1;
899 uint64_t p2_pperr:1;
900 uint64_t p1_pperr:1;
901 uint64_t p0_pperr:1;
902 uint64_t g3_rtout:1;
903 uint64_t g2_rtout:1;
904 uint64_t g1_rtout:1;
905 uint64_t g0_rtout:1;
906 uint64_t p3_perr:1;
907 uint64_t p2_perr:1;
908 uint64_t p1_perr:1;
909 uint64_t p0_perr:1;
910 uint64_t p3_rtout:1;
911 uint64_t p2_rtout:1;
912 uint64_t p1_rtout:1;
913 uint64_t p0_rtout:1;
914 uint64_t i3_overf:1;
915 uint64_t i2_overf:1;
916 uint64_t i1_overf:1;
917 uint64_t i0_overf:1;
918 uint64_t i3_rtout:1;
919 uint64_t i2_rtout:1;
920 uint64_t i1_rtout:1;
921 uint64_t i0_rtout:1;
922 uint64_t po3_2sml:1;
923 uint64_t po2_2sml:1;
924 uint64_t po1_2sml:1;
925 uint64_t po0_2sml:1;
926 uint64_t pci_rsl:1;
927 uint64_t rml_wto:1;
928 uint64_t rml_rto:1;
929 } s;
930 struct cvmx_npi_int_sum_cn30xx {
931 uint64_t reserved_62_63:2;
932 uint64_t q1_a_f:1;
933 uint64_t q1_s_e:1;
934 uint64_t pdf_p_f:1;
935 uint64_t pdf_p_e:1;
936 uint64_t pcf_p_f:1;
937 uint64_t pcf_p_e:1;
938 uint64_t rdx_s_e:1;
939 uint64_t rwx_s_e:1;
940 uint64_t pnc_a_f:1;
941 uint64_t pnc_s_e:1;
942 uint64_t com_a_f:1;
943 uint64_t com_s_e:1;
944 uint64_t q3_a_f:1;
945 uint64_t q3_s_e:1;
946 uint64_t q2_a_f:1;
947 uint64_t q2_s_e:1;
948 uint64_t pcr_a_f:1;
949 uint64_t pcr_s_e:1;
950 uint64_t fcr_a_f:1;
951 uint64_t fcr_s_e:1;
952 uint64_t iobdma:1;
953 uint64_t p_dperr:1;
954 uint64_t win_rto:1;
955 uint64_t reserved_36_38:3;
956 uint64_t i0_pperr:1;
957 uint64_t reserved_32_34:3;
958 uint64_t p0_ptout:1;
959 uint64_t reserved_28_30:3;
960 uint64_t p0_pperr:1;
961 uint64_t reserved_24_26:3;
962 uint64_t g0_rtout:1;
963 uint64_t reserved_20_22:3;
964 uint64_t p0_perr:1;
965 uint64_t reserved_16_18:3;
966 uint64_t p0_rtout:1;
967 uint64_t reserved_12_14:3;
968 uint64_t i0_overf:1;
969 uint64_t reserved_8_10:3;
970 uint64_t i0_rtout:1;
971 uint64_t reserved_4_6:3;
972 uint64_t po0_2sml:1;
973 uint64_t pci_rsl:1;
974 uint64_t rml_wto:1;
975 uint64_t rml_rto:1;
976 } cn30xx;
977 struct cvmx_npi_int_sum_cn31xx {
978 uint64_t reserved_62_63:2;
979 uint64_t q1_a_f:1;
980 uint64_t q1_s_e:1;
981 uint64_t pdf_p_f:1;
982 uint64_t pdf_p_e:1;
983 uint64_t pcf_p_f:1;
984 uint64_t pcf_p_e:1;
985 uint64_t rdx_s_e:1;
986 uint64_t rwx_s_e:1;
987 uint64_t pnc_a_f:1;
988 uint64_t pnc_s_e:1;
989 uint64_t com_a_f:1;
990 uint64_t com_s_e:1;
991 uint64_t q3_a_f:1;
992 uint64_t q3_s_e:1;
993 uint64_t q2_a_f:1;
994 uint64_t q2_s_e:1;
995 uint64_t pcr_a_f:1;
996 uint64_t pcr_s_e:1;
997 uint64_t fcr_a_f:1;
998 uint64_t fcr_s_e:1;
999 uint64_t iobdma:1;
1000 uint64_t p_dperr:1;
1001 uint64_t win_rto:1;
1002 uint64_t reserved_37_38:2;
1003 uint64_t i1_pperr:1;
1004 uint64_t i0_pperr:1;
1005 uint64_t reserved_33_34:2;
1006 uint64_t p1_ptout:1;
1007 uint64_t p0_ptout:1;
1008 uint64_t reserved_29_30:2;
1009 uint64_t p1_pperr:1;
1010 uint64_t p0_pperr:1;
1011 uint64_t reserved_25_26:2;
1012 uint64_t g1_rtout:1;
1013 uint64_t g0_rtout:1;
1014 uint64_t reserved_21_22:2;
1015 uint64_t p1_perr:1;
1016 uint64_t p0_perr:1;
1017 uint64_t reserved_17_18:2;
1018 uint64_t p1_rtout:1;
1019 uint64_t p0_rtout:1;
1020 uint64_t reserved_13_14:2;
1021 uint64_t i1_overf:1;
1022 uint64_t i0_overf:1;
1023 uint64_t reserved_9_10:2;
1024 uint64_t i1_rtout:1;
1025 uint64_t i0_rtout:1;
1026 uint64_t reserved_5_6:2;
1027 uint64_t po1_2sml:1;
1028 uint64_t po0_2sml:1;
1029 uint64_t pci_rsl:1;
1030 uint64_t rml_wto:1;
1031 uint64_t rml_rto:1;
1032 } cn31xx;
1033 struct cvmx_npi_int_sum_s cn38xx;
1034 struct cvmx_npi_int_sum_cn38xxp2 {
1035 uint64_t reserved_42_63:22;
1036 uint64_t iobdma:1;
1037 uint64_t p_dperr:1;
1038 uint64_t win_rto:1;
1039 uint64_t i3_pperr:1;
1040 uint64_t i2_pperr:1;
1041 uint64_t i1_pperr:1;
1042 uint64_t i0_pperr:1;
1043 uint64_t p3_ptout:1;
1044 uint64_t p2_ptout:1;
1045 uint64_t p1_ptout:1;
1046 uint64_t p0_ptout:1;
1047 uint64_t p3_pperr:1;
1048 uint64_t p2_pperr:1;
1049 uint64_t p1_pperr:1;
1050 uint64_t p0_pperr:1;
1051 uint64_t g3_rtout:1;
1052 uint64_t g2_rtout:1;
1053 uint64_t g1_rtout:1;
1054 uint64_t g0_rtout:1;
1055 uint64_t p3_perr:1;
1056 uint64_t p2_perr:1;
1057 uint64_t p1_perr:1;
1058 uint64_t p0_perr:1;
1059 uint64_t p3_rtout:1;
1060 uint64_t p2_rtout:1;
1061 uint64_t p1_rtout:1;
1062 uint64_t p0_rtout:1;
1063 uint64_t i3_overf:1;
1064 uint64_t i2_overf:1;
1065 uint64_t i1_overf:1;
1066 uint64_t i0_overf:1;
1067 uint64_t i3_rtout:1;
1068 uint64_t i2_rtout:1;
1069 uint64_t i1_rtout:1;
1070 uint64_t i0_rtout:1;
1071 uint64_t po3_2sml:1;
1072 uint64_t po2_2sml:1;
1073 uint64_t po1_2sml:1;
1074 uint64_t po0_2sml:1;
1075 uint64_t pci_rsl:1;
1076 uint64_t rml_wto:1;
1077 uint64_t rml_rto:1;
1078 } cn38xxp2;
1079 struct cvmx_npi_int_sum_cn31xx cn50xx;
1080 struct cvmx_npi_int_sum_s cn58xx;
1081 struct cvmx_npi_int_sum_s cn58xxp1;
1082};
1083
1084union cvmx_npi_lowp_dbell {
1085 uint64_t u64;
1086 struct cvmx_npi_lowp_dbell_s {
1087 uint64_t reserved_16_63:48;
1088 uint64_t dbell:16;
1089 } s;
1090 struct cvmx_npi_lowp_dbell_s cn30xx;
1091 struct cvmx_npi_lowp_dbell_s cn31xx;
1092 struct cvmx_npi_lowp_dbell_s cn38xx;
1093 struct cvmx_npi_lowp_dbell_s cn38xxp2;
1094 struct cvmx_npi_lowp_dbell_s cn50xx;
1095 struct cvmx_npi_lowp_dbell_s cn58xx;
1096 struct cvmx_npi_lowp_dbell_s cn58xxp1;
1097};
1098
1099union cvmx_npi_lowp_ibuff_saddr {
1100 uint64_t u64;
1101 struct cvmx_npi_lowp_ibuff_saddr_s {
1102 uint64_t reserved_36_63:28;
1103 uint64_t saddr:36;
1104 } s;
1105 struct cvmx_npi_lowp_ibuff_saddr_s cn30xx;
1106 struct cvmx_npi_lowp_ibuff_saddr_s cn31xx;
1107 struct cvmx_npi_lowp_ibuff_saddr_s cn38xx;
1108 struct cvmx_npi_lowp_ibuff_saddr_s cn38xxp2;
1109 struct cvmx_npi_lowp_ibuff_saddr_s cn50xx;
1110 struct cvmx_npi_lowp_ibuff_saddr_s cn58xx;
1111 struct cvmx_npi_lowp_ibuff_saddr_s cn58xxp1;
1112};
1113
1114union cvmx_npi_mem_access_subidx {
1115 uint64_t u64;
1116 struct cvmx_npi_mem_access_subidx_s {
1117 uint64_t reserved_38_63:26;
1118 uint64_t shortl:1;
1119 uint64_t nmerge:1;
1120 uint64_t esr:2;
1121 uint64_t esw:2;
1122 uint64_t nsr:1;
1123 uint64_t nsw:1;
1124 uint64_t ror:1;
1125 uint64_t row:1;
1126 uint64_t ba:28;
1127 } s;
1128 struct cvmx_npi_mem_access_subidx_s cn30xx;
1129 struct cvmx_npi_mem_access_subidx_cn31xx {
1130 uint64_t reserved_36_63:28;
1131 uint64_t esr:2;
1132 uint64_t esw:2;
1133 uint64_t nsr:1;
1134 uint64_t nsw:1;
1135 uint64_t ror:1;
1136 uint64_t row:1;
1137 uint64_t ba:28;
1138 } cn31xx;
1139 struct cvmx_npi_mem_access_subidx_s cn38xx;
1140 struct cvmx_npi_mem_access_subidx_cn31xx cn38xxp2;
1141 struct cvmx_npi_mem_access_subidx_s cn50xx;
1142 struct cvmx_npi_mem_access_subidx_s cn58xx;
1143 struct cvmx_npi_mem_access_subidx_s cn58xxp1;
1144};
1145
1146union cvmx_npi_msi_rcv {
1147 uint64_t u64;
1148 struct cvmx_npi_msi_rcv_s {
1149 uint64_t int_vec:64;
1150 } s;
1151 struct cvmx_npi_msi_rcv_s cn30xx;
1152 struct cvmx_npi_msi_rcv_s cn31xx;
1153 struct cvmx_npi_msi_rcv_s cn38xx;
1154 struct cvmx_npi_msi_rcv_s cn38xxp2;
1155 struct cvmx_npi_msi_rcv_s cn50xx;
1156 struct cvmx_npi_msi_rcv_s cn58xx;
1157 struct cvmx_npi_msi_rcv_s cn58xxp1;
1158};
1159
1160union cvmx_npi_num_desc_outputx {
1161 uint64_t u64;
1162 struct cvmx_npi_num_desc_outputx_s {
1163 uint64_t reserved_32_63:32;
1164 uint64_t size:32;
1165 } s;
1166 struct cvmx_npi_num_desc_outputx_s cn30xx;
1167 struct cvmx_npi_num_desc_outputx_s cn31xx;
1168 struct cvmx_npi_num_desc_outputx_s cn38xx;
1169 struct cvmx_npi_num_desc_outputx_s cn38xxp2;
1170 struct cvmx_npi_num_desc_outputx_s cn50xx;
1171 struct cvmx_npi_num_desc_outputx_s cn58xx;
1172 struct cvmx_npi_num_desc_outputx_s cn58xxp1;
1173};
1174
1175union cvmx_npi_output_control {
1176 uint64_t u64;
1177 struct cvmx_npi_output_control_s {
1178 uint64_t reserved_49_63:15;
1179 uint64_t pkt_rr:1;
1180 uint64_t p3_bmode:1;
1181 uint64_t p2_bmode:1;
1182 uint64_t p1_bmode:1;
1183 uint64_t p0_bmode:1;
1184 uint64_t o3_es:2;
1185 uint64_t o3_ns:1;
1186 uint64_t o3_ro:1;
1187 uint64_t o2_es:2;
1188 uint64_t o2_ns:1;
1189 uint64_t o2_ro:1;
1190 uint64_t o1_es:2;
1191 uint64_t o1_ns:1;
1192 uint64_t o1_ro:1;
1193 uint64_t o0_es:2;
1194 uint64_t o0_ns:1;
1195 uint64_t o0_ro:1;
1196 uint64_t o3_csrm:1;
1197 uint64_t o2_csrm:1;
1198 uint64_t o1_csrm:1;
1199 uint64_t o0_csrm:1;
1200 uint64_t reserved_20_23:4;
1201 uint64_t iptr_o3:1;
1202 uint64_t iptr_o2:1;
1203 uint64_t iptr_o1:1;
1204 uint64_t iptr_o0:1;
1205 uint64_t esr_sl3:2;
1206 uint64_t nsr_sl3:1;
1207 uint64_t ror_sl3:1;
1208 uint64_t esr_sl2:2;
1209 uint64_t nsr_sl2:1;
1210 uint64_t ror_sl2:1;
1211 uint64_t esr_sl1:2;
1212 uint64_t nsr_sl1:1;
1213 uint64_t ror_sl1:1;
1214 uint64_t esr_sl0:2;
1215 uint64_t nsr_sl0:1;
1216 uint64_t ror_sl0:1;
1217 } s;
1218 struct cvmx_npi_output_control_cn30xx {
1219 uint64_t reserved_45_63:19;
1220 uint64_t p0_bmode:1;
1221 uint64_t reserved_32_43:12;
1222 uint64_t o0_es:2;
1223 uint64_t o0_ns:1;
1224 uint64_t o0_ro:1;
1225 uint64_t reserved_25_27:3;
1226 uint64_t o0_csrm:1;
1227 uint64_t reserved_17_23:7;
1228 uint64_t iptr_o0:1;
1229 uint64_t reserved_4_15:12;
1230 uint64_t esr_sl0:2;
1231 uint64_t nsr_sl0:1;
1232 uint64_t ror_sl0:1;
1233 } cn30xx;
1234 struct cvmx_npi_output_control_cn31xx {
1235 uint64_t reserved_46_63:18;
1236 uint64_t p1_bmode:1;
1237 uint64_t p0_bmode:1;
1238 uint64_t reserved_36_43:8;
1239 uint64_t o1_es:2;
1240 uint64_t o1_ns:1;
1241 uint64_t o1_ro:1;
1242 uint64_t o0_es:2;
1243 uint64_t o0_ns:1;
1244 uint64_t o0_ro:1;
1245 uint64_t reserved_26_27:2;
1246 uint64_t o1_csrm:1;
1247 uint64_t o0_csrm:1;
1248 uint64_t reserved_18_23:6;
1249 uint64_t iptr_o1:1;
1250 uint64_t iptr_o0:1;
1251 uint64_t reserved_8_15:8;
1252 uint64_t esr_sl1:2;
1253 uint64_t nsr_sl1:1;
1254 uint64_t ror_sl1:1;
1255 uint64_t esr_sl0:2;
1256 uint64_t nsr_sl0:1;
1257 uint64_t ror_sl0:1;
1258 } cn31xx;
1259 struct cvmx_npi_output_control_s cn38xx;
1260 struct cvmx_npi_output_control_cn38xxp2 {
1261 uint64_t reserved_48_63:16;
1262 uint64_t p3_bmode:1;
1263 uint64_t p2_bmode:1;
1264 uint64_t p1_bmode:1;
1265 uint64_t p0_bmode:1;
1266 uint64_t o3_es:2;
1267 uint64_t o3_ns:1;
1268 uint64_t o3_ro:1;
1269 uint64_t o2_es:2;
1270 uint64_t o2_ns:1;
1271 uint64_t o2_ro:1;
1272 uint64_t o1_es:2;
1273 uint64_t o1_ns:1;
1274 uint64_t o1_ro:1;
1275 uint64_t o0_es:2;
1276 uint64_t o0_ns:1;
1277 uint64_t o0_ro:1;
1278 uint64_t o3_csrm:1;
1279 uint64_t o2_csrm:1;
1280 uint64_t o1_csrm:1;
1281 uint64_t o0_csrm:1;
1282 uint64_t reserved_20_23:4;
1283 uint64_t iptr_o3:1;
1284 uint64_t iptr_o2:1;
1285 uint64_t iptr_o1:1;
1286 uint64_t iptr_o0:1;
1287 uint64_t esr_sl3:2;
1288 uint64_t nsr_sl3:1;
1289 uint64_t ror_sl3:1;
1290 uint64_t esr_sl2:2;
1291 uint64_t nsr_sl2:1;
1292 uint64_t ror_sl2:1;
1293 uint64_t esr_sl1:2;
1294 uint64_t nsr_sl1:1;
1295 uint64_t ror_sl1:1;
1296 uint64_t esr_sl0:2;
1297 uint64_t nsr_sl0:1;
1298 uint64_t ror_sl0:1;
1299 } cn38xxp2;
1300 struct cvmx_npi_output_control_cn50xx {
1301 uint64_t reserved_49_63:15;
1302 uint64_t pkt_rr:1;
1303 uint64_t reserved_46_47:2;
1304 uint64_t p1_bmode:1;
1305 uint64_t p0_bmode:1;
1306 uint64_t reserved_36_43:8;
1307 uint64_t o1_es:2;
1308 uint64_t o1_ns:1;
1309 uint64_t o1_ro:1;
1310 uint64_t o0_es:2;
1311 uint64_t o0_ns:1;
1312 uint64_t o0_ro:1;
1313 uint64_t reserved_26_27:2;
1314 uint64_t o1_csrm:1;
1315 uint64_t o0_csrm:1;
1316 uint64_t reserved_18_23:6;
1317 uint64_t iptr_o1:1;
1318 uint64_t iptr_o0:1;
1319 uint64_t reserved_8_15:8;
1320 uint64_t esr_sl1:2;
1321 uint64_t nsr_sl1:1;
1322 uint64_t ror_sl1:1;
1323 uint64_t esr_sl0:2;
1324 uint64_t nsr_sl0:1;
1325 uint64_t ror_sl0:1;
1326 } cn50xx;
1327 struct cvmx_npi_output_control_s cn58xx;
1328 struct cvmx_npi_output_control_s cn58xxp1;
1329};
1330
1331union cvmx_npi_px_dbpair_addr {
1332 uint64_t u64;
1333 struct cvmx_npi_px_dbpair_addr_s {
1334 uint64_t reserved_63_63:1;
1335 uint64_t state:2;
1336 uint64_t naddr:61;
1337 } s;
1338 struct cvmx_npi_px_dbpair_addr_s cn30xx;
1339 struct cvmx_npi_px_dbpair_addr_s cn31xx;
1340 struct cvmx_npi_px_dbpair_addr_s cn38xx;
1341 struct cvmx_npi_px_dbpair_addr_s cn38xxp2;
1342 struct cvmx_npi_px_dbpair_addr_s cn50xx;
1343 struct cvmx_npi_px_dbpair_addr_s cn58xx;
1344 struct cvmx_npi_px_dbpair_addr_s cn58xxp1;
1345};
1346
1347union cvmx_npi_px_instr_addr {
1348 uint64_t u64;
1349 struct cvmx_npi_px_instr_addr_s {
1350 uint64_t state:3;
1351 uint64_t naddr:61;
1352 } s;
1353 struct cvmx_npi_px_instr_addr_s cn30xx;
1354 struct cvmx_npi_px_instr_addr_s cn31xx;
1355 struct cvmx_npi_px_instr_addr_s cn38xx;
1356 struct cvmx_npi_px_instr_addr_s cn38xxp2;
1357 struct cvmx_npi_px_instr_addr_s cn50xx;
1358 struct cvmx_npi_px_instr_addr_s cn58xx;
1359 struct cvmx_npi_px_instr_addr_s cn58xxp1;
1360};
1361
1362union cvmx_npi_px_instr_cnts {
1363 uint64_t u64;
1364 struct cvmx_npi_px_instr_cnts_s {
1365 uint64_t reserved_38_63:26;
1366 uint64_t fcnt:6;
1367 uint64_t avail:32;
1368 } s;
1369 struct cvmx_npi_px_instr_cnts_s cn30xx;
1370 struct cvmx_npi_px_instr_cnts_s cn31xx;
1371 struct cvmx_npi_px_instr_cnts_s cn38xx;
1372 struct cvmx_npi_px_instr_cnts_s cn38xxp2;
1373 struct cvmx_npi_px_instr_cnts_s cn50xx;
1374 struct cvmx_npi_px_instr_cnts_s cn58xx;
1375 struct cvmx_npi_px_instr_cnts_s cn58xxp1;
1376};
1377
1378union cvmx_npi_px_pair_cnts {
1379 uint64_t u64;
1380 struct cvmx_npi_px_pair_cnts_s {
1381 uint64_t reserved_37_63:27;
1382 uint64_t fcnt:5;
1383 uint64_t avail:32;
1384 } s;
1385 struct cvmx_npi_px_pair_cnts_s cn30xx;
1386 struct cvmx_npi_px_pair_cnts_s cn31xx;
1387 struct cvmx_npi_px_pair_cnts_s cn38xx;
1388 struct cvmx_npi_px_pair_cnts_s cn38xxp2;
1389 struct cvmx_npi_px_pair_cnts_s cn50xx;
1390 struct cvmx_npi_px_pair_cnts_s cn58xx;
1391 struct cvmx_npi_px_pair_cnts_s cn58xxp1;
1392};
1393
1394union cvmx_npi_pci_burst_size {
1395 uint64_t u64;
1396 struct cvmx_npi_pci_burst_size_s {
1397 uint64_t reserved_14_63:50;
1398 uint64_t wr_brst:7;
1399 uint64_t rd_brst:7;
1400 } s;
1401 struct cvmx_npi_pci_burst_size_s cn30xx;
1402 struct cvmx_npi_pci_burst_size_s cn31xx;
1403 struct cvmx_npi_pci_burst_size_s cn38xx;
1404 struct cvmx_npi_pci_burst_size_s cn38xxp2;
1405 struct cvmx_npi_pci_burst_size_s cn50xx;
1406 struct cvmx_npi_pci_burst_size_s cn58xx;
1407 struct cvmx_npi_pci_burst_size_s cn58xxp1;
1408};
1409
1410union cvmx_npi_pci_int_arb_cfg {
1411 uint64_t u64;
1412 struct cvmx_npi_pci_int_arb_cfg_s {
1413 uint64_t reserved_13_63:51;
1414 uint64_t hostmode:1;
1415 uint64_t pci_ovr:4;
1416 uint64_t reserved_5_7:3;
1417 uint64_t en:1;
1418 uint64_t park_mod:1;
1419 uint64_t park_dev:3;
1420 } s;
1421 struct cvmx_npi_pci_int_arb_cfg_cn30xx {
1422 uint64_t reserved_5_63:59;
1423 uint64_t en:1;
1424 uint64_t park_mod:1;
1425 uint64_t park_dev:3;
1426 } cn30xx;
1427 struct cvmx_npi_pci_int_arb_cfg_cn30xx cn31xx;
1428 struct cvmx_npi_pci_int_arb_cfg_cn30xx cn38xx;
1429 struct cvmx_npi_pci_int_arb_cfg_cn30xx cn38xxp2;
1430 struct cvmx_npi_pci_int_arb_cfg_s cn50xx;
1431 struct cvmx_npi_pci_int_arb_cfg_s cn58xx;
1432 struct cvmx_npi_pci_int_arb_cfg_s cn58xxp1;
1433};
1434
1435union cvmx_npi_pci_read_cmd {
1436 uint64_t u64;
1437 struct cvmx_npi_pci_read_cmd_s {
1438 uint64_t reserved_11_63:53;
1439 uint64_t cmd_size:11;
1440 } s;
1441 struct cvmx_npi_pci_read_cmd_s cn30xx;
1442 struct cvmx_npi_pci_read_cmd_s cn31xx;
1443 struct cvmx_npi_pci_read_cmd_s cn38xx;
1444 struct cvmx_npi_pci_read_cmd_s cn38xxp2;
1445 struct cvmx_npi_pci_read_cmd_s cn50xx;
1446 struct cvmx_npi_pci_read_cmd_s cn58xx;
1447 struct cvmx_npi_pci_read_cmd_s cn58xxp1;
1448};
1449
1450union cvmx_npi_port32_instr_hdr {
1451 uint64_t u64;
1452 struct cvmx_npi_port32_instr_hdr_s {
1453 uint64_t reserved_44_63:20;
1454 uint64_t pbp:1;
1455 uint64_t rsv_f:5;
1456 uint64_t rparmode:2;
1457 uint64_t rsv_e:1;
1458 uint64_t rskp_len:7;
1459 uint64_t rsv_d:6;
1460 uint64_t use_ihdr:1;
1461 uint64_t rsv_c:5;
1462 uint64_t par_mode:2;
1463 uint64_t rsv_b:1;
1464 uint64_t skp_len:7;
1465 uint64_t rsv_a:6;
1466 } s;
1467 struct cvmx_npi_port32_instr_hdr_s cn30xx;
1468 struct cvmx_npi_port32_instr_hdr_s cn31xx;
1469 struct cvmx_npi_port32_instr_hdr_s cn38xx;
1470 struct cvmx_npi_port32_instr_hdr_s cn38xxp2;
1471 struct cvmx_npi_port32_instr_hdr_s cn50xx;
1472 struct cvmx_npi_port32_instr_hdr_s cn58xx;
1473 struct cvmx_npi_port32_instr_hdr_s cn58xxp1;
1474};
1475
1476union cvmx_npi_port33_instr_hdr {
1477 uint64_t u64;
1478 struct cvmx_npi_port33_instr_hdr_s {
1479 uint64_t reserved_44_63:20;
1480 uint64_t pbp:1;
1481 uint64_t rsv_f:5;
1482 uint64_t rparmode:2;
1483 uint64_t rsv_e:1;
1484 uint64_t rskp_len:7;
1485 uint64_t rsv_d:6;
1486 uint64_t use_ihdr:1;
1487 uint64_t rsv_c:5;
1488 uint64_t par_mode:2;
1489 uint64_t rsv_b:1;
1490 uint64_t skp_len:7;
1491 uint64_t rsv_a:6;
1492 } s;
1493 struct cvmx_npi_port33_instr_hdr_s cn31xx;
1494 struct cvmx_npi_port33_instr_hdr_s cn38xx;
1495 struct cvmx_npi_port33_instr_hdr_s cn38xxp2;
1496 struct cvmx_npi_port33_instr_hdr_s cn50xx;
1497 struct cvmx_npi_port33_instr_hdr_s cn58xx;
1498 struct cvmx_npi_port33_instr_hdr_s cn58xxp1;
1499};
1500
1501union cvmx_npi_port34_instr_hdr {
1502 uint64_t u64;
1503 struct cvmx_npi_port34_instr_hdr_s {
1504 uint64_t reserved_44_63:20;
1505 uint64_t pbp:1;
1506 uint64_t rsv_f:5;
1507 uint64_t rparmode:2;
1508 uint64_t rsv_e:1;
1509 uint64_t rskp_len:7;
1510 uint64_t rsv_d:6;
1511 uint64_t use_ihdr:1;
1512 uint64_t rsv_c:5;
1513 uint64_t par_mode:2;
1514 uint64_t rsv_b:1;
1515 uint64_t skp_len:7;
1516 uint64_t rsv_a:6;
1517 } s;
1518 struct cvmx_npi_port34_instr_hdr_s cn38xx;
1519 struct cvmx_npi_port34_instr_hdr_s cn38xxp2;
1520 struct cvmx_npi_port34_instr_hdr_s cn58xx;
1521 struct cvmx_npi_port34_instr_hdr_s cn58xxp1;
1522};
1523
1524union cvmx_npi_port35_instr_hdr {
1525 uint64_t u64;
1526 struct cvmx_npi_port35_instr_hdr_s {
1527 uint64_t reserved_44_63:20;
1528 uint64_t pbp:1;
1529 uint64_t rsv_f:5;
1530 uint64_t rparmode:2;
1531 uint64_t rsv_e:1;
1532 uint64_t rskp_len:7;
1533 uint64_t rsv_d:6;
1534 uint64_t use_ihdr:1;
1535 uint64_t rsv_c:5;
1536 uint64_t par_mode:2;
1537 uint64_t rsv_b:1;
1538 uint64_t skp_len:7;
1539 uint64_t rsv_a:6;
1540 } s;
1541 struct cvmx_npi_port35_instr_hdr_s cn38xx;
1542 struct cvmx_npi_port35_instr_hdr_s cn38xxp2;
1543 struct cvmx_npi_port35_instr_hdr_s cn58xx;
1544 struct cvmx_npi_port35_instr_hdr_s cn58xxp1;
1545};
1546
1547union cvmx_npi_port_bp_control {
1548 uint64_t u64;
1549 struct cvmx_npi_port_bp_control_s {
1550 uint64_t reserved_8_63:56;
1551 uint64_t bp_on:4;
1552 uint64_t enb:4;
1553 } s;
1554 struct cvmx_npi_port_bp_control_s cn30xx;
1555 struct cvmx_npi_port_bp_control_s cn31xx;
1556 struct cvmx_npi_port_bp_control_s cn38xx;
1557 struct cvmx_npi_port_bp_control_s cn38xxp2;
1558 struct cvmx_npi_port_bp_control_s cn50xx;
1559 struct cvmx_npi_port_bp_control_s cn58xx;
1560 struct cvmx_npi_port_bp_control_s cn58xxp1;
1561};
1562
1563union cvmx_npi_rsl_int_blocks {
1564 uint64_t u64;
1565 struct cvmx_npi_rsl_int_blocks_s {
1566 uint64_t reserved_32_63:32;
1567 uint64_t rint_31:1;
1568 uint64_t iob:1;
1569 uint64_t reserved_28_29:2;
1570 uint64_t rint_27:1;
1571 uint64_t rint_26:1;
1572 uint64_t rint_25:1;
1573 uint64_t rint_24:1;
1574 uint64_t asx1:1;
1575 uint64_t asx0:1;
1576 uint64_t rint_21:1;
1577 uint64_t pip:1;
1578 uint64_t spx1:1;
1579 uint64_t spx0:1;
1580 uint64_t lmc:1;
1581 uint64_t l2c:1;
1582 uint64_t rint_15:1;
1583 uint64_t reserved_13_14:2;
1584 uint64_t pow:1;
1585 uint64_t tim:1;
1586 uint64_t pko:1;
1587 uint64_t ipd:1;
1588 uint64_t rint_8:1;
1589 uint64_t zip:1;
1590 uint64_t dfa:1;
1591 uint64_t fpa:1;
1592 uint64_t key:1;
1593 uint64_t npi:1;
1594 uint64_t gmx1:1;
1595 uint64_t gmx0:1;
1596 uint64_t mio:1;
1597 } s;
1598 struct cvmx_npi_rsl_int_blocks_cn30xx {
1599 uint64_t reserved_32_63:32;
1600 uint64_t rint_31:1;
1601 uint64_t iob:1;
1602 uint64_t rint_29:1;
1603 uint64_t rint_28:1;
1604 uint64_t rint_27:1;
1605 uint64_t rint_26:1;
1606 uint64_t rint_25:1;
1607 uint64_t rint_24:1;
1608 uint64_t asx1:1;
1609 uint64_t asx0:1;
1610 uint64_t rint_21:1;
1611 uint64_t pip:1;
1612 uint64_t spx1:1;
1613 uint64_t spx0:1;
1614 uint64_t lmc:1;
1615 uint64_t l2c:1;
1616 uint64_t rint_15:1;
1617 uint64_t rint_14:1;
1618 uint64_t usb:1;
1619 uint64_t pow:1;
1620 uint64_t tim:1;
1621 uint64_t pko:1;
1622 uint64_t ipd:1;
1623 uint64_t rint_8:1;
1624 uint64_t zip:1;
1625 uint64_t dfa:1;
1626 uint64_t fpa:1;
1627 uint64_t key:1;
1628 uint64_t npi:1;
1629 uint64_t gmx1:1;
1630 uint64_t gmx0:1;
1631 uint64_t mio:1;
1632 } cn30xx;
1633 struct cvmx_npi_rsl_int_blocks_cn30xx cn31xx;
1634 struct cvmx_npi_rsl_int_blocks_cn38xx {
1635 uint64_t reserved_32_63:32;
1636 uint64_t rint_31:1;
1637 uint64_t iob:1;
1638 uint64_t rint_29:1;
1639 uint64_t rint_28:1;
1640 uint64_t rint_27:1;
1641 uint64_t rint_26:1;
1642 uint64_t rint_25:1;
1643 uint64_t rint_24:1;
1644 uint64_t asx1:1;
1645 uint64_t asx0:1;
1646 uint64_t rint_21:1;
1647 uint64_t pip:1;
1648 uint64_t spx1:1;
1649 uint64_t spx0:1;
1650 uint64_t lmc:1;
1651 uint64_t l2c:1;
1652 uint64_t rint_15:1;
1653 uint64_t rint_14:1;
1654 uint64_t rint_13:1;
1655 uint64_t pow:1;
1656 uint64_t tim:1;
1657 uint64_t pko:1;
1658 uint64_t ipd:1;
1659 uint64_t rint_8:1;
1660 uint64_t zip:1;
1661 uint64_t dfa:1;
1662 uint64_t fpa:1;
1663 uint64_t key:1;
1664 uint64_t npi:1;
1665 uint64_t gmx1:1;
1666 uint64_t gmx0:1;
1667 uint64_t mio:1;
1668 } cn38xx;
1669 struct cvmx_npi_rsl_int_blocks_cn38xx cn38xxp2;
1670 struct cvmx_npi_rsl_int_blocks_cn50xx {
1671 uint64_t reserved_31_63:33;
1672 uint64_t iob:1;
1673 uint64_t lmc1:1;
1674 uint64_t agl:1;
1675 uint64_t reserved_24_27:4;
1676 uint64_t asx1:1;
1677 uint64_t asx0:1;
1678 uint64_t reserved_21_21:1;
1679 uint64_t pip:1;
1680 uint64_t spx1:1;
1681 uint64_t spx0:1;
1682 uint64_t lmc:1;
1683 uint64_t l2c:1;
1684 uint64_t reserved_15_15:1;
1685 uint64_t rad:1;
1686 uint64_t usb:1;
1687 uint64_t pow:1;
1688 uint64_t tim:1;
1689 uint64_t pko:1;
1690 uint64_t ipd:1;
1691 uint64_t reserved_8_8:1;
1692 uint64_t zip:1;
1693 uint64_t dfa:1;
1694 uint64_t fpa:1;
1695 uint64_t key:1;
1696 uint64_t npi:1;
1697 uint64_t gmx1:1;
1698 uint64_t gmx0:1;
1699 uint64_t mio:1;
1700 } cn50xx;
1701 struct cvmx_npi_rsl_int_blocks_cn38xx cn58xx;
1702 struct cvmx_npi_rsl_int_blocks_cn38xx cn58xxp1;
1703};
1704
1705union cvmx_npi_size_inputx {
1706 uint64_t u64;
1707 struct cvmx_npi_size_inputx_s {
1708 uint64_t reserved_32_63:32;
1709 uint64_t size:32;
1710 } s;
1711 struct cvmx_npi_size_inputx_s cn30xx;
1712 struct cvmx_npi_size_inputx_s cn31xx;
1713 struct cvmx_npi_size_inputx_s cn38xx;
1714 struct cvmx_npi_size_inputx_s cn38xxp2;
1715 struct cvmx_npi_size_inputx_s cn50xx;
1716 struct cvmx_npi_size_inputx_s cn58xx;
1717 struct cvmx_npi_size_inputx_s cn58xxp1;
1718};
1719
1720union cvmx_npi_win_read_to {
1721 uint64_t u64;
1722 struct cvmx_npi_win_read_to_s {
1723 uint64_t reserved_32_63:32;
1724 uint64_t time:32;
1725 } s;
1726 struct cvmx_npi_win_read_to_s cn30xx;
1727 struct cvmx_npi_win_read_to_s cn31xx;
1728 struct cvmx_npi_win_read_to_s cn38xx;
1729 struct cvmx_npi_win_read_to_s cn38xxp2;
1730 struct cvmx_npi_win_read_to_s cn50xx;
1731 struct cvmx_npi_win_read_to_s cn58xx;
1732 struct cvmx_npi_win_read_to_s cn58xxp1;
1733};
1734
1735#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-pci-defs.h b/arch/mips/include/asm/octeon/cvmx-pci-defs.h
new file mode 100644
index 000000000000..90f8d6535753
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-pci-defs.h
@@ -0,0 +1,1645 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_PCI_DEFS_H__
29#define __CVMX_PCI_DEFS_H__
30
31#define CVMX_PCI_BAR1_INDEXX(offset) \
32 (0x0000000000000100ull + (((offset) & 31) * 4))
33#define CVMX_PCI_BIST_REG \
34 (0x00000000000001C0ull)
35#define CVMX_PCI_CFG00 \
36 (0x0000000000000000ull)
37#define CVMX_PCI_CFG01 \
38 (0x0000000000000004ull)
39#define CVMX_PCI_CFG02 \
40 (0x0000000000000008ull)
41#define CVMX_PCI_CFG03 \
42 (0x000000000000000Cull)
43#define CVMX_PCI_CFG04 \
44 (0x0000000000000010ull)
45#define CVMX_PCI_CFG05 \
46 (0x0000000000000014ull)
47#define CVMX_PCI_CFG06 \
48 (0x0000000000000018ull)
49#define CVMX_PCI_CFG07 \
50 (0x000000000000001Cull)
51#define CVMX_PCI_CFG08 \
52 (0x0000000000000020ull)
53#define CVMX_PCI_CFG09 \
54 (0x0000000000000024ull)
55#define CVMX_PCI_CFG10 \
56 (0x0000000000000028ull)
57#define CVMX_PCI_CFG11 \
58 (0x000000000000002Cull)
59#define CVMX_PCI_CFG12 \
60 (0x0000000000000030ull)
61#define CVMX_PCI_CFG13 \
62 (0x0000000000000034ull)
63#define CVMX_PCI_CFG15 \
64 (0x000000000000003Cull)
65#define CVMX_PCI_CFG16 \
66 (0x0000000000000040ull)
67#define CVMX_PCI_CFG17 \
68 (0x0000000000000044ull)
69#define CVMX_PCI_CFG18 \
70 (0x0000000000000048ull)
71#define CVMX_PCI_CFG19 \
72 (0x000000000000004Cull)
73#define CVMX_PCI_CFG20 \
74 (0x0000000000000050ull)
75#define CVMX_PCI_CFG21 \
76 (0x0000000000000054ull)
77#define CVMX_PCI_CFG22 \
78 (0x0000000000000058ull)
79#define CVMX_PCI_CFG56 \
80 (0x00000000000000E0ull)
81#define CVMX_PCI_CFG57 \
82 (0x00000000000000E4ull)
83#define CVMX_PCI_CFG58 \
84 (0x00000000000000E8ull)
85#define CVMX_PCI_CFG59 \
86 (0x00000000000000ECull)
87#define CVMX_PCI_CFG60 \
88 (0x00000000000000F0ull)
89#define CVMX_PCI_CFG61 \
90 (0x00000000000000F4ull)
91#define CVMX_PCI_CFG62 \
92 (0x00000000000000F8ull)
93#define CVMX_PCI_CFG63 \
94 (0x00000000000000FCull)
95#define CVMX_PCI_CNT_REG \
96 (0x00000000000001B8ull)
97#define CVMX_PCI_CTL_STATUS_2 \
98 (0x000000000000018Cull)
99#define CVMX_PCI_DBELL_0 \
100 (0x0000000000000080ull)
101#define CVMX_PCI_DBELL_1 \
102 (0x0000000000000088ull)
103#define CVMX_PCI_DBELL_2 \
104 (0x0000000000000090ull)
105#define CVMX_PCI_DBELL_3 \
106 (0x0000000000000098ull)
107#define CVMX_PCI_DBELL_X(offset) \
108 (0x0000000000000080ull + (((offset) & 3) * 8))
109#define CVMX_PCI_DMA_CNT0 \
110 (0x00000000000000A0ull)
111#define CVMX_PCI_DMA_CNT1 \
112 (0x00000000000000A8ull)
113#define CVMX_PCI_DMA_CNTX(offset) \
114 (0x00000000000000A0ull + (((offset) & 1) * 8))
115#define CVMX_PCI_DMA_INT_LEV0 \
116 (0x00000000000000A4ull)
117#define CVMX_PCI_DMA_INT_LEV1 \
118 (0x00000000000000ACull)
119#define CVMX_PCI_DMA_INT_LEVX(offset) \
120 (0x00000000000000A4ull + (((offset) & 1) * 8))
121#define CVMX_PCI_DMA_TIME0 \
122 (0x00000000000000B0ull)
123#define CVMX_PCI_DMA_TIME1 \
124 (0x00000000000000B4ull)
125#define CVMX_PCI_DMA_TIMEX(offset) \
126 (0x00000000000000B0ull + (((offset) & 1) * 4))
127#define CVMX_PCI_INSTR_COUNT0 \
128 (0x0000000000000084ull)
129#define CVMX_PCI_INSTR_COUNT1 \
130 (0x000000000000008Cull)
131#define CVMX_PCI_INSTR_COUNT2 \
132 (0x0000000000000094ull)
133#define CVMX_PCI_INSTR_COUNT3 \
134 (0x000000000000009Cull)
135#define CVMX_PCI_INSTR_COUNTX(offset) \
136 (0x0000000000000084ull + (((offset) & 3) * 8))
137#define CVMX_PCI_INT_ENB \
138 (0x0000000000000038ull)
139#define CVMX_PCI_INT_ENB2 \
140 (0x00000000000001A0ull)
141#define CVMX_PCI_INT_SUM \
142 (0x0000000000000030ull)
143#define CVMX_PCI_INT_SUM2 \
144 (0x0000000000000198ull)
145#define CVMX_PCI_MSI_RCV \
146 (0x00000000000000F0ull)
147#define CVMX_PCI_PKTS_SENT0 \
148 (0x0000000000000040ull)
149#define CVMX_PCI_PKTS_SENT1 \
150 (0x0000000000000050ull)
151#define CVMX_PCI_PKTS_SENT2 \
152 (0x0000000000000060ull)
153#define CVMX_PCI_PKTS_SENT3 \
154 (0x0000000000000070ull)
155#define CVMX_PCI_PKTS_SENTX(offset) \
156 (0x0000000000000040ull + (((offset) & 3) * 16))
157#define CVMX_PCI_PKTS_SENT_INT_LEV0 \
158 (0x0000000000000048ull)
159#define CVMX_PCI_PKTS_SENT_INT_LEV1 \
160 (0x0000000000000058ull)
161#define CVMX_PCI_PKTS_SENT_INT_LEV2 \
162 (0x0000000000000068ull)
163#define CVMX_PCI_PKTS_SENT_INT_LEV3 \
164 (0x0000000000000078ull)
165#define CVMX_PCI_PKTS_SENT_INT_LEVX(offset) \
166 (0x0000000000000048ull + (((offset) & 3) * 16))
167#define CVMX_PCI_PKTS_SENT_TIME0 \
168 (0x000000000000004Cull)
169#define CVMX_PCI_PKTS_SENT_TIME1 \
170 (0x000000000000005Cull)
171#define CVMX_PCI_PKTS_SENT_TIME2 \
172 (0x000000000000006Cull)
173#define CVMX_PCI_PKTS_SENT_TIME3 \
174 (0x000000000000007Cull)
175#define CVMX_PCI_PKTS_SENT_TIMEX(offset) \
176 (0x000000000000004Cull + (((offset) & 3) * 16))
177#define CVMX_PCI_PKT_CREDITS0 \
178 (0x0000000000000044ull)
179#define CVMX_PCI_PKT_CREDITS1 \
180 (0x0000000000000054ull)
181#define CVMX_PCI_PKT_CREDITS2 \
182 (0x0000000000000064ull)
183#define CVMX_PCI_PKT_CREDITS3 \
184 (0x0000000000000074ull)
185#define CVMX_PCI_PKT_CREDITSX(offset) \
186 (0x0000000000000044ull + (((offset) & 3) * 16))
187#define CVMX_PCI_READ_CMD_6 \
188 (0x0000000000000180ull)
189#define CVMX_PCI_READ_CMD_C \
190 (0x0000000000000184ull)
191#define CVMX_PCI_READ_CMD_E \
192 (0x0000000000000188ull)
193#define CVMX_PCI_READ_TIMEOUT \
194 CVMX_ADD_IO_SEG(0x00011F00000000B0ull)
195#define CVMX_PCI_SCM_REG \
196 (0x00000000000001A8ull)
197#define CVMX_PCI_TSR_REG \
198 (0x00000000000001B0ull)
199#define CVMX_PCI_WIN_RD_ADDR \
200 (0x0000000000000008ull)
201#define CVMX_PCI_WIN_RD_DATA \
202 (0x0000000000000020ull)
203#define CVMX_PCI_WIN_WR_ADDR \
204 (0x0000000000000000ull)
205#define CVMX_PCI_WIN_WR_DATA \
206 (0x0000000000000010ull)
207#define CVMX_PCI_WIN_WR_MASK \
208 (0x0000000000000018ull)
209
210union cvmx_pci_bar1_indexx {
211 uint32_t u32;
212 struct cvmx_pci_bar1_indexx_s {
213 uint32_t reserved_18_31:14;
214 uint32_t addr_idx:14;
215 uint32_t ca:1;
216 uint32_t end_swp:2;
217 uint32_t addr_v:1;
218 } s;
219 struct cvmx_pci_bar1_indexx_s cn30xx;
220 struct cvmx_pci_bar1_indexx_s cn31xx;
221 struct cvmx_pci_bar1_indexx_s cn38xx;
222 struct cvmx_pci_bar1_indexx_s cn38xxp2;
223 struct cvmx_pci_bar1_indexx_s cn50xx;
224 struct cvmx_pci_bar1_indexx_s cn58xx;
225 struct cvmx_pci_bar1_indexx_s cn58xxp1;
226};
227
228union cvmx_pci_bist_reg {
229 uint64_t u64;
230 struct cvmx_pci_bist_reg_s {
231 uint64_t reserved_10_63:54;
232 uint64_t rsp_bs:1;
233 uint64_t dma0_bs:1;
234 uint64_t cmd0_bs:1;
235 uint64_t cmd_bs:1;
236 uint64_t csr2p_bs:1;
237 uint64_t csrr_bs:1;
238 uint64_t rsp2p_bs:1;
239 uint64_t csr2n_bs:1;
240 uint64_t dat2n_bs:1;
241 uint64_t dbg2n_bs:1;
242 } s;
243 struct cvmx_pci_bist_reg_s cn50xx;
244};
245
246union cvmx_pci_cfg00 {
247 uint32_t u32;
248 struct cvmx_pci_cfg00_s {
249 uint32_t devid:16;
250 uint32_t vendid:16;
251 } s;
252 struct cvmx_pci_cfg00_s cn30xx;
253 struct cvmx_pci_cfg00_s cn31xx;
254 struct cvmx_pci_cfg00_s cn38xx;
255 struct cvmx_pci_cfg00_s cn38xxp2;
256 struct cvmx_pci_cfg00_s cn50xx;
257 struct cvmx_pci_cfg00_s cn58xx;
258 struct cvmx_pci_cfg00_s cn58xxp1;
259};
260
261union cvmx_pci_cfg01 {
262 uint32_t u32;
263 struct cvmx_pci_cfg01_s {
264 uint32_t dpe:1;
265 uint32_t sse:1;
266 uint32_t rma:1;
267 uint32_t rta:1;
268 uint32_t sta:1;
269 uint32_t devt:2;
270 uint32_t mdpe:1;
271 uint32_t fbb:1;
272 uint32_t reserved_22_22:1;
273 uint32_t m66:1;
274 uint32_t cle:1;
275 uint32_t i_stat:1;
276 uint32_t reserved_11_18:8;
277 uint32_t i_dis:1;
278 uint32_t fbbe:1;
279 uint32_t see:1;
280 uint32_t ads:1;
281 uint32_t pee:1;
282 uint32_t vps:1;
283 uint32_t mwice:1;
284 uint32_t scse:1;
285 uint32_t me:1;
286 uint32_t msae:1;
287 uint32_t isae:1;
288 } s;
289 struct cvmx_pci_cfg01_s cn30xx;
290 struct cvmx_pci_cfg01_s cn31xx;
291 struct cvmx_pci_cfg01_s cn38xx;
292 struct cvmx_pci_cfg01_s cn38xxp2;
293 struct cvmx_pci_cfg01_s cn50xx;
294 struct cvmx_pci_cfg01_s cn58xx;
295 struct cvmx_pci_cfg01_s cn58xxp1;
296};
297
298union cvmx_pci_cfg02 {
299 uint32_t u32;
300 struct cvmx_pci_cfg02_s {
301 uint32_t cc:24;
302 uint32_t rid:8;
303 } s;
304 struct cvmx_pci_cfg02_s cn30xx;
305 struct cvmx_pci_cfg02_s cn31xx;
306 struct cvmx_pci_cfg02_s cn38xx;
307 struct cvmx_pci_cfg02_s cn38xxp2;
308 struct cvmx_pci_cfg02_s cn50xx;
309 struct cvmx_pci_cfg02_s cn58xx;
310 struct cvmx_pci_cfg02_s cn58xxp1;
311};
312
313union cvmx_pci_cfg03 {
314 uint32_t u32;
315 struct cvmx_pci_cfg03_s {
316 uint32_t bcap:1;
317 uint32_t brb:1;
318 uint32_t reserved_28_29:2;
319 uint32_t bcod:4;
320 uint32_t ht:8;
321 uint32_t lt:8;
322 uint32_t cls:8;
323 } s;
324 struct cvmx_pci_cfg03_s cn30xx;
325 struct cvmx_pci_cfg03_s cn31xx;
326 struct cvmx_pci_cfg03_s cn38xx;
327 struct cvmx_pci_cfg03_s cn38xxp2;
328 struct cvmx_pci_cfg03_s cn50xx;
329 struct cvmx_pci_cfg03_s cn58xx;
330 struct cvmx_pci_cfg03_s cn58xxp1;
331};
332
333union cvmx_pci_cfg04 {
334 uint32_t u32;
335 struct cvmx_pci_cfg04_s {
336 uint32_t lbase:20;
337 uint32_t lbasez:8;
338 uint32_t pf:1;
339 uint32_t typ:2;
340 uint32_t mspc:1;
341 } s;
342 struct cvmx_pci_cfg04_s cn30xx;
343 struct cvmx_pci_cfg04_s cn31xx;
344 struct cvmx_pci_cfg04_s cn38xx;
345 struct cvmx_pci_cfg04_s cn38xxp2;
346 struct cvmx_pci_cfg04_s cn50xx;
347 struct cvmx_pci_cfg04_s cn58xx;
348 struct cvmx_pci_cfg04_s cn58xxp1;
349};
350
351union cvmx_pci_cfg05 {
352 uint32_t u32;
353 struct cvmx_pci_cfg05_s {
354 uint32_t hbase:32;
355 } s;
356 struct cvmx_pci_cfg05_s cn30xx;
357 struct cvmx_pci_cfg05_s cn31xx;
358 struct cvmx_pci_cfg05_s cn38xx;
359 struct cvmx_pci_cfg05_s cn38xxp2;
360 struct cvmx_pci_cfg05_s cn50xx;
361 struct cvmx_pci_cfg05_s cn58xx;
362 struct cvmx_pci_cfg05_s cn58xxp1;
363};
364
365union cvmx_pci_cfg06 {
366 uint32_t u32;
367 struct cvmx_pci_cfg06_s {
368 uint32_t lbase:5;
369 uint32_t lbasez:23;
370 uint32_t pf:1;
371 uint32_t typ:2;
372 uint32_t mspc:1;
373 } s;
374 struct cvmx_pci_cfg06_s cn30xx;
375 struct cvmx_pci_cfg06_s cn31xx;
376 struct cvmx_pci_cfg06_s cn38xx;
377 struct cvmx_pci_cfg06_s cn38xxp2;
378 struct cvmx_pci_cfg06_s cn50xx;
379 struct cvmx_pci_cfg06_s cn58xx;
380 struct cvmx_pci_cfg06_s cn58xxp1;
381};
382
383union cvmx_pci_cfg07 {
384 uint32_t u32;
385 struct cvmx_pci_cfg07_s {
386 uint32_t hbase:32;
387 } s;
388 struct cvmx_pci_cfg07_s cn30xx;
389 struct cvmx_pci_cfg07_s cn31xx;
390 struct cvmx_pci_cfg07_s cn38xx;
391 struct cvmx_pci_cfg07_s cn38xxp2;
392 struct cvmx_pci_cfg07_s cn50xx;
393 struct cvmx_pci_cfg07_s cn58xx;
394 struct cvmx_pci_cfg07_s cn58xxp1;
395};
396
397union cvmx_pci_cfg08 {
398 uint32_t u32;
399 struct cvmx_pci_cfg08_s {
400 uint32_t lbasez:28;
401 uint32_t pf:1;
402 uint32_t typ:2;
403 uint32_t mspc:1;
404 } s;
405 struct cvmx_pci_cfg08_s cn30xx;
406 struct cvmx_pci_cfg08_s cn31xx;
407 struct cvmx_pci_cfg08_s cn38xx;
408 struct cvmx_pci_cfg08_s cn38xxp2;
409 struct cvmx_pci_cfg08_s cn50xx;
410 struct cvmx_pci_cfg08_s cn58xx;
411 struct cvmx_pci_cfg08_s cn58xxp1;
412};
413
414union cvmx_pci_cfg09 {
415 uint32_t u32;
416 struct cvmx_pci_cfg09_s {
417 uint32_t hbase:25;
418 uint32_t hbasez:7;
419 } s;
420 struct cvmx_pci_cfg09_s cn30xx;
421 struct cvmx_pci_cfg09_s cn31xx;
422 struct cvmx_pci_cfg09_s cn38xx;
423 struct cvmx_pci_cfg09_s cn38xxp2;
424 struct cvmx_pci_cfg09_s cn50xx;
425 struct cvmx_pci_cfg09_s cn58xx;
426 struct cvmx_pci_cfg09_s cn58xxp1;
427};
428
429union cvmx_pci_cfg10 {
430 uint32_t u32;
431 struct cvmx_pci_cfg10_s {
432 uint32_t cisp:32;
433 } s;
434 struct cvmx_pci_cfg10_s cn30xx;
435 struct cvmx_pci_cfg10_s cn31xx;
436 struct cvmx_pci_cfg10_s cn38xx;
437 struct cvmx_pci_cfg10_s cn38xxp2;
438 struct cvmx_pci_cfg10_s cn50xx;
439 struct cvmx_pci_cfg10_s cn58xx;
440 struct cvmx_pci_cfg10_s cn58xxp1;
441};
442
443union cvmx_pci_cfg11 {
444 uint32_t u32;
445 struct cvmx_pci_cfg11_s {
446 uint32_t ssid:16;
447 uint32_t ssvid:16;
448 } s;
449 struct cvmx_pci_cfg11_s cn30xx;
450 struct cvmx_pci_cfg11_s cn31xx;
451 struct cvmx_pci_cfg11_s cn38xx;
452 struct cvmx_pci_cfg11_s cn38xxp2;
453 struct cvmx_pci_cfg11_s cn50xx;
454 struct cvmx_pci_cfg11_s cn58xx;
455 struct cvmx_pci_cfg11_s cn58xxp1;
456};
457
458union cvmx_pci_cfg12 {
459 uint32_t u32;
460 struct cvmx_pci_cfg12_s {
461 uint32_t erbar:16;
462 uint32_t erbarz:5;
463 uint32_t reserved_1_10:10;
464 uint32_t erbar_en:1;
465 } s;
466 struct cvmx_pci_cfg12_s cn30xx;
467 struct cvmx_pci_cfg12_s cn31xx;
468 struct cvmx_pci_cfg12_s cn38xx;
469 struct cvmx_pci_cfg12_s cn38xxp2;
470 struct cvmx_pci_cfg12_s cn50xx;
471 struct cvmx_pci_cfg12_s cn58xx;
472 struct cvmx_pci_cfg12_s cn58xxp1;
473};
474
475union cvmx_pci_cfg13 {
476 uint32_t u32;
477 struct cvmx_pci_cfg13_s {
478 uint32_t reserved_8_31:24;
479 uint32_t cp:8;
480 } s;
481 struct cvmx_pci_cfg13_s cn30xx;
482 struct cvmx_pci_cfg13_s cn31xx;
483 struct cvmx_pci_cfg13_s cn38xx;
484 struct cvmx_pci_cfg13_s cn38xxp2;
485 struct cvmx_pci_cfg13_s cn50xx;
486 struct cvmx_pci_cfg13_s cn58xx;
487 struct cvmx_pci_cfg13_s cn58xxp1;
488};
489
490union cvmx_pci_cfg15 {
491 uint32_t u32;
492 struct cvmx_pci_cfg15_s {
493 uint32_t ml:8;
494 uint32_t mg:8;
495 uint32_t inta:8;
496 uint32_t il:8;
497 } s;
498 struct cvmx_pci_cfg15_s cn30xx;
499 struct cvmx_pci_cfg15_s cn31xx;
500 struct cvmx_pci_cfg15_s cn38xx;
501 struct cvmx_pci_cfg15_s cn38xxp2;
502 struct cvmx_pci_cfg15_s cn50xx;
503 struct cvmx_pci_cfg15_s cn58xx;
504 struct cvmx_pci_cfg15_s cn58xxp1;
505};
506
507union cvmx_pci_cfg16 {
508 uint32_t u32;
509 struct cvmx_pci_cfg16_s {
510 uint32_t trdnpr:1;
511 uint32_t trdard:1;
512 uint32_t rdsati:1;
513 uint32_t trdrs:1;
514 uint32_t trtae:1;
515 uint32_t twsei:1;
516 uint32_t twsen:1;
517 uint32_t twtae:1;
518 uint32_t tmae:1;
519 uint32_t tslte:3;
520 uint32_t tilt:4;
521 uint32_t pbe:12;
522 uint32_t dppmr:1;
523 uint32_t reserved_2_2:1;
524 uint32_t tswc:1;
525 uint32_t mltd:1;
526 } s;
527 struct cvmx_pci_cfg16_s cn30xx;
528 struct cvmx_pci_cfg16_s cn31xx;
529 struct cvmx_pci_cfg16_s cn38xx;
530 struct cvmx_pci_cfg16_s cn38xxp2;
531 struct cvmx_pci_cfg16_s cn50xx;
532 struct cvmx_pci_cfg16_s cn58xx;
533 struct cvmx_pci_cfg16_s cn58xxp1;
534};
535
536union cvmx_pci_cfg17 {
537 uint32_t u32;
538 struct cvmx_pci_cfg17_s {
539 uint32_t tscme:32;
540 } s;
541 struct cvmx_pci_cfg17_s cn30xx;
542 struct cvmx_pci_cfg17_s cn31xx;
543 struct cvmx_pci_cfg17_s cn38xx;
544 struct cvmx_pci_cfg17_s cn38xxp2;
545 struct cvmx_pci_cfg17_s cn50xx;
546 struct cvmx_pci_cfg17_s cn58xx;
547 struct cvmx_pci_cfg17_s cn58xxp1;
548};
549
550union cvmx_pci_cfg18 {
551 uint32_t u32;
552 struct cvmx_pci_cfg18_s {
553 uint32_t tdsrps:32;
554 } s;
555 struct cvmx_pci_cfg18_s cn30xx;
556 struct cvmx_pci_cfg18_s cn31xx;
557 struct cvmx_pci_cfg18_s cn38xx;
558 struct cvmx_pci_cfg18_s cn38xxp2;
559 struct cvmx_pci_cfg18_s cn50xx;
560 struct cvmx_pci_cfg18_s cn58xx;
561 struct cvmx_pci_cfg18_s cn58xxp1;
562};
563
564union cvmx_pci_cfg19 {
565 uint32_t u32;
566 struct cvmx_pci_cfg19_s {
567 uint32_t mrbcm:1;
568 uint32_t mrbci:1;
569 uint32_t mdwe:1;
570 uint32_t mdre:1;
571 uint32_t mdrimc:1;
572 uint32_t mdrrmc:3;
573 uint32_t tmes:8;
574 uint32_t teci:1;
575 uint32_t tmei:1;
576 uint32_t tmse:1;
577 uint32_t tmdpes:1;
578 uint32_t tmapes:1;
579 uint32_t reserved_9_10:2;
580 uint32_t tibcd:1;
581 uint32_t tibde:1;
582 uint32_t reserved_6_6:1;
583 uint32_t tidomc:1;
584 uint32_t tdomc:5;
585 } s;
586 struct cvmx_pci_cfg19_s cn30xx;
587 struct cvmx_pci_cfg19_s cn31xx;
588 struct cvmx_pci_cfg19_s cn38xx;
589 struct cvmx_pci_cfg19_s cn38xxp2;
590 struct cvmx_pci_cfg19_s cn50xx;
591 struct cvmx_pci_cfg19_s cn58xx;
592 struct cvmx_pci_cfg19_s cn58xxp1;
593};
594
595union cvmx_pci_cfg20 {
596 uint32_t u32;
597 struct cvmx_pci_cfg20_s {
598 uint32_t mdsp:32;
599 } s;
600 struct cvmx_pci_cfg20_s cn30xx;
601 struct cvmx_pci_cfg20_s cn31xx;
602 struct cvmx_pci_cfg20_s cn38xx;
603 struct cvmx_pci_cfg20_s cn38xxp2;
604 struct cvmx_pci_cfg20_s cn50xx;
605 struct cvmx_pci_cfg20_s cn58xx;
606 struct cvmx_pci_cfg20_s cn58xxp1;
607};
608
609union cvmx_pci_cfg21 {
610 uint32_t u32;
611 struct cvmx_pci_cfg21_s {
612 uint32_t scmre:32;
613 } s;
614 struct cvmx_pci_cfg21_s cn30xx;
615 struct cvmx_pci_cfg21_s cn31xx;
616 struct cvmx_pci_cfg21_s cn38xx;
617 struct cvmx_pci_cfg21_s cn38xxp2;
618 struct cvmx_pci_cfg21_s cn50xx;
619 struct cvmx_pci_cfg21_s cn58xx;
620 struct cvmx_pci_cfg21_s cn58xxp1;
621};
622
623union cvmx_pci_cfg22 {
624 uint32_t u32;
625 struct cvmx_pci_cfg22_s {
626 uint32_t mac:7;
627 uint32_t reserved_19_24:6;
628 uint32_t flush:1;
629 uint32_t mra:1;
630 uint32_t mtta:1;
631 uint32_t mrv:8;
632 uint32_t mttv:8;
633 } s;
634 struct cvmx_pci_cfg22_s cn30xx;
635 struct cvmx_pci_cfg22_s cn31xx;
636 struct cvmx_pci_cfg22_s cn38xx;
637 struct cvmx_pci_cfg22_s cn38xxp2;
638 struct cvmx_pci_cfg22_s cn50xx;
639 struct cvmx_pci_cfg22_s cn58xx;
640 struct cvmx_pci_cfg22_s cn58xxp1;
641};
642
643union cvmx_pci_cfg56 {
644 uint32_t u32;
645 struct cvmx_pci_cfg56_s {
646 uint32_t reserved_23_31:9;
647 uint32_t most:3;
648 uint32_t mmbc:2;
649 uint32_t roe:1;
650 uint32_t dpere:1;
651 uint32_t ncp:8;
652 uint32_t pxcid:8;
653 } s;
654 struct cvmx_pci_cfg56_s cn30xx;
655 struct cvmx_pci_cfg56_s cn31xx;
656 struct cvmx_pci_cfg56_s cn38xx;
657 struct cvmx_pci_cfg56_s cn38xxp2;
658 struct cvmx_pci_cfg56_s cn50xx;
659 struct cvmx_pci_cfg56_s cn58xx;
660 struct cvmx_pci_cfg56_s cn58xxp1;
661};
662
663union cvmx_pci_cfg57 {
664 uint32_t u32;
665 struct cvmx_pci_cfg57_s {
666 uint32_t reserved_30_31:2;
667 uint32_t scemr:1;
668 uint32_t mcrsd:3;
669 uint32_t mostd:3;
670 uint32_t mmrbcd:2;
671 uint32_t dc:1;
672 uint32_t usc:1;
673 uint32_t scd:1;
674 uint32_t m133:1;
675 uint32_t w64:1;
676 uint32_t bn:8;
677 uint32_t dn:5;
678 uint32_t fn:3;
679 } s;
680 struct cvmx_pci_cfg57_s cn30xx;
681 struct cvmx_pci_cfg57_s cn31xx;
682 struct cvmx_pci_cfg57_s cn38xx;
683 struct cvmx_pci_cfg57_s cn38xxp2;
684 struct cvmx_pci_cfg57_s cn50xx;
685 struct cvmx_pci_cfg57_s cn58xx;
686 struct cvmx_pci_cfg57_s cn58xxp1;
687};
688
689union cvmx_pci_cfg58 {
690 uint32_t u32;
691 struct cvmx_pci_cfg58_s {
692 uint32_t pmes:5;
693 uint32_t d2s:1;
694 uint32_t d1s:1;
695 uint32_t auxc:3;
696 uint32_t dsi:1;
697 uint32_t reserved_20_20:1;
698 uint32_t pmec:1;
699 uint32_t pcimiv:3;
700 uint32_t ncp:8;
701 uint32_t pmcid:8;
702 } s;
703 struct cvmx_pci_cfg58_s cn30xx;
704 struct cvmx_pci_cfg58_s cn31xx;
705 struct cvmx_pci_cfg58_s cn38xx;
706 struct cvmx_pci_cfg58_s cn38xxp2;
707 struct cvmx_pci_cfg58_s cn50xx;
708 struct cvmx_pci_cfg58_s cn58xx;
709 struct cvmx_pci_cfg58_s cn58xxp1;
710};
711
712union cvmx_pci_cfg59 {
713 uint32_t u32;
714 struct cvmx_pci_cfg59_s {
715 uint32_t pmdia:8;
716 uint32_t bpccen:1;
717 uint32_t bd3h:1;
718 uint32_t reserved_16_21:6;
719 uint32_t pmess:1;
720 uint32_t pmedsia:2;
721 uint32_t pmds:4;
722 uint32_t pmeens:1;
723 uint32_t reserved_2_7:6;
724 uint32_t ps:2;
725 } s;
726 struct cvmx_pci_cfg59_s cn30xx;
727 struct cvmx_pci_cfg59_s cn31xx;
728 struct cvmx_pci_cfg59_s cn38xx;
729 struct cvmx_pci_cfg59_s cn38xxp2;
730 struct cvmx_pci_cfg59_s cn50xx;
731 struct cvmx_pci_cfg59_s cn58xx;
732 struct cvmx_pci_cfg59_s cn58xxp1;
733};
734
735union cvmx_pci_cfg60 {
736 uint32_t u32;
737 struct cvmx_pci_cfg60_s {
738 uint32_t reserved_24_31:8;
739 uint32_t m64:1;
740 uint32_t mme:3;
741 uint32_t mmc:3;
742 uint32_t msien:1;
743 uint32_t ncp:8;
744 uint32_t msicid:8;
745 } s;
746 struct cvmx_pci_cfg60_s cn30xx;
747 struct cvmx_pci_cfg60_s cn31xx;
748 struct cvmx_pci_cfg60_s cn38xx;
749 struct cvmx_pci_cfg60_s cn38xxp2;
750 struct cvmx_pci_cfg60_s cn50xx;
751 struct cvmx_pci_cfg60_s cn58xx;
752 struct cvmx_pci_cfg60_s cn58xxp1;
753};
754
755union cvmx_pci_cfg61 {
756 uint32_t u32;
757 struct cvmx_pci_cfg61_s {
758 uint32_t msi31t2:30;
759 uint32_t reserved_0_1:2;
760 } s;
761 struct cvmx_pci_cfg61_s cn30xx;
762 struct cvmx_pci_cfg61_s cn31xx;
763 struct cvmx_pci_cfg61_s cn38xx;
764 struct cvmx_pci_cfg61_s cn38xxp2;
765 struct cvmx_pci_cfg61_s cn50xx;
766 struct cvmx_pci_cfg61_s cn58xx;
767 struct cvmx_pci_cfg61_s cn58xxp1;
768};
769
770union cvmx_pci_cfg62 {
771 uint32_t u32;
772 struct cvmx_pci_cfg62_s {
773 uint32_t msi:32;
774 } s;
775 struct cvmx_pci_cfg62_s cn30xx;
776 struct cvmx_pci_cfg62_s cn31xx;
777 struct cvmx_pci_cfg62_s cn38xx;
778 struct cvmx_pci_cfg62_s cn38xxp2;
779 struct cvmx_pci_cfg62_s cn50xx;
780 struct cvmx_pci_cfg62_s cn58xx;
781 struct cvmx_pci_cfg62_s cn58xxp1;
782};
783
784union cvmx_pci_cfg63 {
785 uint32_t u32;
786 struct cvmx_pci_cfg63_s {
787 uint32_t reserved_16_31:16;
788 uint32_t msimd:16;
789 } s;
790 struct cvmx_pci_cfg63_s cn30xx;
791 struct cvmx_pci_cfg63_s cn31xx;
792 struct cvmx_pci_cfg63_s cn38xx;
793 struct cvmx_pci_cfg63_s cn38xxp2;
794 struct cvmx_pci_cfg63_s cn50xx;
795 struct cvmx_pci_cfg63_s cn58xx;
796 struct cvmx_pci_cfg63_s cn58xxp1;
797};
798
799union cvmx_pci_cnt_reg {
800 uint64_t u64;
801 struct cvmx_pci_cnt_reg_s {
802 uint64_t reserved_38_63:26;
803 uint64_t hm_pcix:1;
804 uint64_t hm_speed:2;
805 uint64_t ap_pcix:1;
806 uint64_t ap_speed:2;
807 uint64_t pcicnt:32;
808 } s;
809 struct cvmx_pci_cnt_reg_s cn50xx;
810 struct cvmx_pci_cnt_reg_s cn58xx;
811 struct cvmx_pci_cnt_reg_s cn58xxp1;
812};
813
814union cvmx_pci_ctl_status_2 {
815 uint32_t u32;
816 struct cvmx_pci_ctl_status_2_s {
817 uint32_t reserved_29_31:3;
818 uint32_t bb1_hole:3;
819 uint32_t bb1_siz:1;
820 uint32_t bb_ca:1;
821 uint32_t bb_es:2;
822 uint32_t bb1:1;
823 uint32_t bb0:1;
824 uint32_t erst_n:1;
825 uint32_t bar2pres:1;
826 uint32_t scmtyp:1;
827 uint32_t scm:1;
828 uint32_t en_wfilt:1;
829 uint32_t reserved_14_14:1;
830 uint32_t ap_pcix:1;
831 uint32_t ap_64ad:1;
832 uint32_t b12_bist:1;
833 uint32_t pmo_amod:1;
834 uint32_t pmo_fpc:3;
835 uint32_t tsr_hwm:3;
836 uint32_t bar2_enb:1;
837 uint32_t bar2_esx:2;
838 uint32_t bar2_cax:1;
839 } s;
840 struct cvmx_pci_ctl_status_2_s cn30xx;
841 struct cvmx_pci_ctl_status_2_cn31xx {
842 uint32_t reserved_20_31:12;
843 uint32_t erst_n:1;
844 uint32_t bar2pres:1;
845 uint32_t scmtyp:1;
846 uint32_t scm:1;
847 uint32_t en_wfilt:1;
848 uint32_t reserved_14_14:1;
849 uint32_t ap_pcix:1;
850 uint32_t ap_64ad:1;
851 uint32_t b12_bist:1;
852 uint32_t pmo_amod:1;
853 uint32_t pmo_fpc:3;
854 uint32_t tsr_hwm:3;
855 uint32_t bar2_enb:1;
856 uint32_t bar2_esx:2;
857 uint32_t bar2_cax:1;
858 } cn31xx;
859 struct cvmx_pci_ctl_status_2_s cn38xx;
860 struct cvmx_pci_ctl_status_2_cn31xx cn38xxp2;
861 struct cvmx_pci_ctl_status_2_s cn50xx;
862 struct cvmx_pci_ctl_status_2_s cn58xx;
863 struct cvmx_pci_ctl_status_2_s cn58xxp1;
864};
865
866union cvmx_pci_dbellx {
867 uint32_t u32;
868 struct cvmx_pci_dbellx_s {
869 uint32_t reserved_16_31:16;
870 uint32_t inc_val:16;
871 } s;
872 struct cvmx_pci_dbellx_s cn30xx;
873 struct cvmx_pci_dbellx_s cn31xx;
874 struct cvmx_pci_dbellx_s cn38xx;
875 struct cvmx_pci_dbellx_s cn38xxp2;
876 struct cvmx_pci_dbellx_s cn50xx;
877 struct cvmx_pci_dbellx_s cn58xx;
878 struct cvmx_pci_dbellx_s cn58xxp1;
879};
880
881union cvmx_pci_dma_cntx {
882 uint32_t u32;
883 struct cvmx_pci_dma_cntx_s {
884 uint32_t dma_cnt:32;
885 } s;
886 struct cvmx_pci_dma_cntx_s cn30xx;
887 struct cvmx_pci_dma_cntx_s cn31xx;
888 struct cvmx_pci_dma_cntx_s cn38xx;
889 struct cvmx_pci_dma_cntx_s cn38xxp2;
890 struct cvmx_pci_dma_cntx_s cn50xx;
891 struct cvmx_pci_dma_cntx_s cn58xx;
892 struct cvmx_pci_dma_cntx_s cn58xxp1;
893};
894
895union cvmx_pci_dma_int_levx {
896 uint32_t u32;
897 struct cvmx_pci_dma_int_levx_s {
898 uint32_t pkt_cnt:32;
899 } s;
900 struct cvmx_pci_dma_int_levx_s cn30xx;
901 struct cvmx_pci_dma_int_levx_s cn31xx;
902 struct cvmx_pci_dma_int_levx_s cn38xx;
903 struct cvmx_pci_dma_int_levx_s cn38xxp2;
904 struct cvmx_pci_dma_int_levx_s cn50xx;
905 struct cvmx_pci_dma_int_levx_s cn58xx;
906 struct cvmx_pci_dma_int_levx_s cn58xxp1;
907};
908
909union cvmx_pci_dma_timex {
910 uint32_t u32;
911 struct cvmx_pci_dma_timex_s {
912 uint32_t dma_time:32;
913 } s;
914 struct cvmx_pci_dma_timex_s cn30xx;
915 struct cvmx_pci_dma_timex_s cn31xx;
916 struct cvmx_pci_dma_timex_s cn38xx;
917 struct cvmx_pci_dma_timex_s cn38xxp2;
918 struct cvmx_pci_dma_timex_s cn50xx;
919 struct cvmx_pci_dma_timex_s cn58xx;
920 struct cvmx_pci_dma_timex_s cn58xxp1;
921};
922
923union cvmx_pci_instr_countx {
924 uint32_t u32;
925 struct cvmx_pci_instr_countx_s {
926 uint32_t icnt:32;
927 } s;
928 struct cvmx_pci_instr_countx_s cn30xx;
929 struct cvmx_pci_instr_countx_s cn31xx;
930 struct cvmx_pci_instr_countx_s cn38xx;
931 struct cvmx_pci_instr_countx_s cn38xxp2;
932 struct cvmx_pci_instr_countx_s cn50xx;
933 struct cvmx_pci_instr_countx_s cn58xx;
934 struct cvmx_pci_instr_countx_s cn58xxp1;
935};
936
937union cvmx_pci_int_enb {
938 uint64_t u64;
939 struct cvmx_pci_int_enb_s {
940 uint64_t reserved_34_63:30;
941 uint64_t ill_rd:1;
942 uint64_t ill_wr:1;
943 uint64_t win_wr:1;
944 uint64_t dma1_fi:1;
945 uint64_t dma0_fi:1;
946 uint64_t idtime1:1;
947 uint64_t idtime0:1;
948 uint64_t idcnt1:1;
949 uint64_t idcnt0:1;
950 uint64_t iptime3:1;
951 uint64_t iptime2:1;
952 uint64_t iptime1:1;
953 uint64_t iptime0:1;
954 uint64_t ipcnt3:1;
955 uint64_t ipcnt2:1;
956 uint64_t ipcnt1:1;
957 uint64_t ipcnt0:1;
958 uint64_t irsl_int:1;
959 uint64_t ill_rrd:1;
960 uint64_t ill_rwr:1;
961 uint64_t idperr:1;
962 uint64_t iaperr:1;
963 uint64_t iserr:1;
964 uint64_t itsr_abt:1;
965 uint64_t imsc_msg:1;
966 uint64_t imsi_mabt:1;
967 uint64_t imsi_tabt:1;
968 uint64_t imsi_per:1;
969 uint64_t imr_tto:1;
970 uint64_t imr_abt:1;
971 uint64_t itr_abt:1;
972 uint64_t imr_wtto:1;
973 uint64_t imr_wabt:1;
974 uint64_t itr_wabt:1;
975 } s;
976 struct cvmx_pci_int_enb_cn30xx {
977 uint64_t reserved_34_63:30;
978 uint64_t ill_rd:1;
979 uint64_t ill_wr:1;
980 uint64_t win_wr:1;
981 uint64_t dma1_fi:1;
982 uint64_t dma0_fi:1;
983 uint64_t idtime1:1;
984 uint64_t idtime0:1;
985 uint64_t idcnt1:1;
986 uint64_t idcnt0:1;
987 uint64_t reserved_22_24:3;
988 uint64_t iptime0:1;
989 uint64_t reserved_18_20:3;
990 uint64_t ipcnt0:1;
991 uint64_t irsl_int:1;
992 uint64_t ill_rrd:1;
993 uint64_t ill_rwr:1;
994 uint64_t idperr:1;
995 uint64_t iaperr:1;
996 uint64_t iserr:1;
997 uint64_t itsr_abt:1;
998 uint64_t imsc_msg:1;
999 uint64_t imsi_mabt:1;
1000 uint64_t imsi_tabt:1;
1001 uint64_t imsi_per:1;
1002 uint64_t imr_tto:1;
1003 uint64_t imr_abt:1;
1004 uint64_t itr_abt:1;
1005 uint64_t imr_wtto:1;
1006 uint64_t imr_wabt:1;
1007 uint64_t itr_wabt:1;
1008 } cn30xx;
1009 struct cvmx_pci_int_enb_cn31xx {
1010 uint64_t reserved_34_63:30;
1011 uint64_t ill_rd:1;
1012 uint64_t ill_wr:1;
1013 uint64_t win_wr:1;
1014 uint64_t dma1_fi:1;
1015 uint64_t dma0_fi:1;
1016 uint64_t idtime1:1;
1017 uint64_t idtime0:1;
1018 uint64_t idcnt1:1;
1019 uint64_t idcnt0:1;
1020 uint64_t reserved_23_24:2;
1021 uint64_t iptime1:1;
1022 uint64_t iptime0:1;
1023 uint64_t reserved_19_20:2;
1024 uint64_t ipcnt1:1;
1025 uint64_t ipcnt0:1;
1026 uint64_t irsl_int:1;
1027 uint64_t ill_rrd:1;
1028 uint64_t ill_rwr:1;
1029 uint64_t idperr:1;
1030 uint64_t iaperr:1;
1031 uint64_t iserr:1;
1032 uint64_t itsr_abt:1;
1033 uint64_t imsc_msg:1;
1034 uint64_t imsi_mabt:1;
1035 uint64_t imsi_tabt:1;
1036 uint64_t imsi_per:1;
1037 uint64_t imr_tto:1;
1038 uint64_t imr_abt:1;
1039 uint64_t itr_abt:1;
1040 uint64_t imr_wtto:1;
1041 uint64_t imr_wabt:1;
1042 uint64_t itr_wabt:1;
1043 } cn31xx;
1044 struct cvmx_pci_int_enb_s cn38xx;
1045 struct cvmx_pci_int_enb_s cn38xxp2;
1046 struct cvmx_pci_int_enb_cn31xx cn50xx;
1047 struct cvmx_pci_int_enb_s cn58xx;
1048 struct cvmx_pci_int_enb_s cn58xxp1;
1049};
1050
1051union cvmx_pci_int_enb2 {
1052 uint64_t u64;
1053 struct cvmx_pci_int_enb2_s {
1054 uint64_t reserved_34_63:30;
1055 uint64_t ill_rd:1;
1056 uint64_t ill_wr:1;
1057 uint64_t win_wr:1;
1058 uint64_t dma1_fi:1;
1059 uint64_t dma0_fi:1;
1060 uint64_t rdtime1:1;
1061 uint64_t rdtime0:1;
1062 uint64_t rdcnt1:1;
1063 uint64_t rdcnt0:1;
1064 uint64_t rptime3:1;
1065 uint64_t rptime2:1;
1066 uint64_t rptime1:1;
1067 uint64_t rptime0:1;
1068 uint64_t rpcnt3:1;
1069 uint64_t rpcnt2:1;
1070 uint64_t rpcnt1:1;
1071 uint64_t rpcnt0:1;
1072 uint64_t rrsl_int:1;
1073 uint64_t ill_rrd:1;
1074 uint64_t ill_rwr:1;
1075 uint64_t rdperr:1;
1076 uint64_t raperr:1;
1077 uint64_t rserr:1;
1078 uint64_t rtsr_abt:1;
1079 uint64_t rmsc_msg:1;
1080 uint64_t rmsi_mabt:1;
1081 uint64_t rmsi_tabt:1;
1082 uint64_t rmsi_per:1;
1083 uint64_t rmr_tto:1;
1084 uint64_t rmr_abt:1;
1085 uint64_t rtr_abt:1;
1086 uint64_t rmr_wtto:1;
1087 uint64_t rmr_wabt:1;
1088 uint64_t rtr_wabt:1;
1089 } s;
1090 struct cvmx_pci_int_enb2_cn30xx {
1091 uint64_t reserved_34_63:30;
1092 uint64_t ill_rd:1;
1093 uint64_t ill_wr:1;
1094 uint64_t win_wr:1;
1095 uint64_t dma1_fi:1;
1096 uint64_t dma0_fi:1;
1097 uint64_t rdtime1:1;
1098 uint64_t rdtime0:1;
1099 uint64_t rdcnt1:1;
1100 uint64_t rdcnt0:1;
1101 uint64_t reserved_22_24:3;
1102 uint64_t rptime0:1;
1103 uint64_t reserved_18_20:3;
1104 uint64_t rpcnt0:1;
1105 uint64_t rrsl_int:1;
1106 uint64_t ill_rrd:1;
1107 uint64_t ill_rwr:1;
1108 uint64_t rdperr:1;
1109 uint64_t raperr:1;
1110 uint64_t rserr:1;
1111 uint64_t rtsr_abt:1;
1112 uint64_t rmsc_msg:1;
1113 uint64_t rmsi_mabt:1;
1114 uint64_t rmsi_tabt:1;
1115 uint64_t rmsi_per:1;
1116 uint64_t rmr_tto:1;
1117 uint64_t rmr_abt:1;
1118 uint64_t rtr_abt:1;
1119 uint64_t rmr_wtto:1;
1120 uint64_t rmr_wabt:1;
1121 uint64_t rtr_wabt:1;
1122 } cn30xx;
1123 struct cvmx_pci_int_enb2_cn31xx {
1124 uint64_t reserved_34_63:30;
1125 uint64_t ill_rd:1;
1126 uint64_t ill_wr:1;
1127 uint64_t win_wr:1;
1128 uint64_t dma1_fi:1;
1129 uint64_t dma0_fi:1;
1130 uint64_t rdtime1:1;
1131 uint64_t rdtime0:1;
1132 uint64_t rdcnt1:1;
1133 uint64_t rdcnt0:1;
1134 uint64_t reserved_23_24:2;
1135 uint64_t rptime1:1;
1136 uint64_t rptime0:1;
1137 uint64_t reserved_19_20:2;
1138 uint64_t rpcnt1:1;
1139 uint64_t rpcnt0:1;
1140 uint64_t rrsl_int:1;
1141 uint64_t ill_rrd:1;
1142 uint64_t ill_rwr:1;
1143 uint64_t rdperr:1;
1144 uint64_t raperr:1;
1145 uint64_t rserr:1;
1146 uint64_t rtsr_abt:1;
1147 uint64_t rmsc_msg:1;
1148 uint64_t rmsi_mabt:1;
1149 uint64_t rmsi_tabt:1;
1150 uint64_t rmsi_per:1;
1151 uint64_t rmr_tto:1;
1152 uint64_t rmr_abt:1;
1153 uint64_t rtr_abt:1;
1154 uint64_t rmr_wtto:1;
1155 uint64_t rmr_wabt:1;
1156 uint64_t rtr_wabt:1;
1157 } cn31xx;
1158 struct cvmx_pci_int_enb2_s cn38xx;
1159 struct cvmx_pci_int_enb2_s cn38xxp2;
1160 struct cvmx_pci_int_enb2_cn31xx cn50xx;
1161 struct cvmx_pci_int_enb2_s cn58xx;
1162 struct cvmx_pci_int_enb2_s cn58xxp1;
1163};
1164
1165union cvmx_pci_int_sum {
1166 uint64_t u64;
1167 struct cvmx_pci_int_sum_s {
1168 uint64_t reserved_34_63:30;
1169 uint64_t ill_rd:1;
1170 uint64_t ill_wr:1;
1171 uint64_t win_wr:1;
1172 uint64_t dma1_fi:1;
1173 uint64_t dma0_fi:1;
1174 uint64_t dtime1:1;
1175 uint64_t dtime0:1;
1176 uint64_t dcnt1:1;
1177 uint64_t dcnt0:1;
1178 uint64_t ptime3:1;
1179 uint64_t ptime2:1;
1180 uint64_t ptime1:1;
1181 uint64_t ptime0:1;
1182 uint64_t pcnt3:1;
1183 uint64_t pcnt2:1;
1184 uint64_t pcnt1:1;
1185 uint64_t pcnt0:1;
1186 uint64_t rsl_int:1;
1187 uint64_t ill_rrd:1;
1188 uint64_t ill_rwr:1;
1189 uint64_t dperr:1;
1190 uint64_t aperr:1;
1191 uint64_t serr:1;
1192 uint64_t tsr_abt:1;
1193 uint64_t msc_msg:1;
1194 uint64_t msi_mabt:1;
1195 uint64_t msi_tabt:1;
1196 uint64_t msi_per:1;
1197 uint64_t mr_tto:1;
1198 uint64_t mr_abt:1;
1199 uint64_t tr_abt:1;
1200 uint64_t mr_wtto:1;
1201 uint64_t mr_wabt:1;
1202 uint64_t tr_wabt:1;
1203 } s;
1204 struct cvmx_pci_int_sum_cn30xx {
1205 uint64_t reserved_34_63:30;
1206 uint64_t ill_rd:1;
1207 uint64_t ill_wr:1;
1208 uint64_t win_wr:1;
1209 uint64_t dma1_fi:1;
1210 uint64_t dma0_fi:1;
1211 uint64_t dtime1:1;
1212 uint64_t dtime0:1;
1213 uint64_t dcnt1:1;
1214 uint64_t dcnt0:1;
1215 uint64_t reserved_22_24:3;
1216 uint64_t ptime0:1;
1217 uint64_t reserved_18_20:3;
1218 uint64_t pcnt0:1;
1219 uint64_t rsl_int:1;
1220 uint64_t ill_rrd:1;
1221 uint64_t ill_rwr:1;
1222 uint64_t dperr:1;
1223 uint64_t aperr:1;
1224 uint64_t serr:1;
1225 uint64_t tsr_abt:1;
1226 uint64_t msc_msg:1;
1227 uint64_t msi_mabt:1;
1228 uint64_t msi_tabt:1;
1229 uint64_t msi_per:1;
1230 uint64_t mr_tto:1;
1231 uint64_t mr_abt:1;
1232 uint64_t tr_abt:1;
1233 uint64_t mr_wtto:1;
1234 uint64_t mr_wabt:1;
1235 uint64_t tr_wabt:1;
1236 } cn30xx;
1237 struct cvmx_pci_int_sum_cn31xx {
1238 uint64_t reserved_34_63:30;
1239 uint64_t ill_rd:1;
1240 uint64_t ill_wr:1;
1241 uint64_t win_wr:1;
1242 uint64_t dma1_fi:1;
1243 uint64_t dma0_fi:1;
1244 uint64_t dtime1:1;
1245 uint64_t dtime0:1;
1246 uint64_t dcnt1:1;
1247 uint64_t dcnt0:1;
1248 uint64_t reserved_23_24:2;
1249 uint64_t ptime1:1;
1250 uint64_t ptime0:1;
1251 uint64_t reserved_19_20:2;
1252 uint64_t pcnt1:1;
1253 uint64_t pcnt0:1;
1254 uint64_t rsl_int:1;
1255 uint64_t ill_rrd:1;
1256 uint64_t ill_rwr:1;
1257 uint64_t dperr:1;
1258 uint64_t aperr:1;
1259 uint64_t serr:1;
1260 uint64_t tsr_abt:1;
1261 uint64_t msc_msg:1;
1262 uint64_t msi_mabt:1;
1263 uint64_t msi_tabt:1;
1264 uint64_t msi_per:1;
1265 uint64_t mr_tto:1;
1266 uint64_t mr_abt:1;
1267 uint64_t tr_abt:1;
1268 uint64_t mr_wtto:1;
1269 uint64_t mr_wabt:1;
1270 uint64_t tr_wabt:1;
1271 } cn31xx;
1272 struct cvmx_pci_int_sum_s cn38xx;
1273 struct cvmx_pci_int_sum_s cn38xxp2;
1274 struct cvmx_pci_int_sum_cn31xx cn50xx;
1275 struct cvmx_pci_int_sum_s cn58xx;
1276 struct cvmx_pci_int_sum_s cn58xxp1;
1277};
1278
1279union cvmx_pci_int_sum2 {
1280 uint64_t u64;
1281 struct cvmx_pci_int_sum2_s {
1282 uint64_t reserved_34_63:30;
1283 uint64_t ill_rd:1;
1284 uint64_t ill_wr:1;
1285 uint64_t win_wr:1;
1286 uint64_t dma1_fi:1;
1287 uint64_t dma0_fi:1;
1288 uint64_t dtime1:1;
1289 uint64_t dtime0:1;
1290 uint64_t dcnt1:1;
1291 uint64_t dcnt0:1;
1292 uint64_t ptime3:1;
1293 uint64_t ptime2:1;
1294 uint64_t ptime1:1;
1295 uint64_t ptime0:1;
1296 uint64_t pcnt3:1;
1297 uint64_t pcnt2:1;
1298 uint64_t pcnt1:1;
1299 uint64_t pcnt0:1;
1300 uint64_t rsl_int:1;
1301 uint64_t ill_rrd:1;
1302 uint64_t ill_rwr:1;
1303 uint64_t dperr:1;
1304 uint64_t aperr:1;
1305 uint64_t serr:1;
1306 uint64_t tsr_abt:1;
1307 uint64_t msc_msg:1;
1308 uint64_t msi_mabt:1;
1309 uint64_t msi_tabt:1;
1310 uint64_t msi_per:1;
1311 uint64_t mr_tto:1;
1312 uint64_t mr_abt:1;
1313 uint64_t tr_abt:1;
1314 uint64_t mr_wtto:1;
1315 uint64_t mr_wabt:1;
1316 uint64_t tr_wabt:1;
1317 } s;
1318 struct cvmx_pci_int_sum2_cn30xx {
1319 uint64_t reserved_34_63:30;
1320 uint64_t ill_rd:1;
1321 uint64_t ill_wr:1;
1322 uint64_t win_wr:1;
1323 uint64_t dma1_fi:1;
1324 uint64_t dma0_fi:1;
1325 uint64_t dtime1:1;
1326 uint64_t dtime0:1;
1327 uint64_t dcnt1:1;
1328 uint64_t dcnt0:1;
1329 uint64_t reserved_22_24:3;
1330 uint64_t ptime0:1;
1331 uint64_t reserved_18_20:3;
1332 uint64_t pcnt0:1;
1333 uint64_t rsl_int:1;
1334 uint64_t ill_rrd:1;
1335 uint64_t ill_rwr:1;
1336 uint64_t dperr:1;
1337 uint64_t aperr:1;
1338 uint64_t serr:1;
1339 uint64_t tsr_abt:1;
1340 uint64_t msc_msg:1;
1341 uint64_t msi_mabt:1;
1342 uint64_t msi_tabt:1;
1343 uint64_t msi_per:1;
1344 uint64_t mr_tto:1;
1345 uint64_t mr_abt:1;
1346 uint64_t tr_abt:1;
1347 uint64_t mr_wtto:1;
1348 uint64_t mr_wabt:1;
1349 uint64_t tr_wabt:1;
1350 } cn30xx;
1351 struct cvmx_pci_int_sum2_cn31xx {
1352 uint64_t reserved_34_63:30;
1353 uint64_t ill_rd:1;
1354 uint64_t ill_wr:1;
1355 uint64_t win_wr:1;
1356 uint64_t dma1_fi:1;
1357 uint64_t dma0_fi:1;
1358 uint64_t dtime1:1;
1359 uint64_t dtime0:1;
1360 uint64_t dcnt1:1;
1361 uint64_t dcnt0:1;
1362 uint64_t reserved_23_24:2;
1363 uint64_t ptime1:1;
1364 uint64_t ptime0:1;
1365 uint64_t reserved_19_20:2;
1366 uint64_t pcnt1:1;
1367 uint64_t pcnt0:1;
1368 uint64_t rsl_int:1;
1369 uint64_t ill_rrd:1;
1370 uint64_t ill_rwr:1;
1371 uint64_t dperr:1;
1372 uint64_t aperr:1;
1373 uint64_t serr:1;
1374 uint64_t tsr_abt:1;
1375 uint64_t msc_msg:1;
1376 uint64_t msi_mabt:1;
1377 uint64_t msi_tabt:1;
1378 uint64_t msi_per:1;
1379 uint64_t mr_tto:1;
1380 uint64_t mr_abt:1;
1381 uint64_t tr_abt:1;
1382 uint64_t mr_wtto:1;
1383 uint64_t mr_wabt:1;
1384 uint64_t tr_wabt:1;
1385 } cn31xx;
1386 struct cvmx_pci_int_sum2_s cn38xx;
1387 struct cvmx_pci_int_sum2_s cn38xxp2;
1388 struct cvmx_pci_int_sum2_cn31xx cn50xx;
1389 struct cvmx_pci_int_sum2_s cn58xx;
1390 struct cvmx_pci_int_sum2_s cn58xxp1;
1391};
1392
1393union cvmx_pci_msi_rcv {
1394 uint32_t u32;
1395 struct cvmx_pci_msi_rcv_s {
1396 uint32_t reserved_6_31:26;
1397 uint32_t intr:6;
1398 } s;
1399 struct cvmx_pci_msi_rcv_s cn30xx;
1400 struct cvmx_pci_msi_rcv_s cn31xx;
1401 struct cvmx_pci_msi_rcv_s cn38xx;
1402 struct cvmx_pci_msi_rcv_s cn38xxp2;
1403 struct cvmx_pci_msi_rcv_s cn50xx;
1404 struct cvmx_pci_msi_rcv_s cn58xx;
1405 struct cvmx_pci_msi_rcv_s cn58xxp1;
1406};
1407
1408union cvmx_pci_pkt_creditsx {
1409 uint32_t u32;
1410 struct cvmx_pci_pkt_creditsx_s {
1411 uint32_t pkt_cnt:16;
1412 uint32_t ptr_cnt:16;
1413 } s;
1414 struct cvmx_pci_pkt_creditsx_s cn30xx;
1415 struct cvmx_pci_pkt_creditsx_s cn31xx;
1416 struct cvmx_pci_pkt_creditsx_s cn38xx;
1417 struct cvmx_pci_pkt_creditsx_s cn38xxp2;
1418 struct cvmx_pci_pkt_creditsx_s cn50xx;
1419 struct cvmx_pci_pkt_creditsx_s cn58xx;
1420 struct cvmx_pci_pkt_creditsx_s cn58xxp1;
1421};
1422
1423union cvmx_pci_pkts_sentx {
1424 uint32_t u32;
1425 struct cvmx_pci_pkts_sentx_s {
1426 uint32_t pkt_cnt:32;
1427 } s;
1428 struct cvmx_pci_pkts_sentx_s cn30xx;
1429 struct cvmx_pci_pkts_sentx_s cn31xx;
1430 struct cvmx_pci_pkts_sentx_s cn38xx;
1431 struct cvmx_pci_pkts_sentx_s cn38xxp2;
1432 struct cvmx_pci_pkts_sentx_s cn50xx;
1433 struct cvmx_pci_pkts_sentx_s cn58xx;
1434 struct cvmx_pci_pkts_sentx_s cn58xxp1;
1435};
1436
1437union cvmx_pci_pkts_sent_int_levx {
1438 uint32_t u32;
1439 struct cvmx_pci_pkts_sent_int_levx_s {
1440 uint32_t pkt_cnt:32;
1441 } s;
1442 struct cvmx_pci_pkts_sent_int_levx_s cn30xx;
1443 struct cvmx_pci_pkts_sent_int_levx_s cn31xx;
1444 struct cvmx_pci_pkts_sent_int_levx_s cn38xx;
1445 struct cvmx_pci_pkts_sent_int_levx_s cn38xxp2;
1446 struct cvmx_pci_pkts_sent_int_levx_s cn50xx;
1447 struct cvmx_pci_pkts_sent_int_levx_s cn58xx;
1448 struct cvmx_pci_pkts_sent_int_levx_s cn58xxp1;
1449};
1450
1451union cvmx_pci_pkts_sent_timex {
1452 uint32_t u32;
1453 struct cvmx_pci_pkts_sent_timex_s {
1454 uint32_t pkt_time:32;
1455 } s;
1456 struct cvmx_pci_pkts_sent_timex_s cn30xx;
1457 struct cvmx_pci_pkts_sent_timex_s cn31xx;
1458 struct cvmx_pci_pkts_sent_timex_s cn38xx;
1459 struct cvmx_pci_pkts_sent_timex_s cn38xxp2;
1460 struct cvmx_pci_pkts_sent_timex_s cn50xx;
1461 struct cvmx_pci_pkts_sent_timex_s cn58xx;
1462 struct cvmx_pci_pkts_sent_timex_s cn58xxp1;
1463};
1464
1465union cvmx_pci_read_cmd_6 {
1466 uint32_t u32;
1467 struct cvmx_pci_read_cmd_6_s {
1468 uint32_t reserved_9_31:23;
1469 uint32_t min_data:6;
1470 uint32_t prefetch:3;
1471 } s;
1472 struct cvmx_pci_read_cmd_6_s cn30xx;
1473 struct cvmx_pci_read_cmd_6_s cn31xx;
1474 struct cvmx_pci_read_cmd_6_s cn38xx;
1475 struct cvmx_pci_read_cmd_6_s cn38xxp2;
1476 struct cvmx_pci_read_cmd_6_s cn50xx;
1477 struct cvmx_pci_read_cmd_6_s cn58xx;
1478 struct cvmx_pci_read_cmd_6_s cn58xxp1;
1479};
1480
1481union cvmx_pci_read_cmd_c {
1482 uint32_t u32;
1483 struct cvmx_pci_read_cmd_c_s {
1484 uint32_t reserved_9_31:23;
1485 uint32_t min_data:6;
1486 uint32_t prefetch:3;
1487 } s;
1488 struct cvmx_pci_read_cmd_c_s cn30xx;
1489 struct cvmx_pci_read_cmd_c_s cn31xx;
1490 struct cvmx_pci_read_cmd_c_s cn38xx;
1491 struct cvmx_pci_read_cmd_c_s cn38xxp2;
1492 struct cvmx_pci_read_cmd_c_s cn50xx;
1493 struct cvmx_pci_read_cmd_c_s cn58xx;
1494 struct cvmx_pci_read_cmd_c_s cn58xxp1;
1495};
1496
1497union cvmx_pci_read_cmd_e {
1498 uint32_t u32;
1499 struct cvmx_pci_read_cmd_e_s {
1500 uint32_t reserved_9_31:23;
1501 uint32_t min_data:6;
1502 uint32_t prefetch:3;
1503 } s;
1504 struct cvmx_pci_read_cmd_e_s cn30xx;
1505 struct cvmx_pci_read_cmd_e_s cn31xx;
1506 struct cvmx_pci_read_cmd_e_s cn38xx;
1507 struct cvmx_pci_read_cmd_e_s cn38xxp2;
1508 struct cvmx_pci_read_cmd_e_s cn50xx;
1509 struct cvmx_pci_read_cmd_e_s cn58xx;
1510 struct cvmx_pci_read_cmd_e_s cn58xxp1;
1511};
1512
1513union cvmx_pci_read_timeout {
1514 uint64_t u64;
1515 struct cvmx_pci_read_timeout_s {
1516 uint64_t reserved_32_63:32;
1517 uint64_t enb:1;
1518 uint64_t cnt:31;
1519 } s;
1520 struct cvmx_pci_read_timeout_s cn30xx;
1521 struct cvmx_pci_read_timeout_s cn31xx;
1522 struct cvmx_pci_read_timeout_s cn38xx;
1523 struct cvmx_pci_read_timeout_s cn38xxp2;
1524 struct cvmx_pci_read_timeout_s cn50xx;
1525 struct cvmx_pci_read_timeout_s cn58xx;
1526 struct cvmx_pci_read_timeout_s cn58xxp1;
1527};
1528
1529union cvmx_pci_scm_reg {
1530 uint64_t u64;
1531 struct cvmx_pci_scm_reg_s {
1532 uint64_t reserved_32_63:32;
1533 uint64_t scm:32;
1534 } s;
1535 struct cvmx_pci_scm_reg_s cn30xx;
1536 struct cvmx_pci_scm_reg_s cn31xx;
1537 struct cvmx_pci_scm_reg_s cn38xx;
1538 struct cvmx_pci_scm_reg_s cn38xxp2;
1539 struct cvmx_pci_scm_reg_s cn50xx;
1540 struct cvmx_pci_scm_reg_s cn58xx;
1541 struct cvmx_pci_scm_reg_s cn58xxp1;
1542};
1543
1544union cvmx_pci_tsr_reg {
1545 uint64_t u64;
1546 struct cvmx_pci_tsr_reg_s {
1547 uint64_t reserved_36_63:28;
1548 uint64_t tsr:36;
1549 } s;
1550 struct cvmx_pci_tsr_reg_s cn30xx;
1551 struct cvmx_pci_tsr_reg_s cn31xx;
1552 struct cvmx_pci_tsr_reg_s cn38xx;
1553 struct cvmx_pci_tsr_reg_s cn38xxp2;
1554 struct cvmx_pci_tsr_reg_s cn50xx;
1555 struct cvmx_pci_tsr_reg_s cn58xx;
1556 struct cvmx_pci_tsr_reg_s cn58xxp1;
1557};
1558
1559union cvmx_pci_win_rd_addr {
1560 uint64_t u64;
1561 struct cvmx_pci_win_rd_addr_s {
1562 uint64_t reserved_49_63:15;
1563 uint64_t iobit:1;
1564 uint64_t reserved_0_47:48;
1565 } s;
1566 struct cvmx_pci_win_rd_addr_cn30xx {
1567 uint64_t reserved_49_63:15;
1568 uint64_t iobit:1;
1569 uint64_t rd_addr:46;
1570 uint64_t reserved_0_1:2;
1571 } cn30xx;
1572 struct cvmx_pci_win_rd_addr_cn30xx cn31xx;
1573 struct cvmx_pci_win_rd_addr_cn38xx {
1574 uint64_t reserved_49_63:15;
1575 uint64_t iobit:1;
1576 uint64_t rd_addr:45;
1577 uint64_t reserved_0_2:3;
1578 } cn38xx;
1579 struct cvmx_pci_win_rd_addr_cn38xx cn38xxp2;
1580 struct cvmx_pci_win_rd_addr_cn30xx cn50xx;
1581 struct cvmx_pci_win_rd_addr_cn38xx cn58xx;
1582 struct cvmx_pci_win_rd_addr_cn38xx cn58xxp1;
1583};
1584
1585union cvmx_pci_win_rd_data {
1586 uint64_t u64;
1587 struct cvmx_pci_win_rd_data_s {
1588 uint64_t rd_data:64;
1589 } s;
1590 struct cvmx_pci_win_rd_data_s cn30xx;
1591 struct cvmx_pci_win_rd_data_s cn31xx;
1592 struct cvmx_pci_win_rd_data_s cn38xx;
1593 struct cvmx_pci_win_rd_data_s cn38xxp2;
1594 struct cvmx_pci_win_rd_data_s cn50xx;
1595 struct cvmx_pci_win_rd_data_s cn58xx;
1596 struct cvmx_pci_win_rd_data_s cn58xxp1;
1597};
1598
1599union cvmx_pci_win_wr_addr {
1600 uint64_t u64;
1601 struct cvmx_pci_win_wr_addr_s {
1602 uint64_t reserved_49_63:15;
1603 uint64_t iobit:1;
1604 uint64_t wr_addr:45;
1605 uint64_t reserved_0_2:3;
1606 } s;
1607 struct cvmx_pci_win_wr_addr_s cn30xx;
1608 struct cvmx_pci_win_wr_addr_s cn31xx;
1609 struct cvmx_pci_win_wr_addr_s cn38xx;
1610 struct cvmx_pci_win_wr_addr_s cn38xxp2;
1611 struct cvmx_pci_win_wr_addr_s cn50xx;
1612 struct cvmx_pci_win_wr_addr_s cn58xx;
1613 struct cvmx_pci_win_wr_addr_s cn58xxp1;
1614};
1615
1616union cvmx_pci_win_wr_data {
1617 uint64_t u64;
1618 struct cvmx_pci_win_wr_data_s {
1619 uint64_t wr_data:64;
1620 } s;
1621 struct cvmx_pci_win_wr_data_s cn30xx;
1622 struct cvmx_pci_win_wr_data_s cn31xx;
1623 struct cvmx_pci_win_wr_data_s cn38xx;
1624 struct cvmx_pci_win_wr_data_s cn38xxp2;
1625 struct cvmx_pci_win_wr_data_s cn50xx;
1626 struct cvmx_pci_win_wr_data_s cn58xx;
1627 struct cvmx_pci_win_wr_data_s cn58xxp1;
1628};
1629
1630union cvmx_pci_win_wr_mask {
1631 uint64_t u64;
1632 struct cvmx_pci_win_wr_mask_s {
1633 uint64_t reserved_8_63:56;
1634 uint64_t wr_mask:8;
1635 } s;
1636 struct cvmx_pci_win_wr_mask_s cn30xx;
1637 struct cvmx_pci_win_wr_mask_s cn31xx;
1638 struct cvmx_pci_win_wr_mask_s cn38xx;
1639 struct cvmx_pci_win_wr_mask_s cn38xxp2;
1640 struct cvmx_pci_win_wr_mask_s cn50xx;
1641 struct cvmx_pci_win_wr_mask_s cn58xx;
1642 struct cvmx_pci_win_wr_mask_s cn58xxp1;
1643};
1644
1645#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-pcieep-defs.h b/arch/mips/include/asm/octeon/cvmx-pcieep-defs.h
new file mode 100644
index 000000000000..d553f8e88df6
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-pcieep-defs.h
@@ -0,0 +1,1365 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_PCIEEP_DEFS_H__
29#define __CVMX_PCIEEP_DEFS_H__
30
31#define CVMX_PCIEEP_CFG000 \
32 (0x0000000000000000ull)
33#define CVMX_PCIEEP_CFG001 \
34 (0x0000000000000004ull)
35#define CVMX_PCIEEP_CFG002 \
36 (0x0000000000000008ull)
37#define CVMX_PCIEEP_CFG003 \
38 (0x000000000000000Cull)
39#define CVMX_PCIEEP_CFG004 \
40 (0x0000000000000010ull)
41#define CVMX_PCIEEP_CFG004_MASK \
42 (0x0000000080000010ull)
43#define CVMX_PCIEEP_CFG005 \
44 (0x0000000000000014ull)
45#define CVMX_PCIEEP_CFG005_MASK \
46 (0x0000000080000014ull)
47#define CVMX_PCIEEP_CFG006 \
48 (0x0000000000000018ull)
49#define CVMX_PCIEEP_CFG006_MASK \
50 (0x0000000080000018ull)
51#define CVMX_PCIEEP_CFG007 \
52 (0x000000000000001Cull)
53#define CVMX_PCIEEP_CFG007_MASK \
54 (0x000000008000001Cull)
55#define CVMX_PCIEEP_CFG008 \
56 (0x0000000000000020ull)
57#define CVMX_PCIEEP_CFG008_MASK \
58 (0x0000000080000020ull)
59#define CVMX_PCIEEP_CFG009 \
60 (0x0000000000000024ull)
61#define CVMX_PCIEEP_CFG009_MASK \
62 (0x0000000080000024ull)
63#define CVMX_PCIEEP_CFG010 \
64 (0x0000000000000028ull)
65#define CVMX_PCIEEP_CFG011 \
66 (0x000000000000002Cull)
67#define CVMX_PCIEEP_CFG012 \
68 (0x0000000000000030ull)
69#define CVMX_PCIEEP_CFG012_MASK \
70 (0x0000000080000030ull)
71#define CVMX_PCIEEP_CFG013 \
72 (0x0000000000000034ull)
73#define CVMX_PCIEEP_CFG015 \
74 (0x000000000000003Cull)
75#define CVMX_PCIEEP_CFG016 \
76 (0x0000000000000040ull)
77#define CVMX_PCIEEP_CFG017 \
78 (0x0000000000000044ull)
79#define CVMX_PCIEEP_CFG020 \
80 (0x0000000000000050ull)
81#define CVMX_PCIEEP_CFG021 \
82 (0x0000000000000054ull)
83#define CVMX_PCIEEP_CFG022 \
84 (0x0000000000000058ull)
85#define CVMX_PCIEEP_CFG023 \
86 (0x000000000000005Cull)
87#define CVMX_PCIEEP_CFG028 \
88 (0x0000000000000070ull)
89#define CVMX_PCIEEP_CFG029 \
90 (0x0000000000000074ull)
91#define CVMX_PCIEEP_CFG030 \
92 (0x0000000000000078ull)
93#define CVMX_PCIEEP_CFG031 \
94 (0x000000000000007Cull)
95#define CVMX_PCIEEP_CFG032 \
96 (0x0000000000000080ull)
97#define CVMX_PCIEEP_CFG033 \
98 (0x0000000000000084ull)
99#define CVMX_PCIEEP_CFG034 \
100 (0x0000000000000088ull)
101#define CVMX_PCIEEP_CFG037 \
102 (0x0000000000000094ull)
103#define CVMX_PCIEEP_CFG038 \
104 (0x0000000000000098ull)
105#define CVMX_PCIEEP_CFG039 \
106 (0x000000000000009Cull)
107#define CVMX_PCIEEP_CFG040 \
108 (0x00000000000000A0ull)
109#define CVMX_PCIEEP_CFG041 \
110 (0x00000000000000A4ull)
111#define CVMX_PCIEEP_CFG042 \
112 (0x00000000000000A8ull)
113#define CVMX_PCIEEP_CFG064 \
114 (0x0000000000000100ull)
115#define CVMX_PCIEEP_CFG065 \
116 (0x0000000000000104ull)
117#define CVMX_PCIEEP_CFG066 \
118 (0x0000000000000108ull)
119#define CVMX_PCIEEP_CFG067 \
120 (0x000000000000010Cull)
121#define CVMX_PCIEEP_CFG068 \
122 (0x0000000000000110ull)
123#define CVMX_PCIEEP_CFG069 \
124 (0x0000000000000114ull)
125#define CVMX_PCIEEP_CFG070 \
126 (0x0000000000000118ull)
127#define CVMX_PCIEEP_CFG071 \
128 (0x000000000000011Cull)
129#define CVMX_PCIEEP_CFG072 \
130 (0x0000000000000120ull)
131#define CVMX_PCIEEP_CFG073 \
132 (0x0000000000000124ull)
133#define CVMX_PCIEEP_CFG074 \
134 (0x0000000000000128ull)
135#define CVMX_PCIEEP_CFG448 \
136 (0x0000000000000700ull)
137#define CVMX_PCIEEP_CFG449 \
138 (0x0000000000000704ull)
139#define CVMX_PCIEEP_CFG450 \
140 (0x0000000000000708ull)
141#define CVMX_PCIEEP_CFG451 \
142 (0x000000000000070Cull)
143#define CVMX_PCIEEP_CFG452 \
144 (0x0000000000000710ull)
145#define CVMX_PCIEEP_CFG453 \
146 (0x0000000000000714ull)
147#define CVMX_PCIEEP_CFG454 \
148 (0x0000000000000718ull)
149#define CVMX_PCIEEP_CFG455 \
150 (0x000000000000071Cull)
151#define CVMX_PCIEEP_CFG456 \
152 (0x0000000000000720ull)
153#define CVMX_PCIEEP_CFG458 \
154 (0x0000000000000728ull)
155#define CVMX_PCIEEP_CFG459 \
156 (0x000000000000072Cull)
157#define CVMX_PCIEEP_CFG460 \
158 (0x0000000000000730ull)
159#define CVMX_PCIEEP_CFG461 \
160 (0x0000000000000734ull)
161#define CVMX_PCIEEP_CFG462 \
162 (0x0000000000000738ull)
163#define CVMX_PCIEEP_CFG463 \
164 (0x000000000000073Cull)
165#define CVMX_PCIEEP_CFG464 \
166 (0x0000000000000740ull)
167#define CVMX_PCIEEP_CFG465 \
168 (0x0000000000000744ull)
169#define CVMX_PCIEEP_CFG466 \
170 (0x0000000000000748ull)
171#define CVMX_PCIEEP_CFG467 \
172 (0x000000000000074Cull)
173#define CVMX_PCIEEP_CFG468 \
174 (0x0000000000000750ull)
175#define CVMX_PCIEEP_CFG490 \
176 (0x00000000000007A8ull)
177#define CVMX_PCIEEP_CFG491 \
178 (0x00000000000007ACull)
179#define CVMX_PCIEEP_CFG492 \
180 (0x00000000000007B0ull)
181#define CVMX_PCIEEP_CFG516 \
182 (0x0000000000000810ull)
183#define CVMX_PCIEEP_CFG517 \
184 (0x0000000000000814ull)
185
186union cvmx_pcieep_cfg000 {
187 uint32_t u32;
188 struct cvmx_pcieep_cfg000_s {
189 uint32_t devid:16;
190 uint32_t vendid:16;
191 } s;
192 struct cvmx_pcieep_cfg000_s cn52xx;
193 struct cvmx_pcieep_cfg000_s cn52xxp1;
194 struct cvmx_pcieep_cfg000_s cn56xx;
195 struct cvmx_pcieep_cfg000_s cn56xxp1;
196};
197
198union cvmx_pcieep_cfg001 {
199 uint32_t u32;
200 struct cvmx_pcieep_cfg001_s {
201 uint32_t dpe:1;
202 uint32_t sse:1;
203 uint32_t rma:1;
204 uint32_t rta:1;
205 uint32_t sta:1;
206 uint32_t devt:2;
207 uint32_t mdpe:1;
208 uint32_t fbb:1;
209 uint32_t reserved_22_22:1;
210 uint32_t m66:1;
211 uint32_t cl:1;
212 uint32_t i_stat:1;
213 uint32_t reserved_11_18:8;
214 uint32_t i_dis:1;
215 uint32_t fbbe:1;
216 uint32_t see:1;
217 uint32_t ids_wcc:1;
218 uint32_t per:1;
219 uint32_t vps:1;
220 uint32_t mwice:1;
221 uint32_t scse:1;
222 uint32_t me:1;
223 uint32_t msae:1;
224 uint32_t isae:1;
225 } s;
226 struct cvmx_pcieep_cfg001_s cn52xx;
227 struct cvmx_pcieep_cfg001_s cn52xxp1;
228 struct cvmx_pcieep_cfg001_s cn56xx;
229 struct cvmx_pcieep_cfg001_s cn56xxp1;
230};
231
232union cvmx_pcieep_cfg002 {
233 uint32_t u32;
234 struct cvmx_pcieep_cfg002_s {
235 uint32_t bcc:8;
236 uint32_t sc:8;
237 uint32_t pi:8;
238 uint32_t rid:8;
239 } s;
240 struct cvmx_pcieep_cfg002_s cn52xx;
241 struct cvmx_pcieep_cfg002_s cn52xxp1;
242 struct cvmx_pcieep_cfg002_s cn56xx;
243 struct cvmx_pcieep_cfg002_s cn56xxp1;
244};
245
246union cvmx_pcieep_cfg003 {
247 uint32_t u32;
248 struct cvmx_pcieep_cfg003_s {
249 uint32_t bist:8;
250 uint32_t mfd:1;
251 uint32_t chf:7;
252 uint32_t lt:8;
253 uint32_t cls:8;
254 } s;
255 struct cvmx_pcieep_cfg003_s cn52xx;
256 struct cvmx_pcieep_cfg003_s cn52xxp1;
257 struct cvmx_pcieep_cfg003_s cn56xx;
258 struct cvmx_pcieep_cfg003_s cn56xxp1;
259};
260
261union cvmx_pcieep_cfg004 {
262 uint32_t u32;
263 struct cvmx_pcieep_cfg004_s {
264 uint32_t lbab:18;
265 uint32_t reserved_4_13:10;
266 uint32_t pf:1;
267 uint32_t typ:2;
268 uint32_t mspc:1;
269 } s;
270 struct cvmx_pcieep_cfg004_s cn52xx;
271 struct cvmx_pcieep_cfg004_s cn52xxp1;
272 struct cvmx_pcieep_cfg004_s cn56xx;
273 struct cvmx_pcieep_cfg004_s cn56xxp1;
274};
275
276union cvmx_pcieep_cfg004_mask {
277 uint32_t u32;
278 struct cvmx_pcieep_cfg004_mask_s {
279 uint32_t lmask:31;
280 uint32_t enb:1;
281 } s;
282 struct cvmx_pcieep_cfg004_mask_s cn52xx;
283 struct cvmx_pcieep_cfg004_mask_s cn52xxp1;
284 struct cvmx_pcieep_cfg004_mask_s cn56xx;
285 struct cvmx_pcieep_cfg004_mask_s cn56xxp1;
286};
287
288union cvmx_pcieep_cfg005 {
289 uint32_t u32;
290 struct cvmx_pcieep_cfg005_s {
291 uint32_t ubab:32;
292 } s;
293 struct cvmx_pcieep_cfg005_s cn52xx;
294 struct cvmx_pcieep_cfg005_s cn52xxp1;
295 struct cvmx_pcieep_cfg005_s cn56xx;
296 struct cvmx_pcieep_cfg005_s cn56xxp1;
297};
298
299union cvmx_pcieep_cfg005_mask {
300 uint32_t u32;
301 struct cvmx_pcieep_cfg005_mask_s {
302 uint32_t umask:32;
303 } s;
304 struct cvmx_pcieep_cfg005_mask_s cn52xx;
305 struct cvmx_pcieep_cfg005_mask_s cn52xxp1;
306 struct cvmx_pcieep_cfg005_mask_s cn56xx;
307 struct cvmx_pcieep_cfg005_mask_s cn56xxp1;
308};
309
310union cvmx_pcieep_cfg006 {
311 uint32_t u32;
312 struct cvmx_pcieep_cfg006_s {
313 uint32_t lbab:6;
314 uint32_t reserved_4_25:22;
315 uint32_t pf:1;
316 uint32_t typ:2;
317 uint32_t mspc:1;
318 } s;
319 struct cvmx_pcieep_cfg006_s cn52xx;
320 struct cvmx_pcieep_cfg006_s cn52xxp1;
321 struct cvmx_pcieep_cfg006_s cn56xx;
322 struct cvmx_pcieep_cfg006_s cn56xxp1;
323};
324
325union cvmx_pcieep_cfg006_mask {
326 uint32_t u32;
327 struct cvmx_pcieep_cfg006_mask_s {
328 uint32_t lmask:31;
329 uint32_t enb:1;
330 } s;
331 struct cvmx_pcieep_cfg006_mask_s cn52xx;
332 struct cvmx_pcieep_cfg006_mask_s cn52xxp1;
333 struct cvmx_pcieep_cfg006_mask_s cn56xx;
334 struct cvmx_pcieep_cfg006_mask_s cn56xxp1;
335};
336
337union cvmx_pcieep_cfg007 {
338 uint32_t u32;
339 struct cvmx_pcieep_cfg007_s {
340 uint32_t ubab:32;
341 } s;
342 struct cvmx_pcieep_cfg007_s cn52xx;
343 struct cvmx_pcieep_cfg007_s cn52xxp1;
344 struct cvmx_pcieep_cfg007_s cn56xx;
345 struct cvmx_pcieep_cfg007_s cn56xxp1;
346};
347
348union cvmx_pcieep_cfg007_mask {
349 uint32_t u32;
350 struct cvmx_pcieep_cfg007_mask_s {
351 uint32_t umask:32;
352 } s;
353 struct cvmx_pcieep_cfg007_mask_s cn52xx;
354 struct cvmx_pcieep_cfg007_mask_s cn52xxp1;
355 struct cvmx_pcieep_cfg007_mask_s cn56xx;
356 struct cvmx_pcieep_cfg007_mask_s cn56xxp1;
357};
358
359union cvmx_pcieep_cfg008 {
360 uint32_t u32;
361 struct cvmx_pcieep_cfg008_s {
362 uint32_t reserved_4_31:28;
363 uint32_t pf:1;
364 uint32_t typ:2;
365 uint32_t mspc:1;
366 } s;
367 struct cvmx_pcieep_cfg008_s cn52xx;
368 struct cvmx_pcieep_cfg008_s cn52xxp1;
369 struct cvmx_pcieep_cfg008_s cn56xx;
370 struct cvmx_pcieep_cfg008_s cn56xxp1;
371};
372
373union cvmx_pcieep_cfg008_mask {
374 uint32_t u32;
375 struct cvmx_pcieep_cfg008_mask_s {
376 uint32_t lmask:31;
377 uint32_t enb:1;
378 } s;
379 struct cvmx_pcieep_cfg008_mask_s cn52xx;
380 struct cvmx_pcieep_cfg008_mask_s cn52xxp1;
381 struct cvmx_pcieep_cfg008_mask_s cn56xx;
382 struct cvmx_pcieep_cfg008_mask_s cn56xxp1;
383};
384
385union cvmx_pcieep_cfg009 {
386 uint32_t u32;
387 struct cvmx_pcieep_cfg009_s {
388 uint32_t ubab:25;
389 uint32_t reserved_0_6:7;
390 } s;
391 struct cvmx_pcieep_cfg009_s cn52xx;
392 struct cvmx_pcieep_cfg009_s cn52xxp1;
393 struct cvmx_pcieep_cfg009_s cn56xx;
394 struct cvmx_pcieep_cfg009_s cn56xxp1;
395};
396
397union cvmx_pcieep_cfg009_mask {
398 uint32_t u32;
399 struct cvmx_pcieep_cfg009_mask_s {
400 uint32_t umask:32;
401 } s;
402 struct cvmx_pcieep_cfg009_mask_s cn52xx;
403 struct cvmx_pcieep_cfg009_mask_s cn52xxp1;
404 struct cvmx_pcieep_cfg009_mask_s cn56xx;
405 struct cvmx_pcieep_cfg009_mask_s cn56xxp1;
406};
407
408union cvmx_pcieep_cfg010 {
409 uint32_t u32;
410 struct cvmx_pcieep_cfg010_s {
411 uint32_t cisp:32;
412 } s;
413 struct cvmx_pcieep_cfg010_s cn52xx;
414 struct cvmx_pcieep_cfg010_s cn52xxp1;
415 struct cvmx_pcieep_cfg010_s cn56xx;
416 struct cvmx_pcieep_cfg010_s cn56xxp1;
417};
418
419union cvmx_pcieep_cfg011 {
420 uint32_t u32;
421 struct cvmx_pcieep_cfg011_s {
422 uint32_t ssid:16;
423 uint32_t ssvid:16;
424 } s;
425 struct cvmx_pcieep_cfg011_s cn52xx;
426 struct cvmx_pcieep_cfg011_s cn52xxp1;
427 struct cvmx_pcieep_cfg011_s cn56xx;
428 struct cvmx_pcieep_cfg011_s cn56xxp1;
429};
430
431union cvmx_pcieep_cfg012 {
432 uint32_t u32;
433 struct cvmx_pcieep_cfg012_s {
434 uint32_t eraddr:16;
435 uint32_t reserved_1_15:15;
436 uint32_t er_en:1;
437 } s;
438 struct cvmx_pcieep_cfg012_s cn52xx;
439 struct cvmx_pcieep_cfg012_s cn52xxp1;
440 struct cvmx_pcieep_cfg012_s cn56xx;
441 struct cvmx_pcieep_cfg012_s cn56xxp1;
442};
443
444union cvmx_pcieep_cfg012_mask {
445 uint32_t u32;
446 struct cvmx_pcieep_cfg012_mask_s {
447 uint32_t mask:31;
448 uint32_t enb:1;
449 } s;
450 struct cvmx_pcieep_cfg012_mask_s cn52xx;
451 struct cvmx_pcieep_cfg012_mask_s cn52xxp1;
452 struct cvmx_pcieep_cfg012_mask_s cn56xx;
453 struct cvmx_pcieep_cfg012_mask_s cn56xxp1;
454};
455
456union cvmx_pcieep_cfg013 {
457 uint32_t u32;
458 struct cvmx_pcieep_cfg013_s {
459 uint32_t reserved_8_31:24;
460 uint32_t cp:8;
461 } s;
462 struct cvmx_pcieep_cfg013_s cn52xx;
463 struct cvmx_pcieep_cfg013_s cn52xxp1;
464 struct cvmx_pcieep_cfg013_s cn56xx;
465 struct cvmx_pcieep_cfg013_s cn56xxp1;
466};
467
468union cvmx_pcieep_cfg015 {
469 uint32_t u32;
470 struct cvmx_pcieep_cfg015_s {
471 uint32_t ml:8;
472 uint32_t mg:8;
473 uint32_t inta:8;
474 uint32_t il:8;
475 } s;
476 struct cvmx_pcieep_cfg015_s cn52xx;
477 struct cvmx_pcieep_cfg015_s cn52xxp1;
478 struct cvmx_pcieep_cfg015_s cn56xx;
479 struct cvmx_pcieep_cfg015_s cn56xxp1;
480};
481
482union cvmx_pcieep_cfg016 {
483 uint32_t u32;
484 struct cvmx_pcieep_cfg016_s {
485 uint32_t pmes:5;
486 uint32_t d2s:1;
487 uint32_t d1s:1;
488 uint32_t auxc:3;
489 uint32_t dsi:1;
490 uint32_t reserved_20_20:1;
491 uint32_t pme_clock:1;
492 uint32_t pmsv:3;
493 uint32_t ncp:8;
494 uint32_t pmcid:8;
495 } s;
496 struct cvmx_pcieep_cfg016_s cn52xx;
497 struct cvmx_pcieep_cfg016_s cn52xxp1;
498 struct cvmx_pcieep_cfg016_s cn56xx;
499 struct cvmx_pcieep_cfg016_s cn56xxp1;
500};
501
502union cvmx_pcieep_cfg017 {
503 uint32_t u32;
504 struct cvmx_pcieep_cfg017_s {
505 uint32_t pmdia:8;
506 uint32_t bpccee:1;
507 uint32_t bd3h:1;
508 uint32_t reserved_16_21:6;
509 uint32_t pmess:1;
510 uint32_t pmedsia:2;
511 uint32_t pmds:4;
512 uint32_t pmeens:1;
513 uint32_t reserved_4_7:4;
514 uint32_t nsr:1;
515 uint32_t reserved_2_2:1;
516 uint32_t ps:2;
517 } s;
518 struct cvmx_pcieep_cfg017_s cn52xx;
519 struct cvmx_pcieep_cfg017_s cn52xxp1;
520 struct cvmx_pcieep_cfg017_s cn56xx;
521 struct cvmx_pcieep_cfg017_s cn56xxp1;
522};
523
524union cvmx_pcieep_cfg020 {
525 uint32_t u32;
526 struct cvmx_pcieep_cfg020_s {
527 uint32_t reserved_24_31:8;
528 uint32_t m64:1;
529 uint32_t mme:3;
530 uint32_t mmc:3;
531 uint32_t msien:1;
532 uint32_t ncp:8;
533 uint32_t msicid:8;
534 } s;
535 struct cvmx_pcieep_cfg020_s cn52xx;
536 struct cvmx_pcieep_cfg020_s cn52xxp1;
537 struct cvmx_pcieep_cfg020_s cn56xx;
538 struct cvmx_pcieep_cfg020_s cn56xxp1;
539};
540
541union cvmx_pcieep_cfg021 {
542 uint32_t u32;
543 struct cvmx_pcieep_cfg021_s {
544 uint32_t lmsi:30;
545 uint32_t reserved_0_1:2;
546 } s;
547 struct cvmx_pcieep_cfg021_s cn52xx;
548 struct cvmx_pcieep_cfg021_s cn52xxp1;
549 struct cvmx_pcieep_cfg021_s cn56xx;
550 struct cvmx_pcieep_cfg021_s cn56xxp1;
551};
552
553union cvmx_pcieep_cfg022 {
554 uint32_t u32;
555 struct cvmx_pcieep_cfg022_s {
556 uint32_t umsi:32;
557 } s;
558 struct cvmx_pcieep_cfg022_s cn52xx;
559 struct cvmx_pcieep_cfg022_s cn52xxp1;
560 struct cvmx_pcieep_cfg022_s cn56xx;
561 struct cvmx_pcieep_cfg022_s cn56xxp1;
562};
563
564union cvmx_pcieep_cfg023 {
565 uint32_t u32;
566 struct cvmx_pcieep_cfg023_s {
567 uint32_t reserved_16_31:16;
568 uint32_t msimd:16;
569 } s;
570 struct cvmx_pcieep_cfg023_s cn52xx;
571 struct cvmx_pcieep_cfg023_s cn52xxp1;
572 struct cvmx_pcieep_cfg023_s cn56xx;
573 struct cvmx_pcieep_cfg023_s cn56xxp1;
574};
575
576union cvmx_pcieep_cfg028 {
577 uint32_t u32;
578 struct cvmx_pcieep_cfg028_s {
579 uint32_t reserved_30_31:2;
580 uint32_t imn:5;
581 uint32_t si:1;
582 uint32_t dpt:4;
583 uint32_t pciecv:4;
584 uint32_t ncp:8;
585 uint32_t pcieid:8;
586 } s;
587 struct cvmx_pcieep_cfg028_s cn52xx;
588 struct cvmx_pcieep_cfg028_s cn52xxp1;
589 struct cvmx_pcieep_cfg028_s cn56xx;
590 struct cvmx_pcieep_cfg028_s cn56xxp1;
591};
592
593union cvmx_pcieep_cfg029 {
594 uint32_t u32;
595 struct cvmx_pcieep_cfg029_s {
596 uint32_t reserved_28_31:4;
597 uint32_t cspls:2;
598 uint32_t csplv:8;
599 uint32_t reserved_16_17:2;
600 uint32_t rber:1;
601 uint32_t reserved_12_14:3;
602 uint32_t el1al:3;
603 uint32_t el0al:3;
604 uint32_t etfs:1;
605 uint32_t pfs:2;
606 uint32_t mpss:3;
607 } s;
608 struct cvmx_pcieep_cfg029_s cn52xx;
609 struct cvmx_pcieep_cfg029_s cn52xxp1;
610 struct cvmx_pcieep_cfg029_s cn56xx;
611 struct cvmx_pcieep_cfg029_s cn56xxp1;
612};
613
614union cvmx_pcieep_cfg030 {
615 uint32_t u32;
616 struct cvmx_pcieep_cfg030_s {
617 uint32_t reserved_22_31:10;
618 uint32_t tp:1;
619 uint32_t ap_d:1;
620 uint32_t ur_d:1;
621 uint32_t fe_d:1;
622 uint32_t nfe_d:1;
623 uint32_t ce_d:1;
624 uint32_t reserved_15_15:1;
625 uint32_t mrrs:3;
626 uint32_t ns_en:1;
627 uint32_t ap_en:1;
628 uint32_t pf_en:1;
629 uint32_t etf_en:1;
630 uint32_t mps:3;
631 uint32_t ro_en:1;
632 uint32_t ur_en:1;
633 uint32_t fe_en:1;
634 uint32_t nfe_en:1;
635 uint32_t ce_en:1;
636 } s;
637 struct cvmx_pcieep_cfg030_s cn52xx;
638 struct cvmx_pcieep_cfg030_s cn52xxp1;
639 struct cvmx_pcieep_cfg030_s cn56xx;
640 struct cvmx_pcieep_cfg030_s cn56xxp1;
641};
642
643union cvmx_pcieep_cfg031 {
644 uint32_t u32;
645 struct cvmx_pcieep_cfg031_s {
646 uint32_t pnum:8;
647 uint32_t reserved_22_23:2;
648 uint32_t lbnc:1;
649 uint32_t dllarc:1;
650 uint32_t sderc:1;
651 uint32_t cpm:1;
652 uint32_t l1el:3;
653 uint32_t l0el:3;
654 uint32_t aslpms:2;
655 uint32_t mlw:6;
656 uint32_t mls:4;
657 } s;
658 struct cvmx_pcieep_cfg031_s cn52xx;
659 struct cvmx_pcieep_cfg031_s cn52xxp1;
660 struct cvmx_pcieep_cfg031_s cn56xx;
661 struct cvmx_pcieep_cfg031_s cn56xxp1;
662};
663
664union cvmx_pcieep_cfg032 {
665 uint32_t u32;
666 struct cvmx_pcieep_cfg032_s {
667 uint32_t reserved_30_31:2;
668 uint32_t dlla:1;
669 uint32_t scc:1;
670 uint32_t lt:1;
671 uint32_t reserved_26_26:1;
672 uint32_t nlw:6;
673 uint32_t ls:4;
674 uint32_t reserved_10_15:6;
675 uint32_t hawd:1;
676 uint32_t ecpm:1;
677 uint32_t es:1;
678 uint32_t ccc:1;
679 uint32_t rl:1;
680 uint32_t ld:1;
681 uint32_t rcb:1;
682 uint32_t reserved_2_2:1;
683 uint32_t aslpc:2;
684 } s;
685 struct cvmx_pcieep_cfg032_s cn52xx;
686 struct cvmx_pcieep_cfg032_s cn52xxp1;
687 struct cvmx_pcieep_cfg032_s cn56xx;
688 struct cvmx_pcieep_cfg032_s cn56xxp1;
689};
690
691union cvmx_pcieep_cfg033 {
692 uint32_t u32;
693 struct cvmx_pcieep_cfg033_s {
694 uint32_t ps_num:13;
695 uint32_t nccs:1;
696 uint32_t emip:1;
697 uint32_t sp_ls:2;
698 uint32_t sp_lv:8;
699 uint32_t hp_c:1;
700 uint32_t hp_s:1;
701 uint32_t pip:1;
702 uint32_t aip:1;
703 uint32_t mrlsp:1;
704 uint32_t pcp:1;
705 uint32_t abp:1;
706 } s;
707 struct cvmx_pcieep_cfg033_s cn52xx;
708 struct cvmx_pcieep_cfg033_s cn52xxp1;
709 struct cvmx_pcieep_cfg033_s cn56xx;
710 struct cvmx_pcieep_cfg033_s cn56xxp1;
711};
712
713union cvmx_pcieep_cfg034 {
714 uint32_t u32;
715 struct cvmx_pcieep_cfg034_s {
716 uint32_t reserved_25_31:7;
717 uint32_t dlls_c:1;
718 uint32_t emis:1;
719 uint32_t pds:1;
720 uint32_t mrlss:1;
721 uint32_t ccint_d:1;
722 uint32_t pd_c:1;
723 uint32_t mrls_c:1;
724 uint32_t pf_d:1;
725 uint32_t abp_d:1;
726 uint32_t reserved_13_15:3;
727 uint32_t dlls_en:1;
728 uint32_t emic:1;
729 uint32_t pcc:1;
730 uint32_t pic:2;
731 uint32_t aic:2;
732 uint32_t hpint_en:1;
733 uint32_t ccint_en:1;
734 uint32_t pd_en:1;
735 uint32_t mrls_en:1;
736 uint32_t pf_en:1;
737 uint32_t abp_en:1;
738 } s;
739 struct cvmx_pcieep_cfg034_s cn52xx;
740 struct cvmx_pcieep_cfg034_s cn52xxp1;
741 struct cvmx_pcieep_cfg034_s cn56xx;
742 struct cvmx_pcieep_cfg034_s cn56xxp1;
743};
744
745union cvmx_pcieep_cfg037 {
746 uint32_t u32;
747 struct cvmx_pcieep_cfg037_s {
748 uint32_t reserved_5_31:27;
749 uint32_t ctds:1;
750 uint32_t ctrs:4;
751 } s;
752 struct cvmx_pcieep_cfg037_s cn52xx;
753 struct cvmx_pcieep_cfg037_s cn52xxp1;
754 struct cvmx_pcieep_cfg037_s cn56xx;
755 struct cvmx_pcieep_cfg037_s cn56xxp1;
756};
757
758union cvmx_pcieep_cfg038 {
759 uint32_t u32;
760 struct cvmx_pcieep_cfg038_s {
761 uint32_t reserved_5_31:27;
762 uint32_t ctd:1;
763 uint32_t ctv:4;
764 } s;
765 struct cvmx_pcieep_cfg038_s cn52xx;
766 struct cvmx_pcieep_cfg038_s cn52xxp1;
767 struct cvmx_pcieep_cfg038_s cn56xx;
768 struct cvmx_pcieep_cfg038_s cn56xxp1;
769};
770
771union cvmx_pcieep_cfg039 {
772 uint32_t u32;
773 struct cvmx_pcieep_cfg039_s {
774 uint32_t reserved_0_31:32;
775 } s;
776 struct cvmx_pcieep_cfg039_s cn52xx;
777 struct cvmx_pcieep_cfg039_s cn52xxp1;
778 struct cvmx_pcieep_cfg039_s cn56xx;
779 struct cvmx_pcieep_cfg039_s cn56xxp1;
780};
781
782union cvmx_pcieep_cfg040 {
783 uint32_t u32;
784 struct cvmx_pcieep_cfg040_s {
785 uint32_t reserved_0_31:32;
786 } s;
787 struct cvmx_pcieep_cfg040_s cn52xx;
788 struct cvmx_pcieep_cfg040_s cn52xxp1;
789 struct cvmx_pcieep_cfg040_s cn56xx;
790 struct cvmx_pcieep_cfg040_s cn56xxp1;
791};
792
793union cvmx_pcieep_cfg041 {
794 uint32_t u32;
795 struct cvmx_pcieep_cfg041_s {
796 uint32_t reserved_0_31:32;
797 } s;
798 struct cvmx_pcieep_cfg041_s cn52xx;
799 struct cvmx_pcieep_cfg041_s cn52xxp1;
800 struct cvmx_pcieep_cfg041_s cn56xx;
801 struct cvmx_pcieep_cfg041_s cn56xxp1;
802};
803
804union cvmx_pcieep_cfg042 {
805 uint32_t u32;
806 struct cvmx_pcieep_cfg042_s {
807 uint32_t reserved_0_31:32;
808 } s;
809 struct cvmx_pcieep_cfg042_s cn52xx;
810 struct cvmx_pcieep_cfg042_s cn52xxp1;
811 struct cvmx_pcieep_cfg042_s cn56xx;
812 struct cvmx_pcieep_cfg042_s cn56xxp1;
813};
814
815union cvmx_pcieep_cfg064 {
816 uint32_t u32;
817 struct cvmx_pcieep_cfg064_s {
818 uint32_t nco:12;
819 uint32_t cv:4;
820 uint32_t pcieec:16;
821 } s;
822 struct cvmx_pcieep_cfg064_s cn52xx;
823 struct cvmx_pcieep_cfg064_s cn52xxp1;
824 struct cvmx_pcieep_cfg064_s cn56xx;
825 struct cvmx_pcieep_cfg064_s cn56xxp1;
826};
827
828union cvmx_pcieep_cfg065 {
829 uint32_t u32;
830 struct cvmx_pcieep_cfg065_s {
831 uint32_t reserved_21_31:11;
832 uint32_t ures:1;
833 uint32_t ecrces:1;
834 uint32_t mtlps:1;
835 uint32_t ros:1;
836 uint32_t ucs:1;
837 uint32_t cas:1;
838 uint32_t cts:1;
839 uint32_t fcpes:1;
840 uint32_t ptlps:1;
841 uint32_t reserved_6_11:6;
842 uint32_t sdes:1;
843 uint32_t dlpes:1;
844 uint32_t reserved_0_3:4;
845 } s;
846 struct cvmx_pcieep_cfg065_s cn52xx;
847 struct cvmx_pcieep_cfg065_s cn52xxp1;
848 struct cvmx_pcieep_cfg065_s cn56xx;
849 struct cvmx_pcieep_cfg065_s cn56xxp1;
850};
851
852union cvmx_pcieep_cfg066 {
853 uint32_t u32;
854 struct cvmx_pcieep_cfg066_s {
855 uint32_t reserved_21_31:11;
856 uint32_t urem:1;
857 uint32_t ecrcem:1;
858 uint32_t mtlpm:1;
859 uint32_t rom:1;
860 uint32_t ucm:1;
861 uint32_t cam:1;
862 uint32_t ctm:1;
863 uint32_t fcpem:1;
864 uint32_t ptlpm:1;
865 uint32_t reserved_6_11:6;
866 uint32_t sdem:1;
867 uint32_t dlpem:1;
868 uint32_t reserved_0_3:4;
869 } s;
870 struct cvmx_pcieep_cfg066_s cn52xx;
871 struct cvmx_pcieep_cfg066_s cn52xxp1;
872 struct cvmx_pcieep_cfg066_s cn56xx;
873 struct cvmx_pcieep_cfg066_s cn56xxp1;
874};
875
876union cvmx_pcieep_cfg067 {
877 uint32_t u32;
878 struct cvmx_pcieep_cfg067_s {
879 uint32_t reserved_21_31:11;
880 uint32_t ures:1;
881 uint32_t ecrces:1;
882 uint32_t mtlps:1;
883 uint32_t ros:1;
884 uint32_t ucs:1;
885 uint32_t cas:1;
886 uint32_t cts:1;
887 uint32_t fcpes:1;
888 uint32_t ptlps:1;
889 uint32_t reserved_6_11:6;
890 uint32_t sdes:1;
891 uint32_t dlpes:1;
892 uint32_t reserved_0_3:4;
893 } s;
894 struct cvmx_pcieep_cfg067_s cn52xx;
895 struct cvmx_pcieep_cfg067_s cn52xxp1;
896 struct cvmx_pcieep_cfg067_s cn56xx;
897 struct cvmx_pcieep_cfg067_s cn56xxp1;
898};
899
900union cvmx_pcieep_cfg068 {
901 uint32_t u32;
902 struct cvmx_pcieep_cfg068_s {
903 uint32_t reserved_14_31:18;
904 uint32_t anfes:1;
905 uint32_t rtts:1;
906 uint32_t reserved_9_11:3;
907 uint32_t rnrs:1;
908 uint32_t bdllps:1;
909 uint32_t btlps:1;
910 uint32_t reserved_1_5:5;
911 uint32_t res:1;
912 } s;
913 struct cvmx_pcieep_cfg068_s cn52xx;
914 struct cvmx_pcieep_cfg068_s cn52xxp1;
915 struct cvmx_pcieep_cfg068_s cn56xx;
916 struct cvmx_pcieep_cfg068_s cn56xxp1;
917};
918
919union cvmx_pcieep_cfg069 {
920 uint32_t u32;
921 struct cvmx_pcieep_cfg069_s {
922 uint32_t reserved_14_31:18;
923 uint32_t anfem:1;
924 uint32_t rttm:1;
925 uint32_t reserved_9_11:3;
926 uint32_t rnrm:1;
927 uint32_t bdllpm:1;
928 uint32_t btlpm:1;
929 uint32_t reserved_1_5:5;
930 uint32_t rem:1;
931 } s;
932 struct cvmx_pcieep_cfg069_s cn52xx;
933 struct cvmx_pcieep_cfg069_s cn52xxp1;
934 struct cvmx_pcieep_cfg069_s cn56xx;
935 struct cvmx_pcieep_cfg069_s cn56xxp1;
936};
937
938union cvmx_pcieep_cfg070 {
939 uint32_t u32;
940 struct cvmx_pcieep_cfg070_s {
941 uint32_t reserved_9_31:23;
942 uint32_t ce:1;
943 uint32_t cc:1;
944 uint32_t ge:1;
945 uint32_t gc:1;
946 uint32_t fep:5;
947 } s;
948 struct cvmx_pcieep_cfg070_s cn52xx;
949 struct cvmx_pcieep_cfg070_s cn52xxp1;
950 struct cvmx_pcieep_cfg070_s cn56xx;
951 struct cvmx_pcieep_cfg070_s cn56xxp1;
952};
953
954union cvmx_pcieep_cfg071 {
955 uint32_t u32;
956 struct cvmx_pcieep_cfg071_s {
957 uint32_t dword1:32;
958 } s;
959 struct cvmx_pcieep_cfg071_s cn52xx;
960 struct cvmx_pcieep_cfg071_s cn52xxp1;
961 struct cvmx_pcieep_cfg071_s cn56xx;
962 struct cvmx_pcieep_cfg071_s cn56xxp1;
963};
964
965union cvmx_pcieep_cfg072 {
966 uint32_t u32;
967 struct cvmx_pcieep_cfg072_s {
968 uint32_t dword2:32;
969 } s;
970 struct cvmx_pcieep_cfg072_s cn52xx;
971 struct cvmx_pcieep_cfg072_s cn52xxp1;
972 struct cvmx_pcieep_cfg072_s cn56xx;
973 struct cvmx_pcieep_cfg072_s cn56xxp1;
974};
975
976union cvmx_pcieep_cfg073 {
977 uint32_t u32;
978 struct cvmx_pcieep_cfg073_s {
979 uint32_t dword3:32;
980 } s;
981 struct cvmx_pcieep_cfg073_s cn52xx;
982 struct cvmx_pcieep_cfg073_s cn52xxp1;
983 struct cvmx_pcieep_cfg073_s cn56xx;
984 struct cvmx_pcieep_cfg073_s cn56xxp1;
985};
986
987union cvmx_pcieep_cfg074 {
988 uint32_t u32;
989 struct cvmx_pcieep_cfg074_s {
990 uint32_t dword4:32;
991 } s;
992 struct cvmx_pcieep_cfg074_s cn52xx;
993 struct cvmx_pcieep_cfg074_s cn52xxp1;
994 struct cvmx_pcieep_cfg074_s cn56xx;
995 struct cvmx_pcieep_cfg074_s cn56xxp1;
996};
997
998union cvmx_pcieep_cfg448 {
999 uint32_t u32;
1000 struct cvmx_pcieep_cfg448_s {
1001 uint32_t rtl:16;
1002 uint32_t rtltl:16;
1003 } s;
1004 struct cvmx_pcieep_cfg448_s cn52xx;
1005 struct cvmx_pcieep_cfg448_s cn52xxp1;
1006 struct cvmx_pcieep_cfg448_s cn56xx;
1007 struct cvmx_pcieep_cfg448_s cn56xxp1;
1008};
1009
1010union cvmx_pcieep_cfg449 {
1011 uint32_t u32;
1012 struct cvmx_pcieep_cfg449_s {
1013 uint32_t omr:32;
1014 } s;
1015 struct cvmx_pcieep_cfg449_s cn52xx;
1016 struct cvmx_pcieep_cfg449_s cn52xxp1;
1017 struct cvmx_pcieep_cfg449_s cn56xx;
1018 struct cvmx_pcieep_cfg449_s cn56xxp1;
1019};
1020
1021union cvmx_pcieep_cfg450 {
1022 uint32_t u32;
1023 struct cvmx_pcieep_cfg450_s {
1024 uint32_t lpec:8;
1025 uint32_t reserved_22_23:2;
1026 uint32_t link_state:6;
1027 uint32_t force_link:1;
1028 uint32_t reserved_8_14:7;
1029 uint32_t link_num:8;
1030 } s;
1031 struct cvmx_pcieep_cfg450_s cn52xx;
1032 struct cvmx_pcieep_cfg450_s cn52xxp1;
1033 struct cvmx_pcieep_cfg450_s cn56xx;
1034 struct cvmx_pcieep_cfg450_s cn56xxp1;
1035};
1036
1037union cvmx_pcieep_cfg451 {
1038 uint32_t u32;
1039 struct cvmx_pcieep_cfg451_s {
1040 uint32_t reserved_30_31:2;
1041 uint32_t l1el:3;
1042 uint32_t l0el:3;
1043 uint32_t n_fts_cc:8;
1044 uint32_t n_fts:8;
1045 uint32_t ack_freq:8;
1046 } s;
1047 struct cvmx_pcieep_cfg451_s cn52xx;
1048 struct cvmx_pcieep_cfg451_s cn52xxp1;
1049 struct cvmx_pcieep_cfg451_s cn56xx;
1050 struct cvmx_pcieep_cfg451_s cn56xxp1;
1051};
1052
1053union cvmx_pcieep_cfg452 {
1054 uint32_t u32;
1055 struct cvmx_pcieep_cfg452_s {
1056 uint32_t reserved_26_31:6;
1057 uint32_t eccrc:1;
1058 uint32_t reserved_22_24:3;
1059 uint32_t lme:6;
1060 uint32_t reserved_8_15:8;
1061 uint32_t flm:1;
1062 uint32_t reserved_6_6:1;
1063 uint32_t dllle:1;
1064 uint32_t reserved_4_4:1;
1065 uint32_t ra:1;
1066 uint32_t le:1;
1067 uint32_t sd:1;
1068 uint32_t omr:1;
1069 } s;
1070 struct cvmx_pcieep_cfg452_s cn52xx;
1071 struct cvmx_pcieep_cfg452_s cn52xxp1;
1072 struct cvmx_pcieep_cfg452_s cn56xx;
1073 struct cvmx_pcieep_cfg452_s cn56xxp1;
1074};
1075
1076union cvmx_pcieep_cfg453 {
1077 uint32_t u32;
1078 struct cvmx_pcieep_cfg453_s {
1079 uint32_t dlld:1;
1080 uint32_t reserved_26_30:5;
1081 uint32_t ack_nak:1;
1082 uint32_t fcd:1;
1083 uint32_t ilst:24;
1084 } s;
1085 struct cvmx_pcieep_cfg453_s cn52xx;
1086 struct cvmx_pcieep_cfg453_s cn52xxp1;
1087 struct cvmx_pcieep_cfg453_s cn56xx;
1088 struct cvmx_pcieep_cfg453_s cn56xxp1;
1089};
1090
1091union cvmx_pcieep_cfg454 {
1092 uint32_t u32;
1093 struct cvmx_pcieep_cfg454_s {
1094 uint32_t reserved_29_31:3;
1095 uint32_t tmfcwt:5;
1096 uint32_t tmanlt:5;
1097 uint32_t tmrt:5;
1098 uint32_t reserved_11_13:3;
1099 uint32_t nskps:3;
1100 uint32_t reserved_4_7:4;
1101 uint32_t ntss:4;
1102 } s;
1103 struct cvmx_pcieep_cfg454_s cn52xx;
1104 struct cvmx_pcieep_cfg454_s cn52xxp1;
1105 struct cvmx_pcieep_cfg454_s cn56xx;
1106 struct cvmx_pcieep_cfg454_s cn56xxp1;
1107};
1108
1109union cvmx_pcieep_cfg455 {
1110 uint32_t u32;
1111 struct cvmx_pcieep_cfg455_s {
1112 uint32_t m_cfg0_filt:1;
1113 uint32_t m_io_filt:1;
1114 uint32_t msg_ctrl:1;
1115 uint32_t m_cpl_ecrc_filt:1;
1116 uint32_t m_ecrc_filt:1;
1117 uint32_t m_cpl_len_err:1;
1118 uint32_t m_cpl_attr_err:1;
1119 uint32_t m_cpl_tc_err:1;
1120 uint32_t m_cpl_fun_err:1;
1121 uint32_t m_cpl_rid_err:1;
1122 uint32_t m_cpl_tag_err:1;
1123 uint32_t m_lk_filt:1;
1124 uint32_t m_cfg1_filt:1;
1125 uint32_t m_bar_match:1;
1126 uint32_t m_pois_filt:1;
1127 uint32_t m_fun:1;
1128 uint32_t dfcwt:1;
1129 uint32_t reserved_11_14:4;
1130 uint32_t skpiv:11;
1131 } s;
1132 struct cvmx_pcieep_cfg455_s cn52xx;
1133 struct cvmx_pcieep_cfg455_s cn52xxp1;
1134 struct cvmx_pcieep_cfg455_s cn56xx;
1135 struct cvmx_pcieep_cfg455_s cn56xxp1;
1136};
1137
1138union cvmx_pcieep_cfg456 {
1139 uint32_t u32;
1140 struct cvmx_pcieep_cfg456_s {
1141 uint32_t reserved_2_31:30;
1142 uint32_t m_vend1_drp:1;
1143 uint32_t m_vend0_drp:1;
1144 } s;
1145 struct cvmx_pcieep_cfg456_s cn52xx;
1146 struct cvmx_pcieep_cfg456_s cn52xxp1;
1147 struct cvmx_pcieep_cfg456_s cn56xx;
1148 struct cvmx_pcieep_cfg456_s cn56xxp1;
1149};
1150
1151union cvmx_pcieep_cfg458 {
1152 uint32_t u32;
1153 struct cvmx_pcieep_cfg458_s {
1154 uint32_t dbg_info_l32:32;
1155 } s;
1156 struct cvmx_pcieep_cfg458_s cn52xx;
1157 struct cvmx_pcieep_cfg458_s cn52xxp1;
1158 struct cvmx_pcieep_cfg458_s cn56xx;
1159 struct cvmx_pcieep_cfg458_s cn56xxp1;
1160};
1161
1162union cvmx_pcieep_cfg459 {
1163 uint32_t u32;
1164 struct cvmx_pcieep_cfg459_s {
1165 uint32_t dbg_info_u32:32;
1166 } s;
1167 struct cvmx_pcieep_cfg459_s cn52xx;
1168 struct cvmx_pcieep_cfg459_s cn52xxp1;
1169 struct cvmx_pcieep_cfg459_s cn56xx;
1170 struct cvmx_pcieep_cfg459_s cn56xxp1;
1171};
1172
1173union cvmx_pcieep_cfg460 {
1174 uint32_t u32;
1175 struct cvmx_pcieep_cfg460_s {
1176 uint32_t reserved_20_31:12;
1177 uint32_t tphfcc:8;
1178 uint32_t tpdfcc:12;
1179 } s;
1180 struct cvmx_pcieep_cfg460_s cn52xx;
1181 struct cvmx_pcieep_cfg460_s cn52xxp1;
1182 struct cvmx_pcieep_cfg460_s cn56xx;
1183 struct cvmx_pcieep_cfg460_s cn56xxp1;
1184};
1185
1186union cvmx_pcieep_cfg461 {
1187 uint32_t u32;
1188 struct cvmx_pcieep_cfg461_s {
1189 uint32_t reserved_20_31:12;
1190 uint32_t tchfcc:8;
1191 uint32_t tcdfcc:12;
1192 } s;
1193 struct cvmx_pcieep_cfg461_s cn52xx;
1194 struct cvmx_pcieep_cfg461_s cn52xxp1;
1195 struct cvmx_pcieep_cfg461_s cn56xx;
1196 struct cvmx_pcieep_cfg461_s cn56xxp1;
1197};
1198
1199union cvmx_pcieep_cfg462 {
1200 uint32_t u32;
1201 struct cvmx_pcieep_cfg462_s {
1202 uint32_t reserved_20_31:12;
1203 uint32_t tchfcc:8;
1204 uint32_t tcdfcc:12;
1205 } s;
1206 struct cvmx_pcieep_cfg462_s cn52xx;
1207 struct cvmx_pcieep_cfg462_s cn52xxp1;
1208 struct cvmx_pcieep_cfg462_s cn56xx;
1209 struct cvmx_pcieep_cfg462_s cn56xxp1;
1210};
1211
1212union cvmx_pcieep_cfg463 {
1213 uint32_t u32;
1214 struct cvmx_pcieep_cfg463_s {
1215 uint32_t reserved_3_31:29;
1216 uint32_t rqne:1;
1217 uint32_t trbne:1;
1218 uint32_t rtlpfccnr:1;
1219 } s;
1220 struct cvmx_pcieep_cfg463_s cn52xx;
1221 struct cvmx_pcieep_cfg463_s cn52xxp1;
1222 struct cvmx_pcieep_cfg463_s cn56xx;
1223 struct cvmx_pcieep_cfg463_s cn56xxp1;
1224};
1225
1226union cvmx_pcieep_cfg464 {
1227 uint32_t u32;
1228 struct cvmx_pcieep_cfg464_s {
1229 uint32_t wrr_vc3:8;
1230 uint32_t wrr_vc2:8;
1231 uint32_t wrr_vc1:8;
1232 uint32_t wrr_vc0:8;
1233 } s;
1234 struct cvmx_pcieep_cfg464_s cn52xx;
1235 struct cvmx_pcieep_cfg464_s cn52xxp1;
1236 struct cvmx_pcieep_cfg464_s cn56xx;
1237 struct cvmx_pcieep_cfg464_s cn56xxp1;
1238};
1239
1240union cvmx_pcieep_cfg465 {
1241 uint32_t u32;
1242 struct cvmx_pcieep_cfg465_s {
1243 uint32_t wrr_vc7:8;
1244 uint32_t wrr_vc6:8;
1245 uint32_t wrr_vc5:8;
1246 uint32_t wrr_vc4:8;
1247 } s;
1248 struct cvmx_pcieep_cfg465_s cn52xx;
1249 struct cvmx_pcieep_cfg465_s cn52xxp1;
1250 struct cvmx_pcieep_cfg465_s cn56xx;
1251 struct cvmx_pcieep_cfg465_s cn56xxp1;
1252};
1253
1254union cvmx_pcieep_cfg466 {
1255 uint32_t u32;
1256 struct cvmx_pcieep_cfg466_s {
1257 uint32_t rx_queue_order:1;
1258 uint32_t type_ordering:1;
1259 uint32_t reserved_24_29:6;
1260 uint32_t queue_mode:3;
1261 uint32_t reserved_20_20:1;
1262 uint32_t header_credits:8;
1263 uint32_t data_credits:12;
1264 } s;
1265 struct cvmx_pcieep_cfg466_s cn52xx;
1266 struct cvmx_pcieep_cfg466_s cn52xxp1;
1267 struct cvmx_pcieep_cfg466_s cn56xx;
1268 struct cvmx_pcieep_cfg466_s cn56xxp1;
1269};
1270
1271union cvmx_pcieep_cfg467 {
1272 uint32_t u32;
1273 struct cvmx_pcieep_cfg467_s {
1274 uint32_t reserved_24_31:8;
1275 uint32_t queue_mode:3;
1276 uint32_t reserved_20_20:1;
1277 uint32_t header_credits:8;
1278 uint32_t data_credits:12;
1279 } s;
1280 struct cvmx_pcieep_cfg467_s cn52xx;
1281 struct cvmx_pcieep_cfg467_s cn52xxp1;
1282 struct cvmx_pcieep_cfg467_s cn56xx;
1283 struct cvmx_pcieep_cfg467_s cn56xxp1;
1284};
1285
1286union cvmx_pcieep_cfg468 {
1287 uint32_t u32;
1288 struct cvmx_pcieep_cfg468_s {
1289 uint32_t reserved_24_31:8;
1290 uint32_t queue_mode:3;
1291 uint32_t reserved_20_20:1;
1292 uint32_t header_credits:8;
1293 uint32_t data_credits:12;
1294 } s;
1295 struct cvmx_pcieep_cfg468_s cn52xx;
1296 struct cvmx_pcieep_cfg468_s cn52xxp1;
1297 struct cvmx_pcieep_cfg468_s cn56xx;
1298 struct cvmx_pcieep_cfg468_s cn56xxp1;
1299};
1300
1301union cvmx_pcieep_cfg490 {
1302 uint32_t u32;
1303 struct cvmx_pcieep_cfg490_s {
1304 uint32_t reserved_26_31:6;
1305 uint32_t header_depth:10;
1306 uint32_t reserved_14_15:2;
1307 uint32_t data_depth:14;
1308 } s;
1309 struct cvmx_pcieep_cfg490_s cn52xx;
1310 struct cvmx_pcieep_cfg490_s cn52xxp1;
1311 struct cvmx_pcieep_cfg490_s cn56xx;
1312 struct cvmx_pcieep_cfg490_s cn56xxp1;
1313};
1314
1315union cvmx_pcieep_cfg491 {
1316 uint32_t u32;
1317 struct cvmx_pcieep_cfg491_s {
1318 uint32_t reserved_26_31:6;
1319 uint32_t header_depth:10;
1320 uint32_t reserved_14_15:2;
1321 uint32_t data_depth:14;
1322 } s;
1323 struct cvmx_pcieep_cfg491_s cn52xx;
1324 struct cvmx_pcieep_cfg491_s cn52xxp1;
1325 struct cvmx_pcieep_cfg491_s cn56xx;
1326 struct cvmx_pcieep_cfg491_s cn56xxp1;
1327};
1328
1329union cvmx_pcieep_cfg492 {
1330 uint32_t u32;
1331 struct cvmx_pcieep_cfg492_s {
1332 uint32_t reserved_26_31:6;
1333 uint32_t header_depth:10;
1334 uint32_t reserved_14_15:2;
1335 uint32_t data_depth:14;
1336 } s;
1337 struct cvmx_pcieep_cfg492_s cn52xx;
1338 struct cvmx_pcieep_cfg492_s cn52xxp1;
1339 struct cvmx_pcieep_cfg492_s cn56xx;
1340 struct cvmx_pcieep_cfg492_s cn56xxp1;
1341};
1342
1343union cvmx_pcieep_cfg516 {
1344 uint32_t u32;
1345 struct cvmx_pcieep_cfg516_s {
1346 uint32_t phy_stat:32;
1347 } s;
1348 struct cvmx_pcieep_cfg516_s cn52xx;
1349 struct cvmx_pcieep_cfg516_s cn52xxp1;
1350 struct cvmx_pcieep_cfg516_s cn56xx;
1351 struct cvmx_pcieep_cfg516_s cn56xxp1;
1352};
1353
1354union cvmx_pcieep_cfg517 {
1355 uint32_t u32;
1356 struct cvmx_pcieep_cfg517_s {
1357 uint32_t phy_ctrl:32;
1358 } s;
1359 struct cvmx_pcieep_cfg517_s cn52xx;
1360 struct cvmx_pcieep_cfg517_s cn52xxp1;
1361 struct cvmx_pcieep_cfg517_s cn56xx;
1362 struct cvmx_pcieep_cfg517_s cn56xxp1;
1363};
1364
1365#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-pciercx-defs.h b/arch/mips/include/asm/octeon/cvmx-pciercx-defs.h
new file mode 100644
index 000000000000..75574c918942
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-pciercx-defs.h
@@ -0,0 +1,1397 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_PCIERCX_DEFS_H__
29#define __CVMX_PCIERCX_DEFS_H__
30
31#define CVMX_PCIERCX_CFG000(offset) \
32 (0x0000000000000000ull + (((offset) & 1) * 0))
33#define CVMX_PCIERCX_CFG001(offset) \
34 (0x0000000000000004ull + (((offset) & 1) * 0))
35#define CVMX_PCIERCX_CFG002(offset) \
36 (0x0000000000000008ull + (((offset) & 1) * 0))
37#define CVMX_PCIERCX_CFG003(offset) \
38 (0x000000000000000Cull + (((offset) & 1) * 0))
39#define CVMX_PCIERCX_CFG004(offset) \
40 (0x0000000000000010ull + (((offset) & 1) * 0))
41#define CVMX_PCIERCX_CFG005(offset) \
42 (0x0000000000000014ull + (((offset) & 1) * 0))
43#define CVMX_PCIERCX_CFG006(offset) \
44 (0x0000000000000018ull + (((offset) & 1) * 0))
45#define CVMX_PCIERCX_CFG007(offset) \
46 (0x000000000000001Cull + (((offset) & 1) * 0))
47#define CVMX_PCIERCX_CFG008(offset) \
48 (0x0000000000000020ull + (((offset) & 1) * 0))
49#define CVMX_PCIERCX_CFG009(offset) \
50 (0x0000000000000024ull + (((offset) & 1) * 0))
51#define CVMX_PCIERCX_CFG010(offset) \
52 (0x0000000000000028ull + (((offset) & 1) * 0))
53#define CVMX_PCIERCX_CFG011(offset) \
54 (0x000000000000002Cull + (((offset) & 1) * 0))
55#define CVMX_PCIERCX_CFG012(offset) \
56 (0x0000000000000030ull + (((offset) & 1) * 0))
57#define CVMX_PCIERCX_CFG013(offset) \
58 (0x0000000000000034ull + (((offset) & 1) * 0))
59#define CVMX_PCIERCX_CFG014(offset) \
60 (0x0000000000000038ull + (((offset) & 1) * 0))
61#define CVMX_PCIERCX_CFG015(offset) \
62 (0x000000000000003Cull + (((offset) & 1) * 0))
63#define CVMX_PCIERCX_CFG016(offset) \
64 (0x0000000000000040ull + (((offset) & 1) * 0))
65#define CVMX_PCIERCX_CFG017(offset) \
66 (0x0000000000000044ull + (((offset) & 1) * 0))
67#define CVMX_PCIERCX_CFG020(offset) \
68 (0x0000000000000050ull + (((offset) & 1) * 0))
69#define CVMX_PCIERCX_CFG021(offset) \
70 (0x0000000000000054ull + (((offset) & 1) * 0))
71#define CVMX_PCIERCX_CFG022(offset) \
72 (0x0000000000000058ull + (((offset) & 1) * 0))
73#define CVMX_PCIERCX_CFG023(offset) \
74 (0x000000000000005Cull + (((offset) & 1) * 0))
75#define CVMX_PCIERCX_CFG028(offset) \
76 (0x0000000000000070ull + (((offset) & 1) * 0))
77#define CVMX_PCIERCX_CFG029(offset) \
78 (0x0000000000000074ull + (((offset) & 1) * 0))
79#define CVMX_PCIERCX_CFG030(offset) \
80 (0x0000000000000078ull + (((offset) & 1) * 0))
81#define CVMX_PCIERCX_CFG031(offset) \
82 (0x000000000000007Cull + (((offset) & 1) * 0))
83#define CVMX_PCIERCX_CFG032(offset) \
84 (0x0000000000000080ull + (((offset) & 1) * 0))
85#define CVMX_PCIERCX_CFG033(offset) \
86 (0x0000000000000084ull + (((offset) & 1) * 0))
87#define CVMX_PCIERCX_CFG034(offset) \
88 (0x0000000000000088ull + (((offset) & 1) * 0))
89#define CVMX_PCIERCX_CFG035(offset) \
90 (0x000000000000008Cull + (((offset) & 1) * 0))
91#define CVMX_PCIERCX_CFG036(offset) \
92 (0x0000000000000090ull + (((offset) & 1) * 0))
93#define CVMX_PCIERCX_CFG037(offset) \
94 (0x0000000000000094ull + (((offset) & 1) * 0))
95#define CVMX_PCIERCX_CFG038(offset) \
96 (0x0000000000000098ull + (((offset) & 1) * 0))
97#define CVMX_PCIERCX_CFG039(offset) \
98 (0x000000000000009Cull + (((offset) & 1) * 0))
99#define CVMX_PCIERCX_CFG040(offset) \
100 (0x00000000000000A0ull + (((offset) & 1) * 0))
101#define CVMX_PCIERCX_CFG041(offset) \
102 (0x00000000000000A4ull + (((offset) & 1) * 0))
103#define CVMX_PCIERCX_CFG042(offset) \
104 (0x00000000000000A8ull + (((offset) & 1) * 0))
105#define CVMX_PCIERCX_CFG064(offset) \
106 (0x0000000000000100ull + (((offset) & 1) * 0))
107#define CVMX_PCIERCX_CFG065(offset) \
108 (0x0000000000000104ull + (((offset) & 1) * 0))
109#define CVMX_PCIERCX_CFG066(offset) \
110 (0x0000000000000108ull + (((offset) & 1) * 0))
111#define CVMX_PCIERCX_CFG067(offset) \
112 (0x000000000000010Cull + (((offset) & 1) * 0))
113#define CVMX_PCIERCX_CFG068(offset) \
114 (0x0000000000000110ull + (((offset) & 1) * 0))
115#define CVMX_PCIERCX_CFG069(offset) \
116 (0x0000000000000114ull + (((offset) & 1) * 0))
117#define CVMX_PCIERCX_CFG070(offset) \
118 (0x0000000000000118ull + (((offset) & 1) * 0))
119#define CVMX_PCIERCX_CFG071(offset) \
120 (0x000000000000011Cull + (((offset) & 1) * 0))
121#define CVMX_PCIERCX_CFG072(offset) \
122 (0x0000000000000120ull + (((offset) & 1) * 0))
123#define CVMX_PCIERCX_CFG073(offset) \
124 (0x0000000000000124ull + (((offset) & 1) * 0))
125#define CVMX_PCIERCX_CFG074(offset) \
126 (0x0000000000000128ull + (((offset) & 1) * 0))
127#define CVMX_PCIERCX_CFG075(offset) \
128 (0x000000000000012Cull + (((offset) & 1) * 0))
129#define CVMX_PCIERCX_CFG076(offset) \
130 (0x0000000000000130ull + (((offset) & 1) * 0))
131#define CVMX_PCIERCX_CFG077(offset) \
132 (0x0000000000000134ull + (((offset) & 1) * 0))
133#define CVMX_PCIERCX_CFG448(offset) \
134 (0x0000000000000700ull + (((offset) & 1) * 0))
135#define CVMX_PCIERCX_CFG449(offset) \
136 (0x0000000000000704ull + (((offset) & 1) * 0))
137#define CVMX_PCIERCX_CFG450(offset) \
138 (0x0000000000000708ull + (((offset) & 1) * 0))
139#define CVMX_PCIERCX_CFG451(offset) \
140 (0x000000000000070Cull + (((offset) & 1) * 0))
141#define CVMX_PCIERCX_CFG452(offset) \
142 (0x0000000000000710ull + (((offset) & 1) * 0))
143#define CVMX_PCIERCX_CFG453(offset) \
144 (0x0000000000000714ull + (((offset) & 1) * 0))
145#define CVMX_PCIERCX_CFG454(offset) \
146 (0x0000000000000718ull + (((offset) & 1) * 0))
147#define CVMX_PCIERCX_CFG455(offset) \
148 (0x000000000000071Cull + (((offset) & 1) * 0))
149#define CVMX_PCIERCX_CFG456(offset) \
150 (0x0000000000000720ull + (((offset) & 1) * 0))
151#define CVMX_PCIERCX_CFG458(offset) \
152 (0x0000000000000728ull + (((offset) & 1) * 0))
153#define CVMX_PCIERCX_CFG459(offset) \
154 (0x000000000000072Cull + (((offset) & 1) * 0))
155#define CVMX_PCIERCX_CFG460(offset) \
156 (0x0000000000000730ull + (((offset) & 1) * 0))
157#define CVMX_PCIERCX_CFG461(offset) \
158 (0x0000000000000734ull + (((offset) & 1) * 0))
159#define CVMX_PCIERCX_CFG462(offset) \
160 (0x0000000000000738ull + (((offset) & 1) * 0))
161#define CVMX_PCIERCX_CFG463(offset) \
162 (0x000000000000073Cull + (((offset) & 1) * 0))
163#define CVMX_PCIERCX_CFG464(offset) \
164 (0x0000000000000740ull + (((offset) & 1) * 0))
165#define CVMX_PCIERCX_CFG465(offset) \
166 (0x0000000000000744ull + (((offset) & 1) * 0))
167#define CVMX_PCIERCX_CFG466(offset) \
168 (0x0000000000000748ull + (((offset) & 1) * 0))
169#define CVMX_PCIERCX_CFG467(offset) \
170 (0x000000000000074Cull + (((offset) & 1) * 0))
171#define CVMX_PCIERCX_CFG468(offset) \
172 (0x0000000000000750ull + (((offset) & 1) * 0))
173#define CVMX_PCIERCX_CFG490(offset) \
174 (0x00000000000007A8ull + (((offset) & 1) * 0))
175#define CVMX_PCIERCX_CFG491(offset) \
176 (0x00000000000007ACull + (((offset) & 1) * 0))
177#define CVMX_PCIERCX_CFG492(offset) \
178 (0x00000000000007B0ull + (((offset) & 1) * 0))
179#define CVMX_PCIERCX_CFG516(offset) \
180 (0x0000000000000810ull + (((offset) & 1) * 0))
181#define CVMX_PCIERCX_CFG517(offset) \
182 (0x0000000000000814ull + (((offset) & 1) * 0))
183
184union cvmx_pciercx_cfg000 {
185 uint32_t u32;
186 struct cvmx_pciercx_cfg000_s {
187 uint32_t devid:16;
188 uint32_t vendid:16;
189 } s;
190 struct cvmx_pciercx_cfg000_s cn52xx;
191 struct cvmx_pciercx_cfg000_s cn52xxp1;
192 struct cvmx_pciercx_cfg000_s cn56xx;
193 struct cvmx_pciercx_cfg000_s cn56xxp1;
194};
195
196union cvmx_pciercx_cfg001 {
197 uint32_t u32;
198 struct cvmx_pciercx_cfg001_s {
199 uint32_t dpe:1;
200 uint32_t sse:1;
201 uint32_t rma:1;
202 uint32_t rta:1;
203 uint32_t sta:1;
204 uint32_t devt:2;
205 uint32_t mdpe:1;
206 uint32_t fbb:1;
207 uint32_t reserved_22_22:1;
208 uint32_t m66:1;
209 uint32_t cl:1;
210 uint32_t i_stat:1;
211 uint32_t reserved_11_18:8;
212 uint32_t i_dis:1;
213 uint32_t fbbe:1;
214 uint32_t see:1;
215 uint32_t ids_wcc:1;
216 uint32_t per:1;
217 uint32_t vps:1;
218 uint32_t mwice:1;
219 uint32_t scse:1;
220 uint32_t me:1;
221 uint32_t msae:1;
222 uint32_t isae:1;
223 } s;
224 struct cvmx_pciercx_cfg001_s cn52xx;
225 struct cvmx_pciercx_cfg001_s cn52xxp1;
226 struct cvmx_pciercx_cfg001_s cn56xx;
227 struct cvmx_pciercx_cfg001_s cn56xxp1;
228};
229
230union cvmx_pciercx_cfg002 {
231 uint32_t u32;
232 struct cvmx_pciercx_cfg002_s {
233 uint32_t bcc:8;
234 uint32_t sc:8;
235 uint32_t pi:8;
236 uint32_t rid:8;
237 } s;
238 struct cvmx_pciercx_cfg002_s cn52xx;
239 struct cvmx_pciercx_cfg002_s cn52xxp1;
240 struct cvmx_pciercx_cfg002_s cn56xx;
241 struct cvmx_pciercx_cfg002_s cn56xxp1;
242};
243
244union cvmx_pciercx_cfg003 {
245 uint32_t u32;
246 struct cvmx_pciercx_cfg003_s {
247 uint32_t bist:8;
248 uint32_t mfd:1;
249 uint32_t chf:7;
250 uint32_t lt:8;
251 uint32_t cls:8;
252 } s;
253 struct cvmx_pciercx_cfg003_s cn52xx;
254 struct cvmx_pciercx_cfg003_s cn52xxp1;
255 struct cvmx_pciercx_cfg003_s cn56xx;
256 struct cvmx_pciercx_cfg003_s cn56xxp1;
257};
258
259union cvmx_pciercx_cfg004 {
260 uint32_t u32;
261 struct cvmx_pciercx_cfg004_s {
262 uint32_t reserved_0_31:32;
263 } s;
264 struct cvmx_pciercx_cfg004_s cn52xx;
265 struct cvmx_pciercx_cfg004_s cn52xxp1;
266 struct cvmx_pciercx_cfg004_s cn56xx;
267 struct cvmx_pciercx_cfg004_s cn56xxp1;
268};
269
270union cvmx_pciercx_cfg005 {
271 uint32_t u32;
272 struct cvmx_pciercx_cfg005_s {
273 uint32_t reserved_0_31:32;
274 } s;
275 struct cvmx_pciercx_cfg005_s cn52xx;
276 struct cvmx_pciercx_cfg005_s cn52xxp1;
277 struct cvmx_pciercx_cfg005_s cn56xx;
278 struct cvmx_pciercx_cfg005_s cn56xxp1;
279};
280
281union cvmx_pciercx_cfg006 {
282 uint32_t u32;
283 struct cvmx_pciercx_cfg006_s {
284 uint32_t slt:8;
285 uint32_t subbnum:8;
286 uint32_t sbnum:8;
287 uint32_t pbnum:8;
288 } s;
289 struct cvmx_pciercx_cfg006_s cn52xx;
290 struct cvmx_pciercx_cfg006_s cn52xxp1;
291 struct cvmx_pciercx_cfg006_s cn56xx;
292 struct cvmx_pciercx_cfg006_s cn56xxp1;
293};
294
295union cvmx_pciercx_cfg007 {
296 uint32_t u32;
297 struct cvmx_pciercx_cfg007_s {
298 uint32_t dpe:1;
299 uint32_t sse:1;
300 uint32_t rma:1;
301 uint32_t rta:1;
302 uint32_t sta:1;
303 uint32_t devt:2;
304 uint32_t mdpe:1;
305 uint32_t fbb:1;
306 uint32_t reserved_22_22:1;
307 uint32_t m66:1;
308 uint32_t reserved_16_20:5;
309 uint32_t lio_limi:4;
310 uint32_t reserved_9_11:3;
311 uint32_t io32b:1;
312 uint32_t lio_base:4;
313 uint32_t reserved_1_3:3;
314 uint32_t io32a:1;
315 } s;
316 struct cvmx_pciercx_cfg007_s cn52xx;
317 struct cvmx_pciercx_cfg007_s cn52xxp1;
318 struct cvmx_pciercx_cfg007_s cn56xx;
319 struct cvmx_pciercx_cfg007_s cn56xxp1;
320};
321
322union cvmx_pciercx_cfg008 {
323 uint32_t u32;
324 struct cvmx_pciercx_cfg008_s {
325 uint32_t ml_addr:12;
326 uint32_t reserved_16_19:4;
327 uint32_t mb_addr:12;
328 uint32_t reserved_0_3:4;
329 } s;
330 struct cvmx_pciercx_cfg008_s cn52xx;
331 struct cvmx_pciercx_cfg008_s cn52xxp1;
332 struct cvmx_pciercx_cfg008_s cn56xx;
333 struct cvmx_pciercx_cfg008_s cn56xxp1;
334};
335
336union cvmx_pciercx_cfg009 {
337 uint32_t u32;
338 struct cvmx_pciercx_cfg009_s {
339 uint32_t lmem_limit:12;
340 uint32_t reserved_17_19:3;
341 uint32_t mem64b:1;
342 uint32_t lmem_base:12;
343 uint32_t reserved_1_3:3;
344 uint32_t mem64a:1;
345 } s;
346 struct cvmx_pciercx_cfg009_s cn52xx;
347 struct cvmx_pciercx_cfg009_s cn52xxp1;
348 struct cvmx_pciercx_cfg009_s cn56xx;
349 struct cvmx_pciercx_cfg009_s cn56xxp1;
350};
351
352union cvmx_pciercx_cfg010 {
353 uint32_t u32;
354 struct cvmx_pciercx_cfg010_s {
355 uint32_t umem_base:32;
356 } s;
357 struct cvmx_pciercx_cfg010_s cn52xx;
358 struct cvmx_pciercx_cfg010_s cn52xxp1;
359 struct cvmx_pciercx_cfg010_s cn56xx;
360 struct cvmx_pciercx_cfg010_s cn56xxp1;
361};
362
363union cvmx_pciercx_cfg011 {
364 uint32_t u32;
365 struct cvmx_pciercx_cfg011_s {
366 uint32_t umem_limit:32;
367 } s;
368 struct cvmx_pciercx_cfg011_s cn52xx;
369 struct cvmx_pciercx_cfg011_s cn52xxp1;
370 struct cvmx_pciercx_cfg011_s cn56xx;
371 struct cvmx_pciercx_cfg011_s cn56xxp1;
372};
373
374union cvmx_pciercx_cfg012 {
375 uint32_t u32;
376 struct cvmx_pciercx_cfg012_s {
377 uint32_t uio_limit:16;
378 uint32_t uio_base:16;
379 } s;
380 struct cvmx_pciercx_cfg012_s cn52xx;
381 struct cvmx_pciercx_cfg012_s cn52xxp1;
382 struct cvmx_pciercx_cfg012_s cn56xx;
383 struct cvmx_pciercx_cfg012_s cn56xxp1;
384};
385
386union cvmx_pciercx_cfg013 {
387 uint32_t u32;
388 struct cvmx_pciercx_cfg013_s {
389 uint32_t reserved_8_31:24;
390 uint32_t cp:8;
391 } s;
392 struct cvmx_pciercx_cfg013_s cn52xx;
393 struct cvmx_pciercx_cfg013_s cn52xxp1;
394 struct cvmx_pciercx_cfg013_s cn56xx;
395 struct cvmx_pciercx_cfg013_s cn56xxp1;
396};
397
398union cvmx_pciercx_cfg014 {
399 uint32_t u32;
400 struct cvmx_pciercx_cfg014_s {
401 uint32_t reserved_0_31:32;
402 } s;
403 struct cvmx_pciercx_cfg014_s cn52xx;
404 struct cvmx_pciercx_cfg014_s cn52xxp1;
405 struct cvmx_pciercx_cfg014_s cn56xx;
406 struct cvmx_pciercx_cfg014_s cn56xxp1;
407};
408
409union cvmx_pciercx_cfg015 {
410 uint32_t u32;
411 struct cvmx_pciercx_cfg015_s {
412 uint32_t reserved_28_31:4;
413 uint32_t dtsees:1;
414 uint32_t dts:1;
415 uint32_t sdt:1;
416 uint32_t pdt:1;
417 uint32_t fbbe:1;
418 uint32_t sbrst:1;
419 uint32_t mam:1;
420 uint32_t vga16d:1;
421 uint32_t vgae:1;
422 uint32_t isae:1;
423 uint32_t see:1;
424 uint32_t pere:1;
425 uint32_t inta:8;
426 uint32_t il:8;
427 } s;
428 struct cvmx_pciercx_cfg015_s cn52xx;
429 struct cvmx_pciercx_cfg015_s cn52xxp1;
430 struct cvmx_pciercx_cfg015_s cn56xx;
431 struct cvmx_pciercx_cfg015_s cn56xxp1;
432};
433
434union cvmx_pciercx_cfg016 {
435 uint32_t u32;
436 struct cvmx_pciercx_cfg016_s {
437 uint32_t pmes:5;
438 uint32_t d2s:1;
439 uint32_t d1s:1;
440 uint32_t auxc:3;
441 uint32_t dsi:1;
442 uint32_t reserved_20_20:1;
443 uint32_t pme_clock:1;
444 uint32_t pmsv:3;
445 uint32_t ncp:8;
446 uint32_t pmcid:8;
447 } s;
448 struct cvmx_pciercx_cfg016_s cn52xx;
449 struct cvmx_pciercx_cfg016_s cn52xxp1;
450 struct cvmx_pciercx_cfg016_s cn56xx;
451 struct cvmx_pciercx_cfg016_s cn56xxp1;
452};
453
454union cvmx_pciercx_cfg017 {
455 uint32_t u32;
456 struct cvmx_pciercx_cfg017_s {
457 uint32_t pmdia:8;
458 uint32_t bpccee:1;
459 uint32_t bd3h:1;
460 uint32_t reserved_16_21:6;
461 uint32_t pmess:1;
462 uint32_t pmedsia:2;
463 uint32_t pmds:4;
464 uint32_t pmeens:1;
465 uint32_t reserved_4_7:4;
466 uint32_t nsr:1;
467 uint32_t reserved_2_2:1;
468 uint32_t ps:2;
469 } s;
470 struct cvmx_pciercx_cfg017_s cn52xx;
471 struct cvmx_pciercx_cfg017_s cn52xxp1;
472 struct cvmx_pciercx_cfg017_s cn56xx;
473 struct cvmx_pciercx_cfg017_s cn56xxp1;
474};
475
476union cvmx_pciercx_cfg020 {
477 uint32_t u32;
478 struct cvmx_pciercx_cfg020_s {
479 uint32_t reserved_24_31:8;
480 uint32_t m64:1;
481 uint32_t mme:3;
482 uint32_t mmc:3;
483 uint32_t msien:1;
484 uint32_t ncp:8;
485 uint32_t msicid:8;
486 } s;
487 struct cvmx_pciercx_cfg020_s cn52xx;
488 struct cvmx_pciercx_cfg020_s cn52xxp1;
489 struct cvmx_pciercx_cfg020_s cn56xx;
490 struct cvmx_pciercx_cfg020_s cn56xxp1;
491};
492
493union cvmx_pciercx_cfg021 {
494 uint32_t u32;
495 struct cvmx_pciercx_cfg021_s {
496 uint32_t lmsi:30;
497 uint32_t reserved_0_1:2;
498 } s;
499 struct cvmx_pciercx_cfg021_s cn52xx;
500 struct cvmx_pciercx_cfg021_s cn52xxp1;
501 struct cvmx_pciercx_cfg021_s cn56xx;
502 struct cvmx_pciercx_cfg021_s cn56xxp1;
503};
504
505union cvmx_pciercx_cfg022 {
506 uint32_t u32;
507 struct cvmx_pciercx_cfg022_s {
508 uint32_t umsi:32;
509 } s;
510 struct cvmx_pciercx_cfg022_s cn52xx;
511 struct cvmx_pciercx_cfg022_s cn52xxp1;
512 struct cvmx_pciercx_cfg022_s cn56xx;
513 struct cvmx_pciercx_cfg022_s cn56xxp1;
514};
515
516union cvmx_pciercx_cfg023 {
517 uint32_t u32;
518 struct cvmx_pciercx_cfg023_s {
519 uint32_t reserved_16_31:16;
520 uint32_t msimd:16;
521 } s;
522 struct cvmx_pciercx_cfg023_s cn52xx;
523 struct cvmx_pciercx_cfg023_s cn52xxp1;
524 struct cvmx_pciercx_cfg023_s cn56xx;
525 struct cvmx_pciercx_cfg023_s cn56xxp1;
526};
527
528union cvmx_pciercx_cfg028 {
529 uint32_t u32;
530 struct cvmx_pciercx_cfg028_s {
531 uint32_t reserved_30_31:2;
532 uint32_t imn:5;
533 uint32_t si:1;
534 uint32_t dpt:4;
535 uint32_t pciecv:4;
536 uint32_t ncp:8;
537 uint32_t pcieid:8;
538 } s;
539 struct cvmx_pciercx_cfg028_s cn52xx;
540 struct cvmx_pciercx_cfg028_s cn52xxp1;
541 struct cvmx_pciercx_cfg028_s cn56xx;
542 struct cvmx_pciercx_cfg028_s cn56xxp1;
543};
544
545union cvmx_pciercx_cfg029 {
546 uint32_t u32;
547 struct cvmx_pciercx_cfg029_s {
548 uint32_t reserved_28_31:4;
549 uint32_t cspls:2;
550 uint32_t csplv:8;
551 uint32_t reserved_16_17:2;
552 uint32_t rber:1;
553 uint32_t reserved_12_14:3;
554 uint32_t el1al:3;
555 uint32_t el0al:3;
556 uint32_t etfs:1;
557 uint32_t pfs:2;
558 uint32_t mpss:3;
559 } s;
560 struct cvmx_pciercx_cfg029_s cn52xx;
561 struct cvmx_pciercx_cfg029_s cn52xxp1;
562 struct cvmx_pciercx_cfg029_s cn56xx;
563 struct cvmx_pciercx_cfg029_s cn56xxp1;
564};
565
566union cvmx_pciercx_cfg030 {
567 uint32_t u32;
568 struct cvmx_pciercx_cfg030_s {
569 uint32_t reserved_22_31:10;
570 uint32_t tp:1;
571 uint32_t ap_d:1;
572 uint32_t ur_d:1;
573 uint32_t fe_d:1;
574 uint32_t nfe_d:1;
575 uint32_t ce_d:1;
576 uint32_t reserved_15_15:1;
577 uint32_t mrrs:3;
578 uint32_t ns_en:1;
579 uint32_t ap_en:1;
580 uint32_t pf_en:1;
581 uint32_t etf_en:1;
582 uint32_t mps:3;
583 uint32_t ro_en:1;
584 uint32_t ur_en:1;
585 uint32_t fe_en:1;
586 uint32_t nfe_en:1;
587 uint32_t ce_en:1;
588 } s;
589 struct cvmx_pciercx_cfg030_s cn52xx;
590 struct cvmx_pciercx_cfg030_s cn52xxp1;
591 struct cvmx_pciercx_cfg030_s cn56xx;
592 struct cvmx_pciercx_cfg030_s cn56xxp1;
593};
594
595union cvmx_pciercx_cfg031 {
596 uint32_t u32;
597 struct cvmx_pciercx_cfg031_s {
598 uint32_t pnum:8;
599 uint32_t reserved_22_23:2;
600 uint32_t lbnc:1;
601 uint32_t dllarc:1;
602 uint32_t sderc:1;
603 uint32_t cpm:1;
604 uint32_t l1el:3;
605 uint32_t l0el:3;
606 uint32_t aslpms:2;
607 uint32_t mlw:6;
608 uint32_t mls:4;
609 } s;
610 struct cvmx_pciercx_cfg031_s cn52xx;
611 struct cvmx_pciercx_cfg031_s cn52xxp1;
612 struct cvmx_pciercx_cfg031_s cn56xx;
613 struct cvmx_pciercx_cfg031_s cn56xxp1;
614};
615
616union cvmx_pciercx_cfg032 {
617 uint32_t u32;
618 struct cvmx_pciercx_cfg032_s {
619 uint32_t lab:1;
620 uint32_t lbm:1;
621 uint32_t dlla:1;
622 uint32_t scc:1;
623 uint32_t lt:1;
624 uint32_t reserved_26_26:1;
625 uint32_t nlw:6;
626 uint32_t ls:4;
627 uint32_t reserved_12_15:4;
628 uint32_t lab_int_enb:1;
629 uint32_t lbm_int_enb:1;
630 uint32_t hawd:1;
631 uint32_t ecpm:1;
632 uint32_t es:1;
633 uint32_t ccc:1;
634 uint32_t rl:1;
635 uint32_t ld:1;
636 uint32_t rcb:1;
637 uint32_t reserved_2_2:1;
638 uint32_t aslpc:2;
639 } s;
640 struct cvmx_pciercx_cfg032_s cn52xx;
641 struct cvmx_pciercx_cfg032_s cn52xxp1;
642 struct cvmx_pciercx_cfg032_s cn56xx;
643 struct cvmx_pciercx_cfg032_s cn56xxp1;
644};
645
646union cvmx_pciercx_cfg033 {
647 uint32_t u32;
648 struct cvmx_pciercx_cfg033_s {
649 uint32_t ps_num:13;
650 uint32_t nccs:1;
651 uint32_t emip:1;
652 uint32_t sp_ls:2;
653 uint32_t sp_lv:8;
654 uint32_t hp_c:1;
655 uint32_t hp_s:1;
656 uint32_t pip:1;
657 uint32_t aip:1;
658 uint32_t mrlsp:1;
659 uint32_t pcp:1;
660 uint32_t abp:1;
661 } s;
662 struct cvmx_pciercx_cfg033_s cn52xx;
663 struct cvmx_pciercx_cfg033_s cn52xxp1;
664 struct cvmx_pciercx_cfg033_s cn56xx;
665 struct cvmx_pciercx_cfg033_s cn56xxp1;
666};
667
668union cvmx_pciercx_cfg034 {
669 uint32_t u32;
670 struct cvmx_pciercx_cfg034_s {
671 uint32_t reserved_25_31:7;
672 uint32_t dlls_c:1;
673 uint32_t emis:1;
674 uint32_t pds:1;
675 uint32_t mrlss:1;
676 uint32_t ccint_d:1;
677 uint32_t pd_c:1;
678 uint32_t mrls_c:1;
679 uint32_t pf_d:1;
680 uint32_t abp_d:1;
681 uint32_t reserved_13_15:3;
682 uint32_t dlls_en:1;
683 uint32_t emic:1;
684 uint32_t pcc:1;
685 uint32_t pic:2;
686 uint32_t aic:2;
687 uint32_t hpint_en:1;
688 uint32_t ccint_en:1;
689 uint32_t pd_en:1;
690 uint32_t mrls_en:1;
691 uint32_t pf_en:1;
692 uint32_t abp_en:1;
693 } s;
694 struct cvmx_pciercx_cfg034_s cn52xx;
695 struct cvmx_pciercx_cfg034_s cn52xxp1;
696 struct cvmx_pciercx_cfg034_s cn56xx;
697 struct cvmx_pciercx_cfg034_s cn56xxp1;
698};
699
700union cvmx_pciercx_cfg035 {
701 uint32_t u32;
702 struct cvmx_pciercx_cfg035_s {
703 uint32_t reserved_17_31:15;
704 uint32_t crssv:1;
705 uint32_t reserved_5_15:11;
706 uint32_t crssve:1;
707 uint32_t pmeie:1;
708 uint32_t sefee:1;
709 uint32_t senfee:1;
710 uint32_t secee:1;
711 } s;
712 struct cvmx_pciercx_cfg035_s cn52xx;
713 struct cvmx_pciercx_cfg035_s cn52xxp1;
714 struct cvmx_pciercx_cfg035_s cn56xx;
715 struct cvmx_pciercx_cfg035_s cn56xxp1;
716};
717
718union cvmx_pciercx_cfg036 {
719 uint32_t u32;
720 struct cvmx_pciercx_cfg036_s {
721 uint32_t reserved_18_31:14;
722 uint32_t pme_pend:1;
723 uint32_t pme_stat:1;
724 uint32_t pme_rid:16;
725 } s;
726 struct cvmx_pciercx_cfg036_s cn52xx;
727 struct cvmx_pciercx_cfg036_s cn52xxp1;
728 struct cvmx_pciercx_cfg036_s cn56xx;
729 struct cvmx_pciercx_cfg036_s cn56xxp1;
730};
731
732union cvmx_pciercx_cfg037 {
733 uint32_t u32;
734 struct cvmx_pciercx_cfg037_s {
735 uint32_t reserved_5_31:27;
736 uint32_t ctds:1;
737 uint32_t ctrs:4;
738 } s;
739 struct cvmx_pciercx_cfg037_s cn52xx;
740 struct cvmx_pciercx_cfg037_s cn52xxp1;
741 struct cvmx_pciercx_cfg037_s cn56xx;
742 struct cvmx_pciercx_cfg037_s cn56xxp1;
743};
744
745union cvmx_pciercx_cfg038 {
746 uint32_t u32;
747 struct cvmx_pciercx_cfg038_s {
748 uint32_t reserved_5_31:27;
749 uint32_t ctd:1;
750 uint32_t ctv:4;
751 } s;
752 struct cvmx_pciercx_cfg038_s cn52xx;
753 struct cvmx_pciercx_cfg038_s cn52xxp1;
754 struct cvmx_pciercx_cfg038_s cn56xx;
755 struct cvmx_pciercx_cfg038_s cn56xxp1;
756};
757
758union cvmx_pciercx_cfg039 {
759 uint32_t u32;
760 struct cvmx_pciercx_cfg039_s {
761 uint32_t reserved_0_31:32;
762 } s;
763 struct cvmx_pciercx_cfg039_s cn52xx;
764 struct cvmx_pciercx_cfg039_s cn52xxp1;
765 struct cvmx_pciercx_cfg039_s cn56xx;
766 struct cvmx_pciercx_cfg039_s cn56xxp1;
767};
768
769union cvmx_pciercx_cfg040 {
770 uint32_t u32;
771 struct cvmx_pciercx_cfg040_s {
772 uint32_t reserved_0_31:32;
773 } s;
774 struct cvmx_pciercx_cfg040_s cn52xx;
775 struct cvmx_pciercx_cfg040_s cn52xxp1;
776 struct cvmx_pciercx_cfg040_s cn56xx;
777 struct cvmx_pciercx_cfg040_s cn56xxp1;
778};
779
780union cvmx_pciercx_cfg041 {
781 uint32_t u32;
782 struct cvmx_pciercx_cfg041_s {
783 uint32_t reserved_0_31:32;
784 } s;
785 struct cvmx_pciercx_cfg041_s cn52xx;
786 struct cvmx_pciercx_cfg041_s cn52xxp1;
787 struct cvmx_pciercx_cfg041_s cn56xx;
788 struct cvmx_pciercx_cfg041_s cn56xxp1;
789};
790
791union cvmx_pciercx_cfg042 {
792 uint32_t u32;
793 struct cvmx_pciercx_cfg042_s {
794 uint32_t reserved_0_31:32;
795 } s;
796 struct cvmx_pciercx_cfg042_s cn52xx;
797 struct cvmx_pciercx_cfg042_s cn52xxp1;
798 struct cvmx_pciercx_cfg042_s cn56xx;
799 struct cvmx_pciercx_cfg042_s cn56xxp1;
800};
801
802union cvmx_pciercx_cfg064 {
803 uint32_t u32;
804 struct cvmx_pciercx_cfg064_s {
805 uint32_t nco:12;
806 uint32_t cv:4;
807 uint32_t pcieec:16;
808 } s;
809 struct cvmx_pciercx_cfg064_s cn52xx;
810 struct cvmx_pciercx_cfg064_s cn52xxp1;
811 struct cvmx_pciercx_cfg064_s cn56xx;
812 struct cvmx_pciercx_cfg064_s cn56xxp1;
813};
814
815union cvmx_pciercx_cfg065 {
816 uint32_t u32;
817 struct cvmx_pciercx_cfg065_s {
818 uint32_t reserved_21_31:11;
819 uint32_t ures:1;
820 uint32_t ecrces:1;
821 uint32_t mtlps:1;
822 uint32_t ros:1;
823 uint32_t ucs:1;
824 uint32_t cas:1;
825 uint32_t cts:1;
826 uint32_t fcpes:1;
827 uint32_t ptlps:1;
828 uint32_t reserved_6_11:6;
829 uint32_t sdes:1;
830 uint32_t dlpes:1;
831 uint32_t reserved_0_3:4;
832 } s;
833 struct cvmx_pciercx_cfg065_s cn52xx;
834 struct cvmx_pciercx_cfg065_s cn52xxp1;
835 struct cvmx_pciercx_cfg065_s cn56xx;
836 struct cvmx_pciercx_cfg065_s cn56xxp1;
837};
838
839union cvmx_pciercx_cfg066 {
840 uint32_t u32;
841 struct cvmx_pciercx_cfg066_s {
842 uint32_t reserved_21_31:11;
843 uint32_t urem:1;
844 uint32_t ecrcem:1;
845 uint32_t mtlpm:1;
846 uint32_t rom:1;
847 uint32_t ucm:1;
848 uint32_t cam:1;
849 uint32_t ctm:1;
850 uint32_t fcpem:1;
851 uint32_t ptlpm:1;
852 uint32_t reserved_6_11:6;
853 uint32_t sdem:1;
854 uint32_t dlpem:1;
855 uint32_t reserved_0_3:4;
856 } s;
857 struct cvmx_pciercx_cfg066_s cn52xx;
858 struct cvmx_pciercx_cfg066_s cn52xxp1;
859 struct cvmx_pciercx_cfg066_s cn56xx;
860 struct cvmx_pciercx_cfg066_s cn56xxp1;
861};
862
863union cvmx_pciercx_cfg067 {
864 uint32_t u32;
865 struct cvmx_pciercx_cfg067_s {
866 uint32_t reserved_21_31:11;
867 uint32_t ures:1;
868 uint32_t ecrces:1;
869 uint32_t mtlps:1;
870 uint32_t ros:1;
871 uint32_t ucs:1;
872 uint32_t cas:1;
873 uint32_t cts:1;
874 uint32_t fcpes:1;
875 uint32_t ptlps:1;
876 uint32_t reserved_6_11:6;
877 uint32_t sdes:1;
878 uint32_t dlpes:1;
879 uint32_t reserved_0_3:4;
880 } s;
881 struct cvmx_pciercx_cfg067_s cn52xx;
882 struct cvmx_pciercx_cfg067_s cn52xxp1;
883 struct cvmx_pciercx_cfg067_s cn56xx;
884 struct cvmx_pciercx_cfg067_s cn56xxp1;
885};
886
887union cvmx_pciercx_cfg068 {
888 uint32_t u32;
889 struct cvmx_pciercx_cfg068_s {
890 uint32_t reserved_14_31:18;
891 uint32_t anfes:1;
892 uint32_t rtts:1;
893 uint32_t reserved_9_11:3;
894 uint32_t rnrs:1;
895 uint32_t bdllps:1;
896 uint32_t btlps:1;
897 uint32_t reserved_1_5:5;
898 uint32_t res:1;
899 } s;
900 struct cvmx_pciercx_cfg068_s cn52xx;
901 struct cvmx_pciercx_cfg068_s cn52xxp1;
902 struct cvmx_pciercx_cfg068_s cn56xx;
903 struct cvmx_pciercx_cfg068_s cn56xxp1;
904};
905
906union cvmx_pciercx_cfg069 {
907 uint32_t u32;
908 struct cvmx_pciercx_cfg069_s {
909 uint32_t reserved_14_31:18;
910 uint32_t anfem:1;
911 uint32_t rttm:1;
912 uint32_t reserved_9_11:3;
913 uint32_t rnrm:1;
914 uint32_t bdllpm:1;
915 uint32_t btlpm:1;
916 uint32_t reserved_1_5:5;
917 uint32_t rem:1;
918 } s;
919 struct cvmx_pciercx_cfg069_s cn52xx;
920 struct cvmx_pciercx_cfg069_s cn52xxp1;
921 struct cvmx_pciercx_cfg069_s cn56xx;
922 struct cvmx_pciercx_cfg069_s cn56xxp1;
923};
924
925union cvmx_pciercx_cfg070 {
926 uint32_t u32;
927 struct cvmx_pciercx_cfg070_s {
928 uint32_t reserved_9_31:23;
929 uint32_t ce:1;
930 uint32_t cc:1;
931 uint32_t ge:1;
932 uint32_t gc:1;
933 uint32_t fep:5;
934 } s;
935 struct cvmx_pciercx_cfg070_s cn52xx;
936 struct cvmx_pciercx_cfg070_s cn52xxp1;
937 struct cvmx_pciercx_cfg070_s cn56xx;
938 struct cvmx_pciercx_cfg070_s cn56xxp1;
939};
940
941union cvmx_pciercx_cfg071 {
942 uint32_t u32;
943 struct cvmx_pciercx_cfg071_s {
944 uint32_t dword1:32;
945 } s;
946 struct cvmx_pciercx_cfg071_s cn52xx;
947 struct cvmx_pciercx_cfg071_s cn52xxp1;
948 struct cvmx_pciercx_cfg071_s cn56xx;
949 struct cvmx_pciercx_cfg071_s cn56xxp1;
950};
951
952union cvmx_pciercx_cfg072 {
953 uint32_t u32;
954 struct cvmx_pciercx_cfg072_s {
955 uint32_t dword2:32;
956 } s;
957 struct cvmx_pciercx_cfg072_s cn52xx;
958 struct cvmx_pciercx_cfg072_s cn52xxp1;
959 struct cvmx_pciercx_cfg072_s cn56xx;
960 struct cvmx_pciercx_cfg072_s cn56xxp1;
961};
962
963union cvmx_pciercx_cfg073 {
964 uint32_t u32;
965 struct cvmx_pciercx_cfg073_s {
966 uint32_t dword3:32;
967 } s;
968 struct cvmx_pciercx_cfg073_s cn52xx;
969 struct cvmx_pciercx_cfg073_s cn52xxp1;
970 struct cvmx_pciercx_cfg073_s cn56xx;
971 struct cvmx_pciercx_cfg073_s cn56xxp1;
972};
973
974union cvmx_pciercx_cfg074 {
975 uint32_t u32;
976 struct cvmx_pciercx_cfg074_s {
977 uint32_t dword4:32;
978 } s;
979 struct cvmx_pciercx_cfg074_s cn52xx;
980 struct cvmx_pciercx_cfg074_s cn52xxp1;
981 struct cvmx_pciercx_cfg074_s cn56xx;
982 struct cvmx_pciercx_cfg074_s cn56xxp1;
983};
984
985union cvmx_pciercx_cfg075 {
986 uint32_t u32;
987 struct cvmx_pciercx_cfg075_s {
988 uint32_t reserved_3_31:29;
989 uint32_t fere:1;
990 uint32_t nfere:1;
991 uint32_t cere:1;
992 } s;
993 struct cvmx_pciercx_cfg075_s cn52xx;
994 struct cvmx_pciercx_cfg075_s cn52xxp1;
995 struct cvmx_pciercx_cfg075_s cn56xx;
996 struct cvmx_pciercx_cfg075_s cn56xxp1;
997};
998
999union cvmx_pciercx_cfg076 {
1000 uint32_t u32;
1001 struct cvmx_pciercx_cfg076_s {
1002 uint32_t aeimn:5;
1003 uint32_t reserved_7_26:20;
1004 uint32_t femr:1;
1005 uint32_t nfemr:1;
1006 uint32_t fuf:1;
1007 uint32_t multi_efnfr:1;
1008 uint32_t efnfr:1;
1009 uint32_t multi_ecr:1;
1010 uint32_t ecr:1;
1011 } s;
1012 struct cvmx_pciercx_cfg076_s cn52xx;
1013 struct cvmx_pciercx_cfg076_s cn52xxp1;
1014 struct cvmx_pciercx_cfg076_s cn56xx;
1015 struct cvmx_pciercx_cfg076_s cn56xxp1;
1016};
1017
1018union cvmx_pciercx_cfg077 {
1019 uint32_t u32;
1020 struct cvmx_pciercx_cfg077_s {
1021 uint32_t efnfsi:16;
1022 uint32_t ecsi:16;
1023 } s;
1024 struct cvmx_pciercx_cfg077_s cn52xx;
1025 struct cvmx_pciercx_cfg077_s cn52xxp1;
1026 struct cvmx_pciercx_cfg077_s cn56xx;
1027 struct cvmx_pciercx_cfg077_s cn56xxp1;
1028};
1029
1030union cvmx_pciercx_cfg448 {
1031 uint32_t u32;
1032 struct cvmx_pciercx_cfg448_s {
1033 uint32_t rtl:16;
1034 uint32_t rtltl:16;
1035 } s;
1036 struct cvmx_pciercx_cfg448_s cn52xx;
1037 struct cvmx_pciercx_cfg448_s cn52xxp1;
1038 struct cvmx_pciercx_cfg448_s cn56xx;
1039 struct cvmx_pciercx_cfg448_s cn56xxp1;
1040};
1041
1042union cvmx_pciercx_cfg449 {
1043 uint32_t u32;
1044 struct cvmx_pciercx_cfg449_s {
1045 uint32_t omr:32;
1046 } s;
1047 struct cvmx_pciercx_cfg449_s cn52xx;
1048 struct cvmx_pciercx_cfg449_s cn52xxp1;
1049 struct cvmx_pciercx_cfg449_s cn56xx;
1050 struct cvmx_pciercx_cfg449_s cn56xxp1;
1051};
1052
1053union cvmx_pciercx_cfg450 {
1054 uint32_t u32;
1055 struct cvmx_pciercx_cfg450_s {
1056 uint32_t lpec:8;
1057 uint32_t reserved_22_23:2;
1058 uint32_t link_state:6;
1059 uint32_t force_link:1;
1060 uint32_t reserved_8_14:7;
1061 uint32_t link_num:8;
1062 } s;
1063 struct cvmx_pciercx_cfg450_s cn52xx;
1064 struct cvmx_pciercx_cfg450_s cn52xxp1;
1065 struct cvmx_pciercx_cfg450_s cn56xx;
1066 struct cvmx_pciercx_cfg450_s cn56xxp1;
1067};
1068
1069union cvmx_pciercx_cfg451 {
1070 uint32_t u32;
1071 struct cvmx_pciercx_cfg451_s {
1072 uint32_t reserved_30_31:2;
1073 uint32_t l1el:3;
1074 uint32_t l0el:3;
1075 uint32_t n_fts_cc:8;
1076 uint32_t n_fts:8;
1077 uint32_t ack_freq:8;
1078 } s;
1079 struct cvmx_pciercx_cfg451_s cn52xx;
1080 struct cvmx_pciercx_cfg451_s cn52xxp1;
1081 struct cvmx_pciercx_cfg451_s cn56xx;
1082 struct cvmx_pciercx_cfg451_s cn56xxp1;
1083};
1084
1085union cvmx_pciercx_cfg452 {
1086 uint32_t u32;
1087 struct cvmx_pciercx_cfg452_s {
1088 uint32_t reserved_26_31:6;
1089 uint32_t eccrc:1;
1090 uint32_t reserved_22_24:3;
1091 uint32_t lme:6;
1092 uint32_t reserved_8_15:8;
1093 uint32_t flm:1;
1094 uint32_t reserved_6_6:1;
1095 uint32_t dllle:1;
1096 uint32_t reserved_4_4:1;
1097 uint32_t ra:1;
1098 uint32_t le:1;
1099 uint32_t sd:1;
1100 uint32_t omr:1;
1101 } s;
1102 struct cvmx_pciercx_cfg452_s cn52xx;
1103 struct cvmx_pciercx_cfg452_s cn52xxp1;
1104 struct cvmx_pciercx_cfg452_s cn56xx;
1105 struct cvmx_pciercx_cfg452_s cn56xxp1;
1106};
1107
1108union cvmx_pciercx_cfg453 {
1109 uint32_t u32;
1110 struct cvmx_pciercx_cfg453_s {
1111 uint32_t dlld:1;
1112 uint32_t reserved_26_30:5;
1113 uint32_t ack_nak:1;
1114 uint32_t fcd:1;
1115 uint32_t ilst:24;
1116 } s;
1117 struct cvmx_pciercx_cfg453_s cn52xx;
1118 struct cvmx_pciercx_cfg453_s cn52xxp1;
1119 struct cvmx_pciercx_cfg453_s cn56xx;
1120 struct cvmx_pciercx_cfg453_s cn56xxp1;
1121};
1122
1123union cvmx_pciercx_cfg454 {
1124 uint32_t u32;
1125 struct cvmx_pciercx_cfg454_s {
1126 uint32_t reserved_29_31:3;
1127 uint32_t tmfcwt:5;
1128 uint32_t tmanlt:5;
1129 uint32_t tmrt:5;
1130 uint32_t reserved_11_13:3;
1131 uint32_t nskps:3;
1132 uint32_t reserved_4_7:4;
1133 uint32_t ntss:4;
1134 } s;
1135 struct cvmx_pciercx_cfg454_s cn52xx;
1136 struct cvmx_pciercx_cfg454_s cn52xxp1;
1137 struct cvmx_pciercx_cfg454_s cn56xx;
1138 struct cvmx_pciercx_cfg454_s cn56xxp1;
1139};
1140
1141union cvmx_pciercx_cfg455 {
1142 uint32_t u32;
1143 struct cvmx_pciercx_cfg455_s {
1144 uint32_t m_cfg0_filt:1;
1145 uint32_t m_io_filt:1;
1146 uint32_t msg_ctrl:1;
1147 uint32_t m_cpl_ecrc_filt:1;
1148 uint32_t m_ecrc_filt:1;
1149 uint32_t m_cpl_len_err:1;
1150 uint32_t m_cpl_attr_err:1;
1151 uint32_t m_cpl_tc_err:1;
1152 uint32_t m_cpl_fun_err:1;
1153 uint32_t m_cpl_rid_err:1;
1154 uint32_t m_cpl_tag_err:1;
1155 uint32_t m_lk_filt:1;
1156 uint32_t m_cfg1_filt:1;
1157 uint32_t m_bar_match:1;
1158 uint32_t m_pois_filt:1;
1159 uint32_t m_fun:1;
1160 uint32_t dfcwt:1;
1161 uint32_t reserved_11_14:4;
1162 uint32_t skpiv:11;
1163 } s;
1164 struct cvmx_pciercx_cfg455_s cn52xx;
1165 struct cvmx_pciercx_cfg455_s cn52xxp1;
1166 struct cvmx_pciercx_cfg455_s cn56xx;
1167 struct cvmx_pciercx_cfg455_s cn56xxp1;
1168};
1169
1170union cvmx_pciercx_cfg456 {
1171 uint32_t u32;
1172 struct cvmx_pciercx_cfg456_s {
1173 uint32_t reserved_2_31:30;
1174 uint32_t m_vend1_drp:1;
1175 uint32_t m_vend0_drp:1;
1176 } s;
1177 struct cvmx_pciercx_cfg456_s cn52xx;
1178 struct cvmx_pciercx_cfg456_s cn52xxp1;
1179 struct cvmx_pciercx_cfg456_s cn56xx;
1180 struct cvmx_pciercx_cfg456_s cn56xxp1;
1181};
1182
1183union cvmx_pciercx_cfg458 {
1184 uint32_t u32;
1185 struct cvmx_pciercx_cfg458_s {
1186 uint32_t dbg_info_l32:32;
1187 } s;
1188 struct cvmx_pciercx_cfg458_s cn52xx;
1189 struct cvmx_pciercx_cfg458_s cn52xxp1;
1190 struct cvmx_pciercx_cfg458_s cn56xx;
1191 struct cvmx_pciercx_cfg458_s cn56xxp1;
1192};
1193
1194union cvmx_pciercx_cfg459 {
1195 uint32_t u32;
1196 struct cvmx_pciercx_cfg459_s {
1197 uint32_t dbg_info_u32:32;
1198 } s;
1199 struct cvmx_pciercx_cfg459_s cn52xx;
1200 struct cvmx_pciercx_cfg459_s cn52xxp1;
1201 struct cvmx_pciercx_cfg459_s cn56xx;
1202 struct cvmx_pciercx_cfg459_s cn56xxp1;
1203};
1204
1205union cvmx_pciercx_cfg460 {
1206 uint32_t u32;
1207 struct cvmx_pciercx_cfg460_s {
1208 uint32_t reserved_20_31:12;
1209 uint32_t tphfcc:8;
1210 uint32_t tpdfcc:12;
1211 } s;
1212 struct cvmx_pciercx_cfg460_s cn52xx;
1213 struct cvmx_pciercx_cfg460_s cn52xxp1;
1214 struct cvmx_pciercx_cfg460_s cn56xx;
1215 struct cvmx_pciercx_cfg460_s cn56xxp1;
1216};
1217
1218union cvmx_pciercx_cfg461 {
1219 uint32_t u32;
1220 struct cvmx_pciercx_cfg461_s {
1221 uint32_t reserved_20_31:12;
1222 uint32_t tchfcc:8;
1223 uint32_t tcdfcc:12;
1224 } s;
1225 struct cvmx_pciercx_cfg461_s cn52xx;
1226 struct cvmx_pciercx_cfg461_s cn52xxp1;
1227 struct cvmx_pciercx_cfg461_s cn56xx;
1228 struct cvmx_pciercx_cfg461_s cn56xxp1;
1229};
1230
1231union cvmx_pciercx_cfg462 {
1232 uint32_t u32;
1233 struct cvmx_pciercx_cfg462_s {
1234 uint32_t reserved_20_31:12;
1235 uint32_t tchfcc:8;
1236 uint32_t tcdfcc:12;
1237 } s;
1238 struct cvmx_pciercx_cfg462_s cn52xx;
1239 struct cvmx_pciercx_cfg462_s cn52xxp1;
1240 struct cvmx_pciercx_cfg462_s cn56xx;
1241 struct cvmx_pciercx_cfg462_s cn56xxp1;
1242};
1243
1244union cvmx_pciercx_cfg463 {
1245 uint32_t u32;
1246 struct cvmx_pciercx_cfg463_s {
1247 uint32_t reserved_3_31:29;
1248 uint32_t rqne:1;
1249 uint32_t trbne:1;
1250 uint32_t rtlpfccnr:1;
1251 } s;
1252 struct cvmx_pciercx_cfg463_s cn52xx;
1253 struct cvmx_pciercx_cfg463_s cn52xxp1;
1254 struct cvmx_pciercx_cfg463_s cn56xx;
1255 struct cvmx_pciercx_cfg463_s cn56xxp1;
1256};
1257
1258union cvmx_pciercx_cfg464 {
1259 uint32_t u32;
1260 struct cvmx_pciercx_cfg464_s {
1261 uint32_t wrr_vc3:8;
1262 uint32_t wrr_vc2:8;
1263 uint32_t wrr_vc1:8;
1264 uint32_t wrr_vc0:8;
1265 } s;
1266 struct cvmx_pciercx_cfg464_s cn52xx;
1267 struct cvmx_pciercx_cfg464_s cn52xxp1;
1268 struct cvmx_pciercx_cfg464_s cn56xx;
1269 struct cvmx_pciercx_cfg464_s cn56xxp1;
1270};
1271
1272union cvmx_pciercx_cfg465 {
1273 uint32_t u32;
1274 struct cvmx_pciercx_cfg465_s {
1275 uint32_t wrr_vc7:8;
1276 uint32_t wrr_vc6:8;
1277 uint32_t wrr_vc5:8;
1278 uint32_t wrr_vc4:8;
1279 } s;
1280 struct cvmx_pciercx_cfg465_s cn52xx;
1281 struct cvmx_pciercx_cfg465_s cn52xxp1;
1282 struct cvmx_pciercx_cfg465_s cn56xx;
1283 struct cvmx_pciercx_cfg465_s cn56xxp1;
1284};
1285
1286union cvmx_pciercx_cfg466 {
1287 uint32_t u32;
1288 struct cvmx_pciercx_cfg466_s {
1289 uint32_t rx_queue_order:1;
1290 uint32_t type_ordering:1;
1291 uint32_t reserved_24_29:6;
1292 uint32_t queue_mode:3;
1293 uint32_t reserved_20_20:1;
1294 uint32_t header_credits:8;
1295 uint32_t data_credits:12;
1296 } s;
1297 struct cvmx_pciercx_cfg466_s cn52xx;
1298 struct cvmx_pciercx_cfg466_s cn52xxp1;
1299 struct cvmx_pciercx_cfg466_s cn56xx;
1300 struct cvmx_pciercx_cfg466_s cn56xxp1;
1301};
1302
1303union cvmx_pciercx_cfg467 {
1304 uint32_t u32;
1305 struct cvmx_pciercx_cfg467_s {
1306 uint32_t reserved_24_31:8;
1307 uint32_t queue_mode:3;
1308 uint32_t reserved_20_20:1;
1309 uint32_t header_credits:8;
1310 uint32_t data_credits:12;
1311 } s;
1312 struct cvmx_pciercx_cfg467_s cn52xx;
1313 struct cvmx_pciercx_cfg467_s cn52xxp1;
1314 struct cvmx_pciercx_cfg467_s cn56xx;
1315 struct cvmx_pciercx_cfg467_s cn56xxp1;
1316};
1317
1318union cvmx_pciercx_cfg468 {
1319 uint32_t u32;
1320 struct cvmx_pciercx_cfg468_s {
1321 uint32_t reserved_24_31:8;
1322 uint32_t queue_mode:3;
1323 uint32_t reserved_20_20:1;
1324 uint32_t header_credits:8;
1325 uint32_t data_credits:12;
1326 } s;
1327 struct cvmx_pciercx_cfg468_s cn52xx;
1328 struct cvmx_pciercx_cfg468_s cn52xxp1;
1329 struct cvmx_pciercx_cfg468_s cn56xx;
1330 struct cvmx_pciercx_cfg468_s cn56xxp1;
1331};
1332
1333union cvmx_pciercx_cfg490 {
1334 uint32_t u32;
1335 struct cvmx_pciercx_cfg490_s {
1336 uint32_t reserved_26_31:6;
1337 uint32_t header_depth:10;
1338 uint32_t reserved_14_15:2;
1339 uint32_t data_depth:14;
1340 } s;
1341 struct cvmx_pciercx_cfg490_s cn52xx;
1342 struct cvmx_pciercx_cfg490_s cn52xxp1;
1343 struct cvmx_pciercx_cfg490_s cn56xx;
1344 struct cvmx_pciercx_cfg490_s cn56xxp1;
1345};
1346
1347union cvmx_pciercx_cfg491 {
1348 uint32_t u32;
1349 struct cvmx_pciercx_cfg491_s {
1350 uint32_t reserved_26_31:6;
1351 uint32_t header_depth:10;
1352 uint32_t reserved_14_15:2;
1353 uint32_t data_depth:14;
1354 } s;
1355 struct cvmx_pciercx_cfg491_s cn52xx;
1356 struct cvmx_pciercx_cfg491_s cn52xxp1;
1357 struct cvmx_pciercx_cfg491_s cn56xx;
1358 struct cvmx_pciercx_cfg491_s cn56xxp1;
1359};
1360
1361union cvmx_pciercx_cfg492 {
1362 uint32_t u32;
1363 struct cvmx_pciercx_cfg492_s {
1364 uint32_t reserved_26_31:6;
1365 uint32_t header_depth:10;
1366 uint32_t reserved_14_15:2;
1367 uint32_t data_depth:14;
1368 } s;
1369 struct cvmx_pciercx_cfg492_s cn52xx;
1370 struct cvmx_pciercx_cfg492_s cn52xxp1;
1371 struct cvmx_pciercx_cfg492_s cn56xx;
1372 struct cvmx_pciercx_cfg492_s cn56xxp1;
1373};
1374
1375union cvmx_pciercx_cfg516 {
1376 uint32_t u32;
1377 struct cvmx_pciercx_cfg516_s {
1378 uint32_t phy_stat:32;
1379 } s;
1380 struct cvmx_pciercx_cfg516_s cn52xx;
1381 struct cvmx_pciercx_cfg516_s cn52xxp1;
1382 struct cvmx_pciercx_cfg516_s cn56xx;
1383 struct cvmx_pciercx_cfg516_s cn56xxp1;
1384};
1385
1386union cvmx_pciercx_cfg517 {
1387 uint32_t u32;
1388 struct cvmx_pciercx_cfg517_s {
1389 uint32_t phy_ctrl:32;
1390 } s;
1391 struct cvmx_pciercx_cfg517_s cn52xx;
1392 struct cvmx_pciercx_cfg517_s cn52xxp1;
1393 struct cvmx_pciercx_cfg517_s cn56xx;
1394 struct cvmx_pciercx_cfg517_s cn56xxp1;
1395};
1396
1397#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-pescx-defs.h b/arch/mips/include/asm/octeon/cvmx-pescx-defs.h
new file mode 100644
index 000000000000..f40cfaf84454
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-pescx-defs.h
@@ -0,0 +1,410 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_PESCX_DEFS_H__
29#define __CVMX_PESCX_DEFS_H__
30
31#define CVMX_PESCX_BIST_STATUS(block_id) \
32 CVMX_ADD_IO_SEG(0x00011800C8000018ull + (((block_id) & 1) * 0x8000000ull))
33#define CVMX_PESCX_BIST_STATUS2(block_id) \
34 CVMX_ADD_IO_SEG(0x00011800C8000418ull + (((block_id) & 1) * 0x8000000ull))
35#define CVMX_PESCX_CFG_RD(block_id) \
36 CVMX_ADD_IO_SEG(0x00011800C8000030ull + (((block_id) & 1) * 0x8000000ull))
37#define CVMX_PESCX_CFG_WR(block_id) \
38 CVMX_ADD_IO_SEG(0x00011800C8000028ull + (((block_id) & 1) * 0x8000000ull))
39#define CVMX_PESCX_CPL_LUT_VALID(block_id) \
40 CVMX_ADD_IO_SEG(0x00011800C8000098ull + (((block_id) & 1) * 0x8000000ull))
41#define CVMX_PESCX_CTL_STATUS(block_id) \
42 CVMX_ADD_IO_SEG(0x00011800C8000000ull + (((block_id) & 1) * 0x8000000ull))
43#define CVMX_PESCX_CTL_STATUS2(block_id) \
44 CVMX_ADD_IO_SEG(0x00011800C8000400ull + (((block_id) & 1) * 0x8000000ull))
45#define CVMX_PESCX_DBG_INFO(block_id) \
46 CVMX_ADD_IO_SEG(0x00011800C8000008ull + (((block_id) & 1) * 0x8000000ull))
47#define CVMX_PESCX_DBG_INFO_EN(block_id) \
48 CVMX_ADD_IO_SEG(0x00011800C80000A0ull + (((block_id) & 1) * 0x8000000ull))
49#define CVMX_PESCX_DIAG_STATUS(block_id) \
50 CVMX_ADD_IO_SEG(0x00011800C8000020ull + (((block_id) & 1) * 0x8000000ull))
51#define CVMX_PESCX_P2N_BAR0_START(block_id) \
52 CVMX_ADD_IO_SEG(0x00011800C8000080ull + (((block_id) & 1) * 0x8000000ull))
53#define CVMX_PESCX_P2N_BAR1_START(block_id) \
54 CVMX_ADD_IO_SEG(0x00011800C8000088ull + (((block_id) & 1) * 0x8000000ull))
55#define CVMX_PESCX_P2N_BAR2_START(block_id) \
56 CVMX_ADD_IO_SEG(0x00011800C8000090ull + (((block_id) & 1) * 0x8000000ull))
57#define CVMX_PESCX_P2P_BARX_END(offset, block_id) \
58 CVMX_ADD_IO_SEG(0x00011800C8000048ull + (((offset) & 3) * 16) + (((block_id) & 1) * 0x8000000ull))
59#define CVMX_PESCX_P2P_BARX_START(offset, block_id) \
60 CVMX_ADD_IO_SEG(0x00011800C8000040ull + (((offset) & 3) * 16) + (((block_id) & 1) * 0x8000000ull))
61#define CVMX_PESCX_TLP_CREDITS(block_id) \
62 CVMX_ADD_IO_SEG(0x00011800C8000038ull + (((block_id) & 1) * 0x8000000ull))
63
64union cvmx_pescx_bist_status {
65 uint64_t u64;
66 struct cvmx_pescx_bist_status_s {
67 uint64_t reserved_13_63:51;
68 uint64_t rqdata5:1;
69 uint64_t ctlp_or:1;
70 uint64_t ntlp_or:1;
71 uint64_t ptlp_or:1;
72 uint64_t retry:1;
73 uint64_t rqdata0:1;
74 uint64_t rqdata1:1;
75 uint64_t rqdata2:1;
76 uint64_t rqdata3:1;
77 uint64_t rqdata4:1;
78 uint64_t rqhdr1:1;
79 uint64_t rqhdr0:1;
80 uint64_t sot:1;
81 } s;
82 struct cvmx_pescx_bist_status_s cn52xx;
83 struct cvmx_pescx_bist_status_cn52xxp1 {
84 uint64_t reserved_12_63:52;
85 uint64_t ctlp_or:1;
86 uint64_t ntlp_or:1;
87 uint64_t ptlp_or:1;
88 uint64_t retry:1;
89 uint64_t rqdata0:1;
90 uint64_t rqdata1:1;
91 uint64_t rqdata2:1;
92 uint64_t rqdata3:1;
93 uint64_t rqdata4:1;
94 uint64_t rqhdr1:1;
95 uint64_t rqhdr0:1;
96 uint64_t sot:1;
97 } cn52xxp1;
98 struct cvmx_pescx_bist_status_s cn56xx;
99 struct cvmx_pescx_bist_status_cn52xxp1 cn56xxp1;
100};
101
102union cvmx_pescx_bist_status2 {
103 uint64_t u64;
104 struct cvmx_pescx_bist_status2_s {
105 uint64_t reserved_14_63:50;
106 uint64_t cto_p2e:1;
107 uint64_t e2p_cpl:1;
108 uint64_t e2p_n:1;
109 uint64_t e2p_p:1;
110 uint64_t e2p_rsl:1;
111 uint64_t dbg_p2e:1;
112 uint64_t peai_p2e:1;
113 uint64_t rsl_p2e:1;
114 uint64_t pef_tpf1:1;
115 uint64_t pef_tpf0:1;
116 uint64_t pef_tnf:1;
117 uint64_t pef_tcf1:1;
118 uint64_t pef_tc0:1;
119 uint64_t ppf:1;
120 } s;
121 struct cvmx_pescx_bist_status2_s cn52xx;
122 struct cvmx_pescx_bist_status2_s cn52xxp1;
123 struct cvmx_pescx_bist_status2_s cn56xx;
124 struct cvmx_pescx_bist_status2_s cn56xxp1;
125};
126
127union cvmx_pescx_cfg_rd {
128 uint64_t u64;
129 struct cvmx_pescx_cfg_rd_s {
130 uint64_t data:32;
131 uint64_t addr:32;
132 } s;
133 struct cvmx_pescx_cfg_rd_s cn52xx;
134 struct cvmx_pescx_cfg_rd_s cn52xxp1;
135 struct cvmx_pescx_cfg_rd_s cn56xx;
136 struct cvmx_pescx_cfg_rd_s cn56xxp1;
137};
138
139union cvmx_pescx_cfg_wr {
140 uint64_t u64;
141 struct cvmx_pescx_cfg_wr_s {
142 uint64_t data:32;
143 uint64_t addr:32;
144 } s;
145 struct cvmx_pescx_cfg_wr_s cn52xx;
146 struct cvmx_pescx_cfg_wr_s cn52xxp1;
147 struct cvmx_pescx_cfg_wr_s cn56xx;
148 struct cvmx_pescx_cfg_wr_s cn56xxp1;
149};
150
151union cvmx_pescx_cpl_lut_valid {
152 uint64_t u64;
153 struct cvmx_pescx_cpl_lut_valid_s {
154 uint64_t reserved_32_63:32;
155 uint64_t tag:32;
156 } s;
157 struct cvmx_pescx_cpl_lut_valid_s cn52xx;
158 struct cvmx_pescx_cpl_lut_valid_s cn52xxp1;
159 struct cvmx_pescx_cpl_lut_valid_s cn56xx;
160 struct cvmx_pescx_cpl_lut_valid_s cn56xxp1;
161};
162
163union cvmx_pescx_ctl_status {
164 uint64_t u64;
165 struct cvmx_pescx_ctl_status_s {
166 uint64_t reserved_28_63:36;
167 uint64_t dnum:5;
168 uint64_t pbus:8;
169 uint64_t qlm_cfg:2;
170 uint64_t lane_swp:1;
171 uint64_t pm_xtoff:1;
172 uint64_t pm_xpme:1;
173 uint64_t ob_p_cmd:1;
174 uint64_t reserved_7_8:2;
175 uint64_t nf_ecrc:1;
176 uint64_t dly_one:1;
177 uint64_t lnk_enb:1;
178 uint64_t ro_ctlp:1;
179 uint64_t reserved_2_2:1;
180 uint64_t inv_ecrc:1;
181 uint64_t inv_lcrc:1;
182 } s;
183 struct cvmx_pescx_ctl_status_s cn52xx;
184 struct cvmx_pescx_ctl_status_s cn52xxp1;
185 struct cvmx_pescx_ctl_status_cn56xx {
186 uint64_t reserved_28_63:36;
187 uint64_t dnum:5;
188 uint64_t pbus:8;
189 uint64_t qlm_cfg:2;
190 uint64_t reserved_12_12:1;
191 uint64_t pm_xtoff:1;
192 uint64_t pm_xpme:1;
193 uint64_t ob_p_cmd:1;
194 uint64_t reserved_7_8:2;
195 uint64_t nf_ecrc:1;
196 uint64_t dly_one:1;
197 uint64_t lnk_enb:1;
198 uint64_t ro_ctlp:1;
199 uint64_t reserved_2_2:1;
200 uint64_t inv_ecrc:1;
201 uint64_t inv_lcrc:1;
202 } cn56xx;
203 struct cvmx_pescx_ctl_status_cn56xx cn56xxp1;
204};
205
206union cvmx_pescx_ctl_status2 {
207 uint64_t u64;
208 struct cvmx_pescx_ctl_status2_s {
209 uint64_t reserved_2_63:62;
210 uint64_t pclk_run:1;
211 uint64_t pcierst:1;
212 } s;
213 struct cvmx_pescx_ctl_status2_s cn52xx;
214 struct cvmx_pescx_ctl_status2_cn52xxp1 {
215 uint64_t reserved_1_63:63;
216 uint64_t pcierst:1;
217 } cn52xxp1;
218 struct cvmx_pescx_ctl_status2_s cn56xx;
219 struct cvmx_pescx_ctl_status2_cn52xxp1 cn56xxp1;
220};
221
222union cvmx_pescx_dbg_info {
223 uint64_t u64;
224 struct cvmx_pescx_dbg_info_s {
225 uint64_t reserved_31_63:33;
226 uint64_t ecrc_e:1;
227 uint64_t rawwpp:1;
228 uint64_t racpp:1;
229 uint64_t ramtlp:1;
230 uint64_t rarwdns:1;
231 uint64_t caar:1;
232 uint64_t racca:1;
233 uint64_t racur:1;
234 uint64_t rauc:1;
235 uint64_t rqo:1;
236 uint64_t fcuv:1;
237 uint64_t rpe:1;
238 uint64_t fcpvwt:1;
239 uint64_t dpeoosd:1;
240 uint64_t rtwdle:1;
241 uint64_t rdwdle:1;
242 uint64_t mre:1;
243 uint64_t rte:1;
244 uint64_t acto:1;
245 uint64_t rvdm:1;
246 uint64_t rumep:1;
247 uint64_t rptamrc:1;
248 uint64_t rpmerc:1;
249 uint64_t rfemrc:1;
250 uint64_t rnfemrc:1;
251 uint64_t rcemrc:1;
252 uint64_t rpoison:1;
253 uint64_t recrce:1;
254 uint64_t rtlplle:1;
255 uint64_t rtlpmal:1;
256 uint64_t spoison:1;
257 } s;
258 struct cvmx_pescx_dbg_info_s cn52xx;
259 struct cvmx_pescx_dbg_info_s cn52xxp1;
260 struct cvmx_pescx_dbg_info_s cn56xx;
261 struct cvmx_pescx_dbg_info_s cn56xxp1;
262};
263
264union cvmx_pescx_dbg_info_en {
265 uint64_t u64;
266 struct cvmx_pescx_dbg_info_en_s {
267 uint64_t reserved_31_63:33;
268 uint64_t ecrc_e:1;
269 uint64_t rawwpp:1;
270 uint64_t racpp:1;
271 uint64_t ramtlp:1;
272 uint64_t rarwdns:1;
273 uint64_t caar:1;
274 uint64_t racca:1;
275 uint64_t racur:1;
276 uint64_t rauc:1;
277 uint64_t rqo:1;
278 uint64_t fcuv:1;
279 uint64_t rpe:1;
280 uint64_t fcpvwt:1;
281 uint64_t dpeoosd:1;
282 uint64_t rtwdle:1;
283 uint64_t rdwdle:1;
284 uint64_t mre:1;
285 uint64_t rte:1;
286 uint64_t acto:1;
287 uint64_t rvdm:1;
288 uint64_t rumep:1;
289 uint64_t rptamrc:1;
290 uint64_t rpmerc:1;
291 uint64_t rfemrc:1;
292 uint64_t rnfemrc:1;
293 uint64_t rcemrc:1;
294 uint64_t rpoison:1;
295 uint64_t recrce:1;
296 uint64_t rtlplle:1;
297 uint64_t rtlpmal:1;
298 uint64_t spoison:1;
299 } s;
300 struct cvmx_pescx_dbg_info_en_s cn52xx;
301 struct cvmx_pescx_dbg_info_en_s cn52xxp1;
302 struct cvmx_pescx_dbg_info_en_s cn56xx;
303 struct cvmx_pescx_dbg_info_en_s cn56xxp1;
304};
305
306union cvmx_pescx_diag_status {
307 uint64_t u64;
308 struct cvmx_pescx_diag_status_s {
309 uint64_t reserved_4_63:60;
310 uint64_t pm_dst:1;
311 uint64_t pm_stat:1;
312 uint64_t pm_en:1;
313 uint64_t aux_en:1;
314 } s;
315 struct cvmx_pescx_diag_status_s cn52xx;
316 struct cvmx_pescx_diag_status_s cn52xxp1;
317 struct cvmx_pescx_diag_status_s cn56xx;
318 struct cvmx_pescx_diag_status_s cn56xxp1;
319};
320
321union cvmx_pescx_p2n_bar0_start {
322 uint64_t u64;
323 struct cvmx_pescx_p2n_bar0_start_s {
324 uint64_t addr:50;
325 uint64_t reserved_0_13:14;
326 } s;
327 struct cvmx_pescx_p2n_bar0_start_s cn52xx;
328 struct cvmx_pescx_p2n_bar0_start_s cn52xxp1;
329 struct cvmx_pescx_p2n_bar0_start_s cn56xx;
330 struct cvmx_pescx_p2n_bar0_start_s cn56xxp1;
331};
332
333union cvmx_pescx_p2n_bar1_start {
334 uint64_t u64;
335 struct cvmx_pescx_p2n_bar1_start_s {
336 uint64_t addr:38;
337 uint64_t reserved_0_25:26;
338 } s;
339 struct cvmx_pescx_p2n_bar1_start_s cn52xx;
340 struct cvmx_pescx_p2n_bar1_start_s cn52xxp1;
341 struct cvmx_pescx_p2n_bar1_start_s cn56xx;
342 struct cvmx_pescx_p2n_bar1_start_s cn56xxp1;
343};
344
345union cvmx_pescx_p2n_bar2_start {
346 uint64_t u64;
347 struct cvmx_pescx_p2n_bar2_start_s {
348 uint64_t addr:25;
349 uint64_t reserved_0_38:39;
350 } s;
351 struct cvmx_pescx_p2n_bar2_start_s cn52xx;
352 struct cvmx_pescx_p2n_bar2_start_s cn52xxp1;
353 struct cvmx_pescx_p2n_bar2_start_s cn56xx;
354 struct cvmx_pescx_p2n_bar2_start_s cn56xxp1;
355};
356
357union cvmx_pescx_p2p_barx_end {
358 uint64_t u64;
359 struct cvmx_pescx_p2p_barx_end_s {
360 uint64_t addr:52;
361 uint64_t reserved_0_11:12;
362 } s;
363 struct cvmx_pescx_p2p_barx_end_s cn52xx;
364 struct cvmx_pescx_p2p_barx_end_s cn52xxp1;
365 struct cvmx_pescx_p2p_barx_end_s cn56xx;
366 struct cvmx_pescx_p2p_barx_end_s cn56xxp1;
367};
368
369union cvmx_pescx_p2p_barx_start {
370 uint64_t u64;
371 struct cvmx_pescx_p2p_barx_start_s {
372 uint64_t addr:52;
373 uint64_t reserved_0_11:12;
374 } s;
375 struct cvmx_pescx_p2p_barx_start_s cn52xx;
376 struct cvmx_pescx_p2p_barx_start_s cn52xxp1;
377 struct cvmx_pescx_p2p_barx_start_s cn56xx;
378 struct cvmx_pescx_p2p_barx_start_s cn56xxp1;
379};
380
381union cvmx_pescx_tlp_credits {
382 uint64_t u64;
383 struct cvmx_pescx_tlp_credits_s {
384 uint64_t reserved_0_63:64;
385 } s;
386 struct cvmx_pescx_tlp_credits_cn52xx {
387 uint64_t reserved_56_63:8;
388 uint64_t peai_ppf:8;
389 uint64_t pesc_cpl:8;
390 uint64_t pesc_np:8;
391 uint64_t pesc_p:8;
392 uint64_t npei_cpl:8;
393 uint64_t npei_np:8;
394 uint64_t npei_p:8;
395 } cn52xx;
396 struct cvmx_pescx_tlp_credits_cn52xxp1 {
397 uint64_t reserved_38_63:26;
398 uint64_t peai_ppf:8;
399 uint64_t pesc_cpl:5;
400 uint64_t pesc_np:5;
401 uint64_t pesc_p:5;
402 uint64_t npei_cpl:5;
403 uint64_t npei_np:5;
404 uint64_t npei_p:5;
405 } cn52xxp1;
406 struct cvmx_pescx_tlp_credits_cn52xx cn56xx;
407 struct cvmx_pescx_tlp_credits_cn52xxp1 cn56xxp1;
408};
409
410#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-pexp-defs.h b/arch/mips/include/asm/octeon/cvmx-pexp-defs.h
new file mode 100644
index 000000000000..5ea5dc571b54
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-pexp-defs.h
@@ -0,0 +1,229 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/**
29 * cvmx-pexp-defs.h
30 *
31 * Configuration and status register (CSR) definitions for
32 * OCTEON PEXP.
33 *
34 */
35#ifndef __CVMX_PEXP_DEFS_H__
36#define __CVMX_PEXP_DEFS_H__
37
38#define CVMX_PEXP_NPEI_BAR1_INDEXX(offset) \
39 CVMX_ADD_IO_SEG(0x00011F0000008000ull + (((offset) & 31) * 16))
40#define CVMX_PEXP_NPEI_BIST_STATUS \
41 CVMX_ADD_IO_SEG(0x00011F0000008580ull)
42#define CVMX_PEXP_NPEI_BIST_STATUS2 \
43 CVMX_ADD_IO_SEG(0x00011F0000008680ull)
44#define CVMX_PEXP_NPEI_CTL_PORT0 \
45 CVMX_ADD_IO_SEG(0x00011F0000008250ull)
46#define CVMX_PEXP_NPEI_CTL_PORT1 \
47 CVMX_ADD_IO_SEG(0x00011F0000008260ull)
48#define CVMX_PEXP_NPEI_CTL_STATUS \
49 CVMX_ADD_IO_SEG(0x00011F0000008570ull)
50#define CVMX_PEXP_NPEI_CTL_STATUS2 \
51 CVMX_ADD_IO_SEG(0x00011F000000BC00ull)
52#define CVMX_PEXP_NPEI_DATA_OUT_CNT \
53 CVMX_ADD_IO_SEG(0x00011F00000085F0ull)
54#define CVMX_PEXP_NPEI_DBG_DATA \
55 CVMX_ADD_IO_SEG(0x00011F0000008510ull)
56#define CVMX_PEXP_NPEI_DBG_SELECT \
57 CVMX_ADD_IO_SEG(0x00011F0000008500ull)
58#define CVMX_PEXP_NPEI_DMA0_INT_LEVEL \
59 CVMX_ADD_IO_SEG(0x00011F00000085C0ull)
60#define CVMX_PEXP_NPEI_DMA1_INT_LEVEL \
61 CVMX_ADD_IO_SEG(0x00011F00000085D0ull)
62#define CVMX_PEXP_NPEI_DMAX_COUNTS(offset) \
63 CVMX_ADD_IO_SEG(0x00011F0000008450ull + (((offset) & 7) * 16))
64#define CVMX_PEXP_NPEI_DMAX_DBELL(offset) \
65 CVMX_ADD_IO_SEG(0x00011F00000083B0ull + (((offset) & 7) * 16))
66#define CVMX_PEXP_NPEI_DMAX_IBUFF_SADDR(offset) \
67 CVMX_ADD_IO_SEG(0x00011F0000008400ull + (((offset) & 7) * 16))
68#define CVMX_PEXP_NPEI_DMAX_NADDR(offset) \
69 CVMX_ADD_IO_SEG(0x00011F00000084A0ull + (((offset) & 7) * 16))
70#define CVMX_PEXP_NPEI_DMA_CNTS \
71 CVMX_ADD_IO_SEG(0x00011F00000085E0ull)
72#define CVMX_PEXP_NPEI_DMA_CONTROL \
73 CVMX_ADD_IO_SEG(0x00011F00000083A0ull)
74#define CVMX_PEXP_NPEI_INT_A_ENB \
75 CVMX_ADD_IO_SEG(0x00011F0000008560ull)
76#define CVMX_PEXP_NPEI_INT_A_ENB2 \
77 CVMX_ADD_IO_SEG(0x00011F000000BCE0ull)
78#define CVMX_PEXP_NPEI_INT_A_SUM \
79 CVMX_ADD_IO_SEG(0x00011F0000008550ull)
80#define CVMX_PEXP_NPEI_INT_ENB \
81 CVMX_ADD_IO_SEG(0x00011F0000008540ull)
82#define CVMX_PEXP_NPEI_INT_ENB2 \
83 CVMX_ADD_IO_SEG(0x00011F000000BCD0ull)
84#define CVMX_PEXP_NPEI_INT_INFO \
85 CVMX_ADD_IO_SEG(0x00011F0000008590ull)
86#define CVMX_PEXP_NPEI_INT_SUM \
87 CVMX_ADD_IO_SEG(0x00011F0000008530ull)
88#define CVMX_PEXP_NPEI_INT_SUM2 \
89 CVMX_ADD_IO_SEG(0x00011F000000BCC0ull)
90#define CVMX_PEXP_NPEI_LAST_WIN_RDATA0 \
91 CVMX_ADD_IO_SEG(0x00011F0000008600ull)
92#define CVMX_PEXP_NPEI_LAST_WIN_RDATA1 \
93 CVMX_ADD_IO_SEG(0x00011F0000008610ull)
94#define CVMX_PEXP_NPEI_MEM_ACCESS_CTL \
95 CVMX_ADD_IO_SEG(0x00011F00000084F0ull)
96#define CVMX_PEXP_NPEI_MEM_ACCESS_SUBIDX(offset) \
97 CVMX_ADD_IO_SEG(0x00011F0000008280ull + (((offset) & 31) * 16) - 16 * 12)
98#define CVMX_PEXP_NPEI_MSI_ENB0 \
99 CVMX_ADD_IO_SEG(0x00011F000000BC50ull)
100#define CVMX_PEXP_NPEI_MSI_ENB1 \
101 CVMX_ADD_IO_SEG(0x00011F000000BC60ull)
102#define CVMX_PEXP_NPEI_MSI_ENB2 \
103 CVMX_ADD_IO_SEG(0x00011F000000BC70ull)
104#define CVMX_PEXP_NPEI_MSI_ENB3 \
105 CVMX_ADD_IO_SEG(0x00011F000000BC80ull)
106#define CVMX_PEXP_NPEI_MSI_RCV0 \
107 CVMX_ADD_IO_SEG(0x00011F000000BC10ull)
108#define CVMX_PEXP_NPEI_MSI_RCV1 \
109 CVMX_ADD_IO_SEG(0x00011F000000BC20ull)
110#define CVMX_PEXP_NPEI_MSI_RCV2 \
111 CVMX_ADD_IO_SEG(0x00011F000000BC30ull)
112#define CVMX_PEXP_NPEI_MSI_RCV3 \
113 CVMX_ADD_IO_SEG(0x00011F000000BC40ull)
114#define CVMX_PEXP_NPEI_MSI_RD_MAP \
115 CVMX_ADD_IO_SEG(0x00011F000000BCA0ull)
116#define CVMX_PEXP_NPEI_MSI_W1C_ENB0 \
117 CVMX_ADD_IO_SEG(0x00011F000000BCF0ull)
118#define CVMX_PEXP_NPEI_MSI_W1C_ENB1 \
119 CVMX_ADD_IO_SEG(0x00011F000000BD00ull)
120#define CVMX_PEXP_NPEI_MSI_W1C_ENB2 \
121 CVMX_ADD_IO_SEG(0x00011F000000BD10ull)
122#define CVMX_PEXP_NPEI_MSI_W1C_ENB3 \
123 CVMX_ADD_IO_SEG(0x00011F000000BD20ull)
124#define CVMX_PEXP_NPEI_MSI_W1S_ENB0 \
125 CVMX_ADD_IO_SEG(0x00011F000000BD30ull)
126#define CVMX_PEXP_NPEI_MSI_W1S_ENB1 \
127 CVMX_ADD_IO_SEG(0x00011F000000BD40ull)
128#define CVMX_PEXP_NPEI_MSI_W1S_ENB2 \
129 CVMX_ADD_IO_SEG(0x00011F000000BD50ull)
130#define CVMX_PEXP_NPEI_MSI_W1S_ENB3 \
131 CVMX_ADD_IO_SEG(0x00011F000000BD60ull)
132#define CVMX_PEXP_NPEI_MSI_WR_MAP \
133 CVMX_ADD_IO_SEG(0x00011F000000BC90ull)
134#define CVMX_PEXP_NPEI_PCIE_CREDIT_CNT \
135 CVMX_ADD_IO_SEG(0x00011F000000BD70ull)
136#define CVMX_PEXP_NPEI_PCIE_MSI_RCV \
137 CVMX_ADD_IO_SEG(0x00011F000000BCB0ull)
138#define CVMX_PEXP_NPEI_PCIE_MSI_RCV_B1 \
139 CVMX_ADD_IO_SEG(0x00011F0000008650ull)
140#define CVMX_PEXP_NPEI_PCIE_MSI_RCV_B2 \
141 CVMX_ADD_IO_SEG(0x00011F0000008660ull)
142#define CVMX_PEXP_NPEI_PCIE_MSI_RCV_B3 \
143 CVMX_ADD_IO_SEG(0x00011F0000008670ull)
144#define CVMX_PEXP_NPEI_PKTX_CNTS(offset) \
145 CVMX_ADD_IO_SEG(0x00011F000000A400ull + (((offset) & 31) * 16))
146#define CVMX_PEXP_NPEI_PKTX_INSTR_BADDR(offset) \
147 CVMX_ADD_IO_SEG(0x00011F000000A800ull + (((offset) & 31) * 16))
148#define CVMX_PEXP_NPEI_PKTX_INSTR_BAOFF_DBELL(offset) \
149 CVMX_ADD_IO_SEG(0x00011F000000AC00ull + (((offset) & 31) * 16))
150#define CVMX_PEXP_NPEI_PKTX_INSTR_FIFO_RSIZE(offset) \
151 CVMX_ADD_IO_SEG(0x00011F000000B000ull + (((offset) & 31) * 16))
152#define CVMX_PEXP_NPEI_PKTX_INSTR_HEADER(offset) \
153 CVMX_ADD_IO_SEG(0x00011F000000B400ull + (((offset) & 31) * 16))
154#define CVMX_PEXP_NPEI_PKTX_IN_BP(offset) \
155 CVMX_ADD_IO_SEG(0x00011F000000B800ull + (((offset) & 31) * 16))
156#define CVMX_PEXP_NPEI_PKTX_SLIST_BADDR(offset) \
157 CVMX_ADD_IO_SEG(0x00011F0000009400ull + (((offset) & 31) * 16))
158#define CVMX_PEXP_NPEI_PKTX_SLIST_BAOFF_DBELL(offset) \
159 CVMX_ADD_IO_SEG(0x00011F0000009800ull + (((offset) & 31) * 16))
160#define CVMX_PEXP_NPEI_PKTX_SLIST_FIFO_RSIZE(offset) \
161 CVMX_ADD_IO_SEG(0x00011F0000009C00ull + (((offset) & 31) * 16))
162#define CVMX_PEXP_NPEI_PKT_CNT_INT \
163 CVMX_ADD_IO_SEG(0x00011F0000009110ull)
164#define CVMX_PEXP_NPEI_PKT_CNT_INT_ENB \
165 CVMX_ADD_IO_SEG(0x00011F0000009130ull)
166#define CVMX_PEXP_NPEI_PKT_DATA_OUT_ES \
167 CVMX_ADD_IO_SEG(0x00011F00000090B0ull)
168#define CVMX_PEXP_NPEI_PKT_DATA_OUT_NS \
169 CVMX_ADD_IO_SEG(0x00011F00000090A0ull)
170#define CVMX_PEXP_NPEI_PKT_DATA_OUT_ROR \
171 CVMX_ADD_IO_SEG(0x00011F0000009090ull)
172#define CVMX_PEXP_NPEI_PKT_DPADDR \
173 CVMX_ADD_IO_SEG(0x00011F0000009080ull)
174#define CVMX_PEXP_NPEI_PKT_INPUT_CONTROL \
175 CVMX_ADD_IO_SEG(0x00011F0000009150ull)
176#define CVMX_PEXP_NPEI_PKT_INSTR_ENB \
177 CVMX_ADD_IO_SEG(0x00011F0000009000ull)
178#define CVMX_PEXP_NPEI_PKT_INSTR_RD_SIZE \
179 CVMX_ADD_IO_SEG(0x00011F0000009190ull)
180#define CVMX_PEXP_NPEI_PKT_INSTR_SIZE \
181 CVMX_ADD_IO_SEG(0x00011F0000009020ull)
182#define CVMX_PEXP_NPEI_PKT_INT_LEVELS \
183 CVMX_ADD_IO_SEG(0x00011F0000009100ull)
184#define CVMX_PEXP_NPEI_PKT_IN_BP \
185 CVMX_ADD_IO_SEG(0x00011F00000086B0ull)
186#define CVMX_PEXP_NPEI_PKT_IN_DONEX_CNTS(offset) \
187 CVMX_ADD_IO_SEG(0x00011F000000A000ull + (((offset) & 31) * 16))
188#define CVMX_PEXP_NPEI_PKT_IN_INSTR_COUNTS \
189 CVMX_ADD_IO_SEG(0x00011F00000086A0ull)
190#define CVMX_PEXP_NPEI_PKT_IN_PCIE_PORT \
191 CVMX_ADD_IO_SEG(0x00011F00000091A0ull)
192#define CVMX_PEXP_NPEI_PKT_IPTR \
193 CVMX_ADD_IO_SEG(0x00011F0000009070ull)
194#define CVMX_PEXP_NPEI_PKT_OUTPUT_WMARK \
195 CVMX_ADD_IO_SEG(0x00011F0000009160ull)
196#define CVMX_PEXP_NPEI_PKT_OUT_BMODE \
197 CVMX_ADD_IO_SEG(0x00011F00000090D0ull)
198#define CVMX_PEXP_NPEI_PKT_OUT_ENB \
199 CVMX_ADD_IO_SEG(0x00011F0000009010ull)
200#define CVMX_PEXP_NPEI_PKT_PCIE_PORT \
201 CVMX_ADD_IO_SEG(0x00011F00000090E0ull)
202#define CVMX_PEXP_NPEI_PKT_PORT_IN_RST \
203 CVMX_ADD_IO_SEG(0x00011F0000008690ull)
204#define CVMX_PEXP_NPEI_PKT_SLIST_ES \
205 CVMX_ADD_IO_SEG(0x00011F0000009050ull)
206#define CVMX_PEXP_NPEI_PKT_SLIST_ID_SIZE \
207 CVMX_ADD_IO_SEG(0x00011F0000009180ull)
208#define CVMX_PEXP_NPEI_PKT_SLIST_NS \
209 CVMX_ADD_IO_SEG(0x00011F0000009040ull)
210#define CVMX_PEXP_NPEI_PKT_SLIST_ROR \
211 CVMX_ADD_IO_SEG(0x00011F0000009030ull)
212#define CVMX_PEXP_NPEI_PKT_TIME_INT \
213 CVMX_ADD_IO_SEG(0x00011F0000009120ull)
214#define CVMX_PEXP_NPEI_PKT_TIME_INT_ENB \
215 CVMX_ADD_IO_SEG(0x00011F0000009140ull)
216#define CVMX_PEXP_NPEI_RSL_INT_BLOCKS \
217 CVMX_ADD_IO_SEG(0x00011F0000008520ull)
218#define CVMX_PEXP_NPEI_SCRATCH_1 \
219 CVMX_ADD_IO_SEG(0x00011F0000008270ull)
220#define CVMX_PEXP_NPEI_STATE1 \
221 CVMX_ADD_IO_SEG(0x00011F0000008620ull)
222#define CVMX_PEXP_NPEI_STATE2 \
223 CVMX_ADD_IO_SEG(0x00011F0000008630ull)
224#define CVMX_PEXP_NPEI_STATE3 \
225 CVMX_ADD_IO_SEG(0x00011F0000008640ull)
226#define CVMX_PEXP_NPEI_WINDOW_CTL \
227 CVMX_ADD_IO_SEG(0x00011F0000008380ull)
228
229#endif
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h
index 03fddfa3e928..e31e3fe14f8a 100644
--- a/arch/mips/include/asm/octeon/cvmx.h
+++ b/arch/mips/include/asm/octeon/cvmx.h
@@ -376,6 +376,18 @@ static inline uint64_t cvmx_get_cycle(void)
376} 376}
377 377
378/** 378/**
379 * Wait for the specified number of cycle
380 *
381 */
382static inline void cvmx_wait(uint64_t cycles)
383{
384 uint64_t done = cvmx_get_cycle() + cycles;
385
386 while (cvmx_get_cycle() < done)
387 ; /* Spin */
388}
389
390/**
379 * Reads a chip global cycle counter. This counts CPU cycles since 391 * Reads a chip global cycle counter. This counts CPU cycles since
380 * chip reset. The counter is 64 bit. 392 * chip reset. The counter is 64 bit.
381 * This register does not exist on CN38XX pass 1 silicion 393 * This register does not exist on CN38XX pass 1 silicion
diff --git a/arch/mips/include/asm/octeon/octeon-feature.h b/arch/mips/include/asm/octeon/octeon-feature.h
index 04fac684069c..ef24a7b4ea57 100644
--- a/arch/mips/include/asm/octeon/octeon-feature.h
+++ b/arch/mips/include/asm/octeon/octeon-feature.h
@@ -57,6 +57,13 @@ enum octeon_feature {
57 OCTEON_FEATURE_RAID, 57 OCTEON_FEATURE_RAID,
58 /* Octeon has a builtin USB */ 58 /* Octeon has a builtin USB */
59 OCTEON_FEATURE_USB, 59 OCTEON_FEATURE_USB,
60 /* Octeon IPD can run without using work queue entries */
61 OCTEON_FEATURE_NO_WPTR,
62 /* Octeon has DFA state machines */
63 OCTEON_FEATURE_DFA,
64 /* Octeon MDIO block supports clause 45 transactions for 10
65 * Gig support */
66 OCTEON_FEATURE_MDIO_CLAUSE_45,
60}; 67};
61 68
62static inline int cvmx_fuse_read(int fuse); 69static inline int cvmx_fuse_read(int fuse);
@@ -112,6 +119,26 @@ static inline int octeon_has_feature(enum octeon_feature feature)
112 case OCTEON_FEATURE_USB: 119 case OCTEON_FEATURE_USB:
113 return !(OCTEON_IS_MODEL(OCTEON_CN38XX) 120 return !(OCTEON_IS_MODEL(OCTEON_CN38XX)
114 || OCTEON_IS_MODEL(OCTEON_CN58XX)); 121 || OCTEON_IS_MODEL(OCTEON_CN58XX));
122 case OCTEON_FEATURE_NO_WPTR:
123 return (OCTEON_IS_MODEL(OCTEON_CN56XX)
124 || OCTEON_IS_MODEL(OCTEON_CN52XX))
125 && !OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X)
126 && !OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_X);
127 case OCTEON_FEATURE_DFA:
128 if (!OCTEON_IS_MODEL(OCTEON_CN38XX)
129 && !OCTEON_IS_MODEL(OCTEON_CN31XX)
130 && !OCTEON_IS_MODEL(OCTEON_CN58XX))
131 return 0;
132 else if (OCTEON_IS_MODEL(OCTEON_CN3020))
133 return 0;
134 else if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1))
135 return 1;
136 else
137 return !cvmx_fuse_read(120);
138 case OCTEON_FEATURE_MDIO_CLAUSE_45:
139 return !(OCTEON_IS_MODEL(OCTEON_CN3XXX)
140 || OCTEON_IS_MODEL(OCTEON_CN58XX)
141 || OCTEON_IS_MODEL(OCTEON_CN50XX));
115 } 142 }
116 return 0; 143 return 0;
117} 144}
diff --git a/arch/mips/include/asm/octeon/octeon.h b/arch/mips/include/asm/octeon/octeon.h
index edc676084cda..cac9b1a206fc 100644
--- a/arch/mips/include/asm/octeon/octeon.h
+++ b/arch/mips/include/asm/octeon/octeon.h
@@ -245,4 +245,6 @@ static inline uint32_t octeon_npi_read32(uint64_t address)
245 return cvmx_read64_uint32(address ^ 4); 245 return cvmx_read64_uint32(address ^ 4);
246} 246}
247 247
248extern struct cvmx_bootinfo *octeon_bootinfo;
249
248#endif /* __ASM_OCTEON_OCTEON_H */ 250#endif /* __ASM_OCTEON_OCTEON_H */
diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h
index 72c80d2034c2..dc0eaa731281 100644
--- a/arch/mips/include/asm/page.h
+++ b/arch/mips/include/asm/page.h
@@ -32,6 +32,11 @@
32#define PAGE_SIZE (1UL << PAGE_SHIFT) 32#define PAGE_SIZE (1UL << PAGE_SHIFT)
33#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1)) 33#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
34 34
35#define HPAGE_SHIFT (PAGE_SHIFT + PAGE_SHIFT - 3)
36#define HPAGE_SIZE ((1UL) << HPAGE_SHIFT)
37#define HPAGE_MASK (~(HPAGE_SIZE - 1))
38#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
39
35#ifndef __ASSEMBLY__ 40#ifndef __ASSEMBLY__
36 41
37#include <linux/pfn.h> 42#include <linux/pfn.h>
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index 51b34a48c84a..1073e6df8621 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -72,6 +72,7 @@
72#else 72#else
73 73
74#define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */ 74#define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */
75#define _PAGE_HUGE (1<<5) /* huge tlb page */
75#define _PAGE_GLOBAL (1<<6) 76#define _PAGE_GLOBAL (1<<6)
76#define _PAGE_VALID (1<<7) 77#define _PAGE_VALID (1<<7)
77#define _PAGE_SILENT_READ (1<<7) /* synonym */ 78#define _PAGE_SILENT_READ (1<<7) /* synonym */
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index 6a0edf72ffbc..1a9f9b257551 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -292,6 +292,16 @@ static inline pte_t pte_mkyoung(pte_t pte)
292 pte_val(pte) |= _PAGE_SILENT_READ; 292 pte_val(pte) |= _PAGE_SILENT_READ;
293 return pte; 293 return pte;
294} 294}
295
296#ifdef _PAGE_HUGE
297static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_HUGE; }
298
299static inline pte_t pte_mkhuge(pte_t pte)
300{
301 pte_val(pte) |= _PAGE_HUGE;
302 return pte;
303}
304#endif /* _PAGE_HUGE */
295#endif 305#endif
296static inline int pte_special(pte_t pte) { return 0; } 306static inline int pte_special(pte_t pte) { return 0; }
297static inline pte_t pte_mkspecial(pte_t pte) { return pte; } 307static inline pte_t pte_mkspecial(pte_t pte) { return pte; }
diff --git a/arch/mips/include/asm/r4kcache.h b/arch/mips/include/asm/r4kcache.h
index 4c140db36786..387bf59f1e37 100644
--- a/arch/mips/include/asm/r4kcache.h
+++ b/arch/mips/include/asm/r4kcache.h
@@ -399,6 +399,7 @@ __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16)
399__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32) 399__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32)
400__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32) 400__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32)
401__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32) 401__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32)
402__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64)
402__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64) 403__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
403__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64) 404__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64)
404__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128) 405__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128)
diff --git a/arch/mips/include/asm/suspend.h b/arch/mips/include/asm/suspend.h
new file mode 100644
index 000000000000..294cdb66c5fc
--- /dev/null
+++ b/arch/mips/include/asm/suspend.h
@@ -0,0 +1,9 @@
1#ifndef __ASM_SUSPEND_H
2#define __ASM_SUSPEND_H
3
4static inline int arch_prepare_suspend(void) { return 0; }
5
6/* References to section boundaries */
7extern const void __nosave_begin, __nosave_end;
8
9#endif /* __ASM_SUSPEND_H */
diff --git a/arch/mips/include/asm/txx9/dmac.h b/arch/mips/include/asm/txx9/dmac.h
new file mode 100644
index 000000000000..5e9151fccbb4
--- /dev/null
+++ b/arch/mips/include/asm/txx9/dmac.h
@@ -0,0 +1,51 @@
1/*
2 * TXx9 SoC DMA Controller
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __ASM_TXX9_DMAC_H
10#define __ASM_TXX9_DMAC_H
11
12#include <linux/dmaengine.h>
13
14#define TXX9_DMA_MAX_NR_CHANNELS 4
15
16/**
17 * struct txx9dmac_platform_data - Controller configuration parameters
18 * @memcpy_chan: Channel used for DMA_MEMCPY
19 * @have_64bit_regs: DMAC have 64 bit registers
20 */
21struct txx9dmac_platform_data {
22 int memcpy_chan;
23 bool have_64bit_regs;
24};
25
26/**
27 * struct txx9dmac_chan_platform_data - Channel configuration parameters
28 * @dmac_dev: A platform device for DMAC
29 */
30struct txx9dmac_chan_platform_data {
31 struct platform_device *dmac_dev;
32};
33
34/**
35 * struct txx9dmac_slave - Controller-specific information about a slave
36 * @tx_reg: physical address of data register used for
37 * memory-to-peripheral transfers
38 * @rx_reg: physical address of data register used for
39 * peripheral-to-memory transfers
40 * @reg_width: peripheral register width
41 */
42struct txx9dmac_slave {
43 u64 tx_reg;
44 u64 rx_reg;
45 unsigned int reg_width;
46};
47
48void txx9_dmac_init(int id, unsigned long baseaddr, int irq,
49 const struct txx9dmac_platform_data *pdata);
50
51#endif /* __ASM_TXX9_DMAC_H */
diff --git a/arch/mips/include/asm/txx9/generic.h b/arch/mips/include/asm/txx9/generic.h
index 9cde0090cbf6..827dc22be2ea 100644
--- a/arch/mips/include/asm/txx9/generic.h
+++ b/arch/mips/include/asm/txx9/generic.h
@@ -91,4 +91,10 @@ void txx9_7segled_init(unsigned int num,
91 void (*putc)(unsigned int pos, unsigned char val)); 91 void (*putc)(unsigned int pos, unsigned char val));
92int txx9_7segled_putc(unsigned int pos, char c); 92int txx9_7segled_putc(unsigned int pos, char c);
93 93
94void __init txx9_aclc_init(unsigned long baseaddr, int irq,
95 unsigned int dmac_id,
96 unsigned int dma_chan_out,
97 unsigned int dma_chan_in);
98void __init txx9_sramc_init(struct resource *r);
99
94#endif /* __ASM_TXX9_GENERIC_H */ 100#endif /* __ASM_TXX9_GENERIC_H */
diff --git a/arch/mips/include/asm/txx9/tx4927.h b/arch/mips/include/asm/txx9/tx4927.h
index 7d813f1cb98d..18c98c52afdb 100644
--- a/arch/mips/include/asm/txx9/tx4927.h
+++ b/arch/mips/include/asm/txx9/tx4927.h
@@ -41,6 +41,7 @@
41 41
42#define TX4927_SDRAMC_REG (TX4927_REG_BASE + 0x8000) 42#define TX4927_SDRAMC_REG (TX4927_REG_BASE + 0x8000)
43#define TX4927_EBUSC_REG (TX4927_REG_BASE + 0x9000) 43#define TX4927_EBUSC_REG (TX4927_REG_BASE + 0x9000)
44#define TX4927_DMA_REG (TX4927_REG_BASE + 0xb000)
44#define TX4927_PCIC_REG (TX4927_REG_BASE + 0xd000) 45#define TX4927_PCIC_REG (TX4927_REG_BASE + 0xd000)
45#define TX4927_CCFG_REG (TX4927_REG_BASE + 0xe000) 46#define TX4927_CCFG_REG (TX4927_REG_BASE + 0xe000)
46#define TX4927_IRC_REG (TX4927_REG_BASE + 0xf600) 47#define TX4927_IRC_REG (TX4927_REG_BASE + 0xf600)
@@ -49,6 +50,7 @@
49#define TX4927_NR_SIO 2 50#define TX4927_NR_SIO 2
50#define TX4927_SIO_REG(ch) (TX4927_REG_BASE + 0xf300 + (ch) * 0x100) 51#define TX4927_SIO_REG(ch) (TX4927_REG_BASE + 0xf300 + (ch) * 0x100)
51#define TX4927_PIO_REG (TX4927_REG_BASE + 0xf500) 52#define TX4927_PIO_REG (TX4927_REG_BASE + 0xf500)
53#define TX4927_ACLC_REG (TX4927_REG_BASE + 0xf700)
52 54
53#define TX4927_IR_ECCERR 0 55#define TX4927_IR_ECCERR 0
54#define TX4927_IR_WTOERR 1 56#define TX4927_IR_WTOERR 1
@@ -265,5 +267,7 @@ int tx4927_pciclk66_setup(void);
265void tx4927_setup_pcierr_irq(void); 267void tx4927_setup_pcierr_irq(void);
266void tx4927_irq_init(void); 268void tx4927_irq_init(void);
267void tx4927_mtd_init(int ch); 269void tx4927_mtd_init(int ch);
270void tx4927_dmac_init(int memcpy_chan);
271void tx4927_aclc_init(unsigned int dma_chan_out, unsigned int dma_chan_in);
268 272
269#endif /* __ASM_TXX9_TX4927_H */ 273#endif /* __ASM_TXX9_TX4927_H */
diff --git a/arch/mips/include/asm/txx9/tx4938.h b/arch/mips/include/asm/txx9/tx4938.h
index cd8bc2021755..8a178f186f7d 100644
--- a/arch/mips/include/asm/txx9/tx4938.h
+++ b/arch/mips/include/asm/txx9/tx4938.h
@@ -305,5 +305,8 @@ struct tx4938ide_platform_info {
305}; 305};
306 306
307void tx4938_ata_init(unsigned int irq, unsigned int shift, int tune); 307void tx4938_ata_init(unsigned int irq, unsigned int shift, int tune);
308void tx4938_dmac_init(int memcpy_chan0, int memcpy_chan1);
309void tx4938_aclc_init(void);
310void tx4938_sramc_init(void);
308 311
309#endif 312#endif
diff --git a/arch/mips/include/asm/txx9/tx4939.h b/arch/mips/include/asm/txx9/tx4939.h
index f02c50b3abfb..d4f342cd5939 100644
--- a/arch/mips/include/asm/txx9/tx4939.h
+++ b/arch/mips/include/asm/txx9/tx4939.h
@@ -45,6 +45,8 @@
45#define TX4939_RTC_REG (TX4939_REG_BASE + 0xfb00) 45#define TX4939_RTC_REG (TX4939_REG_BASE + 0xfb00)
46#define TX4939_CIR_REG (TX4939_REG_BASE + 0xfc00) 46#define TX4939_CIR_REG (TX4939_REG_BASE + 0xfc00)
47 47
48#define TX4939_RNG_REG (TX4939_CRYPTO_REG + 0xb0)
49
48struct tx4939_le_reg { 50struct tx4939_le_reg {
49 __u32 r; 51 __u32 r;
50 __u32 unused; 52 __u32 unused;
@@ -544,5 +546,9 @@ void tx4939_ata_init(void);
544void tx4939_rtc_init(void); 546void tx4939_rtc_init(void);
545void tx4939_ndfmc_init(unsigned int hold, unsigned int spw, 547void tx4939_ndfmc_init(unsigned int hold, unsigned int spw,
546 unsigned char ch_mask, unsigned char wide_mask); 548 unsigned char ch_mask, unsigned char wide_mask);
549void tx4939_dmac_init(int memcpy_chan0, int memcpy_chan1);
550void tx4939_aclc_init(void);
551void tx4939_sramc_init(void);
552void tx4939_rng_init(void);
547 553
548#endif /* __ASM_TXX9_TX4939_H */ 554#endif /* __ASM_TXX9_TX4939_H */
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index c901c22d7ad0..8d006ec65677 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -14,6 +14,7 @@
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/kbuild.h> 16#include <linux/kbuild.h>
17#include <linux/suspend.h>
17#include <asm/ptrace.h> 18#include <asm/ptrace.h>
18#include <asm/processor.h> 19#include <asm/processor.h>
19 20
@@ -326,3 +327,15 @@ void output_octeon_cop2_state_defines(void)
326 BLANK(); 327 BLANK();
327} 328}
328#endif 329#endif
330
331#ifdef CONFIG_HIBERNATION
332void output_pbe_defines(void)
333{
334 COMMENT(" Linux struct pbe offsets. ");
335 OFFSET(PBE_ADDRESS, pbe, address);
336 OFFSET(PBE_ORIG_ADDRESS, pbe, orig_address);
337 OFFSET(PBE_NEXT, pbe, next);
338 DEFINE(PBE_SIZE, sizeof(struct pbe));
339 BLANK();
340}
341#endif
diff --git a/arch/mips/kernel/cevt-txx9.c b/arch/mips/kernel/cevt-txx9.c
index 2e911e3da8d3..0037f21baf0d 100644
--- a/arch/mips/kernel/cevt-txx9.c
+++ b/arch/mips/kernel/cevt-txx9.c
@@ -20,22 +20,29 @@
20#define TIMER_CCD 0 /* 1/2 */ 20#define TIMER_CCD 0 /* 1/2 */
21#define TIMER_CLK(imclk) ((imclk) / (2 << TIMER_CCD)) 21#define TIMER_CLK(imclk) ((imclk) / (2 << TIMER_CCD))
22 22
23static struct txx9_tmr_reg __iomem *txx9_cs_tmrptr; 23struct txx9_clocksource {
24 struct clocksource cs;
25 struct txx9_tmr_reg __iomem *tmrptr;
26};
24 27
25static cycle_t txx9_cs_read(struct clocksource *cs) 28static cycle_t txx9_cs_read(struct clocksource *cs)
26{ 29{
27 return __raw_readl(&txx9_cs_tmrptr->trr); 30 struct txx9_clocksource *txx9_cs =
31 container_of(cs, struct txx9_clocksource, cs);
32 return __raw_readl(&txx9_cs->tmrptr->trr);
28} 33}
29 34
30/* Use 1 bit smaller width to use full bits in that width */ 35/* Use 1 bit smaller width to use full bits in that width */
31#define TXX9_CLOCKSOURCE_BITS (TXX9_TIMER_BITS - 1) 36#define TXX9_CLOCKSOURCE_BITS (TXX9_TIMER_BITS - 1)
32 37
33static struct clocksource txx9_clocksource = { 38static struct txx9_clocksource txx9_clocksource = {
34 .name = "TXx9", 39 .cs = {
35 .rating = 200, 40 .name = "TXx9",
36 .read = txx9_cs_read, 41 .rating = 200,
37 .mask = CLOCKSOURCE_MASK(TXX9_CLOCKSOURCE_BITS), 42 .read = txx9_cs_read,
38 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 43 .mask = CLOCKSOURCE_MASK(TXX9_CLOCKSOURCE_BITS),
44 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
45 },
39}; 46};
40 47
41void __init txx9_clocksource_init(unsigned long baseaddr, 48void __init txx9_clocksource_init(unsigned long baseaddr,
@@ -43,8 +50,8 @@ void __init txx9_clocksource_init(unsigned long baseaddr,
43{ 50{
44 struct txx9_tmr_reg __iomem *tmrptr; 51 struct txx9_tmr_reg __iomem *tmrptr;
45 52
46 clocksource_set_clock(&txx9_clocksource, TIMER_CLK(imbusclk)); 53 clocksource_set_clock(&txx9_clocksource.cs, TIMER_CLK(imbusclk));
47 clocksource_register(&txx9_clocksource); 54 clocksource_register(&txx9_clocksource.cs);
48 55
49 tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg)); 56 tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg));
50 __raw_writel(TCR_BASE, &tmrptr->tcr); 57 __raw_writel(TCR_BASE, &tmrptr->tcr);
@@ -53,10 +60,13 @@ void __init txx9_clocksource_init(unsigned long baseaddr,
53 __raw_writel(TXx9_TMITMR_TZCE, &tmrptr->itmr); 60 __raw_writel(TXx9_TMITMR_TZCE, &tmrptr->itmr);
54 __raw_writel(1 << TXX9_CLOCKSOURCE_BITS, &tmrptr->cpra); 61 __raw_writel(1 << TXX9_CLOCKSOURCE_BITS, &tmrptr->cpra);
55 __raw_writel(TCR_BASE | TXx9_TMTCR_TCE, &tmrptr->tcr); 62 __raw_writel(TCR_BASE | TXx9_TMTCR_TCE, &tmrptr->tcr);
56 txx9_cs_tmrptr = tmrptr; 63 txx9_clocksource.tmrptr = tmrptr;
57} 64}
58 65
59static struct txx9_tmr_reg __iomem *txx9_tmrptr; 66struct txx9_clock_event_device {
67 struct clock_event_device cd;
68 struct txx9_tmr_reg __iomem *tmrptr;
69};
60 70
61static void txx9tmr_stop_and_clear(struct txx9_tmr_reg __iomem *tmrptr) 71static void txx9tmr_stop_and_clear(struct txx9_tmr_reg __iomem *tmrptr)
62{ 72{
@@ -69,7 +79,9 @@ static void txx9tmr_stop_and_clear(struct txx9_tmr_reg __iomem *tmrptr)
69static void txx9tmr_set_mode(enum clock_event_mode mode, 79static void txx9tmr_set_mode(enum clock_event_mode mode,
70 struct clock_event_device *evt) 80 struct clock_event_device *evt)
71{ 81{
72 struct txx9_tmr_reg __iomem *tmrptr = txx9_tmrptr; 82 struct txx9_clock_event_device *txx9_cd =
83 container_of(evt, struct txx9_clock_event_device, cd);
84 struct txx9_tmr_reg __iomem *tmrptr = txx9_cd->tmrptr;
73 85
74 txx9tmr_stop_and_clear(tmrptr); 86 txx9tmr_stop_and_clear(tmrptr);
75 switch (mode) { 87 switch (mode) {
@@ -99,7 +111,9 @@ static void txx9tmr_set_mode(enum clock_event_mode mode,
99static int txx9tmr_set_next_event(unsigned long delta, 111static int txx9tmr_set_next_event(unsigned long delta,
100 struct clock_event_device *evt) 112 struct clock_event_device *evt)
101{ 113{
102 struct txx9_tmr_reg __iomem *tmrptr = txx9_tmrptr; 114 struct txx9_clock_event_device *txx9_cd =
115 container_of(evt, struct txx9_clock_event_device, cd);
116 struct txx9_tmr_reg __iomem *tmrptr = txx9_cd->tmrptr;
103 117
104 txx9tmr_stop_and_clear(tmrptr); 118 txx9tmr_stop_and_clear(tmrptr);
105 /* start timer */ 119 /* start timer */
@@ -108,18 +122,22 @@ static int txx9tmr_set_next_event(unsigned long delta,
108 return 0; 122 return 0;
109} 123}
110 124
111static struct clock_event_device txx9tmr_clock_event_device = { 125static struct txx9_clock_event_device txx9_clock_event_device = {
112 .name = "TXx9", 126 .cd = {
113 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 127 .name = "TXx9",
114 .rating = 200, 128 .features = CLOCK_EVT_FEAT_PERIODIC |
115 .set_mode = txx9tmr_set_mode, 129 CLOCK_EVT_FEAT_ONESHOT,
116 .set_next_event = txx9tmr_set_next_event, 130 .rating = 200,
131 .set_mode = txx9tmr_set_mode,
132 .set_next_event = txx9tmr_set_next_event,
133 },
117}; 134};
118 135
119static irqreturn_t txx9tmr_interrupt(int irq, void *dev_id) 136static irqreturn_t txx9tmr_interrupt(int irq, void *dev_id)
120{ 137{
121 struct clock_event_device *cd = &txx9tmr_clock_event_device; 138 struct txx9_clock_event_device *txx9_cd = dev_id;
122 struct txx9_tmr_reg __iomem *tmrptr = txx9_tmrptr; 139 struct clock_event_device *cd = &txx9_cd->cd;
140 struct txx9_tmr_reg __iomem *tmrptr = txx9_cd->tmrptr;
123 141
124 __raw_writel(0, &tmrptr->tisr); /* ack interrupt */ 142 __raw_writel(0, &tmrptr->tisr); /* ack interrupt */
125 cd->event_handler(cd); 143 cd->event_handler(cd);
@@ -130,19 +148,20 @@ static struct irqaction txx9tmr_irq = {
130 .handler = txx9tmr_interrupt, 148 .handler = txx9tmr_interrupt,
131 .flags = IRQF_DISABLED | IRQF_PERCPU, 149 .flags = IRQF_DISABLED | IRQF_PERCPU,
132 .name = "txx9tmr", 150 .name = "txx9tmr",
151 .dev_id = &txx9_clock_event_device,
133}; 152};
134 153
135void __init txx9_clockevent_init(unsigned long baseaddr, int irq, 154void __init txx9_clockevent_init(unsigned long baseaddr, int irq,
136 unsigned int imbusclk) 155 unsigned int imbusclk)
137{ 156{
138 struct clock_event_device *cd = &txx9tmr_clock_event_device; 157 struct clock_event_device *cd = &txx9_clock_event_device.cd;
139 struct txx9_tmr_reg __iomem *tmrptr; 158 struct txx9_tmr_reg __iomem *tmrptr;
140 159
141 tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg)); 160 tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg));
142 txx9tmr_stop_and_clear(tmrptr); 161 txx9tmr_stop_and_clear(tmrptr);
143 __raw_writel(TIMER_CCD, &tmrptr->ccdr); 162 __raw_writel(TIMER_CCD, &tmrptr->ccdr);
144 __raw_writel(0, &tmrptr->itmr); 163 __raw_writel(0, &tmrptr->itmr);
145 txx9_tmrptr = tmrptr; 164 txx9_clock_event_device.tmrptr = tmrptr;
146 165
147 clockevent_set_clock(cd, TIMER_CLK(imbusclk)); 166 clockevent_set_clock(cd, TIMER_CLK(imbusclk));
148 cd->max_delta_ns = 167 cd->max_delta_ns =
diff --git a/arch/mips/kernel/init_task.c b/arch/mips/kernel/init_task.c
index 149cd914526e..5b457a40c784 100644
--- a/arch/mips/kernel/init_task.c
+++ b/arch/mips/kernel/init_task.c
@@ -11,10 +11,6 @@
11 11
12static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 12static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
13static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 13static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
14struct mm_struct init_mm = INIT_MM(init_mm);
15
16EXPORT_SYMBOL(init_mm);
17
18/* 14/*
19 * Initial thread structure. 15 * Initial thread structure.
20 * 16 *
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index 5f5af7d4c890..37d51cd124e9 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -924,6 +924,7 @@ void ipi_decode(struct smtc_ipi *pipi)
924 int irq = MIPS_CPU_IRQ_BASE + 1; 924 int irq = MIPS_CPU_IRQ_BASE + 1;
925 925
926 smtc_ipi_nq(&freeIPIq, pipi); 926 smtc_ipi_nq(&freeIPIq, pipi);
927
927 switch (type_copy) { 928 switch (type_copy) {
928 case SMTC_CLOCK_TICK: 929 case SMTC_CLOCK_TICK:
929 irq_enter(); 930 irq_enter();
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index e83da174b533..08f1edf355e8 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1502,7 +1502,7 @@ void __cpuinit per_cpu_trap_init(void)
1502 status_set); 1502 status_set);
1503 1503
1504 if (cpu_has_mips_r2) { 1504 if (cpu_has_mips_r2) {
1505 unsigned int enable = 0x0000000f; 1505 unsigned int enable = 0x0000000f | cpu_hwrena_impl_bits;
1506 1506
1507 if (!noulri && cpu_has_userlocal) 1507 if (!noulri && cpu_has_userlocal)
1508 enable |= (1 << 29); 1508 enable |= (1 << 29);
@@ -1510,10 +1510,6 @@ void __cpuinit per_cpu_trap_init(void)
1510 write_c0_hwrena(enable); 1510 write_c0_hwrena(enable);
1511 } 1511 }
1512 1512
1513#ifdef CONFIG_CPU_CAVIUM_OCTEON
1514 write_c0_hwrena(0xc000000f); /* Octeon has register 30 and 31 */
1515#endif
1516
1517#ifdef CONFIG_MIPS_MT_SMTC 1513#ifdef CONFIG_MIPS_MT_SMTC
1518 if (!secondaryTC) { 1514 if (!secondaryTC) {
1519#endif /* CONFIG_MIPS_MT_SMTC */ 1515#endif /* CONFIG_MIPS_MT_SMTC */
diff --git a/arch/mips/lib/delay.c b/arch/mips/lib/delay.c
index f69c6b569eb3..6b3b1de9dcae 100644
--- a/arch/mips/lib/delay.c
+++ b/arch/mips/lib/delay.c
@@ -43,7 +43,7 @@ void __udelay(unsigned long us)
43{ 43{
44 unsigned int lpj = current_cpu_data.udelay_val; 44 unsigned int lpj = current_cpu_data.udelay_val;
45 45
46 __delay((us * 0x000010c7 * HZ * lpj) >> 32); 46 __delay((us * 0x000010c7ull * HZ * lpj) >> 32);
47} 47}
48EXPORT_SYMBOL(__udelay); 48EXPORT_SYMBOL(__udelay);
49 49
@@ -51,6 +51,6 @@ void __ndelay(unsigned long ns)
51{ 51{
52 unsigned int lpj = current_cpu_data.udelay_val; 52 unsigned int lpj = current_cpu_data.udelay_val;
53 53
54 __delay((us * 0x00000005 * HZ * lpj) >> 32); 54 __delay((ns * 0x00000005ull * HZ * lpj) >> 32);
55} 55}
56EXPORT_SYMBOL(__ndelay); 56EXPORT_SYMBOL(__ndelay);
diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile
index d7ec95522292..f0e435599707 100644
--- a/arch/mips/mm/Makefile
+++ b/arch/mips/mm/Makefile
@@ -8,6 +8,7 @@ obj-y += cache.o dma-default.o extable.o fault.o \
8obj-$(CONFIG_32BIT) += ioremap.o pgtable-32.o 8obj-$(CONFIG_32BIT) += ioremap.o pgtable-32.o
9obj-$(CONFIG_64BIT) += pgtable-64.o 9obj-$(CONFIG_64BIT) += pgtable-64.o
10obj-$(CONFIG_HIGHMEM) += highmem.o 10obj-$(CONFIG_HIGHMEM) += highmem.o
11obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
11 12
12obj-$(CONFIG_CPU_LOONGSON2) += c-r4k.o cex-gen.o tlb-r4k.o 13obj-$(CONFIG_CPU_LOONGSON2) += c-r4k.o cex-gen.o tlb-r4k.o
13obj-$(CONFIG_CPU_MIPS32) += c-r4k.o cex-gen.o tlb-r4k.o 14obj-$(CONFIG_CPU_MIPS32) += c-r4k.o cex-gen.o tlb-r4k.o
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 171951d2305b..71fe4cb778cd 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -100,6 +100,12 @@ static inline void r4k_blast_dcache_page_dc32(unsigned long addr)
100 blast_dcache32_page(addr); 100 blast_dcache32_page(addr);
101} 101}
102 102
103static inline void r4k_blast_dcache_page_dc64(unsigned long addr)
104{
105 R4600_HIT_CACHEOP_WAR_IMPL;
106 blast_dcache64_page(addr);
107}
108
103static void __cpuinit r4k_blast_dcache_page_setup(void) 109static void __cpuinit r4k_blast_dcache_page_setup(void)
104{ 110{
105 unsigned long dc_lsize = cpu_dcache_line_size(); 111 unsigned long dc_lsize = cpu_dcache_line_size();
@@ -110,6 +116,8 @@ static void __cpuinit r4k_blast_dcache_page_setup(void)
110 r4k_blast_dcache_page = blast_dcache16_page; 116 r4k_blast_dcache_page = blast_dcache16_page;
111 else if (dc_lsize == 32) 117 else if (dc_lsize == 32)
112 r4k_blast_dcache_page = r4k_blast_dcache_page_dc32; 118 r4k_blast_dcache_page = r4k_blast_dcache_page_dc32;
119 else if (dc_lsize == 64)
120 r4k_blast_dcache_page = r4k_blast_dcache_page_dc64;
113} 121}
114 122
115static void (* r4k_blast_dcache_page_indexed)(unsigned long addr); 123static void (* r4k_blast_dcache_page_indexed)(unsigned long addr);
@@ -124,6 +132,8 @@ static void __cpuinit r4k_blast_dcache_page_indexed_setup(void)
124 r4k_blast_dcache_page_indexed = blast_dcache16_page_indexed; 132 r4k_blast_dcache_page_indexed = blast_dcache16_page_indexed;
125 else if (dc_lsize == 32) 133 else if (dc_lsize == 32)
126 r4k_blast_dcache_page_indexed = blast_dcache32_page_indexed; 134 r4k_blast_dcache_page_indexed = blast_dcache32_page_indexed;
135 else if (dc_lsize == 64)
136 r4k_blast_dcache_page_indexed = blast_dcache64_page_indexed;
127} 137}
128 138
129static void (* r4k_blast_dcache)(void); 139static void (* r4k_blast_dcache)(void);
@@ -138,6 +148,8 @@ static void __cpuinit r4k_blast_dcache_setup(void)
138 r4k_blast_dcache = blast_dcache16; 148 r4k_blast_dcache = blast_dcache16;
139 else if (dc_lsize == 32) 149 else if (dc_lsize == 32)
140 r4k_blast_dcache = blast_dcache32; 150 r4k_blast_dcache = blast_dcache32;
151 else if (dc_lsize == 64)
152 r4k_blast_dcache = blast_dcache64;
141} 153}
142 154
143/* force code alignment (used for TX49XX_ICACHE_INDEX_INV_WAR) */ 155/* force code alignment (used for TX49XX_ICACHE_INDEX_INV_WAR) */
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 4fdb7f5216b9..7e48e76148aa 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -20,9 +20,10 @@
20 20
21#include <dma-coherence.h> 21#include <dma-coherence.h>
22 22
23static inline unsigned long dma_addr_to_virt(dma_addr_t dma_addr) 23static inline unsigned long dma_addr_to_virt(struct device *dev,
24 dma_addr_t dma_addr)
24{ 25{
25 unsigned long addr = plat_dma_addr_to_phys(dma_addr); 26 unsigned long addr = plat_dma_addr_to_phys(dev, dma_addr);
26 27
27 return (unsigned long)phys_to_virt(addr); 28 return (unsigned long)phys_to_virt(addr);
28} 29}
@@ -111,7 +112,7 @@ EXPORT_SYMBOL(dma_alloc_coherent);
111void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, 112void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr,
112 dma_addr_t dma_handle) 113 dma_addr_t dma_handle)
113{ 114{
114 plat_unmap_dma_mem(dev, dma_handle); 115 plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL);
115 free_pages((unsigned long) vaddr, get_order(size)); 116 free_pages((unsigned long) vaddr, get_order(size));
116} 117}
117 118
@@ -122,7 +123,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
122{ 123{
123 unsigned long addr = (unsigned long) vaddr; 124 unsigned long addr = (unsigned long) vaddr;
124 125
125 plat_unmap_dma_mem(dev, dma_handle); 126 plat_unmap_dma_mem(dev, dma_handle, size, DMA_BIDIRECTIONAL);
126 127
127 if (!plat_device_is_coherent(dev)) 128 if (!plat_device_is_coherent(dev))
128 addr = CAC_ADDR(addr); 129 addr = CAC_ADDR(addr);
@@ -170,10 +171,10 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
170 enum dma_data_direction direction) 171 enum dma_data_direction direction)
171{ 172{
172 if (cpu_is_noncoherent_r10000(dev)) 173 if (cpu_is_noncoherent_r10000(dev))
173 __dma_sync(dma_addr_to_virt(dma_addr), size, 174 __dma_sync(dma_addr_to_virt(dev, dma_addr), size,
174 direction); 175 direction);
175 176
176 plat_unmap_dma_mem(dev, dma_addr); 177 plat_unmap_dma_mem(dev, dma_addr, size, direction);
177} 178}
178 179
179EXPORT_SYMBOL(dma_unmap_single); 180EXPORT_SYMBOL(dma_unmap_single);
@@ -232,7 +233,7 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
232 if (addr) 233 if (addr)
233 __dma_sync(addr, sg->length, direction); 234 __dma_sync(addr, sg->length, direction);
234 } 235 }
235 plat_unmap_dma_mem(dev, sg->dma_address); 236 plat_unmap_dma_mem(dev, sg->dma_address, sg->length, direction);
236 } 237 }
237} 238}
238 239
@@ -246,7 +247,7 @@ void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
246 if (cpu_is_noncoherent_r10000(dev)) { 247 if (cpu_is_noncoherent_r10000(dev)) {
247 unsigned long addr; 248 unsigned long addr;
248 249
249 addr = dma_addr_to_virt(dma_handle); 250 addr = dma_addr_to_virt(dev, dma_handle);
250 __dma_sync(addr, size, direction); 251 __dma_sync(addr, size, direction);
251 } 252 }
252} 253}
@@ -262,7 +263,7 @@ void dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
262 if (!plat_device_is_coherent(dev)) { 263 if (!plat_device_is_coherent(dev)) {
263 unsigned long addr; 264 unsigned long addr;
264 265
265 addr = dma_addr_to_virt(dma_handle); 266 addr = dma_addr_to_virt(dev, dma_handle);
266 __dma_sync(addr, size, direction); 267 __dma_sync(addr, size, direction);
267 } 268 }
268} 269}
@@ -277,7 +278,7 @@ void dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
277 if (cpu_is_noncoherent_r10000(dev)) { 278 if (cpu_is_noncoherent_r10000(dev)) {
278 unsigned long addr; 279 unsigned long addr;
279 280
280 addr = dma_addr_to_virt(dma_handle); 281 addr = dma_addr_to_virt(dev, dma_handle);
281 __dma_sync(addr + offset, size, direction); 282 __dma_sync(addr + offset, size, direction);
282 } 283 }
283} 284}
@@ -293,7 +294,7 @@ void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
293 if (!plat_device_is_coherent(dev)) { 294 if (!plat_device_is_coherent(dev)) {
294 unsigned long addr; 295 unsigned long addr;
295 296
296 addr = dma_addr_to_virt(dma_handle); 297 addr = dma_addr_to_virt(dev, dma_handle);
297 __dma_sync(addr + offset, size, direction); 298 __dma_sync(addr + offset, size, direction);
298 } 299 }
299} 300}
diff --git a/arch/mips/mm/hugetlbpage.c b/arch/mips/mm/hugetlbpage.c
new file mode 100644
index 000000000000..471c09aa1614
--- /dev/null
+++ b/arch/mips/mm/hugetlbpage.c
@@ -0,0 +1,101 @@
1/*
2 * MIPS Huge TLB Page Support for Kernel.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2002, Rohit Seth <rohit.seth@intel.com>
9 * Copyright 2005, Embedded Alley Solutions, Inc.
10 * Matt Porter <mporter@embeddedalley.com>
11 * Copyright (C) 2008, 2009 Cavium Networks, Inc.
12 */
13
14#include <linux/init.h>
15#include <linux/fs.h>
16#include <linux/mm.h>
17#include <linux/hugetlb.h>
18#include <linux/pagemap.h>
19#include <linux/smp_lock.h>
20#include <linux/slab.h>
21#include <linux/err.h>
22#include <linux/sysctl.h>
23#include <asm/mman.h>
24#include <asm/tlb.h>
25#include <asm/tlbflush.h>
26
27pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr,
28 unsigned long sz)
29{
30 pgd_t *pgd;
31 pud_t *pud;
32 pte_t *pte = NULL;
33
34 pgd = pgd_offset(mm, addr);
35 pud = pud_alloc(mm, pgd, addr);
36 if (pud)
37 pte = (pte_t *)pmd_alloc(mm, pud, addr);
38
39 return pte;
40}
41
42pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
43{
44 pgd_t *pgd;
45 pud_t *pud;
46 pmd_t *pmd = NULL;
47
48 pgd = pgd_offset(mm, addr);
49 if (pgd_present(*pgd)) {
50 pud = pud_offset(pgd, addr);
51 if (pud_present(*pud))
52 pmd = pmd_offset(pud, addr);
53 }
54 return (pte_t *) pmd;
55}
56
57int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
58{
59 return 0;
60}
61
62/*
63 * This function checks for proper alignment of input addr and len parameters.
64 */
65int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
66{
67 if (len & ~HPAGE_MASK)
68 return -EINVAL;
69 if (addr & ~HPAGE_MASK)
70 return -EINVAL;
71 return 0;
72}
73
74struct page *
75follow_huge_addr(struct mm_struct *mm, unsigned long address, int write)
76{
77 return ERR_PTR(-EINVAL);
78}
79
80int pmd_huge(pmd_t pmd)
81{
82 return (pmd_val(pmd) & _PAGE_HUGE) != 0;
83}
84
85int pud_huge(pud_t pud)
86{
87 return (pud_val(pud) & _PAGE_HUGE) != 0;
88}
89
90struct page *
91follow_huge_pmd(struct mm_struct *mm, unsigned long address,
92 pmd_t *pmd, int write)
93{
94 struct page *page;
95
96 page = pte_page(*(pte_t *)pmd);
97 if (page)
98 page += ((address & ~HPAGE_MASK) >> PAGE_SHIFT);
99 return page;
100}
101
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index 892be426787c..f60fe513eb60 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -11,6 +11,7 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/mm.h> 13#include <linux/mm.h>
14#include <linux/hugetlb.h>
14 15
15#include <asm/cpu.h> 16#include <asm/cpu.h>
16#include <asm/bootinfo.h> 17#include <asm/bootinfo.h>
@@ -295,21 +296,41 @@ void __update_tlb(struct vm_area_struct * vma, unsigned long address, pte_t pte)
295 pudp = pud_offset(pgdp, address); 296 pudp = pud_offset(pgdp, address);
296 pmdp = pmd_offset(pudp, address); 297 pmdp = pmd_offset(pudp, address);
297 idx = read_c0_index(); 298 idx = read_c0_index();
298 ptep = pte_offset_map(pmdp, address); 299#ifdef CONFIG_HUGETLB_PAGE
300 /* this could be a huge page */
301 if (pmd_huge(*pmdp)) {
302 unsigned long lo;
303 write_c0_pagemask(PM_HUGE_MASK);
304 ptep = (pte_t *)pmdp;
305 lo = pte_val(*ptep) >> 6;
306 write_c0_entrylo0(lo);
307 write_c0_entrylo1(lo + (HPAGE_SIZE >> 7));
308
309 mtc0_tlbw_hazard();
310 if (idx < 0)
311 tlb_write_random();
312 else
313 tlb_write_indexed();
314 write_c0_pagemask(PM_DEFAULT_MASK);
315 } else
316#endif
317 {
318 ptep = pte_offset_map(pmdp, address);
299 319
300#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) 320#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32)
301 write_c0_entrylo0(ptep->pte_high); 321 write_c0_entrylo0(ptep->pte_high);
302 ptep++; 322 ptep++;
303 write_c0_entrylo1(ptep->pte_high); 323 write_c0_entrylo1(ptep->pte_high);
304#else 324#else
305 write_c0_entrylo0(pte_val(*ptep++) >> 6); 325 write_c0_entrylo0(pte_val(*ptep++) >> 6);
306 write_c0_entrylo1(pte_val(*ptep) >> 6); 326 write_c0_entrylo1(pte_val(*ptep) >> 6);
307#endif 327#endif
308 mtc0_tlbw_hazard(); 328 mtc0_tlbw_hazard();
309 if (idx < 0) 329 if (idx < 0)
310 tlb_write_random(); 330 tlb_write_random();
311 else 331 else
312 tlb_write_indexed(); 332 tlb_write_indexed();
333 }
313 tlbw_use_hazard(); 334 tlbw_use_hazard();
314 FLUSH_ITLB_VM(vma); 335 FLUSH_ITLB_VM(vma);
315 EXIT_CRITICAL(flags); 336 EXIT_CRITICAL(flags);
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 0615b62efd6d..8f606ead826e 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -6,8 +6,9 @@
6 * Synthesize TLB refill handlers at runtime. 6 * Synthesize TLB refill handlers at runtime.
7 * 7 *
8 * Copyright (C) 2004, 2005, 2006, 2008 Thiemo Seufer 8 * Copyright (C) 2004, 2005, 2006, 2008 Thiemo Seufer
9 * Copyright (C) 2005, 2007 Maciej W. Rozycki 9 * Copyright (C) 2005, 2007, 2008, 2009 Maciej W. Rozycki
10 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) 10 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org)
11 * Copyright (C) 2008, 2009 Cavium Networks, Inc.
11 * 12 *
12 * ... and the days got worse and worse and now you see 13 * ... and the days got worse and worse and now you see
13 * I've gone completly out of my mind. 14 * I've gone completly out of my mind.
@@ -19,6 +20,7 @@
19 * (Condolences to Napoleon XIV) 20 * (Condolences to Napoleon XIV)
20 */ 21 */
21 22
23#include <linux/bug.h>
22#include <linux/kernel.h> 24#include <linux/kernel.h>
23#include <linux/types.h> 25#include <linux/types.h>
24#include <linux/string.h> 26#include <linux/string.h>
@@ -82,6 +84,9 @@ enum label_id {
82 label_nopage_tlbm, 84 label_nopage_tlbm,
83 label_smp_pgtable_change, 85 label_smp_pgtable_change,
84 label_r3000_write_probe_fail, 86 label_r3000_write_probe_fail,
87#ifdef CONFIG_HUGETLB_PAGE
88 label_tlb_huge_update,
89#endif
85}; 90};
86 91
87UASM_L_LA(_second_part) 92UASM_L_LA(_second_part)
@@ -98,6 +103,9 @@ UASM_L_LA(_nopage_tlbs)
98UASM_L_LA(_nopage_tlbm) 103UASM_L_LA(_nopage_tlbm)
99UASM_L_LA(_smp_pgtable_change) 104UASM_L_LA(_smp_pgtable_change)
100UASM_L_LA(_r3000_write_probe_fail) 105UASM_L_LA(_r3000_write_probe_fail)
106#ifdef CONFIG_HUGETLB_PAGE
107UASM_L_LA(_tlb_huge_update)
108#endif
101 109
102/* 110/*
103 * For debug purposes. 111 * For debug purposes.
@@ -125,6 +133,7 @@ static inline void dump_handler(const u32 *handler, int count)
125#define C0_TCBIND 2, 2 133#define C0_TCBIND 2, 2
126#define C0_ENTRYLO1 3, 0 134#define C0_ENTRYLO1 3, 0
127#define C0_CONTEXT 4, 0 135#define C0_CONTEXT 4, 0
136#define C0_PAGEMASK 5, 0
128#define C0_BADVADDR 8, 0 137#define C0_BADVADDR 8, 0
129#define C0_ENTRYHI 10, 0 138#define C0_ENTRYHI 10, 0
130#define C0_EPC 14, 0 139#define C0_EPC 14, 0
@@ -258,7 +267,8 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
258 } 267 }
259 268
260 if (cpu_has_mips_r2) { 269 if (cpu_has_mips_r2) {
261 uasm_i_ehb(p); 270 if (cpu_has_mips_r2_exec_hazard)
271 uasm_i_ehb(p);
262 tlbw(p); 272 tlbw(p);
263 return; 273 return;
264 } 274 }
@@ -310,7 +320,6 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
310 case CPU_BCM3302: 320 case CPU_BCM3302:
311 case CPU_BCM4710: 321 case CPU_BCM4710:
312 case CPU_LOONGSON2: 322 case CPU_LOONGSON2:
313 case CPU_CAVIUM_OCTEON:
314 case CPU_R5500: 323 case CPU_R5500:
315 if (m4kc_tlbp_war()) 324 if (m4kc_tlbp_war())
316 uasm_i_nop(p); 325 uasm_i_nop(p);
@@ -382,6 +391,98 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
382 } 391 }
383} 392}
384 393
394#ifdef CONFIG_HUGETLB_PAGE
395static __cpuinit void build_huge_tlb_write_entry(u32 **p,
396 struct uasm_label **l,
397 struct uasm_reloc **r,
398 unsigned int tmp,
399 enum tlb_write_entry wmode)
400{
401 /* Set huge page tlb entry size */
402 uasm_i_lui(p, tmp, PM_HUGE_MASK >> 16);
403 uasm_i_ori(p, tmp, tmp, PM_HUGE_MASK & 0xffff);
404 uasm_i_mtc0(p, tmp, C0_PAGEMASK);
405
406 build_tlb_write_entry(p, l, r, wmode);
407
408 /* Reset default page size */
409 if (PM_DEFAULT_MASK >> 16) {
410 uasm_i_lui(p, tmp, PM_DEFAULT_MASK >> 16);
411 uasm_i_ori(p, tmp, tmp, PM_DEFAULT_MASK & 0xffff);
412 uasm_il_b(p, r, label_leave);
413 uasm_i_mtc0(p, tmp, C0_PAGEMASK);
414 } else if (PM_DEFAULT_MASK) {
415 uasm_i_ori(p, tmp, 0, PM_DEFAULT_MASK);
416 uasm_il_b(p, r, label_leave);
417 uasm_i_mtc0(p, tmp, C0_PAGEMASK);
418 } else {
419 uasm_il_b(p, r, label_leave);
420 uasm_i_mtc0(p, 0, C0_PAGEMASK);
421 }
422}
423
424/*
425 * Check if Huge PTE is present, if so then jump to LABEL.
426 */
427static void __cpuinit
428build_is_huge_pte(u32 **p, struct uasm_reloc **r, unsigned int tmp,
429 unsigned int pmd, int lid)
430{
431 UASM_i_LW(p, tmp, 0, pmd);
432 uasm_i_andi(p, tmp, tmp, _PAGE_HUGE);
433 uasm_il_bnez(p, r, tmp, lid);
434}
435
436static __cpuinit void build_huge_update_entries(u32 **p,
437 unsigned int pte,
438 unsigned int tmp)
439{
440 int small_sequence;
441
442 /*
443 * A huge PTE describes an area the size of the
444 * configured huge page size. This is twice the
445 * of the large TLB entry size we intend to use.
446 * A TLB entry half the size of the configured
447 * huge page size is configured into entrylo0
448 * and entrylo1 to cover the contiguous huge PTE
449 * address space.
450 */
451 small_sequence = (HPAGE_SIZE >> 7) < 0x10000;
452
453 /* We can clobber tmp. It isn't used after this.*/
454 if (!small_sequence)
455 uasm_i_lui(p, tmp, HPAGE_SIZE >> (7 + 16));
456
457 UASM_i_SRL(p, pte, pte, 6); /* convert to entrylo */
458 uasm_i_mtc0(p, pte, C0_ENTRYLO0); /* load it */
459 /* convert to entrylo1 */
460 if (small_sequence)
461 UASM_i_ADDIU(p, pte, pte, HPAGE_SIZE >> 7);
462 else
463 UASM_i_ADDU(p, pte, pte, tmp);
464
465 uasm_i_mtc0(p, pte, C0_ENTRYLO1); /* load it */
466}
467
468static __cpuinit void build_huge_handler_tail(u32 **p,
469 struct uasm_reloc **r,
470 struct uasm_label **l,
471 unsigned int pte,
472 unsigned int ptr)
473{
474#ifdef CONFIG_SMP
475 UASM_i_SC(p, pte, 0, ptr);
476 uasm_il_beqz(p, r, pte, label_tlb_huge_update);
477 UASM_i_LW(p, pte, 0, ptr); /* Needed because SC killed our PTE */
478#else
479 UASM_i_SW(p, pte, 0, ptr);
480#endif
481 build_huge_update_entries(p, pte, ptr);
482 build_huge_tlb_write_entry(p, l, r, pte, tlb_indexed);
483}
484#endif /* CONFIG_HUGETLB_PAGE */
485
385#ifdef CONFIG_64BIT 486#ifdef CONFIG_64BIT
386/* 487/*
387 * TMP and PTR are scratch. 488 * TMP and PTR are scratch.
@@ -649,6 +750,14 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
649#endif 750#endif
650} 751}
651 752
753/*
754 * For a 64-bit kernel, we are using the 64-bit XTLB refill exception
755 * because EXL == 0. If we wrap, we can also use the 32 instruction
756 * slots before the XTLB refill exception handler which belong to the
757 * unused TLB refill exception.
758 */
759#define MIPS64_REFILL_INSNS 32
760
652static void __cpuinit build_r4000_tlb_refill_handler(void) 761static void __cpuinit build_r4000_tlb_refill_handler(void)
653{ 762{
654 u32 *p = tlb_handler; 763 u32 *p = tlb_handler;
@@ -680,12 +789,23 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
680 build_get_pgde32(&p, K0, K1); /* get pgd in K1 */ 789 build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
681#endif 790#endif
682 791
792#ifdef CONFIG_HUGETLB_PAGE
793 build_is_huge_pte(&p, &r, K0, K1, label_tlb_huge_update);
794#endif
795
683 build_get_ptep(&p, K0, K1); 796 build_get_ptep(&p, K0, K1);
684 build_update_entries(&p, K0, K1); 797 build_update_entries(&p, K0, K1);
685 build_tlb_write_entry(&p, &l, &r, tlb_random); 798 build_tlb_write_entry(&p, &l, &r, tlb_random);
686 uasm_l_leave(&l, p); 799 uasm_l_leave(&l, p);
687 uasm_i_eret(&p); /* return from trap */ 800 uasm_i_eret(&p); /* return from trap */
688 801
802#ifdef CONFIG_HUGETLB_PAGE
803 uasm_l_tlb_huge_update(&l, p);
804 UASM_i_LW(&p, K0, 0, K1);
805 build_huge_update_entries(&p, K0, K1);
806 build_huge_tlb_write_entry(&p, &l, &r, K0, tlb_random);
807#endif
808
689#ifdef CONFIG_64BIT 809#ifdef CONFIG_64BIT
690 build_get_pgd_vmalloc64(&p, &l, &r, K0, K1); 810 build_get_pgd_vmalloc64(&p, &l, &r, K0, K1);
691#endif 811#endif
@@ -702,9 +822,10 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
702 if ((p - tlb_handler) > 64) 822 if ((p - tlb_handler) > 64)
703 panic("TLB refill handler space exceeded"); 823 panic("TLB refill handler space exceeded");
704#else 824#else
705 if (((p - tlb_handler) > 63) 825 if (((p - tlb_handler) > (MIPS64_REFILL_INSNS * 2) - 1)
706 || (((p - tlb_handler) > 61) 826 || (((p - tlb_handler) > (MIPS64_REFILL_INSNS * 2) - 3)
707 && uasm_insn_has_bdelay(relocs, tlb_handler + 29))) 827 && uasm_insn_has_bdelay(relocs,
828 tlb_handler + MIPS64_REFILL_INSNS - 3)))
708 panic("TLB refill handler space exceeded"); 829 panic("TLB refill handler space exceeded");
709#endif 830#endif
710 831
@@ -717,39 +838,74 @@ static void __cpuinit build_r4000_tlb_refill_handler(void)
717 uasm_copy_handler(relocs, labels, tlb_handler, p, f); 838 uasm_copy_handler(relocs, labels, tlb_handler, p, f);
718 final_len = p - tlb_handler; 839 final_len = p - tlb_handler;
719#else /* CONFIG_64BIT */ 840#else /* CONFIG_64BIT */
720 f = final_handler + 32; 841 f = final_handler + MIPS64_REFILL_INSNS;
721 if ((p - tlb_handler) <= 32) { 842 if ((p - tlb_handler) <= MIPS64_REFILL_INSNS) {
722 /* Just copy the handler. */ 843 /* Just copy the handler. */
723 uasm_copy_handler(relocs, labels, tlb_handler, p, f); 844 uasm_copy_handler(relocs, labels, tlb_handler, p, f);
724 final_len = p - tlb_handler; 845 final_len = p - tlb_handler;
725 } else { 846 } else {
726 u32 *split = tlb_handler + 30; 847#if defined(CONFIG_HUGETLB_PAGE)
848 const enum label_id ls = label_tlb_huge_update;
849#elif defined(MODULE_START)
850 const enum label_id ls = label_module_alloc;
851#else
852 const enum label_id ls = label_vmalloc;
853#endif
854 u32 *split;
855 int ov = 0;
856 int i;
857
858 for (i = 0; i < ARRAY_SIZE(labels) && labels[i].lab != ls; i++)
859 ;
860 BUG_ON(i == ARRAY_SIZE(labels));
861 split = labels[i].addr;
727 862
728 /* 863 /*
729 * Find the split point. 864 * See if we have overflown one way or the other.
730 */ 865 */
731 if (uasm_insn_has_bdelay(relocs, split - 1)) 866 if (split > tlb_handler + MIPS64_REFILL_INSNS ||
732 split--; 867 split < p - MIPS64_REFILL_INSNS)
733 868 ov = 1;
869
870 if (ov) {
871 /*
872 * Split two instructions before the end. One
873 * for the branch and one for the instruction
874 * in the delay slot.
875 */
876 split = tlb_handler + MIPS64_REFILL_INSNS - 2;
877
878 /*
879 * If the branch would fall in a delay slot,
880 * we must back up an additional instruction
881 * so that it is no longer in a delay slot.
882 */
883 if (uasm_insn_has_bdelay(relocs, split - 1))
884 split--;
885 }
734 /* Copy first part of the handler. */ 886 /* Copy first part of the handler. */
735 uasm_copy_handler(relocs, labels, tlb_handler, split, f); 887 uasm_copy_handler(relocs, labels, tlb_handler, split, f);
736 f += split - tlb_handler; 888 f += split - tlb_handler;
737 889
738 /* Insert branch. */ 890 if (ov) {
739 uasm_l_split(&l, final_handler); 891 /* Insert branch. */
740 uasm_il_b(&f, &r, label_split); 892 uasm_l_split(&l, final_handler);
741 if (uasm_insn_has_bdelay(relocs, split)) 893 uasm_il_b(&f, &r, label_split);
742 uasm_i_nop(&f); 894 if (uasm_insn_has_bdelay(relocs, split))
743 else { 895 uasm_i_nop(&f);
744 uasm_copy_handler(relocs, labels, split, split + 1, f); 896 else {
745 uasm_move_labels(labels, f, f + 1, -1); 897 uasm_copy_handler(relocs, labels,
746 f++; 898 split, split + 1, f);
747 split++; 899 uasm_move_labels(labels, f, f + 1, -1);
900 f++;
901 split++;
902 }
748 } 903 }
749 904
750 /* Copy the rest of the handler. */ 905 /* Copy the rest of the handler. */
751 uasm_copy_handler(relocs, labels, split, p, final_handler); 906 uasm_copy_handler(relocs, labels, split, p, final_handler);
752 final_len = (f - (final_handler + 32)) + (p - split); 907 final_len = (f - (final_handler + MIPS64_REFILL_INSNS)) +
908 (p - split);
753 } 909 }
754#endif /* CONFIG_64BIT */ 910#endif /* CONFIG_64BIT */
755 911
@@ -782,7 +938,7 @@ u32 handle_tlbs[FASTPATH_SIZE] __cacheline_aligned;
782u32 handle_tlbm[FASTPATH_SIZE] __cacheline_aligned; 938u32 handle_tlbm[FASTPATH_SIZE] __cacheline_aligned;
783 939
784static void __cpuinit 940static void __cpuinit
785iPTE_LW(u32 **p, struct uasm_label **l, unsigned int pte, unsigned int ptr) 941iPTE_LW(u32 **p, unsigned int pte, unsigned int ptr)
786{ 942{
787#ifdef CONFIG_SMP 943#ifdef CONFIG_SMP
788# ifdef CONFIG_64BIT_PHYS_ADDR 944# ifdef CONFIG_64BIT_PHYS_ADDR
@@ -862,13 +1018,13 @@ iPTE_SW(u32 **p, struct uasm_reloc **r, unsigned int pte, unsigned int ptr,
862 * with it's original value. 1018 * with it's original value.
863 */ 1019 */
864static void __cpuinit 1020static void __cpuinit
865build_pte_present(u32 **p, struct uasm_label **l, struct uasm_reloc **r, 1021build_pte_present(u32 **p, struct uasm_reloc **r,
866 unsigned int pte, unsigned int ptr, enum label_id lid) 1022 unsigned int pte, unsigned int ptr, enum label_id lid)
867{ 1023{
868 uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); 1024 uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_READ);
869 uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ); 1025 uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_READ);
870 uasm_il_bnez(p, r, pte, lid); 1026 uasm_il_bnez(p, r, pte, lid);
871 iPTE_LW(p, l, pte, ptr); 1027 iPTE_LW(p, pte, ptr);
872} 1028}
873 1029
874/* Make PTE valid, store result in PTR. */ 1030/* Make PTE valid, store result in PTR. */
@@ -886,13 +1042,13 @@ build_make_valid(u32 **p, struct uasm_reloc **r, unsigned int pte,
886 * restore PTE with value from PTR when done. 1042 * restore PTE with value from PTR when done.
887 */ 1043 */
888static void __cpuinit 1044static void __cpuinit
889build_pte_writable(u32 **p, struct uasm_label **l, struct uasm_reloc **r, 1045build_pte_writable(u32 **p, struct uasm_reloc **r,
890 unsigned int pte, unsigned int ptr, enum label_id lid) 1046 unsigned int pte, unsigned int ptr, enum label_id lid)
891{ 1047{
892 uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE); 1048 uasm_i_andi(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE);
893 uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE); 1049 uasm_i_xori(p, pte, pte, _PAGE_PRESENT | _PAGE_WRITE);
894 uasm_il_bnez(p, r, pte, lid); 1050 uasm_il_bnez(p, r, pte, lid);
895 iPTE_LW(p, l, pte, ptr); 1051 iPTE_LW(p, pte, ptr);
896} 1052}
897 1053
898/* Make PTE writable, update software status bits as well, then store 1054/* Make PTE writable, update software status bits as well, then store
@@ -913,12 +1069,12 @@ build_make_write(u32 **p, struct uasm_reloc **r, unsigned int pte,
913 * restore PTE with value from PTR when done. 1069 * restore PTE with value from PTR when done.
914 */ 1070 */
915static void __cpuinit 1071static void __cpuinit
916build_pte_modifiable(u32 **p, struct uasm_label **l, struct uasm_reloc **r, 1072build_pte_modifiable(u32 **p, struct uasm_reloc **r,
917 unsigned int pte, unsigned int ptr, enum label_id lid) 1073 unsigned int pte, unsigned int ptr, enum label_id lid)
918{ 1074{
919 uasm_i_andi(p, pte, pte, _PAGE_WRITE); 1075 uasm_i_andi(p, pte, pte, _PAGE_WRITE);
920 uasm_il_beqz(p, r, pte, lid); 1076 uasm_il_beqz(p, r, pte, lid);
921 iPTE_LW(p, l, pte, ptr); 1077 iPTE_LW(p, pte, ptr);
922} 1078}
923 1079
924/* 1080/*
@@ -994,7 +1150,7 @@ static void __cpuinit build_r3000_tlb_load_handler(void)
994 memset(relocs, 0, sizeof(relocs)); 1150 memset(relocs, 0, sizeof(relocs));
995 1151
996 build_r3000_tlbchange_handler_head(&p, K0, K1); 1152 build_r3000_tlbchange_handler_head(&p, K0, K1);
997 build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl); 1153 build_pte_present(&p, &r, K0, K1, label_nopage_tlbl);
998 uasm_i_nop(&p); /* load delay */ 1154 uasm_i_nop(&p); /* load delay */
999 build_make_valid(&p, &r, K0, K1); 1155 build_make_valid(&p, &r, K0, K1);
1000 build_r3000_tlb_reload_write(&p, &l, &r, K0, K1); 1156 build_r3000_tlb_reload_write(&p, &l, &r, K0, K1);
@@ -1024,7 +1180,7 @@ static void __cpuinit build_r3000_tlb_store_handler(void)
1024 memset(relocs, 0, sizeof(relocs)); 1180 memset(relocs, 0, sizeof(relocs));
1025 1181
1026 build_r3000_tlbchange_handler_head(&p, K0, K1); 1182 build_r3000_tlbchange_handler_head(&p, K0, K1);
1027 build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs); 1183 build_pte_writable(&p, &r, K0, K1, label_nopage_tlbs);
1028 uasm_i_nop(&p); /* load delay */ 1184 uasm_i_nop(&p); /* load delay */
1029 build_make_write(&p, &r, K0, K1); 1185 build_make_write(&p, &r, K0, K1);
1030 build_r3000_tlb_reload_write(&p, &l, &r, K0, K1); 1186 build_r3000_tlb_reload_write(&p, &l, &r, K0, K1);
@@ -1054,7 +1210,7 @@ static void __cpuinit build_r3000_tlb_modify_handler(void)
1054 memset(relocs, 0, sizeof(relocs)); 1210 memset(relocs, 0, sizeof(relocs));
1055 1211
1056 build_r3000_tlbchange_handler_head(&p, K0, K1); 1212 build_r3000_tlbchange_handler_head(&p, K0, K1);
1057 build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm); 1213 build_pte_modifiable(&p, &r, K0, K1, label_nopage_tlbm);
1058 uasm_i_nop(&p); /* load delay */ 1214 uasm_i_nop(&p); /* load delay */
1059 build_make_write(&p, &r, K0, K1); 1215 build_make_write(&p, &r, K0, K1);
1060 build_r3000_pte_reload_tlbwi(&p, K0, K1); 1216 build_r3000_pte_reload_tlbwi(&p, K0, K1);
@@ -1087,6 +1243,15 @@ build_r4000_tlbchange_handler_head(u32 **p, struct uasm_label **l,
1087 build_get_pgde32(p, pte, ptr); /* get pgd in ptr */ 1243 build_get_pgde32(p, pte, ptr); /* get pgd in ptr */
1088#endif 1244#endif
1089 1245
1246#ifdef CONFIG_HUGETLB_PAGE
1247 /*
1248 * For huge tlb entries, pmd doesn't contain an address but
1249 * instead contains the tlb pte. Check the PAGE_HUGE bit and
1250 * see if we need to jump to huge tlb processing.
1251 */
1252 build_is_huge_pte(p, r, pte, ptr, label_tlb_huge_update);
1253#endif
1254
1090 UASM_i_MFC0(p, pte, C0_BADVADDR); 1255 UASM_i_MFC0(p, pte, C0_BADVADDR);
1091 UASM_i_LW(p, ptr, 0, ptr); 1256 UASM_i_LW(p, ptr, 0, ptr);
1092 UASM_i_SRL(p, pte, pte, PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2); 1257 UASM_i_SRL(p, pte, pte, PAGE_SHIFT + PTE_ORDER - PTE_T_LOG2);
@@ -1096,7 +1261,7 @@ build_r4000_tlbchange_handler_head(u32 **p, struct uasm_label **l,
1096#ifdef CONFIG_SMP 1261#ifdef CONFIG_SMP
1097 uasm_l_smp_pgtable_change(l, *p); 1262 uasm_l_smp_pgtable_change(l, *p);
1098#endif 1263#endif
1099 iPTE_LW(p, l, pte, ptr); /* get even pte */ 1264 iPTE_LW(p, pte, ptr); /* get even pte */
1100 if (!m4kc_tlbp_war()) 1265 if (!m4kc_tlbp_war())
1101 build_tlb_probe_entry(p); 1266 build_tlb_probe_entry(p);
1102} 1267}
@@ -1138,12 +1303,25 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
1138 } 1303 }
1139 1304
1140 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); 1305 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
1141 build_pte_present(&p, &l, &r, K0, K1, label_nopage_tlbl); 1306 build_pte_present(&p, &r, K0, K1, label_nopage_tlbl);
1142 if (m4kc_tlbp_war()) 1307 if (m4kc_tlbp_war())
1143 build_tlb_probe_entry(&p); 1308 build_tlb_probe_entry(&p);
1144 build_make_valid(&p, &r, K0, K1); 1309 build_make_valid(&p, &r, K0, K1);
1145 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); 1310 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
1146 1311
1312#ifdef CONFIG_HUGETLB_PAGE
1313 /*
1314 * This is the entry point when build_r4000_tlbchange_handler_head
1315 * spots a huge page.
1316 */
1317 uasm_l_tlb_huge_update(&l, p);
1318 iPTE_LW(&p, K0, K1);
1319 build_pte_present(&p, &r, K0, K1, label_nopage_tlbl);
1320 build_tlb_probe_entry(&p);
1321 uasm_i_ori(&p, K0, K0, (_PAGE_ACCESSED | _PAGE_VALID));
1322 build_huge_handler_tail(&p, &r, &l, K0, K1);
1323#endif
1324
1147 uasm_l_nopage_tlbl(&l, p); 1325 uasm_l_nopage_tlbl(&l, p);
1148 uasm_i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff); 1326 uasm_i_j(&p, (unsigned long)tlb_do_page_fault_0 & 0x0fffffff);
1149 uasm_i_nop(&p); 1327 uasm_i_nop(&p);
@@ -1169,12 +1347,26 @@ static void __cpuinit build_r4000_tlb_store_handler(void)
1169 memset(relocs, 0, sizeof(relocs)); 1347 memset(relocs, 0, sizeof(relocs));
1170 1348
1171 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); 1349 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
1172 build_pte_writable(&p, &l, &r, K0, K1, label_nopage_tlbs); 1350 build_pte_writable(&p, &r, K0, K1, label_nopage_tlbs);
1173 if (m4kc_tlbp_war()) 1351 if (m4kc_tlbp_war())
1174 build_tlb_probe_entry(&p); 1352 build_tlb_probe_entry(&p);
1175 build_make_write(&p, &r, K0, K1); 1353 build_make_write(&p, &r, K0, K1);
1176 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); 1354 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
1177 1355
1356#ifdef CONFIG_HUGETLB_PAGE
1357 /*
1358 * This is the entry point when
1359 * build_r4000_tlbchange_handler_head spots a huge page.
1360 */
1361 uasm_l_tlb_huge_update(&l, p);
1362 iPTE_LW(&p, K0, K1);
1363 build_pte_writable(&p, &r, K0, K1, label_nopage_tlbs);
1364 build_tlb_probe_entry(&p);
1365 uasm_i_ori(&p, K0, K0,
1366 _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY);
1367 build_huge_handler_tail(&p, &r, &l, K0, K1);
1368#endif
1369
1178 uasm_l_nopage_tlbs(&l, p); 1370 uasm_l_nopage_tlbs(&l, p);
1179 uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); 1371 uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff);
1180 uasm_i_nop(&p); 1372 uasm_i_nop(&p);
@@ -1200,13 +1392,27 @@ static void __cpuinit build_r4000_tlb_modify_handler(void)
1200 memset(relocs, 0, sizeof(relocs)); 1392 memset(relocs, 0, sizeof(relocs));
1201 1393
1202 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1); 1394 build_r4000_tlbchange_handler_head(&p, &l, &r, K0, K1);
1203 build_pte_modifiable(&p, &l, &r, K0, K1, label_nopage_tlbm); 1395 build_pte_modifiable(&p, &r, K0, K1, label_nopage_tlbm);
1204 if (m4kc_tlbp_war()) 1396 if (m4kc_tlbp_war())
1205 build_tlb_probe_entry(&p); 1397 build_tlb_probe_entry(&p);
1206 /* Present and writable bits set, set accessed and dirty bits. */ 1398 /* Present and writable bits set, set accessed and dirty bits. */
1207 build_make_write(&p, &r, K0, K1); 1399 build_make_write(&p, &r, K0, K1);
1208 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1); 1400 build_r4000_tlbchange_handler_tail(&p, &l, &r, K0, K1);
1209 1401
1402#ifdef CONFIG_HUGETLB_PAGE
1403 /*
1404 * This is the entry point when
1405 * build_r4000_tlbchange_handler_head spots a huge page.
1406 */
1407 uasm_l_tlb_huge_update(&l, p);
1408 iPTE_LW(&p, K0, K1);
1409 build_pte_modifiable(&p, &r, K0, K1, label_nopage_tlbm);
1410 build_tlb_probe_entry(&p);
1411 uasm_i_ori(&p, K0, K0,
1412 _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_VALID | _PAGE_DIRTY);
1413 build_huge_handler_tail(&p, &r, &l, K0, K1);
1414#endif
1415
1210 uasm_l_nopage_tlbm(&l, p); 1416 uasm_l_nopage_tlbm(&l, p);
1211 uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff); 1417 uasm_i_j(&p, (unsigned long)tlb_do_page_fault_1 & 0x0fffffff);
1212 uasm_i_nop(&p); 1418 uasm_i_nop(&p);
diff --git a/arch/mips/power/Makefile b/arch/mips/power/Makefile
new file mode 100644
index 000000000000..73d56b87cb9b
--- /dev/null
+++ b/arch/mips/power/Makefile
@@ -0,0 +1 @@
obj-$(CONFIG_HIBERNATION) += cpu.o hibernate.o
diff --git a/arch/mips/power/cpu.c b/arch/mips/power/cpu.c
new file mode 100644
index 000000000000..7995df45dc8d
--- /dev/null
+++ b/arch/mips/power/cpu.c
@@ -0,0 +1,43 @@
1/*
2 * Suspend support specific for mips.
3 *
4 * Licensed under the GPLv2
5 *
6 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
7 * Author: Hu Hongbing <huhb@lemote.com>
8 * Wu Zhangjin <wuzj@lemote.com>
9 */
10#include <asm/suspend.h>
11#include <asm/fpu.h>
12#include <asm/dsp.h>
13
14static u32 saved_status;
15struct pt_regs saved_regs;
16
17void save_processor_state(void)
18{
19 saved_status = read_c0_status();
20
21 if (is_fpu_owner())
22 save_fp(current);
23 if (cpu_has_dsp)
24 save_dsp(current);
25}
26
27void restore_processor_state(void)
28{
29 write_c0_status(saved_status);
30
31 if (is_fpu_owner())
32 restore_fp(current);
33 if (cpu_has_dsp)
34 restore_dsp(current);
35}
36
37int pfn_is_nosave(unsigned long pfn)
38{
39 unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin));
40 unsigned long nosave_end_pfn = PFN_UP(__pa(&__nosave_end));
41
42 return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
43}
diff --git a/arch/mips/power/hibernate.S b/arch/mips/power/hibernate.S
new file mode 100644
index 000000000000..486bd3fd01a1
--- /dev/null
+++ b/arch/mips/power/hibernate.S
@@ -0,0 +1,70 @@
1/*
2 * Hibernation support specific for mips - temporary page tables
3 *
4 * Licensed under the GPLv2
5 *
6 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology
7 * Author: Hu Hongbing <huhb@lemote.com>
8 * Wu Zhangjin <wuzj@lemote.com>
9 */
10#include <asm/asm-offsets.h>
11#include <asm/regdef.h>
12#include <asm/asm.h>
13
14.text
15LEAF(swsusp_arch_suspend)
16 PTR_LA t0, saved_regs
17 PTR_S ra, PT_R31(t0)
18 PTR_S sp, PT_R29(t0)
19 PTR_S fp, PT_R30(t0)
20 PTR_S gp, PT_R28(t0)
21 PTR_S s0, PT_R16(t0)
22 PTR_S s1, PT_R17(t0)
23 PTR_S s2, PT_R18(t0)
24 PTR_S s3, PT_R19(t0)
25 PTR_S s4, PT_R20(t0)
26 PTR_S s5, PT_R21(t0)
27 PTR_S s6, PT_R22(t0)
28 PTR_S s7, PT_R23(t0)
29 j swsusp_save
30END(swsusp_arch_suspend)
31
32LEAF(swsusp_arch_resume)
33 PTR_L t0, restore_pblist
340:
35 PTR_L t1, PBE_ADDRESS(t0) /* source */
36 PTR_L t2, PBE_ORIG_ADDRESS(t0) /* destination */
37 PTR_ADDIU t3, t1, _PAGE_SIZE
381:
39 REG_L t8, (t1)
40 REG_S t8, (t2)
41 PTR_ADDIU t1, t1, SZREG
42 PTR_ADDIU t2, t2, SZREG
43 bne t1, t3, 1b
44 PTR_L t0, PBE_NEXT(t0)
45 bnez t0, 0b
46 /* flush caches to make sure context is in memory */
47 PTR_L t0, __flush_cache_all
48 jalr t0
49 /* flush tlb entries */
50#ifdef CONFIG_SMP
51 jal flush_tlb_all
52#else
53 jal local_flush_tlb_all
54#endif
55 PTR_LA t0, saved_regs
56 PTR_L ra, PT_R31(t0)
57 PTR_L sp, PT_R29(t0)
58 PTR_L fp, PT_R30(t0)
59 PTR_L gp, PT_R28(t0)
60 PTR_L s0, PT_R16(t0)
61 PTR_L s1, PT_R17(t0)
62 PTR_L s2, PT_R18(t0)
63 PTR_L s3, PT_R19(t0)
64 PTR_L s4, PT_R20(t0)
65 PTR_L s5, PT_R21(t0)
66 PTR_L s6, PT_R22(t0)
67 PTR_L s7, PT_R23(t0)
68 PTR_LI v0, 0x0
69 jr ra
70END(swsusp_arch_resume)
diff --git a/arch/mips/rb532/irq.c b/arch/mips/rb532/irq.c
index 53eeb5e7bc5b..f07882029a90 100644
--- a/arch/mips/rb532/irq.c
+++ b/arch/mips/rb532/irq.c
@@ -151,7 +151,8 @@ static void rb532_disable_irq(unsigned int irq_nr)
151 mask |= intr_bit; 151 mask |= intr_bit;
152 WRITE_MASK(addr, mask); 152 WRITE_MASK(addr, mask);
153 153
154 if (group == GPIO_MAPPED_IRQ_GROUP) 154 /* There is a maximum of 14 GPIO interrupts */
155 if (group == GPIO_MAPPED_IRQ_GROUP && irq_nr <= (GROUP4_IRQ_BASE + 13))
155 rb532_gpio_set_istat(0, irq_nr - GPIO_MAPPED_IRQ_BASE); 156 rb532_gpio_set_istat(0, irq_nr - GPIO_MAPPED_IRQ_BASE);
156 157
157 /* 158 /*
@@ -174,7 +175,7 @@ static int rb532_set_type(unsigned int irq_nr, unsigned type)
174 int gpio = irq_nr - GPIO_MAPPED_IRQ_BASE; 175 int gpio = irq_nr - GPIO_MAPPED_IRQ_BASE;
175 int group = irq_to_group(irq_nr); 176 int group = irq_to_group(irq_nr);
176 177
177 if (group != GPIO_MAPPED_IRQ_GROUP) 178 if (group != GPIO_MAPPED_IRQ_GROUP || irq_nr > (GROUP4_IRQ_BASE + 13))
178 return (type == IRQ_TYPE_LEVEL_HIGH) ? 0 : -EINVAL; 179 return (type == IRQ_TYPE_LEVEL_HIGH) ? 0 : -EINVAL;
179 180
180 switch (type) { 181 switch (type) {
diff --git a/arch/mips/sibyte/Kconfig b/arch/mips/sibyte/Kconfig
index 366b19d33f77..3e639bda43f7 100644
--- a/arch/mips/sibyte/Kconfig
+++ b/arch/mips/sibyte/Kconfig
@@ -75,6 +75,8 @@ config SIBYTE_SB1xxx_SOC
75 select SWAP_IO_SPACE 75 select SWAP_IO_SPACE
76 select SYS_SUPPORTS_32BIT_KERNEL 76 select SYS_SUPPORTS_32BIT_KERNEL
77 select SYS_SUPPORTS_64BIT_KERNEL 77 select SYS_SUPPORTS_64BIT_KERNEL
78 select CFE
79 select SYS_HAS_EARLY_PRINTK
78 80
79choice 81choice
80 prompt "SiByte SOC Stepping" 82 prompt "SiByte SOC Stepping"
@@ -128,13 +130,6 @@ config SIBYTE_ENABLE_LDT_IF_PCI
128 bool 130 bool
129 select SIBYTE_HAS_LDT if PCI 131 select SIBYTE_HAS_LDT if PCI
130 132
131config SIMULATION
132 bool "Running under simulation"
133 depends on SIBYTE_SB1xxx_SOC
134 help
135 Build a kernel suitable for running under the GDB simulator.
136 Primarily adjusts the kernel's notion of time.
137
138config SB1_CEX_ALWAYS_FATAL 133config SB1_CEX_ALWAYS_FATAL
139 bool "All cache exceptions considered fatal (no recovery attempted)" 134 bool "All cache exceptions considered fatal (no recovery attempted)"
140 depends on SIBYTE_SB1xxx_SOC 135 depends on SIBYTE_SB1xxx_SOC
@@ -143,34 +138,14 @@ config SB1_CERR_STALL
143 bool "Stall (rather than panic) on fatal cache error" 138 bool "Stall (rather than panic) on fatal cache error"
144 depends on SIBYTE_SB1xxx_SOC 139 depends on SIBYTE_SB1xxx_SOC
145 140
146config SIBYTE_CFE
147 bool "Booting from CFE"
148 depends on SIBYTE_SB1xxx_SOC
149 select CFE
150 select SYS_HAS_EARLY_PRINTK
151 help
152 Make use of the CFE API for enumerating available memory,
153 controlling secondary CPUs, and possibly console output.
154
155config SIBYTE_CFE_CONSOLE 141config SIBYTE_CFE_CONSOLE
156 bool "Use firmware console" 142 bool "Use firmware console"
157 depends on SIBYTE_CFE 143 depends on SIBYTE_SB1xxx_SOC
158 help 144 help
159 Use the CFE API's console write routines during boot. Other console 145 Use the CFE API's console write routines during boot. Other console
160 options (VT console, sb1250 duart console, etc.) should not be 146 options (VT console, sb1250 duart console, etc.) should not be
161 configured. 147 configured.
162 148
163config SIBYTE_STANDALONE
164 bool
165 depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE
166 select SYS_HAS_EARLY_PRINTK
167 default y
168
169config SIBYTE_STANDALONE_RAM_SIZE
170 int "Memory size (in megabytes)"
171 depends on SIBYTE_STANDALONE
172 default "32"
173
174config SIBYTE_BUS_WATCHER 149config SIBYTE_BUS_WATCHER
175 bool "Support for Bus Watcher statistics" 150 bool "Support for Bus Watcher statistics"
176 depends on SIBYTE_SB1xxx_SOC 151 depends on SIBYTE_SB1xxx_SOC
diff --git a/arch/mips/sibyte/cfe/Makefile b/arch/mips/sibyte/cfe/Makefile
deleted file mode 100644
index 02b32e142adf..000000000000
--- a/arch/mips/sibyte/cfe/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
1lib-y = setup.o
2lib-$(CONFIG_SIBYTE_CFE_CONSOLE) += console.o
diff --git a/arch/mips/sibyte/common/Makefile b/arch/mips/sibyte/common/Makefile
index 48a91b9e5870..4f659837c7c6 100644
--- a/arch/mips/sibyte/common/Makefile
+++ b/arch/mips/sibyte/common/Makefile
@@ -1,5 +1,5 @@
1obj-y := 1obj-y := cfe.o
2 2obj-$(CONFIG_SIBYTE_CFE_CONSOLE) += cfe_console.o
3obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o 3obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o
4 4
5EXTRA_CFLAGS += -Werror 5EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/sibyte/cfe/setup.c b/arch/mips/sibyte/common/cfe.c
index eb5396cf81bb..eb5396cf81bb 100644
--- a/arch/mips/sibyte/cfe/setup.c
+++ b/arch/mips/sibyte/common/cfe.c
diff --git a/arch/mips/sibyte/cfe/console.c b/arch/mips/sibyte/common/cfe_console.c
index 81e3d54376e9..81e3d54376e9 100644
--- a/arch/mips/sibyte/cfe/console.c
+++ b/arch/mips/sibyte/common/cfe_console.c
diff --git a/arch/mips/sibyte/sb1250/Makefile b/arch/mips/sibyte/sb1250/Makefile
index 697793783a25..1896f4e77a30 100644
--- a/arch/mips/sibyte/sb1250/Makefile
+++ b/arch/mips/sibyte/sb1250/Makefile
@@ -1,7 +1,6 @@
1obj-y := setup.o irq.o time.o 1obj-y := setup.o irq.o time.o
2 2
3obj-$(CONFIG_SMP) += smp.o 3obj-$(CONFIG_SMP) += smp.o
4obj-$(CONFIG_SIBYTE_STANDALONE) += prom.o
5obj-$(CONFIG_SIBYTE_BUS_WATCHER) += bus_watcher.o 4obj-$(CONFIG_SIBYTE_BUS_WATCHER) += bus_watcher.o
6 5
7EXTRA_CFLAGS += -Werror 6EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index 409dec798863..5e7f2016cceb 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -111,11 +111,6 @@ static int sb1250_set_affinity(unsigned int irq, const struct cpumask *mask)
111 111
112 i = cpumask_first(mask); 112 i = cpumask_first(mask);
113 113
114 if (cpumask_weight(mask) > 1) {
115 printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq);
116 return -1;
117 }
118
119 /* Convert logical CPU to physical CPU */ 114 /* Convert logical CPU to physical CPU */
120 cpu = cpu_logical_map(i); 115 cpu = cpu_logical_map(i);
121 116
diff --git a/arch/mips/sibyte/sb1250/prom.c b/arch/mips/sibyte/sb1250/prom.c
deleted file mode 100644
index 65b1af66b674..000000000000
--- a/arch/mips/sibyte/sb1250/prom.c
+++ /dev/null
@@ -1,96 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/mm.h>
22#include <linux/blkdev.h>
23#include <linux/bootmem.h>
24#include <linux/smp.h>
25#include <linux/initrd.h>
26#include <linux/pm.h>
27
28#include <asm/bootinfo.h>
29#include <asm/reboot.h>
30
31#define MAX_RAM_SIZE ((CONFIG_SIBYTE_STANDALONE_RAM_SIZE * 1024 * 1024) - 1)
32
33static __init void prom_meminit(void)
34{
35#ifdef CONFIG_BLK_DEV_INITRD
36 unsigned long initrd_pstart;
37 unsigned long initrd_pend;
38
39 initrd_pstart = __pa(initrd_start);
40 initrd_pend = __pa(initrd_end);
41 if (initrd_start &&
42 ((initrd_pstart > MAX_RAM_SIZE)
43 || (initrd_pend > MAX_RAM_SIZE))) {
44 panic("initrd out of addressable memory");
45 }
46
47 add_memory_region(0, initrd_pstart,
48 BOOT_MEM_RAM);
49 add_memory_region(initrd_pstart, initrd_pend - initrd_pstart,
50 BOOT_MEM_RESERVED);
51 add_memory_region(initrd_pend,
52 (CONFIG_SIBYTE_STANDALONE_RAM_SIZE * 1024 * 1024) - initrd_pend,
53 BOOT_MEM_RAM);
54#else
55 add_memory_region(0, CONFIG_SIBYTE_STANDALONE_RAM_SIZE * 1024 * 1024,
56 BOOT_MEM_RAM);
57#endif
58}
59
60void prom_cpu0_exit(void *unused)
61{
62 while (1) ;
63}
64
65static void prom_linux_exit(void)
66{
67#ifdef CONFIG_SMP
68 if (smp_processor_id()) {
69 smp_call_function(prom_cpu0_exit, NULL, 1);
70 }
71#endif
72 while(1);
73}
74
75/*
76 * prom_init is called just after the cpu type is determined, from setup_arch()
77 */
78void __init prom_init(void)
79{
80 _machine_restart = (void (*)(char *))prom_linux_exit;
81 _machine_halt = prom_linux_exit;
82 pm_power_off = prom_linux_exit;
83
84 strcpy(arcs_cmdline, "root=/dev/ram0 ");
85
86 prom_meminit();
87}
88
89void __init prom_free_prom_memory(void)
90{
91 /* Not sure what I'm supposed to do here. Nothing, I think */
92}
93
94void prom_putchar(char c)
95{
96}
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index 080c966263b7..672e45d495a9 100644
--- a/arch/mips/sibyte/swarm/setup.c
+++ b/arch/mips/sibyte/swarm/setup.c
@@ -136,20 +136,6 @@ void __init plat_mem_setup(void)
136 if (m41t81_probe()) 136 if (m41t81_probe())
137 swarm_rtc_type = RTC_M4LT81; 137 swarm_rtc_type = RTC_M4LT81;
138 138
139 printk("This kernel optimized for "
140#ifdef CONFIG_SIMULATION
141 "simulation"
142#else
143 "board"
144#endif
145 " runs "
146#ifdef CONFIG_SIBYTE_CFE
147 "with"
148#else
149 "without"
150#endif
151 " CFE\n");
152
153#ifdef CONFIG_VT 139#ifdef CONFIG_VT
154 screen_info = (struct screen_info) { 140 screen_info = (struct screen_info) {
155 0, 0, /* orig-x, orig-y */ 141 0, 0, /* orig-x, orig-y */
diff --git a/arch/mips/sni/eisa.c b/arch/mips/sni/eisa.c
index 7396cd719900..6827feb4de96 100644
--- a/arch/mips/sni/eisa.c
+++ b/arch/mips/sni/eisa.c
@@ -38,7 +38,7 @@ int __init sni_eisa_root_init(void)
38 if (!r) 38 if (!r)
39 return r; 39 return r;
40 40
41 eisa_root_dev.dev.driver_data = &eisa_bus_root; 41 dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root);
42 42
43 if (eisa_root_register(&eisa_bus_root)) { 43 if (eisa_root_register(&eisa_bus_root)) {
44 /* A real bridge may have been registered before 44 /* A real bridge may have been registered before
diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig
index 0db7cf38ed8b..852ae4bb7a85 100644
--- a/arch/mips/txx9/Kconfig
+++ b/arch/mips/txx9/Kconfig
@@ -69,6 +69,7 @@ config SOC_TX4927
69 select IRQ_TXX9 69 select IRQ_TXX9
70 select PCI_TX4927 70 select PCI_TX4927
71 select GPIO_TXX9 71 select GPIO_TXX9
72 select HAS_TXX9_ACLC
72 73
73config SOC_TX4938 74config SOC_TX4938
74 bool 75 bool
@@ -78,6 +79,7 @@ config SOC_TX4938
78 select IRQ_TXX9 79 select IRQ_TXX9
79 select PCI_TX4927 80 select PCI_TX4927
80 select GPIO_TXX9 81 select GPIO_TXX9
82 select HAS_TXX9_ACLC
81 83
82config SOC_TX4939 84config SOC_TX4939
83 bool 85 bool
@@ -85,6 +87,7 @@ config SOC_TX4939
85 select HAS_TXX9_SERIAL 87 select HAS_TXX9_SERIAL
86 select HW_HAS_PCI 88 select HW_HAS_PCI
87 select PCI_TX4927 89 select PCI_TX4927
90 select HAS_TXX9_ACLC
88 91
89config TXX9_7SEGLED 92config TXX9_7SEGLED
90 bool 93 bool
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 8a266c6a3f58..3b7d77d61ce0 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -24,6 +24,7 @@
24#include <linux/serial_core.h> 24#include <linux/serial_core.h>
25#include <linux/mtd/physmap.h> 25#include <linux/mtd/physmap.h>
26#include <linux/leds.h> 26#include <linux/leds.h>
27#include <linux/sysdev.h>
27#include <asm/bootinfo.h> 28#include <asm/bootinfo.h>
28#include <asm/time.h> 29#include <asm/time.h>
29#include <asm/reboot.h> 30#include <asm/reboot.h>
@@ -33,6 +34,7 @@
33#include <asm/txx9/pci.h> 34#include <asm/txx9/pci.h>
34#include <asm/txx9tmr.h> 35#include <asm/txx9tmr.h>
35#include <asm/txx9/ndfmc.h> 36#include <asm/txx9/ndfmc.h>
37#include <asm/txx9/dmac.h>
36#ifdef CONFIG_CPU_TX49XX 38#ifdef CONFIG_CPU_TX49XX
37#include <asm/txx9/tx4938.h> 39#include <asm/txx9/tx4938.h>
38#endif 40#endif
@@ -821,3 +823,176 @@ void __init txx9_iocled_init(unsigned long baseaddr,
821{ 823{
822} 824}
823#endif /* CONFIG_LEDS_GPIO */ 825#endif /* CONFIG_LEDS_GPIO */
826
827void __init txx9_dmac_init(int id, unsigned long baseaddr, int irq,
828 const struct txx9dmac_platform_data *pdata)
829{
830#if defined(CONFIG_TXX9_DMAC) || defined(CONFIG_TXX9_DMAC_MODULE)
831 struct resource res[] = {
832 {
833 .start = baseaddr,
834 .end = baseaddr + 0x800 - 1,
835 .flags = IORESOURCE_MEM,
836#ifndef CONFIG_MACH_TX49XX
837 }, {
838 .start = irq,
839 .flags = IORESOURCE_IRQ,
840#endif
841 }
842 };
843#ifdef CONFIG_MACH_TX49XX
844 struct resource chan_res[] = {
845 {
846 .flags = IORESOURCE_IRQ,
847 }
848 };
849#endif
850 struct platform_device *pdev = platform_device_alloc("txx9dmac", id);
851 struct txx9dmac_chan_platform_data cpdata;
852 int i;
853
854 if (!pdev ||
855 platform_device_add_resources(pdev, res, ARRAY_SIZE(res)) ||
856 platform_device_add_data(pdev, pdata, sizeof(*pdata)) ||
857 platform_device_add(pdev)) {
858 platform_device_put(pdev);
859 return;
860 }
861 memset(&cpdata, 0, sizeof(cpdata));
862 cpdata.dmac_dev = pdev;
863 for (i = 0; i < TXX9_DMA_MAX_NR_CHANNELS; i++) {
864#ifdef CONFIG_MACH_TX49XX
865 chan_res[0].start = irq + i;
866#endif
867 pdev = platform_device_alloc("txx9dmac-chan",
868 id * TXX9_DMA_MAX_NR_CHANNELS + i);
869 if (!pdev ||
870#ifdef CONFIG_MACH_TX49XX
871 platform_device_add_resources(pdev, chan_res,
872 ARRAY_SIZE(chan_res)) ||
873#endif
874 platform_device_add_data(pdev, &cpdata, sizeof(cpdata)) ||
875 platform_device_add(pdev))
876 platform_device_put(pdev);
877 }
878#endif
879}
880
881void __init txx9_aclc_init(unsigned long baseaddr, int irq,
882 unsigned int dmac_id,
883 unsigned int dma_chan_out,
884 unsigned int dma_chan_in)
885{
886#if defined(CONFIG_SND_SOC_TXX9ACLC) || \
887 defined(CONFIG_SND_SOC_TXX9ACLC_MODULE)
888 unsigned int dma_base = dmac_id * TXX9_DMA_MAX_NR_CHANNELS;
889 struct resource res[] = {
890 {
891 .start = baseaddr,
892 .end = baseaddr + 0x100 - 1,
893 .flags = IORESOURCE_MEM,
894 }, {
895 .start = irq,
896 .flags = IORESOURCE_IRQ,
897 }, {
898 .name = "txx9dmac-chan",
899 .start = dma_base + dma_chan_out,
900 .flags = IORESOURCE_DMA,
901 }, {
902 .name = "txx9dmac-chan",
903 .start = dma_base + dma_chan_in,
904 .flags = IORESOURCE_DMA,
905 }
906 };
907 struct platform_device *pdev =
908 platform_device_alloc("txx9aclc-ac97", -1);
909
910 if (!pdev ||
911 platform_device_add_resources(pdev, res, ARRAY_SIZE(res)) ||
912 platform_device_add(pdev))
913 platform_device_put(pdev);
914#endif
915}
916
917static struct sysdev_class txx9_sramc_sysdev_class;
918
919struct txx9_sramc_sysdev {
920 struct sys_device dev;
921 struct bin_attribute bindata_attr;
922 void __iomem *base;
923};
924
925static ssize_t txx9_sram_read(struct kobject *kobj,
926 struct bin_attribute *bin_attr,
927 char *buf, loff_t pos, size_t size)
928{
929 struct txx9_sramc_sysdev *dev = bin_attr->private;
930 size_t ramsize = bin_attr->size;
931
932 if (pos >= ramsize)
933 return 0;
934 if (pos + size > ramsize)
935 size = ramsize - pos;
936 memcpy_fromio(buf, dev->base + pos, size);
937 return size;
938}
939
940static ssize_t txx9_sram_write(struct kobject *kobj,
941 struct bin_attribute *bin_attr,
942 char *buf, loff_t pos, size_t size)
943{
944 struct txx9_sramc_sysdev *dev = bin_attr->private;
945 size_t ramsize = bin_attr->size;
946
947 if (pos >= ramsize)
948 return 0;
949 if (pos + size > ramsize)
950 size = ramsize - pos;
951 memcpy_toio(dev->base + pos, buf, size);
952 return size;
953}
954
955void __init txx9_sramc_init(struct resource *r)
956{
957 struct txx9_sramc_sysdev *dev;
958 size_t size;
959 int err;
960
961 if (!txx9_sramc_sysdev_class.name) {
962 txx9_sramc_sysdev_class.name = "txx9_sram";
963 err = sysdev_class_register(&txx9_sramc_sysdev_class);
964 if (err) {
965 txx9_sramc_sysdev_class.name = NULL;
966 return;
967 }
968 }
969 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
970 if (!dev)
971 return;
972 size = resource_size(r);
973 dev->base = ioremap(r->start, size);
974 if (!dev->base)
975 goto exit;
976 dev->dev.cls = &txx9_sramc_sysdev_class;
977 dev->bindata_attr.attr.name = "bindata";
978 dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR;
979 dev->bindata_attr.read = txx9_sram_read;
980 dev->bindata_attr.write = txx9_sram_write;
981 dev->bindata_attr.size = size;
982 dev->bindata_attr.private = dev;
983 err = sysdev_register(&dev->dev);
984 if (err)
985 goto exit;
986 err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr);
987 if (err) {
988 sysdev_unregister(&dev->dev);
989 goto exit;
990 }
991 return;
992exit:
993 if (dev) {
994 if (dev->base)
995 iounmap(dev->base);
996 kfree(dev);
997 }
998}
diff --git a/arch/mips/txx9/generic/setup_tx4927.c b/arch/mips/txx9/generic/setup_tx4927.c
index 1093549df1a8..3418b2a90f7e 100644
--- a/arch/mips/txx9/generic/setup_tx4927.c
+++ b/arch/mips/txx9/generic/setup_tx4927.c
@@ -22,6 +22,7 @@
22#include <asm/txx9tmr.h> 22#include <asm/txx9tmr.h>
23#include <asm/txx9pio.h> 23#include <asm/txx9pio.h>
24#include <asm/txx9/generic.h> 24#include <asm/txx9/generic.h>
25#include <asm/txx9/dmac.h>
25#include <asm/txx9/tx4927.h> 26#include <asm/txx9/tx4927.h>
26 27
27static void __init tx4927_wdr_init(void) 28static void __init tx4927_wdr_init(void)
@@ -253,6 +254,60 @@ void __init tx4927_mtd_init(int ch)
253 txx9_physmap_flash_init(ch, start, size, &pdata); 254 txx9_physmap_flash_init(ch, start, size, &pdata);
254} 255}
255 256
257void __init tx4927_dmac_init(int memcpy_chan)
258{
259 struct txx9dmac_platform_data plat_data = {
260 .memcpy_chan = memcpy_chan,
261 .have_64bit_regs = true,
262 };
263
264 txx9_dmac_init(0, TX4927_DMA_REG & 0xfffffffffULL,
265 TXX9_IRQ_BASE + TX4927_IR_DMA(0), &plat_data);
266}
267
268void __init tx4927_aclc_init(unsigned int dma_chan_out,
269 unsigned int dma_chan_in)
270{
271 u64 pcfg = __raw_readq(&tx4927_ccfgptr->pcfg);
272 __u64 dmasel_mask = 0, dmasel = 0;
273 unsigned long flags;
274
275 if (!(pcfg & TX4927_PCFG_SEL2))
276 return;
277 /* setup DMASEL (playback:ACLC ch0, capture:ACLC ch1) */
278 switch (dma_chan_out) {
279 case 0:
280 dmasel_mask |= TX4927_PCFG_DMASEL0_MASK;
281 dmasel |= TX4927_PCFG_DMASEL0_ACL0;
282 break;
283 case 2:
284 dmasel_mask |= TX4927_PCFG_DMASEL2_MASK;
285 dmasel |= TX4927_PCFG_DMASEL2_ACL0;
286 break;
287 default:
288 return;
289 }
290 switch (dma_chan_in) {
291 case 1:
292 dmasel_mask |= TX4927_PCFG_DMASEL1_MASK;
293 dmasel |= TX4927_PCFG_DMASEL1_ACL1;
294 break;
295 case 3:
296 dmasel_mask |= TX4927_PCFG_DMASEL3_MASK;
297 dmasel |= TX4927_PCFG_DMASEL3_ACL1;
298 break;
299 default:
300 return;
301 }
302 local_irq_save(flags);
303 txx9_clear64(&tx4927_ccfgptr->pcfg, dmasel_mask);
304 txx9_set64(&tx4927_ccfgptr->pcfg, dmasel);
305 local_irq_restore(flags);
306 txx9_aclc_init(TX4927_ACLC_REG & 0xfffffffffULL,
307 TXX9_IRQ_BASE + TX4927_IR_ACLC,
308 0, dma_chan_out, dma_chan_in);
309}
310
256static void __init tx4927_stop_unused_modules(void) 311static void __init tx4927_stop_unused_modules(void)
257{ 312{
258 __u64 pcfg, rst = 0, ckd = 0; 313 __u64 pcfg, rst = 0, ckd = 0;
diff --git a/arch/mips/txx9/generic/setup_tx4938.c b/arch/mips/txx9/generic/setup_tx4938.c
index 3925219b8973..eb2080110239 100644
--- a/arch/mips/txx9/generic/setup_tx4938.c
+++ b/arch/mips/txx9/generic/setup_tx4938.c
@@ -24,6 +24,7 @@
24#include <asm/txx9pio.h> 24#include <asm/txx9pio.h>
25#include <asm/txx9/generic.h> 25#include <asm/txx9/generic.h>
26#include <asm/txx9/ndfmc.h> 26#include <asm/txx9/ndfmc.h>
27#include <asm/txx9/dmac.h>
27#include <asm/txx9/tx4938.h> 28#include <asm/txx9/tx4938.h>
28 29
29static void __init tx4938_wdr_init(void) 30static void __init tx4938_wdr_init(void)
@@ -239,11 +240,6 @@ void __init tx4938_setup(void)
239 for (i = 0; i < TX4938_NR_TMR; i++) 240 for (i = 0; i < TX4938_NR_TMR; i++)
240 txx9_tmr_init(TX4938_TMR_REG(i) & 0xfffffffffULL); 241 txx9_tmr_init(TX4938_TMR_REG(i) & 0xfffffffffULL);
241 242
242 /* DMA */
243 for (i = 0; i < 2; i++)
244 ____raw_writeq(TX4938_DMA_MCR_MSTEN,
245 (void __iomem *)(TX4938_DMA_REG(i) + 0x50));
246
247 /* PIO */ 243 /* PIO */
248 txx9_gpio_init(TX4938_PIO_REG & 0xfffffffffULL, 0, TX4938_NUM_PIO); 244 txx9_gpio_init(TX4938_PIO_REG & 0xfffffffffULL, 0, TX4938_NUM_PIO);
249 __raw_writel(0, &tx4938_pioptr->maskcpu); 245 __raw_writel(0, &tx4938_pioptr->maskcpu);
@@ -403,6 +399,38 @@ void __init tx4938_ndfmc_init(unsigned int hold, unsigned int spw)
403 txx9_ndfmc_init(baseaddr, &plat_data); 399 txx9_ndfmc_init(baseaddr, &plat_data);
404} 400}
405 401
402void __init tx4938_dmac_init(int memcpy_chan0, int memcpy_chan1)
403{
404 struct txx9dmac_platform_data plat_data = {
405 .have_64bit_regs = true,
406 };
407 int i;
408
409 for (i = 0; i < 2; i++) {
410 plat_data.memcpy_chan = i ? memcpy_chan1 : memcpy_chan0;
411 txx9_dmac_init(i, TX4938_DMA_REG(i) & 0xfffffffffULL,
412 TXX9_IRQ_BASE + TX4938_IR_DMA(i, 0),
413 &plat_data);
414 }
415}
416
417void __init tx4938_aclc_init(void)
418{
419 u64 pcfg = __raw_readq(&tx4938_ccfgptr->pcfg);
420
421 if ((pcfg & TX4938_PCFG_SEL2) &&
422 !(pcfg & TX4938_PCFG_ETH0_SEL))
423 txx9_aclc_init(TX4938_ACLC_REG & 0xfffffffffULL,
424 TXX9_IRQ_BASE + TX4938_IR_ACLC,
425 1, 0, 1);
426}
427
428void __init tx4938_sramc_init(void)
429{
430 if (tx4938_sram_resource.start)
431 txx9_sramc_init(&tx4938_sram_resource);
432}
433
406static void __init tx4938_stop_unused_modules(void) 434static void __init tx4938_stop_unused_modules(void)
407{ 435{
408 __u64 pcfg, rst = 0, ckd = 0; 436 __u64 pcfg, rst = 0, ckd = 0;
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c
index c2bf150c8838..3dc19f482959 100644
--- a/arch/mips/txx9/generic/setup_tx4939.c
+++ b/arch/mips/txx9/generic/setup_tx4939.c
@@ -28,6 +28,7 @@
28#include <asm/txx9tmr.h> 28#include <asm/txx9tmr.h>
29#include <asm/txx9/generic.h> 29#include <asm/txx9/generic.h>
30#include <asm/txx9/ndfmc.h> 30#include <asm/txx9/ndfmc.h>
31#include <asm/txx9/dmac.h>
31#include <asm/txx9/tx4939.h> 32#include <asm/txx9/tx4939.h>
32 33
33static void __init tx4939_wdr_init(void) 34static void __init tx4939_wdr_init(void)
@@ -259,11 +260,6 @@ void __init tx4939_setup(void)
259 for (i = 0; i < TX4939_NR_TMR; i++) 260 for (i = 0; i < TX4939_NR_TMR; i++)
260 txx9_tmr_init(TX4939_TMR_REG(i) & 0xfffffffffULL); 261 txx9_tmr_init(TX4939_TMR_REG(i) & 0xfffffffffULL);
261 262
262 /* DMA */
263 for (i = 0; i < 2; i++)
264 ____raw_writeq(TX4938_DMA_MCR_MSTEN,
265 (void __iomem *)(TX4939_DMA_REG(i) + 0x50));
266
267 /* set PCIC1 reset (required to prevent hangup on BIST) */ 263 /* set PCIC1 reset (required to prevent hangup on BIST) */
268 txx9_set64(&tx4939_ccfgptr->clkctr, TX4939_CLKCTR_PCI1RST); 264 txx9_set64(&tx4939_ccfgptr->clkctr, TX4939_CLKCTR_PCI1RST);
269 pcfg = ____raw_readq(&tx4939_ccfgptr->pcfg); 265 pcfg = ____raw_readq(&tx4939_ccfgptr->pcfg);
@@ -474,6 +470,53 @@ void __init tx4939_ndfmc_init(unsigned int hold, unsigned int spw,
474 txx9_ndfmc_init(TX4939_NDFMC_REG & 0xfffffffffULL, &plat_data); 470 txx9_ndfmc_init(TX4939_NDFMC_REG & 0xfffffffffULL, &plat_data);
475} 471}
476 472
473void __init tx4939_dmac_init(int memcpy_chan0, int memcpy_chan1)
474{
475 struct txx9dmac_platform_data plat_data = {
476 .have_64bit_regs = true,
477 };
478 int i;
479
480 for (i = 0; i < 2; i++) {
481 plat_data.memcpy_chan = i ? memcpy_chan1 : memcpy_chan0;
482 txx9_dmac_init(i, TX4939_DMA_REG(i) & 0xfffffffffULL,
483 TXX9_IRQ_BASE + TX4939_IR_DMA(i, 0),
484 &plat_data);
485 }
486}
487
488void __init tx4939_aclc_init(void)
489{
490 u64 pcfg = __raw_readq(&tx4939_ccfgptr->pcfg);
491
492 if ((pcfg & TX4939_PCFG_I2SMODE_MASK) == TX4939_PCFG_I2SMODE_ACLC)
493 txx9_aclc_init(TX4939_ACLC_REG & 0xfffffffffULL,
494 TXX9_IRQ_BASE + TX4939_IR_ACLC, 1, 0, 1);
495}
496
497void __init tx4939_sramc_init(void)
498{
499 if (tx4939_sram_resource.start)
500 txx9_sramc_init(&tx4939_sram_resource);
501}
502
503void __init tx4939_rng_init(void)
504{
505 static struct resource res = {
506 .start = TX4939_RNG_REG & 0xfffffffffULL,
507 .end = (TX4939_RNG_REG & 0xfffffffffULL) + 0x30 - 1,
508 .flags = IORESOURCE_MEM,
509 };
510 static struct platform_device pdev = {
511 .name = "tx4939-rng",
512 .id = -1,
513 .num_resources = 1,
514 .resource = &res,
515 };
516
517 platform_device_register(&pdev);
518}
519
477static void __init tx4939_stop_unused_modules(void) 520static void __init tx4939_stop_unused_modules(void)
478{ 521{
479 __u64 pcfg, rst = 0, ckd = 0; 522 __u64 pcfg, rst = 0, ckd = 0;
diff --git a/arch/mips/txx9/rbtx4927/setup.c b/arch/mips/txx9/rbtx4927/setup.c
index 01129a9d50fa..ee468eaee4f7 100644
--- a/arch/mips/txx9/rbtx4927/setup.c
+++ b/arch/mips/txx9/rbtx4927/setup.c
@@ -337,6 +337,14 @@ static void __init rbtx4927_device_init(void)
337 rbtx4927_ne_init(); 337 rbtx4927_ne_init();
338 tx4927_wdt_init(); 338 tx4927_wdt_init();
339 rbtx4927_mtd_init(); 339 rbtx4927_mtd_init();
340 if (TX4927_REV_PCODE() == 0x4927) {
341 tx4927_dmac_init(2);
342 tx4927_aclc_init(0, 1);
343 } else {
344 tx4938_dmac_init(0, 2);
345 tx4938_aclc_init();
346 }
347 platform_device_register_simple("txx9aclc-generic", -1, NULL, 0);
340 txx9_iocled_init(RBTX4927_LED_ADDR - IO_BASE, -1, 3, 1, "green", NULL); 348 txx9_iocled_init(RBTX4927_LED_ADDR - IO_BASE, -1, 3, 1, "green", NULL);
341 rbtx4927_gpioled_init(); 349 rbtx4927_gpioled_init();
342} 350}
diff --git a/arch/mips/txx9/rbtx4938/setup.c b/arch/mips/txx9/rbtx4938/setup.c
index 65d13df8878a..d66509b14284 100644
--- a/arch/mips/txx9/rbtx4938/setup.c
+++ b/arch/mips/txx9/rbtx4938/setup.c
@@ -355,6 +355,10 @@ static void __init rbtx4938_device_init(void)
355 /* TC58DVM82A1FT: tDH=10ns, tWP=tRP=tREADID=35ns */ 355 /* TC58DVM82A1FT: tDH=10ns, tWP=tRP=tREADID=35ns */
356 tx4938_ndfmc_init(10, 35); 356 tx4938_ndfmc_init(10, 35);
357 tx4938_ata_init(RBTX4938_IRQ_IOC_ATA, 0, 1); 357 tx4938_ata_init(RBTX4938_IRQ_IOC_ATA, 0, 1);
358 tx4938_dmac_init(0, 2);
359 tx4938_aclc_init();
360 platform_device_register_simple("txx9aclc-generic", -1, NULL, 0);
361 tx4938_sramc_init();
358 txx9_iocled_init(RBTX4938_LED_ADDR - IO_BASE, -1, 8, 1, "green", NULL); 362 txx9_iocled_init(RBTX4938_LED_ADDR - IO_BASE, -1, 8, 1, "green", NULL);
359} 363}
360 364
diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
index 4199c6fd4d1d..c033ffe71cdf 100644
--- a/arch/mips/txx9/rbtx4939/setup.c
+++ b/arch/mips/txx9/rbtx4939/setup.c
@@ -498,6 +498,11 @@ static void __init rbtx4939_device_init(void)
498 tx4939_wdt_init(); 498 tx4939_wdt_init();
499 tx4939_ata_init(); 499 tx4939_ata_init();
500 tx4939_rtc_init(); 500 tx4939_rtc_init();
501 tx4939_dmac_init(0, 2);
502 tx4939_aclc_init();
503 platform_device_register_simple("txx9aclc-generic", -1, NULL, 0);
504 tx4939_sramc_init();
505 tx4939_rng_init();
501} 506}
502 507
503static void __init rbtx4939_setup(void) 508static void __init rbtx4939_setup(void)
diff --git a/arch/mn10300/include/asm/kmap_types.h b/arch/mn10300/include/asm/kmap_types.h
index 3398f9f35603..76d093b58d4f 100644
--- a/arch/mn10300/include/asm/kmap_types.h
+++ b/arch/mn10300/include/asm/kmap_types.h
@@ -1,31 +1,6 @@
1/* MN10300 kmap_atomic() slot IDs
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11#ifndef _ASM_KMAP_TYPES_H 1#ifndef _ASM_KMAP_TYPES_H
12#define _ASM_KMAP_TYPES_H 2#define _ASM_KMAP_TYPES_H
13 3
14enum km_type { 4#include <asm-generic/kmap_types.h>
15 KM_BOUNCE_READ,
16 KM_SKB_SUNRPC_DATA,
17 KM_SKB_DATA_SOFTIRQ,
18 KM_USER0,
19 KM_USER1,
20 KM_BIO_SRC_IRQ,
21 KM_BIO_DST_IRQ,
22 KM_PTE0,
23 KM_PTE1,
24 KM_IRQ0,
25 KM_IRQ1,
26 KM_SOFTIRQ0,
27 KM_SOFTIRQ1,
28 KM_TYPE_NR
29};
30 5
31#endif /* _ASM_KMAP_TYPES_H */ 6#endif /* _ASM_KMAP_TYPES_H */
diff --git a/arch/mn10300/kernel/init_task.c b/arch/mn10300/kernel/init_task.c
index 5ac3566f8c98..80d423b80af3 100644
--- a/arch/mn10300/kernel/init_task.c
+++ b/arch/mn10300/kernel/init_task.c
@@ -20,9 +20,6 @@
20 20
21static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 21static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
22static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 22static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
23struct mm_struct init_mm = INIT_MM(init_mm);
24EXPORT_SYMBOL(init_mm);
25
26/* 23/*
27 * Initial thread structure. 24 * Initial thread structure.
28 * 25 *
diff --git a/arch/parisc/include/asm/errno.h b/arch/parisc/include/asm/errno.h
index e2f3ddc796be..9992abdd782d 100644
--- a/arch/parisc/include/asm/errno.h
+++ b/arch/parisc/include/asm/errno.h
@@ -120,5 +120,6 @@
120#define EOWNERDEAD 254 /* Owner died */ 120#define EOWNERDEAD 254 /* Owner died */
121#define ENOTRECOVERABLE 255 /* State not recoverable */ 121#define ENOTRECOVERABLE 255 /* State not recoverable */
122 122
123#define ERFKILL 256 /* Operation not possible due to RF-kill */
123 124
124#endif 125#endif
diff --git a/arch/parisc/include/asm/kmap_types.h b/arch/parisc/include/asm/kmap_types.h
index 806aae3c5338..58e91ed0388f 100644
--- a/arch/parisc/include/asm/kmap_types.h
+++ b/arch/parisc/include/asm/kmap_types.h
@@ -1,30 +1,12 @@
1#ifndef _ASM_KMAP_TYPES_H 1#ifndef _ASM_KMAP_TYPES_H
2#define _ASM_KMAP_TYPES_H 2#define _ASM_KMAP_TYPES_H
3 3
4
5#ifdef CONFIG_DEBUG_HIGHMEM 4#ifdef CONFIG_DEBUG_HIGHMEM
6# define D(n) __KM_FENCE_##n , 5#define __WITH_KM_FENCE
7#else
8# define D(n)
9#endif 6#endif
10 7
11enum km_type { 8#include <asm-generic/kmap_types.h>
12D(0) KM_BOUNCE_READ,
13D(1) KM_SKB_SUNRPC_DATA,
14D(2) KM_SKB_DATA_SOFTIRQ,
15D(3) KM_USER0,
16D(4) KM_USER1,
17D(5) KM_BIO_SRC_IRQ,
18D(6) KM_BIO_DST_IRQ,
19D(7) KM_PTE0,
20D(8) KM_PTE1,
21D(9) KM_IRQ0,
22D(10) KM_IRQ1,
23D(11) KM_SOFTIRQ0,
24D(12) KM_SOFTIRQ1,
25D(13) KM_TYPE_NR
26};
27 9
28#undef D 10#undef __WITH_KM_FENCE
29 11
30#endif 12#endif
diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c
index 1e25a45d64c1..82974b20fc10 100644
--- a/arch/parisc/kernel/init_task.c
+++ b/arch/parisc/kernel/init_task.c
@@ -36,10 +36,6 @@
36 36
37static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 37static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
38static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 38static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
39struct mm_struct init_mm = INIT_MM(init_mm);
40
41EXPORT_SYMBOL(init_mm);
42
43/* 39/*
44 * Initial task structure. 40 * Initial task structure.
45 * 41 *
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index cdc9a6ff4be8..9fb344d5a86a 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -42,6 +42,10 @@ config GENERIC_HARDIRQS
42 bool 42 bool
43 default y 43 default y
44 44
45config GENERIC_HARDIRQS_NO__DO_IRQ
46 bool
47 default y
48
45config HAVE_SETUP_PER_CPU_AREA 49config HAVE_SETUP_PER_CPU_AREA
46 def_bool PPC64 50 def_bool PPC64
47 51
@@ -89,10 +93,6 @@ config GENERIC_HWEIGHT
89 bool 93 bool
90 default y 94 default y
91 95
92config GENERIC_CALIBRATE_DELAY
93 bool
94 default y
95
96config GENERIC_FIND_NEXT_BIT 96config GENERIC_FIND_NEXT_BIT
97 bool 97 bool
98 default y 98 default y
@@ -125,6 +125,7 @@ config PPC
125 select USE_GENERIC_SMP_HELPERS if SMP 125 select USE_GENERIC_SMP_HELPERS if SMP
126 select HAVE_OPROFILE 126 select HAVE_OPROFILE
127 select HAVE_SYSCALL_WRAPPERS if PPC64 127 select HAVE_SYSCALL_WRAPPERS if PPC64
128 select GENERIC_ATOMIC64 if PPC32
128 129
129config EARLY_PRINTK 130config EARLY_PRINTK
130 bool 131 bool
@@ -296,9 +297,19 @@ config IOMMU_VMERGE
296config IOMMU_HELPER 297config IOMMU_HELPER
297 def_bool PPC64 298 def_bool PPC64
298 299
300config SWIOTLB
301 bool "SWIOTLB support"
302 default n
303 select IOMMU_HELPER
304 ---help---
305 Support for IO bounce buffering for systems without an IOMMU.
306 This allows us to DMA to the full physical address space on
307 platforms where the size of a physical address is larger
308 than the bus address. Not all platforms support this.
309
299config PPC_NEED_DMA_SYNC_OPS 310config PPC_NEED_DMA_SYNC_OPS
300 def_bool y 311 def_bool y
301 depends on NOT_COHERENT_CACHE 312 depends on (NOT_COHERENT_CACHE || SWIOTLB)
302 313
303config HOTPLUG_CPU 314config HOTPLUG_CPU
304 bool "Support for enabling/disabling CPUs" 315 bool "Support for enabling/disabling CPUs"
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index a1098e23221f..d79a902d155a 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -41,6 +41,19 @@ config HCALL_STATS
41 This option will add a small amount of overhead to all hypervisor 41 This option will add a small amount of overhead to all hypervisor
42 calls. 42 calls.
43 43
44config PPC_EMULATED_STATS
45 bool "Emulated instructions tracking"
46 depends on DEBUG_FS
47 help
48 Adds code to keep track of the number of instructions that are
49 emulated by the in-kernel emulator. Counters for the various classes
50 of emulated instructions are available under
51 powerpc/emulated_instructions/ in the root of the debugfs file
52 system. Optionally (controlled by
53 powerpc/emulated_instructions/do_warn in debugfs), rate-limited
54 warnings can be printed to the console when instructions are
55 emulated.
56
44config CODE_PATCHING_SELFTEST 57config CODE_PATCHING_SELFTEST
45 bool "Run self-tests of the code-patching code." 58 bool "Run self-tests of the code-patching code."
46 depends on DEBUG_KERNEL 59 depends on DEBUG_KERNEL
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 551fc58c05cf..bc35f4e2b81c 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -142,6 +142,7 @@ head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o
142 142
143head-$(CONFIG_PPC64) += arch/powerpc/kernel/entry_64.o 143head-$(CONFIG_PPC64) += arch/powerpc/kernel/entry_64.o
144head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o 144head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
145head-$(CONFIG_ALTIVEC) += arch/powerpc/kernel/vector.o
145 146
146core-y += arch/powerpc/kernel/ \ 147core-y += arch/powerpc/kernel/ \
147 arch/powerpc/mm/ \ 148 arch/powerpc/mm/ \
diff --git a/arch/powerpc/boot/dts/gef_ppc9a.dts b/arch/powerpc/boot/dts/gef_ppc9a.dts
index 53a7a6255909..910944edd886 100644
--- a/arch/powerpc/boot/dts/gef_ppc9a.dts
+++ b/arch/powerpc/boot/dts/gef_ppc9a.dts
@@ -164,9 +164,21 @@
164 device_type = "soc"; 164 device_type = "soc";
165 compatible = "fsl,mpc8641-soc", "simple-bus"; 165 compatible = "fsl,mpc8641-soc", "simple-bus";
166 ranges = <0x0 0xfef00000 0x00100000>; 166 ranges = <0x0 0xfef00000 0x00100000>;
167 reg = <0xfef00000 0x100000>; // CCSRBAR 1M
168 bus-frequency = <33333333>; 167 bus-frequency = <33333333>;
169 168
169 mcm-law@0 {
170 compatible = "fsl,mcm-law";
171 reg = <0x0 0x1000>;
172 fsl,num-laws = <10>;
173 };
174
175 mcm@1000 {
176 compatible = "fsl,mpc8641-mcm", "fsl,mcm";
177 reg = <0x1000 0x1000>;
178 interrupts = <17 2>;
179 interrupt-parent = <&mpic>;
180 };
181
170 i2c1: i2c@3000 { 182 i2c1: i2c@3000 {
171 #address-cells = <1>; 183 #address-cells = <1>;
172 #size-cells = <0>; 184 #size-cells = <0>;
diff --git a/arch/powerpc/boot/dts/gef_sbc310.dts b/arch/powerpc/boot/dts/gef_sbc310.dts
index 1569117e5ddc..0f4c9ec2c3a6 100644
--- a/arch/powerpc/boot/dts/gef_sbc310.dts
+++ b/arch/powerpc/boot/dts/gef_sbc310.dts
@@ -163,9 +163,21 @@
163 device_type = "soc"; 163 device_type = "soc";
164 compatible = "simple-bus"; 164 compatible = "simple-bus";
165 ranges = <0x0 0xfef00000 0x00100000>; 165 ranges = <0x0 0xfef00000 0x00100000>;
166 reg = <0xfef00000 0x100000>; // CCSRBAR 1M
167 bus-frequency = <33333333>; 166 bus-frequency = <33333333>;
168 167
168 mcm-law@0 {
169 compatible = "fsl,mcm-law";
170 reg = <0x0 0x1000>;
171 fsl,num-laws = <10>;
172 };
173
174 mcm@1000 {
175 compatible = "fsl,mpc8641-mcm", "fsl,mcm";
176 reg = <0x1000 0x1000>;
177 interrupts = <17 2>;
178 interrupt-parent = <&mpic>;
179 };
180
169 i2c1: i2c@3000 { 181 i2c1: i2c@3000 {
170 #address-cells = <1>; 182 #address-cells = <1>;
171 #size-cells = <0>; 183 #size-cells = <0>;
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index 6582dbd36da7..217f8aa66725 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -128,9 +128,21 @@
128 device_type = "soc"; 128 device_type = "soc";
129 compatible = "simple-bus"; 129 compatible = "simple-bus";
130 ranges = <0x0 0xfef00000 0x00100000>; 130 ranges = <0x0 0xfef00000 0x00100000>;
131 reg = <0xfef00000 0x100000>; // CCSRBAR 1M
132 bus-frequency = <33333333>; 131 bus-frequency = <33333333>;
133 132
133 mcm-law@0 {
134 compatible = "fsl,mcm-law";
135 reg = <0x0 0x1000>;
136 fsl,num-laws = <10>;
137 };
138
139 mcm@1000 {
140 compatible = "fsl,mpc8641-mcm", "fsl,mcm";
141 reg = <0x1000 0x1000>;
142 interrupts = <17 2>;
143 interrupt-parent = <&mpic>;
144 };
145
134 i2c1: i2c@3000 { 146 i2c1: i2c@3000 {
135 #address-cells = <1>; 147 #address-cells = <1>;
136 #size-cells = <0>; 148 #size-cells = <0>;
diff --git a/arch/powerpc/boot/dts/ksi8560.dts b/arch/powerpc/boot/dts/ksi8560.dts
index c9cfd374bffb..bdb7fc0fa332 100644
--- a/arch/powerpc/boot/dts/ksi8560.dts
+++ b/arch/powerpc/boot/dts/ksi8560.dts
@@ -56,6 +56,19 @@
56 ranges = <0x00000000 0xfdf00000 0x00100000>; 56 ranges = <0x00000000 0xfdf00000 0x00100000>;
57 bus-frequency = <0>; /* Fixed by bootwrapper */ 57 bus-frequency = <0>; /* Fixed by bootwrapper */
58 58
59 ecm-law@0 {
60 compatible = "fsl,ecm-law";
61 reg = <0x0 0x1000>;
62 fsl,num-laws = <8>;
63 };
64
65 ecm@1000 {
66 compatible = "fsl,mpc8560-ecm", "fsl,ecm";
67 reg = <0x1000 0x1000>;
68 interrupts = <17 2>;
69 interrupt-parent = <&mpic>;
70 };
71
59 memory-controller@2000 { 72 memory-controller@2000 {
60 compatible = "fsl,mpc8540-memory-controller"; 73 compatible = "fsl,mpc8540-memory-controller";
61 reg = <0x2000 0x1000>; 74 reg = <0x2000 0x1000>;
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index 57c595bf1071..436c9c671dd9 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -249,6 +249,8 @@
249 reg = <0xe0100000 0x480>; 249 reg = <0xe0100000 0x480>;
250 brg-frequency = <0>; 250 brg-frequency = <0>;
251 bus-frequency = <198000000>; 251 bus-frequency = <198000000>;
252 fsl,qe-num-riscs = <1>;
253 fsl,qe-num-snums = <28>;
252 254
253 muram@10000 { 255 muram@10000 {
254 #address-cells = <1>; 256 #address-cells = <1>;
@@ -369,7 +371,6 @@
369 }; 371 };
370 372
371 pci0: pci@e0008500 { 373 pci0: pci@e0008500 {
372 cell-index = <1>;
373 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 374 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
374 interrupt-map = < 375 interrupt-map = <
375 /* IDSEL 0x11 AD17 */ 376 /* IDSEL 0x11 AD17 */
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 4319bd70a580..9a0952f74b81 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -221,6 +221,8 @@
221 reg = <0xe0100000 0x480>; 221 reg = <0xe0100000 0x480>;
222 brg-frequency = <0>; 222 brg-frequency = <0>;
223 bus-frequency = <198000000>; 223 bus-frequency = <198000000>;
224 fsl,qe-num-riscs = <1>;
225 fsl,qe-num-snums = <28>;
224 226
225 muram@10000 { 227 muram@10000 {
226 #address-cells = <1>; 228 #address-cells = <1>;
@@ -327,7 +329,6 @@
327 }; 329 };
328 330
329 pci0: pci@e0008500 { 331 pci0: pci@e0008500 {
330 cell-index = <1>;
331 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 332 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
332 interrupt-map = < 333 interrupt-map = <
333 /* IDSEL 0x10 AD16 (USB) */ 334 /* IDSEL 0x10 AD16 (USB) */
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index 1ae38f0ddef8..e3eeaeda9187 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -278,7 +278,6 @@
278 }; 278 };
279 279
280 pci0: pci@e0008500 { 280 pci0: pci@e0008500 {
281 cell-index = <1>;
282 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 281 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
283 interrupt-map = < 282 interrupt-map = <
284 /* IDSEL 0x10 - SATA */ 283 /* IDSEL 0x10 - SATA */
@@ -301,7 +300,6 @@
301 }; 300 };
302 301
303 pci1: pci@e0008600 { 302 pci1: pci@e0008600 {
304 cell-index = <2>;
305 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 303 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
306 interrupt-map = < 304 interrupt-map = <
307 /* IDSEL 0x0E - MiniPCI Slot */ 305 /* IDSEL 0x0E - MiniPCI Slot */
diff --git a/arch/powerpc/boot/dts/mpc8349emitxgp.dts b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
index 662abe1fb804..eb732115f016 100644
--- a/arch/powerpc/boot/dts/mpc8349emitxgp.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
@@ -227,7 +227,6 @@
227 }; 227 };
228 228
229 pci0: pci@e0008600 { 229 pci0: pci@e0008600 {
230 cell-index = <2>;
231 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 230 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
232 interrupt-map = < 231 interrupt-map = <
233 /* IDSEL 0x0F - PCI Slot */ 232 /* IDSEL 0x0F - PCI Slot */
diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts b/arch/powerpc/boot/dts/mpc834x_mds.dts
index d9f0a2325fa4..a2553a6f9009 100644
--- a/arch/powerpc/boot/dts/mpc834x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
@@ -286,7 +286,6 @@
286 }; 286 };
287 287
288 pci0: pci@e0008500 { 288 pci0: pci@e0008500 {
289 cell-index = <1>;
290 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 289 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
291 interrupt-map = < 290 interrupt-map = <
292 291
@@ -348,7 +347,6 @@
348 }; 347 };
349 348
350 pci1: pci@e0008600 { 349 pci1: pci@e0008600 {
351 cell-index = <2>;
352 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 350 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
353 interrupt-map = < 351 interrupt-map = <
354 352
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index 6e34f170fa62..39ff4c829caf 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -289,6 +289,8 @@
289 reg = <0xe0100000 0x480>; 289 reg = <0xe0100000 0x480>;
290 brg-frequency = <0>; 290 brg-frequency = <0>;
291 bus-frequency = <396000000>; 291 bus-frequency = <396000000>;
292 fsl,qe-num-riscs = <2>;
293 fsl,qe-num-snums = <28>;
292 294
293 muram@10000 { 295 muram@10000 {
294 #address-cells = <1>; 296 #address-cells = <1>;
@@ -410,7 +412,6 @@
410 }; 412 };
411 413
412 pci0: pci@e0008500 { 414 pci0: pci@e0008500 {
413 cell-index = <1>;
414 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 415 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
415 interrupt-map = < 416 interrupt-map = <
416 417
diff --git a/arch/powerpc/boot/dts/mpc836x_rdk.dts b/arch/powerpc/boot/dts/mpc836x_rdk.dts
index 37b789510d68..6315d6fcc58a 100644
--- a/arch/powerpc/boot/dts/mpc836x_rdk.dts
+++ b/arch/powerpc/boot/dts/mpc836x_rdk.dts
@@ -198,6 +198,8 @@
198 clock-frequency = <0>; 198 clock-frequency = <0>;
199 bus-frequency = <0>; 199 bus-frequency = <0>;
200 brg-frequency = <0>; 200 brg-frequency = <0>;
201 fsl,qe-num-riscs = <2>;
202 fsl,qe-num-snums = <28>;
201 203
202 muram@10000 { 204 muram@10000 {
203 #address-cells = <1>; 205 #address-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8377_mds.dts b/arch/powerpc/boot/dts/mpc8377_mds.dts
index 963708017e6c..67bb372c9451 100644
--- a/arch/powerpc/boot/dts/mpc8377_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8377_mds.dts
@@ -383,7 +383,6 @@
383 }; 383 };
384 384
385 pci0: pci@e0008500 { 385 pci0: pci@e0008500 {
386 cell-index = <0>;
387 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 386 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
388 interrupt-map = < 387 interrupt-map = <
389 388
diff --git a/arch/powerpc/boot/dts/mpc8378_mds.dts b/arch/powerpc/boot/dts/mpc8378_mds.dts
index 651ff2f9db2d..a955a577db81 100644
--- a/arch/powerpc/boot/dts/mpc8378_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8378_mds.dts
@@ -367,7 +367,6 @@
367 }; 367 };
368 368
369 pci0: pci@e0008500 { 369 pci0: pci@e0008500 {
370 cell-index = <0>;
371 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 370 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
372 interrupt-map = < 371 interrupt-map = <
373 372
diff --git a/arch/powerpc/boot/dts/mpc8379_mds.dts b/arch/powerpc/boot/dts/mpc8379_mds.dts
index d6f208b8297a..d266ddbfc28d 100644
--- a/arch/powerpc/boot/dts/mpc8379_mds.dts
+++ b/arch/powerpc/boot/dts/mpc8379_mds.dts
@@ -397,7 +397,6 @@
397 }; 397 };
398 398
399 pci0: pci@e0008500 { 399 pci0: pci@e0008500 {
400 cell-index = <0>;
401 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 400 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
402 interrupt-map = < 401 interrupt-map = <
403 402
diff --git a/arch/powerpc/boot/dts/mpc8536ds.dts b/arch/powerpc/boot/dts/mpc8536ds.dts
index b31c5041350b..e781ad2f1f8a 100644
--- a/arch/powerpc/boot/dts/mpc8536ds.dts
+++ b/arch/powerpc/boot/dts/mpc8536ds.dts
@@ -51,9 +51,21 @@
51 device_type = "soc"; 51 device_type = "soc";
52 compatible = "simple-bus"; 52 compatible = "simple-bus";
53 ranges = <0x0 0xffe00000 0x100000>; 53 ranges = <0x0 0xffe00000 0x100000>;
54 reg = <0xffe00000 0x1000>;
55 bus-frequency = <0>; // Filled out by uboot. 54 bus-frequency = <0>; // Filled out by uboot.
56 55
56 ecm-law@0 {
57 compatible = "fsl,ecm-law";
58 reg = <0x0 0x1000>;
59 fsl,num-laws = <12>;
60 };
61
62 ecm@1000 {
63 compatible = "fsl,mpc8536-ecm", "fsl,ecm";
64 reg = <0x1000 0x1000>;
65 interrupts = <17 2>;
66 interrupt-parent = <&mpic>;
67 };
68
57 memory-controller@2000 { 69 memory-controller@2000 {
58 compatible = "fsl,mpc8536-memory-controller"; 70 compatible = "fsl,mpc8536-memory-controller";
59 reg = <0x2000 0x1000>; 71 reg = <0x2000 0x1000>;
@@ -321,7 +333,6 @@
321 }; 333 };
322 334
323 pci0: pci@ffe08000 { 335 pci0: pci@ffe08000 {
324 cell-index = <0>;
325 compatible = "fsl,mpc8540-pci"; 336 compatible = "fsl,mpc8540-pci";
326 device_type = "pci"; 337 device_type = "pci";
327 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 338 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
@@ -346,7 +357,6 @@
346 }; 357 };
347 358
348 pci1: pcie@ffe09000 { 359 pci1: pcie@ffe09000 {
349 cell-index = <1>;
350 compatible = "fsl,mpc8548-pcie"; 360 compatible = "fsl,mpc8548-pcie";
351 device_type = "pci"; 361 device_type = "pci";
352 #interrupt-cells = <1>; 362 #interrupt-cells = <1>;
@@ -383,7 +393,6 @@
383 }; 393 };
384 394
385 pci2: pcie@ffe0a000 { 395 pci2: pcie@ffe0a000 {
386 cell-index = <2>;
387 compatible = "fsl,mpc8548-pcie"; 396 compatible = "fsl,mpc8548-pcie";
388 device_type = "pci"; 397 device_type = "pci";
389 #interrupt-cells = <1>; 398 #interrupt-cells = <1>;
@@ -420,7 +429,6 @@
420 }; 429 };
421 430
422 pci3: pcie@ffe0b000 { 431 pci3: pcie@ffe0b000 {
423 cell-index = <3>;
424 compatible = "fsl,mpc8548-pcie"; 432 compatible = "fsl,mpc8548-pcie";
425 device_type = "pci"; 433 device_type = "pci";
426 #interrupt-cells = <1>; 434 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts
index ddd67be10b03..9dc292962a9a 100644
--- a/arch/powerpc/boot/dts/mpc8540ads.dts
+++ b/arch/powerpc/boot/dts/mpc8540ads.dts
@@ -55,9 +55,21 @@
55 device_type = "soc"; 55 device_type = "soc";
56 compatible = "simple-bus"; 56 compatible = "simple-bus";
57 ranges = <0x0 0xe0000000 0x100000>; 57 ranges = <0x0 0xe0000000 0x100000>;
58 reg = <0xe0000000 0x100000>; // CCSRBAR 1M
59 bus-frequency = <0>; 58 bus-frequency = <0>;
60 59
60 ecm-law@0 {
61 compatible = "fsl,ecm-law";
62 reg = <0x0 0x1000>;
63 fsl,num-laws = <8>;
64 };
65
66 ecm@1000 {
67 compatible = "fsl,mpc8540-ecm", "fsl,ecm";
68 reg = <0x1000 0x1000>;
69 interrupts = <17 2>;
70 interrupt-parent = <&mpic>;
71 };
72
61 memory-controller@2000 { 73 memory-controller@2000 {
62 compatible = "fsl,8540-memory-controller"; 74 compatible = "fsl,8540-memory-controller";
63 reg = <0x2000 0x1000>; 75 reg = <0x2000 0x1000>;
@@ -258,7 +270,6 @@
258 }; 270 };
259 271
260 pci0: pci@e0008000 { 272 pci0: pci@e0008000 {
261 cell-index = <0>;
262 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 273 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
263 interrupt-map = < 274 interrupt-map = <
264 275
diff --git a/arch/powerpc/boot/dts/mpc8541cds.dts b/arch/powerpc/boot/dts/mpc8541cds.dts
index e45097f44fbd..9a3ad311aedf 100644
--- a/arch/powerpc/boot/dts/mpc8541cds.dts
+++ b/arch/powerpc/boot/dts/mpc8541cds.dts
@@ -55,9 +55,21 @@
55 device_type = "soc"; 55 device_type = "soc";
56 compatible = "simple-bus"; 56 compatible = "simple-bus";
57 ranges = <0x0 0xe0000000 0x100000>; 57 ranges = <0x0 0xe0000000 0x100000>;
58 reg = <0xe0000000 0x1000>; // CCSRBAR 1M
59 bus-frequency = <0>; 58 bus-frequency = <0>;
60 59
60 ecm-law@0 {
61 compatible = "fsl,ecm-law";
62 reg = <0x0 0x1000>;
63 fsl,num-laws = <8>;
64 };
65
66 ecm@1000 {
67 compatible = "fsl,mpc8541-ecm", "fsl,ecm";
68 reg = <0x1000 0x1000>;
69 interrupts = <17 2>;
70 interrupt-parent = <&mpic>;
71 };
72
61 memory-controller@2000 { 73 memory-controller@2000 {
62 compatible = "fsl,8541-memory-controller"; 74 compatible = "fsl,8541-memory-controller";
63 reg = <0x2000 0x1000>; 75 reg = <0x2000 0x1000>;
@@ -272,7 +284,6 @@
272 }; 284 };
273 285
274 pci0: pci@e0008000 { 286 pci0: pci@e0008000 {
275 cell-index = <0>;
276 interrupt-map-mask = <0x1f800 0x0 0x0 0x7>; 287 interrupt-map-mask = <0x1f800 0x0 0x0 0x7>;
277 interrupt-map = < 288 interrupt-map = <
278 289
@@ -344,7 +355,6 @@
344 }; 355 };
345 356
346 pci1: pci@e0009000 { 357 pci1: pci@e0009000 {
347 cell-index = <1>;
348 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 358 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
349 interrupt-map = < 359 interrupt-map = <
350 360
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index 7c6932be0197..98e94b465662 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -57,9 +57,21 @@
57 compatible = "simple-bus"; 57 compatible = "simple-bus";
58 58
59 ranges = <0x0 0xe0000000 0x100000>; 59 ranges = <0x0 0xe0000000 0x100000>;
60 reg = <0xe0000000 0x1000>; // CCSRBAR 1M
61 bus-frequency = <0>; // Filled out by uboot. 60 bus-frequency = <0>; // Filled out by uboot.
62 61
62 ecm-law@0 {
63 compatible = "fsl,ecm-law";
64 reg = <0x0 0x1000>;
65 fsl,num-laws = <10>;
66 };
67
68 ecm@1000 {
69 compatible = "fsl,mpc8544-ecm", "fsl,ecm";
70 reg = <0x1000 0x1000>;
71 interrupts = <17 2>;
72 interrupt-parent = <&mpic>;
73 };
74
63 memory-controller@2000 { 75 memory-controller@2000 {
64 compatible = "fsl,8544-memory-controller"; 76 compatible = "fsl,8544-memory-controller";
65 reg = <0x2000 0x1000>; 77 reg = <0x2000 0x1000>;
@@ -274,7 +286,6 @@
274 }; 286 };
275 287
276 pci0: pci@e0008000 { 288 pci0: pci@e0008000 {
277 cell-index = <0>;
278 compatible = "fsl,mpc8540-pci"; 289 compatible = "fsl,mpc8540-pci";
279 device_type = "pci"; 290 device_type = "pci";
280 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 291 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
@@ -306,7 +317,6 @@
306 }; 317 };
307 318
308 pci1: pcie@e0009000 { 319 pci1: pcie@e0009000 {
309 cell-index = <1>;
310 compatible = "fsl,mpc8548-pcie"; 320 compatible = "fsl,mpc8548-pcie";
311 device_type = "pci"; 321 device_type = "pci";
312 #interrupt-cells = <1>; 322 #interrupt-cells = <1>;
@@ -343,7 +353,6 @@
343 }; 353 };
344 354
345 pci2: pcie@e000a000 { 355 pci2: pcie@e000a000 {
346 cell-index = <2>;
347 compatible = "fsl,mpc8548-pcie"; 356 compatible = "fsl,mpc8548-pcie";
348 device_type = "pci"; 357 device_type = "pci";
349 #interrupt-cells = <1>; 358 #interrupt-cells = <1>;
@@ -380,7 +389,6 @@
380 }; 389 };
381 390
382 pci3: pcie@e000b000 { 391 pci3: pcie@e000b000 {
383 cell-index = <3>;
384 compatible = "fsl,mpc8548-pcie"; 392 compatible = "fsl,mpc8548-pcie";
385 device_type = "pci"; 393 device_type = "pci";
386 #interrupt-cells = <1>; 394 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index 804e90353293..475be1433fe1 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -60,9 +60,21 @@
60 device_type = "soc"; 60 device_type = "soc";
61 compatible = "simple-bus"; 61 compatible = "simple-bus";
62 ranges = <0x0 0xe0000000 0x100000>; 62 ranges = <0x0 0xe0000000 0x100000>;
63 reg = <0xe0000000 0x1000>; // CCSRBAR
64 bus-frequency = <0>; 63 bus-frequency = <0>;
65 64
65 ecm-law@0 {
66 compatible = "fsl,ecm-law";
67 reg = <0x0 0x1000>;
68 fsl,num-laws = <10>;
69 };
70
71 ecm@1000 {
72 compatible = "fsl,mpc8548-ecm", "fsl,ecm";
73 reg = <0x1000 0x1000>;
74 interrupts = <17 2>;
75 interrupt-parent = <&mpic>;
76 };
77
66 memory-controller@2000 { 78 memory-controller@2000 {
67 compatible = "fsl,8548-memory-controller"; 79 compatible = "fsl,8548-memory-controller";
68 reg = <0x2000 0x1000>; 80 reg = <0x2000 0x1000>;
@@ -328,7 +340,6 @@
328 }; 340 };
329 341
330 pci0: pci@e0008000 { 342 pci0: pci@e0008000 {
331 cell-index = <0>;
332 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 343 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
333 interrupt-map = < 344 interrupt-map = <
334 /* IDSEL 0x4 (PCIX Slot 2) */ 345 /* IDSEL 0x4 (PCIX Slot 2) */
@@ -478,7 +489,6 @@
478 }; 489 };
479 490
480 pci1: pci@e0009000 { 491 pci1: pci@e0009000 {
481 cell-index = <1>;
482 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 492 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
483 interrupt-map = < 493 interrupt-map = <
484 494
@@ -503,7 +513,6 @@
503 }; 513 };
504 514
505 pci2: pcie@e000a000 { 515 pci2: pcie@e000a000 {
506 cell-index = <2>;
507 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 516 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
508 interrupt-map = < 517 interrupt-map = <
509 518
diff --git a/arch/powerpc/boot/dts/mpc8555cds.dts b/arch/powerpc/boot/dts/mpc8555cds.dts
index 9484f0729b10..065b2f093de2 100644
--- a/arch/powerpc/boot/dts/mpc8555cds.dts
+++ b/arch/powerpc/boot/dts/mpc8555cds.dts
@@ -55,9 +55,21 @@
55 device_type = "soc"; 55 device_type = "soc";
56 compatible = "simple-bus"; 56 compatible = "simple-bus";
57 ranges = <0x0 0xe0000000 0x100000>; 57 ranges = <0x0 0xe0000000 0x100000>;
58 reg = <0xe0000000 0x1000>; // CCSRBAR 1M
59 bus-frequency = <0>; 58 bus-frequency = <0>;
60 59
60 ecm-law@0 {
61 compatible = "fsl,ecm-law";
62 reg = <0x0 0x1000>;
63 fsl,num-laws = <8>;
64 };
65
66 ecm@1000 {
67 compatible = "fsl,mpc8555-ecm", "fsl,ecm";
68 reg = <0x1000 0x1000>;
69 interrupts = <17 2>;
70 interrupt-parent = <&mpic>;
71 };
72
61 memory-controller@2000 { 73 memory-controller@2000 {
62 compatible = "fsl,8555-memory-controller"; 74 compatible = "fsl,8555-memory-controller";
63 reg = <0x2000 0x1000>; 75 reg = <0x2000 0x1000>;
@@ -272,7 +284,6 @@
272 }; 284 };
273 285
274 pci0: pci@e0008000 { 286 pci0: pci@e0008000 {
275 cell-index = <0>;
276 interrupt-map-mask = <0x1f800 0x0 0x0 0x7>; 287 interrupt-map-mask = <0x1f800 0x0 0x0 0x7>;
277 interrupt-map = < 288 interrupt-map = <
278 289
@@ -344,7 +355,6 @@
344 }; 355 };
345 356
346 pci1: pci@e0009000 { 357 pci1: pci@e0009000 {
347 cell-index = <1>;
348 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 358 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
349 interrupt-map = < 359 interrupt-map = <
350 360
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index cc2acf87d02f..a5bb1ec70a5a 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -55,9 +55,21 @@
55 device_type = "soc"; 55 device_type = "soc";
56 compatible = "simple-bus"; 56 compatible = "simple-bus";
57 ranges = <0x0 0xe0000000 0x100000>; 57 ranges = <0x0 0xe0000000 0x100000>;
58 reg = <0xe0000000 0x200>;
59 bus-frequency = <330000000>; 58 bus-frequency = <330000000>;
60 59
60 ecm-law@0 {
61 compatible = "fsl,ecm-law";
62 reg = <0x0 0x1000>;
63 fsl,num-laws = <8>;
64 };
65
66 ecm@1000 {
67 compatible = "fsl,mpc8560-ecm", "fsl,ecm";
68 reg = <0x1000 0x1000>;
69 interrupts = <17 2>;
70 interrupt-parent = <&mpic>;
71 };
72
61 memory-controller@2000 { 73 memory-controller@2000 {
62 compatible = "fsl,8540-memory-controller"; 74 compatible = "fsl,8540-memory-controller";
63 reg = <0x2000 0x1000>; 75 reg = <0x2000 0x1000>;
@@ -291,7 +303,6 @@
291 }; 303 };
292 304
293 pci0: pci@e0008000 { 305 pci0: pci@e0008000 {
294 cell-index = <0>;
295 #interrupt-cells = <1>; 306 #interrupt-cells = <1>;
296 #size-cells = <2>; 307 #size-cells = <2>;
297 #address-cells = <3>; 308 #address-cells = <3>;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 9d52e3b25047..00c2bbda7013 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -26,6 +26,7 @@
26 serial1 = &serial1; 26 serial1 = &serial1;
27 pci0 = &pci0; 27 pci0 = &pci0;
28 pci1 = &pci1; 28 pci1 = &pci1;
29 rapidio0 = &rio0;
29 }; 30 };
30 31
31 cpus { 32 cpus {
@@ -62,9 +63,21 @@
62 device_type = "soc"; 63 device_type = "soc";
63 compatible = "simple-bus"; 64 compatible = "simple-bus";
64 ranges = <0x0 0xe0000000 0x100000>; 65 ranges = <0x0 0xe0000000 0x100000>;
65 reg = <0xe0000000 0x1000>;
66 bus-frequency = <0>; 66 bus-frequency = <0>;
67 67
68 ecm-law@0 {
69 compatible = "fsl,ecm-law";
70 reg = <0x0 0x1000>;
71 fsl,num-laws = <10>;
72 };
73
74 ecm@1000 {
75 compatible = "fsl,mpc8568-ecm", "fsl,ecm";
76 reg = <0x1000 0x1000>;
77 interrupts = <17 2>;
78 interrupt-parent = <&mpic>;
79 };
80
68 memory-controller@2000 { 81 memory-controller@2000 {
69 compatible = "fsl,8568-memory-controller"; 82 compatible = "fsl,8568-memory-controller";
70 reg = <0x2000 0x1000>; 83 reg = <0x2000 0x1000>;
@@ -275,6 +288,22 @@
275 device_type = "open-pic"; 288 device_type = "open-pic";
276 }; 289 };
277 290
291 msi@41600 {
292 compatible = "fsl,mpc8568-msi", "fsl,mpic-msi";
293 reg = <0x41600 0x80>;
294 msi-available-ranges = <0 0x100>;
295 interrupts = <
296 0xe0 0
297 0xe1 0
298 0xe2 0
299 0xe3 0
300 0xe4 0
301 0xe5 0
302 0xe6 0
303 0xe7 0>;
304 interrupt-parent = <&mpic>;
305 };
306
278 par_io@e0100 { 307 par_io@e0100 {
279 reg = <0xe0100 0x100>; 308 reg = <0xe0100 0x100>;
280 device_type = "par_io"; 309 device_type = "par_io";
@@ -349,6 +378,8 @@
349 reg = <0xe0080000 0x480>; 378 reg = <0xe0080000 0x480>;
350 brg-frequency = <0>; 379 brg-frequency = <0>;
351 bus-frequency = <396000000>; 380 bus-frequency = <396000000>;
381 fsl,qe-num-riscs = <2>;
382 fsl,qe-num-snums = <28>;
352 383
353 muram@10000 { 384 muram@10000 {
354 #address-cells = <1>; 385 #address-cells = <1>;
@@ -459,7 +490,6 @@
459 }; 490 };
460 491
461 pci0: pci@e0008000 { 492 pci0: pci@e0008000 {
462 cell-index = <0>;
463 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 493 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
464 interrupt-map = < 494 interrupt-map = <
465 /* IDSEL 0x12 AD18 */ 495 /* IDSEL 0x12 AD18 */
@@ -490,7 +520,6 @@
490 520
491 /* PCI Express */ 521 /* PCI Express */
492 pci1: pcie@e000a000 { 522 pci1: pcie@e000a000 {
493 cell-index = <2>;
494 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 523 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
495 interrupt-map = < 524 interrupt-map = <
496 525
@@ -526,4 +555,20 @@
526 0x0 0x800000>; 555 0x0 0x800000>;
527 }; 556 };
528 }; 557 };
558
559 rio0: rapidio@e00c00000 {
560 #address-cells = <2>;
561 #size-cells = <2>;
562 compatible = "fsl,mpc8568-rapidio", "fsl,rapidio-delta";
563 reg = <0xe00c0000 0x20000>;
564 ranges = <0x0 0x0 0xc0000000 0x0 0x20000000>;
565 interrupts = <48 2 /* error */
566 49 2 /* bell_outb */
567 50 2 /* bell_inb */
568 53 2 /* msg1_tx */
569 54 2 /* msg1_rx */
570 55 2 /* msg2_tx */
571 56 2 /* msg2_rx */>;
572 interrupt-parent = <&mpic>;
573 };
529}; 574};
diff --git a/arch/powerpc/boot/dts/mpc8569mds.dts b/arch/powerpc/boot/dts/mpc8569mds.dts
new file mode 100644
index 000000000000..39c2927503cf
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8569mds.dts
@@ -0,0 +1,583 @@
1/*
2 * MPC8569E MDS Device Tree Source
3 *
4 * Copyright (C) 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/ {
15 model = "MPC8569EMDS";
16 compatible = "fsl,MPC8569EMDS";
17 #address-cells = <1>;
18 #size-cells = <1>;
19
20 aliases {
21 serial0 = &serial0;
22 serial1 = &serial1;
23 ethernet0 = &enet0;
24 ethernet1 = &enet1;
25 ethernet2 = &enet2;
26 ethernet3 = &enet3;
27 pci1 = &pci1;
28 rapidio0 = &rio0;
29 };
30
31 cpus {
32 #address-cells = <1>;
33 #size-cells = <0>;
34
35 PowerPC,8569@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
49 memory {
50 device_type = "memory";
51 };
52
53 localbus@e0005000 {
54 #address-cells = <2>;
55 #size-cells = <1>;
56 compatible = "fsl,mpc8569-elbc", "fsl,elbc", "simple-bus";
57 reg = <0xe0005000 0x1000>;
58 interrupts = <19 2>;
59 interrupt-parent = <&mpic>;
60
61 ranges = <0x0 0x0 0xfe000000 0x02000000
62 0x1 0x0 0xf8000000 0x00008000
63 0x2 0x0 0xf0000000 0x04000000
64 0x3 0x0 0xfc000000 0x00008000
65 0x4 0x0 0xf8008000 0x00008000
66 0x5 0x0 0xf8010000 0x00008000>;
67
68 nor@0,0 {
69 #address-cells = <1>;
70 #size-cells = <1>;
71 compatible = "cfi-flash";
72 reg = <0x0 0x0 0x02000000>;
73 bank-width = <2>;
74 device-width = <1>;
75 };
76
77 bcsr@1,0 {
78 compatible = "fsl,mpc8569mds-bcsr";
79 reg = <1 0 0x8000>;
80 };
81
82 nand@3,0 {
83 compatible = "fsl,mpc8569-fcm-nand",
84 "fsl,elbc-fcm-nand";
85 reg = <3 0 0x8000>;
86 };
87
88 pib@4,0 {
89 compatible = "fsl,mpc8569mds-pib";
90 reg = <4 0 0x8000>;
91 };
92
93 pib@5,0 {
94 compatible = "fsl,mpc8569mds-pib";
95 reg = <5 0 0x8000>;
96 };
97 };
98
99 soc@e0000000 {
100 #address-cells = <1>;
101 #size-cells = <1>;
102 device_type = "soc";
103 compatible = "fsl,mpc8569-immr", "simple-bus";
104 ranges = <0x0 0xe0000000 0x100000>;
105 bus-frequency = <0>;
106
107 ecm-law@0 {
108 compatible = "fsl,ecm-law";
109 reg = <0x0 0x1000>;
110 fsl,num-laws = <10>;
111 };
112
113 ecm@1000 {
114 compatible = "fsl,mpc8569-ecm", "fsl,ecm";
115 reg = <0x1000 0x1000>;
116 interrupts = <17 2>;
117 interrupt-parent = <&mpic>;
118 };
119
120 memory-controller@2000 {
121 compatible = "fsl,mpc8569-memory-controller";
122 reg = <0x2000 0x1000>;
123 interrupt-parent = <&mpic>;
124 interrupts = <18 2>;
125 };
126
127 i2c@3000 {
128 #address-cells = <1>;
129 #size-cells = <0>;
130 cell-index = <0>;
131 compatible = "fsl-i2c";
132 reg = <0x3000 0x100>;
133 interrupts = <43 2>;
134 interrupt-parent = <&mpic>;
135 dfsrr;
136
137 rtc@68 {
138 compatible = "dallas,ds1374";
139 reg = <0x68>;
140 };
141 };
142
143 i2c@3100 {
144 #address-cells = <1>;
145 #size-cells = <0>;
146 cell-index = <1>;
147 compatible = "fsl-i2c";
148 reg = <0x3100 0x100>;
149 interrupts = <43 2>;
150 interrupt-parent = <&mpic>;
151 dfsrr;
152 };
153
154 serial0: serial@4500 {
155 cell-index = <0>;
156 device_type = "serial";
157 compatible = "ns16550";
158 reg = <0x4500 0x100>;
159 clock-frequency = <0>;
160 interrupts = <42 2>;
161 interrupt-parent = <&mpic>;
162 };
163
164 serial1: serial@4600 {
165 cell-index = <1>;
166 device_type = "serial";
167 compatible = "ns16550";
168 reg = <0x4600 0x100>;
169 clock-frequency = <0>;
170 interrupts = <42 2>;
171 interrupt-parent = <&mpic>;
172 };
173
174 L2: l2-cache-controller@20000 {
175 compatible = "fsl,mpc8569-l2-cache-controller";
176 reg = <0x20000 0x1000>;
177 cache-line-size = <32>; // 32 bytes
178 cache-size = <0x80000>; // L2, 512K
179 interrupt-parent = <&mpic>;
180 interrupts = <16 2>;
181 };
182
183 dma@21300 {
184 #address-cells = <1>;
185 #size-cells = <1>;
186 compatible = "fsl,mpc8569-dma", "fsl,eloplus-dma";
187 reg = <0x21300 0x4>;
188 ranges = <0x0 0x21100 0x200>;
189 cell-index = <0>;
190 dma-channel@0 {
191 compatible = "fsl,mpc8569-dma-channel",
192 "fsl,eloplus-dma-channel";
193 reg = <0x0 0x80>;
194 cell-index = <0>;
195 interrupt-parent = <&mpic>;
196 interrupts = <20 2>;
197 };
198 dma-channel@80 {
199 compatible = "fsl,mpc8569-dma-channel",
200 "fsl,eloplus-dma-channel";
201 reg = <0x80 0x80>;
202 cell-index = <1>;
203 interrupt-parent = <&mpic>;
204 interrupts = <21 2>;
205 };
206 dma-channel@100 {
207 compatible = "fsl,mpc8569-dma-channel",
208 "fsl,eloplus-dma-channel";
209 reg = <0x100 0x80>;
210 cell-index = <2>;
211 interrupt-parent = <&mpic>;
212 interrupts = <22 2>;
213 };
214 dma-channel@180 {
215 compatible = "fsl,mpc8569-dma-channel",
216 "fsl,eloplus-dma-channel";
217 reg = <0x180 0x80>;
218 cell-index = <3>;
219 interrupt-parent = <&mpic>;
220 interrupts = <23 2>;
221 };
222 };
223
224 sdhci@2e000 {
225 compatible = "fsl,mpc8569-esdhc", "fsl,esdhc";
226 reg = <0x2e000 0x1000>;
227 interrupts = <72 0x8>;
228 interrupt-parent = <&mpic>;
229 /* Filled in by U-Boot */
230 clock-frequency = <0>;
231 status = "disabled";
232 };
233
234 crypto@30000 {
235 compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4",
236 "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0";
237 reg = <0x30000 0x10000>;
238 interrupts = <45 2 58 2>;
239 interrupt-parent = <&mpic>;
240 fsl,num-channels = <4>;
241 fsl,channel-fifo-len = <24>;
242 fsl,exec-units-mask = <0xbfe>;
243 fsl,descriptor-types-mask = <0x3ab0ebf>;
244 };
245
246 mpic: pic@40000 {
247 interrupt-controller;
248 #address-cells = <0>;
249 #interrupt-cells = <2>;
250 reg = <0x40000 0x40000>;
251 compatible = "chrp,open-pic";
252 device_type = "open-pic";
253 };
254
255 msi@41600 {
256 compatible = "fsl,mpc8568-msi", "fsl,mpic-msi";
257 reg = <0x41600 0x80>;
258 msi-available-ranges = <0 0x100>;
259 interrupts = <
260 0xe0 0
261 0xe1 0
262 0xe2 0
263 0xe3 0
264 0xe4 0
265 0xe5 0
266 0xe6 0
267 0xe7 0>;
268 interrupt-parent = <&mpic>;
269 };
270
271 global-utilities@e0000 {
272 compatible = "fsl,mpc8569-guts";
273 reg = <0xe0000 0x1000>;
274 fsl,has-rstcr;
275 };
276
277 par_io@e0100 {
278 #address-cells = <1>;
279 #size-cells = <1>;
280 reg = <0xe0100 0x100>;
281 ranges = <0x0 0xe0100 0x100>;
282 device_type = "par_io";
283 num-ports = <7>;
284
285 qe_pio_e: gpio-controller@80 {
286 #gpio-cells = <2>;
287 compatible = "fsl,mpc8569-qe-pario-bank",
288 "fsl,mpc8323-qe-pario-bank";
289 reg = <0x80 0x18>;
290 gpio-controller;
291 };
292
293 pio1: ucc_pin@01 {
294 pio-map = <
295 /* port pin dir open_drain assignment has_irq */
296 0x2 0x1f 0x1 0x0 0x1 0x0 /* QE_MUX_MDC */
297 0x2 0x1e 0x3 0x0 0x2 0x0 /* QE_MUX_MDIO */
298 0x2 0x0b 0x2 0x0 0x1 0x0 /* CLK12*/
299 0x0 0x0 0x1 0x0 0x3 0x0 /* ENET1_TXD0_SER1_TXD0 */
300 0x0 0x1 0x1 0x0 0x3 0x0 /* ENET1_TXD1_SER1_TXD1 */
301 0x0 0x2 0x1 0x0 0x1 0x0 /* ENET1_TXD2_SER1_TXD2 */
302 0x0 0x3 0x1 0x0 0x2 0x0 /* ENET1_TXD3_SER1_TXD3 */
303 0x0 0x6 0x2 0x0 0x3 0x0 /* ENET1_RXD0_SER1_RXD0 */
304 0x0 0x7 0x2 0x0 0x1 0x0 /* ENET1_RXD1_SER1_RXD1 */
305 0x0 0x8 0x2 0x0 0x2 0x0 /* ENET1_RXD2_SER1_RXD2 */
306 0x0 0x9 0x2 0x0 0x2 0x0 /* ENET1_RXD3_SER1_RXD3 */
307 0x0 0x4 0x1 0x0 0x2 0x0 /* ENET1_TX_EN_SER1_RTS_B */
308 0x0 0xc 0x2 0x0 0x3 0x0 /* ENET1_RX_DV_SER1_CTS_B */
309 0x2 0x8 0x2 0x0 0x1 0x0 /* ENET1_GRXCLK */
310 0x2 0x14 0x1 0x0 0x2 0x0>; /* ENET1_GTXCLK */
311 };
312
313 pio2: ucc_pin@02 {
314 pio-map = <
315 /* port pin dir open_drain assignment has_irq */
316 0x2 0x1f 0x1 0x0 0x1 0x0 /* QE_MUX_MDC */
317 0x2 0x1e 0x3 0x0 0x2 0x0 /* QE_MUX_MDIO */
318 0x2 0x10 0x2 0x0 0x3 0x0 /* CLK17 */
319 0x0 0xe 0x1 0x0 0x2 0x0 /* ENET2_TXD0_SER2_TXD0 */
320 0x0 0xf 0x1 0x0 0x2 0x0 /* ENET2_TXD1_SER2_TXD1 */
321 0x0 0x10 0x1 0x0 0x1 0x0 /* ENET2_TXD2_SER2_TXD2 */
322 0x0 0x11 0x1 0x0 0x1 0x0 /* ENET2_TXD3_SER2_TXD3 */
323 0x0 0x14 0x2 0x0 0x2 0x0 /* ENET2_RXD0_SER2_RXD0 */
324 0x0 0x15 0x2 0x0 0x1 0x0 /* ENET2_RXD1_SER2_RXD1 */
325 0x0 0x16 0x2 0x0 0x1 0x0 /* ENET2_RXD2_SER2_RXD2 */
326 0x0 0x17 0x2 0x0 0x1 0x0 /* ENET2_RXD3_SER2_RXD3 */
327 0x0 0x12 0x1 0x0 0x2 0x0 /* ENET2_TX_EN_SER2_RTS_B */
328 0x0 0x1a 0x2 0x0 0x3 0x0 /* ENET2_RX_DV_SER2_CTS_B */
329 0x2 0x3 0x2 0x0 0x1 0x0 /* ENET2_GRXCLK */
330 0x2 0x2 0x1 0x0 0x2 0x0>; /* ENET2_GTXCLK */
331 };
332
333 pio3: ucc_pin@03 {
334 pio-map = <
335 /* port pin dir open_drain assignment has_irq */
336 0x2 0x1f 0x1 0x0 0x1 0x0 /* QE_MUX_MDC */
337 0x2 0x1e 0x3 0x0 0x2 0x0 /* QE_MUX_MDIO */
338 0x2 0x0b 0x2 0x0 0x1 0x0 /* CLK12*/
339 0x0 0x1d 0x1 0x0 0x2 0x0 /* ENET3_TXD0_SER3_TXD0 */
340 0x0 0x1e 0x1 0x0 0x3 0x0 /* ENET3_TXD1_SER3_TXD1 */
341 0x0 0x1f 0x1 0x0 0x2 0x0 /* ENET3_TXD2_SER3_TXD2 */
342 0x1 0x0 0x1 0x0 0x3 0x0 /* ENET3_TXD3_SER3_TXD3 */
343 0x1 0x3 0x2 0x0 0x3 0x0 /* ENET3_RXD0_SER3_RXD0 */
344 0x1 0x4 0x2 0x0 0x1 0x0 /* ENET3_RXD1_SER3_RXD1 */
345 0x1 0x5 0x2 0x0 0x2 0x0 /* ENET3_RXD2_SER3_RXD2 */
346 0x1 0x6 0x2 0x0 0x3 0x0 /* ENET3_RXD3_SER3_RXD3 */
347 0x1 0x1 0x1 0x0 0x1 0x0 /* ENET3_TX_EN_SER3_RTS_B */
348 0x1 0x9 0x2 0x0 0x3 0x0 /* ENET3_RX_DV_SER3_CTS_B */
349 0x2 0x9 0x2 0x0 0x2 0x0 /* ENET3_GRXCLK */
350 0x2 0x19 0x1 0x0 0x2 0x0>; /* ENET3_GTXCLK */
351 };
352
353 pio4: ucc_pin@04 {
354 pio-map = <
355 /* port pin dir open_drain assignment has_irq */
356 0x2 0x1f 0x1 0x0 0x1 0x0 /* QE_MUX_MDC */
357 0x2 0x1e 0x3 0x0 0x2 0x0 /* QE_MUX_MDIO */
358 0x2 0x10 0x2 0x0 0x3 0x0 /* CLK17 */
359 0x1 0xc 0x1 0x0 0x2 0x0 /* ENET4_TXD0_SER4_TXD0 */
360 0x1 0xd 0x1 0x0 0x2 0x0 /* ENET4_TXD1_SER4_TXD1 */
361 0x1 0xe 0x1 0x0 0x1 0x0 /* ENET4_TXD2_SER4_TXD2 */
362 0x1 0xf 0x1 0x0 0x2 0x0 /* ENET4_TXD3_SER4_TXD3 */
363 0x1 0x12 0x2 0x0 0x2 0x0 /* ENET4_RXD0_SER4_RXD0 */
364 0x1 0x13 0x2 0x0 0x1 0x0 /* ENET4_RXD1_SER4_RXD1 */
365 0x1 0x14 0x2 0x0 0x1 0x0 /* ENET4_RXD2_SER4_RXD2 */
366 0x1 0x15 0x2 0x0 0x2 0x0 /* ENET4_RXD3_SER4_RXD3 */
367 0x1 0x10 0x1 0x0 0x2 0x0 /* ENET4_TX_EN_SER4_RTS_B */
368 0x1 0x18 0x2 0x0 0x3 0x0 /* ENET4_RX_DV_SER4_CTS_B */
369 0x2 0x11 0x2 0x0 0x2 0x0 /* ENET4_GRXCLK */
370 0x2 0x18 0x1 0x0 0x2 0x0>; /* ENET4_GTXCLK */
371 };
372 };
373 };
374
375 qe@e0080000 {
376 #address-cells = <1>;
377 #size-cells = <1>;
378 device_type = "qe";
379 compatible = "fsl,qe";
380 ranges = <0x0 0xe0080000 0x40000>;
381 reg = <0xe0080000 0x480>;
382 brg-frequency = <0>;
383 bus-frequency = <0>;
384 fsl,qe-num-riscs = <4>;
385 fsl,qe-num-snums = <46>;
386
387 qeic: interrupt-controller@80 {
388 interrupt-controller;
389 compatible = "fsl,qe-ic";
390 #address-cells = <0>;
391 #interrupt-cells = <1>;
392 reg = <0x80 0x80>;
393 interrupts = <46 2 46 2>; //high:30 low:30
394 interrupt-parent = <&mpic>;
395 };
396
397 spi@4c0 {
398 #address-cells = <1>;
399 #size-cells = <0>;
400 compatible = "fsl,mpc8569-qe-spi", "fsl,spi";
401 reg = <0x4c0 0x40>;
402 cell-index = <0>;
403 interrupts = <2>;
404 interrupt-parent = <&qeic>;
405 gpios = <&qe_pio_e 30 0>;
406 mode = "cpu-qe";
407
408 serial-flash@0 {
409 compatible = "stm,m25p40";
410 reg = <0>;
411 spi-max-frequency = <25000000>;
412 };
413 };
414
415 spi@500 {
416 cell-index = <1>;
417 compatible = "fsl,spi";
418 reg = <0x500 0x40>;
419 interrupts = <1>;
420 interrupt-parent = <&qeic>;
421 mode = "cpu";
422 };
423
424 enet0: ucc@2000 {
425 device_type = "network";
426 compatible = "ucc_geth";
427 cell-index = <1>;
428 reg = <0x2000 0x200>;
429 interrupts = <32>;
430 interrupt-parent = <&qeic>;
431 local-mac-address = [ 00 00 00 00 00 00 ];
432 rx-clock-name = "none";
433 tx-clock-name = "clk12";
434 pio-handle = <&pio1>;
435 phy-handle = <&qe_phy0>;
436 phy-connection-type = "rgmii-id";
437 };
438
439 mdio@2120 {
440 #address-cells = <1>;
441 #size-cells = <0>;
442 reg = <0x2120 0x18>;
443 compatible = "fsl,ucc-mdio";
444
445 qe_phy0: ethernet-phy@07 {
446 interrupt-parent = <&mpic>;
447 interrupts = <1 1>;
448 reg = <0x7>;
449 device_type = "ethernet-phy";
450 };
451 qe_phy1: ethernet-phy@01 {
452 interrupt-parent = <&mpic>;
453 interrupts = <2 1>;
454 reg = <0x1>;
455 device_type = "ethernet-phy";
456 };
457 qe_phy2: ethernet-phy@02 {
458 interrupt-parent = <&mpic>;
459 interrupts = <3 1>;
460 reg = <0x2>;
461 device_type = "ethernet-phy";
462 };
463 qe_phy3: ethernet-phy@03 {
464 interrupt-parent = <&mpic>;
465 interrupts = <4 1>;
466 reg = <0x3>;
467 device_type = "ethernet-phy";
468 };
469 };
470
471 enet2: ucc@2200 {
472 device_type = "network";
473 compatible = "ucc_geth";
474 cell-index = <3>;
475 reg = <0x2200 0x200>;
476 interrupts = <34>;
477 interrupt-parent = <&qeic>;
478 local-mac-address = [ 00 00 00 00 00 00 ];
479 rx-clock-name = "none";
480 tx-clock-name = "clk12";
481 pio-handle = <&pio3>;
482 phy-handle = <&qe_phy2>;
483 phy-connection-type = "rgmii-id";
484 };
485
486 enet1: ucc@3000 {
487 device_type = "network";
488 compatible = "ucc_geth";
489 cell-index = <2>;
490 reg = <0x3000 0x200>;
491 interrupts = <33>;
492 interrupt-parent = <&qeic>;
493 local-mac-address = [ 00 00 00 00 00 00 ];
494 rx-clock-name = "none";
495 tx-clock-name = "clk17";
496 pio-handle = <&pio2>;
497 phy-handle = <&qe_phy1>;
498 phy-connection-type = "rgmii-id";
499 };
500
501 enet3: ucc@3200 {
502 device_type = "network";
503 compatible = "ucc_geth";
504 cell-index = <4>;
505 reg = <0x3200 0x200>;
506 interrupts = <35>;
507 interrupt-parent = <&qeic>;
508 local-mac-address = [ 00 00 00 00 00 00 ];
509 rx-clock-name = "none";
510 tx-clock-name = "clk17";
511 pio-handle = <&pio4>;
512 phy-handle = <&qe_phy3>;
513 phy-connection-type = "rgmii-id";
514 };
515
516 muram@10000 {
517 #address-cells = <1>;
518 #size-cells = <1>;
519 compatible = "fsl,qe-muram", "fsl,cpm-muram";
520 ranges = <0x0 0x10000 0x20000>;
521
522 data-only@0 {
523 compatible = "fsl,qe-muram-data",
524 "fsl,cpm-muram-data";
525 reg = <0x0 0x20000>;
526 };
527 };
528
529 };
530
531 /* PCI Express */
532 pci1: pcie@e000a000 {
533 compatible = "fsl,mpc8548-pcie";
534 device_type = "pci";
535 #interrupt-cells = <1>;
536 #size-cells = <2>;
537 #address-cells = <3>;
538 reg = <0xe000a000 0x1000>;
539 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
540 interrupt-map = <
541 /* IDSEL 0x0 (PEX) */
542 00000 0x0 0x0 0x1 &mpic 0x0 0x1
543 00000 0x0 0x0 0x2 &mpic 0x1 0x1
544 00000 0x0 0x0 0x3 &mpic 0x2 0x1
545 00000 0x0 0x0 0x4 &mpic 0x3 0x1>;
546
547 interrupt-parent = <&mpic>;
548 interrupts = <26 2>;
549 bus-range = <0 255>;
550 ranges = <0x2000000 0x0 0xa0000000 0xa0000000 0x0 0x10000000
551 0x1000000 0x0 0x00000000 0xe2800000 0x0 0x00800000>;
552 clock-frequency = <33333333>;
553 pcie@0 {
554 reg = <0x0 0x0 0x0 0x0 0x0>;
555 #size-cells = <2>;
556 #address-cells = <3>;
557 device_type = "pci";
558 ranges = <0x2000000 0x0 0xa0000000
559 0x2000000 0x0 0xa0000000
560 0x0 0x10000000
561
562 0x1000000 0x0 0x0
563 0x1000000 0x0 0x0
564 0x0 0x800000>;
565 };
566 };
567
568 rio0: rapidio@e00c00000 {
569 #address-cells = <2>;
570 #size-cells = <2>;
571 compatible = "fsl,mpc8569-rapidio", "fsl,rapidio-delta";
572 reg = <0xe00c0000 0x20000>;
573 ranges = <0x0 0x0 0xc0000000 0x0 0x20000000>;
574 interrupts = <48 2 /* error */
575 49 2 /* bell_outb */
576 50 2 /* bell_inb */
577 53 2 /* msg1_tx */
578 54 2 /* msg1_rx */
579 55 2 /* msg2_tx */
580 56 2 /* msg2_rx */>;
581 interrupt-parent = <&mpic>;
582 };
583};
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dts b/arch/powerpc/boot/dts/mpc8572ds.dts
index 6e79a4169088..cafc1285c140 100644
--- a/arch/powerpc/boot/dts/mpc8572ds.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds.dts
@@ -182,9 +182,21 @@
182 device_type = "soc"; 182 device_type = "soc";
183 compatible = "simple-bus"; 183 compatible = "simple-bus";
184 ranges = <0x0 0 0xffe00000 0x100000>; 184 ranges = <0x0 0 0xffe00000 0x100000>;
185 reg = <0 0xffe00000 0 0x1000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed
186 bus-frequency = <0>; // Filled out by uboot. 185 bus-frequency = <0>; // Filled out by uboot.
187 186
187 ecm-law@0 {
188 compatible = "fsl,ecm-law";
189 reg = <0x0 0x1000>;
190 fsl,num-laws = <12>;
191 };
192
193 ecm@1000 {
194 compatible = "fsl,mpc8572-ecm", "fsl,ecm";
195 reg = <0x1000 0x1000>;
196 interrupts = <17 2>;
197 interrupt-parent = <&mpic>;
198 };
199
188 memory-controller@2000 { 200 memory-controller@2000 {
189 compatible = "fsl,mpc8572-memory-controller"; 201 compatible = "fsl,mpc8572-memory-controller";
190 reg = <0x2000 0x1000>; 202 reg = <0x2000 0x1000>;
@@ -514,7 +526,6 @@
514 }; 526 };
515 527
516 pci0: pcie@ffe08000 { 528 pci0: pcie@ffe08000 {
517 cell-index = <0>;
518 compatible = "fsl,mpc8548-pcie"; 529 compatible = "fsl,mpc8548-pcie";
519 device_type = "pci"; 530 device_type = "pci";
520 #interrupt-cells = <1>; 531 #interrupt-cells = <1>;
@@ -724,7 +735,6 @@
724 }; 735 };
725 736
726 pci1: pcie@ffe09000 { 737 pci1: pcie@ffe09000 {
727 cell-index = <1>;
728 compatible = "fsl,mpc8548-pcie"; 738 compatible = "fsl,mpc8548-pcie";
729 device_type = "pci"; 739 device_type = "pci";
730 #interrupt-cells = <1>; 740 #interrupt-cells = <1>;
@@ -761,7 +771,6 @@
761 }; 771 };
762 772
763 pci2: pcie@ffe0a000 { 773 pci2: pcie@ffe0a000 {
764 cell-index = <2>;
765 compatible = "fsl,mpc8548-pcie"; 774 compatible = "fsl,mpc8548-pcie";
766 device_type = "pci"; 775 device_type = "pci";
767 #interrupt-cells = <1>; 776 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8572ds_36b.dts b/arch/powerpc/boot/dts/mpc8572ds_36b.dts
index dbd81a764742..f6365db3b97d 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_36b.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_36b.dts
@@ -182,9 +182,21 @@
182 device_type = "soc"; 182 device_type = "soc";
183 compatible = "simple-bus"; 183 compatible = "simple-bus";
184 ranges = <0x0 0xf 0xffe00000 0x100000>; 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. 185 bus-frequency = <0>; // Filled out by uboot.
187 186
187 ecm-law@0 {
188 compatible = "fsl,ecm-law";
189 reg = <0x0 0x1000>;
190 fsl,num-laws = <12>;
191 };
192
193 ecm@1000 {
194 compatible = "fsl,mpc8572-ecm", "fsl,ecm";
195 reg = <0x1000 0x1000>;
196 interrupts = <17 2>;
197 interrupt-parent = <&mpic>;
198 };
199
188 memory-controller@2000 { 200 memory-controller@2000 {
189 compatible = "fsl,mpc8572-memory-controller"; 201 compatible = "fsl,mpc8572-memory-controller";
190 reg = <0x2000 0x1000>; 202 reg = <0x2000 0x1000>;
@@ -514,7 +526,6 @@
514 }; 526 };
515 527
516 pci0: pcie@fffe08000 { 528 pci0: pcie@fffe08000 {
517 cell-index = <0>;
518 compatible = "fsl,mpc8548-pcie"; 529 compatible = "fsl,mpc8548-pcie";
519 device_type = "pci"; 530 device_type = "pci";
520 #interrupt-cells = <1>; 531 #interrupt-cells = <1>;
@@ -522,7 +533,7 @@
522 #address-cells = <3>; 533 #address-cells = <3>;
523 reg = <0xf 0xffe08000 0 0x1000>; 534 reg = <0xf 0xffe08000 0 0x1000>;
524 bus-range = <0 255>; 535 bus-range = <0 255>;
525 ranges = <0x2000000 0x0 0xc0000000 0xc 0x00000000 0x0 0x20000000 536 ranges = <0x2000000 0x0 0xe0000000 0xc 0x00000000 0x0 0x20000000
526 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x00010000>; 537 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x00010000>;
527 clock-frequency = <33333333>; 538 clock-frequency = <33333333>;
528 interrupt-parent = <&mpic>; 539 interrupt-parent = <&mpic>;
@@ -649,8 +660,8 @@
649 #size-cells = <2>; 660 #size-cells = <2>;
650 #address-cells = <3>; 661 #address-cells = <3>;
651 device_type = "pci"; 662 device_type = "pci";
652 ranges = <0x2000000 0x0 0xc0000000 663 ranges = <0x2000000 0x0 0xe0000000
653 0x2000000 0x0 0xc0000000 664 0x2000000 0x0 0xe0000000
654 0x0 0x20000000 665 0x0 0x20000000
655 666
656 0x1000000 0x0 0x0 667 0x1000000 0x0 0x0
@@ -660,8 +671,8 @@
660 reg = <0x0 0x0 0x0 0x0 0x0>; 671 reg = <0x0 0x0 0x0 0x0 0x0>;
661 #size-cells = <2>; 672 #size-cells = <2>;
662 #address-cells = <3>; 673 #address-cells = <3>;
663 ranges = <0x2000000 0x0 0xc0000000 674 ranges = <0x2000000 0x0 0xe0000000
664 0x2000000 0x0 0xc0000000 675 0x2000000 0x0 0xe0000000
665 0x0 0x20000000 676 0x0 0x20000000
666 677
667 0x1000000 0x0 0x0 678 0x1000000 0x0 0x0
@@ -724,7 +735,6 @@
724 }; 735 };
725 736
726 pci1: pcie@fffe09000 { 737 pci1: pcie@fffe09000 {
727 cell-index = <1>;
728 compatible = "fsl,mpc8548-pcie"; 738 compatible = "fsl,mpc8548-pcie";
729 device_type = "pci"; 739 device_type = "pci";
730 #interrupt-cells = <1>; 740 #interrupt-cells = <1>;
@@ -732,7 +742,7 @@
732 #address-cells = <3>; 742 #address-cells = <3>;
733 reg = <0xf 0xffe09000 0 0x1000>; 743 reg = <0xf 0xffe09000 0 0x1000>;
734 bus-range = <0 255>; 744 bus-range = <0 255>;
735 ranges = <0x2000000 0x0 0xc0000000 0xc 0x20000000 0x0 0x20000000 745 ranges = <0x2000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000
736 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x00010000>; 746 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x00010000>;
737 clock-frequency = <33333333>; 747 clock-frequency = <33333333>;
738 interrupt-parent = <&mpic>; 748 interrupt-parent = <&mpic>;
@@ -750,8 +760,8 @@
750 #size-cells = <2>; 760 #size-cells = <2>;
751 #address-cells = <3>; 761 #address-cells = <3>;
752 device_type = "pci"; 762 device_type = "pci";
753 ranges = <0x2000000 0x0 0xc0000000 763 ranges = <0x2000000 0x0 0xe0000000
754 0x2000000 0x0 0xc0000000 764 0x2000000 0x0 0xe0000000
755 0x0 0x20000000 765 0x0 0x20000000
756 766
757 0x1000000 0x0 0x0 767 0x1000000 0x0 0x0
@@ -761,7 +771,6 @@
761 }; 771 };
762 772
763 pci2: pcie@fffe0a000 { 773 pci2: pcie@fffe0a000 {
764 cell-index = <2>;
765 compatible = "fsl,mpc8548-pcie"; 774 compatible = "fsl,mpc8548-pcie";
766 device_type = "pci"; 775 device_type = "pci";
767 #interrupt-cells = <1>; 776 #interrupt-cells = <1>;
@@ -769,7 +778,7 @@
769 #address-cells = <3>; 778 #address-cells = <3>;
770 reg = <0xf 0xffe0a000 0 0x1000>; 779 reg = <0xf 0xffe0a000 0 0x1000>;
771 bus-range = <0 255>; 780 bus-range = <0 255>;
772 ranges = <0x2000000 0x0 0xc0000000 0xc 0x40000000 0x0 0x20000000 781 ranges = <0x2000000 0x0 0xe0000000 0xc 0x40000000 0x0 0x20000000
773 0x1000000 0x0 0x00000000 0xf 0xffc20000 0x0 0x00010000>; 782 0x1000000 0x0 0x00000000 0xf 0xffc20000 0x0 0x00010000>;
774 clock-frequency = <33333333>; 783 clock-frequency = <33333333>;
775 interrupt-parent = <&mpic>; 784 interrupt-parent = <&mpic>;
@@ -787,8 +796,8 @@
787 #size-cells = <2>; 796 #size-cells = <2>;
788 #address-cells = <3>; 797 #address-cells = <3>;
789 device_type = "pci"; 798 device_type = "pci";
790 ranges = <0x2000000 0x0 0xc0000000 799 ranges = <0x2000000 0x0 0xe0000000
791 0x2000000 0x0 0xc0000000 800 0x2000000 0x0 0xe0000000
792 0x0 0x20000000 801 0x0 0x20000000
793 802
794 0x1000000 0x0 0x0 803 0x1000000 0x0 0x0
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
index 2bc0c7189653..5bd1011fde96 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
@@ -59,9 +59,21 @@
59 device_type = "soc"; 59 device_type = "soc";
60 compatible = "simple-bus"; 60 compatible = "simple-bus";
61 ranges = <0x0 0xffe00000 0x100000>; 61 ranges = <0x0 0xffe00000 0x100000>;
62 reg = <0xffe00000 0x1000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed
63 bus-frequency = <0>; // Filled out by uboot. 62 bus-frequency = <0>; // Filled out by uboot.
64 63
64 ecm-law@0 {
65 compatible = "fsl,ecm-law";
66 reg = <0x0 0x1000>;
67 fsl,num-laws = <12>;
68 };
69
70 ecm@1000 {
71 compatible = "fsl,mpc8572-ecm", "fsl,ecm";
72 reg = <0x1000 0x1000>;
73 interrupts = <17 2>;
74 interrupt-parent = <&mpic>;
75 };
76
65 memory-controller@2000 { 77 memory-controller@2000 {
66 compatible = "fsl,mpc8572-memory-controller"; 78 compatible = "fsl,mpc8572-memory-controller";
67 reg = <0x2000 0x1000>; 79 reg = <0x2000 0x1000>;
@@ -238,7 +250,6 @@
238 }; 250 };
239 251
240 pci0: pcie@ffe08000 { 252 pci0: pcie@ffe08000 {
241 cell-index = <0>;
242 compatible = "fsl,mpc8548-pcie"; 253 compatible = "fsl,mpc8548-pcie";
243 device_type = "pci"; 254 device_type = "pci";
244 #interrupt-cells = <1>; 255 #interrupt-cells = <1>;
@@ -448,7 +459,6 @@
448 }; 459 };
449 460
450 pci1: pcie@ffe09000 { 461 pci1: pcie@ffe09000 {
451 cell-index = <1>;
452 compatible = "fsl,mpc8548-pcie"; 462 compatible = "fsl,mpc8548-pcie";
453 device_type = "pci"; 463 device_type = "pci";
454 #interrupt-cells = <1>; 464 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
index 159cb3a875f0..0efc3456e297 100644
--- a/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
+++ b/arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
@@ -58,7 +58,6 @@
58 device_type = "soc"; 58 device_type = "soc";
59 compatible = "simple-bus"; 59 compatible = "simple-bus";
60 ranges = <0x0 0xffe00000 0x100000>; 60 ranges = <0x0 0xffe00000 0x100000>;
61 reg = <0xffe00000 0x1000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed
62 bus-frequency = <0>; // Filled out by uboot. 61 bus-frequency = <0>; // Filled out by uboot.
63 62
64 L2: l2-cache-controller@20000 { 63 L2: l2-cache-controller@20000 {
@@ -196,7 +195,6 @@
196 }; 195 };
197 196
198 pci2: pcie@ffe0a000 { 197 pci2: pcie@ffe0a000 {
199 cell-index = <2>;
200 compatible = "fsl,mpc8548-pcie"; 198 compatible = "fsl,mpc8548-pcie";
201 device_type = "pci"; 199 device_type = "pci";
202 #interrupt-cells = <1>; 200 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
index 1bd3ebe11437..cfc2c60d1f5f 100644
--- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -112,9 +112,21 @@
112 device_type = "soc"; 112 device_type = "soc";
113 compatible = "fsl,mpc8610-immr", "simple-bus"; 113 compatible = "fsl,mpc8610-immr", "simple-bus";
114 ranges = <0x0 0xe0000000 0x00100000>; 114 ranges = <0x0 0xe0000000 0x00100000>;
115 reg = <0xe0000000 0x1000>;
116 bus-frequency = <0>; 115 bus-frequency = <0>;
117 116
117 mcm-law@0 {
118 compatible = "fsl,mcm-law";
119 reg = <0x0 0x1000>;
120 fsl,num-laws = <10>;
121 };
122
123 mcm@1000 {
124 compatible = "fsl,mpc8610-mcm", "fsl,mcm";
125 reg = <0x1000 0x1000>;
126 interrupts = <17 2>;
127 interrupt-parent = <&mpic>;
128 };
129
118 i2c@3000 { 130 i2c@3000 {
119 #address-cells = <1>; 131 #address-cells = <1>;
120 #size-cells = <0>; 132 #size-cells = <0>;
@@ -316,7 +328,6 @@
316 }; 328 };
317 329
318 pci0: pci@e0008000 { 330 pci0: pci@e0008000 {
319 cell-index = <0>;
320 compatible = "fsl,mpc8610-pci"; 331 compatible = "fsl,mpc8610-pci";
321 device_type = "pci"; 332 device_type = "pci";
322 #interrupt-cells = <1>; 333 #interrupt-cells = <1>;
@@ -346,7 +357,6 @@
346 }; 357 };
347 358
348 pci1: pcie@e000a000 { 359 pci1: pcie@e000a000 {
349 cell-index = <1>;
350 compatible = "fsl,mpc8641-pcie"; 360 compatible = "fsl,mpc8641-pcie";
351 device_type = "pci"; 361 device_type = "pci";
352 #interrupt-cells = <1>; 362 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index d72beb192460..848320e4d3c4 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -114,9 +114,21 @@
114 device_type = "soc"; 114 device_type = "soc";
115 compatible = "simple-bus"; 115 compatible = "simple-bus";
116 ranges = <0x00000000 0xffe00000 0x00100000>; 116 ranges = <0x00000000 0xffe00000 0x00100000>;
117 reg = <0xffe00000 0x00001000>; // CCSRBAR
118 bus-frequency = <0>; 117 bus-frequency = <0>;
119 118
119 mcm-law@0 {
120 compatible = "fsl,mcm-law";
121 reg = <0x0 0x1000>;
122 fsl,num-laws = <10>;
123 };
124
125 mcm@1000 {
126 compatible = "fsl,mpc8641-mcm", "fsl,mcm";
127 reg = <0x1000 0x1000>;
128 interrupts = <17 2>;
129 interrupt-parent = <&mpic>;
130 };
131
120 i2c@3000 { 132 i2c@3000 {
121 #address-cells = <1>; 133 #address-cells = <1>;
122 #size-cells = <0>; 134 #size-cells = <0>;
@@ -357,7 +369,6 @@
357 }; 369 };
358 370
359 pci0: pcie@ffe08000 { 371 pci0: pcie@ffe08000 {
360 cell-index = <0>;
361 compatible = "fsl,mpc8641-pcie"; 372 compatible = "fsl,mpc8641-pcie";
362 device_type = "pci"; 373 device_type = "pci";
363 #interrupt-cells = <1>; 374 #interrupt-cells = <1>;
@@ -566,7 +577,6 @@
566 }; 577 };
567 578
568 pci1: pcie@ffe09000 { 579 pci1: pcie@ffe09000 {
569 cell-index = <1>;
570 compatible = "fsl,mpc8641-pcie"; 580 compatible = "fsl,mpc8641-pcie";
571 device_type = "pci"; 581 device_type = "pci";
572 #interrupt-cells = <1>; 582 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts b/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts
new file mode 100644
index 000000000000..8be8e701e1d3
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn_36b.dts
@@ -0,0 +1,609 @@
1/*
2 * MPC8641 HPCN Device Tree Source
3 *
4 * Copyright 2008-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/ {
15 model = "MPC8641HPCN";
16 compatible = "fsl,mpc8641hpcn";
17 #address-cells = <2>;
18 #size-cells = <2>;
19
20 aliases {
21 ethernet0 = &enet0;
22 ethernet1 = &enet1;
23 ethernet2 = &enet2;
24 ethernet3 = &enet3;
25 serial0 = &serial0;
26 serial1 = &serial1;
27 pci0 = &pci0;
28 pci1 = &pci1;
29 };
30
31 cpus {
32 #address-cells = <1>;
33 #size-cells = <0>;
34
35 PowerPC,8641@0 {
36 device_type = "cpu";
37 reg = <0>;
38 d-cache-line-size = <32>; // 32 bytes
39 i-cache-line-size = <32>; // 32 bytes
40 d-cache-size = <32768>; // L1, 32K
41 i-cache-size = <32768>; // L1, 32K
42 timebase-frequency = <0>; // 33 MHz, from uboot
43 bus-frequency = <0>; // From uboot
44 clock-frequency = <0>; // From uboot
45 };
46 PowerPC,8641@1 {
47 device_type = "cpu";
48 reg = <1>;
49 d-cache-line-size = <32>; // 32 bytes
50 i-cache-line-size = <32>; // 32 bytes
51 d-cache-size = <32768>; // L1, 32K
52 i-cache-size = <32768>; // L1, 32K
53 timebase-frequency = <0>; // 33 MHz, from uboot
54 bus-frequency = <0>; // From uboot
55 clock-frequency = <0>; // From uboot
56 };
57 };
58
59 memory {
60 device_type = "memory";
61 reg = <0x0 0x00000000 0x0 0x40000000>; // 1G at 0x0
62 };
63
64 localbus@fffe05000 {
65 #address-cells = <2>;
66 #size-cells = <1>;
67 compatible = "fsl,mpc8641-localbus", "simple-bus";
68 reg = <0x0f 0xffe05000 0x0 0x1000>;
69 interrupts = <19 2>;
70 interrupt-parent = <&mpic>;
71
72 ranges = <0 0 0xf 0xef800000 0x00800000
73 2 0 0xf 0xffdf8000 0x00008000
74 3 0 0xf 0xffdf0000 0x00008000>;
75
76 flash@0,0 {
77 compatible = "cfi-flash";
78 reg = <0 0 0x00800000>;
79 bank-width = <2>;
80 device-width = <2>;
81 #address-cells = <1>;
82 #size-cells = <1>;
83 partition@0 {
84 label = "kernel";
85 reg = <0x00000000 0x00300000>;
86 };
87 partition@300000 {
88 label = "firmware b";
89 reg = <0x00300000 0x00100000>;
90 read-only;
91 };
92 partition@400000 {
93 label = "fs";
94 reg = <0x00400000 0x00300000>;
95 };
96 partition@700000 {
97 label = "firmware a";
98 reg = <0x00700000 0x00100000>;
99 read-only;
100 };
101 };
102 };
103
104 soc8641@fffe00000 {
105 #address-cells = <1>;
106 #size-cells = <1>;
107 device_type = "soc";
108 compatible = "simple-bus";
109 ranges = <0x00000000 0x0f 0xffe00000 0x00100000>;
110 bus-frequency = <0>;
111
112 mcm-law@0 {
113 compatible = "fsl,mcm-law";
114 reg = <0x0 0x1000>;
115 fsl,num-laws = <10>;
116 };
117
118 mcm@1000 {
119 compatible = "fsl,mpc8641-mcm", "fsl,mcm";
120 reg = <0x1000 0x1000>;
121 interrupts = <17 2>;
122 interrupt-parent = <&mpic>;
123 };
124
125 i2c@3000 {
126 #address-cells = <1>;
127 #size-cells = <0>;
128 cell-index = <0>;
129 compatible = "fsl-i2c";
130 reg = <0x3000 0x100>;
131 interrupts = <43 2>;
132 interrupt-parent = <&mpic>;
133 dfsrr;
134 };
135
136 i2c@3100 {
137 #address-cells = <1>;
138 #size-cells = <0>;
139 cell-index = <1>;
140 compatible = "fsl-i2c";
141 reg = <0x3100 0x100>;
142 interrupts = <43 2>;
143 interrupt-parent = <&mpic>;
144 dfsrr;
145 };
146
147 dma@21300 {
148 #address-cells = <1>;
149 #size-cells = <1>;
150 compatible = "fsl,mpc8641-dma", "fsl,eloplus-dma";
151 reg = <0x21300 0x4>;
152 ranges = <0x0 0x21100 0x200>;
153 cell-index = <0>;
154 dma-channel@0 {
155 compatible = "fsl,mpc8641-dma-channel",
156 "fsl,eloplus-dma-channel";
157 reg = <0x0 0x80>;
158 cell-index = <0>;
159 interrupt-parent = <&mpic>;
160 interrupts = <20 2>;
161 };
162 dma-channel@80 {
163 compatible = "fsl,mpc8641-dma-channel",
164 "fsl,eloplus-dma-channel";
165 reg = <0x80 0x80>;
166 cell-index = <1>;
167 interrupt-parent = <&mpic>;
168 interrupts = <21 2>;
169 };
170 dma-channel@100 {
171 compatible = "fsl,mpc8641-dma-channel",
172 "fsl,eloplus-dma-channel";
173 reg = <0x100 0x80>;
174 cell-index = <2>;
175 interrupt-parent = <&mpic>;
176 interrupts = <22 2>;
177 };
178 dma-channel@180 {
179 compatible = "fsl,mpc8641-dma-channel",
180 "fsl,eloplus-dma-channel";
181 reg = <0x180 0x80>;
182 cell-index = <3>;
183 interrupt-parent = <&mpic>;
184 interrupts = <23 2>;
185 };
186 };
187
188 enet0: ethernet@24000 {
189 #address-cells = <1>;
190 #size-cells = <1>;
191 cell-index = <0>;
192 device_type = "network";
193 model = "TSEC";
194 compatible = "gianfar";
195 reg = <0x24000 0x1000>;
196 ranges = <0x0 0x24000 0x1000>;
197 local-mac-address = [ 00 00 00 00 00 00 ];
198 interrupts = <29 2 30 2 34 2>;
199 interrupt-parent = <&mpic>;
200 tbi-handle = <&tbi0>;
201 phy-handle = <&phy0>;
202 phy-connection-type = "rgmii-id";
203
204 mdio@520 {
205 #address-cells = <1>;
206 #size-cells = <0>;
207 compatible = "fsl,gianfar-mdio";
208 reg = <0x520 0x20>;
209
210 phy0: ethernet-phy@0 {
211 interrupt-parent = <&mpic>;
212 interrupts = <10 1>;
213 reg = <0>;
214 device_type = "ethernet-phy";
215 };
216 phy1: ethernet-phy@1 {
217 interrupt-parent = <&mpic>;
218 interrupts = <10 1>;
219 reg = <1>;
220 device_type = "ethernet-phy";
221 };
222 phy2: ethernet-phy@2 {
223 interrupt-parent = <&mpic>;
224 interrupts = <10 1>;
225 reg = <2>;
226 device_type = "ethernet-phy";
227 };
228 phy3: ethernet-phy@3 {
229 interrupt-parent = <&mpic>;
230 interrupts = <10 1>;
231 reg = <3>;
232 device_type = "ethernet-phy";
233 };
234 tbi0: tbi-phy@11 {
235 reg = <0x11>;
236 device_type = "tbi-phy";
237 };
238 };
239 };
240
241 enet1: ethernet@25000 {
242 #address-cells = <1>;
243 #size-cells = <1>;
244 cell-index = <1>;
245 device_type = "network";
246 model = "TSEC";
247 compatible = "gianfar";
248 reg = <0x25000 0x1000>;
249 ranges = <0x0 0x25000 0x1000>;
250 local-mac-address = [ 00 00 00 00 00 00 ];
251 interrupts = <35 2 36 2 40 2>;
252 interrupt-parent = <&mpic>;
253 tbi-handle = <&tbi1>;
254 phy-handle = <&phy1>;
255 phy-connection-type = "rgmii-id";
256
257 mdio@520 {
258 #address-cells = <1>;
259 #size-cells = <0>;
260 compatible = "fsl,gianfar-tbi";
261 reg = <0x520 0x20>;
262
263 tbi1: tbi-phy@11 {
264 reg = <0x11>;
265 device_type = "tbi-phy";
266 };
267 };
268 };
269
270 enet2: ethernet@26000 {
271 #address-cells = <1>;
272 #size-cells = <1>;
273 cell-index = <2>;
274 device_type = "network";
275 model = "TSEC";
276 compatible = "gianfar";
277 reg = <0x26000 0x1000>;
278 ranges = <0x0 0x26000 0x1000>;
279 local-mac-address = [ 00 00 00 00 00 00 ];
280 interrupts = <31 2 32 2 33 2>;
281 interrupt-parent = <&mpic>;
282 tbi-handle = <&tbi2>;
283 phy-handle = <&phy2>;
284 phy-connection-type = "rgmii-id";
285
286 mdio@520 {
287 #address-cells = <1>;
288 #size-cells = <0>;
289 compatible = "fsl,gianfar-tbi";
290 reg = <0x520 0x20>;
291
292 tbi2: tbi-phy@11 {
293 reg = <0x11>;
294 device_type = "tbi-phy";
295 };
296 };
297 };
298
299 enet3: ethernet@27000 {
300 #address-cells = <1>;
301 #size-cells = <1>;
302 cell-index = <3>;
303 device_type = "network";
304 model = "TSEC";
305 compatible = "gianfar";
306 reg = <0x27000 0x1000>;
307 ranges = <0x0 0x27000 0x1000>;
308 local-mac-address = [ 00 00 00 00 00 00 ];
309 interrupts = <37 2 38 2 39 2>;
310 interrupt-parent = <&mpic>;
311 tbi-handle = <&tbi3>;
312 phy-handle = <&phy3>;
313 phy-connection-type = "rgmii-id";
314
315 mdio@520 {
316 #address-cells = <1>;
317 #size-cells = <0>;
318 compatible = "fsl,gianfar-tbi";
319 reg = <0x520 0x20>;
320
321 tbi3: tbi-phy@11 {
322 reg = <0x11>;
323 device_type = "tbi-phy";
324 };
325 };
326 };
327
328 serial0: serial@4500 {
329 cell-index = <0>;
330 device_type = "serial";
331 compatible = "ns16550";
332 reg = <0x4500 0x100>;
333 clock-frequency = <0>;
334 interrupts = <42 2>;
335 interrupt-parent = <&mpic>;
336 };
337
338 serial1: serial@4600 {
339 cell-index = <1>;
340 device_type = "serial";
341 compatible = "ns16550";
342 reg = <0x4600 0x100>;
343 clock-frequency = <0>;
344 interrupts = <28 2>;
345 interrupt-parent = <&mpic>;
346 };
347
348 mpic: pic@40000 {
349 interrupt-controller;
350 #address-cells = <0>;
351 #interrupt-cells = <2>;
352 reg = <0x40000 0x40000>;
353 compatible = "chrp,open-pic";
354 device_type = "open-pic";
355 };
356
357 global-utilities@e0000 {
358 compatible = "fsl,mpc8641-guts";
359 reg = <0xe0000 0x1000>;
360 fsl,has-rstcr;
361 };
362 };
363
364 pci0: pcie@fffe08000 {
365 cell-index = <0>;
366 compatible = "fsl,mpc8641-pcie";
367 device_type = "pci";
368 #interrupt-cells = <1>;
369 #size-cells = <2>;
370 #address-cells = <3>;
371 reg = <0x0f 0xffe08000 0x0 0x1000>;
372 bus-range = <0x0 0xff>;
373 ranges = <0x02000000 0x0 0xe0000000 0x0c 0x00000000 0x0 0x20000000
374 0x01000000 0x0 0x00000000 0x0f 0xffc00000 0x0 0x00010000>;
375 clock-frequency = <33333333>;
376 interrupt-parent = <&mpic>;
377 interrupts = <24 2>;
378 interrupt-map-mask = <0xff00 0 0 7>;
379 interrupt-map = <
380 /* IDSEL 0x11 func 0 - PCI slot 1 */
381 0x8800 0 0 1 &mpic 2 1
382 0x8800 0 0 2 &mpic 3 1
383 0x8800 0 0 3 &mpic 4 1
384 0x8800 0 0 4 &mpic 1 1
385
386 /* IDSEL 0x11 func 1 - PCI slot 1 */
387 0x8900 0 0 1 &mpic 2 1
388 0x8900 0 0 2 &mpic 3 1
389 0x8900 0 0 3 &mpic 4 1
390 0x8900 0 0 4 &mpic 1 1
391
392 /* IDSEL 0x11 func 2 - PCI slot 1 */
393 0x8a00 0 0 1 &mpic 2 1
394 0x8a00 0 0 2 &mpic 3 1
395 0x8a00 0 0 3 &mpic 4 1
396 0x8a00 0 0 4 &mpic 1 1
397
398 /* IDSEL 0x11 func 3 - PCI slot 1 */
399 0x8b00 0 0 1 &mpic 2 1
400 0x8b00 0 0 2 &mpic 3 1
401 0x8b00 0 0 3 &mpic 4 1
402 0x8b00 0 0 4 &mpic 1 1
403
404 /* IDSEL 0x11 func 4 - PCI slot 1 */
405 0x8c00 0 0 1 &mpic 2 1
406 0x8c00 0 0 2 &mpic 3 1
407 0x8c00 0 0 3 &mpic 4 1
408 0x8c00 0 0 4 &mpic 1 1
409
410 /* IDSEL 0x11 func 5 - PCI slot 1 */
411 0x8d00 0 0 1 &mpic 2 1
412 0x8d00 0 0 2 &mpic 3 1
413 0x8d00 0 0 3 &mpic 4 1
414 0x8d00 0 0 4 &mpic 1 1
415
416 /* IDSEL 0x11 func 6 - PCI slot 1 */
417 0x8e00 0 0 1 &mpic 2 1
418 0x8e00 0 0 2 &mpic 3 1
419 0x8e00 0 0 3 &mpic 4 1
420 0x8e00 0 0 4 &mpic 1 1
421
422 /* IDSEL 0x11 func 7 - PCI slot 1 */
423 0x8f00 0 0 1 &mpic 2 1
424 0x8f00 0 0 2 &mpic 3 1
425 0x8f00 0 0 3 &mpic 4 1
426 0x8f00 0 0 4 &mpic 1 1
427
428 /* IDSEL 0x12 func 0 - PCI slot 2 */
429 0x9000 0 0 1 &mpic 3 1
430 0x9000 0 0 2 &mpic 4 1
431 0x9000 0 0 3 &mpic 1 1
432 0x9000 0 0 4 &mpic 2 1
433
434 /* IDSEL 0x12 func 1 - PCI slot 2 */
435 0x9100 0 0 1 &mpic 3 1
436 0x9100 0 0 2 &mpic 4 1
437 0x9100 0 0 3 &mpic 1 1
438 0x9100 0 0 4 &mpic 2 1
439
440 /* IDSEL 0x12 func 2 - PCI slot 2 */
441 0x9200 0 0 1 &mpic 3 1
442 0x9200 0 0 2 &mpic 4 1
443 0x9200 0 0 3 &mpic 1 1
444 0x9200 0 0 4 &mpic 2 1
445
446 /* IDSEL 0x12 func 3 - PCI slot 2 */
447 0x9300 0 0 1 &mpic 3 1
448 0x9300 0 0 2 &mpic 4 1
449 0x9300 0 0 3 &mpic 1 1
450 0x9300 0 0 4 &mpic 2 1
451
452 /* IDSEL 0x12 func 4 - PCI slot 2 */
453 0x9400 0 0 1 &mpic 3 1
454 0x9400 0 0 2 &mpic 4 1
455 0x9400 0 0 3 &mpic 1 1
456 0x9400 0 0 4 &mpic 2 1
457
458 /* IDSEL 0x12 func 5 - PCI slot 2 */
459 0x9500 0 0 1 &mpic 3 1
460 0x9500 0 0 2 &mpic 4 1
461 0x9500 0 0 3 &mpic 1 1
462 0x9500 0 0 4 &mpic 2 1
463
464 /* IDSEL 0x12 func 6 - PCI slot 2 */
465 0x9600 0 0 1 &mpic 3 1
466 0x9600 0 0 2 &mpic 4 1
467 0x9600 0 0 3 &mpic 1 1
468 0x9600 0 0 4 &mpic 2 1
469
470 /* IDSEL 0x12 func 7 - PCI slot 2 */
471 0x9700 0 0 1 &mpic 3 1
472 0x9700 0 0 2 &mpic 4 1
473 0x9700 0 0 3 &mpic 1 1
474 0x9700 0 0 4 &mpic 2 1
475
476 // IDSEL 0x1c USB
477 0xe000 0 0 1 &i8259 12 2
478 0xe100 0 0 2 &i8259 9 2
479 0xe200 0 0 3 &i8259 10 2
480 0xe300 0 0 4 &i8259 11 2
481
482 // IDSEL 0x1d Audio
483 0xe800 0 0 1 &i8259 6 2
484
485 // IDSEL 0x1e Legacy
486 0xf000 0 0 1 &i8259 7 2
487 0xf100 0 0 1 &i8259 7 2
488
489 // IDSEL 0x1f IDE/SATA
490 0xf800 0 0 1 &i8259 14 2
491 0xf900 0 0 1 &i8259 5 2
492 >;
493
494 pcie@0 {
495 reg = <0 0 0 0 0>;
496 #size-cells = <2>;
497 #address-cells = <3>;
498 device_type = "pci";
499 ranges = <0x02000000 0x0 0xe0000000
500 0x02000000 0x0 0xe0000000
501 0x0 0x20000000
502
503 0x01000000 0x0 0x00000000
504 0x01000000 0x0 0x00000000
505 0x0 0x00010000>;
506 uli1575@0 {
507 reg = <0 0 0 0 0>;
508 #size-cells = <2>;
509 #address-cells = <3>;
510 ranges = <0x02000000 0x0 0xe0000000
511 0x02000000 0x0 0xe0000000
512 0x0 0x20000000
513 0x01000000 0x0 0x00000000
514 0x01000000 0x0 0x00000000
515 0x0 0x00010000>;
516 isa@1e {
517 device_type = "isa";
518 #interrupt-cells = <2>;
519 #size-cells = <1>;
520 #address-cells = <2>;
521 reg = <0xf000 0 0 0 0>;
522 ranges = <1 0 0x01000000 0 0
523 0x00001000>;
524 interrupt-parent = <&i8259>;
525
526 i8259: interrupt-controller@20 {
527 reg = <1 0x20 2
528 1 0xa0 2
529 1 0x4d0 2>;
530 interrupt-controller;
531 device_type = "interrupt-controller";
532 #address-cells = <0>;
533 #interrupt-cells = <2>;
534 compatible = "chrp,iic";
535 interrupts = <9 2>;
536 interrupt-parent = <&mpic>;
537 };
538
539 i8042@60 {
540 #size-cells = <0>;
541 #address-cells = <1>;
542 reg = <1 0x60 1 1 0x64 1>;
543 interrupts = <1 3 12 3>;
544 interrupt-parent =
545 <&i8259>;
546
547 keyboard@0 {
548 reg = <0>;
549 compatible = "pnpPNP,303";
550 };
551
552 mouse@1 {
553 reg = <1>;
554 compatible = "pnpPNP,f03";
555 };
556 };
557
558 rtc@70 {
559 compatible =
560 "pnpPNP,b00";
561 reg = <1 0x70 2>;
562 };
563
564 gpio@400 {
565 reg = <1 0x400 0x80>;
566 };
567 };
568 };
569 };
570
571 };
572
573 pci1: pcie@fffe09000 {
574 cell-index = <1>;
575 compatible = "fsl,mpc8641-pcie";
576 device_type = "pci";
577 #interrupt-cells = <1>;
578 #size-cells = <2>;
579 #address-cells = <3>;
580 reg = <0x0f 0xffe09000 0x0 0x1000>;
581 bus-range = <0x0 0xff>;
582 ranges = <0x02000000 0x0 0xe0000000 0x0c 0x20000000 0x0 0x20000000
583 0x01000000 0x0 0x00000000 0x0f 0xffc10000 0x0 0x00010000>;
584 clock-frequency = <33333333>;
585 interrupt-parent = <&mpic>;
586 interrupts = <25 2>;
587 interrupt-map-mask = <0xf800 0 0 7>;
588 interrupt-map = <
589 /* IDSEL 0x0 */
590 0x0000 0 0 1 &mpic 4 1
591 0x0000 0 0 2 &mpic 5 1
592 0x0000 0 0 3 &mpic 6 1
593 0x0000 0 0 4 &mpic 7 1
594 >;
595 pcie@0 {
596 reg = <0 0 0 0 0>;
597 #size-cells = <2>;
598 #address-cells = <3>;
599 device_type = "pci";
600 ranges = <0x02000000 0x0 0xe0000000
601 0x02000000 0x0 0xe0000000
602 0x0 0x20000000
603
604 0x01000000 0x0 0x00000000
605 0x01000000 0x0 0x00000000
606 0x0 0x00010000>;
607 };
608 };
609};
diff --git a/arch/powerpc/boot/dts/p2020ds.dts b/arch/powerpc/boot/dts/p2020ds.dts
new file mode 100644
index 000000000000..11019142813c
--- /dev/null
+++ b/arch/powerpc/boot/dts/p2020ds.dts
@@ -0,0 +1,704 @@
1/*
2 * P2020 DS Device Tree Source
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/dts-v1/;
13/ {
14 model = "fsl,P2020";
15 compatible = "fsl,P2020DS";
16 #address-cells = <2>;
17 #size-cells = <2>;
18
19 aliases {
20 ethernet0 = &enet0;
21 ethernet1 = &enet1;
22 ethernet2 = &enet2;
23 serial0 = &serial0;
24 serial1 = &serial1;
25 pci0 = &pci0;
26 pci1 = &pci1;
27 pci2 = &pci2;
28 };
29
30 cpus {
31 #address-cells = <1>;
32 #size-cells = <0>;
33
34 PowerPC,P2020@0 {
35 device_type = "cpu";
36 reg = <0x0>;
37 next-level-cache = <&L2>;
38 };
39
40 PowerPC,P2020@1 {
41 device_type = "cpu";
42 reg = <0x1>;
43 next-level-cache = <&L2>;
44 };
45 };
46
47 memory {
48 device_type = "memory";
49 };
50
51 localbus@ffe05000 {
52 #address-cells = <2>;
53 #size-cells = <1>;
54 compatible = "fsl,elbc", "simple-bus";
55 reg = <0 0xffe05000 0 0x1000>;
56 interrupts = <19 2>;
57 interrupt-parent = <&mpic>;
58
59 ranges = <0x0 0x0 0x0 0xe8000000 0x08000000
60 0x1 0x0 0x0 0xe0000000 0x08000000
61 0x2 0x0 0x0 0xffa00000 0x00040000
62 0x3 0x0 0x0 0xffdf0000 0x00008000
63 0x4 0x0 0x0 0xffa40000 0x00040000
64 0x5 0x0 0x0 0xffa80000 0x00040000
65 0x6 0x0 0x0 0xffac0000 0x00040000>;
66
67 nor@0,0 {
68 #address-cells = <1>;
69 #size-cells = <1>;
70 compatible = "cfi-flash";
71 reg = <0x0 0x0 0x8000000>;
72 bank-width = <2>;
73 device-width = <1>;
74
75 ramdisk@0 {
76 reg = <0x0 0x03000000>;
77 read-only;
78 };
79
80 diagnostic@3000000 {
81 reg = <0x03000000 0x00e00000>;
82 read-only;
83 };
84
85 dink@3e00000 {
86 reg = <0x03e00000 0x00200000>;
87 read-only;
88 };
89
90 kernel@4000000 {
91 reg = <0x04000000 0x00400000>;
92 read-only;
93 };
94
95 jffs2@4400000 {
96 reg = <0x04400000 0x03b00000>;
97 };
98
99 dtb@7f00000 {
100 reg = <0x07f00000 0x00080000>;
101 read-only;
102 };
103
104 u-boot@7f80000 {
105 reg = <0x07f80000 0x00080000>;
106 read-only;
107 };
108 };
109
110 nand@2,0 {
111 #address-cells = <1>;
112 #size-cells = <1>;
113 compatible = "fsl,elbc-fcm-nand";
114 reg = <0x2 0x0 0x40000>;
115
116 u-boot@0 {
117 reg = <0x0 0x02000000>;
118 read-only;
119 };
120
121 jffs2@2000000 {
122 reg = <0x02000000 0x10000000>;
123 };
124
125 ramdisk@12000000 {
126 reg = <0x12000000 0x08000000>;
127 read-only;
128 };
129
130 kernel@1a000000 {
131 reg = <0x1a000000 0x04000000>;
132 };
133
134 dtb@1e000000 {
135 reg = <0x1e000000 0x01000000>;
136 read-only;
137 };
138
139 empty@1f000000 {
140 reg = <0x1f000000 0x21000000>;
141 };
142 };
143
144 nand@4,0 {
145 compatible = "fsl,elbc-fcm-nand";
146 reg = <0x4 0x0 0x40000>;
147 };
148
149 nand@5,0 {
150 compatible = "fsl,elbc-fcm-nand";
151 reg = <0x5 0x0 0x40000>;
152 };
153
154 nand@6,0 {
155 compatible = "fsl,elbc-fcm-nand";
156 reg = <0x6 0x0 0x40000>;
157 };
158 };
159
160 soc@ffe00000 {
161 #address-cells = <1>;
162 #size-cells = <1>;
163 device_type = "soc";
164 compatible = "fsl,p2020-immr", "simple-bus";
165 ranges = <0x0 0 0xffe00000 0x100000>;
166 bus-frequency = <0>; // Filled out by uboot.
167
168 ecm-law@0 {
169 compatible = "fsl,ecm-law";
170 reg = <0x0 0x1000>;
171 fsl,num-laws = <12>;
172 };
173
174 ecm@1000 {
175 compatible = "fsl,p2020-ecm", "fsl,ecm";
176 reg = <0x1000 0x1000>;
177 interrupts = <17 2>;
178 interrupt-parent = <&mpic>;
179 };
180
181 memory-controller@2000 {
182 compatible = "fsl,p2020-memory-controller";
183 reg = <0x2000 0x1000>;
184 interrupt-parent = <&mpic>;
185 interrupts = <18 2>;
186 };
187
188 i2c@3000 {
189 #address-cells = <1>;
190 #size-cells = <0>;
191 cell-index = <0>;
192 compatible = "fsl-i2c";
193 reg = <0x3000 0x100>;
194 interrupts = <43 2>;
195 interrupt-parent = <&mpic>;
196 dfsrr;
197 };
198
199 i2c@3100 {
200 #address-cells = <1>;
201 #size-cells = <0>;
202 cell-index = <1>;
203 compatible = "fsl-i2c";
204 reg = <0x3100 0x100>;
205 interrupts = <43 2>;
206 interrupt-parent = <&mpic>;
207 dfsrr;
208 };
209
210 serial0: serial@4500 {
211 cell-index = <0>;
212 device_type = "serial";
213 compatible = "ns16550";
214 reg = <0x4500 0x100>;
215 clock-frequency = <0>;
216 interrupts = <42 2>;
217 interrupt-parent = <&mpic>;
218 };
219
220 serial1: serial@4600 {
221 cell-index = <1>;
222 device_type = "serial";
223 compatible = "ns16550";
224 reg = <0x4600 0x100>;
225 clock-frequency = <0>;
226 interrupts = <42 2>;
227 interrupt-parent = <&mpic>;
228 };
229
230 spi@7000 {
231 compatible = "fsl,espi";
232 reg = <0x7000 0x1000>;
233 interrupts = <59 0x2>;
234 interrupt-parent = <&mpic>;
235 };
236
237 dma@c300 {
238 #address-cells = <1>;
239 #size-cells = <1>;
240 compatible = "fsl,eloplus-dma";
241 reg = <0xc300 0x4>;
242 ranges = <0x0 0xc100 0x200>;
243 cell-index = <1>;
244 dma-channel@0 {
245 compatible = "fsl,eloplus-dma-channel";
246 reg = <0x0 0x80>;
247 cell-index = <0>;
248 interrupt-parent = <&mpic>;
249 interrupts = <76 2>;
250 };
251 dma-channel@80 {
252 compatible = "fsl,eloplus-dma-channel";
253 reg = <0x80 0x80>;
254 cell-index = <1>;
255 interrupt-parent = <&mpic>;
256 interrupts = <77 2>;
257 };
258 dma-channel@100 {
259 compatible = "fsl,eloplus-dma-channel";
260 reg = <0x100 0x80>;
261 cell-index = <2>;
262 interrupt-parent = <&mpic>;
263 interrupts = <78 2>;
264 };
265 dma-channel@180 {
266 compatible = "fsl,eloplus-dma-channel";
267 reg = <0x180 0x80>;
268 cell-index = <3>;
269 interrupt-parent = <&mpic>;
270 interrupts = <79 2>;
271 };
272 };
273
274 gpio: gpio-controller@f000 {
275 #gpio-cells = <2>;
276 compatible = "fsl,mpc8572-gpio";
277 reg = <0xf000 0x100>;
278 interrupts = <47 0x2>;
279 interrupt-parent = <&mpic>;
280 gpio-controller;
281 };
282
283 L2: l2-cache-controller@20000 {
284 compatible = "fsl,p2020-l2-cache-controller";
285 reg = <0x20000 0x1000>;
286 cache-line-size = <32>; // 32 bytes
287 cache-size = <0x80000>; // L2, 512k
288 interrupt-parent = <&mpic>;
289 interrupts = <16 2>;
290 };
291
292 dma@21300 {
293 #address-cells = <1>;
294 #size-cells = <1>;
295 compatible = "fsl,eloplus-dma";
296 reg = <0x21300 0x4>;
297 ranges = <0x0 0x21100 0x200>;
298 cell-index = <0>;
299 dma-channel@0 {
300 compatible = "fsl,eloplus-dma-channel";
301 reg = <0x0 0x80>;
302 cell-index = <0>;
303 interrupt-parent = <&mpic>;
304 interrupts = <20 2>;
305 };
306 dma-channel@80 {
307 compatible = "fsl,eloplus-dma-channel";
308 reg = <0x80 0x80>;
309 cell-index = <1>;
310 interrupt-parent = <&mpic>;
311 interrupts = <21 2>;
312 };
313 dma-channel@100 {
314 compatible = "fsl,eloplus-dma-channel";
315 reg = <0x100 0x80>;
316 cell-index = <2>;
317 interrupt-parent = <&mpic>;
318 interrupts = <22 2>;
319 };
320 dma-channel@180 {
321 compatible = "fsl,eloplus-dma-channel";
322 reg = <0x180 0x80>;
323 cell-index = <3>;
324 interrupt-parent = <&mpic>;
325 interrupts = <23 2>;
326 };
327 };
328
329 usb@22000 {
330 #address-cells = <1>;
331 #size-cells = <0>;
332 compatible = "fsl-usb2-dr";
333 reg = <0x22000 0x1000>;
334 interrupt-parent = <&mpic>;
335 interrupts = <28 0x2>;
336 phy_type = "ulpi";
337 };
338
339 enet0: ethernet@24000 {
340 #address-cells = <1>;
341 #size-cells = <1>;
342 cell-index = <0>;
343 device_type = "network";
344 model = "eTSEC";
345 compatible = "gianfar";
346 reg = <0x24000 0x1000>;
347 ranges = <0x0 0x24000 0x1000>;
348 local-mac-address = [ 00 00 00 00 00 00 ];
349 interrupts = <29 2 30 2 34 2>;
350 interrupt-parent = <&mpic>;
351 tbi-handle = <&tbi0>;
352 phy-handle = <&phy0>;
353 phy-connection-type = "rgmii-id";
354
355 mdio@520 {
356 #address-cells = <1>;
357 #size-cells = <0>;
358 compatible = "fsl,gianfar-mdio";
359 reg = <0x520 0x20>;
360
361 phy0: ethernet-phy@0 {
362 interrupt-parent = <&mpic>;
363 interrupts = <3 1>;
364 reg = <0x0>;
365 };
366 phy1: ethernet-phy@1 {
367 interrupt-parent = <&mpic>;
368 interrupts = <3 1>;
369 reg = <0x1>;
370 };
371 phy2: ethernet-phy@2 {
372 interrupt-parent = <&mpic>;
373 interrupts = <3 1>;
374 reg = <0x2>;
375 };
376 tbi0: tbi-phy@11 {
377 reg = <0x11>;
378 device_type = "tbi-phy";
379 };
380 };
381 };
382
383 enet1: ethernet@25000 {
384 #address-cells = <1>;
385 #size-cells = <1>;
386 cell-index = <1>;
387 device_type = "network";
388 model = "eTSEC";
389 compatible = "gianfar";
390 reg = <0x25000 0x1000>;
391 ranges = <0x0 0x25000 0x1000>;
392 local-mac-address = [ 00 00 00 00 00 00 ];
393 interrupts = <35 2 36 2 40 2>;
394 interrupt-parent = <&mpic>;
395 tbi-handle = <&tbi1>;
396 phy-handle = <&phy1>;
397 phy-connection-type = "rgmii-id";
398
399 mdio@520 {
400 #address-cells = <1>;
401 #size-cells = <0>;
402 compatible = "fsl,gianfar-tbi";
403 reg = <0x520 0x20>;
404
405 tbi1: tbi-phy@11 {
406 reg = <0x11>;
407 device_type = "tbi-phy";
408 };
409 };
410 };
411
412 enet2: ethernet@26000 {
413 #address-cells = <1>;
414 #size-cells = <1>;
415 cell-index = <2>;
416 device_type = "network";
417 model = "eTSEC";
418 compatible = "gianfar";
419 reg = <0x26000 0x1000>;
420 ranges = <0x0 0x26000 0x1000>;
421 local-mac-address = [ 00 00 00 00 00 00 ];
422 interrupts = <31 2 32 2 33 2>;
423 interrupt-parent = <&mpic>;
424 tbi-handle = <&tbi2>;
425 phy-handle = <&phy2>;
426 phy-connection-type = "rgmii-id";
427
428 mdio@520 {
429 #address-cells = <1>;
430 #size-cells = <0>;
431 compatible = "fsl,gianfar-tbi";
432 reg = <0x520 0x20>;
433
434 tbi2: tbi-phy@11 {
435 reg = <0x11>;
436 device_type = "tbi-phy";
437 };
438 };
439 };
440
441 sdhci@2e000 {
442 compatible = "fsl,p2020-esdhc", "fsl,esdhc";
443 reg = <0x2e000 0x1000>;
444 interrupts = <72 0x2>;
445 interrupt-parent = <&mpic>;
446 /* Filled in by U-Boot */
447 clock-frequency = <0>;
448 };
449
450 crypto@30000 {
451 compatible = "fsl,sec3.1", "fsl,sec3.0", "fsl,sec2.4",
452 "fsl,sec2.2", "fsl,sec2.1", "fsl,sec2.0";
453 reg = <0x30000 0x10000>;
454 interrupts = <45 2 58 2>;
455 interrupt-parent = <&mpic>;
456 fsl,num-channels = <4>;
457 fsl,channel-fifo-len = <24>;
458 fsl,exec-units-mask = <0xbfe>;
459 fsl,descriptor-types-mask = <0x3ab0ebf>;
460 };
461
462 mpic: pic@40000 {
463 interrupt-controller;
464 #address-cells = <0>;
465 #interrupt-cells = <2>;
466 reg = <0x40000 0x40000>;
467 compatible = "chrp,open-pic";
468 device_type = "open-pic";
469 };
470
471 msi@41600 {
472 compatible = "fsl,mpic-msi";
473 reg = <0x41600 0x80>;
474 msi-available-ranges = <0 0x100>;
475 interrupts = <
476 0xe0 0
477 0xe1 0
478 0xe2 0
479 0xe3 0
480 0xe4 0
481 0xe5 0
482 0xe6 0
483 0xe7 0>;
484 interrupt-parent = <&mpic>;
485 };
486
487 global-utilities@e0000 { //global utilities block
488 compatible = "fsl,p2020-guts";
489 reg = <0xe0000 0x1000>;
490 fsl,has-rstcr;
491 };
492 };
493
494 pci0: pcie@ffe08000 {
495 compatible = "fsl,mpc8548-pcie";
496 device_type = "pci";
497 #interrupt-cells = <1>;
498 #size-cells = <2>;
499 #address-cells = <3>;
500 reg = <0 0xffe08000 0 0x1000>;
501 bus-range = <0 255>;
502 ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
503 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
504 clock-frequency = <33333333>;
505 interrupt-parent = <&mpic>;
506 interrupts = <24 2>;
507 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
508 interrupt-map = <
509 /* IDSEL 0x0 */
510 0000 0x0 0x0 0x1 &mpic 0x8 0x1
511 0000 0x0 0x0 0x2 &mpic 0x9 0x1
512 0000 0x0 0x0 0x3 &mpic 0xa 0x1
513 0000 0x0 0x0 0x4 &mpic 0xb 0x1
514 >;
515 pcie@0 {
516 reg = <0x0 0x0 0x0 0x0 0x0>;
517 #size-cells = <2>;
518 #address-cells = <3>;
519 device_type = "pci";
520 ranges = <0x2000000 0x0 0x80000000
521 0x2000000 0x0 0x80000000
522 0x0 0x20000000
523
524 0x1000000 0x0 0x0
525 0x1000000 0x0 0x0
526 0x0 0x10000>;
527 };
528 };
529
530 pci1: pcie@ffe09000 {
531 compatible = "fsl,mpc8548-pcie";
532 device_type = "pci";
533 #interrupt-cells = <1>;
534 #size-cells = <2>;
535 #address-cells = <3>;
536 reg = <0 0xffe09000 0 0x1000>;
537 bus-range = <0 255>;
538 ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
539 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
540 clock-frequency = <33333333>;
541 interrupt-parent = <&mpic>;
542 interrupts = <25 2>;
543 interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
544 interrupt-map = <
545
546 // IDSEL 0x11 func 0 - PCI slot 1
547 0x8800 0x0 0x0 0x1 &i8259 0x9 0x2
548 0x8800 0x0 0x0 0x2 &i8259 0xa 0x2
549
550 // IDSEL 0x11 func 1 - PCI slot 1
551 0x8900 0x0 0x0 0x1 &i8259 0x9 0x2
552 0x8900 0x0 0x0 0x2 &i8259 0xa 0x2
553
554 // IDSEL 0x11 func 2 - PCI slot 1
555 0x8a00 0x0 0x0 0x1 &i8259 0x9 0x2
556 0x8a00 0x0 0x0 0x2 &i8259 0xa 0x2
557
558 // IDSEL 0x11 func 3 - PCI slot 1
559 0x8b00 0x0 0x0 0x1 &i8259 0x9 0x2
560 0x8b00 0x0 0x0 0x2 &i8259 0xa 0x2
561
562 // IDSEL 0x11 func 4 - PCI slot 1
563 0x8c00 0x0 0x0 0x1 &i8259 0x9 0x2
564 0x8c00 0x0 0x0 0x2 &i8259 0xa 0x2
565
566 // IDSEL 0x11 func 5 - PCI slot 1
567 0x8d00 0x0 0x0 0x1 &i8259 0x9 0x2
568 0x8d00 0x0 0x0 0x2 &i8259 0xa 0x2
569
570 // IDSEL 0x11 func 6 - PCI slot 1
571 0x8e00 0x0 0x0 0x1 &i8259 0x9 0x2
572 0x8e00 0x0 0x0 0x2 &i8259 0xa 0x2
573
574 // IDSEL 0x11 func 7 - PCI slot 1
575 0x8f00 0x0 0x0 0x1 &i8259 0x9 0x2
576 0x8f00 0x0 0x0 0x2 &i8259 0xa 0x2
577
578 // IDSEL 0x1d Audio
579 0xe800 0x0 0x0 0x1 &i8259 0x6 0x2
580
581 // IDSEL 0x1e Legacy
582 0xf000 0x0 0x0 0x1 &i8259 0x7 0x2
583 0xf100 0x0 0x0 0x1 &i8259 0x7 0x2
584
585 // IDSEL 0x1f IDE/SATA
586 0xf800 0x0 0x0 0x1 &i8259 0xe 0x2
587 0xf900 0x0 0x0 0x1 &i8259 0x5 0x2
588 >;
589
590 pcie@0 {
591 reg = <0x0 0x0 0x0 0x0 0x0>;
592 #size-cells = <2>;
593 #address-cells = <3>;
594 device_type = "pci";
595 ranges = <0x2000000 0x0 0xa0000000
596 0x2000000 0x0 0xa0000000
597 0x0 0x20000000
598
599 0x1000000 0x0 0x0
600 0x1000000 0x0 0x0
601 0x0 0x10000>;
602 uli1575@0 {
603 reg = <0x0 0x0 0x0 0x0 0x0>;
604 #size-cells = <2>;
605 #address-cells = <3>;
606 ranges = <0x2000000 0x0 0xa0000000
607 0x2000000 0x0 0xa0000000
608 0x0 0x20000000
609
610 0x1000000 0x0 0x0
611 0x1000000 0x0 0x0
612 0x0 0x10000>;
613 isa@1e {
614 device_type = "isa";
615 #interrupt-cells = <2>;
616 #size-cells = <1>;
617 #address-cells = <2>;
618 reg = <0xf000 0x0 0x0 0x0 0x0>;
619 ranges = <0x1 0x0 0x1000000 0x0 0x0
620 0x1000>;
621 interrupt-parent = <&i8259>;
622
623 i8259: interrupt-controller@20 {
624 reg = <0x1 0x20 0x2
625 0x1 0xa0 0x2
626 0x1 0x4d0 0x2>;
627 interrupt-controller;
628 device_type = "interrupt-controller";
629 #address-cells = <0>;
630 #interrupt-cells = <2>;
631 compatible = "chrp,iic";
632 interrupts = <4 1>;
633 interrupt-parent = <&mpic>;
634 };
635
636 i8042@60 {
637 #size-cells = <0>;
638 #address-cells = <1>;
639 reg = <0x1 0x60 0x1 0x1 0x64 0x1>;
640 interrupts = <1 3 12 3>;
641 interrupt-parent =
642 <&i8259>;
643
644 keyboard@0 {
645 reg = <0x0>;
646 compatible = "pnpPNP,303";
647 };
648
649 mouse@1 {
650 reg = <0x1>;
651 compatible = "pnpPNP,f03";
652 };
653 };
654
655 rtc@70 {
656 compatible = "pnpPNP,b00";
657 reg = <0x1 0x70 0x2>;
658 };
659
660 gpio@400 {
661 reg = <0x1 0x400 0x80>;
662 };
663 };
664 };
665 };
666
667 };
668
669 pci2: pcie@ffe0a000 {
670 compatible = "fsl,mpc8548-pcie";
671 device_type = "pci";
672 #interrupt-cells = <1>;
673 #size-cells = <2>;
674 #address-cells = <3>;
675 reg = <0 0xffe0a000 0 0x1000>;
676 bus-range = <0 255>;
677 ranges = <0x2000000 0x0 0xc0000000 0 0xc0000000 0x0 0x20000000
678 0x1000000 0x0 0x00000000 0 0xffc20000 0x0 0x10000>;
679 clock-frequency = <33333333>;
680 interrupt-parent = <&mpic>;
681 interrupts = <26 2>;
682 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
683 interrupt-map = <
684 /* IDSEL 0x0 */
685 0000 0x0 0x0 0x1 &mpic 0x0 0x1
686 0000 0x0 0x0 0x2 &mpic 0x1 0x1
687 0000 0x0 0x0 0x3 &mpic 0x2 0x1
688 0000 0x0 0x0 0x4 &mpic 0x3 0x1
689 >;
690 pcie@0 {
691 reg = <0x0 0x0 0x0 0x0 0x0>;
692 #size-cells = <2>;
693 #address-cells = <3>;
694 device_type = "pci";
695 ranges = <0x2000000 0x0 0xc0000000
696 0x2000000 0x0 0xc0000000
697 0x0 0x20000000
698
699 0x1000000 0x0 0x0
700 0x1000000 0x0 0x0
701 0x0 0x10000>;
702 };
703 };
704};
diff --git a/arch/powerpc/boot/dts/sbc8349.dts b/arch/powerpc/boot/dts/sbc8349.dts
index a36dbbc48694..5fb6f6684b0e 100644
--- a/arch/powerpc/boot/dts/sbc8349.dts
+++ b/arch/powerpc/boot/dts/sbc8349.dts
@@ -278,7 +278,6 @@
278 }; 278 };
279 279
280 pci0: pci@e0008500 { 280 pci0: pci@e0008500 {
281 cell-index = <1>;
282 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 281 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
283 interrupt-map = < 282 interrupt-map = <
284 283
diff --git a/arch/powerpc/boot/dts/sbc8548.dts b/arch/powerpc/boot/dts/sbc8548.dts
index b1f1416ac998..9eefe00ed253 100644
--- a/arch/powerpc/boot/dts/sbc8548.dts
+++ b/arch/powerpc/boot/dts/sbc8548.dts
@@ -151,10 +151,22 @@
151 #size-cells = <1>; 151 #size-cells = <1>;
152 device_type = "soc"; 152 device_type = "soc";
153 ranges = <0x00000000 0xe0000000 0x00100000>; 153 ranges = <0x00000000 0xe0000000 0x00100000>;
154 reg = <0xe0000000 0x00001000>; // CCSRBAR
155 bus-frequency = <0>; 154 bus-frequency = <0>;
156 compatible = "simple-bus"; 155 compatible = "simple-bus";
157 156
157 ecm-law@0 {
158 compatible = "fsl,ecm-law";
159 reg = <0x0 0x1000>;
160 fsl,num-laws = <10>;
161 };
162
163 ecm@1000 {
164 compatible = "fsl,mpc8548-ecm", "fsl,ecm";
165 reg = <0x1000 0x1000>;
166 interrupts = <17 2>;
167 interrupt-parent = <&mpic>;
168 };
169
158 memory-controller@2000 { 170 memory-controller@2000 {
159 compatible = "fsl,mpc8548-memory-controller"; 171 compatible = "fsl,mpc8548-memory-controller";
160 reg = <0x2000 0x1000>; 172 reg = <0x2000 0x1000>;
@@ -350,7 +362,6 @@
350 }; 362 };
351 363
352 pci0: pci@e0008000 { 364 pci0: pci@e0008000 {
353 cell-index = <0>;
354 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 365 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
355 interrupt-map = < 366 interrupt-map = <
356 /* IDSEL 0x01 (PCI-X slot) @66MHz */ 367 /* IDSEL 0x01 (PCI-X slot) @66MHz */
@@ -380,7 +391,6 @@
380 }; 391 };
381 392
382 pci2: pcie@e000a000 { 393 pci2: pcie@e000a000 {
383 cell-index = <2>;
384 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 394 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
385 interrupt-map = < 395 interrupt-map = <
386 396
diff --git a/arch/powerpc/boot/dts/sbc8560.dts b/arch/powerpc/boot/dts/sbc8560.dts
index c4564b81e473..239d57a55cf4 100644
--- a/arch/powerpc/boot/dts/sbc8560.dts
+++ b/arch/powerpc/boot/dts/sbc8560.dts
@@ -57,9 +57,21 @@
57 #size-cells = <1>; 57 #size-cells = <1>;
58 device_type = "soc"; 58 device_type = "soc";
59 ranges = <0x0 0xff700000 0x00100000>; 59 ranges = <0x0 0xff700000 0x00100000>;
60 reg = <0xff700000 0x00100000>;
61 clock-frequency = <0>; 60 clock-frequency = <0>;
62 61
62 ecm-law@0 {
63 compatible = "fsl,ecm-law";
64 reg = <0x0 0x1000>;
65 fsl,num-laws = <8>;
66 };
67
68 ecm@1000 {
69 compatible = "fsl,mpc8560-ecm", "fsl,ecm";
70 reg = <0x1000 0x1000>;
71 interrupts = <17 2>;
72 interrupt-parent = <&mpic>;
73 };
74
63 memory-controller@2000 { 75 memory-controller@2000 {
64 compatible = "fsl,mpc8560-memory-controller"; 76 compatible = "fsl,mpc8560-memory-controller";
65 reg = <0x2000 0x1000>; 77 reg = <0x2000 0x1000>;
@@ -296,7 +308,6 @@
296 }; 308 };
297 309
298 pci0: pci@ff708000 { 310 pci0: pci@ff708000 {
299 cell-index = <0>;
300 #interrupt-cells = <1>; 311 #interrupt-cells = <1>;
301 #size-cells = <2>; 312 #size-cells = <2>;
302 #address-cells = <3>; 313 #address-cells = <3>;
diff --git a/arch/powerpc/boot/dts/sbc8641d.dts b/arch/powerpc/boot/dts/sbc8641d.dts
index e3e914e78caa..ee5538feb455 100644
--- a/arch/powerpc/boot/dts/sbc8641d.dts
+++ b/arch/powerpc/boot/dts/sbc8641d.dts
@@ -126,9 +126,21 @@
126 device_type = "soc"; 126 device_type = "soc";
127 compatible = "simple-bus"; 127 compatible = "simple-bus";
128 ranges = <0x00000000 0xf8000000 0x00100000>; 128 ranges = <0x00000000 0xf8000000 0x00100000>;
129 reg = <0xf8000000 0x00001000>; // CCSRBAR
130 bus-frequency = <0>; 129 bus-frequency = <0>;
131 130
131 mcm-law@0 {
132 compatible = "fsl,mcm-law";
133 reg = <0x0 0x1000>;
134 fsl,num-laws = <10>;
135 };
136
137 mcm@1000 {
138 compatible = "fsl,mpc8641-mcm", "fsl,mcm";
139 reg = <0x1000 0x1000>;
140 interrupts = <17 2>;
141 interrupt-parent = <&mpic>;
142 };
143
132 i2c@3000 { 144 i2c@3000 {
133 #address-cells = <1>; 145 #address-cells = <1>;
134 #size-cells = <0>; 146 #size-cells = <0>;
@@ -371,7 +383,6 @@
371 }; 383 };
372 384
373 pci0: pcie@f8008000 { 385 pci0: pcie@f8008000 {
374 cell-index = <0>;
375 compatible = "fsl,mpc8641-pcie"; 386 compatible = "fsl,mpc8641-pcie";
376 device_type = "pci"; 387 device_type = "pci";
377 #interrupt-cells = <1>; 388 #interrupt-cells = <1>;
@@ -410,7 +421,6 @@
410 }; 421 };
411 422
412 pci1: pcie@f8009000 { 423 pci1: pcie@f8009000 {
413 cell-index = <1>;
414 compatible = "fsl,mpc8641-pcie"; 424 compatible = "fsl,mpc8641-pcie";
415 device_type = "pci"; 425 device_type = "pci";
416 #interrupt-cells = <1>; 426 #interrupt-cells = <1>;
diff --git a/arch/powerpc/boot/dts/sequoia.dts b/arch/powerpc/boot/dts/sequoia.dts
index 43cc68bd3192..739dd0da2416 100644
--- a/arch/powerpc/boot/dts/sequoia.dts
+++ b/arch/powerpc/boot/dts/sequoia.dts
@@ -199,6 +199,28 @@
199 }; 199 };
200 }; 200 };
201 201
202 ndfc@3,0 {
203 compatible = "ibm,ndfc";
204 reg = <0x00000003 0x00000000 0x00002000>;
205 ccr = <0x00001000>;
206 bank-settings = <0x80002222>;
207 #address-cells = <1>;
208 #size-cells = <1>;
209
210 nand {
211 #address-cells = <1>;
212 #size-cells = <1>;
213
214 partition@0 {
215 label = "u-boot";
216 reg = <0x00000000 0x00084000>;
217 };
218 partition@84000 {
219 label = "user";
220 reg = <0x00000000 0x01f7c000>;
221 };
222 };
223 };
202 }; 224 };
203 225
204 UART0: serial@ef600300 { 226 UART0: serial@ef600300 {
diff --git a/arch/powerpc/boot/dts/socrates.dts b/arch/powerpc/boot/dts/socrates.dts
index 7a6ae75a1e57..feb4ef6bd144 100644
--- a/arch/powerpc/boot/dts/socrates.dts
+++ b/arch/powerpc/boot/dts/socrates.dts
@@ -55,10 +55,22 @@
55 device_type = "soc"; 55 device_type = "soc";
56 56
57 ranges = <0x00000000 0xe0000000 0x00100000>; 57 ranges = <0x00000000 0xe0000000 0x00100000>;
58 reg = <0xe0000000 0x00001000>; // CCSRBAR 1M
59 bus-frequency = <0>; // Filled in by U-Boot 58 bus-frequency = <0>; // Filled in by U-Boot
60 compatible = "fsl,mpc8544-immr", "simple-bus"; 59 compatible = "fsl,mpc8544-immr", "simple-bus";
61 60
61 ecm-law@0 {
62 compatible = "fsl,ecm-law";
63 reg = <0x0 0x1000>;
64 fsl,num-laws = <10>;
65 };
66
67 ecm@1000 {
68 compatible = "fsl,mpc8544-ecm", "fsl,ecm";
69 reg = <0x1000 0x1000>;
70 interrupts = <17 2>;
71 interrupt-parent = <&mpic>;
72 };
73
62 memory-controller@2000 { 74 memory-controller@2000 {
63 compatible = "fsl,mpc8544-memory-controller"; 75 compatible = "fsl,mpc8544-memory-controller";
64 reg = <0x2000 0x1000>; 76 reg = <0x2000 0x1000>;
@@ -314,7 +326,6 @@
314 }; 326 };
315 327
316 pci0: pci@e0008000 { 328 pci0: pci@e0008000 {
317 cell-index = <0>;
318 #interrupt-cells = <1>; 329 #interrupt-cells = <1>;
319 #size-cells = <2>; 330 #size-cells = <2>;
320 #address-cells = <3>; 331 #address-cells = <3>;
diff --git a/arch/powerpc/boot/dts/stx_gp3_8560.dts b/arch/powerpc/boot/dts/stx_gp3_8560.dts
index ea6b15152de3..b670d03fbcd9 100644
--- a/arch/powerpc/boot/dts/stx_gp3_8560.dts
+++ b/arch/powerpc/boot/dts/stx_gp3_8560.dts
@@ -52,10 +52,22 @@
52 #size-cells = <1>; 52 #size-cells = <1>;
53 device_type = "soc"; 53 device_type = "soc";
54 ranges = <0 0xfdf00000 0x100000>; 54 ranges = <0 0xfdf00000 0x100000>;
55 reg = <0xfdf00000 0x1000>;
56 bus-frequency = <0>; 55 bus-frequency = <0>;
57 compatible = "fsl,mpc8560-immr", "simple-bus"; 56 compatible = "fsl,mpc8560-immr", "simple-bus";
58 57
58 ecm-law@0 {
59 compatible = "fsl,ecm-law";
60 reg = <0x0 0x1000>;
61 fsl,num-laws = <8>;
62 };
63
64 ecm@1000 {
65 compatible = "fsl,mpc8560-ecm", "fsl,ecm";
66 reg = <0x1000 0x1000>;
67 interrupts = <17 2>;
68 interrupt-parent = <&mpic>;
69 };
70
59 memory-controller@2000 { 71 memory-controller@2000 {
60 compatible = "fsl,mpc8540-memory-controller"; 72 compatible = "fsl,mpc8540-memory-controller";
61 reg = <0x2000 0x1000>; 73 reg = <0x2000 0x1000>;
@@ -251,7 +263,6 @@
251 }; 263 };
252 264
253 pci0: pci@fdf08000 { 265 pci0: pci@fdf08000 {
254 cell-index = <0>;
255 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 266 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
256 interrupt-map = < 267 interrupt-map = <
257 268
diff --git a/arch/powerpc/boot/dts/tqm8540.dts b/arch/powerpc/boot/dts/tqm8540.dts
index b6f1fc6eb960..71347537b83e 100644
--- a/arch/powerpc/boot/dts/tqm8540.dts
+++ b/arch/powerpc/boot/dts/tqm8540.dts
@@ -54,10 +54,22 @@
54 #size-cells = <1>; 54 #size-cells = <1>;
55 device_type = "soc"; 55 device_type = "soc";
56 ranges = <0x0 0xe0000000 0x100000>; 56 ranges = <0x0 0xe0000000 0x100000>;
57 reg = <0xe0000000 0x200>;
58 bus-frequency = <0>; 57 bus-frequency = <0>;
59 compatible = "fsl,mpc8540-immr", "simple-bus"; 58 compatible = "fsl,mpc8540-immr", "simple-bus";
60 59
60 ecm-law@0 {
61 compatible = "fsl,ecm-law";
62 reg = <0x0 0x1000>;
63 fsl,num-laws = <8>;
64 };
65
66 ecm@1000 {
67 compatible = "fsl,mpc8540-ecm", "fsl,ecm";
68 reg = <0x1000 0x1000>;
69 interrupts = <17 2>;
70 interrupt-parent = <&mpic>;
71 };
72
61 memory-controller@2000 { 73 memory-controller@2000 {
62 compatible = "fsl,mpc8540-memory-controller"; 74 compatible = "fsl,mpc8540-memory-controller";
63 reg = <0x2000 0x1000>; 75 reg = <0x2000 0x1000>;
@@ -266,7 +278,6 @@
266 }; 278 };
267 279
268 pci0: pci@e0008000 { 280 pci0: pci@e0008000 {
269 cell-index = <0>;
270 #interrupt-cells = <1>; 281 #interrupt-cells = <1>;
271 #size-cells = <2>; 282 #size-cells = <2>;
272 #address-cells = <3>; 283 #address-cells = <3>;
diff --git a/arch/powerpc/boot/dts/tqm8541.dts b/arch/powerpc/boot/dts/tqm8541.dts
index fa6a3d54a8a5..b30f63753d41 100644
--- a/arch/powerpc/boot/dts/tqm8541.dts
+++ b/arch/powerpc/boot/dts/tqm8541.dts
@@ -53,10 +53,22 @@
53 #size-cells = <1>; 53 #size-cells = <1>;
54 device_type = "soc"; 54 device_type = "soc";
55 ranges = <0x0 0xe0000000 0x100000>; 55 ranges = <0x0 0xe0000000 0x100000>;
56 reg = <0xe0000000 0x200>;
57 bus-frequency = <0>; 56 bus-frequency = <0>;
58 compatible = "fsl,mpc8541-immr", "simple-bus"; 57 compatible = "fsl,mpc8541-immr", "simple-bus";
59 58
59 ecm-law@0 {
60 compatible = "fsl,ecm-law";
61 reg = <0x0 0x1000>;
62 fsl,num-laws = <8>;
63 };
64
65 ecm@1000 {
66 compatible = "fsl,mpc8541-ecm", "fsl,ecm";
67 reg = <0x1000 0x1000>;
68 interrupts = <17 2>;
69 interrupt-parent = <&mpic>;
70 };
71
60 memory-controller@2000 { 72 memory-controller@2000 {
61 compatible = "fsl,mpc8540-memory-controller"; 73 compatible = "fsl,mpc8540-memory-controller";
62 reg = <0x2000 0x1000>; 74 reg = <0x2000 0x1000>;
@@ -288,7 +300,6 @@
288 }; 300 };
289 301
290 pci0: pci@e0008000 { 302 pci0: pci@e0008000 {
291 cell-index = <0>;
292 #interrupt-cells = <1>; 303 #interrupt-cells = <1>;
293 #size-cells = <2>; 304 #size-cells = <2>;
294 #address-cells = <3>; 305 #address-cells = <3>;
diff --git a/arch/powerpc/boot/dts/tqm8548-bigflash.dts b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
index 00f7ed7a2455..61f25e15fd66 100644
--- a/arch/powerpc/boot/dts/tqm8548-bigflash.dts
+++ b/arch/powerpc/boot/dts/tqm8548-bigflash.dts
@@ -55,10 +55,22 @@
55 #size-cells = <1>; 55 #size-cells = <1>;
56 device_type = "soc"; 56 device_type = "soc";
57 ranges = <0x0 0xa0000000 0x100000>; 57 ranges = <0x0 0xa0000000 0x100000>;
58 reg = <0xa0000000 0x1000>; // CCSRBAR
59 bus-frequency = <0>; 58 bus-frequency = <0>;
60 compatible = "fsl,mpc8548-immr", "simple-bus"; 59 compatible = "fsl,mpc8548-immr", "simple-bus";
61 60
61 ecm-law@0 {
62 compatible = "fsl,ecm-law";
63 reg = <0x0 0x1000>;
64 fsl,num-laws = <10>;
65 };
66
67 ecm@1000 {
68 compatible = "fsl,mpc8548-ecm", "fsl,ecm";
69 reg = <0x1000 0x1000>;
70 interrupts = <17 2>;
71 interrupt-parent = <&mpic>;
72 };
73
62 memory-controller@2000 { 74 memory-controller@2000 {
63 compatible = "fsl,mpc8548-memory-controller"; 75 compatible = "fsl,mpc8548-memory-controller";
64 reg = <0x2000 0x1000>; 76 reg = <0x2000 0x1000>;
@@ -419,7 +431,6 @@
419 }; 431 };
420 432
421 pci0: pci@a0008000 { 433 pci0: pci@a0008000 {
422 cell-index = <0>;
423 #interrupt-cells = <1>; 434 #interrupt-cells = <1>;
424 #size-cells = <2>; 435 #size-cells = <2>;
425 #address-cells = <3>; 436 #address-cells = <3>;
@@ -441,7 +452,6 @@
441 }; 452 };
442 453
443 pci1: pcie@a000a000 { 454 pci1: pcie@a000a000 {
444 cell-index = <2>;
445 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 455 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
446 interrupt-map = < 456 interrupt-map = <
447 /* IDSEL 0x0 (PEX) */ 457 /* IDSEL 0x0 (PEX) */
diff --git a/arch/powerpc/boot/dts/tqm8548.dts b/arch/powerpc/boot/dts/tqm8548.dts
index 673e4a778ac8..025759c7c955 100644
--- a/arch/powerpc/boot/dts/tqm8548.dts
+++ b/arch/powerpc/boot/dts/tqm8548.dts
@@ -55,10 +55,22 @@
55 #size-cells = <1>; 55 #size-cells = <1>;
56 device_type = "soc"; 56 device_type = "soc";
57 ranges = <0x0 0xe0000000 0x100000>; 57 ranges = <0x0 0xe0000000 0x100000>;
58 reg = <0xe0000000 0x1000>; // CCSRBAR
59 bus-frequency = <0>; 58 bus-frequency = <0>;
60 compatible = "fsl,mpc8548-immr", "simple-bus"; 59 compatible = "fsl,mpc8548-immr", "simple-bus";
61 60
61 ecm-law@0 {
62 compatible = "fsl,ecm-law";
63 reg = <0x0 0x1000>;
64 fsl,num-laws = <10>;
65 };
66
67 ecm@1000 {
68 compatible = "fsl,mpc8548-ecm", "fsl,ecm";
69 reg = <0x1000 0x1000>;
70 interrupts = <17 2>;
71 interrupt-parent = <&mpic>;
72 };
73
62 memory-controller@2000 { 74 memory-controller@2000 {
63 compatible = "fsl,mpc8548-memory-controller"; 75 compatible = "fsl,mpc8548-memory-controller";
64 reg = <0x2000 0x1000>; 76 reg = <0x2000 0x1000>;
@@ -419,7 +431,6 @@
419 }; 431 };
420 432
421 pci0: pci@e0008000 { 433 pci0: pci@e0008000 {
422 cell-index = <0>;
423 #interrupt-cells = <1>; 434 #interrupt-cells = <1>;
424 #size-cells = <2>; 435 #size-cells = <2>;
425 #address-cells = <3>; 436 #address-cells = <3>;
@@ -441,7 +452,6 @@
441 }; 452 };
442 453
443 pci1: pcie@e000a000 { 454 pci1: pcie@e000a000 {
444 cell-index = <2>;
445 interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 455 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
446 interrupt-map = < 456 interrupt-map = <
447 /* IDSEL 0x0 (PEX) */ 457 /* IDSEL 0x0 (PEX) */
diff --git a/arch/powerpc/boot/dts/tqm8555.dts b/arch/powerpc/boot/dts/tqm8555.dts
index 6a99f1eef7ad..95e287381836 100644
--- a/arch/powerpc/boot/dts/tqm8555.dts
+++ b/arch/powerpc/boot/dts/tqm8555.dts
@@ -53,10 +53,22 @@
53 #size-cells = <1>; 53 #size-cells = <1>;
54 device_type = "soc"; 54 device_type = "soc";
55 ranges = <0x0 0xe0000000 0x100000>; 55 ranges = <0x0 0xe0000000 0x100000>;
56 reg = <0xe0000000 0x200>;
57 bus-frequency = <0>; 56 bus-frequency = <0>;
58 compatible = "fsl,mpc8555-immr", "simple-bus"; 57 compatible = "fsl,mpc8555-immr", "simple-bus";
59 58
59 ecm-law@0 {
60 compatible = "fsl,ecm-law";
61 reg = <0x0 0x1000>;
62 fsl,num-laws = <8>;
63 };
64
65 ecm@1000 {
66 compatible = "fsl,mpc8555-ecm", "fsl,ecm";
67 reg = <0x1000 0x1000>;
68 interrupts = <17 2>;
69 interrupt-parent = <&mpic>;
70 };
71
60 memory-controller@2000 { 72 memory-controller@2000 {
61 compatible = "fsl,mpc8540-memory-controller"; 73 compatible = "fsl,mpc8540-memory-controller";
62 reg = <0x2000 0x1000>; 74 reg = <0x2000 0x1000>;
@@ -288,7 +300,6 @@
288 }; 300 };
289 301
290 pci0: pci@e0008000 { 302 pci0: pci@e0008000 {
291 cell-index = <0>;
292 #interrupt-cells = <1>; 303 #interrupt-cells = <1>;
293 #size-cells = <2>; 304 #size-cells = <2>;
294 #address-cells = <3>; 305 #address-cells = <3>;
diff --git a/arch/powerpc/boot/dts/tqm8560.dts b/arch/powerpc/boot/dts/tqm8560.dts
index b6c2d71defd3..ff70580a8f4c 100644
--- a/arch/powerpc/boot/dts/tqm8560.dts
+++ b/arch/powerpc/boot/dts/tqm8560.dts
@@ -55,10 +55,22 @@
55 #size-cells = <1>; 55 #size-cells = <1>;
56 device_type = "soc"; 56 device_type = "soc";
57 ranges = <0x0 0xe0000000 0x100000>; 57 ranges = <0x0 0xe0000000 0x100000>;
58 reg = <0xe0000000 0x200>;
59 bus-frequency = <0>; 58 bus-frequency = <0>;
60 compatible = "fsl,mpc8560-immr", "simple-bus"; 59 compatible = "fsl,mpc8560-immr", "simple-bus";
61 60
61 ecm-law@0 {
62 compatible = "fsl,ecm-law";
63 reg = <0x0 0x1000>;
64 fsl,num-laws = <8>;
65 };
66
67 ecm@1000 {
68 compatible = "fsl,mpc8560-ecm", "fsl,ecm";
69 reg = <0x1000 0x1000>;
70 interrupts = <17 2>;
71 interrupt-parent = <&mpic>;
72 };
73
62 memory-controller@2000 { 74 memory-controller@2000 {
63 compatible = "fsl,mpc8540-memory-controller"; 75 compatible = "fsl,mpc8540-memory-controller";
64 reg = <0x2000 0x1000>; 76 reg = <0x2000 0x1000>;
@@ -359,7 +371,6 @@
359 }; 371 };
360 372
361 pci0: pci@e0008000 { 373 pci0: pci@e0008000 {
362 cell-index = <0>;
363 #interrupt-cells = <1>; 374 #interrupt-cells = <1>;
364 #size-cells = <2>; 375 #size-cells = <2>;
365 #address-cells = <3>; 376 #address-cells = <3>;
diff --git a/arch/powerpc/boot/dts/virtex440-ml510.dts b/arch/powerpc/boot/dts/virtex440-ml510.dts
new file mode 100644
index 000000000000..81a8dc2c6365
--- /dev/null
+++ b/arch/powerpc/boot/dts/virtex440-ml510.dts
@@ -0,0 +1,465 @@
1/*
2 * Xilinx ML510 Reference Design support
3 *
4 * This DTS file was created for the ml510_bsb1_pcores_ppc440 reference design.
5 * The reference design contains a bug which prevent PCI DMA from working
6 * properly. A description of the bug is given in the plbv46_pci section. It
7 * needs to be fixed by the user until Xilinx updates their reference design.
8 *
9 * Copyright 2009, Roderick Colenbrander
10 */
11
12/dts-v1/;
13/ {
14 #address-cells = <1>;
15 #size-cells = <1>;
16 compatible = "xlnx,ml510-ref-design", "xlnx,virtex440";
17 dcr-parent = <&ppc440_0>;
18 DDR2_SDRAM_DIMM0: memory@0 {
19 device_type = "memory";
20 reg = < 0x0 0x20000000 >;
21 } ;
22 alias {
23 ethernet0 = &Hard_Ethernet_MAC;
24 serial0 = &RS232_Uart_1;
25 } ;
26 chosen {
27 bootargs = "console=ttyS0 root=/dev/ram";
28 linux,stdout-path = "/plb@0/serial@83e00000";
29 } ;
30 cpus {
31 #address-cells = <1>;
32 #cpus = <0x1>;
33 #size-cells = <0>;
34 ppc440_0: cpu@0 {
35 #address-cells = <1>;
36 #size-cells = <1>;
37 clock-frequency = <300000000>;
38 compatible = "PowerPC,440", "ibm,ppc440";
39 d-cache-line-size = <0x20>;
40 d-cache-size = <0x8000>;
41 dcr-access-method = "native";
42 dcr-controller ;
43 device_type = "cpu";
44 i-cache-line-size = <0x20>;
45 i-cache-size = <0x8000>;
46 model = "PowerPC,440";
47 reg = <0>;
48 timebase-frequency = <300000000>;
49 xlnx,apu-control = <0x2000>;
50 xlnx,apu-udi-0 = <0x0>;
51 xlnx,apu-udi-1 = <0x0>;
52 xlnx,apu-udi-10 = <0x0>;
53 xlnx,apu-udi-11 = <0x0>;
54 xlnx,apu-udi-12 = <0x0>;
55 xlnx,apu-udi-13 = <0x0>;
56 xlnx,apu-udi-14 = <0x0>;
57 xlnx,apu-udi-15 = <0x0>;
58 xlnx,apu-udi-2 = <0x0>;
59 xlnx,apu-udi-3 = <0x0>;
60 xlnx,apu-udi-4 = <0x0>;
61 xlnx,apu-udi-5 = <0x0>;
62 xlnx,apu-udi-6 = <0x0>;
63 xlnx,apu-udi-7 = <0x0>;
64 xlnx,apu-udi-8 = <0x0>;
65 xlnx,apu-udi-9 = <0x0>;
66 xlnx,dcr-autolock-enable = <0x1>;
67 xlnx,dcu-rd-ld-cache-plb-prio = <0x0>;
68 xlnx,dcu-rd-noncache-plb-prio = <0x0>;
69 xlnx,dcu-rd-touch-plb-prio = <0x0>;
70 xlnx,dcu-rd-urgent-plb-prio = <0x0>;
71 xlnx,dcu-wr-flush-plb-prio = <0x0>;
72 xlnx,dcu-wr-store-plb-prio = <0x0>;
73 xlnx,dcu-wr-urgent-plb-prio = <0x0>;
74 xlnx,dma0-control = <0x0>;
75 xlnx,dma0-plb-prio = <0x0>;
76 xlnx,dma0-rxchannelctrl = <0x1010000>;
77 xlnx,dma0-rxirqtimer = <0x3ff>;
78 xlnx,dma0-txchannelctrl = <0x1010000>;
79 xlnx,dma0-txirqtimer = <0x3ff>;
80 xlnx,dma1-control = <0x0>;
81 xlnx,dma1-plb-prio = <0x0>;
82 xlnx,dma1-rxchannelctrl = <0x1010000>;
83 xlnx,dma1-rxirqtimer = <0x3ff>;
84 xlnx,dma1-txchannelctrl = <0x1010000>;
85 xlnx,dma1-txirqtimer = <0x3ff>;
86 xlnx,dma2-control = <0x0>;
87 xlnx,dma2-plb-prio = <0x0>;
88 xlnx,dma2-rxchannelctrl = <0x1010000>;
89 xlnx,dma2-rxirqtimer = <0x3ff>;
90 xlnx,dma2-txchannelctrl = <0x1010000>;
91 xlnx,dma2-txirqtimer = <0x3ff>;
92 xlnx,dma3-control = <0x0>;
93 xlnx,dma3-plb-prio = <0x0>;
94 xlnx,dma3-rxchannelctrl = <0x1010000>;
95 xlnx,dma3-rxirqtimer = <0x3ff>;
96 xlnx,dma3-txchannelctrl = <0x1010000>;
97 xlnx,dma3-txirqtimer = <0x3ff>;
98 xlnx,endian-reset = <0x0>;
99 xlnx,generate-plb-timespecs = <0x1>;
100 xlnx,icu-rd-fetch-plb-prio = <0x0>;
101 xlnx,icu-rd-spec-plb-prio = <0x0>;
102 xlnx,icu-rd-touch-plb-prio = <0x0>;
103 xlnx,interconnect-imask = <0xffffffff>;
104 xlnx,mplb-allow-lock-xfer = <0x1>;
105 xlnx,mplb-arb-mode = <0x0>;
106 xlnx,mplb-awidth = <0x20>;
107 xlnx,mplb-counter = <0x500>;
108 xlnx,mplb-dwidth = <0x80>;
109 xlnx,mplb-max-burst = <0x8>;
110 xlnx,mplb-native-dwidth = <0x80>;
111 xlnx,mplb-p2p = <0x0>;
112 xlnx,mplb-prio-dcur = <0x2>;
113 xlnx,mplb-prio-dcuw = <0x3>;
114 xlnx,mplb-prio-icu = <0x4>;
115 xlnx,mplb-prio-splb0 = <0x1>;
116 xlnx,mplb-prio-splb1 = <0x0>;
117 xlnx,mplb-read-pipe-enable = <0x1>;
118 xlnx,mplb-sync-tattribute = <0x0>;
119 xlnx,mplb-wdog-enable = <0x1>;
120 xlnx,mplb-write-pipe-enable = <0x1>;
121 xlnx,mplb-write-post-enable = <0x1>;
122 xlnx,num-dma = <0x0>;
123 xlnx,pir = <0xf>;
124 xlnx,ppc440mc-addr-base = <0x0>;
125 xlnx,ppc440mc-addr-high = <0x1fffffff>;
126 xlnx,ppc440mc-arb-mode = <0x0>;
127 xlnx,ppc440mc-bank-conflict-mask = <0x1800000>;
128 xlnx,ppc440mc-control = <0xf810008f>;
129 xlnx,ppc440mc-max-burst = <0x8>;
130 xlnx,ppc440mc-prio-dcur = <0x2>;
131 xlnx,ppc440mc-prio-dcuw = <0x3>;
132 xlnx,ppc440mc-prio-icu = <0x4>;
133 xlnx,ppc440mc-prio-splb0 = <0x1>;
134 xlnx,ppc440mc-prio-splb1 = <0x0>;
135 xlnx,ppc440mc-row-conflict-mask = <0x7ffe00>;
136 xlnx,ppcdm-asyncmode = <0x0>;
137 xlnx,ppcds-asyncmode = <0x0>;
138 xlnx,user-reset = <0x0>;
139 } ;
140 } ;
141 plb_v46_0: plb@0 {
142 #address-cells = <1>;
143 #size-cells = <1>;
144 compatible = "xlnx,plb-v46-1.03.a", "simple-bus";
145 ranges ;
146 FLASH: flash@fc000000 {
147 bank-width = <2>;
148 compatible = "xlnx,xps-mch-emc-2.00.a", "cfi-flash";
149 reg = < 0xfc000000 0x2000000 >;
150 xlnx,family = "virtex5";
151 xlnx,include-datawidth-matching-0 = <0x1>;
152 xlnx,include-datawidth-matching-1 = <0x0>;
153 xlnx,include-datawidth-matching-2 = <0x0>;
154 xlnx,include-datawidth-matching-3 = <0x0>;
155 xlnx,include-negedge-ioregs = <0x0>;
156 xlnx,include-plb-ipif = <0x1>;
157 xlnx,include-wrbuf = <0x1>;
158 xlnx,max-mem-width = <0x10>;
159 xlnx,mch-native-dwidth = <0x20>;
160 xlnx,mch-plb-clk-period-ps = <0x2710>;
161 xlnx,mch-splb-awidth = <0x20>;
162 xlnx,mch0-accessbuf-depth = <0x10>;
163 xlnx,mch0-protocol = <0x0>;
164 xlnx,mch0-rddatabuf-depth = <0x10>;
165 xlnx,mch1-accessbuf-depth = <0x10>;
166 xlnx,mch1-protocol = <0x0>;
167 xlnx,mch1-rddatabuf-depth = <0x10>;
168 xlnx,mch2-accessbuf-depth = <0x10>;
169 xlnx,mch2-protocol = <0x0>;
170 xlnx,mch2-rddatabuf-depth = <0x10>;
171 xlnx,mch3-accessbuf-depth = <0x10>;
172 xlnx,mch3-protocol = <0x0>;
173 xlnx,mch3-rddatabuf-depth = <0x10>;
174 xlnx,mem0-width = <0x10>;
175 xlnx,mem1-width = <0x20>;
176 xlnx,mem2-width = <0x20>;
177 xlnx,mem3-width = <0x20>;
178 xlnx,num-banks-mem = <0x1>;
179 xlnx,num-channels = <0x2>;
180 xlnx,priority-mode = <0x0>;
181 xlnx,synch-mem-0 = <0x0>;
182 xlnx,synch-mem-1 = <0x0>;
183 xlnx,synch-mem-2 = <0x0>;
184 xlnx,synch-mem-3 = <0x0>;
185 xlnx,synch-pipedelay-0 = <0x2>;
186 xlnx,synch-pipedelay-1 = <0x2>;
187 xlnx,synch-pipedelay-2 = <0x2>;
188 xlnx,synch-pipedelay-3 = <0x2>;
189 xlnx,tavdv-ps-mem-0 = <0x1adb0>;
190 xlnx,tavdv-ps-mem-1 = <0x3a98>;
191 xlnx,tavdv-ps-mem-2 = <0x3a98>;
192 xlnx,tavdv-ps-mem-3 = <0x3a98>;
193 xlnx,tcedv-ps-mem-0 = <0x1adb0>;
194 xlnx,tcedv-ps-mem-1 = <0x3a98>;
195 xlnx,tcedv-ps-mem-2 = <0x3a98>;
196 xlnx,tcedv-ps-mem-3 = <0x3a98>;
197 xlnx,thzce-ps-mem-0 = <0x88b8>;
198 xlnx,thzce-ps-mem-1 = <0x1b58>;
199 xlnx,thzce-ps-mem-2 = <0x1b58>;
200 xlnx,thzce-ps-mem-3 = <0x1b58>;
201 xlnx,thzoe-ps-mem-0 = <0x1b58>;
202 xlnx,thzoe-ps-mem-1 = <0x1b58>;
203 xlnx,thzoe-ps-mem-2 = <0x1b58>;
204 xlnx,thzoe-ps-mem-3 = <0x1b58>;
205 xlnx,tlzwe-ps-mem-0 = <0x88b8>;
206 xlnx,tlzwe-ps-mem-1 = <0x0>;
207 xlnx,tlzwe-ps-mem-2 = <0x0>;
208 xlnx,tlzwe-ps-mem-3 = <0x0>;
209 xlnx,twc-ps-mem-0 = <0x1adb0>;
210 xlnx,twc-ps-mem-1 = <0x3a98>;
211 xlnx,twc-ps-mem-2 = <0x3a98>;
212 xlnx,twc-ps-mem-3 = <0x3a98>;
213 xlnx,twp-ps-mem-0 = <0x11170>;
214 xlnx,twp-ps-mem-1 = <0x2ee0>;
215 xlnx,twp-ps-mem-2 = <0x2ee0>;
216 xlnx,twp-ps-mem-3 = <0x2ee0>;
217 xlnx,xcl0-linesize = <0x4>;
218 xlnx,xcl0-writexfer = <0x1>;
219 xlnx,xcl1-linesize = <0x4>;
220 xlnx,xcl1-writexfer = <0x1>;
221 xlnx,xcl2-linesize = <0x4>;
222 xlnx,xcl2-writexfer = <0x1>;
223 xlnx,xcl3-linesize = <0x4>;
224 xlnx,xcl3-writexfer = <0x1>;
225 } ;
226 Hard_Ethernet_MAC: xps-ll-temac@81c00000 {
227 #address-cells = <1>;
228 #size-cells = <1>;
229 compatible = "xlnx,compound";
230 ethernet@81c00000 {
231 compatible = "xlnx,xps-ll-temac-1.01.b";
232 device_type = "network";
233 interrupt-parent = <&xps_intc_0>;
234 interrupts = < 8 2 >;
235 llink-connected = <&Hard_Ethernet_MAC_fifo>;
236 local-mac-address = [ 02 00 00 00 00 00 ];
237 reg = < 0x81c00000 0x40 >;
238 xlnx,bus2core-clk-ratio = <0x1>;
239 xlnx,phy-type = <0x3>;
240 xlnx,phyaddr = <0x1>;
241 xlnx,rxcsum = <0x0>;
242 xlnx,rxfifo = <0x8000>;
243 xlnx,temac-type = <0x0>;
244 xlnx,txcsum = <0x0>;
245 xlnx,txfifo = <0x8000>;
246 } ;
247 } ;
248 Hard_Ethernet_MAC_fifo: xps-ll-fifo@81a00000 {
249 compatible = "xlnx,xps-ll-fifo-1.01.a";
250 interrupt-parent = <&xps_intc_0>;
251 interrupts = < 6 2 >;
252 reg = < 0x81a00000 0x10000 >;
253 xlnx,family = "virtex5";
254 } ;
255 IIC_EEPROM: i2c@81600000 {
256 compatible = "xlnx,xps-iic-2.00.a";
257 interrupt-parent = <&xps_intc_0>;
258 interrupts = < 9 2 >;
259 reg = < 0x81600000 0x10000 >;
260 xlnx,clk-freq = <0x5f5e100>;
261 xlnx,family = "virtex5";
262 xlnx,gpo-width = <0x1>;
263 xlnx,iic-freq = <0x186a0>;
264 xlnx,scl-inertial-delay = <0x5>;
265 xlnx,sda-inertial-delay = <0x5>;
266 xlnx,ten-bit-adr = <0x0>;
267 } ;
268 LCD_OPTIONAL: gpio@81420000 {
269 compatible = "xlnx,xps-gpio-1.00.a";
270 reg = < 0x81420000 0x10000 >;
271 xlnx,all-inputs = <0x0>;
272 xlnx,all-inputs-2 = <0x0>;
273 xlnx,dout-default = <0x0>;
274 xlnx,dout-default-2 = <0x0>;
275 xlnx,family = "virtex5";
276 xlnx,gpio-width = <0xb>;
277 xlnx,interrupt-present = <0x0>;
278 xlnx,is-bidir = <0x1>;
279 xlnx,is-bidir-2 = <0x1>;
280 xlnx,is-dual = <0x0>;
281 xlnx,tri-default = <0xffffffff>;
282 xlnx,tri-default-2 = <0xffffffff>;
283 } ;
284 LEDs_4Bit: gpio@81400000 {
285 compatible = "xlnx,xps-gpio-1.00.a";
286 reg = < 0x81400000 0x10000 >;
287 xlnx,all-inputs = <0x0>;
288 xlnx,all-inputs-2 = <0x0>;
289 xlnx,dout-default = <0x0>;
290 xlnx,dout-default-2 = <0x0>;
291 xlnx,family = "virtex5";
292 xlnx,gpio-width = <0x4>;
293 xlnx,interrupt-present = <0x0>;
294 xlnx,is-bidir = <0x1>;
295 xlnx,is-bidir-2 = <0x1>;
296 xlnx,is-dual = <0x0>;
297 xlnx,tri-default = <0xffffffff>;
298 xlnx,tri-default-2 = <0xffffffff>;
299 } ;
300 RS232_Uart_1: serial@83e00000 {
301 clock-frequency = <100000000>;
302 compatible = "xlnx,xps-uart16550-2.00.b", "ns16550";
303 current-speed = <9600>;
304 device_type = "serial";
305 interrupt-parent = <&xps_intc_0>;
306 interrupts = < 11 2 >;
307 reg = < 0x83e00000 0x10000 >;
308 reg-offset = <0x1003>;
309 reg-shift = <2>;
310 xlnx,family = "virtex5";
311 xlnx,has-external-rclk = <0x0>;
312 xlnx,has-external-xin = <0x0>;
313 xlnx,is-a-16550 = <0x1>;
314 } ;
315 SPI_EEPROM: xps-spi@feff8000 {
316 compatible = "xlnx,xps-spi-2.00.b";
317 interrupt-parent = <&xps_intc_0>;
318 interrupts = < 10 2 >;
319 reg = < 0xfeff8000 0x80 >;
320 xlnx,family = "virtex5";
321 xlnx,fifo-exist = <0x1>;
322 xlnx,num-ss-bits = <0x1>;
323 xlnx,num-transfer-bits = <0x8>;
324 xlnx,sck-ratio = <0x80>;
325 } ;
326 SysACE_CompactFlash: sysace@83600000 {
327 compatible = "xlnx,xps-sysace-1.00.a";
328 interrupt-parent = <&xps_intc_0>;
329 interrupts = < 7 2 >;
330 reg = < 0x83600000 0x10000 >;
331 xlnx,family = "virtex5";
332 xlnx,mem-width = <0x10>;
333 } ;
334 plbv46_pci_0: plbv46-pci@85e00000 {
335 #size-cells = <2>;
336 #address-cells = <3>;
337 compatible = "xlnx,plbv46-pci-1.03.a";
338 device_type = "pci";
339 reg = < 0x85e00000 0x10000 >;
340
341 /*
342 * The default ML510 BSB has C_IPIFBAR2PCIBAR_0 set to
343 * 0 which means that a read/write to the memory mapped
344 * i/o region (which starts at 0xa0000000) for pci
345 * bar 0 on the plb side translates to 0.
346 * It is important to set this value to 0xa0000000, so
347 * that inbound and outbound pci transactions work
348 * properly including DMA.
349 */
350 ranges = <0x02000000 0 0xa0000000 0xa0000000 0 0x20000000
351 0x01000000 0 0x00000000 0xf0000000 0 0x00010000>;
352
353 #interrupt-cells = <1>;
354 interrupt-parent = <&xps_intc_0>;
355 interrupt-map-mask = <0xff00 0x0 0x0 0x7>;
356 interrupt-map = <
357 /* IRQ mapping for pci slots and ALI M1533
358 * periperhals. In total there are 5 interrupt
359 * lines connected to a xps_intc controller.
360 * Four of them are PCI IRQ A, B, C, D and
361 * which correspond to respectively xpx_intc
362 * 5, 4, 3 and 2. The fifth interrupt line is
363 * connected to the south bridge and this one
364 * uses irq 1 and is active high instead of
365 * active low.
366 *
367 * The M1533 contains various peripherals
368 * including AC97 audio, a modem, USB, IDE and
369 * some power management stuff. The modem
370 * isn't connected on the ML510 and the power
371 * management core also isn't used.
372 */
373
374 /* IDSEL 0x16 / dev=6, bus=0 / PCI slot 3 */
375 0x3000 0 0 1 &xps_intc_0 3 2
376 0x3000 0 0 2 &xps_intc_0 2 2
377 0x3000 0 0 3 &xps_intc_0 5 2
378 0x3000 0 0 4 &xps_intc_0 4 2
379
380 /* IDSEL 0x13 / dev=3, bus=1 / PCI slot 4 */
381 /*
382 0x11800 0 0 1 &xps_intc_0 5 0 2
383 0x11800 0 0 2 &xps_intc_0 4 0 2
384 0x11800 0 0 3 &xps_intc_0 3 0 2
385 0x11800 0 0 4 &xps_intc_0 2 0 2
386 */
387
388 /* According to the datasheet + schematic
389 * ABCD [FPGA] of slot 5 is mapped to DABC.
390 * Testing showed that at least A maps to B,
391 * the mapping of the other pins is a guess
392 * and for that reason the lines have been
393 * commented out.
394 */
395 /* IDSEL 0x15 / dev=5, bus=0 / PCI slot 5 */
396 0x2800 0 0 1 &xps_intc_0 4 2
397 /*
398 0x2800 0 0 2 &xps_intc_0 3 2
399 0x2800 0 0 3 &xps_intc_0 2 2
400 0x2800 0 0 4 &xps_intc_0 5 2
401 */
402
403 /* IDSEL 0x12 / dev=2, bus=1 / PCI slot 6 */
404 /*
405 0x11000 0 0 1 &xps_intc_0 4 0 2
406 0x11000 0 0 2 &xps_intc_0 3 0 2
407 0x11000 0 0 3 &xps_intc_0 2 0 2
408 0x11000 0 0 4 &xps_intc_0 5 0 2
409 */
410
411 /* IDSEL 0x11 / dev=1, bus=0 / AC97 audio */
412 0x0800 0 0 1 &i8259 7 2
413
414 /* IDSEL 0x1b / dev=11, bus=0 / IDE */
415 0x5800 0 0 1 &i8259 14 2
416
417 /* IDSEL 0x1f / dev 15, bus=0 / 2x USB 1.1 */
418 0x7800 0 0 1 &i8259 7 2
419 >;
420 ali_m1533 {
421 #size-cells = <1>;
422 #address-cells = <2>;
423 i8259: interrupt-controller@20 {
424 reg = <1 0x20 2
425 1 0xa0 2
426 1 0x4d0 2>;
427 interrupt-controller;
428 device_type = "interrupt-controller";
429 #address-cells = <0>;
430 #interrupt-cells = <2>;
431 compatible = "chrp,iic";
432
433 /* south bridge irq is active high */
434 interrupts = <1 3>;
435 interrupt-parent = <&xps_intc_0>;
436 };
437 };
438 } ;
439 xps_bram_if_cntlr_1: xps-bram-if-cntlr@ffff0000 {
440 compatible = "xlnx,xps-bram-if-cntlr-1.00.a";
441 reg = < 0xffff0000 0x10000 >;
442 xlnx,family = "virtex5";
443 } ;
444 xps_intc_0: interrupt-controller@81800000 {
445 #interrupt-cells = <0x2>;
446 compatible = "xlnx,xps-intc-1.00.a";
447 interrupt-controller ;
448 reg = < 0x81800000 0x10000 >;
449 xlnx,num-intr-inputs = <0xc>;
450 } ;
451 xps_tft_0: tft@86e00000 {
452 compatible = "xlnx,xps-tft-1.00.a";
453 reg = < 0x86e00000 0x10000 >;
454 xlnx,dcr-splb-slave-if = <0x1>;
455 xlnx,default-tft-base-addr = <0x0>;
456 xlnx,family = "virtex5";
457 xlnx,i2c-slave-addr = <0x76>;
458 xlnx,mplb-awidth = <0x20>;
459 xlnx,mplb-dwidth = <0x80>;
460 xlnx,mplb-native-dwidth = <0x40>;
461 xlnx,mplb-smallest-slave = <0x20>;
462 xlnx,tft-interface = <0x1>;
463 } ;
464 } ;
465} ;
diff --git a/arch/powerpc/boot/dts/warp.dts b/arch/powerpc/boot/dts/warp.dts
index 7e183ff9a317..01bfb56bbe80 100644
--- a/arch/powerpc/boot/dts/warp.dts
+++ b/arch/powerpc/boot/dts/warp.dts
@@ -1,7 +1,7 @@
1/* 1/*
2 * Device Tree Source for PIKA Warp 2 * Device Tree Source for PIKA Warp
3 * 3 *
4 * Copyright (c) 2008 PIKA Technologies 4 * Copyright (c) 2008-2009 PIKA Technologies
5 * Sean MacLennan <smaclennan@pikatech.com> 5 * Sean MacLennan <smaclennan@pikatech.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
@@ -158,7 +158,7 @@
158 158
159 partition@0 { 159 partition@0 {
160 label = "splash"; 160 label = "splash";
161 reg = <0x00000000 0x00020000>; 161 reg = <0x00000000 0x00010000>;
162 }; 162 };
163 partition@300000 { 163 partition@300000 {
164 label = "fpga"; 164 label = "fpga";
@@ -244,28 +244,27 @@
244 }; 244 };
245 245
246 GPIO0: gpio@ef600b00 { 246 GPIO0: gpio@ef600b00 {
247 compatible = "ibm,gpio-440ep"; 247 compatible = "ibm,ppc4xx-gpio";
248 reg = <0xef600b00 0x00000048>; 248 reg = <0xef600b00 0x00000048>;
249 #gpio-cells = <2>; 249 #gpio-cells = <2>;
250 gpio-controller; 250 gpio-controller;
251 }; 251 };
252 252
253 GPIO1: gpio@ef600c00 { 253 GPIO1: gpio@ef600c00 {
254 compatible = "ibm,gpio-440ep"; 254 compatible = "ibm,ppc4xx-gpio";
255 reg = <0xef600c00 0x00000048>; 255 reg = <0xef600c00 0x00000048>;
256 #gpio-cells = <2>; 256 #gpio-cells = <2>;
257 gpio-controller; 257 gpio-controller;
258 };
258 259
259 led@31 { 260 power-leds {
260 compatible = "linux,gpio-led"; 261 compatible = "gpio-leds";
261 linux,name = ":green:"; 262 green {
262 gpios = <&GPIO1 31 0>; 263 gpios = <&GPIO1 0 0>;
263 }; 264 default-state = "on";
264 265 };
265 led@30 { 266 red {
266 compatible = "linux,gpio-led"; 267 gpios = <&GPIO1 1 0>;
267 linux,name = ":red:";
268 gpios = <&GPIO1 30 0>;
269 }; 268 };
270 }; 269 };
271 270
diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh
index 51b2387bdba0..98312d169c85 100644
--- a/arch/powerpc/boot/install.sh
+++ b/arch/powerpc/boot/install.sh
@@ -18,6 +18,9 @@
18# $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc. 18# $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc.
19# 19#
20 20
21# Bail with error code if anything goes wrong
22set -e
23
21# User may have a custom install script 24# User may have a custom install script
22 25
23if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi 26if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi
diff --git a/arch/powerpc/configs/40x/acadia_defconfig b/arch/powerpc/configs/40x/acadia_defconfig
index a32ec8d323a0..173a5bb77ca1 100644
--- a/arch/powerpc/configs/40x/acadia_defconfig
+++ b/arch/powerpc/configs/40x/acadia_defconfig
@@ -252,7 +252,7 @@ CONFIG_PCI_SYSCALL=y
252# CONFIG_PCIEPORTBUS is not set 252# CONFIG_PCIEPORTBUS is not set
253CONFIG_ARCH_SUPPORTS_MSI=y 253CONFIG_ARCH_SUPPORTS_MSI=y
254# CONFIG_PCI_MSI is not set 254# CONFIG_PCI_MSI is not set
255CONFIG_PCI_LEGACY=y 255# CONFIG_PCI_LEGACY is not set
256# CONFIG_PCI_DEBUG is not set 256# CONFIG_PCI_DEBUG is not set
257# CONFIG_PCI_STUB is not set 257# CONFIG_PCI_STUB is not set
258# CONFIG_PCCARD is not set 258# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/40x/ep405_defconfig b/arch/powerpc/configs/40x/ep405_defconfig
index 4e9d85f39da0..e9b8495cde0c 100644
--- a/arch/powerpc/configs/40x/ep405_defconfig
+++ b/arch/powerpc/configs/40x/ep405_defconfig
@@ -254,7 +254,7 @@ CONFIG_PCI_SYSCALL=y
254# CONFIG_PCIEPORTBUS is not set 254# CONFIG_PCIEPORTBUS is not set
255CONFIG_ARCH_SUPPORTS_MSI=y 255CONFIG_ARCH_SUPPORTS_MSI=y
256# CONFIG_PCI_MSI is not set 256# CONFIG_PCI_MSI is not set
257CONFIG_PCI_LEGACY=y 257# CONFIG_PCI_LEGACY is not set
258# CONFIG_PCI_DEBUG is not set 258# CONFIG_PCI_DEBUG is not set
259# CONFIG_PCI_STUB is not set 259# CONFIG_PCI_STUB is not set
260# CONFIG_PCCARD is not set 260# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/40x/kilauea_defconfig b/arch/powerpc/configs/40x/kilauea_defconfig
index 9917a09bad3a..865725effe93 100644
--- a/arch/powerpc/configs/40x/kilauea_defconfig
+++ b/arch/powerpc/configs/40x/kilauea_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.30-rc7
4# Tue Jan 20 08:17:52 2009 4# Wed Jun 3 10:18:16 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -27,6 +27,7 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
@@ -49,10 +50,12 @@ CONFIG_PPC_UDBG_16550=y
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
51CONFIG_GENERIC_BUG=y 52CONFIG_GENERIC_BUG=y
53CONFIG_DTC=y
52# CONFIG_DEFAULT_UIMAGE is not set 54# CONFIG_DEFAULT_UIMAGE is not set
53CONFIG_PPC_DCR_NATIVE=y 55CONFIG_PPC_DCR_NATIVE=y
54# CONFIG_PPC_DCR_MMIO is not set 56# CONFIG_PPC_DCR_MMIO is not set
55CONFIG_PPC_DCR=y 57CONFIG_PPC_DCR=y
58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
56CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
57 60
58# 61#
@@ -67,9 +70,19 @@ CONFIG_SWAP=y
67CONFIG_SYSVIPC=y 70CONFIG_SYSVIPC=y
68CONFIG_SYSVIPC_SYSCTL=y 71CONFIG_SYSVIPC_SYSCTL=y
69CONFIG_POSIX_MQUEUE=y 72CONFIG_POSIX_MQUEUE=y
73CONFIG_POSIX_MQUEUE_SYSCTL=y
70# CONFIG_BSD_PROCESS_ACCT is not set 74# CONFIG_BSD_PROCESS_ACCT is not set
71# CONFIG_TASKSTATS is not set 75# CONFIG_TASKSTATS is not set
72# 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
73# CONFIG_IKCONFIG is not set 86# CONFIG_IKCONFIG is not set
74CONFIG_LOG_BUF_SHIFT=14 87CONFIG_LOG_BUF_SHIFT=14
75CONFIG_GROUP_SCHED=y 88CONFIG_GROUP_SCHED=y
@@ -84,22 +97,24 @@ CONFIG_SYSFS_DEPRECATED_V2=y
84# CONFIG_NAMESPACES is not set 97# CONFIG_NAMESPACES is not set
85CONFIG_BLK_DEV_INITRD=y 98CONFIG_BLK_DEV_INITRD=y
86CONFIG_INITRAMFS_SOURCE="" 99CONFIG_INITRAMFS_SOURCE=""
100CONFIG_RD_GZIP=y
101# CONFIG_RD_BZIP2 is not set
102# CONFIG_RD_LZMA is not set
87# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 103# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
88CONFIG_SYSCTL=y 104CONFIG_SYSCTL=y
105CONFIG_ANON_INODES=y
89CONFIG_EMBEDDED=y 106CONFIG_EMBEDDED=y
90CONFIG_SYSCTL_SYSCALL=y 107CONFIG_SYSCTL_SYSCALL=y
91CONFIG_KALLSYMS=y 108CONFIG_KALLSYMS=y
92CONFIG_KALLSYMS_ALL=y 109CONFIG_KALLSYMS_ALL=y
93CONFIG_KALLSYMS_STRIP_GENERATED=y
94CONFIG_KALLSYMS_EXTRA_PASS=y 110CONFIG_KALLSYMS_EXTRA_PASS=y
111# CONFIG_STRIP_ASM_SYMS is not set
95CONFIG_HOTPLUG=y 112CONFIG_HOTPLUG=y
96CONFIG_PRINTK=y 113CONFIG_PRINTK=y
97CONFIG_BUG=y 114CONFIG_BUG=y
98CONFIG_ELF_CORE=y 115CONFIG_ELF_CORE=y
99CONFIG_COMPAT_BRK=y
100CONFIG_BASE_FULL=y 116CONFIG_BASE_FULL=y
101CONFIG_FUTEX=y 117CONFIG_FUTEX=y
102CONFIG_ANON_INODES=y
103CONFIG_EPOLL=y 118CONFIG_EPOLL=y
104CONFIG_SIGNALFD=y 119CONFIG_SIGNALFD=y
105CONFIG_TIMERFD=y 120CONFIG_TIMERFD=y
@@ -109,10 +124,12 @@ CONFIG_AIO=y
109CONFIG_VM_EVENT_COUNTERS=y 124CONFIG_VM_EVENT_COUNTERS=y
110CONFIG_PCI_QUIRKS=y 125CONFIG_PCI_QUIRKS=y
111CONFIG_SLUB_DEBUG=y 126CONFIG_SLUB_DEBUG=y
127CONFIG_COMPAT_BRK=y
112# CONFIG_SLAB is not set 128# CONFIG_SLAB is not set
113CONFIG_SLUB=y 129CONFIG_SLUB=y
114# CONFIG_SLOB is not set 130# CONFIG_SLOB is not set
115# CONFIG_PROFILING is not set 131# CONFIG_PROFILING is not set
132# CONFIG_MARKERS is not set
116CONFIG_HAVE_OPROFILE=y 133CONFIG_HAVE_OPROFILE=y
117# CONFIG_KPROBES is not set 134# CONFIG_KPROBES is not set
118CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 135CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -120,6 +137,7 @@ CONFIG_HAVE_IOREMAP_PROT=y
120CONFIG_HAVE_KPROBES=y 137CONFIG_HAVE_KPROBES=y
121CONFIG_HAVE_KRETPROBES=y 138CONFIG_HAVE_KRETPROBES=y
122CONFIG_HAVE_ARCH_TRACEHOOK=y 139CONFIG_HAVE_ARCH_TRACEHOOK=y
140# CONFIG_SLOW_WORK is not set
123# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
124CONFIG_SLABINFO=y 142CONFIG_SLABINFO=y
125CONFIG_RT_MUTEXES=y 143CONFIG_RT_MUTEXES=y
@@ -132,7 +150,6 @@ CONFIG_MODULE_UNLOAD=y
132# CONFIG_MODULE_SRCVERSION_ALL is not set 150# CONFIG_MODULE_SRCVERSION_ALL is not set
133CONFIG_BLOCK=y 151CONFIG_BLOCK=y
134CONFIG_LBD=y 152CONFIG_LBD=y
135# CONFIG_BLK_DEV_IO_TRACE is not set
136# CONFIG_BLK_DEV_BSG is not set 153# CONFIG_BLK_DEV_BSG is not set
137# CONFIG_BLK_DEV_INTEGRITY is not set 154# CONFIG_BLK_DEV_INTEGRITY is not set
138 155
@@ -148,11 +165,6 @@ CONFIG_DEFAULT_AS=y
148# CONFIG_DEFAULT_CFQ is not set 165# CONFIG_DEFAULT_CFQ is not set
149# CONFIG_DEFAULT_NOOP is not set 166# CONFIG_DEFAULT_NOOP is not set
150CONFIG_DEFAULT_IOSCHED="anticipatory" 167CONFIG_DEFAULT_IOSCHED="anticipatory"
151CONFIG_CLASSIC_RCU=y
152# CONFIG_TREE_RCU is not set
153# CONFIG_PREEMPT_RCU is not set
154# CONFIG_TREE_RCU_TRACE is not set
155# CONFIG_PREEMPT_RCU_TRACE is not set
156# CONFIG_FREEZER is not set 168# CONFIG_FREEZER is not set
157CONFIG_PPC4xx_PCI_EXPRESS=y 169CONFIG_PPC4xx_PCI_EXPRESS=y
158 170
@@ -170,7 +182,7 @@ CONFIG_KILAUEA=y
170# CONFIG_MAKALU is not set 182# CONFIG_MAKALU is not set
171# CONFIG_WALNUT is not set 183# CONFIG_WALNUT is not set
172# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set 184# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
173# CONFIG_PPC40x_SIMPLE is not set 185CONFIG_PPC40x_SIMPLE=y
174CONFIG_405EX=y 186CONFIG_405EX=y
175# CONFIG_IPIC is not set 187# CONFIG_IPIC is not set
176# CONFIG_MPIC is not set 188# CONFIG_MPIC is not set
@@ -228,9 +240,12 @@ CONFIG_ZONE_DMA_FLAG=1
228CONFIG_BOUNCE=y 240CONFIG_BOUNCE=y
229CONFIG_VIRT_TO_BUS=y 241CONFIG_VIRT_TO_BUS=y
230CONFIG_UNEVICTABLE_LRU=y 242CONFIG_UNEVICTABLE_LRU=y
243CONFIG_HAVE_MLOCK=y
244CONFIG_HAVE_MLOCKED_PAGE_BIT=y
231CONFIG_PPC_4K_PAGES=y 245CONFIG_PPC_4K_PAGES=y
232# CONFIG_PPC_16K_PAGES is not set 246# CONFIG_PPC_16K_PAGES is not set
233# CONFIG_PPC_64K_PAGES is not set 247# CONFIG_PPC_64K_PAGES is not set
248# CONFIG_PPC_256K_PAGES is not set
234CONFIG_FORCE_MAX_ZONEORDER=11 249CONFIG_FORCE_MAX_ZONEORDER=11
235CONFIG_PROC_DEVICETREE=y 250CONFIG_PROC_DEVICETREE=y
236# CONFIG_CMDLINE_BOOL is not set 251# CONFIG_CMDLINE_BOOL is not set
@@ -252,9 +267,10 @@ CONFIG_PCI_SYSCALL=y
252# CONFIG_PCIEPORTBUS is not set 267# CONFIG_PCIEPORTBUS is not set
253CONFIG_ARCH_SUPPORTS_MSI=y 268CONFIG_ARCH_SUPPORTS_MSI=y
254# CONFIG_PCI_MSI is not set 269# CONFIG_PCI_MSI is not set
255CONFIG_PCI_LEGACY=y 270# CONFIG_PCI_LEGACY is not set
256# CONFIG_PCI_DEBUG is not set 271# CONFIG_PCI_DEBUG is not set
257# CONFIG_PCI_STUB is not set 272# CONFIG_PCI_STUB is not set
273# CONFIG_PCI_IOV is not set
258# CONFIG_PCCARD is not set 274# CONFIG_PCCARD is not set
259# CONFIG_HOTPLUG_PCI is not set 275# CONFIG_HOTPLUG_PCI is not set
260# CONFIG_HAS_RAPIDIO is not set 276# CONFIG_HAS_RAPIDIO is not set
@@ -272,14 +288,12 @@ CONFIG_PAGE_OFFSET=0xc0000000
272CONFIG_KERNEL_START=0xc0000000 288CONFIG_KERNEL_START=0xc0000000
273CONFIG_PHYSICAL_START=0x00000000 289CONFIG_PHYSICAL_START=0x00000000
274CONFIG_TASK_SIZE=0xc0000000 290CONFIG_TASK_SIZE=0xc0000000
275CONFIG_CONSISTENT_START=0xff100000
276CONFIG_CONSISTENT_SIZE=0x00200000 291CONFIG_CONSISTENT_SIZE=0x00200000
277CONFIG_NET=y 292CONFIG_NET=y
278 293
279# 294#
280# Networking options 295# Networking options
281# 296#
282CONFIG_COMPAT_NET_DEV_OPS=y
283CONFIG_PACKET=y 297CONFIG_PACKET=y
284# CONFIG_PACKET_MMAP is not set 298# CONFIG_PACKET_MMAP is not set
285CONFIG_UNIX=y 299CONFIG_UNIX=y
@@ -329,6 +343,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
329# CONFIG_LAPB is not set 343# CONFIG_LAPB is not set
330# CONFIG_ECONET is not set 344# CONFIG_ECONET is not set
331# CONFIG_WAN_ROUTER is not set 345# CONFIG_WAN_ROUTER is not set
346# CONFIG_PHONET is not set
332# CONFIG_NET_SCHED is not set 347# CONFIG_NET_SCHED is not set
333# CONFIG_DCB is not set 348# CONFIG_DCB is not set
334 349
@@ -341,7 +356,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
341# CONFIG_IRDA is not set 356# CONFIG_IRDA is not set
342# CONFIG_BT is not set 357# CONFIG_BT is not set
343# CONFIG_AF_RXRPC is not set 358# CONFIG_AF_RXRPC is not set
344# CONFIG_PHONET is not set
345# CONFIG_WIRELESS is not set 359# CONFIG_WIRELESS is not set
346# CONFIG_WIMAX is not set 360# CONFIG_WIMAX is not set
347# CONFIG_RFKILL is not set 361# CONFIG_RFKILL is not set
@@ -445,7 +459,6 @@ CONFIG_MTD_PHYSMAP_OF=y
445# LPDDR flash memory drivers 459# LPDDR flash memory drivers
446# 460#
447# CONFIG_MTD_LPDDR is not set 461# CONFIG_MTD_LPDDR is not set
448# CONFIG_MTD_QINFO_PROBE is not set
449 462
450# 463#
451# UBI - Unsorted block images 464# UBI - Unsorted block images
@@ -498,6 +511,7 @@ CONFIG_HAVE_IDE=y
498# CONFIG_I2O is not set 511# CONFIG_I2O is not set
499# CONFIG_MACINTOSH_DRIVERS is not set 512# CONFIG_MACINTOSH_DRIVERS is not set
500CONFIG_NETDEVICES=y 513CONFIG_NETDEVICES=y
514CONFIG_COMPAT_NET_DEV_OPS=y
501# CONFIG_DUMMY is not set 515# CONFIG_DUMMY is not set
502# CONFIG_BONDING is not set 516# CONFIG_BONDING is not set
503# CONFIG_MACVLAN is not set 517# CONFIG_MACVLAN is not set
@@ -512,6 +526,8 @@ CONFIG_NET_ETHERNET=y
512# CONFIG_SUNGEM is not set 526# CONFIG_SUNGEM is not set
513# CONFIG_CASSINI is not set 527# CONFIG_CASSINI is not set
514# CONFIG_NET_VENDOR_3COM is not set 528# CONFIG_NET_VENDOR_3COM is not set
529# CONFIG_ETHOC is not set
530# CONFIG_DNET is not set
515# CONFIG_NET_TULIP is not set 531# CONFIG_NET_TULIP is not set
516# CONFIG_HP100 is not set 532# CONFIG_HP100 is not set
517CONFIG_IBM_NEW_EMAC=y 533CONFIG_IBM_NEW_EMAC=y
@@ -540,7 +556,6 @@ CONFIG_IBM_NEW_EMAC_EMAC4=y
540# 556#
541# CONFIG_WLAN_PRE80211 is not set 557# CONFIG_WLAN_PRE80211 is not set
542# CONFIG_WLAN_80211 is not set 558# CONFIG_WLAN_80211 is not set
543# CONFIG_IWLWIFI_LEDS is not set
544 559
545# 560#
546# Enable WiMAX (Networking options) to see the WiMAX drivers 561# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -678,6 +693,7 @@ CONFIG_SSB_POSSIBLE=y
678# CONFIG_EDAC is not set 693# CONFIG_EDAC is not set
679# CONFIG_RTC_CLASS is not set 694# CONFIG_RTC_CLASS is not set
680# CONFIG_DMADEVICES is not set 695# CONFIG_DMADEVICES is not set
696# CONFIG_AUXDISPLAY is not set
681# CONFIG_UIO is not set 697# CONFIG_UIO is not set
682# CONFIG_STAGING is not set 698# CONFIG_STAGING is not set
683 699
@@ -706,6 +722,11 @@ CONFIG_INOTIFY_USER=y
706# CONFIG_FUSE_FS is not set 722# CONFIG_FUSE_FS is not set
707 723
708# 724#
725# Caches
726#
727# CONFIG_FSCACHE is not set
728
729#
709# CD-ROM/DVD Filesystems 730# CD-ROM/DVD Filesystems
710# 731#
711# CONFIG_ISO9660_FS is not set 732# CONFIG_ISO9660_FS is not set
@@ -749,6 +770,7 @@ CONFIG_CRAMFS=y
749# CONFIG_ROMFS_FS is not set 770# CONFIG_ROMFS_FS is not set
750# CONFIG_SYSV_FS is not set 771# CONFIG_SYSV_FS is not set
751# CONFIG_UFS_FS is not set 772# CONFIG_UFS_FS is not set
773# CONFIG_NILFS2_FS is not set
752CONFIG_NETWORK_FILESYSTEMS=y 774CONFIG_NETWORK_FILESYSTEMS=y
753CONFIG_NFS_FS=y 775CONFIG_NFS_FS=y
754CONFIG_NFS_V3=y 776CONFIG_NFS_V3=y
@@ -760,7 +782,6 @@ CONFIG_LOCKD=y
760CONFIG_LOCKD_V4=y 782CONFIG_LOCKD_V4=y
761CONFIG_NFS_COMMON=y 783CONFIG_NFS_COMMON=y
762CONFIG_SUNRPC=y 784CONFIG_SUNRPC=y
763# CONFIG_SUNRPC_REGISTER_V4 is not set
764# CONFIG_RPCSEC_GSS_KRB5 is not set 785# CONFIG_RPCSEC_GSS_KRB5 is not set
765# CONFIG_RPCSEC_GSS_SPKM3 is not set 786# CONFIG_RPCSEC_GSS_SPKM3 is not set
766# CONFIG_SMB_FS is not set 787# CONFIG_SMB_FS is not set
@@ -776,6 +797,7 @@ CONFIG_SUNRPC=y
776CONFIG_MSDOS_PARTITION=y 797CONFIG_MSDOS_PARTITION=y
777# CONFIG_NLS is not set 798# CONFIG_NLS is not set
778# CONFIG_DLM is not set 799# CONFIG_DLM is not set
800# CONFIG_BINARY_PRINTF is not set
779 801
780# 802#
781# Library routines 803# Library routines
@@ -790,11 +812,12 @@ CONFIG_CRC32=y
790# CONFIG_CRC7 is not set 812# CONFIG_CRC7 is not set
791# CONFIG_LIBCRC32C is not set 813# CONFIG_LIBCRC32C is not set
792CONFIG_ZLIB_INFLATE=y 814CONFIG_ZLIB_INFLATE=y
793CONFIG_PLIST=y 815CONFIG_DECOMPRESS_GZIP=y
794CONFIG_HAS_IOMEM=y 816CONFIG_HAS_IOMEM=y
795CONFIG_HAS_IOPORT=y 817CONFIG_HAS_IOPORT=y
796CONFIG_HAS_DMA=y 818CONFIG_HAS_DMA=y
797CONFIG_HAVE_LMB=y 819CONFIG_HAVE_LMB=y
820CONFIG_NLATTR=y
798 821
799# 822#
800# Kernel hacking 823# Kernel hacking
@@ -812,6 +835,9 @@ CONFIG_DEBUG_KERNEL=y
812CONFIG_DETECT_SOFTLOCKUP=y 835CONFIG_DETECT_SOFTLOCKUP=y
813# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 836# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
814CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 837CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
838CONFIG_DETECT_HUNG_TASK=y
839# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
840CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
815CONFIG_SCHED_DEBUG=y 841CONFIG_SCHED_DEBUG=y
816# CONFIG_SCHEDSTATS is not set 842# CONFIG_SCHEDSTATS is not set
817# CONFIG_TIMER_STATS is not set 843# CONFIG_TIMER_STATS is not set
@@ -841,9 +867,12 @@ CONFIG_DEBUG_BUGVERBOSE=y
841# CONFIG_FAULT_INJECTION is not set 867# CONFIG_FAULT_INJECTION is not set
842# CONFIG_LATENCYTOP is not set 868# CONFIG_LATENCYTOP is not set
843CONFIG_SYSCTL_SYSCALL_CHECK=y 869CONFIG_SYSCTL_SYSCALL_CHECK=y
870# CONFIG_DEBUG_PAGEALLOC is not set
844CONFIG_HAVE_FUNCTION_TRACER=y 871CONFIG_HAVE_FUNCTION_TRACER=y
872CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
845CONFIG_HAVE_DYNAMIC_FTRACE=y 873CONFIG_HAVE_DYNAMIC_FTRACE=y
846CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 874CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
875CONFIG_TRACING_SUPPORT=y
847 876
848# 877#
849# Tracers 878# Tracers
@@ -851,17 +880,21 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
851# CONFIG_FUNCTION_TRACER is not set 880# CONFIG_FUNCTION_TRACER is not set
852# CONFIG_SCHED_TRACER is not set 881# CONFIG_SCHED_TRACER is not set
853# CONFIG_CONTEXT_SWITCH_TRACER is not set 882# CONFIG_CONTEXT_SWITCH_TRACER is not set
883# CONFIG_EVENT_TRACER is not set
854# CONFIG_BOOT_TRACER is not set 884# CONFIG_BOOT_TRACER is not set
855# CONFIG_TRACE_BRANCH_PROFILING is not set 885# CONFIG_TRACE_BRANCH_PROFILING is not set
856# CONFIG_STACK_TRACER is not set 886# CONFIG_STACK_TRACER is not set
857# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 887# CONFIG_KMEMTRACE is not set
888# CONFIG_WORKQUEUE_TRACER is not set
889# CONFIG_BLK_DEV_IO_TRACE is not set
890# CONFIG_DYNAMIC_DEBUG is not set
858# CONFIG_SAMPLES is not set 891# CONFIG_SAMPLES is not set
859CONFIG_HAVE_ARCH_KGDB=y 892CONFIG_HAVE_ARCH_KGDB=y
860# CONFIG_KGDB is not set 893# CONFIG_KGDB is not set
861CONFIG_PRINT_STACK_DEPTH=64 894CONFIG_PRINT_STACK_DEPTH=64
862# CONFIG_DEBUG_STACKOVERFLOW is not set 895# CONFIG_DEBUG_STACKOVERFLOW is not set
863# CONFIG_DEBUG_STACK_USAGE is not set 896# CONFIG_DEBUG_STACK_USAGE is not set
864# CONFIG_DEBUG_PAGEALLOC is not set 897# CONFIG_PPC_EMULATED_STATS is not set
865# CONFIG_CODE_PATCHING_SELFTEST is not set 898# CONFIG_CODE_PATCHING_SELFTEST is not set
866# CONFIG_FTR_FIXUP_SELFTEST is not set 899# CONFIG_FTR_FIXUP_SELFTEST is not set
867# CONFIG_MSI_BITMAP_SELFTEST is not set 900# CONFIG_MSI_BITMAP_SELFTEST is not set
@@ -892,10 +925,12 @@ CONFIG_CRYPTO_BLKCIPHER2=y
892CONFIG_CRYPTO_HASH=y 925CONFIG_CRYPTO_HASH=y
893CONFIG_CRYPTO_HASH2=y 926CONFIG_CRYPTO_HASH2=y
894CONFIG_CRYPTO_RNG2=y 927CONFIG_CRYPTO_RNG2=y
928CONFIG_CRYPTO_PCOMP=y
895CONFIG_CRYPTO_MANAGER=y 929CONFIG_CRYPTO_MANAGER=y
896CONFIG_CRYPTO_MANAGER2=y 930CONFIG_CRYPTO_MANAGER2=y
897# CONFIG_CRYPTO_GF128MUL is not set 931# CONFIG_CRYPTO_GF128MUL is not set
898# CONFIG_CRYPTO_NULL is not set 932# CONFIG_CRYPTO_NULL is not set
933CONFIG_CRYPTO_WORKQUEUE=y
899# CONFIG_CRYPTO_CRYPTD is not set 934# CONFIG_CRYPTO_CRYPTD is not set
900# CONFIG_CRYPTO_AUTHENC is not set 935# CONFIG_CRYPTO_AUTHENC is not set
901# CONFIG_CRYPTO_TEST is not set 936# CONFIG_CRYPTO_TEST is not set
@@ -964,6 +999,7 @@ CONFIG_CRYPTO_DES=y
964# Compression 999# Compression
965# 1000#
966# CONFIG_CRYPTO_DEFLATE is not set 1001# CONFIG_CRYPTO_DEFLATE is not set
1002# CONFIG_CRYPTO_ZLIB is not set
967# CONFIG_CRYPTO_LZO is not set 1003# CONFIG_CRYPTO_LZO is not set
968 1004
969# 1005#
@@ -972,5 +1008,6 @@ CONFIG_CRYPTO_DES=y
972# CONFIG_CRYPTO_ANSI_CPRNG is not set 1008# CONFIG_CRYPTO_ANSI_CPRNG is not set
973CONFIG_CRYPTO_HW=y 1009CONFIG_CRYPTO_HW=y
974# CONFIG_CRYPTO_DEV_HIFN_795X is not set 1010# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1011# CONFIG_CRYPTO_DEV_PPC4XX is not set
975# CONFIG_PPC_CLOCK is not set 1012# CONFIG_PPC_CLOCK is not set
976# CONFIG_VIRTUALIZATION is not set 1013# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/40x/makalu_defconfig b/arch/powerpc/configs/40x/makalu_defconfig
index 58bf2ac2e0dd..146747547873 100644
--- a/arch/powerpc/configs/40x/makalu_defconfig
+++ b/arch/powerpc/configs/40x/makalu_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.30-rc7
4# Tue Jan 20 08:17:53 2009 4# Wed Jun 3 09:11:02 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -27,6 +27,7 @@ CONFIG_GENERIC_TIME=y
27CONFIG_GENERIC_TIME_VSYSCALL=y 27CONFIG_GENERIC_TIME_VSYSCALL=y
28CONFIG_GENERIC_CLOCKEVENTS=y 28CONFIG_GENERIC_CLOCKEVENTS=y
29CONFIG_GENERIC_HARDIRQS=y 29CONFIG_GENERIC_HARDIRQS=y
30CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
30# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set 31# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
31CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
32CONFIG_STACKTRACE_SUPPORT=y 33CONFIG_STACKTRACE_SUPPORT=y
@@ -49,10 +50,12 @@ CONFIG_PPC_UDBG_16550=y
49# CONFIG_GENERIC_TBSYNC is not set 50# CONFIG_GENERIC_TBSYNC is not set
50CONFIG_AUDIT_ARCH=y 51CONFIG_AUDIT_ARCH=y
51CONFIG_GENERIC_BUG=y 52CONFIG_GENERIC_BUG=y
53CONFIG_DTC=y
52# CONFIG_DEFAULT_UIMAGE is not set 54# CONFIG_DEFAULT_UIMAGE is not set
53CONFIG_PPC_DCR_NATIVE=y 55CONFIG_PPC_DCR_NATIVE=y
54# CONFIG_PPC_DCR_MMIO is not set 56# CONFIG_PPC_DCR_MMIO is not set
55CONFIG_PPC_DCR=y 57CONFIG_PPC_DCR=y
58CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
56CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 59CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
57 60
58# 61#
@@ -67,9 +70,19 @@ CONFIG_SWAP=y
67CONFIG_SYSVIPC=y 70CONFIG_SYSVIPC=y
68CONFIG_SYSVIPC_SYSCTL=y 71CONFIG_SYSVIPC_SYSCTL=y
69CONFIG_POSIX_MQUEUE=y 72CONFIG_POSIX_MQUEUE=y
73CONFIG_POSIX_MQUEUE_SYSCTL=y
70# CONFIG_BSD_PROCESS_ACCT is not set 74# CONFIG_BSD_PROCESS_ACCT is not set
71# CONFIG_TASKSTATS is not set 75# CONFIG_TASKSTATS is not set
72# 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
73# CONFIG_IKCONFIG is not set 86# CONFIG_IKCONFIG is not set
74CONFIG_LOG_BUF_SHIFT=14 87CONFIG_LOG_BUF_SHIFT=14
75CONFIG_GROUP_SCHED=y 88CONFIG_GROUP_SCHED=y
@@ -84,22 +97,24 @@ CONFIG_SYSFS_DEPRECATED_V2=y
84# CONFIG_NAMESPACES is not set 97# CONFIG_NAMESPACES is not set
85CONFIG_BLK_DEV_INITRD=y 98CONFIG_BLK_DEV_INITRD=y
86CONFIG_INITRAMFS_SOURCE="" 99CONFIG_INITRAMFS_SOURCE=""
100CONFIG_RD_GZIP=y
101# CONFIG_RD_BZIP2 is not set
102# CONFIG_RD_LZMA is not set
87# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 103# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
88CONFIG_SYSCTL=y 104CONFIG_SYSCTL=y
105CONFIG_ANON_INODES=y
89CONFIG_EMBEDDED=y 106CONFIG_EMBEDDED=y
90CONFIG_SYSCTL_SYSCALL=y 107CONFIG_SYSCTL_SYSCALL=y
91CONFIG_KALLSYMS=y 108CONFIG_KALLSYMS=y
92CONFIG_KALLSYMS_ALL=y 109CONFIG_KALLSYMS_ALL=y
93CONFIG_KALLSYMS_STRIP_GENERATED=y
94CONFIG_KALLSYMS_EXTRA_PASS=y 110CONFIG_KALLSYMS_EXTRA_PASS=y
111# CONFIG_STRIP_ASM_SYMS is not set
95CONFIG_HOTPLUG=y 112CONFIG_HOTPLUG=y
96CONFIG_PRINTK=y 113CONFIG_PRINTK=y
97CONFIG_BUG=y 114CONFIG_BUG=y
98CONFIG_ELF_CORE=y 115CONFIG_ELF_CORE=y
99CONFIG_COMPAT_BRK=y
100CONFIG_BASE_FULL=y 116CONFIG_BASE_FULL=y
101CONFIG_FUTEX=y 117CONFIG_FUTEX=y
102CONFIG_ANON_INODES=y
103CONFIG_EPOLL=y 118CONFIG_EPOLL=y
104CONFIG_SIGNALFD=y 119CONFIG_SIGNALFD=y
105CONFIG_TIMERFD=y 120CONFIG_TIMERFD=y
@@ -109,10 +124,12 @@ CONFIG_AIO=y
109CONFIG_VM_EVENT_COUNTERS=y 124CONFIG_VM_EVENT_COUNTERS=y
110CONFIG_PCI_QUIRKS=y 125CONFIG_PCI_QUIRKS=y
111CONFIG_SLUB_DEBUG=y 126CONFIG_SLUB_DEBUG=y
127CONFIG_COMPAT_BRK=y
112# CONFIG_SLAB is not set 128# CONFIG_SLAB is not set
113CONFIG_SLUB=y 129CONFIG_SLUB=y
114# CONFIG_SLOB is not set 130# CONFIG_SLOB is not set
115# CONFIG_PROFILING is not set 131# CONFIG_PROFILING is not set
132# CONFIG_MARKERS is not set
116CONFIG_HAVE_OPROFILE=y 133CONFIG_HAVE_OPROFILE=y
117# CONFIG_KPROBES is not set 134# CONFIG_KPROBES is not set
118CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 135CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -120,6 +137,7 @@ CONFIG_HAVE_IOREMAP_PROT=y
120CONFIG_HAVE_KPROBES=y 137CONFIG_HAVE_KPROBES=y
121CONFIG_HAVE_KRETPROBES=y 138CONFIG_HAVE_KRETPROBES=y
122CONFIG_HAVE_ARCH_TRACEHOOK=y 139CONFIG_HAVE_ARCH_TRACEHOOK=y
140# CONFIG_SLOW_WORK is not set
123# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
124CONFIG_SLABINFO=y 142CONFIG_SLABINFO=y
125CONFIG_RT_MUTEXES=y 143CONFIG_RT_MUTEXES=y
@@ -132,7 +150,6 @@ CONFIG_MODULE_UNLOAD=y
132# CONFIG_MODULE_SRCVERSION_ALL is not set 150# CONFIG_MODULE_SRCVERSION_ALL is not set
133CONFIG_BLOCK=y 151CONFIG_BLOCK=y
134CONFIG_LBD=y 152CONFIG_LBD=y
135# CONFIG_BLK_DEV_IO_TRACE is not set
136# CONFIG_BLK_DEV_BSG is not set 153# CONFIG_BLK_DEV_BSG is not set
137# CONFIG_BLK_DEV_INTEGRITY is not set 154# CONFIG_BLK_DEV_INTEGRITY is not set
138 155
@@ -148,11 +165,6 @@ CONFIG_DEFAULT_AS=y
148# CONFIG_DEFAULT_CFQ is not set 165# CONFIG_DEFAULT_CFQ is not set
149# CONFIG_DEFAULT_NOOP is not set 166# CONFIG_DEFAULT_NOOP is not set
150CONFIG_DEFAULT_IOSCHED="anticipatory" 167CONFIG_DEFAULT_IOSCHED="anticipatory"
151CONFIG_CLASSIC_RCU=y
152# CONFIG_TREE_RCU is not set
153# CONFIG_PREEMPT_RCU is not set
154# CONFIG_TREE_RCU_TRACE is not set
155# CONFIG_PREEMPT_RCU_TRACE is not set
156# CONFIG_FREEZER is not set 168# CONFIG_FREEZER is not set
157CONFIG_PPC4xx_PCI_EXPRESS=y 169CONFIG_PPC4xx_PCI_EXPRESS=y
158 170
@@ -170,7 +182,7 @@ CONFIG_PPC4xx_PCI_EXPRESS=y
170CONFIG_MAKALU=y 182CONFIG_MAKALU=y
171# CONFIG_WALNUT is not set 183# CONFIG_WALNUT is not set
172# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set 184# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
173# CONFIG_PPC40x_SIMPLE is not set 185CONFIG_PPC40x_SIMPLE=y
174CONFIG_405EX=y 186CONFIG_405EX=y
175# CONFIG_IPIC is not set 187# CONFIG_IPIC is not set
176# CONFIG_MPIC is not set 188# CONFIG_MPIC is not set
@@ -228,9 +240,12 @@ CONFIG_ZONE_DMA_FLAG=1
228CONFIG_BOUNCE=y 240CONFIG_BOUNCE=y
229CONFIG_VIRT_TO_BUS=y 241CONFIG_VIRT_TO_BUS=y
230CONFIG_UNEVICTABLE_LRU=y 242CONFIG_UNEVICTABLE_LRU=y
243CONFIG_HAVE_MLOCK=y
244CONFIG_HAVE_MLOCKED_PAGE_BIT=y
231CONFIG_PPC_4K_PAGES=y 245CONFIG_PPC_4K_PAGES=y
232# CONFIG_PPC_16K_PAGES is not set 246# CONFIG_PPC_16K_PAGES is not set
233# CONFIG_PPC_64K_PAGES is not set 247# CONFIG_PPC_64K_PAGES is not set
248# CONFIG_PPC_256K_PAGES is not set
234CONFIG_FORCE_MAX_ZONEORDER=11 249CONFIG_FORCE_MAX_ZONEORDER=11
235CONFIG_PROC_DEVICETREE=y 250CONFIG_PROC_DEVICETREE=y
236# CONFIG_CMDLINE_BOOL is not set 251# CONFIG_CMDLINE_BOOL is not set
@@ -252,9 +267,10 @@ CONFIG_PCI_SYSCALL=y
252# CONFIG_PCIEPORTBUS is not set 267# CONFIG_PCIEPORTBUS is not set
253CONFIG_ARCH_SUPPORTS_MSI=y 268CONFIG_ARCH_SUPPORTS_MSI=y
254# CONFIG_PCI_MSI is not set 269# CONFIG_PCI_MSI is not set
255CONFIG_PCI_LEGACY=y 270# CONFIG_PCI_LEGACY is not set
256# CONFIG_PCI_DEBUG is not set 271# CONFIG_PCI_DEBUG is not set
257# CONFIG_PCI_STUB is not set 272# CONFIG_PCI_STUB is not set
273# CONFIG_PCI_IOV is not set
258# CONFIG_PCCARD is not set 274# CONFIG_PCCARD is not set
259# CONFIG_HOTPLUG_PCI is not set 275# CONFIG_HOTPLUG_PCI is not set
260# CONFIG_HAS_RAPIDIO is not set 276# CONFIG_HAS_RAPIDIO is not set
@@ -272,14 +288,12 @@ CONFIG_PAGE_OFFSET=0xc0000000
272CONFIG_KERNEL_START=0xc0000000 288CONFIG_KERNEL_START=0xc0000000
273CONFIG_PHYSICAL_START=0x00000000 289CONFIG_PHYSICAL_START=0x00000000
274CONFIG_TASK_SIZE=0xc0000000 290CONFIG_TASK_SIZE=0xc0000000
275CONFIG_CONSISTENT_START=0xff100000
276CONFIG_CONSISTENT_SIZE=0x00200000 291CONFIG_CONSISTENT_SIZE=0x00200000
277CONFIG_NET=y 292CONFIG_NET=y
278 293
279# 294#
280# Networking options 295# Networking options
281# 296#
282CONFIG_COMPAT_NET_DEV_OPS=y
283CONFIG_PACKET=y 297CONFIG_PACKET=y
284# CONFIG_PACKET_MMAP is not set 298# CONFIG_PACKET_MMAP is not set
285CONFIG_UNIX=y 299CONFIG_UNIX=y
@@ -329,6 +343,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
329# CONFIG_LAPB is not set 343# CONFIG_LAPB is not set
330# CONFIG_ECONET is not set 344# CONFIG_ECONET is not set
331# CONFIG_WAN_ROUTER is not set 345# CONFIG_WAN_ROUTER is not set
346# CONFIG_PHONET is not set
332# CONFIG_NET_SCHED is not set 347# CONFIG_NET_SCHED is not set
333# CONFIG_DCB is not set 348# CONFIG_DCB is not set
334 349
@@ -341,7 +356,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
341# CONFIG_IRDA is not set 356# CONFIG_IRDA is not set
342# CONFIG_BT is not set 357# CONFIG_BT is not set
343# CONFIG_AF_RXRPC is not set 358# CONFIG_AF_RXRPC is not set
344# CONFIG_PHONET is not set
345# CONFIG_WIRELESS is not set 359# CONFIG_WIRELESS is not set
346# CONFIG_WIMAX is not set 360# CONFIG_WIMAX is not set
347# CONFIG_RFKILL is not set 361# CONFIG_RFKILL is not set
@@ -445,7 +459,6 @@ CONFIG_MTD_PHYSMAP_OF=y
445# LPDDR flash memory drivers 459# LPDDR flash memory drivers
446# 460#
447# CONFIG_MTD_LPDDR is not set 461# CONFIG_MTD_LPDDR is not set
448# CONFIG_MTD_QINFO_PROBE is not set
449 462
450# 463#
451# UBI - Unsorted block images 464# UBI - Unsorted block images
@@ -498,6 +511,7 @@ CONFIG_HAVE_IDE=y
498# CONFIG_I2O is not set 511# CONFIG_I2O is not set
499# CONFIG_MACINTOSH_DRIVERS is not set 512# CONFIG_MACINTOSH_DRIVERS is not set
500CONFIG_NETDEVICES=y 513CONFIG_NETDEVICES=y
514CONFIG_COMPAT_NET_DEV_OPS=y
501# CONFIG_DUMMY is not set 515# CONFIG_DUMMY is not set
502# CONFIG_BONDING is not set 516# CONFIG_BONDING is not set
503# CONFIG_MACVLAN is not set 517# CONFIG_MACVLAN is not set
@@ -512,6 +526,8 @@ CONFIG_NET_ETHERNET=y
512# CONFIG_SUNGEM is not set 526# CONFIG_SUNGEM is not set
513# CONFIG_CASSINI is not set 527# CONFIG_CASSINI is not set
514# CONFIG_NET_VENDOR_3COM is not set 528# CONFIG_NET_VENDOR_3COM is not set
529# CONFIG_ETHOC is not set
530# CONFIG_DNET is not set
515# CONFIG_NET_TULIP is not set 531# CONFIG_NET_TULIP is not set
516# CONFIG_HP100 is not set 532# CONFIG_HP100 is not set
517CONFIG_IBM_NEW_EMAC=y 533CONFIG_IBM_NEW_EMAC=y
@@ -540,7 +556,6 @@ CONFIG_IBM_NEW_EMAC_EMAC4=y
540# 556#
541# CONFIG_WLAN_PRE80211 is not set 557# CONFIG_WLAN_PRE80211 is not set
542# CONFIG_WLAN_80211 is not set 558# CONFIG_WLAN_80211 is not set
543# CONFIG_IWLWIFI_LEDS is not set
544 559
545# 560#
546# Enable WiMAX (Networking options) to see the WiMAX drivers 561# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -678,6 +693,7 @@ CONFIG_SSB_POSSIBLE=y
678# CONFIG_EDAC is not set 693# CONFIG_EDAC is not set
679# CONFIG_RTC_CLASS is not set 694# CONFIG_RTC_CLASS is not set
680# CONFIG_DMADEVICES is not set 695# CONFIG_DMADEVICES is not set
696# CONFIG_AUXDISPLAY is not set
681# CONFIG_UIO is not set 697# CONFIG_UIO is not set
682# CONFIG_STAGING is not set 698# CONFIG_STAGING is not set
683 699
@@ -706,6 +722,11 @@ CONFIG_INOTIFY_USER=y
706# CONFIG_FUSE_FS is not set 722# CONFIG_FUSE_FS is not set
707 723
708# 724#
725# Caches
726#
727# CONFIG_FSCACHE is not set
728
729#
709# CD-ROM/DVD Filesystems 730# CD-ROM/DVD Filesystems
710# 731#
711# CONFIG_ISO9660_FS is not set 732# CONFIG_ISO9660_FS is not set
@@ -749,6 +770,7 @@ CONFIG_CRAMFS=y
749# CONFIG_ROMFS_FS is not set 770# CONFIG_ROMFS_FS is not set
750# CONFIG_SYSV_FS is not set 771# CONFIG_SYSV_FS is not set
751# CONFIG_UFS_FS is not set 772# CONFIG_UFS_FS is not set
773# CONFIG_NILFS2_FS is not set
752CONFIG_NETWORK_FILESYSTEMS=y 774CONFIG_NETWORK_FILESYSTEMS=y
753CONFIG_NFS_FS=y 775CONFIG_NFS_FS=y
754CONFIG_NFS_V3=y 776CONFIG_NFS_V3=y
@@ -760,7 +782,6 @@ CONFIG_LOCKD=y
760CONFIG_LOCKD_V4=y 782CONFIG_LOCKD_V4=y
761CONFIG_NFS_COMMON=y 783CONFIG_NFS_COMMON=y
762CONFIG_SUNRPC=y 784CONFIG_SUNRPC=y
763# CONFIG_SUNRPC_REGISTER_V4 is not set
764# CONFIG_RPCSEC_GSS_KRB5 is not set 785# CONFIG_RPCSEC_GSS_KRB5 is not set
765# CONFIG_RPCSEC_GSS_SPKM3 is not set 786# CONFIG_RPCSEC_GSS_SPKM3 is not set
766# CONFIG_SMB_FS is not set 787# CONFIG_SMB_FS is not set
@@ -776,6 +797,7 @@ CONFIG_SUNRPC=y
776CONFIG_MSDOS_PARTITION=y 797CONFIG_MSDOS_PARTITION=y
777# CONFIG_NLS is not set 798# CONFIG_NLS is not set
778# CONFIG_DLM is not set 799# CONFIG_DLM is not set
800# CONFIG_BINARY_PRINTF is not set
779 801
780# 802#
781# Library routines 803# Library routines
@@ -790,11 +812,12 @@ CONFIG_CRC32=y
790# CONFIG_CRC7 is not set 812# CONFIG_CRC7 is not set
791# CONFIG_LIBCRC32C is not set 813# CONFIG_LIBCRC32C is not set
792CONFIG_ZLIB_INFLATE=y 814CONFIG_ZLIB_INFLATE=y
793CONFIG_PLIST=y 815CONFIG_DECOMPRESS_GZIP=y
794CONFIG_HAS_IOMEM=y 816CONFIG_HAS_IOMEM=y
795CONFIG_HAS_IOPORT=y 817CONFIG_HAS_IOPORT=y
796CONFIG_HAS_DMA=y 818CONFIG_HAS_DMA=y
797CONFIG_HAVE_LMB=y 819CONFIG_HAVE_LMB=y
820CONFIG_NLATTR=y
798 821
799# 822#
800# Kernel hacking 823# Kernel hacking
@@ -812,6 +835,9 @@ CONFIG_DEBUG_KERNEL=y
812CONFIG_DETECT_SOFTLOCKUP=y 835CONFIG_DETECT_SOFTLOCKUP=y
813# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 836# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
814CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 837CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
838CONFIG_DETECT_HUNG_TASK=y
839# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
840CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
815CONFIG_SCHED_DEBUG=y 841CONFIG_SCHED_DEBUG=y
816# CONFIG_SCHEDSTATS is not set 842# CONFIG_SCHEDSTATS is not set
817# CONFIG_TIMER_STATS is not set 843# CONFIG_TIMER_STATS is not set
@@ -841,9 +867,12 @@ CONFIG_DEBUG_BUGVERBOSE=y
841# CONFIG_FAULT_INJECTION is not set 867# CONFIG_FAULT_INJECTION is not set
842# CONFIG_LATENCYTOP is not set 868# CONFIG_LATENCYTOP is not set
843CONFIG_SYSCTL_SYSCALL_CHECK=y 869CONFIG_SYSCTL_SYSCALL_CHECK=y
870# CONFIG_DEBUG_PAGEALLOC is not set
844CONFIG_HAVE_FUNCTION_TRACER=y 871CONFIG_HAVE_FUNCTION_TRACER=y
872CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
845CONFIG_HAVE_DYNAMIC_FTRACE=y 873CONFIG_HAVE_DYNAMIC_FTRACE=y
846CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 874CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
875CONFIG_TRACING_SUPPORT=y
847 876
848# 877#
849# Tracers 878# Tracers
@@ -851,17 +880,21 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
851# CONFIG_FUNCTION_TRACER is not set 880# CONFIG_FUNCTION_TRACER is not set
852# CONFIG_SCHED_TRACER is not set 881# CONFIG_SCHED_TRACER is not set
853# CONFIG_CONTEXT_SWITCH_TRACER is not set 882# CONFIG_CONTEXT_SWITCH_TRACER is not set
883# CONFIG_EVENT_TRACER is not set
854# CONFIG_BOOT_TRACER is not set 884# CONFIG_BOOT_TRACER is not set
855# CONFIG_TRACE_BRANCH_PROFILING is not set 885# CONFIG_TRACE_BRANCH_PROFILING is not set
856# CONFIG_STACK_TRACER is not set 886# CONFIG_STACK_TRACER is not set
857# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 887# CONFIG_KMEMTRACE is not set
888# CONFIG_WORKQUEUE_TRACER is not set
889# CONFIG_BLK_DEV_IO_TRACE is not set
890# CONFIG_DYNAMIC_DEBUG is not set
858# CONFIG_SAMPLES is not set 891# CONFIG_SAMPLES is not set
859CONFIG_HAVE_ARCH_KGDB=y 892CONFIG_HAVE_ARCH_KGDB=y
860# CONFIG_KGDB is not set 893# CONFIG_KGDB is not set
861CONFIG_PRINT_STACK_DEPTH=64 894CONFIG_PRINT_STACK_DEPTH=64
862# CONFIG_DEBUG_STACKOVERFLOW is not set 895# CONFIG_DEBUG_STACKOVERFLOW is not set
863# CONFIG_DEBUG_STACK_USAGE is not set 896# CONFIG_DEBUG_STACK_USAGE is not set
864# CONFIG_DEBUG_PAGEALLOC is not set 897# CONFIG_PPC_EMULATED_STATS is not set
865# CONFIG_CODE_PATCHING_SELFTEST is not set 898# CONFIG_CODE_PATCHING_SELFTEST is not set
866# CONFIG_FTR_FIXUP_SELFTEST is not set 899# CONFIG_FTR_FIXUP_SELFTEST is not set
867# CONFIG_MSI_BITMAP_SELFTEST is not set 900# CONFIG_MSI_BITMAP_SELFTEST is not set
@@ -892,10 +925,12 @@ CONFIG_CRYPTO_BLKCIPHER2=y
892CONFIG_CRYPTO_HASH=y 925CONFIG_CRYPTO_HASH=y
893CONFIG_CRYPTO_HASH2=y 926CONFIG_CRYPTO_HASH2=y
894CONFIG_CRYPTO_RNG2=y 927CONFIG_CRYPTO_RNG2=y
928CONFIG_CRYPTO_PCOMP=y
895CONFIG_CRYPTO_MANAGER=y 929CONFIG_CRYPTO_MANAGER=y
896CONFIG_CRYPTO_MANAGER2=y 930CONFIG_CRYPTO_MANAGER2=y
897# CONFIG_CRYPTO_GF128MUL is not set 931# CONFIG_CRYPTO_GF128MUL is not set
898# CONFIG_CRYPTO_NULL is not set 932# CONFIG_CRYPTO_NULL is not set
933CONFIG_CRYPTO_WORKQUEUE=y
899# CONFIG_CRYPTO_CRYPTD is not set 934# CONFIG_CRYPTO_CRYPTD is not set
900# CONFIG_CRYPTO_AUTHENC is not set 935# CONFIG_CRYPTO_AUTHENC is not set
901# CONFIG_CRYPTO_TEST is not set 936# CONFIG_CRYPTO_TEST is not set
@@ -964,6 +999,7 @@ CONFIG_CRYPTO_DES=y
964# Compression 999# Compression
965# 1000#
966# CONFIG_CRYPTO_DEFLATE is not set 1001# CONFIG_CRYPTO_DEFLATE is not set
1002# CONFIG_CRYPTO_ZLIB is not set
967# CONFIG_CRYPTO_LZO is not set 1003# CONFIG_CRYPTO_LZO is not set
968 1004
969# 1005#
@@ -972,5 +1008,6 @@ CONFIG_CRYPTO_DES=y
972# CONFIG_CRYPTO_ANSI_CPRNG is not set 1008# CONFIG_CRYPTO_ANSI_CPRNG is not set
973CONFIG_CRYPTO_HW=y 1009CONFIG_CRYPTO_HW=y
974# CONFIG_CRYPTO_DEV_HIFN_795X is not set 1010# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1011# CONFIG_CRYPTO_DEV_PPC4XX is not set
975# CONFIG_PPC_CLOCK is not set 1012# CONFIG_PPC_CLOCK is not set
976# CONFIG_VIRTUALIZATION is not set 1013# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/40x/virtex_defconfig b/arch/powerpc/configs/40x/virtex_defconfig
index f5698f962e58..416e79ac0711 100644
--- a/arch/powerpc/configs/40x/virtex_defconfig
+++ b/arch/powerpc/configs/40x/virtex_defconfig
@@ -258,7 +258,7 @@ CONFIG_PCI_SYSCALL=y
258# CONFIG_PCIEPORTBUS is not set 258# CONFIG_PCIEPORTBUS is not set
259CONFIG_ARCH_SUPPORTS_MSI=y 259CONFIG_ARCH_SUPPORTS_MSI=y
260# CONFIG_PCI_MSI is not set 260# CONFIG_PCI_MSI is not set
261CONFIG_PCI_LEGACY=y 261# CONFIG_PCI_LEGACY is not set
262# CONFIG_PCI_DEBUG is not set 262# CONFIG_PCI_DEBUG is not set
263# CONFIG_PCI_STUB is not set 263# CONFIG_PCI_STUB is not set
264# CONFIG_PCCARD is not set 264# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/44x/arches_defconfig b/arch/powerpc/configs/44x/arches_defconfig
index 1d72b0ac3f25..f7fd32c09424 100644
--- a/arch/powerpc/configs/44x/arches_defconfig
+++ b/arch/powerpc/configs/44x/arches_defconfig
@@ -258,7 +258,7 @@ CONFIG_PCI_SYSCALL=y
258# CONFIG_PCIEPORTBUS is not set 258# CONFIG_PCIEPORTBUS is not set
259CONFIG_ARCH_SUPPORTS_MSI=y 259CONFIG_ARCH_SUPPORTS_MSI=y
260# CONFIG_PCI_MSI is not set 260# CONFIG_PCI_MSI is not set
261CONFIG_PCI_LEGACY=y 261# CONFIG_PCI_LEGACY is not set
262# CONFIG_PCI_DEBUG is not set 262# CONFIG_PCI_DEBUG is not set
263# CONFIG_PCI_STUB is not set 263# CONFIG_PCI_STUB is not set
264# CONFIG_PCCARD is not set 264# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/44x/bamboo_defconfig b/arch/powerpc/configs/44x/bamboo_defconfig
index 959bdc43a491..e57f1e4c1795 100644
--- a/arch/powerpc/configs/44x/bamboo_defconfig
+++ b/arch/powerpc/configs/44x/bamboo_defconfig
@@ -262,7 +262,7 @@ CONFIG_PCI_SYSCALL=y
262# CONFIG_PCIEPORTBUS is not set 262# CONFIG_PCIEPORTBUS is not set
263CONFIG_ARCH_SUPPORTS_MSI=y 263CONFIG_ARCH_SUPPORTS_MSI=y
264# CONFIG_PCI_MSI is not set 264# CONFIG_PCI_MSI is not set
265CONFIG_PCI_LEGACY=y 265# CONFIG_PCI_LEGACY is not set
266# CONFIG_PCI_DEBUG is not set 266# CONFIG_PCI_DEBUG is not set
267# CONFIG_PCI_STUB is not set 267# CONFIG_PCI_STUB is not set
268# CONFIG_PCCARD is not set 268# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/44x/canyonlands_defconfig b/arch/powerpc/configs/44x/canyonlands_defconfig
index f9a08ee49b96..5e85412eb9fa 100644
--- a/arch/powerpc/configs/44x/canyonlands_defconfig
+++ b/arch/powerpc/configs/44x/canyonlands_defconfig
@@ -262,7 +262,7 @@ CONFIG_PCI_SYSCALL=y
262# CONFIG_PCIEPORTBUS is not set 262# CONFIG_PCIEPORTBUS is not set
263CONFIG_ARCH_SUPPORTS_MSI=y 263CONFIG_ARCH_SUPPORTS_MSI=y
264# CONFIG_PCI_MSI is not set 264# CONFIG_PCI_MSI is not set
265CONFIG_PCI_LEGACY=y 265# CONFIG_PCI_LEGACY is not set
266# CONFIG_PCI_DEBUG is not set 266# CONFIG_PCI_DEBUG is not set
267# CONFIG_PCI_STUB is not set 267# CONFIG_PCI_STUB is not set
268# CONFIG_PCCARD is not set 268# CONFIG_PCCARD is not set
@@ -716,7 +716,7 @@ CONFIG_SSB_POSSIBLE=y
716# 716#
717# Multimedia drivers 717# Multimedia drivers
718# 718#
719CONFIG_DAB=y 719# CONFIG_DAB is not set
720# CONFIG_USB_DABUSB is not set 720# CONFIG_USB_DABUSB is not set
721 721
722# 722#
@@ -725,7 +725,7 @@ CONFIG_DAB=y
725# CONFIG_AGP is not set 725# CONFIG_AGP is not set
726# CONFIG_DRM is not set 726# CONFIG_DRM is not set
727# CONFIG_VGASTATE is not set 727# CONFIG_VGASTATE is not set
728CONFIG_VIDEO_OUTPUT_CONTROL=m 728# CONFIG_VIDEO_OUTPUT_CONTROL is not set
729# CONFIG_FB is not set 729# CONFIG_FB is not set
730# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 730# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
731 731
diff --git a/arch/powerpc/configs/44x/ebony_defconfig b/arch/powerpc/configs/44x/ebony_defconfig
index be64aa644d15..b652f7dcab5a 100644
--- a/arch/powerpc/configs/44x/ebony_defconfig
+++ b/arch/powerpc/configs/44x/ebony_defconfig
@@ -261,7 +261,7 @@ CONFIG_PCI_SYSCALL=y
261# CONFIG_PCIEPORTBUS is not set 261# CONFIG_PCIEPORTBUS is not set
262CONFIG_ARCH_SUPPORTS_MSI=y 262CONFIG_ARCH_SUPPORTS_MSI=y
263# CONFIG_PCI_MSI is not set 263# CONFIG_PCI_MSI is not set
264CONFIG_PCI_LEGACY=y 264# CONFIG_PCI_LEGACY is not set
265# CONFIG_PCI_DEBUG is not set 265# CONFIG_PCI_DEBUG is not set
266# CONFIG_PCI_STUB is not set 266# CONFIG_PCI_STUB is not set
267# CONFIG_PCCARD is not set 267# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/44x/katmai_defconfig b/arch/powerpc/configs/44x/katmai_defconfig
index f67250b24ec5..c23a4ef13e45 100644
--- a/arch/powerpc/configs/44x/katmai_defconfig
+++ b/arch/powerpc/configs/44x/katmai_defconfig
@@ -256,7 +256,7 @@ CONFIG_PCI_SYSCALL=y
256# CONFIG_PCIEPORTBUS is not set 256# CONFIG_PCIEPORTBUS is not set
257CONFIG_ARCH_SUPPORTS_MSI=y 257CONFIG_ARCH_SUPPORTS_MSI=y
258# CONFIG_PCI_MSI is not set 258# CONFIG_PCI_MSI is not set
259CONFIG_PCI_LEGACY=y 259# CONFIG_PCI_LEGACY is not set
260# CONFIG_PCI_DEBUG is not set 260# CONFIG_PCI_DEBUG is not set
261# CONFIG_PCI_STUB is not set 261# CONFIG_PCI_STUB is not set
262# CONFIG_PCCARD is not set 262# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/44x/rainier_defconfig b/arch/powerpc/configs/44x/rainier_defconfig
index 9348c12bd7a6..b25fad1343dc 100644
--- a/arch/powerpc/configs/44x/rainier_defconfig
+++ b/arch/powerpc/configs/44x/rainier_defconfig
@@ -260,7 +260,7 @@ CONFIG_PCI_SYSCALL=y
260# CONFIG_PCIEPORTBUS is not set 260# CONFIG_PCIEPORTBUS is not set
261CONFIG_ARCH_SUPPORTS_MSI=y 261CONFIG_ARCH_SUPPORTS_MSI=y
262# CONFIG_PCI_MSI is not set 262# CONFIG_PCI_MSI is not set
263CONFIG_PCI_LEGACY=y 263# CONFIG_PCI_LEGACY is not set
264# CONFIG_PCI_DEBUG is not set 264# CONFIG_PCI_DEBUG is not set
265# CONFIG_PCI_STUB is not set 265# CONFIG_PCI_STUB is not set
266# CONFIG_PCCARD is not set 266# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/44x/redwood_defconfig b/arch/powerpc/configs/44x/redwood_defconfig
index e665433762ba..ed31d4f17b5a 100644
--- a/arch/powerpc/configs/44x/redwood_defconfig
+++ b/arch/powerpc/configs/44x/redwood_defconfig
@@ -265,7 +265,7 @@ CONFIG_PCIEAER=y
265# CONFIG_PCIEASPM is not set 265# CONFIG_PCIEASPM is not set
266CONFIG_ARCH_SUPPORTS_MSI=y 266CONFIG_ARCH_SUPPORTS_MSI=y
267# CONFIG_PCI_MSI is not set 267# CONFIG_PCI_MSI is not set
268CONFIG_PCI_LEGACY=y 268# CONFIG_PCI_LEGACY is not set
269# CONFIG_PCI_DEBUG is not set 269# CONFIG_PCI_DEBUG is not set
270# CONFIG_PCI_STUB is not set 270# CONFIG_PCI_STUB is not set
271# CONFIG_PCCARD is not set 271# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/44x/sam440ep_defconfig b/arch/powerpc/configs/44x/sam440ep_defconfig
index 70d5c3fa3283..e14e89a5e06b 100644
--- a/arch/powerpc/configs/44x/sam440ep_defconfig
+++ b/arch/powerpc/configs/44x/sam440ep_defconfig
@@ -262,7 +262,7 @@ CONFIG_PCI_SYSCALL=y
262# CONFIG_PCIEPORTBUS is not set 262# CONFIG_PCIEPORTBUS is not set
263CONFIG_ARCH_SUPPORTS_MSI=y 263CONFIG_ARCH_SUPPORTS_MSI=y
264# CONFIG_PCI_MSI is not set 264# CONFIG_PCI_MSI is not set
265CONFIG_PCI_LEGACY=y 265# CONFIG_PCI_LEGACY is not set
266# CONFIG_PCI_STUB is not set 266# CONFIG_PCI_STUB is not set
267# CONFIG_PCCARD is not set 267# CONFIG_PCCARD is not set
268# CONFIG_HOTPLUG_PCI is not set 268# CONFIG_HOTPLUG_PCI is not set
diff --git a/arch/powerpc/configs/44x/sequoia_defconfig b/arch/powerpc/configs/44x/sequoia_defconfig
index a921fe3c3711..6400aae04dda 100644
--- a/arch/powerpc/configs/44x/sequoia_defconfig
+++ b/arch/powerpc/configs/44x/sequoia_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
4# Tue Jan 20 08:22:45 2009 4# Tue Apr 7 17:04:52 2009
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -57,6 +57,7 @@ CONFIG_GENERIC_BUG=y
57CONFIG_PPC_DCR_NATIVE=y 57CONFIG_PPC_DCR_NATIVE=y
58# CONFIG_PPC_DCR_MMIO is not set 58# CONFIG_PPC_DCR_MMIO is not set
59CONFIG_PPC_DCR=y 59CONFIG_PPC_DCR=y
60CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
60CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 61CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
61 62
62# 63#
@@ -74,6 +75,15 @@ CONFIG_POSIX_MQUEUE=y
74# CONFIG_BSD_PROCESS_ACCT is not set 75# CONFIG_BSD_PROCESS_ACCT is not set
75# CONFIG_TASKSTATS is not set 76# CONFIG_TASKSTATS is not set
76# CONFIG_AUDIT is not set 77# CONFIG_AUDIT is not set
78
79#
80# RCU Subsystem
81#
82CONFIG_CLASSIC_RCU=y
83# CONFIG_TREE_RCU is not set
84# CONFIG_PREEMPT_RCU is not set
85# CONFIG_TREE_RCU_TRACE is not set
86# CONFIG_PREEMPT_RCU_TRACE is not set
77# CONFIG_IKCONFIG is not set 87# CONFIG_IKCONFIG is not set
78CONFIG_LOG_BUF_SHIFT=14 88CONFIG_LOG_BUF_SHIFT=14
79CONFIG_GROUP_SCHED=y 89CONFIG_GROUP_SCHED=y
@@ -88,8 +98,12 @@ CONFIG_SYSFS_DEPRECATED_V2=y
88# CONFIG_NAMESPACES is not set 98# CONFIG_NAMESPACES is not set
89CONFIG_BLK_DEV_INITRD=y 99CONFIG_BLK_DEV_INITRD=y
90CONFIG_INITRAMFS_SOURCE="" 100CONFIG_INITRAMFS_SOURCE=""
101CONFIG_RD_GZIP=y
102# CONFIG_RD_BZIP2 is not set
103# CONFIG_RD_LZMA is not set
91# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 104# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
92CONFIG_SYSCTL=y 105CONFIG_SYSCTL=y
106CONFIG_ANON_INODES=y
93CONFIG_EMBEDDED=y 107CONFIG_EMBEDDED=y
94CONFIG_SYSCTL_SYSCALL=y 108CONFIG_SYSCTL_SYSCALL=y
95CONFIG_KALLSYMS=y 109CONFIG_KALLSYMS=y
@@ -99,10 +113,8 @@ CONFIG_HOTPLUG=y
99CONFIG_PRINTK=y 113CONFIG_PRINTK=y
100CONFIG_BUG=y 114CONFIG_BUG=y
101CONFIG_ELF_CORE=y 115CONFIG_ELF_CORE=y
102CONFIG_COMPAT_BRK=y
103CONFIG_BASE_FULL=y 116CONFIG_BASE_FULL=y
104CONFIG_FUTEX=y 117CONFIG_FUTEX=y
105CONFIG_ANON_INODES=y
106CONFIG_EPOLL=y 118CONFIG_EPOLL=y
107CONFIG_SIGNALFD=y 119CONFIG_SIGNALFD=y
108CONFIG_TIMERFD=y 120CONFIG_TIMERFD=y
@@ -112,10 +124,12 @@ CONFIG_AIO=y
112CONFIG_VM_EVENT_COUNTERS=y 124CONFIG_VM_EVENT_COUNTERS=y
113CONFIG_PCI_QUIRKS=y 125CONFIG_PCI_QUIRKS=y
114CONFIG_SLUB_DEBUG=y 126CONFIG_SLUB_DEBUG=y
127CONFIG_COMPAT_BRK=y
115# CONFIG_SLAB is not set 128# CONFIG_SLAB is not set
116CONFIG_SLUB=y 129CONFIG_SLUB=y
117# CONFIG_SLOB is not set 130# CONFIG_SLOB is not set
118# CONFIG_PROFILING is not set 131# CONFIG_PROFILING is not set
132# CONFIG_MARKERS is not set
119CONFIG_HAVE_OPROFILE=y 133CONFIG_HAVE_OPROFILE=y
120# CONFIG_KPROBES is not set 134# CONFIG_KPROBES is not set
121CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y 135CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
@@ -123,6 +137,7 @@ CONFIG_HAVE_IOREMAP_PROT=y
123CONFIG_HAVE_KPROBES=y 137CONFIG_HAVE_KPROBES=y
124CONFIG_HAVE_KRETPROBES=y 138CONFIG_HAVE_KRETPROBES=y
125CONFIG_HAVE_ARCH_TRACEHOOK=y 139CONFIG_HAVE_ARCH_TRACEHOOK=y
140# CONFIG_SLOW_WORK is not set
126# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 141# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
127CONFIG_SLABINFO=y 142CONFIG_SLABINFO=y
128CONFIG_RT_MUTEXES=y 143CONFIG_RT_MUTEXES=y
@@ -135,7 +150,6 @@ CONFIG_MODULE_UNLOAD=y
135# CONFIG_MODULE_SRCVERSION_ALL is not set 150# CONFIG_MODULE_SRCVERSION_ALL is not set
136CONFIG_BLOCK=y 151CONFIG_BLOCK=y
137CONFIG_LBD=y 152CONFIG_LBD=y
138# CONFIG_BLK_DEV_IO_TRACE is not set
139# CONFIG_BLK_DEV_BSG is not set 153# CONFIG_BLK_DEV_BSG is not set
140# CONFIG_BLK_DEV_INTEGRITY is not set 154# CONFIG_BLK_DEV_INTEGRITY is not set
141 155
@@ -151,11 +165,6 @@ CONFIG_DEFAULT_AS=y
151# CONFIG_DEFAULT_CFQ is not set 165# CONFIG_DEFAULT_CFQ is not set
152# CONFIG_DEFAULT_NOOP is not set 166# CONFIG_DEFAULT_NOOP is not set
153CONFIG_DEFAULT_IOSCHED="anticipatory" 167CONFIG_DEFAULT_IOSCHED="anticipatory"
154CONFIG_CLASSIC_RCU=y
155# CONFIG_TREE_RCU is not set
156# CONFIG_PREEMPT_RCU is not set
157# CONFIG_TREE_RCU_TRACE is not set
158# CONFIG_PREEMPT_RCU_TRACE is not set
159# CONFIG_FREEZER is not set 168# CONFIG_FREEZER is not set
160# CONFIG_PPC4xx_PCI_EXPRESS is not set 169# CONFIG_PPC4xx_PCI_EXPRESS is not set
161 170
@@ -176,6 +185,7 @@ CONFIG_SEQUOIA=y
176# CONFIG_ARCHES is not set 185# CONFIG_ARCHES is not set
177# CONFIG_CANYONLANDS is not set 186# CONFIG_CANYONLANDS is not set
178# CONFIG_GLACIER is not set 187# CONFIG_GLACIER is not set
188# CONFIG_REDWOOD is not set
179# CONFIG_YOSEMITE is not set 189# CONFIG_YOSEMITE is not set
180# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set 190# CONFIG_XILINX_VIRTEX440_GENERIC_BOARD is not set
181CONFIG_PPC44x_SIMPLE=y 191CONFIG_PPC44x_SIMPLE=y
@@ -238,9 +248,13 @@ CONFIG_ZONE_DMA_FLAG=1
238CONFIG_BOUNCE=y 248CONFIG_BOUNCE=y
239CONFIG_VIRT_TO_BUS=y 249CONFIG_VIRT_TO_BUS=y
240CONFIG_UNEVICTABLE_LRU=y 250CONFIG_UNEVICTABLE_LRU=y
251CONFIG_HAVE_MLOCK=y
252CONFIG_HAVE_MLOCKED_PAGE_BIT=y
253CONFIG_STDBINUTILS=y
241CONFIG_PPC_4K_PAGES=y 254CONFIG_PPC_4K_PAGES=y
242# CONFIG_PPC_16K_PAGES is not set 255# CONFIG_PPC_16K_PAGES is not set
243# CONFIG_PPC_64K_PAGES is not set 256# CONFIG_PPC_64K_PAGES is not set
257# CONFIG_PPC_256K_PAGES is not set
244CONFIG_FORCE_MAX_ZONEORDER=11 258CONFIG_FORCE_MAX_ZONEORDER=11
245CONFIG_PROC_DEVICETREE=y 259CONFIG_PROC_DEVICETREE=y
246CONFIG_CMDLINE_BOOL=y 260CONFIG_CMDLINE_BOOL=y
@@ -262,9 +276,10 @@ CONFIG_PCI_SYSCALL=y
262# CONFIG_PCIEPORTBUS is not set 276# CONFIG_PCIEPORTBUS is not set
263CONFIG_ARCH_SUPPORTS_MSI=y 277CONFIG_ARCH_SUPPORTS_MSI=y
264# CONFIG_PCI_MSI is not set 278# CONFIG_PCI_MSI is not set
265CONFIG_PCI_LEGACY=y 279# CONFIG_PCI_LEGACY is not set
266# CONFIG_PCI_DEBUG is not set 280# CONFIG_PCI_DEBUG is not set
267# CONFIG_PCI_STUB is not set 281# CONFIG_PCI_STUB is not set
282# CONFIG_PCI_IOV is not set
268# CONFIG_PCCARD is not set 283# CONFIG_PCCARD is not set
269# CONFIG_HOTPLUG_PCI is not set 284# CONFIG_HOTPLUG_PCI is not set
270# CONFIG_HAS_RAPIDIO is not set 285# CONFIG_HAS_RAPIDIO is not set
@@ -278,18 +293,16 @@ CONFIG_PCI_LEGACY=y
278# Default settings for advanced configuration options are used 293# Default settings for advanced configuration options are used
279# 294#
280CONFIG_LOWMEM_SIZE=0x30000000 295CONFIG_LOWMEM_SIZE=0x30000000
296CONFIG_LOWMEM_CAM_NUM=3
281CONFIG_PAGE_OFFSET=0xc0000000 297CONFIG_PAGE_OFFSET=0xc0000000
282CONFIG_KERNEL_START=0xc0000000 298CONFIG_KERNEL_START=0xc0000000
283CONFIG_PHYSICAL_START=0x00000000 299CONFIG_PHYSICAL_START=0x00000000
284CONFIG_TASK_SIZE=0xc0000000 300CONFIG_TASK_SIZE=0xc0000000
285CONFIG_CONSISTENT_START=0xff100000
286CONFIG_CONSISTENT_SIZE=0x00200000
287CONFIG_NET=y 301CONFIG_NET=y
288 302
289# 303#
290# Networking options 304# Networking options
291# 305#
292CONFIG_COMPAT_NET_DEV_OPS=y
293CONFIG_PACKET=y 306CONFIG_PACKET=y
294# CONFIG_PACKET_MMAP is not set 307# CONFIG_PACKET_MMAP is not set
295CONFIG_UNIX=y 308CONFIG_UNIX=y
@@ -339,6 +352,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
339# CONFIG_LAPB is not set 352# CONFIG_LAPB is not set
340# CONFIG_ECONET is not set 353# CONFIG_ECONET is not set
341# CONFIG_WAN_ROUTER is not set 354# CONFIG_WAN_ROUTER is not set
355# CONFIG_PHONET is not set
342# CONFIG_NET_SCHED is not set 356# CONFIG_NET_SCHED is not set
343# CONFIG_DCB is not set 357# CONFIG_DCB is not set
344 358
@@ -351,7 +365,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
351# CONFIG_IRDA is not set 365# CONFIG_IRDA is not set
352# CONFIG_BT is not set 366# CONFIG_BT is not set
353# CONFIG_AF_RXRPC is not set 367# CONFIG_AF_RXRPC is not set
354# CONFIG_PHONET is not set
355# CONFIG_WIRELESS is not set 368# CONFIG_WIRELESS is not set
356# CONFIG_WIMAX is not set 369# CONFIG_WIMAX is not set
357# CONFIG_RFKILL is not set 370# CONFIG_RFKILL is not set
@@ -448,14 +461,23 @@ CONFIG_MTD_PHYSMAP_OF=y
448# CONFIG_MTD_DOC2000 is not set 461# CONFIG_MTD_DOC2000 is not set
449# CONFIG_MTD_DOC2001 is not set 462# CONFIG_MTD_DOC2001 is not set
450# CONFIG_MTD_DOC2001PLUS is not set 463# CONFIG_MTD_DOC2001PLUS is not set
451# CONFIG_MTD_NAND is not set 464CONFIG_MTD_NAND=y
465# CONFIG_MTD_NAND_VERIFY_WRITE is not set
466CONFIG_MTD_NAND_ECC_SMC=y
467# CONFIG_MTD_NAND_MUSEUM_IDS is not set
468CONFIG_MTD_NAND_IDS=y
469CONFIG_MTD_NAND_NDFC=y
470# CONFIG_MTD_NAND_DISKONCHIP is not set
471# CONFIG_MTD_NAND_CAFE is not set
472# CONFIG_MTD_NAND_NANDSIM is not set
473# CONFIG_MTD_NAND_PLATFORM is not set
474# CONFIG_MTD_NAND_FSL_ELBC is not set
452# CONFIG_MTD_ONENAND is not set 475# CONFIG_MTD_ONENAND is not set
453 476
454# 477#
455# LPDDR flash memory drivers 478# LPDDR flash memory drivers
456# 479#
457# CONFIG_MTD_LPDDR is not set 480# CONFIG_MTD_LPDDR is not set
458# CONFIG_MTD_QINFO_PROBE is not set
459 481
460# 482#
461# UBI - Unsorted block images 483# UBI - Unsorted block images
@@ -483,12 +505,16 @@ CONFIG_BLK_DEV_RAM_SIZE=35000
483# CONFIG_BLK_DEV_HD is not set 505# CONFIG_BLK_DEV_HD is not set
484CONFIG_MISC_DEVICES=y 506CONFIG_MISC_DEVICES=y
485# CONFIG_PHANTOM is not set 507# CONFIG_PHANTOM is not set
486# CONFIG_EEPROM_93CX6 is not set
487# CONFIG_SGI_IOC4 is not set 508# CONFIG_SGI_IOC4 is not set
488# CONFIG_TIFM_CORE is not set 509# CONFIG_TIFM_CORE is not set
489# CONFIG_ENCLOSURE_SERVICES is not set 510# CONFIG_ENCLOSURE_SERVICES is not set
490# CONFIG_HP_ILO is not set 511# CONFIG_HP_ILO is not set
491# CONFIG_C2PORT is not set 512# CONFIG_C2PORT is not set
513
514#
515# EEPROM support
516#
517# CONFIG_EEPROM_93CX6 is not set
492CONFIG_HAVE_IDE=y 518CONFIG_HAVE_IDE=y
493# CONFIG_IDE is not set 519# CONFIG_IDE is not set
494 520
@@ -515,6 +541,7 @@ CONFIG_HAVE_IDE=y
515# CONFIG_I2O is not set 541# CONFIG_I2O is not set
516# CONFIG_MACINTOSH_DRIVERS is not set 542# CONFIG_MACINTOSH_DRIVERS is not set
517CONFIG_NETDEVICES=y 543CONFIG_NETDEVICES=y
544CONFIG_COMPAT_NET_DEV_OPS=y
518# CONFIG_DUMMY is not set 545# CONFIG_DUMMY is not set
519# CONFIG_BONDING is not set 546# CONFIG_BONDING is not set
520# CONFIG_MACVLAN is not set 547# CONFIG_MACVLAN is not set
@@ -529,6 +556,8 @@ CONFIG_NET_ETHERNET=y
529# CONFIG_SUNGEM is not set 556# CONFIG_SUNGEM is not set
530# CONFIG_CASSINI is not set 557# CONFIG_CASSINI is not set
531# CONFIG_NET_VENDOR_3COM is not set 558# CONFIG_NET_VENDOR_3COM is not set
559# CONFIG_ETHOC is not set
560# CONFIG_DNET is not set
532# CONFIG_NET_TULIP is not set 561# CONFIG_NET_TULIP is not set
533# CONFIG_HP100 is not set 562# CONFIG_HP100 is not set
534CONFIG_IBM_NEW_EMAC=y 563CONFIG_IBM_NEW_EMAC=y
@@ -568,6 +597,7 @@ CONFIG_NETDEV_1000=y
568# CONFIG_QLA3XXX is not set 597# CONFIG_QLA3XXX is not set
569# CONFIG_ATL1 is not set 598# CONFIG_ATL1 is not set
570# CONFIG_ATL1E is not set 599# CONFIG_ATL1E is not set
600# CONFIG_ATL1C is not set
571# CONFIG_JME is not set 601# CONFIG_JME is not set
572CONFIG_NETDEV_10000=y 602CONFIG_NETDEV_10000=y
573# CONFIG_CHELSIO_T1 is not set 603# CONFIG_CHELSIO_T1 is not set
@@ -577,6 +607,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
577# CONFIG_IXGBE is not set 607# CONFIG_IXGBE is not set
578# CONFIG_IXGB is not set 608# CONFIG_IXGB is not set
579# CONFIG_S2IO is not set 609# CONFIG_S2IO is not set
610# CONFIG_VXGE is not set
580# CONFIG_MYRI10GE is not set 611# CONFIG_MYRI10GE is not set
581# CONFIG_NETXEN_NIC is not set 612# CONFIG_NETXEN_NIC is not set
582# CONFIG_NIU is not set 613# CONFIG_NIU is not set
@@ -586,6 +617,7 @@ CONFIG_CHELSIO_T3_DEPENDS=y
586# CONFIG_BNX2X is not set 617# CONFIG_BNX2X is not set
587# CONFIG_QLGE is not set 618# CONFIG_QLGE is not set
588# CONFIG_SFC is not set 619# CONFIG_SFC is not set
620# CONFIG_BE2NET is not set
589# CONFIG_TR is not set 621# CONFIG_TR is not set
590 622
591# 623#
@@ -593,7 +625,6 @@ CONFIG_CHELSIO_T3_DEPENDS=y
593# 625#
594# CONFIG_WLAN_PRE80211 is not set 626# CONFIG_WLAN_PRE80211 is not set
595# CONFIG_WLAN_80211 is not set 627# CONFIG_WLAN_80211 is not set
596# CONFIG_IWLWIFI_LEDS is not set
597 628
598# 629#
599# Enable WiMAX (Networking options) to see the WiMAX drivers 630# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -734,7 +765,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
734# 765#
735 766
736# 767#
737# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed; 768# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
738# 769#
739# CONFIG_USB_GADGET is not set 770# CONFIG_USB_GADGET is not set
740 771
@@ -750,6 +781,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
750# CONFIG_EDAC is not set 781# CONFIG_EDAC is not set
751# CONFIG_RTC_CLASS is not set 782# CONFIG_RTC_CLASS is not set
752# CONFIG_DMADEVICES is not set 783# CONFIG_DMADEVICES is not set
784# CONFIG_AUXDISPLAY is not set
753# CONFIG_UIO is not set 785# CONFIG_UIO is not set
754# CONFIG_STAGING is not set 786# CONFIG_STAGING is not set
755 787
@@ -778,6 +810,11 @@ CONFIG_INOTIFY_USER=y
778# CONFIG_FUSE_FS is not set 810# CONFIG_FUSE_FS is not set
779 811
780# 812#
813# Caches
814#
815# CONFIG_FSCACHE is not set
816
817#
781# CD-ROM/DVD Filesystems 818# CD-ROM/DVD Filesystems
782# 819#
783# CONFIG_ISO9660_FS is not set 820# CONFIG_ISO9660_FS is not set
@@ -842,7 +879,6 @@ CONFIG_LOCKD=y
842CONFIG_LOCKD_V4=y 879CONFIG_LOCKD_V4=y
843CONFIG_NFS_COMMON=y 880CONFIG_NFS_COMMON=y
844CONFIG_SUNRPC=y 881CONFIG_SUNRPC=y
845# CONFIG_SUNRPC_REGISTER_V4 is not set
846# CONFIG_RPCSEC_GSS_KRB5 is not set 882# CONFIG_RPCSEC_GSS_KRB5 is not set
847# CONFIG_RPCSEC_GSS_SPKM3 is not set 883# CONFIG_RPCSEC_GSS_SPKM3 is not set
848# CONFIG_SMB_FS is not set 884# CONFIG_SMB_FS is not set
@@ -858,6 +894,7 @@ CONFIG_SUNRPC=y
858CONFIG_MSDOS_PARTITION=y 894CONFIG_MSDOS_PARTITION=y
859# CONFIG_NLS is not set 895# CONFIG_NLS is not set
860# CONFIG_DLM is not set 896# CONFIG_DLM is not set
897# CONFIG_BINARY_PRINTF is not set
861 898
862# 899#
863# Library routines 900# Library routines
@@ -873,11 +910,12 @@ CONFIG_CRC32=y
873# CONFIG_LIBCRC32C is not set 910# CONFIG_LIBCRC32C is not set
874CONFIG_ZLIB_INFLATE=y 911CONFIG_ZLIB_INFLATE=y
875CONFIG_ZLIB_DEFLATE=y 912CONFIG_ZLIB_DEFLATE=y
876CONFIG_PLIST=y 913CONFIG_DECOMPRESS_GZIP=y
877CONFIG_HAS_IOMEM=y 914CONFIG_HAS_IOMEM=y
878CONFIG_HAS_IOPORT=y 915CONFIG_HAS_IOPORT=y
879CONFIG_HAS_DMA=y 916CONFIG_HAS_DMA=y
880CONFIG_HAVE_LMB=y 917CONFIG_HAVE_LMB=y
918CONFIG_NLATTR=y
881 919
882# 920#
883# Kernel hacking 921# Kernel hacking
@@ -924,9 +962,12 @@ CONFIG_SCHED_DEBUG=y
924# CONFIG_FAULT_INJECTION is not set 962# CONFIG_FAULT_INJECTION is not set
925# CONFIG_LATENCYTOP is not set 963# CONFIG_LATENCYTOP is not set
926CONFIG_SYSCTL_SYSCALL_CHECK=y 964CONFIG_SYSCTL_SYSCALL_CHECK=y
965# CONFIG_DEBUG_PAGEALLOC is not set
927CONFIG_HAVE_FUNCTION_TRACER=y 966CONFIG_HAVE_FUNCTION_TRACER=y
967CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
928CONFIG_HAVE_DYNAMIC_FTRACE=y 968CONFIG_HAVE_DYNAMIC_FTRACE=y
929CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y 969CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
970CONFIG_TRACING_SUPPORT=y
930 971
931# 972#
932# Tracers 973# Tracers
@@ -934,17 +975,20 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
934# CONFIG_FUNCTION_TRACER is not set 975# CONFIG_FUNCTION_TRACER is not set
935# CONFIG_SCHED_TRACER is not set 976# CONFIG_SCHED_TRACER is not set
936# CONFIG_CONTEXT_SWITCH_TRACER is not set 977# CONFIG_CONTEXT_SWITCH_TRACER is not set
978# CONFIG_EVENT_TRACER is not set
937# CONFIG_BOOT_TRACER is not set 979# CONFIG_BOOT_TRACER is not set
938# CONFIG_TRACE_BRANCH_PROFILING is not set 980# CONFIG_TRACE_BRANCH_PROFILING is not set
939# CONFIG_STACK_TRACER is not set 981# CONFIG_STACK_TRACER is not set
940# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 982# CONFIG_KMEMTRACE is not set
983# CONFIG_WORKQUEUE_TRACER is not set
984# CONFIG_BLK_DEV_IO_TRACE is not set
985# CONFIG_DYNAMIC_DEBUG is not set
941# CONFIG_SAMPLES is not set 986# CONFIG_SAMPLES is not set
942CONFIG_HAVE_ARCH_KGDB=y 987CONFIG_HAVE_ARCH_KGDB=y
943# CONFIG_KGDB is not set 988# CONFIG_KGDB is not set
944CONFIG_PRINT_STACK_DEPTH=64 989CONFIG_PRINT_STACK_DEPTH=64
945# CONFIG_DEBUG_STACKOVERFLOW is not set 990# CONFIG_DEBUG_STACKOVERFLOW is not set
946# CONFIG_DEBUG_STACK_USAGE is not set 991# CONFIG_DEBUG_STACK_USAGE is not set
947# CONFIG_DEBUG_PAGEALLOC is not set
948# CONFIG_CODE_PATCHING_SELFTEST is not set 992# CONFIG_CODE_PATCHING_SELFTEST is not set
949# CONFIG_FTR_FIXUP_SELFTEST is not set 993# CONFIG_FTR_FIXUP_SELFTEST is not set
950# CONFIG_MSI_BITMAP_SELFTEST is not set 994# CONFIG_MSI_BITMAP_SELFTEST is not set
@@ -952,20 +996,7 @@ CONFIG_PRINT_STACK_DEPTH=64
952# CONFIG_IRQSTACKS is not set 996# CONFIG_IRQSTACKS is not set
953# CONFIG_VIRQ_DEBUG is not set 997# CONFIG_VIRQ_DEBUG is not set
954# CONFIG_BDI_SWITCH is not set 998# CONFIG_BDI_SWITCH is not set
955CONFIG_PPC_EARLY_DEBUG=y 999# CONFIG_PPC_EARLY_DEBUG is not set
956# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
957# CONFIG_PPC_EARLY_DEBUG_G5 is not set
958# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
959# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
960# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
961# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
962# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
963# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
964CONFIG_PPC_EARLY_DEBUG_44x=y
965# CONFIG_PPC_EARLY_DEBUG_40x is not set
966# CONFIG_PPC_EARLY_DEBUG_CPM is not set
967CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
968CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x1
969 1000
970# 1001#
971# Security options 1002# Security options
@@ -988,10 +1019,12 @@ CONFIG_CRYPTO_BLKCIPHER2=y
988CONFIG_CRYPTO_HASH=y 1019CONFIG_CRYPTO_HASH=y
989CONFIG_CRYPTO_HASH2=y 1020CONFIG_CRYPTO_HASH2=y
990CONFIG_CRYPTO_RNG2=y 1021CONFIG_CRYPTO_RNG2=y
1022CONFIG_CRYPTO_PCOMP=y
991CONFIG_CRYPTO_MANAGER=y 1023CONFIG_CRYPTO_MANAGER=y
992CONFIG_CRYPTO_MANAGER2=y 1024CONFIG_CRYPTO_MANAGER2=y
993# CONFIG_CRYPTO_GF128MUL is not set 1025# CONFIG_CRYPTO_GF128MUL is not set
994# CONFIG_CRYPTO_NULL is not set 1026# CONFIG_CRYPTO_NULL is not set
1027CONFIG_CRYPTO_WORKQUEUE=y
995# CONFIG_CRYPTO_CRYPTD is not set 1028# CONFIG_CRYPTO_CRYPTD is not set
996# CONFIG_CRYPTO_AUTHENC is not set 1029# CONFIG_CRYPTO_AUTHENC is not set
997# CONFIG_CRYPTO_TEST is not set 1030# CONFIG_CRYPTO_TEST is not set
@@ -1060,6 +1093,7 @@ CONFIG_CRYPTO_DES=y
1060# Compression 1093# Compression
1061# 1094#
1062# CONFIG_CRYPTO_DEFLATE is not set 1095# CONFIG_CRYPTO_DEFLATE is not set
1096# CONFIG_CRYPTO_ZLIB is not set
1063# CONFIG_CRYPTO_LZO is not set 1097# CONFIG_CRYPTO_LZO is not set
1064 1098
1065# 1099#
@@ -1068,5 +1102,6 @@ CONFIG_CRYPTO_DES=y
1068# CONFIG_CRYPTO_ANSI_CPRNG is not set 1102# CONFIG_CRYPTO_ANSI_CPRNG is not set
1069CONFIG_CRYPTO_HW=y 1103CONFIG_CRYPTO_HW=y
1070# CONFIG_CRYPTO_DEV_HIFN_795X is not set 1104# CONFIG_CRYPTO_DEV_HIFN_795X is not set
1105# CONFIG_CRYPTO_DEV_PPC4XX is not set
1071# CONFIG_PPC_CLOCK is not set 1106# CONFIG_PPC_CLOCK is not set
1072# CONFIG_VIRTUALIZATION is not set 1107# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/configs/44x/taishan_defconfig b/arch/powerpc/configs/44x/taishan_defconfig
index 826700872d26..ef32cc4f82eb 100644
--- a/arch/powerpc/configs/44x/taishan_defconfig
+++ b/arch/powerpc/configs/44x/taishan_defconfig
@@ -260,7 +260,7 @@ CONFIG_PCI_SYSCALL=y
260# CONFIG_PCIEPORTBUS is not set 260# CONFIG_PCIEPORTBUS is not set
261CONFIG_ARCH_SUPPORTS_MSI=y 261CONFIG_ARCH_SUPPORTS_MSI=y
262# CONFIG_PCI_MSI is not set 262# CONFIG_PCI_MSI is not set
263CONFIG_PCI_LEGACY=y 263# CONFIG_PCI_LEGACY is not set
264# CONFIG_PCI_DEBUG is not set 264# CONFIG_PCI_DEBUG is not set
265# CONFIG_PCI_STUB is not set 265# CONFIG_PCI_STUB is not set
266# CONFIG_PCCARD is not set 266# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/44x/virtex5_defconfig b/arch/powerpc/configs/44x/virtex5_defconfig
index 1bf0a63614b1..2518b8568c70 100644
--- a/arch/powerpc/configs/44x/virtex5_defconfig
+++ b/arch/powerpc/configs/44x/virtex5_defconfig
@@ -263,7 +263,7 @@ CONFIG_PCI_SYSCALL=y
263# CONFIG_PCIEPORTBUS is not set 263# CONFIG_PCIEPORTBUS is not set
264CONFIG_ARCH_SUPPORTS_MSI=y 264CONFIG_ARCH_SUPPORTS_MSI=y
265# CONFIG_PCI_MSI is not set 265# CONFIG_PCI_MSI is not set
266CONFIG_PCI_LEGACY=y 266# CONFIG_PCI_LEGACY is not set
267# CONFIG_PCI_DEBUG is not set 267# CONFIG_PCI_DEBUG is not set
268# CONFIG_PCI_STUB is not set 268# CONFIG_PCI_STUB is not set
269# CONFIG_PCCARD is not set 269# CONFIG_PCCARD is not set
diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig
index 7d044dfd9236..12dc7c409616 100644
--- a/arch/powerpc/configs/ppc6xx_defconfig
+++ b/arch/powerpc/configs/ppc6xx_defconfig
@@ -1808,7 +1808,7 @@ CONFIG_PCF8575=m
1808CONFIG_SENSORS_PCA9539=m 1808CONFIG_SENSORS_PCA9539=m
1809CONFIG_SENSORS_PCF8591=m 1809CONFIG_SENSORS_PCF8591=m
1810# CONFIG_TPS65010 is not set 1810# CONFIG_TPS65010 is not set
1811CONFIG_SENSORS_MAX6875=m 1811CONFIG_EEPROM_MAX6875=m
1812CONFIG_SENSORS_TSL2550=m 1812CONFIG_SENSORS_TSL2550=m
1813CONFIG_MCU_MPC8349EMITX=m 1813CONFIG_MCU_MPC8349EMITX=m
1814# CONFIG_I2C_DEBUG_CORE is not set 1814# CONFIG_I2C_DEBUG_CORE is not set
diff --git a/arch/powerpc/include/asm/8253pit.h b/arch/powerpc/include/asm/8253pit.h
index b70d6e53b303..a71c9c1455a7 100644
--- a/arch/powerpc/include/asm/8253pit.h
+++ b/arch/powerpc/include/asm/8253pit.h
@@ -1,10 +1,3 @@
1#ifndef _ASM_POWERPC_8253PIT_H
2#define _ASM_POWERPC_8253PIT_H
3
4/* 1/*
5 * 8253/8254 Programmable Interval Timer 2 * 8253/8254 Programmable Interval Timer
6 */ 3 */
7
8#define PIT_TICK_RATE 1193182UL
9
10#endif /* _ASM_POWERPC_8253PIT_H */
diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h
index b7d2d07b6f96..4012483b1899 100644
--- a/arch/powerpc/include/asm/atomic.h
+++ b/arch/powerpc/include/asm/atomic.h
@@ -470,6 +470,9 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
470 470
471#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) 471#define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0)
472 472
473#else /* __powerpc64__ */
474#include <asm-generic/atomic64.h>
475
473#endif /* __powerpc64__ */ 476#endif /* __powerpc64__ */
474 477
475#include <asm-generic/atomic-long.h> 478#include <asm-generic/atomic-long.h>
diff --git a/arch/powerpc/include/asm/cpm2.h b/arch/powerpc/include/asm/cpm2.h
index 0f5e8ff59a85..990ff191da8b 100644
--- a/arch/powerpc/include/asm/cpm2.h
+++ b/arch/powerpc/include/asm/cpm2.h
@@ -14,10 +14,6 @@
14#include <asm/cpm.h> 14#include <asm/cpm.h>
15#include <sysdev/fsl_soc.h> 15#include <sysdev/fsl_soc.h>
16 16
17#ifdef CONFIG_PPC_85xx
18#define CPM_MAP_ADDR (get_immrbase() + 0x80000)
19#endif
20
21/* CPM Command register. 17/* CPM Command register.
22*/ 18*/
23#define CPM_CR_RST ((uint)0x80000000) 19#define CPM_CR_RST ((uint)0x80000000)
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index cb448d68452c..3d9e887c3c0c 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -15,9 +15,18 @@
15#include <linux/scatterlist.h> 15#include <linux/scatterlist.h>
16#include <linux/dma-attrs.h> 16#include <linux/dma-attrs.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/swiotlb.h>
18 19
19#define DMA_ERROR_CODE (~(dma_addr_t)0x0) 20#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
20 21
22/* Some dma direct funcs must be visible for use in other dma_ops */
23extern void *dma_direct_alloc_coherent(struct device *dev, size_t size,
24 dma_addr_t *dma_handle, gfp_t flag);
25extern void dma_direct_free_coherent(struct device *dev, size_t size,
26 void *vaddr, dma_addr_t dma_handle);
27
28extern unsigned long get_dma_direct_offset(struct device *dev);
29
21#ifdef CONFIG_NOT_COHERENT_CACHE 30#ifdef CONFIG_NOT_COHERENT_CACHE
22/* 31/*
23 * DMA-consistent mapping functions for PowerPCs that don't support 32 * DMA-consistent mapping functions for PowerPCs that don't support
@@ -78,6 +87,8 @@ struct dma_mapping_ops {
78 dma_addr_t dma_address, size_t size, 87 dma_addr_t dma_address, size_t size,
79 enum dma_data_direction direction, 88 enum dma_data_direction direction,
80 struct dma_attrs *attrs); 89 struct dma_attrs *attrs);
90 int (*addr_needs_map)(struct device *dev, dma_addr_t addr,
91 size_t size);
81#ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS 92#ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS
82 void (*sync_single_range_for_cpu)(struct device *hwdev, 93 void (*sync_single_range_for_cpu)(struct device *hwdev,
83 dma_addr_t dma_handle, unsigned long offset, 94 dma_addr_t dma_handle, unsigned long offset,
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index d6b4a12cdeff..014a624f4c8e 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -256,11 +256,11 @@ do { \
256 * even if we have an executable stack. 256 * even if we have an executable stack.
257 */ 257 */
258# define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \ 258# define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \
259 (exec_stk != EXSTACK_DISABLE_X) : 0) 259 (exec_stk == EXSTACK_DEFAULT) : 0)
260#else 260#else
261# define SET_PERSONALITY(ex) \ 261# define SET_PERSONALITY(ex) \
262 set_personality(PER_LINUX | (current->personality & (~PER_MASK))) 262 set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
263# define elf_read_implies_exec(ex, exec_stk) (exec_stk != EXSTACK_DISABLE_X) 263# define elf_read_implies_exec(ex, exec_stk) (exec_stk == EXSTACK_DEFAULT)
264#endif /* __powerpc64__ */ 264#endif /* __powerpc64__ */
265 265
266extern int dcache_bsize; 266extern int dcache_bsize;
diff --git a/arch/powerpc/include/asm/emulated_ops.h b/arch/powerpc/include/asm/emulated_ops.h
new file mode 100644
index 000000000000..9154e8526732
--- /dev/null
+++ b/arch/powerpc/include/asm/emulated_ops.h
@@ -0,0 +1,73 @@
1/*
2 * Copyright 2007 Sony Corporation
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; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program.
15 * If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _ASM_POWERPC_EMULATED_OPS_H
19#define _ASM_POWERPC_EMULATED_OPS_H
20
21#include <asm/atomic.h>
22
23
24#ifdef CONFIG_PPC_EMULATED_STATS
25
26struct ppc_emulated_entry {
27 const char *name;
28 atomic_t val;
29};
30
31extern struct ppc_emulated {
32#ifdef CONFIG_ALTIVEC
33 struct ppc_emulated_entry altivec;
34#endif
35 struct ppc_emulated_entry dcba;
36 struct ppc_emulated_entry dcbz;
37 struct ppc_emulated_entry fp_pair;
38 struct ppc_emulated_entry isel;
39 struct ppc_emulated_entry mcrxr;
40 struct ppc_emulated_entry mfpvr;
41 struct ppc_emulated_entry multiple;
42 struct ppc_emulated_entry popcntb;
43 struct ppc_emulated_entry spe;
44 struct ppc_emulated_entry string;
45 struct ppc_emulated_entry unaligned;
46#ifdef CONFIG_MATH_EMULATION
47 struct ppc_emulated_entry math;
48#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
49 struct ppc_emulated_entry 8xx;
50#endif
51#ifdef CONFIG_VSX
52 struct ppc_emulated_entry vsx;
53#endif
54} ppc_emulated;
55
56extern u32 ppc_warn_emulated;
57
58extern void ppc_warn_emulated_print(const char *type);
59
60#define PPC_WARN_EMULATED(type) \
61 do { \
62 atomic_inc(&ppc_emulated.type.val); \
63 if (ppc_warn_emulated) \
64 ppc_warn_emulated_print(ppc_emulated.type.name); \
65 } while (0)
66
67#else /* !CONFIG_PPC_EMULATED_STATS */
68
69#define PPC_WARN_EMULATED(type) do { } while (0)
70
71#endif /* !CONFIG_PPC_EMULATED_STATS */
72
73#endif /* _ASM_POWERPC_EMULATED_OPS_H */
diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h
index e4094a5cb05b..cbd4dfa4bce2 100644
--- a/arch/powerpc/include/asm/feature-fixups.h
+++ b/arch/powerpc/include/asm/feature-fixups.h
@@ -8,8 +8,6 @@
8 * 2 of the License, or (at your option) any later version. 8 * 2 of the License, or (at your option) any later version.
9 */ 9 */
10 10
11#ifdef __ASSEMBLY__
12
13/* 11/*
14 * Feature section common macros 12 * Feature section common macros
15 * 13 *
@@ -23,10 +21,12 @@
23/* 64 bits kernel, 32 bits code (ie. vdso32) */ 21/* 64 bits kernel, 32 bits code (ie. vdso32) */
24#define FTR_ENTRY_LONG .llong 22#define FTR_ENTRY_LONG .llong
25#define FTR_ENTRY_OFFSET .long 0xffffffff; .long 23#define FTR_ENTRY_OFFSET .long 0xffffffff; .long
24#elif defined(CONFIG_PPC64)
25#define FTR_ENTRY_LONG .llong
26#define FTR_ENTRY_OFFSET .llong
26#else 27#else
27/* 64 bit kernel 64 bit code, or 32 bit kernel 32 bit code */ 28#define FTR_ENTRY_LONG .long
28#define FTR_ENTRY_LONG PPC_LONG 29#define FTR_ENTRY_OFFSET .long
29#define FTR_ENTRY_OFFSET PPC_LONG
30#endif 30#endif
31 31
32#define START_FTR_SECTION(label) label##1: 32#define START_FTR_SECTION(label) label##1:
@@ -141,6 +141,21 @@ label##5: \
141#define ALT_FW_FTR_SECTION_END_IFCLR(msk) \ 141#define ALT_FW_FTR_SECTION_END_IFCLR(msk) \
142 ALT_FW_FTR_SECTION_END_NESTED_IFCLR(msk, 97) 142 ALT_FW_FTR_SECTION_END_NESTED_IFCLR(msk, 97)
143 143
144#ifndef __ASSEMBLY__
145
146#define ASM_MMU_FTR_IF(section_if, section_else, msk, val) \
147 stringify_in_c(BEGIN_MMU_FTR_SECTION) \
148 section_if "; " \
149 stringify_in_c(MMU_FTR_SECTION_ELSE) \
150 section_else "; " \
151 stringify_in_c(ALT_MMU_FTR_SECTION_END((msk), (val)))
152
153#define ASM_MMU_FTR_IFSET(section_if, section_else, msk) \
154 ASM_MMU_FTR_IF(section_if, section_else, (msk), (msk))
155
156#define ASM_MMU_FTR_IFCLR(section_if, section_else, msk) \
157 ASM_MMU_FTR_IF(section_if, section_else, (msk), 0)
158
144#endif /* __ASSEMBLY__ */ 159#endif /* __ASSEMBLY__ */
145 160
146/* LWSYNC feature sections */ 161/* LWSYNC feature sections */
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 53512374e1c9..b7f8f4a87cc0 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -80,7 +80,7 @@ static inline void local_irq_disable(void)
80 __asm__ __volatile__("wrteei 0": : :"memory"); 80 __asm__ __volatile__("wrteei 0": : :"memory");
81#else 81#else
82 unsigned long msr; 82 unsigned long msr;
83 __asm__ __volatile__("": : :"memory"); 83
84 msr = mfmsr(); 84 msr = mfmsr();
85 SET_MSR_EE(msr & ~MSR_EE); 85 SET_MSR_EE(msr & ~MSR_EE);
86#endif 86#endif
@@ -92,7 +92,7 @@ static inline void local_irq_enable(void)
92 __asm__ __volatile__("wrteei 1": : :"memory"); 92 __asm__ __volatile__("wrteei 1": : :"memory");
93#else 93#else
94 unsigned long msr; 94 unsigned long msr;
95 __asm__ __volatile__("": : :"memory"); 95
96 msr = mfmsr(); 96 msr = mfmsr();
97 SET_MSR_EE(msr | MSR_EE); 97 SET_MSR_EE(msr | MSR_EE);
98#endif 98#endif
@@ -108,7 +108,6 @@ static inline void local_irq_save_ptr(unsigned long *flags)
108#else 108#else
109 SET_MSR_EE(msr & ~MSR_EE); 109 SET_MSR_EE(msr & ~MSR_EE);
110#endif 110#endif
111 __asm__ __volatile__("": : :"memory");
112} 111}
113 112
114#define local_save_flags(flags) ((flags) = mfmsr()) 113#define local_save_flags(flags) ((flags) = mfmsr())
diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/iommu.h
index 7464c0daddd1..7ead7c16fb7c 100644
--- a/arch/powerpc/include/asm/iommu.h
+++ b/arch/powerpc/include/asm/iommu.h
@@ -35,6 +35,16 @@
35#define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1)) 35#define IOMMU_PAGE_MASK (~((1 << IOMMU_PAGE_SHIFT) - 1))
36#define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE) 36#define IOMMU_PAGE_ALIGN(addr) _ALIGN_UP(addr, IOMMU_PAGE_SIZE)
37 37
38/* Cell page table entries */
39#define CBE_IOPTE_PP_W 0x8000000000000000ul /* protection: write */
40#define CBE_IOPTE_PP_R 0x4000000000000000ul /* protection: read */
41#define CBE_IOPTE_M 0x2000000000000000ul /* coherency required */
42#define CBE_IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */
43#define CBE_IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */
44#define CBE_IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */
45#define CBE_IOPTE_H 0x0000000000000800ul /* cache hint */
46#define CBE_IOPTE_IOID_Mask 0x00000000000007fful /* ioid */
47
38/* Boot time flags */ 48/* Boot time flags */
39extern int iommu_is_off; 49extern int iommu_is_off;
40extern int iommu_force_on; 50extern int iommu_force_on;
diff --git a/arch/powerpc/include/asm/lppaca.h b/arch/powerpc/include/asm/lppaca.h
index d2a65e8ca6ae..f78f65c38f05 100644
--- a/arch/powerpc/include/asm/lppaca.h
+++ b/arch/powerpc/include/asm/lppaca.h
@@ -20,6 +20,11 @@
20#define _ASM_POWERPC_LPPACA_H 20#define _ASM_POWERPC_LPPACA_H
21#ifdef __KERNEL__ 21#ifdef __KERNEL__
22 22
23/* These definitions relate to hypervisors that only exist when using
24 * a server type processor
25 */
26#ifdef CONFIG_PPC_BOOK3S
27
23//============================================================================= 28//=============================================================================
24// 29//
25// This control block contains the data that is shared between the 30// This control block contains the data that is shared between the
@@ -158,5 +163,6 @@ struct slb_shadow {
158 163
159extern struct slb_shadow slb_shadow[]; 164extern struct slb_shadow slb_shadow[];
160 165
166#endif /* CONFIG_PPC_BOOK3S */
161#endif /* __KERNEL__ */ 167#endif /* __KERNEL__ */
162#endif /* _ASM_POWERPC_LPPACA_H */ 168#endif /* _ASM_POWERPC_LPPACA_H */
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 0efdb1dfdc5f..11d1fc3a8962 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -110,6 +110,10 @@ struct machdep_calls {
110 void (*show_percpuinfo)(struct seq_file *m, int i); 110 void (*show_percpuinfo)(struct seq_file *m, int i);
111 111
112 void (*init_IRQ)(void); 112 void (*init_IRQ)(void);
113
114 /* Return an irq, or NO_IRQ to indicate there are none pending.
115 * If for some reason there is no irq, but the interrupt
116 * shouldn't be counted as spurious, return NO_IRQ_IGNORE. */
113 unsigned int (*get_irq)(void); 117 unsigned int (*get_irq)(void);
114#ifdef CONFIG_KEXEC 118#ifdef CONFIG_KEXEC
115 void (*kexec_cpu_down)(int crash_shutdown, int secondary); 119 void (*kexec_cpu_down)(int crash_shutdown, int secondary);
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
index cbf154387091..fb57ded592f9 100644
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -52,6 +52,11 @@
52 */ 52 */
53#define MMU_FTR_NEED_DTLB_SW_LRU ASM_CONST(0x00200000) 53#define MMU_FTR_NEED_DTLB_SW_LRU ASM_CONST(0x00200000)
54 54
55/* This indicates that the processor uses the ISA 2.06 server tlbie
56 * mnemonics
57 */
58#define MMU_FTR_TLBIE_206 ASM_CONST(0x00400000)
59
55#ifndef __ASSEMBLY__ 60#ifndef __ASSEMBLY__
56#include <asm/cputable.h> 61#include <asm/cputable.h>
57 62
@@ -69,10 +74,10 @@ extern void early_init_mmu_secondary(void);
69#endif /* !__ASSEMBLY__ */ 74#endif /* !__ASSEMBLY__ */
70 75
71 76
72#ifdef CONFIG_PPC64 77#if defined(CONFIG_PPC_STD_MMU_64)
73/* 64-bit classic hash table MMU */ 78/* 64-bit classic hash table MMU */
74# include <asm/mmu-hash64.h> 79# include <asm/mmu-hash64.h>
75#elif defined(CONFIG_PPC_STD_MMU) 80#elif defined(CONFIG_PPC_STD_MMU_32)
76/* 32-bit classic hash table MMU */ 81/* 32-bit classic hash table MMU */
77# include <asm/mmu-hash32.h> 82# include <asm/mmu-hash32.h>
78#elif defined(CONFIG_40x) 83#elif defined(CONFIG_40x)
diff --git a/arch/powerpc/include/asm/mpc86xx.h b/arch/powerpc/include/asm/mpc86xx.h
deleted file mode 100644
index 15f650f987e7..000000000000
--- a/arch/powerpc/include/asm/mpc86xx.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * MPC86xx definitions
3 *
4 * Author: Jeff Brown
5 *
6 * Copyright 2004 Freescale Semiconductor, 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
14#ifdef __KERNEL__
15#ifndef __ASM_POWERPC_MPC86xx_H__
16#define __ASM_POWERPC_MPC86xx_H__
17
18#include <asm/mmu.h>
19
20#ifdef CONFIG_PPC_86xx
21
22#define CPU0_BOOT_RELEASE 0x01000000
23#define CPU1_BOOT_RELEASE 0x02000000
24#define CPU_ALL_RELEASED (CPU0_BOOT_RELEASE | CPU1_BOOT_RELEASE)
25#define MCM_PORT_CONFIG_OFFSET 0x1010
26
27/* Offset from CCSRBAR */
28#define MPC86xx_MCM_OFFSET (0x00000)
29#define MPC86xx_MCM_SIZE (0x02000)
30
31#endif /* CONFIG_PPC_86xx */
32#endif /* __ASM_POWERPC_MPC86xx_H__ */
33#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 6ef055723019..c8a3cbfe02ff 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -43,6 +43,7 @@ struct task_struct;
43 * processor. 43 * processor.
44 */ 44 */
45struct paca_struct { 45struct paca_struct {
46#ifdef CONFIG_PPC_BOOK3S
46 /* 47 /*
47 * Because hw_cpu_id, unlike other paca fields, is accessed 48 * Because hw_cpu_id, unlike other paca fields, is accessed
48 * routinely from other CPUs (from the IRQ code), we stick to 49 * routinely from other CPUs (from the IRQ code), we stick to
@@ -51,7 +52,7 @@ struct paca_struct {
51 */ 52 */
52 53
53 struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */ 54 struct lppaca *lppaca_ptr; /* Pointer to LpPaca for PLIC */
54 55#endif /* CONFIG_PPC_BOOK3S */
55 /* 56 /*
56 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c 57 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c
57 * load lock_token and paca_index with a single lwz 58 * load lock_token and paca_index with a single lwz
@@ -64,13 +65,16 @@ struct paca_struct {
64 u64 kernel_toc; /* Kernel TOC address */ 65 u64 kernel_toc; /* Kernel TOC address */
65 u64 kernelbase; /* Base address of kernel */ 66 u64 kernelbase; /* Base address of kernel */
66 u64 kernel_msr; /* MSR while running in kernel */ 67 u64 kernel_msr; /* MSR while running in kernel */
68#ifdef CONFIG_PPC_STD_MMU_64
67 u64 stab_real; /* Absolute address of segment table */ 69 u64 stab_real; /* Absolute address of segment table */
68 u64 stab_addr; /* Virtual address of segment table */ 70 u64 stab_addr; /* Virtual address of segment table */
71#endif /* CONFIG_PPC_STD_MMU_64 */
69 void *emergency_sp; /* pointer to emergency stack */ 72 void *emergency_sp; /* pointer to emergency stack */
70 u64 data_offset; /* per cpu data offset */ 73 u64 data_offset; /* per cpu data offset */
71 s16 hw_cpu_id; /* Physical processor number */ 74 s16 hw_cpu_id; /* Physical processor number */
72 u8 cpu_start; /* At startup, processor spins until */ 75 u8 cpu_start; /* At startup, processor spins until */
73 /* this becomes non-zero. */ 76 /* this becomes non-zero. */
77#ifdef CONFIG_PPC_STD_MMU_64
74 struct slb_shadow *slb_shadow_ptr; 78 struct slb_shadow *slb_shadow_ptr;
75 79
76 /* 80 /*
@@ -81,11 +85,13 @@ struct paca_struct {
81 u64 exmc[10]; /* used for machine checks */ 85 u64 exmc[10]; /* used for machine checks */
82 u64 exslb[10]; /* used for SLB/segment table misses 86 u64 exslb[10]; /* used for SLB/segment table misses
83 * on the linear mapping */ 87 * on the linear mapping */
84 88 /* SLB related definitions */
85 mm_context_t context;
86 u16 vmalloc_sllp; 89 u16 vmalloc_sllp;
87 u16 slb_cache_ptr; 90 u16 slb_cache_ptr;
88 u16 slb_cache[SLB_CACHE_ENTRIES]; 91 u16 slb_cache[SLB_CACHE_ENTRIES];
92#endif /* CONFIG_PPC_STD_MMU_64 */
93
94 mm_context_t context;
89 95
90 /* 96 /*
91 * then miscellaneous read-write fields 97 * then miscellaneous read-write fields
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 32cbf16f10ea..4940662ee87e 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -231,6 +231,11 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr,
231 struct page *p); 231 struct page *p);
232extern int page_is_ram(unsigned long pfn); 232extern int page_is_ram(unsigned long pfn);
233 233
234#ifdef CONFIG_PPC_SMLPAR
235void arch_free_page(struct page *page, int order);
236#define HAVE_ARCH_FREE_PAGE
237#endif
238
234struct vm_area_struct; 239struct vm_area_struct;
235 240
236typedef struct page *pgtable_t; 241typedef struct page *pgtable_t;
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 84007afabdb5..4c61fa0b8d75 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -86,17 +86,12 @@ struct pci_controller {
86 void *io_base_alloc; 86 void *io_base_alloc;
87#endif 87#endif
88 resource_size_t io_base_phys; 88 resource_size_t io_base_phys;
89#ifndef CONFIG_PPC64
90 resource_size_t pci_io_size; 89 resource_size_t pci_io_size;
91#endif
92 90
93 /* Some machines (PReP) have a non 1:1 mapping of 91 /* Some machines (PReP) have a non 1:1 mapping of
94 * the PCI memory space in the CPU bus space 92 * the PCI memory space in the CPU bus space
95 */ 93 */
96 resource_size_t pci_mem_offset; 94 resource_size_t pci_mem_offset;
97#ifdef CONFIG_PPC64
98 unsigned long pci_io_size;
99#endif
100 95
101 /* Some machines have a special region to forward the ISA 96 /* Some machines have a special region to forward the ISA
102 * "memory" cycles such as VGA memory regions. Left to 0 97 * "memory" cycles such as VGA memory regions. Left to 0
@@ -140,10 +135,12 @@ struct pci_controller {
140 struct resource io_resource; 135 struct resource io_resource;
141 struct resource mem_resources[3]; 136 struct resource mem_resources[3];
142 int global_number; /* PCI domain number */ 137 int global_number; /* PCI domain number */
138
139 resource_size_t dma_window_base_cur;
140 resource_size_t dma_window_size;
141
143#ifdef CONFIG_PPC64 142#ifdef CONFIG_PPC64
144 unsigned long buid; 143 unsigned long buid;
145 unsigned long dma_window_base_cur;
146 unsigned long dma_window_size;
147 144
148 void *private_data; 145 void *private_data;
149#endif /* CONFIG_PPC64 */ 146#endif /* CONFIG_PPC64 */
@@ -185,7 +182,6 @@ extern int early_find_capability(struct pci_controller *hose, int bus,
185extern void setup_indirect_pci(struct pci_controller* hose, 182extern void setup_indirect_pci(struct pci_controller* hose,
186 resource_size_t cfg_addr, 183 resource_size_t cfg_addr,
187 resource_size_t cfg_data, u32 flags); 184 resource_size_t cfg_data, u32 flags);
188extern void setup_grackle(struct pci_controller *hose);
189#else /* CONFIG_PPC64 */ 185#else /* CONFIG_PPC64 */
190 186
191/* 187/*
@@ -221,6 +217,7 @@ struct pci_dn {
221#define PCI_DN(dn) ((struct pci_dn *) (dn)->data) 217#define PCI_DN(dn) ((struct pci_dn *) (dn)->data)
222 218
223extern struct device_node *fetch_dev_dn(struct pci_dev *dev); 219extern struct device_node *fetch_dev_dn(struct pci_dev *dev);
220extern void * update_dn_pci_info(struct device_node *dn, void *data);
224 221
225/* Get a device_node from a pci_dev. This code must be fast except 222/* Get a device_node from a pci_dev. This code must be fast except
226 * in the case where the sysdata is incorrect and needs to be fixed 223 * in the case where the sysdata is incorrect and needs to be fixed
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index c40db05f21e0..8cd083c61503 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -31,9 +31,11 @@
31#error TASK_SIZE_USER64 exceeds pagetable range 31#error TASK_SIZE_USER64 exceeds pagetable range
32#endif 32#endif
33 33
34#ifdef CONFIG_PPC_STD_MMU_64
34#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT)) 35#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT))
35#error TASK_SIZE_USER64 exceeds user VSID range 36#error TASK_SIZE_USER64 exceeds user VSID range
36#endif 37#endif
38#endif
37 39
38/* 40/*
39 * Define the address range of the vmalloc VM area. 41 * Define the address range of the vmalloc VM area.
@@ -199,8 +201,11 @@ static inline unsigned long pte_update(struct mm_struct *mm,
199 if (!huge) 201 if (!huge)
200 assert_pte_locked(mm, addr); 202 assert_pte_locked(mm, addr);
201 203
204#ifdef CONFIG_PPC_STD_MMU_64
202 if (old & _PAGE_HASHPTE) 205 if (old & _PAGE_HASHPTE)
203 hpte_need_flush(mm, addr, ptep, old, huge); 206 hpte_need_flush(mm, addr, ptep, old, huge);
207#endif
208
204 return old; 209 return old;
205} 210}
206 211
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
index 640ccbbc0977..b74f16d45cb4 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -25,6 +25,7 @@
25#define PPC_INST_LSWI 0x7c0004aa 25#define PPC_INST_LSWI 0x7c0004aa
26#define PPC_INST_LSWX 0x7c00042a 26#define PPC_INST_LSWX 0x7c00042a
27#define PPC_INST_LWSYNC 0x7c2004ac 27#define PPC_INST_LWSYNC 0x7c2004ac
28#define PPC_INST_LXVD2X 0x7c000698
28#define PPC_INST_MCRXR 0x7c000400 29#define PPC_INST_MCRXR 0x7c000400
29#define PPC_INST_MCRXR_MASK 0xfc0007fe 30#define PPC_INST_MCRXR_MASK 0xfc0007fe
30#define PPC_INST_MFSPR_PVR 0x7c1f42a6 31#define PPC_INST_MFSPR_PVR 0x7c1f42a6
@@ -43,14 +44,18 @@
43 44
44#define PPC_INST_STSWI 0x7c0005aa 45#define PPC_INST_STSWI 0x7c0005aa
45#define PPC_INST_STSWX 0x7c00052a 46#define PPC_INST_STSWX 0x7c00052a
47#define PPC_INST_STXVD2X 0x7c000798
48#define PPC_INST_TLBIE 0x7c000264
46#define PPC_INST_TLBILX 0x7c000024 49#define PPC_INST_TLBILX 0x7c000024
47#define PPC_INST_WAIT 0x7c00007c 50#define PPC_INST_WAIT 0x7c00007c
48 51
49/* macros to insert fields into opcodes */ 52/* macros to insert fields into opcodes */
50#define __PPC_RA(a) ((a & 0x1f) << 16) 53#define __PPC_RA(a) (((a) & 0x1f) << 16)
51#define __PPC_RB(b) ((b & 0x1f) << 11) 54#define __PPC_RB(b) (((b) & 0x1f) << 11)
52#define __PPC_T_TLB(t) ((t & 0x3) << 21) 55#define __PPC_RS(s) (((s) & 0x1f) << 21)
53#define __PPC_WC(w) ((w & 0x3) << 21) 56#define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5))
57#define __PPC_T_TLB(t) (((t) & 0x3) << 21)
58#define __PPC_WC(w) (((w) & 0x3) << 21)
54 59
55/* Deal with instructions that older assemblers aren't aware of */ 60/* Deal with instructions that older assemblers aren't aware of */
56#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \ 61#define PPC_DCBAL(a, b) stringify_in_c(.long PPC_INST_DCBAL | \
@@ -69,5 +74,17 @@
69#define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b) 74#define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b)
70#define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \ 75#define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \
71 __PPC_WC(w)) 76 __PPC_WC(w))
77#define PPC_TLBIE(lp,a) stringify_in_c(.long PPC_INST_TLBIE | \
78 __PPC_RB(a) | __PPC_RS(lp))
79
80/*
81 * Define what the VSX XX1 form instructions will look like, then add
82 * the 128 bit load store instructions based on that.
83 */
84#define VSX_XX1(s, a, b) (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b))
85#define STXVD2X(s, a, b) stringify_in_c(.long PPC_INST_STXVD2X | \
86 VSX_XX1((s), (a), (b)))
87#define LXVD2X(s, a, b) stringify_in_c(.long PPC_INST_LXVD2X | \
88 VSX_XX1((s), (a), (b)))
72 89
73#endif /* _ASM_POWERPC_PPC_OPCODE_H */ 90#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 384d90c9c272..f9729529c20d 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -76,16 +76,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
76 REST_10GPRS(22, base) 76 REST_10GPRS(22, base)
77#endif 77#endif
78 78
79/*
80 * Define what the VSX XX1 form instructions will look like, then add
81 * the 128 bit load store instructions based on that.
82 */
83#define VSX_XX1(xs, ra, rb) (((xs) & 0x1f) << 21 | ((ra) << 16) | \
84 ((rb) << 11) | (((xs) >> 5)))
85
86#define STXVD2X(xs, ra, rb) .long (0x7c000798 | VSX_XX1((xs), (ra), (rb)))
87#define LXVD2X(xs, ra, rb) .long (0x7c000698 | VSX_XX1((xs), (ra), (rb)))
88
89#define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base) 79#define SAVE_2GPRS(n, base) SAVE_GPR(n, base); SAVE_GPR(n+1, base)
90#define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base) 80#define SAVE_4GPRS(n, base) SAVE_2GPRS(n, base); SAVE_2GPRS(n+2, base)
91#define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base) 81#define SAVE_8GPRS(n, base) SAVE_4GPRS(n, base); SAVE_4GPRS(n+4, base)
diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h
index cdb6fd814de8..7f065e178ec4 100644
--- a/arch/powerpc/include/asm/ps3.h
+++ b/arch/powerpc/include/asm/ps3.h
@@ -53,6 +53,13 @@ enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void);
53extern u64 ps3_os_area_get_rtc_diff(void); 53extern u64 ps3_os_area_get_rtc_diff(void);
54extern void ps3_os_area_set_rtc_diff(u64 rtc_diff); 54extern void ps3_os_area_set_rtc_diff(u64 rtc_diff);
55 55
56struct ps3_os_area_flash_ops {
57 ssize_t (*read)(void *buf, size_t count, loff_t pos);
58 ssize_t (*write)(const void *buf, size_t count, loff_t pos);
59};
60
61extern void ps3_os_area_flash_register(const struct ps3_os_area_flash_ops *ops);
62
56/* dma routines */ 63/* dma routines */
57 64
58enum ps3_dma_page_size { 65enum ps3_dma_page_size {
@@ -418,15 +425,15 @@ static inline struct ps3_system_bus_driver *
418 * @data: Data to set 425 * @data: Data to set
419 */ 426 */
420 427
421static inline void ps3_system_bus_set_driver_data( 428static inline void ps3_system_bus_set_drvdata(
422 struct ps3_system_bus_device *dev, void *data) 429 struct ps3_system_bus_device *dev, void *data)
423{ 430{
424 dev->core.driver_data = data; 431 dev_set_drvdata(&dev->core, data);
425} 432}
426static inline void *ps3_system_bus_get_driver_data( 433static inline void *ps3_system_bus_get_drvdata(
427 struct ps3_system_bus_device *dev) 434 struct ps3_system_bus_device *dev)
428{ 435{
429 return dev->core.driver_data; 436 return dev_get_drvdata(&dev->core);
430} 437}
431 438
432/* These two need global scope for get_dma_ops(). */ 439/* These two need global scope for get_dma_ops(). */
@@ -520,7 +527,4 @@ void ps3_sync_irq(int node);
520u32 ps3_get_hw_thread_id(int cpu); 527u32 ps3_get_hw_thread_id(int cpu);
521u64 ps3_get_spe_id(void *arg); 528u64 ps3_get_spe_id(void *arg);
522 529
523/* mutex synchronizing GPU accesses and video mode changes */
524extern struct mutex ps3_gpu_mutex;
525
526#endif 530#endif
diff --git a/arch/powerpc/include/asm/ps3gpu.h b/arch/powerpc/include/asm/ps3gpu.h
new file mode 100644
index 000000000000..b2b89591907c
--- /dev/null
+++ b/arch/powerpc/include/asm/ps3gpu.h
@@ -0,0 +1,86 @@
1/*
2 * PS3 GPU declarations.
3 *
4 * Copyright 2009 Sony Corporation
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; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program.
17 * If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef _ASM_POWERPC_PS3GPU_H
21#define _ASM_POWERPC_PS3GPU_H
22
23#include <linux/mutex.h>
24
25#include <asm/lv1call.h>
26
27
28#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC 0x101
29#define L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP 0x102
30
31#define L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP 0x600
32#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT 0x601
33#define L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT_SYNC 0x602
34#define L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE 0x603
35
36#define L1GPU_FB_BLIT_WAIT_FOR_COMPLETION (1ULL << 32)
37
38#define L1GPU_DISPLAY_SYNC_HSYNC 1
39#define L1GPU_DISPLAY_SYNC_VSYNC 2
40
41
42/* mutex synchronizing GPU accesses and video mode changes */
43extern struct mutex ps3_gpu_mutex;
44
45
46static inline int lv1_gpu_display_sync(u64 context_handle, u64 head,
47 u64 ddr_offset)
48{
49 return lv1_gpu_context_attribute(context_handle,
50 L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,
51 head, ddr_offset, 0, 0);
52}
53
54static inline int lv1_gpu_display_flip(u64 context_handle, u64 head,
55 u64 ddr_offset)
56{
57 return lv1_gpu_context_attribute(context_handle,
58 L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP,
59 head, ddr_offset, 0, 0);
60}
61
62static inline int lv1_gpu_fb_setup(u64 context_handle, u64 xdr_lpar,
63 u64 xdr_size, u64 ioif_offset)
64{
65 return lv1_gpu_context_attribute(context_handle,
66 L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP,
67 xdr_lpar, xdr_size, ioif_offset, 0);
68}
69
70static inline int lv1_gpu_fb_blit(u64 context_handle, u64 ddr_offset,
71 u64 ioif_offset, u64 sync_width, u64 pitch)
72{
73 return lv1_gpu_context_attribute(context_handle,
74 L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT,
75 ddr_offset, ioif_offset, sync_width,
76 pitch);
77}
78
79static inline int lv1_gpu_fb_close(u64 context_handle)
80{
81 return lv1_gpu_context_attribute(context_handle,
82 L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE, 0,
83 0, 0, 0);
84}
85
86#endif /* _ASM_POWERPC_PS3GPU_H */
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index c9c678fb2538..8c341490cfc5 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -135,7 +135,9 @@ do { \
135 * These are defined as per linux/ptrace.h, which see. 135 * These are defined as per linux/ptrace.h, which see.
136 */ 136 */
137#define arch_has_single_step() (1) 137#define arch_has_single_step() (1)
138#define arch_has_block_step() (!cpu_has_feature(CPU_FTR_601))
138extern void user_enable_single_step(struct task_struct *); 139extern void user_enable_single_step(struct task_struct *);
140extern void user_enable_block_step(struct task_struct *);
139extern void user_disable_single_step(struct task_struct *); 141extern void user_disable_single_step(struct task_struct *);
140 142
141#endif /* __ASSEMBLY__ */ 143#endif /* __ASSEMBLY__ */
@@ -288,4 +290,6 @@ extern void user_disable_single_step(struct task_struct *);
288#define PPC_PTRACE_PEEKUSR_3264 0x91 290#define PPC_PTRACE_PEEKUSR_3264 0x91
289#define PPC_PTRACE_POKEUSR_3264 0x90 291#define PPC_PTRACE_POKEUSR_3264 0x90
290 292
293#define PTRACE_SINGLEBLOCK 0x100 /* resume execution until next branch */
294
291#endif /* _ASM_POWERPC_PTRACE_H */ 295#endif /* _ASM_POWERPC_PTRACE_H */
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h
index 2701753d9937..157c5ca581c8 100644
--- a/arch/powerpc/include/asm/qe.h
+++ b/arch/powerpc/include/asm/qe.h
@@ -22,7 +22,7 @@
22#include <asm/cpm.h> 22#include <asm/cpm.h>
23#include <asm/immap_qe.h> 23#include <asm/immap_qe.h>
24 24
25#define QE_NUM_OF_SNUM 28 25#define QE_NUM_OF_SNUM 256 /* There are 256 serial number in QE */
26#define QE_NUM_OF_BRGS 16 26#define QE_NUM_OF_BRGS 16
27#define QE_NUM_OF_PORTS 1024 27#define QE_NUM_OF_PORTS 1024
28 28
@@ -152,6 +152,9 @@ unsigned int qe_get_brg_clk(void);
152int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier); 152int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
153int qe_get_snum(void); 153int qe_get_snum(void);
154void qe_put_snum(u8 snum); 154void qe_put_snum(u8 snum);
155unsigned int qe_get_num_of_risc(void);
156unsigned int qe_get_num_of_snums(void);
157
155/* we actually use cpm_muram implementation, define this for convenience */ 158/* we actually use cpm_muram implementation, define this for convenience */
156#define qe_muram_init cpm_muram_init 159#define qe_muram_init cpm_muram_init
157#define qe_muram_alloc cpm_muram_alloc 160#define qe_muram_alloc cpm_muram_alloc
@@ -231,12 +234,16 @@ struct qe_bd {
231#define QE_ALIGNMENT_OF_PRAM 64 234#define QE_ALIGNMENT_OF_PRAM 64
232 235
233/* RISC allocation */ 236/* RISC allocation */
234enum qe_risc_allocation { 237#define QE_RISC_ALLOCATION_RISC1 0x1 /* RISC 1 */
235 QE_RISC_ALLOCATION_RISC1 = 1, /* RISC 1 */ 238#define QE_RISC_ALLOCATION_RISC2 0x2 /* RISC 2 */
236 QE_RISC_ALLOCATION_RISC2 = 2, /* RISC 2 */ 239#define QE_RISC_ALLOCATION_RISC3 0x4 /* RISC 3 */
237 QE_RISC_ALLOCATION_RISC1_AND_RISC2 = 3 /* Dynamically choose 240#define QE_RISC_ALLOCATION_RISC4 0x8 /* RISC 4 */
238 RISC 1 or RISC 2 */ 241#define QE_RISC_ALLOCATION_RISC1_AND_RISC2 (QE_RISC_ALLOCATION_RISC1 | \
239}; 242 QE_RISC_ALLOCATION_RISC2)
243#define QE_RISC_ALLOCATION_FOUR_RISCS (QE_RISC_ALLOCATION_RISC1 | \
244 QE_RISC_ALLOCATION_RISC2 | \
245 QE_RISC_ALLOCATION_RISC3 | \
246 QE_RISC_ALLOCATION_RISC4)
240 247
241/* QE extended filtering Table Lookup Key Size */ 248/* QE extended filtering Table Lookup Key Size */
242enum qe_fltr_tbl_lookup_key_size { 249enum qe_fltr_tbl_lookup_key_size {
@@ -668,6 +675,8 @@ struct ucc_slow_pram {
668#define UCC_GETH_UPSMR_RMM 0x00001000 675#define UCC_GETH_UPSMR_RMM 0x00001000
669#define UCC_GETH_UPSMR_CAM 0x00000400 676#define UCC_GETH_UPSMR_CAM 0x00000400
670#define UCC_GETH_UPSMR_BRO 0x00000200 677#define UCC_GETH_UPSMR_BRO 0x00000200
678#define UCC_GETH_UPSMR_SMM 0x00000080
679#define UCC_GETH_UPSMR_SGMM 0x00000020
671 680
672/* UCC Transmit On Demand Register (UTODR) */ 681/* UCC Transmit On Demand Register (UTODR) */
673#define UCC_SLOW_TOD 0x8000 682#define UCC_SLOW_TOD 0x8000
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index fb359b0a6937..a3c28e46947c 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -745,11 +745,11 @@
745 asm volatile("mfmsr %0" : "=r" (rval)); rval;}) 745 asm volatile("mfmsr %0" : "=r" (rval)); rval;})
746#ifdef CONFIG_PPC64 746#ifdef CONFIG_PPC64
747#define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ 747#define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \
748 : : "r" (v)) 748 : : "r" (v) : "memory")
749#define mtmsrd(v) __mtmsrd((v), 0) 749#define mtmsrd(v) __mtmsrd((v), 0)
750#define mtmsr(v) mtmsrd(v) 750#define mtmsr(v) mtmsrd(v)
751#else 751#else
752#define mtmsr(v) asm volatile("mtmsr %0" : : "r" (v)) 752#define mtmsr(v) asm volatile("mtmsr %0" : : "r" (v) : "memory")
753#endif 753#endif
754 754
755#define mfspr(rn) ({unsigned long rval; \ 755#define mfspr(rn) ({unsigned long rval; \
diff --git a/arch/powerpc/include/asm/scatterlist.h b/arch/powerpc/include/asm/scatterlist.h
index fcf7d55afe45..912bf597870f 100644
--- a/arch/powerpc/include/asm/scatterlist.h
+++ b/arch/powerpc/include/asm/scatterlist.h
@@ -21,7 +21,7 @@ struct scatterlist {
21 unsigned int offset; 21 unsigned int offset;
22 unsigned int length; 22 unsigned int length;
23 23
24 /* For TCE support */ 24 /* For TCE or SWIOTLB support */
25 dma_addr_t dma_address; 25 dma_addr_t dma_address;
26 u32 dma_length; 26 u32 dma_length;
27}; 27};
@@ -34,11 +34,7 @@ struct scatterlist {
34 * is 0. 34 * is 0.
35 */ 35 */
36#define sg_dma_address(sg) ((sg)->dma_address) 36#define sg_dma_address(sg) ((sg)->dma_address)
37#ifdef __powerpc64__
38#define sg_dma_len(sg) ((sg)->dma_length) 37#define sg_dma_len(sg) ((sg)->dma_length)
39#else
40#define sg_dma_len(sg) ((sg)->length)
41#endif
42 38
43#ifdef __powerpc64__ 39#ifdef __powerpc64__
44#define ISA_DMA_THRESHOLD (~0UL) 40#define ISA_DMA_THRESHOLD (~0UL)
diff --git a/arch/powerpc/include/asm/swiotlb.h b/arch/powerpc/include/asm/swiotlb.h
new file mode 100644
index 000000000000..30891d6e2bc1
--- /dev/null
+++ b/arch/powerpc/include/asm/swiotlb.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2009 Becky Bruce, Freescale Semiconductor
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 */
10
11#ifndef __ASM_SWIOTLB_H
12#define __ASM_SWIOTLB_H
13
14#include <linux/swiotlb.h>
15
16extern struct dma_mapping_ops swiotlb_dma_ops;
17extern struct dma_mapping_ops swiotlb_pci_dma_ops;
18
19int swiotlb_arch_address_needs_mapping(struct device *, dma_addr_t,
20 size_t size);
21
22static inline void dma_mark_clean(void *addr, size_t size) {}
23
24extern unsigned int ppc_swiotlb_enable;
25int __init swiotlb_setup_bus_notifier(void);
26
27#endif /* __ASM_SWIOTLB_H */
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index a0b92de51c7e..370600ca2765 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -325,3 +325,4 @@ SYSCALL(inotify_init1)
325SYSCALL_SPU(perf_counter_open) 325SYSCALL_SPU(perf_counter_open)
326COMPAT_SYS_SPU(preadv) 326COMPAT_SYS_SPU(preadv)
327COMPAT_SYS_SPU(pwritev) 327COMPAT_SYS_SPU(pwritev)
328COMPAT_SYS(rt_tgsigqueueinfo)
diff --git a/arch/powerpc/include/asm/system.h b/arch/powerpc/include/asm/system.h
index 2b2420a49884..bb8e006a47c6 100644
--- a/arch/powerpc/include/asm/system.h
+++ b/arch/powerpc/include/asm/system.h
@@ -211,7 +211,7 @@ extern struct task_struct *_switch(struct thread_struct *prev,
211 211
212extern unsigned int rtas_data; 212extern unsigned int rtas_data;
213extern int mem_init_done; /* set on boot once kmalloc can be called */ 213extern int mem_init_done; /* set on boot once kmalloc can be called */
214extern int init_bootmem_done; /* set on !NUMA once bootmem is available */ 214extern int init_bootmem_done; /* set once bootmem is available */
215extern phys_addr_t memory_limit; 215extern phys_addr_t memory_limit;
216extern unsigned long klimit; 216extern unsigned long klimit;
217 217
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index 4badac2d11d1..cef080bfc607 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -344,10 +344,11 @@
344#define __NR_perf_counter_open 319 344#define __NR_perf_counter_open 319
345#define __NR_preadv 320 345#define __NR_preadv 320
346#define __NR_pwritev 321 346#define __NR_pwritev 321
347#define __NR_rt_tgsigqueueinfo 322
347 348
348#ifdef __KERNEL__ 349#ifdef __KERNEL__
349 350
350#define __NR_syscalls 322 351#define __NR_syscalls 323
351 352
352#define __NR__exit __NR_exit 353#define __NR__exit __NR_exit
353#define NR_syscalls __NR_syscalls 354#define NR_syscalls __NR_syscalls
diff --git a/arch/powerpc/include/asm/xilinx_pci.h b/arch/powerpc/include/asm/xilinx_pci.h
new file mode 100644
index 000000000000..7a8275caf6af
--- /dev/null
+++ b/arch/powerpc/include/asm/xilinx_pci.h
@@ -0,0 +1,21 @@
1/*
2 * Xilinx pci external definitions
3 *
4 * Copyright 2009 Roderick Colenbrander
5 * Copyright 2009 Secret Lab Technologies Ltd.
6 *
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
9 * kind, whether express or implied.
10 */
11
12#ifndef INCLUDE_XILINX_PCI
13#define INCLUDE_XILINX_PCI
14
15#ifdef CONFIG_XILINX_PCI
16extern void __init xilinx_pci_init(void);
17#else
18static inline void __init xilinx_pci_init(void) { return; }
19#endif
20
21#endif /* INCLUDE_XILINX_PCI */
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index a2c683403c2b..612b0c4dc26d 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -36,7 +36,7 @@ obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \
36 firmware.o nvram_64.o 36 firmware.o nvram_64.o
37obj64-$(CONFIG_RELOCATABLE) += reloc_64.o 37obj64-$(CONFIG_RELOCATABLE) += reloc_64.o
38obj-$(CONFIG_PPC64) += vdso64/ 38obj-$(CONFIG_PPC64) += vdso64/
39obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o 39obj-$(CONFIG_ALTIVEC) += vecemu.o
40obj-$(CONFIG_PPC_970_NAP) += idle_power4.o 40obj-$(CONFIG_PPC_970_NAP) += idle_power4.o
41obj-$(CONFIG_PPC_OF) += of_device.o of_platform.o prom_parse.o 41obj-$(CONFIG_PPC_OF) += of_device.o of_platform.o prom_parse.o
42obj-$(CONFIG_PPC_CLOCK) += clock.o 42obj-$(CONFIG_PPC_CLOCK) += clock.o
@@ -82,6 +82,7 @@ obj-$(CONFIG_SMP) += smp.o
82obj-$(CONFIG_KPROBES) += kprobes.o 82obj-$(CONFIG_KPROBES) += kprobes.o
83obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o 83obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
84obj-$(CONFIG_STACKTRACE) += stacktrace.o 84obj-$(CONFIG_STACKTRACE) += stacktrace.o
85obj-$(CONFIG_SWIOTLB) += dma-swiotlb.o
85 86
86pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o 87pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o
87obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \ 88obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
@@ -111,6 +112,7 @@ obj-y += ppc_save_regs.o
111endif 112endif
112 113
113extra-$(CONFIG_PPC_FPU) += fpu.o 114extra-$(CONFIG_PPC_FPU) += fpu.o
115extra-$(CONFIG_ALTIVEC) += vector.o
114extra-$(CONFIG_PPC64) += entry_64.o 116extra-$(CONFIG_PPC64) += entry_64.o
115 117
116extra-y += systbl_chk.i 118extra-y += systbl_chk.i
@@ -123,6 +125,7 @@ PHONY += systbl_chk
123systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i 125systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
124 $(call cmd,systbl_chk) 126 $(call cmd,systbl_chk)
125 127
128ifeq ($(CONFIG_PPC_OF_BOOT_TRAMPOLINE),y)
126$(obj)/built-in.o: prom_init_check 129$(obj)/built-in.o: prom_init_check
127 130
128quiet_cmd_prom_init_check = CALL $< 131quiet_cmd_prom_init_check = CALL $<
@@ -131,5 +134,6 @@ quiet_cmd_prom_init_check = CALL $<
131PHONY += prom_init_check 134PHONY += prom_init_check
132prom_init_check: $(src)/prom_init_check.sh $(obj)/prom_init.o 135prom_init_check: $(src)/prom_init_check.sh $(obj)/prom_init.o
133 $(call cmd,prom_init_check) 136 $(call cmd,prom_init_check)
137endif
134 138
135clean-files := vmlinux.lds 139clean-files := vmlinux.lds
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 5ffcfaa77d6a..a5b632e52fae 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -24,6 +24,7 @@
24#include <asm/system.h> 24#include <asm/system.h>
25#include <asm/cache.h> 25#include <asm/cache.h>
26#include <asm/cputable.h> 26#include <asm/cputable.h>
27#include <asm/emulated_ops.h>
27 28
28struct aligninfo { 29struct aligninfo {
29 unsigned char len; 30 unsigned char len;
@@ -730,8 +731,10 @@ int fix_alignment(struct pt_regs *regs)
730 areg = dsisr & 0x1f; /* register to update */ 731 areg = dsisr & 0x1f; /* register to update */
731 732
732#ifdef CONFIG_SPE 733#ifdef CONFIG_SPE
733 if ((instr >> 26) == 0x4) 734 if ((instr >> 26) == 0x4) {
735 PPC_WARN_EMULATED(spe);
734 return emulate_spe(regs, reg, instr); 736 return emulate_spe(regs, reg, instr);
737 }
735#endif 738#endif
736 739
737 instr = (dsisr >> 10) & 0x7f; 740 instr = (dsisr >> 10) & 0x7f;
@@ -783,23 +786,28 @@ int fix_alignment(struct pt_regs *regs)
783 flags |= SPLT; 786 flags |= SPLT;
784 nb = 8; 787 nb = 8;
785 } 788 }
789 PPC_WARN_EMULATED(vsx);
786 return emulate_vsx(addr, reg, areg, regs, flags, nb); 790 return emulate_vsx(addr, reg, areg, regs, flags, nb);
787 } 791 }
788#endif 792#endif
789 /* A size of 0 indicates an instruction we don't support, with 793 /* A size of 0 indicates an instruction we don't support, with
790 * the exception of DCBZ which is handled as a special case here 794 * the exception of DCBZ which is handled as a special case here
791 */ 795 */
792 if (instr == DCBZ) 796 if (instr == DCBZ) {
797 PPC_WARN_EMULATED(dcbz);
793 return emulate_dcbz(regs, addr); 798 return emulate_dcbz(regs, addr);
799 }
794 if (unlikely(nb == 0)) 800 if (unlikely(nb == 0))
795 return 0; 801 return 0;
796 802
797 /* Load/Store Multiple instructions are handled in their own 803 /* Load/Store Multiple instructions are handled in their own
798 * function 804 * function
799 */ 805 */
800 if (flags & M) 806 if (flags & M) {
807 PPC_WARN_EMULATED(multiple);
801 return emulate_multiple(regs, addr, reg, nb, 808 return emulate_multiple(regs, addr, reg, nb,
802 flags, instr, swiz); 809 flags, instr, swiz);
810 }
803 811
804 /* Verify the address of the operand */ 812 /* Verify the address of the operand */
805 if (unlikely(user_mode(regs) && 813 if (unlikely(user_mode(regs) &&
@@ -816,8 +824,12 @@ int fix_alignment(struct pt_regs *regs)
816 } 824 }
817 825
818 /* Special case for 16-byte FP loads and stores */ 826 /* Special case for 16-byte FP loads and stores */
819 if (nb == 16) 827 if (nb == 16) {
828 PPC_WARN_EMULATED(fp_pair);
820 return emulate_fp_pair(addr, reg, flags); 829 return emulate_fp_pair(addr, reg, flags);
830 }
831
832 PPC_WARN_EMULATED(unaligned);
821 833
822 /* If we are loading, get the data from user space, else 834 /* If we are loading, get the data from user space, else
823 * get it from register values 835 * get it from register values
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index e981d1ce1914..561b64652311 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -122,8 +122,6 @@ int main(void)
122 DEFINE(PACAKSAVE, offsetof(struct paca_struct, kstack)); 122 DEFINE(PACAKSAVE, offsetof(struct paca_struct, kstack));
123 DEFINE(PACACURRENT, offsetof(struct paca_struct, __current)); 123 DEFINE(PACACURRENT, offsetof(struct paca_struct, __current));
124 DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, saved_msr)); 124 DEFINE(PACASAVEDMSR, offsetof(struct paca_struct, saved_msr));
125 DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real));
126 DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr));
127 DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr)); 125 DEFINE(PACASTABRR, offsetof(struct paca_struct, stab_rr));
128 DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1)); 126 DEFINE(PACAR1, offsetof(struct paca_struct, saved_r1));
129 DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc)); 127 DEFINE(PACATOC, offsetof(struct paca_struct, kernel_toc));
@@ -132,35 +130,30 @@ int main(void)
132 DEFINE(PACASOFTIRQEN, offsetof(struct paca_struct, soft_enabled)); 130 DEFINE(PACASOFTIRQEN, offsetof(struct paca_struct, soft_enabled));
133 DEFINE(PACAHARDIRQEN, offsetof(struct paca_struct, hard_enabled)); 131 DEFINE(PACAHARDIRQEN, offsetof(struct paca_struct, hard_enabled));
134 DEFINE(PACAPERFPEND, offsetof(struct paca_struct, perf_counter_pending)); 132 DEFINE(PACAPERFPEND, offsetof(struct paca_struct, perf_counter_pending));
135 DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
136 DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
137 DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id)); 133 DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
138 DEFINE(PACAVMALLOCSLLP, offsetof(struct paca_struct, vmalloc_sllp));
139#ifdef CONFIG_PPC_MM_SLICES 134#ifdef CONFIG_PPC_MM_SLICES
140 DEFINE(PACALOWSLICESPSIZE, offsetof(struct paca_struct, 135 DEFINE(PACALOWSLICESPSIZE, offsetof(struct paca_struct,
141 context.low_slices_psize)); 136 context.low_slices_psize));
142 DEFINE(PACAHIGHSLICEPSIZE, offsetof(struct paca_struct, 137 DEFINE(PACAHIGHSLICEPSIZE, offsetof(struct paca_struct,
143 context.high_slices_psize)); 138 context.high_slices_psize));
144 DEFINE(MMUPSIZEDEFSIZE, sizeof(struct mmu_psize_def)); 139 DEFINE(MMUPSIZEDEFSIZE, sizeof(struct mmu_psize_def));
140#endif /* CONFIG_PPC_MM_SLICES */
141#ifdef CONFIG_PPC_STD_MMU_64
142 DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real));
143 DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr));
144 DEFINE(PACASLBCACHE, offsetof(struct paca_struct, slb_cache));
145 DEFINE(PACASLBCACHEPTR, offsetof(struct paca_struct, slb_cache_ptr));
146 DEFINE(PACAVMALLOCSLLP, offsetof(struct paca_struct, vmalloc_sllp));
147#ifdef CONFIG_PPC_MM_SLICES
145 DEFINE(MMUPSIZESLLP, offsetof(struct mmu_psize_def, sllp)); 148 DEFINE(MMUPSIZESLLP, offsetof(struct mmu_psize_def, sllp));
146#else 149#else
147 DEFINE(PACACONTEXTSLLP, offsetof(struct paca_struct, context.sllp)); 150 DEFINE(PACACONTEXTSLLP, offsetof(struct paca_struct, context.sllp));
148
149#endif /* CONFIG_PPC_MM_SLICES */ 151#endif /* CONFIG_PPC_MM_SLICES */
150 DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen)); 152 DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen));
151 DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc)); 153 DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc));
152 DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb)); 154 DEFINE(PACA_EXSLB, offsetof(struct paca_struct, exslb));
153 DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
154 DEFINE(PACALPPACAPTR, offsetof(struct paca_struct, lppaca_ptr)); 155 DEFINE(PACALPPACAPTR, offsetof(struct paca_struct, lppaca_ptr));
155 DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
156 DEFINE(PACA_STARTPURR, offsetof(struct paca_struct, startpurr));
157 DEFINE(PACA_STARTSPURR, offsetof(struct paca_struct, startspurr));
158 DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time));
159 DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time));
160 DEFINE(PACA_SLBSHADOWPTR, offsetof(struct paca_struct, slb_shadow_ptr)); 156 DEFINE(PACA_SLBSHADOWPTR, offsetof(struct paca_struct, slb_shadow_ptr));
161 DEFINE(PACA_DATA_OFFSET, offsetof(struct paca_struct, data_offset));
162 DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save));
163
164 DEFINE(SLBSHADOW_STACKVSID, 157 DEFINE(SLBSHADOW_STACKVSID,
165 offsetof(struct slb_shadow, save_area[SLB_NUM_BOLTED - 1].vsid)); 158 offsetof(struct slb_shadow, save_area[SLB_NUM_BOLTED - 1].vsid));
166 DEFINE(SLBSHADOW_STACKESID, 159 DEFINE(SLBSHADOW_STACKESID,
@@ -170,6 +163,15 @@ int main(void)
170 DEFINE(LPPACAANYINT, offsetof(struct lppaca, int_dword.any_int)); 163 DEFINE(LPPACAANYINT, offsetof(struct lppaca, int_dword.any_int));
171 DEFINE(LPPACADECRINT, offsetof(struct lppaca, int_dword.fields.decr_int)); 164 DEFINE(LPPACADECRINT, offsetof(struct lppaca, int_dword.fields.decr_int));
172 DEFINE(SLBSHADOW_SAVEAREA, offsetof(struct slb_shadow, save_area)); 165 DEFINE(SLBSHADOW_SAVEAREA, offsetof(struct slb_shadow, save_area));
166#endif /* CONFIG_PPC_STD_MMU_64 */
167 DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp));
168 DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
169 DEFINE(PACA_STARTPURR, offsetof(struct paca_struct, startpurr));
170 DEFINE(PACA_STARTSPURR, offsetof(struct paca_struct, startspurr));
171 DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time));
172 DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time));
173 DEFINE(PACA_DATA_OFFSET, offsetof(struct paca_struct, data_offset));
174 DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save));
173#endif /* CONFIG_PPC64 */ 175#endif /* CONFIG_PPC64 */
174 176
175 /* RTAS */ 177 /* RTAS */
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 3e33fb933d99..4a24a2fc4574 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -427,7 +427,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
427 .cpu_name = "POWER7 (architected)", 427 .cpu_name = "POWER7 (architected)",
428 .cpu_features = CPU_FTRS_POWER7, 428 .cpu_features = CPU_FTRS_POWER7,
429 .cpu_user_features = COMMON_USER_POWER7, 429 .cpu_user_features = COMMON_USER_POWER7,
430 .mmu_features = MMU_FTR_HPTE_TABLE, 430 .mmu_features = MMU_FTR_HPTE_TABLE |
431 MMU_FTR_TLBIE_206,
431 .icache_bsize = 128, 432 .icache_bsize = 128,
432 .dcache_bsize = 128, 433 .dcache_bsize = 128,
433 .machine_check = machine_check_generic, 434 .machine_check = machine_check_generic,
@@ -441,7 +442,8 @@ static struct cpu_spec __initdata cpu_specs[] = {
441 .cpu_name = "POWER7 (raw)", 442 .cpu_name = "POWER7 (raw)",
442 .cpu_features = CPU_FTRS_POWER7, 443 .cpu_features = CPU_FTRS_POWER7,
443 .cpu_user_features = COMMON_USER_POWER7, 444 .cpu_user_features = COMMON_USER_POWER7,
444 .mmu_features = MMU_FTR_HPTE_TABLE, 445 .mmu_features = MMU_FTR_HPTE_TABLE |
446 MMU_FTR_TLBIE_206,
445 .icache_bsize = 128, 447 .icache_bsize = 128,
446 .dcache_bsize = 128, 448 .dcache_bsize = 128,
447 .num_pmcs = 6, 449 .num_pmcs = 6,
diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
new file mode 100644
index 000000000000..68ccf11e4f19
--- /dev/null
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -0,0 +1,163 @@
1/*
2 * Contains routines needed to support swiotlb for ppc.
3 *
4 * Copyright (C) 2009 Becky Bruce, Freescale Semiconductor
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
13#include <linux/dma-mapping.h>
14#include <linux/pfn.h>
15#include <linux/of_platform.h>
16#include <linux/platform_device.h>
17#include <linux/pci.h>
18
19#include <asm/machdep.h>
20#include <asm/swiotlb.h>
21#include <asm/dma.h>
22#include <asm/abs_addr.h>
23
24int swiotlb __read_mostly;
25unsigned int ppc_swiotlb_enable;
26
27void *swiotlb_bus_to_virt(struct device *hwdev, dma_addr_t addr)
28{
29 unsigned long pfn = PFN_DOWN(swiotlb_bus_to_phys(hwdev, addr));
30 void *pageaddr = page_address(pfn_to_page(pfn));
31
32 if (pageaddr != NULL)
33 return pageaddr + (addr % PAGE_SIZE);
34 return NULL;
35}
36
37dma_addr_t swiotlb_phys_to_bus(struct device *hwdev, phys_addr_t paddr)
38{
39 return paddr + get_dma_direct_offset(hwdev);
40}
41
42phys_addr_t swiotlb_bus_to_phys(struct device *hwdev, dma_addr_t baddr)
43
44{
45 return baddr - get_dma_direct_offset(hwdev);
46}
47
48/*
49 * Determine if an address needs bounce buffering via swiotlb.
50 * Going forward I expect the swiotlb code to generalize on using
51 * a dma_ops->addr_needs_map, and this function will move from here to the
52 * generic swiotlb code.
53 */
54int
55swiotlb_arch_address_needs_mapping(struct device *hwdev, dma_addr_t addr,
56 size_t size)
57{
58 struct dma_mapping_ops *dma_ops = get_dma_ops(hwdev);
59
60 BUG_ON(!dma_ops);
61 return dma_ops->addr_needs_map(hwdev, addr, size);
62}
63
64/*
65 * Determine if an address is reachable by a pci device, or if we must bounce.
66 */
67static int
68swiotlb_pci_addr_needs_map(struct device *hwdev, dma_addr_t addr, size_t size)
69{
70 u64 mask = dma_get_mask(hwdev);
71 dma_addr_t max;
72 struct pci_controller *hose;
73 struct pci_dev *pdev = to_pci_dev(hwdev);
74
75 hose = pci_bus_to_host(pdev->bus);
76 max = hose->dma_window_base_cur + hose->dma_window_size;
77
78 /* check that we're within mapped pci window space */
79 if ((addr + size > max) | (addr < hose->dma_window_base_cur))
80 return 1;
81
82 return !is_buffer_dma_capable(mask, addr, size);
83}
84
85static int
86swiotlb_addr_needs_map(struct device *hwdev, dma_addr_t addr, size_t size)
87{
88 return !is_buffer_dma_capable(dma_get_mask(hwdev), addr, size);
89}
90
91
92/*
93 * At the moment, all platforms that use this code only require
94 * swiotlb to be used if we're operating on HIGHMEM. Since
95 * we don't ever call anything other than map_sg, unmap_sg,
96 * map_page, and unmap_page on highmem, use normal dma_ops
97 * for everything else.
98 */
99struct dma_mapping_ops swiotlb_dma_ops = {
100 .alloc_coherent = dma_direct_alloc_coherent,
101 .free_coherent = dma_direct_free_coherent,
102 .map_sg = swiotlb_map_sg_attrs,
103 .unmap_sg = swiotlb_unmap_sg_attrs,
104 .dma_supported = swiotlb_dma_supported,
105 .map_page = swiotlb_map_page,
106 .unmap_page = swiotlb_unmap_page,
107 .addr_needs_map = swiotlb_addr_needs_map,
108 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
109 .sync_single_range_for_device = swiotlb_sync_single_range_for_device,
110 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
111 .sync_sg_for_device = swiotlb_sync_sg_for_device
112};
113
114struct dma_mapping_ops swiotlb_pci_dma_ops = {
115 .alloc_coherent = dma_direct_alloc_coherent,
116 .free_coherent = dma_direct_free_coherent,
117 .map_sg = swiotlb_map_sg_attrs,
118 .unmap_sg = swiotlb_unmap_sg_attrs,
119 .dma_supported = swiotlb_dma_supported,
120 .map_page = swiotlb_map_page,
121 .unmap_page = swiotlb_unmap_page,
122 .addr_needs_map = swiotlb_pci_addr_needs_map,
123 .sync_single_range_for_cpu = swiotlb_sync_single_range_for_cpu,
124 .sync_single_range_for_device = swiotlb_sync_single_range_for_device,
125 .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu,
126 .sync_sg_for_device = swiotlb_sync_sg_for_device
127};
128
129static int ppc_swiotlb_bus_notify(struct notifier_block *nb,
130 unsigned long action, void *data)
131{
132 struct device *dev = data;
133
134 /* We are only intereted in device addition */
135 if (action != BUS_NOTIFY_ADD_DEVICE)
136 return 0;
137
138 /* May need to bounce if the device can't address all of DRAM */
139 if (dma_get_mask(dev) < lmb_end_of_DRAM())
140 set_dma_ops(dev, &swiotlb_dma_ops);
141
142 return NOTIFY_DONE;
143}
144
145static struct notifier_block ppc_swiotlb_plat_bus_notifier = {
146 .notifier_call = ppc_swiotlb_bus_notify,
147 .priority = 0,
148};
149
150static struct notifier_block ppc_swiotlb_of_bus_notifier = {
151 .notifier_call = ppc_swiotlb_bus_notify,
152 .priority = 0,
153};
154
155int __init swiotlb_setup_bus_notifier(void)
156{
157 bus_register_notifier(&platform_bus_type,
158 &ppc_swiotlb_plat_bus_notifier);
159 bus_register_notifier(&of_platform_bus_type,
160 &ppc_swiotlb_of_bus_notifier);
161
162 return 0;
163}
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index 6b02793dc75b..20a60d661ba8 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -19,7 +19,7 @@
19 * default the offset is PCI_DRAM_OFFSET. 19 * default the offset is PCI_DRAM_OFFSET.
20 */ 20 */
21 21
22static unsigned long get_dma_direct_offset(struct device *dev) 22unsigned long get_dma_direct_offset(struct device *dev)
23{ 23{
24 if (dev) 24 if (dev)
25 return (unsigned long)dev->archdata.dma_data; 25 return (unsigned long)dev->archdata.dma_data;
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
new file mode 100644
index 000000000000..eb898112e577
--- /dev/null
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -0,0 +1,978 @@
1/*
2 * This file contains the 64-bit "server" PowerPC variant
3 * of the low level exception handling including exception
4 * vectors, exception return, part of the slb and stab
5 * handling and other fixed offset specific things.
6 *
7 * This file is meant to be #included from head_64.S due to
8 * position dependant assembly.
9 *
10 * Most of this originates from head_64.S and thus has the same
11 * copyright history.
12 *
13 */
14
15/*
16 * We layout physical memory as follows:
17 * 0x0000 - 0x00ff : Secondary processor spin code
18 * 0x0100 - 0x2fff : pSeries Interrupt prologs
19 * 0x3000 - 0x5fff : interrupt support, iSeries and common interrupt prologs
20 * 0x6000 - 0x6fff : Initial (CPU0) segment table
21 * 0x7000 - 0x7fff : FWNMI data area
22 * 0x8000 - : Early init and support code
23 */
24
25
26/*
27 * SPRG Usage
28 *
29 * Register Definition
30 *
31 * SPRG0 reserved for hypervisor
32 * SPRG1 temp - used to save gpr
33 * SPRG2 temp - used to save gpr
34 * SPRG3 virt addr of paca
35 */
36
37/*
38 * This is the start of the interrupt handlers for pSeries
39 * This code runs with relocation off.
40 * Code from here to __end_interrupts gets copied down to real
41 * address 0x100 when we are running a relocatable kernel.
42 * Therefore any relative branches in this section must only
43 * branch to labels in this section.
44 */
45 . = 0x100
46 .globl __start_interrupts
47__start_interrupts:
48
49 STD_EXCEPTION_PSERIES(0x100, system_reset)
50
51 . = 0x200
52_machine_check_pSeries:
53 HMT_MEDIUM
54 mtspr SPRN_SPRG1,r13 /* save r13 */
55 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
56
57 . = 0x300
58 .globl data_access_pSeries
59data_access_pSeries:
60 HMT_MEDIUM
61 mtspr SPRN_SPRG1,r13
62BEGIN_FTR_SECTION
63 mtspr SPRN_SPRG2,r12
64 mfspr r13,SPRN_DAR
65 mfspr r12,SPRN_DSISR
66 srdi r13,r13,60
67 rlwimi r13,r12,16,0x20
68 mfcr r12
69 cmpwi r13,0x2c
70 beq do_stab_bolted_pSeries
71 mtcrf 0x80,r12
72 mfspr r12,SPRN_SPRG2
73END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
74 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common)
75
76 . = 0x380
77 .globl data_access_slb_pSeries
78data_access_slb_pSeries:
79 HMT_MEDIUM
80 mtspr SPRN_SPRG1,r13
81 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
82 std r3,PACA_EXSLB+EX_R3(r13)
83 mfspr r3,SPRN_DAR
84 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
85 mfcr r9
86#ifdef __DISABLED__
87 /* Keep that around for when we re-implement dynamic VSIDs */
88 cmpdi r3,0
89 bge slb_miss_user_pseries
90#endif /* __DISABLED__ */
91 std r10,PACA_EXSLB+EX_R10(r13)
92 std r11,PACA_EXSLB+EX_R11(r13)
93 std r12,PACA_EXSLB+EX_R12(r13)
94 mfspr r10,SPRN_SPRG1
95 std r10,PACA_EXSLB+EX_R13(r13)
96 mfspr r12,SPRN_SRR1 /* and SRR1 */
97#ifndef CONFIG_RELOCATABLE
98 b .slb_miss_realmode
99#else
100 /*
101 * We can't just use a direct branch to .slb_miss_realmode
102 * because the distance from here to there depends on where
103 * the kernel ends up being put.
104 */
105 mfctr r11
106 ld r10,PACAKBASE(r13)
107 LOAD_HANDLER(r10, .slb_miss_realmode)
108 mtctr r10
109 bctr
110#endif
111
112 STD_EXCEPTION_PSERIES(0x400, instruction_access)
113
114 . = 0x480
115 .globl instruction_access_slb_pSeries
116instruction_access_slb_pSeries:
117 HMT_MEDIUM
118 mtspr SPRN_SPRG1,r13
119 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
120 std r3,PACA_EXSLB+EX_R3(r13)
121 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
122 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
123 mfcr r9
124#ifdef __DISABLED__
125 /* Keep that around for when we re-implement dynamic VSIDs */
126 cmpdi r3,0
127 bge slb_miss_user_pseries
128#endif /* __DISABLED__ */
129 std r10,PACA_EXSLB+EX_R10(r13)
130 std r11,PACA_EXSLB+EX_R11(r13)
131 std r12,PACA_EXSLB+EX_R12(r13)
132 mfspr r10,SPRN_SPRG1
133 std r10,PACA_EXSLB+EX_R13(r13)
134 mfspr r12,SPRN_SRR1 /* and SRR1 */
135#ifndef CONFIG_RELOCATABLE
136 b .slb_miss_realmode
137#else
138 mfctr r11
139 ld r10,PACAKBASE(r13)
140 LOAD_HANDLER(r10, .slb_miss_realmode)
141 mtctr r10
142 bctr
143#endif
144
145 MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt)
146 STD_EXCEPTION_PSERIES(0x600, alignment)
147 STD_EXCEPTION_PSERIES(0x700, program_check)
148 STD_EXCEPTION_PSERIES(0x800, fp_unavailable)
149 MASKABLE_EXCEPTION_PSERIES(0x900, decrementer)
150 STD_EXCEPTION_PSERIES(0xa00, trap_0a)
151 STD_EXCEPTION_PSERIES(0xb00, trap_0b)
152
153 . = 0xc00
154 .globl system_call_pSeries
155system_call_pSeries:
156 HMT_MEDIUM
157BEGIN_FTR_SECTION
158 cmpdi r0,0x1ebe
159 beq- 1f
160END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)
161 mr r9,r13
162 mfspr r13,SPRN_SPRG3
163 mfspr r11,SPRN_SRR0
164 ld r12,PACAKBASE(r13)
165 ld r10,PACAKMSR(r13)
166 LOAD_HANDLER(r12, system_call_entry)
167 mtspr SPRN_SRR0,r12
168 mfspr r12,SPRN_SRR1
169 mtspr SPRN_SRR1,r10
170 rfid
171 b . /* prevent speculative execution */
172
173/* Fast LE/BE switch system call */
1741: mfspr r12,SPRN_SRR1
175 xori r12,r12,MSR_LE
176 mtspr SPRN_SRR1,r12
177 rfid /* return to userspace */
178 b .
179
180 STD_EXCEPTION_PSERIES(0xd00, single_step)
181 STD_EXCEPTION_PSERIES(0xe00, trap_0e)
182
183 /* We need to deal with the Altivec unavailable exception
184 * here which is at 0xf20, thus in the middle of the
185 * prolog code of the PerformanceMonitor one. A little
186 * trickery is thus necessary
187 */
188 . = 0xf00
189 b performance_monitor_pSeries
190
191 . = 0xf20
192 b altivec_unavailable_pSeries
193
194 . = 0xf40
195 b vsx_unavailable_pSeries
196
197#ifdef CONFIG_CBE_RAS
198 HSTD_EXCEPTION_PSERIES(0x1200, cbe_system_error)
199#endif /* CONFIG_CBE_RAS */
200 STD_EXCEPTION_PSERIES(0x1300, instruction_breakpoint)
201#ifdef CONFIG_CBE_RAS
202 HSTD_EXCEPTION_PSERIES(0x1600, cbe_maintenance)
203#endif /* CONFIG_CBE_RAS */
204 STD_EXCEPTION_PSERIES(0x1700, altivec_assist)
205#ifdef CONFIG_CBE_RAS
206 HSTD_EXCEPTION_PSERIES(0x1800, cbe_thermal)
207#endif /* CONFIG_CBE_RAS */
208
209 . = 0x3000
210
211/*** pSeries interrupt support ***/
212
213 /* moved from 0xf00 */
214 STD_EXCEPTION_PSERIES(., performance_monitor)
215 STD_EXCEPTION_PSERIES(., altivec_unavailable)
216 STD_EXCEPTION_PSERIES(., vsx_unavailable)
217
218/*
219 * An interrupt came in while soft-disabled; clear EE in SRR1,
220 * clear paca->hard_enabled and return.
221 */
222masked_interrupt:
223 stb r10,PACAHARDIRQEN(r13)
224 mtcrf 0x80,r9
225 ld r9,PACA_EXGEN+EX_R9(r13)
226 mfspr r10,SPRN_SRR1
227 rldicl r10,r10,48,1 /* clear MSR_EE */
228 rotldi r10,r10,16
229 mtspr SPRN_SRR1,r10
230 ld r10,PACA_EXGEN+EX_R10(r13)
231 mfspr r13,SPRN_SPRG1
232 rfid
233 b .
234
235 .align 7
236do_stab_bolted_pSeries:
237 mtcrf 0x80,r12
238 mfspr r12,SPRN_SPRG2
239 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted)
240
241#ifdef CONFIG_PPC_PSERIES
242/*
243 * Vectors for the FWNMI option. Share common code.
244 */
245 .globl system_reset_fwnmi
246 .align 7
247system_reset_fwnmi:
248 HMT_MEDIUM
249 mtspr SPRN_SPRG1,r13 /* save r13 */
250 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
251
252 .globl machine_check_fwnmi
253 .align 7
254machine_check_fwnmi:
255 HMT_MEDIUM
256 mtspr SPRN_SPRG1,r13 /* save r13 */
257 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
258
259#endif /* CONFIG_PPC_PSERIES */
260
261#ifdef __DISABLED__
262/*
263 * This is used for when the SLB miss handler has to go virtual,
264 * which doesn't happen for now anymore but will once we re-implement
265 * dynamic VSIDs for shared page tables
266 */
267slb_miss_user_pseries:
268 std r10,PACA_EXGEN+EX_R10(r13)
269 std r11,PACA_EXGEN+EX_R11(r13)
270 std r12,PACA_EXGEN+EX_R12(r13)
271 mfspr r10,SPRG1
272 ld r11,PACA_EXSLB+EX_R9(r13)
273 ld r12,PACA_EXSLB+EX_R3(r13)
274 std r10,PACA_EXGEN+EX_R13(r13)
275 std r11,PACA_EXGEN+EX_R9(r13)
276 std r12,PACA_EXGEN+EX_R3(r13)
277 clrrdi r12,r13,32
278 mfmsr r10
279 mfspr r11,SRR0 /* save SRR0 */
280 ori r12,r12,slb_miss_user_common@l /* virt addr of handler */
281 ori r10,r10,MSR_IR|MSR_DR|MSR_RI
282 mtspr SRR0,r12
283 mfspr r12,SRR1 /* and SRR1 */
284 mtspr SRR1,r10
285 rfid
286 b . /* prevent spec. execution */
287#endif /* __DISABLED__ */
288
289 .align 7
290 .globl __end_interrupts
291__end_interrupts:
292
293/*
294 * Code from here down to __end_handlers is invoked from the
295 * exception prologs above. Because the prologs assemble the
296 * addresses of these handlers using the LOAD_HANDLER macro,
297 * which uses an addi instruction, these handlers must be in
298 * the first 32k of the kernel image.
299 */
300
301/*** Common interrupt handlers ***/
302
303 STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception)
304
305 /*
306 * Machine check is different because we use a different
307 * save area: PACA_EXMC instead of PACA_EXGEN.
308 */
309 .align 7
310 .globl machine_check_common
311machine_check_common:
312 EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
313 FINISH_NAP
314 DISABLE_INTS
315 bl .save_nvgprs
316 addi r3,r1,STACK_FRAME_OVERHEAD
317 bl .machine_check_exception
318 b .ret_from_except
319
320 STD_EXCEPTION_COMMON_LITE(0x900, decrementer, .timer_interrupt)
321 STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception)
322 STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception)
323 STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception)
324 STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception)
325 STD_EXCEPTION_COMMON_IDLE(0xf00, performance_monitor, .performance_monitor_exception)
326 STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception)
327#ifdef CONFIG_ALTIVEC
328 STD_EXCEPTION_COMMON(0x1700, altivec_assist, .altivec_assist_exception)
329#else
330 STD_EXCEPTION_COMMON(0x1700, altivec_assist, .unknown_exception)
331#endif
332#ifdef CONFIG_CBE_RAS
333 STD_EXCEPTION_COMMON(0x1200, cbe_system_error, .cbe_system_error_exception)
334 STD_EXCEPTION_COMMON(0x1600, cbe_maintenance, .cbe_maintenance_exception)
335 STD_EXCEPTION_COMMON(0x1800, cbe_thermal, .cbe_thermal_exception)
336#endif /* CONFIG_CBE_RAS */
337
338 .align 7
339system_call_entry:
340 b system_call_common
341
342/*
343 * Here we have detected that the kernel stack pointer is bad.
344 * R9 contains the saved CR, r13 points to the paca,
345 * r10 contains the (bad) kernel stack pointer,
346 * r11 and r12 contain the saved SRR0 and SRR1.
347 * We switch to using an emergency stack, save the registers there,
348 * and call kernel_bad_stack(), which panics.
349 */
350bad_stack:
351 ld r1,PACAEMERGSP(r13)
352 subi r1,r1,64+INT_FRAME_SIZE
353 std r9,_CCR(r1)
354 std r10,GPR1(r1)
355 std r11,_NIP(r1)
356 std r12,_MSR(r1)
357 mfspr r11,SPRN_DAR
358 mfspr r12,SPRN_DSISR
359 std r11,_DAR(r1)
360 std r12,_DSISR(r1)
361 mflr r10
362 mfctr r11
363 mfxer r12
364 std r10,_LINK(r1)
365 std r11,_CTR(r1)
366 std r12,_XER(r1)
367 SAVE_GPR(0,r1)
368 SAVE_GPR(2,r1)
369 SAVE_4GPRS(3,r1)
370 SAVE_2GPRS(7,r1)
371 SAVE_10GPRS(12,r1)
372 SAVE_10GPRS(22,r1)
373 lhz r12,PACA_TRAP_SAVE(r13)
374 std r12,_TRAP(r1)
375 addi r11,r1,INT_FRAME_SIZE
376 std r11,0(r1)
377 li r12,0
378 std r12,0(r11)
379 ld r2,PACATOC(r13)
3801: addi r3,r1,STACK_FRAME_OVERHEAD
381 bl .kernel_bad_stack
382 b 1b
383
384/*
385 * Here r13 points to the paca, r9 contains the saved CR,
386 * SRR0 and SRR1 are saved in r11 and r12,
387 * r9 - r13 are saved in paca->exgen.
388 */
389 .align 7
390 .globl data_access_common
391data_access_common:
392 mfspr r10,SPRN_DAR
393 std r10,PACA_EXGEN+EX_DAR(r13)
394 mfspr r10,SPRN_DSISR
395 stw r10,PACA_EXGEN+EX_DSISR(r13)
396 EXCEPTION_PROLOG_COMMON(0x300, PACA_EXGEN)
397 ld r3,PACA_EXGEN+EX_DAR(r13)
398 lwz r4,PACA_EXGEN+EX_DSISR(r13)
399 li r5,0x300
400 b .do_hash_page /* Try to handle as hpte fault */
401
402 .align 7
403 .globl instruction_access_common
404instruction_access_common:
405 EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN)
406 ld r3,_NIP(r1)
407 andis. r4,r12,0x5820
408 li r5,0x400
409 b .do_hash_page /* Try to handle as hpte fault */
410
411/*
412 * Here is the common SLB miss user that is used when going to virtual
413 * mode for SLB misses, that is currently not used
414 */
415#ifdef __DISABLED__
416 .align 7
417 .globl slb_miss_user_common
418slb_miss_user_common:
419 mflr r10
420 std r3,PACA_EXGEN+EX_DAR(r13)
421 stw r9,PACA_EXGEN+EX_CCR(r13)
422 std r10,PACA_EXGEN+EX_LR(r13)
423 std r11,PACA_EXGEN+EX_SRR0(r13)
424 bl .slb_allocate_user
425
426 ld r10,PACA_EXGEN+EX_LR(r13)
427 ld r3,PACA_EXGEN+EX_R3(r13)
428 lwz r9,PACA_EXGEN+EX_CCR(r13)
429 ld r11,PACA_EXGEN+EX_SRR0(r13)
430 mtlr r10
431 beq- slb_miss_fault
432
433 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
434 beq- unrecov_user_slb
435 mfmsr r10
436
437.machine push
438.machine "power4"
439 mtcrf 0x80,r9
440.machine pop
441
442 clrrdi r10,r10,2 /* clear RI before setting SRR0/1 */
443 mtmsrd r10,1
444
445 mtspr SRR0,r11
446 mtspr SRR1,r12
447
448 ld r9,PACA_EXGEN+EX_R9(r13)
449 ld r10,PACA_EXGEN+EX_R10(r13)
450 ld r11,PACA_EXGEN+EX_R11(r13)
451 ld r12,PACA_EXGEN+EX_R12(r13)
452 ld r13,PACA_EXGEN+EX_R13(r13)
453 rfid
454 b .
455
456slb_miss_fault:
457 EXCEPTION_PROLOG_COMMON(0x380, PACA_EXGEN)
458 ld r4,PACA_EXGEN+EX_DAR(r13)
459 li r5,0
460 std r4,_DAR(r1)
461 std r5,_DSISR(r1)
462 b handle_page_fault
463
464unrecov_user_slb:
465 EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN)
466 DISABLE_INTS
467 bl .save_nvgprs
4681: addi r3,r1,STACK_FRAME_OVERHEAD
469 bl .unrecoverable_exception
470 b 1b
471
472#endif /* __DISABLED__ */
473
474
475/*
476 * r13 points to the PACA, r9 contains the saved CR,
477 * r12 contain the saved SRR1, SRR0 is still ready for return
478 * r3 has the faulting address
479 * r9 - r13 are saved in paca->exslb.
480 * r3 is saved in paca->slb_r3
481 * We assume we aren't going to take any exceptions during this procedure.
482 */
483_GLOBAL(slb_miss_realmode)
484 mflr r10
485#ifdef CONFIG_RELOCATABLE
486 mtctr r11
487#endif
488
489 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
490 std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
491
492 bl .slb_allocate_realmode
493
494 /* All done -- return from exception. */
495
496 ld r10,PACA_EXSLB+EX_LR(r13)
497 ld r3,PACA_EXSLB+EX_R3(r13)
498 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
499#ifdef CONFIG_PPC_ISERIES
500BEGIN_FW_FTR_SECTION
501 ld r11,PACALPPACAPTR(r13)
502 ld r11,LPPACASRR0(r11) /* get SRR0 value */
503END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
504#endif /* CONFIG_PPC_ISERIES */
505
506 mtlr r10
507
508 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
509 beq- 2f
510
511.machine push
512.machine "power4"
513 mtcrf 0x80,r9
514 mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
515.machine pop
516
517#ifdef CONFIG_PPC_ISERIES
518BEGIN_FW_FTR_SECTION
519 mtspr SPRN_SRR0,r11
520 mtspr SPRN_SRR1,r12
521END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
522#endif /* CONFIG_PPC_ISERIES */
523 ld r9,PACA_EXSLB+EX_R9(r13)
524 ld r10,PACA_EXSLB+EX_R10(r13)
525 ld r11,PACA_EXSLB+EX_R11(r13)
526 ld r12,PACA_EXSLB+EX_R12(r13)
527 ld r13,PACA_EXSLB+EX_R13(r13)
528 rfid
529 b . /* prevent speculative execution */
530
5312:
532#ifdef CONFIG_PPC_ISERIES
533BEGIN_FW_FTR_SECTION
534 b unrecov_slb
535END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
536#endif /* CONFIG_PPC_ISERIES */
537 mfspr r11,SPRN_SRR0
538 ld r10,PACAKBASE(r13)
539 LOAD_HANDLER(r10,unrecov_slb)
540 mtspr SPRN_SRR0,r10
541 ld r10,PACAKMSR(r13)
542 mtspr SPRN_SRR1,r10
543 rfid
544 b .
545
546unrecov_slb:
547 EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
548 DISABLE_INTS
549 bl .save_nvgprs
5501: addi r3,r1,STACK_FRAME_OVERHEAD
551 bl .unrecoverable_exception
552 b 1b
553
554 .align 7
555 .globl hardware_interrupt_common
556 .globl hardware_interrupt_entry
557hardware_interrupt_common:
558 EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN)
559 FINISH_NAP
560hardware_interrupt_entry:
561 DISABLE_INTS
562BEGIN_FTR_SECTION
563 bl .ppc64_runlatch_on
564END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
565 addi r3,r1,STACK_FRAME_OVERHEAD
566 bl .do_IRQ
567 b .ret_from_except_lite
568
569#ifdef CONFIG_PPC_970_NAP
570power4_fixup_nap:
571 andc r9,r9,r10
572 std r9,TI_LOCAL_FLAGS(r11)
573 ld r10,_LINK(r1) /* make idle task do the */
574 std r10,_NIP(r1) /* equivalent of a blr */
575 blr
576#endif
577
578 .align 7
579 .globl alignment_common
580alignment_common:
581 mfspr r10,SPRN_DAR
582 std r10,PACA_EXGEN+EX_DAR(r13)
583 mfspr r10,SPRN_DSISR
584 stw r10,PACA_EXGEN+EX_DSISR(r13)
585 EXCEPTION_PROLOG_COMMON(0x600, PACA_EXGEN)
586 ld r3,PACA_EXGEN+EX_DAR(r13)
587 lwz r4,PACA_EXGEN+EX_DSISR(r13)
588 std r3,_DAR(r1)
589 std r4,_DSISR(r1)
590 bl .save_nvgprs
591 addi r3,r1,STACK_FRAME_OVERHEAD
592 ENABLE_INTS
593 bl .alignment_exception
594 b .ret_from_except
595
596 .align 7
597 .globl program_check_common
598program_check_common:
599 EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
600 bl .save_nvgprs
601 addi r3,r1,STACK_FRAME_OVERHEAD
602 ENABLE_INTS
603 bl .program_check_exception
604 b .ret_from_except
605
606 .align 7
607 .globl fp_unavailable_common
608fp_unavailable_common:
609 EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
610 bne 1f /* if from user, just load it up */
611 bl .save_nvgprs
612 addi r3,r1,STACK_FRAME_OVERHEAD
613 ENABLE_INTS
614 bl .kernel_fp_unavailable_exception
615 BUG_OPCODE
6161: bl .load_up_fpu
617 b fast_exception_return
618
619 .align 7
620 .globl altivec_unavailable_common
621altivec_unavailable_common:
622 EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN)
623#ifdef CONFIG_ALTIVEC
624BEGIN_FTR_SECTION
625 beq 1f
626 bl .load_up_altivec
627 b fast_exception_return
6281:
629END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
630#endif
631 bl .save_nvgprs
632 addi r3,r1,STACK_FRAME_OVERHEAD
633 ENABLE_INTS
634 bl .altivec_unavailable_exception
635 b .ret_from_except
636
637 .align 7
638 .globl vsx_unavailable_common
639vsx_unavailable_common:
640 EXCEPTION_PROLOG_COMMON(0xf40, PACA_EXGEN)
641#ifdef CONFIG_VSX
642BEGIN_FTR_SECTION
643 bne .load_up_vsx
6441:
645END_FTR_SECTION_IFSET(CPU_FTR_VSX)
646#endif
647 bl .save_nvgprs
648 addi r3,r1,STACK_FRAME_OVERHEAD
649 ENABLE_INTS
650 bl .vsx_unavailable_exception
651 b .ret_from_except
652
653 .align 7
654 .globl __end_handlers
655__end_handlers:
656
657/*
658 * Return from an exception with minimal checks.
659 * The caller is assumed to have done EXCEPTION_PROLOG_COMMON.
660 * If interrupts have been enabled, or anything has been
661 * done that might have changed the scheduling status of
662 * any task or sent any task a signal, you should use
663 * ret_from_except or ret_from_except_lite instead of this.
664 */
665fast_exc_return_irq: /* restores irq state too */
666 ld r3,SOFTE(r1)
667 TRACE_AND_RESTORE_IRQ(r3);
668 ld r12,_MSR(r1)
669 rldicl r4,r12,49,63 /* get MSR_EE to LSB */
670 stb r4,PACAHARDIRQEN(r13) /* restore paca->hard_enabled */
671 b 1f
672
673 .globl fast_exception_return
674fast_exception_return:
675 ld r12,_MSR(r1)
6761: ld r11,_NIP(r1)
677 andi. r3,r12,MSR_RI /* check if RI is set */
678 beq- unrecov_fer
679
680#ifdef CONFIG_VIRT_CPU_ACCOUNTING
681 andi. r3,r12,MSR_PR
682 beq 2f
683 ACCOUNT_CPU_USER_EXIT(r3, r4)
6842:
685#endif
686
687 ld r3,_CCR(r1)
688 ld r4,_LINK(r1)
689 ld r5,_CTR(r1)
690 ld r6,_XER(r1)
691 mtcr r3
692 mtlr r4
693 mtctr r5
694 mtxer r6
695 REST_GPR(0, r1)
696 REST_8GPRS(2, r1)
697
698 mfmsr r10
699 rldicl r10,r10,48,1 /* clear EE */
700 rldicr r10,r10,16,61 /* clear RI (LE is 0 already) */
701 mtmsrd r10,1
702
703 mtspr SPRN_SRR1,r12
704 mtspr SPRN_SRR0,r11
705 REST_4GPRS(10, r1)
706 ld r1,GPR1(r1)
707 rfid
708 b . /* prevent speculative execution */
709
710unrecov_fer:
711 bl .save_nvgprs
7121: addi r3,r1,STACK_FRAME_OVERHEAD
713 bl .unrecoverable_exception
714 b 1b
715
716
717/*
718 * Hash table stuff
719 */
720 .align 7
721_STATIC(do_hash_page)
722 std r3,_DAR(r1)
723 std r4,_DSISR(r1)
724
725 andis. r0,r4,0xa450 /* weird error? */
726 bne- handle_page_fault /* if not, try to insert a HPTE */
727BEGIN_FTR_SECTION
728 andis. r0,r4,0x0020 /* Is it a segment table fault? */
729 bne- do_ste_alloc /* If so handle it */
730END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
731
732 /*
733 * On iSeries, we soft-disable interrupts here, then
734 * hard-enable interrupts so that the hash_page code can spin on
735 * the hash_table_lock without problems on a shared processor.
736 */
737 DISABLE_INTS
738
739 /*
740 * Currently, trace_hardirqs_off() will be called by DISABLE_INTS
741 * and will clobber volatile registers when irq tracing is enabled
742 * so we need to reload them. It may be possible to be smarter here
743 * and move the irq tracing elsewhere but let's keep it simple for
744 * now
745 */
746#ifdef CONFIG_TRACE_IRQFLAGS
747 ld r3,_DAR(r1)
748 ld r4,_DSISR(r1)
749 ld r5,_TRAP(r1)
750 ld r12,_MSR(r1)
751 clrrdi r5,r5,4
752#endif /* CONFIG_TRACE_IRQFLAGS */
753 /*
754 * We need to set the _PAGE_USER bit if MSR_PR is set or if we are
755 * accessing a userspace segment (even from the kernel). We assume
756 * kernel addresses always have the high bit set.
757 */
758 rlwinm r4,r4,32-25+9,31-9,31-9 /* DSISR_STORE -> _PAGE_RW */
759 rotldi r0,r3,15 /* Move high bit into MSR_PR posn */
760 orc r0,r12,r0 /* MSR_PR | ~high_bit */
761 rlwimi r4,r0,32-13,30,30 /* becomes _PAGE_USER access bit */
762 ori r4,r4,1 /* add _PAGE_PRESENT */
763 rlwimi r4,r5,22+2,31-2,31-2 /* Set _PAGE_EXEC if trap is 0x400 */
764
765 /*
766 * r3 contains the faulting address
767 * r4 contains the required access permissions
768 * r5 contains the trap number
769 *
770 * at return r3 = 0 for success
771 */
772 bl .hash_page /* build HPTE if possible */
773 cmpdi r3,0 /* see if hash_page succeeded */
774
775BEGIN_FW_FTR_SECTION
776 /*
777 * If we had interrupts soft-enabled at the point where the
778 * DSI/ISI occurred, and an interrupt came in during hash_page,
779 * handle it now.
780 * We jump to ret_from_except_lite rather than fast_exception_return
781 * because ret_from_except_lite will check for and handle pending
782 * interrupts if necessary.
783 */
784 beq 13f
785END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
786
787BEGIN_FW_FTR_SECTION
788 /*
789 * Here we have interrupts hard-disabled, so it is sufficient
790 * to restore paca->{soft,hard}_enable and get out.
791 */
792 beq fast_exc_return_irq /* Return from exception on success */
793END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
794
795 /* For a hash failure, we don't bother re-enabling interrupts */
796 ble- 12f
797
798 /*
799 * hash_page couldn't handle it, set soft interrupt enable back
800 * to what it was before the trap. Note that .raw_local_irq_restore
801 * handles any interrupts pending at this point.
802 */
803 ld r3,SOFTE(r1)
804 TRACE_AND_RESTORE_IRQ_PARTIAL(r3, 11f)
805 bl .raw_local_irq_restore
806 b 11f
807
808/* Here we have a page fault that hash_page can't handle. */
809handle_page_fault:
810 ENABLE_INTS
81111: ld r4,_DAR(r1)
812 ld r5,_DSISR(r1)
813 addi r3,r1,STACK_FRAME_OVERHEAD
814 bl .do_page_fault
815 cmpdi r3,0
816 beq+ 13f
817 bl .save_nvgprs
818 mr r5,r3
819 addi r3,r1,STACK_FRAME_OVERHEAD
820 lwz r4,_DAR(r1)
821 bl .bad_page_fault
822 b .ret_from_except
823
82413: b .ret_from_except_lite
825
826/* We have a page fault that hash_page could handle but HV refused
827 * the PTE insertion
828 */
82912: bl .save_nvgprs
830 mr r5,r3
831 addi r3,r1,STACK_FRAME_OVERHEAD
832 ld r4,_DAR(r1)
833 bl .low_hash_fault
834 b .ret_from_except
835
836 /* here we have a segment miss */
837do_ste_alloc:
838 bl .ste_allocate /* try to insert stab entry */
839 cmpdi r3,0
840 bne- handle_page_fault
841 b fast_exception_return
842
843/*
844 * r13 points to the PACA, r9 contains the saved CR,
845 * r11 and r12 contain the saved SRR0 and SRR1.
846 * r9 - r13 are saved in paca->exslb.
847 * We assume we aren't going to take any exceptions during this procedure.
848 * We assume (DAR >> 60) == 0xc.
849 */
850 .align 7
851_GLOBAL(do_stab_bolted)
852 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
853 std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */
854
855 /* Hash to the primary group */
856 ld r10,PACASTABVIRT(r13)
857 mfspr r11,SPRN_DAR
858 srdi r11,r11,28
859 rldimi r10,r11,7,52 /* r10 = first ste of the group */
860
861 /* Calculate VSID */
862 /* This is a kernel address, so protovsid = ESID */
863 ASM_VSID_SCRAMBLE(r11, r9, 256M)
864 rldic r9,r11,12,16 /* r9 = vsid << 12 */
865
866 /* Search the primary group for a free entry */
8671: ld r11,0(r10) /* Test valid bit of the current ste */
868 andi. r11,r11,0x80
869 beq 2f
870 addi r10,r10,16
871 andi. r11,r10,0x70
872 bne 1b
873
874 /* Stick for only searching the primary group for now. */
875 /* At least for now, we use a very simple random castout scheme */
876 /* Use the TB as a random number ; OR in 1 to avoid entry 0 */
877 mftb r11
878 rldic r11,r11,4,57 /* r11 = (r11 << 4) & 0x70 */
879 ori r11,r11,0x10
880
881 /* r10 currently points to an ste one past the group of interest */
882 /* make it point to the randomly selected entry */
883 subi r10,r10,128
884 or r10,r10,r11 /* r10 is the entry to invalidate */
885
886 isync /* mark the entry invalid */
887 ld r11,0(r10)
888 rldicl r11,r11,56,1 /* clear the valid bit */
889 rotldi r11,r11,8
890 std r11,0(r10)
891 sync
892
893 clrrdi r11,r11,28 /* Get the esid part of the ste */
894 slbie r11
895
8962: std r9,8(r10) /* Store the vsid part of the ste */
897 eieio
898
899 mfspr r11,SPRN_DAR /* Get the new esid */
900 clrrdi r11,r11,28 /* Permits a full 32b of ESID */
901 ori r11,r11,0x90 /* Turn on valid and kp */
902 std r11,0(r10) /* Put new entry back into the stab */
903
904 sync
905
906 /* All done -- return from exception. */
907 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
908 ld r11,PACA_EXSLB+EX_SRR0(r13) /* get saved SRR0 */
909
910 andi. r10,r12,MSR_RI
911 beq- unrecov_slb
912
913 mtcrf 0x80,r9 /* restore CR */
914
915 mfmsr r10
916 clrrdi r10,r10,2
917 mtmsrd r10,1
918
919 mtspr SPRN_SRR0,r11
920 mtspr SPRN_SRR1,r12
921 ld r9,PACA_EXSLB+EX_R9(r13)
922 ld r10,PACA_EXSLB+EX_R10(r13)
923 ld r11,PACA_EXSLB+EX_R11(r13)
924 ld r12,PACA_EXSLB+EX_R12(r13)
925 ld r13,PACA_EXSLB+EX_R13(r13)
926 rfid
927 b . /* prevent speculative execution */
928
929/*
930 * Space for CPU0's segment table.
931 *
932 * On iSeries, the hypervisor must fill in at least one entry before
933 * we get control (with relocate on). The address is given to the hv
934 * as a page number (see xLparMap below), so this must be at a
935 * fixed address (the linker can't compute (u64)&initial_stab >>
936 * PAGE_SHIFT).
937 */
938 . = STAB0_OFFSET /* 0x6000 */
939 .globl initial_stab
940initial_stab:
941 .space 4096
942
943#ifdef CONFIG_PPC_PSERIES
944/*
945 * Data area reserved for FWNMI option.
946 * This address (0x7000) is fixed by the RPA.
947 */
948 .= 0x7000
949 .globl fwnmi_data_area
950fwnmi_data_area:
951#endif /* CONFIG_PPC_PSERIES */
952
953 /* iSeries does not use the FWNMI stuff, so it is safe to put
954 * this here, even if we later allow kernels that will boot on
955 * both pSeries and iSeries */
956#ifdef CONFIG_PPC_ISERIES
957 . = LPARMAP_PHYS
958 .globl xLparMap
959xLparMap:
960 .quad HvEsidsToMap /* xNumberEsids */
961 .quad HvRangesToMap /* xNumberRanges */
962 .quad STAB0_PAGE /* xSegmentTableOffs */
963 .zero 40 /* xRsvd */
964 /* xEsids (HvEsidsToMap entries of 2 quads) */
965 .quad PAGE_OFFSET_ESID /* xKernelEsid */
966 .quad PAGE_OFFSET_VSID /* xKernelVsid */
967 .quad VMALLOC_START_ESID /* xKernelEsid */
968 .quad VMALLOC_START_VSID /* xKernelVsid */
969 /* xRanges (HvRangesToMap entries of 3 quads) */
970 .quad HvPagesToMap /* xPages */
971 .quad 0 /* xOffset */
972 .quad PAGE_OFFSET_VSID << (SID_SHIFT - HW_PAGE_SHIFT) /* xVPN */
973
974#endif /* CONFIG_PPC_ISERIES */
975
976#ifdef CONFIG_PPC_PSERIES
977 . = 0x8000
978#endif /* CONFIG_PPC_PSERIES */
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 2d182f119d1d..1b12696cca06 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -23,25 +23,14 @@
23#include <asm/code-patching.h> 23#include <asm/code-patching.h>
24#include <asm/ftrace.h> 24#include <asm/ftrace.h>
25 25
26#ifdef CONFIG_PPC32
27# define GET_ADDR(addr) addr
28#else
29/* PowerPC64's functions are data that points to the functions */
30# define GET_ADDR(addr) (*(unsigned long *)addr)
31#endif
32 26
33#ifdef CONFIG_DYNAMIC_FTRACE 27#ifdef CONFIG_DYNAMIC_FTRACE
34static unsigned int ftrace_nop_replace(void)
35{
36 return PPC_INST_NOP;
37}
38
39static unsigned int 28static unsigned int
40ftrace_call_replace(unsigned long ip, unsigned long addr, int link) 29ftrace_call_replace(unsigned long ip, unsigned long addr, int link)
41{ 30{
42 unsigned int op; 31 unsigned int op;
43 32
44 addr = GET_ADDR(addr); 33 addr = ppc_function_entry((void *)addr);
45 34
46 /* if (link) set op to 'bl' else 'b' */ 35 /* if (link) set op to 'bl' else 'b' */
47 op = create_branch((unsigned int *)ip, addr, link ? 1 : 0); 36 op = create_branch((unsigned int *)ip, addr, link ? 1 : 0);
@@ -49,14 +38,6 @@ ftrace_call_replace(unsigned long ip, unsigned long addr, int link)
49 return op; 38 return op;
50} 39}
51 40
52#ifdef CONFIG_PPC64
53# define _ASM_ALIGN " .align 3 "
54# define _ASM_PTR " .llong "
55#else
56# define _ASM_ALIGN " .align 2 "
57# define _ASM_PTR " .long "
58#endif
59
60static int 41static int
61ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new) 42ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new)
62{ 43{
@@ -197,7 +178,7 @@ __ftrace_make_nop(struct module *mod,
197 ptr = ((unsigned long)jmp[0] << 32) + jmp[1]; 178 ptr = ((unsigned long)jmp[0] << 32) + jmp[1];
198 179
199 /* This should match what was called */ 180 /* This should match what was called */
200 if (ptr != GET_ADDR(addr)) { 181 if (ptr != ppc_function_entry((void *)addr)) {
201 printk(KERN_ERR "addr does not match %lx\n", ptr); 182 printk(KERN_ERR "addr does not match %lx\n", ptr);
202 return -EINVAL; 183 return -EINVAL;
203 } 184 }
@@ -328,7 +309,7 @@ int ftrace_make_nop(struct module *mod,
328 if (test_24bit_addr(ip, addr)) { 309 if (test_24bit_addr(ip, addr)) {
329 /* within range */ 310 /* within range */
330 old = ftrace_call_replace(ip, addr, 1); 311 old = ftrace_call_replace(ip, addr, 1);
331 new = ftrace_nop_replace(); 312 new = PPC_INST_NOP;
332 return ftrace_modify_code(ip, old, new); 313 return ftrace_modify_code(ip, old, new);
333 } 314 }
334 315
@@ -466,7 +447,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
466 */ 447 */
467 if (test_24bit_addr(ip, addr)) { 448 if (test_24bit_addr(ip, addr)) {
468 /* within range */ 449 /* within range */
469 old = ftrace_nop_replace(); 450 old = PPC_INST_NOP;
470 new = ftrace_call_replace(ip, addr, 1); 451 new = ftrace_call_replace(ip, addr, 1);
471 return ftrace_modify_code(ip, old, new); 452 return ftrace_modify_code(ip, old, new);
472 } 453 }
@@ -570,7 +551,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
570 return_hooker = (unsigned long)&mod_return_to_handler; 551 return_hooker = (unsigned long)&mod_return_to_handler;
571#endif 552#endif
572 553
573 return_hooker = GET_ADDR(return_hooker); 554 return_hooker = ppc_function_entry((void *)return_hooker);
574 555
575 /* 556 /*
576 * Protect against fault, even if it shouldn't 557 * Protect against fault, even if it shouldn't
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index c01467f952d3..48469463f89e 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -733,9 +733,11 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_NEED_DTLB_SW_LRU)
733AltiVecUnavailable: 733AltiVecUnavailable:
734 EXCEPTION_PROLOG 734 EXCEPTION_PROLOG
735#ifdef CONFIG_ALTIVEC 735#ifdef CONFIG_ALTIVEC
736 bne load_up_altivec /* if from user, just load it up */ 736 beq 1f
737 bl load_up_altivec /* if from user, just load it up */
738 b fast_exception_return
737#endif /* CONFIG_ALTIVEC */ 739#endif /* CONFIG_ALTIVEC */
738 addi r3,r1,STACK_FRAME_OVERHEAD 7401: addi r3,r1,STACK_FRAME_OVERHEAD
739 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception) 741 EXC_XFER_EE_LITE(0xf20, altivec_unavailable_exception)
740 742
741PerformanceMonitor: 743PerformanceMonitor:
@@ -743,101 +745,6 @@ PerformanceMonitor:
743 addi r3,r1,STACK_FRAME_OVERHEAD 745 addi r3,r1,STACK_FRAME_OVERHEAD
744 EXC_XFER_STD(0xf00, performance_monitor_exception) 746 EXC_XFER_STD(0xf00, performance_monitor_exception)
745 747
746#ifdef CONFIG_ALTIVEC
747/* Note that the AltiVec support is closely modeled after the FP
748 * support. Changes to one are likely to be applicable to the
749 * other! */
750load_up_altivec:
751/*
752 * Disable AltiVec for the task which had AltiVec previously,
753 * and save its AltiVec registers in its thread_struct.
754 * Enables AltiVec for use in the kernel on return.
755 * On SMP we know the AltiVec units are free, since we give it up every
756 * switch. -- Kumar
757 */
758 mfmsr r5
759 oris r5,r5,MSR_VEC@h
760 MTMSRD(r5) /* enable use of AltiVec now */
761 isync
762/*
763 * For SMP, we don't do lazy AltiVec switching because it just gets too
764 * horrendously complex, especially when a task switches from one CPU
765 * to another. Instead we call giveup_altivec in switch_to.
766 */
767#ifndef CONFIG_SMP
768 tophys(r6,0)
769 addis r3,r6,last_task_used_altivec@ha
770 lwz r4,last_task_used_altivec@l(r3)
771 cmpwi 0,r4,0
772 beq 1f
773 add r4,r4,r6
774 addi r4,r4,THREAD /* want THREAD of last_task_used_altivec */
775 SAVE_32VRS(0,r10,r4)
776 mfvscr vr0
777 li r10,THREAD_VSCR
778 stvx vr0,r10,r4
779 lwz r5,PT_REGS(r4)
780 add r5,r5,r6
781 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
782 lis r10,MSR_VEC@h
783 andc r4,r4,r10 /* disable altivec for previous task */
784 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
7851:
786#endif /* CONFIG_SMP */
787 /* enable use of AltiVec after return */
788 oris r9,r9,MSR_VEC@h
789 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */
790 li r4,1
791 li r10,THREAD_VSCR
792 stw r4,THREAD_USED_VR(r5)
793 lvx vr0,r10,r5
794 mtvscr vr0
795 REST_32VRS(0,r10,r5)
796#ifndef CONFIG_SMP
797 subi r4,r5,THREAD
798 sub r4,r4,r6
799 stw r4,last_task_used_altivec@l(r3)
800#endif /* CONFIG_SMP */
801 /* restore registers and return */
802 /* we haven't used ctr or xer or lr */
803 b fast_exception_return
804
805/*
806 * giveup_altivec(tsk)
807 * Disable AltiVec for the task given as the argument,
808 * and save the AltiVec registers in its thread_struct.
809 * Enables AltiVec for use in the kernel on return.
810 */
811
812 .globl giveup_altivec
813giveup_altivec:
814 mfmsr r5
815 oris r5,r5,MSR_VEC@h
816 SYNC
817 MTMSRD(r5) /* enable use of AltiVec now */
818 isync
819 cmpwi 0,r3,0
820 beqlr- /* if no previous owner, done */
821 addi r3,r3,THREAD /* want THREAD of task */
822 lwz r5,PT_REGS(r3)
823 cmpwi 0,r5,0
824 SAVE_32VRS(0, r4, r3)
825 mfvscr vr0
826 li r4,THREAD_VSCR
827 stvx vr0,r4,r3
828 beq 1f
829 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
830 lis r3,MSR_VEC@h
831 andc r4,r4,r3 /* disable AltiVec for previous task */
832 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
8331:
834#ifndef CONFIG_SMP
835 li r5,0
836 lis r4,last_task_used_altivec@ha
837 stw r5,last_task_used_altivec@l(r4)
838#endif /* CONFIG_SMP */
839 blr
840#endif /* CONFIG_ALTIVEC */
841 748
842/* 749/*
843 * This code is jumped to from the startup code to copy 750 * This code is jumped to from the startup code to copy
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 50ef505b8fb6..012505ebd9f9 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -12,8 +12,9 @@
12 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and 12 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
13 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com 13 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com
14 * 14 *
15 * This file contains the low-level support and setup for the 15 * This file contains the entry point for the 64-bit kernel along
16 * PowerPC-64 platform, including trap and interrupt dispatch. 16 * with some early initialization code common to all 64-bit powerpc
17 * variants.
17 * 18 *
18 * This program is free software; you can redistribute it and/or 19 * This program is free software; you can redistribute it and/or
19 * modify it under the terms of the GNU General Public License 20 * modify it under the terms of the GNU General Public License
@@ -38,36 +39,25 @@
38#include <asm/exception.h> 39#include <asm/exception.h>
39#include <asm/irqflags.h> 40#include <asm/irqflags.h>
40 41
41/* 42/* The physical memory is layed out such that the secondary processor
42 * We layout physical memory as follows: 43 * spin code sits at 0x0000...0x00ff. On server, the vectors follow
43 * 0x0000 - 0x00ff : Secondary processor spin code 44 * using the layout described in exceptions-64s.S
44 * 0x0100 - 0x2fff : pSeries Interrupt prologs
45 * 0x3000 - 0x5fff : interrupt support, iSeries and common interrupt prologs
46 * 0x6000 - 0x6fff : Initial (CPU0) segment table
47 * 0x7000 - 0x7fff : FWNMI data area
48 * 0x8000 - : Early init and support code
49 */
50
51/*
52 * SPRG Usage
53 *
54 * Register Definition
55 *
56 * SPRG0 reserved for hypervisor
57 * SPRG1 temp - used to save gpr
58 * SPRG2 temp - used to save gpr
59 * SPRG3 virt addr of paca
60 */ 45 */
61 46
62/* 47/*
63 * Entering into this code we make the following assumptions: 48 * Entering into this code we make the following assumptions:
64 * For pSeries: 49 *
50 * For pSeries or server processors:
65 * 1. The MMU is off & open firmware is running in real mode. 51 * 1. The MMU is off & open firmware is running in real mode.
66 * 2. The kernel is entered at __start 52 * 2. The kernel is entered at __start
67 * 53 *
68 * For iSeries: 54 * For iSeries:
69 * 1. The MMU is on (as it always is for iSeries) 55 * 1. The MMU is on (as it always is for iSeries)
70 * 2. The kernel is entered at system_reset_iSeries 56 * 2. The kernel is entered at system_reset_iSeries
57 *
58 * For Book3E processors:
59 * 1. The MMU is on running in AS0 in a state defined in ePAPR
60 * 2. The kernel is entered at __start
71 */ 61 */
72 62
73 .text 63 .text
@@ -166,1065 +156,14 @@ exception_marker:
166 .text 156 .text
167 157
168/* 158/*
169 * This is the start of the interrupt handlers for pSeries 159 * On server, we include the exception vectors code here as it
170 * This code runs with relocation off. 160 * relies on absolute addressing which is only possible within
171 * Code from here to __end_interrupts gets copied down to real 161 * this compilation unit
172 * address 0x100 when we are running a relocatable kernel.
173 * Therefore any relative branches in this section must only
174 * branch to labels in this section.
175 */
176 . = 0x100
177 .globl __start_interrupts
178__start_interrupts:
179
180 STD_EXCEPTION_PSERIES(0x100, system_reset)
181
182 . = 0x200
183_machine_check_pSeries:
184 HMT_MEDIUM
185 mtspr SPRN_SPRG1,r13 /* save r13 */
186 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
187
188 . = 0x300
189 .globl data_access_pSeries
190data_access_pSeries:
191 HMT_MEDIUM
192 mtspr SPRN_SPRG1,r13
193BEGIN_FTR_SECTION
194 mtspr SPRN_SPRG2,r12
195 mfspr r13,SPRN_DAR
196 mfspr r12,SPRN_DSISR
197 srdi r13,r13,60
198 rlwimi r13,r12,16,0x20
199 mfcr r12
200 cmpwi r13,0x2c
201 beq do_stab_bolted_pSeries
202 mtcrf 0x80,r12
203 mfspr r12,SPRN_SPRG2
204END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
205 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common)
206
207 . = 0x380
208 .globl data_access_slb_pSeries
209data_access_slb_pSeries:
210 HMT_MEDIUM
211 mtspr SPRN_SPRG1,r13
212 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
213 std r3,PACA_EXSLB+EX_R3(r13)
214 mfspr r3,SPRN_DAR
215 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
216 mfcr r9
217#ifdef __DISABLED__
218 /* Keep that around for when we re-implement dynamic VSIDs */
219 cmpdi r3,0
220 bge slb_miss_user_pseries
221#endif /* __DISABLED__ */
222 std r10,PACA_EXSLB+EX_R10(r13)
223 std r11,PACA_EXSLB+EX_R11(r13)
224 std r12,PACA_EXSLB+EX_R12(r13)
225 mfspr r10,SPRN_SPRG1
226 std r10,PACA_EXSLB+EX_R13(r13)
227 mfspr r12,SPRN_SRR1 /* and SRR1 */
228#ifndef CONFIG_RELOCATABLE
229 b .slb_miss_realmode
230#else
231 /*
232 * We can't just use a direct branch to .slb_miss_realmode
233 * because the distance from here to there depends on where
234 * the kernel ends up being put.
235 */
236 mfctr r11
237 ld r10,PACAKBASE(r13)
238 LOAD_HANDLER(r10, .slb_miss_realmode)
239 mtctr r10
240 bctr
241#endif
242
243 STD_EXCEPTION_PSERIES(0x400, instruction_access)
244
245 . = 0x480
246 .globl instruction_access_slb_pSeries
247instruction_access_slb_pSeries:
248 HMT_MEDIUM
249 mtspr SPRN_SPRG1,r13
250 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
251 std r3,PACA_EXSLB+EX_R3(r13)
252 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
253 std r9,PACA_EXSLB+EX_R9(r13) /* save r9 - r12 */
254 mfcr r9
255#ifdef __DISABLED__
256 /* Keep that around for when we re-implement dynamic VSIDs */
257 cmpdi r3,0
258 bge slb_miss_user_pseries
259#endif /* __DISABLED__ */
260 std r10,PACA_EXSLB+EX_R10(r13)
261 std r11,PACA_EXSLB+EX_R11(r13)
262 std r12,PACA_EXSLB+EX_R12(r13)
263 mfspr r10,SPRN_SPRG1
264 std r10,PACA_EXSLB+EX_R13(r13)
265 mfspr r12,SPRN_SRR1 /* and SRR1 */
266#ifndef CONFIG_RELOCATABLE
267 b .slb_miss_realmode
268#else
269 mfctr r11
270 ld r10,PACAKBASE(r13)
271 LOAD_HANDLER(r10, .slb_miss_realmode)
272 mtctr r10
273 bctr
274#endif
275
276 MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt)
277 STD_EXCEPTION_PSERIES(0x600, alignment)
278 STD_EXCEPTION_PSERIES(0x700, program_check)
279 STD_EXCEPTION_PSERIES(0x800, fp_unavailable)
280 MASKABLE_EXCEPTION_PSERIES(0x900, decrementer)
281 STD_EXCEPTION_PSERIES(0xa00, trap_0a)
282 STD_EXCEPTION_PSERIES(0xb00, trap_0b)
283
284 . = 0xc00
285 .globl system_call_pSeries
286system_call_pSeries:
287 HMT_MEDIUM
288BEGIN_FTR_SECTION
289 cmpdi r0,0x1ebe
290 beq- 1f
291END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE)
292 mr r9,r13
293 mfspr r13,SPRN_SPRG3
294 mfspr r11,SPRN_SRR0
295 ld r12,PACAKBASE(r13)
296 ld r10,PACAKMSR(r13)
297 LOAD_HANDLER(r12, system_call_entry)
298 mtspr SPRN_SRR0,r12
299 mfspr r12,SPRN_SRR1
300 mtspr SPRN_SRR1,r10
301 rfid
302 b . /* prevent speculative execution */
303
304/* Fast LE/BE switch system call */
3051: mfspr r12,SPRN_SRR1
306 xori r12,r12,MSR_LE
307 mtspr SPRN_SRR1,r12
308 rfid /* return to userspace */
309 b .
310
311 STD_EXCEPTION_PSERIES(0xd00, single_step)
312 STD_EXCEPTION_PSERIES(0xe00, trap_0e)
313
314 /* We need to deal with the Altivec unavailable exception
315 * here which is at 0xf20, thus in the middle of the
316 * prolog code of the PerformanceMonitor one. A little
317 * trickery is thus necessary
318 */
319 . = 0xf00
320 b performance_monitor_pSeries
321
322 . = 0xf20
323 b altivec_unavailable_pSeries
324
325 . = 0xf40
326 b vsx_unavailable_pSeries
327
328#ifdef CONFIG_CBE_RAS
329 HSTD_EXCEPTION_PSERIES(0x1200, cbe_system_error)
330#endif /* CONFIG_CBE_RAS */
331 STD_EXCEPTION_PSERIES(0x1300, instruction_breakpoint)
332#ifdef CONFIG_CBE_RAS
333 HSTD_EXCEPTION_PSERIES(0x1600, cbe_maintenance)
334#endif /* CONFIG_CBE_RAS */
335 STD_EXCEPTION_PSERIES(0x1700, altivec_assist)
336#ifdef CONFIG_CBE_RAS
337 HSTD_EXCEPTION_PSERIES(0x1800, cbe_thermal)
338#endif /* CONFIG_CBE_RAS */
339
340 . = 0x3000
341
342/*** pSeries interrupt support ***/
343
344 /* moved from 0xf00 */
345 STD_EXCEPTION_PSERIES(., performance_monitor)
346 STD_EXCEPTION_PSERIES(., altivec_unavailable)
347 STD_EXCEPTION_PSERIES(., vsx_unavailable)
348
349/*
350 * An interrupt came in while soft-disabled; clear EE in SRR1,
351 * clear paca->hard_enabled and return.
352 */
353masked_interrupt:
354 stb r10,PACAHARDIRQEN(r13)
355 mtcrf 0x80,r9
356 ld r9,PACA_EXGEN+EX_R9(r13)
357 mfspr r10,SPRN_SRR1
358 rldicl r10,r10,48,1 /* clear MSR_EE */
359 rotldi r10,r10,16
360 mtspr SPRN_SRR1,r10
361 ld r10,PACA_EXGEN+EX_R10(r13)
362 mfspr r13,SPRN_SPRG1
363 rfid
364 b .
365
366 .align 7
367do_stab_bolted_pSeries:
368 mtcrf 0x80,r12
369 mfspr r12,SPRN_SPRG2
370 EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted)
371
372#ifdef CONFIG_PPC_PSERIES
373/*
374 * Vectors for the FWNMI option. Share common code.
375 */
376 .globl system_reset_fwnmi
377 .align 7
378system_reset_fwnmi:
379 HMT_MEDIUM
380 mtspr SPRN_SPRG1,r13 /* save r13 */
381 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
382
383 .globl machine_check_fwnmi
384 .align 7
385machine_check_fwnmi:
386 HMT_MEDIUM
387 mtspr SPRN_SPRG1,r13 /* save r13 */
388 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
389
390#endif /* CONFIG_PPC_PSERIES */
391
392#ifdef __DISABLED__
393/*
394 * This is used for when the SLB miss handler has to go virtual,
395 * which doesn't happen for now anymore but will once we re-implement
396 * dynamic VSIDs for shared page tables
397 */
398slb_miss_user_pseries:
399 std r10,PACA_EXGEN+EX_R10(r13)
400 std r11,PACA_EXGEN+EX_R11(r13)
401 std r12,PACA_EXGEN+EX_R12(r13)
402 mfspr r10,SPRG1
403 ld r11,PACA_EXSLB+EX_R9(r13)
404 ld r12,PACA_EXSLB+EX_R3(r13)
405 std r10,PACA_EXGEN+EX_R13(r13)
406 std r11,PACA_EXGEN+EX_R9(r13)
407 std r12,PACA_EXGEN+EX_R3(r13)
408 clrrdi r12,r13,32
409 mfmsr r10
410 mfspr r11,SRR0 /* save SRR0 */
411 ori r12,r12,slb_miss_user_common@l /* virt addr of handler */
412 ori r10,r10,MSR_IR|MSR_DR|MSR_RI
413 mtspr SRR0,r12
414 mfspr r12,SRR1 /* and SRR1 */
415 mtspr SRR1,r10
416 rfid
417 b . /* prevent spec. execution */
418#endif /* __DISABLED__ */
419
420 .align 7
421 .globl __end_interrupts
422__end_interrupts:
423
424/*
425 * Code from here down to __end_handlers is invoked from the
426 * exception prologs above. Because the prologs assemble the
427 * addresses of these handlers using the LOAD_HANDLER macro,
428 * which uses an addi instruction, these handlers must be in
429 * the first 32k of the kernel image.
430 */
431
432/*** Common interrupt handlers ***/
433
434 STD_EXCEPTION_COMMON(0x100, system_reset, .system_reset_exception)
435
436 /*
437 * Machine check is different because we use a different
438 * save area: PACA_EXMC instead of PACA_EXGEN.
439 */
440 .align 7
441 .globl machine_check_common
442machine_check_common:
443 EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
444 FINISH_NAP
445 DISABLE_INTS
446 bl .save_nvgprs
447 addi r3,r1,STACK_FRAME_OVERHEAD
448 bl .machine_check_exception
449 b .ret_from_except
450
451 STD_EXCEPTION_COMMON_LITE(0x900, decrementer, .timer_interrupt)
452 STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception)
453 STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception)
454 STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception)
455 STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception)
456 STD_EXCEPTION_COMMON_IDLE(0xf00, performance_monitor, .performance_monitor_exception)
457 STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception)
458#ifdef CONFIG_ALTIVEC
459 STD_EXCEPTION_COMMON(0x1700, altivec_assist, .altivec_assist_exception)
460#else
461 STD_EXCEPTION_COMMON(0x1700, altivec_assist, .unknown_exception)
462#endif
463#ifdef CONFIG_CBE_RAS
464 STD_EXCEPTION_COMMON(0x1200, cbe_system_error, .cbe_system_error_exception)
465 STD_EXCEPTION_COMMON(0x1600, cbe_maintenance, .cbe_maintenance_exception)
466 STD_EXCEPTION_COMMON(0x1800, cbe_thermal, .cbe_thermal_exception)
467#endif /* CONFIG_CBE_RAS */
468
469 .align 7
470system_call_entry:
471 b system_call_common
472
473/*
474 * Here we have detected that the kernel stack pointer is bad.
475 * R9 contains the saved CR, r13 points to the paca,
476 * r10 contains the (bad) kernel stack pointer,
477 * r11 and r12 contain the saved SRR0 and SRR1.
478 * We switch to using an emergency stack, save the registers there,
479 * and call kernel_bad_stack(), which panics.
480 */
481bad_stack:
482 ld r1,PACAEMERGSP(r13)
483 subi r1,r1,64+INT_FRAME_SIZE
484 std r9,_CCR(r1)
485 std r10,GPR1(r1)
486 std r11,_NIP(r1)
487 std r12,_MSR(r1)
488 mfspr r11,SPRN_DAR
489 mfspr r12,SPRN_DSISR
490 std r11,_DAR(r1)
491 std r12,_DSISR(r1)
492 mflr r10
493 mfctr r11
494 mfxer r12
495 std r10,_LINK(r1)
496 std r11,_CTR(r1)
497 std r12,_XER(r1)
498 SAVE_GPR(0,r1)
499 SAVE_GPR(2,r1)
500 SAVE_4GPRS(3,r1)
501 SAVE_2GPRS(7,r1)
502 SAVE_10GPRS(12,r1)
503 SAVE_10GPRS(22,r1)
504 lhz r12,PACA_TRAP_SAVE(r13)
505 std r12,_TRAP(r1)
506 addi r11,r1,INT_FRAME_SIZE
507 std r11,0(r1)
508 li r12,0
509 std r12,0(r11)
510 ld r2,PACATOC(r13)
5111: addi r3,r1,STACK_FRAME_OVERHEAD
512 bl .kernel_bad_stack
513 b 1b
514
515/*
516 * Here r13 points to the paca, r9 contains the saved CR,
517 * SRR0 and SRR1 are saved in r11 and r12,
518 * r9 - r13 are saved in paca->exgen.
519 */
520 .align 7
521 .globl data_access_common
522data_access_common:
523 mfspr r10,SPRN_DAR
524 std r10,PACA_EXGEN+EX_DAR(r13)
525 mfspr r10,SPRN_DSISR
526 stw r10,PACA_EXGEN+EX_DSISR(r13)
527 EXCEPTION_PROLOG_COMMON(0x300, PACA_EXGEN)
528 ld r3,PACA_EXGEN+EX_DAR(r13)
529 lwz r4,PACA_EXGEN+EX_DSISR(r13)
530 li r5,0x300
531 b .do_hash_page /* Try to handle as hpte fault */
532
533 .align 7
534 .globl instruction_access_common
535instruction_access_common:
536 EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN)
537 ld r3,_NIP(r1)
538 andis. r4,r12,0x5820
539 li r5,0x400
540 b .do_hash_page /* Try to handle as hpte fault */
541
542/*
543 * Here is the common SLB miss user that is used when going to virtual
544 * mode for SLB misses, that is currently not used
545 */
546#ifdef __DISABLED__
547 .align 7
548 .globl slb_miss_user_common
549slb_miss_user_common:
550 mflr r10
551 std r3,PACA_EXGEN+EX_DAR(r13)
552 stw r9,PACA_EXGEN+EX_CCR(r13)
553 std r10,PACA_EXGEN+EX_LR(r13)
554 std r11,PACA_EXGEN+EX_SRR0(r13)
555 bl .slb_allocate_user
556
557 ld r10,PACA_EXGEN+EX_LR(r13)
558 ld r3,PACA_EXGEN+EX_R3(r13)
559 lwz r9,PACA_EXGEN+EX_CCR(r13)
560 ld r11,PACA_EXGEN+EX_SRR0(r13)
561 mtlr r10
562 beq- slb_miss_fault
563
564 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
565 beq- unrecov_user_slb
566 mfmsr r10
567
568.machine push
569.machine "power4"
570 mtcrf 0x80,r9
571.machine pop
572
573 clrrdi r10,r10,2 /* clear RI before setting SRR0/1 */
574 mtmsrd r10,1
575
576 mtspr SRR0,r11
577 mtspr SRR1,r12
578
579 ld r9,PACA_EXGEN+EX_R9(r13)
580 ld r10,PACA_EXGEN+EX_R10(r13)
581 ld r11,PACA_EXGEN+EX_R11(r13)
582 ld r12,PACA_EXGEN+EX_R12(r13)
583 ld r13,PACA_EXGEN+EX_R13(r13)
584 rfid
585 b .
586
587slb_miss_fault:
588 EXCEPTION_PROLOG_COMMON(0x380, PACA_EXGEN)
589 ld r4,PACA_EXGEN+EX_DAR(r13)
590 li r5,0
591 std r4,_DAR(r1)
592 std r5,_DSISR(r1)
593 b handle_page_fault
594
595unrecov_user_slb:
596 EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN)
597 DISABLE_INTS
598 bl .save_nvgprs
5991: addi r3,r1,STACK_FRAME_OVERHEAD
600 bl .unrecoverable_exception
601 b 1b
602
603#endif /* __DISABLED__ */
604
605
606/*
607 * r13 points to the PACA, r9 contains the saved CR,
608 * r12 contain the saved SRR1, SRR0 is still ready for return
609 * r3 has the faulting address
610 * r9 - r13 are saved in paca->exslb.
611 * r3 is saved in paca->slb_r3
612 * We assume we aren't going to take any exceptions during this procedure.
613 */
614_GLOBAL(slb_miss_realmode)
615 mflr r10
616#ifdef CONFIG_RELOCATABLE
617 mtctr r11
618#endif
619
620 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
621 std r10,PACA_EXSLB+EX_LR(r13) /* save LR */
622
623 bl .slb_allocate_realmode
624
625 /* All done -- return from exception. */
626
627 ld r10,PACA_EXSLB+EX_LR(r13)
628 ld r3,PACA_EXSLB+EX_R3(r13)
629 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
630#ifdef CONFIG_PPC_ISERIES
631BEGIN_FW_FTR_SECTION
632 ld r11,PACALPPACAPTR(r13)
633 ld r11,LPPACASRR0(r11) /* get SRR0 value */
634END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
635#endif /* CONFIG_PPC_ISERIES */
636
637 mtlr r10
638
639 andi. r10,r12,MSR_RI /* check for unrecoverable exception */
640 beq- 2f
641
642.machine push
643.machine "power4"
644 mtcrf 0x80,r9
645 mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
646.machine pop
647
648#ifdef CONFIG_PPC_ISERIES
649BEGIN_FW_FTR_SECTION
650 mtspr SPRN_SRR0,r11
651 mtspr SPRN_SRR1,r12
652END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
653#endif /* CONFIG_PPC_ISERIES */
654 ld r9,PACA_EXSLB+EX_R9(r13)
655 ld r10,PACA_EXSLB+EX_R10(r13)
656 ld r11,PACA_EXSLB+EX_R11(r13)
657 ld r12,PACA_EXSLB+EX_R12(r13)
658 ld r13,PACA_EXSLB+EX_R13(r13)
659 rfid
660 b . /* prevent speculative execution */
661
6622:
663#ifdef CONFIG_PPC_ISERIES
664BEGIN_FW_FTR_SECTION
665 b unrecov_slb
666END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
667#endif /* CONFIG_PPC_ISERIES */
668 mfspr r11,SPRN_SRR0
669 ld r10,PACAKBASE(r13)
670 LOAD_HANDLER(r10,unrecov_slb)
671 mtspr SPRN_SRR0,r10
672 ld r10,PACAKMSR(r13)
673 mtspr SPRN_SRR1,r10
674 rfid
675 b .
676
677unrecov_slb:
678 EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
679 DISABLE_INTS
680 bl .save_nvgprs
6811: addi r3,r1,STACK_FRAME_OVERHEAD
682 bl .unrecoverable_exception
683 b 1b
684
685 .align 7
686 .globl hardware_interrupt_common
687 .globl hardware_interrupt_entry
688hardware_interrupt_common:
689 EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN)
690 FINISH_NAP
691hardware_interrupt_entry:
692 DISABLE_INTS
693BEGIN_FTR_SECTION
694 bl .ppc64_runlatch_on
695END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
696 addi r3,r1,STACK_FRAME_OVERHEAD
697 bl .do_IRQ
698 b .ret_from_except_lite
699
700#ifdef CONFIG_PPC_970_NAP
701power4_fixup_nap:
702 andc r9,r9,r10
703 std r9,TI_LOCAL_FLAGS(r11)
704 ld r10,_LINK(r1) /* make idle task do the */
705 std r10,_NIP(r1) /* equivalent of a blr */
706 blr
707#endif
708
709 .align 7
710 .globl alignment_common
711alignment_common:
712 mfspr r10,SPRN_DAR
713 std r10,PACA_EXGEN+EX_DAR(r13)
714 mfspr r10,SPRN_DSISR
715 stw r10,PACA_EXGEN+EX_DSISR(r13)
716 EXCEPTION_PROLOG_COMMON(0x600, PACA_EXGEN)
717 ld r3,PACA_EXGEN+EX_DAR(r13)
718 lwz r4,PACA_EXGEN+EX_DSISR(r13)
719 std r3,_DAR(r1)
720 std r4,_DSISR(r1)
721 bl .save_nvgprs
722 addi r3,r1,STACK_FRAME_OVERHEAD
723 ENABLE_INTS
724 bl .alignment_exception
725 b .ret_from_except
726
727 .align 7
728 .globl program_check_common
729program_check_common:
730 EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
731 bl .save_nvgprs
732 addi r3,r1,STACK_FRAME_OVERHEAD
733 ENABLE_INTS
734 bl .program_check_exception
735 b .ret_from_except
736
737 .align 7
738 .globl fp_unavailable_common
739fp_unavailable_common:
740 EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
741 bne 1f /* if from user, just load it up */
742 bl .save_nvgprs
743 addi r3,r1,STACK_FRAME_OVERHEAD
744 ENABLE_INTS
745 bl .kernel_fp_unavailable_exception
746 BUG_OPCODE
7471: bl .load_up_fpu
748 b fast_exception_return
749
750 .align 7
751 .globl altivec_unavailable_common
752altivec_unavailable_common:
753 EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN)
754#ifdef CONFIG_ALTIVEC
755BEGIN_FTR_SECTION
756 beq 1f
757 bl .load_up_altivec
758 b fast_exception_return
7591:
760END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
761#endif
762 bl .save_nvgprs
763 addi r3,r1,STACK_FRAME_OVERHEAD
764 ENABLE_INTS
765 bl .altivec_unavailable_exception
766 b .ret_from_except
767
768 .align 7
769 .globl vsx_unavailable_common
770vsx_unavailable_common:
771 EXCEPTION_PROLOG_COMMON(0xf40, PACA_EXGEN)
772#ifdef CONFIG_VSX
773BEGIN_FTR_SECTION
774 bne .load_up_vsx
7751:
776END_FTR_SECTION_IFSET(CPU_FTR_VSX)
777#endif
778 bl .save_nvgprs
779 addi r3,r1,STACK_FRAME_OVERHEAD
780 ENABLE_INTS
781 bl .vsx_unavailable_exception
782 b .ret_from_except
783
784 .align 7
785 .globl __end_handlers
786__end_handlers:
787
788/*
789 * Return from an exception with minimal checks.
790 * The caller is assumed to have done EXCEPTION_PROLOG_COMMON.
791 * If interrupts have been enabled, or anything has been
792 * done that might have changed the scheduling status of
793 * any task or sent any task a signal, you should use
794 * ret_from_except or ret_from_except_lite instead of this.
795 */ 162 */
796fast_exc_return_irq: /* restores irq state too */ 163#ifdef CONFIG_PPC_BOOK3S
797 ld r3,SOFTE(r1) 164#include "exceptions-64s.S"
798 TRACE_AND_RESTORE_IRQ(r3);
799 ld r12,_MSR(r1)
800 rldicl r4,r12,49,63 /* get MSR_EE to LSB */
801 stb r4,PACAHARDIRQEN(r13) /* restore paca->hard_enabled */
802 b 1f
803
804 .globl fast_exception_return
805fast_exception_return:
806 ld r12,_MSR(r1)
8071: ld r11,_NIP(r1)
808 andi. r3,r12,MSR_RI /* check if RI is set */
809 beq- unrecov_fer
810
811#ifdef CONFIG_VIRT_CPU_ACCOUNTING
812 andi. r3,r12,MSR_PR
813 beq 2f
814 ACCOUNT_CPU_USER_EXIT(r3, r4)
8152:
816#endif 165#endif
817 166
818 ld r3,_CCR(r1)
819 ld r4,_LINK(r1)
820 ld r5,_CTR(r1)
821 ld r6,_XER(r1)
822 mtcr r3
823 mtlr r4
824 mtctr r5
825 mtxer r6
826 REST_GPR(0, r1)
827 REST_8GPRS(2, r1)
828
829 mfmsr r10
830 rldicl r10,r10,48,1 /* clear EE */
831 rldicr r10,r10,16,61 /* clear RI (LE is 0 already) */
832 mtmsrd r10,1
833
834 mtspr SPRN_SRR1,r12
835 mtspr SPRN_SRR0,r11
836 REST_4GPRS(10, r1)
837 ld r1,GPR1(r1)
838 rfid
839 b . /* prevent speculative execution */
840
841unrecov_fer:
842 bl .save_nvgprs
8431: addi r3,r1,STACK_FRAME_OVERHEAD
844 bl .unrecoverable_exception
845 b 1b
846
847#ifdef CONFIG_ALTIVEC
848/*
849 * load_up_altivec(unused, unused, tsk)
850 * Disable VMX for the task which had it previously,
851 * and save its vector registers in its thread_struct.
852 * Enables the VMX for use in the kernel on return.
853 * On SMP we know the VMX is free, since we give it up every
854 * switch (ie, no lazy save of the vector registers).
855 * On entry: r13 == 'current' && last_task_used_altivec != 'current'
856 */
857_STATIC(load_up_altivec)
858 mfmsr r5 /* grab the current MSR */
859 oris r5,r5,MSR_VEC@h
860 mtmsrd r5 /* enable use of VMX now */
861 isync
862
863/*
864 * For SMP, we don't do lazy VMX switching because it just gets too
865 * horrendously complex, especially when a task switches from one CPU
866 * to another. Instead we call giveup_altvec in switch_to.
867 * VRSAVE isn't dealt with here, that is done in the normal context
868 * switch code. Note that we could rely on vrsave value to eventually
869 * avoid saving all of the VREGs here...
870 */
871#ifndef CONFIG_SMP
872 ld r3,last_task_used_altivec@got(r2)
873 ld r4,0(r3)
874 cmpdi 0,r4,0
875 beq 1f
876 /* Save VMX state to last_task_used_altivec's THREAD struct */
877 addi r4,r4,THREAD
878 SAVE_32VRS(0,r5,r4)
879 mfvscr vr0
880 li r10,THREAD_VSCR
881 stvx vr0,r10,r4
882 /* Disable VMX for last_task_used_altivec */
883 ld r5,PT_REGS(r4)
884 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
885 lis r6,MSR_VEC@h
886 andc r4,r4,r6
887 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
8881:
889#endif /* CONFIG_SMP */
890 /* Hack: if we get an altivec unavailable trap with VRSAVE
891 * set to all zeros, we assume this is a broken application
892 * that fails to set it properly, and thus we switch it to
893 * all 1's
894 */
895 mfspr r4,SPRN_VRSAVE
896 cmpdi 0,r4,0
897 bne+ 1f
898 li r4,-1
899 mtspr SPRN_VRSAVE,r4
9001:
901 /* enable use of VMX after return */
902 ld r4,PACACURRENT(r13)
903 addi r5,r4,THREAD /* Get THREAD */
904 oris r12,r12,MSR_VEC@h
905 std r12,_MSR(r1)
906 li r4,1
907 li r10,THREAD_VSCR
908 stw r4,THREAD_USED_VR(r5)
909 lvx vr0,r10,r5
910 mtvscr vr0
911 REST_32VRS(0,r4,r5)
912#ifndef CONFIG_SMP
913 /* Update last_task_used_math to 'current' */
914 subi r4,r5,THREAD /* Back to 'current' */
915 std r4,0(r3)
916#endif /* CONFIG_SMP */
917 /* restore registers and return */
918 blr
919#endif /* CONFIG_ALTIVEC */
920
921#ifdef CONFIG_VSX
922/*
923 * load_up_vsx(unused, unused, tsk)
924 * Disable VSX for the task which had it previously,
925 * and save its vector registers in its thread_struct.
926 * Reuse the fp and vsx saves, but first check to see if they have
927 * been saved already.
928 * On entry: r13 == 'current' && last_task_used_vsx != 'current'
929 */
930_STATIC(load_up_vsx)
931/* Load FP and VSX registers if they haven't been done yet */
932 andi. r5,r12,MSR_FP
933 beql+ load_up_fpu /* skip if already loaded */
934 andis. r5,r12,MSR_VEC@h
935 beql+ load_up_altivec /* skip if already loaded */
936
937#ifndef CONFIG_SMP
938 ld r3,last_task_used_vsx@got(r2)
939 ld r4,0(r3)
940 cmpdi 0,r4,0
941 beq 1f
942 /* Disable VSX for last_task_used_vsx */
943 addi r4,r4,THREAD
944 ld r5,PT_REGS(r4)
945 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
946 lis r6,MSR_VSX@h
947 andc r6,r4,r6
948 std r6,_MSR-STACK_FRAME_OVERHEAD(r5)
9491:
950#endif /* CONFIG_SMP */
951 ld r4,PACACURRENT(r13)
952 addi r4,r4,THREAD /* Get THREAD */
953 li r6,1
954 stw r6,THREAD_USED_VSR(r4) /* ... also set thread used vsr */
955 /* enable use of VSX after return */
956 oris r12,r12,MSR_VSX@h
957 std r12,_MSR(r1)
958#ifndef CONFIG_SMP
959 /* Update last_task_used_math to 'current' */
960 ld r4,PACACURRENT(r13)
961 std r4,0(r3)
962#endif /* CONFIG_SMP */
963 b fast_exception_return
964#endif /* CONFIG_VSX */
965
966/*
967 * Hash table stuff
968 */
969 .align 7
970_STATIC(do_hash_page)
971 std r3,_DAR(r1)
972 std r4,_DSISR(r1)
973
974 andis. r0,r4,0xa450 /* weird error? */
975 bne- handle_page_fault /* if not, try to insert a HPTE */
976BEGIN_FTR_SECTION
977 andis. r0,r4,0x0020 /* Is it a segment table fault? */
978 bne- do_ste_alloc /* If so handle it */
979END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
980
981 /*
982 * On iSeries, we soft-disable interrupts here, then
983 * hard-enable interrupts so that the hash_page code can spin on
984 * the hash_table_lock without problems on a shared processor.
985 */
986 DISABLE_INTS
987
988 /*
989 * Currently, trace_hardirqs_off() will be called by DISABLE_INTS
990 * and will clobber volatile registers when irq tracing is enabled
991 * so we need to reload them. It may be possible to be smarter here
992 * and move the irq tracing elsewhere but let's keep it simple for
993 * now
994 */
995#ifdef CONFIG_TRACE_IRQFLAGS
996 ld r3,_DAR(r1)
997 ld r4,_DSISR(r1)
998 ld r5,_TRAP(r1)
999 ld r12,_MSR(r1)
1000 clrrdi r5,r5,4
1001#endif /* CONFIG_TRACE_IRQFLAGS */
1002 /*
1003 * We need to set the _PAGE_USER bit if MSR_PR is set or if we are
1004 * accessing a userspace segment (even from the kernel). We assume
1005 * kernel addresses always have the high bit set.
1006 */
1007 rlwinm r4,r4,32-25+9,31-9,31-9 /* DSISR_STORE -> _PAGE_RW */
1008 rotldi r0,r3,15 /* Move high bit into MSR_PR posn */
1009 orc r0,r12,r0 /* MSR_PR | ~high_bit */
1010 rlwimi r4,r0,32-13,30,30 /* becomes _PAGE_USER access bit */
1011 ori r4,r4,1 /* add _PAGE_PRESENT */
1012 rlwimi r4,r5,22+2,31-2,31-2 /* Set _PAGE_EXEC if trap is 0x400 */
1013
1014 /*
1015 * r3 contains the faulting address
1016 * r4 contains the required access permissions
1017 * r5 contains the trap number
1018 *
1019 * at return r3 = 0 for success
1020 */
1021 bl .hash_page /* build HPTE if possible */
1022 cmpdi r3,0 /* see if hash_page succeeded */
1023
1024BEGIN_FW_FTR_SECTION
1025 /*
1026 * If we had interrupts soft-enabled at the point where the
1027 * DSI/ISI occurred, and an interrupt came in during hash_page,
1028 * handle it now.
1029 * We jump to ret_from_except_lite rather than fast_exception_return
1030 * because ret_from_except_lite will check for and handle pending
1031 * interrupts if necessary.
1032 */
1033 beq 13f
1034END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
1035
1036BEGIN_FW_FTR_SECTION
1037 /*
1038 * Here we have interrupts hard-disabled, so it is sufficient
1039 * to restore paca->{soft,hard}_enable and get out.
1040 */
1041 beq fast_exc_return_irq /* Return from exception on success */
1042END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
1043
1044 /* For a hash failure, we don't bother re-enabling interrupts */
1045 ble- 12f
1046
1047 /*
1048 * hash_page couldn't handle it, set soft interrupt enable back
1049 * to what it was before the trap. Note that .raw_local_irq_restore
1050 * handles any interrupts pending at this point.
1051 */
1052 ld r3,SOFTE(r1)
1053 TRACE_AND_RESTORE_IRQ_PARTIAL(r3, 11f)
1054 bl .raw_local_irq_restore
1055 b 11f
1056
1057/* Here we have a page fault that hash_page can't handle. */
1058handle_page_fault:
1059 ENABLE_INTS
106011: ld r4,_DAR(r1)
1061 ld r5,_DSISR(r1)
1062 addi r3,r1,STACK_FRAME_OVERHEAD
1063 bl .do_page_fault
1064 cmpdi r3,0
1065 beq+ 13f
1066 bl .save_nvgprs
1067 mr r5,r3
1068 addi r3,r1,STACK_FRAME_OVERHEAD
1069 lwz r4,_DAR(r1)
1070 bl .bad_page_fault
1071 b .ret_from_except
1072
107313: b .ret_from_except_lite
1074
1075/* We have a page fault that hash_page could handle but HV refused
1076 * the PTE insertion
1077 */
107812: bl .save_nvgprs
1079 mr r5,r3
1080 addi r3,r1,STACK_FRAME_OVERHEAD
1081 ld r4,_DAR(r1)
1082 bl .low_hash_fault
1083 b .ret_from_except
1084
1085 /* here we have a segment miss */
1086do_ste_alloc:
1087 bl .ste_allocate /* try to insert stab entry */
1088 cmpdi r3,0
1089 bne- handle_page_fault
1090 b fast_exception_return
1091
1092/*
1093 * r13 points to the PACA, r9 contains the saved CR,
1094 * r11 and r12 contain the saved SRR0 and SRR1.
1095 * r9 - r13 are saved in paca->exslb.
1096 * We assume we aren't going to take any exceptions during this procedure.
1097 * We assume (DAR >> 60) == 0xc.
1098 */
1099 .align 7
1100_GLOBAL(do_stab_bolted)
1101 stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
1102 std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */
1103
1104 /* Hash to the primary group */
1105 ld r10,PACASTABVIRT(r13)
1106 mfspr r11,SPRN_DAR
1107 srdi r11,r11,28
1108 rldimi r10,r11,7,52 /* r10 = first ste of the group */
1109
1110 /* Calculate VSID */
1111 /* This is a kernel address, so protovsid = ESID */
1112 ASM_VSID_SCRAMBLE(r11, r9, 256M)
1113 rldic r9,r11,12,16 /* r9 = vsid << 12 */
1114
1115 /* Search the primary group for a free entry */
11161: ld r11,0(r10) /* Test valid bit of the current ste */
1117 andi. r11,r11,0x80
1118 beq 2f
1119 addi r10,r10,16
1120 andi. r11,r10,0x70
1121 bne 1b
1122
1123 /* Stick for only searching the primary group for now. */
1124 /* At least for now, we use a very simple random castout scheme */
1125 /* Use the TB as a random number ; OR in 1 to avoid entry 0 */
1126 mftb r11
1127 rldic r11,r11,4,57 /* r11 = (r11 << 4) & 0x70 */
1128 ori r11,r11,0x10
1129
1130 /* r10 currently points to an ste one past the group of interest */
1131 /* make it point to the randomly selected entry */
1132 subi r10,r10,128
1133 or r10,r10,r11 /* r10 is the entry to invalidate */
1134
1135 isync /* mark the entry invalid */
1136 ld r11,0(r10)
1137 rldicl r11,r11,56,1 /* clear the valid bit */
1138 rotldi r11,r11,8
1139 std r11,0(r10)
1140 sync
1141
1142 clrrdi r11,r11,28 /* Get the esid part of the ste */
1143 slbie r11
1144
11452: std r9,8(r10) /* Store the vsid part of the ste */
1146 eieio
1147
1148 mfspr r11,SPRN_DAR /* Get the new esid */
1149 clrrdi r11,r11,28 /* Permits a full 32b of ESID */
1150 ori r11,r11,0x90 /* Turn on valid and kp */
1151 std r11,0(r10) /* Put new entry back into the stab */
1152
1153 sync
1154
1155 /* All done -- return from exception. */
1156 lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
1157 ld r11,PACA_EXSLB+EX_SRR0(r13) /* get saved SRR0 */
1158
1159 andi. r10,r12,MSR_RI
1160 beq- unrecov_slb
1161
1162 mtcrf 0x80,r9 /* restore CR */
1163
1164 mfmsr r10
1165 clrrdi r10,r10,2
1166 mtmsrd r10,1
1167
1168 mtspr SPRN_SRR0,r11
1169 mtspr SPRN_SRR1,r12
1170 ld r9,PACA_EXSLB+EX_R9(r13)
1171 ld r10,PACA_EXSLB+EX_R10(r13)
1172 ld r11,PACA_EXSLB+EX_R11(r13)
1173 ld r12,PACA_EXSLB+EX_R12(r13)
1174 ld r13,PACA_EXSLB+EX_R13(r13)
1175 rfid
1176 b . /* prevent speculative execution */
1177
1178/*
1179 * Space for CPU0's segment table.
1180 *
1181 * On iSeries, the hypervisor must fill in at least one entry before
1182 * we get control (with relocate on). The address is given to the hv
1183 * as a page number (see xLparMap below), so this must be at a
1184 * fixed address (the linker can't compute (u64)&initial_stab >>
1185 * PAGE_SHIFT).
1186 */
1187 . = STAB0_OFFSET /* 0x6000 */
1188 .globl initial_stab
1189initial_stab:
1190 .space 4096
1191
1192#ifdef CONFIG_PPC_PSERIES
1193/*
1194 * Data area reserved for FWNMI option.
1195 * This address (0x7000) is fixed by the RPA.
1196 */
1197 .= 0x7000
1198 .globl fwnmi_data_area
1199fwnmi_data_area:
1200#endif /* CONFIG_PPC_PSERIES */
1201
1202 /* iSeries does not use the FWNMI stuff, so it is safe to put
1203 * this here, even if we later allow kernels that will boot on
1204 * both pSeries and iSeries */
1205#ifdef CONFIG_PPC_ISERIES
1206 . = LPARMAP_PHYS
1207 .globl xLparMap
1208xLparMap:
1209 .quad HvEsidsToMap /* xNumberEsids */
1210 .quad HvRangesToMap /* xNumberRanges */
1211 .quad STAB0_PAGE /* xSegmentTableOffs */
1212 .zero 40 /* xRsvd */
1213 /* xEsids (HvEsidsToMap entries of 2 quads) */
1214 .quad PAGE_OFFSET_ESID /* xKernelEsid */
1215 .quad PAGE_OFFSET_VSID /* xKernelVsid */
1216 .quad VMALLOC_START_ESID /* xKernelEsid */
1217 .quad VMALLOC_START_VSID /* xKernelVsid */
1218 /* xRanges (HvRangesToMap entries of 3 quads) */
1219 .quad HvPagesToMap /* xPages */
1220 .quad 0 /* xOffset */
1221 .quad PAGE_OFFSET_VSID << (SID_SHIFT - HW_PAGE_SHIFT) /* xVPN */
1222
1223#endif /* CONFIG_PPC_ISERIES */
1224
1225#ifdef CONFIG_PPC_PSERIES
1226 . = 0x8000
1227#endif /* CONFIG_PPC_PSERIES */
1228 167
1229/* 168/*
1230 * On pSeries and most other platforms, secondary processors spin 169 * On pSeries and most other platforms, secondary processors spin
diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h
index 95f39f1e68d4..5f9febc8d143 100644
--- a/arch/powerpc/kernel/head_booke.h
+++ b/arch/powerpc/kernel/head_booke.h
@@ -256,7 +256,7 @@ label:
256 * off DE in the DSRR1 value and clearing the debug status. \ 256 * off DE in the DSRR1 value and clearing the debug status. \
257 */ \ 257 */ \
258 mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \ 258 mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \
259 andis. r10,r10,DBSR_IC@h; \ 259 andis. r10,r10,(DBSR_IC|DBSR_BT)@h; \
260 beq+ 2f; \ 260 beq+ 2f; \
261 \ 261 \
262 lis r10,KERNELBASE@h; /* check if exception in vectors */ \ 262 lis r10,KERNELBASE@h; /* check if exception in vectors */ \
@@ -271,7 +271,7 @@ label:
271 \ 271 \
272 /* here it looks like we got an inappropriate debug exception. */ \ 272 /* here it looks like we got an inappropriate debug exception. */ \
2731: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CDRR1 value */ \ 2731: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CDRR1 value */ \
274 lis r10,DBSR_IC@h; /* clear the IC event */ \ 274 lis r10,(DBSR_IC|DBSR_BT)@h; /* clear the IC event */ \
275 mtspr SPRN_DBSR,r10; \ 275 mtspr SPRN_DBSR,r10; \
276 /* restore state and get out */ \ 276 /* restore state and get out */ \
277 lwz r10,_CCR(r11); \ 277 lwz r10,_CCR(r11); \
@@ -309,7 +309,7 @@ label:
309 * off DE in the CSRR1 value and clearing the debug status. \ 309 * off DE in the CSRR1 value and clearing the debug status. \
310 */ \ 310 */ \
311 mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \ 311 mfspr r10,SPRN_DBSR; /* check single-step/branch taken */ \
312 andis. r10,r10,DBSR_IC@h; \ 312 andis. r10,r10,(DBSR_IC|DBSR_BT)@h; \
313 beq+ 2f; \ 313 beq+ 2f; \
314 \ 314 \
315 lis r10,KERNELBASE@h; /* check if exception in vectors */ \ 315 lis r10,KERNELBASE@h; /* check if exception in vectors */ \
@@ -317,14 +317,14 @@ label:
317 cmplw r12,r10; \ 317 cmplw r12,r10; \
318 blt+ 2f; /* addr below exception vectors */ \ 318 blt+ 2f; /* addr below exception vectors */ \
319 \ 319 \
320 lis r10,DebugCrit@h; \ 320 lis r10,DebugCrit@h; \
321 ori r10,r10,DebugCrit@l; \ 321 ori r10,r10,DebugCrit@l; \
322 cmplw r12,r10; \ 322 cmplw r12,r10; \
323 bgt+ 2f; /* addr above exception vectors */ \ 323 bgt+ 2f; /* addr above exception vectors */ \
324 \ 324 \
325 /* here it looks like we got an inappropriate debug exception. */ \ 325 /* here it looks like we got an inappropriate debug exception. */ \
3261: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CSRR1 value */ \ 3261: rlwinm r9,r9,0,~MSR_DE; /* clear DE in the CSRR1 value */ \
327 lis r10,DBSR_IC@h; /* clear the IC event */ \ 327 lis r10,(DBSR_IC|DBSR_BT)@h; /* clear the IC event */ \
328 mtspr SPRN_DBSR,r10; \ 328 mtspr SPRN_DBSR,r10; \
329 /* restore state and get out */ \ 329 /* restore state and get out */ \
330 lwz r10,_CCR(r11); \ 330 lwz r10,_CCR(r11); \
diff --git a/arch/powerpc/kernel/init_task.c b/arch/powerpc/kernel/init_task.c
index 688b329800bd..ffc4253fef55 100644
--- a/arch/powerpc/kernel/init_task.c
+++ b/arch/powerpc/kernel/init_task.c
@@ -9,10 +9,6 @@
9 9
10static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 10static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
11static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 11static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
12struct mm_struct init_mm = INIT_MM(init_mm);
13
14EXPORT_SYMBOL(init_mm);
15
16/* 12/*
17 * Initial thread structure. 13 * Initial thread structure.
18 * 14 *
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 844d3f882a15..f7f376ea7b17 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -118,6 +118,7 @@ notrace void raw_local_irq_restore(unsigned long en)
118 if (!en) 118 if (!en)
119 return; 119 return;
120 120
121#ifdef CONFIG_PPC_STD_MMU_64
121 if (firmware_has_feature(FW_FEATURE_ISERIES)) { 122 if (firmware_has_feature(FW_FEATURE_ISERIES)) {
122 /* 123 /*
123 * Do we need to disable preemption here? Not really: in the 124 * Do we need to disable preemption here? Not really: in the
@@ -135,6 +136,7 @@ notrace void raw_local_irq_restore(unsigned long en)
135 if (local_paca->lppaca_ptr->int_dword.any_int) 136 if (local_paca->lppaca_ptr->int_dword.any_int)
136 iseries_handle_interrupts(); 137 iseries_handle_interrupts();
137 } 138 }
139#endif /* CONFIG_PPC_STD_MMU_64 */
138 140
139 if (test_perf_counter_pending()) { 141 if (test_perf_counter_pending()) {
140 clear_perf_counter_pending(); 142 clear_perf_counter_pending();
@@ -254,77 +256,84 @@ void fixup_irqs(cpumask_t map)
254} 256}
255#endif 257#endif
256 258
257void do_IRQ(struct pt_regs *regs)
258{
259 struct pt_regs *old_regs = set_irq_regs(regs);
260 unsigned int irq;
261#ifdef CONFIG_IRQSTACKS 259#ifdef CONFIG_IRQSTACKS
260static inline void handle_one_irq(unsigned int irq)
261{
262 struct thread_info *curtp, *irqtp; 262 struct thread_info *curtp, *irqtp;
263#endif 263 unsigned long saved_sp_limit;
264 struct irq_desc *desc;
264 265
265 irq_enter(); 266 /* Switch to the irq stack to handle this */
267 curtp = current_thread_info();
268 irqtp = hardirq_ctx[smp_processor_id()];
269
270 if (curtp == irqtp) {
271 /* We're already on the irq stack, just handle it */
272 generic_handle_irq(irq);
273 return;
274 }
275
276 desc = irq_desc + irq;
277 saved_sp_limit = current->thread.ksp_limit;
278
279 irqtp->task = curtp->task;
280 irqtp->flags = 0;
281
282 /* Copy the softirq bits in preempt_count so that the
283 * softirq checks work in the hardirq context. */
284 irqtp->preempt_count = (irqtp->preempt_count & ~SOFTIRQ_MASK) |
285 (curtp->preempt_count & SOFTIRQ_MASK);
286
287 current->thread.ksp_limit = (unsigned long)irqtp +
288 _ALIGN_UP(sizeof(struct thread_info), 16);
289
290 call_handle_irq(irq, desc, irqtp, desc->handle_irq);
291 current->thread.ksp_limit = saved_sp_limit;
292 irqtp->task = NULL;
293
294 /* Set any flag that may have been set on the
295 * alternate stack
296 */
297 if (irqtp->flags)
298 set_bits(irqtp->flags, &curtp->flags);
299}
300#else
301static inline void handle_one_irq(unsigned int irq)
302{
303 generic_handle_irq(irq);
304}
305#endif
266 306
307static inline void check_stack_overflow(void)
308{
267#ifdef CONFIG_DEBUG_STACKOVERFLOW 309#ifdef CONFIG_DEBUG_STACKOVERFLOW
268 /* Debugging check for stack overflow: is there less than 2KB free? */ 310 long sp;
269 {
270 long sp;
271 311
272 sp = __get_SP() & (THREAD_SIZE-1); 312 sp = __get_SP() & (THREAD_SIZE-1);
273 313
274 if (unlikely(sp < (sizeof(struct thread_info) + 2048))) { 314 /* check for stack overflow: is there less than 2KB free? */
275 printk("do_IRQ: stack overflow: %ld\n", 315 if (unlikely(sp < (sizeof(struct thread_info) + 2048))) {
276 sp - sizeof(struct thread_info)); 316 printk("do_IRQ: stack overflow: %ld\n",
277 dump_stack(); 317 sp - sizeof(struct thread_info));
278 } 318 dump_stack();
279 } 319 }
280#endif 320#endif
321}
281 322
282 /* 323void do_IRQ(struct pt_regs *regs)
283 * Every platform is required to implement ppc_md.get_irq. 324{
284 * This function will either return an irq number or NO_IRQ to 325 struct pt_regs *old_regs = set_irq_regs(regs);
285 * indicate there are no more pending. 326 unsigned int irq;
286 * The value NO_IRQ_IGNORE is for buggy hardware and means that this
287 * IRQ has already been handled. -- Tom
288 */
289 irq = ppc_md.get_irq();
290 327
291 if (irq != NO_IRQ && irq != NO_IRQ_IGNORE) { 328 irq_enter();
292#ifdef CONFIG_IRQSTACKS
293 /* Switch to the irq stack to handle this */
294 curtp = current_thread_info();
295 irqtp = hardirq_ctx[smp_processor_id()];
296 if (curtp != irqtp) {
297 struct irq_desc *desc = irq_desc + irq;
298 void *handler = desc->handle_irq;
299 unsigned long saved_sp_limit = current->thread.ksp_limit;
300 if (handler == NULL)
301 handler = &__do_IRQ;
302 irqtp->task = curtp->task;
303 irqtp->flags = 0;
304
305 /* Copy the softirq bits in preempt_count so that the
306 * softirq checks work in the hardirq context.
307 */
308 irqtp->preempt_count =
309 (irqtp->preempt_count & ~SOFTIRQ_MASK) |
310 (curtp->preempt_count & SOFTIRQ_MASK);
311 329
312 current->thread.ksp_limit = (unsigned long)irqtp + 330 check_stack_overflow();
313 _ALIGN_UP(sizeof(struct thread_info), 16);
314 call_handle_irq(irq, desc, irqtp, handler);
315 current->thread.ksp_limit = saved_sp_limit;
316 irqtp->task = NULL;
317 331
332 irq = ppc_md.get_irq();
318 333
319 /* Set any flag that may have been set on the 334 if (irq != NO_IRQ && irq != NO_IRQ_IGNORE)
320 * alternate stack 335 handle_one_irq(irq);
321 */ 336 else if (irq != NO_IRQ_IGNORE)
322 if (irqtp->flags)
323 set_bits(irqtp->flags, &curtp->flags);
324 } else
325#endif
326 generic_handle_irq(irq);
327 } else if (irq != NO_IRQ_IGNORE)
328 /* That's not SMP safe ... but who cares ? */ 337 /* That's not SMP safe ... but who cares ? */
329 ppc_spurious_interrupts++; 338 ppc_spurious_interrupts++;
330 339
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 78b3f7840ade..2419cc706ff1 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -169,6 +169,9 @@ struct hvcall_ppp_data {
169 u8 unallocated_weight; 169 u8 unallocated_weight;
170 u16 active_procs_in_pool; 170 u16 active_procs_in_pool;
171 u16 active_system_procs; 171 u16 active_system_procs;
172 u16 phys_platform_procs;
173 u32 max_proc_cap_avail;
174 u32 entitled_proc_cap_avail;
172}; 175};
173 176
174/* 177/*
@@ -190,13 +193,18 @@ struct hvcall_ppp_data {
190 * XX - Unallocated Variable Processor Capacity Weight. 193 * XX - Unallocated Variable Processor Capacity Weight.
191 * XXXX - Active processors in Physical Processor Pool. 194 * XXXX - Active processors in Physical Processor Pool.
192 * XXXX - Processors active on platform. 195 * XXXX - Processors active on platform.
196 * R8 (QQQQRRRRRRSSSSSS). if ibm,partition-performance-parameters-level >= 1
197 * XXXX - Physical platform procs allocated to virtualization.
198 * XXXXXX - Max procs capacity % available to the partitions pool.
199 * XXXXXX - Entitled procs capacity % available to the
200 * partitions pool.
193 */ 201 */
194static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data) 202static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data)
195{ 203{
196 unsigned long rc; 204 unsigned long rc;
197 unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; 205 unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
198 206
199 rc = plpar_hcall(H_GET_PPP, retbuf); 207 rc = plpar_hcall9(H_GET_PPP, retbuf);
200 208
201 ppp_data->entitlement = retbuf[0]; 209 ppp_data->entitlement = retbuf[0];
202 ppp_data->unallocated_entitlement = retbuf[1]; 210 ppp_data->unallocated_entitlement = retbuf[1];
@@ -210,6 +218,10 @@ static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data)
210 ppp_data->active_procs_in_pool = (retbuf[3] >> 2 * 8) & 0xffff; 218 ppp_data->active_procs_in_pool = (retbuf[3] >> 2 * 8) & 0xffff;
211 ppp_data->active_system_procs = retbuf[3] & 0xffff; 219 ppp_data->active_system_procs = retbuf[3] & 0xffff;
212 220
221 ppp_data->phys_platform_procs = retbuf[4] >> 6 * 8;
222 ppp_data->max_proc_cap_avail = (retbuf[4] >> 3 * 8) & 0xffffff;
223 ppp_data->entitled_proc_cap_avail = retbuf[4] & 0xffffff;
224
213 return rc; 225 return rc;
214} 226}
215 227
@@ -234,6 +246,8 @@ static unsigned h_pic(unsigned long *pool_idle_time,
234static void parse_ppp_data(struct seq_file *m) 246static void parse_ppp_data(struct seq_file *m)
235{ 247{
236 struct hvcall_ppp_data ppp_data; 248 struct hvcall_ppp_data ppp_data;
249 struct device_node *root;
250 const int *perf_level;
237 int rc; 251 int rc;
238 252
239 rc = h_get_ppp(&ppp_data); 253 rc = h_get_ppp(&ppp_data);
@@ -267,6 +281,28 @@ static void parse_ppp_data(struct seq_file *m)
267 seq_printf(m, "capped=%d\n", ppp_data.capped); 281 seq_printf(m, "capped=%d\n", ppp_data.capped);
268 seq_printf(m, "unallocated_capacity=%lld\n", 282 seq_printf(m, "unallocated_capacity=%lld\n",
269 ppp_data.unallocated_entitlement); 283 ppp_data.unallocated_entitlement);
284
285 /* The last bits of information returned from h_get_ppp are only
286 * valid if the ibm,partition-performance-parameters-level
287 * property is >= 1.
288 */
289 root = of_find_node_by_path("/");
290 if (root) {
291 perf_level = of_get_property(root,
292 "ibm,partition-performance-parameters-level",
293 NULL);
294 if (perf_level && (*perf_level >= 1)) {
295 seq_printf(m,
296 "physical_procs_allocated_to_virtualization=%d\n",
297 ppp_data.phys_platform_procs);
298 seq_printf(m, "max_proc_capacity_available=%d\n",
299 ppp_data.max_proc_cap_avail);
300 seq_printf(m, "entitled_proc_capacity_available=%d\n",
301 ppp_data.entitled_proc_cap_avail);
302 }
303
304 of_node_put(root);
305 }
270} 306}
271 307
272/** 308/**
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index b9530b2395a2..a5cf9c1356a6 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -457,98 +457,6 @@ _GLOBAL(disable_kernel_fp)
457 isync 457 isync
458 blr 458 blr
459 459
460#ifdef CONFIG_ALTIVEC
461
462#if 0 /* this has no callers for now */
463/*
464 * disable_kernel_altivec()
465 * Disable the VMX.
466 */
467_GLOBAL(disable_kernel_altivec)
468 mfmsr r3
469 rldicl r0,r3,(63-MSR_VEC_LG),1
470 rldicl r3,r0,(MSR_VEC_LG+1),0
471 mtmsrd r3 /* disable use of VMX now */
472 isync
473 blr
474#endif /* 0 */
475
476/*
477 * giveup_altivec(tsk)
478 * Disable VMX for the task given as the argument,
479 * and save the vector registers in its thread_struct.
480 * Enables the VMX for use in the kernel on return.
481 */
482_GLOBAL(giveup_altivec)
483 mfmsr r5
484 oris r5,r5,MSR_VEC@h
485 mtmsrd r5 /* enable use of VMX now */
486 isync
487 cmpdi 0,r3,0
488 beqlr- /* if no previous owner, done */
489 addi r3,r3,THREAD /* want THREAD of task */
490 ld r5,PT_REGS(r3)
491 cmpdi 0,r5,0
492 SAVE_32VRS(0,r4,r3)
493 mfvscr vr0
494 li r4,THREAD_VSCR
495 stvx vr0,r4,r3
496 beq 1f
497 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
498#ifdef CONFIG_VSX
499BEGIN_FTR_SECTION
500 lis r3,(MSR_VEC|MSR_VSX)@h
501FTR_SECTION_ELSE
502 lis r3,MSR_VEC@h
503ALT_FTR_SECTION_END_IFSET(CPU_FTR_VSX)
504#else
505 lis r3,MSR_VEC@h
506#endif
507 andc r4,r4,r3 /* disable FP for previous task */
508 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
5091:
510#ifndef CONFIG_SMP
511 li r5,0
512 ld r4,last_task_used_altivec@got(r2)
513 std r5,0(r4)
514#endif /* CONFIG_SMP */
515 blr
516
517#endif /* CONFIG_ALTIVEC */
518
519#ifdef CONFIG_VSX
520/*
521 * __giveup_vsx(tsk)
522 * Disable VSX for the task given as the argument.
523 * Does NOT save vsx registers.
524 * Enables the VSX for use in the kernel on return.
525 */
526_GLOBAL(__giveup_vsx)
527 mfmsr r5
528 oris r5,r5,MSR_VSX@h
529 mtmsrd r5 /* enable use of VSX now */
530 isync
531
532 cmpdi 0,r3,0
533 beqlr- /* if no previous owner, done */
534 addi r3,r3,THREAD /* want THREAD of task */
535 ld r5,PT_REGS(r3)
536 cmpdi 0,r5,0
537 beq 1f
538 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
539 lis r3,MSR_VSX@h
540 andc r4,r4,r3 /* disable VSX for previous task */
541 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
5421:
543#ifndef CONFIG_SMP
544 li r5,0
545 ld r4,last_task_used_vsx@got(r2)
546 std r5,0(r4)
547#endif /* CONFIG_SMP */
548 blr
549
550#endif /* CONFIG_VSX */
551
552/* kexec_wait(phys_cpu) 460/* kexec_wait(phys_cpu)
553 * 461 *
554 * wait for the flag to change, indicating this kernel is going away but 462 * wait for the flag to change, indicating this kernel is going away but
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index c744b327bcab..e9962c7f8a09 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -18,6 +18,8 @@
18 * field correctly */ 18 * field correctly */
19extern unsigned long __toc_start; 19extern unsigned long __toc_start;
20 20
21#ifdef CONFIG_PPC_BOOK3S
22
21/* 23/*
22 * The structure which the hypervisor knows about - this structure 24 * The structure which the hypervisor knows about - this structure
23 * should not cross a page boundary. The vpa_init/register_vpa call 25 * should not cross a page boundary. The vpa_init/register_vpa call
@@ -41,6 +43,10 @@ struct lppaca lppaca[] = {
41 }, 43 },
42}; 44};
43 45
46#endif /* CONFIG_PPC_BOOK3S */
47
48#ifdef CONFIG_PPC_STD_MMU_64
49
44/* 50/*
45 * 3 persistent SLBs are registered here. The buffer will be zero 51 * 3 persistent SLBs are registered here. The buffer will be zero
46 * initially, hence will all be invaild until we actually write them. 52 * initially, hence will all be invaild until we actually write them.
@@ -52,6 +58,8 @@ struct slb_shadow slb_shadow[] __cacheline_aligned = {
52 }, 58 },
53}; 59};
54 60
61#endif /* CONFIG_PPC_STD_MMU_64 */
62
55/* The Paca is an array with one entry per processor. Each contains an 63/* The Paca is an array with one entry per processor. Each contains an
56 * lppaca, which contains the information shared between the 64 * lppaca, which contains the information shared between the
57 * hypervisor and Linux. 65 * hypervisor and Linux.
@@ -77,15 +85,19 @@ void __init initialise_pacas(void)
77 for (cpu = 0; cpu < NR_CPUS; cpu++) { 85 for (cpu = 0; cpu < NR_CPUS; cpu++) {
78 struct paca_struct *new_paca = &paca[cpu]; 86 struct paca_struct *new_paca = &paca[cpu];
79 87
88#ifdef CONFIG_PPC_BOOK3S
80 new_paca->lppaca_ptr = &lppaca[cpu]; 89 new_paca->lppaca_ptr = &lppaca[cpu];
90#endif
81 new_paca->lock_token = 0x8000; 91 new_paca->lock_token = 0x8000;
82 new_paca->paca_index = cpu; 92 new_paca->paca_index = cpu;
83 new_paca->kernel_toc = kernel_toc; 93 new_paca->kernel_toc = kernel_toc;
84 new_paca->kernelbase = (unsigned long) _stext; 94 new_paca->kernelbase = (unsigned long) _stext;
85 new_paca->kernel_msr = MSR_KERNEL; 95 new_paca->kernel_msr = MSR_KERNEL;
86 new_paca->hw_cpu_id = 0xffff; 96 new_paca->hw_cpu_id = 0xffff;
87 new_paca->slb_shadow_ptr = &slb_shadow[cpu];
88 new_paca->__current = &init_task; 97 new_paca->__current = &init_task;
98#ifdef CONFIG_PPC_STD_MMU_64
99 new_paca->slb_shadow_ptr = &slb_shadow[cpu];
100#endif /* CONFIG_PPC_STD_MMU_64 */
89 101
90 } 102 }
91} 103}
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 4fee63cb53ff..5a56e97c5ac0 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1505,7 +1505,7 @@ void __init pcibios_resource_survey(void)
1505 * rest of the code later, for now, keep it as-is as our main 1505 * rest of the code later, for now, keep it as-is as our main
1506 * resource allocation function doesn't deal with sub-trees yet. 1506 * resource allocation function doesn't deal with sub-trees yet.
1507 */ 1507 */
1508void __devinit pcibios_claim_one_bus(struct pci_bus *bus) 1508void pcibios_claim_one_bus(struct pci_bus *bus)
1509{ 1509{
1510 struct pci_dev *dev; 1510 struct pci_dev *dev;
1511 struct pci_bus *child_bus; 1511 struct pci_bus *child_bus;
@@ -1533,7 +1533,6 @@ void __devinit pcibios_claim_one_bus(struct pci_bus *bus)
1533 list_for_each_entry(child_bus, &bus->children, node) 1533 list_for_each_entry(child_bus, &bus->children, node)
1534 pcibios_claim_one_bus(child_bus); 1534 pcibios_claim_one_bus(child_bus);
1535} 1535}
1536EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);
1537 1536
1538 1537
1539/* pcibios_finish_adding_to_bus 1538/* pcibios_finish_adding_to_bus
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index d473634e39e3..3ae1c666ff92 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -33,7 +33,6 @@ int pcibios_assign_bus_offset = 1;
33 33
34void pcibios_make_OF_bus_map(void); 34void pcibios_make_OF_bus_map(void);
35 35
36static void fixup_broken_pcnet32(struct pci_dev* dev);
37static void fixup_cpc710_pci64(struct pci_dev* dev); 36static void fixup_cpc710_pci64(struct pci_dev* dev);
38#ifdef CONFIG_PPC_OF 37#ifdef CONFIG_PPC_OF
39static u8* pci_to_OF_bus_map; 38static u8* pci_to_OF_bus_map;
@@ -72,16 +71,6 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MOTOROLA, PCI_ANY_ID, fixup_hide_host_res
72DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_hide_host_resource_fsl); 71DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_hide_host_resource_fsl);
73 72
74static void 73static void
75fixup_broken_pcnet32(struct pci_dev* dev)
76{
77 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
78 dev->vendor = PCI_VENDOR_ID_AMD;
79 pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
80 }
81}
82DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
83
84static void
85fixup_cpc710_pci64(struct pci_dev* dev) 74fixup_cpc710_pci64(struct pci_dev* dev)
86{ 75{
87 /* Hide the PCI64 BARs from the kernel as their content doesn't 76 /* Hide the PCI64 BARs from the kernel as their content doesn't
@@ -447,14 +436,6 @@ static int __init pcibios_init(void)
447 436
448subsys_initcall(pcibios_init); 437subsys_initcall(pcibios_init);
449 438
450/* the next one is stolen from the alpha port... */
451void __init
452pcibios_update_irq(struct pci_dev *dev, int irq)
453{
454 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
455 /* XXX FIXME - update OF device tree node interrupt property */
456}
457
458static struct pci_controller* 439static struct pci_controller*
459pci_bus_to_hose(int bus) 440pci_bus_to_hose(int bus)
460{ 441{
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 96edb6f8babb..9e8902fa14c7 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -43,16 +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
46static void fixup_broken_pcnet32(struct pci_dev* dev)
47{
48 if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
49 dev->vendor = PCI_VENDOR_ID_AMD;
50 pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
51 }
52}
53DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
54
55
56static u32 get_int_prop(struct device_node *np, const char *name, u32 def) 46static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
57{ 47{
58 const u32 *prop; 48 const u32 *prop;
@@ -430,6 +420,9 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
430 * so flushing the hash table is the only sane way to make sure 420 * so flushing the hash table is the only sane way to make sure
431 * that no hash entries are covering that removed bridge area 421 * that no hash entries are covering that removed bridge area
432 * while still allowing other busses overlapping those pages 422 * while still allowing other busses overlapping those pages
423 *
424 * Note: If we ever support P2P hotplug on Book3E, we'll have
425 * to do an appropriate TLB flush here too
433 */ 426 */
434 if (bus->self) { 427 if (bus->self) {
435 struct resource *res = bus->resource[0]; 428 struct resource *res = bus->resource[0];
@@ -437,8 +430,10 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
437 pr_debug("IO unmapping for PCI-PCI bridge %s\n", 430 pr_debug("IO unmapping for PCI-PCI bridge %s\n",
438 pci_name(bus->self)); 431 pci_name(bus->self));
439 432
433#ifdef CONFIG_PPC_STD_MMU_64
440 __flush_hash_table_range(&init_mm, res->start + _IO_BASE, 434 __flush_hash_table_range(&init_mm, res->start + _IO_BASE,
441 res->end + _IO_BASE + 1); 435 res->end + _IO_BASE + 1);
436#endif
442 return 0; 437 return 0;
443 } 438 }
444 439
@@ -511,7 +506,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
511 pr_debug("IO mapping for PHB %s\n", hose->dn->full_name); 506 pr_debug("IO mapping for PHB %s\n", hose->dn->full_name);
512 pr_debug(" phys=0x%016llx, virt=0x%p (alloc=0x%p)\n", 507 pr_debug(" phys=0x%016llx, virt=0x%p (alloc=0x%p)\n",
513 hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc); 508 hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
514 pr_debug(" size=0x%016lx (alloc=0x%016lx)\n", 509 pr_debug(" size=0x%016llx (alloc=0x%016lx)\n",
515 hose->pci_io_size, size_page); 510 hose->pci_io_size, size_page);
516 511
517 /* Establish the mapping */ 512 /* Establish the mapping */
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index 1c67de52e3ce..d5e36e5dc7c2 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -27,7 +27,6 @@
27#include <asm/io.h> 27#include <asm/io.h>
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
30#include <asm/pSeries_reconfig.h>
31#include <asm/ppc-pci.h> 30#include <asm/ppc-pci.h>
32#include <asm/firmware.h> 31#include <asm/firmware.h>
33 32
@@ -35,7 +34,7 @@
35 * Traverse_func that inits the PCI fields of the device node. 34 * Traverse_func that inits the PCI fields of the device node.
36 * NOTE: this *must* be done before read/write config to the device. 35 * NOTE: this *must* be done before read/write config to the device.
37 */ 36 */
38static void * __devinit update_dn_pci_info(struct device_node *dn, void *data) 37void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
39{ 38{
40 struct pci_controller *phb = data; 39 struct pci_controller *phb = data;
41 const int *type = 40 const int *type =
@@ -184,29 +183,6 @@ struct device_node *fetch_dev_dn(struct pci_dev *dev)
184} 183}
185EXPORT_SYMBOL(fetch_dev_dn); 184EXPORT_SYMBOL(fetch_dev_dn);
186 185
187static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
188{
189 struct device_node *np = node;
190 struct pci_dn *pci = NULL;
191 int err = NOTIFY_OK;
192
193 switch (action) {
194 case PSERIES_RECONFIG_ADD:
195 pci = np->parent->data;
196 if (pci)
197 update_dn_pci_info(np, pci->phb);
198 break;
199 default:
200 err = NOTIFY_DONE;
201 break;
202 }
203 return err;
204}
205
206static struct notifier_block pci_dn_reconfig_nb = {
207 .notifier_call = pci_dn_reconfig_notifier,
208};
209
210/** 186/**
211 * pci_devs_phb_init - Initialize phbs and pci devs under them. 187 * pci_devs_phb_init - Initialize phbs and pci devs under them.
212 * 188 *
@@ -223,6 +199,4 @@ void __init pci_devs_phb_init(void)
223 /* This must be done first so the device nodes have valid pci info! */ 199 /* This must be done first so the device nodes have valid pci info! */
224 list_for_each_entry_safe(phb, tmp, &hose_list, list_node) 200 list_for_each_entry_safe(phb, tmp, &hose_list, list_node)
225 pci_devs_phb_init_dynamic(phb); 201 pci_devs_phb_init_dynamic(phb);
226
227 pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb);
228} 202}
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 7b44a33f03c2..3e7135bbe40f 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -650,7 +650,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
650 p->thread.ksp_limit = (unsigned long)task_stack_page(p) + 650 p->thread.ksp_limit = (unsigned long)task_stack_page(p) +
651 _ALIGN_UP(sizeof(struct thread_info), 16); 651 _ALIGN_UP(sizeof(struct thread_info), 16);
652 652
653#ifdef CONFIG_PPC64 653#ifdef CONFIG_PPC_STD_MMU_64
654 if (cpu_has_feature(CPU_FTR_SLB)) { 654 if (cpu_has_feature(CPU_FTR_SLB)) {
655 unsigned long sp_vsid; 655 unsigned long sp_vsid;
656 unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp; 656 unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp;
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index ce01ff2474da..d4405b95bfaa 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -585,7 +585,7 @@ static void __init check_cpu_pa_features(unsigned long node)
585 ibm_pa_features, ARRAY_SIZE(ibm_pa_features)); 585 ibm_pa_features, ARRAY_SIZE(ibm_pa_features));
586} 586}
587 587
588#ifdef CONFIG_PPC64 588#ifdef CONFIG_PPC_STD_MMU_64
589static void __init check_cpu_slb_size(unsigned long node) 589static void __init check_cpu_slb_size(unsigned long node)
590{ 590{
591 u32 *slb_size_ptr; 591 u32 *slb_size_ptr;
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 2f0e64b53642..ef6f64950e9b 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -44,10 +44,7 @@
44#include <asm/sections.h> 44#include <asm/sections.h>
45#include <asm/machdep.h> 45#include <asm/machdep.h>
46 46
47#ifdef CONFIG_LOGO_LINUX_CLUT224
48#include <linux/linux_logo.h> 47#include <linux/linux_logo.h>
49extern const struct linux_logo logo_linux_clut224;
50#endif
51 48
52/* 49/*
53 * Properties whose value is longer than this get excluded from our 50 * Properties whose value is longer than this get excluded from our
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 3635be61f899..9fa2c7dcd05a 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -704,15 +704,34 @@ void user_enable_single_step(struct task_struct *task)
704 704
705 if (regs != NULL) { 705 if (regs != NULL) {
706#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 706#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
707 task->thread.dbcr0 &= ~DBCR0_BT;
707 task->thread.dbcr0 |= DBCR0_IDM | DBCR0_IC; 708 task->thread.dbcr0 |= DBCR0_IDM | DBCR0_IC;
708 regs->msr |= MSR_DE; 709 regs->msr |= MSR_DE;
709#else 710#else
711 regs->msr &= ~MSR_BE;
710 regs->msr |= MSR_SE; 712 regs->msr |= MSR_SE;
711#endif 713#endif
712 } 714 }
713 set_tsk_thread_flag(task, TIF_SINGLESTEP); 715 set_tsk_thread_flag(task, TIF_SINGLESTEP);
714} 716}
715 717
718void user_enable_block_step(struct task_struct *task)
719{
720 struct pt_regs *regs = task->thread.regs;
721
722 if (regs != NULL) {
723#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
724 task->thread.dbcr0 &= ~DBCR0_IC;
725 task->thread.dbcr0 = DBCR0_IDM | DBCR0_BT;
726 regs->msr |= MSR_DE;
727#else
728 regs->msr &= ~MSR_SE;
729 regs->msr |= MSR_BE;
730#endif
731 }
732 set_tsk_thread_flag(task, TIF_SINGLESTEP);
733}
734
716void user_disable_single_step(struct task_struct *task) 735void user_disable_single_step(struct task_struct *task)
717{ 736{
718 struct pt_regs *regs = task->thread.regs; 737 struct pt_regs *regs = task->thread.regs;
@@ -726,10 +745,10 @@ void user_disable_single_step(struct task_struct *task)
726 745
727 if (regs != NULL) { 746 if (regs != NULL) {
728#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 747#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
729 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_IDM); 748 task->thread.dbcr0 &= ~(DBCR0_IC | DBCR0_BT | DBCR0_IDM);
730 regs->msr &= ~MSR_DE; 749 regs->msr &= ~MSR_DE;
731#else 750#else
732 regs->msr &= ~MSR_SE; 751 regs->msr &= ~(MSR_SE | MSR_BE);
733#endif 752#endif
734 } 753 }
735 clear_tsk_thread_flag(task, TIF_SINGLESTEP); 754 clear_tsk_thread_flag(task, TIF_SINGLESTEP);
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 8869001ab5d7..54e66da8f743 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -93,10 +93,7 @@ static int rtas_pci_read_config(struct pci_bus *bus,
93{ 93{
94 struct device_node *busdn, *dn; 94 struct device_node *busdn, *dn;
95 95
96 if (bus->self) 96 busdn = pci_bus_to_OF_node(bus);
97 busdn = pci_device_to_OF_node(bus->self);
98 else
99 busdn = bus->sysdata; /* must be a phb */
100 97
101 /* Search only direct children of the bus */ 98 /* Search only direct children of the bus */
102 for (dn = busdn->child; dn; dn = dn->sibling) { 99 for (dn = busdn->child; dn; dn = dn->sibling) {
@@ -140,10 +137,7 @@ static int rtas_pci_write_config(struct pci_bus *bus,
140{ 137{
141 struct device_node *busdn, *dn; 138 struct device_node *busdn, *dn;
142 139
143 if (bus->self) 140 busdn = pci_bus_to_OF_node(bus);
144 busdn = pci_device_to_OF_node(bus->self);
145 else
146 busdn = bus->sysdata; /* must be a phb */
147 141
148 /* Search only direct children of the bus */ 142 /* Search only direct children of the bus */
149 for (dn = busdn->child; dn; dn = dn->sibling) { 143 for (dn = busdn->child; dn; dn = dn->sibling) {
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 9e1ca745d8f0..1d154248cf40 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -39,6 +39,7 @@
39#include <asm/serial.h> 39#include <asm/serial.h>
40#include <asm/udbg.h> 40#include <asm/udbg.h>
41#include <asm/mmu_context.h> 41#include <asm/mmu_context.h>
42#include <asm/swiotlb.h>
42 43
43#include "setup.h" 44#include "setup.h"
44 45
@@ -332,6 +333,11 @@ void __init setup_arch(char **cmdline_p)
332 ppc_md.setup_arch(); 333 ppc_md.setup_arch();
333 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab); 334 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
334 335
336#ifdef CONFIG_SWIOTLB
337 if (ppc_swiotlb_enable)
338 swiotlb_init();
339#endif
340
335 paging_init(); 341 paging_init();
336 342
337 /* Initialize the MMU context management stuff */ 343 /* Initialize the MMU context management stuff */
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index c410c606955d..1f6816003ebe 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -61,6 +61,7 @@
61#include <asm/xmon.h> 61#include <asm/xmon.h>
62#include <asm/udbg.h> 62#include <asm/udbg.h>
63#include <asm/kexec.h> 63#include <asm/kexec.h>
64#include <asm/swiotlb.h>
64 65
65#include "setup.h" 66#include "setup.h"
66 67
@@ -417,12 +418,14 @@ void __init setup_system(void)
417 if (ppc64_caches.iline_size != 0x80) 418 if (ppc64_caches.iline_size != 0x80)
418 printk("ppc64_caches.icache_line_size = 0x%x\n", 419 printk("ppc64_caches.icache_line_size = 0x%x\n",
419 ppc64_caches.iline_size); 420 ppc64_caches.iline_size);
421#ifdef CONFIG_PPC_STD_MMU_64
420 if (htab_address) 422 if (htab_address)
421 printk("htab_address = 0x%p\n", htab_address); 423 printk("htab_address = 0x%p\n", htab_address);
422 printk("htab_hash_mask = 0x%lx\n", htab_hash_mask); 424 printk("htab_hash_mask = 0x%lx\n", htab_hash_mask);
425#endif /* CONFIG_PPC_STD_MMU_64 */
423 if (PHYSICAL_START > 0) 426 if (PHYSICAL_START > 0)
424 printk("physical_start = 0x%lx\n", 427 printk("physical_start = 0x%llx\n",
425 PHYSICAL_START); 428 (unsigned long long)PHYSICAL_START);
426 printk("-----------------------------------------------------\n"); 429 printk("-----------------------------------------------------\n");
427 430
428 DBG(" <- setup_system()\n"); 431 DBG(" <- setup_system()\n");
@@ -511,8 +514,9 @@ void __init setup_arch(char **cmdline_p)
511 irqstack_early_init(); 514 irqstack_early_init();
512 emergency_stack_init(); 515 emergency_stack_init();
513 516
517#ifdef CONFIG_PPC_STD_MMU_64
514 stabs_alloc(); 518 stabs_alloc();
515 519#endif
516 /* set up the bootmem stuff with available memory */ 520 /* set up the bootmem stuff with available memory */
517 do_init_bootmem(); 521 do_init_bootmem();
518 sparse_init(); 522 sparse_init();
@@ -524,6 +528,11 @@ void __init setup_arch(char **cmdline_p)
524 if (ppc_md.setup_arch) 528 if (ppc_md.setup_arch)
525 ppc_md.setup_arch(); 529 ppc_md.setup_arch();
526 530
531#ifdef CONFIG_SWIOTLB
532 if (ppc_swiotlb_enable)
533 swiotlb_init();
534#endif
535
527 paging_init(); 536 paging_init();
528 ppc64_boot_msg(0x15, "Setup Done"); 537 ppc64_boot_msg(0x15, "Setup Done");
529} 538}
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 48571ac56fb7..15391c2ab013 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -52,6 +52,7 @@
52#include <linux/jiffies.h> 52#include <linux/jiffies.h>
53#include <linux/posix-timers.h> 53#include <linux/posix-timers.h>
54#include <linux/irq.h> 54#include <linux/irq.h>
55#include <linux/delay.h>
55 56
56#include <asm/io.h> 57#include <asm/io.h>
57#include <asm/processor.h> 58#include <asm/processor.h>
@@ -109,7 +110,7 @@ static void decrementer_set_mode(enum clock_event_mode mode,
109static struct clock_event_device decrementer_clockevent = { 110static struct clock_event_device decrementer_clockevent = {
110 .name = "decrementer", 111 .name = "decrementer",
111 .rating = 200, 112 .rating = 200,
112 .shift = 16, 113 .shift = 0, /* To be filled in */
113 .mult = 0, /* To be filled in */ 114 .mult = 0, /* To be filled in */
114 .irq = 0, 115 .irq = 0,
115 .set_next_event = decrementer_set_next_event, 116 .set_next_event = decrementer_set_next_event,
@@ -843,6 +844,22 @@ static void decrementer_set_mode(enum clock_event_mode mode,
843 decrementer_set_next_event(DECREMENTER_MAX, dev); 844 decrementer_set_next_event(DECREMENTER_MAX, dev);
844} 845}
845 846
847static void __init setup_clockevent_multiplier(unsigned long hz)
848{
849 u64 mult, shift = 32;
850
851 while (1) {
852 mult = div_sc(hz, NSEC_PER_SEC, shift);
853 if (mult && (mult >> 32UL) == 0UL)
854 break;
855
856 shift--;
857 }
858
859 decrementer_clockevent.shift = shift;
860 decrementer_clockevent.mult = mult;
861}
862
846static void register_decrementer_clockevent(int cpu) 863static void register_decrementer_clockevent(int cpu)
847{ 864{
848 struct clock_event_device *dec = &per_cpu(decrementers, cpu).event; 865 struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
@@ -860,8 +877,7 @@ static void __init init_decrementer_clockevent(void)
860{ 877{
861 int cpu = smp_processor_id(); 878 int cpu = smp_processor_id();
862 879
863 decrementer_clockevent.mult = div_sc(ppc_tb_freq, NSEC_PER_SEC, 880 setup_clockevent_multiplier(ppc_tb_freq);
864 decrementer_clockevent.shift);
865 decrementer_clockevent.max_delta_ns = 881 decrementer_clockevent.max_delta_ns =
866 clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent); 882 clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent);
867 decrementer_clockevent.min_delta_ns = 883 decrementer_clockevent.min_delta_ns =
@@ -1128,6 +1144,15 @@ void div128_by_32(u64 dividend_high, u64 dividend_low,
1128 1144
1129} 1145}
1130 1146
1147/* We don't need to calibrate delay, we use the CPU timebase for that */
1148void calibrate_delay(void)
1149{
1150 /* Some generic code (such as spinlock debug) use loops_per_jiffy
1151 * as the number of __delay(1) in a jiffy, so make it so
1152 */
1153 loops_per_jiffy = tb_ticks_per_jiffy;
1154}
1155
1131static int __init rtc_init(void) 1156static int __init rtc_init(void)
1132{ 1157{
1133 struct platform_device *pdev; 1158 struct platform_device *pdev;
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 678fbff0d206..6f0ae1a9bfae 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -33,7 +33,9 @@
33#include <linux/backlight.h> 33#include <linux/backlight.h>
34#include <linux/bug.h> 34#include <linux/bug.h>
35#include <linux/kdebug.h> 35#include <linux/kdebug.h>
36#include <linux/debugfs.h>
36 37
38#include <asm/emulated_ops.h>
37#include <asm/pgtable.h> 39#include <asm/pgtable.h>
38#include <asm/uaccess.h> 40#include <asm/uaccess.h>
39#include <asm/system.h> 41#include <asm/system.h>
@@ -757,36 +759,44 @@ static int emulate_instruction(struct pt_regs *regs)
757 759
758 /* Emulate the mfspr rD, PVR. */ 760 /* Emulate the mfspr rD, PVR. */
759 if ((instword & PPC_INST_MFSPR_PVR_MASK) == PPC_INST_MFSPR_PVR) { 761 if ((instword & PPC_INST_MFSPR_PVR_MASK) == PPC_INST_MFSPR_PVR) {
762 PPC_WARN_EMULATED(mfpvr);
760 rd = (instword >> 21) & 0x1f; 763 rd = (instword >> 21) & 0x1f;
761 regs->gpr[rd] = mfspr(SPRN_PVR); 764 regs->gpr[rd] = mfspr(SPRN_PVR);
762 return 0; 765 return 0;
763 } 766 }
764 767
765 /* Emulating the dcba insn is just a no-op. */ 768 /* Emulating the dcba insn is just a no-op. */
766 if ((instword & PPC_INST_DCBA_MASK) == PPC_INST_DCBA) 769 if ((instword & PPC_INST_DCBA_MASK) == PPC_INST_DCBA) {
770 PPC_WARN_EMULATED(dcba);
767 return 0; 771 return 0;
772 }
768 773
769 /* Emulate the mcrxr insn. */ 774 /* Emulate the mcrxr insn. */
770 if ((instword & PPC_INST_MCRXR_MASK) == PPC_INST_MCRXR) { 775 if ((instword & PPC_INST_MCRXR_MASK) == PPC_INST_MCRXR) {
771 int shift = (instword >> 21) & 0x1c; 776 int shift = (instword >> 21) & 0x1c;
772 unsigned long msk = 0xf0000000UL >> shift; 777 unsigned long msk = 0xf0000000UL >> shift;
773 778
779 PPC_WARN_EMULATED(mcrxr);
774 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk); 780 regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
775 regs->xer &= ~0xf0000000UL; 781 regs->xer &= ~0xf0000000UL;
776 return 0; 782 return 0;
777 } 783 }
778 784
779 /* Emulate load/store string insn. */ 785 /* Emulate load/store string insn. */
780 if ((instword & PPC_INST_STRING_GEN_MASK) == PPC_INST_STRING) 786 if ((instword & PPC_INST_STRING_GEN_MASK) == PPC_INST_STRING) {
787 PPC_WARN_EMULATED(string);
781 return emulate_string_inst(regs, instword); 788 return emulate_string_inst(regs, instword);
789 }
782 790
783 /* Emulate the popcntb (Population Count Bytes) instruction. */ 791 /* Emulate the popcntb (Population Count Bytes) instruction. */
784 if ((instword & PPC_INST_POPCNTB_MASK) == PPC_INST_POPCNTB) { 792 if ((instword & PPC_INST_POPCNTB_MASK) == PPC_INST_POPCNTB) {
793 PPC_WARN_EMULATED(popcntb);
785 return emulate_popcntb_inst(regs, instword); 794 return emulate_popcntb_inst(regs, instword);
786 } 795 }
787 796
788 /* Emulate isel (Integer Select) instruction */ 797 /* Emulate isel (Integer Select) instruction */
789 if ((instword & PPC_INST_ISEL_MASK) == PPC_INST_ISEL) { 798 if ((instword & PPC_INST_ISEL_MASK) == PPC_INST_ISEL) {
799 PPC_WARN_EMULATED(isel);
790 return emulate_isel(regs, instword); 800 return emulate_isel(regs, instword);
791 } 801 }
792 802
@@ -984,6 +994,8 @@ void SoftwareEmulation(struct pt_regs *regs)
984 994
985#ifdef CONFIG_MATH_EMULATION 995#ifdef CONFIG_MATH_EMULATION
986 errcode = do_mathemu(regs); 996 errcode = do_mathemu(regs);
997 if (errcode >= 0)
998 PPC_WARN_EMULATED(math);
987 999
988 switch (errcode) { 1000 switch (errcode) {
989 case 0: 1001 case 0:
@@ -1005,6 +1017,9 @@ void SoftwareEmulation(struct pt_regs *regs)
1005 1017
1006#elif defined(CONFIG_8XX_MINIMAL_FPEMU) 1018#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
1007 errcode = Soft_emulate_8xx(regs); 1019 errcode = Soft_emulate_8xx(regs);
1020 if (errcode >= 0)
1021 PPC_WARN_EMULATED(8xx);
1022
1008 switch (errcode) { 1023 switch (errcode) {
1009 case 0: 1024 case 0:
1010 emulate_single_step(regs); 1025 emulate_single_step(regs);
@@ -1026,7 +1041,34 @@ void SoftwareEmulation(struct pt_regs *regs)
1026 1041
1027void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status) 1042void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status)
1028{ 1043{
1029 if (debug_status & DBSR_IC) { /* instruction completion */ 1044 /* Hack alert: On BookE, Branch Taken stops on the branch itself, while
1045 * on server, it stops on the target of the branch. In order to simulate
1046 * the server behaviour, we thus restart right away with a single step
1047 * instead of stopping here when hitting a BT
1048 */
1049 if (debug_status & DBSR_BT) {
1050 regs->msr &= ~MSR_DE;
1051
1052 /* Disable BT */
1053 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~DBCR0_BT);
1054 /* Clear the BT event */
1055 mtspr(SPRN_DBSR, DBSR_BT);
1056
1057 /* Do the single step trick only when coming from userspace */
1058 if (user_mode(regs)) {
1059 current->thread.dbcr0 &= ~DBCR0_BT;
1060 current->thread.dbcr0 |= DBCR0_IDM | DBCR0_IC;
1061 regs->msr |= MSR_DE;
1062 return;
1063 }
1064
1065 if (notify_die(DIE_SSTEP, "block_step", regs, 5,
1066 5, SIGTRAP) == NOTIFY_STOP) {
1067 return;
1068 }
1069 if (debugger_sstep(regs))
1070 return;
1071 } else if (debug_status & DBSR_IC) { /* Instruction complete */
1030 regs->msr &= ~MSR_DE; 1072 regs->msr &= ~MSR_DE;
1031 1073
1032 /* Disable instruction completion */ 1074 /* Disable instruction completion */
@@ -1042,9 +1084,8 @@ void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status)
1042 if (debugger_sstep(regs)) 1084 if (debugger_sstep(regs))
1043 return; 1085 return;
1044 1086
1045 if (user_mode(regs)) { 1087 if (user_mode(regs))
1046 current->thread.dbcr0 &= ~DBCR0_IC; 1088 current->thread.dbcr0 &= ~(DBCR0_IC);
1047 }
1048 1089
1049 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip); 1090 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
1050 } else if (debug_status & (DBSR_DAC1R | DBSR_DAC1W)) { 1091 } else if (debug_status & (DBSR_DAC1R | DBSR_DAC1W)) {
@@ -1088,6 +1129,7 @@ void altivec_assist_exception(struct pt_regs *regs)
1088 1129
1089 flush_altivec_to_thread(current); 1130 flush_altivec_to_thread(current);
1090 1131
1132 PPC_WARN_EMULATED(altivec);
1091 err = emulate_altivec(regs); 1133 err = emulate_altivec(regs);
1092 if (err == 0) { 1134 if (err == 0) {
1093 regs->nip += 4; /* skip emulated instruction */ 1135 regs->nip += 4; /* skip emulated instruction */
@@ -1286,3 +1328,79 @@ void kernel_bad_stack(struct pt_regs *regs)
1286void __init trap_init(void) 1328void __init trap_init(void)
1287{ 1329{
1288} 1330}
1331
1332
1333#ifdef CONFIG_PPC_EMULATED_STATS
1334
1335#define WARN_EMULATED_SETUP(type) .type = { .name = #type }
1336
1337struct ppc_emulated ppc_emulated = {
1338#ifdef CONFIG_ALTIVEC
1339 WARN_EMULATED_SETUP(altivec),
1340#endif
1341 WARN_EMULATED_SETUP(dcba),
1342 WARN_EMULATED_SETUP(dcbz),
1343 WARN_EMULATED_SETUP(fp_pair),
1344 WARN_EMULATED_SETUP(isel),
1345 WARN_EMULATED_SETUP(mcrxr),
1346 WARN_EMULATED_SETUP(mfpvr),
1347 WARN_EMULATED_SETUP(multiple),
1348 WARN_EMULATED_SETUP(popcntb),
1349 WARN_EMULATED_SETUP(spe),
1350 WARN_EMULATED_SETUP(string),
1351 WARN_EMULATED_SETUP(unaligned),
1352#ifdef CONFIG_MATH_EMULATION
1353 WARN_EMULATED_SETUP(math),
1354#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
1355 WARN_EMULATED_SETUP(8xx),
1356#endif
1357#ifdef CONFIG_VSX
1358 WARN_EMULATED_SETUP(vsx),
1359#endif
1360};
1361
1362u32 ppc_warn_emulated;
1363
1364void ppc_warn_emulated_print(const char *type)
1365{
1366 if (printk_ratelimit())
1367 pr_warning("%s used emulated %s instruction\n", current->comm,
1368 type);
1369}
1370
1371static int __init ppc_warn_emulated_init(void)
1372{
1373 struct dentry *dir, *d;
1374 unsigned int i;
1375 struct ppc_emulated_entry *entries = (void *)&ppc_emulated;
1376
1377 if (!powerpc_debugfs_root)
1378 return -ENODEV;
1379
1380 dir = debugfs_create_dir("emulated_instructions",
1381 powerpc_debugfs_root);
1382 if (!dir)
1383 return -ENOMEM;
1384
1385 d = debugfs_create_u32("do_warn", S_IRUGO | S_IWUSR, dir,
1386 &ppc_warn_emulated);
1387 if (!d)
1388 goto fail;
1389
1390 for (i = 0; i < sizeof(ppc_emulated)/sizeof(*entries); i++) {
1391 d = debugfs_create_u32(entries[i].name, S_IRUGO | S_IWUSR, dir,
1392 (u32 *)&entries[i].val.counter);
1393 if (!d)
1394 goto fail;
1395 }
1396
1397 return 0;
1398
1399fail:
1400 debugfs_remove_recursive(dir);
1401 return -ENOMEM;
1402}
1403
1404device_initcall(ppc_warn_emulated_init);
1405
1406#endif /* CONFIG_PPC_EMULATED_STATS */
diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S
index 49ac3d6e1399..ef36cbbc5882 100644
--- a/arch/powerpc/kernel/vector.S
+++ b/arch/powerpc/kernel/vector.S
@@ -1,5 +1,215 @@
1#include <asm/processor.h>
1#include <asm/ppc_asm.h> 2#include <asm/ppc_asm.h>
2#include <asm/reg.h> 3#include <asm/reg.h>
4#include <asm/asm-offsets.h>
5#include <asm/cputable.h>
6#include <asm/thread_info.h>
7#include <asm/page.h>
8
9/*
10 * load_up_altivec(unused, unused, tsk)
11 * Disable VMX for the task which had it previously,
12 * and save its vector registers in its thread_struct.
13 * Enables the VMX for use in the kernel on return.
14 * On SMP we know the VMX is free, since we give it up every
15 * switch (ie, no lazy save of the vector registers).
16 */
17_GLOBAL(load_up_altivec)
18 mfmsr r5 /* grab the current MSR */
19 oris r5,r5,MSR_VEC@h
20 MTMSRD(r5) /* enable use of AltiVec now */
21 isync
22
23/*
24 * For SMP, we don't do lazy VMX switching because it just gets too
25 * horrendously complex, especially when a task switches from one CPU
26 * to another. Instead we call giveup_altvec in switch_to.
27 * VRSAVE isn't dealt with here, that is done in the normal context
28 * switch code. Note that we could rely on vrsave value to eventually
29 * avoid saving all of the VREGs here...
30 */
31#ifndef CONFIG_SMP
32 LOAD_REG_ADDRBASE(r3, last_task_used_altivec)
33 toreal(r3)
34 PPC_LL r4,ADDROFF(last_task_used_altivec)(r3)
35 PPC_LCMPI 0,r4,0
36 beq 1f
37
38 /* Save VMX state to last_task_used_altivec's THREAD struct */
39 toreal(r4)
40 addi r4,r4,THREAD
41 SAVE_32VRS(0,r5,r4)
42 mfvscr vr0
43 li r10,THREAD_VSCR
44 stvx vr0,r10,r4
45 /* Disable VMX for last_task_used_altivec */
46 PPC_LL r5,PT_REGS(r4)
47 toreal(r5)
48 PPC_LL r4,_MSR-STACK_FRAME_OVERHEAD(r5)
49 lis r10,MSR_VEC@h
50 andc r4,r4,r10
51 PPC_STL r4,_MSR-STACK_FRAME_OVERHEAD(r5)
521:
53#endif /* CONFIG_SMP */
54
55 /* Hack: if we get an altivec unavailable trap with VRSAVE
56 * set to all zeros, we assume this is a broken application
57 * that fails to set it properly, and thus we switch it to
58 * all 1's
59 */
60 mfspr r4,SPRN_VRSAVE
61 cmpdi 0,r4,0
62 bne+ 1f
63 li r4,-1
64 mtspr SPRN_VRSAVE,r4
651:
66 /* enable use of VMX after return */
67#ifdef CONFIG_PPC32
68 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */
69 oris r9,r9,MSR_VEC@h
70#else
71 ld r4,PACACURRENT(r13)
72 addi r5,r4,THREAD /* Get THREAD */
73 oris r12,r12,MSR_VEC@h
74 std r12,_MSR(r1)
75#endif
76 li r4,1
77 li r10,THREAD_VSCR
78 stw r4,THREAD_USED_VR(r5)
79 lvx vr0,r10,r5
80 mtvscr vr0
81 REST_32VRS(0,r4,r5)
82#ifndef CONFIG_SMP
83 /* Update last_task_used_math to 'current' */
84 subi r4,r5,THREAD /* Back to 'current' */
85 fromreal(r4)
86 PPC_STL r4,ADDROFF(last_task_used_math)(r3)
87#endif /* CONFIG_SMP */
88 /* restore registers and return */
89 blr
90
91/*
92 * giveup_altivec(tsk)
93 * Disable VMX for the task given as the argument,
94 * and save the vector registers in its thread_struct.
95 * Enables the VMX for use in the kernel on return.
96 */
97_GLOBAL(giveup_altivec)
98 mfmsr r5
99 oris r5,r5,MSR_VEC@h
100 SYNC
101 MTMSRD(r5) /* enable use of VMX now */
102 isync
103 PPC_LCMPI 0,r3,0
104 beqlr- /* if no previous owner, done */
105 addi r3,r3,THREAD /* want THREAD of task */
106 PPC_LL r5,PT_REGS(r3)
107 PPC_LCMPI 0,r5,0
108 SAVE_32VRS(0,r4,r3)
109 mfvscr vr0
110 li r4,THREAD_VSCR
111 stvx vr0,r4,r3
112 beq 1f
113 PPC_LL r4,_MSR-STACK_FRAME_OVERHEAD(r5)
114#ifdef CONFIG_VSX
115BEGIN_FTR_SECTION
116 lis r3,(MSR_VEC|MSR_VSX)@h
117FTR_SECTION_ELSE
118 lis r3,MSR_VEC@h
119ALT_FTR_SECTION_END_IFSET(CPU_FTR_VSX)
120#else
121 lis r3,MSR_VEC@h
122#endif
123 andc r4,r4,r3 /* disable FP for previous task */
124 PPC_STL r4,_MSR-STACK_FRAME_OVERHEAD(r5)
1251:
126#ifndef CONFIG_SMP
127 li r5,0
128 LOAD_REG_ADDRBASE(r4,last_task_used_altivec)
129 PPC_STL r5,ADDROFF(last_task_used_altivec)(r4)
130#endif /* CONFIG_SMP */
131 blr
132
133#ifdef CONFIG_VSX
134
135#ifdef CONFIG_PPC32
136#error This asm code isn't ready for 32-bit kernels
137#endif
138
139/*
140 * load_up_vsx(unused, unused, tsk)
141 * Disable VSX for the task which had it previously,
142 * and save its vector registers in its thread_struct.
143 * Reuse the fp and vsx saves, but first check to see if they have
144 * been saved already.
145 */
146_GLOBAL(load_up_vsx)
147/* Load FP and VSX registers if they haven't been done yet */
148 andi. r5,r12,MSR_FP
149 beql+ load_up_fpu /* skip if already loaded */
150 andis. r5,r12,MSR_VEC@h
151 beql+ load_up_altivec /* skip if already loaded */
152
153#ifndef CONFIG_SMP
154 ld r3,last_task_used_vsx@got(r2)
155 ld r4,0(r3)
156 cmpdi 0,r4,0
157 beq 1f
158 /* Disable VSX for last_task_used_vsx */
159 addi r4,r4,THREAD
160 ld r5,PT_REGS(r4)
161 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
162 lis r6,MSR_VSX@h
163 andc r6,r4,r6
164 std r6,_MSR-STACK_FRAME_OVERHEAD(r5)
1651:
166#endif /* CONFIG_SMP */
167 ld r4,PACACURRENT(r13)
168 addi r4,r4,THREAD /* Get THREAD */
169 li r6,1
170 stw r6,THREAD_USED_VSR(r4) /* ... also set thread used vsr */
171 /* enable use of VSX after return */
172 oris r12,r12,MSR_VSX@h
173 std r12,_MSR(r1)
174#ifndef CONFIG_SMP
175 /* Update last_task_used_math to 'current' */
176 ld r4,PACACURRENT(r13)
177 std r4,0(r3)
178#endif /* CONFIG_SMP */
179 b fast_exception_return
180
181/*
182 * __giveup_vsx(tsk)
183 * Disable VSX for the task given as the argument.
184 * Does NOT save vsx registers.
185 * Enables the VSX for use in the kernel on return.
186 */
187_GLOBAL(__giveup_vsx)
188 mfmsr r5
189 oris r5,r5,MSR_VSX@h
190 mtmsrd r5 /* enable use of VSX now */
191 isync
192
193 cmpdi 0,r3,0
194 beqlr- /* if no previous owner, done */
195 addi r3,r3,THREAD /* want THREAD of task */
196 ld r5,PT_REGS(r3)
197 cmpdi 0,r5,0
198 beq 1f
199 ld r4,_MSR-STACK_FRAME_OVERHEAD(r5)
200 lis r3,MSR_VSX@h
201 andc r4,r4,r3 /* disable VSX for previous task */
202 std r4,_MSR-STACK_FRAME_OVERHEAD(r5)
2031:
204#ifndef CONFIG_SMP
205 li r5,0
206 ld r4,last_task_used_vsx@got(r2)
207 std r5,0(r4)
208#endif /* CONFIG_SMP */
209 blr
210
211#endif /* CONFIG_VSX */
212
3 213
4/* 214/*
5 * The routines below are in assembler so we can closely control the 215 * The routines below are in assembler so we can closely control the
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index b746f4ca4209..c4bcf072cb3c 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -11,10 +11,11 @@ obj-y := fault.o mem.o pgtable.o gup.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 \
13 tlb_nohash_low.o 13 tlb_nohash_low.o
14hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o 14obj-$(CONFIG_PPC64) += mmap_64.o
15obj-$(CONFIG_PPC64) += hash_utils_64.o \ 15hash64-$(CONFIG_PPC_NATIVE) := hash_native_64.o
16obj-$(CONFIG_PPC_STD_MMU_64) += hash_utils_64.o \
16 slb_low.o slb.o stab.o \ 17 slb_low.o slb.o stab.o \
17 mmap_64.o $(hash-y) 18 mmap_64.o $(hash64-y)
18obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o 19obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o
19obj-$(CONFIG_PPC_STD_MMU) += hash_low_$(CONFIG_WORD_SIZE).o \ 20obj-$(CONFIG_PPC_STD_MMU) += hash_low_$(CONFIG_WORD_SIZE).o \
20 tlb_hash$(CONFIG_WORD_SIZE).o \ 21 tlb_hash$(CONFIG_WORD_SIZE).o \
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index 34e5c0b219b9..056d23a1b105 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -27,6 +27,7 @@
27#include <asm/cputable.h> 27#include <asm/cputable.h>
28#include <asm/udbg.h> 28#include <asm/udbg.h>
29#include <asm/kexec.h> 29#include <asm/kexec.h>
30#include <asm/ppc-opcode.h>
30 31
31#ifdef DEBUG_LOW 32#ifdef DEBUG_LOW
32#define DBG_LOW(fmt...) udbg_printf(fmt) 33#define DBG_LOW(fmt...) udbg_printf(fmt)
@@ -49,14 +50,21 @@ static inline void __tlbie(unsigned long va, int psize, int ssize)
49 case MMU_PAGE_4K: 50 case MMU_PAGE_4K:
50 va &= ~0xffful; 51 va &= ~0xffful;
51 va |= ssize << 8; 52 va |= ssize << 8;
52 asm volatile("tlbie %0,0" : : "r" (va) : "memory"); 53 asm volatile(ASM_MMU_FTR_IFCLR("tlbie %0,0", PPC_TLBIE(%1,%0),
54 %2)
55 : : "r" (va), "r"(0), "i" (MMU_FTR_TLBIE_206)
56 : "memory");
53 break; 57 break;
54 default: 58 default:
55 penc = mmu_psize_defs[psize].penc; 59 penc = mmu_psize_defs[psize].penc;
56 va &= ~((1ul << mmu_psize_defs[psize].shift) - 1); 60 va &= ~((1ul << mmu_psize_defs[psize].shift) - 1);
57 va |= penc << 12; 61 va |= penc << 12;
58 va |= ssize << 8; 62 va |= ssize << 8;
59 asm volatile("tlbie %0,1" : : "r" (va) : "memory"); 63 va |= 1; /* L */
64 asm volatile(ASM_MMU_FTR_IFCLR("tlbie %0,1", PPC_TLBIE(%1,%0),
65 %2)
66 : : "r" (va), "r"(0), "i" (MMU_FTR_TLBIE_206)
67 : "memory");
60 break; 68 break;
61 } 69 }
62} 70}
@@ -80,6 +88,7 @@ static inline void __tlbiel(unsigned long va, int psize, int ssize)
80 va &= ~((1ul << mmu_psize_defs[psize].shift) - 1); 88 va &= ~((1ul << mmu_psize_defs[psize].shift) - 1);
81 va |= penc << 12; 89 va |= penc << 12;
82 va |= ssize << 8; 90 va |= ssize << 8;
91 va |= 1; /* L */
83 asm volatile(".long 0x7c000224 | (%0 << 11) | (1 << 21)" 92 asm volatile(".long 0x7c000224 | (%0 << 11) | (1 << 21)"
84 : : "r"(va) : "memory"); 93 : : "r"(va) : "memory");
85 break; 94 break;
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 3e6a6543f53a..68a821add28d 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -66,6 +66,7 @@
66 66
67#include "mmu_decl.h" 67#include "mmu_decl.h"
68 68
69#ifdef CONFIG_PPC_STD_MMU_64
69#if PGTABLE_RANGE > USER_VSID_RANGE 70#if PGTABLE_RANGE > USER_VSID_RANGE
70#warning Limited user VSID range means pagetable space is wasted 71#warning Limited user VSID range means pagetable space is wasted
71#endif 72#endif
@@ -73,6 +74,7 @@
73#if (TASK_SIZE_USER64 < PGTABLE_RANGE) && (TASK_SIZE_USER64 < USER_VSID_RANGE) 74#if (TASK_SIZE_USER64 < PGTABLE_RANGE) && (TASK_SIZE_USER64 < USER_VSID_RANGE)
74#warning TASK_SIZE is smaller than it needs to be. 75#warning TASK_SIZE is smaller than it needs to be.
75#endif 76#endif
77#endif /* CONFIG_PPC_STD_MMU_64 */
76 78
77phys_addr_t memstart_addr = ~0; 79phys_addr_t memstart_addr = ~0;
78phys_addr_t kernstart_addr; 80phys_addr_t kernstart_addr;
diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
index 030d0005b4d2..8343986809c0 100644
--- a/arch/powerpc/mm/mmu_context_nohash.c
+++ b/arch/powerpc/mm/mmu_context_nohash.c
@@ -46,7 +46,7 @@ static unsigned int next_context, nr_free_contexts;
46static unsigned long *context_map; 46static unsigned long *context_map;
47static unsigned long *stale_map[NR_CPUS]; 47static unsigned long *stale_map[NR_CPUS];
48static struct mm_struct **context_mm; 48static struct mm_struct **context_mm;
49static spinlock_t context_lock = SPIN_LOCK_UNLOCKED; 49static DEFINE_SPINLOCK(context_lock);
50 50
51#define CTX_MAP_SIZE \ 51#define CTX_MAP_SIZE \
52 (sizeof(unsigned long) * (last_context / BITS_PER_LONG + 1)) 52 (sizeof(unsigned long) * (last_context / BITS_PER_LONG + 1))
@@ -73,7 +73,6 @@ static unsigned int steal_context_smp(unsigned int id)
73 struct mm_struct *mm; 73 struct mm_struct *mm;
74 unsigned int cpu, max; 74 unsigned int cpu, max;
75 75
76 again:
77 max = last_context - first_context; 76 max = last_context - first_context;
78 77
79 /* Attempt to free next_context first and then loop until we manage */ 78 /* Attempt to free next_context first and then loop until we manage */
@@ -108,7 +107,9 @@ static unsigned int steal_context_smp(unsigned int id)
108 spin_unlock(&context_lock); 107 spin_unlock(&context_lock);
109 cpu_relax(); 108 cpu_relax();
110 spin_lock(&context_lock); 109 spin_lock(&context_lock);
111 goto again; 110
111 /* This will cause the caller to try again */
112 return MMU_NO_CONTEXT;
112} 113}
113#endif /* CONFIG_SMP */ 114#endif /* CONFIG_SMP */
114 115
@@ -194,6 +195,8 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
194 WARN_ON(prev->context.active < 1); 195 WARN_ON(prev->context.active < 1);
195 prev->context.active--; 196 prev->context.active--;
196 } 197 }
198
199 again:
197#endif /* CONFIG_SMP */ 200#endif /* CONFIG_SMP */
198 201
199 /* If we already have a valid assigned context, skip all that */ 202 /* If we already have a valid assigned context, skip all that */
@@ -212,7 +215,8 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
212#ifdef CONFIG_SMP 215#ifdef CONFIG_SMP
213 if (num_online_cpus() > 1) { 216 if (num_online_cpus() > 1) {
214 id = steal_context_smp(id); 217 id = steal_context_smp(id);
215 goto stolen; 218 if (id == MMU_NO_CONTEXT)
219 goto again;
216 } 220 }
217#endif /* CONFIG_SMP */ 221#endif /* CONFIG_SMP */
218 id = steal_context_up(id); 222 id = steal_context_up(id);
@@ -272,6 +276,7 @@ int init_new_context(struct task_struct *t, struct mm_struct *mm)
272 */ 276 */
273void destroy_context(struct mm_struct *mm) 277void destroy_context(struct mm_struct *mm)
274{ 278{
279 unsigned long flags;
275 unsigned int id; 280 unsigned int id;
276 281
277 if (mm->context.id == MMU_NO_CONTEXT) 282 if (mm->context.id == MMU_NO_CONTEXT)
@@ -279,18 +284,18 @@ void destroy_context(struct mm_struct *mm)
279 284
280 WARN_ON(mm->context.active != 0); 285 WARN_ON(mm->context.active != 0);
281 286
282 spin_lock(&context_lock); 287 spin_lock_irqsave(&context_lock, flags);
283 id = mm->context.id; 288 id = mm->context.id;
284 if (id != MMU_NO_CONTEXT) { 289 if (id != MMU_NO_CONTEXT) {
285 __clear_bit(id, context_map); 290 __clear_bit(id, context_map);
286 mm->context.id = MMU_NO_CONTEXT; 291 mm->context.id = MMU_NO_CONTEXT;
287#ifdef DEBUG_MAP_CONSISTENCY 292#ifdef DEBUG_MAP_CONSISTENCY
288 mm->context.active = 0; 293 mm->context.active = 0;
289 context_mm[id] = NULL;
290#endif 294#endif
295 context_mm[id] = NULL;
291 nr_free_contexts++; 296 nr_free_contexts++;
292 } 297 }
293 spin_unlock(&context_lock); 298 spin_unlock_irqrestore(&context_lock, flags);
294} 299}
295 300
296#ifdef CONFIG_SMP 301#ifdef CONFIG_SMP
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 9047145095aa..b037d95eeadc 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -981,6 +981,8 @@ void __init do_init_bootmem(void)
981 mark_reserved_regions_for_nid(nid); 981 mark_reserved_regions_for_nid(nid);
982 sparse_memory_present_with_active_regions(nid); 982 sparse_memory_present_with_active_regions(nid);
983 } 983 }
984
985 init_bootmem_done = 1;
984} 986}
985 987
986void __init paging_init(void) 988void __init paging_init(void)
diff --git a/arch/powerpc/oprofile/op_model_fsl_emb.c b/arch/powerpc/oprofile/op_model_fsl_emb.c
index 91596f6ba1f4..62312abffa28 100644
--- a/arch/powerpc/oprofile/op_model_fsl_emb.c
+++ b/arch/powerpc/oprofile/op_model_fsl_emb.c
@@ -228,20 +228,6 @@ static void pmc_stop_ctrs(void)
228 mtpmr(PMRN_PMGC0, pmgc0); 228 mtpmr(PMRN_PMGC0, pmgc0);
229} 229}
230 230
231static void dump_pmcs(void)
232{
233 printk("pmgc0: %x\n", mfpmr(PMRN_PMGC0));
234 printk("pmc\t\tpmlca\t\tpmlcb\n");
235 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC0),
236 mfpmr(PMRN_PMLCA0), mfpmr(PMRN_PMLCB0));
237 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC1),
238 mfpmr(PMRN_PMLCA1), mfpmr(PMRN_PMLCB1));
239 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC2),
240 mfpmr(PMRN_PMLCA2), mfpmr(PMRN_PMLCB2));
241 printk("%8x\t%8x\t%8x\n", mfpmr(PMRN_PMC3),
242 mfpmr(PMRN_PMLCA3), mfpmr(PMRN_PMLCB3));
243}
244
245static int fsl_emb_cpu_setup(struct op_counter_config *ctr) 231static int fsl_emb_cpu_setup(struct op_counter_config *ctr)
246{ 232{
247 int i; 233 int i;
diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index f39c953d5353..a6e43cb6f825 100644
--- a/arch/powerpc/platforms/40x/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -45,6 +45,7 @@ config KILAUEA
45 depends on 40x 45 depends on 40x
46 default n 46 default n
47 select 405EX 47 select 405EX
48 select PPC40x_SIMPLE
48 select PPC4xx_PCI_EXPRESS 49 select PPC4xx_PCI_EXPRESS
49 help 50 help
50 This option enables support for the AMCC PPC405EX evaluation board. 51 This option enables support for the AMCC PPC405EX evaluation board.
@@ -56,6 +57,7 @@ config MAKALU
56 select 405EX 57 select 405EX
57 select PCI 58 select PCI
58 select PPC4xx_PCI_EXPRESS 59 select PPC4xx_PCI_EXPRESS
60 select PPC40x_SIMPLE
59 help 61 help
60 This option enables support for the AMCC PPC405EX board. 62 This option enables support for the AMCC PPC405EX board.
61 63
diff --git a/arch/powerpc/platforms/40x/Makefile b/arch/powerpc/platforms/40x/Makefile
index 9bab76a652a6..56e89004c468 100644
--- a/arch/powerpc/platforms/40x/Makefile
+++ b/arch/powerpc/platforms/40x/Makefile
@@ -1,6 +1,4 @@
1obj-$(CONFIG_KILAUEA) += kilauea.o
2obj-$(CONFIG_HCU4) += hcu4.o 1obj-$(CONFIG_HCU4) += hcu4.o
3obj-$(CONFIG_MAKALU) += makalu.o
4obj-$(CONFIG_WALNUT) += walnut.o 2obj-$(CONFIG_WALNUT) += walnut.o
5obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o 3obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o
6obj-$(CONFIG_EP405) += ep405.o 4obj-$(CONFIG_EP405) += ep405.o
diff --git a/arch/powerpc/platforms/40x/kilauea.c b/arch/powerpc/platforms/40x/kilauea.c
deleted file mode 100644
index fd7d934dac8b..000000000000
--- a/arch/powerpc/platforms/40x/kilauea.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * Kilauea board specific routines
3 *
4 * Copyright 2007-2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * Based on the Walnut code by
7 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
8 * Copyright 2007 IBM Corporation
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15#include <linux/init.h>
16#include <linux/of_platform.h>
17#include <asm/machdep.h>
18#include <asm/prom.h>
19#include <asm/udbg.h>
20#include <asm/time.h>
21#include <asm/uic.h>
22#include <asm/pci-bridge.h>
23#include <asm/ppc4xx.h>
24
25static __initdata struct of_device_id kilauea_of_bus[] = {
26 { .compatible = "ibm,plb4", },
27 { .compatible = "ibm,opb", },
28 { .compatible = "ibm,ebc", },
29 {},
30};
31
32static int __init kilauea_device_probe(void)
33{
34 of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
35
36 return 0;
37}
38machine_device_initcall(kilauea, kilauea_device_probe);
39
40static int __init kilauea_probe(void)
41{
42 unsigned long root = of_get_flat_dt_root();
43
44 if (!of_flat_dt_is_compatible(root, "amcc,kilauea"))
45 return 0;
46
47 ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);
48
49 return 1;
50}
51
52define_machine(kilauea) {
53 .name = "Kilauea",
54 .probe = kilauea_probe,
55 .progress = udbg_progress,
56 .init_IRQ = uic_init_tree,
57 .get_irq = uic_get_irq,
58 .restart = ppc4xx_reset_system,
59 .calibrate_decr = generic_calibrate_decr,
60};
diff --git a/arch/powerpc/platforms/40x/makalu.c b/arch/powerpc/platforms/40x/makalu.c
deleted file mode 100644
index a6a1d6017b71..000000000000
--- a/arch/powerpc/platforms/40x/makalu.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * Makalu board specific routines
3 *
4 * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * Based on the Walnut code by
7 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
8 * Copyright 2007 IBM Corporation
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15#include <linux/init.h>
16#include <linux/of_platform.h>
17#include <asm/machdep.h>
18#include <asm/prom.h>
19#include <asm/udbg.h>
20#include <asm/time.h>
21#include <asm/uic.h>
22#include <asm/pci-bridge.h>
23#include <asm/ppc4xx.h>
24
25static __initdata struct of_device_id makalu_of_bus[] = {
26 { .compatible = "ibm,plb4", },
27 { .compatible = "ibm,opb", },
28 { .compatible = "ibm,ebc", },
29 {},
30};
31
32static int __init makalu_device_probe(void)
33{
34 of_platform_bus_probe(NULL, makalu_of_bus, NULL);
35
36 return 0;
37}
38machine_device_initcall(makalu, makalu_device_probe);
39
40static int __init makalu_probe(void)
41{
42 unsigned long root = of_get_flat_dt_root();
43
44 if (!of_flat_dt_is_compatible(root, "amcc,makalu"))
45 return 0;
46
47 ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
48
49 return 1;
50}
51
52define_machine(makalu) {
53 .name = "Makalu",
54 .probe = makalu_probe,
55 .progress = udbg_progress,
56 .init_IRQ = uic_init_tree,
57 .get_irq = uic_get_irq,
58 .restart = ppc4xx_reset_system,
59 .calibrate_decr = generic_calibrate_decr,
60};
diff --git a/arch/powerpc/platforms/40x/ppc40x_simple.c b/arch/powerpc/platforms/40x/ppc40x_simple.c
index f40ac9b8f99f..5fd5a5974001 100644
--- a/arch/powerpc/platforms/40x/ppc40x_simple.c
+++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
@@ -51,7 +51,10 @@ machine_device_initcall(ppc40x_simple, ppc40x_device_probe);
51 * board.c file for it rather than adding it to this list. 51 * board.c file for it rather than adding it to this list.
52 */ 52 */
53static char *board[] __initdata = { 53static char *board[] __initdata = {
54 "amcc,acadia" 54 "amcc,acadia",
55 "amcc,haleakala",
56 "amcc,kilauea",
57 "amcc,makalu"
55}; 58};
56 59
57static int __init ppc40x_probe(void) 60static int __init ppc40x_probe(void)
diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
index fc7fb001276c..d0fc6866b00c 100644
--- a/arch/powerpc/platforms/40x/virtex.c
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -14,6 +14,7 @@
14#include <asm/prom.h> 14#include <asm/prom.h>
15#include <asm/time.h> 15#include <asm/time.h>
16#include <asm/xilinx_intc.h> 16#include <asm/xilinx_intc.h>
17#include <asm/xilinx_pci.h>
17#include <asm/ppc4xx.h> 18#include <asm/ppc4xx.h>
18 19
19static struct of_device_id xilinx_of_bus_ids[] __initdata = { 20static struct of_device_id xilinx_of_bus_ids[] __initdata = {
@@ -47,6 +48,7 @@ static int __init virtex_probe(void)
47define_machine(virtex) { 48define_machine(virtex) {
48 .name = "Xilinx Virtex", 49 .name = "Xilinx Virtex",
49 .probe = virtex_probe, 50 .probe = virtex_probe,
51 .setup_arch = xilinx_pci_init,
50 .init_IRQ = xilinx_intc_init_tree, 52 .init_IRQ = xilinx_intc_init_tree,
51 .get_irq = xilinx_intc_get_irq, 53 .get_irq = xilinx_intc_get_irq,
52 .restart = ppc4xx_reset_system, 54 .restart = ppc4xx_reset_system,
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 0d83a6a0397d..90e3192611a4 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -156,7 +156,7 @@ config YOSEMITE
156# This option enables support for the IBM PPC440GX evaluation board. 156# This option enables support for the IBM PPC440GX evaluation board.
157 157
158config XILINX_VIRTEX440_GENERIC_BOARD 158config XILINX_VIRTEX440_GENERIC_BOARD
159 bool "Generic Xilinx Virtex 440 board" 159 bool "Generic Xilinx Virtex 5 FXT board support"
160 depends on 44x 160 depends on 44x
161 default n 161 default n
162 select XILINX_VIRTEX_5_FXT 162 select XILINX_VIRTEX_5_FXT
@@ -171,6 +171,17 @@ config XILINX_VIRTEX440_GENERIC_BOARD
171 Most Virtex 5 designs should use this unless it needs to do some 171 Most Virtex 5 designs should use this unless it needs to do some
172 special configuration at board probe time. 172 special configuration at board probe time.
173 173
174config XILINX_ML510
175 bool "Xilinx ML510 extra support"
176 depends on XILINX_VIRTEX440_GENERIC_BOARD
177 select PPC_PCI_CHOICE
178 select XILINX_PCI if PCI
179 select PPC_INDIRECT_PCI if PCI
180 select PPC_I8259 if PCI
181 help
182 This option enables extra support for features on the Xilinx ML510
183 board. The ML510 has a PCI bus with ALI south bridge.
184
174config PPC44x_SIMPLE 185config PPC44x_SIMPLE
175 bool "Simple PowerPC 44x board support" 186 bool "Simple PowerPC 44x board support"
176 depends on 44x 187 depends on 44x
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 01f51daace13..ee6185aeaa3b 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -4,3 +4,4 @@ obj-$(CONFIG_EBONY) += ebony.o
4obj-$(CONFIG_SAM440EP) += sam440ep.o 4obj-$(CONFIG_SAM440EP) += sam440ep.o
5obj-$(CONFIG_WARP) += warp.o 5obj-$(CONFIG_WARP) += warp.o
6obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o 6obj-$(CONFIG_XILINX_VIRTEX_5_FXT) += virtex.o
7obj-$(CONFIG_XILINX_ML510) += virtex_ml510.o
diff --git a/arch/powerpc/platforms/44x/virtex.c b/arch/powerpc/platforms/44x/virtex.c
index 68637faf70ae..cf96ccaa760c 100644
--- a/arch/powerpc/platforms/44x/virtex.c
+++ b/arch/powerpc/platforms/44x/virtex.c
@@ -16,6 +16,7 @@
16#include <asm/prom.h> 16#include <asm/prom.h>
17#include <asm/time.h> 17#include <asm/time.h>
18#include <asm/xilinx_intc.h> 18#include <asm/xilinx_intc.h>
19#include <asm/xilinx_pci.h>
19#include <asm/reg.h> 20#include <asm/reg.h>
20#include <asm/ppc4xx.h> 21#include <asm/ppc4xx.h>
21#include "44x.h" 22#include "44x.h"
@@ -53,6 +54,7 @@ static int __init virtex_probe(void)
53define_machine(virtex) { 54define_machine(virtex) {
54 .name = "Xilinx Virtex440", 55 .name = "Xilinx Virtex440",
55 .probe = virtex_probe, 56 .probe = virtex_probe,
57 .setup_arch = xilinx_pci_init,
56 .init_IRQ = xilinx_intc_init_tree, 58 .init_IRQ = xilinx_intc_init_tree,
57 .get_irq = xilinx_intc_get_irq, 59 .get_irq = xilinx_intc_get_irq,
58 .calibrate_decr = generic_calibrate_decr, 60 .calibrate_decr = generic_calibrate_decr,
diff --git a/arch/powerpc/platforms/44x/virtex_ml510.c b/arch/powerpc/platforms/44x/virtex_ml510.c
new file mode 100644
index 000000000000..ba4a6e388a46
--- /dev/null
+++ b/arch/powerpc/platforms/44x/virtex_ml510.c
@@ -0,0 +1,29 @@
1#include <asm/i8259.h>
2#include <linux/pci.h>
3#include "44x.h"
4
5/**
6 * ml510_ail_quirk
7 */
8static void __devinit ml510_ali_quirk(struct pci_dev *dev)
9{
10 /* Enable the IDE controller */
11 pci_write_config_byte(dev, 0x58, 0x4c);
12 /* Assign irq 14 to the primary ide channel */
13 pci_write_config_byte(dev, 0x44, 0x0d);
14 /* Assign irq 15 to the secondary ide channel */
15 pci_write_config_byte(dev, 0x75, 0x0f);
16 /* Set the ide controller in native mode */
17 pci_write_config_byte(dev, 0x09, 0xff);
18
19 /* INTB = disabled, INTA = disabled */
20 pci_write_config_byte(dev, 0x48, 0x00);
21 /* INTD = disabled, INTC = disabled */
22 pci_write_config_byte(dev, 0x4a, 0x00);
23 /* Audio = INT7, Modem = disabled. */
24 pci_write_config_byte(dev, 0x4b, 0x60);
25 /* USB = INT7 */
26 pci_write_config_byte(dev, 0x74, 0x06);
27}
28DECLARE_PCI_FIXUP_EARLY(0x10b9, 0x1533, ml510_ali_quirk);
29
diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c
index 960edf89be51..c5118802a281 100644
--- a/arch/powerpc/platforms/44x/warp.c
+++ b/arch/powerpc/platforms/44x/warp.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * PIKA Warp(tm) board specific routines 2 * PIKA Warp(tm) board specific routines
3 * 3 *
4 * Copyright (c) 2008 PIKA Technologies 4 * Copyright (c) 2008-2009 PIKA Technologies
5 * Sean MacLennan <smaclennan@pikatech.com> 5 * Sean MacLennan <smaclennan@pikatech.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -15,6 +15,7 @@
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/of_gpio.h>
18 19
19#include <asm/machdep.h> 20#include <asm/machdep.h>
20#include <asm/prom.h> 21#include <asm/prom.h>
@@ -23,6 +24,7 @@
23#include <asm/uic.h> 24#include <asm/uic.h>
24#include <asm/ppc4xx.h> 25#include <asm/ppc4xx.h>
25 26
27
26static __initdata struct of_device_id warp_of_bus[] = { 28static __initdata struct of_device_id warp_of_bus[] = {
27 { .compatible = "ibm,plb4", }, 29 { .compatible = "ibm,plb4", },
28 { .compatible = "ibm,opb", }, 30 { .compatible = "ibm,opb", },
@@ -55,6 +57,8 @@ define_machine(warp) {
55}; 57};
56 58
57 59
60static u32 post_info;
61
58/* I am not sure this is the best place for this... */ 62/* I am not sure this is the best place for this... */
59static int __init warp_post_info(void) 63static int __init warp_post_info(void)
60{ 64{
@@ -77,21 +81,21 @@ static int __init warp_post_info(void)
77 81
78 iounmap(fpga); 82 iounmap(fpga);
79 83
80 if (post1 || post2) 84 if (post1 || post2) {
81 printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2); 85 printk(KERN_INFO "Warp POST %08x %08x\n", post1, post2);
82 else 86 post_info = 1;
87 } else
83 printk(KERN_INFO "Warp POST OK\n"); 88 printk(KERN_INFO "Warp POST OK\n");
84 89
85 return 0; 90 return 0;
86} 91}
87machine_late_initcall(warp, warp_post_info);
88 92
89 93
90#ifdef CONFIG_SENSORS_AD7414 94#ifdef CONFIG_SENSORS_AD7414
91 95
92static LIST_HEAD(dtm_shutdown_list); 96static LIST_HEAD(dtm_shutdown_list);
93static void __iomem *dtm_fpga; 97static void __iomem *dtm_fpga;
94static void __iomem *gpio_base; 98static unsigned green_led, red_led;
95 99
96 100
97struct dtm_shutdown { 101struct dtm_shutdown {
@@ -134,14 +138,17 @@ int pika_dtm_unregister_shutdown(void (*func)(void *arg), void *arg)
134static irqreturn_t temp_isr(int irq, void *context) 138static irqreturn_t temp_isr(int irq, void *context)
135{ 139{
136 struct dtm_shutdown *shutdown; 140 struct dtm_shutdown *shutdown;
141 int value = 1;
137 142
138 local_irq_disable(); 143 local_irq_disable();
139 144
145 gpio_set_value(green_led, 0);
146
140 /* Run through the shutdown list. */ 147 /* Run through the shutdown list. */
141 list_for_each_entry(shutdown, &dtm_shutdown_list, list) 148 list_for_each_entry(shutdown, &dtm_shutdown_list, list)
142 shutdown->func(shutdown->arg); 149 shutdown->func(shutdown->arg);
143 150
144 printk(KERN_EMERG "\n\nCritical Temperature Shutdown\n"); 151 printk(KERN_EMERG "\n\nCritical Temperature Shutdown\n\n");
145 152
146 while (1) { 153 while (1) {
147 if (dtm_fpga) { 154 if (dtm_fpga) {
@@ -149,52 +156,34 @@ static irqreturn_t temp_isr(int irq, void *context)
149 out_be32(dtm_fpga + 0x14, reset); 156 out_be32(dtm_fpga + 0x14, reset);
150 } 157 }
151 158
152 if (gpio_base) { 159 gpio_set_value(red_led, value);
153 unsigned leds = in_be32(gpio_base); 160 value ^= 1;
154
155 /* green off, red toggle */
156 leds &= ~0x80000000;
157 leds ^= 0x40000000;
158
159 out_be32(gpio_base, leds);
160 }
161
162 mdelay(500); 161 mdelay(500);
163 } 162 }
164} 163}
165 164
166static int pika_setup_leds(void) 165static int pika_setup_leds(void)
167{ 166{
168 struct device_node *np; 167 struct device_node *np, *child;
169 const u32 *gpios;
170 int len;
171 168
172 np = of_find_compatible_node(NULL, NULL, "linux,gpio-led"); 169 np = of_find_compatible_node(NULL, NULL, "gpio-leds");
173 if (!np) { 170 if (!np) {
174 printk(KERN_ERR __FILE__ ": Unable to find gpio-led\n"); 171 printk(KERN_ERR __FILE__ ": Unable to find leds\n");
175 return -ENOENT;
176 }
177
178 gpios = of_get_property(np, "gpios", &len);
179 of_node_put(np);
180 if (!gpios || len < 4) {
181 printk(KERN_ERR __FILE__
182 ": Unable to get gpios property (%d)\n", len);
183 return -ENOENT; 172 return -ENOENT;
184 } 173 }
185 174
186 np = of_find_node_by_phandle(gpios[0]); 175 for_each_child_of_node(np, child)
187 if (!np) { 176 if (strcmp(child->name, "green") == 0) {
188 printk(KERN_ERR __FILE__ ": Unable to find gpio\n"); 177 green_led = of_get_gpio(child, 0);
189 return -ENOENT; 178 /* Turn back on the green LED */
190 } 179 gpio_set_value(green_led, 1);
180 } else if (strcmp(child->name, "red") == 0) {
181 red_led = of_get_gpio(child, 0);
182 /* Set based on post */
183 gpio_set_value(red_led, post_info);
184 }
191 185
192 gpio_base = of_iomap(np, 0);
193 of_node_put(np); 186 of_node_put(np);
194 if (!gpio_base) {
195 printk(KERN_ERR __FILE__ ": Unable to map gpio");
196 return -ENOMEM;
197 }
198 187
199 return 0; 188 return 0;
200} 189}
@@ -270,10 +259,10 @@ static int pika_dtm_thread(void __iomem *fpga)
270 } 259 }
271 260
272found_it: 261found_it:
273 i2c_put_adapter(adap);
274
275 pika_setup_critical_temp(client); 262 pika_setup_critical_temp(client);
276 263
264 i2c_put_adapter(adap);
265
277 printk(KERN_INFO "PIKA DTM thread running.\n"); 266 printk(KERN_INFO "PIKA DTM thread running.\n");
278 267
279 while (!kthread_should_stop()) { 268 while (!kthread_should_stop()) {
@@ -311,6 +300,9 @@ static int __init pika_dtm_start(void)
311 if (dtm_fpga == NULL) 300 if (dtm_fpga == NULL)
312 return -ENOENT; 301 return -ENOENT;
313 302
303 /* Must get post info before thread starts. */
304 warp_post_info();
305
314 dtm_thread = kthread_run(pika_dtm_thread, dtm_fpga, "pika-dtm"); 306 dtm_thread = kthread_run(pika_dtm_thread, dtm_fpga, "pika-dtm");
315 if (IS_ERR(dtm_thread)) { 307 if (IS_ERR(dtm_thread)) {
316 iounmap(dtm_fpga); 308 iounmap(dtm_fpga);
@@ -333,6 +325,8 @@ int pika_dtm_unregister_shutdown(void (*func)(void *arg), void *arg)
333 return 0; 325 return 0;
334} 326}
335 327
328machine_late_initcall(warp, warp_post_info);
329
336#endif 330#endif
337 331
338EXPORT_SYMBOL(pika_dtm_register_shutdown); 332EXPORT_SYMBOL(pika_dtm_register_shutdown);
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index a2068faef6ea..bcc69e1f77c1 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -34,7 +34,7 @@
34static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 34static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
35 int len, u32 * val) 35 int len, u32 * val)
36{ 36{
37 struct pci_controller *hose = bus->sysdata; 37 struct pci_controller *hose = pci_bus_to_host(bus);
38 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) 38 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
39 | (((bus->number - hose->first_busno) & 0xff) << 16) 39 | (((bus->number - hose->first_busno) & 0xff) << 16)
40 | (hose->global_number << 24); 40 | (hose->global_number << 24);
@@ -49,7 +49,7 @@ static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
49static int rtas_write_config(struct pci_bus *bus, unsigned int devfn, 49static int rtas_write_config(struct pci_bus *bus, unsigned int devfn,
50 int offset, int len, u32 val) 50 int offset, int len, u32 val)
51{ 51{
52 struct pci_controller *hose = bus->sysdata; 52 struct pci_controller *hose = pci_bus_to_host(bus);
53 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) 53 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
54 | (((bus->number - hose->first_busno) & 0xff) << 16) 54 | (((bus->number - hose->first_busno) & 0xff) << 16)
55 | (hose->global_number << 24); 55 | (hose->global_number << 24);
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index 87ff522f28b5..dd43114e9684 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -107,7 +107,7 @@ static int
107mpc52xx_pci_read_config(struct pci_bus *bus, unsigned int devfn, 107mpc52xx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
108 int offset, int len, u32 *val) 108 int offset, int len, u32 *val)
109{ 109{
110 struct pci_controller *hose = bus->sysdata; 110 struct pci_controller *hose = pci_bus_to_host(bus);
111 u32 value; 111 u32 value;
112 112
113 if (ppc_md.pci_exclude_device) 113 if (ppc_md.pci_exclude_device)
@@ -164,7 +164,7 @@ static int
164mpc52xx_pci_write_config(struct pci_bus *bus, unsigned int devfn, 164mpc52xx_pci_write_config(struct pci_bus *bus, unsigned int devfn,
165 int offset, int len, u32 val) 165 int offset, int len, u32 val)
166{ 166{
167 struct pci_controller *hose = bus->sysdata; 167 struct pci_controller *hose = pci_bus_to_host(bus);
168 u32 value, mask; 168 u32 value, mask;
169 169
170 if (ppc_md.pci_exclude_device) 170 if (ppc_md.pci_exclude_device)
diff --git a/arch/powerpc/platforms/82xx/ep8248e.c b/arch/powerpc/platforms/82xx/ep8248e.c
index 0eb6d7f62241..51fcae41f08a 100644
--- a/arch/powerpc/platforms/82xx/ep8248e.c
+++ b/arch/powerpc/platforms/82xx/ep8248e.c
@@ -14,6 +14,7 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/fsl_devices.h> 15#include <linux/fsl_devices.h>
16#include <linux/mdio-bitbang.h> 16#include <linux/mdio-bitbang.h>
17#include <linux/of_mdio.h>
17#include <linux/of_platform.h> 18#include <linux/of_platform.h>
18 19
19#include <asm/io.h> 20#include <asm/io.h>
@@ -115,7 +116,7 @@ static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
115 struct mii_bus *bus; 116 struct mii_bus *bus;
116 struct resource res; 117 struct resource res;
117 struct device_node *node; 118 struct device_node *node;
118 int ret, i; 119 int ret;
119 120
120 node = of_get_parent(ofdev->node); 121 node = of_get_parent(ofdev->node);
121 of_node_put(node); 122 of_node_put(node);
@@ -130,17 +131,13 @@ static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
130 if (!bus) 131 if (!bus)
131 return -ENOMEM; 132 return -ENOMEM;
132 133
133 bus->phy_mask = 0;
134 bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); 134 bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
135 135
136 for (i = 0; i < PHY_MAX_ADDR; i++)
137 bus->irq[i] = -1;
138
139 bus->name = "ep8248e-mdio-bitbang"; 136 bus->name = "ep8248e-mdio-bitbang";
140 bus->parent = &ofdev->dev; 137 bus->parent = &ofdev->dev;
141 snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start); 138 snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start);
142 139
143 return mdiobus_register(bus); 140 return of_mdiobus_register(bus, ofdev->node);
144} 141}
145 142
146static int ep8248e_mdio_remove(struct of_device *ofdev) 143static int ep8248e_mdio_remove(struct of_device *ofdev)
diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h
index 984db42cc8e7..6cf0f97486e2 100644
--- a/arch/powerpc/platforms/82xx/pq2ads.h
+++ b/arch/powerpc/platforms/82xx/pq2ads.h
@@ -24,10 +24,6 @@
24 24
25#include <linux/seq_file.h> 25#include <linux/seq_file.h>
26 26
27/* Backword-compatibility stuff for the drivers */
28#define CPM_MAP_ADDR ((uint)0xf0000000)
29#define CPM_IRQ_OFFSET 0
30
31/* The ADS8260 has 16, 32-bit wide control/status registers, accessed 27/* The ADS8260 has 16, 32-bit wide control/status registers, accessed
32 * only on word boundaries. 28 * only on word boundaries.
33 * Not all are used (yet), or are interesting to us (yet). 29 * Not all are used (yet), or are interesting to us (yet).
@@ -44,14 +40,5 @@
44#define BCSR3_FETHIEN2 ((uint)0x10000000) /* 0 == enable*/ 40#define BCSR3_FETHIEN2 ((uint)0x10000000) /* 0 == enable*/
45#define BCSR3_FETH2_RST ((uint)0x80000000) /* 0 == reset */ 41#define BCSR3_FETH2_RST ((uint)0x80000000) /* 0 == reset */
46 42
47/* cpm serial driver works with constants below */
48
49#define SIU_INT_SMC1 ((uint)0x04+CPM_IRQ_OFFSET)
50#define SIU_INT_SMC2 ((uint)0x05+CPM_IRQ_OFFSET)
51#define SIU_INT_SCC1 ((uint)0x28+CPM_IRQ_OFFSET)
52#define SIU_INT_SCC2 ((uint)0x29+CPM_IRQ_OFFSET)
53#define SIU_INT_SCC3 ((uint)0x2a+CPM_IRQ_OFFSET)
54#define SIU_INT_SCC4 ((uint)0x2b+CPM_IRQ_OFFSET)
55
56#endif /* __MACH_ADS8260_DEFS */ 43#endif /* __MACH_ADS8260_DEFS */
57#endif /* __KERNEL__ */ 44#endif /* __KERNEL__ */
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 7f066adc068c..43d385cedcd7 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -34,6 +34,7 @@ config MPC85xx_MDS
34 bool "Freescale MPC85xx MDS" 34 bool "Freescale MPC85xx MDS"
35 select DEFAULT_UIMAGE 35 select DEFAULT_UIMAGE
36 select PHYLIB 36 select PHYLIB
37 select HAS_RAPIDIO
37 help 38 help
38 This option enables support for the MPC85xx MDS board 39 This option enables support for the MPC85xx MDS board
39 40
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index de66de7a9ca2..53d5851a6c97 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -163,7 +163,8 @@ static void __init mpc85xx_ds_setup_arch(void)
163#ifdef CONFIG_PCI 163#ifdef CONFIG_PCI
164 for_each_node_by_type(np, "pci") { 164 for_each_node_by_type(np, "pci") {
165 if (of_device_is_compatible(np, "fsl,mpc8540-pci") || 165 if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
166 of_device_is_compatible(np, "fsl,mpc8548-pcie")) { 166 of_device_is_compatible(np, "fsl,mpc8548-pcie") ||
167 of_device_is_compatible(np, "fsl,p2020-pcie")) {
167 struct resource rsrc; 168 struct resource rsrc;
168 of_address_to_resource(np, 0, &rsrc); 169 of_address_to_resource(np, 0, &rsrc);
169 if ((rsrc.start & 0xfffff) == primary_phb_addr) 170 if ((rsrc.start & 0xfffff) == primary_phb_addr)
@@ -195,9 +196,9 @@ static int __init mpc8544_ds_probe(void)
195 primary_phb_addr = 0xb000; 196 primary_phb_addr = 0xb000;
196#endif 197#endif
197 return 1; 198 return 1;
198 } else {
199 return 0;
200 } 199 }
200
201 return 0;
201} 202}
202 203
203static struct of_device_id __initdata mpc85xxds_ids[] = { 204static struct of_device_id __initdata mpc85xxds_ids[] = {
@@ -214,6 +215,7 @@ static int __init mpc85xxds_publish_devices(void)
214} 215}
215machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices); 216machine_device_initcall(mpc8544_ds, mpc85xxds_publish_devices);
216machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices); 217machine_device_initcall(mpc8572_ds, mpc85xxds_publish_devices);
218machine_device_initcall(p2020_ds, mpc85xxds_publish_devices);
217 219
218/* 220/*
219 * Called very early, device-tree isn't unflattened 221 * Called very early, device-tree isn't unflattened
@@ -227,9 +229,26 @@ static int __init mpc8572_ds_probe(void)
227 primary_phb_addr = 0x8000; 229 primary_phb_addr = 0x8000;
228#endif 230#endif
229 return 1; 231 return 1;
230 } else {
231 return 0;
232 } 232 }
233
234 return 0;
235}
236
237/*
238 * Called very early, device-tree isn't unflattened
239 */
240static int __init p2020_ds_probe(void)
241{
242 unsigned long root = of_get_flat_dt_root();
243
244 if (of_flat_dt_is_compatible(root, "fsl,P2020DS")) {
245#ifdef CONFIG_PCI
246 primary_phb_addr = 0x9000;
247#endif
248 return 1;
249 }
250
251 return 0;
233} 252}
234 253
235define_machine(mpc8544_ds) { 254define_machine(mpc8544_ds) {
@@ -259,3 +278,17 @@ define_machine(mpc8572_ds) {
259 .calibrate_decr = generic_calibrate_decr, 278 .calibrate_decr = generic_calibrate_decr,
260 .progress = udbg_progress, 279 .progress = udbg_progress,
261}; 280};
281
282define_machine(p2020_ds) {
283 .name = "P2020 DS",
284 .probe = p2020_ds_probe,
285 .setup_arch = mpc85xx_ds_setup_arch,
286 .init_IRQ = mpc85xx_ds_pic_init,
287#ifdef CONFIG_PCI
288 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
289#endif
290 .get_irq = mpic_get_irq,
291 .restart = fsl_rstcr_restart,
292 .calibrate_decr = generic_calibrate_decr,
293 .progress = udbg_progress,
294};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 7dd029034aec..b2c0a4319973 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -206,23 +206,24 @@ static void __init mpc85xx_mds_setup_arch(void)
206 } 206 }
207 207
208 if (bcsr_regs) { 208 if (bcsr_regs) {
209 if (machine_is(mpc8568_mds)) {
209#define BCSR_UCC1_GETH_EN (0x1 << 7) 210#define BCSR_UCC1_GETH_EN (0x1 << 7)
210#define BCSR_UCC2_GETH_EN (0x1 << 7) 211#define BCSR_UCC2_GETH_EN (0x1 << 7)
211#define BCSR_UCC1_MODE_MSK (0x3 << 4) 212#define BCSR_UCC1_MODE_MSK (0x3 << 4)
212#define BCSR_UCC2_MODE_MSK (0x3 << 0) 213#define BCSR_UCC2_MODE_MSK (0x3 << 0)
213 214
214 /* Turn off UCC1 & UCC2 */ 215 /* Turn off UCC1 & UCC2 */
215 clrbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN); 216 clrbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
216 clrbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN); 217 clrbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
217 218
218 /* Mode is RGMII, all bits clear */ 219 /* Mode is RGMII, all bits clear */
219 clrbits8(&bcsr_regs[11], BCSR_UCC1_MODE_MSK | 220 clrbits8(&bcsr_regs[11], BCSR_UCC1_MODE_MSK |
220 BCSR_UCC2_MODE_MSK); 221 BCSR_UCC2_MODE_MSK);
221
222 /* Turn UCC1 & UCC2 on */
223 setbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
224 setbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
225 222
223 /* Turn UCC1 & UCC2 on */
224 setbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
225 setbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
226 }
226 iounmap(bcsr_regs); 227 iounmap(bcsr_regs);
227 } 228 }
228#endif /* CONFIG_QUICC_ENGINE */ 229#endif /* CONFIG_QUICC_ENGINE */
@@ -257,7 +258,8 @@ static int __init board_fixups(void)
257 258
258 return 0; 259 return 0;
259} 260}
260machine_arch_initcall(mpc85xx_mds, board_fixups); 261machine_arch_initcall(mpc8568_mds, board_fixups);
262machine_arch_initcall(mpc8569_mds, board_fixups);
261 263
262static struct of_device_id mpc85xx_ids[] = { 264static struct of_device_id mpc85xx_ids[] = {
263 { .type = "soc", }, 265 { .type = "soc", },
@@ -276,7 +278,8 @@ static int __init mpc85xx_publish_devices(void)
276 278
277 return 0; 279 return 0;
278} 280}
279machine_device_initcall(mpc85xx_mds, mpc85xx_publish_devices); 281machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices);
282machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices);
280 283
281static void __init mpc85xx_mds_pic_init(void) 284static void __init mpc85xx_mds_pic_init(void)
282{ 285{
@@ -321,8 +324,8 @@ static int __init mpc85xx_mds_probe(void)
321 return of_flat_dt_is_compatible(root, "MPC85xxMDS"); 324 return of_flat_dt_is_compatible(root, "MPC85xxMDS");
322} 325}
323 326
324define_machine(mpc85xx_mds) { 327define_machine(mpc8568_mds) {
325 .name = "MPC85xx MDS", 328 .name = "MPC8568 MDS",
326 .probe = mpc85xx_mds_probe, 329 .probe = mpc85xx_mds_probe,
327 .setup_arch = mpc85xx_mds_setup_arch, 330 .setup_arch = mpc85xx_mds_setup_arch,
328 .init_IRQ = mpc85xx_mds_pic_init, 331 .init_IRQ = mpc85xx_mds_pic_init,
@@ -334,3 +337,24 @@ define_machine(mpc85xx_mds) {
334 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 337 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
335#endif 338#endif
336}; 339};
340
341static int __init mpc8569_mds_probe(void)
342{
343 unsigned long root = of_get_flat_dt_root();
344
345 return of_flat_dt_is_compatible(root, "fsl,MPC8569EMDS");
346}
347
348define_machine(mpc8569_mds) {
349 .name = "MPC8569 MDS",
350 .probe = mpc8569_mds_probe,
351 .setup_arch = mpc85xx_mds_setup_arch,
352 .init_IRQ = mpc85xx_mds_pic_init,
353 .get_irq = mpic_get_irq,
354 .restart = fsl_rstcr_restart,
355 .calibrate_decr = generic_calibrate_decr,
356 .progress = udbg_progress,
357#ifdef CONFIG_PCI
358 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
359#endif
360};
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
index d79104669cdc..2efa052975e6 100644
--- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -28,7 +28,6 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 30#include <asm/pci-bridge.h>
31#include <asm/mpc86xx.h>
32#include <asm/prom.h> 31#include <asm/prom.h>
33#include <mm/mmu_decl.h> 32#include <mm/mmu_decl.h>
34#include <asm/udbg.h> 33#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c
index af14f852d747..90754e752bd8 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc310.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
@@ -28,7 +28,6 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 30#include <asm/pci-bridge.h>
31#include <asm/mpc86xx.h>
32#include <asm/prom.h> 31#include <asm/prom.h>
33#include <mm/mmu_decl.h> 32#include <mm/mmu_decl.h>
34#include <asm/udbg.h> 33#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index ea2360639652..72b31a6010a0 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -28,7 +28,6 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 30#include <asm/pci-bridge.h>
31#include <asm/mpc86xx.h>
32#include <asm/prom.h> 31#include <asm/prom.h>
33#include <mm/mmu_decl.h> 32#include <mm/mmu_decl.h>
34#include <asm/udbg.h> 33#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index 3f49a6f893a3..51eec0cd5519 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -28,7 +28,6 @@
28#include <asm/time.h> 28#include <asm/time.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/pci-bridge.h> 30#include <asm/pci-bridge.h>
31#include <asm/mpc86xx.h>
32#include <asm/prom.h> 31#include <asm/prom.h>
33#include <mm/mmu_decl.h> 32#include <mm/mmu_decl.h>
34#include <asm/udbg.h> 33#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index c4ec49b5f7f8..7e9e83c04a8a 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -24,7 +24,6 @@
24#include <asm/time.h> 24#include <asm/time.h>
25#include <asm/machdep.h> 25#include <asm/machdep.h>
26#include <asm/pci-bridge.h> 26#include <asm/pci-bridge.h>
27#include <asm/mpc86xx.h>
28#include <asm/prom.h> 27#include <asm/prom.h>
29#include <mm/mmu_decl.h> 28#include <mm/mmu_decl.h>
30#include <asm/udbg.h> 29#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
index 014e26cda08d..d84bbb508ee7 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
@@ -20,7 +20,6 @@
20#include <asm/pgtable.h> 20#include <asm/pgtable.h>
21#include <asm/pci-bridge.h> 21#include <asm/pci-bridge.h>
22#include <asm/mpic.h> 22#include <asm/mpic.h>
23#include <asm/mpc86xx.h>
24#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
25 24
26#include <sysdev/fsl_soc.h> 25#include <sysdev/fsl_soc.h>
@@ -30,6 +29,11 @@
30extern void __secondary_start_mpc86xx(void); 29extern void __secondary_start_mpc86xx(void);
31extern unsigned long __secondary_hold_acknowledge; 30extern unsigned long __secondary_hold_acknowledge;
32 31
32#define MCM_PORT_CONFIG_OFFSET 0x10
33
34/* Offset from CCSRBAR */
35#define MPC86xx_MCM_OFFSET (0x1000)
36#define MPC86xx_MCM_SIZE (0x1000)
33 37
34static void __init 38static void __init
35smp_86xx_release_core(int nr) 39smp_86xx_release_core(int nr)
@@ -48,6 +52,8 @@ smp_86xx_release_core(int nr)
48 pcr = in_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2)); 52 pcr = in_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2));
49 pcr |= 1 << (nr + 24); 53 pcr |= 1 << (nr + 24);
50 out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2), pcr); 54 out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2), pcr);
55
56 iounmap(mcm_vaddr);
51} 57}
52 58
53 59
diff --git a/arch/powerpc/platforms/86xx/sbc8641d.c b/arch/powerpc/platforms/86xx/sbc8641d.c
index 2886a36fc085..51c8f331b671 100644
--- a/arch/powerpc/platforms/86xx/sbc8641d.c
+++ b/arch/powerpc/platforms/86xx/sbc8641d.c
@@ -25,7 +25,6 @@
25#include <asm/time.h> 25#include <asm/time.h>
26#include <asm/machdep.h> 26#include <asm/machdep.h>
27#include <asm/pci-bridge.h> 27#include <asm/pci-bridge.h>
28#include <asm/mpc86xx.h>
29#include <asm/prom.h> 28#include <asm/prom.h>
30#include <mm/mmu_decl.h> 29#include <mm/mmu_decl.h>
31#include <asm/udbg.h> 30#include <asm/udbg.h>
diff --git a/arch/powerpc/platforms/8xx/mpc885ads.h b/arch/powerpc/platforms/8xx/mpc885ads.h
index a5076668bad6..19412f76fa3b 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads.h
+++ b/arch/powerpc/platforms/8xx/mpc885ads.h
@@ -17,10 +17,6 @@
17 17
18#include <sysdev/fsl_soc.h> 18#include <sysdev/fsl_soc.h>
19 19
20#define MPC8xx_CPM_OFFSET (0x9c0)
21#define CPM_MAP_ADDR (get_immrbase() + MPC8xx_CPM_OFFSET)
22#define CPM_IRQ_OFFSET 16 // for compability with cpm_uart driver
23
24/* Bits of interest in the BCSRs. 20/* Bits of interest in the BCSRs.
25 */ 21 */
26#define BCSR1_ETHEN ((uint)0x20000000) 22#define BCSR1_ETHEN ((uint)0x20000000)
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index e3e87078d03f..04a8061045c4 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -329,4 +329,8 @@ config MCU_MPC8349EMITX
329 also register MCU GPIOs with the generic GPIO API, so you'll able 329 also register MCU GPIOs with the generic GPIO API, so you'll able
330 to use MCU pins as GPIOs. 330 to use MCU pins as GPIOs.
331 331
332config XILINX_PCI
333 bool "Xilinx PCI host bridge support"
334 depends on PCI && XILINX_VIRTEX
335
332endmenu 336endmenu
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 732ee93a8e98..cca6b4fc719a 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -10,7 +10,6 @@ menu "Processor support"
10choice 10choice
11 prompt "Processor Type" 11 prompt "Processor Type"
12 depends on PPC32 12 depends on PPC32
13 default 6xx
14 help 13 help
15 There are five families of 32 bit PowerPC chips supported. 14 There are five families of 32 bit PowerPC chips supported.
16 The most common ones are the desktop and server CPUs (601, 603, 15 The most common ones are the desktop and server CPUs (601, 603,
@@ -22,7 +21,7 @@ choice
22 21
23 If unsure, select 52xx/6xx/7xx/74xx/82xx/83xx/86xx. 22 If unsure, select 52xx/6xx/7xx/74xx/82xx/83xx/86xx.
24 23
25config 6xx 24config PPC_BOOK3S
26 bool "512x/52xx/6xx/7xx/74xx/82xx/83xx/86xx" 25 bool "512x/52xx/6xx/7xx/74xx/82xx/83xx/86xx"
27 select PPC_FPU 26 select PPC_FPU
28 27
@@ -58,13 +57,11 @@ config E200
58 57
59endchoice 58endchoice
60 59
61# Until we have a choice of exclusive CPU types on 64-bit, we always
62# use PPC_BOOK3S. On 32-bit, this is equivalent to 6xx which is
63# "classic" MMU
64
65config PPC_BOOK3S 60config PPC_BOOK3S
66 def_bool y 61 default y
67 depends on PPC64 || 6xx 62 depends on PPC64
63 select PPC_FPU
64
68 65
69config POWER4_ONLY 66config POWER4_ONLY
70 bool "Optimize for POWER4" 67 bool "Optimize for POWER4"
@@ -75,6 +72,10 @@ config POWER4_ONLY
75 The resulting binary will not work on POWER3 or RS64 processors 72 The resulting binary will not work on POWER3 or RS64 processors
76 when compiled with binutils 2.15 or later. 73 when compiled with binutils 2.15 or later.
77 74
75config 6xx
76 def_bool y
77 depends on PPC32 && PPC_BOOK3S
78
78config POWER3 79config POWER3
79 bool 80 bool
80 depends on PPC64 && PPC_BOOK3S 81 depends on PPC64 && PPC_BOOK3S
@@ -203,9 +204,8 @@ config SPE
203 If in doubt, say Y here. 204 If in doubt, say Y here.
204 205
205config PPC_STD_MMU 206config PPC_STD_MMU
206 bool 207 def_bool y
207 depends on 6xx || PPC64 208 depends on PPC_BOOK3S
208 default y
209 209
210config PPC_STD_MMU_32 210config PPC_STD_MMU_32
211 def_bool y 211 def_bool y
@@ -263,8 +263,8 @@ config SMP
263 If you don't know what to do here, say N. 263 If you don't know what to do here, say N.
264 264
265config NR_CPUS 265config NR_CPUS
266 int "Maximum number of CPUs (2-1024)" 266 int "Maximum number of CPUs (2-8192)"
267 range 2 1024 267 range 2 8192
268 depends on SMP 268 depends on SMP
269 default "32" if PPC64 269 default "32" if PPC64
270 default "4" 270 default "4"
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index 0ce45c2b42f8..c71498dbf211 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -329,7 +329,7 @@ static struct irq_host_ops msic_host_ops = {
329 329
330static int axon_msi_shutdown(struct of_device *device) 330static int axon_msi_shutdown(struct of_device *device)
331{ 331{
332 struct axon_msic *msic = device->dev.platform_data; 332 struct axon_msic *msic = dev_get_drvdata(&device->dev);
333 u32 tmp; 333 u32 tmp;
334 334
335 pr_debug("axon_msi: disabling %s\n", 335 pr_debug("axon_msi: disabling %s\n",
@@ -416,7 +416,7 @@ static int axon_msi_probe(struct of_device *device,
416 msic->read_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG) 416 msic->read_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG)
417 & MSIC_FIFO_SIZE_MASK; 417 & MSIC_FIFO_SIZE_MASK;
418 418
419 device->dev.platform_data = msic; 419 dev_set_drvdata(&device->dev, msic);
420 420
421 ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs; 421 ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs;
422 ppc_md.teardown_msi_irqs = axon_msi_teardown_msi_irqs; 422 ppc_md.teardown_msi_irqs = axon_msi_teardown_msi_irqs;
diff --git a/arch/powerpc/platforms/cell/celleb_pci.c b/arch/powerpc/platforms/cell/celleb_pci.c
index f39a3b2a1667..00eaaa71630f 100644
--- a/arch/powerpc/platforms/cell/celleb_pci.c
+++ b/arch/powerpc/platforms/cell/celleb_pci.c
@@ -162,8 +162,7 @@ static int celleb_fake_pci_read_config(struct pci_bus *bus,
162 unsigned int devfn, int where, int size, u32 *val) 162 unsigned int devfn, int where, int size, u32 *val)
163{ 163{
164 char *config; 164 char *config;
165 struct device_node *node; 165 struct pci_controller *hose = pci_bus_to_host(bus);
166 struct pci_controller *hose;
167 unsigned int devno = devfn >> 3; 166 unsigned int devno = devfn >> 3;
168 unsigned int fn = devfn & 0x7; 167 unsigned int fn = devfn & 0x7;
169 168
@@ -171,8 +170,6 @@ static int celleb_fake_pci_read_config(struct pci_bus *bus,
171 BUG_ON(where % size); 170 BUG_ON(where % size);
172 171
173 pr_debug(" fake read: bus=0x%x, ", bus->number); 172 pr_debug(" fake read: bus=0x%x, ", bus->number);
174 node = (struct device_node *)bus->sysdata;
175 hose = pci_find_hose_for_OF_device(node);
176 config = get_fake_config_start(hose, devno, fn); 173 config = get_fake_config_start(hose, devno, fn);
177 174
178 pr_debug("devno=0x%x, where=0x%x, size=0x%x, ", devno, where, size); 175 pr_debug("devno=0x%x, where=0x%x, size=0x%x, ", devno, where, size);
@@ -192,8 +189,7 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus,
192 unsigned int devfn, int where, int size, u32 val) 189 unsigned int devfn, int where, int size, u32 val)
193{ 190{
194 char *config; 191 char *config;
195 struct device_node *node; 192 struct pci_controller *hose = pci_bus_to_host(bus);
196 struct pci_controller *hose;
197 struct celleb_pci_resource *res; 193 struct celleb_pci_resource *res;
198 unsigned int devno = devfn >> 3; 194 unsigned int devno = devfn >> 3;
199 unsigned int fn = devfn & 0x7; 195 unsigned int fn = devfn & 0x7;
@@ -201,8 +197,6 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus,
201 /* allignment check */ 197 /* allignment check */
202 BUG_ON(where % size); 198 BUG_ON(where % size);
203 199
204 node = (struct device_node *)bus->sysdata;
205 hose = pci_find_hose_for_OF_device(node);
206 config = get_fake_config_start(hose, devno, fn); 200 config = get_fake_config_start(hose, devno, fn);
207 201
208 if (!config) 202 if (!config)
diff --git a/arch/powerpc/platforms/cell/celleb_scc_epci.c b/arch/powerpc/platforms/cell/celleb_scc_epci.c
index 48ec88a38a12..05b0db3ef638 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_epci.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_epci.c
@@ -134,15 +134,11 @@ static int celleb_epci_read_config(struct pci_bus *bus,
134{ 134{
135 PCI_IO_ADDR epci_base; 135 PCI_IO_ADDR epci_base;
136 PCI_IO_ADDR addr; 136 PCI_IO_ADDR addr;
137 struct device_node *node; 137 struct pci_controller *hose = pci_bus_to_host(bus);
138 struct pci_controller *hose;
139 138
140 /* allignment check */ 139 /* allignment check */
141 BUG_ON(where % size); 140 BUG_ON(where % size);
142 141
143 node = (struct device_node *)bus->sysdata;
144 hose = pci_find_hose_for_OF_device(node);
145
146 if (!celleb_epci_get_epci_cfg(hose)) 142 if (!celleb_epci_get_epci_cfg(hose))
147 return PCIBIOS_DEVICE_NOT_FOUND; 143 return PCIBIOS_DEVICE_NOT_FOUND;
148 144
@@ -198,16 +194,11 @@ static int celleb_epci_write_config(struct pci_bus *bus,
198{ 194{
199 PCI_IO_ADDR epci_base; 195 PCI_IO_ADDR epci_base;
200 PCI_IO_ADDR addr; 196 PCI_IO_ADDR addr;
201 struct device_node *node; 197 struct pci_controller *hose = pci_bus_to_host(bus);
202 struct pci_controller *hose;
203 198
204 /* allignment check */ 199 /* allignment check */
205 BUG_ON(where % size); 200 BUG_ON(where % size);
206 201
207 node = (struct device_node *)bus->sysdata;
208 hose = pci_find_hose_for_OF_device(node);
209
210
211 if (!celleb_epci_get_epci_cfg(hose)) 202 if (!celleb_epci_get_epci_cfg(hose))
212 return PCIBIOS_DEVICE_NOT_FOUND; 203 return PCIBIOS_DEVICE_NOT_FOUND;
213 204
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
index 3e7e0f1568ef..7fca09f990ba 100644
--- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c
+++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c
@@ -366,11 +366,7 @@ static void config_write_pciex_rc(unsigned int __iomem *base, uint32_t where,
366static int scc_pciex_read_config(struct pci_bus *bus, unsigned int devfn, 366static int scc_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
367 int where, int size, unsigned int *val) 367 int where, int size, unsigned int *val)
368{ 368{
369 struct device_node *dn; 369 struct pci_controller *phb = pci_bus_to_host(bus);
370 struct pci_controller *phb;
371
372 dn = bus->sysdata;
373 phb = pci_find_hose_for_OF_device(dn);
374 370
375 if (bus->number == phb->first_busno && PCI_SLOT(devfn) != 1) { 371 if (bus->number == phb->first_busno && PCI_SLOT(devfn) != 1) {
376 *val = ~0; 372 *val = ~0;
@@ -389,11 +385,7 @@ static int scc_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
389static int scc_pciex_write_config(struct pci_bus *bus, unsigned int devfn, 385static int scc_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
390 int where, int size, unsigned int val) 386 int where, int size, unsigned int val)
391{ 387{
392 struct device_node *dn; 388 struct pci_controller *phb = pci_bus_to_host(bus);
393 struct pci_controller *phb;
394
395 dn = bus->sysdata;
396 phb = pci_find_hose_for_OF_device(dn);
397 389
398 if (bus->number == phb->first_busno && PCI_SLOT(devfn) != 1) 390 if (bus->number == phb->first_busno && PCI_SLOT(devfn) != 1)
399 return PCIBIOS_DEVICE_NOT_FOUND; 391 return PCIBIOS_DEVICE_NOT_FOUND;
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index bed4690de394..5b34fc211f35 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -100,16 +100,6 @@
100#define IOSTE_PS_1M 0x0000000000000005ul /* - 1MB */ 100#define IOSTE_PS_1M 0x0000000000000005ul /* - 1MB */
101#define IOSTE_PS_16M 0x0000000000000007ul /* - 16MB */ 101#define IOSTE_PS_16M 0x0000000000000007ul /* - 16MB */
102 102
103/* Page table entries */
104#define IOPTE_PP_W 0x8000000000000000ul /* protection: write */
105#define IOPTE_PP_R 0x4000000000000000ul /* protection: read */
106#define IOPTE_M 0x2000000000000000ul /* coherency required */
107#define IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */
108#define IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */
109#define IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */
110#define IOPTE_H 0x0000000000000800ul /* cache hint */
111#define IOPTE_IOID_Mask 0x00000000000007fful /* ioid */
112
113 103
114/* IOMMU sizing */ 104/* IOMMU sizing */
115#define IO_SEGMENT_SHIFT 28 105#define IO_SEGMENT_SHIFT 28
@@ -193,19 +183,21 @@ static int tce_build_cell(struct iommu_table *tbl, long index, long npages,
193 */ 183 */
194 const unsigned long prot = 0xc48; 184 const unsigned long prot = 0xc48;
195 base_pte = 185 base_pte =
196 ((prot << (52 + 4 * direction)) & (IOPTE_PP_W | IOPTE_PP_R)) 186 ((prot << (52 + 4 * direction)) &
197 | IOPTE_M | IOPTE_SO_RW | (window->ioid & IOPTE_IOID_Mask); 187 (CBE_IOPTE_PP_W | CBE_IOPTE_PP_R)) |
188 CBE_IOPTE_M | CBE_IOPTE_SO_RW |
189 (window->ioid & CBE_IOPTE_IOID_Mask);
198#else 190#else
199 base_pte = IOPTE_PP_W | IOPTE_PP_R | IOPTE_M | IOPTE_SO_RW | 191 base_pte = CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | CBE_IOPTE_M |
200 (window->ioid & IOPTE_IOID_Mask); 192 CBE_IOPTE_SO_RW | (window->ioid & CBE_IOPTE_IOID_Mask);
201#endif 193#endif
202 if (unlikely(dma_get_attr(DMA_ATTR_WEAK_ORDERING, attrs))) 194 if (unlikely(dma_get_attr(DMA_ATTR_WEAK_ORDERING, attrs)))
203 base_pte &= ~IOPTE_SO_RW; 195 base_pte &= ~CBE_IOPTE_SO_RW;
204 196
205 io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset); 197 io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset);
206 198
207 for (i = 0; i < npages; i++, uaddr += IOMMU_PAGE_SIZE) 199 for (i = 0; i < npages; i++, uaddr += IOMMU_PAGE_SIZE)
208 io_pte[i] = base_pte | (__pa(uaddr) & IOPTE_RPN_Mask); 200 io_pte[i] = base_pte | (__pa(uaddr) & CBE_IOPTE_RPN_Mask);
209 201
210 mb(); 202 mb();
211 203
@@ -231,8 +223,9 @@ static void tce_free_cell(struct iommu_table *tbl, long index, long npages)
231#else 223#else
232 /* spider bridge does PCI reads after freeing - insert a mapping 224 /* spider bridge does PCI reads after freeing - insert a mapping
233 * to a scratch page instead of an invalid entry */ 225 * to a scratch page instead of an invalid entry */
234 pte = IOPTE_PP_R | IOPTE_M | IOPTE_SO_RW | __pa(window->iommu->pad_page) 226 pte = CBE_IOPTE_PP_R | CBE_IOPTE_M | CBE_IOPTE_SO_RW |
235 | (window->ioid & IOPTE_IOID_Mask); 227 __pa(window->iommu->pad_page) |
228 (window->ioid & CBE_IOPTE_IOID_Mask);
236#endif 229#endif
237 230
238 io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset); 231 io_pte = (unsigned long *)tbl->it_base + (index - tbl->it_offset);
@@ -1001,7 +994,7 @@ static void insert_16M_pte(unsigned long addr, unsigned long *ptab,
1001 pr_debug("iommu: addr %lx ptab %p segment %lx offset %lx\n", 994 pr_debug("iommu: addr %lx ptab %p segment %lx offset %lx\n",
1002 addr, ptab, segment, offset); 995 addr, ptab, segment, offset);
1003 996
1004 ptab[offset] = base_pte | (__pa(addr) & IOPTE_RPN_Mask); 997 ptab[offset] = base_pte | (__pa(addr) & CBE_IOPTE_RPN_Mask);
1005} 998}
1006 999
1007static void cell_iommu_setup_fixed_ptab(struct cbe_iommu *iommu, 1000static void cell_iommu_setup_fixed_ptab(struct cbe_iommu *iommu,
@@ -1016,14 +1009,14 @@ static void cell_iommu_setup_fixed_ptab(struct cbe_iommu *iommu,
1016 1009
1017 pr_debug("iommu: mapping 0x%lx pages from 0x%lx\n", fsize, fbase); 1010 pr_debug("iommu: mapping 0x%lx pages from 0x%lx\n", fsize, fbase);
1018 1011
1019 base_pte = IOPTE_PP_W | IOPTE_PP_R | IOPTE_M 1012 base_pte = CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | CBE_IOPTE_M |
1020 | (cell_iommu_get_ioid(np) & IOPTE_IOID_Mask); 1013 (cell_iommu_get_ioid(np) & CBE_IOPTE_IOID_Mask);
1021 1014
1022 if (iommu_fixed_is_weak) 1015 if (iommu_fixed_is_weak)
1023 pr_info("IOMMU: Using weak ordering for fixed mapping\n"); 1016 pr_info("IOMMU: Using weak ordering for fixed mapping\n");
1024 else { 1017 else {
1025 pr_info("IOMMU: Using strong ordering for fixed mapping\n"); 1018 pr_info("IOMMU: Using strong ordering for fixed mapping\n");
1026 base_pte |= IOPTE_SO_RW; 1019 base_pte |= CBE_IOPTE_SO_RW;
1027 } 1020 }
1028 1021
1029 for (uaddr = 0; uaddr < fsize; uaddr += (1 << 24)) { 1022 for (uaddr = 0; uaddr < fsize; uaddr += (1 << 24)) {
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c
index 296b5268754e..5e0a191764fc 100644
--- a/arch/powerpc/platforms/cell/ras.c
+++ b/arch/powerpc/platforms/cell/ras.c
@@ -122,8 +122,8 @@ static int __init cbe_ptcal_enable_on_node(int nid, int order)
122 122
123 area->nid = nid; 123 area->nid = nid;
124 area->order = order; 124 area->order = order;
125 area->pages = alloc_pages_node(area->nid, GFP_KERNEL | GFP_THISNODE, 125 area->pages = alloc_pages_exact_node(area->nid, GFP_KERNEL|GFP_THISNODE,
126 area->order); 126 area->order);
127 127
128 if (!area->pages) { 128 if (!area->pages) {
129 printk(KERN_WARNING "%s: no page on node %d\n", 129 printk(KERN_WARNING "%s: no page on node %d\n",
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 9abd210d87c1..8547e86bfb42 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -752,17 +752,8 @@ static int __init init_spu_base(void)
752 goto out_unregister_sysdev_class; 752 goto out_unregister_sysdev_class;
753 } 753 }
754 754
755 if (ret > 0) { 755 if (ret > 0)
756 /*
757 * We cannot put the forward declaration in
758 * <linux/linux_logo.h> because of conflicting session type
759 * conflicts for const and __initdata with different compiler
760 * versions
761 */
762 extern const struct linux_logo logo_spe_clut224;
763
764 fb_append_extra_logo(&logo_spe_clut224, ret); 756 fb_append_extra_logo(&logo_spe_clut224, ret);
765 }
766 757
767 mutex_lock(&spu_full_list_mutex); 758 mutex_lock(&spu_full_list_mutex);
768 xmon_register_spus(&spu_full_list); 759 xmon_register_spus(&spu_full_list);
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 706eb5c7e2ee..24b30b6909c4 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -631,10 +631,6 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
631 if (IS_ERR(dentry)) 631 if (IS_ERR(dentry))
632 goto out_dir; 632 goto out_dir;
633 633
634 ret = -EEXIST;
635 if (dentry->d_inode)
636 goto out_dput;
637
638 mode &= ~current_umask(); 634 mode &= ~current_umask();
639 635
640 if (flags & SPU_CREATE_GANG) 636 if (flags & SPU_CREATE_GANG)
@@ -648,8 +644,6 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
648 fsnotify_mkdir(nd->path.dentry->d_inode, dentry); 644 fsnotify_mkdir(nd->path.dentry->d_inode, dentry);
649 return ret; 645 return ret;
650 646
651out_dput:
652 dput(dentry);
653out_dir: 647out_dir:
654 mutex_unlock(&nd->path.dentry->d_inode->i_mutex); 648 mutex_unlock(&nd->path.dentry->d_inode->i_mutex);
655out: 649out:
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index f6b0c519d5a2..8f67a394b2d0 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -34,7 +34,7 @@ int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
34 int len, u32 *val) 34 int len, u32 *val)
35{ 35{
36 volatile void __iomem *cfg_data; 36 volatile void __iomem *cfg_data;
37 struct pci_controller *hose = bus->sysdata; 37 struct pci_controller *hose = pci_bus_to_host(bus);
38 38
39 if (bus->number > 7) 39 if (bus->number > 7)
40 return PCIBIOS_DEVICE_NOT_FOUND; 40 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -61,7 +61,7 @@ int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
61 int len, u32 val) 61 int len, u32 val)
62{ 62{
63 volatile void __iomem *cfg_data; 63 volatile void __iomem *cfg_data;
64 struct pci_controller *hose = bus->sysdata; 64 struct pci_controller *hose = pci_bus_to_host(bus);
65 65
66 if (bus->number > 7) 66 if (bus->number > 7)
67 return PCIBIOS_DEVICE_NOT_FOUND; 67 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -96,7 +96,7 @@ static struct pci_ops gg2_pci_ops =
96int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 96int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
97 int len, u32 *val) 97 int len, u32 *val)
98{ 98{
99 struct pci_controller *hose = bus->sysdata; 99 struct pci_controller *hose = pci_bus_to_host(bus);
100 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) 100 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
101 | (((bus->number - hose->first_busno) & 0xff) << 16) 101 | (((bus->number - hose->first_busno) & 0xff) << 16)
102 | (hose->global_number << 24); 102 | (hose->global_number << 24);
@@ -111,7 +111,7 @@ int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
111int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset, 111int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
112 int len, u32 val) 112 int len, u32 val)
113{ 113{
114 struct pci_controller *hose = bus->sysdata; 114 struct pci_controller *hose = pci_bus_to_host(bus);
115 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) 115 unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
116 | (((bus->number - hose->first_busno) & 0xff) << 16) 116 | (((bus->number - hose->first_busno) & 0xff) << 16)
117 | (hose->global_number << 24); 117 | (hose->global_number << 24);
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c
index 65a35f38e062..fd23a1d4b39d 100644
--- a/arch/powerpc/platforms/fsl_uli1575.c
+++ b/arch/powerpc/platforms/fsl_uli1575.c
@@ -51,13 +51,20 @@ u8 uli_pirq_to_irq[8] = {
51 ULI_8259_NONE, /* PIRQH */ 51 ULI_8259_NONE, /* PIRQH */
52}; 52};
53 53
54static inline bool is_quirk_valid(void)
55{
56 return (machine_is(mpc86xx_hpcn) ||
57 machine_is(mpc8544_ds) ||
58 machine_is(p2020_ds) ||
59 machine_is(mpc8572_ds));
60}
61
54/* Bridge */ 62/* Bridge */
55static void __devinit early_uli5249(struct pci_dev *dev) 63static void __devinit early_uli5249(struct pci_dev *dev)
56{ 64{
57 unsigned char temp; 65 unsigned char temp;
58 66
59 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 67 if (!is_quirk_valid())
60 !machine_is(mpc8572_ds))
61 return; 68 return;
62 69
63 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_IO | 70 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_IO |
@@ -80,8 +87,7 @@ static void __devinit quirk_uli1575(struct pci_dev *dev)
80{ 87{
81 int i; 88 int i;
82 89
83 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 90 if (!is_quirk_valid())
84 !machine_is(mpc8572_ds))
85 return; 91 return;
86 92
87 /* 93 /*
@@ -149,8 +155,7 @@ static void __devinit quirk_final_uli1575(struct pci_dev *dev)
149 * IRQ 14: Edge 155 * IRQ 14: Edge
150 * IRQ 15: Edge 156 * IRQ 15: Edge
151 */ 157 */
152 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 158 if (!is_quirk_valid())
153 !machine_is(mpc8572_ds))
154 return; 159 return;
155 160
156 outb(0xfa, 0x4d0); 161 outb(0xfa, 0x4d0);
@@ -176,8 +181,7 @@ static void __devinit quirk_uli5288(struct pci_dev *dev)
176 unsigned char c; 181 unsigned char c;
177 unsigned int d; 182 unsigned int d;
178 183
179 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 184 if (!is_quirk_valid())
180 !machine_is(mpc8572_ds))
181 return; 185 return;
182 186
183 /* read/write lock */ 187 /* read/write lock */
@@ -201,8 +205,7 @@ static void __devinit quirk_uli5229(struct pci_dev *dev)
201{ 205{
202 unsigned short temp; 206 unsigned short temp;
203 207
204 if (!machine_is(mpc86xx_hpcn) && !machine_is(mpc8544_ds) && 208 if (!is_quirk_valid())
205 !machine_is(mpc8572_ds))
206 return; 209 return;
207 210
208 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE | 211 pci_write_config_word(dev, PCI_COMMAND, PCI_COMMAND_INTX_DISABLE |
@@ -270,7 +273,6 @@ static void __devinit hpcd_quirk_uli1575(struct pci_dev *dev)
270static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev) 273static void __devinit hpcd_quirk_uli5288(struct pci_dev *dev)
271{ 274{
272 unsigned char c; 275 unsigned char c;
273 unsigned short temp;
274 276
275 if (!machine_is(mpc86xx_hpcd)) 277 if (!machine_is(mpc86xx_hpcd))
276 return; 278 return;
diff --git a/arch/powerpc/platforms/iseries/dt.c b/arch/powerpc/platforms/iseries/dt.c
index 4543c4bc3a56..c5a87a72057b 100644
--- a/arch/powerpc/platforms/iseries/dt.c
+++ b/arch/powerpc/platforms/iseries/dt.c
@@ -204,7 +204,8 @@ static void __init dt_prop_u32(struct iseries_flat_dt *dt, const char *name,
204 dt_prop(dt, name, &data, sizeof(u32)); 204 dt_prop(dt, name, &data, sizeof(u32));
205} 205}
206 206
207static void __init dt_prop_u64(struct iseries_flat_dt *dt, const char *name, 207static void __init __maybe_unused dt_prop_u64(struct iseries_flat_dt *dt,
208 const char *name,
208 u64 data) 209 u64 data)
209{ 210{
210 dt_prop(dt, name, &data, sizeof(u64)); 211 dt_prop(dt, name, &data, sizeof(u64));
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index 40219823d9b0..6c1e1011959e 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -177,7 +177,7 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
177static void pci_dma_dev_setup_iseries(struct pci_dev *pdev) 177static void pci_dma_dev_setup_iseries(struct pci_dev *pdev)
178{ 178{
179 struct iommu_table *tbl; 179 struct iommu_table *tbl;
180 struct device_node *dn = pdev->sysdata; 180 struct device_node *dn = pci_device_to_OF_node(pdev);
181 struct pci_dn *pdn = PCI_DN(dn); 181 struct pci_dn *pdn = PCI_DN(dn);
182 const u32 *lsn = of_get_property(dn, "linux,logical-slot-number", NULL); 182 const u32 *lsn = of_get_property(dn, "linux,logical-slot-number", NULL);
183 183
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index 3689c2413d24..fef4d5150517 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -267,7 +267,8 @@ static struct pending_event *new_pending_event(void)
267 return ev; 267 return ev;
268} 268}
269 269
270static int signal_vsp_instruction(struct vsp_cmd_data *vsp_cmd) 270static int __maybe_unused
271signal_vsp_instruction(struct vsp_cmd_data *vsp_cmd)
271{ 272{
272 struct pending_event *ev = new_pending_event(); 273 struct pending_event *ev = new_pending_event();
273 int rc; 274 int rc;
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 21cddc30220b..175aac8ca7e5 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -318,6 +318,7 @@ static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
318{ 318{
319 struct resource *bar_res = &dev->resource[bar_num]; 319 struct resource *bar_res = &dev->resource[bar_num];
320 long bar_size = pci_resource_len(dev, bar_num); 320 long bar_size = pci_resource_len(dev, bar_num);
321 struct device_node *dn = pci_device_to_OF_node(dev);
321 322
322 /* 323 /*
323 * No space to allocate, quick exit, skip Allocation. 324 * No space to allocate, quick exit, skip Allocation.
@@ -335,9 +336,9 @@ static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
335 * Allocate the number of table entries needed for BAR. 336 * Allocate the number of table entries needed for BAR.
336 */ 337 */
337 while (bar_size > 0 ) { 338 while (bar_size > 0 ) {
338 iomm_table[current_iomm_table_entry] = dev->sysdata; 339 iomm_table[current_iomm_table_entry] = dn;
339 ds_addr_table[current_iomm_table_entry] = 340 ds_addr_table[current_iomm_table_entry] =
340 iseries_ds_addr(dev->sysdata) | (bar_num << 24); 341 iseries_ds_addr(dn) | (bar_num << 24);
341 bar_size -= IOMM_TABLE_ENTRY_SIZE; 342 bar_size -= IOMM_TABLE_ENTRY_SIZE;
342 ++current_iomm_table_entry; 343 ++current_iomm_table_entry;
343 } 344 }
@@ -410,7 +411,7 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
410 struct device_node *node; 411 struct device_node *node;
411 int i; 412 int i;
412 413
413 node = find_device_node(bus, pdev->devfn); 414 node = pci_device_to_OF_node(pdev);
414 pr_debug("PCI: iSeries %s, pdev %p, node %p\n", 415 pr_debug("PCI: iSeries %s, pdev %p, node %p\n",
415 pci_name(pdev), pdev, node); 416 pci_name(pdev), pdev, node);
416 if (!node) { 417 if (!node) {
@@ -441,7 +442,6 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
441 } 442 }
442 } 443 }
443 444
444 pdev->sysdata = node;
445 allocate_device_bars(pdev); 445 allocate_device_bars(pdev);
446 iseries_device_information(pdev, bus, *sub_bus); 446 iseries_device_information(pdev, bus, *sub_bus);
447} 447}
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index 75cc165d5bee..3bf546797cbb 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -29,7 +29,7 @@
29#include <linux/ioport.h> 29#include <linux/ioport.h>
30#include <linux/interrupt.h> 30#include <linux/interrupt.h>
31#include <linux/phy.h> 31#include <linux/phy.h>
32#include <linux/platform_device.h> 32#include <linux/of_mdio.h>
33#include <linux/of_platform.h> 33#include <linux/of_platform.h>
34 34
35#define DELAY 1 35#define DELAY 1
@@ -39,6 +39,7 @@ static void __iomem *gpio_regs;
39struct gpio_priv { 39struct gpio_priv {
40 int mdc_pin; 40 int mdc_pin;
41 int mdio_pin; 41 int mdio_pin;
42 int mdio_irqs[PHY_MAX_ADDR];
42}; 43};
43 44
44#define MDC_PIN(bus) (((struct gpio_priv *)bus->priv)->mdc_pin) 45#define MDC_PIN(bus) (((struct gpio_priv *)bus->priv)->mdc_pin)
@@ -218,12 +219,11 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
218 const struct of_device_id *match) 219 const struct of_device_id *match)
219{ 220{
220 struct device *dev = &ofdev->dev; 221 struct device *dev = &ofdev->dev;
221 struct device_node *phy_dn, *np = ofdev->node; 222 struct device_node *np = ofdev->node;
222 struct mii_bus *new_bus; 223 struct mii_bus *new_bus;
223 struct gpio_priv *priv; 224 struct gpio_priv *priv;
224 const unsigned int *prop; 225 const unsigned int *prop;
225 int err; 226 int err;
226 int i;
227 227
228 err = -ENOMEM; 228 err = -ENOMEM;
229 priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL); 229 priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
@@ -244,27 +244,7 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
244 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", *prop); 244 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", *prop);
245 new_bus->priv = priv; 245 new_bus->priv = priv;
246 246
247 new_bus->phy_mask = 0; 247 new_bus->irq = priv->mdio_irqs;
248
249 new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
250
251 if (!new_bus->irq)
252 goto out_free_bus;
253
254 for (i = 0; i < PHY_MAX_ADDR; i++)
255 new_bus->irq[i] = NO_IRQ;
256
257 for (phy_dn = of_get_next_child(np, NULL);
258 phy_dn != NULL;
259 phy_dn = of_get_next_child(np, phy_dn)) {
260 const unsigned int *ip, *regp;
261
262 ip = of_get_property(phy_dn, "interrupts", NULL);
263 regp = of_get_property(phy_dn, "reg", NULL);
264 if (!ip || !regp || *regp >= PHY_MAX_ADDR)
265 continue;
266 new_bus->irq[*regp] = irq_create_mapping(NULL, *ip);
267 }
268 248
269 prop = of_get_property(np, "mdc-pin", NULL); 249 prop = of_get_property(np, "mdc-pin", NULL);
270 priv->mdc_pin = *prop; 250 priv->mdc_pin = *prop;
@@ -275,7 +255,7 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
275 new_bus->parent = dev; 255 new_bus->parent = dev;
276 dev_set_drvdata(dev, new_bus); 256 dev_set_drvdata(dev, new_bus);
277 257
278 err = mdiobus_register(new_bus); 258 err = of_mdiobus_register(new_bus, np);
279 259
280 if (err != 0) { 260 if (err != 0) {
281 printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n", 261 printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n",
@@ -286,8 +266,6 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev,
286 return 0; 266 return 0;
287 267
288out_free_irq: 268out_free_irq:
289 kfree(new_bus->irq);
290out_free_bus:
291 kfree(new_bus); 269 kfree(new_bus);
292out_free_priv: 270out_free_priv:
293 kfree(priv); 271 kfree(priv);
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 7039d8f1d3ba..dce736349107 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -221,7 +221,7 @@ static irqreturn_t gatwick_action(int cpl, void *dev_id)
221 continue; 221 continue;
222 irq += __ilog2(bits); 222 irq += __ilog2(bits);
223 spin_unlock_irqrestore(&pmac_pic_lock, flags); 223 spin_unlock_irqrestore(&pmac_pic_lock, flags);
224 __do_IRQ(irq); 224 generic_handle_irq(irq);
225 spin_lock_irqsave(&pmac_pic_lock, flags); 225 spin_lock_irqsave(&pmac_pic_lock, flags);
226 rc = IRQ_HANDLED; 226 rc = IRQ_HANDLED;
227 } 227 }
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 45936c9ed0ec..86f69a4eb49b 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -655,7 +655,7 @@ static int __init pmac_probe(void)
655/* Move that to pci.c */ 655/* Move that to pci.c */
656static int pmac_pci_probe_mode(struct pci_bus *bus) 656static int pmac_pci_probe_mode(struct pci_bus *bus)
657{ 657{
658 struct device_node *node = bus->sysdata; 658 struct device_node *node = pci_bus_to_OF_node(bus);
659 659
660 /* We need to use normal PCI probing for the AGP bus, 660 /* We need to use normal PCI probing for the AGP bus,
661 * since the device for the AGP bridge isn't in the tree. 661 * since the device for the AGP bridge isn't in the tree.
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index 9a2b6d948610..846eb8b57fd1 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -24,6 +24,7 @@
24#include <linux/lmb.h> 24#include <linux/lmb.h>
25 25
26#include <asm/firmware.h> 26#include <asm/firmware.h>
27#include <asm/iommu.h>
27#include <asm/prom.h> 28#include <asm/prom.h>
28#include <asm/udbg.h> 29#include <asm/udbg.h>
29#include <asm/lv1call.h> 30#include <asm/lv1call.h>
@@ -605,9 +606,8 @@ static int dma_ioc0_map_pages(struct ps3_dma_region *r, unsigned long phys_addr,
605 r->ioid, 606 r->ioid,
606 iopte_flag); 607 iopte_flag);
607 if (result) { 608 if (result) {
608 printk(KERN_WARNING "%s:%d: lv1_map_device_dma_region " 609 pr_warning("%s:%d: lv1_put_iopte failed: %s\n",
609 "failed: %s\n", __func__, __LINE__, 610 __func__, __LINE__, ps3_result(result));
610 ps3_result(result));
611 goto fail_map; 611 goto fail_map;
612 } 612 }
613 DBG("%s: pg=%d bus=%#lx, lpar=%#lx, ioid=%#x\n", __func__, 613 DBG("%s: pg=%d bus=%#lx, lpar=%#lx, ioid=%#x\n", __func__,
@@ -1001,7 +1001,8 @@ static int dma_sb_region_create_linear(struct ps3_dma_region *r)
1001 if (len > r->len) 1001 if (len > r->len)
1002 len = r->len; 1002 len = r->len;
1003 result = dma_sb_map_area(r, virt_addr, len, &tmp, 1003 result = dma_sb_map_area(r, virt_addr, len, &tmp,
1004 IOPTE_PP_W | IOPTE_PP_R | IOPTE_SO_RW | IOPTE_M); 1004 CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | CBE_IOPTE_SO_RW |
1005 CBE_IOPTE_M);
1005 BUG_ON(result); 1006 BUG_ON(result);
1006 } 1007 }
1007 1008
@@ -1014,7 +1015,8 @@ static int dma_sb_region_create_linear(struct ps3_dma_region *r)
1014 else 1015 else
1015 len -= map.rm.size - r->offset; 1016 len -= map.rm.size - r->offset;
1016 result = dma_sb_map_area(r, virt_addr, len, &tmp, 1017 result = dma_sb_map_area(r, virt_addr, len, &tmp,
1017 IOPTE_PP_W | IOPTE_PP_R | IOPTE_SO_RW | IOPTE_M); 1018 CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | CBE_IOPTE_SO_RW |
1019 CBE_IOPTE_M);
1018 BUG_ON(result); 1020 BUG_ON(result);
1019 } 1021 }
1020 1022
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
index cf1cd0f8c18f..d6487a9c8019 100644
--- a/arch/powerpc/platforms/ps3/os-area.c
+++ b/arch/powerpc/platforms/ps3/os-area.c
@@ -226,6 +226,44 @@ static struct property property_av_multi_out = {
226 .value = &saved_params.av_multi_out, 226 .value = &saved_params.av_multi_out,
227}; 227};
228 228
229
230static DEFINE_MUTEX(os_area_flash_mutex);
231
232static const struct ps3_os_area_flash_ops *os_area_flash_ops;
233
234void ps3_os_area_flash_register(const struct ps3_os_area_flash_ops *ops)
235{
236 mutex_lock(&os_area_flash_mutex);
237 os_area_flash_ops = ops;
238 mutex_unlock(&os_area_flash_mutex);
239}
240EXPORT_SYMBOL_GPL(ps3_os_area_flash_register);
241
242static ssize_t os_area_flash_read(void *buf, size_t count, loff_t pos)
243{
244 ssize_t res = -ENODEV;
245
246 mutex_lock(&os_area_flash_mutex);
247 if (os_area_flash_ops)
248 res = os_area_flash_ops->read(buf, count, pos);
249 mutex_unlock(&os_area_flash_mutex);
250
251 return res;
252}
253
254static ssize_t os_area_flash_write(const void *buf, size_t count, loff_t pos)
255{
256 ssize_t res = -ENODEV;
257
258 mutex_lock(&os_area_flash_mutex);
259 if (os_area_flash_ops)
260 res = os_area_flash_ops->write(buf, count, pos);
261 mutex_unlock(&os_area_flash_mutex);
262
263 return res;
264}
265
266
229/** 267/**
230 * os_area_set_property - Add or overwrite a saved_params value to the device tree. 268 * os_area_set_property - Add or overwrite a saved_params value to the device tree.
231 * 269 *
@@ -352,12 +390,12 @@ static int db_verify(const struct os_area_db *db)
352 if (memcmp(db->magic_num, OS_AREA_DB_MAGIC_NUM, 390 if (memcmp(db->magic_num, OS_AREA_DB_MAGIC_NUM,
353 sizeof(db->magic_num))) { 391 sizeof(db->magic_num))) {
354 pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); 392 pr_debug("%s:%d magic_num failed\n", __func__, __LINE__);
355 return -1; 393 return -EINVAL;
356 } 394 }
357 395
358 if (db->version != 1) { 396 if (db->version != 1) {
359 pr_debug("%s:%d version failed\n", __func__, __LINE__); 397 pr_debug("%s:%d version failed\n", __func__, __LINE__);
360 return -1; 398 return -EINVAL;
361 } 399 }
362 400
363 return 0; 401 return 0;
@@ -578,59 +616,48 @@ static void os_area_db_init(struct os_area_db *db)
578 * 616 *
579 */ 617 */
580 618
581static void __maybe_unused update_flash_db(void) 619static int update_flash_db(void)
582{ 620{
583 int result; 621 const unsigned int buf_len = 8 * OS_AREA_SEGMENT_SIZE;
584 int file; 622 struct os_area_header *header;
585 off_t offset;
586 ssize_t count; 623 ssize_t count;
587 static const unsigned int buf_len = 8 * OS_AREA_SEGMENT_SIZE; 624 int error;
588 const struct os_area_header *header; 625 loff_t pos;
589 struct os_area_db* db; 626 struct os_area_db* db;
590 627
591 /* Read in header and db from flash. */ 628 /* Read in header and db from flash. */
592 629
593 file = sys_open("/dev/ps3flash", O_RDWR, 0);
594
595 if (file < 0) {
596 pr_debug("%s:%d sys_open failed\n", __func__, __LINE__);
597 goto fail_open;
598 }
599
600 header = kmalloc(buf_len, GFP_KERNEL); 630 header = kmalloc(buf_len, GFP_KERNEL);
601
602 if (!header) { 631 if (!header) {
603 pr_debug("%s:%d kmalloc failed\n", __func__, __LINE__); 632 pr_debug("%s: kmalloc failed\n", __func__);
604 goto fail_malloc; 633 return -ENOMEM;
605 } 634 }
606 635
607 offset = sys_lseek(file, 0, SEEK_SET); 636 count = os_area_flash_read(header, buf_len, 0);
608 637 if (count < 0) {
609 if (offset != 0) { 638 pr_debug("%s: os_area_flash_read failed %zd\n", __func__,
610 pr_debug("%s:%d sys_lseek failed\n", __func__, __LINE__); 639 count);
611 goto fail_header_seek; 640 error = count;
641 goto fail;
612 } 642 }
613 643
614 count = sys_read(file, (char __user *)header, buf_len); 644 pos = header->db_area_offset * OS_AREA_SEGMENT_SIZE;
615 645 if (count < OS_AREA_SEGMENT_SIZE || verify_header(header) ||
616 result = count < OS_AREA_SEGMENT_SIZE || verify_header(header) 646 count < pos) {
617 || count < header->db_area_offset * OS_AREA_SEGMENT_SIZE; 647 pr_debug("%s: verify_header failed\n", __func__);
618
619 if (result) {
620 pr_debug("%s:%d verify_header failed\n", __func__, __LINE__);
621 dump_header(header); 648 dump_header(header);
622 goto fail_header; 649 error = -EINVAL;
650 goto fail;
623 } 651 }
624 652
625 /* Now got a good db offset and some maybe good db data. */ 653 /* Now got a good db offset and some maybe good db data. */
626 654
627 db = (void*)header + header->db_area_offset * OS_AREA_SEGMENT_SIZE; 655 db = (void *)header + pos;
628 656
629 result = db_verify(db); 657 error = db_verify(db);
630 658 if (error) {
631 if (result) { 659 pr_notice("%s: Verify of flash database failed, formatting.\n",
632 printk(KERN_NOTICE "%s:%d: Verify of flash database failed, " 660 __func__);
633 "formatting.\n", __func__, __LINE__);
634 dump_db(db); 661 dump_db(db);
635 os_area_db_init(db); 662 os_area_db_init(db);
636 } 663 }
@@ -639,29 +666,16 @@ static void __maybe_unused update_flash_db(void)
639 666
640 db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff); 667 db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff);
641 668
642 offset = sys_lseek(file, header->db_area_offset * OS_AREA_SEGMENT_SIZE, 669 count = os_area_flash_write(db, sizeof(struct os_area_db), pos);
643 SEEK_SET);
644
645 if (offset != header->db_area_offset * OS_AREA_SEGMENT_SIZE) {
646 pr_debug("%s:%d sys_lseek failed\n", __func__, __LINE__);
647 goto fail_db_seek;
648 }
649
650 count = sys_write(file, (const char __user *)db,
651 sizeof(struct os_area_db));
652
653 if (count < sizeof(struct os_area_db)) { 670 if (count < sizeof(struct os_area_db)) {
654 pr_debug("%s:%d sys_write failed\n", __func__, __LINE__); 671 pr_debug("%s: os_area_flash_write failed %zd\n", __func__,
672 count);
673 error = count < 0 ? count : -EIO;
655 } 674 }
656 675
657fail_db_seek: 676fail:
658fail_header:
659fail_header_seek:
660 kfree(header); 677 kfree(header);
661fail_malloc: 678 return error;
662 sys_close(file);
663fail_open:
664 return;
665} 679}
666 680
667/** 681/**
@@ -674,11 +688,11 @@ fail_open:
674static void os_area_queue_work_handler(struct work_struct *work) 688static void os_area_queue_work_handler(struct work_struct *work)
675{ 689{
676 struct device_node *node; 690 struct device_node *node;
691 int error;
677 692
678 pr_debug(" -> %s:%d\n", __func__, __LINE__); 693 pr_debug(" -> %s:%d\n", __func__, __LINE__);
679 694
680 node = of_find_node_by_path("/"); 695 node = of_find_node_by_path("/");
681
682 if (node) { 696 if (node) {
683 os_area_set_property(node, &property_rtc_diff); 697 os_area_set_property(node, &property_rtc_diff);
684 of_node_put(node); 698 of_node_put(node);
@@ -686,12 +700,10 @@ static void os_area_queue_work_handler(struct work_struct *work)
686 pr_debug("%s:%d of_find_node_by_path failed\n", 700 pr_debug("%s:%d of_find_node_by_path failed\n",
687 __func__, __LINE__); 701 __func__, __LINE__);
688 702
689#if defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE) 703 error = update_flash_db();
690 update_flash_db(); 704 if (error)
691#else 705 pr_warning("%s: Could not update FLASH ROM\n", __func__);
692 printk(KERN_WARNING "%s:%d: No flash rom driver configured.\n", 706
693 __func__, __LINE__);
694#endif
695 pr_debug(" <- %s:%d\n", __func__, __LINE__); 707 pr_debug(" <- %s:%d\n", __func__, __LINE__);
696} 708}
697 709
@@ -808,7 +820,7 @@ u64 ps3_os_area_get_rtc_diff(void)
808{ 820{
809 return saved_params.rtc_diff; 821 return saved_params.rtc_diff;
810} 822}
811EXPORT_SYMBOL(ps3_os_area_get_rtc_diff); 823EXPORT_SYMBOL_GPL(ps3_os_area_get_rtc_diff);
812 824
813/** 825/**
814 * ps3_os_area_set_rtc_diff - Set the rtc diff value. 826 * ps3_os_area_set_rtc_diff - Set the rtc diff value.
@@ -824,7 +836,7 @@ void ps3_os_area_set_rtc_diff(u64 rtc_diff)
824 os_area_queue_work(); 836 os_area_queue_work();
825 } 837 }
826} 838}
827EXPORT_SYMBOL(ps3_os_area_set_rtc_diff); 839EXPORT_SYMBOL_GPL(ps3_os_area_set_rtc_diff);
828 840
829/** 841/**
830 * ps3_os_area_get_av_multi_out - Returns the default video mode. 842 * ps3_os_area_get_av_multi_out - Returns the default video mode.
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h
index 136aa0637d9c..9a196a88eda7 100644
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -232,14 +232,4 @@ int ps3_repository_read_spu_resource_id(unsigned int res_index,
232int ps3_repository_read_vuart_av_port(unsigned int *port); 232int ps3_repository_read_vuart_av_port(unsigned int *port);
233int ps3_repository_read_vuart_sysmgr_port(unsigned int *port); 233int ps3_repository_read_vuart_sysmgr_port(unsigned int *port);
234 234
235/* Page table entries */
236#define IOPTE_PP_W 0x8000000000000000ul /* protection: write */
237#define IOPTE_PP_R 0x4000000000000000ul /* protection: read */
238#define IOPTE_M 0x2000000000000000ul /* coherency required */
239#define IOPTE_SO_R 0x1000000000000000ul /* ordering: writes */
240#define IOPTE_SO_RW 0x1800000000000000ul /* ordering: r & w */
241#define IOPTE_RPN_Mask 0x07fffffffffff000ul /* RPN */
242#define IOPTE_H 0x0000000000000800ul /* cache hint */
243#define IOPTE_IOID_Mask 0x00000000000007fful /* ioid */
244
245#endif 235#endif
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index 1a7b5ae0c83e..149bea2ce583 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -32,6 +32,7 @@
32#include <asm/udbg.h> 32#include <asm/udbg.h>
33#include <asm/prom.h> 33#include <asm/prom.h>
34#include <asm/lv1call.h> 34#include <asm/lv1call.h>
35#include <asm/ps3gpu.h>
35 36
36#include "platform.h" 37#include "platform.h"
37 38
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c
index a0927a3bacb7..f6e04bcc70ef 100644
--- a/arch/powerpc/platforms/ps3/smp.c
+++ b/arch/powerpc/platforms/ps3/smp.c
@@ -32,12 +32,6 @@
32#define DBG pr_debug 32#define DBG pr_debug
33#endif 33#endif
34 34
35static irqreturn_t ipi_function_handler(int irq, void *msg)
36{
37 smp_message_recv((int)(long)msg);
38 return IRQ_HANDLED;
39}
40
41/** 35/**
42 * ps3_ipi_virqs - a per cpu array of virqs for ipi use 36 * ps3_ipi_virqs - a per cpu array of virqs for ipi use
43 */ 37 */
@@ -45,13 +39,6 @@ static irqreturn_t ipi_function_handler(int irq, void *msg)
45#define MSG_COUNT 4 39#define MSG_COUNT 4
46static DEFINE_PER_CPU(unsigned int, ps3_ipi_virqs[MSG_COUNT]); 40static DEFINE_PER_CPU(unsigned int, ps3_ipi_virqs[MSG_COUNT]);
47 41
48static const char *names[MSG_COUNT] = {
49 "ipi call",
50 "ipi reschedule",
51 "ipi migrate",
52 "ipi debug brk"
53};
54
55static void do_message_pass(int target, int msg) 42static void do_message_pass(int target, int msg)
56{ 43{
57 int result; 44 int result;
@@ -119,8 +106,7 @@ static void __init ps3_smp_setup_cpu(int cpu)
119 DBG("%s:%d: (%d, %d) => virq %u\n", 106 DBG("%s:%d: (%d, %d) => virq %u\n",
120 __func__, __LINE__, cpu, i, virqs[i]); 107 __func__, __LINE__, cpu, i, virqs[i]);
121 108
122 result = request_irq(virqs[i], ipi_function_handler, 109 result = smp_request_message_ipi(virqs[i], i);
123 IRQF_DISABLED, names[i], (void*)(long)i);
124 110
125 if (result) 111 if (result)
126 virqs[i] = NO_IRQ; 112 virqs[i] = NO_IRQ;
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index 9a73d0238639..9fead0faf38b 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -27,6 +27,7 @@
27#include <asm/udbg.h> 27#include <asm/udbg.h>
28#include <asm/lv1call.h> 28#include <asm/lv1call.h>
29#include <asm/firmware.h> 29#include <asm/firmware.h>
30#include <asm/iommu.h>
30 31
31#include "platform.h" 32#include "platform.h"
32 33
@@ -531,7 +532,8 @@ static void * ps3_alloc_coherent(struct device *_dev, size_t size,
531 } 532 }
532 533
533 result = ps3_dma_map(dev->d_region, virt_addr, size, dma_handle, 534 result = ps3_dma_map(dev->d_region, virt_addr, size, dma_handle,
534 IOPTE_PP_W | IOPTE_PP_R | IOPTE_SO_RW | IOPTE_M); 535 CBE_IOPTE_PP_W | CBE_IOPTE_PP_R |
536 CBE_IOPTE_SO_RW | CBE_IOPTE_M);
535 537
536 if (result) { 538 if (result) {
537 pr_debug("%s:%d: ps3_dma_map failed (%d)\n", 539 pr_debug("%s:%d: ps3_dma_map failed (%d)\n",
@@ -575,7 +577,8 @@ static dma_addr_t ps3_sb_map_page(struct device *_dev, struct page *page,
575 577
576 result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size, 578 result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size,
577 &bus_addr, 579 &bus_addr,
578 IOPTE_PP_R | IOPTE_PP_W | IOPTE_SO_RW | IOPTE_M); 580 CBE_IOPTE_PP_R | CBE_IOPTE_PP_W |
581 CBE_IOPTE_SO_RW | CBE_IOPTE_M);
579 582
580 if (result) { 583 if (result) {
581 pr_debug("%s:%d: ps3_dma_map failed (%d)\n", 584 pr_debug("%s:%d: ps3_dma_map failed (%d)\n",
@@ -596,16 +599,16 @@ static dma_addr_t ps3_ioc0_map_page(struct device *_dev, struct page *page,
596 u64 iopte_flag; 599 u64 iopte_flag;
597 void *ptr = page_address(page) + offset; 600 void *ptr = page_address(page) + offset;
598 601
599 iopte_flag = IOPTE_M; 602 iopte_flag = CBE_IOPTE_M;
600 switch (direction) { 603 switch (direction) {
601 case DMA_BIDIRECTIONAL: 604 case DMA_BIDIRECTIONAL:
602 iopte_flag |= IOPTE_PP_R | IOPTE_PP_W | IOPTE_SO_RW; 605 iopte_flag |= CBE_IOPTE_PP_R | CBE_IOPTE_PP_W | CBE_IOPTE_SO_RW;
603 break; 606 break;
604 case DMA_TO_DEVICE: 607 case DMA_TO_DEVICE:
605 iopte_flag |= IOPTE_PP_R | IOPTE_SO_R; 608 iopte_flag |= CBE_IOPTE_PP_R | CBE_IOPTE_SO_R;
606 break; 609 break;
607 case DMA_FROM_DEVICE: 610 case DMA_FROM_DEVICE:
608 iopte_flag |= IOPTE_PP_W | IOPTE_SO_RW; 611 iopte_flag |= CBE_IOPTE_PP_W | CBE_IOPTE_SO_RW;
609 break; 612 break;
610 default: 613 default:
611 /* not happned */ 614 /* not happned */
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 3ee01b4f4257..661c8e02bcba 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -388,7 +388,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
388 388
389 while (pci->phb->dma_window_size * children > 0x80000000ul) 389 while (pci->phb->dma_window_size * children > 0x80000000ul)
390 pci->phb->dma_window_size >>= 1; 390 pci->phb->dma_window_size >>= 1;
391 pr_debug("No ISA/IDE, window size is 0x%lx\n", 391 pr_debug("No ISA/IDE, window size is 0x%llx\n",
392 pci->phb->dma_window_size); 392 pci->phb->dma_window_size);
393 pci->phb->dma_window_base_cur = 0; 393 pci->phb->dma_window_base_cur = 0;
394 394
@@ -414,7 +414,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
414 while (pci->phb->dma_window_size * children > 0x70000000ul) 414 while (pci->phb->dma_window_size * children > 0x70000000ul)
415 pci->phb->dma_window_size >>= 1; 415 pci->phb->dma_window_size >>= 1;
416 416
417 pr_debug("ISA/IDE, window size is 0x%lx\n", pci->phb->dma_window_size); 417 pr_debug("ISA/IDE, window size is 0x%llx\n", pci->phb->dma_window_size);
418} 418}
419 419
420 420
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 52a80e5840e8..e3139fa5e556 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -609,3 +609,55 @@ void __init hpte_init_lpar(void)
609 ppc_md.flush_hash_range = pSeries_lpar_flush_hash_range; 609 ppc_md.flush_hash_range = pSeries_lpar_flush_hash_range;
610 ppc_md.hpte_clear_all = pSeries_lpar_hptab_clear; 610 ppc_md.hpte_clear_all = pSeries_lpar_hptab_clear;
611} 611}
612
613#ifdef CONFIG_PPC_SMLPAR
614#define CMO_FREE_HINT_DEFAULT 1
615static int cmo_free_hint_flag = CMO_FREE_HINT_DEFAULT;
616
617static int __init cmo_free_hint(char *str)
618{
619 char *parm;
620 parm = strstrip(str);
621
622 if (strcasecmp(parm, "no") == 0 || strcasecmp(parm, "off") == 0) {
623 printk(KERN_INFO "cmo_free_hint: CMO free page hinting is not active.\n");
624 cmo_free_hint_flag = 0;
625 return 1;
626 }
627
628 cmo_free_hint_flag = 1;
629 printk(KERN_INFO "cmo_free_hint: CMO free page hinting is active.\n");
630
631 if (strcasecmp(parm, "yes") == 0 || strcasecmp(parm, "on") == 0)
632 return 1;
633
634 return 0;
635}
636
637__setup("cmo_free_hint=", cmo_free_hint);
638
639static void pSeries_set_page_state(struct page *page, int order,
640 unsigned long state)
641{
642 int i, j;
643 unsigned long cmo_page_sz, addr;
644
645 cmo_page_sz = cmo_get_page_size();
646 addr = __pa((unsigned long)page_address(page));
647
648 for (i = 0; i < (1 << order); i++, addr += PAGE_SIZE) {
649 for (j = 0; j < PAGE_SIZE; j += cmo_page_sz)
650 plpar_hcall_norets(H_PAGE_INIT, state, addr + j, 0);
651 }
652}
653
654void arch_free_page(struct page *page, int order)
655{
656 if (!cmo_free_hint_flag || !firmware_has_feature(FW_FEATURE_CMO))
657 return;
658
659 pSeries_set_page_state(page, order, H_PAGE_SET_UNUSED);
660}
661EXPORT_SYMBOL(arch_free_page);
662
663#endif
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index afad9f5ac0ac..b3cbac855924 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -19,7 +19,7 @@
19#include <linux/vmalloc.h> 19#include <linux/vmalloc.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/cpu.h> 21#include <linux/cpu.h>
22#include <linux/delay.h> 22#include <linux/workqueue.h>
23 23
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include <asm/io.h> 25#include <asm/io.h>
@@ -387,36 +387,51 @@ static void do_event_scan(void)
387 } while(error == 0); 387 } while(error == 0);
388} 388}
389 389
390static void do_event_scan_all_cpus(long delay) 390static void rtas_event_scan(struct work_struct *w);
391DECLARE_DELAYED_WORK(event_scan_work, rtas_event_scan);
392
393/*
394 * Delay should be at least one second since some machines have problems if
395 * we call event-scan too quickly.
396 */
397static unsigned long event_scan_delay = 1*HZ;
398static int first_pass = 1;
399
400static void rtas_event_scan(struct work_struct *w)
391{ 401{
392 int cpu; 402 unsigned int cpu;
403
404 do_event_scan();
393 405
394 get_online_cpus(); 406 get_online_cpus();
395 cpu = first_cpu(cpu_online_map); 407
396 for (;;) { 408 cpu = next_cpu(smp_processor_id(), cpu_online_map);
397 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 409 if (cpu == NR_CPUS) {
398 do_event_scan(); 410 cpu = first_cpu(cpu_online_map);
399 set_cpus_allowed(current, CPU_MASK_ALL); 411
400 412 if (first_pass) {
401 /* Drop hotplug lock, and sleep for the specified delay */ 413 first_pass = 0;
402 put_online_cpus(); 414 event_scan_delay = 30*HZ/rtas_event_scan_rate;
403 msleep_interruptible(delay); 415
404 get_online_cpus(); 416 if (surveillance_timeout != -1) {
405 417 pr_debug("rtasd: enabling surveillance\n");
406 cpu = next_cpu(cpu, cpu_online_map); 418 enable_surveillance(surveillance_timeout);
407 if (cpu == NR_CPUS) 419 pr_debug("rtasd: surveillance enabled\n");
408 break; 420 }
421 }
409 } 422 }
423
424 schedule_delayed_work_on(cpu, &event_scan_work,
425 __round_jiffies_relative(event_scan_delay, cpu));
426
410 put_online_cpus(); 427 put_online_cpus();
411} 428}
412 429
413static int rtasd(void *unused) 430static void start_event_scan(void)
414{ 431{
415 unsigned int err_type; 432 unsigned int err_type;
416 int rc; 433 int rc;
417 434
418 daemonize("rtasd");
419
420 printk(KERN_DEBUG "RTAS daemon started\n"); 435 printk(KERN_DEBUG "RTAS daemon started\n");
421 pr_debug("rtasd: will sleep for %d milliseconds\n", 436 pr_debug("rtasd: will sleep for %d milliseconds\n",
422 (30000 / rtas_event_scan_rate)); 437 (30000 / rtas_event_scan_rate));
@@ -434,22 +449,8 @@ static int rtasd(void *unused)
434 } 449 }
435 } 450 }
436 451
437 /* First pass. */ 452 schedule_delayed_work_on(first_cpu(cpu_online_map), &event_scan_work,
438 do_event_scan_all_cpus(1000); 453 event_scan_delay);
439
440 if (surveillance_timeout != -1) {
441 pr_debug("rtasd: enabling surveillance\n");
442 enable_surveillance(surveillance_timeout);
443 pr_debug("rtasd: surveillance enabled\n");
444 }
445
446 /* Delay should be at least one second since some
447 * machines have problems if we call event-scan too
448 * quickly. */
449 for (;;)
450 do_event_scan_all_cpus(30000/rtas_event_scan_rate);
451
452 return -EINVAL;
453} 454}
454 455
455static int __init rtas_init(void) 456static int __init rtas_init(void)
@@ -487,8 +488,7 @@ static int __init rtas_init(void)
487 if (!entry) 488 if (!entry)
488 printk(KERN_ERR "Failed to create error_log proc entry\n"); 489 printk(KERN_ERR "Failed to create error_log proc entry\n");
489 490
490 if (kernel_thread(rtasd, NULL, CLONE_FS) < 0) 491 start_event_scan();
491 printk(KERN_ERR "Failed to start RTAS daemon\n");
492 492
493 return 0; 493 return 0;
494} 494}
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index ec341707e41b..8d75ea21296f 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -63,6 +63,7 @@
63#include <asm/smp.h> 63#include <asm/smp.h>
64#include <asm/firmware.h> 64#include <asm/firmware.h>
65#include <asm/eeh.h> 65#include <asm/eeh.h>
66#include <asm/pSeries_reconfig.h>
66 67
67#include "plpar_wrappers.h" 68#include "plpar_wrappers.h"
68#include "pseries.h" 69#include "pseries.h"
@@ -254,6 +255,29 @@ static void __init pseries_discover_pic(void)
254 " interrupt-controller\n"); 255 " interrupt-controller\n");
255} 256}
256 257
258static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
259{
260 struct device_node *np = node;
261 struct pci_dn *pci = NULL;
262 int err = NOTIFY_OK;
263
264 switch (action) {
265 case PSERIES_RECONFIG_ADD:
266 pci = np->parent->data;
267 if (pci)
268 update_dn_pci_info(np, pci->phb);
269 break;
270 default:
271 err = NOTIFY_DONE;
272 break;
273 }
274 return err;
275}
276
277static struct notifier_block pci_dn_reconfig_nb = {
278 .notifier_call = pci_dn_reconfig_notifier,
279};
280
257static void __init pSeries_setup_arch(void) 281static void __init pSeries_setup_arch(void)
258{ 282{
259 /* Discover PIC type and setup ppc_md accordingly */ 283 /* Discover PIC type and setup ppc_md accordingly */
@@ -271,6 +295,7 @@ static void __init pSeries_setup_arch(void)
271 /* Find and initialize PCI host bridges */ 295 /* Find and initialize PCI host bridges */
272 init_pci_config_tokens(); 296 init_pci_config_tokens();
273 find_and_init_phbs(); 297 find_and_init_phbs();
298 pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb);
274 eeh_init(); 299 eeh_init();
275 300
276 pSeries_nvram_init(); 301 pSeries_nvram_init();
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index b33b28a6fe12..2d1c87dd5d14 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -34,6 +34,7 @@ obj-$(CONFIG_IPIC) += ipic.o
34obj-$(CONFIG_4xx) += uic.o 34obj-$(CONFIG_4xx) += uic.o
35obj-$(CONFIG_4xx_SOC) += ppc4xx_soc.o 35obj-$(CONFIG_4xx_SOC) += ppc4xx_soc.o
36obj-$(CONFIG_XILINX_VIRTEX) += xilinx_intc.o 36obj-$(CONFIG_XILINX_VIRTEX) += xilinx_intc.o
37obj-$(CONFIG_XILINX_PCI) += xilinx_pci.o
37obj-$(CONFIG_OF_RTC) += of_rtc.o 38obj-$(CONFIG_OF_RTC) += of_rtc.o
38ifeq ($(CONFIG_PCI),y) 39ifeq ($(CONFIG_PCI),y)
39obj-$(CONFIG_4xx) += ppc4xx_pci.o 40obj-$(CONFIG_4xx) += ppc4xx_pci.o
diff --git a/arch/powerpc/sysdev/cpm2.c b/arch/powerpc/sysdev/cpm2.c
index fd969f0e3121..eb5927212fab 100644
--- a/arch/powerpc/sysdev/cpm2.c
+++ b/arch/powerpc/sysdev/cpm2.c
@@ -61,7 +61,7 @@ EXPORT_SYMBOL(cpm2_immr);
61void __init cpm2_reset(void) 61void __init cpm2_reset(void)
62{ 62{
63#ifdef CONFIG_PPC_85xx 63#ifdef CONFIG_PPC_85xx
64 cpm2_immr = ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE); 64 cpm2_immr = ioremap(get_immrbase() + 0x80000, CPM_MAP_SIZE);
65#else 65#else
66 cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE); 66 cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE);
67#endif 67#endif
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index f25ce818d40a..da38a1ff97bb 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -113,8 +113,13 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
113 struct msi_msg *msg) 113 struct msi_msg *msg)
114{ 114{
115 struct fsl_msi *msi_data = fsl_msi; 115 struct fsl_msi *msi_data = fsl_msi;
116 struct pci_controller *hose = pci_bus_to_host(pdev->bus);
117 u32 base = 0;
116 118
117 msg->address_lo = msi_data->msi_addr_lo; 119 pci_bus_read_config_dword(hose->bus,
120 PCI_DEVFN(0, 0), PCI_BASE_ADDRESS_0, &base);
121
122 msg->address_lo = msi_data->msi_addr_lo + base;
118 msg->address_hi = msi_data->msi_addr_hi; 123 msg->address_hi = msi_data->msi_addr_hi;
119 msg->data = hwirq; 124 msg->data = hwirq;
120 125
@@ -271,7 +276,7 @@ static int __devinit fsl_of_msi_probe(struct of_device *dev,
271 msi->irqhost->host_data = msi; 276 msi->irqhost->host_data = msi;
272 277
273 msi->msi_addr_hi = 0x0; 278 msi->msi_addr_hi = 0x0;
274 msi->msi_addr_lo = res.start + features->msiir_offset; 279 msi->msi_addr_lo = features->msiir_offset + (res.start & 0xfffff);
275 280
276 rc = fsl_msi_init_allocator(msi); 281 rc = fsl_msi_init_allocator(msi);
277 if (rc) { 282 if (rc) {
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 78021d8afc53..ae88b1448018 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -23,6 +23,8 @@
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/bootmem.h> 25#include <linux/bootmem.h>
26#include <linux/lmb.h>
27#include <linux/log2.h>
26 28
27#include <asm/io.h> 29#include <asm/io.h>
28#include <asm/prom.h> 30#include <asm/prom.h>
@@ -96,7 +98,13 @@ static void __init setup_pci_atmu(struct pci_controller *hose,
96 struct resource *rsrc) 98 struct resource *rsrc)
97{ 99{
98 struct ccsr_pci __iomem *pci; 100 struct ccsr_pci __iomem *pci;
99 int i, j, n; 101 int i, j, n, mem_log, win_idx = 2;
102 u64 mem, sz, paddr_hi = 0;
103 u64 paddr_lo = ULLONG_MAX;
104 u32 pcicsrbar = 0, pcicsrbar_sz;
105 u32 piwar = PIWAR_EN | PIWAR_PF | PIWAR_TGI_LOCAL |
106 PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP;
107 char *name = hose->dn->full_name;
100 108
101 pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n", 109 pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n",
102 (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1); 110 (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1);
@@ -117,6 +125,9 @@ static void __init setup_pci_atmu(struct pci_controller *hose,
117 if (!(hose->mem_resources[i].flags & IORESOURCE_MEM)) 125 if (!(hose->mem_resources[i].flags & IORESOURCE_MEM))
118 continue; 126 continue;
119 127
128 paddr_lo = min(paddr_lo, (u64)hose->mem_resources[i].start);
129 paddr_hi = max(paddr_hi, (u64)hose->mem_resources[i].end);
130
120 n = setup_one_atmu(pci, j, &hose->mem_resources[i], 131 n = setup_one_atmu(pci, j, &hose->mem_resources[i],
121 hose->pci_mem_offset); 132 hose->pci_mem_offset);
122 133
@@ -147,10 +158,105 @@ static void __init setup_pci_atmu(struct pci_controller *hose,
147 } 158 }
148 } 159 }
149 160
150 /* Setup 2G inbound Memory Window @ 1 */ 161 /* convert to pci address space */
151 out_be32(&pci->piw[2].pitar, 0x00000000); 162 paddr_hi -= hose->pci_mem_offset;
152 out_be32(&pci->piw[2].piwbar,0x00000000); 163 paddr_lo -= hose->pci_mem_offset;
153 out_be32(&pci->piw[2].piwar, PIWAR_2G); 164
165 if (paddr_hi == paddr_lo) {
166 pr_err("%s: No outbound window space\n", name);
167 return ;
168 }
169
170 if (paddr_lo == 0) {
171 pr_err("%s: No space for inbound window\n", name);
172 return ;
173 }
174
175 /* setup PCSRBAR/PEXCSRBAR */
176 early_write_config_dword(hose, 0, 0, PCI_BASE_ADDRESS_0, 0xffffffff);
177 early_read_config_dword(hose, 0, 0, PCI_BASE_ADDRESS_0, &pcicsrbar_sz);
178 pcicsrbar_sz = ~pcicsrbar_sz + 1;
179
180 if (paddr_hi < (0x100000000ull - pcicsrbar_sz) ||
181 (paddr_lo > 0x100000000ull))
182 pcicsrbar = 0x100000000ull - pcicsrbar_sz;
183 else
184 pcicsrbar = (paddr_lo - pcicsrbar_sz) & -pcicsrbar_sz;
185 early_write_config_dword(hose, 0, 0, PCI_BASE_ADDRESS_0, pcicsrbar);
186
187 paddr_lo = min(paddr_lo, (u64)pcicsrbar);
188
189 pr_info("%s: PCICSRBAR @ 0x%x\n", name, pcicsrbar);
190
191 /* Setup inbound mem window */
192 mem = lmb_end_of_DRAM();
193 sz = min(mem, paddr_lo);
194 mem_log = __ilog2_u64(sz);
195
196 /* PCIe can overmap inbound & outbound since RX & TX are separated */
197 if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) {
198 /* Size window to exact size if power-of-two or one size up */
199 if ((1ull << mem_log) != mem) {
200 if ((1ull << mem_log) > mem)
201 pr_info("%s: Setting PCI inbound window "
202 "greater than memory size\n", name);
203 mem_log++;
204 }
205
206 piwar |= (mem_log - 1);
207
208 /* Setup inbound memory window */
209 out_be32(&pci->piw[win_idx].pitar, 0x00000000);
210 out_be32(&pci->piw[win_idx].piwbar, 0x00000000);
211 out_be32(&pci->piw[win_idx].piwar, piwar);
212 win_idx--;
213
214 hose->dma_window_base_cur = 0x00000000;
215 hose->dma_window_size = (resource_size_t)sz;
216 } else {
217 u64 paddr = 0;
218
219 /* Setup inbound memory window */
220 out_be32(&pci->piw[win_idx].pitar, paddr >> 12);
221 out_be32(&pci->piw[win_idx].piwbar, paddr >> 12);
222 out_be32(&pci->piw[win_idx].piwar, (piwar | (mem_log - 1)));
223 win_idx--;
224
225 paddr += 1ull << mem_log;
226 sz -= 1ull << mem_log;
227
228 if (sz) {
229 mem_log = __ilog2_u64(sz);
230 piwar |= (mem_log - 1);
231
232 out_be32(&pci->piw[win_idx].pitar, paddr >> 12);
233 out_be32(&pci->piw[win_idx].piwbar, paddr >> 12);
234 out_be32(&pci->piw[win_idx].piwar, piwar);
235 win_idx--;
236
237 paddr += 1ull << mem_log;
238 }
239
240 hose->dma_window_base_cur = 0x00000000;
241 hose->dma_window_size = (resource_size_t)paddr;
242 }
243
244 if (hose->dma_window_size < mem) {
245#ifndef CONFIG_SWIOTLB
246 pr_err("%s: ERROR: Memory size exceeds PCI ATMU ability to "
247 "map - enable CONFIG_SWIOTLB to avoid dma errors.\n",
248 name);
249#endif
250 /* adjusting outbound windows could reclaim space in mem map */
251 if (paddr_hi < 0xffffffffull)
252 pr_warning("%s: WARNING: Outbound window cfg leaves "
253 "gaps in memory map. Adjusting the memory map "
254 "could reduce unnecessary bounce buffering.\n",
255 name);
256
257 pr_info("%s: DMA window size is 0x%llx\n", name,
258 (u64)hose->dma_window_size);
259 }
154 260
155 iounmap(pci); 261 iounmap(pci);
156} 262}
@@ -176,19 +282,9 @@ static void __init setup_pci_cmd(struct pci_controller *hose)
176 } 282 }
177} 283}
178 284
179static void __init setup_pci_pcsrbar(struct pci_controller *hose)
180{
181#ifdef CONFIG_PCI_MSI
182 phys_addr_t immr_base;
183
184 immr_base = get_immrbase();
185 early_write_config_dword(hose, 0, 0, PCI_BASE_ADDRESS_0, immr_base);
186#endif
187}
188
189void fsl_pcibios_fixup_bus(struct pci_bus *bus) 285void fsl_pcibios_fixup_bus(struct pci_bus *bus)
190{ 286{
191 struct pci_controller *hose = (struct pci_controller *) bus->sysdata; 287 struct pci_controller *hose = pci_bus_to_host(bus);
192 int i; 288 int i;
193 289
194 if ((bus->parent == hose->bus) && 290 if ((bus->parent == hose->bus) &&
@@ -269,8 +365,6 @@ int __init fsl_add_bridge(struct device_node *dev, int is_primary)
269 /* Setup PEX window registers */ 365 /* Setup PEX window registers */
270 setup_pci_atmu(hose, &rsrc); 366 setup_pci_atmu(hose, &rsrc);
271 367
272 /* Setup PEXCSRBAR */
273 setup_pci_pcsrbar(hose);
274 return 0; 368 return 0;
275} 369}
276 370
@@ -281,6 +375,8 @@ DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8543, quirk_fsl_pcie_header);
281DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8547E, quirk_fsl_pcie_header); 375DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8547E, quirk_fsl_pcie_header);
282DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8545E, quirk_fsl_pcie_header); 376DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8545E, quirk_fsl_pcie_header);
283DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8545, quirk_fsl_pcie_header); 377DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8545, quirk_fsl_pcie_header);
378DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8569E, quirk_fsl_pcie_header);
379DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8569, quirk_fsl_pcie_header);
284DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8568E, quirk_fsl_pcie_header); 380DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8568E, quirk_fsl_pcie_header);
285DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_header); 381DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_header);
286DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_header); 382DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_header);
@@ -296,6 +392,8 @@ DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8536, quirk_fsl_pcie_header);
296DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_header); 392DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_header);
297DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_header); 393DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_header);
298DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_header); 394DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_header);
395DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2020E, quirk_fsl_pcie_header);
396DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2020, quirk_fsl_pcie_header);
299#endif /* CONFIG_PPC_85xx || CONFIG_PPC_86xx */ 397#endif /* CONFIG_PPC_85xx || CONFIG_PPC_86xx */
300 398
301#if defined(CONFIG_PPC_83xx) || defined(CONFIG_PPC_MPC512x) 399#if defined(CONFIG_PPC_83xx) || defined(CONFIG_PPC_MPC512x)
@@ -324,7 +422,7 @@ struct mpc83xx_pcie_priv {
324 422
325static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn) 423static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn)
326{ 424{
327 struct pci_controller *hose = bus->sysdata; 425 struct pci_controller *hose = pci_bus_to_host(bus);
328 426
329 if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) 427 if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK)
330 return PCIBIOS_DEVICE_NOT_FOUND; 428 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -350,7 +448,7 @@ static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn)
350static void __iomem *mpc83xx_pcie_remap_cfg(struct pci_bus *bus, 448static void __iomem *mpc83xx_pcie_remap_cfg(struct pci_bus *bus,
351 unsigned int devfn, int offset) 449 unsigned int devfn, int offset)
352{ 450{
353 struct pci_controller *hose = bus->sysdata; 451 struct pci_controller *hose = pci_bus_to_host(bus);
354 struct mpc83xx_pcie_priv *pcie = hose->dn->data; 452 struct mpc83xx_pcie_priv *pcie = hose->dn->data;
355 u8 bus_no = bus->number - hose->first_busno; 453 u8 bus_no = bus->number - hose->first_busno;
356 u32 dev_base = bus_no << 24 | devfn << 16; 454 u32 dev_base = bus_no << 24 | devfn << 16;
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index 13f30c2a61e7..a9d8bbebed80 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -16,7 +16,11 @@
16 16
17#define PCIE_LTSSM 0x0404 /* PCIE Link Training and Status */ 17#define PCIE_LTSSM 0x0404 /* PCIE Link Training and Status */
18#define PCIE_LTSSM_L0 0x16 /* L0 state */ 18#define PCIE_LTSSM_L0 0x16 /* L0 state */
19#define PIWAR_2G 0xa0f5501e /* Enable, Prefetch, Local Mem, Snoop R/W, 2G */ 19#define PIWAR_EN 0x80000000 /* Enable */
20#define PIWAR_PF 0x20000000 /* prefetch */
21#define PIWAR_TGI_LOCAL 0x00f00000 /* target - local memory */
22#define PIWAR_READ_SNOOP 0x00050000
23#define PIWAR_WRITE_SNOOP 0x00005000
20 24
21/* PCI/PCI Express outbound window reg */ 25/* PCI/PCI Express outbound window reg */
22struct pci_outbound_window_regs { 26struct pci_outbound_window_regs {
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index abdb124e1e2f..39db9d1155d2 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -1026,8 +1026,7 @@ int fsl_rio_setup(struct of_device *dev)
1026 return -EFAULT; 1026 return -EFAULT;
1027 } 1027 }
1028 dev_info(&dev->dev, "Of-device full name %s\n", dev->node->full_name); 1028 dev_info(&dev->dev, "Of-device full name %s\n", dev->node->full_name);
1029 dev_info(&dev->dev, "Regs start 0x%08x size 0x%08x\n", regs.start, 1029 dev_info(&dev->dev, "Regs: %pR\n", &regs);
1030 regs.end - regs.start + 1);
1031 1030
1032 dt_range = of_get_property(dev->node, "ranges", &rlen); 1031 dt_range = of_get_property(dev->node, "ranges", &rlen);
1033 if (!dt_range) { 1032 if (!dt_range) {
@@ -1077,8 +1076,9 @@ int fsl_rio_setup(struct of_device *dev)
1077 1076
1078 INIT_LIST_HEAD(&port->dbells); 1077 INIT_LIST_HEAD(&port->dbells);
1079 port->iores.start = law_start; 1078 port->iores.start = law_start;
1080 port->iores.end = law_start + law_size; 1079 port->iores.end = law_start + law_size - 1;
1081 port->iores.flags = IORESOURCE_MEM; 1080 port->iores.flags = IORESOURCE_MEM;
1081 port->iores.name = "rio_io_win";
1082 1082
1083 priv->bellirq = irq_of_parse_and_map(dev->node, 2); 1083 priv->bellirq = irq_of_parse_and_map(dev->node, 2);
1084 priv->txirq = irq_of_parse_and_map(dev->node, 3); 1084 priv->txirq = irq_of_parse_and_map(dev->node, 3);
@@ -1156,14 +1156,15 @@ int fsl_rio_setup(struct of_device *dev)
1156 out_be32((priv->regs_win + RIO_ISR_AACR), RIO_ISR_AACR_AA); 1156 out_be32((priv->regs_win + RIO_ISR_AACR), RIO_ISR_AACR_AA);
1157 1157
1158 /* Configure maintenance transaction window */ 1158 /* Configure maintenance transaction window */
1159 out_be32(&priv->maint_atmu_regs->rowbar, 0x000c0000); 1159 out_be32(&priv->maint_atmu_regs->rowbar, law_start >> 12);
1160 out_be32(&priv->maint_atmu_regs->rowar, 0x80077015); 1160 out_be32(&priv->maint_atmu_regs->rowar, 0x80077015); /* 4M */
1161 1161
1162 priv->maint_win = ioremap(law_start, RIO_MAINT_WIN_SIZE); 1162 priv->maint_win = ioremap(law_start, RIO_MAINT_WIN_SIZE);
1163 1163
1164 /* Configure outbound doorbell window */ 1164 /* Configure outbound doorbell window */
1165 out_be32(&priv->dbell_atmu_regs->rowbar, 0x000c0400); 1165 out_be32(&priv->dbell_atmu_regs->rowbar,
1166 out_be32(&priv->dbell_atmu_regs->rowar, 0x8004200b); 1166 (law_start + RIO_MAINT_WIN_SIZE) >> 12);
1167 out_be32(&priv->dbell_atmu_regs->rowar, 0x8004200b); /* 4k */
1167 fsl_rio_doorbell_init(port); 1168 fsl_rio_doorbell_init(port);
1168 1169
1169 return 0; 1170 return 0;
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 5c64ccd402e2..95dbc643c4fc 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -379,16 +379,10 @@ static int __init setup_rstcr(void)
379 struct device_node *np; 379 struct device_node *np;
380 np = of_find_node_by_name(NULL, "global-utilities"); 380 np = of_find_node_by_name(NULL, "global-utilities");
381 if ((np && of_get_property(np, "fsl,has-rstcr", NULL))) { 381 if ((np && of_get_property(np, "fsl,has-rstcr", NULL))) {
382 const u32 *prop = of_get_property(np, "reg", NULL); 382 rstcr = of_iomap(np, 0) + 0xb0;
383 if (prop) { 383 if (!rstcr)
384 /* map reset control register 384 printk (KERN_EMERG "Error: reset control register "
385 * 0xE00B0 is offset of reset control register 385 "not mapped!\n");
386 */
387 rstcr = ioremap(get_immrbase() + *prop + 0xB0, 0xff);
388 if (!rstcr)
389 printk (KERN_EMERG "Error: reset control "
390 "register not mapped!\n");
391 }
392 } else 386 } else
393 printk (KERN_INFO "rstcr compatible register does not exist!\n"); 387 printk (KERN_INFO "rstcr compatible register does not exist!\n");
394 if (np) 388 if (np)
diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
index 7fd49c97501a..7ed809676642 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -24,7 +24,7 @@ static int
24indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, 24indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
25 int len, u32 *val) 25 int len, u32 *val)
26{ 26{
27 struct pci_controller *hose = bus->sysdata; 27 struct pci_controller *hose = pci_bus_to_host(bus);
28 volatile void __iomem *cfg_data; 28 volatile void __iomem *cfg_data;
29 u8 cfg_type = 0; 29 u8 cfg_type = 0;
30 u32 bus_no, reg; 30 u32 bus_no, reg;
@@ -82,7 +82,7 @@ static int
82indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset, 82indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
83 int len, u32 val) 83 int len, u32 val)
84{ 84{
85 struct pci_controller *hose = bus->sysdata; 85 struct pci_controller *hose = pci_bus_to_host(bus);
86 volatile void __iomem *cfg_data; 86 volatile void __iomem *cfg_data;
87 u8 cfg_type = 0; 87 u8 cfg_type = 0;
88 u32 bus_no, reg; 88 u32 bus_no, reg;
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 352d8c3ef526..9c3af5045495 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -613,23 +613,23 @@ static int irq_choose_cpu(unsigned int virt_irq)
613#define mpic_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq) 613#define mpic_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq)
614 614
615/* Find an mpic associated with a given linux interrupt */ 615/* Find an mpic associated with a given linux interrupt */
616static struct mpic *mpic_find(unsigned int irq, unsigned int *is_ipi) 616static struct mpic *mpic_find(unsigned int irq)
617{ 617{
618 unsigned int src = mpic_irq_to_hw(irq);
619 struct mpic *mpic;
620
621 if (irq < NUM_ISA_INTERRUPTS) 618 if (irq < NUM_ISA_INTERRUPTS)
622 return NULL; 619 return NULL;
623 620
624 mpic = irq_desc[irq].chip_data; 621 return irq_desc[irq].chip_data;
622}
625 623
626 if (is_ipi) 624/* Determine if the linux irq is an IPI */
627 *is_ipi = (src >= mpic->ipi_vecs[0] && 625static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int irq)
628 src <= mpic->ipi_vecs[3]); 626{
627 unsigned int src = mpic_irq_to_hw(irq);
629 628
630 return mpic; 629 return (src >= mpic->ipi_vecs[0] && src <= mpic->ipi_vecs[3]);
631} 630}
632 631
632
633/* Convert a cpu mask from logical to physical cpu numbers. */ 633/* Convert a cpu mask from logical to physical cpu numbers. */
634static inline u32 mpic_physmask(u32 cpumask) 634static inline u32 mpic_physmask(u32 cpumask)
635{ 635{
@@ -1383,8 +1383,7 @@ void __init mpic_set_serial_int(struct mpic *mpic, int enable)
1383 1383
1384void mpic_irq_set_priority(unsigned int irq, unsigned int pri) 1384void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
1385{ 1385{
1386 unsigned int is_ipi; 1386 struct mpic *mpic = mpic_find(irq);
1387 struct mpic *mpic = mpic_find(irq, &is_ipi);
1388 unsigned int src = mpic_irq_to_hw(irq); 1387 unsigned int src = mpic_irq_to_hw(irq);
1389 unsigned long flags; 1388 unsigned long flags;
1390 u32 reg; 1389 u32 reg;
@@ -1393,7 +1392,7 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
1393 return; 1392 return;
1394 1393
1395 spin_lock_irqsave(&mpic_lock, flags); 1394 spin_lock_irqsave(&mpic_lock, flags);
1396 if (is_ipi) { 1395 if (mpic_is_ipi(mpic, irq)) {
1397 reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) & 1396 reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) &
1398 ~MPIC_VECPRI_PRIORITY_MASK; 1397 ~MPIC_VECPRI_PRIORITY_MASK;
1399 mpic_ipi_write(src - mpic->ipi_vecs[0], 1398 mpic_ipi_write(src - mpic->ipi_vecs[0],
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 6a2d473c345a..daefc93ddffe 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -1295,7 +1295,7 @@ static void __iomem *ppc4xx_pciex_get_config_base(struct ppc4xx_pciex_port *port
1295static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn, 1295static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
1296 int offset, int len, u32 *val) 1296 int offset, int len, u32 *val)
1297{ 1297{
1298 struct pci_controller *hose = (struct pci_controller *) bus->sysdata; 1298 struct pci_controller *hose = pci_bus_to_host(bus);
1299 struct ppc4xx_pciex_port *port = 1299 struct ppc4xx_pciex_port *port =
1300 &ppc4xx_pciex_ports[hose->indirect_type]; 1300 &ppc4xx_pciex_ports[hose->indirect_type];
1301 void __iomem *addr; 1301 void __iomem *addr;
@@ -1352,7 +1352,7 @@ static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
1352static int ppc4xx_pciex_write_config(struct pci_bus *bus, unsigned int devfn, 1352static int ppc4xx_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
1353 int offset, int len, u32 val) 1353 int offset, int len, u32 val)
1354{ 1354{
1355 struct pci_controller *hose = (struct pci_controller *) bus->sysdata; 1355 struct pci_controller *hose = pci_bus_to_host(bus);
1356 struct ppc4xx_pciex_port *port = 1356 struct ppc4xx_pciex_port *port =
1357 &ppc4xx_pciex_ports[hose->indirect_type]; 1357 &ppc4xx_pciex_ports[hose->indirect_type];
1358 void __iomem *addr; 1358 void __iomem *addr;
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 01bce3784b0a..b28b0e512d67 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -61,6 +61,7 @@ struct qe_immap __iomem *qe_immr;
61EXPORT_SYMBOL(qe_immr); 61EXPORT_SYMBOL(qe_immr);
62 62
63static struct qe_snum snums[QE_NUM_OF_SNUM]; /* Dynamically allocated SNUMs */ 63static struct qe_snum snums[QE_NUM_OF_SNUM]; /* Dynamically allocated SNUMs */
64static unsigned int qe_num_of_snum;
64 65
65static phys_addr_t qebase = -1; 66static phys_addr_t qebase = -1;
66 67
@@ -264,10 +265,14 @@ static void qe_snums_init(void)
264 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D, 265 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D,
265 0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, 0x88, 0x89, 266 0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, 0x88, 0x89,
266 0x98, 0x99, 0xA8, 0xA9, 0xB8, 0xB9, 0xC8, 0xC9, 267 0x98, 0x99, 0xA8, 0xA9, 0xB8, 0xB9, 0xC8, 0xC9,
267 0xD8, 0xD9, 0xE8, 0xE9, 268 0xD8, 0xD9, 0xE8, 0xE9, 0x08, 0x09, 0x18, 0x19,
269 0x28, 0x29, 0x38, 0x39, 0x48, 0x49, 0x58, 0x59,
270 0x68, 0x69, 0x78, 0x79, 0x80, 0x81,
268 }; 271 };
269 272
270 for (i = 0; i < QE_NUM_OF_SNUM; i++) { 273 qe_num_of_snum = qe_get_num_of_snums();
274
275 for (i = 0; i < qe_num_of_snum; i++) {
271 snums[i].num = snum_init[i]; 276 snums[i].num = snum_init[i];
272 snums[i].state = QE_SNUM_STATE_FREE; 277 snums[i].state = QE_SNUM_STATE_FREE;
273 } 278 }
@@ -280,7 +285,7 @@ int qe_get_snum(void)
280 int i; 285 int i;
281 286
282 spin_lock_irqsave(&qe_lock, flags); 287 spin_lock_irqsave(&qe_lock, flags);
283 for (i = 0; i < QE_NUM_OF_SNUM; i++) { 288 for (i = 0; i < qe_num_of_snum; i++) {
284 if (snums[i].state == QE_SNUM_STATE_FREE) { 289 if (snums[i].state == QE_SNUM_STATE_FREE) {
285 snums[i].state = QE_SNUM_STATE_USED; 290 snums[i].state = QE_SNUM_STATE_USED;
286 snum = snums[i].num; 291 snum = snums[i].num;
@@ -297,7 +302,7 @@ void qe_put_snum(u8 snum)
297{ 302{
298 int i; 303 int i;
299 304
300 for (i = 0; i < QE_NUM_OF_SNUM; i++) { 305 for (i = 0; i < qe_num_of_snum; i++) {
301 if (snums[i].num == snum) { 306 if (snums[i].num == snum) {
302 snums[i].state = QE_SNUM_STATE_FREE; 307 snums[i].state = QE_SNUM_STATE_FREE;
303 break; 308 break;
@@ -575,3 +580,65 @@ struct qe_firmware_info *qe_get_firmware_info(void)
575} 580}
576EXPORT_SYMBOL(qe_get_firmware_info); 581EXPORT_SYMBOL(qe_get_firmware_info);
577 582
583unsigned int qe_get_num_of_risc(void)
584{
585 struct device_node *qe;
586 int size;
587 unsigned int num_of_risc = 0;
588 const u32 *prop;
589
590 qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
591 if (!qe) {
592 /* Older devices trees did not have an "fsl,qe"
593 * compatible property, so we need to look for
594 * the QE node by name.
595 */
596 qe = of_find_node_by_type(NULL, "qe");
597 if (!qe)
598 return num_of_risc;
599 }
600
601 prop = of_get_property(qe, "fsl,qe-num-riscs", &size);
602 if (prop && size == sizeof(*prop))
603 num_of_risc = *prop;
604
605 of_node_put(qe);
606
607 return num_of_risc;
608}
609EXPORT_SYMBOL(qe_get_num_of_risc);
610
611unsigned int qe_get_num_of_snums(void)
612{
613 struct device_node *qe;
614 int size;
615 unsigned int num_of_snums;
616 const u32 *prop;
617
618 num_of_snums = 28; /* The default number of snum for threads is 28 */
619 qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
620 if (!qe) {
621 /* Older devices trees did not have an "fsl,qe"
622 * compatible property, so we need to look for
623 * the QE node by name.
624 */
625 qe = of_find_node_by_type(NULL, "qe");
626 if (!qe)
627 return num_of_snums;
628 }
629
630 prop = of_get_property(qe, "fsl,qe-num-snums", &size);
631 if (prop && size == sizeof(*prop)) {
632 num_of_snums = *prop;
633 if ((num_of_snums < 28) || (num_of_snums > QE_NUM_OF_SNUM)) {
634 /* No QE ever has fewer than 28 SNUMs */
635 pr_err("QE: number of snum is invalid\n");
636 return -EINVAL;
637 }
638 }
639
640 of_node_put(qe);
641
642 return num_of_snums;
643}
644EXPORT_SYMBOL(qe_get_num_of_snums);
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c
index 24e1f5a197ae..cf244a419e96 100644
--- a/arch/powerpc/sysdev/tsi108_pci.c
+++ b/arch/powerpc/sysdev/tsi108_pci.c
@@ -63,7 +63,7 @@ tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfunc,
63 int offset, int len, u32 val) 63 int offset, int len, u32 val)
64{ 64{
65 volatile unsigned char *cfg_addr; 65 volatile unsigned char *cfg_addr;
66 struct pci_controller *hose = bus->sysdata; 66 struct pci_controller *hose = pci_bus_to_host(bus);
67 67
68 if (ppc_md.pci_exclude_device) 68 if (ppc_md.pci_exclude_device)
69 if (ppc_md.pci_exclude_device(hose, bus->number, devfunc)) 69 if (ppc_md.pci_exclude_device(hose, bus->number, devfunc))
@@ -149,7 +149,7 @@ tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
149 int len, u32 * val) 149 int len, u32 * val)
150{ 150{
151 volatile unsigned char *cfg_addr; 151 volatile unsigned char *cfg_addr;
152 struct pci_controller *hose = bus->sysdata; 152 struct pci_controller *hose = pci_bus_to_host(bus);
153 u32 temp; 153 u32 temp;
154 154
155 if (ppc_md.pci_exclude_device) 155 if (ppc_md.pci_exclude_device)
diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c
index c658b413c9b4..3ee1fd37bbfc 100644
--- a/arch/powerpc/sysdev/xilinx_intc.c
+++ b/arch/powerpc/sysdev/xilinx_intc.c
@@ -25,6 +25,7 @@
25#include <linux/of.h> 25#include <linux/of.h>
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/processor.h> 27#include <asm/processor.h>
28#include <asm/i8259.h>
28#include <asm/irq.h> 29#include <asm/irq.h>
29 30
30/* 31/*
@@ -191,20 +192,14 @@ struct irq_host * __init
191xilinx_intc_init(struct device_node *np) 192xilinx_intc_init(struct device_node *np)
192{ 193{
193 struct irq_host * irq; 194 struct irq_host * irq;
194 struct resource res;
195 void * regs; 195 void * regs;
196 int rc;
197 196
198 /* Find and map the intc registers */ 197 /* Find and map the intc registers */
199 rc = of_address_to_resource(np, 0, &res); 198 regs = of_iomap(np, 0);
200 if (rc) { 199 if (!regs) {
201 printk(KERN_ERR __FILE__ ": of_address_to_resource() failed\n"); 200 pr_err("xilinx_intc: could not map registers\n");
202 return NULL; 201 return NULL;
203 } 202 }
204 regs = ioremap(res.start, 32);
205
206 printk(KERN_INFO "Xilinx intc at 0x%08llx mapped to 0x%p\n",
207 (unsigned long long) res.start, regs);
208 203
209 /* Setup interrupt controller */ 204 /* Setup interrupt controller */
210 out_be32(regs + XINTC_IER, 0); /* disable all irqs */ 205 out_be32(regs + XINTC_IER, 0); /* disable all irqs */
@@ -217,6 +212,7 @@ xilinx_intc_init(struct device_node *np)
217 if (!irq) 212 if (!irq)
218 panic(__FILE__ ": Cannot allocate IRQ host\n"); 213 panic(__FILE__ ": Cannot allocate IRQ host\n");
219 irq->host_data = regs; 214 irq->host_data = regs;
215
220 return irq; 216 return irq;
221} 217}
222 218
@@ -227,23 +223,70 @@ int xilinx_intc_get_irq(void)
227 return irq_linear_revmap(master_irqhost, in_be32(regs + XINTC_IVR)); 223 return irq_linear_revmap(master_irqhost, in_be32(regs + XINTC_IVR));
228} 224}
229 225
226#if defined(CONFIG_PPC_I8259)
227/*
228 * Support code for cascading to 8259 interrupt controllers
229 */
230static void xilinx_i8259_cascade(unsigned int irq, struct irq_desc *desc)
231{
232 unsigned int cascade_irq = i8259_irq();
233 if (cascade_irq)
234 generic_handle_irq(cascade_irq);
235
236 /* Let xilinx_intc end the interrupt */
237 desc->chip->ack(irq);
238 desc->chip->unmask(irq);
239}
240
241static void __init xilinx_i8259_setup_cascade(void)
242{
243 struct device_node *cascade_node;
244 int cascade_irq;
245
246 /* Initialize i8259 controller */
247 cascade_node = of_find_compatible_node(NULL, NULL, "chrp,iic");
248 if (!cascade_node)
249 return;
250
251 cascade_irq = irq_of_parse_and_map(cascade_node, 0);
252 if (!cascade_irq) {
253 pr_err("virtex_ml510: Failed to map cascade interrupt\n");
254 goto out;
255 }
256
257 i8259_init(cascade_node, 0);
258 set_irq_chained_handler(cascade_irq, xilinx_i8259_cascade);
259
260 /* Program irq 7 (usb/audio), 14/15 (ide) to level sensitive */
261 /* This looks like a dirty hack to me --gcl */
262 outb(0xc0, 0x4d0);
263 outb(0xc0, 0x4d1);
264
265 out:
266 of_node_put(cascade_node);
267}
268#else
269static inline void xilinx_i8259_setup_cascade(void) { return; }
270#endif /* defined(CONFIG_PPC_I8259) */
271
272static struct of_device_id xilinx_intc_match[] __initconst = {
273 { .compatible = "xlnx,opb-intc-1.00.c", },
274 { .compatible = "xlnx,xps-intc-1.00.a", },
275 {}
276};
277
278/*
279 * Initialize master Xilinx interrupt controller
280 */
230void __init xilinx_intc_init_tree(void) 281void __init xilinx_intc_init_tree(void)
231{ 282{
232 struct device_node *np; 283 struct device_node *np;
233 284
234 /* find top level interrupt controller */ 285 /* find top level interrupt controller */
235 for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") { 286 for_each_matching_node(np, xilinx_intc_match) {
236 if (!of_get_property(np, "interrupts", NULL)) 287 if (!of_get_property(np, "interrupts", NULL))
237 break; 288 break;
238 } 289 }
239 if (!np) {
240 for_each_compatible_node(np, NULL, "xlnx,xps-intc-1.00.a") {
241 if (!of_get_property(np, "interrupts", NULL))
242 break;
243 }
244 }
245
246 /* xilinx interrupt controller needs to be top level */
247 BUG_ON(!np); 290 BUG_ON(!np);
248 291
249 master_irqhost = xilinx_intc_init(np); 292 master_irqhost = xilinx_intc_init(np);
@@ -251,4 +294,6 @@ void __init xilinx_intc_init_tree(void)
251 294
252 irq_set_default_host(master_irqhost); 295 irq_set_default_host(master_irqhost);
253 of_node_put(np); 296 of_node_put(np);
297
298 xilinx_i8259_setup_cascade();
254} 299}
diff --git a/arch/powerpc/sysdev/xilinx_pci.c b/arch/powerpc/sysdev/xilinx_pci.c
new file mode 100644
index 000000000000..1453b0eed220
--- /dev/null
+++ b/arch/powerpc/sysdev/xilinx_pci.c
@@ -0,0 +1,132 @@
1/*
2 * PCI support for Xilinx plbv46_pci soft-core which can be used on
3 * Xilinx Virtex ML410 / ML510 boards.
4 *
5 * Copyright 2009 Roderick Colenbrander
6 * Copyright 2009 Secret Lab Technologies Ltd.
7 *
8 * The pci bridge fixup code was copied from ppc4xx_pci.c and was written
9 * by Benjamin Herrenschmidt.
10 * Copyright 2007 Ben. Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
11 *
12 * This file is licensed under the terms of the GNU General Public License
13 * version 2. This program is licensed "as is" without any warranty of any
14 * kind, whether express or implied.
15 */
16
17#include <linux/ioport.h>
18#include <linux/of.h>
19#include <linux/pci.h>
20#include <mm/mmu_decl.h>
21#include <asm/io.h>
22#include <asm/xilinx_pci.h>
23
24#define XPLB_PCI_ADDR 0x10c
25#define XPLB_PCI_DATA 0x110
26#define XPLB_PCI_BUS 0x114
27
28#define PCI_HOST_ENABLE_CMD PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY
29
30static struct of_device_id xilinx_pci_match[] = {
31 { .compatible = "xlnx,plbv46-pci-1.03.a", },
32 {}
33};
34
35/**
36 * xilinx_pci_fixup_bridge - Block Xilinx PHB configuration.
37 */
38static void xilinx_pci_fixup_bridge(struct pci_dev *dev)
39{
40 struct pci_controller *hose;
41 int i;
42
43 if (dev->devfn || dev->bus->self)
44 return;
45
46 hose = pci_bus_to_host(dev->bus);
47 if (!hose)
48 return;
49
50 if (!of_match_node(xilinx_pci_match, hose->dn))
51 return;
52
53 /* Hide the PCI host BARs from the kernel as their content doesn't
54 * fit well in the resource management
55 */
56 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
57 dev->resource[i].start = 0;
58 dev->resource[i].end = 0;
59 dev->resource[i].flags = 0;
60 }
61
62 dev_info(&dev->dev, "Hiding Xilinx plb-pci host bridge resources %s\n",
63 pci_name(dev));
64}
65DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, xilinx_pci_fixup_bridge);
66
67/**
68 * xilinx_pci_exclude_device - Don't do config access for non-root bus
69 *
70 * This is a hack. Config access to any bus other than bus 0 does not
71 * currently work on the ML510 so we prevent it here.
72 */
73static int
74xilinx_pci_exclude_device(struct pci_controller *hose, u_char bus, u8 devfn)
75{
76 return (bus != 0);
77}
78
79/**
80 * xilinx_pci_init - Find and register a Xilinx PCI host bridge
81 */
82void __init xilinx_pci_init(void)
83{
84 struct pci_controller *hose;
85 struct resource r;
86 void __iomem *pci_reg;
87 struct device_node *pci_node;
88
89 pci_node = of_find_matching_node(NULL, xilinx_pci_match);
90 if(!pci_node)
91 return;
92
93 if (of_address_to_resource(pci_node, 0, &r)) {
94 pr_err("xilinx-pci: cannot resolve base address\n");
95 return;
96 }
97
98 hose = pcibios_alloc_controller(pci_node);
99 if (!hose) {
100 pr_err("xilinx-pci: pcibios_alloc_controller() failed\n");
101 return;
102 }
103
104 /* Setup config space */
105 setup_indirect_pci(hose, r.start + XPLB_PCI_ADDR,
106 r.start + XPLB_PCI_DATA,
107 PPC_INDIRECT_TYPE_SET_CFG_TYPE);
108
109 /* According to the xilinx plbv46_pci documentation the soft-core starts
110 * a self-init when the bus master enable bit is set. Without this bit
111 * set the pci bus can't be scanned.
112 */
113 early_write_config_word(hose, 0, 0, PCI_COMMAND, PCI_HOST_ENABLE_CMD);
114
115 /* Set the max latency timer to 255 */
116 early_write_config_byte(hose, 0, 0, PCI_LATENCY_TIMER, 0xff);
117
118 /* Set the max bus number to 255 */
119 pci_reg = of_iomap(pci_node, 0);
120 out_8(pci_reg + XPLB_PCI_BUS, 0xff);
121 iounmap(pci_reg);
122
123 /* Nothing past the root bridge is working right now. By default
124 * exclude config access to anything except bus 0 */
125 if (!ppc_md.pci_exclude_device)
126 ppc_md.pci_exclude_device = xilinx_pci_exclude_device;
127
128 /* Register the host bridge with the linux kernel! */
129 pci_process_bridge_OF_ranges(hose, pci_node, 1);
130
131 pr_info("xilinx-pci: Registered PCI host bridge\n");
132}
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 8dfad7d9a004..e1f33a81e5e1 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -110,6 +110,7 @@ static int bsesc(void);
110static void dump(void); 110static void dump(void);
111static void prdump(unsigned long, long); 111static void prdump(unsigned long, long);
112static int ppc_inst_dump(unsigned long, long, int); 112static int ppc_inst_dump(unsigned long, long, int);
113static void dump_log_buf(void);
113static void backtrace(struct pt_regs *); 114static void backtrace(struct pt_regs *);
114static void excprint(struct pt_regs *); 115static void excprint(struct pt_regs *);
115static void prregs(struct pt_regs *); 116static void prregs(struct pt_regs *);
@@ -197,6 +198,7 @@ Commands:\n\
197 di dump instructions\n\ 198 di dump instructions\n\
198 df dump float values\n\ 199 df dump float values\n\
199 dd dump double values\n\ 200 dd dump double values\n\
201 dl dump the kernel log buffer\n\
200 dr dump stream of raw bytes\n\ 202 dr dump stream of raw bytes\n\
201 e print exception information\n\ 203 e print exception information\n\
202 f flush cache\n\ 204 f flush cache\n\
@@ -2009,6 +2011,8 @@ dump(void)
2009 nidump = MAX_DUMP; 2011 nidump = MAX_DUMP;
2010 adrs += ppc_inst_dump(adrs, nidump, 1); 2012 adrs += ppc_inst_dump(adrs, nidump, 1);
2011 last_cmd = "di\n"; 2013 last_cmd = "di\n";
2014 } else if (c == 'l') {
2015 dump_log_buf();
2012 } else if (c == 'r') { 2016 } else if (c == 'r') {
2013 scanhex(&ndump); 2017 scanhex(&ndump);
2014 if (ndump == 0) 2018 if (ndump == 0)
@@ -2122,6 +2126,49 @@ print_address(unsigned long addr)
2122 xmon_print_symbol(addr, "\t# ", ""); 2126 xmon_print_symbol(addr, "\t# ", "");
2123} 2127}
2124 2128
2129void
2130dump_log_buf(void)
2131{
2132 const unsigned long size = 128;
2133 unsigned long end, addr;
2134 unsigned char buf[size + 1];
2135
2136 addr = 0;
2137 buf[size] = '\0';
2138
2139 if (setjmp(bus_error_jmp) != 0) {
2140 printf("Unable to lookup symbol __log_buf!\n");
2141 return;
2142 }
2143
2144 catch_memory_errors = 1;
2145 sync();
2146 addr = kallsyms_lookup_name("__log_buf");
2147
2148 if (! addr)
2149 printf("Symbol __log_buf not found!\n");
2150 else {
2151 end = addr + (1 << CONFIG_LOG_BUF_SHIFT);
2152 while (addr < end) {
2153 if (! mread(addr, buf, size)) {
2154 printf("Can't read memory at address 0x%lx\n", addr);
2155 break;
2156 }
2157
2158 printf("%s", buf);
2159
2160 if (strlen(buf) < size)
2161 break;
2162
2163 addr += size;
2164 }
2165 }
2166
2167 sync();
2168 /* wait a little while to see if we get a machine check */
2169 __delay(200);
2170 catch_memory_errors = 0;
2171}
2125 2172
2126/* 2173/*
2127 * Memory operations - move, set, print differences 2174 * Memory operations - move, set, print differences
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 99dc3ded6b49..a14dba0e4d67 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -348,6 +348,9 @@ config ARCH_ENABLE_MEMORY_HOTPLUG
348config ARCH_ENABLE_MEMORY_HOTREMOVE 348config ARCH_ENABLE_MEMORY_HOTREMOVE
349 def_bool y 349 def_bool y
350 350
351config ARCH_HIBERNATION_POSSIBLE
352 def_bool y if 64BIT
353
351source "mm/Kconfig" 354source "mm/Kconfig"
352 355
353comment "I/O subsystem configuration" 356comment "I/O subsystem configuration"
@@ -592,6 +595,12 @@ config SECCOMP
592 595
593endmenu 596endmenu
594 597
598menu "Power Management"
599
600source "kernel/power/Kconfig"
601
602endmenu
603
595source "net/Kconfig" 604source "net/Kconfig"
596 605
597config PCMCIA 606config PCMCIA
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 578c61f15a4b..0ff387cebf88 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -88,7 +88,9 @@ LDFLAGS_vmlinux := -e start
88head-y := arch/s390/kernel/head.o arch/s390/kernel/init_task.o 88head-y := arch/s390/kernel/head.o arch/s390/kernel/init_task.o
89 89
90core-y += arch/s390/mm/ arch/s390/kernel/ arch/s390/crypto/ \ 90core-y += arch/s390/mm/ arch/s390/kernel/ arch/s390/crypto/ \
91 arch/s390/appldata/ arch/s390/hypfs/ arch/s390/kvm/ 91 arch/s390/appldata/ arch/s390/hypfs/ arch/s390/kvm/ \
92 arch/s390/power/
93
92libs-y += arch/s390/lib/ 94libs-y += arch/s390/lib/
93drivers-y += drivers/s390/ 95drivers-y += drivers/s390/
94drivers-$(CONFIG_MATHEMU) += arch/s390/math-emu/ 96drivers-$(CONFIG_MATHEMU) += arch/s390/math-emu/
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 1dfc7100c7ee..264528e4f58d 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -5,7 +5,7 @@
5 * Exports appldata_register_ops() and appldata_unregister_ops() for the 5 * Exports appldata_register_ops() and appldata_unregister_ops() for the
6 * data gathering modules. 6 * data gathering modules.
7 * 7 *
8 * Copyright IBM Corp. 2003, 2008 8 * Copyright IBM Corp. 2003, 2009
9 * 9 *
10 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com> 10 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
11 */ 11 */
@@ -26,6 +26,8 @@
26#include <linux/notifier.h> 26#include <linux/notifier.h>
27#include <linux/cpu.h> 27#include <linux/cpu.h>
28#include <linux/workqueue.h> 28#include <linux/workqueue.h>
29#include <linux/suspend.h>
30#include <linux/platform_device.h>
29#include <asm/appldata.h> 31#include <asm/appldata.h>
30#include <asm/timer.h> 32#include <asm/timer.h>
31#include <asm/uaccess.h> 33#include <asm/uaccess.h>
@@ -41,6 +43,9 @@
41 43
42#define TOD_MICRO 0x01000 /* nr. of TOD clock units 44#define TOD_MICRO 0x01000 /* nr. of TOD clock units
43 for 1 microsecond */ 45 for 1 microsecond */
46
47static struct platform_device *appldata_pdev;
48
44/* 49/*
45 * /proc entries (sysctl) 50 * /proc entries (sysctl)
46 */ 51 */
@@ -86,6 +91,7 @@ static atomic_t appldata_expire_count = ATOMIC_INIT(0);
86static DEFINE_SPINLOCK(appldata_timer_lock); 91static DEFINE_SPINLOCK(appldata_timer_lock);
87static int appldata_interval = APPLDATA_CPU_INTERVAL; 92static int appldata_interval = APPLDATA_CPU_INTERVAL;
88static int appldata_timer_active; 93static int appldata_timer_active;
94static int appldata_timer_suspended = 0;
89 95
90/* 96/*
91 * Work queue 97 * Work queue
@@ -475,6 +481,93 @@ void appldata_unregister_ops(struct appldata_ops *ops)
475/********************** module-ops management <END> **************************/ 481/********************** module-ops management <END> **************************/
476 482
477 483
484/**************************** suspend / resume *******************************/
485static int appldata_freeze(struct device *dev)
486{
487 struct appldata_ops *ops;
488 int rc;
489 struct list_head *lh;
490
491 get_online_cpus();
492 spin_lock(&appldata_timer_lock);
493 if (appldata_timer_active) {
494 __appldata_vtimer_setup(APPLDATA_DEL_TIMER);
495 appldata_timer_suspended = 1;
496 }
497 spin_unlock(&appldata_timer_lock);
498 put_online_cpus();
499
500 mutex_lock(&appldata_ops_mutex);
501 list_for_each(lh, &appldata_ops_list) {
502 ops = list_entry(lh, struct appldata_ops, list);
503 if (ops->active == 1) {
504 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
505 (unsigned long) ops->data, ops->size,
506 ops->mod_lvl);
507 if (rc != 0)
508 pr_err("Stopping the data collection for %s "
509 "failed with rc=%d\n", ops->name, rc);
510 }
511 }
512 mutex_unlock(&appldata_ops_mutex);
513 return 0;
514}
515
516static int appldata_restore(struct device *dev)
517{
518 struct appldata_ops *ops;
519 int rc;
520 struct list_head *lh;
521
522 get_online_cpus();
523 spin_lock(&appldata_timer_lock);
524 if (appldata_timer_suspended) {
525 __appldata_vtimer_setup(APPLDATA_ADD_TIMER);
526 appldata_timer_suspended = 0;
527 }
528 spin_unlock(&appldata_timer_lock);
529 put_online_cpus();
530
531 mutex_lock(&appldata_ops_mutex);
532 list_for_each(lh, &appldata_ops_list) {
533 ops = list_entry(lh, struct appldata_ops, list);
534 if (ops->active == 1) {
535 ops->callback(ops->data); // init record
536 rc = appldata_diag(ops->record_nr,
537 APPLDATA_START_INTERVAL_REC,
538 (unsigned long) ops->data, ops->size,
539 ops->mod_lvl);
540 if (rc != 0) {
541 pr_err("Starting the data collection for %s "
542 "failed with rc=%d\n", ops->name, rc);
543 }
544 }
545 }
546 mutex_unlock(&appldata_ops_mutex);
547 return 0;
548}
549
550static int appldata_thaw(struct device *dev)
551{
552 return appldata_restore(dev);
553}
554
555static struct dev_pm_ops appldata_pm_ops = {
556 .freeze = appldata_freeze,
557 .thaw = appldata_thaw,
558 .restore = appldata_restore,
559};
560
561static struct platform_driver appldata_pdrv = {
562 .driver = {
563 .name = "appldata",
564 .owner = THIS_MODULE,
565 .pm = &appldata_pm_ops,
566 },
567};
568/************************* suspend / resume <END> ****************************/
569
570
478/******************************* init / exit *********************************/ 571/******************************* init / exit *********************************/
479 572
480static void __cpuinit appldata_online_cpu(int cpu) 573static void __cpuinit appldata_online_cpu(int cpu)
@@ -531,11 +624,23 @@ static struct notifier_block __cpuinitdata appldata_nb = {
531 */ 624 */
532static int __init appldata_init(void) 625static int __init appldata_init(void)
533{ 626{
534 int i; 627 int i, rc;
628
629 rc = platform_driver_register(&appldata_pdrv);
630 if (rc)
631 return rc;
535 632
633 appldata_pdev = platform_device_register_simple("appldata", -1, NULL,
634 0);
635 if (IS_ERR(appldata_pdev)) {
636 rc = PTR_ERR(appldata_pdev);
637 goto out_driver;
638 }
536 appldata_wq = create_singlethread_workqueue("appldata"); 639 appldata_wq = create_singlethread_workqueue("appldata");
537 if (!appldata_wq) 640 if (!appldata_wq) {
538 return -ENOMEM; 641 rc = -ENOMEM;
642 goto out_device;
643 }
539 644
540 get_online_cpus(); 645 get_online_cpus();
541 for_each_online_cpu(i) 646 for_each_online_cpu(i)
@@ -547,6 +652,12 @@ static int __init appldata_init(void)
547 652
548 appldata_sysctl_header = register_sysctl_table(appldata_dir_table); 653 appldata_sysctl_header = register_sysctl_table(appldata_dir_table);
549 return 0; 654 return 0;
655
656out_device:
657 platform_device_unregister(appldata_pdev);
658out_driver:
659 platform_driver_unregister(&appldata_pdrv);
660 return rc;
550} 661}
551 662
552__initcall(appldata_init); 663__initcall(appldata_init);
diff --git a/arch/s390/include/asm/ccwdev.h b/arch/s390/include/asm/ccwdev.h
index ba007d8df941..2a5419551176 100644
--- a/arch/s390/include/asm/ccwdev.h
+++ b/arch/s390/include/asm/ccwdev.h
@@ -1,11 +1,9 @@
1/* 1/*
2 * include/asm-s390/ccwdev.h 2 * Copyright IBM Corp. 2002, 2009
3 * include/asm-s390x/ccwdev.h
4 * 3 *
5 * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, IBM Corporation 4 * Author(s): Arnd Bergmann <arndb@de.ibm.com>
6 * Author(s): Arnd Bergmann <arndb@de.ibm.com>
7 * 5 *
8 * Interface for CCW device drivers 6 * Interface for CCW device drivers
9 */ 7 */
10#ifndef _S390_CCWDEV_H_ 8#ifndef _S390_CCWDEV_H_
11#define _S390_CCWDEV_H_ 9#define _S390_CCWDEV_H_
@@ -104,6 +102,11 @@ struct ccw_device {
104 * @set_offline: called when setting device offline 102 * @set_offline: called when setting device offline
105 * @notify: notify driver of device state changes 103 * @notify: notify driver of device state changes
106 * @shutdown: called at device shutdown 104 * @shutdown: called at device shutdown
105 * @prepare: prepare for pm state transition
106 * @complete: undo work done in @prepare
107 * @freeze: callback for freezing during hibernation snapshotting
108 * @thaw: undo work done in @freeze
109 * @restore: callback for restoring after hibernation
107 * @driver: embedded device driver structure 110 * @driver: embedded device driver structure
108 * @name: device driver name 111 * @name: device driver name
109 */ 112 */
@@ -116,6 +119,11 @@ struct ccw_driver {
116 int (*set_offline) (struct ccw_device *); 119 int (*set_offline) (struct ccw_device *);
117 int (*notify) (struct ccw_device *, int); 120 int (*notify) (struct ccw_device *, int);
118 void (*shutdown) (struct ccw_device *); 121 void (*shutdown) (struct ccw_device *);
122 int (*prepare) (struct ccw_device *);
123 void (*complete) (struct ccw_device *);
124 int (*freeze)(struct ccw_device *);
125 int (*thaw) (struct ccw_device *);
126 int (*restore)(struct ccw_device *);
119 struct device_driver driver; 127 struct device_driver driver;
120 char *name; 128 char *name;
121}; 129};
@@ -184,6 +192,7 @@ extern void ccw_device_get_id(struct ccw_device *, struct ccw_dev_id *);
184#define to_ccwdrv(n) container_of(n, struct ccw_driver, driver) 192#define to_ccwdrv(n) container_of(n, struct ccw_driver, driver)
185 193
186extern struct ccw_device *ccw_device_probe_console(void); 194extern struct ccw_device *ccw_device_probe_console(void);
195extern int ccw_device_force_console(void);
187 196
188// FIXME: these have to go 197// FIXME: these have to go
189extern int _ccw_device_get_subchannel_number(struct ccw_device *); 198extern int _ccw_device_get_subchannel_number(struct ccw_device *);
diff --git a/arch/s390/include/asm/ccwgroup.h b/arch/s390/include/asm/ccwgroup.h
index a27f68985a79..c79c1e787b86 100644
--- a/arch/s390/include/asm/ccwgroup.h
+++ b/arch/s390/include/asm/ccwgroup.h
@@ -38,6 +38,11 @@ struct ccwgroup_device {
38 * @set_online: function called when device is set online 38 * @set_online: function called when device is set online
39 * @set_offline: function called when device is set offline 39 * @set_offline: function called when device is set offline
40 * @shutdown: function called when device is shut down 40 * @shutdown: function called when device is shut down
41 * @prepare: prepare for pm state transition
42 * @complete: undo work done in @prepare
43 * @freeze: callback for freezing during hibernation snapshotting
44 * @thaw: undo work done in @freeze
45 * @restore: callback for restoring after hibernation
41 * @driver: embedded driver structure 46 * @driver: embedded driver structure
42 */ 47 */
43struct ccwgroup_driver { 48struct ccwgroup_driver {
@@ -51,6 +56,11 @@ struct ccwgroup_driver {
51 int (*set_online) (struct ccwgroup_device *); 56 int (*set_online) (struct ccwgroup_device *);
52 int (*set_offline) (struct ccwgroup_device *); 57 int (*set_offline) (struct ccwgroup_device *);
53 void (*shutdown)(struct ccwgroup_device *); 58 void (*shutdown)(struct ccwgroup_device *);
59 int (*prepare) (struct ccwgroup_device *);
60 void (*complete) (struct ccwgroup_device *);
61 int (*freeze)(struct ccwgroup_device *);
62 int (*thaw) (struct ccwgroup_device *);
63 int (*restore)(struct ccwgroup_device *);
54 64
55 struct device_driver driver; 65 struct device_driver driver;
56}; 66};
diff --git a/arch/s390/include/asm/kmap_types.h b/arch/s390/include/asm/kmap_types.h
index fd1574648223..94ec3ee07983 100644
--- a/arch/s390/include/asm/kmap_types.h
+++ b/arch/s390/include/asm/kmap_types.h
@@ -2,22 +2,7 @@
2#ifndef _ASM_KMAP_TYPES_H 2#ifndef _ASM_KMAP_TYPES_H
3#define _ASM_KMAP_TYPES_H 3#define _ASM_KMAP_TYPES_H
4 4
5enum km_type { 5#include <asm-generic/kmap_types.h>
6 KM_BOUNCE_READ,
7 KM_SKB_SUNRPC_DATA,
8 KM_SKB_DATA_SOFTIRQ,
9 KM_USER0,
10 KM_USER1,
11 KM_BIO_SRC_IRQ,
12 KM_BIO_DST_IRQ,
13 KM_PTE0,
14 KM_PTE1,
15 KM_IRQ0,
16 KM_IRQ1,
17 KM_SOFTIRQ0,
18 KM_SOFTIRQ1,
19 KM_TYPE_NR
20};
21 6
22#endif 7#endif
23#endif /* __KERNEL__ */ 8#endif /* __KERNEL__ */
diff --git a/arch/s390/include/asm/suspend.h b/arch/s390/include/asm/suspend.h
new file mode 100644
index 000000000000..dc75c616eafe
--- /dev/null
+++ b/arch/s390/include/asm/suspend.h
@@ -0,0 +1,10 @@
1#ifndef __ASM_S390_SUSPEND_H
2#define __ASM_S390_SUSPEND_H
3
4static inline int arch_prepare_suspend(void)
5{
6 return 0;
7}
8
9#endif
10
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h
index 3a8b26eb1f2e..4fb83c1cdb77 100644
--- a/arch/s390/include/asm/system.h
+++ b/arch/s390/include/asm/system.h
@@ -1,11 +1,7 @@
1/* 1/*
2 * include/asm-s390/system.h 2 * Copyright IBM Corp. 1999, 2009
3 * 3 *
4 * S390 version 4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
7 *
8 * Derived from "include/asm-i386/system.h"
9 */ 5 */
10 6
11#ifndef __ASM_SYSTEM_H 7#ifndef __ASM_SYSTEM_H
@@ -469,6 +465,20 @@ extern psw_t sysc_restore_trace_psw;
469extern psw_t io_restore_trace_psw; 465extern psw_t io_restore_trace_psw;
470#endif 466#endif
471 467
468static inline int tprot(unsigned long addr)
469{
470 int rc = -EFAULT;
471
472 asm volatile(
473 " tprot 0(%1),0\n"
474 "0: ipm %0\n"
475 " srl %0,28\n"
476 "1:\n"
477 EX_TABLE(0b,1b)
478 : "+d" (rc) : "a" (addr) : "cc");
479 return rc;
480}
481
472#endif /* __KERNEL__ */ 482#endif /* __KERNEL__ */
473 483
474#endif 484#endif
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index fb263736826c..f9b144049dc9 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/s390/kernel/early.c 2 * arch/s390/kernel/early.c
3 * 3 *
4 * Copyright IBM Corp. 2007 4 * Copyright IBM Corp. 2007, 2009
5 * Author(s): Hongjie Yang <hongjie@us.ibm.com>, 5 * Author(s): Hongjie Yang <hongjie@us.ibm.com>,
6 * Heiko Carstens <heiko.carstens@de.ibm.com> 6 * Heiko Carstens <heiko.carstens@de.ibm.com>
7 */ 7 */
@@ -210,7 +210,7 @@ static noinline __init void detect_machine_type(void)
210 machine_flags |= MACHINE_FLAG_VM; 210 machine_flags |= MACHINE_FLAG_VM;
211} 211}
212 212
213static __init void early_pgm_check_handler(void) 213static void early_pgm_check_handler(void)
214{ 214{
215 unsigned long addr; 215 unsigned long addr;
216 const struct exception_table_entry *fixup; 216 const struct exception_table_entry *fixup;
@@ -222,7 +222,7 @@ static __init void early_pgm_check_handler(void)
222 S390_lowcore.program_old_psw.addr = fixup->fixup | PSW_ADDR_AMODE; 222 S390_lowcore.program_old_psw.addr = fixup->fixup | PSW_ADDR_AMODE;
223} 223}
224 224
225static noinline __init void setup_lowcore_early(void) 225void setup_lowcore_early(void)
226{ 226{
227 psw_t psw; 227 psw_t psw;
228 228
diff --git a/arch/s390/kernel/init_task.c b/arch/s390/kernel/init_task.c
index 7db95c0b8693..fe787f9e5f3f 100644
--- a/arch/s390/kernel/init_task.c
+++ b/arch/s390/kernel/init_task.c
@@ -18,10 +18,6 @@
18 18
19static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 19static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
20static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 20static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
21struct mm_struct init_mm = INIT_MM(init_mm);
22
23EXPORT_SYMBOL(init_mm);
24
25/* 21/*
26 * Initial thread structure. 22 * Initial thread structure.
27 * 23 *
diff --git a/arch/s390/kernel/mem_detect.c b/arch/s390/kernel/mem_detect.c
index 9872999c66d1..559af0d07878 100644
--- a/arch/s390/kernel/mem_detect.c
+++ b/arch/s390/kernel/mem_detect.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright IBM Corp. 2008 2 * Copyright IBM Corp. 2008, 2009
3 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com> 3 *
4 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
4 */ 5 */
5 6
6#include <linux/kernel.h> 7#include <linux/kernel.h>
@@ -9,20 +10,6 @@
9#include <asm/sclp.h> 10#include <asm/sclp.h>
10#include <asm/setup.h> 11#include <asm/setup.h>
11 12
12static inline int tprot(unsigned long addr)
13{
14 int rc = -EFAULT;
15
16 asm volatile(
17 " tprot 0(%1),0\n"
18 "0: ipm %0\n"
19 " srl %0,28\n"
20 "1:\n"
21 EX_TABLE(0b,1b)
22 : "+d" (rc) : "a" (addr) : "cc");
23 return rc;
24}
25
26#define ADDR2G (1ULL << 31) 13#define ADDR2G (1ULL << 31)
27 14
28static void find_memory_chunks(struct mem_chunk chunk[]) 15static void find_memory_chunks(struct mem_chunk chunk[])
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index cc8c484984e3..fd8e3111a4e8 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/s390/kernel/smp.c 2 * arch/s390/kernel/smp.c
3 * 3 *
4 * Copyright IBM Corp. 1999,2007 4 * Copyright IBM Corp. 1999, 2009
5 * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), 5 * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
6 * Martin Schwidefsky (schwidefsky@de.ibm.com) 6 * Martin Schwidefsky (schwidefsky@de.ibm.com)
7 * Heiko Carstens (heiko.carstens@de.ibm.com) 7 * Heiko Carstens (heiko.carstens@de.ibm.com)
@@ -1031,6 +1031,42 @@ out:
1031static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show, 1031static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show,
1032 dispatching_store); 1032 dispatching_store);
1033 1033
1034/*
1035 * If the resume kernel runs on another cpu than the suspended kernel,
1036 * we have to switch the cpu IDs in the logical map.
1037 */
1038void smp_switch_boot_cpu_in_resume(u32 resume_phys_cpu_id,
1039 struct _lowcore *suspend_lowcore)
1040{
1041 int cpu, suspend_cpu_id, resume_cpu_id;
1042 u32 suspend_phys_cpu_id;
1043
1044 suspend_phys_cpu_id = __cpu_logical_map[suspend_lowcore->cpu_nr];
1045 suspend_cpu_id = suspend_lowcore->cpu_nr;
1046
1047 for_each_present_cpu(cpu) {
1048 if (__cpu_logical_map[cpu] == resume_phys_cpu_id) {
1049 resume_cpu_id = cpu;
1050 goto found;
1051 }
1052 }
1053 panic("Could not find resume cpu in logical map.\n");
1054
1055found:
1056 printk("Resume cpu ID: %i/%i\n", resume_phys_cpu_id, resume_cpu_id);
1057 printk("Suspend cpu ID: %i/%i\n", suspend_phys_cpu_id, suspend_cpu_id);
1058
1059 __cpu_logical_map[resume_cpu_id] = suspend_phys_cpu_id;
1060 __cpu_logical_map[suspend_cpu_id] = resume_phys_cpu_id;
1061
1062 lowcore_ptr[suspend_cpu_id]->cpu_addr = resume_phys_cpu_id;
1063}
1064
1065u32 smp_get_phys_cpu_id(void)
1066{
1067 return __cpu_logical_map[smp_processor_id()];
1068}
1069
1034static int __init topology_init(void) 1070static int __init topology_init(void)
1035{ 1071{
1036 int cpu; 1072 int cpu;
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 4ca8e826bf30..565667207985 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -313,3 +313,22 @@ int s390_enable_sie(void)
313 return 0; 313 return 0;
314} 314}
315EXPORT_SYMBOL_GPL(s390_enable_sie); 315EXPORT_SYMBOL_GPL(s390_enable_sie);
316
317#ifdef CONFIG_DEBUG_PAGEALLOC
318#ifdef CONFIG_HIBERNATION
319bool kernel_page_present(struct page *page)
320{
321 unsigned long addr;
322 int cc;
323
324 addr = page_to_phys(page);
325 asm("lra %1,0(%1)\n"
326 "ipm %0\n"
327 "srl %0,28"
328 :"=d"(cc),"+a"(addr)::"cc");
329 return cc == 0;
330}
331
332#endif /* CONFIG_HIBERNATION */
333#endif /* CONFIG_DEBUG_PAGEALLOC */
334
diff --git a/arch/s390/power/Makefile b/arch/s390/power/Makefile
new file mode 100644
index 000000000000..973bb45a8fec
--- /dev/null
+++ b/arch/s390/power/Makefile
@@ -0,0 +1,8 @@
1#
2# Makefile for s390 PM support
3#
4
5obj-$(CONFIG_HIBERNATION) += suspend.o
6obj-$(CONFIG_HIBERNATION) += swsusp.o
7obj-$(CONFIG_HIBERNATION) += swsusp_64.o
8obj-$(CONFIG_HIBERNATION) += swsusp_asm64.o
diff --git a/arch/s390/power/suspend.c b/arch/s390/power/suspend.c
new file mode 100644
index 000000000000..b3351eceebbe
--- /dev/null
+++ b/arch/s390/power/suspend.c
@@ -0,0 +1,40 @@
1/*
2 * Suspend support specific for s390.
3 *
4 * Copyright IBM Corp. 2009
5 *
6 * Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com>
7 */
8
9#include <linux/mm.h>
10#include <linux/suspend.h>
11#include <linux/reboot.h>
12#include <linux/pfn.h>
13#include <asm/sections.h>
14#include <asm/ipl.h>
15
16/*
17 * References to section boundaries
18 */
19extern const void __nosave_begin, __nosave_end;
20
21/*
22 * check if given pfn is in the 'nosave' or in the read only NSS section
23 */
24int pfn_is_nosave(unsigned long pfn)
25{
26 unsigned long nosave_begin_pfn = __pa(&__nosave_begin) >> PAGE_SHIFT;
27 unsigned long nosave_end_pfn = PAGE_ALIGN(__pa(&__nosave_end))
28 >> PAGE_SHIFT;
29 unsigned long eshared_pfn = PFN_DOWN(__pa(&_eshared)) - 1;
30 unsigned long stext_pfn = PFN_DOWN(__pa(&_stext));
31
32 if (pfn >= nosave_begin_pfn && pfn < nosave_end_pfn)
33 return 1;
34 if (pfn >= stext_pfn && pfn <= eshared_pfn) {
35 if (ipl_info.type == IPL_TYPE_NSS)
36 return 1;
37 } else if ((tprot(pfn * PAGE_SIZE) && pfn > 0))
38 return 1;
39 return 0;
40}
diff --git a/arch/s390/power/swsusp.c b/arch/s390/power/swsusp.c
new file mode 100644
index 000000000000..e6a4fe9f5f24
--- /dev/null
+++ b/arch/s390/power/swsusp.c
@@ -0,0 +1,30 @@
1/*
2 * Support for suspend and resume on s390
3 *
4 * Copyright IBM Corp. 2009
5 *
6 * Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com>
7 *
8 */
9
10
11/*
12 * save CPU registers before creating a hibernation image and before
13 * restoring the memory state from it
14 */
15void save_processor_state(void)
16{
17 /* implentation contained in the
18 * swsusp_arch_suspend function
19 */
20}
21
22/*
23 * restore the contents of CPU registers
24 */
25void restore_processor_state(void)
26{
27 /* implentation contained in the
28 * swsusp_arch_resume function
29 */
30}
diff --git a/arch/s390/power/swsusp_64.c b/arch/s390/power/swsusp_64.c
new file mode 100644
index 000000000000..9516a517d72f
--- /dev/null
+++ b/arch/s390/power/swsusp_64.c
@@ -0,0 +1,17 @@
1/*
2 * Support for suspend and resume on s390
3 *
4 * Copyright IBM Corp. 2009
5 *
6 * Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com>
7 *
8 */
9
10#include <asm/system.h>
11#include <linux/interrupt.h>
12
13void do_after_copyback(void)
14{
15 mb();
16}
17
diff --git a/arch/s390/power/swsusp_asm64.S b/arch/s390/power/swsusp_asm64.S
new file mode 100644
index 000000000000..3c74e7d827c9
--- /dev/null
+++ b/arch/s390/power/swsusp_asm64.S
@@ -0,0 +1,199 @@
1/*
2 * S390 64-bit swsusp implementation
3 *
4 * Copyright IBM Corp. 2009
5 *
6 * Author(s): Hans-Joachim Picht <hans@linux.vnet.ibm.com>
7 * Michael Holzheu <holzheu@linux.vnet.ibm.com>
8 */
9
10#include <asm/page.h>
11#include <asm/ptrace.h>
12#include <asm/asm-offsets.h>
13
14/*
15 * Save register context in absolute 0 lowcore and call swsusp_save() to
16 * create in-memory kernel image. The context is saved in the designated
17 * "store status" memory locations (see POP).
18 * We return from this function twice. The first time during the suspend to
19 * disk process. The second time via the swsusp_arch_resume() function
20 * (see below) in the resume process.
21 * This function runs with disabled interrupts.
22 */
23 .section .text
24 .align 2
25 .globl swsusp_arch_suspend
26swsusp_arch_suspend:
27 stmg %r6,%r15,__SF_GPRS(%r15)
28 lgr %r1,%r15
29 aghi %r15,-STACK_FRAME_OVERHEAD
30 stg %r1,__SF_BACKCHAIN(%r15)
31
32 /* Deactivate DAT */
33 stnsm __SF_EMPTY(%r15),0xfb
34
35 /* Switch off lowcore protection */
36 stctg %c0,%c0,__SF_EMPTY(%r15)
37 ni __SF_EMPTY+4(%r15),0xef
38 lctlg %c0,%c0,__SF_EMPTY(%r15)
39
40 /* Store prefix register on stack */
41 stpx __SF_EMPTY(%r15)
42
43 /* Setup base register for lowcore (absolute 0) */
44 llgf %r1,__SF_EMPTY(%r15)
45
46 /* Get pointer to save area */
47 aghi %r1,0x1000
48
49 /* Store registers */
50 mvc 0x318(4,%r1),__SF_EMPTY(%r15) /* move prefix to lowcore */
51 stfpc 0x31c(%r1) /* store fpu control */
52 std 0,0x200(%r1) /* store f0 */
53 std 1,0x208(%r1) /* store f1 */
54 std 2,0x210(%r1) /* store f2 */
55 std 3,0x218(%r1) /* store f3 */
56 std 4,0x220(%r1) /* store f4 */
57 std 5,0x228(%r1) /* store f5 */
58 std 6,0x230(%r1) /* store f6 */
59 std 7,0x238(%r1) /* store f7 */
60 std 8,0x240(%r1) /* store f8 */
61 std 9,0x248(%r1) /* store f9 */
62 std 10,0x250(%r1) /* store f10 */
63 std 11,0x258(%r1) /* store f11 */
64 std 12,0x260(%r1) /* store f12 */
65 std 13,0x268(%r1) /* store f13 */
66 std 14,0x270(%r1) /* store f14 */
67 std 15,0x278(%r1) /* store f15 */
68 stam %a0,%a15,0x340(%r1) /* store access registers */
69 stctg %c0,%c15,0x380(%r1) /* store control registers */
70 stmg %r0,%r15,0x280(%r1) /* store general registers */
71
72 stpt 0x328(%r1) /* store timer */
73 stckc 0x330(%r1) /* store clock comparator */
74
75 /* Activate DAT */
76 stosm __SF_EMPTY(%r15),0x04
77
78 /* Set prefix page to zero */
79 xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15)
80 spx __SF_EMPTY(%r15)
81
82 /* Setup lowcore */
83 brasl %r14,setup_lowcore_early
84
85 /* Save image */
86 brasl %r14,swsusp_save
87
88 /* Switch on lowcore protection */
89 stctg %c0,%c0,__SF_EMPTY(%r15)
90 oi __SF_EMPTY+4(%r15),0x10
91 lctlg %c0,%c0,__SF_EMPTY(%r15)
92
93 /* Restore prefix register and return */
94 lghi %r1,0x1000
95 spx 0x318(%r1)
96 lmg %r6,%r15,STACK_FRAME_OVERHEAD + __SF_GPRS(%r15)
97 lghi %r2,0
98 br %r14
99
100/*
101 * Restore saved memory image to correct place and restore register context.
102 * Then we return to the function that called swsusp_arch_suspend().
103 * swsusp_arch_resume() runs with disabled interrupts.
104 */
105 .globl swsusp_arch_resume
106swsusp_arch_resume:
107 stmg %r6,%r15,__SF_GPRS(%r15)
108 lgr %r1,%r15
109 aghi %r15,-STACK_FRAME_OVERHEAD
110 stg %r1,__SF_BACKCHAIN(%r15)
111
112 /* Save boot cpu number */
113 brasl %r14,smp_get_phys_cpu_id
114 lgr %r10,%r2
115
116 /* Deactivate DAT */
117 stnsm __SF_EMPTY(%r15),0xfb
118
119 /* Switch off lowcore protection */
120 stctg %c0,%c0,__SF_EMPTY(%r15)
121 ni __SF_EMPTY+4(%r15),0xef
122 lctlg %c0,%c0,__SF_EMPTY(%r15)
123
124 /* Set prefix page to zero */
125 xc __SF_EMPTY(4,%r15),__SF_EMPTY(%r15)
126 spx __SF_EMPTY(%r15)
127
128 /* Restore saved image */
129 larl %r1,restore_pblist
130 lg %r1,0(%r1)
131 ltgr %r1,%r1
132 jz 2f
1330:
134 lg %r2,8(%r1)
135 lg %r4,0(%r1)
136 lghi %r3,PAGE_SIZE
137 lghi %r5,PAGE_SIZE
1381:
139 mvcle %r2,%r4,0
140 jo 1b
141 lg %r1,16(%r1)
142 ltgr %r1,%r1
143 jnz 0b
1442:
145 ptlb /* flush tlb */
146
147 /* Restore registers */
148 lghi %r13,0x1000 /* %r1 = pointer to save arae */
149
150 spt 0x328(%r13) /* reprogram timer */
151 //sckc 0x330(%r13) /* set clock comparator */
152
153 lctlg %c0,%c15,0x380(%r13) /* load control registers */
154 lam %a0,%a15,0x340(%r13) /* load access registers */
155
156 lfpc 0x31c(%r13) /* load fpu control */
157 ld 0,0x200(%r13) /* load f0 */
158 ld 1,0x208(%r13) /* load f1 */
159 ld 2,0x210(%r13) /* load f2 */
160 ld 3,0x218(%r13) /* load f3 */
161 ld 4,0x220(%r13) /* load f4 */
162 ld 5,0x228(%r13) /* load f5 */
163 ld 6,0x230(%r13) /* load f6 */
164 ld 7,0x238(%r13) /* load f7 */
165 ld 8,0x240(%r13) /* load f8 */
166 ld 9,0x248(%r13) /* load f9 */
167 ld 10,0x250(%r13) /* load f10 */
168 ld 11,0x258(%r13) /* load f11 */
169 ld 12,0x260(%r13) /* load f12 */
170 ld 13,0x268(%r13) /* load f13 */
171 ld 14,0x270(%r13) /* load f14 */
172 ld 15,0x278(%r13) /* load f15 */
173
174 /* Load old stack */
175 lg %r15,0x2f8(%r13)
176
177 /* Pointer to save arae */
178 lghi %r13,0x1000
179
180 /* Switch CPUs */
181 lgr %r2,%r10 /* get cpu id */
182 llgf %r3,0x318(%r13)
183 brasl %r14,smp_switch_boot_cpu_in_resume
184
185 /* Restore prefix register */
186 spx 0x318(%r13)
187
188 /* Switch on lowcore protection */
189 stctg %c0,%c0,__SF_EMPTY(%r15)
190 oi __SF_EMPTY+4(%r15),0x10
191 lctlg %c0,%c0,__SF_EMPTY(%r15)
192
193 /* Activate DAT */
194 stosm __SF_EMPTY(%r15),0x04
195
196 /* Return 0 */
197 lmg %r6,%r15,STACK_FRAME_OVERHEAD + __SF_GPRS(%r15)
198 lghi %r2,0
199 br %r14
diff --git a/arch/sh/include/asm/kmap_types.h b/arch/sh/include/asm/kmap_types.h
index 84d565c696be..5962b08b6dd8 100644
--- a/arch/sh/include/asm/kmap_types.h
+++ b/arch/sh/include/asm/kmap_types.h
@@ -3,30 +3,12 @@
3 3
4/* Dummy header just to define km_type. */ 4/* Dummy header just to define km_type. */
5 5
6
7#ifdef CONFIG_DEBUG_HIGHMEM 6#ifdef CONFIG_DEBUG_HIGHMEM
8# define D(n) __KM_FENCE_##n , 7#define __WITH_KM_FENCE
9#else
10# define D(n)
11#endif 8#endif
12 9
13enum km_type { 10#include <asm-generic/kmap_types.h>
14D(0) KM_BOUNCE_READ,
15D(1) KM_SKB_SUNRPC_DATA,
16D(2) KM_SKB_DATA_SOFTIRQ,
17D(3) KM_USER0,
18D(4) KM_USER1,
19D(5) KM_BIO_SRC_IRQ,
20D(6) KM_BIO_DST_IRQ,
21D(7) KM_PTE0,
22D(8) KM_PTE1,
23D(9) KM_IRQ0,
24D(10) KM_IRQ1,
25D(11) KM_SOFTIRQ0,
26D(12) KM_SOFTIRQ1,
27D(13) KM_TYPE_NR
28};
29 11
30#undef D 12#undef __WITH_KM_FENCE
31 13
32#endif 14#endif
diff --git a/arch/sh/kernel/init_task.c b/arch/sh/kernel/init_task.c
index 80c35ff71d56..1719957c0a69 100644
--- a/arch/sh/kernel/init_task.c
+++ b/arch/sh/kernel/init_task.c
@@ -10,9 +10,6 @@
10static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 10static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
11static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 11static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
12struct pt_regs fake_swapper_regs; 12struct pt_regs fake_swapper_regs;
13struct mm_struct init_mm = INIT_MM(init_mm);
14EXPORT_SYMBOL(init_mm);
15
16/* 13/*
17 * Initial thread structure. 14 * Initial thread structure.
18 * 15 *
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index cc12cd48bbc5..3f8b6a92eabd 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -37,6 +37,8 @@ config SPARC64
37 select HAVE_KPROBES 37 select HAVE_KPROBES
38 select HAVE_LMB 38 select HAVE_LMB
39 select HAVE_SYSCALL_WRAPPERS 39 select HAVE_SYSCALL_WRAPPERS
40 select HAVE_DYNAMIC_FTRACE
41 select HAVE_FTRACE_MCOUNT_RECORD
40 select USE_GENERIC_SMP_HELPERS if SMP 42 select USE_GENERIC_SMP_HELPERS if SMP
41 select RTC_DRV_CMOS 43 select RTC_DRV_CMOS
42 select RTC_DRV_BQ4802 44 select RTC_DRV_BQ4802
@@ -93,6 +95,9 @@ config AUDIT_ARCH
93config HAVE_SETUP_PER_CPU_AREA 95config HAVE_SETUP_PER_CPU_AREA
94 def_bool y if SPARC64 96 def_bool y if SPARC64
95 97
98config HAVE_DYNAMIC_PER_CPU_AREA
99 def_bool y if SPARC64
100
96config GENERIC_HARDIRQS_NO__DO_IRQ 101config GENERIC_HARDIRQS_NO__DO_IRQ
97 bool 102 bool
98 def_bool y if SPARC64 103 def_bool y if SPARC64
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig
index b5d63bd8716e..0123a4c596ce 100644
--- a/arch/sparc/configs/sparc64_defconfig
+++ b/arch/sparc/configs/sparc64_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.30-rc2 3# Linux kernel version: 2.6.30
4# Fri Apr 17 02:03:07 2009 4# Tue Jun 16 04:59:36 2009
5# 5#
6CONFIG_64BIT=y 6CONFIG_64BIT=y
7CONFIG_SPARC=y 7CONFIG_SPARC=y
@@ -19,6 +19,7 @@ CONFIG_LOCKDEP_SUPPORT=y
19CONFIG_HAVE_LATENCYTOP_SUPPORT=y 19CONFIG_HAVE_LATENCYTOP_SUPPORT=y
20CONFIG_AUDIT_ARCH=y 20CONFIG_AUDIT_ARCH=y
21CONFIG_HAVE_SETUP_PER_CPU_AREA=y 21CONFIG_HAVE_SETUP_PER_CPU_AREA=y
22CONFIG_HAVE_DYNAMIC_PER_CPU_AREA=y
22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 23CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
23CONFIG_MMU=y 24CONFIG_MMU=y
24CONFIG_ARCH_NO_VIRT_TO_BUS=y 25CONFIG_ARCH_NO_VIRT_TO_BUS=y
@@ -82,7 +83,6 @@ CONFIG_SYSCTL_SYSCALL=y
82CONFIG_KALLSYMS=y 83CONFIG_KALLSYMS=y
83# CONFIG_KALLSYMS_ALL is not set 84# CONFIG_KALLSYMS_ALL is not set
84# CONFIG_KALLSYMS_EXTRA_PASS is not set 85# CONFIG_KALLSYMS_EXTRA_PASS is not set
85# CONFIG_STRIP_ASM_SYMS is not set
86CONFIG_HOTPLUG=y 86CONFIG_HOTPLUG=y
87CONFIG_PRINTK=y 87CONFIG_PRINTK=y
88CONFIG_BUG=y 88CONFIG_BUG=y
@@ -95,16 +95,21 @@ CONFIG_TIMERFD=y
95CONFIG_EVENTFD=y 95CONFIG_EVENTFD=y
96CONFIG_SHMEM=y 96CONFIG_SHMEM=y
97CONFIG_AIO=y 97CONFIG_AIO=y
98
99#
100# Performance Counters
101#
98CONFIG_VM_EVENT_COUNTERS=y 102CONFIG_VM_EVENT_COUNTERS=y
99CONFIG_PCI_QUIRKS=y 103CONFIG_PCI_QUIRKS=y
100CONFIG_SLUB_DEBUG=y 104CONFIG_SLUB_DEBUG=y
105# CONFIG_STRIP_ASM_SYMS is not set
101# CONFIG_COMPAT_BRK is not set 106# CONFIG_COMPAT_BRK is not set
102# CONFIG_SLAB is not set 107# CONFIG_SLAB is not set
103CONFIG_SLUB=y 108CONFIG_SLUB=y
104# CONFIG_SLOB is not set 109# CONFIG_SLOB is not set
105CONFIG_PROFILING=y 110CONFIG_PROFILING=y
106CONFIG_TRACEPOINTS=y 111CONFIG_TRACEPOINTS=y
107# CONFIG_MARKERS is not set 112CONFIG_MARKERS=y
108CONFIG_OPROFILE=m 113CONFIG_OPROFILE=m
109CONFIG_HAVE_OPROFILE=y 114CONFIG_HAVE_OPROFILE=y
110CONFIG_KPROBES=y 115CONFIG_KPROBES=y
@@ -202,6 +207,7 @@ CONFIG_NR_QUICK=1
202CONFIG_UNEVICTABLE_LRU=y 207CONFIG_UNEVICTABLE_LRU=y
203CONFIG_HAVE_MLOCK=y 208CONFIG_HAVE_MLOCK=y
204CONFIG_HAVE_MLOCKED_PAGE_BIT=y 209CONFIG_HAVE_MLOCKED_PAGE_BIT=y
210CONFIG_DEFAULT_MMAP_MIN_ADDR=8192
205CONFIG_SCHED_SMT=y 211CONFIG_SCHED_SMT=y
206CONFIG_SCHED_MC=y 212CONFIG_SCHED_MC=y
207# CONFIG_PREEMPT_NONE is not set 213# CONFIG_PREEMPT_NONE is not set
@@ -321,6 +327,7 @@ CONFIG_VLAN_8021Q=m
321# CONFIG_ECONET is not set 327# CONFIG_ECONET is not set
322# CONFIG_WAN_ROUTER is not set 328# CONFIG_WAN_ROUTER is not set
323# CONFIG_PHONET is not set 329# CONFIG_PHONET is not set
330# CONFIG_IEEE802154 is not set
324# CONFIG_NET_SCHED is not set 331# CONFIG_NET_SCHED is not set
325# CONFIG_DCB is not set 332# CONFIG_DCB is not set
326 333
@@ -340,7 +347,11 @@ CONFIG_WIRELESS=y
340CONFIG_WIRELESS_OLD_REGULATORY=y 347CONFIG_WIRELESS_OLD_REGULATORY=y
341# CONFIG_WIRELESS_EXT is not set 348# CONFIG_WIRELESS_EXT is not set
342# CONFIG_LIB80211 is not set 349# CONFIG_LIB80211 is not set
343# CONFIG_MAC80211 is not set 350
351#
352# CFG80211 needs to be enabled for MAC80211
353#
354CONFIG_MAC80211_DEFAULT_PS_VALUE=0
344# CONFIG_WIMAX is not set 355# CONFIG_WIMAX is not set
345# CONFIG_RFKILL is not set 356# CONFIG_RFKILL is not set
346# CONFIG_NET_9P is not set 357# CONFIG_NET_9P is not set
@@ -364,6 +375,7 @@ CONFIG_EXTRA_FIRMWARE=""
364CONFIG_CONNECTOR=m 375CONFIG_CONNECTOR=m
365# CONFIG_MTD is not set 376# CONFIG_MTD is not set
366CONFIG_OF_DEVICE=y 377CONFIG_OF_DEVICE=y
378CONFIG_OF_MDIO=m
367# CONFIG_PARPORT is not set 379# CONFIG_PARPORT is not set
368CONFIG_BLK_DEV=y 380CONFIG_BLK_DEV=y
369# CONFIG_BLK_DEV_FD is not set 381# CONFIG_BLK_DEV_FD is not set
@@ -399,6 +411,7 @@ CONFIG_MISC_DEVICES=y
399# CONFIG_EEPROM_AT24 is not set 411# CONFIG_EEPROM_AT24 is not set
400# CONFIG_EEPROM_LEGACY is not set 412# CONFIG_EEPROM_LEGACY is not set
401# CONFIG_EEPROM_93CX6 is not set 413# CONFIG_EEPROM_93CX6 is not set
414# CONFIG_CB710_CORE is not set
402CONFIG_HAVE_IDE=y 415CONFIG_HAVE_IDE=y
403CONFIG_IDE=y 416CONFIG_IDE=y
404 417
@@ -477,10 +490,6 @@ CONFIG_BLK_DEV_SR=m
477CONFIG_BLK_DEV_SR_VENDOR=y 490CONFIG_BLK_DEV_SR_VENDOR=y
478CONFIG_CHR_DEV_SG=m 491CONFIG_CHR_DEV_SG=m
479# CONFIG_CHR_DEV_SCH is not set 492# CONFIG_CHR_DEV_SCH is not set
480
481#
482# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
483#
484CONFIG_SCSI_MULTI_LUN=y 493CONFIG_SCSI_MULTI_LUN=y
485CONFIG_SCSI_CONSTANTS=y 494CONFIG_SCSI_CONSTANTS=y
486# CONFIG_SCSI_LOGGING is not set 495# CONFIG_SCSI_LOGGING is not set
@@ -499,6 +508,7 @@ CONFIG_SCSI_FC_ATTRS=y
499CONFIG_SCSI_LOWLEVEL=y 508CONFIG_SCSI_LOWLEVEL=y
500# CONFIG_ISCSI_TCP is not set 509# CONFIG_ISCSI_TCP is not set
501# CONFIG_SCSI_CXGB3_ISCSI is not set 510# CONFIG_SCSI_CXGB3_ISCSI is not set
511# CONFIG_SCSI_BNX2_ISCSI is not set
502# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 512# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
503# CONFIG_SCSI_3W_9XXX is not set 513# CONFIG_SCSI_3W_9XXX is not set
504# CONFIG_SCSI_ACARD is not set 514# CONFIG_SCSI_ACARD is not set
@@ -507,6 +517,7 @@ CONFIG_SCSI_LOWLEVEL=y
507# CONFIG_SCSI_AIC7XXX_OLD is not set 517# CONFIG_SCSI_AIC7XXX_OLD is not set
508# CONFIG_SCSI_AIC79XX is not set 518# CONFIG_SCSI_AIC79XX is not set
509# CONFIG_SCSI_AIC94XX is not set 519# CONFIG_SCSI_AIC94XX is not set
520# CONFIG_SCSI_MVSAS is not set
510# CONFIG_SCSI_ARCMSR is not set 521# CONFIG_SCSI_ARCMSR is not set
511# CONFIG_MEGARAID_NEWGEN is not set 522# CONFIG_MEGARAID_NEWGEN is not set
512# CONFIG_MEGARAID_LEGACY is not set 523# CONFIG_MEGARAID_LEGACY is not set
@@ -521,7 +532,6 @@ CONFIG_SCSI_LOWLEVEL=y
521# CONFIG_SCSI_IPS is not set 532# CONFIG_SCSI_IPS is not set
522# CONFIG_SCSI_INITIO is not set 533# CONFIG_SCSI_INITIO is not set
523# CONFIG_SCSI_INIA100 is not set 534# CONFIG_SCSI_INIA100 is not set
524# CONFIG_SCSI_MVSAS is not set
525# CONFIG_SCSI_STEX is not set 535# CONFIG_SCSI_STEX is not set
526# CONFIG_SCSI_SYM53C8XX_2 is not set 536# CONFIG_SCSI_SYM53C8XX_2 is not set
527# CONFIG_SCSI_QLOGIC_1280 is not set 537# CONFIG_SCSI_QLOGIC_1280 is not set
@@ -569,7 +579,6 @@ CONFIG_DM_ZERO=m
569# CONFIG_IEEE1394 is not set 579# CONFIG_IEEE1394 is not set
570# CONFIG_I2O is not set 580# CONFIG_I2O is not set
571CONFIG_NETDEVICES=y 581CONFIG_NETDEVICES=y
572CONFIG_COMPAT_NET_DEV_OPS=y
573# CONFIG_DUMMY is not set 582# CONFIG_DUMMY is not set
574# CONFIG_BONDING is not set 583# CONFIG_BONDING is not set
575# CONFIG_MACVLAN is not set 584# CONFIG_MACVLAN is not set
@@ -635,6 +644,7 @@ CONFIG_NET_PCI=y
635# CONFIG_SMSC9420 is not set 644# CONFIG_SMSC9420 is not set
636# CONFIG_SUNDANCE is not set 645# CONFIG_SUNDANCE is not set
637# CONFIG_TLAN is not set 646# CONFIG_TLAN is not set
647# CONFIG_KS8842 is not set
638# CONFIG_VIA_RHINE is not set 648# CONFIG_VIA_RHINE is not set
639# CONFIG_SC92031 is not set 649# CONFIG_SC92031 is not set
640# CONFIG_ATL2 is not set 650# CONFIG_ATL2 is not set
@@ -1127,6 +1137,11 @@ CONFIG_SND_VERBOSE_PROCFS=y
1127# CONFIG_SND_VERBOSE_PRINTK is not set 1137# CONFIG_SND_VERBOSE_PRINTK is not set
1128# CONFIG_SND_DEBUG is not set 1138# CONFIG_SND_DEBUG is not set
1129CONFIG_SND_VMASTER=y 1139CONFIG_SND_VMASTER=y
1140CONFIG_SND_RAWMIDI_SEQ=m
1141# CONFIG_SND_OPL3_LIB_SEQ is not set
1142# CONFIG_SND_OPL4_LIB_SEQ is not set
1143# CONFIG_SND_SBAWE_SEQ is not set
1144# CONFIG_SND_EMU10K1_SEQ is not set
1130CONFIG_SND_MPU401_UART=m 1145CONFIG_SND_MPU401_UART=m
1131CONFIG_SND_AC97_CODEC=m 1146CONFIG_SND_AC97_CODEC=m
1132CONFIG_SND_DRIVERS=y 1147CONFIG_SND_DRIVERS=y
@@ -1153,6 +1168,7 @@ CONFIG_SND_ALI5451=m
1153# CONFIG_SND_OXYGEN is not set 1168# CONFIG_SND_OXYGEN is not set
1154# CONFIG_SND_CS4281 is not set 1169# CONFIG_SND_CS4281 is not set
1155# CONFIG_SND_CS46XX is not set 1170# CONFIG_SND_CS46XX is not set
1171# CONFIG_SND_CTXFI is not set
1156# CONFIG_SND_DARLA20 is not set 1172# CONFIG_SND_DARLA20 is not set
1157# CONFIG_SND_GINA20 is not set 1173# CONFIG_SND_GINA20 is not set
1158# CONFIG_SND_LAYLA20 is not set 1174# CONFIG_SND_LAYLA20 is not set
@@ -1183,6 +1199,7 @@ CONFIG_SND_ALI5451=m
1183# CONFIG_SND_INTEL8X0 is not set 1199# CONFIG_SND_INTEL8X0 is not set
1184# CONFIG_SND_INTEL8X0M is not set 1200# CONFIG_SND_INTEL8X0M is not set
1185# CONFIG_SND_KORG1212 is not set 1201# CONFIG_SND_KORG1212 is not set
1202# CONFIG_SND_LX6464ES is not set
1186# CONFIG_SND_MAESTRO3 is not set 1203# CONFIG_SND_MAESTRO3 is not set
1187# CONFIG_SND_MIXART is not set 1204# CONFIG_SND_MIXART is not set
1188# CONFIG_SND_NM256 is not set 1205# CONFIG_SND_NM256 is not set
@@ -1229,6 +1246,7 @@ CONFIG_HID_BELKIN=y
1229CONFIG_HID_CHERRY=y 1246CONFIG_HID_CHERRY=y
1230CONFIG_HID_CHICONY=y 1247CONFIG_HID_CHICONY=y
1231CONFIG_HID_CYPRESS=y 1248CONFIG_HID_CYPRESS=y
1249CONFIG_HID_DRAGONRISE=y
1232# CONFIG_DRAGONRISE_FF is not set 1250# CONFIG_DRAGONRISE_FF is not set
1233CONFIG_HID_EZKEY=y 1251CONFIG_HID_EZKEY=y
1234CONFIG_HID_KYE=y 1252CONFIG_HID_KYE=y
@@ -1246,9 +1264,14 @@ CONFIG_HID_PETALYNX=y
1246CONFIG_HID_SAMSUNG=y 1264CONFIG_HID_SAMSUNG=y
1247CONFIG_HID_SONY=y 1265CONFIG_HID_SONY=y
1248CONFIG_HID_SUNPLUS=y 1266CONFIG_HID_SUNPLUS=y
1267CONFIG_HID_GREENASIA=y
1249# CONFIG_GREENASIA_FF is not set 1268# CONFIG_GREENASIA_FF is not set
1269CONFIG_HID_SMARTJOYPLUS=y
1270# CONFIG_SMARTJOYPLUS_FF is not set
1250CONFIG_HID_TOPSEED=y 1271CONFIG_HID_TOPSEED=y
1272CONFIG_HID_THRUSTMASTER=y
1251# CONFIG_THRUSTMASTER_FF is not set 1273# CONFIG_THRUSTMASTER_FF is not set
1274CONFIG_HID_ZEROPLUS=y
1252# CONFIG_ZEROPLUS_FF is not set 1275# CONFIG_ZEROPLUS_FF is not set
1253CONFIG_USB_SUPPORT=y 1276CONFIG_USB_SUPPORT=y
1254CONFIG_USB_ARCH_HAS_HCD=y 1277CONFIG_USB_ARCH_HAS_HCD=y
@@ -1462,6 +1485,7 @@ CONFIG_FILE_LOCKING=y
1462# CONFIG_GFS2_FS is not set 1485# CONFIG_GFS2_FS is not set
1463# CONFIG_OCFS2_FS is not set 1486# CONFIG_OCFS2_FS is not set
1464# CONFIG_BTRFS_FS is not set 1487# CONFIG_BTRFS_FS is not set
1488CONFIG_FSNOTIFY=y
1465CONFIG_DNOTIFY=y 1489CONFIG_DNOTIFY=y
1466CONFIG_INOTIFY=y 1490CONFIG_INOTIFY=y
1467CONFIG_INOTIFY_USER=y 1491CONFIG_INOTIFY_USER=y
@@ -1636,25 +1660,28 @@ CONFIG_SYSCTL_SYSCALL_CHECK=y
1636# CONFIG_DEBUG_PAGEALLOC is not set 1660# CONFIG_DEBUG_PAGEALLOC is not set
1637CONFIG_NOP_TRACER=y 1661CONFIG_NOP_TRACER=y
1638CONFIG_HAVE_FUNCTION_TRACER=y 1662CONFIG_HAVE_FUNCTION_TRACER=y
1663CONFIG_HAVE_DYNAMIC_FTRACE=y
1664CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
1639CONFIG_RING_BUFFER=y 1665CONFIG_RING_BUFFER=y
1666CONFIG_EVENT_TRACING=y
1667CONFIG_CONTEXT_SWITCH_TRACER=y
1640CONFIG_TRACING=y 1668CONFIG_TRACING=y
1669CONFIG_GENERIC_TRACER=y
1641CONFIG_TRACING_SUPPORT=y 1670CONFIG_TRACING_SUPPORT=y
1642 1671CONFIG_FTRACE=y
1643#
1644# Tracers
1645#
1646# CONFIG_FUNCTION_TRACER is not set 1672# CONFIG_FUNCTION_TRACER is not set
1647# CONFIG_IRQSOFF_TRACER is not set 1673# CONFIG_IRQSOFF_TRACER is not set
1648# CONFIG_SCHED_TRACER is not set 1674# CONFIG_SCHED_TRACER is not set
1649# CONFIG_CONTEXT_SWITCH_TRACER is not set
1650# CONFIG_EVENT_TRACER is not set
1651# CONFIG_BOOT_TRACER is not set 1675# CONFIG_BOOT_TRACER is not set
1652# CONFIG_TRACE_BRANCH_PROFILING is not set 1676CONFIG_BRANCH_PROFILE_NONE=y
1677# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1678# CONFIG_PROFILE_ALL_BRANCHES is not set
1653# CONFIG_STACK_TRACER is not set 1679# CONFIG_STACK_TRACER is not set
1654# CONFIG_KMEMTRACE is not set 1680# CONFIG_KMEMTRACE is not set
1655# CONFIG_WORKQUEUE_TRACER is not set 1681# CONFIG_WORKQUEUE_TRACER is not set
1656CONFIG_BLK_DEV_IO_TRACE=y 1682CONFIG_BLK_DEV_IO_TRACE=y
1657# CONFIG_FTRACE_STARTUP_TEST is not set 1683# CONFIG_FTRACE_STARTUP_TEST is not set
1684# CONFIG_RING_BUFFER_BENCHMARK is not set
1658# CONFIG_DYNAMIC_DEBUG is not set 1685# CONFIG_DYNAMIC_DEBUG is not set
1659# CONFIG_SAMPLES is not set 1686# CONFIG_SAMPLES is not set
1660CONFIG_HAVE_ARCH_KGDB=y 1687CONFIG_HAVE_ARCH_KGDB=y
diff --git a/arch/sparc/include/asm/cpudata_64.h b/arch/sparc/include/asm/cpudata_64.h
index a11b89ee9ef8..926397d345ff 100644
--- a/arch/sparc/include/asm/cpudata_64.h
+++ b/arch/sparc/include/asm/cpudata_64.h
@@ -6,9 +6,6 @@
6#ifndef _SPARC64_CPUDATA_H 6#ifndef _SPARC64_CPUDATA_H
7#define _SPARC64_CPUDATA_H 7#define _SPARC64_CPUDATA_H
8 8
9#include <asm/hypervisor.h>
10#include <asm/asi.h>
11
12#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
13 10
14#include <linux/percpu.h> 11#include <linux/percpu.h>
@@ -38,202 +35,10 @@ DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
38#define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu)) 35#define cpu_data(__cpu) per_cpu(__cpu_data, (__cpu))
39#define local_cpu_data() __get_cpu_var(__cpu_data) 36#define local_cpu_data() __get_cpu_var(__cpu_data)
40 37
41/* Trap handling code needs to get at a few critical values upon
42 * trap entry and to process TSB misses. These cannot be in the
43 * per_cpu() area as we really need to lock them into the TLB and
44 * thus make them part of the main kernel image. As a result we
45 * try to make this as small as possible.
46 *
47 * This is padded out and aligned to 64-bytes to avoid false sharing
48 * on SMP.
49 */
50
51/* If you modify the size of this structure, please update
52 * TRAP_BLOCK_SZ_SHIFT below.
53 */
54struct thread_info;
55struct trap_per_cpu {
56/* D-cache line 1: Basic thread information, cpu and device mondo queues */
57 struct thread_info *thread;
58 unsigned long pgd_paddr;
59 unsigned long cpu_mondo_pa;
60 unsigned long dev_mondo_pa;
61
62/* D-cache line 2: Error Mondo Queue and kernel buffer pointers */
63 unsigned long resum_mondo_pa;
64 unsigned long resum_kernel_buf_pa;
65 unsigned long nonresum_mondo_pa;
66 unsigned long nonresum_kernel_buf_pa;
67
68/* Dcache lines 3, 4, 5, and 6: Hypervisor Fault Status */
69 struct hv_fault_status fault_info;
70
71/* Dcache line 7: Physical addresses of CPU send mondo block and CPU list. */
72 unsigned long cpu_mondo_block_pa;
73 unsigned long cpu_list_pa;
74 unsigned long tsb_huge;
75 unsigned long tsb_huge_temp;
76
77/* Dcache line 8: IRQ work list, and keep trap_block a power-of-2 in size. */
78 unsigned long irq_worklist_pa;
79 unsigned int cpu_mondo_qmask;
80 unsigned int dev_mondo_qmask;
81 unsigned int resum_qmask;
82 unsigned int nonresum_qmask;
83 void *hdesc;
84} __attribute__((aligned(64)));
85extern struct trap_per_cpu trap_block[NR_CPUS];
86extern void init_cur_cpu_trap(struct thread_info *);
87extern void setup_tba(void);
88extern int ncpus_probed;
89extern const struct seq_operations cpuinfo_op; 38extern const struct seq_operations cpuinfo_op;
90 39
91extern unsigned long real_hard_smp_processor_id(void);
92
93struct cpuid_patch_entry {
94 unsigned int addr;
95 unsigned int cheetah_safari[4];
96 unsigned int cheetah_jbus[4];
97 unsigned int starfire[4];
98 unsigned int sun4v[4];
99};
100extern struct cpuid_patch_entry __cpuid_patch, __cpuid_patch_end;
101
102struct sun4v_1insn_patch_entry {
103 unsigned int addr;
104 unsigned int insn;
105};
106extern struct sun4v_1insn_patch_entry __sun4v_1insn_patch,
107 __sun4v_1insn_patch_end;
108
109struct sun4v_2insn_patch_entry {
110 unsigned int addr;
111 unsigned int insns[2];
112};
113extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
114 __sun4v_2insn_patch_end;
115
116#endif /* !(__ASSEMBLY__) */ 40#endif /* !(__ASSEMBLY__) */
117 41
118#define TRAP_PER_CPU_THREAD 0x00 42#include <asm/trap_block.h>
119#define TRAP_PER_CPU_PGD_PADDR 0x08
120#define TRAP_PER_CPU_CPU_MONDO_PA 0x10
121#define TRAP_PER_CPU_DEV_MONDO_PA 0x18
122#define TRAP_PER_CPU_RESUM_MONDO_PA 0x20
123#define TRAP_PER_CPU_RESUM_KBUF_PA 0x28
124#define TRAP_PER_CPU_NONRESUM_MONDO_PA 0x30
125#define TRAP_PER_CPU_NONRESUM_KBUF_PA 0x38
126#define TRAP_PER_CPU_FAULT_INFO 0x40
127#define TRAP_PER_CPU_CPU_MONDO_BLOCK_PA 0xc0
128#define TRAP_PER_CPU_CPU_LIST_PA 0xc8
129#define TRAP_PER_CPU_TSB_HUGE 0xd0
130#define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8
131#define TRAP_PER_CPU_IRQ_WORKLIST_PA 0xe0
132#define TRAP_PER_CPU_CPU_MONDO_QMASK 0xe8
133#define TRAP_PER_CPU_DEV_MONDO_QMASK 0xec
134#define TRAP_PER_CPU_RESUM_QMASK 0xf0
135#define TRAP_PER_CPU_NONRESUM_QMASK 0xf4
136
137#define TRAP_BLOCK_SZ_SHIFT 8
138
139#include <asm/scratchpad.h>
140
141#define __GET_CPUID(REG) \
142 /* Spitfire implementation (default). */ \
143661: ldxa [%g0] ASI_UPA_CONFIG, REG; \
144 srlx REG, 17, REG; \
145 and REG, 0x1f, REG; \
146 nop; \
147 .section .cpuid_patch, "ax"; \
148 /* Instruction location. */ \
149 .word 661b; \
150 /* Cheetah Safari implementation. */ \
151 ldxa [%g0] ASI_SAFARI_CONFIG, REG; \
152 srlx REG, 17, REG; \
153 and REG, 0x3ff, REG; \
154 nop; \
155 /* Cheetah JBUS implementation. */ \
156 ldxa [%g0] ASI_JBUS_CONFIG, REG; \
157 srlx REG, 17, REG; \
158 and REG, 0x1f, REG; \
159 nop; \
160 /* Starfire implementation. */ \
161 sethi %hi(0x1fff40000d0 >> 9), REG; \
162 sllx REG, 9, REG; \
163 or REG, 0xd0, REG; \
164 lduwa [REG] ASI_PHYS_BYPASS_EC_E, REG;\
165 /* sun4v implementation. */ \
166 mov SCRATCHPAD_CPUID, REG; \
167 ldxa [REG] ASI_SCRATCHPAD, REG; \
168 nop; \
169 nop; \
170 .previous;
171
172#ifdef CONFIG_SMP
173
174#define TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
175 __GET_CPUID(TMP) \
176 sethi %hi(trap_block), DEST; \
177 sllx TMP, TRAP_BLOCK_SZ_SHIFT, TMP; \
178 or DEST, %lo(trap_block), DEST; \
179 add DEST, TMP, DEST; \
180
181/* Clobbers TMP, current address space PGD phys address into DEST. */
182#define TRAP_LOAD_PGD_PHYS(DEST, TMP) \
183 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
184 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
185
186/* Clobbers TMP, loads local processor's IRQ work area into DEST. */
187#define TRAP_LOAD_IRQ_WORK_PA(DEST, TMP) \
188 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
189 add DEST, TRAP_PER_CPU_IRQ_WORKLIST_PA, DEST;
190
191/* Clobbers TMP, loads DEST with current thread info pointer. */
192#define TRAP_LOAD_THREAD_REG(DEST, TMP) \
193 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
194 ldx [DEST + TRAP_PER_CPU_THREAD], DEST;
195
196/* Given the current thread info pointer in THR, load the per-cpu
197 * area base of the current processor into DEST. REG1, REG2, and REG3 are
198 * clobbered.
199 *
200 * You absolutely cannot use DEST as a temporary in this code. The
201 * reason is that traps can happen during execution, and return from
202 * trap will load the fully resolved DEST per-cpu base. This can corrupt
203 * the calculations done by the macro mid-stream.
204 */
205#define LOAD_PER_CPU_BASE(DEST, THR, REG1, REG2, REG3) \
206 lduh [THR + TI_CPU], REG1; \
207 sethi %hi(__per_cpu_shift), REG3; \
208 sethi %hi(__per_cpu_base), REG2; \
209 ldx [REG3 + %lo(__per_cpu_shift)], REG3; \
210 ldx [REG2 + %lo(__per_cpu_base)], REG2; \
211 sllx REG1, REG3, REG3; \
212 add REG3, REG2, DEST;
213
214#else
215
216#define TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
217 sethi %hi(trap_block), DEST; \
218 or DEST, %lo(trap_block), DEST; \
219
220/* Uniprocessor versions, we know the cpuid is zero. */
221#define TRAP_LOAD_PGD_PHYS(DEST, TMP) \
222 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
223 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
224
225/* Clobbers TMP, loads local processor's IRQ work area into DEST. */
226#define TRAP_LOAD_IRQ_WORK_PA(DEST, TMP) \
227 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
228 add DEST, TRAP_PER_CPU_IRQ_WORKLIST_PA, DEST;
229
230#define TRAP_LOAD_THREAD_REG(DEST, TMP) \
231 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
232 ldx [DEST + TRAP_PER_CPU_THREAD], DEST;
233
234/* No per-cpu areas on uniprocessor, so no need to load DEST. */
235#define LOAD_PER_CPU_BASE(DEST, THR, REG1, REG2, REG3)
236
237#endif /* !(CONFIG_SMP) */
238 43
239#endif /* _SPARC64_CPUDATA_H */ 44#endif /* _SPARC64_CPUDATA_H */
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h
index 0f4150e26619..204e4bf64438 100644
--- a/arch/sparc/include/asm/dma-mapping.h
+++ b/arch/sparc/include/asm/dma-mapping.h
@@ -1,8 +1,166 @@
1#ifndef ___ASM_SPARC_DMA_MAPPING_H 1#ifndef ___ASM_SPARC_DMA_MAPPING_H
2#define ___ASM_SPARC_DMA_MAPPING_H 2#define ___ASM_SPARC_DMA_MAPPING_H
3#if defined(__sparc__) && defined(__arch64__) 3
4#include <asm/dma-mapping_64.h> 4#include <linux/scatterlist.h>
5#else 5#include <linux/mm.h>
6#include <asm/dma-mapping_32.h> 6
7#endif 7#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
8
9extern int dma_supported(struct device *dev, u64 mask);
10extern int dma_set_mask(struct device *dev, u64 dma_mask);
11
12#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
13#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
14#define dma_is_consistent(d, h) (1)
15
16struct dma_ops {
17 void *(*alloc_coherent)(struct device *dev, size_t size,
18 dma_addr_t *dma_handle, gfp_t flag);
19 void (*free_coherent)(struct device *dev, size_t size,
20 void *cpu_addr, dma_addr_t dma_handle);
21 dma_addr_t (*map_page)(struct device *dev, struct page *page,
22 unsigned long offset, size_t size,
23 enum dma_data_direction direction);
24 void (*unmap_page)(struct device *dev, dma_addr_t dma_addr,
25 size_t size,
26 enum dma_data_direction direction);
27 int (*map_sg)(struct device *dev, struct scatterlist *sg, int nents,
28 enum dma_data_direction direction);
29 void (*unmap_sg)(struct device *dev, struct scatterlist *sg,
30 int nhwentries,
31 enum dma_data_direction direction);
32 void (*sync_single_for_cpu)(struct device *dev,
33 dma_addr_t dma_handle, size_t size,
34 enum dma_data_direction direction);
35 void (*sync_single_for_device)(struct device *dev,
36 dma_addr_t dma_handle, size_t size,
37 enum dma_data_direction direction);
38 void (*sync_sg_for_cpu)(struct device *dev, struct scatterlist *sg,
39 int nelems,
40 enum dma_data_direction direction);
41 void (*sync_sg_for_device)(struct device *dev,
42 struct scatterlist *sg, int nents,
43 enum dma_data_direction dir);
44};
45extern const struct dma_ops *dma_ops;
46
47static inline void *dma_alloc_coherent(struct device *dev, size_t size,
48 dma_addr_t *dma_handle, gfp_t flag)
49{
50 return dma_ops->alloc_coherent(dev, size, dma_handle, flag);
51}
52
53static inline void dma_free_coherent(struct device *dev, size_t size,
54 void *cpu_addr, dma_addr_t dma_handle)
55{
56 dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
57}
58
59static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
60 size_t size,
61 enum dma_data_direction direction)
62{
63 return dma_ops->map_page(dev, virt_to_page(cpu_addr),
64 (unsigned long)cpu_addr & ~PAGE_MASK, size,
65 direction);
66}
67
68static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
69 size_t size,
70 enum dma_data_direction direction)
71{
72 dma_ops->unmap_page(dev, dma_addr, size, direction);
73}
74
75static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
76 unsigned long offset, size_t size,
77 enum dma_data_direction direction)
78{
79 return dma_ops->map_page(dev, page, offset, size, direction);
80}
81
82static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
83 size_t size,
84 enum dma_data_direction direction)
85{
86 dma_ops->unmap_page(dev, dma_address, size, direction);
87}
88
89static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
90 int nents, enum dma_data_direction direction)
91{
92 return dma_ops->map_sg(dev, sg, nents, direction);
93}
94
95static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
96 int nents, enum dma_data_direction direction)
97{
98 dma_ops->unmap_sg(dev, sg, nents, direction);
99}
100
101static inline void dma_sync_single_for_cpu(struct device *dev,
102 dma_addr_t dma_handle, size_t size,
103 enum dma_data_direction direction)
104{
105 dma_ops->sync_single_for_cpu(dev, dma_handle, size, direction);
106}
107
108static inline void dma_sync_single_for_device(struct device *dev,
109 dma_addr_t dma_handle,
110 size_t size,
111 enum dma_data_direction direction)
112{
113 if (dma_ops->sync_single_for_device)
114 dma_ops->sync_single_for_device(dev, dma_handle, size,
115 direction);
116}
117
118static inline void dma_sync_sg_for_cpu(struct device *dev,
119 struct scatterlist *sg, int nelems,
120 enum dma_data_direction direction)
121{
122 dma_ops->sync_sg_for_cpu(dev, sg, nelems, direction);
123}
124
125static inline void dma_sync_sg_for_device(struct device *dev,
126 struct scatterlist *sg, int nelems,
127 enum dma_data_direction direction)
128{
129 if (dma_ops->sync_sg_for_device)
130 dma_ops->sync_sg_for_device(dev, sg, nelems, direction);
131}
132
133static inline void dma_sync_single_range_for_cpu(struct device *dev,
134 dma_addr_t dma_handle,
135 unsigned long offset,
136 size_t size,
137 enum dma_data_direction dir)
138{
139 dma_sync_single_for_cpu(dev, dma_handle+offset, size, dir);
140}
141
142static inline void dma_sync_single_range_for_device(struct device *dev,
143 dma_addr_t dma_handle,
144 unsigned long offset,
145 size_t size,
146 enum dma_data_direction dir)
147{
148 dma_sync_single_for_device(dev, dma_handle+offset, size, dir);
149}
150
151
152static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
153{
154 return (dma_addr == DMA_ERROR_CODE);
155}
156
157static inline int dma_get_cache_alignment(void)
158{
159 /*
160 * no easy way to get cache size on all processors, so return
161 * the maximum possible, to be safe
162 */
163 return (1 << INTERNODE_CACHE_SHIFT);
164}
165
8#endif 166#endif
diff --git a/arch/sparc/include/asm/dma-mapping_32.h b/arch/sparc/include/asm/dma-mapping_32.h
deleted file mode 100644
index 8a57ea0573e6..000000000000
--- a/arch/sparc/include/asm/dma-mapping_32.h
+++ /dev/null
@@ -1,60 +0,0 @@
1#ifndef _ASM_SPARC_DMA_MAPPING_H
2#define _ASM_SPARC_DMA_MAPPING_H
3
4#include <linux/types.h>
5
6struct device;
7struct scatterlist;
8struct page;
9
10#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
11
12extern int dma_supported(struct device *dev, u64 mask);
13extern int dma_set_mask(struct device *dev, u64 dma_mask);
14extern void *dma_alloc_coherent(struct device *dev, size_t size,
15 dma_addr_t *dma_handle, gfp_t flag);
16extern void dma_free_coherent(struct device *dev, size_t size,
17 void *cpu_addr, dma_addr_t dma_handle);
18extern dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
19 size_t size,
20 enum dma_data_direction direction);
21extern void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
22 size_t size,
23 enum dma_data_direction direction);
24extern dma_addr_t dma_map_page(struct device *dev, struct page *page,
25 unsigned long offset, size_t size,
26 enum dma_data_direction direction);
27extern void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
28 size_t size, enum dma_data_direction direction);
29extern int dma_map_sg(struct device *dev, struct scatterlist *sg,
30 int nents, enum dma_data_direction direction);
31extern void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
32 int nents, enum dma_data_direction direction);
33extern void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
34 size_t size,
35 enum dma_data_direction direction);
36extern void dma_sync_single_for_device(struct device *dev,
37 dma_addr_t dma_handle,
38 size_t size,
39 enum dma_data_direction direction);
40extern void dma_sync_single_range_for_cpu(struct device *dev,
41 dma_addr_t dma_handle,
42 unsigned long offset,
43 size_t size,
44 enum dma_data_direction direction);
45extern void dma_sync_single_range_for_device(struct device *dev,
46 dma_addr_t dma_handle,
47 unsigned long offset, size_t size,
48 enum dma_data_direction direction);
49extern void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
50 int nelems, enum dma_data_direction direction);
51extern void dma_sync_sg_for_device(struct device *dev,
52 struct scatterlist *sg, int nelems,
53 enum dma_data_direction direction);
54extern int dma_mapping_error(struct device *dev, dma_addr_t dma_addr);
55extern int dma_get_cache_alignment(void);
56
57#define dma_alloc_noncoherent dma_alloc_coherent
58#define dma_free_noncoherent dma_free_coherent
59
60#endif /* _ASM_SPARC_DMA_MAPPING_H */
diff --git a/arch/sparc/include/asm/dma-mapping_64.h b/arch/sparc/include/asm/dma-mapping_64.h
deleted file mode 100644
index bfa64f9702d5..000000000000
--- a/arch/sparc/include/asm/dma-mapping_64.h
+++ /dev/null
@@ -1,154 +0,0 @@
1#ifndef _ASM_SPARC64_DMA_MAPPING_H
2#define _ASM_SPARC64_DMA_MAPPING_H
3
4#include <linux/scatterlist.h>
5#include <linux/mm.h>
6
7#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
8
9struct dma_ops {
10 void *(*alloc_coherent)(struct device *dev, size_t size,
11 dma_addr_t *dma_handle, gfp_t flag);
12 void (*free_coherent)(struct device *dev, size_t size,
13 void *cpu_addr, dma_addr_t dma_handle);
14 dma_addr_t (*map_single)(struct device *dev, void *cpu_addr,
15 size_t size,
16 enum dma_data_direction direction);
17 void (*unmap_single)(struct device *dev, dma_addr_t dma_addr,
18 size_t size,
19 enum dma_data_direction direction);
20 int (*map_sg)(struct device *dev, struct scatterlist *sg, int nents,
21 enum dma_data_direction direction);
22 void (*unmap_sg)(struct device *dev, struct scatterlist *sg,
23 int nhwentries,
24 enum dma_data_direction direction);
25 void (*sync_single_for_cpu)(struct device *dev,
26 dma_addr_t dma_handle, size_t size,
27 enum dma_data_direction direction);
28 void (*sync_sg_for_cpu)(struct device *dev, struct scatterlist *sg,
29 int nelems,
30 enum dma_data_direction direction);
31};
32extern const struct dma_ops *dma_ops;
33
34extern int dma_supported(struct device *dev, u64 mask);
35extern int dma_set_mask(struct device *dev, u64 dma_mask);
36
37static inline void *dma_alloc_coherent(struct device *dev, size_t size,
38 dma_addr_t *dma_handle, gfp_t flag)
39{
40 return dma_ops->alloc_coherent(dev, size, dma_handle, flag);
41}
42
43static inline void dma_free_coherent(struct device *dev, size_t size,
44 void *cpu_addr, dma_addr_t dma_handle)
45{
46 dma_ops->free_coherent(dev, size, cpu_addr, dma_handle);
47}
48
49static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
50 size_t size,
51 enum dma_data_direction direction)
52{
53 return dma_ops->map_single(dev, cpu_addr, size, direction);
54}
55
56static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
57 size_t size,
58 enum dma_data_direction direction)
59{
60 dma_ops->unmap_single(dev, dma_addr, size, direction);
61}
62
63static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
64 unsigned long offset, size_t size,
65 enum dma_data_direction direction)
66{
67 return dma_ops->map_single(dev, page_address(page) + offset,
68 size, direction);
69}
70
71static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
72 size_t size,
73 enum dma_data_direction direction)
74{
75 dma_ops->unmap_single(dev, dma_address, size, direction);
76}
77
78static inline int dma_map_sg(struct device *dev, struct scatterlist *sg,
79 int nents, enum dma_data_direction direction)
80{
81 return dma_ops->map_sg(dev, sg, nents, direction);
82}
83
84static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
85 int nents, enum dma_data_direction direction)
86{
87 dma_ops->unmap_sg(dev, sg, nents, direction);
88}
89
90static inline void dma_sync_single_for_cpu(struct device *dev,
91 dma_addr_t dma_handle, size_t size,
92 enum dma_data_direction direction)
93{
94 dma_ops->sync_single_for_cpu(dev, dma_handle, size, direction);
95}
96
97static inline void dma_sync_single_for_device(struct device *dev,
98 dma_addr_t dma_handle,
99 size_t size,
100 enum dma_data_direction direction)
101{
102 /* No flushing needed to sync cpu writes to the device. */
103}
104
105static inline void dma_sync_single_range_for_cpu(struct device *dev,
106 dma_addr_t dma_handle,
107 unsigned long offset,
108 size_t size,
109 enum dma_data_direction direction)
110{
111 dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
112}
113
114static inline void dma_sync_single_range_for_device(struct device *dev,
115 dma_addr_t dma_handle,
116 unsigned long offset,
117 size_t size,
118 enum dma_data_direction direction)
119{
120 /* No flushing needed to sync cpu writes to the device. */
121}
122
123
124static inline void dma_sync_sg_for_cpu(struct device *dev,
125 struct scatterlist *sg, int nelems,
126 enum dma_data_direction direction)
127{
128 dma_ops->sync_sg_for_cpu(dev, sg, nelems, direction);
129}
130
131static inline void dma_sync_sg_for_device(struct device *dev,
132 struct scatterlist *sg, int nelems,
133 enum dma_data_direction direction)
134{
135 /* No flushing needed to sync cpu writes to the device. */
136}
137
138static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
139{
140 return (dma_addr == DMA_ERROR_CODE);
141}
142
143static inline int dma_get_cache_alignment(void)
144{
145 /* no easy way to get cache size on all processors, so return
146 * the maximum possible, to be safe */
147 return (1 << INTERNODE_CACHE_SHIFT);
148}
149
150#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
151#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
152#define dma_is_consistent(d, h) (1)
153
154#endif /* _ASM_SPARC64_DMA_MAPPING_H */
diff --git a/arch/sparc/include/asm/errno.h b/arch/sparc/include/asm/errno.h
index a9ef172977de..4e2bc490d714 100644
--- a/arch/sparc/include/asm/errno.h
+++ b/arch/sparc/include/asm/errno.h
@@ -110,4 +110,6 @@
110#define EOWNERDEAD 132 /* Owner died */ 110#define EOWNERDEAD 132 /* Owner died */
111#define ENOTRECOVERABLE 133 /* State not recoverable */ 111#define ENOTRECOVERABLE 133 /* State not recoverable */
112 112
113#define ERFKILL 134 /* Operation not possible due to RF-kill */
114
113#endif 115#endif
diff --git a/arch/sparc/include/asm/ftrace.h b/arch/sparc/include/asm/ftrace.h
index d27716cd38c1..b0f18e9893db 100644
--- a/arch/sparc/include/asm/ftrace.h
+++ b/arch/sparc/include/asm/ftrace.h
@@ -11,4 +11,15 @@ extern void _mcount(void);
11 11
12#endif 12#endif
13 13
14#ifdef CONFIG_DYNAMIC_FTRACE
15/* reloction of mcount call site is the same as the address */
16static inline unsigned long ftrace_call_adjust(unsigned long addr)
17{
18 return addr;
19}
20
21struct dyn_arch_ftrace {
22};
23#endif /* CONFIG_DYNAMIC_FTRACE */
24
14#endif /* _ASM_SPARC64_FTRACE */ 25#endif /* _ASM_SPARC64_FTRACE */
diff --git a/arch/sparc/include/asm/kmap_types.h b/arch/sparc/include/asm/kmap_types.h
index 602f5e034f7a..aad21745fbb9 100644
--- a/arch/sparc/include/asm/kmap_types.h
+++ b/arch/sparc/include/asm/kmap_types.h
@@ -5,21 +5,6 @@
5 * is actually used on sparc. -DaveM 5 * is actually used on sparc. -DaveM
6 */ 6 */
7 7
8enum km_type { 8#include <asm-generic/kmap_types.h>
9 KM_BOUNCE_READ,
10 KM_SKB_SUNRPC_DATA,
11 KM_SKB_DATA_SOFTIRQ,
12 KM_USER0,
13 KM_USER1,
14 KM_BIO_SRC_IRQ,
15 KM_BIO_DST_IRQ,
16 KM_PTE0,
17 KM_PTE1,
18 KM_IRQ0,
19 KM_IRQ1,
20 KM_SOFTIRQ0,
21 KM_SOFTIRQ1,
22 KM_TYPE_NR
23};
24 9
25#endif 10#endif
diff --git a/arch/sparc/include/asm/mdesc.h b/arch/sparc/include/asm/mdesc.h
index 1acc7272e537..9faa046713fb 100644
--- a/arch/sparc/include/asm/mdesc.h
+++ b/arch/sparc/include/asm/mdesc.h
@@ -71,7 +71,8 @@ struct mdesc_notifier_client {
71 71
72extern void mdesc_register_notifier(struct mdesc_notifier_client *client); 72extern void mdesc_register_notifier(struct mdesc_notifier_client *client);
73 73
74extern void mdesc_fill_in_cpu_data(cpumask_t mask); 74extern void mdesc_fill_in_cpu_data(cpumask_t *mask);
75extern void mdesc_populate_present_mask(cpumask_t *mask);
75 76
76extern void sun4v_mdesc_init(void); 77extern void sun4v_mdesc_init(void);
77 78
diff --git a/arch/sparc/include/asm/percpu_64.h b/arch/sparc/include/asm/percpu_64.h
index bee64593023e..007aafb4ae97 100644
--- a/arch/sparc/include/asm/percpu_64.h
+++ b/arch/sparc/include/asm/percpu_64.h
@@ -7,20 +7,16 @@ register unsigned long __local_per_cpu_offset asm("g5");
7 7
8#ifdef CONFIG_SMP 8#ifdef CONFIG_SMP
9 9
10extern void real_setup_per_cpu_areas(void); 10#include <asm/trap_block.h>
11 11
12extern unsigned long __per_cpu_base;
13extern unsigned long __per_cpu_shift;
14#define __per_cpu_offset(__cpu) \ 12#define __per_cpu_offset(__cpu) \
15 (__per_cpu_base + ((unsigned long)(__cpu) << __per_cpu_shift)) 13 (trap_block[(__cpu)].__per_cpu_base)
16#define per_cpu_offset(x) (__per_cpu_offset(x)) 14#define per_cpu_offset(x) (__per_cpu_offset(x))
17 15
18#define __my_cpu_offset __local_per_cpu_offset 16#define __my_cpu_offset __local_per_cpu_offset
19 17
20#else /* ! SMP */ 18#else /* ! SMP */
21 19
22#define real_setup_per_cpu_areas() do { } while (0)
23
24#endif /* SMP */ 20#endif /* SMP */
25 21
26#include <asm-generic/percpu.h> 22#include <asm-generic/percpu.h>
diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h
index 900d44714f8d..be8d7aaeb60d 100644
--- a/arch/sparc/include/asm/prom.h
+++ b/arch/sparc/include/asm/prom.h
@@ -86,6 +86,8 @@ extern int of_node_to_nid(struct device_node *dp);
86#endif 86#endif
87 87
88extern void prom_build_devicetree(void); 88extern void prom_build_devicetree(void);
89extern void of_populate_present_mask(void);
90extern void of_fill_in_cpu_data(void);
89 91
90/* Dummy ref counting routines - to be implemented later */ 92/* Dummy ref counting routines - to be implemented later */
91static inline struct device_node *of_node_get(struct device_node *node) 93static inline struct device_node *of_node_get(struct device_node *node)
diff --git a/arch/sparc/include/asm/trap_block.h b/arch/sparc/include/asm/trap_block.h
new file mode 100644
index 000000000000..7e26b2db6211
--- /dev/null
+++ b/arch/sparc/include/asm/trap_block.h
@@ -0,0 +1,207 @@
1#ifndef _SPARC_TRAP_BLOCK_H
2#define _SPARC_TRAP_BLOCK_H
3
4#include <asm/hypervisor.h>
5#include <asm/asi.h>
6
7#ifndef __ASSEMBLY__
8
9/* Trap handling code needs to get at a few critical values upon
10 * trap entry and to process TSB misses. These cannot be in the
11 * per_cpu() area as we really need to lock them into the TLB and
12 * thus make them part of the main kernel image. As a result we
13 * try to make this as small as possible.
14 *
15 * This is padded out and aligned to 64-bytes to avoid false sharing
16 * on SMP.
17 */
18
19/* If you modify the size of this structure, please update
20 * TRAP_BLOCK_SZ_SHIFT below.
21 */
22struct thread_info;
23struct trap_per_cpu {
24/* D-cache line 1: Basic thread information, cpu and device mondo queues */
25 struct thread_info *thread;
26 unsigned long pgd_paddr;
27 unsigned long cpu_mondo_pa;
28 unsigned long dev_mondo_pa;
29
30/* D-cache line 2: Error Mondo Queue and kernel buffer pointers */
31 unsigned long resum_mondo_pa;
32 unsigned long resum_kernel_buf_pa;
33 unsigned long nonresum_mondo_pa;
34 unsigned long nonresum_kernel_buf_pa;
35
36/* Dcache lines 3, 4, 5, and 6: Hypervisor Fault Status */
37 struct hv_fault_status fault_info;
38
39/* Dcache line 7: Physical addresses of CPU send mondo block and CPU list. */
40 unsigned long cpu_mondo_block_pa;
41 unsigned long cpu_list_pa;
42 unsigned long tsb_huge;
43 unsigned long tsb_huge_temp;
44
45/* Dcache line 8: IRQ work list, and keep trap_block a power-of-2 in size. */
46 unsigned long irq_worklist_pa;
47 unsigned int cpu_mondo_qmask;
48 unsigned int dev_mondo_qmask;
49 unsigned int resum_qmask;
50 unsigned int nonresum_qmask;
51 unsigned long __per_cpu_base;
52} __attribute__((aligned(64)));
53extern struct trap_per_cpu trap_block[NR_CPUS];
54extern void init_cur_cpu_trap(struct thread_info *);
55extern void setup_tba(void);
56extern int ncpus_probed;
57
58extern unsigned long real_hard_smp_processor_id(void);
59
60struct cpuid_patch_entry {
61 unsigned int addr;
62 unsigned int cheetah_safari[4];
63 unsigned int cheetah_jbus[4];
64 unsigned int starfire[4];
65 unsigned int sun4v[4];
66};
67extern struct cpuid_patch_entry __cpuid_patch, __cpuid_patch_end;
68
69struct sun4v_1insn_patch_entry {
70 unsigned int addr;
71 unsigned int insn;
72};
73extern struct sun4v_1insn_patch_entry __sun4v_1insn_patch,
74 __sun4v_1insn_patch_end;
75
76struct sun4v_2insn_patch_entry {
77 unsigned int addr;
78 unsigned int insns[2];
79};
80extern struct sun4v_2insn_patch_entry __sun4v_2insn_patch,
81 __sun4v_2insn_patch_end;
82
83
84#endif /* !(__ASSEMBLY__) */
85
86#define TRAP_PER_CPU_THREAD 0x00
87#define TRAP_PER_CPU_PGD_PADDR 0x08
88#define TRAP_PER_CPU_CPU_MONDO_PA 0x10
89#define TRAP_PER_CPU_DEV_MONDO_PA 0x18
90#define TRAP_PER_CPU_RESUM_MONDO_PA 0x20
91#define TRAP_PER_CPU_RESUM_KBUF_PA 0x28
92#define TRAP_PER_CPU_NONRESUM_MONDO_PA 0x30
93#define TRAP_PER_CPU_NONRESUM_KBUF_PA 0x38
94#define TRAP_PER_CPU_FAULT_INFO 0x40
95#define TRAP_PER_CPU_CPU_MONDO_BLOCK_PA 0xc0
96#define TRAP_PER_CPU_CPU_LIST_PA 0xc8
97#define TRAP_PER_CPU_TSB_HUGE 0xd0
98#define TRAP_PER_CPU_TSB_HUGE_TEMP 0xd8
99#define TRAP_PER_CPU_IRQ_WORKLIST_PA 0xe0
100#define TRAP_PER_CPU_CPU_MONDO_QMASK 0xe8
101#define TRAP_PER_CPU_DEV_MONDO_QMASK 0xec
102#define TRAP_PER_CPU_RESUM_QMASK 0xf0
103#define TRAP_PER_CPU_NONRESUM_QMASK 0xf4
104#define TRAP_PER_CPU_PER_CPU_BASE 0xf8
105
106#define TRAP_BLOCK_SZ_SHIFT 8
107
108#include <asm/scratchpad.h>
109
110#define __GET_CPUID(REG) \
111 /* Spitfire implementation (default). */ \
112661: ldxa [%g0] ASI_UPA_CONFIG, REG; \
113 srlx REG, 17, REG; \
114 and REG, 0x1f, REG; \
115 nop; \
116 .section .cpuid_patch, "ax"; \
117 /* Instruction location. */ \
118 .word 661b; \
119 /* Cheetah Safari implementation. */ \
120 ldxa [%g0] ASI_SAFARI_CONFIG, REG; \
121 srlx REG, 17, REG; \
122 and REG, 0x3ff, REG; \
123 nop; \
124 /* Cheetah JBUS implementation. */ \
125 ldxa [%g0] ASI_JBUS_CONFIG, REG; \
126 srlx REG, 17, REG; \
127 and REG, 0x1f, REG; \
128 nop; \
129 /* Starfire implementation. */ \
130 sethi %hi(0x1fff40000d0 >> 9), REG; \
131 sllx REG, 9, REG; \
132 or REG, 0xd0, REG; \
133 lduwa [REG] ASI_PHYS_BYPASS_EC_E, REG;\
134 /* sun4v implementation. */ \
135 mov SCRATCHPAD_CPUID, REG; \
136 ldxa [REG] ASI_SCRATCHPAD, REG; \
137 nop; \
138 nop; \
139 .previous;
140
141#ifdef CONFIG_SMP
142
143#define TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
144 __GET_CPUID(TMP) \
145 sethi %hi(trap_block), DEST; \
146 sllx TMP, TRAP_BLOCK_SZ_SHIFT, TMP; \
147 or DEST, %lo(trap_block), DEST; \
148 add DEST, TMP, DEST; \
149
150/* Clobbers TMP, current address space PGD phys address into DEST. */
151#define TRAP_LOAD_PGD_PHYS(DEST, TMP) \
152 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
153 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
154
155/* Clobbers TMP, loads local processor's IRQ work area into DEST. */
156#define TRAP_LOAD_IRQ_WORK_PA(DEST, TMP) \
157 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
158 add DEST, TRAP_PER_CPU_IRQ_WORKLIST_PA, DEST;
159
160/* Clobbers TMP, loads DEST with current thread info pointer. */
161#define TRAP_LOAD_THREAD_REG(DEST, TMP) \
162 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
163 ldx [DEST + TRAP_PER_CPU_THREAD], DEST;
164
165/* Given the current thread info pointer in THR, load the per-cpu
166 * area base of the current processor into DEST. REG1, REG2, and REG3 are
167 * clobbered.
168 *
169 * You absolutely cannot use DEST as a temporary in this code. The
170 * reason is that traps can happen during execution, and return from
171 * trap will load the fully resolved DEST per-cpu base. This can corrupt
172 * the calculations done by the macro mid-stream.
173 */
174#define LOAD_PER_CPU_BASE(DEST, THR, REG1, REG2, REG3) \
175 lduh [THR + TI_CPU], REG1; \
176 sethi %hi(trap_block), REG2; \
177 sllx REG1, TRAP_BLOCK_SZ_SHIFT, REG1; \
178 or REG2, %lo(trap_block), REG2; \
179 add REG2, REG1, REG2; \
180 ldx [REG2 + TRAP_PER_CPU_PER_CPU_BASE], DEST;
181
182#else
183
184#define TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
185 sethi %hi(trap_block), DEST; \
186 or DEST, %lo(trap_block), DEST; \
187
188/* Uniprocessor versions, we know the cpuid is zero. */
189#define TRAP_LOAD_PGD_PHYS(DEST, TMP) \
190 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
191 ldx [DEST + TRAP_PER_CPU_PGD_PADDR], DEST;
192
193/* Clobbers TMP, loads local processor's IRQ work area into DEST. */
194#define TRAP_LOAD_IRQ_WORK_PA(DEST, TMP) \
195 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
196 add DEST, TRAP_PER_CPU_IRQ_WORKLIST_PA, DEST;
197
198#define TRAP_LOAD_THREAD_REG(DEST, TMP) \
199 TRAP_LOAD_TRAP_BLOCK(DEST, TMP) \
200 ldx [DEST + TRAP_PER_CPU_THREAD], DEST;
201
202/* No per-cpu areas on uniprocessor, so no need to load DEST. */
203#define LOAD_PER_CPU_BASE(DEST, THR, REG1, REG2, REG3)
204
205#endif /* !(CONFIG_SMP) */
206
207#endif /* _SPARC_TRAP_BLOCK_H */
diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h
index b8eb71ef3163..b2c406de7d4f 100644
--- a/arch/sparc/include/asm/unistd.h
+++ b/arch/sparc/include/asm/unistd.h
@@ -394,8 +394,9 @@
394#define __NR_accept4 323 394#define __NR_accept4 323
395#define __NR_preadv 324 395#define __NR_preadv 324
396#define __NR_pwritev 325 396#define __NR_pwritev 325
397#define __NR_rt_tgsigqueueinfo 326
397 398
398#define NR_SYSCALLS 326 399#define NR_SYSCALLS 327
399 400
400#ifdef __32bit_syscall_numbers__ 401#ifdef __32bit_syscall_numbers__
401/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, 402/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants,
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
index 54742e58831c..475ce4696acd 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -37,6 +37,7 @@ obj-y += una_asm_$(BITS).o
37obj-$(CONFIG_SPARC32) += muldiv.o 37obj-$(CONFIG_SPARC32) += muldiv.o
38obj-y += prom_common.o 38obj-y += prom_common.o
39obj-y += prom_$(BITS).o 39obj-y += prom_$(BITS).o
40obj-y += of_device_common.o
40obj-y += of_device_$(BITS).o 41obj-y += of_device_$(BITS).o
41obj-$(CONFIG_SPARC64) += prom_irqtrans.o 42obj-$(CONFIG_SPARC64) += prom_irqtrans.o
42 43
@@ -54,6 +55,7 @@ obj-$(CONFIG_SPARC64) += sstate.o
54obj-$(CONFIG_SPARC64) += mdesc.o 55obj-$(CONFIG_SPARC64) += mdesc.o
55obj-$(CONFIG_SPARC64) += pcr.o 56obj-$(CONFIG_SPARC64) += pcr.o
56obj-$(CONFIG_SPARC64) += nmi.o 57obj-$(CONFIG_SPARC64) += nmi.o
58obj-$(CONFIG_SPARC64_SMP) += cpumap.o
57 59
58# sparc32 do not use GENERIC_HARDIRQS but uses the generic devres implementation 60# sparc32 do not use GENERIC_HARDIRQS but uses the generic devres implementation
59obj-$(CONFIG_SPARC32) += devres.o 61obj-$(CONFIG_SPARC32) += devres.o
diff --git a/arch/sparc/kernel/cpumap.c b/arch/sparc/kernel/cpumap.c
new file mode 100644
index 000000000000..7430ed080b23
--- /dev/null
+++ b/arch/sparc/kernel/cpumap.c
@@ -0,0 +1,431 @@
1/* cpumap.c: used for optimizing CPU assignment
2 *
3 * Copyright (C) 2009 Hong H. Pham <hong.pham@windriver.com>
4 */
5
6#include <linux/module.h>
7#include <linux/kernel.h>
8#include <linux/init.h>
9#include <linux/cpumask.h>
10#include <linux/spinlock.h>
11#include <asm/cpudata.h>
12#include "cpumap.h"
13
14
15enum {
16 CPUINFO_LVL_ROOT = 0,
17 CPUINFO_LVL_NODE,
18 CPUINFO_LVL_CORE,
19 CPUINFO_LVL_PROC,
20 CPUINFO_LVL_MAX,
21};
22
23enum {
24 ROVER_NO_OP = 0,
25 /* Increment rover every time level is visited */
26 ROVER_INC_ON_VISIT = 1 << 0,
27 /* Increment parent's rover every time rover wraps around */
28 ROVER_INC_PARENT_ON_LOOP = 1 << 1,
29};
30
31struct cpuinfo_node {
32 int id;
33 int level;
34 int num_cpus; /* Number of CPUs in this hierarchy */
35 int parent_index;
36 int child_start; /* Array index of the first child node */
37 int child_end; /* Array index of the last child node */
38 int rover; /* Child node iterator */
39};
40
41struct cpuinfo_level {
42 int start_index; /* Index of first node of a level in a cpuinfo tree */
43 int end_index; /* Index of last node of a level in a cpuinfo tree */
44 int num_nodes; /* Number of nodes in a level in a cpuinfo tree */
45};
46
47struct cpuinfo_tree {
48 int total_nodes;
49
50 /* Offsets into nodes[] for each level of the tree */
51 struct cpuinfo_level level[CPUINFO_LVL_MAX];
52 struct cpuinfo_node nodes[0];
53};
54
55
56static struct cpuinfo_tree *cpuinfo_tree;
57
58static u16 cpu_distribution_map[NR_CPUS];
59static DEFINE_SPINLOCK(cpu_map_lock);
60
61
62/* Niagara optimized cpuinfo tree traversal. */
63static const int niagara_iterate_method[] = {
64 [CPUINFO_LVL_ROOT] = ROVER_NO_OP,
65
66 /* Strands (or virtual CPUs) within a core may not run concurrently
67 * on the Niagara, as instruction pipeline(s) are shared. Distribute
68 * work to strands in different cores first for better concurrency.
69 * Go to next NUMA node when all cores are used.
70 */
71 [CPUINFO_LVL_NODE] = ROVER_INC_ON_VISIT|ROVER_INC_PARENT_ON_LOOP,
72
73 /* Strands are grouped together by proc_id in cpuinfo_sparc, i.e.
74 * a proc_id represents an instruction pipeline. Distribute work to
75 * strands in different proc_id groups if the core has multiple
76 * instruction pipelines (e.g. the Niagara 2/2+ has two).
77 */
78 [CPUINFO_LVL_CORE] = ROVER_INC_ON_VISIT,
79
80 /* Pick the next strand in the proc_id group. */
81 [CPUINFO_LVL_PROC] = ROVER_INC_ON_VISIT,
82};
83
84/* Generic cpuinfo tree traversal. Distribute work round robin across NUMA
85 * nodes.
86 */
87static const int generic_iterate_method[] = {
88 [CPUINFO_LVL_ROOT] = ROVER_INC_ON_VISIT,
89 [CPUINFO_LVL_NODE] = ROVER_NO_OP,
90 [CPUINFO_LVL_CORE] = ROVER_INC_PARENT_ON_LOOP,
91 [CPUINFO_LVL_PROC] = ROVER_INC_ON_VISIT|ROVER_INC_PARENT_ON_LOOP,
92};
93
94
95static int cpuinfo_id(int cpu, int level)
96{
97 int id;
98
99 switch (level) {
100 case CPUINFO_LVL_ROOT:
101 id = 0;
102 break;
103 case CPUINFO_LVL_NODE:
104 id = cpu_to_node(cpu);
105 break;
106 case CPUINFO_LVL_CORE:
107 id = cpu_data(cpu).core_id;
108 break;
109 case CPUINFO_LVL_PROC:
110 id = cpu_data(cpu).proc_id;
111 break;
112 default:
113 id = -EINVAL;
114 }
115 return id;
116}
117
118/*
119 * Enumerate the CPU information in __cpu_data to determine the start index,
120 * end index, and number of nodes for each level in the cpuinfo tree. The
121 * total number of cpuinfo nodes required to build the tree is returned.
122 */
123static int enumerate_cpuinfo_nodes(struct cpuinfo_level *tree_level)
124{
125 int prev_id[CPUINFO_LVL_MAX];
126 int i, n, num_nodes;
127
128 for (i = CPUINFO_LVL_ROOT; i < CPUINFO_LVL_MAX; i++) {
129 struct cpuinfo_level *lv = &tree_level[i];
130
131 prev_id[i] = -1;
132 lv->start_index = lv->end_index = lv->num_nodes = 0;
133 }
134
135 num_nodes = 1; /* Include the root node */
136
137 for (i = 0; i < num_possible_cpus(); i++) {
138 if (!cpu_online(i))
139 continue;
140
141 n = cpuinfo_id(i, CPUINFO_LVL_NODE);
142 if (n > prev_id[CPUINFO_LVL_NODE]) {
143 tree_level[CPUINFO_LVL_NODE].num_nodes++;
144 prev_id[CPUINFO_LVL_NODE] = n;
145 num_nodes++;
146 }
147 n = cpuinfo_id(i, CPUINFO_LVL_CORE);
148 if (n > prev_id[CPUINFO_LVL_CORE]) {
149 tree_level[CPUINFO_LVL_CORE].num_nodes++;
150 prev_id[CPUINFO_LVL_CORE] = n;
151 num_nodes++;
152 }
153 n = cpuinfo_id(i, CPUINFO_LVL_PROC);
154 if (n > prev_id[CPUINFO_LVL_PROC]) {
155 tree_level[CPUINFO_LVL_PROC].num_nodes++;
156 prev_id[CPUINFO_LVL_PROC] = n;
157 num_nodes++;
158 }
159 }
160
161 tree_level[CPUINFO_LVL_ROOT].num_nodes = 1;
162
163 n = tree_level[CPUINFO_LVL_NODE].num_nodes;
164 tree_level[CPUINFO_LVL_NODE].start_index = 1;
165 tree_level[CPUINFO_LVL_NODE].end_index = n;
166
167 n++;
168 tree_level[CPUINFO_LVL_CORE].start_index = n;
169 n += tree_level[CPUINFO_LVL_CORE].num_nodes;
170 tree_level[CPUINFO_LVL_CORE].end_index = n - 1;
171
172 tree_level[CPUINFO_LVL_PROC].start_index = n;
173 n += tree_level[CPUINFO_LVL_PROC].num_nodes;
174 tree_level[CPUINFO_LVL_PROC].end_index = n - 1;
175
176 return num_nodes;
177}
178
179/* Build a tree representation of the CPU hierarchy using the per CPU
180 * information in __cpu_data. Entries in __cpu_data[0..NR_CPUS] are
181 * assumed to be sorted in ascending order based on node, core_id, and
182 * proc_id (in order of significance).
183 */
184static struct cpuinfo_tree *build_cpuinfo_tree(void)
185{
186 struct cpuinfo_tree *new_tree;
187 struct cpuinfo_node *node;
188 struct cpuinfo_level tmp_level[CPUINFO_LVL_MAX];
189 int num_cpus[CPUINFO_LVL_MAX];
190 int level_rover[CPUINFO_LVL_MAX];
191 int prev_id[CPUINFO_LVL_MAX];
192 int n, id, cpu, prev_cpu, last_cpu, level;
193
194 n = enumerate_cpuinfo_nodes(tmp_level);
195
196 new_tree = kzalloc(sizeof(struct cpuinfo_tree) +
197 (sizeof(struct cpuinfo_node) * n), GFP_ATOMIC);
198 if (!new_tree)
199 return NULL;
200
201 new_tree->total_nodes = n;
202 memcpy(&new_tree->level, tmp_level, sizeof(tmp_level));
203
204 prev_cpu = cpu = first_cpu(cpu_online_map);
205
206 /* Initialize all levels in the tree with the first CPU */
207 for (level = CPUINFO_LVL_PROC; level >= CPUINFO_LVL_ROOT; level--) {
208 n = new_tree->level[level].start_index;
209
210 level_rover[level] = n;
211 node = &new_tree->nodes[n];
212
213 id = cpuinfo_id(cpu, level);
214 if (unlikely(id < 0)) {
215 kfree(new_tree);
216 return NULL;
217 }
218 node->id = id;
219 node->level = level;
220 node->num_cpus = 1;
221
222 node->parent_index = (level > CPUINFO_LVL_ROOT)
223 ? new_tree->level[level - 1].start_index : -1;
224
225 node->child_start = node->child_end = node->rover =
226 (level == CPUINFO_LVL_PROC)
227 ? cpu : new_tree->level[level + 1].start_index;
228
229 prev_id[level] = node->id;
230 num_cpus[level] = 1;
231 }
232
233 for (last_cpu = (num_possible_cpus() - 1); last_cpu >= 0; last_cpu--) {
234 if (cpu_online(last_cpu))
235 break;
236 }
237
238 while (++cpu <= last_cpu) {
239 if (!cpu_online(cpu))
240 continue;
241
242 for (level = CPUINFO_LVL_PROC; level >= CPUINFO_LVL_ROOT;
243 level--) {
244 id = cpuinfo_id(cpu, level);
245 if (unlikely(id < 0)) {
246 kfree(new_tree);
247 return NULL;
248 }
249
250 if ((id != prev_id[level]) || (cpu == last_cpu)) {
251 prev_id[level] = id;
252 node = &new_tree->nodes[level_rover[level]];
253 node->num_cpus = num_cpus[level];
254 num_cpus[level] = 1;
255
256 if (cpu == last_cpu)
257 node->num_cpus++;
258
259 /* Connect tree node to parent */
260 if (level == CPUINFO_LVL_ROOT)
261 node->parent_index = -1;
262 else
263 node->parent_index =
264 level_rover[level - 1];
265
266 if (level == CPUINFO_LVL_PROC) {
267 node->child_end =
268 (cpu == last_cpu) ? cpu : prev_cpu;
269 } else {
270 node->child_end =
271 level_rover[level + 1] - 1;
272 }
273
274 /* Initialize the next node in the same level */
275 n = ++level_rover[level];
276 if (n <= new_tree->level[level].end_index) {
277 node = &new_tree->nodes[n];
278 node->id = id;
279 node->level = level;
280
281 /* Connect node to child */
282 node->child_start = node->child_end =
283 node->rover =
284 (level == CPUINFO_LVL_PROC)
285 ? cpu : level_rover[level + 1];
286 }
287 } else
288 num_cpus[level]++;
289 }
290 prev_cpu = cpu;
291 }
292
293 return new_tree;
294}
295
296static void increment_rover(struct cpuinfo_tree *t, int node_index,
297 int root_index, const int *rover_inc_table)
298{
299 struct cpuinfo_node *node = &t->nodes[node_index];
300 int top_level, level;
301
302 top_level = t->nodes[root_index].level;
303 for (level = node->level; level >= top_level; level--) {
304 node->rover++;
305 if (node->rover <= node->child_end)
306 return;
307
308 node->rover = node->child_start;
309 /* If parent's rover does not need to be adjusted, stop here. */
310 if ((level == top_level) ||
311 !(rover_inc_table[level] & ROVER_INC_PARENT_ON_LOOP))
312 return;
313
314 node = &t->nodes[node->parent_index];
315 }
316}
317
318static int iterate_cpu(struct cpuinfo_tree *t, unsigned int root_index)
319{
320 const int *rover_inc_table;
321 int level, new_index, index = root_index;
322
323 switch (sun4v_chip_type) {
324 case SUN4V_CHIP_NIAGARA1:
325 case SUN4V_CHIP_NIAGARA2:
326 rover_inc_table = niagara_iterate_method;
327 break;
328 default:
329 rover_inc_table = generic_iterate_method;
330 }
331
332 for (level = t->nodes[root_index].level; level < CPUINFO_LVL_MAX;
333 level++) {
334 new_index = t->nodes[index].rover;
335 if (rover_inc_table[level] & ROVER_INC_ON_VISIT)
336 increment_rover(t, index, root_index, rover_inc_table);
337
338 index = new_index;
339 }
340 return index;
341}
342
343static void _cpu_map_rebuild(void)
344{
345 int i;
346
347 if (cpuinfo_tree) {
348 kfree(cpuinfo_tree);
349 cpuinfo_tree = NULL;
350 }
351
352 cpuinfo_tree = build_cpuinfo_tree();
353 if (!cpuinfo_tree)
354 return;
355
356 /* Build CPU distribution map that spans all online CPUs. No need
357 * to check if the CPU is online, as that is done when the cpuinfo
358 * tree is being built.
359 */
360 for (i = 0; i < cpuinfo_tree->nodes[0].num_cpus; i++)
361 cpu_distribution_map[i] = iterate_cpu(cpuinfo_tree, 0);
362}
363
364/* Fallback if the cpuinfo tree could not be built. CPU mapping is linear
365 * round robin.
366 */
367static int simple_map_to_cpu(unsigned int index)
368{
369 int i, end, cpu_rover;
370
371 cpu_rover = 0;
372 end = index % num_online_cpus();
373 for (i = 0; i < num_possible_cpus(); i++) {
374 if (cpu_online(cpu_rover)) {
375 if (cpu_rover >= end)
376 return cpu_rover;
377
378 cpu_rover++;
379 }
380 }
381
382 /* Impossible, since num_online_cpus() <= num_possible_cpus() */
383 return first_cpu(cpu_online_map);
384}
385
386static int _map_to_cpu(unsigned int index)
387{
388 struct cpuinfo_node *root_node;
389
390 if (unlikely(!cpuinfo_tree)) {
391 _cpu_map_rebuild();
392 if (!cpuinfo_tree)
393 return simple_map_to_cpu(index);
394 }
395
396 root_node = &cpuinfo_tree->nodes[0];
397#ifdef CONFIG_HOTPLUG_CPU
398 if (unlikely(root_node->num_cpus != num_online_cpus())) {
399 _cpu_map_rebuild();
400 if (!cpuinfo_tree)
401 return simple_map_to_cpu(index);
402 }
403#endif
404 return cpu_distribution_map[index % root_node->num_cpus];
405}
406
407int map_to_cpu(unsigned int index)
408{
409 int mapped_cpu;
410 unsigned long flag;
411
412 spin_lock_irqsave(&cpu_map_lock, flag);
413 mapped_cpu = _map_to_cpu(index);
414
415#ifdef CONFIG_HOTPLUG_CPU
416 while (unlikely(!cpu_online(mapped_cpu)))
417 mapped_cpu = _map_to_cpu(index);
418#endif
419 spin_unlock_irqrestore(&cpu_map_lock, flag);
420 return mapped_cpu;
421}
422EXPORT_SYMBOL(map_to_cpu);
423
424void cpu_map_rebuild(void)
425{
426 unsigned long flag;
427
428 spin_lock_irqsave(&cpu_map_lock, flag);
429 _cpu_map_rebuild();
430 spin_unlock_irqrestore(&cpu_map_lock, flag);
431}
diff --git a/arch/sparc/kernel/cpumap.h b/arch/sparc/kernel/cpumap.h
new file mode 100644
index 000000000000..e639880ab864
--- /dev/null
+++ b/arch/sparc/kernel/cpumap.h
@@ -0,0 +1,16 @@
1#ifndef _CPUMAP_H
2#define _CPUMAP_H
3
4#ifdef CONFIG_SMP
5extern void cpu_map_rebuild(void);
6extern int map_to_cpu(unsigned int index);
7#define cpu_map_init() cpu_map_rebuild()
8#else
9#define cpu_map_init() do {} while (0)
10static inline int map_to_cpu(unsigned int index)
11{
12 return raw_smp_processor_id();
13}
14#endif
15
16#endif
diff --git a/arch/sparc/kernel/dma.c b/arch/sparc/kernel/dma.c
index ebc8403b035e..524c32f97c55 100644
--- a/arch/sparc/kernel/dma.c
+++ b/arch/sparc/kernel/dma.c
@@ -35,8 +35,8 @@ int dma_set_mask(struct device *dev, u64 dma_mask)
35} 35}
36EXPORT_SYMBOL(dma_set_mask); 36EXPORT_SYMBOL(dma_set_mask);
37 37
38void *dma_alloc_coherent(struct device *dev, size_t size, 38static void *dma32_alloc_coherent(struct device *dev, size_t size,
39 dma_addr_t *dma_handle, gfp_t flag) 39 dma_addr_t *dma_handle, gfp_t flag)
40{ 40{
41#ifdef CONFIG_PCI 41#ifdef CONFIG_PCI
42 if (dev->bus == &pci_bus_type) 42 if (dev->bus == &pci_bus_type)
@@ -44,10 +44,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
44#endif 44#endif
45 return sbus_alloc_consistent(dev, size, dma_handle); 45 return sbus_alloc_consistent(dev, size, dma_handle);
46} 46}
47EXPORT_SYMBOL(dma_alloc_coherent);
48 47
49void dma_free_coherent(struct device *dev, size_t size, 48static void dma32_free_coherent(struct device *dev, size_t size,
50 void *cpu_addr, dma_addr_t dma_handle) 49 void *cpu_addr, dma_addr_t dma_handle)
51{ 50{
52#ifdef CONFIG_PCI 51#ifdef CONFIG_PCI
53 if (dev->bus == &pci_bus_type) { 52 if (dev->bus == &pci_bus_type) {
@@ -58,38 +57,10 @@ void dma_free_coherent(struct device *dev, size_t size,
58#endif 57#endif
59 sbus_free_consistent(dev, size, cpu_addr, dma_handle); 58 sbus_free_consistent(dev, size, cpu_addr, dma_handle);
60} 59}
61EXPORT_SYMBOL(dma_free_coherent);
62 60
63dma_addr_t dma_map_single(struct device *dev, void *cpu_addr, 61static dma_addr_t dma32_map_page(struct device *dev, struct page *page,
64 size_t size, enum dma_data_direction direction) 62 unsigned long offset, size_t size,
65{ 63 enum dma_data_direction direction)
66#ifdef CONFIG_PCI
67 if (dev->bus == &pci_bus_type)
68 return pci_map_single(to_pci_dev(dev), cpu_addr,
69 size, (int)direction);
70#endif
71 return sbus_map_single(dev, cpu_addr, size, (int)direction);
72}
73EXPORT_SYMBOL(dma_map_single);
74
75void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
76 size_t size,
77 enum dma_data_direction direction)
78{
79#ifdef CONFIG_PCI
80 if (dev->bus == &pci_bus_type) {
81 pci_unmap_single(to_pci_dev(dev), dma_addr,
82 size, (int)direction);
83 return;
84 }
85#endif
86 sbus_unmap_single(dev, dma_addr, size, (int)direction);
87}
88EXPORT_SYMBOL(dma_unmap_single);
89
90dma_addr_t dma_map_page(struct device *dev, struct page *page,
91 unsigned long offset, size_t size,
92 enum dma_data_direction direction)
93{ 64{
94#ifdef CONFIG_PCI 65#ifdef CONFIG_PCI
95 if (dev->bus == &pci_bus_type) 66 if (dev->bus == &pci_bus_type)
@@ -99,10 +70,9 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page,
99 return sbus_map_single(dev, page_address(page) + offset, 70 return sbus_map_single(dev, page_address(page) + offset,
100 size, (int)direction); 71 size, (int)direction);
101} 72}
102EXPORT_SYMBOL(dma_map_page);
103 73
104void dma_unmap_page(struct device *dev, dma_addr_t dma_address, 74static void dma32_unmap_page(struct device *dev, dma_addr_t dma_address,
105 size_t size, enum dma_data_direction direction) 75 size_t size, enum dma_data_direction direction)
106{ 76{
107#ifdef CONFIG_PCI 77#ifdef CONFIG_PCI
108 if (dev->bus == &pci_bus_type) { 78 if (dev->bus == &pci_bus_type) {
@@ -113,10 +83,9 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
113#endif 83#endif
114 sbus_unmap_single(dev, dma_address, size, (int)direction); 84 sbus_unmap_single(dev, dma_address, size, (int)direction);
115} 85}
116EXPORT_SYMBOL(dma_unmap_page);
117 86
118int dma_map_sg(struct device *dev, struct scatterlist *sg, 87static int dma32_map_sg(struct device *dev, struct scatterlist *sg,
119 int nents, enum dma_data_direction direction) 88 int nents, enum dma_data_direction direction)
120{ 89{
121#ifdef CONFIG_PCI 90#ifdef CONFIG_PCI
122 if (dev->bus == &pci_bus_type) 91 if (dev->bus == &pci_bus_type)
@@ -124,10 +93,9 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg,
124#endif 93#endif
125 return sbus_map_sg(dev, sg, nents, direction); 94 return sbus_map_sg(dev, sg, nents, direction);
126} 95}
127EXPORT_SYMBOL(dma_map_sg);
128 96
129void dma_unmap_sg(struct device *dev, struct scatterlist *sg, 97void dma32_unmap_sg(struct device *dev, struct scatterlist *sg,
130 int nents, enum dma_data_direction direction) 98 int nents, enum dma_data_direction direction)
131{ 99{
132#ifdef CONFIG_PCI 100#ifdef CONFIG_PCI
133 if (dev->bus == &pci_bus_type) { 101 if (dev->bus == &pci_bus_type) {
@@ -137,10 +105,10 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
137#endif 105#endif
138 sbus_unmap_sg(dev, sg, nents, (int)direction); 106 sbus_unmap_sg(dev, sg, nents, (int)direction);
139} 107}
140EXPORT_SYMBOL(dma_unmap_sg);
141 108
142void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, 109static void dma32_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
143 size_t size, enum dma_data_direction direction) 110 size_t size,
111 enum dma_data_direction direction)
144{ 112{
145#ifdef CONFIG_PCI 113#ifdef CONFIG_PCI
146 if (dev->bus == &pci_bus_type) { 114 if (dev->bus == &pci_bus_type) {
@@ -151,10 +119,10 @@ void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
151#endif 119#endif
152 sbus_dma_sync_single_for_cpu(dev, dma_handle, size, (int) direction); 120 sbus_dma_sync_single_for_cpu(dev, dma_handle, size, (int) direction);
153} 121}
154EXPORT_SYMBOL(dma_sync_single_for_cpu);
155 122
156void dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, 123static void dma32_sync_single_for_device(struct device *dev,
157 size_t size, enum dma_data_direction direction) 124 dma_addr_t dma_handle, size_t size,
125 enum dma_data_direction direction)
158{ 126{
159#ifdef CONFIG_PCI 127#ifdef CONFIG_PCI
160 if (dev->bus == &pci_bus_type) { 128 if (dev->bus == &pci_bus_type) {
@@ -165,28 +133,9 @@ void dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
165#endif 133#endif
166 sbus_dma_sync_single_for_device(dev, dma_handle, size, (int) direction); 134 sbus_dma_sync_single_for_device(dev, dma_handle, size, (int) direction);
167} 135}
168EXPORT_SYMBOL(dma_sync_single_for_device);
169
170void dma_sync_single_range_for_cpu(struct device *dev,
171 dma_addr_t dma_handle,
172 unsigned long offset,
173 size_t size,
174 enum dma_data_direction direction)
175{
176 dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
177}
178EXPORT_SYMBOL(dma_sync_single_range_for_cpu);
179
180void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
181 unsigned long offset, size_t size,
182 enum dma_data_direction direction)
183{
184 dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
185}
186EXPORT_SYMBOL(dma_sync_single_range_for_device);
187 136
188void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, 137static void dma32_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
189 int nelems, enum dma_data_direction direction) 138 int nelems, enum dma_data_direction direction)
190{ 139{
191#ifdef CONFIG_PCI 140#ifdef CONFIG_PCI
192 if (dev->bus == &pci_bus_type) { 141 if (dev->bus == &pci_bus_type) {
@@ -197,11 +146,10 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
197#endif 146#endif
198 BUG(); 147 BUG();
199} 148}
200EXPORT_SYMBOL(dma_sync_sg_for_cpu);
201 149
202void dma_sync_sg_for_device(struct device *dev, 150static void dma32_sync_sg_for_device(struct device *dev,
203 struct scatterlist *sg, int nelems, 151 struct scatterlist *sg, int nelems,
204 enum dma_data_direction direction) 152 enum dma_data_direction direction)
205{ 153{
206#ifdef CONFIG_PCI 154#ifdef CONFIG_PCI
207 if (dev->bus == &pci_bus_type) { 155 if (dev->bus == &pci_bus_type) {
@@ -212,16 +160,19 @@ void dma_sync_sg_for_device(struct device *dev,
212#endif 160#endif
213 BUG(); 161 BUG();
214} 162}
215EXPORT_SYMBOL(dma_sync_sg_for_device);
216 163
217int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 164static const struct dma_ops dma32_dma_ops = {
218{ 165 .alloc_coherent = dma32_alloc_coherent,
219 return (dma_addr == DMA_ERROR_CODE); 166 .free_coherent = dma32_free_coherent,
220} 167 .map_page = dma32_map_page,
221EXPORT_SYMBOL(dma_mapping_error); 168 .unmap_page = dma32_unmap_page,
222 169 .map_sg = dma32_map_sg,
223int dma_get_cache_alignment(void) 170 .unmap_sg = dma32_unmap_sg,
224{ 171 .sync_single_for_cpu = dma32_sync_single_for_cpu,
225 return 32; 172 .sync_single_for_device = dma32_sync_single_for_device,
226} 173 .sync_sg_for_cpu = dma32_sync_sg_for_cpu,
227EXPORT_SYMBOL(dma_get_cache_alignment); 174 .sync_sg_for_device = dma32_sync_sg_for_device,
175};
176
177const struct dma_ops *dma_ops = &dma32_dma_ops;
178EXPORT_SYMBOL(dma_ops);
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c
index 90350f838f05..4a700f4b79ce 100644
--- a/arch/sparc/kernel/ds.c
+++ b/arch/sparc/kernel/ds.c
@@ -544,7 +544,8 @@ static int __cpuinit dr_cpu_configure(struct ds_info *dp,
544 resp_len, ncpus, mask, 544 resp_len, ncpus, mask,
545 DR_CPU_STAT_CONFIGURED); 545 DR_CPU_STAT_CONFIGURED);
546 546
547 mdesc_fill_in_cpu_data(*mask); 547 mdesc_populate_present_mask(mask);
548 mdesc_fill_in_cpu_data(mask);
548 549
549 for_each_cpu_mask(cpu, *mask) { 550 for_each_cpu_mask(cpu, *mask) {
550 int err; 551 int err;
diff --git a/arch/sparc/kernel/ftrace.c b/arch/sparc/kernel/ftrace.c
index d0218e73f982..d3b1a3076569 100644
--- a/arch/sparc/kernel/ftrace.c
+++ b/arch/sparc/kernel/ftrace.c
@@ -7,14 +7,10 @@
7 7
8#include <asm/ftrace.h> 8#include <asm/ftrace.h>
9 9
10#ifdef CONFIG_DYNAMIC_FTRACE
10static const u32 ftrace_nop = 0x01000000; 11static const u32 ftrace_nop = 0x01000000;
11 12
12unsigned char *ftrace_nop_replace(void) 13static u32 ftrace_call_replace(unsigned long ip, unsigned long addr)
13{
14 return (char *)&ftrace_nop;
15}
16
17unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr)
18{ 14{
19 static u32 call; 15 static u32 call;
20 s32 off; 16 s32 off;
@@ -22,15 +18,11 @@ unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr)
22 off = ((s32)addr - (s32)ip); 18 off = ((s32)addr - (s32)ip);
23 call = 0x40000000 | ((u32)off >> 2); 19 call = 0x40000000 | ((u32)off >> 2);
24 20
25 return (unsigned char *) &call; 21 return call;
26} 22}
27 23
28int 24static int ftrace_modify_code(unsigned long ip, u32 old, u32 new)
29ftrace_modify_code(unsigned long ip, unsigned char *old_code,
30 unsigned char *new_code)
31{ 25{
32 u32 old = *(u32 *)old_code;
33 u32 new = *(u32 *)new_code;
34 u32 replaced; 26 u32 replaced;
35 int faulted; 27 int faulted;
36 28
@@ -59,18 +51,43 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
59 return faulted; 51 return faulted;
60} 52}
61 53
54int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, unsigned long addr)
55{
56 unsigned long ip = rec->ip;
57 u32 old, new;
58
59 old = ftrace_call_replace(ip, addr);
60 new = ftrace_nop;
61 return ftrace_modify_code(ip, old, new);
62}
63
64int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
65{
66 unsigned long ip = rec->ip;
67 u32 old, new;
68
69 old = ftrace_nop;
70 new = ftrace_call_replace(ip, addr);
71 return ftrace_modify_code(ip, old, new);
72}
73
62int ftrace_update_ftrace_func(ftrace_func_t func) 74int ftrace_update_ftrace_func(ftrace_func_t func)
63{ 75{
64 unsigned long ip = (unsigned long)(&ftrace_call); 76 unsigned long ip = (unsigned long)(&ftrace_call);
65 unsigned char old[MCOUNT_INSN_SIZE], *new; 77 u32 old, new;
66 78
67 memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE); 79 old = *(u32 *) &ftrace_call;
68 new = ftrace_call_replace(ip, (unsigned long)func); 80 new = ftrace_call_replace(ip, (unsigned long)func);
69 return ftrace_modify_code(ip, old, new); 81 return ftrace_modify_code(ip, old, new);
70} 82}
71 83
72int __init ftrace_dyn_arch_init(void *data) 84int __init ftrace_dyn_arch_init(void *data)
73{ 85{
74 ftrace_mcount_set(data); 86 unsigned long *p = data;
87
88 *p = 0;
89
75 return 0; 90 return 0;
76} 91}
92#endif
93
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
index 91bf4c7f79b9..f8f21050448b 100644
--- a/arch/sparc/kernel/head_64.S
+++ b/arch/sparc/kernel/head_64.S
@@ -641,28 +641,6 @@ tlb_fixup_done:
641 /* Not reached... */ 641 /* Not reached... */
642 642
6431: 6431:
644 /* If we boot on a non-zero cpu, all of the per-cpu
645 * variable references we make before setting up the
646 * per-cpu areas will use a bogus offset. Put a
647 * compensating factor into __per_cpu_base to handle
648 * this cleanly.
649 *
650 * What the per-cpu code calculates is:
651 *
652 * __per_cpu_base + (cpu << __per_cpu_shift)
653 *
654 * These two variables are zero initially, so to
655 * make it all cancel out to zero we need to put
656 * "0 - (cpu << 0)" into __per_cpu_base so that the
657 * above formula evaluates to zero.
658 *
659 * We cannot even perform a printk() until this stuff
660 * is setup as that calls cpu_clock() which uses
661 * per-cpu variables.
662 */
663 sub %g0, %o0, %o1
664 sethi %hi(__per_cpu_base), %o2
665 stx %o1, [%o2 + %lo(__per_cpu_base)]
666#else 644#else
667 mov 0, %o0 645 mov 0, %o0
668#endif 646#endif
diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c
index f28cb8278e98..28125c5b3d3c 100644
--- a/arch/sparc/kernel/init_task.c
+++ b/arch/sparc/kernel/init_task.c
@@ -10,10 +10,7 @@
10 10
11static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 11static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
12static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 12static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
13struct mm_struct init_mm = INIT_MM(init_mm);
14struct task_struct init_task = INIT_TASK(init_task); 13struct task_struct init_task = INIT_TASK(init_task);
15
16EXPORT_SYMBOL(init_mm);
17EXPORT_SYMBOL(init_task); 14EXPORT_SYMBOL(init_task);
18 15
19/* .text section in head.S is aligned at 8k boundary and this gets linked 16/* .text section in head.S is aligned at 8k boundary and this gets linked
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index d8900e1d5aad..0aeaefe696b9 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -351,8 +351,9 @@ static void dma_4u_free_coherent(struct device *dev, size_t size,
351 free_pages((unsigned long)cpu, order); 351 free_pages((unsigned long)cpu, order);
352} 352}
353 353
354static dma_addr_t dma_4u_map_single(struct device *dev, void *ptr, size_t sz, 354static dma_addr_t dma_4u_map_page(struct device *dev, struct page *page,
355 enum dma_data_direction direction) 355 unsigned long offset, size_t sz,
356 enum dma_data_direction direction)
356{ 357{
357 struct iommu *iommu; 358 struct iommu *iommu;
358 struct strbuf *strbuf; 359 struct strbuf *strbuf;
@@ -368,7 +369,7 @@ static dma_addr_t dma_4u_map_single(struct device *dev, void *ptr, size_t sz,
368 if (unlikely(direction == DMA_NONE)) 369 if (unlikely(direction == DMA_NONE))
369 goto bad_no_ctx; 370 goto bad_no_ctx;
370 371
371 oaddr = (unsigned long)ptr; 372 oaddr = (unsigned long)(page_address(page) + offset);
372 npages = IO_PAGE_ALIGN(oaddr + sz) - (oaddr & IO_PAGE_MASK); 373 npages = IO_PAGE_ALIGN(oaddr + sz) - (oaddr & IO_PAGE_MASK);
373 npages >>= IO_PAGE_SHIFT; 374 npages >>= IO_PAGE_SHIFT;
374 375
@@ -472,8 +473,8 @@ do_flush_sync:
472 vaddr, ctx, npages); 473 vaddr, ctx, npages);
473} 474}
474 475
475static void dma_4u_unmap_single(struct device *dev, dma_addr_t bus_addr, 476static void dma_4u_unmap_page(struct device *dev, dma_addr_t bus_addr,
476 size_t sz, enum dma_data_direction direction) 477 size_t sz, enum dma_data_direction direction)
477{ 478{
478 struct iommu *iommu; 479 struct iommu *iommu;
479 struct strbuf *strbuf; 480 struct strbuf *strbuf;
@@ -824,8 +825,8 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev,
824static const struct dma_ops sun4u_dma_ops = { 825static const struct dma_ops sun4u_dma_ops = {
825 .alloc_coherent = dma_4u_alloc_coherent, 826 .alloc_coherent = dma_4u_alloc_coherent,
826 .free_coherent = dma_4u_free_coherent, 827 .free_coherent = dma_4u_free_coherent,
827 .map_single = dma_4u_map_single, 828 .map_page = dma_4u_map_page,
828 .unmap_single = dma_4u_unmap_single, 829 .unmap_page = dma_4u_unmap_page,
829 .map_sg = dma_4u_map_sg, 830 .map_sg = dma_4u_map_sg,
830 .unmap_sg = dma_4u_unmap_sg, 831 .unmap_sg = dma_4u_unmap_sg,
831 .sync_single_for_cpu = dma_4u_sync_single_for_cpu, 832 .sync_single_for_cpu = dma_4u_sync_single_for_cpu,
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index e5e78f9cfc95..bd075054942b 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -45,6 +45,7 @@
45#include <asm/cacheflush.h> 45#include <asm/cacheflush.h>
46 46
47#include "entry.h" 47#include "entry.h"
48#include "cpumap.h"
48 49
49#define NUM_IVECS (IMAP_INR + 1) 50#define NUM_IVECS (IMAP_INR + 1)
50 51
@@ -256,35 +257,13 @@ static int irq_choose_cpu(unsigned int virt_irq)
256 int cpuid; 257 int cpuid;
257 258
258 cpumask_copy(&mask, irq_desc[virt_irq].affinity); 259 cpumask_copy(&mask, irq_desc[virt_irq].affinity);
259 if (cpus_equal(mask, CPU_MASK_ALL)) { 260 if (cpus_equal(mask, cpu_online_map)) {
260 static int irq_rover; 261 cpuid = map_to_cpu(virt_irq);
261 static DEFINE_SPINLOCK(irq_rover_lock);
262 unsigned long flags;
263
264 /* Round-robin distribution... */
265 do_round_robin:
266 spin_lock_irqsave(&irq_rover_lock, flags);
267
268 while (!cpu_online(irq_rover)) {
269 if (++irq_rover >= nr_cpu_ids)
270 irq_rover = 0;
271 }
272 cpuid = irq_rover;
273 do {
274 if (++irq_rover >= nr_cpu_ids)
275 irq_rover = 0;
276 } while (!cpu_online(irq_rover));
277
278 spin_unlock_irqrestore(&irq_rover_lock, flags);
279 } else { 262 } else {
280 cpumask_t tmp; 263 cpumask_t tmp;
281 264
282 cpus_and(tmp, cpu_online_map, mask); 265 cpus_and(tmp, cpu_online_map, mask);
283 266 cpuid = cpus_empty(tmp) ? map_to_cpu(virt_irq) : first_cpu(tmp);
284 if (cpus_empty(tmp))
285 goto do_round_robin;
286
287 cpuid = first_cpu(tmp);
288 } 267 }
289 268
290 return cpuid; 269 return cpuid;
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c
index f0e6ed23a468..938da19dc065 100644
--- a/arch/sparc/kernel/mdesc.c
+++ b/arch/sparc/kernel/mdesc.c
@@ -574,7 +574,7 @@ static void __init report_platform_properties(void)
574 mdesc_release(hp); 574 mdesc_release(hp);
575} 575}
576 576
577static void __devinit fill_in_one_cache(cpuinfo_sparc *c, 577static void __cpuinit fill_in_one_cache(cpuinfo_sparc *c,
578 struct mdesc_handle *hp, 578 struct mdesc_handle *hp,
579 u64 mp) 579 u64 mp)
580{ 580{
@@ -619,8 +619,7 @@ static void __devinit fill_in_one_cache(cpuinfo_sparc *c,
619 } 619 }
620} 620}
621 621
622static void __devinit mark_core_ids(struct mdesc_handle *hp, u64 mp, 622static void __cpuinit mark_core_ids(struct mdesc_handle *hp, u64 mp, int core_id)
623 int core_id)
624{ 623{
625 u64 a; 624 u64 a;
626 625
@@ -653,7 +652,7 @@ static void __devinit mark_core_ids(struct mdesc_handle *hp, u64 mp,
653 } 652 }
654} 653}
655 654
656static void __devinit set_core_ids(struct mdesc_handle *hp) 655static void __cpuinit set_core_ids(struct mdesc_handle *hp)
657{ 656{
658 int idx; 657 int idx;
659 u64 mp; 658 u64 mp;
@@ -678,8 +677,7 @@ static void __devinit set_core_ids(struct mdesc_handle *hp)
678 } 677 }
679} 678}
680 679
681static void __devinit mark_proc_ids(struct mdesc_handle *hp, u64 mp, 680static void __cpuinit mark_proc_ids(struct mdesc_handle *hp, u64 mp, int proc_id)
682 int proc_id)
683{ 681{
684 u64 a; 682 u64 a;
685 683
@@ -698,8 +696,7 @@ static void __devinit mark_proc_ids(struct mdesc_handle *hp, u64 mp,
698 } 696 }
699} 697}
700 698
701static void __devinit __set_proc_ids(struct mdesc_handle *hp, 699static void __cpuinit __set_proc_ids(struct mdesc_handle *hp, const char *exec_unit_name)
702 const char *exec_unit_name)
703{ 700{
704 int idx; 701 int idx;
705 u64 mp; 702 u64 mp;
@@ -720,13 +717,13 @@ static void __devinit __set_proc_ids(struct mdesc_handle *hp,
720 } 717 }
721} 718}
722 719
723static void __devinit set_proc_ids(struct mdesc_handle *hp) 720static void __cpuinit set_proc_ids(struct mdesc_handle *hp)
724{ 721{
725 __set_proc_ids(hp, "exec_unit"); 722 __set_proc_ids(hp, "exec_unit");
726 __set_proc_ids(hp, "exec-unit"); 723 __set_proc_ids(hp, "exec-unit");
727} 724}
728 725
729static void __devinit get_one_mondo_bits(const u64 *p, unsigned int *mask, 726static void __cpuinit get_one_mondo_bits(const u64 *p, unsigned int *mask,
730 unsigned char def) 727 unsigned char def)
731{ 728{
732 u64 val; 729 u64 val;
@@ -745,7 +742,7 @@ use_default:
745 *mask = ((1U << def) * 64U) - 1U; 742 *mask = ((1U << def) * 64U) - 1U;
746} 743}
747 744
748static void __devinit get_mondo_data(struct mdesc_handle *hp, u64 mp, 745static void __cpuinit get_mondo_data(struct mdesc_handle *hp, u64 mp,
749 struct trap_per_cpu *tb) 746 struct trap_per_cpu *tb)
750{ 747{
751 const u64 *val; 748 const u64 *val;
@@ -763,23 +760,15 @@ static void __devinit get_mondo_data(struct mdesc_handle *hp, u64 mp,
763 get_one_mondo_bits(val, &tb->nonresum_qmask, 2); 760 get_one_mondo_bits(val, &tb->nonresum_qmask, 2);
764} 761}
765 762
766void __cpuinit mdesc_fill_in_cpu_data(cpumask_t mask) 763static void * __cpuinit mdesc_iterate_over_cpus(void *(*func)(struct mdesc_handle *, u64, int, void *), void *arg, cpumask_t *mask)
767{ 764{
768 struct mdesc_handle *hp = mdesc_grab(); 765 struct mdesc_handle *hp = mdesc_grab();
766 void *ret = NULL;
769 u64 mp; 767 u64 mp;
770 768
771 ncpus_probed = 0;
772 mdesc_for_each_node_by_name(hp, mp, "cpu") { 769 mdesc_for_each_node_by_name(hp, mp, "cpu") {
773 const u64 *id = mdesc_get_property(hp, mp, "id", NULL); 770 const u64 *id = mdesc_get_property(hp, mp, "id", NULL);
774 const u64 *cfreq = mdesc_get_property(hp, mp, "clock-frequency", NULL); 771 int cpuid = *id;
775 struct trap_per_cpu *tb;
776 cpuinfo_sparc *c;
777 int cpuid;
778 u64 a;
779
780 ncpus_probed++;
781
782 cpuid = *id;
783 772
784#ifdef CONFIG_SMP 773#ifdef CONFIG_SMP
785 if (cpuid >= NR_CPUS) { 774 if (cpuid >= NR_CPUS) {
@@ -788,62 +777,104 @@ void __cpuinit mdesc_fill_in_cpu_data(cpumask_t mask)
788 cpuid, NR_CPUS); 777 cpuid, NR_CPUS);
789 continue; 778 continue;
790 } 779 }
791 if (!cpu_isset(cpuid, mask)) 780 if (!cpu_isset(cpuid, *mask))
792 continue; 781 continue;
793#else
794 /* On uniprocessor we only want the values for the
795 * real physical cpu the kernel booted onto, however
796 * cpu_data() only has one entry at index 0.
797 */
798 if (cpuid != real_hard_smp_processor_id())
799 continue;
800 cpuid = 0;
801#endif 782#endif
802 783
803 c = &cpu_data(cpuid); 784 ret = func(hp, mp, cpuid, arg);
804 c->clock_tick = *cfreq; 785 if (ret)
786 goto out;
787 }
788out:
789 mdesc_release(hp);
790 return ret;
791}
805 792
806 tb = &trap_block[cpuid]; 793static void * __cpuinit record_one_cpu(struct mdesc_handle *hp, u64 mp, int cpuid, void *arg)
807 get_mondo_data(hp, mp, tb); 794{
795 ncpus_probed++;
796#ifdef CONFIG_SMP
797 set_cpu_present(cpuid, true);
798#endif
799 return NULL;
800}
808 801
809 mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_FWD) { 802void __cpuinit mdesc_populate_present_mask(cpumask_t *mask)
810 u64 j, t = mdesc_arc_target(hp, a); 803{
811 const char *t_name; 804 if (tlb_type != hypervisor)
805 return;
812 806
813 t_name = mdesc_node_name(hp, t); 807 ncpus_probed = 0;
814 if (!strcmp(t_name, "cache")) { 808 mdesc_iterate_over_cpus(record_one_cpu, NULL, mask);
815 fill_in_one_cache(c, hp, t); 809}
816 continue;
817 }
818 810
819 mdesc_for_each_arc(j, hp, t, MDESC_ARC_TYPE_FWD) { 811static void * __cpuinit fill_in_one_cpu(struct mdesc_handle *hp, u64 mp, int cpuid, void *arg)
820 u64 n = mdesc_arc_target(hp, j); 812{
821 const char *n_name; 813 const u64 *cfreq = mdesc_get_property(hp, mp, "clock-frequency", NULL);
814 struct trap_per_cpu *tb;
815 cpuinfo_sparc *c;
816 u64 a;
822 817
823 n_name = mdesc_node_name(hp, n); 818#ifndef CONFIG_SMP
824 if (!strcmp(n_name, "cache")) 819 /* On uniprocessor we only want the values for the
825 fill_in_one_cache(c, hp, n); 820 * real physical cpu the kernel booted onto, however
826 } 821 * cpu_data() only has one entry at index 0.
822 */
823 if (cpuid != real_hard_smp_processor_id())
824 return NULL;
825 cpuid = 0;
826#endif
827
828 c = &cpu_data(cpuid);
829 c->clock_tick = *cfreq;
830
831 tb = &trap_block[cpuid];
832 get_mondo_data(hp, mp, tb);
833
834 mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_FWD) {
835 u64 j, t = mdesc_arc_target(hp, a);
836 const char *t_name;
837
838 t_name = mdesc_node_name(hp, t);
839 if (!strcmp(t_name, "cache")) {
840 fill_in_one_cache(c, hp, t);
841 continue;
827 } 842 }
828 843
829#ifdef CONFIG_SMP 844 mdesc_for_each_arc(j, hp, t, MDESC_ARC_TYPE_FWD) {
830 cpu_set(cpuid, cpu_present_map); 845 u64 n = mdesc_arc_target(hp, j);
831#endif 846 const char *n_name;
832 847
833 c->core_id = 0; 848 n_name = mdesc_node_name(hp, n);
834 c->proc_id = -1; 849 if (!strcmp(n_name, "cache"))
850 fill_in_one_cache(c, hp, n);
851 }
835 } 852 }
836 853
854 c->core_id = 0;
855 c->proc_id = -1;
856
857 return NULL;
858}
859
860void __cpuinit mdesc_fill_in_cpu_data(cpumask_t *mask)
861{
862 struct mdesc_handle *hp;
863
864 mdesc_iterate_over_cpus(fill_in_one_cpu, NULL, mask);
865
837#ifdef CONFIG_SMP 866#ifdef CONFIG_SMP
838 sparc64_multi_core = 1; 867 sparc64_multi_core = 1;
839#endif 868#endif
840 869
870 hp = mdesc_grab();
871
841 set_core_ids(hp); 872 set_core_ids(hp);
842 set_proc_ids(hp); 873 set_proc_ids(hp);
843 874
844 smp_fill_in_sib_core_maps();
845
846 mdesc_release(hp); 875 mdesc_release(hp);
876
877 smp_fill_in_sib_core_maps();
847} 878}
848 879
849static ssize_t mdesc_read(struct file *file, char __user *buf, 880static ssize_t mdesc_read(struct file *file, char __user *buf,
@@ -887,7 +918,6 @@ void __init sun4v_mdesc_init(void)
887{ 918{
888 struct mdesc_handle *hp; 919 struct mdesc_handle *hp;
889 unsigned long len, real_len, status; 920 unsigned long len, real_len, status;
890 cpumask_t mask;
891 921
892 (void) sun4v_mach_desc(0UL, 0UL, &len); 922 (void) sun4v_mach_desc(0UL, 0UL, &len);
893 923
@@ -911,7 +941,4 @@ void __init sun4v_mdesc_init(void)
911 cur_mdesc = hp; 941 cur_mdesc = hp;
912 942
913 report_platform_properties(); 943 report_platform_properties();
914
915 cpus_setall(mask);
916 mdesc_fill_in_cpu_data(mask);
917} 944}
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index c8f14c1dc521..90396702ea2c 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -6,159 +6,11 @@
6#include <linux/mod_devicetable.h> 6#include <linux/mod_devicetable.h>
7#include <linux/slab.h> 7#include <linux/slab.h>
8#include <linux/errno.h> 8#include <linux/errno.h>
9#include <linux/irq.h>
9#include <linux/of_device.h> 10#include <linux/of_device.h>
10#include <linux/of_platform.h> 11#include <linux/of_platform.h>
11 12
12static int node_match(struct device *dev, void *data) 13#include "of_device_common.h"
13{
14 struct of_device *op = to_of_device(dev);
15 struct device_node *dp = data;
16
17 return (op->node == dp);
18}
19
20struct of_device *of_find_device_by_node(struct device_node *dp)
21{
22 struct device *dev = bus_find_device(&of_platform_bus_type, NULL,
23 dp, node_match);
24
25 if (dev)
26 return to_of_device(dev);
27
28 return NULL;
29}
30EXPORT_SYMBOL(of_find_device_by_node);
31
32unsigned int irq_of_parse_and_map(struct device_node *node, int index)
33{
34 struct of_device *op = of_find_device_by_node(node);
35
36 if (!op || index >= op->num_irqs)
37 return 0;
38
39 return op->irqs[index];
40}
41EXPORT_SYMBOL(irq_of_parse_and_map);
42
43/* Take the archdata values for IOMMU, STC, and HOSTDATA found in
44 * BUS and propagate to all child of_device objects.
45 */
46void of_propagate_archdata(struct of_device *bus)
47{
48 struct dev_archdata *bus_sd = &bus->dev.archdata;
49 struct device_node *bus_dp = bus->node;
50 struct device_node *dp;
51
52 for (dp = bus_dp->child; dp; dp = dp->sibling) {
53 struct of_device *op = of_find_device_by_node(dp);
54
55 op->dev.archdata.iommu = bus_sd->iommu;
56 op->dev.archdata.stc = bus_sd->stc;
57 op->dev.archdata.host_controller = bus_sd->host_controller;
58 op->dev.archdata.numa_node = bus_sd->numa_node;
59
60 if (dp->child)
61 of_propagate_archdata(op);
62 }
63}
64
65struct bus_type of_platform_bus_type;
66EXPORT_SYMBOL(of_platform_bus_type);
67
68static inline u64 of_read_addr(const u32 *cell, int size)
69{
70 u64 r = 0;
71 while (size--)
72 r = (r << 32) | *(cell++);
73 return r;
74}
75
76static void __init get_cells(struct device_node *dp,
77 int *addrc, int *sizec)
78{
79 if (addrc)
80 *addrc = of_n_addr_cells(dp);
81 if (sizec)
82 *sizec = of_n_size_cells(dp);
83}
84
85/* Max address size we deal with */
86#define OF_MAX_ADDR_CELLS 4
87
88struct of_bus {
89 const char *name;
90 const char *addr_prop_name;
91 int (*match)(struct device_node *parent);
92 void (*count_cells)(struct device_node *child,
93 int *addrc, int *sizec);
94 int (*map)(u32 *addr, const u32 *range,
95 int na, int ns, int pna);
96 unsigned long (*get_flags)(const u32 *addr, unsigned long);
97};
98
99/*
100 * Default translator (generic bus)
101 */
102
103static void of_bus_default_count_cells(struct device_node *dev,
104 int *addrc, int *sizec)
105{
106 get_cells(dev, addrc, sizec);
107}
108
109/* Make sure the least significant 64-bits are in-range. Even
110 * for 3 or 4 cell values it is a good enough approximation.
111 */
112static int of_out_of_range(const u32 *addr, const u32 *base,
113 const u32 *size, int na, int ns)
114{
115 u64 a = of_read_addr(addr, na);
116 u64 b = of_read_addr(base, na);
117
118 if (a < b)
119 return 1;
120
121 b += of_read_addr(size, ns);
122 if (a >= b)
123 return 1;
124
125 return 0;
126}
127
128static int of_bus_default_map(u32 *addr, const u32 *range,
129 int na, int ns, int pna)
130{
131 u32 result[OF_MAX_ADDR_CELLS];
132 int i;
133
134 if (ns > 2) {
135 printk("of_device: Cannot handle size cells (%d) > 2.", ns);
136 return -EINVAL;
137 }
138
139 if (of_out_of_range(addr, range, range + na + pna, na, ns))
140 return -EINVAL;
141
142 /* Start with the parent range base. */
143 memcpy(result, range + na, pna * 4);
144
145 /* Add in the child address offset. */
146 for (i = 0; i < na; i++)
147 result[pna - 1 - i] +=
148 (addr[na - 1 - i] -
149 range[na - 1 - i]);
150
151 memcpy(addr, result, pna * 4);
152
153 return 0;
154}
155
156static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags)
157{
158 if (flags)
159 return flags;
160 return IORESOURCE_MEM;
161}
162 14
163/* 15/*
164 * PCI bus specific translator 16 * PCI bus specific translator
@@ -240,47 +92,6 @@ static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
240 return flags; 92 return flags;
241} 93}
242 94
243/*
244 * SBUS bus specific translator
245 */
246
247static int of_bus_sbus_match(struct device_node *np)
248{
249 struct device_node *dp = np;
250
251 while (dp) {
252 if (!strcmp(dp->name, "sbus") ||
253 !strcmp(dp->name, "sbi"))
254 return 1;
255
256 /* Have a look at use_1to1_mapping(). We're trying
257 * to match SBUS if that's the top-level bus and we
258 * don't have some intervening real bus that provides
259 * ranges based translations.
260 */
261 if (of_find_property(dp, "ranges", NULL) != NULL)
262 break;
263
264 dp = dp->parent;
265 }
266
267 return 0;
268}
269
270static void of_bus_sbus_count_cells(struct device_node *child,
271 int *addrc, int *sizec)
272{
273 if (addrc)
274 *addrc = 2;
275 if (sizec)
276 *sizec = 1;
277}
278
279static int of_bus_sbus_map(u32 *addr, const u32 *range, int na, int ns, int pna)
280{
281 return of_bus_default_map(addr, range, na, ns, pna);
282}
283
284static unsigned long of_bus_sbus_get_flags(const u32 *addr, unsigned long flags) 95static unsigned long of_bus_sbus_get_flags(const u32 *addr, unsigned long flags)
285{ 96{
286 return IORESOURCE_MEM; 97 return IORESOURCE_MEM;
@@ -307,7 +118,7 @@ static struct of_bus of_busses[] = {
307 .addr_prop_name = "reg", 118 .addr_prop_name = "reg",
308 .match = of_bus_sbus_match, 119 .match = of_bus_sbus_match,
309 .count_cells = of_bus_sbus_count_cells, 120 .count_cells = of_bus_sbus_count_cells,
310 .map = of_bus_sbus_map, 121 .map = of_bus_default_map,
311 .get_flags = of_bus_sbus_get_flags, 122 .get_flags = of_bus_sbus_get_flags,
312 }, 123 },
313 /* Default */ 124 /* Default */
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 5ac287ac03de..881947e59e95 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -10,6 +10,8 @@
10#include <linux/of_device.h> 10#include <linux/of_device.h>
11#include <linux/of_platform.h> 11#include <linux/of_platform.h>
12 12
13#include "of_device_common.h"
14
13void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name) 15void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name)
14{ 16{
15 unsigned long ret = res->start + offset; 17 unsigned long ret = res->start + offset;
@@ -35,156 +37,6 @@ void of_iounmap(struct resource *res, void __iomem *base, unsigned long size)
35} 37}
36EXPORT_SYMBOL(of_iounmap); 38EXPORT_SYMBOL(of_iounmap);
37 39
38static int node_match(struct device *dev, void *data)
39{
40 struct of_device *op = to_of_device(dev);
41 struct device_node *dp = data;
42
43 return (op->node == dp);
44}
45
46struct of_device *of_find_device_by_node(struct device_node *dp)
47{
48 struct device *dev = bus_find_device(&of_platform_bus_type, NULL,
49 dp, node_match);
50
51 if (dev)
52 return to_of_device(dev);
53
54 return NULL;
55}
56EXPORT_SYMBOL(of_find_device_by_node);
57
58unsigned int irq_of_parse_and_map(struct device_node *node, int index)
59{
60 struct of_device *op = of_find_device_by_node(node);
61
62 if (!op || index >= op->num_irqs)
63 return 0;
64
65 return op->irqs[index];
66}
67EXPORT_SYMBOL(irq_of_parse_and_map);
68
69/* Take the archdata values for IOMMU, STC, and HOSTDATA found in
70 * BUS and propagate to all child of_device objects.
71 */
72void of_propagate_archdata(struct of_device *bus)
73{
74 struct dev_archdata *bus_sd = &bus->dev.archdata;
75 struct device_node *bus_dp = bus->node;
76 struct device_node *dp;
77
78 for (dp = bus_dp->child; dp; dp = dp->sibling) {
79 struct of_device *op = of_find_device_by_node(dp);
80
81 op->dev.archdata.iommu = bus_sd->iommu;
82 op->dev.archdata.stc = bus_sd->stc;
83 op->dev.archdata.host_controller = bus_sd->host_controller;
84 op->dev.archdata.numa_node = bus_sd->numa_node;
85
86 if (dp->child)
87 of_propagate_archdata(op);
88 }
89}
90
91struct bus_type of_platform_bus_type;
92EXPORT_SYMBOL(of_platform_bus_type);
93
94static inline u64 of_read_addr(const u32 *cell, int size)
95{
96 u64 r = 0;
97 while (size--)
98 r = (r << 32) | *(cell++);
99 return r;
100}
101
102static void get_cells(struct device_node *dp, int *addrc, int *sizec)
103{
104 if (addrc)
105 *addrc = of_n_addr_cells(dp);
106 if (sizec)
107 *sizec = of_n_size_cells(dp);
108}
109
110/* Max address size we deal with */
111#define OF_MAX_ADDR_CELLS 4
112
113struct of_bus {
114 const char *name;
115 const char *addr_prop_name;
116 int (*match)(struct device_node *parent);
117 void (*count_cells)(struct device_node *child,
118 int *addrc, int *sizec);
119 int (*map)(u32 *addr, const u32 *range,
120 int na, int ns, int pna);
121 unsigned long (*get_flags)(const u32 *addr, unsigned long);
122};
123
124/*
125 * Default translator (generic bus)
126 */
127
128static void of_bus_default_count_cells(struct device_node *dev,
129 int *addrc, int *sizec)
130{
131 get_cells(dev, addrc, sizec);
132}
133
134/* Make sure the least significant 64-bits are in-range. Even
135 * for 3 or 4 cell values it is a good enough approximation.
136 */
137static int of_out_of_range(const u32 *addr, const u32 *base,
138 const u32 *size, int na, int ns)
139{
140 u64 a = of_read_addr(addr, na);
141 u64 b = of_read_addr(base, na);
142
143 if (a < b)
144 return 1;
145
146 b += of_read_addr(size, ns);
147 if (a >= b)
148 return 1;
149
150 return 0;
151}
152
153static int of_bus_default_map(u32 *addr, const u32 *range,
154 int na, int ns, int pna)
155{
156 u32 result[OF_MAX_ADDR_CELLS];
157 int i;
158
159 if (ns > 2) {
160 printk("of_device: Cannot handle size cells (%d) > 2.", ns);
161 return -EINVAL;
162 }
163
164 if (of_out_of_range(addr, range, range + na + pna, na, ns))
165 return -EINVAL;
166
167 /* Start with the parent range base. */
168 memcpy(result, range + na, pna * 4);
169
170 /* Add in the child address offset. */
171 for (i = 0; i < na; i++)
172 result[pna - 1 - i] +=
173 (addr[na - 1 - i] -
174 range[na - 1 - i]);
175
176 memcpy(addr, result, pna * 4);
177
178 return 0;
179}
180
181static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags)
182{
183 if (flags)
184 return flags;
185 return IORESOURCE_MEM;
186}
187
188/* 40/*
189 * PCI bus specific translator 41 * PCI bus specific translator
190 */ 42 */
@@ -295,42 +147,6 @@ static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
295} 147}
296 148
297/* 149/*
298 * SBUS bus specific translator
299 */
300
301static int of_bus_sbus_match(struct device_node *np)
302{
303 struct device_node *dp = np;
304
305 while (dp) {
306 if (!strcmp(dp->name, "sbus") ||
307 !strcmp(dp->name, "sbi"))
308 return 1;
309
310 /* Have a look at use_1to1_mapping(). We're trying
311 * to match SBUS if that's the top-level bus and we
312 * don't have some intervening real bus that provides
313 * ranges based translations.
314 */
315 if (of_find_property(dp, "ranges", NULL) != NULL)
316 break;
317
318 dp = dp->parent;
319 }
320
321 return 0;
322}
323
324static void of_bus_sbus_count_cells(struct device_node *child,
325 int *addrc, int *sizec)
326{
327 if (addrc)
328 *addrc = 2;
329 if (sizec)
330 *sizec = 1;
331}
332
333/*
334 * FHC/Central bus specific translator. 150 * FHC/Central bus specific translator.
335 * 151 *
336 * This is just needed to hard-code the address and size cell 152 * This is just needed to hard-code the address and size cell
diff --git a/arch/sparc/kernel/of_device_common.c b/arch/sparc/kernel/of_device_common.c
new file mode 100644
index 000000000000..cb8eb799bb6c
--- /dev/null
+++ b/arch/sparc/kernel/of_device_common.c
@@ -0,0 +1,174 @@
1#include <linux/string.h>
2#include <linux/kernel.h>
3#include <linux/of.h>
4#include <linux/init.h>
5#include <linux/module.h>
6#include <linux/mod_devicetable.h>
7#include <linux/slab.h>
8#include <linux/errno.h>
9#include <linux/irq.h>
10#include <linux/of_device.h>
11#include <linux/of_platform.h>
12
13#include "of_device_common.h"
14
15static int node_match(struct device *dev, void *data)
16{
17 struct of_device *op = to_of_device(dev);
18 struct device_node *dp = data;
19
20 return (op->node == dp);
21}
22
23struct of_device *of_find_device_by_node(struct device_node *dp)
24{
25 struct device *dev = bus_find_device(&of_platform_bus_type, NULL,
26 dp, node_match);
27
28 if (dev)
29 return to_of_device(dev);
30
31 return NULL;
32}
33EXPORT_SYMBOL(of_find_device_by_node);
34
35unsigned int irq_of_parse_and_map(struct device_node *node, int index)
36{
37 struct of_device *op = of_find_device_by_node(node);
38
39 if (!op || index >= op->num_irqs)
40 return 0;
41
42 return op->irqs[index];
43}
44EXPORT_SYMBOL(irq_of_parse_and_map);
45
46/* Take the archdata values for IOMMU, STC, and HOSTDATA found in
47 * BUS and propagate to all child of_device objects.
48 */
49void of_propagate_archdata(struct of_device *bus)
50{
51 struct dev_archdata *bus_sd = &bus->dev.archdata;
52 struct device_node *bus_dp = bus->node;
53 struct device_node *dp;
54
55 for (dp = bus_dp->child; dp; dp = dp->sibling) {
56 struct of_device *op = of_find_device_by_node(dp);
57
58 op->dev.archdata.iommu = bus_sd->iommu;
59 op->dev.archdata.stc = bus_sd->stc;
60 op->dev.archdata.host_controller = bus_sd->host_controller;
61 op->dev.archdata.numa_node = bus_sd->numa_node;
62
63 if (dp->child)
64 of_propagate_archdata(op);
65 }
66}
67
68struct bus_type of_platform_bus_type;
69EXPORT_SYMBOL(of_platform_bus_type);
70
71static void get_cells(struct device_node *dp, int *addrc, int *sizec)
72{
73 if (addrc)
74 *addrc = of_n_addr_cells(dp);
75 if (sizec)
76 *sizec = of_n_size_cells(dp);
77}
78
79/*
80 * Default translator (generic bus)
81 */
82
83void of_bus_default_count_cells(struct device_node *dev, int *addrc, int *sizec)
84{
85 get_cells(dev, addrc, sizec);
86}
87
88/* Make sure the least significant 64-bits are in-range. Even
89 * for 3 or 4 cell values it is a good enough approximation.
90 */
91int of_out_of_range(const u32 *addr, const u32 *base,
92 const u32 *size, int na, int ns)
93{
94 u64 a = of_read_addr(addr, na);
95 u64 b = of_read_addr(base, na);
96
97 if (a < b)
98 return 1;
99
100 b += of_read_addr(size, ns);
101 if (a >= b)
102 return 1;
103
104 return 0;
105}
106
107int of_bus_default_map(u32 *addr, const u32 *range, int na, int ns, int pna)
108{
109 u32 result[OF_MAX_ADDR_CELLS];
110 int i;
111
112 if (ns > 2) {
113 printk("of_device: Cannot handle size cells (%d) > 2.", ns);
114 return -EINVAL;
115 }
116
117 if (of_out_of_range(addr, range, range + na + pna, na, ns))
118 return -EINVAL;
119
120 /* Start with the parent range base. */
121 memcpy(result, range + na, pna * 4);
122
123 /* Add in the child address offset. */
124 for (i = 0; i < na; i++)
125 result[pna - 1 - i] +=
126 (addr[na - 1 - i] -
127 range[na - 1 - i]);
128
129 memcpy(addr, result, pna * 4);
130
131 return 0;
132}
133
134unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags)
135{
136 if (flags)
137 return flags;
138 return IORESOURCE_MEM;
139}
140
141/*
142 * SBUS bus specific translator
143 */
144
145int of_bus_sbus_match(struct device_node *np)
146{
147 struct device_node *dp = np;
148
149 while (dp) {
150 if (!strcmp(dp->name, "sbus") ||
151 !strcmp(dp->name, "sbi"))
152 return 1;
153
154 /* Have a look at use_1to1_mapping(). We're trying
155 * to match SBUS if that's the top-level bus and we
156 * don't have some intervening real bus that provides
157 * ranges based translations.
158 */
159 if (of_find_property(dp, "ranges", NULL) != NULL)
160 break;
161
162 dp = dp->parent;
163 }
164
165 return 0;
166}
167
168void of_bus_sbus_count_cells(struct device_node *child, int *addrc, int *sizec)
169{
170 if (addrc)
171 *addrc = 2;
172 if (sizec)
173 *sizec = 1;
174}
diff --git a/arch/sparc/kernel/of_device_common.h b/arch/sparc/kernel/of_device_common.h
new file mode 100644
index 000000000000..cdfd23992841
--- /dev/null
+++ b/arch/sparc/kernel/of_device_common.h
@@ -0,0 +1,36 @@
1#ifndef _OF_DEVICE_COMMON_H
2#define _OF_DEVICE_COMMON_H
3
4static inline u64 of_read_addr(const u32 *cell, int size)
5{
6 u64 r = 0;
7 while (size--)
8 r = (r << 32) | *(cell++);
9 return r;
10}
11
12void of_bus_default_count_cells(struct device_node *dev, int *addrc,
13 int *sizec);
14int of_out_of_range(const u32 *addr, const u32 *base,
15 const u32 *size, int na, int ns);
16int of_bus_default_map(u32 *addr, const u32 *range, int na, int ns, int pna);
17unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags);
18
19int of_bus_sbus_match(struct device_node *np);
20void of_bus_sbus_count_cells(struct device_node *child, int *addrc, int *sizec);
21
22/* Max address size we deal with */
23#define OF_MAX_ADDR_CELLS 4
24
25struct of_bus {
26 const char *name;
27 const char *addr_prop_name;
28 int (*match)(struct device_node *parent);
29 void (*count_cells)(struct device_node *child,
30 int *addrc, int *sizec);
31 int (*map)(u32 *addr, const u32 *range,
32 int na, int ns, int pna);
33 unsigned long (*get_flags)(const u32 *addr, unsigned long);
34};
35
36#endif /* _OF_DEVICE_COMMON_H */
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index 5db5ebed35da..2485eaa23101 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -230,8 +230,9 @@ static void dma_4v_free_coherent(struct device *dev, size_t size, void *cpu,
230 free_pages((unsigned long)cpu, order); 230 free_pages((unsigned long)cpu, order);
231} 231}
232 232
233static dma_addr_t dma_4v_map_single(struct device *dev, void *ptr, size_t sz, 233static dma_addr_t dma_4v_map_page(struct device *dev, struct page *page,
234 enum dma_data_direction direction) 234 unsigned long offset, size_t sz,
235 enum dma_data_direction direction)
235{ 236{
236 struct iommu *iommu; 237 struct iommu *iommu;
237 unsigned long flags, npages, oaddr; 238 unsigned long flags, npages, oaddr;
@@ -245,7 +246,7 @@ static dma_addr_t dma_4v_map_single(struct device *dev, void *ptr, size_t sz,
245 if (unlikely(direction == DMA_NONE)) 246 if (unlikely(direction == DMA_NONE))
246 goto bad; 247 goto bad;
247 248
248 oaddr = (unsigned long)ptr; 249 oaddr = (unsigned long)(page_address(page) + offset);
249 npages = IO_PAGE_ALIGN(oaddr + sz) - (oaddr & IO_PAGE_MASK); 250 npages = IO_PAGE_ALIGN(oaddr + sz) - (oaddr & IO_PAGE_MASK);
250 npages >>= IO_PAGE_SHIFT; 251 npages >>= IO_PAGE_SHIFT;
251 252
@@ -294,8 +295,8 @@ iommu_map_fail:
294 return DMA_ERROR_CODE; 295 return DMA_ERROR_CODE;
295} 296}
296 297
297static void dma_4v_unmap_single(struct device *dev, dma_addr_t bus_addr, 298static void dma_4v_unmap_page(struct device *dev, dma_addr_t bus_addr,
298 size_t sz, enum dma_data_direction direction) 299 size_t sz, enum dma_data_direction direction)
299{ 300{
300 struct pci_pbm_info *pbm; 301 struct pci_pbm_info *pbm;
301 struct iommu *iommu; 302 struct iommu *iommu;
@@ -537,8 +538,8 @@ static void dma_4v_sync_sg_for_cpu(struct device *dev,
537static const struct dma_ops sun4v_dma_ops = { 538static const struct dma_ops sun4v_dma_ops = {
538 .alloc_coherent = dma_4v_alloc_coherent, 539 .alloc_coherent = dma_4v_alloc_coherent,
539 .free_coherent = dma_4v_free_coherent, 540 .free_coherent = dma_4v_free_coherent,
540 .map_single = dma_4v_map_single, 541 .map_page = dma_4v_map_page,
541 .unmap_single = dma_4v_unmap_single, 542 .unmap_page = dma_4v_unmap_page,
542 .map_sg = dma_4v_map_sg, 543 .map_sg = dma_4v_map_sg,
543 .unmap_sg = dma_4v_unmap_sg, 544 .unmap_sg = dma_4v_unmap_sg,
544 .sync_single_for_cpu = dma_4v_sync_single_for_cpu, 545 .sync_single_for_cpu = dma_4v_sync_single_for_cpu,
diff --git a/arch/sparc/kernel/prom.h b/arch/sparc/kernel/prom.h
index bb0f0fda6cab..453397fe5e14 100644
--- a/arch/sparc/kernel/prom.h
+++ b/arch/sparc/kernel/prom.h
@@ -22,7 +22,6 @@ static inline int is_root_node(const struct device_node *dp)
22 22
23extern char *build_path_component(struct device_node *dp); 23extern char *build_path_component(struct device_node *dp);
24extern void of_console_init(void); 24extern void of_console_init(void);
25extern void of_fill_in_cpu_data(void);
26 25
27extern unsigned int prom_early_allocated; 26extern unsigned int prom_early_allocated;
28 27
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c
index ca55c7012f77..fb06ac2bd38f 100644
--- a/arch/sparc/kernel/prom_64.c
+++ b/arch/sparc/kernel/prom_64.c
@@ -374,75 +374,26 @@ static const char *get_mid_prop(void)
374 return (tlb_type == spitfire ? "upa-portid" : "portid"); 374 return (tlb_type == spitfire ? "upa-portid" : "portid");
375} 375}
376 376
377struct device_node *of_find_node_by_cpuid(int cpuid) 377static void *of_iterate_over_cpus(void *(*func)(struct device_node *, int, int), int arg)
378{
379 struct device_node *dp;
380 const char *mid_prop = get_mid_prop();
381
382 for_each_node_by_type(dp, "cpu") {
383 int id = of_getintprop_default(dp, mid_prop, -1);
384 const char *this_mid_prop = mid_prop;
385
386 if (id < 0) {
387 this_mid_prop = "cpuid";
388 id = of_getintprop_default(dp, this_mid_prop, -1);
389 }
390
391 if (id < 0) {
392 prom_printf("OF: Serious problem, cpu lacks "
393 "%s property", this_mid_prop);
394 prom_halt();
395 }
396 if (cpuid == id)
397 return dp;
398 }
399 return NULL;
400}
401
402void __init of_fill_in_cpu_data(void)
403{ 378{
404 struct device_node *dp; 379 struct device_node *dp;
405 const char *mid_prop; 380 const char *mid_prop;
406 381
407 if (tlb_type == hypervisor)
408 return;
409
410 mid_prop = get_mid_prop(); 382 mid_prop = get_mid_prop();
411 ncpus_probed = 0;
412 for_each_node_by_type(dp, "cpu") { 383 for_each_node_by_type(dp, "cpu") {
413 int cpuid = of_getintprop_default(dp, mid_prop, -1); 384 int cpuid = of_getintprop_default(dp, mid_prop, -1);
414 const char *this_mid_prop = mid_prop; 385 const char *this_mid_prop = mid_prop;
415 struct device_node *portid_parent; 386 void *ret;
416 int portid = -1;
417 387
418 portid_parent = NULL;
419 if (cpuid < 0) { 388 if (cpuid < 0) {
420 this_mid_prop = "cpuid"; 389 this_mid_prop = "cpuid";
421 cpuid = of_getintprop_default(dp, this_mid_prop, -1); 390 cpuid = of_getintprop_default(dp, this_mid_prop, -1);
422 if (cpuid >= 0) {
423 int limit = 2;
424
425 portid_parent = dp;
426 while (limit--) {
427 portid_parent = portid_parent->parent;
428 if (!portid_parent)
429 break;
430 portid = of_getintprop_default(portid_parent,
431 "portid", -1);
432 if (portid >= 0)
433 break;
434 }
435 }
436 } 391 }
437
438 if (cpuid < 0) { 392 if (cpuid < 0) {
439 prom_printf("OF: Serious problem, cpu lacks " 393 prom_printf("OF: Serious problem, cpu lacks "
440 "%s property", this_mid_prop); 394 "%s property", this_mid_prop);
441 prom_halt(); 395 prom_halt();
442 } 396 }
443
444 ncpus_probed++;
445
446#ifdef CONFIG_SMP 397#ifdef CONFIG_SMP
447 if (cpuid >= NR_CPUS) { 398 if (cpuid >= NR_CPUS) {
448 printk(KERN_WARNING "Ignoring CPU %d which is " 399 printk(KERN_WARNING "Ignoring CPU %d which is "
@@ -450,79 +401,142 @@ void __init of_fill_in_cpu_data(void)
450 cpuid, NR_CPUS); 401 cpuid, NR_CPUS);
451 continue; 402 continue;
452 } 403 }
453#else
454 /* On uniprocessor we only want the values for the
455 * real physical cpu the kernel booted onto, however
456 * cpu_data() only has one entry at index 0.
457 */
458 if (cpuid != real_hard_smp_processor_id())
459 continue;
460 cpuid = 0;
461#endif 404#endif
405 ret = func(dp, cpuid, arg);
406 if (ret)
407 return ret;
408 }
409 return NULL;
410}
462 411
463 cpu_data(cpuid).clock_tick = 412static void *check_cpu_node(struct device_node *dp, int cpuid, int id)
464 of_getintprop_default(dp, "clock-frequency", 0); 413{
465 414 if (id == cpuid)
466 if (portid_parent) { 415 return dp;
467 cpu_data(cpuid).dcache_size = 416 return NULL;
468 of_getintprop_default(dp, "l1-dcache-size", 417}
469 16 * 1024); 418
470 cpu_data(cpuid).dcache_line_size = 419struct device_node *of_find_node_by_cpuid(int cpuid)
471 of_getintprop_default(dp, "l1-dcache-line-size", 420{
472 32); 421 return of_iterate_over_cpus(check_cpu_node, cpuid);
473 cpu_data(cpuid).icache_size = 422}
474 of_getintprop_default(dp, "l1-icache-size", 423
475 8 * 1024); 424static void *record_one_cpu(struct device_node *dp, int cpuid, int arg)
476 cpu_data(cpuid).icache_line_size = 425{
477 of_getintprop_default(dp, "l1-icache-line-size", 426 ncpus_probed++;
478 32);
479 cpu_data(cpuid).ecache_size =
480 of_getintprop_default(dp, "l2-cache-size", 0);
481 cpu_data(cpuid).ecache_line_size =
482 of_getintprop_default(dp, "l2-cache-line-size", 0);
483 if (!cpu_data(cpuid).ecache_size ||
484 !cpu_data(cpuid).ecache_line_size) {
485 cpu_data(cpuid).ecache_size =
486 of_getintprop_default(portid_parent,
487 "l2-cache-size",
488 (4 * 1024 * 1024));
489 cpu_data(cpuid).ecache_line_size =
490 of_getintprop_default(portid_parent,
491 "l2-cache-line-size", 64);
492 }
493
494 cpu_data(cpuid).core_id = portid + 1;
495 cpu_data(cpuid).proc_id = portid;
496#ifdef CONFIG_SMP 427#ifdef CONFIG_SMP
497 sparc64_multi_core = 1; 428 set_cpu_present(cpuid, true);
429 set_cpu_possible(cpuid, true);
498#endif 430#endif
499 } else { 431 return NULL;
500 cpu_data(cpuid).dcache_size = 432}
501 of_getintprop_default(dp, "dcache-size", 16 * 1024);
502 cpu_data(cpuid).dcache_line_size =
503 of_getintprop_default(dp, "dcache-line-size", 32);
504 433
505 cpu_data(cpuid).icache_size = 434void __init of_populate_present_mask(void)
506 of_getintprop_default(dp, "icache-size", 16 * 1024); 435{
507 cpu_data(cpuid).icache_line_size = 436 if (tlb_type == hypervisor)
508 of_getintprop_default(dp, "icache-line-size", 32); 437 return;
438
439 ncpus_probed = 0;
440 of_iterate_over_cpus(record_one_cpu, 0);
441}
509 442
443static void *fill_in_one_cpu(struct device_node *dp, int cpuid, int arg)
444{
445 struct device_node *portid_parent = NULL;
446 int portid = -1;
447
448 if (of_find_property(dp, "cpuid", NULL)) {
449 int limit = 2;
450
451 portid_parent = dp;
452 while (limit--) {
453 portid_parent = portid_parent->parent;
454 if (!portid_parent)
455 break;
456 portid = of_getintprop_default(portid_parent,
457 "portid", -1);
458 if (portid >= 0)
459 break;
460 }
461 }
462
463#ifndef CONFIG_SMP
464 /* On uniprocessor we only want the values for the
465 * real physical cpu the kernel booted onto, however
466 * cpu_data() only has one entry at index 0.
467 */
468 if (cpuid != real_hard_smp_processor_id())
469 return NULL;
470 cpuid = 0;
471#endif
472
473 cpu_data(cpuid).clock_tick =
474 of_getintprop_default(dp, "clock-frequency", 0);
475
476 if (portid_parent) {
477 cpu_data(cpuid).dcache_size =
478 of_getintprop_default(dp, "l1-dcache-size",
479 16 * 1024);
480 cpu_data(cpuid).dcache_line_size =
481 of_getintprop_default(dp, "l1-dcache-line-size",
482 32);
483 cpu_data(cpuid).icache_size =
484 of_getintprop_default(dp, "l1-icache-size",
485 8 * 1024);
486 cpu_data(cpuid).icache_line_size =
487 of_getintprop_default(dp, "l1-icache-line-size",
488 32);
489 cpu_data(cpuid).ecache_size =
490 of_getintprop_default(dp, "l2-cache-size", 0);
491 cpu_data(cpuid).ecache_line_size =
492 of_getintprop_default(dp, "l2-cache-line-size", 0);
493 if (!cpu_data(cpuid).ecache_size ||
494 !cpu_data(cpuid).ecache_line_size) {
510 cpu_data(cpuid).ecache_size = 495 cpu_data(cpuid).ecache_size =
511 of_getintprop_default(dp, "ecache-size", 496 of_getintprop_default(portid_parent,
497 "l2-cache-size",
512 (4 * 1024 * 1024)); 498 (4 * 1024 * 1024));
513 cpu_data(cpuid).ecache_line_size = 499 cpu_data(cpuid).ecache_line_size =
514 of_getintprop_default(dp, "ecache-line-size", 64); 500 of_getintprop_default(portid_parent,
515 501 "l2-cache-line-size", 64);
516 cpu_data(cpuid).core_id = 0;
517 cpu_data(cpuid).proc_id = -1;
518 } 502 }
519 503
504 cpu_data(cpuid).core_id = portid + 1;
505 cpu_data(cpuid).proc_id = portid;
520#ifdef CONFIG_SMP 506#ifdef CONFIG_SMP
521 set_cpu_present(cpuid, true); 507 sparc64_multi_core = 1;
522 set_cpu_possible(cpuid, true);
523#endif 508#endif
509 } else {
510 cpu_data(cpuid).dcache_size =
511 of_getintprop_default(dp, "dcache-size", 16 * 1024);
512 cpu_data(cpuid).dcache_line_size =
513 of_getintprop_default(dp, "dcache-line-size", 32);
514
515 cpu_data(cpuid).icache_size =
516 of_getintprop_default(dp, "icache-size", 16 * 1024);
517 cpu_data(cpuid).icache_line_size =
518 of_getintprop_default(dp, "icache-line-size", 32);
519
520 cpu_data(cpuid).ecache_size =
521 of_getintprop_default(dp, "ecache-size",
522 (4 * 1024 * 1024));
523 cpu_data(cpuid).ecache_line_size =
524 of_getintprop_default(dp, "ecache-line-size", 64);
525
526 cpu_data(cpuid).core_id = 0;
527 cpu_data(cpuid).proc_id = -1;
524 } 528 }
525 529
530 return NULL;
531}
532
533void __init of_fill_in_cpu_data(void)
534{
535 if (tlb_type == hypervisor)
536 return;
537
538 of_iterate_over_cpus(fill_in_one_cpu, 0);
539
526 smp_fill_in_sib_core_maps(); 540 smp_fill_in_sib_core_maps();
527} 541}
528 542
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
index ff7b591c8946..0fb5789d43c8 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
@@ -313,6 +313,4 @@ void __init prom_build_devicetree(void)
313 313
314 printk("PROM: Built device tree with %u bytes of memory.\n", 314 printk("PROM: Built device tree with %u bytes of memory.\n",
315 prom_early_allocated); 315 prom_early_allocated);
316
317 of_fill_in_cpu_data();
318} 316}
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index f7642e5a94db..fa44eaf8d897 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -20,7 +20,8 @@
20#include <linux/cache.h> 20#include <linux/cache.h>
21#include <linux/jiffies.h> 21#include <linux/jiffies.h>
22#include <linux/profile.h> 22#include <linux/profile.h>
23#include <linux/lmb.h> 23#include <linux/bootmem.h>
24#include <linux/vmalloc.h>
24#include <linux/cpu.h> 25#include <linux/cpu.h>
25 26
26#include <asm/head.h> 27#include <asm/head.h>
@@ -47,6 +48,8 @@
47#include <asm/ldc.h> 48#include <asm/ldc.h>
48#include <asm/hypervisor.h> 49#include <asm/hypervisor.h>
49 50
51#include "cpumap.h"
52
50int sparc64_multi_core __read_mostly; 53int sparc64_multi_core __read_mostly;
51 54
52DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; 55DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE;
@@ -278,7 +281,7 @@ static unsigned long kimage_addr_to_ra(void *p)
278 return kern_base + (val - KERNBASE); 281 return kern_base + (val - KERNBASE);
279} 282}
280 283
281static void __cpuinit ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg) 284static void __cpuinit ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread_reg, void **descrp)
282{ 285{
283 extern unsigned long sparc64_ttable_tl0; 286 extern unsigned long sparc64_ttable_tl0;
284 extern unsigned long kern_locked_tte_data; 287 extern unsigned long kern_locked_tte_data;
@@ -298,12 +301,12 @@ static void __cpuinit ldom_startcpu_cpuid(unsigned int cpu, unsigned long thread
298 "hvtramp_descr.\n"); 301 "hvtramp_descr.\n");
299 return; 302 return;
300 } 303 }
304 *descrp = hdesc;
301 305
302 hdesc->cpu = cpu; 306 hdesc->cpu = cpu;
303 hdesc->num_mappings = num_kernel_image_mappings; 307 hdesc->num_mappings = num_kernel_image_mappings;
304 308
305 tb = &trap_block[cpu]; 309 tb = &trap_block[cpu];
306 tb->hdesc = hdesc;
307 310
308 hdesc->fault_info_va = (unsigned long) &tb->fault_info; 311 hdesc->fault_info_va = (unsigned long) &tb->fault_info;
309 hdesc->fault_info_pa = kimage_addr_to_ra(&tb->fault_info); 312 hdesc->fault_info_pa = kimage_addr_to_ra(&tb->fault_info);
@@ -341,12 +344,12 @@ static struct thread_info *cpu_new_thread = NULL;
341 344
342static int __cpuinit smp_boot_one_cpu(unsigned int cpu) 345static int __cpuinit smp_boot_one_cpu(unsigned int cpu)
343{ 346{
344 struct trap_per_cpu *tb = &trap_block[cpu];
345 unsigned long entry = 347 unsigned long entry =
346 (unsigned long)(&sparc64_cpu_startup); 348 (unsigned long)(&sparc64_cpu_startup);
347 unsigned long cookie = 349 unsigned long cookie =
348 (unsigned long)(&cpu_new_thread); 350 (unsigned long)(&cpu_new_thread);
349 struct task_struct *p; 351 struct task_struct *p;
352 void *descr = NULL;
350 int timeout, ret; 353 int timeout, ret;
351 354
352 p = fork_idle(cpu); 355 p = fork_idle(cpu);
@@ -359,7 +362,8 @@ static int __cpuinit smp_boot_one_cpu(unsigned int cpu)
359#if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU) 362#if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU)
360 if (ldom_domaining_enabled) 363 if (ldom_domaining_enabled)
361 ldom_startcpu_cpuid(cpu, 364 ldom_startcpu_cpuid(cpu,
362 (unsigned long) cpu_new_thread); 365 (unsigned long) cpu_new_thread,
366 &descr);
363 else 367 else
364#endif 368#endif
365 prom_startcpu_cpuid(cpu, entry, cookie); 369 prom_startcpu_cpuid(cpu, entry, cookie);
@@ -383,10 +387,7 @@ static int __cpuinit smp_boot_one_cpu(unsigned int cpu)
383 } 387 }
384 cpu_new_thread = NULL; 388 cpu_new_thread = NULL;
385 389
386 if (tb->hdesc) { 390 kfree(descr);
387 kfree(tb->hdesc);
388 tb->hdesc = NULL;
389 }
390 391
391 return ret; 392 return ret;
392} 393}
@@ -1315,6 +1316,8 @@ int __cpu_disable(void)
1315 cpu_clear(cpu, cpu_online_map); 1316 cpu_clear(cpu, cpu_online_map);
1316 ipi_call_unlock(); 1317 ipi_call_unlock();
1317 1318
1319 cpu_map_rebuild();
1320
1318 return 0; 1321 return 0;
1319} 1322}
1320 1323
@@ -1373,36 +1376,171 @@ void smp_send_stop(void)
1373{ 1376{
1374} 1377}
1375 1378
1376unsigned long __per_cpu_base __read_mostly; 1379/**
1377unsigned long __per_cpu_shift __read_mostly; 1380 * pcpu_alloc_bootmem - NUMA friendly alloc_bootmem wrapper for percpu
1381 * @cpu: cpu to allocate for
1382 * @size: size allocation in bytes
1383 * @align: alignment
1384 *
1385 * Allocate @size bytes aligned at @align for cpu @cpu. This wrapper
1386 * does the right thing for NUMA regardless of the current
1387 * configuration.
1388 *
1389 * RETURNS:
1390 * Pointer to the allocated area on success, NULL on failure.
1391 */
1392static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
1393 unsigned long align)
1394{
1395 const unsigned long goal = __pa(MAX_DMA_ADDRESS);
1396#ifdef CONFIG_NEED_MULTIPLE_NODES
1397 int node = cpu_to_node(cpu);
1398 void *ptr;
1399
1400 if (!node_online(node) || !NODE_DATA(node)) {
1401 ptr = __alloc_bootmem(size, align, goal);
1402 pr_info("cpu %d has no node %d or node-local memory\n",
1403 cpu, node);
1404 pr_debug("per cpu data for cpu%d %lu bytes at %016lx\n",
1405 cpu, size, __pa(ptr));
1406 } else {
1407 ptr = __alloc_bootmem_node(NODE_DATA(node),
1408 size, align, goal);
1409 pr_debug("per cpu data for cpu%d %lu bytes on node%d at "
1410 "%016lx\n", cpu, size, node, __pa(ptr));
1411 }
1412 return ptr;
1413#else
1414 return __alloc_bootmem(size, align, goal);
1415#endif
1416}
1378 1417
1379EXPORT_SYMBOL(__per_cpu_base); 1418static size_t pcpur_size __initdata;
1380EXPORT_SYMBOL(__per_cpu_shift); 1419static void **pcpur_ptrs __initdata;
1381 1420
1382void __init real_setup_per_cpu_areas(void) 1421static struct page * __init pcpur_get_page(unsigned int cpu, int pageno)
1383{ 1422{
1384 unsigned long paddr, goal, size, i; 1423 size_t off = (size_t)pageno << PAGE_SHIFT;
1385 char *ptr;
1386 1424
1387 /* Copy section for each CPU (we discard the original) */ 1425 if (off >= pcpur_size)
1388 goal = PERCPU_ENOUGH_ROOM; 1426 return NULL;
1389 1427
1390 __per_cpu_shift = PAGE_SHIFT; 1428 return virt_to_page(pcpur_ptrs[cpu] + off);
1391 for (size = PAGE_SIZE; size < goal; size <<= 1UL) 1429}
1392 __per_cpu_shift++; 1430
1431#define PCPU_CHUNK_SIZE (4UL * 1024UL * 1024UL)
1432
1433static void __init pcpu_map_range(unsigned long start, unsigned long end,
1434 struct page *page)
1435{
1436 unsigned long pfn = page_to_pfn(page);
1437 unsigned long pte_base;
1438
1439 BUG_ON((pfn<<PAGE_SHIFT)&(PCPU_CHUNK_SIZE - 1UL));
1440
1441 pte_base = (_PAGE_VALID | _PAGE_SZ4MB_4U |
1442 _PAGE_CP_4U | _PAGE_CV_4U |
1443 _PAGE_P_4U | _PAGE_W_4U);
1444 if (tlb_type == hypervisor)
1445 pte_base = (_PAGE_VALID | _PAGE_SZ4MB_4V |
1446 _PAGE_CP_4V | _PAGE_CV_4V |
1447 _PAGE_P_4V | _PAGE_W_4V);
1448
1449 while (start < end) {
1450 pgd_t *pgd = pgd_offset_k(start);
1451 unsigned long this_end;
1452 pud_t *pud;
1453 pmd_t *pmd;
1454 pte_t *pte;
1455
1456 pud = pud_offset(pgd, start);
1457 if (pud_none(*pud)) {
1458 pmd_t *new;
1459
1460 new = __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE);
1461 pud_populate(&init_mm, pud, new);
1462 }
1463
1464 pmd = pmd_offset(pud, start);
1465 if (!pmd_present(*pmd)) {
1466 pte_t *new;
1467
1468 new = __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE);
1469 pmd_populate_kernel(&init_mm, pmd, new);
1470 }
1393 1471
1394 paddr = lmb_alloc(size * NR_CPUS, PAGE_SIZE); 1472 pte = pte_offset_kernel(pmd, start);
1395 if (!paddr) { 1473 this_end = (start + PMD_SIZE) & PMD_MASK;
1396 prom_printf("Cannot allocate per-cpu memory.\n"); 1474 if (this_end > end)
1397 prom_halt(); 1475 this_end = end;
1476
1477 while (start < this_end) {
1478 unsigned long paddr = pfn << PAGE_SHIFT;
1479
1480 pte_val(*pte) = (paddr | pte_base);
1481
1482 start += PAGE_SIZE;
1483 pte++;
1484 pfn++;
1485 }
1486 }
1487}
1488
1489void __init setup_per_cpu_areas(void)
1490{
1491 size_t dyn_size, static_size = __per_cpu_end - __per_cpu_start;
1492 static struct vm_struct vm;
1493 unsigned long delta, cpu;
1494 size_t pcpu_unit_size;
1495 size_t ptrs_size;
1496
1497 pcpur_size = PFN_ALIGN(static_size + PERCPU_MODULE_RESERVE +
1498 PERCPU_DYNAMIC_RESERVE);
1499 dyn_size = pcpur_size - static_size - PERCPU_MODULE_RESERVE;
1500
1501
1502 ptrs_size = PFN_ALIGN(num_possible_cpus() * sizeof(pcpur_ptrs[0]));
1503 pcpur_ptrs = alloc_bootmem(ptrs_size);
1504
1505 for_each_possible_cpu(cpu) {
1506 pcpur_ptrs[cpu] = pcpu_alloc_bootmem(cpu, PCPU_CHUNK_SIZE,
1507 PCPU_CHUNK_SIZE);
1508
1509 free_bootmem(__pa(pcpur_ptrs[cpu] + pcpur_size),
1510 PCPU_CHUNK_SIZE - pcpur_size);
1511
1512 memcpy(pcpur_ptrs[cpu], __per_cpu_load, static_size);
1398 } 1513 }
1399 1514
1400 ptr = __va(paddr); 1515 /* allocate address and map */
1401 __per_cpu_base = ptr - __per_cpu_start; 1516 vm.flags = VM_ALLOC;
1517 vm.size = num_possible_cpus() * PCPU_CHUNK_SIZE;
1518 vm_area_register_early(&vm, PCPU_CHUNK_SIZE);
1519
1520 for_each_possible_cpu(cpu) {
1521 unsigned long start = (unsigned long) vm.addr;
1522 unsigned long end;
1523
1524 start += cpu * PCPU_CHUNK_SIZE;
1525 end = start + PCPU_CHUNK_SIZE;
1526 pcpu_map_range(start, end, virt_to_page(pcpur_ptrs[cpu]));
1527 }
1402 1528
1403 for (i = 0; i < NR_CPUS; i++, ptr += size) 1529 pcpu_unit_size = pcpu_setup_first_chunk(pcpur_get_page, static_size,
1404 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); 1530 PERCPU_MODULE_RESERVE, dyn_size,
1531 PCPU_CHUNK_SIZE, vm.addr, NULL);
1532
1533 free_bootmem(__pa(pcpur_ptrs), ptrs_size);
1534
1535 delta = (unsigned long)pcpu_base_addr - (unsigned long)__per_cpu_start;
1536 for_each_possible_cpu(cpu) {
1537 __per_cpu_offset(cpu) = delta + cpu * pcpu_unit_size;
1538 }
1405 1539
1406 /* Setup %g5 for the boot cpu. */ 1540 /* Setup %g5 for the boot cpu. */
1407 __local_per_cpu_offset = __per_cpu_offset(smp_processor_id()); 1541 __local_per_cpu_offset = __per_cpu_offset(smp_processor_id());
1542
1543 of_fill_in_cpu_data();
1544 if (tlb_type == hypervisor)
1545 mdesc_fill_in_cpu_data(cpu_all_mask);
1408} 1546}
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S
index 00ec3b15f38c..690901657291 100644
--- a/arch/sparc/kernel/systbls_32.S
+++ b/arch/sparc/kernel/systbls_32.S
@@ -81,4 +81,6 @@ sys_call_table:
81/*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait 81/*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
82/*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate 82/*310*/ .long sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate
83/*315*/ .long sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 83/*315*/ .long sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1
84/*320*/ .long sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv, sys_pwritev 84/*320*/ .long sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv
85/*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo
86
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index 82b5bf85b9d2..6b3ee88e253c 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -82,7 +82,8 @@ sys_call_table32:
82 .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait 82 .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait
83/*310*/ .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate 83/*310*/ .word compat_sys_utimensat, compat_sys_signalfd, sys_timerfd_create, sys_eventfd, compat_sys_fallocate
84 .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1 84 .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1
85/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, compat_sys_preadv, compat_sys_pwritev 85/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, compat_sys_preadv
86 .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo
86 87
87#endif /* CONFIG_COMPAT */ 88#endif /* CONFIG_COMPAT */
88 89
@@ -156,4 +157,5 @@ sys_call_table:
156 .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait 157 .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait
157/*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate 158/*310*/ .word sys_utimensat, sys_signalfd, sys_timerfd_create, sys_eventfd, sys_fallocate
158 .word sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1 159 .word sys_timerfd_settime, sys_timerfd_gettime, sys_signalfd4, sys_eventfd2, sys_epoll_create1
159/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv, sys_pwritev 160/*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, sys_preadv
161 .word sys_pwritev, sys_rt_tgsigqueueinfo
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index d809c4ebb48f..10f7bb9fc140 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -2509,6 +2509,7 @@ void do_getpsr(struct pt_regs *regs)
2509} 2509}
2510 2510
2511struct trap_per_cpu trap_block[NR_CPUS]; 2511struct trap_per_cpu trap_block[NR_CPUS];
2512EXPORT_SYMBOL(trap_block);
2512 2513
2513/* This can get invoked before sched_init() so play it super safe 2514/* This can get invoked before sched_init() so play it super safe
2514 * and use hard_smp_processor_id(). 2515 * and use hard_smp_processor_id().
@@ -2530,84 +2531,97 @@ extern void tsb_config_offsets_are_bolixed_dave(void);
2530void __init trap_init(void) 2531void __init trap_init(void)
2531{ 2532{
2532 /* Compile time sanity check. */ 2533 /* Compile time sanity check. */
2533 if (TI_TASK != offsetof(struct thread_info, task) || 2534 BUILD_BUG_ON(TI_TASK != offsetof(struct thread_info, task) ||
2534 TI_FLAGS != offsetof(struct thread_info, flags) || 2535 TI_FLAGS != offsetof(struct thread_info, flags) ||
2535 TI_CPU != offsetof(struct thread_info, cpu) || 2536 TI_CPU != offsetof(struct thread_info, cpu) ||
2536 TI_FPSAVED != offsetof(struct thread_info, fpsaved) || 2537 TI_FPSAVED != offsetof(struct thread_info, fpsaved) ||
2537 TI_KSP != offsetof(struct thread_info, ksp) || 2538 TI_KSP != offsetof(struct thread_info, ksp) ||
2538 TI_FAULT_ADDR != offsetof(struct thread_info, fault_address) || 2539 TI_FAULT_ADDR != offsetof(struct thread_info,
2539 TI_KREGS != offsetof(struct thread_info, kregs) || 2540 fault_address) ||
2540 TI_UTRAPS != offsetof(struct thread_info, utraps) || 2541 TI_KREGS != offsetof(struct thread_info, kregs) ||
2541 TI_EXEC_DOMAIN != offsetof(struct thread_info, exec_domain) || 2542 TI_UTRAPS != offsetof(struct thread_info, utraps) ||
2542 TI_REG_WINDOW != offsetof(struct thread_info, reg_window) || 2543 TI_EXEC_DOMAIN != offsetof(struct thread_info,
2543 TI_RWIN_SPTRS != offsetof(struct thread_info, rwbuf_stkptrs) || 2544 exec_domain) ||
2544 TI_GSR != offsetof(struct thread_info, gsr) || 2545 TI_REG_WINDOW != offsetof(struct thread_info,
2545 TI_XFSR != offsetof(struct thread_info, xfsr) || 2546 reg_window) ||
2546 TI_USER_CNTD0 != offsetof(struct thread_info, user_cntd0) || 2547 TI_RWIN_SPTRS != offsetof(struct thread_info,
2547 TI_USER_CNTD1 != offsetof(struct thread_info, user_cntd1) || 2548 rwbuf_stkptrs) ||
2548 TI_KERN_CNTD0 != offsetof(struct thread_info, kernel_cntd0) || 2549 TI_GSR != offsetof(struct thread_info, gsr) ||
2549 TI_KERN_CNTD1 != offsetof(struct thread_info, kernel_cntd1) || 2550 TI_XFSR != offsetof(struct thread_info, xfsr) ||
2550 TI_PCR != offsetof(struct thread_info, pcr_reg) || 2551 TI_USER_CNTD0 != offsetof(struct thread_info,
2551 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || 2552 user_cntd0) ||
2552 TI_NEW_CHILD != offsetof(struct thread_info, new_child) || 2553 TI_USER_CNTD1 != offsetof(struct thread_info,
2553 TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || 2554 user_cntd1) ||
2554 TI_RESTART_BLOCK != offsetof(struct thread_info, restart_block) || 2555 TI_KERN_CNTD0 != offsetof(struct thread_info,
2555 TI_KUNA_REGS != offsetof(struct thread_info, kern_una_regs) || 2556 kernel_cntd0) ||
2556 TI_KUNA_INSN != offsetof(struct thread_info, kern_una_insn) || 2557 TI_KERN_CNTD1 != offsetof(struct thread_info,
2557 TI_FPREGS != offsetof(struct thread_info, fpregs) || 2558 kernel_cntd1) ||
2558 (TI_FPREGS & (64 - 1))) 2559 TI_PCR != offsetof(struct thread_info, pcr_reg) ||
2559 thread_info_offsets_are_bolixed_dave(); 2560 TI_PRE_COUNT != offsetof(struct thread_info,
2560 2561 preempt_count) ||
2561 if (TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu, thread) || 2562 TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
2562 (TRAP_PER_CPU_PGD_PADDR != 2563 TI_SYS_NOERROR != offsetof(struct thread_info,
2563 offsetof(struct trap_per_cpu, pgd_paddr)) || 2564 syscall_noerror) ||
2564 (TRAP_PER_CPU_CPU_MONDO_PA != 2565 TI_RESTART_BLOCK != offsetof(struct thread_info,
2565 offsetof(struct trap_per_cpu, cpu_mondo_pa)) || 2566 restart_block) ||
2566 (TRAP_PER_CPU_DEV_MONDO_PA != 2567 TI_KUNA_REGS != offsetof(struct thread_info,
2567 offsetof(struct trap_per_cpu, dev_mondo_pa)) || 2568 kern_una_regs) ||
2568 (TRAP_PER_CPU_RESUM_MONDO_PA != 2569 TI_KUNA_INSN != offsetof(struct thread_info,
2569 offsetof(struct trap_per_cpu, resum_mondo_pa)) || 2570 kern_una_insn) ||
2570 (TRAP_PER_CPU_RESUM_KBUF_PA != 2571 TI_FPREGS != offsetof(struct thread_info, fpregs) ||
2571 offsetof(struct trap_per_cpu, resum_kernel_buf_pa)) || 2572 (TI_FPREGS & (64 - 1)));
2572 (TRAP_PER_CPU_NONRESUM_MONDO_PA != 2573
2573 offsetof(struct trap_per_cpu, nonresum_mondo_pa)) || 2574 BUILD_BUG_ON(TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu,
2574 (TRAP_PER_CPU_NONRESUM_KBUF_PA != 2575 thread) ||
2575 offsetof(struct trap_per_cpu, nonresum_kernel_buf_pa)) || 2576 (TRAP_PER_CPU_PGD_PADDR !=
2576 (TRAP_PER_CPU_FAULT_INFO != 2577 offsetof(struct trap_per_cpu, pgd_paddr)) ||
2577 offsetof(struct trap_per_cpu, fault_info)) || 2578 (TRAP_PER_CPU_CPU_MONDO_PA !=
2578 (TRAP_PER_CPU_CPU_MONDO_BLOCK_PA != 2579 offsetof(struct trap_per_cpu, cpu_mondo_pa)) ||
2579 offsetof(struct trap_per_cpu, cpu_mondo_block_pa)) || 2580 (TRAP_PER_CPU_DEV_MONDO_PA !=
2580 (TRAP_PER_CPU_CPU_LIST_PA != 2581 offsetof(struct trap_per_cpu, dev_mondo_pa)) ||
2581 offsetof(struct trap_per_cpu, cpu_list_pa)) || 2582 (TRAP_PER_CPU_RESUM_MONDO_PA !=
2582 (TRAP_PER_CPU_TSB_HUGE != 2583 offsetof(struct trap_per_cpu, resum_mondo_pa)) ||
2583 offsetof(struct trap_per_cpu, tsb_huge)) || 2584 (TRAP_PER_CPU_RESUM_KBUF_PA !=
2584 (TRAP_PER_CPU_TSB_HUGE_TEMP != 2585 offsetof(struct trap_per_cpu, resum_kernel_buf_pa)) ||
2585 offsetof(struct trap_per_cpu, tsb_huge_temp)) || 2586 (TRAP_PER_CPU_NONRESUM_MONDO_PA !=
2586 (TRAP_PER_CPU_IRQ_WORKLIST_PA != 2587 offsetof(struct trap_per_cpu, nonresum_mondo_pa)) ||
2587 offsetof(struct trap_per_cpu, irq_worklist_pa)) || 2588 (TRAP_PER_CPU_NONRESUM_KBUF_PA !=
2588 (TRAP_PER_CPU_CPU_MONDO_QMASK != 2589 offsetof(struct trap_per_cpu, nonresum_kernel_buf_pa)) ||
2589 offsetof(struct trap_per_cpu, cpu_mondo_qmask)) || 2590 (TRAP_PER_CPU_FAULT_INFO !=
2590 (TRAP_PER_CPU_DEV_MONDO_QMASK != 2591 offsetof(struct trap_per_cpu, fault_info)) ||
2591 offsetof(struct trap_per_cpu, dev_mondo_qmask)) || 2592 (TRAP_PER_CPU_CPU_MONDO_BLOCK_PA !=
2592 (TRAP_PER_CPU_RESUM_QMASK != 2593 offsetof(struct trap_per_cpu, cpu_mondo_block_pa)) ||
2593 offsetof(struct trap_per_cpu, resum_qmask)) || 2594 (TRAP_PER_CPU_CPU_LIST_PA !=
2594 (TRAP_PER_CPU_NONRESUM_QMASK != 2595 offsetof(struct trap_per_cpu, cpu_list_pa)) ||
2595 offsetof(struct trap_per_cpu, nonresum_qmask))) 2596 (TRAP_PER_CPU_TSB_HUGE !=
2596 trap_per_cpu_offsets_are_bolixed_dave(); 2597 offsetof(struct trap_per_cpu, tsb_huge)) ||
2597 2598 (TRAP_PER_CPU_TSB_HUGE_TEMP !=
2598 if ((TSB_CONFIG_TSB != 2599 offsetof(struct trap_per_cpu, tsb_huge_temp)) ||
2599 offsetof(struct tsb_config, tsb)) || 2600 (TRAP_PER_CPU_IRQ_WORKLIST_PA !=
2600 (TSB_CONFIG_RSS_LIMIT != 2601 offsetof(struct trap_per_cpu, irq_worklist_pa)) ||
2601 offsetof(struct tsb_config, tsb_rss_limit)) || 2602 (TRAP_PER_CPU_CPU_MONDO_QMASK !=
2602 (TSB_CONFIG_NENTRIES != 2603 offsetof(struct trap_per_cpu, cpu_mondo_qmask)) ||
2603 offsetof(struct tsb_config, tsb_nentries)) || 2604 (TRAP_PER_CPU_DEV_MONDO_QMASK !=
2604 (TSB_CONFIG_REG_VAL != 2605 offsetof(struct trap_per_cpu, dev_mondo_qmask)) ||
2605 offsetof(struct tsb_config, tsb_reg_val)) || 2606 (TRAP_PER_CPU_RESUM_QMASK !=
2606 (TSB_CONFIG_MAP_VADDR != 2607 offsetof(struct trap_per_cpu, resum_qmask)) ||
2607 offsetof(struct tsb_config, tsb_map_vaddr)) || 2608 (TRAP_PER_CPU_NONRESUM_QMASK !=
2608 (TSB_CONFIG_MAP_PTE != 2609 offsetof(struct trap_per_cpu, nonresum_qmask)) ||
2609 offsetof(struct tsb_config, tsb_map_pte))) 2610 (TRAP_PER_CPU_PER_CPU_BASE !=
2610 tsb_config_offsets_are_bolixed_dave(); 2611 offsetof(struct trap_per_cpu, __per_cpu_base)));
2612
2613 BUILD_BUG_ON((TSB_CONFIG_TSB !=
2614 offsetof(struct tsb_config, tsb)) ||
2615 (TSB_CONFIG_RSS_LIMIT !=
2616 offsetof(struct tsb_config, tsb_rss_limit)) ||
2617 (TSB_CONFIG_NENTRIES !=
2618 offsetof(struct tsb_config, tsb_nentries)) ||
2619 (TSB_CONFIG_REG_VAL !=
2620 offsetof(struct tsb_config, tsb_reg_val)) ||
2621 (TSB_CONFIG_MAP_VADDR !=
2622 offsetof(struct tsb_config, tsb_map_vaddr)) ||
2623 (TSB_CONFIG_MAP_PTE !=
2624 offsetof(struct tsb_config, tsb_map_pte)));
2611 2625
2612 /* Attach to the address space of init_task. On SMP we 2626 /* Attach to the address space of init_task. On SMP we
2613 * do this in smp.c:smp_callin for other cpus. 2627 * do this in smp.c:smp_callin for other cpus.
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index cbb282dab5a7..26bb3919ff1f 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -358,6 +358,7 @@ void __init paging_init(void)
358 protection_map[15] = PAGE_SHARED; 358 protection_map[15] = PAGE_SHARED;
359 btfixup(); 359 btfixup();
360 prom_build_devicetree(); 360 prom_build_devicetree();
361 of_fill_in_cpu_data();
361 device_scan(); 362 device_scan();
362} 363}
363 364
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index f26a352c08a0..ca92e2f54e4d 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -1679,11 +1679,6 @@ pgd_t swapper_pg_dir[2048];
1679static void sun4u_pgprot_init(void); 1679static void sun4u_pgprot_init(void);
1680static void sun4v_pgprot_init(void); 1680static void sun4v_pgprot_init(void);
1681 1681
1682/* Dummy function */
1683void __init setup_per_cpu_areas(void)
1684{
1685}
1686
1687void __init paging_init(void) 1682void __init paging_init(void)
1688{ 1683{
1689 unsigned long end_pfn, shift, phys_base; 1684 unsigned long end_pfn, shift, phys_base;
@@ -1799,16 +1794,13 @@ void __init paging_init(void)
1799 if (tlb_type == hypervisor) 1794 if (tlb_type == hypervisor)
1800 sun4v_ktsb_register(); 1795 sun4v_ktsb_register();
1801 1796
1802 /* We must setup the per-cpu areas before we pull in the
1803 * PROM and the MDESC. The code there fills in cpu and
1804 * other information into per-cpu data structures.
1805 */
1806 real_setup_per_cpu_areas();
1807
1808 prom_build_devicetree(); 1797 prom_build_devicetree();
1798 of_populate_present_mask();
1809 1799
1810 if (tlb_type == hypervisor) 1800 if (tlb_type == hypervisor) {
1811 sun4v_mdesc_init(); 1801 sun4v_mdesc_init();
1802 mdesc_populate_present_mask(cpu_all_mask);
1803 }
1812 1804
1813 /* Once the OF device tree and MDESC have been setup, we know 1805 /* Once the OF device tree and MDESC have been setup, we know
1814 * the list of possible cpus. Therefore we can allocate the 1806 * the list of possible cpus. Therefore we can allocate the
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 06c9a7d98206..ade4eb373bdd 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -19,6 +19,7 @@
19#include <linux/fs.h> 19#include <linux/fs.h>
20#include <linux/seq_file.h> 20#include <linux/seq_file.h>
21#include <linux/kdebug.h> 21#include <linux/kdebug.h>
22#include <linux/log2.h>
22 23
23#include <asm/bitext.h> 24#include <asm/bitext.h>
24#include <asm/page.h> 25#include <asm/page.h>
@@ -349,7 +350,7 @@ static void srmmu_free_nocache(unsigned long vaddr, int size)
349 vaddr, srmmu_nocache_end); 350 vaddr, srmmu_nocache_end);
350 BUG(); 351 BUG();
351 } 352 }
352 if (size & (size-1)) { 353 if (!is_power_of_2(size)) {
353 printk("Size 0x%x is not a power of 2\n", size); 354 printk("Size 0x%x is not a power of 2\n", size);
354 BUG(); 355 BUG();
355 } 356 }
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 434ba121e3c5..3b44b47c7e1d 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -360,7 +360,7 @@ static struct platform_driver uml_net_driver = {
360 360
361static void net_device_release(struct device *dev) 361static void net_device_release(struct device *dev)
362{ 362{
363 struct uml_net *device = dev->driver_data; 363 struct uml_net *device = dev_get_drvdata(dev);
364 struct net_device *netdev = device->dev; 364 struct net_device *netdev = device->dev;
365 struct uml_net_private *lp = netdev_priv(netdev); 365 struct uml_net_private *lp = netdev_priv(netdev);
366 366
@@ -440,7 +440,7 @@ static void eth_configure(int n, void *init, char *mac,
440 device->pdev.id = n; 440 device->pdev.id = n;
441 device->pdev.name = DRIVER_NAME; 441 device->pdev.name = DRIVER_NAME;
442 device->pdev.dev.release = net_device_release; 442 device->pdev.dev.release = net_device_release;
443 device->pdev.dev.driver_data = device; 443 dev_set_drvdata(&device->pdev.dev, device);
444 if (platform_device_register(&device->pdev)) 444 if (platform_device_register(&device->pdev))
445 goto out_free_netdev; 445 goto out_free_netdev;
446 SET_NETDEV_DEV(dev,&device->pdev.dev); 446 SET_NETDEV_DEV(dev,&device->pdev.dev);
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index aa9e926e13d7..8f05d4d9da12 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -778,7 +778,7 @@ static int ubd_open_dev(struct ubd *ubd_dev)
778 778
779static void ubd_device_release(struct device *dev) 779static void ubd_device_release(struct device *dev)
780{ 780{
781 struct ubd *ubd_dev = dev->driver_data; 781 struct ubd *ubd_dev = dev_get_drvdata(dev);
782 782
783 blk_cleanup_queue(ubd_dev->queue); 783 blk_cleanup_queue(ubd_dev->queue);
784 *ubd_dev = ((struct ubd) DEFAULT_UBD); 784 *ubd_dev = ((struct ubd) DEFAULT_UBD);
@@ -807,7 +807,7 @@ static int ubd_disk_register(int major, u64 size, int unit,
807 ubd_devs[unit].pdev.id = unit; 807 ubd_devs[unit].pdev.id = unit;
808 ubd_devs[unit].pdev.name = DRIVER_NAME; 808 ubd_devs[unit].pdev.name = DRIVER_NAME;
809 ubd_devs[unit].pdev.dev.release = ubd_device_release; 809 ubd_devs[unit].pdev.dev.release = ubd_device_release;
810 ubd_devs[unit].pdev.dev.driver_data = &ubd_devs[unit]; 810 dev_set_drvdata(&ubd_devs[unit].pdev.dev, &ubd_devs[unit]);
811 platform_device_register(&ubd_devs[unit].pdev); 811 platform_device_register(&ubd_devs[unit].pdev);
812 disk->driverfs_dev = &ubd_devs[unit].pdev.dev; 812 disk->driverfs_dev = &ubd_devs[unit].pdev.dev;
813 } 813 }
diff --git a/arch/um/include/shared/init.h b/arch/um/include/shared/init.h
index 37dd097c16c0..b3906f860a87 100644
--- a/arch/um/include/shared/init.h
+++ b/arch/um/include/shared/init.h
@@ -27,7 +27,7 @@
27 * sign followed by value, e.g.: 27 * sign followed by value, e.g.:
28 * 28 *
29 * static int init_variable __initdata = 0; 29 * static int init_variable __initdata = 0;
30 * static char linux_logo[] __initdata = { 0x32, 0x36, ... }; 30 * static const char linux_logo[] __initconst = { 0x32, 0x36, ... };
31 * 31 *
32 * Don't forget to initialize data not at file scope, i.e. within a function, 32 * Don't forget to initialize data not at file scope, i.e. within a function,
33 * as gcc otherwise puts the data into the bss section and not into the init 33 * as gcc otherwise puts the data into the bss section and not into the init
diff --git a/arch/um/include/shared/net_user.h b/arch/um/include/shared/net_user.h
index 63bee158cd8e..3dabbe128e40 100644
--- a/arch/um/include/shared/net_user.h
+++ b/arch/um/include/shared/net_user.h
@@ -8,7 +8,7 @@
8 8
9#define ETH_ADDR_LEN (6) 9#define ETH_ADDR_LEN (6)
10#define ETH_HEADER_ETHERTAP (16) 10#define ETH_HEADER_ETHERTAP (16)
11#define ETH_HEADER_OTHER (14) 11#define ETH_HEADER_OTHER (26) /* 14 for ethernet + VLAN + MPLS for crazy people */
12#define ETH_MAX_PACKET (1500) 12#define ETH_MAX_PACKET (1500)
13 13
14#define UML_NET_VERSION (4) 14#define UML_NET_VERSION (4)
diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c
index 806d381947bf..b25121b537d8 100644
--- a/arch/um/kernel/init_task.c
+++ b/arch/um/kernel/init_task.c
@@ -10,11 +10,8 @@
10#include "linux/mqueue.h" 10#include "linux/mqueue.h"
11#include "asm/uaccess.h" 11#include "asm/uaccess.h"
12 12
13struct mm_struct init_mm = INIT_MM(init_mm);
14static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 13static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
15static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 14static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
16EXPORT_SYMBOL(init_mm);
17
18/* 15/*
19 * Initial task structure. 16 * Initial task structure.
20 * 17 *
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index 336b61569072..454cdb43e351 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -358,7 +358,7 @@ EXPORT_SYMBOL(um_request_irq);
358EXPORT_SYMBOL(reactivate_fd); 358EXPORT_SYMBOL(reactivate_fd);
359 359
360/* 360/*
361 * hw_interrupt_type must define (startup || enable) && 361 * irq_chip must define (startup || enable) &&
362 * (shutdown || disable) && end 362 * (shutdown || disable) && end
363 */ 363 */
364static void dummy(unsigned int irq) 364static void dummy(unsigned int irq)
@@ -366,7 +366,7 @@ static void dummy(unsigned int irq)
366} 366}
367 367
368/* This is used for everything else than the timer. */ 368/* This is used for everything else than the timer. */
369static struct hw_interrupt_type normal_irq_type = { 369static struct irq_chip normal_irq_type = {
370 .typename = "SIGIO", 370 .typename = "SIGIO",
371 .release = free_irq_by_irq_and_dev, 371 .release = free_irq_by_irq_and_dev,
372 .disable = dummy, 372 .disable = dummy,
@@ -375,7 +375,7 @@ static struct hw_interrupt_type normal_irq_type = {
375 .end = dummy 375 .end = dummy
376}; 376};
377 377
378static struct hw_interrupt_type SIGVTALRM_irq_type = { 378static struct irq_chip SIGVTALRM_irq_type = {
379 .typename = "SIGVTALRM", 379 .typename = "SIGVTALRM",
380 .release = free_irq_by_irq_and_dev, 380 .release = free_irq_by_irq_and_dev,
381 .shutdown = dummy, /* never called */ 381 .shutdown = dummy, /* never called */
diff --git a/arch/um/sys-i386/stub.S b/arch/um/sys-i386/stub.S
index c41b04bf5fa0..54a36ec20cb7 100644
--- a/arch/um/sys-i386/stub.S
+++ b/arch/um/sys-i386/stub.S
@@ -1,7 +1,7 @@
1#include "as-layout.h" 1#include "as-layout.h"
2 2
3 .globl syscall_stub 3 .globl syscall_stub
4.section .__syscall_stub, "x" 4.section .__syscall_stub, "ax"
5 5
6 .globl batch_syscall_stub 6 .globl batch_syscall_stub
7batch_syscall_stub: 7batch_syscall_stub:
diff --git a/arch/um/sys-x86_64/asm/elf.h b/arch/um/sys-x86_64/asm/elf.h
index 6e8a9195e952..04b9e87c8dad 100644
--- a/arch/um/sys-x86_64/asm/elf.h
+++ b/arch/um/sys-x86_64/asm/elf.h
@@ -66,28 +66,28 @@ typedef struct user_i387_struct elf_fpregset_t;
66 PT_REGS_R15(regs) = 0; \ 66 PT_REGS_R15(regs) = 0; \
67} while (0) 67} while (0)
68 68
69#define ELF_CORE_COPY_REGS(pr_reg, regs) \ 69#define ELF_CORE_COPY_REGS(pr_reg, _regs) \
70 (pr_reg)[0] = (regs)->regs.gp[0]; \ 70 (pr_reg)[0] = (_regs)->regs.gp[0]; \
71 (pr_reg)[1] = (regs)->regs.gp[1]; \ 71 (pr_reg)[1] = (_regs)->regs.gp[1]; \
72 (pr_reg)[2] = (regs)->regs.gp[2]; \ 72 (pr_reg)[2] = (_regs)->regs.gp[2]; \
73 (pr_reg)[3] = (regs)->regs.gp[3]; \ 73 (pr_reg)[3] = (_regs)->regs.gp[3]; \
74 (pr_reg)[4] = (regs)->regs.gp[4]; \ 74 (pr_reg)[4] = (_regs)->regs.gp[4]; \
75 (pr_reg)[5] = (regs)->regs.gp[5]; \ 75 (pr_reg)[5] = (_regs)->regs.gp[5]; \
76 (pr_reg)[6] = (regs)->regs.gp[6]; \ 76 (pr_reg)[6] = (_regs)->regs.gp[6]; \
77 (pr_reg)[7] = (regs)->regs.gp[7]; \ 77 (pr_reg)[7] = (_regs)->regs.gp[7]; \
78 (pr_reg)[8] = (regs)->regs.gp[8]; \ 78 (pr_reg)[8] = (_regs)->regs.gp[8]; \
79 (pr_reg)[9] = (regs)->regs.gp[9]; \ 79 (pr_reg)[9] = (_regs)->regs.gp[9]; \
80 (pr_reg)[10] = (regs)->regs.gp[10]; \ 80 (pr_reg)[10] = (_regs)->regs.gp[10]; \
81 (pr_reg)[11] = (regs)->regs.gp[11]; \ 81 (pr_reg)[11] = (_regs)->regs.gp[11]; \
82 (pr_reg)[12] = (regs)->regs.gp[12]; \ 82 (pr_reg)[12] = (_regs)->regs.gp[12]; \
83 (pr_reg)[13] = (regs)->regs.gp[13]; \ 83 (pr_reg)[13] = (_regs)->regs.gp[13]; \
84 (pr_reg)[14] = (regs)->regs.gp[14]; \ 84 (pr_reg)[14] = (_regs)->regs.gp[14]; \
85 (pr_reg)[15] = (regs)->regs.gp[15]; \ 85 (pr_reg)[15] = (_regs)->regs.gp[15]; \
86 (pr_reg)[16] = (regs)->regs.gp[16]; \ 86 (pr_reg)[16] = (_regs)->regs.gp[16]; \
87 (pr_reg)[17] = (regs)->regs.gp[17]; \ 87 (pr_reg)[17] = (_regs)->regs.gp[17]; \
88 (pr_reg)[18] = (regs)->regs.gp[18]; \ 88 (pr_reg)[18] = (_regs)->regs.gp[18]; \
89 (pr_reg)[19] = (regs)->regs.gp[19]; \ 89 (pr_reg)[19] = (_regs)->regs.gp[19]; \
90 (pr_reg)[20] = (regs)->regs.gp[20]; \ 90 (pr_reg)[20] = (_regs)->regs.gp[20]; \
91 (pr_reg)[21] = current->thread.arch.fs; \ 91 (pr_reg)[21] = current->thread.arch.fs; \
92 (pr_reg)[22] = 0; \ 92 (pr_reg)[22] = 0; \
93 (pr_reg)[23] = 0; \ 93 (pr_reg)[23] = 0; \
diff --git a/arch/um/sys-x86_64/stub.S b/arch/um/sys-x86_64/stub.S
index 6d9edf9fabce..20e4a96a6dcb 100644
--- a/arch/um/sys-x86_64/stub.S
+++ b/arch/um/sys-x86_64/stub.S
@@ -1,7 +1,7 @@
1#include "as-layout.h" 1#include "as-layout.h"
2 2
3 .globl syscall_stub 3 .globl syscall_stub
4.section .__syscall_stub, "x" 4.section .__syscall_stub, "ax"
5syscall_stub: 5syscall_stub:
6 syscall 6 syscall
7 /* We don't have 64-bit constants, so this constructs the address 7 /* We don't have 64-bit constants, so this constructs the address
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 356d2ec8e2fb..cf42fc305419 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -46,6 +46,7 @@ config X86
46 select HAVE_KERNEL_GZIP 46 select HAVE_KERNEL_GZIP
47 select HAVE_KERNEL_BZIP2 47 select HAVE_KERNEL_BZIP2
48 select HAVE_KERNEL_LZMA 48 select HAVE_KERNEL_LZMA
49 select HAVE_ARCH_KMEMCHECK
49 50
50config OUTPUT_FORMAT 51config OUTPUT_FORMAT
51 string 52 string
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index edbd0ca62067..1b68659c41b4 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -81,6 +81,11 @@ ifdef CONFIG_CC_STACKPROTECTOR
81 endif 81 endif
82endif 82endif
83 83
84# Don't unroll struct assignments with kmemcheck enabled
85ifeq ($(CONFIG_KMEMCHECK),y)
86 KBUILD_CFLAGS += $(call cc-option,-fno-builtin-memcpy)
87endif
88
84# Stackpointer is addressed different for 32 bit and 64 bit x86 89# Stackpointer is addressed different for 32 bit and 64 bit x86
85sp-$(CONFIG_X86_32) := esp 90sp-$(CONFIG_X86_32) := esp
86sp-$(CONFIG_X86_64) := rsp 91sp-$(CONFIG_X86_64) := rsp
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index f82fdc412c64..b93405b228b4 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -6,6 +6,7 @@
6 * Documentation/DMA-API.txt for documentation. 6 * Documentation/DMA-API.txt for documentation.
7 */ 7 */
8 8
9#include <linux/kmemcheck.h>
9#include <linux/scatterlist.h> 10#include <linux/scatterlist.h>
10#include <linux/dma-debug.h> 11#include <linux/dma-debug.h>
11#include <linux/dma-attrs.h> 12#include <linux/dma-attrs.h>
@@ -60,6 +61,7 @@ dma_map_single(struct device *hwdev, void *ptr, size_t size,
60 dma_addr_t addr; 61 dma_addr_t addr;
61 62
62 BUG_ON(!valid_dma_direction(dir)); 63 BUG_ON(!valid_dma_direction(dir));
64 kmemcheck_mark_initialized(ptr, size);
63 addr = ops->map_page(hwdev, virt_to_page(ptr), 65 addr = ops->map_page(hwdev, virt_to_page(ptr),
64 (unsigned long)ptr & ~PAGE_MASK, size, 66 (unsigned long)ptr & ~PAGE_MASK, size,
65 dir, NULL); 67 dir, NULL);
@@ -87,8 +89,12 @@ dma_map_sg(struct device *hwdev, struct scatterlist *sg,
87{ 89{
88 struct dma_map_ops *ops = get_dma_ops(hwdev); 90 struct dma_map_ops *ops = get_dma_ops(hwdev);
89 int ents; 91 int ents;
92 struct scatterlist *s;
93 int i;
90 94
91 BUG_ON(!valid_dma_direction(dir)); 95 BUG_ON(!valid_dma_direction(dir));
96 for_each_sg(sg, s, nents, i)
97 kmemcheck_mark_initialized(sg_virt(s), s->length);
92 ents = ops->map_sg(hwdev, sg, nents, dir, NULL); 98 ents = ops->map_sg(hwdev, sg, nents, dir, NULL);
93 debug_dma_map_sg(hwdev, sg, nents, ents, dir); 99 debug_dma_map_sg(hwdev, sg, nents, ents, dir);
94 100
@@ -200,6 +206,7 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
200 dma_addr_t addr; 206 dma_addr_t addr;
201 207
202 BUG_ON(!valid_dma_direction(dir)); 208 BUG_ON(!valid_dma_direction(dir));
209 kmemcheck_mark_initialized(page_address(page) + offset, size);
203 addr = ops->map_page(dev, page, offset, size, dir, NULL); 210 addr = ops->map_page(dev, page, offset, size, dir, NULL);
204 debug_dma_map_page(dev, page, offset, size, dir, addr, false); 211 debug_dma_map_page(dev, page, offset, size, dir, addr, false);
205 212
diff --git a/arch/x86/include/asm/kmap_types.h b/arch/x86/include/asm/kmap_types.h
index 5759c165a5cf..9e00a731a7fb 100644
--- a/arch/x86/include/asm/kmap_types.h
+++ b/arch/x86/include/asm/kmap_types.h
@@ -2,28 +2,11 @@
2#define _ASM_X86_KMAP_TYPES_H 2#define _ASM_X86_KMAP_TYPES_H
3 3
4#if defined(CONFIG_X86_32) && defined(CONFIG_DEBUG_HIGHMEM) 4#if defined(CONFIG_X86_32) && defined(CONFIG_DEBUG_HIGHMEM)
5# define D(n) __KM_FENCE_##n , 5#define __WITH_KM_FENCE
6#else
7# define D(n)
8#endif 6#endif
9 7
10enum km_type { 8#include <asm-generic/kmap_types.h>
11D(0) KM_BOUNCE_READ,
12D(1) KM_SKB_SUNRPC_DATA,
13D(2) KM_SKB_DATA_SOFTIRQ,
14D(3) KM_USER0,
15D(4) KM_USER1,
16D(5) KM_BIO_SRC_IRQ,
17D(6) KM_BIO_DST_IRQ,
18D(7) KM_PTE0,
19D(8) KM_PTE1,
20D(9) KM_IRQ0,
21D(10) KM_IRQ1,
22D(11) KM_SOFTIRQ0,
23D(12) KM_SOFTIRQ1,
24D(13) KM_TYPE_NR
25};
26 9
27#undef D 10#undef __WITH_KM_FENCE
28 11
29#endif /* _ASM_X86_KMAP_TYPES_H */ 12#endif /* _ASM_X86_KMAP_TYPES_H */
diff --git a/arch/x86/include/asm/kmemcheck.h b/arch/x86/include/asm/kmemcheck.h
new file mode 100644
index 000000000000..ed01518f297e
--- /dev/null
+++ b/arch/x86/include/asm/kmemcheck.h
@@ -0,0 +1,42 @@
1#ifndef ASM_X86_KMEMCHECK_H
2#define ASM_X86_KMEMCHECK_H
3
4#include <linux/types.h>
5#include <asm/ptrace.h>
6
7#ifdef CONFIG_KMEMCHECK
8bool kmemcheck_active(struct pt_regs *regs);
9
10void kmemcheck_show(struct pt_regs *regs);
11void kmemcheck_hide(struct pt_regs *regs);
12
13bool kmemcheck_fault(struct pt_regs *regs,
14 unsigned long address, unsigned long error_code);
15bool kmemcheck_trap(struct pt_regs *regs);
16#else
17static inline bool kmemcheck_active(struct pt_regs *regs)
18{
19 return false;
20}
21
22static inline void kmemcheck_show(struct pt_regs *regs)
23{
24}
25
26static inline void kmemcheck_hide(struct pt_regs *regs)
27{
28}
29
30static inline bool kmemcheck_fault(struct pt_regs *regs,
31 unsigned long address, unsigned long error_code)
32{
33 return false;
34}
35
36static inline bool kmemcheck_trap(struct pt_regs *regs)
37{
38 return false;
39}
40#endif /* CONFIG_KMEMCHECK */
41
42#endif
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 18ef7ebf2631..3cc06e3fceb8 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -317,6 +317,11 @@ static inline int pte_present(pte_t a)
317 return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE); 317 return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE);
318} 318}
319 319
320static inline int pte_hidden(pte_t pte)
321{
322 return pte_flags(pte) & _PAGE_HIDDEN;
323}
324
320static inline int pmd_present(pmd_t pmd) 325static inline int pmd_present(pmd_t pmd)
321{ 326{
322 return pmd_flags(pmd) & _PAGE_PRESENT; 327 return pmd_flags(pmd) & _PAGE_PRESENT;
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 4d258ad76a0f..54cb697f4900 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -18,7 +18,7 @@
18#define _PAGE_BIT_GLOBAL 8 /* Global TLB entry PPro+ */ 18#define _PAGE_BIT_GLOBAL 8 /* Global TLB entry PPro+ */
19#define _PAGE_BIT_UNUSED1 9 /* available for programmer */ 19#define _PAGE_BIT_UNUSED1 9 /* available for programmer */
20#define _PAGE_BIT_IOMAP 10 /* flag used to indicate IO mapping */ 20#define _PAGE_BIT_IOMAP 10 /* flag used to indicate IO mapping */
21#define _PAGE_BIT_UNUSED3 11 21#define _PAGE_BIT_HIDDEN 11 /* hidden by kmemcheck */
22#define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */ 22#define _PAGE_BIT_PAT_LARGE 12 /* On 2MB or 1GB pages */
23#define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1 23#define _PAGE_BIT_SPECIAL _PAGE_BIT_UNUSED1
24#define _PAGE_BIT_CPA_TEST _PAGE_BIT_UNUSED1 24#define _PAGE_BIT_CPA_TEST _PAGE_BIT_UNUSED1
@@ -41,13 +41,18 @@
41#define _PAGE_GLOBAL (_AT(pteval_t, 1) << _PAGE_BIT_GLOBAL) 41#define _PAGE_GLOBAL (_AT(pteval_t, 1) << _PAGE_BIT_GLOBAL)
42#define _PAGE_UNUSED1 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED1) 42#define _PAGE_UNUSED1 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED1)
43#define _PAGE_IOMAP (_AT(pteval_t, 1) << _PAGE_BIT_IOMAP) 43#define _PAGE_IOMAP (_AT(pteval_t, 1) << _PAGE_BIT_IOMAP)
44#define _PAGE_UNUSED3 (_AT(pteval_t, 1) << _PAGE_BIT_UNUSED3)
45#define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT) 44#define _PAGE_PAT (_AT(pteval_t, 1) << _PAGE_BIT_PAT)
46#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE) 45#define _PAGE_PAT_LARGE (_AT(pteval_t, 1) << _PAGE_BIT_PAT_LARGE)
47#define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL) 46#define _PAGE_SPECIAL (_AT(pteval_t, 1) << _PAGE_BIT_SPECIAL)
48#define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST) 47#define _PAGE_CPA_TEST (_AT(pteval_t, 1) << _PAGE_BIT_CPA_TEST)
49#define __HAVE_ARCH_PTE_SPECIAL 48#define __HAVE_ARCH_PTE_SPECIAL
50 49
50#ifdef CONFIG_KMEMCHECK
51#define _PAGE_HIDDEN (_AT(pteval_t, 1) << _PAGE_BIT_HIDDEN)
52#else
53#define _PAGE_HIDDEN (_AT(pteval_t, 0))
54#endif
55
51#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) 56#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
52#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX) 57#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX)
53#else 58#else
diff --git a/arch/x86/include/asm/string_32.h b/arch/x86/include/asm/string_32.h
index 0e0e3ba827f7..c86f452256de 100644
--- a/arch/x86/include/asm/string_32.h
+++ b/arch/x86/include/asm/string_32.h
@@ -177,10 +177,18 @@ static inline void *__memcpy3d(void *to, const void *from, size_t len)
177 * No 3D Now! 177 * No 3D Now!
178 */ 178 */
179 179
180#ifndef CONFIG_KMEMCHECK
180#define memcpy(t, f, n) \ 181#define memcpy(t, f, n) \
181 (__builtin_constant_p((n)) \ 182 (__builtin_constant_p((n)) \
182 ? __constant_memcpy((t), (f), (n)) \ 183 ? __constant_memcpy((t), (f), (n)) \
183 : __memcpy((t), (f), (n))) 184 : __memcpy((t), (f), (n)))
185#else
186/*
187 * kmemcheck becomes very happy if we use the REP instructions unconditionally,
188 * because it means that we know both memory operands in advance.
189 */
190#define memcpy(t, f, n) __memcpy((t), (f), (n))
191#endif
184 192
185#endif 193#endif
186 194
diff --git a/arch/x86/include/asm/string_64.h b/arch/x86/include/asm/string_64.h
index 2afe164bf1e6..19e2c468fc2c 100644
--- a/arch/x86/include/asm/string_64.h
+++ b/arch/x86/include/asm/string_64.h
@@ -27,6 +27,7 @@ static __always_inline void *__inline_memcpy(void *to, const void *from, size_t
27 function. */ 27 function. */
28 28
29#define __HAVE_ARCH_MEMCPY 1 29#define __HAVE_ARCH_MEMCPY 1
30#ifndef CONFIG_KMEMCHECK
30#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4 31#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
31extern void *memcpy(void *to, const void *from, size_t len); 32extern void *memcpy(void *to, const void *from, size_t len);
32#else 33#else
@@ -42,6 +43,13 @@ extern void *__memcpy(void *to, const void *from, size_t len);
42 __ret; \ 43 __ret; \
43}) 44})
44#endif 45#endif
46#else
47/*
48 * kmemcheck becomes very happy if we use the REP instructions unconditionally,
49 * because it means that we know both memory operands in advance.
50 */
51#define memcpy(dst, src, len) __inline_memcpy((dst), (src), (len))
52#endif
45 53
46#define __HAVE_ARCH_MEMSET 54#define __HAVE_ARCH_MEMSET
47void *memset(void *s, int c, size_t n); 55void *memset(void *s, int c, size_t n);
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 602c769fc98c..b0783520988b 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -154,9 +154,9 @@ struct thread_info {
154 154
155/* thread information allocation */ 155/* thread information allocation */
156#ifdef CONFIG_DEBUG_STACK_USAGE 156#ifdef CONFIG_DEBUG_STACK_USAGE
157#define THREAD_FLAGS (GFP_KERNEL | __GFP_ZERO) 157#define THREAD_FLAGS (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO)
158#else 158#else
159#define THREAD_FLAGS GFP_KERNEL 159#define THREAD_FLAGS (GFP_KERNEL | __GFP_NOTRACK)
160#endif 160#endif
161 161
162#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR 162#define __HAVE_ARCH_THREAD_INFO_ALLOCATOR
diff --git a/arch/x86/include/asm/timex.h b/arch/x86/include/asm/timex.h
index b5c9d45c981f..1375cfc93960 100644
--- a/arch/x86/include/asm/timex.h
+++ b/arch/x86/include/asm/timex.h
@@ -4,9 +4,7 @@
4#include <asm/processor.h> 4#include <asm/processor.h>
5#include <asm/tsc.h> 5#include <asm/tsc.h>
6 6
7/* The PIT ticks at this frequency (in HZ): */ 7/* Assume we use the PIT time source for the clock tick */
8#define PIT_TICK_RATE 1193182
9
10#define CLOCK_TICK_RATE PIT_TICK_RATE 8#define CLOCK_TICK_RATE PIT_TICK_RATE
11 9
12#define ARCH_HAS_READ_CURRENT_TIMER 10#define ARCH_HAS_READ_CURRENT_TIMER
diff --git a/arch/x86/include/asm/xor.h b/arch/x86/include/asm/xor.h
index 11b3bb86e17b..7fcf6f3dbcc3 100644
--- a/arch/x86/include/asm/xor.h
+++ b/arch/x86/include/asm/xor.h
@@ -1,5 +1,10 @@
1#ifdef CONFIG_KMEMCHECK
2/* kmemcheck doesn't handle MMX/SSE/SSE2 instructions */
3# include <asm-generic/xor.h>
4#else
1#ifdef CONFIG_X86_32 5#ifdef CONFIG_X86_32
2# include "xor_32.h" 6# include "xor_32.h"
3#else 7#else
4# include "xor_64.h" 8# include "xor_64.h"
5#endif 9#endif
10#endif
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index ef0ae207a7c8..096d19aea2f7 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -463,7 +463,7 @@ static void uv_heartbeat(unsigned long ignored)
463 uv_set_scir_bits(bits); 463 uv_set_scir_bits(bits);
464 464
465 /* enable next timer period */ 465 /* enable next timer period */
466 mod_timer(timer, jiffies + SCIR_CPU_HB_INTERVAL); 466 mod_timer_pinned(timer, jiffies + SCIR_CPU_HB_INTERVAL);
467} 467}
468 468
469static void __cpuinit uv_heartbeat_enable(int cpu) 469static void __cpuinit uv_heartbeat_enable(int cpu)
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 3ffdcfa9abdf..9fa33886c0d7 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -487,7 +487,6 @@ out:
487static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c) 487static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
488{ 488{
489 char *v = c->x86_vendor_id; 489 char *v = c->x86_vendor_id;
490 static int printed;
491 int i; 490 int i;
492 491
493 for (i = 0; i < X86_VENDOR_NUM; i++) { 492 for (i = 0; i < X86_VENDOR_NUM; i++) {
@@ -504,13 +503,9 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
504 } 503 }
505 } 504 }
506 505
507 if (!printed) { 506 printk_once(KERN_ERR
508 printed++; 507 "CPU: vendor_id '%s' unknown, using generic init.\n" \
509 printk(KERN_ERR 508 "CPU: Your system may be unstable.\n", v);
510 "CPU: vendor_id '%s' unknown, using generic init.\n", v);
511
512 printk(KERN_ERR "CPU: Your system may be unstable.\n");
513 }
514 509
515 c->x86_vendor = X86_VENDOR_UNKNOWN; 510 c->x86_vendor = X86_VENDOR_UNKNOWN;
516 this_cpu = &default_cpu; 511 this_cpu = &default_cpu;
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index daed39ba2614..3260ab044996 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -86,6 +86,29 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
86 */ 86 */
87 if (c->x86 == 6 && c->x86_model < 15) 87 if (c->x86 == 6 && c->x86_model < 15)
88 clear_cpu_cap(c, X86_FEATURE_PAT); 88 clear_cpu_cap(c, X86_FEATURE_PAT);
89
90#ifdef CONFIG_KMEMCHECK
91 /*
92 * P4s have a "fast strings" feature which causes single-
93 * stepping REP instructions to only generate a #DB on
94 * cache-line boundaries.
95 *
96 * Ingo Molnar reported a Pentium D (model 6) and a Xeon
97 * (model 2) with the same problem.
98 */
99 if (c->x86 == 15) {
100 u64 misc_enable;
101
102 rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
103
104 if (misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING) {
105 printk(KERN_INFO "kmemcheck: Disabling fast string operations\n");
106
107 misc_enable &= ~MSR_IA32_MISC_ENABLE_FAST_STRING;
108 wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
109 }
110 }
111#endif
89} 112}
90 113
91#ifdef CONFIG_X86_32 114#ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 2ac1f0c2beb3..b07af8861244 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -182,6 +182,11 @@ static struct notifier_block __refdata cpuid_class_cpu_notifier =
182 .notifier_call = cpuid_class_cpu_callback, 182 .notifier_call = cpuid_class_cpu_callback,
183}; 183};
184 184
185static char *cpuid_nodename(struct device *dev)
186{
187 return kasprintf(GFP_KERNEL, "cpu/%u/cpuid", MINOR(dev->devt));
188}
189
185static int __init cpuid_init(void) 190static int __init cpuid_init(void)
186{ 191{
187 int i, err = 0; 192 int i, err = 0;
@@ -198,6 +203,7 @@ static int __init cpuid_init(void)
198 err = PTR_ERR(cpuid_class); 203 err = PTR_ERR(cpuid_class);
199 goto out_chrdev; 204 goto out_chrdev;
200 } 205 }
206 cpuid_class->nodename = cpuid_nodename;
201 for_each_online_cpu(i) { 207 for_each_online_cpu(i) {
202 err = cpuid_device_create(i); 208 err = cpuid_device_create(i);
203 if (err != 0) 209 if (err != 0)
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index c2e0bb0890d4..5cf36c053ac4 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -7,6 +7,7 @@
7#include <linux/spinlock.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/timex.h>
10#include <linux/delay.h> 11#include <linux/delay.h>
11#include <linux/init.h> 12#include <linux/init.h>
12#include <linux/io.h> 13#include <linux/io.h>
diff --git a/arch/x86/kernel/init_task.c b/arch/x86/kernel/init_task.c
index df3bf269beab..270ff83efc11 100644
--- a/arch/x86/kernel/init_task.c
+++ b/arch/x86/kernel/init_task.c
@@ -12,7 +12,6 @@
12 12
13static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 13static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
14static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 14static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
15struct mm_struct init_mm = INIT_MM(init_mm);
16 15
17/* 16/*
18 * Initial thread structure. 17 * Initial thread structure.
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 9c4461501fcb..9371448290ac 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -236,6 +236,7 @@ static const struct file_operations microcode_fops = {
236static struct miscdevice microcode_dev = { 236static struct miscdevice microcode_dev = {
237 .minor = MICROCODE_MINOR, 237 .minor = MICROCODE_MINOR,
238 .name = "microcode", 238 .name = "microcode",
239 .devnode = "cpu/microcode",
239 .fops = &microcode_fops, 240 .fops = &microcode_fops,
240}; 241};
241 242
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 3cf3413ec626..98fd6cd4e3a4 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -196,6 +196,11 @@ static struct notifier_block __refdata msr_class_cpu_notifier = {
196 .notifier_call = msr_class_cpu_callback, 196 .notifier_call = msr_class_cpu_callback,
197}; 197};
198 198
199static char *msr_nodename(struct device *dev)
200{
201 return kasprintf(GFP_KERNEL, "cpu/%u/msr", MINOR(dev->devt));
202}
203
199static int __init msr_init(void) 204static int __init msr_init(void)
200{ 205{
201 int i, err = 0; 206 int i, err = 0;
@@ -212,6 +217,7 @@ static int __init msr_init(void)
212 err = PTR_ERR(msr_class); 217 err = PTR_ERR(msr_class);
213 goto out_chrdev; 218 goto out_chrdev;
214 } 219 }
220 msr_class->nodename = msr_nodename;
215 for_each_online_cpu(i) { 221 for_each_online_cpu(i) {
216 err = msr_device_create(i); 222 err = msr_device_create(i);
217 if (err != 0) 223 if (err != 0)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 3bb2be1649bd..994dd6a4a2a0 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -63,7 +63,7 @@ void arch_task_cache_init(void)
63 task_xstate_cachep = 63 task_xstate_cachep =
64 kmem_cache_create("task_xstate", xstate_size, 64 kmem_cache_create("task_xstate", xstate_size,
65 __alignof__(union thread_xstate), 65 __alignof__(union thread_xstate),
66 SLAB_PANIC, NULL); 66 SLAB_PANIC | SLAB_NOTRACK, NULL);
67} 67}
68 68
69/* 69/*
diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c
index 4aaf7e48394f..c3eb207181fe 100644
--- a/arch/x86/kernel/stacktrace.c
+++ b/arch/x86/kernel/stacktrace.c
@@ -77,6 +77,13 @@ void save_stack_trace(struct stack_trace *trace)
77} 77}
78EXPORT_SYMBOL_GPL(save_stack_trace); 78EXPORT_SYMBOL_GPL(save_stack_trace);
79 79
80void save_stack_trace_bp(struct stack_trace *trace, unsigned long bp)
81{
82 dump_trace(current, NULL, NULL, bp, &save_stack_ops, trace);
83 if (trace->nr_entries < trace->max_entries)
84 trace->entries[trace->nr_entries++] = ULONG_MAX;
85}
86
80void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) 87void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
81{ 88{
82 dump_trace(tsk, NULL, NULL, 0, &save_stack_ops_nosched, trace); 89 dump_trace(tsk, NULL, NULL, 0, &save_stack_ops_nosched, trace);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 1e1e27b7d438..5f935f0d5861 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -45,6 +45,7 @@
45#include <linux/edac.h> 45#include <linux/edac.h>
46#endif 46#endif
47 47
48#include <asm/kmemcheck.h>
48#include <asm/stacktrace.h> 49#include <asm/stacktrace.h>
49#include <asm/processor.h> 50#include <asm/processor.h>
50#include <asm/debugreg.h> 51#include <asm/debugreg.h>
@@ -534,6 +535,10 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
534 535
535 get_debugreg(condition, 6); 536 get_debugreg(condition, 6);
536 537
538 /* Catch kmemcheck conditions first of all! */
539 if (condition & DR_STEP && kmemcheck_trap(regs))
540 return;
541
537 /* 542 /*
538 * The processor cleared BTF, so don't mark that we need it set. 543 * The processor cleared BTF, so don't mark that we need it set.
539 */ 544 */
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 3fbd3206eccf..b0597ad02c93 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -9,6 +9,7 @@
9#include <linux/delay.h> 9#include <linux/delay.h>
10#include <linux/clocksource.h> 10#include <linux/clocksource.h>
11#include <linux/percpu.h> 11#include <linux/percpu.h>
12#include <linux/timex.h>
12 13
13#include <asm/hpet.h> 14#include <asm/hpet.h>
14#include <asm/timer.h> 15#include <asm/timer.h>
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 32d6ae8fb60e..e770bf349ec4 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1277,7 +1277,7 @@ static struct vmcs *alloc_vmcs_cpu(int cpu)
1277 struct page *pages; 1277 struct page *pages;
1278 struct vmcs *vmcs; 1278 struct vmcs *vmcs;
1279 1279
1280 pages = alloc_pages_node(node, GFP_KERNEL, vmcs_config.order); 1280 pages = alloc_pages_exact_node(node, GFP_KERNEL, vmcs_config.order);
1281 if (!pages) 1281 if (!pages)
1282 return NULL; 1282 return NULL;
1283 vmcs = page_address(pages); 1283 vmcs = page_address(pages);
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index fdd30d08ab52..eefdeee8a871 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -10,6 +10,8 @@ obj-$(CONFIG_X86_PTDUMP) += dump_pagetables.o
10 10
11obj-$(CONFIG_HIGHMEM) += highmem_32.o 11obj-$(CONFIG_HIGHMEM) += highmem_32.o
12 12
13obj-$(CONFIG_KMEMCHECK) += kmemcheck/
14
13obj-$(CONFIG_MMIOTRACE) += mmiotrace.o 15obj-$(CONFIG_MMIOTRACE) += mmiotrace.o
14mmiotrace-y := kmmio.o pf_in.o mmio-mod.o 16mmiotrace-y := kmmio.o pf_in.o mmio-mod.o
15obj-$(CONFIG_MMIOTRACE_TEST) += testmmiotrace.o 17obj-$(CONFIG_MMIOTRACE_TEST) += testmmiotrace.o
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index c6acc6326374..baa0e86adfbc 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -14,6 +14,7 @@
14 14
15#include <asm/traps.h> /* dotraplinkage, ... */ 15#include <asm/traps.h> /* dotraplinkage, ... */
16#include <asm/pgalloc.h> /* pgd_*(), ... */ 16#include <asm/pgalloc.h> /* pgd_*(), ... */
17#include <asm/kmemcheck.h> /* kmemcheck_*(), ... */
17 18
18/* 19/*
19 * Page fault error code bits: 20 * Page fault error code bits:
@@ -956,6 +957,13 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
956 /* Get the faulting address: */ 957 /* Get the faulting address: */
957 address = read_cr2(); 958 address = read_cr2();
958 959
960 /*
961 * Detect and handle instructions that would cause a page fault for
962 * both a tracked kernel page and a userspace page.
963 */
964 if (kmemcheck_active(regs))
965 kmemcheck_hide(regs);
966
959 if (unlikely(kmmio_fault(regs, address))) 967 if (unlikely(kmmio_fault(regs, address)))
960 return; 968 return;
961 969
@@ -973,9 +981,13 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code)
973 * protection error (error_code & 9) == 0. 981 * protection error (error_code & 9) == 0.
974 */ 982 */
975 if (unlikely(fault_in_kernel_space(address))) { 983 if (unlikely(fault_in_kernel_space(address))) {
976 if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) && 984 if (!(error_code & (PF_RSVD | PF_USER | PF_PROT))) {
977 vmalloc_fault(address) >= 0) 985 if (vmalloc_fault(address) >= 0)
978 return; 986 return;
987
988 if (kmemcheck_fault(regs, address, error_code))
989 return;
990 }
979 991
980 /* Can handle a stale RO->RW TLB: */ 992 /* Can handle a stale RO->RW TLB: */
981 if (spurious_fault(error_code, address)) 993 if (spurious_fault(error_code, address))
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 34c1bfb64f1c..f53b57e4086f 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -213,7 +213,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
213 if (!after_bootmem) 213 if (!after_bootmem)
214 init_gbpages(); 214 init_gbpages();
215 215
216#ifdef CONFIG_DEBUG_PAGEALLOC 216#if defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KMEMCHECK)
217 /* 217 /*
218 * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages. 218 * For CONFIG_DEBUG_PAGEALLOC, identity mapping will use small pages.
219 * This will simplify cpa(), which otherwise needs to support splitting 219 * This will simplify cpa(), which otherwise needs to support splitting
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 9ff3c0816d15..3cd7711bb949 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -111,7 +111,7 @@ static pte_t * __init one_page_table_init(pmd_t *pmd)
111 pte_t *page_table = NULL; 111 pte_t *page_table = NULL;
112 112
113 if (after_bootmem) { 113 if (after_bootmem) {
114#ifdef CONFIG_DEBUG_PAGEALLOC 114#if defined(CONFIG_DEBUG_PAGEALLOC) || defined(CONFIG_KMEMCHECK)
115 page_table = (pte_t *) alloc_bootmem_pages(PAGE_SIZE); 115 page_table = (pte_t *) alloc_bootmem_pages(PAGE_SIZE);
116#endif 116#endif
117 if (!page_table) 117 if (!page_table)
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 52bb9519bb86..9c543290a813 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -104,7 +104,7 @@ static __ref void *spp_getpage(void)
104 void *ptr; 104 void *ptr;
105 105
106 if (after_bootmem) 106 if (after_bootmem)
107 ptr = (void *) get_zeroed_page(GFP_ATOMIC); 107 ptr = (void *) get_zeroed_page(GFP_ATOMIC | __GFP_NOTRACK);
108 else 108 else
109 ptr = alloc_bootmem_pages(PAGE_SIZE); 109 ptr = alloc_bootmem_pages(PAGE_SIZE);
110 110
@@ -281,7 +281,7 @@ static __ref void *alloc_low_page(unsigned long *phys)
281 void *adr; 281 void *adr;
282 282
283 if (after_bootmem) { 283 if (after_bootmem) {
284 adr = (void *)get_zeroed_page(GFP_ATOMIC); 284 adr = (void *)get_zeroed_page(GFP_ATOMIC | __GFP_NOTRACK);
285 *phys = __pa(adr); 285 *phys = __pa(adr);
286 286
287 return adr; 287 return adr;
diff --git a/arch/x86/mm/kmemcheck/Makefile b/arch/x86/mm/kmemcheck/Makefile
new file mode 100644
index 000000000000..520b3bce4095
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/Makefile
@@ -0,0 +1 @@
obj-y := error.o kmemcheck.o opcode.o pte.o selftest.o shadow.o
diff --git a/arch/x86/mm/kmemcheck/error.c b/arch/x86/mm/kmemcheck/error.c
new file mode 100644
index 000000000000..4901d0dafda6
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/error.c
@@ -0,0 +1,228 @@
1#include <linux/interrupt.h>
2#include <linux/kdebug.h>
3#include <linux/kmemcheck.h>
4#include <linux/kernel.h>
5#include <linux/types.h>
6#include <linux/ptrace.h>
7#include <linux/stacktrace.h>
8#include <linux/string.h>
9
10#include "error.h"
11#include "shadow.h"
12
13enum kmemcheck_error_type {
14 KMEMCHECK_ERROR_INVALID_ACCESS,
15 KMEMCHECK_ERROR_BUG,
16};
17
18#define SHADOW_COPY_SIZE (1 << CONFIG_KMEMCHECK_SHADOW_COPY_SHIFT)
19
20struct kmemcheck_error {
21 enum kmemcheck_error_type type;
22
23 union {
24 /* KMEMCHECK_ERROR_INVALID_ACCESS */
25 struct {
26 /* Kind of access that caused the error */
27 enum kmemcheck_shadow state;
28 /* Address and size of the erroneous read */
29 unsigned long address;
30 unsigned int size;
31 };
32 };
33
34 struct pt_regs regs;
35 struct stack_trace trace;
36 unsigned long trace_entries[32];
37
38 /* We compress it to a char. */
39 unsigned char shadow_copy[SHADOW_COPY_SIZE];
40 unsigned char memory_copy[SHADOW_COPY_SIZE];
41};
42
43/*
44 * Create a ring queue of errors to output. We can't call printk() directly
45 * from the kmemcheck traps, since this may call the console drivers and
46 * result in a recursive fault.
47 */
48static struct kmemcheck_error error_fifo[CONFIG_KMEMCHECK_QUEUE_SIZE];
49static unsigned int error_count;
50static unsigned int error_rd;
51static unsigned int error_wr;
52static unsigned int error_missed_count;
53
54static struct kmemcheck_error *error_next_wr(void)
55{
56 struct kmemcheck_error *e;
57
58 if (error_count == ARRAY_SIZE(error_fifo)) {
59 ++error_missed_count;
60 return NULL;
61 }
62
63 e = &error_fifo[error_wr];
64 if (++error_wr == ARRAY_SIZE(error_fifo))
65 error_wr = 0;
66 ++error_count;
67 return e;
68}
69
70static struct kmemcheck_error *error_next_rd(void)
71{
72 struct kmemcheck_error *e;
73
74 if (error_count == 0)
75 return NULL;
76
77 e = &error_fifo[error_rd];
78 if (++error_rd == ARRAY_SIZE(error_fifo))
79 error_rd = 0;
80 --error_count;
81 return e;
82}
83
84void kmemcheck_error_recall(void)
85{
86 static const char *desc[] = {
87 [KMEMCHECK_SHADOW_UNALLOCATED] = "unallocated",
88 [KMEMCHECK_SHADOW_UNINITIALIZED] = "uninitialized",
89 [KMEMCHECK_SHADOW_INITIALIZED] = "initialized",
90 [KMEMCHECK_SHADOW_FREED] = "freed",
91 };
92
93 static const char short_desc[] = {
94 [KMEMCHECK_SHADOW_UNALLOCATED] = 'a',
95 [KMEMCHECK_SHADOW_UNINITIALIZED] = 'u',
96 [KMEMCHECK_SHADOW_INITIALIZED] = 'i',
97 [KMEMCHECK_SHADOW_FREED] = 'f',
98 };
99
100 struct kmemcheck_error *e;
101 unsigned int i;
102
103 e = error_next_rd();
104 if (!e)
105 return;
106
107 switch (e->type) {
108 case KMEMCHECK_ERROR_INVALID_ACCESS:
109 printk(KERN_ERR "WARNING: kmemcheck: Caught %d-bit read "
110 "from %s memory (%p)\n",
111 8 * e->size, e->state < ARRAY_SIZE(desc) ?
112 desc[e->state] : "(invalid shadow state)",
113 (void *) e->address);
114
115 printk(KERN_INFO);
116 for (i = 0; i < SHADOW_COPY_SIZE; ++i)
117 printk("%02x", e->memory_copy[i]);
118 printk("\n");
119
120 printk(KERN_INFO);
121 for (i = 0; i < SHADOW_COPY_SIZE; ++i) {
122 if (e->shadow_copy[i] < ARRAY_SIZE(short_desc))
123 printk(" %c", short_desc[e->shadow_copy[i]]);
124 else
125 printk(" ?");
126 }
127 printk("\n");
128 printk(KERN_INFO "%*c\n", 2 + 2
129 * (int) (e->address & (SHADOW_COPY_SIZE - 1)), '^');
130 break;
131 case KMEMCHECK_ERROR_BUG:
132 printk(KERN_EMERG "ERROR: kmemcheck: Fatal error\n");
133 break;
134 }
135
136 __show_regs(&e->regs, 1);
137 print_stack_trace(&e->trace, 0);
138}
139
140static void do_wakeup(unsigned long data)
141{
142 while (error_count > 0)
143 kmemcheck_error_recall();
144
145 if (error_missed_count > 0) {
146 printk(KERN_WARNING "kmemcheck: Lost %d error reports because "
147 "the queue was too small\n", error_missed_count);
148 error_missed_count = 0;
149 }
150}
151
152static DECLARE_TASKLET(kmemcheck_tasklet, &do_wakeup, 0);
153
154/*
155 * Save the context of an error report.
156 */
157void kmemcheck_error_save(enum kmemcheck_shadow state,
158 unsigned long address, unsigned int size, struct pt_regs *regs)
159{
160 static unsigned long prev_ip;
161
162 struct kmemcheck_error *e;
163 void *shadow_copy;
164 void *memory_copy;
165
166 /* Don't report several adjacent errors from the same EIP. */
167 if (regs->ip == prev_ip)
168 return;
169 prev_ip = regs->ip;
170
171 e = error_next_wr();
172 if (!e)
173 return;
174
175 e->type = KMEMCHECK_ERROR_INVALID_ACCESS;
176
177 e->state = state;
178 e->address = address;
179 e->size = size;
180
181 /* Save regs */
182 memcpy(&e->regs, regs, sizeof(*regs));
183
184 /* Save stack trace */
185 e->trace.nr_entries = 0;
186 e->trace.entries = e->trace_entries;
187 e->trace.max_entries = ARRAY_SIZE(e->trace_entries);
188 e->trace.skip = 0;
189 save_stack_trace_bp(&e->trace, regs->bp);
190
191 /* Round address down to nearest 16 bytes */
192 shadow_copy = kmemcheck_shadow_lookup(address
193 & ~(SHADOW_COPY_SIZE - 1));
194 BUG_ON(!shadow_copy);
195
196 memcpy(e->shadow_copy, shadow_copy, SHADOW_COPY_SIZE);
197
198 kmemcheck_show_addr(address);
199 memory_copy = (void *) (address & ~(SHADOW_COPY_SIZE - 1));
200 memcpy(e->memory_copy, memory_copy, SHADOW_COPY_SIZE);
201 kmemcheck_hide_addr(address);
202
203 tasklet_hi_schedule_first(&kmemcheck_tasklet);
204}
205
206/*
207 * Save the context of a kmemcheck bug.
208 */
209void kmemcheck_error_save_bug(struct pt_regs *regs)
210{
211 struct kmemcheck_error *e;
212
213 e = error_next_wr();
214 if (!e)
215 return;
216
217 e->type = KMEMCHECK_ERROR_BUG;
218
219 memcpy(&e->regs, regs, sizeof(*regs));
220
221 e->trace.nr_entries = 0;
222 e->trace.entries = e->trace_entries;
223 e->trace.max_entries = ARRAY_SIZE(e->trace_entries);
224 e->trace.skip = 1;
225 save_stack_trace(&e->trace);
226
227 tasklet_hi_schedule_first(&kmemcheck_tasklet);
228}
diff --git a/arch/x86/mm/kmemcheck/error.h b/arch/x86/mm/kmemcheck/error.h
new file mode 100644
index 000000000000..0efc2e8d0a20
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/error.h
@@ -0,0 +1,15 @@
1#ifndef ARCH__X86__MM__KMEMCHECK__ERROR_H
2#define ARCH__X86__MM__KMEMCHECK__ERROR_H
3
4#include <linux/ptrace.h>
5
6#include "shadow.h"
7
8void kmemcheck_error_save(enum kmemcheck_shadow state,
9 unsigned long address, unsigned int size, struct pt_regs *regs);
10
11void kmemcheck_error_save_bug(struct pt_regs *regs);
12
13void kmemcheck_error_recall(void);
14
15#endif
diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c
new file mode 100644
index 000000000000..2c55ed098654
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/kmemcheck.c
@@ -0,0 +1,640 @@
1/**
2 * kmemcheck - a heavyweight memory checker for the linux kernel
3 * Copyright (C) 2007, 2008 Vegard Nossum <vegardno@ifi.uio.no>
4 * (With a lot of help from Ingo Molnar and Pekka Enberg.)
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License (version 2) as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/init.h>
12#include <linux/interrupt.h>
13#include <linux/kallsyms.h>
14#include <linux/kernel.h>
15#include <linux/kmemcheck.h>
16#include <linux/mm.h>
17#include <linux/module.h>
18#include <linux/page-flags.h>
19#include <linux/percpu.h>
20#include <linux/ptrace.h>
21#include <linux/string.h>
22#include <linux/types.h>
23
24#include <asm/cacheflush.h>
25#include <asm/kmemcheck.h>
26#include <asm/pgtable.h>
27#include <asm/tlbflush.h>
28
29#include "error.h"
30#include "opcode.h"
31#include "pte.h"
32#include "selftest.h"
33#include "shadow.h"
34
35
36#ifdef CONFIG_KMEMCHECK_DISABLED_BY_DEFAULT
37# define KMEMCHECK_ENABLED 0
38#endif
39
40#ifdef CONFIG_KMEMCHECK_ENABLED_BY_DEFAULT
41# define KMEMCHECK_ENABLED 1
42#endif
43
44#ifdef CONFIG_KMEMCHECK_ONESHOT_BY_DEFAULT
45# define KMEMCHECK_ENABLED 2
46#endif
47
48int kmemcheck_enabled = KMEMCHECK_ENABLED;
49
50int __init kmemcheck_init(void)
51{
52#ifdef CONFIG_SMP
53 /*
54 * Limit SMP to use a single CPU. We rely on the fact that this code
55 * runs before SMP is set up.
56 */
57 if (setup_max_cpus > 1) {
58 printk(KERN_INFO
59 "kmemcheck: Limiting number of CPUs to 1.\n");
60 setup_max_cpus = 1;
61 }
62#endif
63
64 if (!kmemcheck_selftest()) {
65 printk(KERN_INFO "kmemcheck: self-tests failed; disabling\n");
66 kmemcheck_enabled = 0;
67 return -EINVAL;
68 }
69
70 printk(KERN_INFO "kmemcheck: Initialized\n");
71 return 0;
72}
73
74early_initcall(kmemcheck_init);
75
76/*
77 * We need to parse the kmemcheck= option before any memory is allocated.
78 */
79static int __init param_kmemcheck(char *str)
80{
81 if (!str)
82 return -EINVAL;
83
84 sscanf(str, "%d", &kmemcheck_enabled);
85 return 0;
86}
87
88early_param("kmemcheck", param_kmemcheck);
89
90int kmemcheck_show_addr(unsigned long address)
91{
92 pte_t *pte;
93
94 pte = kmemcheck_pte_lookup(address);
95 if (!pte)
96 return 0;
97
98 set_pte(pte, __pte(pte_val(*pte) | _PAGE_PRESENT));
99 __flush_tlb_one(address);
100 return 1;
101}
102
103int kmemcheck_hide_addr(unsigned long address)
104{
105 pte_t *pte;
106
107 pte = kmemcheck_pte_lookup(address);
108 if (!pte)
109 return 0;
110
111 set_pte(pte, __pte(pte_val(*pte) & ~_PAGE_PRESENT));
112 __flush_tlb_one(address);
113 return 1;
114}
115
116struct kmemcheck_context {
117 bool busy;
118 int balance;
119
120 /*
121 * There can be at most two memory operands to an instruction, but
122 * each address can cross a page boundary -- so we may need up to
123 * four addresses that must be hidden/revealed for each fault.
124 */
125 unsigned long addr[4];
126 unsigned long n_addrs;
127 unsigned long flags;
128
129 /* Data size of the instruction that caused a fault. */
130 unsigned int size;
131};
132
133static DEFINE_PER_CPU(struct kmemcheck_context, kmemcheck_context);
134
135bool kmemcheck_active(struct pt_regs *regs)
136{
137 struct kmemcheck_context *data = &__get_cpu_var(kmemcheck_context);
138
139 return data->balance > 0;
140}
141
142/* Save an address that needs to be shown/hidden */
143static void kmemcheck_save_addr(unsigned long addr)
144{
145 struct kmemcheck_context *data = &__get_cpu_var(kmemcheck_context);
146
147 BUG_ON(data->n_addrs >= ARRAY_SIZE(data->addr));
148 data->addr[data->n_addrs++] = addr;
149}
150
151static unsigned int kmemcheck_show_all(void)
152{
153 struct kmemcheck_context *data = &__get_cpu_var(kmemcheck_context);
154 unsigned int i;
155 unsigned int n;
156
157 n = 0;
158 for (i = 0; i < data->n_addrs; ++i)
159 n += kmemcheck_show_addr(data->addr[i]);
160
161 return n;
162}
163
164static unsigned int kmemcheck_hide_all(void)
165{
166 struct kmemcheck_context *data = &__get_cpu_var(kmemcheck_context);
167 unsigned int i;
168 unsigned int n;
169
170 n = 0;
171 for (i = 0; i < data->n_addrs; ++i)
172 n += kmemcheck_hide_addr(data->addr[i]);
173
174 return n;
175}
176
177/*
178 * Called from the #PF handler.
179 */
180void kmemcheck_show(struct pt_regs *regs)
181{
182 struct kmemcheck_context *data = &__get_cpu_var(kmemcheck_context);
183
184 BUG_ON(!irqs_disabled());
185
186 if (unlikely(data->balance != 0)) {
187 kmemcheck_show_all();
188 kmemcheck_error_save_bug(regs);
189 data->balance = 0;
190 return;
191 }
192
193 /*
194 * None of the addresses actually belonged to kmemcheck. Note that
195 * this is not an error.
196 */
197 if (kmemcheck_show_all() == 0)
198 return;
199
200 ++data->balance;
201
202 /*
203 * The IF needs to be cleared as well, so that the faulting
204 * instruction can run "uninterrupted". Otherwise, we might take
205 * an interrupt and start executing that before we've had a chance
206 * to hide the page again.
207 *
208 * NOTE: In the rare case of multiple faults, we must not override
209 * the original flags:
210 */
211 if (!(regs->flags & X86_EFLAGS_TF))
212 data->flags = regs->flags;
213
214 regs->flags |= X86_EFLAGS_TF;
215 regs->flags &= ~X86_EFLAGS_IF;
216}
217
218/*
219 * Called from the #DB handler.
220 */
221void kmemcheck_hide(struct pt_regs *regs)
222{
223 struct kmemcheck_context *data = &__get_cpu_var(kmemcheck_context);
224 int n;
225
226 BUG_ON(!irqs_disabled());
227
228 if (data->balance == 0)
229 return;
230
231 if (unlikely(data->balance != 1)) {
232 kmemcheck_show_all();
233 kmemcheck_error_save_bug(regs);
234 data->n_addrs = 0;
235 data->balance = 0;
236
237 if (!(data->flags & X86_EFLAGS_TF))
238 regs->flags &= ~X86_EFLAGS_TF;
239 if (data->flags & X86_EFLAGS_IF)
240 regs->flags |= X86_EFLAGS_IF;
241 return;
242 }
243
244 if (kmemcheck_enabled)
245 n = kmemcheck_hide_all();
246 else
247 n = kmemcheck_show_all();
248
249 if (n == 0)
250 return;
251
252 --data->balance;
253
254 data->n_addrs = 0;
255
256 if (!(data->flags & X86_EFLAGS_TF))
257 regs->flags &= ~X86_EFLAGS_TF;
258 if (data->flags & X86_EFLAGS_IF)
259 regs->flags |= X86_EFLAGS_IF;
260}
261
262void kmemcheck_show_pages(struct page *p, unsigned int n)
263{
264 unsigned int i;
265
266 for (i = 0; i < n; ++i) {
267 unsigned long address;
268 pte_t *pte;
269 unsigned int level;
270
271 address = (unsigned long) page_address(&p[i]);
272 pte = lookup_address(address, &level);
273 BUG_ON(!pte);
274 BUG_ON(level != PG_LEVEL_4K);
275
276 set_pte(pte, __pte(pte_val(*pte) | _PAGE_PRESENT));
277 set_pte(pte, __pte(pte_val(*pte) & ~_PAGE_HIDDEN));
278 __flush_tlb_one(address);
279 }
280}
281
282bool kmemcheck_page_is_tracked(struct page *p)
283{
284 /* This will also check the "hidden" flag of the PTE. */
285 return kmemcheck_pte_lookup((unsigned long) page_address(p));
286}
287
288void kmemcheck_hide_pages(struct page *p, unsigned int n)
289{
290 unsigned int i;
291
292 for (i = 0; i < n; ++i) {
293 unsigned long address;
294 pte_t *pte;
295 unsigned int level;
296
297 address = (unsigned long) page_address(&p[i]);
298 pte = lookup_address(address, &level);
299 BUG_ON(!pte);
300 BUG_ON(level != PG_LEVEL_4K);
301
302 set_pte(pte, __pte(pte_val(*pte) & ~_PAGE_PRESENT));
303 set_pte(pte, __pte(pte_val(*pte) | _PAGE_HIDDEN));
304 __flush_tlb_one(address);
305 }
306}
307
308/* Access may NOT cross page boundary */
309static void kmemcheck_read_strict(struct pt_regs *regs,
310 unsigned long addr, unsigned int size)
311{
312 void *shadow;
313 enum kmemcheck_shadow status;
314
315 shadow = kmemcheck_shadow_lookup(addr);
316 if (!shadow)
317 return;
318
319 kmemcheck_save_addr(addr);
320 status = kmemcheck_shadow_test(shadow, size);
321 if (status == KMEMCHECK_SHADOW_INITIALIZED)
322 return;
323
324 if (kmemcheck_enabled)
325 kmemcheck_error_save(status, addr, size, regs);
326
327 if (kmemcheck_enabled == 2)
328 kmemcheck_enabled = 0;
329
330 /* Don't warn about it again. */
331 kmemcheck_shadow_set(shadow, size);
332}
333
334/* Access may cross page boundary */
335static void kmemcheck_read(struct pt_regs *regs,
336 unsigned long addr, unsigned int size)
337{
338 unsigned long page = addr & PAGE_MASK;
339 unsigned long next_addr = addr + size - 1;
340 unsigned long next_page = next_addr & PAGE_MASK;
341
342 if (likely(page == next_page)) {
343 kmemcheck_read_strict(regs, addr, size);
344 return;
345 }
346
347 /*
348 * What we do is basically to split the access across the
349 * two pages and handle each part separately. Yes, this means
350 * that we may now see reads that are 3 + 5 bytes, for
351 * example (and if both are uninitialized, there will be two
352 * reports), but it makes the code a lot simpler.
353 */
354 kmemcheck_read_strict(regs, addr, next_page - addr);
355 kmemcheck_read_strict(regs, next_page, next_addr - next_page);
356}
357
358static void kmemcheck_write_strict(struct pt_regs *regs,
359 unsigned long addr, unsigned int size)
360{
361 void *shadow;
362
363 shadow = kmemcheck_shadow_lookup(addr);
364 if (!shadow)
365 return;
366
367 kmemcheck_save_addr(addr);
368 kmemcheck_shadow_set(shadow, size);
369}
370
371static void kmemcheck_write(struct pt_regs *regs,
372 unsigned long addr, unsigned int size)
373{
374 unsigned long page = addr & PAGE_MASK;
375 unsigned long next_addr = addr + size - 1;
376 unsigned long next_page = next_addr & PAGE_MASK;
377
378 if (likely(page == next_page)) {
379 kmemcheck_write_strict(regs, addr, size);
380 return;
381 }
382
383 /* See comment in kmemcheck_read(). */
384 kmemcheck_write_strict(regs, addr, next_page - addr);
385 kmemcheck_write_strict(regs, next_page, next_addr - next_page);
386}
387
388/*
389 * Copying is hard. We have two addresses, each of which may be split across
390 * a page (and each page will have different shadow addresses).
391 */
392static void kmemcheck_copy(struct pt_regs *regs,
393 unsigned long src_addr, unsigned long dst_addr, unsigned int size)
394{
395 uint8_t shadow[8];
396 enum kmemcheck_shadow status;
397
398 unsigned long page;
399 unsigned long next_addr;
400 unsigned long next_page;
401
402 uint8_t *x;
403 unsigned int i;
404 unsigned int n;
405
406 BUG_ON(size > sizeof(shadow));
407
408 page = src_addr & PAGE_MASK;
409 next_addr = src_addr + size - 1;
410 next_page = next_addr & PAGE_MASK;
411
412 if (likely(page == next_page)) {
413 /* Same page */
414 x = kmemcheck_shadow_lookup(src_addr);
415 if (x) {
416 kmemcheck_save_addr(src_addr);
417 for (i = 0; i < size; ++i)
418 shadow[i] = x[i];
419 } else {
420 for (i = 0; i < size; ++i)
421 shadow[i] = KMEMCHECK_SHADOW_INITIALIZED;
422 }
423 } else {
424 n = next_page - src_addr;
425 BUG_ON(n > sizeof(shadow));
426
427 /* First page */
428 x = kmemcheck_shadow_lookup(src_addr);
429 if (x) {
430 kmemcheck_save_addr(src_addr);
431 for (i = 0; i < n; ++i)
432 shadow[i] = x[i];
433 } else {
434 /* Not tracked */
435 for (i = 0; i < n; ++i)
436 shadow[i] = KMEMCHECK_SHADOW_INITIALIZED;
437 }
438
439 /* Second page */
440 x = kmemcheck_shadow_lookup(next_page);
441 if (x) {
442 kmemcheck_save_addr(next_page);
443 for (i = n; i < size; ++i)
444 shadow[i] = x[i - n];
445 } else {
446 /* Not tracked */
447 for (i = n; i < size; ++i)
448 shadow[i] = KMEMCHECK_SHADOW_INITIALIZED;
449 }
450 }
451
452 page = dst_addr & PAGE_MASK;
453 next_addr = dst_addr + size - 1;
454 next_page = next_addr & PAGE_MASK;
455
456 if (likely(page == next_page)) {
457 /* Same page */
458 x = kmemcheck_shadow_lookup(dst_addr);
459 if (x) {
460 kmemcheck_save_addr(dst_addr);
461 for (i = 0; i < size; ++i) {
462 x[i] = shadow[i];
463 shadow[i] = KMEMCHECK_SHADOW_INITIALIZED;
464 }
465 }
466 } else {
467 n = next_page - dst_addr;
468 BUG_ON(n > sizeof(shadow));
469
470 /* First page */
471 x = kmemcheck_shadow_lookup(dst_addr);
472 if (x) {
473 kmemcheck_save_addr(dst_addr);
474 for (i = 0; i < n; ++i) {
475 x[i] = shadow[i];
476 shadow[i] = KMEMCHECK_SHADOW_INITIALIZED;
477 }
478 }
479
480 /* Second page */
481 x = kmemcheck_shadow_lookup(next_page);
482 if (x) {
483 kmemcheck_save_addr(next_page);
484 for (i = n; i < size; ++i) {
485 x[i - n] = shadow[i];
486 shadow[i] = KMEMCHECK_SHADOW_INITIALIZED;
487 }
488 }
489 }
490
491 status = kmemcheck_shadow_test(shadow, size);
492 if (status == KMEMCHECK_SHADOW_INITIALIZED)
493 return;
494
495 if (kmemcheck_enabled)
496 kmemcheck_error_save(status, src_addr, size, regs);
497
498 if (kmemcheck_enabled == 2)
499 kmemcheck_enabled = 0;
500}
501
502enum kmemcheck_method {
503 KMEMCHECK_READ,
504 KMEMCHECK_WRITE,
505};
506
507static void kmemcheck_access(struct pt_regs *regs,
508 unsigned long fallback_address, enum kmemcheck_method fallback_method)
509{
510 const uint8_t *insn;
511 const uint8_t *insn_primary;
512 unsigned int size;
513
514 struct kmemcheck_context *data = &__get_cpu_var(kmemcheck_context);
515
516 /* Recursive fault -- ouch. */
517 if (data->busy) {
518 kmemcheck_show_addr(fallback_address);
519 kmemcheck_error_save_bug(regs);
520 return;
521 }
522
523 data->busy = true;
524
525 insn = (const uint8_t *) regs->ip;
526 insn_primary = kmemcheck_opcode_get_primary(insn);
527
528 kmemcheck_opcode_decode(insn, &size);
529
530 switch (insn_primary[0]) {
531#ifdef CONFIG_KMEMCHECK_BITOPS_OK
532 /* AND, OR, XOR */
533 /*
534 * Unfortunately, these instructions have to be excluded from
535 * our regular checking since they access only some (and not
536 * all) bits. This clears out "bogus" bitfield-access warnings.
537 */
538 case 0x80:
539 case 0x81:
540 case 0x82:
541 case 0x83:
542 switch ((insn_primary[1] >> 3) & 7) {
543 /* OR */
544 case 1:
545 /* AND */
546 case 4:
547 /* XOR */
548 case 6:
549 kmemcheck_write(regs, fallback_address, size);
550 goto out;
551
552 /* ADD */
553 case 0:
554 /* ADC */
555 case 2:
556 /* SBB */
557 case 3:
558 /* SUB */
559 case 5:
560 /* CMP */
561 case 7:
562 break;
563 }
564 break;
565#endif
566
567 /* MOVS, MOVSB, MOVSW, MOVSD */
568 case 0xa4:
569 case 0xa5:
570 /*
571 * These instructions are special because they take two
572 * addresses, but we only get one page fault.
573 */
574 kmemcheck_copy(regs, regs->si, regs->di, size);
575 goto out;
576
577 /* CMPS, CMPSB, CMPSW, CMPSD */
578 case 0xa6:
579 case 0xa7:
580 kmemcheck_read(regs, regs->si, size);
581 kmemcheck_read(regs, regs->di, size);
582 goto out;
583 }
584
585 /*
586 * If the opcode isn't special in any way, we use the data from the
587 * page fault handler to determine the address and type of memory
588 * access.
589 */
590 switch (fallback_method) {
591 case KMEMCHECK_READ:
592 kmemcheck_read(regs, fallback_address, size);
593 goto out;
594 case KMEMCHECK_WRITE:
595 kmemcheck_write(regs, fallback_address, size);
596 goto out;
597 }
598
599out:
600 data->busy = false;
601}
602
603bool kmemcheck_fault(struct pt_regs *regs, unsigned long address,
604 unsigned long error_code)
605{
606 pte_t *pte;
607
608 /*
609 * XXX: Is it safe to assume that memory accesses from virtual 86
610 * mode or non-kernel code segments will _never_ access kernel
611 * memory (e.g. tracked pages)? For now, we need this to avoid
612 * invoking kmemcheck for PnP BIOS calls.
613 */
614 if (regs->flags & X86_VM_MASK)
615 return false;
616 if (regs->cs != __KERNEL_CS)
617 return false;
618
619 pte = kmemcheck_pte_lookup(address);
620 if (!pte)
621 return false;
622
623 if (error_code & 2)
624 kmemcheck_access(regs, address, KMEMCHECK_WRITE);
625 else
626 kmemcheck_access(regs, address, KMEMCHECK_READ);
627
628 kmemcheck_show(regs);
629 return true;
630}
631
632bool kmemcheck_trap(struct pt_regs *regs)
633{
634 if (!kmemcheck_active(regs))
635 return false;
636
637 /* We're done. */
638 kmemcheck_hide(regs);
639 return true;
640}
diff --git a/arch/x86/mm/kmemcheck/opcode.c b/arch/x86/mm/kmemcheck/opcode.c
new file mode 100644
index 000000000000..63c19e27aa6f
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/opcode.c
@@ -0,0 +1,106 @@
1#include <linux/types.h>
2
3#include "opcode.h"
4
5static bool opcode_is_prefix(uint8_t b)
6{
7 return
8 /* Group 1 */
9 b == 0xf0 || b == 0xf2 || b == 0xf3
10 /* Group 2 */
11 || b == 0x2e || b == 0x36 || b == 0x3e || b == 0x26
12 || b == 0x64 || b == 0x65 || b == 0x2e || b == 0x3e
13 /* Group 3 */
14 || b == 0x66
15 /* Group 4 */
16 || b == 0x67;
17}
18
19#ifdef CONFIG_X86_64
20static bool opcode_is_rex_prefix(uint8_t b)
21{
22 return (b & 0xf0) == 0x40;
23}
24#else
25static bool opcode_is_rex_prefix(uint8_t b)
26{
27 return false;
28}
29#endif
30
31#define REX_W (1 << 3)
32
33/*
34 * This is a VERY crude opcode decoder. We only need to find the size of the
35 * load/store that caused our #PF and this should work for all the opcodes
36 * that we care about. Moreover, the ones who invented this instruction set
37 * should be shot.
38 */
39void kmemcheck_opcode_decode(const uint8_t *op, unsigned int *size)
40{
41 /* Default operand size */
42 int operand_size_override = 4;
43
44 /* prefixes */
45 for (; opcode_is_prefix(*op); ++op) {
46 if (*op == 0x66)
47 operand_size_override = 2;
48 }
49
50 /* REX prefix */
51 if (opcode_is_rex_prefix(*op)) {
52 uint8_t rex = *op;
53
54 ++op;
55 if (rex & REX_W) {
56 switch (*op) {
57 case 0x63:
58 *size = 4;
59 return;
60 case 0x0f:
61 ++op;
62
63 switch (*op) {
64 case 0xb6:
65 case 0xbe:
66 *size = 1;
67 return;
68 case 0xb7:
69 case 0xbf:
70 *size = 2;
71 return;
72 }
73
74 break;
75 }
76
77 *size = 8;
78 return;
79 }
80 }
81
82 /* escape opcode */
83 if (*op == 0x0f) {
84 ++op;
85
86 /*
87 * This is move with zero-extend and sign-extend, respectively;
88 * we don't have to think about 0xb6/0xbe, because this is
89 * already handled in the conditional below.
90 */
91 if (*op == 0xb7 || *op == 0xbf)
92 operand_size_override = 2;
93 }
94
95 *size = (*op & 1) ? operand_size_override : 1;
96}
97
98const uint8_t *kmemcheck_opcode_get_primary(const uint8_t *op)
99{
100 /* skip prefixes */
101 while (opcode_is_prefix(*op))
102 ++op;
103 if (opcode_is_rex_prefix(*op))
104 ++op;
105 return op;
106}
diff --git a/arch/x86/mm/kmemcheck/opcode.h b/arch/x86/mm/kmemcheck/opcode.h
new file mode 100644
index 000000000000..6956aad66b5b
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/opcode.h
@@ -0,0 +1,9 @@
1#ifndef ARCH__X86__MM__KMEMCHECK__OPCODE_H
2#define ARCH__X86__MM__KMEMCHECK__OPCODE_H
3
4#include <linux/types.h>
5
6void kmemcheck_opcode_decode(const uint8_t *op, unsigned int *size);
7const uint8_t *kmemcheck_opcode_get_primary(const uint8_t *op);
8
9#endif
diff --git a/arch/x86/mm/kmemcheck/pte.c b/arch/x86/mm/kmemcheck/pte.c
new file mode 100644
index 000000000000..4ead26eeaf96
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/pte.c
@@ -0,0 +1,22 @@
1#include <linux/mm.h>
2
3#include <asm/pgtable.h>
4
5#include "pte.h"
6
7pte_t *kmemcheck_pte_lookup(unsigned long address)
8{
9 pte_t *pte;
10 unsigned int level;
11
12 pte = lookup_address(address, &level);
13 if (!pte)
14 return NULL;
15 if (level != PG_LEVEL_4K)
16 return NULL;
17 if (!pte_hidden(*pte))
18 return NULL;
19
20 return pte;
21}
22
diff --git a/arch/x86/mm/kmemcheck/pte.h b/arch/x86/mm/kmemcheck/pte.h
new file mode 100644
index 000000000000..9f5966456492
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/pte.h
@@ -0,0 +1,10 @@
1#ifndef ARCH__X86__MM__KMEMCHECK__PTE_H
2#define ARCH__X86__MM__KMEMCHECK__PTE_H
3
4#include <linux/mm.h>
5
6#include <asm/pgtable.h>
7
8pte_t *kmemcheck_pte_lookup(unsigned long address);
9
10#endif
diff --git a/arch/x86/mm/kmemcheck/selftest.c b/arch/x86/mm/kmemcheck/selftest.c
new file mode 100644
index 000000000000..036efbea8b28
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/selftest.c
@@ -0,0 +1,69 @@
1#include <linux/kernel.h>
2
3#include "opcode.h"
4#include "selftest.h"
5
6struct selftest_opcode {
7 unsigned int expected_size;
8 const uint8_t *insn;
9 const char *desc;
10};
11
12static const struct selftest_opcode selftest_opcodes[] = {
13 /* REP MOVS */
14 {1, "\xf3\xa4", "rep movsb <mem8>, <mem8>"},
15 {4, "\xf3\xa5", "rep movsl <mem32>, <mem32>"},
16
17 /* MOVZX / MOVZXD */
18 {1, "\x66\x0f\xb6\x51\xf8", "movzwq <mem8>, <reg16>"},
19 {1, "\x0f\xb6\x51\xf8", "movzwq <mem8>, <reg32>"},
20
21 /* MOVSX / MOVSXD */
22 {1, "\x66\x0f\xbe\x51\xf8", "movswq <mem8>, <reg16>"},
23 {1, "\x0f\xbe\x51\xf8", "movswq <mem8>, <reg32>"},
24
25#ifdef CONFIG_X86_64
26 /* MOVZX / MOVZXD */
27 {1, "\x49\x0f\xb6\x51\xf8", "movzbq <mem8>, <reg64>"},
28 {2, "\x49\x0f\xb7\x51\xf8", "movzbq <mem16>, <reg64>"},
29
30 /* MOVSX / MOVSXD */
31 {1, "\x49\x0f\xbe\x51\xf8", "movsbq <mem8>, <reg64>"},
32 {2, "\x49\x0f\xbf\x51\xf8", "movsbq <mem16>, <reg64>"},
33 {4, "\x49\x63\x51\xf8", "movslq <mem32>, <reg64>"},
34#endif
35};
36
37static bool selftest_opcode_one(const struct selftest_opcode *op)
38{
39 unsigned size;
40
41 kmemcheck_opcode_decode(op->insn, &size);
42
43 if (size == op->expected_size)
44 return true;
45
46 printk(KERN_WARNING "kmemcheck: opcode %s: expected size %d, got %d\n",
47 op->desc, op->expected_size, size);
48 return false;
49}
50
51static bool selftest_opcodes_all(void)
52{
53 bool pass = true;
54 unsigned int i;
55
56 for (i = 0; i < ARRAY_SIZE(selftest_opcodes); ++i)
57 pass = pass && selftest_opcode_one(&selftest_opcodes[i]);
58
59 return pass;
60}
61
62bool kmemcheck_selftest(void)
63{
64 bool pass = true;
65
66 pass = pass && selftest_opcodes_all();
67
68 return pass;
69}
diff --git a/arch/x86/mm/kmemcheck/selftest.h b/arch/x86/mm/kmemcheck/selftest.h
new file mode 100644
index 000000000000..8fed4fe11f95
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/selftest.h
@@ -0,0 +1,6 @@
1#ifndef ARCH_X86_MM_KMEMCHECK_SELFTEST_H
2#define ARCH_X86_MM_KMEMCHECK_SELFTEST_H
3
4bool kmemcheck_selftest(void);
5
6#endif
diff --git a/arch/x86/mm/kmemcheck/shadow.c b/arch/x86/mm/kmemcheck/shadow.c
new file mode 100644
index 000000000000..e773b6bd0079
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/shadow.c
@@ -0,0 +1,162 @@
1#include <linux/kmemcheck.h>
2#include <linux/module.h>
3#include <linux/mm.h>
4#include <linux/module.h>
5
6#include <asm/page.h>
7#include <asm/pgtable.h>
8
9#include "pte.h"
10#include "shadow.h"
11
12/*
13 * Return the shadow address for the given address. Returns NULL if the
14 * address is not tracked.
15 *
16 * We need to be extremely careful not to follow any invalid pointers,
17 * because this function can be called for *any* possible address.
18 */
19void *kmemcheck_shadow_lookup(unsigned long address)
20{
21 pte_t *pte;
22 struct page *page;
23
24 if (!virt_addr_valid(address))
25 return NULL;
26
27 pte = kmemcheck_pte_lookup(address);
28 if (!pte)
29 return NULL;
30
31 page = virt_to_page(address);
32 if (!page->shadow)
33 return NULL;
34 return page->shadow + (address & (PAGE_SIZE - 1));
35}
36
37static void mark_shadow(void *address, unsigned int n,
38 enum kmemcheck_shadow status)
39{
40 unsigned long addr = (unsigned long) address;
41 unsigned long last_addr = addr + n - 1;
42 unsigned long page = addr & PAGE_MASK;
43 unsigned long last_page = last_addr & PAGE_MASK;
44 unsigned int first_n;
45 void *shadow;
46
47 /* If the memory range crosses a page boundary, stop there. */
48 if (page == last_page)
49 first_n = n;
50 else
51 first_n = page + PAGE_SIZE - addr;
52
53 shadow = kmemcheck_shadow_lookup(addr);
54 if (shadow)
55 memset(shadow, status, first_n);
56
57 addr += first_n;
58 n -= first_n;
59
60 /* Do full-page memset()s. */
61 while (n >= PAGE_SIZE) {
62 shadow = kmemcheck_shadow_lookup(addr);
63 if (shadow)
64 memset(shadow, status, PAGE_SIZE);
65
66 addr += PAGE_SIZE;
67 n -= PAGE_SIZE;
68 }
69
70 /* Do the remaining page, if any. */
71 if (n > 0) {
72 shadow = kmemcheck_shadow_lookup(addr);
73 if (shadow)
74 memset(shadow, status, n);
75 }
76}
77
78void kmemcheck_mark_unallocated(void *address, unsigned int n)
79{
80 mark_shadow(address, n, KMEMCHECK_SHADOW_UNALLOCATED);
81}
82
83void kmemcheck_mark_uninitialized(void *address, unsigned int n)
84{
85 mark_shadow(address, n, KMEMCHECK_SHADOW_UNINITIALIZED);
86}
87
88/*
89 * Fill the shadow memory of the given address such that the memory at that
90 * address is marked as being initialized.
91 */
92void kmemcheck_mark_initialized(void *address, unsigned int n)
93{
94 mark_shadow(address, n, KMEMCHECK_SHADOW_INITIALIZED);
95}
96EXPORT_SYMBOL_GPL(kmemcheck_mark_initialized);
97
98void kmemcheck_mark_freed(void *address, unsigned int n)
99{
100 mark_shadow(address, n, KMEMCHECK_SHADOW_FREED);
101}
102
103void kmemcheck_mark_unallocated_pages(struct page *p, unsigned int n)
104{
105 unsigned int i;
106
107 for (i = 0; i < n; ++i)
108 kmemcheck_mark_unallocated(page_address(&p[i]), PAGE_SIZE);
109}
110
111void kmemcheck_mark_uninitialized_pages(struct page *p, unsigned int n)
112{
113 unsigned int i;
114
115 for (i = 0; i < n; ++i)
116 kmemcheck_mark_uninitialized(page_address(&p[i]), PAGE_SIZE);
117}
118
119void kmemcheck_mark_initialized_pages(struct page *p, unsigned int n)
120{
121 unsigned int i;
122
123 for (i = 0; i < n; ++i)
124 kmemcheck_mark_initialized(page_address(&p[i]), PAGE_SIZE);
125}
126
127enum kmemcheck_shadow kmemcheck_shadow_test(void *shadow, unsigned int size)
128{
129 uint8_t *x;
130 unsigned int i;
131
132 x = shadow;
133
134#ifdef CONFIG_KMEMCHECK_PARTIAL_OK
135 /*
136 * Make sure _some_ bytes are initialized. Gcc frequently generates
137 * code to access neighboring bytes.
138 */
139 for (i = 0; i < size; ++i) {
140 if (x[i] == KMEMCHECK_SHADOW_INITIALIZED)
141 return x[i];
142 }
143#else
144 /* All bytes must be initialized. */
145 for (i = 0; i < size; ++i) {
146 if (x[i] != KMEMCHECK_SHADOW_INITIALIZED)
147 return x[i];
148 }
149#endif
150
151 return x[0];
152}
153
154void kmemcheck_shadow_set(void *shadow, unsigned int size)
155{
156 uint8_t *x;
157 unsigned int i;
158
159 x = shadow;
160 for (i = 0; i < size; ++i)
161 x[i] = KMEMCHECK_SHADOW_INITIALIZED;
162}
diff --git a/arch/x86/mm/kmemcheck/shadow.h b/arch/x86/mm/kmemcheck/shadow.h
new file mode 100644
index 000000000000..af46d9ab9d86
--- /dev/null
+++ b/arch/x86/mm/kmemcheck/shadow.h
@@ -0,0 +1,16 @@
1#ifndef ARCH__X86__MM__KMEMCHECK__SHADOW_H
2#define ARCH__X86__MM__KMEMCHECK__SHADOW_H
3
4enum kmemcheck_shadow {
5 KMEMCHECK_SHADOW_UNALLOCATED,
6 KMEMCHECK_SHADOW_UNINITIALIZED,
7 KMEMCHECK_SHADOW_INITIALIZED,
8 KMEMCHECK_SHADOW_FREED,
9};
10
11void *kmemcheck_shadow_lookup(unsigned long address);
12
13enum kmemcheck_shadow kmemcheck_shadow_test(void *shadow, unsigned int size);
14void kmemcheck_shadow_set(void *shadow, unsigned int size);
15
16#endif
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 6ce9518fe2ac..3cfe9ced8a4c 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -470,7 +470,7 @@ static int split_large_page(pte_t *kpte, unsigned long address)
470 470
471 if (!debug_pagealloc) 471 if (!debug_pagealloc)
472 spin_unlock(&cpa_lock); 472 spin_unlock(&cpa_lock);
473 base = alloc_pages(GFP_KERNEL, 0); 473 base = alloc_pages(GFP_KERNEL | __GFP_NOTRACK, 0);
474 if (!debug_pagealloc) 474 if (!debug_pagealloc)
475 spin_lock(&cpa_lock); 475 spin_lock(&cpa_lock);
476 if (!base) 476 if (!base)
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 7aa03a5389f5..8e43bdd45456 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -4,9 +4,11 @@
4#include <asm/tlb.h> 4#include <asm/tlb.h>
5#include <asm/fixmap.h> 5#include <asm/fixmap.h>
6 6
7#define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO
8
7pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) 9pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
8{ 10{
9 return (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); 11 return (pte_t *)__get_free_page(PGALLOC_GFP);
10} 12}
11 13
12pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address) 14pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
@@ -14,9 +16,9 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
14 struct page *pte; 16 struct page *pte;
15 17
16#ifdef CONFIG_HIGHPTE 18#ifdef CONFIG_HIGHPTE
17 pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT|__GFP_ZERO, 0); 19 pte = alloc_pages(PGALLOC_GFP | __GFP_HIGHMEM, 0);
18#else 20#else
19 pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0); 21 pte = alloc_pages(PGALLOC_GFP, 0);
20#endif 22#endif
21 if (pte) 23 if (pte)
22 pgtable_page_ctor(pte); 24 pgtable_page_ctor(pte);
@@ -161,7 +163,7 @@ static int preallocate_pmds(pmd_t *pmds[])
161 bool failed = false; 163 bool failed = false;
162 164
163 for(i = 0; i < PREALLOCATED_PMDS; i++) { 165 for(i = 0; i < PREALLOCATED_PMDS; i++) {
164 pmd_t *pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 166 pmd_t *pmd = (pmd_t *)__get_free_page(PGALLOC_GFP);
165 if (pmd == NULL) 167 if (pmd == NULL)
166 failed = true; 168 failed = true;
167 pmds[i] = pmd; 169 pmds[i] = pmd;
@@ -228,7 +230,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
228 pmd_t *pmds[PREALLOCATED_PMDS]; 230 pmd_t *pmds[PREALLOCATED_PMDS];
229 unsigned long flags; 231 unsigned long flags;
230 232
231 pgd = (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO); 233 pgd = (pgd_t *)__get_free_page(PGALLOC_GFP);
232 234
233 if (pgd == NULL) 235 if (pgd == NULL)
234 goto out; 236 goto out;
diff --git a/arch/xtensa/include/asm/kmap_types.h b/arch/xtensa/include/asm/kmap_types.h
index 9e822d2e3bce..11c687e527f1 100644
--- a/arch/xtensa/include/asm/kmap_types.h
+++ b/arch/xtensa/include/asm/kmap_types.h
@@ -1,31 +1,6 @@
1/*
2 * include/asm-xtensa/kmap_types.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_KMAP_TYPES_H 1#ifndef _XTENSA_KMAP_TYPES_H
12#define _XTENSA_KMAP_TYPES_H 2#define _XTENSA_KMAP_TYPES_H
13 3
14enum km_type { 4#include <asm-generic/kmap_types.h>
15 KM_BOUNCE_READ,
16 KM_SKB_SUNRPC_DATA,
17 KM_SKB_DATA_SOFTIRQ,
18 KM_USER0,
19 KM_USER1,
20 KM_BIO_SRC_IRQ,
21 KM_BIO_DST_IRQ,
22 KM_PTE0,
23 KM_PTE1,
24 KM_IRQ0,
25 KM_IRQ1,
26 KM_SOFTIRQ0,
27 KM_SOFTIRQ1,
28 KM_TYPE_NR
29};
30 5
31#endif /* _XTENSA_KMAP_TYPES_H */ 6#endif /* _XTENSA_KMAP_TYPES_H */
diff --git a/arch/xtensa/kernel/init_task.c b/arch/xtensa/kernel/init_task.c
index e07f5c9fcd35..c4302f0e4ba0 100644
--- a/arch/xtensa/kernel/init_task.c
+++ b/arch/xtensa/kernel/init_task.c
@@ -23,10 +23,6 @@
23 23
24static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 24static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
25static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 25static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
26struct mm_struct init_mm = INIT_MM(init_mm);
27
28EXPORT_SYMBOL(init_mm);
29
30union thread_union init_thread_union 26union thread_union init_thread_union
31 __attribute__((__section__(".data.init_task"))) = 27 __attribute__((__section__(".data.init_task"))) =
32{ INIT_THREAD_INFO(init_task) }; 28{ INIT_THREAD_INFO(init_task) };