aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/Kconfig29
-rw-r--r--arch/powerpc/Kconfig.debug10
-rw-r--r--arch/powerpc/Makefile56
-rw-r--r--arch/powerpc/boot/.gitignore8
-rw-r--r--arch/powerpc/boot/44x.c85
-rw-r--r--arch/powerpc/boot/44x.h5
-rw-r--r--arch/powerpc/boot/4xx.c300
-rw-r--r--arch/powerpc/boot/4xx.h22
-rw-r--r--arch/powerpc/boot/Makefile16
-rw-r--r--arch/powerpc/boot/bamboo.c47
-rw-r--r--arch/powerpc/boot/cpm-serial.c249
-rw-r--r--arch/powerpc/boot/cuboot-52xx.c59
-rw-r--r--arch/powerpc/boot/cuboot-83xx.c1
-rw-r--r--arch/powerpc/boot/cuboot-85xx.c1
-rw-r--r--arch/powerpc/boot/cuboot-8xx.c45
-rw-r--r--arch/powerpc/boot/cuboot-bamboo.c30
-rw-r--r--arch/powerpc/boot/cuboot-pq2.c283
-rw-r--r--arch/powerpc/boot/cuboot-sequoia.c56
-rw-r--r--arch/powerpc/boot/cuboot.c3
-rw-r--r--arch/powerpc/boot/dcr.h18
-rw-r--r--arch/powerpc/boot/devtree.c99
-rw-r--r--arch/powerpc/boot/dts/bamboo.dts244
-rw-r--r--arch/powerpc/boot/dts/ebony.dts35
-rw-r--r--arch/powerpc/boot/dts/holly.dts5
-rw-r--r--arch/powerpc/boot/dts/kuroboxHD.dts9
-rw-r--r--arch/powerpc/boot/dts/kuroboxHG.dts9
-rw-r--r--arch/powerpc/boot/dts/lite5200.dts49
-rw-r--r--arch/powerpc/boot/dts/lite5200b.dts59
-rw-r--r--arch/powerpc/boot/dts/mpc7448hpc2.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8272ads.dts371
-rw-r--r--arch/powerpc/boot/dts/mpc8313erdb.dts63
-rw-r--r--arch/powerpc/boot/dts/mpc832x_mds.dts122
-rw-r--r--arch/powerpc/boot/dts/mpc832x_rdb.dts72
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitx.dts100
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitxgp.dts48
-rw-r--r--arch/powerpc/boot/dts/mpc834x_mds.dts245
-rw-r--r--arch/powerpc/boot/dts/mpc836x_mds.dts123
-rw-r--r--arch/powerpc/boot/dts/mpc8540ads.dts175
-rw-r--r--arch/powerpc/boot/dts/mpc8541cds.dts196
-rw-r--r--arch/powerpc/boot/dts/mpc8544ds.dts377
-rw-r--r--arch/powerpc/boot/dts/mpc8548cds.dts404
-rw-r--r--arch/powerpc/boot/dts/mpc8555cds.dts196
-rw-r--r--arch/powerpc/boot/dts/mpc8560ads.dts185
-rw-r--r--arch/powerpc/boot/dts/mpc8568mds.dts4
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds.dts404
-rw-r--r--arch/powerpc/boot/dts/mpc8641_hpcn.dts275
-rw-r--r--arch/powerpc/boot/dts/mpc866ads.dts5
-rw-r--r--arch/powerpc/boot/dts/mpc885ads.dts5
-rw-r--r--arch/powerpc/boot/dts/prpmc2800.dts5
-rw-r--r--arch/powerpc/boot/dts/sequoia.dts302
-rw-r--r--arch/powerpc/boot/dts/walnut.dts190
-rw-r--r--arch/powerpc/boot/ebony.c45
-rw-r--r--arch/powerpc/boot/flatdevtree.c100
-rw-r--r--arch/powerpc/boot/flatdevtree.h8
-rw-r--r--arch/powerpc/boot/flatdevtree_env.h20
-rw-r--r--arch/powerpc/boot/flatdevtree_misc.c8
-rw-r--r--arch/powerpc/boot/gunzip_util.c8
-rw-r--r--arch/powerpc/boot/holly.c5
-rw-r--r--arch/powerpc/boot/io.h49
-rw-r--r--arch/powerpc/boot/main.c10
-rw-r--r--arch/powerpc/boot/mpc52xx-psc.c69
-rw-r--r--arch/powerpc/boot/mpsc.c1
-rw-r--r--arch/powerpc/boot/mv64x60_i2c.c2
-rw-r--r--arch/powerpc/boot/of.c2
-rw-r--r--arch/powerpc/boot/ops.h35
-rw-r--r--arch/powerpc/boot/planetcore.c166
-rw-r--r--arch/powerpc/boot/planetcore.h49
-rw-r--r--arch/powerpc/boot/ppcboot.h7
-rw-r--r--arch/powerpc/boot/prpmc2800.c6
-rw-r--r--arch/powerpc/boot/ps3.c4
-rw-r--r--arch/powerpc/boot/serial.c21
-rw-r--r--arch/powerpc/boot/stdlib.c45
-rw-r--r--arch/powerpc/boot/stdlib.h6
-rw-r--r--arch/powerpc/boot/string.S24
-rw-r--r--arch/powerpc/boot/string.h2
-rw-r--r--arch/powerpc/boot/treeboot-bamboo.c43
-rw-r--r--arch/powerpc/boot/treeboot-ebony.c2
-rw-r--r--arch/powerpc/boot/treeboot-walnut.c131
-rw-r--r--arch/powerpc/configs/bamboo_defconfig775
-rw-r--r--arch/powerpc/configs/ebony_defconfig85
-rw-r--r--arch/powerpc/configs/mpc8544_ds_defconfig2
-rw-r--r--arch/powerpc/configs/mpc8572_ds_defconfig1496
-rw-r--r--arch/powerpc/configs/sequoia_defconfig861
-rw-r--r--arch/powerpc/configs/walnut_defconfig773
-rw-r--r--arch/powerpc/kernel/Makefile40
-rw-r--r--arch/powerpc/kernel/align.c307
-rw-r--r--arch/powerpc/kernel/asm-offsets.c12
-rw-r--r--arch/powerpc/kernel/btext.c1
-rw-r--r--arch/powerpc/kernel/clock.c82
-rw-r--r--arch/powerpc/kernel/cputable.c41
-rw-r--r--arch/powerpc/kernel/crash.c1
-rw-r--r--arch/powerpc/kernel/crash_dump.c4
-rw-r--r--arch/powerpc/kernel/entry_32.S4
-rw-r--r--arch/powerpc/kernel/entry_64.S8
-rw-r--r--arch/powerpc/kernel/head_32.S37
-rw-r--r--arch/powerpc/kernel/head_40x.S (renamed from arch/powerpc/kernel/head_4xx.S)22
-rw-r--r--arch/powerpc/kernel/head_44x.S16
-rw-r--r--arch/powerpc/kernel/head_64.S602
-rw-r--r--arch/powerpc/kernel/head_8xx.S17
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S14
-rw-r--r--arch/powerpc/kernel/ibmebus.c7
-rw-r--r--arch/powerpc/kernel/iomap.c4
-rw-r--r--arch/powerpc/kernel/iommu.c1
-rw-r--r--arch/powerpc/kernel/irq.c97
-rw-r--r--arch/powerpc/kernel/lparcfg.c2
-rw-r--r--arch/powerpc/kernel/lparmap.c32
-rw-r--r--arch/powerpc/kernel/nvram_64.c23
-rw-r--r--arch/powerpc/kernel/pci-common.c7
-rw-r--r--arch/powerpc/kernel/pci_32.c4
-rw-r--r--arch/powerpc/kernel/pci_64.c2
-rw-r--r--arch/powerpc/kernel/pci_dn.c7
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c8
-rw-r--r--arch/powerpc/kernel/process.c23
-rw-r--r--arch/powerpc/kernel/prom.c21
-rw-r--r--arch/powerpc/kernel/prom_init.c23
-rw-r--r--arch/powerpc/kernel/ptrace.c10
-rw-r--r--arch/powerpc/kernel/ptrace32.c8
-rw-r--r--arch/powerpc/kernel/rtas_pci.c4
-rw-r--r--arch/powerpc/kernel/setup-common.c2
-rw-r--r--arch/powerpc/kernel/setup_32.c7
-rw-r--r--arch/powerpc/kernel/setup_64.c6
-rw-r--r--arch/powerpc/kernel/smp.c27
-rw-r--r--arch/powerpc/kernel/sysfs.c64
-rw-r--r--arch/powerpc/kernel/time.c358
-rw-r--r--arch/powerpc/kernel/traps.c79
-rw-r--r--arch/powerpc/kernel/udbg_16550.c11
-rw-r--r--arch/powerpc/kernel/vdso32/Makefile20
-rw-r--r--arch/powerpc/kernel/vdso64/Makefile19
-rw-r--r--arch/powerpc/kernel/vio.c23
-rw-r--r--arch/powerpc/kernel/vmlinux.lds.S2
-rw-r--r--arch/powerpc/lib/Makefile7
-rw-r--r--arch/powerpc/lib/alloc.c29
-rw-r--r--arch/powerpc/mm/40x_mmu.c (renamed from arch/powerpc/mm/4xx_mmu.c)4
-rw-r--r--arch/powerpc/mm/Makefile15
-rw-r--r--arch/powerpc/mm/hash_utils_64.c7
-rw-r--r--arch/powerpc/mm/hugetlbpage.c3
-rw-r--r--arch/powerpc/mm/init_32.c38
-rw-r--r--arch/powerpc/mm/init_64.c2
-rw-r--r--arch/powerpc/mm/mem.c1
-rw-r--r--arch/powerpc/mm/mmu_context_64.c11
-rw-r--r--arch/powerpc/mm/pgtable_64.c2
-rw-r--r--arch/powerpc/mm/slb.c6
-rw-r--r--arch/powerpc/mm/slice.c1
-rw-r--r--arch/powerpc/platforms/40x/Kconfig (renamed from arch/powerpc/platforms/4xx/Kconfig)91
-rw-r--r--arch/powerpc/platforms/40x/Makefile1
-rw-r--r--arch/powerpc/platforms/40x/walnut.c68
-rw-r--r--arch/powerpc/platforms/44x/Kconfig32
-rw-r--r--arch/powerpc/platforms/44x/Makefile2
-rw-r--r--arch/powerpc/platforms/44x/bamboo.c66
-rw-r--r--arch/powerpc/platforms/44x/sequoia.c66
-rw-r--r--arch/powerpc/platforms/4xx/Makefile1
-rw-r--r--arch/powerpc/platforms/52xx/Kconfig2
-rw-r--r--arch/powerpc/platforms/52xx/Makefile3
-rw-r--r--arch/powerpc/platforms/52xx/efika.c4
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c28
-rw-r--r--arch/powerpc/platforms/52xx/lite5200_pm.c213
-rw-r--r--arch/powerpc/platforms/52xx/lite5200_sleep.S412
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pic.c11
-rw-r--r--arch/powerpc/platforms/82xx/m82xx_pci.h2
-rw-r--r--arch/powerpc/platforms/82xx/mpc82xx.c1
-rw-r--r--arch/powerpc/platforms/82xx/mpc82xx_ads.c12
-rw-r--r--arch/powerpc/platforms/82xx/pq2ads.h1
-rw-r--r--arch/powerpc/platforms/83xx/mpc8313_rdb.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c48
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_itx.c3
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_mds.c3
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_mds.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc83xx.h2
-rw-r--r--arch/powerpc/platforms/83xx/pci.c7
-rw-r--r--arch/powerpc/platforms/85xx/Kconfig8
-rw-r--r--arch/powerpc/platforms/85xx/Makefile2
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c13
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c14
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c (renamed from arch/powerpc/platforms/85xx/mpc8544_ds.c)67
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c12
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c14
-rw-r--r--arch/powerpc/platforms/8xx/m8xx_setup.c76
-rw-r--r--arch/powerpc/platforms/8xx/mpc86xads.h1
-rw-r--r--arch/powerpc/platforms/8xx/mpc86xads_setup.c15
-rw-r--r--arch/powerpc/platforms/8xx/mpc885ads.h1
-rw-r--r--arch/powerpc/platforms/8xx/mpc885ads_setup.c32
-rw-r--r--arch/powerpc/platforms/Kconfig17
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype14
-rw-r--r--arch/powerpc/platforms/Makefile2
-rw-r--r--arch/powerpc/platforms/cell/Makefile4
-rw-r--r--arch/powerpc/platforms/cell/axon_msi.c35
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c2
-rw-r--r--arch/powerpc/platforms/cell/spider-pic.c22
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c2
-rw-r--r--arch/powerpc/platforms/cell/spu_callbacks.c4
-rw-r--r--arch/powerpc/platforms/cell/spu_coredump.c79
-rw-r--r--arch/powerpc/platforms/cell/spu_manage.c4
-rw-r--r--arch/powerpc/platforms/cell/spu_syscalls.c142
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c236
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c251
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c15
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c49
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h7
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c29
-rw-r--r--arch/powerpc/platforms/cell/spufs/syscalls.c48
-rw-r--r--arch/powerpc/platforms/celleb/Kconfig1
-rw-r--r--arch/powerpc/platforms/celleb/Makefile5
-rw-r--r--arch/powerpc/platforms/celleb/beat.c106
-rw-r--r--arch/powerpc/platforms/celleb/beat.h2
-rw-r--r--arch/powerpc/platforms/celleb/beat_syscall.h4
-rw-r--r--arch/powerpc/platforms/celleb/beat_wrapper.h68
-rw-r--r--arch/powerpc/platforms/celleb/htab.c130
-rw-r--r--arch/powerpc/platforms/celleb/interrupt.c9
-rw-r--r--arch/powerpc/platforms/celleb/io-workarounds.c279
-rw-r--r--arch/powerpc/platforms/celleb/pci.c98
-rw-r--r--arch/powerpc/platforms/celleb/pci.h9
-rw-r--r--arch/powerpc/platforms/celleb/scc.h2
-rw-r--r--arch/powerpc/platforms/celleb/scc_epci.c88
-rw-r--r--arch/powerpc/platforms/celleb/scc_sio.c56
-rw-r--r--arch/powerpc/platforms/celleb/setup.c22
-rw-r--r--arch/powerpc/platforms/chrp/gg2.h61
-rw-r--r--arch/powerpc/platforms/chrp/pci.c39
-rw-r--r--arch/powerpc/platforms/chrp/setup.c3
-rw-r--r--arch/powerpc/platforms/chrp/smp.c2
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig11
-rw-r--r--arch/powerpc/platforms/embedded6xx/holly.c14
-rw-r--r--arch/powerpc/platforms/embedded6xx/linkstation.c6
-rw-r--r--arch/powerpc/platforms/embedded6xx/ls_uart.c18
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc10x.h180
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c3
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h21
-rw-r--r--arch/powerpc/platforms/embedded6xx/prpmc2800.c8
-rw-r--r--arch/powerpc/platforms/iseries/Makefile1
-rw-r--r--arch/powerpc/platforms/iseries/exception.S251
-rw-r--r--arch/powerpc/platforms/iseries/exception.h58
-rw-r--r--arch/powerpc/platforms/iseries/irq.c10
-rw-r--r--arch/powerpc/platforms/iseries/it_lp_naca.h2
-rw-r--r--arch/powerpc/platforms/iseries/setup.c1
-rw-r--r--arch/powerpc/platforms/maple/pci.c21
-rw-r--r--arch/powerpc/platforms/pasemi/Kconfig1
-rw-r--r--arch/powerpc/platforms/pasemi/idle.c8
-rw-r--r--arch/powerpc/platforms/pasemi/iommu.c4
-rw-r--r--arch/powerpc/platforms/pasemi/pasemi.h4
-rw-r--r--arch/powerpc/platforms/pasemi/pci.c74
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c134
-rw-r--r--arch/powerpc/platforms/powermac/bootx_init.c1
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c1
-rw-r--r--arch/powerpc/platforms/powermac/pci.c25
-rw-r--r--arch/powerpc/platforms/powermac/pic.c2
-rw-r--r--arch/powerpc/platforms/powermac/pmac.h4
-rw-r--r--arch/powerpc/platforms/powermac/udbg_adb.c5
-rw-r--r--arch/powerpc/platforms/ps3/device-init.c24
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c9
-rw-r--r--arch/powerpc/platforms/ps3/platform.h4
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c54
-rw-r--r--arch/powerpc/platforms/pseries/eeh_cache.c9
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c1
-rw-r--r--arch/powerpc/platforms/pseries/msi.c35
-rw-r--r--arch/powerpc/platforms/pseries/rtasd.c99
-rw-r--r--arch/powerpc/platforms/pseries/xics.c2
-rw-r--r--arch/powerpc/sysdev/Makefile8
-rw-r--r--arch/powerpc/sysdev/commproc.c32
-rw-r--r--arch/powerpc/sysdev/cpm2_common.c2
-rw-r--r--arch/powerpc/sysdev/cpm2_pic.c11
-rw-r--r--arch/powerpc/sysdev/dart_iommu.c4
-rw-r--r--arch/powerpc/sysdev/dcr.c6
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c2
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c127
-rw-r--r--arch/powerpc/sysdev/fsl_soc.h7
-rw-r--r--arch/powerpc/sysdev/i8259.c8
-rw-r--r--arch/powerpc/sysdev/indirect_pci.c4
-rw-r--r--arch/powerpc/sysdev/ipic.c7
-rw-r--r--arch/powerpc/sysdev/ipic.h3
-rw-r--r--arch/powerpc/sysdev/mpc8xx_pic.c23
-rw-r--r--arch/powerpc/sysdev/mpic.c53
-rw-r--r--arch/powerpc/sysdev/mpic.h1
-rw-r--r--arch/powerpc/sysdev/mpic_msi.c13
-rw-r--r--arch/powerpc/sysdev/mpic_u3msi.c36
-rw-r--r--arch/powerpc/sysdev/mv64x60.h1
-rw-r--r--arch/powerpc/sysdev/mv64x60_pic.c12
-rw-r--r--arch/powerpc/sysdev/mv64x60_udbg.c152
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c7
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.h3
-rw-r--r--arch/powerpc/sysdev/timer.c81
-rw-r--r--arch/powerpc/sysdev/tsi108_pci.c16
-rw-r--r--arch/powerpc/sysdev/uic.c75
-rw-r--r--arch/ppc/.gitignore2
-rw-r--r--arch/ppc/Kconfig154
-rw-r--r--arch/ppc/Makefile1
-rw-r--r--arch/ppc/amiga/Makefile8
-rw-r--r--arch/ppc/amiga/amiga_ksyms.c1
-rw-r--r--arch/ppc/amiga/amiints.c322
-rw-r--r--arch/ppc/amiga/amisound.c1
-rw-r--r--arch/ppc/amiga/bootinfo.c78
-rw-r--r--arch/ppc/amiga/chipram.c1
-rw-r--r--arch/ppc/amiga/cia.c176
-rw-r--r--arch/ppc/amiga/config.c953
-rw-r--r--arch/ppc/amiga/ints.c158
-rw-r--r--arch/ppc/amiga/pcmcia.c1
-rw-r--r--arch/ppc/amiga/time.c57
-rw-r--r--arch/ppc/configs/apus_defconfig920
-rw-r--r--arch/ppc/kernel/head.S117
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c3
-rw-r--r--arch/ppc/kernel/setup.c1
-rw-r--r--arch/ppc/kernel/vmlinux.lds.S2
-rw-r--r--arch/ppc/mm/pgtable.c38
-rw-r--r--arch/ppc/platforms/Makefile4
-rw-r--r--arch/ppc/platforms/apus_pci.c207
-rw-r--r--arch/ppc/platforms/apus_pci.h34
-rw-r--r--arch/ppc/platforms/apus_setup.c798
-rw-r--r--arch/ppc/syslib/ocp.c2
308 files changed, 13384 insertions, 8542 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 00099efe0e9f..6819a94f2cac 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -14,6 +14,11 @@ config 64BIT
14 bool 14 bool
15 default y if PPC64 15 default y if PPC64
16 16
17config WORD_SIZE
18 int
19 default 64 if PPC64
20 default 32 if !PPC64
21
17config PPC_MERGE 22config PPC_MERGE
18 def_bool y 23 def_bool y
19 24
@@ -21,6 +26,15 @@ config MMU
21 bool 26 bool
22 default y 27 default y
23 28
29config GENERIC_CMOS_UPDATE
30 def_bool y
31
32config GENERIC_TIME
33 def_bool y
34
35config GENERIC_TIME_VSYSCALL
36 def_bool y
37
24config GENERIC_HARDIRQS 38config GENERIC_HARDIRQS
25 bool 39 bool
26 default y 40 default y
@@ -181,16 +195,17 @@ config MATH_EMULATION
181 instructions to run. 195 instructions to run.
182 196
183config IOMMU_VMERGE 197config IOMMU_VMERGE
184 bool "Enable IOMMU virtual merging (EXPERIMENTAL)" 198 bool "Enable IOMMU virtual merging"
185 depends on EXPERIMENTAL && PPC64 199 depends on PPC64
186 default n 200 default y
187 help 201 help
188 Cause IO segments sent to a device for DMA to be merged virtually 202 Cause IO segments sent to a device for DMA to be merged virtually
189 by the IOMMU when they happen to have been allocated contiguously. 203 by the IOMMU when they happen to have been allocated contiguously.
190 This doesn't add pressure to the IOMMU allocator. However, some 204 This doesn't add pressure to the IOMMU allocator. However, some
191 drivers don't support getting large merged segments coming back 205 drivers don't support getting large merged segments coming back
192 from *_map_sg(). Say Y if you know the drivers you are using are 206 from *_map_sg().
193 properly handling this case. 207
208 Most drivers don't have this problem; it is safe to say Y here.
194 209
195config HOTPLUG_CPU 210config HOTPLUG_CPU
196 bool "Support for enabling/disabling CPUs" 211 bool "Support for enabling/disabling CPUs"
@@ -662,3 +677,7 @@ config KEYS_COMPAT
662 default y 677 default y
663 678
664source "crypto/Kconfig" 679source "crypto/Kconfig"
680
681config PPC_CLOCK
682 bool
683 default n
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 22acece95b11..c38bc2237057 100644
--- a/arch/powerpc/Kconfig.debug
+++ b/arch/powerpc/Kconfig.debug
@@ -124,6 +124,16 @@ config IRQSTACKS
124 for handling hard and soft interrupts. This can help avoid 124 for handling hard and soft interrupts. This can help avoid
125 overflowing the process kernel stacks. 125 overflowing the process kernel stacks.
126 126
127config VIRQ_DEBUG
128 bool "Expose hardware/virtual IRQ mapping via debugfs"
129 depends on DEBUG_FS && PPC_MERGE
130 help
131 This option will show the mapping relationship between hardware irq
132 numbers and virtual irq numbers. The mapping is exposed via debugfs
133 in the file powerpc/virq_mapping.
134
135 If you don't know what this means you don't need it.
136
127config BDI_SWITCH 137config BDI_SWITCH
128 bool "Include BDI-2000 user context switcher" 138 bool "Include BDI-2000 user context switcher"
129 depends on DEBUG_KERNEL && PPC32 139 depends on DEBUG_KERNEL && PPC32
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6c1e36c33faa..643839a3f5d8 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -35,11 +35,14 @@ endif
35 35
36export CROSS32CC CROSS32AS CROSS32LD CROSS32AR CROSS32OBJCOPY 36export CROSS32CC CROSS32AS CROSS32LD CROSS32AR CROSS32OBJCOPY
37 37
38ifeq ($(CROSS_COMPILE),)
38KBUILD_DEFCONFIG := $(shell uname -m)_defconfig 39KBUILD_DEFCONFIG := $(shell uname -m)_defconfig
40else
41KBUILD_DEFCONFIG := ppc64_defconfig
42endif
39 43
40ifeq ($(CONFIG_PPC64),y) 44ifeq ($(CONFIG_PPC64),y)
41OLDARCH := ppc64 45OLDARCH := ppc64
42SZ := 64
43 46
44new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) 47new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
45 48
@@ -49,22 +52,26 @@ endif
49 52
50else 53else
51OLDARCH := ppc 54OLDARCH := ppc
52SZ := 32 55endif
56
57# It seems there are times we use this Makefile without
58# including the config file, but this replicates the old behaviour
59ifeq ($(CONFIG_WORD_SIZE),)
60CONFIG_WORD_SIZE := 32
53endif 61endif
54 62
55UTS_MACHINE := $(OLDARCH) 63UTS_MACHINE := $(OLDARCH)
56 64
57ifeq ($(HAS_BIARCH),y) 65ifeq ($(HAS_BIARCH),y)
58override AS += -a$(SZ) 66override AS += -a$(CONFIG_WORD_SIZE)
59override LD += -m elf$(SZ)ppc 67override LD += -m elf$(CONFIG_WORD_SIZE)ppc
60override CC += -m$(SZ) 68override CC += -m$(CONFIG_WORD_SIZE)
61override AR := GNUTARGET=elf$(SZ)-powerpc $(AR) 69override AR := GNUTARGET=elf$(CONFIG_WORD_SIZE)-powerpc $(AR)
62endif 70endif
63 71
64LDFLAGS_vmlinux := -Bstatic 72LDFLAGS_vmlinux := -Bstatic
65 73
66# The -Iarch/$(ARCH)/include is temporary while we are merging 74CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)
67CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -Iarch/$(ARCH)/include
68AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) 75AFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH)
69CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc 76CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc
70CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple 77CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple
@@ -72,11 +79,8 @@ CPPFLAGS += $(CPPFLAGS-y)
72AFLAGS += $(AFLAGS-y) 79AFLAGS += $(AFLAGS-y)
73CFLAGS += -msoft-float -pipe $(CFLAGS-y) 80CFLAGS += -msoft-float -pipe $(CFLAGS-y)
74CPP = $(CC) -E $(CFLAGS) 81CPP = $(CC) -E $(CFLAGS)
75# Temporary hack until we have migrated to asm-powerpc
76LINUXINCLUDE-$(CONFIG_PPC32) := -Iarch/$(ARCH)/include
77LINUXINCLUDE += $(LINUXINCLUDE-y)
78 82
79CHECKFLAGS += -m$(SZ) -D__powerpc__ -D__powerpc$(SZ)__ 83CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
80 84
81ifeq ($(CONFIG_PPC64),y) 85ifeq ($(CONFIG_PPC64),y)
82GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi) 86GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi)
@@ -96,6 +100,10 @@ else
96endif 100endif
97endif 101endif
98 102
103ifeq ($(CONFIG_TUNE_CELL),y)
104 CFLAGS += $(call cc-option,-mtune=cell)
105endif
106
99# No AltiVec instruction when building kernel 107# No AltiVec instruction when building kernel
100CFLAGS += $(call cc-option,-mno-altivec) 108CFLAGS += $(call cc-option,-mno-altivec)
101 109
@@ -120,10 +128,9 @@ cpu-as-$(CONFIG_E200) += -Wa,-me200
120AFLAGS += $(cpu-as-y) 128AFLAGS += $(cpu-as-y)
121CFLAGS += $(cpu-as-y) 129CFLAGS += $(cpu-as-y)
122 130
123head-y := arch/powerpc/kernel/head_32.o 131head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
124head-$(CONFIG_PPC64) := arch/powerpc/kernel/head_64.o
125head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o 132head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o
126head-$(CONFIG_4xx) := arch/powerpc/kernel/head_4xx.o 133head-$(CONFIG_40x) := arch/powerpc/kernel/head_40x.o
127head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o 134head-$(CONFIG_44x) := arch/powerpc/kernel/head_44x.o
128head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o 135head-$(CONFIG_FSL_BOOKE) := arch/powerpc/kernel/head_fsl_booke.o
129 136
@@ -166,25 +173,20 @@ define archhelp
166 @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' 173 @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs'
167endef 174endef
168 175
169install: 176install: vdso_install
170 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install 177 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
171 178
179vdso_install:
180ifeq ($(CONFIG_PPC64),y)
181 $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
182endif
183 $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
184
172archclean: 185archclean:
173 $(Q)$(MAKE) $(clean)=$(boot) 186 $(Q)$(MAKE) $(clean)=$(boot)
174 187
175archmrproper:
176 $(Q)rm -rf arch/$(ARCH)/include
177
178archprepare: checkbin 188archprepare: checkbin
179 189
180ifeq ($(CONFIG_PPC32),y)
181# Temporary hack until we have migrated to asm-powerpc
182include/asm: arch/$(ARCH)/include/asm
183arch/$(ARCH)/include/asm: FORCE
184 $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
185 $(Q)ln -fsn $(srctree)/include/asm-$(OLDARCH) arch/$(ARCH)/include/asm
186endif
187
188# Use the file '.tmp_gas_check' for binutils tests, as gas won't output 190# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
189# to stdout and these checks are run even on install targets. 191# to stdout and these checks are run even on install targets.
190TOUT := .tmp_gas_check 192TOUT := .tmp_gas_check
diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore
index eec7af7e5993..2c187ca05982 100644
--- a/arch/powerpc/boot/.gitignore
+++ b/arch/powerpc/boot/.gitignore
@@ -18,14 +18,14 @@ kernel-vmlinux.strip.c
18kernel-vmlinux.strip.gz 18kernel-vmlinux.strip.gz
19mktree 19mktree
20uImage 20uImage
21cuImage 21cuImage.*
22cuImage.bin.gz
23cuImage.elf
24zImage 22zImage
23zImage.bin.*
25zImage.chrp 24zImage.chrp
26zImage.coff 25zImage.coff
27zImage.coff.lds 26zImage.coff.lds
28zImage.lds 27zImage.ep*
28zImage.*lds
29zImage.miboot 29zImage.miboot
30zImage.pmac 30zImage.pmac
31zImage.pseries 31zImage.pseries
diff --git a/arch/powerpc/boot/44x.c b/arch/powerpc/boot/44x.c
deleted file mode 100644
index 9f64e840bef6..000000000000
--- a/arch/powerpc/boot/44x.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Copyright 2007 David Gibson, IBM Corporation.
3 *
4 * Based on earlier code:
5 * Matt Porter <mporter@kernel.crashing.org>
6 * Copyright 2002-2005 MontaVista Software Inc.
7 *
8 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
9 * Copyright (c) 2003, 2004 Zultys Technologies
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 */
16#include <stddef.h>
17#include "types.h"
18#include "string.h"
19#include "stdio.h"
20#include "ops.h"
21#include "reg.h"
22#include "dcr.h"
23
24/* Read the 44x memory controller to get size of system memory. */
25void ibm44x_fixup_memsize(void)
26{
27 int i;
28 unsigned long memsize, bank_config;
29
30 memsize = 0;
31 for (i = 0; i < ARRAY_SIZE(sdram_bxcr); i++) {
32 mtdcr(DCRN_SDRAM0_CFGADDR, sdram_bxcr[i]);
33 bank_config = mfdcr(DCRN_SDRAM0_CFGDATA);
34
35 if (bank_config & SDRAM_CONFIG_BANK_ENABLE)
36 memsize += SDRAM_CONFIG_BANK_SIZE(bank_config);
37 }
38
39 dt_fixup_memory(0, memsize);
40}
41
42#define SPRN_DBCR0 0x134
43#define DBCR0_RST_SYSTEM 0x30000000
44
45void ibm44x_dbcr_reset(void)
46{
47 unsigned long tmp;
48
49 asm volatile (
50 "mfspr %0,%1\n"
51 "oris %0,%0,%2@h\n"
52 "mtspr %1,%0"
53 : "=&r"(tmp) : "i"(SPRN_DBCR0), "i"(DBCR0_RST_SYSTEM)
54 );
55
56}
57
58/* Read 4xx EBC bus bridge registers to get mappings of the peripheral
59 * banks into the OPB address space */
60void ibm4xx_fixup_ebc_ranges(const char *ebc)
61{
62 void *devp;
63 u32 bxcr;
64 u32 ranges[EBC_NUM_BANKS*4];
65 u32 *p = ranges;
66 int i;
67
68 for (i = 0; i < EBC_NUM_BANKS; i++) {
69 mtdcr(DCRN_EBC0_CFGADDR, EBC_BXCR(i));
70 bxcr = mfdcr(DCRN_EBC0_CFGDATA);
71
72 if ((bxcr & EBC_BXCR_BU) != EBC_BXCR_BU_OFF) {
73 *p++ = i;
74 *p++ = 0;
75 *p++ = bxcr & EBC_BXCR_BAS;
76 *p++ = EBC_BXCR_BANK_SIZE(bxcr);
77 }
78 }
79
80 devp = finddevice(ebc);
81 if (! devp)
82 fatal("Couldn't locate EBC node %s\n\r", ebc);
83
84 setprop(devp, "ranges", ranges, (p - ranges) * sizeof(u32));
85}
diff --git a/arch/powerpc/boot/44x.h b/arch/powerpc/boot/44x.h
index 577982c9a3cd..02563443788a 100644
--- a/arch/powerpc/boot/44x.h
+++ b/arch/powerpc/boot/44x.h
@@ -10,10 +10,7 @@
10#ifndef _PPC_BOOT_44X_H_ 10#ifndef _PPC_BOOT_44X_H_
11#define _PPC_BOOT_44X_H_ 11#define _PPC_BOOT_44X_H_
12 12
13void ibm44x_fixup_memsize(void);
14void ibm4xx_fixup_ebc_ranges(const char *ebc);
15
16void ibm44x_dbcr_reset(void);
17void ebony_init(void *mac0, void *mac1); 13void ebony_init(void *mac0, void *mac1);
14void bamboo_init(void *mac0, void *mac1);
18 15
19#endif /* _PPC_BOOT_44X_H_ */ 16#endif /* _PPC_BOOT_44X_H_ */
diff --git a/arch/powerpc/boot/4xx.c b/arch/powerpc/boot/4xx.c
new file mode 100644
index 000000000000..ebf9e217612d
--- /dev/null
+++ b/arch/powerpc/boot/4xx.c
@@ -0,0 +1,300 @@
1/*
2 * Copyright 2007 David Gibson, IBM Corporation.
3 *
4 * Based on earlier code:
5 * Matt Porter <mporter@kernel.crashing.org>
6 * Copyright 2002-2005 MontaVista Software Inc.
7 *
8 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
9 * Copyright (c) 2003, 2004 Zultys Technologies
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 */
16#include <stddef.h>
17#include "types.h"
18#include "string.h"
19#include "stdio.h"
20#include "ops.h"
21#include "reg.h"
22#include "dcr.h"
23
24/* Read the 4xx SDRAM controller to get size of system memory. */
25void ibm4xx_fixup_memsize(void)
26{
27 int i;
28 unsigned long memsize, bank_config;
29
30 memsize = 0;
31 for (i = 0; i < ARRAY_SIZE(sdram_bxcr); i++) {
32 mtdcr(DCRN_SDRAM0_CFGADDR, sdram_bxcr[i]);
33 bank_config = mfdcr(DCRN_SDRAM0_CFGDATA);
34
35 if (bank_config & SDRAM_CONFIG_BANK_ENABLE)
36 memsize += SDRAM_CONFIG_BANK_SIZE(bank_config);
37 }
38
39 dt_fixup_memory(0, memsize);
40}
41
42/* 4xx DDR1/2 Denali memory controller support */
43/* DDR0 registers */
44#define DDR0_02 2
45#define DDR0_08 8
46#define DDR0_10 10
47#define DDR0_14 14
48#define DDR0_42 42
49#define DDR0_43 43
50
51/* DDR0_02 */
52#define DDR_START 0x1
53#define DDR_START_SHIFT 0
54#define DDR_MAX_CS_REG 0x3
55#define DDR_MAX_CS_REG_SHIFT 24
56#define DDR_MAX_COL_REG 0xf
57#define DDR_MAX_COL_REG_SHIFT 16
58#define DDR_MAX_ROW_REG 0xf
59#define DDR_MAX_ROW_REG_SHIFT 8
60/* DDR0_08 */
61#define DDR_DDR2_MODE 0x1
62#define DDR_DDR2_MODE_SHIFT 0
63/* DDR0_10 */
64#define DDR_CS_MAP 0x3
65#define DDR_CS_MAP_SHIFT 8
66/* DDR0_14 */
67#define DDR_REDUC 0x1
68#define DDR_REDUC_SHIFT 16
69/* DDR0_42 */
70#define DDR_APIN 0x7
71#define DDR_APIN_SHIFT 24
72/* DDR0_43 */
73#define DDR_COL_SZ 0x7
74#define DDR_COL_SZ_SHIFT 8
75#define DDR_BANK8 0x1
76#define DDR_BANK8_SHIFT 0
77
78#define DDR_GET_VAL(val, mask, shift) (((val) >> (shift)) & (mask))
79
80static inline u32 mfdcr_sdram0(u32 reg)
81{
82 mtdcr(DCRN_SDRAM0_CFGADDR, reg);
83 return mfdcr(DCRN_SDRAM0_CFGDATA);
84}
85
86void ibm4xx_denali_fixup_memsize(void)
87{
88 u32 val, max_cs, max_col, max_row;
89 u32 cs, col, row, bank, dpath;
90 unsigned long memsize;
91
92 val = mfdcr_sdram0(DDR0_02);
93 if (!DDR_GET_VAL(val, DDR_START, DDR_START_SHIFT))
94 fatal("DDR controller is not initialized\n");
95
96 /* get maximum cs col and row values */
97 max_cs = DDR_GET_VAL(val, DDR_MAX_CS_REG, DDR_MAX_CS_REG_SHIFT);
98 max_col = DDR_GET_VAL(val, DDR_MAX_COL_REG, DDR_MAX_COL_REG_SHIFT);
99 max_row = DDR_GET_VAL(val, DDR_MAX_ROW_REG, DDR_MAX_ROW_REG_SHIFT);
100
101 /* get CS value */
102 val = mfdcr_sdram0(DDR0_10);
103
104 val = DDR_GET_VAL(val, DDR_CS_MAP, DDR_CS_MAP_SHIFT);
105 cs = 0;
106 while (val) {
107 if (val && 0x1)
108 cs++;
109 val = val >> 1;
110 }
111
112 if (!cs)
113 fatal("No memory installed\n");
114 if (cs > max_cs)
115 fatal("DDR wrong CS configuration\n");
116
117 /* get data path bytes */
118 val = mfdcr_sdram0(DDR0_14);
119
120 if (DDR_GET_VAL(val, DDR_REDUC, DDR_REDUC_SHIFT))
121 dpath = 8; /* 64 bits */
122 else
123 dpath = 4; /* 32 bits */
124
125 /* get adress pins (rows) */
126 val = mfdcr_sdram0(DDR0_42);
127
128 row = DDR_GET_VAL(val, DDR_APIN, DDR_APIN_SHIFT);
129 if (row > max_row)
130 fatal("DDR wrong APIN configuration\n");
131 row = max_row - row;
132
133 /* get collomn size and banks */
134 val = mfdcr_sdram0(DDR0_43);
135
136 col = DDR_GET_VAL(val, DDR_COL_SZ, DDR_COL_SZ_SHIFT);
137 if (col > max_col)
138 fatal("DDR wrong COL configuration\n");
139 col = max_col - col;
140
141 if (DDR_GET_VAL(val, DDR_BANK8, DDR_BANK8_SHIFT))
142 bank = 8; /* 8 banks */
143 else
144 bank = 4; /* 4 banks */
145
146 memsize = cs * (1 << (col+row)) * bank * dpath;
147 dt_fixup_memory(0, memsize);
148}
149
150#define SPRN_DBCR0_40X 0x3F2
151#define SPRN_DBCR0_44X 0x134
152#define DBCR0_RST_SYSTEM 0x30000000
153
154void ibm44x_dbcr_reset(void)
155{
156 unsigned long tmp;
157
158 asm volatile (
159 "mfspr %0,%1\n"
160 "oris %0,%0,%2@h\n"
161 "mtspr %1,%0"
162 : "=&r"(tmp) : "i"(SPRN_DBCR0_44X), "i"(DBCR0_RST_SYSTEM)
163 );
164
165}
166
167void ibm40x_dbcr_reset(void)
168{
169 unsigned long tmp;
170
171 asm volatile (
172 "mfspr %0,%1\n"
173 "oris %0,%0,%2@h\n"
174 "mtspr %1,%0"
175 : "=&r"(tmp) : "i"(SPRN_DBCR0_40X), "i"(DBCR0_RST_SYSTEM)
176 );
177}
178
179#define EMAC_RESET 0x20000000
180void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1)
181{
182 /* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't do this for us */
183 if (emac0)
184 *emac0 = EMAC_RESET;
185 if (emac1)
186 *emac1 = EMAC_RESET;
187
188 mtdcr(DCRN_MAL0_CFG, MAL_RESET);
189}
190
191/* Read 4xx EBC bus bridge registers to get mappings of the peripheral
192 * banks into the OPB address space */
193void ibm4xx_fixup_ebc_ranges(const char *ebc)
194{
195 void *devp;
196 u32 bxcr;
197 u32 ranges[EBC_NUM_BANKS*4];
198 u32 *p = ranges;
199 int i;
200
201 for (i = 0; i < EBC_NUM_BANKS; i++) {
202 mtdcr(DCRN_EBC0_CFGADDR, EBC_BXCR(i));
203 bxcr = mfdcr(DCRN_EBC0_CFGDATA);
204
205 if ((bxcr & EBC_BXCR_BU) != EBC_BXCR_BU_OFF) {
206 *p++ = i;
207 *p++ = 0;
208 *p++ = bxcr & EBC_BXCR_BAS;
209 *p++ = EBC_BXCR_BANK_SIZE(bxcr);
210 }
211 }
212
213 devp = finddevice(ebc);
214 if (! devp)
215 fatal("Couldn't locate EBC node %s\n\r", ebc);
216
217 setprop(devp, "ranges", ranges, (p - ranges) * sizeof(u32));
218}
219
220#define SPRN_CCR1 0x378
221void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
222{
223 u32 cpu, plb, opb, ebc, tb, uart0, m, vco;
224 u32 reg;
225 u32 fwdva, fwdvb, fbdv, lfbdv, opbdv0, perdv0, spcid0, prbdv0, tmp;
226
227 mtdcr(DCRN_CPR0_ADDR, CPR0_PLLD0);
228 reg = mfdcr(DCRN_CPR0_DATA);
229 tmp = (reg & 0x000F0000) >> 16;
230 fwdva = tmp ? tmp : 16;
231 tmp = (reg & 0x00000700) >> 8;
232 fwdvb = tmp ? tmp : 8;
233 tmp = (reg & 0x1F000000) >> 24;
234 fbdv = tmp ? tmp : 32;
235 lfbdv = (reg & 0x0000007F);
236
237 mtdcr(DCRN_CPR0_ADDR, CPR0_OPBD0);
238 reg = mfdcr(DCRN_CPR0_DATA);
239 tmp = (reg & 0x03000000) >> 24;
240 opbdv0 = tmp ? tmp : 4;
241
242 mtdcr(DCRN_CPR0_ADDR, CPR0_PERD0);
243 reg = mfdcr(DCRN_CPR0_DATA);
244 tmp = (reg & 0x07000000) >> 24;
245 perdv0 = tmp ? tmp : 8;
246
247 mtdcr(DCRN_CPR0_ADDR, CPR0_PRIMBD0);
248 reg = mfdcr(DCRN_CPR0_DATA);
249 tmp = (reg & 0x07000000) >> 24;
250 prbdv0 = tmp ? tmp : 8;
251
252 mtdcr(DCRN_CPR0_ADDR, CPR0_SCPID);
253 reg = mfdcr(DCRN_CPR0_DATA);
254 tmp = (reg & 0x03000000) >> 24;
255 spcid0 = tmp ? tmp : 4;
256
257 /* Calculate M */
258 mtdcr(DCRN_CPR0_ADDR, CPR0_PLLC0);
259 reg = mfdcr(DCRN_CPR0_DATA);
260 tmp = (reg & 0x03000000) >> 24;
261 if (tmp == 0) { /* PLL output */
262 tmp = (reg & 0x20000000) >> 29;
263 if (!tmp) /* PLLOUTA */
264 m = fbdv * lfbdv * fwdva;
265 else
266 m = fbdv * lfbdv * fwdvb;
267 }
268 else if (tmp == 1) /* CPU output */
269 m = fbdv * fwdva;
270 else
271 m = perdv0 * opbdv0 * fwdvb;
272
273 vco = (m * sysclk) + (m >> 1);
274 cpu = vco / fwdva;
275 plb = vco / fwdvb / prbdv0;
276 opb = plb / opbdv0;
277 ebc = plb / perdv0;
278
279 /* FIXME */
280 uart0 = ser_clk;
281
282 /* Figure out timebase. Either CPU or default TmrClk */
283 asm volatile (
284 "mfspr %0,%1\n"
285 :
286 "=&r"(reg) : "i"(SPRN_CCR1));
287 if (reg & 0x0080)
288 tb = 25000000; /* TmrClk is 25MHz */
289 else
290 tb = cpu;
291
292 dt_fixup_cpu_clocks(cpu, tb, 0);
293 dt_fixup_clock("/plb", plb);
294 dt_fixup_clock("/plb/opb", opb);
295 dt_fixup_clock("/plb/opb/ebc", ebc);
296 dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
297 dt_fixup_clock("/plb/opb/serial@ef600400", uart0);
298 dt_fixup_clock("/plb/opb/serial@ef600500", uart0);
299 dt_fixup_clock("/plb/opb/serial@ef600600", uart0);
300}
diff --git a/arch/powerpc/boot/4xx.h b/arch/powerpc/boot/4xx.h
new file mode 100644
index 000000000000..adba6a599a93
--- /dev/null
+++ b/arch/powerpc/boot/4xx.h
@@ -0,0 +1,22 @@
1/*
2 * PowerPC 4xx related functions
3 *
4 * Copyright 2007 IBM Corporation.
5 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11#ifndef _POWERPC_BOOT_4XX_H_
12#define _POWERPC_BOOT_4XX_H_
13
14void ibm4xx_fixup_memsize(void);
15void ibm4xx_denali_fixup_memsize(void);
16void ibm44x_dbcr_reset(void);
17void ibm40x_dbcr_reset(void);
18void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1);
19void ibm4xx_fixup_ebc_ranges(const char *ebc);
20void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk);
21
22#endif /* _POWERPC_BOOT_4XX_H_ */
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 61a6f34ca5ed..a6bba9a69e66 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -31,7 +31,7 @@ endif
31 31
32BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) 32BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
33 33
34$(obj)/44x.o: BOOTCFLAGS += -mcpu=440 34$(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
35$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440 35$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
36 36
37zlib := inffast.c inflate.c inftrees.c 37zlib := inffast.c inflate.c inftrees.c
@@ -44,10 +44,12 @@ $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \
44src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ 44src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
45 ns16550.c serial.c simple_alloc.c div64.S util.S \ 45 ns16550.c serial.c simple_alloc.c div64.S util.S \
46 gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ 46 gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
47 44x.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c 47 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
48src-plat := of.c cuboot-83xx.c cuboot-85xx.c holly.c \ 48 cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c
49src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
49 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ 50 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
50 ps3-head.S ps3-hvcall.S ps3.c 51 ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
52 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c
51src-boot := $(src-wlib) $(src-plat) empty.c 53src-boot := $(src-wlib) $(src-plat) empty.c
52 54
53src-boot := $(addprefix $(obj)/, $(src-boot)) 55src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -139,9 +141,15 @@ image-$(CONFIG_PPC_ISERIES) += zImage.iseries
139image-$(CONFIG_DEFAULT_UIMAGE) += uImage 141image-$(CONFIG_DEFAULT_UIMAGE) += uImage
140 142
141ifneq ($(CONFIG_DEVICE_TREE),"") 143ifneq ($(CONFIG_DEVICE_TREE),"")
144image-$(CONFIG_PPC_8xx) += cuImage.8xx
145image-$(CONFIG_8260) += cuImage.pq2
146image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx
142image-$(CONFIG_PPC_83xx) += cuImage.83xx 147image-$(CONFIG_PPC_83xx) += cuImage.83xx
143image-$(CONFIG_PPC_85xx) += cuImage.85xx 148image-$(CONFIG_PPC_85xx) += cuImage.85xx
144image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony 149image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
150image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo
151image-$(CONFIG_SEQUOIA) += cuImage.sequoia
152image-$(CONFIG_WALNUT) += treeImage.walnut
145endif 153endif
146 154
147# For 32-bit powermacs, build the COFF and miboot images 155# For 32-bit powermacs, build the COFF and miboot images
diff --git a/arch/powerpc/boot/bamboo.c b/arch/powerpc/boot/bamboo.c
new file mode 100644
index 000000000000..f61fcdab1c7c
--- /dev/null
+++ b/arch/powerpc/boot/bamboo.c
@@ -0,0 +1,47 @@
1/*
2 * Copyright IBM Corporation, 2007
3 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
4 *
5 * Based on ebony wrapper:
6 * Copyright 2007 David Gibson, IBM Corporation.
7 *
8 * Clocking code based on code by:
9 * Stefan Roese <sr@denx.de>
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; version 2 of the License
14 */
15#include <stdarg.h>
16#include <stddef.h>
17#include "types.h"
18#include "elf.h"
19#include "string.h"
20#include "stdio.h"
21#include "page.h"
22#include "ops.h"
23#include "dcr.h"
24#include "4xx.h"
25#include "44x.h"
26
27static u8 *bamboo_mac0, *bamboo_mac1;
28
29static void bamboo_fixups(void)
30{
31 unsigned long sysclk = 33333333;
32
33 ibm440ep_fixup_clocks(sysclk, 11059200);
34 ibm4xx_fixup_memsize();
35 ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
36 dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
37}
38
39void bamboo_init(void *mac0, void *mac1)
40{
41 platform_ops.fixups = bamboo_fixups;
42 platform_ops.exit = ibm44x_dbcr_reset;
43 bamboo_mac0 = mac0;
44 bamboo_mac1 = mac1;
45 ft_init(_dtb_start, 0, 32);
46 serial_console_init();
47}
diff --git a/arch/powerpc/boot/cpm-serial.c b/arch/powerpc/boot/cpm-serial.c
new file mode 100644
index 000000000000..fcb8b5e956bd
--- /dev/null
+++ b/arch/powerpc/boot/cpm-serial.c
@@ -0,0 +1,249 @@
1/*
2 * CPM serial console support.
3 *
4 * Copyright 2007 Freescale Semiconductor, Inc.
5 * Author: Scott Wood <scottwood@freescale.com>
6 *
7 * It is assumed that the firmware (or the platform file) has already set
8 * up the port.
9 */
10
11#include "types.h"
12#include "io.h"
13#include "ops.h"
14
15struct cpm_scc {
16 u32 gsmrl;
17 u32 gsmrh;
18 u16 psmr;
19 u8 res1[2];
20 u16 todr;
21 u16 dsr;
22 u16 scce;
23 u8 res2[2];
24 u16 sccm;
25 u8 res3;
26 u8 sccs;
27 u8 res4[8];
28};
29
30struct cpm_smc {
31 u8 res1[2];
32 u16 smcmr;
33 u8 res2[2];
34 u8 smce;
35 u8 res3[3];
36 u8 smcm;
37 u8 res4[5];
38};
39
40struct cpm_param {
41 u16 rbase;
42 u16 tbase;
43 u8 rfcr;
44 u8 tfcr;
45};
46
47struct cpm_bd {
48 u16 sc; /* Status and Control */
49 u16 len; /* Data length in buffer */
50 u8 *addr; /* Buffer address in host memory */
51};
52
53static void *cpcr;
54static struct cpm_param *param;
55static struct cpm_smc *smc;
56static struct cpm_scc *scc;
57struct cpm_bd *tbdf, *rbdf;
58static u32 cpm_cmd;
59static u8 *dpram_start;
60
61static void (*do_cmd)(int op);
62static void (*enable_port)(void);
63static void (*disable_port)(void);
64
65#define CPM_CMD_STOP_TX 4
66#define CPM_CMD_RESTART_TX 6
67#define CPM_CMD_INIT_RX_TX 0
68
69static void cpm1_cmd(int op)
70{
71 while (in_be16(cpcr) & 1)
72 ;
73
74 out_be16(cpcr, (op << 8) | cpm_cmd | 1);
75
76 while (in_be16(cpcr) & 1)
77 ;
78}
79
80static void cpm2_cmd(int op)
81{
82 while (in_be32(cpcr) & 0x10000)
83 ;
84
85 out_be32(cpcr, op | cpm_cmd | 0x10000);
86
87 while (in_be32(cpcr) & 0x10000)
88 ;
89}
90
91static void smc_disable_port(void)
92{
93 do_cmd(CPM_CMD_STOP_TX);
94 out_be16(&smc->smcmr, in_be16(&smc->smcmr) & ~3);
95}
96
97static void scc_disable_port(void)
98{
99 do_cmd(CPM_CMD_STOP_TX);
100 out_be32(&scc->gsmrl, in_be32(&scc->gsmrl) & ~0x30);
101}
102
103static void smc_enable_port(void)
104{
105 out_be16(&smc->smcmr, in_be16(&smc->smcmr) | 3);
106 do_cmd(CPM_CMD_RESTART_TX);
107}
108
109static void scc_enable_port(void)
110{
111 out_be32(&scc->gsmrl, in_be32(&scc->gsmrl) | 0x30);
112 do_cmd(CPM_CMD_RESTART_TX);
113}
114
115static int cpm_serial_open(void)
116{
117 int dpaddr = 0x800;
118 disable_port();
119
120 out_8(&param->rfcr, 0x10);
121 out_8(&param->tfcr, 0x10);
122
123 rbdf = (struct cpm_bd *)(dpram_start + dpaddr);
124 rbdf->addr = (u8 *)(rbdf + 2);
125 rbdf->sc = 0xa000;
126 rbdf->len = 1;
127
128 tbdf = rbdf + 1;
129 tbdf->addr = (u8 *)(rbdf + 2) + 1;
130 tbdf->sc = 0x2000;
131 tbdf->len = 1;
132
133 sync();
134 out_be16(&param->rbase, dpaddr);
135 out_be16(&param->tbase, dpaddr + sizeof(struct cpm_bd));
136
137 do_cmd(CPM_CMD_INIT_RX_TX);
138
139 enable_port();
140 return 0;
141}
142
143static void cpm_serial_putc(unsigned char c)
144{
145 while (tbdf->sc & 0x8000)
146 barrier();
147
148 sync();
149
150 tbdf->addr[0] = c;
151 eieio();
152 tbdf->sc |= 0x8000;
153}
154
155static unsigned char cpm_serial_tstc(void)
156{
157 barrier();
158 return !(rbdf->sc & 0x8000);
159}
160
161static unsigned char cpm_serial_getc(void)
162{
163 unsigned char c;
164
165 while (!cpm_serial_tstc())
166 ;
167
168 sync();
169 c = rbdf->addr[0];
170 eieio();
171 rbdf->sc |= 0x8000;
172
173 return c;
174}
175
176int cpm_console_init(void *devp, struct serial_console_data *scdp)
177{
178 void *reg_virt[2];
179 int is_smc = 0, is_cpm2 = 0, n;
180 unsigned long reg_phys;
181 void *parent;
182
183 if (dt_is_compatible(devp, "fsl,cpm1-smc-uart")) {
184 is_smc = 1;
185 } else if (dt_is_compatible(devp, "fsl,cpm2-scc-uart")) {
186 is_cpm2 = 1;
187 } else if (dt_is_compatible(devp, "fsl,cpm2-smc-uart")) {
188 is_cpm2 = 1;
189 is_smc = 1;
190 }
191
192 if (is_smc) {
193 enable_port = smc_enable_port;
194 disable_port = smc_disable_port;
195 } else {
196 enable_port = scc_enable_port;
197 disable_port = scc_disable_port;
198 }
199
200 if (is_cpm2)
201 do_cmd = cpm2_cmd;
202 else
203 do_cmd = cpm1_cmd;
204
205 n = getprop(devp, "fsl,cpm-command", &cpm_cmd, 4);
206 if (n < 4)
207 return -1;
208
209 n = getprop(devp, "virtual-reg", reg_virt, sizeof(reg_virt));
210 if (n < (int)sizeof(reg_virt)) {
211 for (n = 0; n < 2; n++) {
212 if (!dt_xlate_reg(devp, n, &reg_phys, NULL))
213 return -1;
214
215 reg_virt[n] = (void *)reg_phys;
216 }
217 }
218
219 if (is_smc)
220 smc = reg_virt[0];
221 else
222 scc = reg_virt[0];
223
224 param = reg_virt[1];
225
226 parent = get_parent(devp);
227 if (!parent)
228 return -1;
229
230 n = getprop(parent, "virtual-reg", reg_virt, sizeof(reg_virt));
231 if (n < (int)sizeof(reg_virt)) {
232 for (n = 0; n < 2; n++) {
233 if (!dt_xlate_reg(parent, n, &reg_phys, NULL))
234 return -1;
235
236 reg_virt[n] = (void *)reg_phys;
237 }
238 }
239
240 cpcr = reg_virt[0];
241 dpram_start = reg_virt[1];
242
243 scdp->open = cpm_serial_open;
244 scdp->putc = cpm_serial_putc;
245 scdp->getc = cpm_serial_getc;
246 scdp->tstc = cpm_serial_tstc;
247
248 return 0;
249}
diff --git a/arch/powerpc/boot/cuboot-52xx.c b/arch/powerpc/boot/cuboot-52xx.c
new file mode 100644
index 000000000000..9256a26d40e4
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-52xx.c
@@ -0,0 +1,59 @@
1/*
2 * Old U-boot compatibility for MPC5200
3 *
4 * Author: Grant Likely <grant.likely@secretlab.ca>
5 *
6 * Copyright (c) 2007 Secret Lab Technologies Ltd.
7 * Copyright (c) 2007 Freescale Semiconductor, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
12 */
13
14#include "ops.h"
15#include "stdio.h"
16#include "io.h"
17#include "cuboot.h"
18
19#define TARGET_PPC_MPC52xx
20#include "ppcboot.h"
21
22static bd_t bd;
23
24static void platform_fixups(void)
25{
26 void *soc, *reg;
27 int div;
28 u32 sysfreq;
29
30
31 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
32 dt_fixup_mac_addresses(bd.bi_enetaddr);
33 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
34
35 /* Unfortunately, the specific model number is encoded in the
36 * soc node name in existing dts files -- once that is fixed,
37 * this can do a simple path lookup.
38 */
39 soc = find_node_by_devtype(NULL, "soc");
40 if (soc) {
41 setprop(soc, "bus-frequency", &bd.bi_ipbfreq,
42 sizeof(bd.bi_ipbfreq));
43
44 if (!dt_xlate_reg(soc, 0, (void*)&reg, NULL))
45 return;
46 div = in_8(reg + 0x204) & 0x0020 ? 8 : 4;
47 sysfreq = bd.bi_busfreq * div;
48 setprop(soc, "system-frequency", &sysfreq, sizeof(sysfreq));
49 }
50}
51
52void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
53 unsigned long r6, unsigned long r7)
54{
55 CUBOOT_INIT();
56 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
57 serial_console_init();
58 platform_ops.fixups = platform_fixups;
59}
diff --git a/arch/powerpc/boot/cuboot-83xx.c b/arch/powerpc/boot/cuboot-83xx.c
index 296025d8b295..a0505509abcc 100644
--- a/arch/powerpc/boot/cuboot-83xx.c
+++ b/arch/powerpc/boot/cuboot-83xx.c
@@ -18,7 +18,6 @@
18#include "ppcboot.h" 18#include "ppcboot.h"
19 19
20static bd_t bd; 20static bd_t bd;
21extern char _dtb_start[], _dtb_end[];
22 21
23static void platform_fixups(void) 22static void platform_fixups(void)
24{ 23{
diff --git a/arch/powerpc/boot/cuboot-85xx.c b/arch/powerpc/boot/cuboot-85xx.c
index 10f0f697c935..345dcbecef0f 100644
--- a/arch/powerpc/boot/cuboot-85xx.c
+++ b/arch/powerpc/boot/cuboot-85xx.c
@@ -18,7 +18,6 @@
18#include "ppcboot.h" 18#include "ppcboot.h"
19 19
20static bd_t bd; 20static bd_t bd;
21extern char _dtb_start[], _dtb_end[];
22 21
23static void platform_fixups(void) 22static void platform_fixups(void)
24{ 23{
diff --git a/arch/powerpc/boot/cuboot-8xx.c b/arch/powerpc/boot/cuboot-8xx.c
new file mode 100644
index 000000000000..88ed84015a8b
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-8xx.c
@@ -0,0 +1,45 @@
1/*
2 * Old U-boot compatibility for 8xx
3 *
4 * Author: Scott Wood <scottwood@freescale.com>
5 *
6 * Copyright (c) 2007 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 version 2 as published
10 * by the Free Software Foundation.
11 */
12
13#include "ops.h"
14#include "stdio.h"
15#include "cuboot.h"
16
17#define TARGET_8xx
18#define TARGET_HAS_ETH1
19#include "ppcboot.h"
20
21static bd_t bd;
22
23static void platform_fixups(void)
24{
25 void *node;
26
27 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
28 dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
29 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq);
30
31 node = finddevice("/soc/cpm");
32 if (node) {
33 setprop(node, "clock-frequency", &bd.bi_busfreq, 4);
34 setprop(node, "fsl,brg-frequency", &bd.bi_busfreq, 4);
35 }
36}
37
38void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
39 unsigned long r6, unsigned long r7)
40{
41 CUBOOT_INIT();
42 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
43 serial_console_init();
44 platform_ops.fixups = platform_fixups;
45}
diff --git a/arch/powerpc/boot/cuboot-bamboo.c b/arch/powerpc/boot/cuboot-bamboo.c
new file mode 100644
index 000000000000..900c7ff2b7e9
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-bamboo.c
@@ -0,0 +1,30 @@
1/*
2 * Old U-boot compatibility for Bamboo
3 *
4 * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
5 *
6 * Copyright 2007 IBM Corporation
7 *
8 * Based on cuboot-ebony.c
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 version 2 as published
12 * by the Free Software Foundation.
13 */
14
15#include "ops.h"
16#include "stdio.h"
17#include "44x.h"
18#include "cuboot.h"
19
20#define TARGET_44x
21#include "ppcboot.h"
22
23static bd_t bd;
24
25void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
26 unsigned long r6, unsigned long r7)
27{
28 CUBOOT_INIT();
29 bamboo_init(&bd.bi_enetaddr, &bd.bi_enet1addr);
30}
diff --git a/arch/powerpc/boot/cuboot-pq2.c b/arch/powerpc/boot/cuboot-pq2.c
new file mode 100644
index 000000000000..8021fd4a43bc
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-pq2.c
@@ -0,0 +1,283 @@
1/*
2 * Old U-boot compatibility for PowerQUICC II
3 * (a.k.a. 82xx with CPM, not the 8240 family of chips)
4 *
5 * Author: Scott Wood <scottwood@freescale.com>
6 *
7 * Copyright (c) 2007 Freescale Semiconductor, Inc.
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
12 */
13
14#include "ops.h"
15#include "stdio.h"
16#include "cuboot.h"
17#include "io.h"
18
19#define TARGET_CPM2
20#define TARGET_HAS_ETH1
21#include "ppcboot.h"
22
23static bd_t bd;
24
25struct cs_range {
26 u32 csnum;
27 u32 base; /* must be zero */
28 u32 addr;
29 u32 size;
30};
31
32struct pci_range {
33 u32 flags;
34 u32 pci_addr[2];
35 u32 phys_addr;
36 u32 size[2];
37};
38
39struct cs_range cs_ranges_buf[MAX_PROP_LEN / sizeof(struct cs_range)];
40struct pci_range pci_ranges_buf[MAX_PROP_LEN / sizeof(struct pci_range)];
41
42/* Different versions of u-boot put the BCSR in different places, and
43 * some don't set up the PCI PIC at all, so we assume the device tree is
44 * sane and update the BRx registers appropriately.
45 *
46 * For any node defined as compatible with fsl,pq2-chipselect,
47 * #address/#size must be 2/1 for chipselect bus, 1/1 for parent bus,
48 * and ranges must be for whole chip selects.
49 */
50static void update_cs_ranges(void)
51{
52 u32 ctrl_ph;
53 void *ctrl_node, *bus_node, *parent_node;
54 u32 *ctrl_addr;
55 unsigned long ctrl_size;
56 u32 naddr, nsize;
57 int len;
58 int i;
59
60 bus_node = finddevice("/chipselect");
61 if (!bus_node || !dt_is_compatible(bus_node, "fsl,pq2-chipselect"))
62 return;
63
64 dt_get_reg_format(bus_node, &naddr, &nsize);
65 if (naddr != 2 || nsize != 1)
66 goto err;
67
68 parent_node = get_parent(bus_node);
69 if (!parent_node)
70 goto err;
71
72 dt_get_reg_format(parent_node, &naddr, &nsize);
73 if (naddr != 1 || nsize != 1)
74 goto err;
75
76 len = getprop(bus_node, "fsl,ctrl", &ctrl_ph, 4);
77 if (len != 4)
78 goto err;
79
80 ctrl_node = find_node_by_prop_value(NULL, "linux,phandle",
81 (char *)&ctrl_ph, 4);
82 if (!ctrl_node)
83 goto err;
84
85 if (!dt_is_compatible(ctrl_node, "fsl,pq2-chipselect-ctrl"))
86 goto err;
87
88 if (!dt_xlate_reg(ctrl_node, 0, (unsigned long *)&ctrl_addr,
89 &ctrl_size))
90 goto err;
91
92 len = getprop(bus_node, "ranges", cs_ranges_buf, sizeof(cs_ranges_buf));
93
94 for (i = 0; i < len / sizeof(struct cs_range); i++) {
95 u32 base, option;
96 int cs = cs_ranges_buf[i].csnum;
97 if (cs >= ctrl_size / 8)
98 goto err;
99
100 if (cs_ranges_buf[i].base != 0)
101 goto err;
102
103 base = in_be32(&ctrl_addr[cs * 2]);
104
105 /* If CS is already valid, use the existing flags.
106 * Otherwise, guess a sane default.
107 */
108 if (base & 1) {
109 base &= 0x7fff;
110 option = in_be32(&ctrl_addr[cs * 2 + 1]) & 0x7fff;
111 } else {
112 base = 0x1801;
113 option = 0x10;
114 }
115
116 out_be32(&ctrl_addr[cs * 2], 0);
117 out_be32(&ctrl_addr[cs * 2 + 1],
118 option | ~(cs_ranges_buf[i].size - 1));
119 out_be32(&ctrl_addr[cs * 2], base | cs_ranges_buf[i].addr);
120 }
121
122 return;
123
124err:
125 printf("Bad /chipselect or fsl,pq2-chipselect-ctrl node\r\n");
126}
127
128/* Older u-boots don't set PCI up properly. Update the hardware to match
129 * the device tree. The prefetch mem region and non-prefetch mem region
130 * must be contiguous in the host bus. As required by the PCI binding,
131 * PCI #addr/#size must be 3/2. The parent bus must be 1/1. Only
132 * 32-bit PCI is supported. All three region types (prefetchable mem,
133 * non-prefetchable mem, and I/O) must be present.
134 */
135static void fixup_pci(void)
136{
137 struct pci_range *mem = NULL, *mmio = NULL,
138 *io = NULL, *mem_base = NULL;
139 u32 *pci_regs[3];
140 u8 *soc_regs;
141 int i, len;
142 void *ctrl_node, *bus_node, *parent_node, *soc_node;
143 u32 naddr, nsize, bus_ph, mem_log2;
144
145 ctrl_node = finddevice("/soc/pci");
146 if (!ctrl_node || !dt_is_compatible(ctrl_node, "fsl,pq2-pci"))
147 return;
148
149 soc_node = finddevice("/soc");
150 if (!soc_node || !dt_is_compatible(soc_node, "fsl,pq2-soc"))
151 goto err;
152
153 for (i = 0; i < 3; i++)
154 if (!dt_xlate_reg(ctrl_node, i,
155 (unsigned long *)&pci_regs[i], NULL))
156 goto err;
157
158 if (!dt_xlate_reg(soc_node, 0, (unsigned long *)&soc_regs, NULL))
159 goto err;
160
161 len = getprop(ctrl_node, "fsl,bus", &bus_ph, 4);
162 if (len != 4)
163 goto err;
164
165 bus_node = find_node_by_prop_value(NULL, "linux,phandle",
166 (char *)&bus_ph, 4);
167 if (!bus_node)
168 goto err;
169
170 dt_get_reg_format(bus_node, &naddr, &nsize);
171 if (naddr != 3 || nsize != 2)
172 goto err;
173
174 parent_node = get_parent(bus_node);
175 if (!parent_node)
176 goto err;
177
178 dt_get_reg_format(parent_node, &naddr, &nsize);
179 if (naddr != 1 || nsize != 1)
180 goto err;
181
182 len = getprop(bus_node, "ranges", pci_ranges_buf,
183 sizeof(pci_ranges_buf));
184
185 for (i = 0; i < len / sizeof(struct pci_range); i++) {
186 u32 flags = pci_ranges_buf[i].flags & 0x43000000;
187
188 if (flags == 0x42000000)
189 mem = &pci_ranges_buf[i];
190 else if (flags == 0x02000000)
191 mmio = &pci_ranges_buf[i];
192 else if (flags == 0x01000000)
193 io = &pci_ranges_buf[i];
194 }
195
196 if (!mem || !mmio || !io)
197 goto err;
198
199 if (mem->phys_addr + mem->size[1] == mmio->phys_addr)
200 mem_base = mem;
201 else if (mmio->phys_addr + mmio->size[1] == mem->phys_addr)
202 mem_base = mmio;
203 else
204 goto err;
205
206 out_be32(&pci_regs[1][0], mem_base->phys_addr | 1);
207 out_be32(&pci_regs[2][0], ~(mem->size[1] + mmio->size[1] - 1));
208
209 out_be32(&pci_regs[1][1], io->phys_addr | 1);
210 out_be32(&pci_regs[2][1], ~(io->size[1] - 1));
211
212 out_le32(&pci_regs[0][0], mem->pci_addr[1] >> 12);
213 out_le32(&pci_regs[0][2], mem->phys_addr >> 12);
214 out_le32(&pci_regs[0][4], (~(mem->size[1] - 1) >> 12) | 0xa0000000);
215
216 out_le32(&pci_regs[0][6], mmio->pci_addr[1] >> 12);
217 out_le32(&pci_regs[0][8], mmio->phys_addr >> 12);
218 out_le32(&pci_regs[0][10], (~(mmio->size[1] - 1) >> 12) | 0x80000000);
219
220 out_le32(&pci_regs[0][12], io->pci_addr[1] >> 12);
221 out_le32(&pci_regs[0][14], io->phys_addr >> 12);
222 out_le32(&pci_regs[0][16], (~(io->size[1] - 1) >> 12) | 0xc0000000);
223
224 /* Inbound translation */
225 out_le32(&pci_regs[0][58], 0);
226 out_le32(&pci_regs[0][60], 0);
227
228 mem_log2 = 1 << (__ilog2_u32(bd.bi_memsize - 1) + 1);
229 out_le32(&pci_regs[0][62], 0xa0000000 | ~((1 << (mem_log2 - 12)) - 1));
230
231 /* If PCI is disabled, drive RST high to enable. */
232 if (!(in_le32(&pci_regs[0][32]) & 1)) {
233 /* Tpvrh (Power valid to RST# high) 100 ms */
234 udelay(100000);
235
236 out_le32(&pci_regs[0][32], 1);
237
238 /* Trhfa (RST# high to first cfg access) 2^25 clocks */
239 udelay(1020000);
240 }
241
242 /* Enable bus master and memory access */
243 out_le32(&pci_regs[0][64], 0x80000004);
244 out_le32(&pci_regs[0][65], in_le32(&pci_regs[0][65]) | 6);
245
246 /* Park the bus on PCI, and elevate PCI's arbitration priority,
247 * as required by section 9.6 of the user's manual.
248 */
249 out_8(&soc_regs[0x10028], 3);
250 out_be32((u32 *)&soc_regs[0x1002c], 0x01236745);
251
252 return;
253
254err:
255 printf("Bad PCI node\r\n");
256}
257
258static void pq2_platform_fixups(void)
259{
260 void *node;
261
262 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
263 dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
264 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
265
266 node = finddevice("/soc/cpm");
267 if (node) {
268 setprop(node, "clock-frequency", &bd.bi_cpmfreq, 4);
269 setprop(node, "fsl,brg-frequency", &bd.bi_brgfreq, 4);
270 }
271
272 update_cs_ranges();
273 fixup_pci();
274}
275
276void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
277 unsigned long r6, unsigned long r7)
278{
279 CUBOOT_INIT();
280 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
281 serial_console_init();
282 platform_ops.fixups = pq2_platform_fixups;
283}
diff --git a/arch/powerpc/boot/cuboot-sequoia.c b/arch/powerpc/boot/cuboot-sequoia.c
new file mode 100644
index 000000000000..ec635e0bd4ec
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-sequoia.c
@@ -0,0 +1,56 @@
1/*
2 * Old U-boot compatibility for Sequoia
3 *
4 * Valentine Barshak <vbarshak@ru.mvista.com>
5 * Copyright 2007 MontaVista Software, Inc
6 *
7 * Based on Ebony code by David Gibson <david@gibson.dropbear.id.au>
8 * Copyright IBM Corporation, 2007
9 *
10 * Based on Bamboo code by Josh Boyer <jwboyer@linux.vnet.ibm.com>
11 * Copyright IBM Corporation, 2007
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; version 2 of the License
16 */
17
18#include <stdarg.h>
19#include <stddef.h>
20#include "types.h"
21#include "elf.h"
22#include "string.h"
23#include "stdio.h"
24#include "page.h"
25#include "ops.h"
26#include "dcr.h"
27#include "4xx.h"
28#include "44x.h"
29#include "cuboot.h"
30
31#define TARGET_4xx
32#define TARGET_44x
33#include "ppcboot.h"
34
35static bd_t bd;
36
37
38static void sequoia_fixups(void)
39{
40 unsigned long sysclk = 33333333;
41
42 ibm440ep_fixup_clocks(sysclk, 11059200);
43 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
44 ibm4xx_denali_fixup_memsize();
45 dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
46}
47
48void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
49 unsigned long r6, unsigned long r7)
50{
51 CUBOOT_INIT();
52 platform_ops.fixups = sequoia_fixups;
53 platform_ops.exit = ibm44x_dbcr_reset;
54 ft_init(_dtb_start, 0, 32);
55 serial_console_init();
56}
diff --git a/arch/powerpc/boot/cuboot.c b/arch/powerpc/boot/cuboot.c
index 65795468ad6f..7768b2306b7a 100644
--- a/arch/powerpc/boot/cuboot.c
+++ b/arch/powerpc/boot/cuboot.c
@@ -17,9 +17,6 @@
17 17
18#include "ppcboot.h" 18#include "ppcboot.h"
19 19
20extern char _end[];
21extern char _dtb_start[], _dtb_end[];
22
23void cuboot_init(unsigned long r4, unsigned long r5, 20void cuboot_init(unsigned long r4, unsigned long r5,
24 unsigned long r6, unsigned long r7, 21 unsigned long r6, unsigned long r7,
25 unsigned long end_of_ram) 22 unsigned long end_of_ram)
diff --git a/arch/powerpc/boot/dcr.h b/arch/powerpc/boot/dcr.h
index 14b44aa96fea..83b88aa92888 100644
--- a/arch/powerpc/boot/dcr.h
+++ b/arch/powerpc/boot/dcr.h
@@ -121,4 +121,22 @@ static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR, SDRAM0_B2C
121#define DCRN_CPC0_MIRQ1 0x0ed 121#define DCRN_CPC0_MIRQ1 0x0ed
122#define DCRN_CPC0_JTAGID 0x0ef 122#define DCRN_CPC0_JTAGID 0x0ef
123 123
124#define DCRN_MAL0_CFG 0x180
125#define MAL_RESET 0x80000000
126
127/* 440EP Clock/Power-on Reset regs */
128#define DCRN_CPR0_ADDR 0xc
129#define DCRN_CPR0_DATA 0xd
130#define CPR0_PLLD0 0x60
131#define CPR0_OPBD0 0xc0
132#define CPR0_PERD0 0xe0
133#define CPR0_PRIMBD0 0xa0
134#define CPR0_SCPID 0x120
135#define CPR0_PLLC0 0x40
136
137/* 405GP Clocking/Power Management/Chip Control regs */
138#define DCRN_CPC0_PLLMR 0xb0
139#define DCRN_405_CPC0_CR0 0xb1
140#define DCRN_405_CPC0_CR1 0xb2
141
124#endif /* _PPC_BOOT_DCR_H_ */ 142#endif /* _PPC_BOOT_DCR_H_ */
diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c
index c9951550ed2c..e5dfe4497313 100644
--- a/arch/powerpc/boot/devtree.c
+++ b/arch/powerpc/boot/devtree.c
@@ -74,6 +74,8 @@ void dt_fixup_cpu_clocks(u32 cpu, u32 tb, u32 bus)
74 if (bus > 0) 74 if (bus > 0)
75 setprop_val(devp, "bus-frequency", bus); 75 setprop_val(devp, "bus-frequency", bus);
76 } 76 }
77
78 timebase_period_ns = 1000000000 / tb;
77} 79}
78 80
79void dt_fixup_clock(const char *path, u32 freq) 81void dt_fixup_clock(const char *path, u32 freq)
@@ -86,34 +88,38 @@ void dt_fixup_clock(const char *path, u32 freq)
86 } 88 }
87} 89}
88 90
91void dt_fixup_mac_address(u32 index, const u8 *addr)
92{
93 void *devp = find_node_by_prop_value(NULL, "linux,network-index",
94 (void*)&index, sizeof(index));
95
96 if (devp) {
97 printf("ENET%d: local-mac-address <-"
98 " %02x:%02x:%02x:%02x:%02x:%02x\n\r", index,
99 addr[0], addr[1], addr[2],
100 addr[3], addr[4], addr[5]);
101
102 setprop(devp, "local-mac-address", addr, 6);
103 }
104}
105
89void __dt_fixup_mac_addresses(u32 startindex, ...) 106void __dt_fixup_mac_addresses(u32 startindex, ...)
90{ 107{
91 va_list ap; 108 va_list ap;
92 u32 index = startindex; 109 u32 index = startindex;
93 void *devp;
94 const u8 *addr; 110 const u8 *addr;
95 111
96 va_start(ap, startindex); 112 va_start(ap, startindex);
97 while ((addr = va_arg(ap, const u8 *))) {
98 devp = find_node_by_prop_value(NULL, "linux,network-index",
99 (void*)&index, sizeof(index));
100
101 printf("ENET%d: local-mac-address <-"
102 " %02x:%02x:%02x:%02x:%02x:%02x\n\r", index,
103 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
104 113
105 if (devp) 114 while ((addr = va_arg(ap, const u8 *)))
106 setprop(devp, "local-mac-address", addr, 6); 115 dt_fixup_mac_address(index++, addr);
107 116
108 index++;
109 }
110 va_end(ap); 117 va_end(ap);
111} 118}
112 119
113#define MAX_ADDR_CELLS 4 120#define MAX_ADDR_CELLS 4
114#define MAX_RANGES 8
115 121
116static void get_reg_format(void *node, u32 *naddr, u32 *nsize) 122void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize)
117{ 123{
118 if (getprop(node, "#address-cells", naddr, 4) != 4) 124 if (getprop(node, "#address-cells", naddr, 4) != 4)
119 *naddr = 2; 125 *naddr = 2;
@@ -207,7 +213,7 @@ static int find_range(u32 *reg, u32 *ranges, int nregaddr,
207 * In particular, PCI is not supported. Also, only the beginning of the 213 * In particular, PCI is not supported. Also, only the beginning of the
208 * reg block is tracked; size is ignored except in ranges. 214 * reg block is tracked; size is ignored except in ranges.
209 */ 215 */
210static u32 dt_xlate_buf[MAX_ADDR_CELLS * MAX_RANGES * 3]; 216static u32 prop_buf[MAX_PROP_LEN / 4];
211 217
212static int dt_xlate(void *node, int res, int reglen, unsigned long *addr, 218static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
213 unsigned long *size) 219 unsigned long *size)
@@ -216,14 +222,14 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
216 u32 this_addr[MAX_ADDR_CELLS]; 222 u32 this_addr[MAX_ADDR_CELLS];
217 void *parent; 223 void *parent;
218 u64 ret_addr, ret_size; 224 u64 ret_addr, ret_size;
219 u32 naddr, nsize, prev_naddr; 225 u32 naddr, nsize, prev_naddr, prev_nsize;
220 int buflen, offset; 226 int buflen, offset;
221 227
222 parent = get_parent(node); 228 parent = get_parent(node);
223 if (!parent) 229 if (!parent)
224 return 0; 230 return 0;
225 231
226 get_reg_format(parent, &naddr, &nsize); 232 dt_get_reg_format(parent, &naddr, &nsize);
227 233
228 if (nsize > 2) 234 if (nsize > 2)
229 return 0; 235 return 0;
@@ -231,41 +237,47 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
231 offset = (naddr + nsize) * res; 237 offset = (naddr + nsize) * res;
232 238
233 if (reglen < offset + naddr + nsize || 239 if (reglen < offset + naddr + nsize ||
234 sizeof(dt_xlate_buf) < offset + naddr + nsize) 240 MAX_PROP_LEN < (offset + naddr + nsize) * 4)
235 return 0; 241 return 0;
236 242
237 copy_val(last_addr, dt_xlate_buf + offset, naddr); 243 copy_val(last_addr, prop_buf + offset, naddr);
238 244
239 ret_size = dt_xlate_buf[offset + naddr]; 245 ret_size = prop_buf[offset + naddr];
240 if (nsize == 2) { 246 if (nsize == 2) {
241 ret_size <<= 32; 247 ret_size <<= 32;
242 ret_size |= dt_xlate_buf[offset + naddr + 1]; 248 ret_size |= prop_buf[offset + naddr + 1];
243 } 249 }
244 250
245 while ((node = get_parent(node))) { 251 for (;;) {
246 prev_naddr = naddr; 252 prev_naddr = naddr;
253 prev_nsize = nsize;
254 node = parent;
255
256 parent = get_parent(node);
257 if (!parent)
258 break;
247 259
248 get_reg_format(node, &naddr, &nsize); 260 dt_get_reg_format(parent, &naddr, &nsize);
249 261
250 buflen = getprop(node, "ranges", dt_xlate_buf, 262 buflen = getprop(node, "ranges", prop_buf,
251 sizeof(dt_xlate_buf)); 263 sizeof(prop_buf));
252 if (buflen < 0) 264 if (buflen == 0)
253 continue; 265 continue;
254 if (buflen > sizeof(dt_xlate_buf)) 266 if (buflen < 0 || buflen > sizeof(prop_buf))
255 return 0; 267 return 0;
256 268
257 offset = find_range(last_addr, dt_xlate_buf, prev_naddr, 269 offset = find_range(last_addr, prop_buf, prev_naddr,
258 naddr, nsize, buflen / 4); 270 naddr, prev_nsize, buflen / 4);
259 271
260 if (offset < 0) 272 if (offset < 0)
261 return 0; 273 return 0;
262 274
263 copy_val(this_addr, dt_xlate_buf + offset, prev_naddr); 275 copy_val(this_addr, prop_buf + offset, prev_naddr);
264 276
265 if (!sub_reg(last_addr, this_addr)) 277 if (!sub_reg(last_addr, this_addr))
266 return 0; 278 return 0;
267 279
268 copy_val(this_addr, dt_xlate_buf + offset + prev_naddr, naddr); 280 copy_val(this_addr, prop_buf + offset + prev_naddr, naddr);
269 281
270 if (!add_reg(last_addr, this_addr, naddr)) 282 if (!add_reg(last_addr, this_addr, naddr))
271 return 0; 283 return 0;
@@ -292,16 +304,35 @@ int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size)
292{ 304{
293 int reglen; 305 int reglen;
294 306
295 reglen = getprop(node, "reg", dt_xlate_buf, sizeof(dt_xlate_buf)) / 4; 307 reglen = getprop(node, "reg", prop_buf, sizeof(prop_buf)) / 4;
296 return dt_xlate(node, res, reglen, addr, size); 308 return dt_xlate(node, res, reglen, addr, size);
297} 309}
298 310
299int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr) 311int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr)
300{ 312{
301 313
302 if (buflen > sizeof(dt_xlate_buf)) 314 if (buflen > sizeof(prop_buf))
303 return 0; 315 return 0;
304 316
305 memcpy(dt_xlate_buf, buf, buflen); 317 memcpy(prop_buf, buf, buflen);
306 return dt_xlate(node, 0, buflen / 4, xlated_addr, NULL); 318 return dt_xlate(node, 0, buflen / 4, xlated_addr, NULL);
307} 319}
320
321int dt_is_compatible(void *node, const char *compat)
322{
323 char *buf = (char *)prop_buf;
324 int len, pos;
325
326 len = getprop(node, "compatible", buf, MAX_PROP_LEN);
327 if (len < 0)
328 return 0;
329
330 for (pos = 0; pos < len; pos++) {
331 if (!strcmp(buf + pos, compat))
332 return 1;
333
334 pos += strnlen(&buf[pos], len - pos);
335 }
336
337 return 0;
338}
diff --git a/arch/powerpc/boot/dts/bamboo.dts b/arch/powerpc/boot/dts/bamboo.dts
new file mode 100644
index 000000000000..a88ae3d218a5
--- /dev/null
+++ b/arch/powerpc/boot/dts/bamboo.dts
@@ -0,0 +1,244 @@
1/*
2 * Device Tree Source for AMCC Bamboo
3 *
4 * Copyright (c) 2006, 2007 IBM Corp.
5 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
6 *
7 * FIXME: Draft only!
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without
11 * any warranty of any kind, whether express or implied.
12 */
13
14/ {
15 #address-cells = <2>;
16 #size-cells = <1>;
17 model = "amcc,bamboo";
18 compatible = "amcc,bamboo";
19 dcr-parent = <&/cpus/PowerPC,440EP@0>;
20
21 cpus {
22 #address-cells = <1>;
23 #size-cells = <0>;
24
25 PowerPC,440EP@0 {
26 device_type = "cpu";
27 reg = <0>;
28 clock-frequency = <0>; /* Filled in by zImage */
29 timebase-frequency = <0>; /* Filled in by zImage */
30 i-cache-line-size = <20>;
31 d-cache-line-size = <20>;
32 i-cache-size = <8000>;
33 d-cache-size = <8000>;
34 dcr-controller;
35 dcr-access-method = "native";
36 };
37 };
38
39 memory {
40 device_type = "memory";
41 reg = <0 0 0>; /* Filled in by zImage */
42 };
43
44 UIC0: interrupt-controller0 {
45 compatible = "ibm,uic-440ep","ibm,uic";
46 interrupt-controller;
47 cell-index = <0>;
48 dcr-reg = <0c0 009>;
49 #address-cells = <0>;
50 #size-cells = <0>;
51 #interrupt-cells = <2>;
52 };
53
54 UIC1: interrupt-controller1 {
55 compatible = "ibm,uic-440ep","ibm,uic";
56 interrupt-controller;
57 cell-index = <1>;
58 dcr-reg = <0d0 009>;
59 #address-cells = <0>;
60 #size-cells = <0>;
61 #interrupt-cells = <2>;
62 interrupts = <1e 4 1f 4>; /* cascade */
63 interrupt-parent = <&UIC0>;
64 };
65
66 SDR0: sdr {
67 compatible = "ibm,sdr-440ep";
68 dcr-reg = <00e 002>;
69 };
70
71 CPR0: cpr {
72 compatible = "ibm,cpr-440ep";
73 dcr-reg = <00c 002>;
74 };
75
76 plb {
77 compatible = "ibm,plb-440ep", "ibm,plb-440gp", "ibm,plb4";
78 #address-cells = <2>;
79 #size-cells = <1>;
80 ranges;
81 clock-frequency = <0>; /* Filled in by zImage */
82
83 SDRAM0: sdram {
84 compatible = "ibm,sdram-440ep", "ibm,sdram-405gp";
85 dcr-reg = <010 2>;
86 };
87
88 DMA0: dma {
89 compatible = "ibm,dma-440ep", "ibm,dma-440gp";
90 dcr-reg = <100 027>;
91 };
92
93 MAL0: mcmal {
94 compatible = "ibm,mcmal-440ep", "ibm,mcmal-440gp", "ibm,mcmal";
95 dcr-reg = <180 62>;
96 num-tx-chans = <4>;
97 num-rx-chans = <2>;
98 interrupt-parent = <&MAL0>;
99 interrupts = <0 1 2 3 4>;
100 #interrupt-cells = <1>;
101 interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
102 /*RXEOB*/ 1 &UIC0 b 4
103 /*SERR*/ 2 &UIC1 0 4
104 /*TXDE*/ 3 &UIC1 1 4
105 /*RXDE*/ 4 &UIC1 3 4>;
106 };
107
108 POB0: opb {
109 compatible = "ibm,opb-440ep", "ibm,opb-440gp", "ibm,opb";
110 #address-cells = <1>;
111 #size-cells = <1>;
112 /* Bamboo is oddball in the 44x world and doesn't use the ERPN
113 * bits.
114 */
115 ranges = <00000000 0 00000000 80000000
116 80000000 0 80000000 80000000>;
117 interrupt-parent = <&UIC1>;
118 interrupts = <7 4>;
119 clock-frequency = <0>; /* Filled in by zImage */
120
121 EBC0: ebc {
122 compatible = "ibm,ebc-440ep", "ibm,ebc-440gp", "ibm,ebc";
123 dcr-reg = <012 2>;
124 #address-cells = <2>;
125 #size-cells = <1>;
126 clock-frequency = <0>; /* Filled in by zImage */
127 ranges;
128 interrupts = <5 1>;
129 interrupt-parent = <&UIC1>;
130 };
131
132 UART0: serial@ef600300 {
133 device_type = "serial";
134 compatible = "ns16550";
135 reg = <ef600300 8>;
136 virtual-reg = <ef600300>;
137 clock-frequency = <0>; /* Filled in by zImage */
138 current-speed = <1c200>;
139 interrupt-parent = <&UIC0>;
140 interrupts = <0 4>;
141 };
142
143 UART1: serial@ef600400 {
144 device_type = "serial";
145 compatible = "ns16550";
146 reg = <ef600400 8>;
147 virtual-reg = <ef600400>;
148 clock-frequency = <0>;
149 current-speed = <0>;
150 interrupt-parent = <&UIC0>;
151 interrupts = <1 4>;
152 };
153
154 UART2: serial@ef600500 {
155 device_type = "serial";
156 compatible = "ns16550";
157 reg = <ef600500 8>;
158 virtual-reg = <ef600500>;
159 clock-frequency = <0>;
160 current-speed = <0>;
161 interrupt-parent = <&UIC0>;
162 interrupts = <3 4>;
163 };
164
165 UART3: serial@ef600600 {
166 device_type = "serial";
167 compatible = "ns16550";
168 reg = <ef600600 8>;
169 virtual-reg = <ef600600>;
170 clock-frequency = <0>;
171 current-speed = <0>;
172 interrupt-parent = <&UIC0>;
173 interrupts = <4 4>;
174 };
175
176 IIC0: i2c@ef600700 {
177 device_type = "i2c";
178 compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
179 reg = <ef600700 14>;
180 interrupt-parent = <&UIC0>;
181 interrupts = <2 4>;
182 };
183
184 IIC1: i2c@ef600800 {
185 device_type = "i2c";
186 compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
187 reg = <ef600800 14>;
188 interrupt-parent = <&UIC0>;
189 interrupts = <7 4>;
190 };
191
192 ZMII0: emac-zmii@ef600d00 {
193 device_type = "zmii-interface";
194 compatible = "ibm,zmii-440ep", "ibm,zmii-440gp", "ibm,zmii";
195 reg = <ef600d00 c>;
196 };
197
198 EMAC0: ethernet@ef600e00 {
199 device_type = "network";
200 compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
201 interrupt-parent = <&UIC1>;
202 interrupts = <1c 4 1d 4>;
203 reg = <ef600e00 70>;
204 local-mac-address = [000000000000];
205 mal-device = <&MAL0>;
206 mal-tx-channel = <0 1>;
207 mal-rx-channel = <0>;
208 cell-index = <0>;
209 max-frame-size = <5dc>;
210 rx-fifo-size = <1000>;
211 tx-fifo-size = <800>;
212 phy-mode = "rmii";
213 phy-map = <00000001>;
214 zmii-device = <&ZMII0>;
215 zmii-channel = <0>;
216 };
217
218 EMAC1: ethernet@ef600f00 {
219 device_type = "network";
220 compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
221 interrupt-parent = <&UIC1>;
222 interrupts = <1e 4 1f 4>;
223 reg = <ef600f00 70>;
224 local-mac-address = [000000000000];
225 mal-device = <&MAL0>;
226 mal-tx-channel = <2 3>;
227 mal-rx-channel = <1>;
228 cell-index = <1>;
229 max-frame-size = <5dc>;
230 rx-fifo-size = <1000>;
231 tx-fifo-size = <800>;
232 phy-mode = "rmii";
233 phy-map = <00000001>;
234 zmii-device = <&ZMII0>;
235 zmii-channel = <1>;
236 };
237 };
238 };
239
240 chosen {
241 linux,stdout-path = "/plb/opb/serial@ef600300";
242 bootargs = "console=ttyS0,115200";
243 };
244};
diff --git a/arch/powerpc/boot/dts/ebony.dts b/arch/powerpc/boot/dts/ebony.dts
index c5f99613fc7b..bc259972aaa0 100644
--- a/arch/powerpc/boot/dts/ebony.dts
+++ b/arch/powerpc/boot/dts/ebony.dts
@@ -9,10 +9,6 @@
9 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without 10 * License version 2. This program is licensed "as is" without
11 * any warranty of any kind, whether express or implied. 11 * any warranty of any kind, whether express or implied.
12 *
13 * To build:
14 * dtc -I dts -O asm -o ebony.S -b 0 ebony.dts
15 * dtc -I dts -O dtb -o ebony.dtb -b 0 ebony.dts
16 */ 12 */
17 13
18/ { 14/ {
@@ -142,13 +138,16 @@
142 interrupt-parent = <&UIC1>; 138 interrupt-parent = <&UIC1>;
143 139
144 small-flash@0,80000 { 140 small-flash@0,80000 {
145 device_type = "rom"; 141 compatible = "jedec-flash";
146 compatible = "direct-mapped";
147 probe-type = "JEDEC";
148 bank-width = <1>; 142 bank-width = <1>;
149 partitions = <0 80000>;
150 partition-names = "OpenBIOS";
151 reg = <0 80000 80000>; 143 reg = <0 80000 80000>;
144 #address-cells = <1>;
145 #size-cells = <1>;
146 partition@0 {
147 label = "OpenBIOS";
148 reg = <0 80000>;
149 read-only;
150 };
152 }; 151 };
153 152
154 ds1743@1,0 { 153 ds1743@1,0 {
@@ -158,14 +157,19 @@
158 }; 157 };
159 158
160 large-flash@2,0 { 159 large-flash@2,0 {
161 device_type = "rom"; 160 compatible = "jedec-flash";
162 compatible = "direct-mapped";
163 probe-type = "JEDEC";
164 bank-width = <1>; 161 bank-width = <1>;
165 partitions = <0 380000
166 380000 80000>;
167 partition-names = "fs", "firmware";
168 reg = <2 0 400000>; 162 reg = <2 0 400000>;
163 #address-cells = <1>;
164 #size-cells = <1>;
165 partition@0 {
166 label = "fs";
167 reg = <0 380000>;
168 };
169 partition@380000 {
170 label = "firmware";
171 reg = <380000 80000>;
172 };
169 }; 173 };
170 174
171 ir@3,0 { 175 ir@3,0 {
@@ -175,6 +179,7 @@
175 fpga@7,0 { 179 fpga@7,0 {
176 compatible = "Ebony-FPGA"; 180 compatible = "Ebony-FPGA";
177 reg = <7 0 10>; 181 reg = <7 0 10>;
182 virtual-reg = <e8300000>;
178 }; 183 };
179 }; 184 };
180 185
diff --git a/arch/powerpc/boot/dts/holly.dts b/arch/powerpc/boot/dts/holly.dts
index 80a4fab8ee37..b5d87895fe06 100644
--- a/arch/powerpc/boot/dts/holly.dts
+++ b/arch/powerpc/boot/dts/holly.dts
@@ -8,10 +8,6 @@
8 * This file is licensed under the terms of the GNU General Public 8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without 9 * License version 2. This program is licensed "as is" without
10 * any warranty of any kind, whether express or implied. 10 * any warranty of any kind, whether express or implied.
11 *
12 * To build:
13 * dtc -I dts -O asm -o holly.S -b 0 holly.dts
14 * dtc -I dts -O dtb -o holly.dtb -b 0 holly.dts
15 */ 11 */
16 12
17/ { 13/ {
@@ -35,7 +31,6 @@
35 timebase-frequency = <2faf080>; 31 timebase-frequency = <2faf080>;
36 clock-frequency = <23c34600>; 32 clock-frequency = <23c34600>;
37 bus-frequency = <bebc200>; 33 bus-frequency = <bebc200>;
38 32-bit;
39 }; 34 };
40 }; 35 };
41 36
diff --git a/arch/powerpc/boot/dts/kuroboxHD.dts b/arch/powerpc/boot/dts/kuroboxHD.dts
index 122537419d9f..ec71ab819fee 100644
--- a/arch/powerpc/boot/dts/kuroboxHD.dts
+++ b/arch/powerpc/boot/dts/kuroboxHD.dts
@@ -15,9 +15,6 @@
15 15
16XXXX add flash parts, rtc, ?? 16XXXX add flash parts, rtc, ??
17 17
18build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
19
20
21 */ 18 */
22 19
23/ { 20/ {
@@ -50,7 +47,6 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
50 soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */ 47 soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */
51 #address-cells = <1>; 48 #address-cells = <1>;
52 #size-cells = <1>; 49 #size-cells = <1>;
53 #interrupt-cells = <2>;
54 device_type = "soc"; 50 device_type = "soc";
55 compatible = "mpc10x"; 51 compatible = "mpc10x";
56 store-gathering = <0>; /* 0 == off, !0 == on */ 52 store-gathering = <0>; /* 0 == off, !0 == on */
@@ -72,7 +68,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
72 68
73 rtc@32 { 69 rtc@32 {
74 device_type = "rtc"; 70 device_type = "rtc";
75 compatible = "ricoh,rs5c372b"; 71 compatible = "ricoh,rs5c372a";
76 reg = <32>; 72 reg = <32>;
77 }; 73 };
78 }; 74 };
@@ -83,7 +79,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
83 reg = <80004500 8>; 79 reg = <80004500 8>;
84 clock-frequency = <5d08d88>; 80 clock-frequency = <5d08d88>;
85 current-speed = <2580>; 81 current-speed = <2580>;
86 interrupts = <9 2>; 82 interrupts = <9 0>;
87 interrupt-parent = <&mpic>; 83 interrupt-parent = <&mpic>;
88 }; 84 };
89 85
@@ -104,7 +100,6 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHD.dtb -V 16 kuroboxHD.dts"
104 compatible = "chrp,open-pic"; 100 compatible = "chrp,open-pic";
105 interrupt-controller; 101 interrupt-controller;
106 reg = <80040000 40000>; 102 reg = <80040000 40000>;
107 built-in;
108 }; 103 };
109 104
110 pci@fec00000 { 105 pci@fec00000 {
diff --git a/arch/powerpc/boot/dts/kuroboxHG.dts b/arch/powerpc/boot/dts/kuroboxHG.dts
index 579aa8b967d9..32ecd2319928 100644
--- a/arch/powerpc/boot/dts/kuroboxHG.dts
+++ b/arch/powerpc/boot/dts/kuroboxHG.dts
@@ -15,9 +15,6 @@
15 15
16XXXX add flash parts, rtc, ?? 16XXXX add flash parts, rtc, ??
17 17
18build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
19
20
21 */ 18 */
22 19
23/ { 20/ {
@@ -50,7 +47,6 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
50 soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */ 47 soc10x { /* AFAICT need to make soc for 8245's uarts to be defined */
51 #address-cells = <1>; 48 #address-cells = <1>;
52 #size-cells = <1>; 49 #size-cells = <1>;
53 #interrupt-cells = <2>;
54 device_type = "soc"; 50 device_type = "soc";
55 compatible = "mpc10x"; 51 compatible = "mpc10x";
56 store-gathering = <0>; /* 0 == off, !0 == on */ 52 store-gathering = <0>; /* 0 == off, !0 == on */
@@ -72,7 +68,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
72 68
73 rtc@32 { 69 rtc@32 {
74 device_type = "rtc"; 70 device_type = "rtc";
75 compatible = "ricoh,rs5c372b"; 71 compatible = "ricoh,rs5c372a";
76 reg = <32>; 72 reg = <32>;
77 }; 73 };
78 }; 74 };
@@ -83,7 +79,7 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
83 reg = <80004500 8>; 79 reg = <80004500 8>;
84 clock-frequency = <7c044a8>; 80 clock-frequency = <7c044a8>;
85 current-speed = <2580>; 81 current-speed = <2580>;
86 interrupts = <9 2>; 82 interrupts = <9 0>;
87 interrupt-parent = <&mpic>; 83 interrupt-parent = <&mpic>;
88 }; 84 };
89 85
@@ -104,7 +100,6 @@ build with: "dtc -f -I dts -O dtb -o kuroboxHG.dtb -V 16 kuroboxHG.dts"
104 compatible = "chrp,open-pic"; 100 compatible = "chrp,open-pic";
105 interrupt-controller; 101 interrupt-controller;
106 reg = <80040000 40000>; 102 reg = <80040000 40000>;
107 built-in;
108 }; 103 };
109 104
110 pci@fec00000 { 105 pci@fec00000 {
diff --git a/arch/powerpc/boot/dts/lite5200.dts b/arch/powerpc/boot/dts/lite5200.dts
index d29308fe4c24..324e1bd2aa60 100644
--- a/arch/powerpc/boot/dts/lite5200.dts
+++ b/arch/powerpc/boot/dts/lite5200.dts
@@ -37,7 +37,6 @@
37 timebase-frequency = <0>; // from bootloader 37 timebase-frequency = <0>; // from bootloader
38 bus-frequency = <0>; // from bootloader 38 bus-frequency = <0>; // from bootloader
39 clock-frequency = <0>; // from bootloader 39 clock-frequency = <0>; // from bootloader
40 32-bit;
41 }; 40 };
42 }; 41 };
43 42
@@ -50,10 +49,9 @@
50 model = "fsl,mpc5200"; 49 model = "fsl,mpc5200";
51 compatible = "mpc5200"; 50 compatible = "mpc5200";
52 revision = ""; // from bootloader 51 revision = ""; // from bootloader
53 #interrupt-cells = <3>;
54 device_type = "soc"; 52 device_type = "soc";
55 ranges = <0 f0000000 f0010000>; 53 ranges = <0 f0000000 0000c000>;
56 reg = <f0000000 00010000>; 54 reg = <f0000000 00000100>;
57 bus-frequency = <0>; // from bootloader 55 bus-frequency = <0>; // from bootloader
58 system-frequency = <0>; // from bootloader 56 system-frequency = <0>; // from bootloader
59 57
@@ -69,7 +67,6 @@
69 device_type = "interrupt-controller"; 67 device_type = "interrupt-controller";
70 compatible = "mpc5200-pic"; 68 compatible = "mpc5200-pic";
71 reg = <500 80>; 69 reg = <500 80>;
72 built-in;
73 }; 70 };
74 71
75 gpt@600 { // General Purpose Timer 72 gpt@600 { // General Purpose Timer
@@ -185,27 +182,6 @@
185 interrupt-parent = <&mpc5200_pic>; 182 interrupt-parent = <&mpc5200_pic>;
186 }; 183 };
187 184
188 pci@0d00 {
189 #interrupt-cells = <1>;
190 #size-cells = <2>;
191 #address-cells = <3>;
192 device_type = "pci";
193 compatible = "mpc5200-pci";
194 reg = <d00 100>;
195 interrupt-map-mask = <f800 0 0 7>;
196 interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3
197 c000 0 0 2 &mpc5200_pic 0 0 3
198 c000 0 0 3 &mpc5200_pic 0 0 3
199 c000 0 0 4 &mpc5200_pic 0 0 3>;
200 clock-frequency = <0>; // From boot loader
201 interrupts = <2 8 0 2 9 0 2 a 0>;
202 interrupt-parent = <&mpc5200_pic>;
203 bus-range = <0 0>;
204 ranges = <42000000 0 80000000 80000000 0 20000000
205 02000000 0 a0000000 a0000000 0 10000000
206 01000000 0 00000000 b0000000 0 01000000>;
207 };
208
209 spi@f00 { 185 spi@f00 {
210 device_type = "spi"; 186 device_type = "spi";
211 compatible = "mpc5200-spi"; 187 compatible = "mpc5200-spi";
@@ -340,4 +316,25 @@
340 reg = <8000 4000>; 316 reg = <8000 4000>;
341 }; 317 };
342 }; 318 };
319
320 pci@f0000d00 {
321 #interrupt-cells = <1>;
322 #size-cells = <2>;
323 #address-cells = <3>;
324 device_type = "pci";
325 compatible = "mpc5200-pci";
326 reg = <f0000d00 100>;
327 interrupt-map-mask = <f800 0 0 7>;
328 interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3
329 c000 0 0 2 &mpc5200_pic 0 0 3
330 c000 0 0 3 &mpc5200_pic 0 0 3
331 c000 0 0 4 &mpc5200_pic 0 0 3>;
332 clock-frequency = <0>; // From boot loader
333 interrupts = <2 8 0 2 9 0 2 a 0>;
334 interrupt-parent = <&mpc5200_pic>;
335 bus-range = <0 0>;
336 ranges = <42000000 0 80000000 80000000 0 20000000
337 02000000 0 a0000000 a0000000 0 10000000
338 01000000 0 00000000 b0000000 0 01000000>;
339 };
343}; 340};
diff --git a/arch/powerpc/boot/dts/lite5200b.dts b/arch/powerpc/boot/dts/lite5200b.dts
index f242531f0451..3f74f73f70ad 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -37,7 +37,6 @@
37 timebase-frequency = <0>; // from bootloader 37 timebase-frequency = <0>; // from bootloader
38 bus-frequency = <0>; // from bootloader 38 bus-frequency = <0>; // from bootloader
39 clock-frequency = <0>; // from bootloader 39 clock-frequency = <0>; // from bootloader
40 32-bit;
41 }; 40 };
42 }; 41 };
43 42
@@ -50,10 +49,9 @@
50 model = "fsl,mpc5200b"; 49 model = "fsl,mpc5200b";
51 compatible = "mpc5200"; 50 compatible = "mpc5200";
52 revision = ""; // from bootloader 51 revision = ""; // from bootloader
53 #interrupt-cells = <3>;
54 device_type = "soc"; 52 device_type = "soc";
55 ranges = <0 f0000000 f0010000>; 53 ranges = <0 f0000000 0000c000>;
56 reg = <f0000000 00010000>; 54 reg = <f0000000 00000100>;
57 bus-frequency = <0>; // from bootloader 55 bus-frequency = <0>; // from bootloader
58 system-frequency = <0>; // from bootloader 56 system-frequency = <0>; // from bootloader
59 57
@@ -69,7 +67,6 @@
69 device_type = "interrupt-controller"; 67 device_type = "interrupt-controller";
70 compatible = "mpc5200b-pic\0mpc5200-pic"; 68 compatible = "mpc5200b-pic\0mpc5200-pic";
71 reg = <500 80>; 69 reg = <500 80>;
72 built-in;
73 }; 70 };
74 71
75 gpt@600 { // General Purpose Timer 72 gpt@600 { // General Purpose Timer
@@ -185,32 +182,6 @@
185 interrupt-parent = <&mpc5200_pic>; 182 interrupt-parent = <&mpc5200_pic>;
186 }; 183 };
187 184
188 pci@0d00 {
189 #interrupt-cells = <1>;
190 #size-cells = <2>;
191 #address-cells = <3>;
192 device_type = "pci";
193 compatible = "mpc5200b-pci\0mpc5200-pci";
194 reg = <d00 100>;
195 interrupt-map-mask = <f800 0 0 7>;
196 interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot
197 c000 0 0 2 &mpc5200_pic 1 1 3
198 c000 0 0 3 &mpc5200_pic 1 2 3
199 c000 0 0 4 &mpc5200_pic 1 3 3
200
201 c800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot
202 c800 0 0 2 &mpc5200_pic 1 2 3
203 c800 0 0 3 &mpc5200_pic 1 3 3
204 c800 0 0 4 &mpc5200_pic 0 0 3>;
205 clock-frequency = <0>; // From boot loader
206 interrupts = <2 8 0 2 9 0 2 a 0>;
207 interrupt-parent = <&mpc5200_pic>;
208 bus-range = <0 0>;
209 ranges = <42000000 0 80000000 80000000 0 20000000
210 02000000 0 a0000000 a0000000 0 10000000
211 01000000 0 00000000 b0000000 0 01000000>;
212 };
213
214 spi@f00 { 185 spi@f00 {
215 device_type = "spi"; 186 device_type = "spi";
216 compatible = "mpc5200b-spi\0mpc5200-spi"; 187 compatible = "mpc5200b-spi\0mpc5200-spi";
@@ -345,4 +316,30 @@
345 reg = <8000 4000>; 316 reg = <8000 4000>;
346 }; 317 };
347 }; 318 };
319
320 pci@f0000d00 {
321 #interrupt-cells = <1>;
322 #size-cells = <2>;
323 #address-cells = <3>;
324 device_type = "pci";
325 compatible = "mpc5200b-pci\0mpc5200-pci";
326 reg = <f0000d00 100>;
327 interrupt-map-mask = <f800 0 0 7>;
328 interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot
329 c000 0 0 2 &mpc5200_pic 1 1 3
330 c000 0 0 3 &mpc5200_pic 1 2 3
331 c000 0 0 4 &mpc5200_pic 1 3 3
332
333 c800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot
334 c800 0 0 2 &mpc5200_pic 1 2 3
335 c800 0 0 3 &mpc5200_pic 1 3 3
336 c800 0 0 4 &mpc5200_pic 0 0 3>;
337 clock-frequency = <0>; // From boot loader
338 interrupts = <2 8 0 2 9 0 2 a 0>;
339 interrupt-parent = <&mpc5200_pic>;
340 bus-range = <0 0>;
341 ranges = <42000000 0 80000000 80000000 0 20000000
342 02000000 0 a0000000 a0000000 0 10000000
343 01000000 0 00000000 b0000000 0 01000000>;
344 };
348}; 345};
diff --git a/arch/powerpc/boot/dts/mpc7448hpc2.dts b/arch/powerpc/boot/dts/mpc7448hpc2.dts
index b9158eb2797e..88cd37da13ef 100644
--- a/arch/powerpc/boot/dts/mpc7448hpc2.dts
+++ b/arch/powerpc/boot/dts/mpc7448hpc2.dts
@@ -31,7 +31,6 @@
31 timebase-frequency = <0>; // 33 MHz, from uboot 31 timebase-frequency = <0>; // 33 MHz, from uboot
32 clock-frequency = <0>; // From U-Boot 32 clock-frequency = <0>; // From U-Boot
33 bus-frequency = <0>; // From U-Boot 33 bus-frequency = <0>; // From U-Boot
34 32-bit;
35 }; 34 };
36 }; 35 };
37 36
@@ -44,7 +43,6 @@
44 tsi108@c0000000 { 43 tsi108@c0000000 {
45 #address-cells = <1>; 44 #address-cells = <1>;
46 #size-cells = <1>; 45 #size-cells = <1>;
47 #interrupt-cells = <2>;
48 device_type = "tsi-bridge"; 46 device_type = "tsi-bridge";
49 ranges = <00000000 c0000000 00010000>; 47 ranges = <00000000 c0000000 00010000>;
50 reg = <c0000000 00010000>; 48 reg = <c0000000 00010000>;
@@ -128,7 +126,6 @@
128 #address-cells = <0>; 126 #address-cells = <0>;
129 #interrupt-cells = <2>; 127 #interrupt-cells = <2>;
130 reg = <7400 400>; 128 reg = <7400 400>;
131 built-in;
132 compatible = "chrp,open-pic"; 129 compatible = "chrp,open-pic";
133 device_type = "open-pic"; 130 device_type = "open-pic";
134 big-endian; 131 big-endian;
@@ -180,7 +177,6 @@
180 device_type = "pic-router"; 177 device_type = "pic-router";
181 #address-cells = <0>; 178 #address-cells = <0>;
182 #interrupt-cells = <2>; 179 #interrupt-cells = <2>;
183 built-in;
184 big-endian; 180 big-endian;
185 interrupts = <17 2>; 181 interrupts = <17 2>;
186 interrupt-parent = <&mpic>; 182 interrupt-parent = <&mpic>;
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts
index 1934b800278e..43130541799a 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -10,207 +10,204 @@
10 */ 10 */
11 11
12/ { 12/ {
13 model = "MPC8272ADS"; 13 model = "MPC8272ADS";
14 compatible = "MPC8260ADS"; 14 compatible = "MPC8260ADS";
15 #address-cells = <1>; 15 #address-cells = <1>;
16 #size-cells = <1>; 16 #size-cells = <1>;
17 17
18 cpus { 18 cpus {
19 #address-cells = <1>; 19 #address-cells = <1>;
20 #size-cells = <0>; 20 #size-cells = <0>;
21 21
22 PowerPC,8272@0 { 22 PowerPC,8272@0 {
23 device_type = "cpu"; 23 device_type = "cpu";
24 reg = <0>; 24 reg = <0>;
25 d-cache-line-size = <20>; // 32 bytes 25 d-cache-line-size = <20>; // 32 bytes
26 i-cache-line-size = <20>; // 32 bytes 26 i-cache-line-size = <20>; // 32 bytes
27 d-cache-size = <4000>; // L1, 16K 27 d-cache-size = <4000>; // L1, 16K
28 i-cache-size = <4000>; // L1, 16K 28 i-cache-size = <4000>; // L1, 16K
29 timebase-frequency = <0>; 29 timebase-frequency = <0>;
30 bus-frequency = <0>; 30 bus-frequency = <0>;
31 clock-frequency = <0>; 31 clock-frequency = <0>;
32 32-bit; 32 };
33 }; 33 };
34 }; 34
35 35 pci_pic: interrupt-controller@f8200000 {
36 pci_pic: interrupt-controller@f8200000 { 36 #address-cells = <0>;
37 #address-cells = <0>; 37 #interrupt-cells = <2>;
38 #interrupt-cells = <2>; 38 interrupt-controller;
39 interrupt-controller; 39 reg = <f8200000 f8200004>;
40 reg = <f8200000 f8200004>; 40 device_type = "pci-pic";
41 built-in; 41 };
42 device_type = "pci-pic"; 42
43 }; 43 memory {
44 memory { 44 device_type = "memory";
45 device_type = "memory"; 45 reg = <00000000 4000000 f4500000 00000020>;
46 reg = <00000000 4000000 f4500000 00000020>; 46 };
47 }; 47
48 48 chosen {
49 chosen { 49 name = "chosen";
50 name = "chosen"; 50 linux,platform = <0>;
51 linux,platform = <0>;
52 interrupt-controller = <&Cpm_pic>; 51 interrupt-controller = <&Cpm_pic>;
53 }; 52 };
54 53
55 soc8272@f0000000 { 54 soc8272@f0000000 {
56 #address-cells = <1>; 55 #address-cells = <1>;
57 #size-cells = <1>; 56 #size-cells = <1>;
58 #interrupt-cells = <2>; 57 device_type = "soc";
59 device_type = "soc"; 58 ranges = <00000000 f0000000 00053000>;
60 ranges = <00000000 f0000000 00053000>; 59 reg = <f0000000 10000>;
61 reg = <f0000000 10000>; 60
62 61 mdio@0 {
63 mdio@0 { 62 device_type = "mdio";
64 device_type = "mdio"; 63 compatible = "fs_enet";
65 compatible = "fs_enet"; 64 reg = <0 0>;
66 reg = <0 0>; 65 #address-cells = <1>;
67 #address-cells = <1>; 66 #size-cells = <0>;
68 #size-cells = <0>; 67
69 phy0:ethernet-phy@0 { 68 phy0:ethernet-phy@0 {
70 interrupt-parent = <&Cpm_pic>; 69 interrupt-parent = <&Cpm_pic>;
71 interrupts = <17 4>; 70 interrupts = <17 4>;
72 reg = <0>; 71 reg = <0>;
73 bitbang = [ 12 12 13 02 02 01 ]; 72 bitbang = [ 12 12 13 02 02 01 ];
74 device_type = "ethernet-phy"; 73 device_type = "ethernet-phy";
75 }; 74 };
75
76 phy1:ethernet-phy@1 { 76 phy1:ethernet-phy@1 {
77 interrupt-parent = <&Cpm_pic>; 77 interrupt-parent = <&Cpm_pic>;
78 interrupts = <17 4>; 78 interrupts = <17 4>;
79 bitbang = [ 12 12 13 02 02 01 ]; 79 bitbang = [ 12 12 13 02 02 01 ];
80 reg = <3>; 80 reg = <3>;
81 device_type = "ethernet-phy"; 81 device_type = "ethernet-phy";
82 }; 82 };
83 }; 83 };
84 84
85 ethernet@24000 { 85 ethernet@24000 {
86 #address-cells = <1>; 86 #address-cells = <1>;
87 #size-cells = <0>; 87 #size-cells = <0>;
88 device_type = "network"; 88 device_type = "network";
89 device-id = <1>; 89 device-id = <1>;
90 compatible = "fs_enet"; 90 compatible = "fs_enet";
91 model = "FCC"; 91 model = "FCC";
92 reg = <11300 20 8400 100 11380 30>; 92 reg = <11300 20 8400 100 11380 30>;
93 mac-address = [ 00 11 2F 99 43 54 ]; 93 mac-address = [ 00 11 2F 99 43 54 ];
94 interrupts = <20 2>; 94 interrupts = <20 2>;
95 interrupt-parent = <&Cpm_pic>; 95 interrupt-parent = <&Cpm_pic>;
96 phy-handle = <&Phy0>; 96 phy-handle = <&Phy0>;
97 rx-clock = <13>; 97 rx-clock = <13>;
98 tx-clock = <12>; 98 tx-clock = <12>;
99 }; 99 };
100 100
101 ethernet@25000 { 101 ethernet@25000 {
102 device_type = "network"; 102 device_type = "network";
103 device-id = <2>; 103 device-id = <2>;
104 compatible = "fs_enet"; 104 compatible = "fs_enet";
105 model = "FCC"; 105 model = "FCC";
106 reg = <11320 20 8500 100 113b0 30>; 106 reg = <11320 20 8500 100 113b0 30>;
107 mac-address = [ 00 11 2F 99 44 54 ]; 107 mac-address = [ 00 11 2F 99 44 54 ];
108 interrupts = <21 2>; 108 interrupts = <21 2>;
109 interrupt-parent = <&Cpm_pic>; 109 interrupt-parent = <&Cpm_pic>;
110 phy-handle = <&Phy1>; 110 phy-handle = <&Phy1>;
111 rx-clock = <17>; 111 rx-clock = <17>;
112 tx-clock = <18>; 112 tx-clock = <18>;
113 }; 113 };
114 114
115 cpm@f0000000 { 115 cpm@f0000000 {
116 #address-cells = <1>; 116 #address-cells = <1>;
117 #size-cells = <1>; 117 #size-cells = <1>;
118 #interrupt-cells = <2>; 118 device_type = "cpm";
119 device_type = "cpm"; 119 model = "CPM2";
120 model = "CPM2"; 120 ranges = <00000000 00000000 20000>;
121 ranges = <00000000 00000000 20000>; 121 reg = <0 20000>;
122 reg = <0 20000>; 122 command-proc = <119c0>;
123 command-proc = <119c0>; 123 brg-frequency = <17D7840>;
124 brg-frequency = <17D7840>; 124 cpm_clk = <BEBC200>;
125 cpm_clk = <BEBC200>; 125
126 126 scc@11a00 {
127 scc@11a00 { 127 device_type = "serial";
128 device_type = "serial"; 128 compatible = "cpm_uart";
129 compatible = "cpm_uart"; 129 model = "SCC";
130 model = "SCC"; 130 device-id = <1>;
131 device-id = <1>; 131 reg = <11a00 20 8000 100>;
132 reg = <11a00 20 8000 100>; 132 current-speed = <1c200>;
133 current-speed = <1c200>; 133 interrupts = <28 2>;
134 interrupts = <28 2>;
135 interrupt-parent = <&Cpm_pic>; 134 interrupt-parent = <&Cpm_pic>;
136 clock-setup = <0 00ffffff>; 135 clock-setup = <0 00ffffff>;
137 rx-clock = <1>; 136 rx-clock = <1>;
138 tx-clock = <1>; 137 tx-clock = <1>;
139 }; 138 };
140 139
141 scc@11a60 { 140 scc@11a60 {
142 device_type = "serial"; 141 device_type = "serial";
143 compatible = "cpm_uart"; 142 compatible = "cpm_uart";
144 model = "SCC"; 143 model = "SCC";
145 device-id = <4>; 144 device-id = <4>;
146 reg = <11a60 20 8300 100>; 145 reg = <11a60 20 8300 100>;
147 current-speed = <1c200>; 146 current-speed = <1c200>;
148 interrupts = <2b 2>; 147 interrupts = <2b 2>;
149 interrupt-parent = <&Cpm_pic>; 148 interrupt-parent = <&Cpm_pic>;
150 clock-setup = <1b ffffff00>; 149 clock-setup = <1b ffffff00>;
151 rx-clock = <4>; 150 rx-clock = <4>;
152 tx-clock = <4>; 151 tx-clock = <4>;
153 }; 152 };
154 153 };
155 }; 154
156 cpm_pic:interrupt-controller@10c00 { 155 cpm_pic:interrupt-controller@10c00 {
157 #address-cells = <0>; 156 #address-cells = <0>;
158 #interrupt-cells = <2>; 157 #interrupt-cells = <2>;
159 interrupt-controller; 158 interrupt-controller;
160 reg = <10c00 80>; 159 reg = <10c00 80>;
161 built-in; 160 device_type = "cpm-pic";
162 device_type = "cpm-pic"; 161 compatible = "CPM2";
163 compatible = "CPM2"; 162 };
164 }; 163
165 pci@0500 { 164 pci@0500 {
166 #interrupt-cells = <1>; 165 #interrupt-cells = <1>;
167 #size-cells = <2>; 166 #size-cells = <2>;
168 #address-cells = <3>; 167 #address-cells = <3>;
169 compatible = "8272"; 168 compatible = "8272";
170 device_type = "pci"; 169 device_type = "pci";
171 reg = <10430 4dc>; 170 reg = <10430 4dc>;
172 clock-frequency = <3f940aa>; 171 clock-frequency = <3f940aa>;
173 interrupt-map-mask = <f800 0 0 7>; 172 interrupt-map-mask = <f800 0 0 7>;
174 interrupt-map = < 173 interrupt-map = <
175 174 /* IDSEL 0x16 */
176 /* IDSEL 0x16 */ 175 b000 0 0 1 f8200000 40 8
177 b000 0 0 1 f8200000 40 8 176 b000 0 0 2 f8200000 41 8
178 b000 0 0 2 f8200000 41 8 177 b000 0 0 3 f8200000 42 8
179 b000 0 0 3 f8200000 42 8 178 b000 0 0 4 f8200000 43 8
180 b000 0 0 4 f8200000 43 8 179
181 180 /* IDSEL 0x17 */
182 /* IDSEL 0x17 */ 181 b800 0 0 1 f8200000 43 8
183 b800 0 0 1 f8200000 43 8 182 b800 0 0 2 f8200000 40 8
184 b800 0 0 2 f8200000 40 8 183 b800 0 0 3 f8200000 41 8
185 b800 0 0 3 f8200000 41 8 184 b800 0 0 4 f8200000 42 8
186 b800 0 0 4 f8200000 42 8 185
187 186 /* IDSEL 0x18 */
188 /* IDSEL 0x18 */ 187 c000 0 0 1 f8200000 42 8
189 c000 0 0 1 f8200000 42 8 188 c000 0 0 2 f8200000 43 8
190 c000 0 0 2 f8200000 43 8 189 c000 0 0 3 f8200000 40 8
191 c000 0 0 3 f8200000 40 8 190 c000 0 0 4 f8200000 41 8>;
192 c000 0 0 4 f8200000 41 8>;
193 interrupt-parent = <&Cpm_pic>; 191 interrupt-parent = <&Cpm_pic>;
194 interrupts = <14 8>; 192 interrupts = <14 8>;
195 bus-range = <0 0>; 193 bus-range = <0 0>;
196 ranges = <02000000 0 80000000 80000000 0 40000000 194 ranges = <02000000 0 80000000 80000000 0 40000000
197 01000000 0 00000000 f6000000 0 02000000>; 195 01000000 0 00000000 f6000000 0 02000000>;
198 }; 196 };
199 197
200/* May need to remove if on a part without crypto engine */ 198/* May need to remove if on a part without crypto engine */
201 crypto@30000 { 199 crypto@30000 {
202 device_type = "crypto"; 200 device_type = "crypto";
203 model = "SEC2"; 201 model = "SEC2";
204 compatible = "talitos"; 202 compatible = "talitos";
205 reg = <30000 10000>; 203 reg = <30000 10000>;
206 interrupts = <b 2>; 204 interrupts = <b 2>;
207 interrupt-parent = <&Cpm_pic>; 205 interrupt-parent = <&Cpm_pic>;
208 num-channels = <4>; 206 num-channels = <4>;
209 channel-fifo-len = <18>; 207 channel-fifo-len = <18>;
210 exec-units-mask = <0000007e>; 208 exec-units-mask = <0000007e>;
211/* desc mask is for rev1.x, we need runtime fixup for >=2.x */ 209/* desc mask is for rev1.x, we need runtime fixup for >=2.x */
212 descriptor-types-mask = <01010ebf>; 210 descriptor-types-mask = <01010ebf>;
213 }; 211 };
214 212 };
215 };
216}; 213};
diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
index c5adbe40364e..a8eadc8c4497 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -29,7 +29,6 @@
29 timebase-frequency = <0>; // from bootloader 29 timebase-frequency = <0>; // from bootloader
30 bus-frequency = <0>; // from bootloader 30 bus-frequency = <0>; // from bootloader
31 clock-frequency = <0>; // from bootloader 31 clock-frequency = <0>; // from bootloader
32 32-bit;
33 }; 32 };
34 }; 33 };
35 34
@@ -41,7 +40,6 @@
41 soc8313@e0000000 { 40 soc8313@e0000000 {
42 #address-cells = <1>; 41 #address-cells = <1>;
43 #size-cells = <1>; 42 #size-cells = <1>;
44 #interrupt-cells = <2>;
45 device_type = "soc"; 43 device_type = "soc";
46 ranges = <0 e0000000 00100000>; 44 ranges = <0 e0000000 00100000>;
47 reg = <e0000000 00000200>; 45 reg = <e0000000 00000200>;
@@ -152,36 +150,6 @@
152 interrupt-parent = < &ipic >; 150 interrupt-parent = < &ipic >;
153 }; 151 };
154 152
155 pci@8500 {
156 interrupt-map-mask = <f800 0 0 7>;
157 interrupt-map = <
158
159 /* IDSEL 0x0E -mini PCI */
160 7000 0 0 1 &ipic 12 8
161 7000 0 0 2 &ipic 12 8
162 7000 0 0 3 &ipic 12 8
163 7000 0 0 4 &ipic 12 8
164
165 /* IDSEL 0x0F - PCI slot */
166 7800 0 0 1 &ipic 11 8
167 7800 0 0 2 &ipic 12 8
168 7800 0 0 3 &ipic 11 8
169 7800 0 0 4 &ipic 12 8>;
170 interrupt-parent = < &ipic >;
171 interrupts = <42 8>;
172 bus-range = <0 0>;
173 ranges = <02000000 0 90000000 90000000 0 10000000
174 42000000 0 80000000 80000000 0 10000000
175 01000000 0 00000000 e2000000 0 00100000>;
176 clock-frequency = <3f940aa>;
177 #interrupt-cells = <1>;
178 #size-cells = <2>;
179 #address-cells = <3>;
180 reg = <8500 100>;
181 compatible = "fsl,mpc8349-pci";
182 device_type = "pci";
183 };
184
185 crypto@30000 { 153 crypto@30000 {
186 device_type = "crypto"; 154 device_type = "crypto";
187 model = "SEC2"; 155 model = "SEC2";
@@ -207,8 +175,37 @@
207 #address-cells = <0>; 175 #address-cells = <0>;
208 #interrupt-cells = <2>; 176 #interrupt-cells = <2>;
209 reg = <700 100>; 177 reg = <700 100>;
210 built-in;
211 device_type = "ipic"; 178 device_type = "ipic";
212 }; 179 };
213 }; 180 };
181
182 pci@e0008500 {
183 interrupt-map-mask = <f800 0 0 7>;
184 interrupt-map = <
185
186 /* IDSEL 0x0E -mini PCI */
187 7000 0 0 1 &ipic 12 8
188 7000 0 0 2 &ipic 12 8
189 7000 0 0 3 &ipic 12 8
190 7000 0 0 4 &ipic 12 8
191
192 /* IDSEL 0x0F - PCI slot */
193 7800 0 0 1 &ipic 11 8
194 7800 0 0 2 &ipic 12 8
195 7800 0 0 3 &ipic 11 8
196 7800 0 0 4 &ipic 12 8>;
197 interrupt-parent = < &ipic >;
198 interrupts = <42 8>;
199 bus-range = <0 0>;
200 ranges = <02000000 0 90000000 90000000 0 10000000
201 42000000 0 80000000 80000000 0 10000000
202 01000000 0 00000000 e2000000 0 00100000>;
203 clock-frequency = <3f940aa>;
204 #interrupt-cells = <1>;
205 #size-cells = <2>;
206 #address-cells = <3>;
207 reg = <e0008500 100>;
208 compatible = "fsl,mpc8349-pci";
209 device_type = "pci";
210 };
214}; 211};
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index f158ed781ba8..fcd333c391ec 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -29,7 +29,6 @@
29 timebase-frequency = <0>; 29 timebase-frequency = <0>;
30 bus-frequency = <0>; 30 bus-frequency = <0>;
31 clock-frequency = <0>; 31 clock-frequency = <0>;
32 32-bit;
33 }; 32 };
34 }; 33 };
35 34
@@ -46,7 +45,6 @@
46 soc8323@e0000000 { 45 soc8323@e0000000 {
47 #address-cells = <1>; 46 #address-cells = <1>;
48 #size-cells = <1>; 47 #size-cells = <1>;
49 #interrupt-cells = <2>;
50 device_type = "soc"; 48 device_type = "soc";
51 ranges = <0 e0000000 00100000>; 49 ranges = <0 e0000000 00100000>;
52 reg = <e0000000 00000200>; 50 reg = <e0000000 00000200>;
@@ -99,71 +97,11 @@
99 descriptor-types-mask = <0122003f>; 97 descriptor-types-mask = <0122003f>;
100 }; 98 };
101 99
102 pci@8500 {
103 interrupt-map-mask = <f800 0 0 7>;
104 interrupt-map = <
105 /* IDSEL 0x11 AD17 */
106 8800 0 0 1 &ipic 14 8
107 8800 0 0 2 &ipic 15 8
108 8800 0 0 3 &ipic 16 8
109 8800 0 0 4 &ipic 17 8
110
111 /* IDSEL 0x12 AD18 */
112 9000 0 0 1 &ipic 16 8
113 9000 0 0 2 &ipic 17 8
114 9000 0 0 3 &ipic 14 8
115 9000 0 0 4 &ipic 15 8
116
117 /* IDSEL 0x13 AD19 */
118 9800 0 0 1 &ipic 17 8
119 9800 0 0 2 &ipic 14 8
120 9800 0 0 3 &ipic 15 8
121 9800 0 0 4 &ipic 16 8
122
123 /* IDSEL 0x15 AD21*/
124 a800 0 0 1 &ipic 14 8
125 a800 0 0 2 &ipic 15 8
126 a800 0 0 3 &ipic 16 8
127 a800 0 0 4 &ipic 17 8
128
129 /* IDSEL 0x16 AD22*/
130 b000 0 0 1 &ipic 17 8
131 b000 0 0 2 &ipic 14 8
132 b000 0 0 3 &ipic 15 8
133 b000 0 0 4 &ipic 16 8
134
135 /* IDSEL 0x17 AD23*/
136 b800 0 0 1 &ipic 16 8
137 b800 0 0 2 &ipic 17 8
138 b800 0 0 3 &ipic 14 8
139 b800 0 0 4 &ipic 15 8
140
141 /* IDSEL 0x18 AD24*/
142 c000 0 0 1 &ipic 15 8
143 c000 0 0 2 &ipic 16 8
144 c000 0 0 3 &ipic 17 8
145 c000 0 0 4 &ipic 14 8>;
146 interrupt-parent = < &ipic >;
147 interrupts = <42 8>;
148 bus-range = <0 0>;
149 ranges = <02000000 0 90000000 90000000 0 10000000
150 42000000 0 80000000 80000000 0 10000000
151 01000000 0 00000000 d0000000 0 00100000>;
152 clock-frequency = <0>;
153 #interrupt-cells = <1>;
154 #size-cells = <2>;
155 #address-cells = <3>;
156 reg = <8500 100>;
157 compatible = "fsl,mpc8349-pci";
158 device_type = "pci";
159 };
160
161 ipic: pic@700 { 100 ipic: pic@700 {
162 interrupt-controller; 101 interrupt-controller;
163 #address-cells = <0>; 102 #address-cells = <0>;
164 #interrupt-cells = <2>; 103 #interrupt-cells = <2>;
165 reg = <700 100>; 104 reg = <700 100>;
166 built-in;
167 device_type = "ipic"; 105 device_type = "ipic";
168 }; 106 };
169 107
@@ -333,10 +271,68 @@
333 #address-cells = <0>; 271 #address-cells = <0>;
334 #interrupt-cells = <1>; 272 #interrupt-cells = <1>;
335 reg = <80 80>; 273 reg = <80 80>;
336 built-in;
337 big-endian; 274 big-endian;
338 interrupts = <20 8 21 8>; //high:32 low:33 275 interrupts = <20 8 21 8>; //high:32 low:33
339 interrupt-parent = < &ipic >; 276 interrupt-parent = < &ipic >;
340 }; 277 };
341 }; 278 };
279
280 pci@e0008500 {
281 interrupt-map-mask = <f800 0 0 7>;
282 interrupt-map = <
283 /* IDSEL 0x11 AD17 */
284 8800 0 0 1 &ipic 14 8
285 8800 0 0 2 &ipic 15 8
286 8800 0 0 3 &ipic 16 8
287 8800 0 0 4 &ipic 17 8
288
289 /* IDSEL 0x12 AD18 */
290 9000 0 0 1 &ipic 16 8
291 9000 0 0 2 &ipic 17 8
292 9000 0 0 3 &ipic 14 8
293 9000 0 0 4 &ipic 15 8
294
295 /* IDSEL 0x13 AD19 */
296 9800 0 0 1 &ipic 17 8
297 9800 0 0 2 &ipic 14 8
298 9800 0 0 3 &ipic 15 8
299 9800 0 0 4 &ipic 16 8
300
301 /* IDSEL 0x15 AD21*/
302 a800 0 0 1 &ipic 14 8
303 a800 0 0 2 &ipic 15 8
304 a800 0 0 3 &ipic 16 8
305 a800 0 0 4 &ipic 17 8
306
307 /* IDSEL 0x16 AD22*/
308 b000 0 0 1 &ipic 17 8
309 b000 0 0 2 &ipic 14 8
310 b000 0 0 3 &ipic 15 8
311 b000 0 0 4 &ipic 16 8
312
313 /* IDSEL 0x17 AD23*/
314 b800 0 0 1 &ipic 16 8
315 b800 0 0 2 &ipic 17 8
316 b800 0 0 3 &ipic 14 8
317 b800 0 0 4 &ipic 15 8
318
319 /* IDSEL 0x18 AD24*/
320 c000 0 0 1 &ipic 15 8
321 c000 0 0 2 &ipic 16 8
322 c000 0 0 3 &ipic 17 8
323 c000 0 0 4 &ipic 14 8>;
324 interrupt-parent = < &ipic >;
325 interrupts = <42 8>;
326 bus-range = <0 0>;
327 ranges = <02000000 0 90000000 90000000 0 10000000
328 42000000 0 80000000 80000000 0 10000000
329 01000000 0 00000000 d0000000 0 00100000>;
330 clock-frequency = <0>;
331 #interrupt-cells = <1>;
332 #size-cells = <2>;
333 #address-cells = <3>;
334 reg = <e0008500 100>;
335 compatible = "fsl,mpc8349-pci";
336 device_type = "pci";
337 };
342}; 338};
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 7c4beff3e200..388c8a7012e1 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -29,7 +29,6 @@
29 timebase-frequency = <0>; 29 timebase-frequency = <0>;
30 bus-frequency = <0>; 30 bus-frequency = <0>;
31 clock-frequency = <0>; 31 clock-frequency = <0>;
32 32-bit;
33 }; 32 };
34 }; 33 };
35 34
@@ -41,7 +40,6 @@
41 soc8323@e0000000 { 40 soc8323@e0000000 {
42 #address-cells = <1>; 41 #address-cells = <1>;
43 #size-cells = <1>; 42 #size-cells = <1>;
44 #interrupt-cells = <2>;
45 device_type = "soc"; 43 device_type = "soc";
46 ranges = <0 e0000000 00100000>; 44 ranges = <0 e0000000 00100000>;
47 reg = <e0000000 00000200>; 45 reg = <e0000000 00000200>;
@@ -94,45 +92,11 @@
94 descriptor-types-mask = <0122003f>; 92 descriptor-types-mask = <0122003f>;
95 }; 93 };
96 94
97 pci@8500 {
98 interrupt-map-mask = <f800 0 0 7>;
99 interrupt-map = <
100 /* IDSEL 0x10 AD16 (USB) */
101 8000 0 0 1 &pic 11 8
102
103 /* IDSEL 0x11 AD17 (Mini1)*/
104 8800 0 0 1 &pic 12 8
105 8800 0 0 2 &pic 13 8
106 8800 0 0 3 &pic 14 8
107 8800 0 0 4 &pic 30 8
108
109 /* IDSEL 0x12 AD18 (PCI/Mini2) */
110 9000 0 0 1 &pic 13 8
111 9000 0 0 2 &pic 14 8
112 9000 0 0 3 &pic 30 8
113 9000 0 0 4 &pic 11 8>;
114
115 interrupt-parent = <&pic>;
116 interrupts = <42 8>;
117 bus-range = <0 0>;
118 ranges = <42000000 0 80000000 80000000 0 10000000
119 02000000 0 90000000 90000000 0 10000000
120 01000000 0 d0000000 d0000000 0 04000000>;
121 clock-frequency = <0>;
122 #interrupt-cells = <1>;
123 #size-cells = <2>;
124 #address-cells = <3>;
125 reg = <8500 100>;
126 compatible = "fsl,mpc8349-pci";
127 device_type = "pci";
128 };
129
130 pic:pic@700 { 95 pic:pic@700 {
131 interrupt-controller; 96 interrupt-controller;
132 #address-cells = <0>; 97 #address-cells = <0>;
133 #interrupt-cells = <2>; 98 #interrupt-cells = <2>;
134 reg = <700 100>; 99 reg = <700 100>;
135 built-in;
136 device_type = "ipic"; 100 device_type = "ipic";
137 }; 101 };
138 102
@@ -211,7 +175,7 @@
211 reg = <4c0 40>; 175 reg = <4c0 40>;
212 interrupts = <2>; 176 interrupts = <2>;
213 interrupt-parent = <&qeic>; 177 interrupt-parent = <&qeic>;
214 mode = "cpu"; 178 mode = "cpu-qe";
215 }; 179 };
216 180
217 spi@500 { 181 spi@500 {
@@ -292,10 +256,42 @@
292 #address-cells = <0>; 256 #address-cells = <0>;
293 #interrupt-cells = <1>; 257 #interrupt-cells = <1>;
294 reg = <80 80>; 258 reg = <80 80>;
295 built-in;
296 big-endian; 259 big-endian;
297 interrupts = <20 8 21 8>; //high:32 low:33 260 interrupts = <20 8 21 8>; //high:32 low:33
298 interrupt-parent = <&pic>; 261 interrupt-parent = <&pic>;
299 }; 262 };
300 }; 263 };
264
265 pci@e0008500 {
266 interrupt-map-mask = <f800 0 0 7>;
267 interrupt-map = <
268 /* IDSEL 0x10 AD16 (USB) */
269 8000 0 0 1 &pic 11 8
270
271 /* IDSEL 0x11 AD17 (Mini1)*/
272 8800 0 0 1 &pic 12 8
273 8800 0 0 2 &pic 13 8
274 8800 0 0 3 &pic 14 8
275 8800 0 0 4 &pic 30 8
276
277 /* IDSEL 0x12 AD18 (PCI/Mini2) */
278 9000 0 0 1 &pic 13 8
279 9000 0 0 2 &pic 14 8
280 9000 0 0 3 &pic 30 8
281 9000 0 0 4 &pic 11 8>;
282
283 interrupt-parent = <&pic>;
284 interrupts = <42 8>;
285 bus-range = <0 0>;
286 ranges = <42000000 0 80000000 80000000 0 10000000
287 02000000 0 90000000 90000000 0 10000000
288 01000000 0 d0000000 d0000000 0 04000000>;
289 clock-frequency = <0>;
290 #interrupt-cells = <1>;
291 #size-cells = <2>;
292 #address-cells = <3>;
293 reg = <e0008500 100>;
294 compatible = "fsl,mpc8349-pci";
295 device_type = "pci";
296 };
301}; 297};
diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts
index 44c065a6b5e7..3bc32029ca5b 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -28,7 +28,6 @@
28 timebase-frequency = <0>; // from bootloader 28 timebase-frequency = <0>; // from bootloader
29 bus-frequency = <0>; // from bootloader 29 bus-frequency = <0>; // from bootloader
30 clock-frequency = <0>; // from bootloader 30 clock-frequency = <0>; // from bootloader
31 32-bit;
32 }; 31 };
33 }; 32 };
34 33
@@ -40,7 +39,6 @@
40 soc8349@e0000000 { 39 soc8349@e0000000 {
41 #address-cells = <1>; 40 #address-cells = <1>;
42 #size-cells = <1>; 41 #size-cells = <1>;
43 #interrupt-cells = <2>;
44 device_type = "soc"; 42 device_type = "soc";
45 ranges = <0 e0000000 00100000>; 43 ranges = <0 e0000000 00100000>;
46 reg = <e0000000 00000200>; 44 reg = <e0000000 00000200>;
@@ -142,6 +140,7 @@
142 interrupts = <20 8 21 8 22 8>; 140 interrupts = <20 8 21 8 22 8>;
143 interrupt-parent = < &ipic >; 141 interrupt-parent = < &ipic >;
144 phy-handle = < &phy1c >; 142 phy-handle = < &phy1c >;
143 linux,network-index = <0>;
145 }; 144 };
146 145
147 ethernet@25000 { 146 ethernet@25000 {
@@ -161,6 +160,7 @@
161 interrupts = <23 8 24 8 25 8>; 160 interrupts = <23 8 24 8 25 8>;
162 interrupt-parent = < &ipic >; 161 interrupt-parent = < &ipic >;
163 phy-handle = < &phy1f >; 162 phy-handle = < &phy1f >;
163 linux,network-index = <1>;
164 }; 164 };
165 165
166 serial@4500 { 166 serial@4500 {
@@ -181,52 +181,6 @@
181 interrupt-parent = < &ipic >; 181 interrupt-parent = < &ipic >;
182 }; 182 };
183 183
184 pci@8500 {
185 interrupt-map-mask = <f800 0 0 7>;
186 interrupt-map = <
187 /* IDSEL 0x10 - SATA */
188 8000 0 0 1 &ipic 16 8 /* SATA_INTA */
189 >;
190 interrupt-parent = < &ipic >;
191 interrupts = <42 8>;
192 bus-range = <0 0>;
193 ranges = <42000000 0 80000000 80000000 0 10000000
194 02000000 0 90000000 90000000 0 10000000
195 01000000 0 00000000 e2000000 0 01000000>;
196 clock-frequency = <3f940aa>;
197 #interrupt-cells = <1>;
198 #size-cells = <2>;
199 #address-cells = <3>;
200 reg = <8500 100>;
201 compatible = "fsl,mpc8349-pci";
202 device_type = "pci";
203 };
204
205 pci@8600 {
206 interrupt-map-mask = <f800 0 0 7>;
207 interrupt-map = <
208 /* IDSEL 0x0E - MiniPCI Slot */
209 7000 0 0 1 &ipic 15 8 /* PCI_INTA */
210
211 /* IDSEL 0x0F - PCI Slot */
212 7800 0 0 1 &ipic 14 8 /* PCI_INTA */
213 7800 0 0 2 &ipic 15 8 /* PCI_INTB */
214 >;
215 interrupt-parent = < &ipic >;
216 interrupts = <43 8>;
217 bus-range = <1 1>;
218 ranges = <42000000 0 a0000000 a0000000 0 10000000
219 02000000 0 b0000000 b0000000 0 10000000
220 01000000 0 00000000 e3000000 0 01000000>;
221 clock-frequency = <3f940aa>;
222 #interrupt-cells = <1>;
223 #size-cells = <2>;
224 #address-cells = <3>;
225 reg = <8600 100>;
226 compatible = "fsl,mpc8349-pci";
227 device_type = "pci";
228 };
229
230 crypto@30000 { 184 crypto@30000 {
231 device_type = "crypto"; 185 device_type = "crypto";
232 model = "SEC2"; 186 model = "SEC2";
@@ -245,8 +199,56 @@
245 #address-cells = <0>; 199 #address-cells = <0>;
246 #interrupt-cells = <2>; 200 #interrupt-cells = <2>;
247 reg = <700 100>; 201 reg = <700 100>;
248 built-in;
249 device_type = "ipic"; 202 device_type = "ipic";
250 }; 203 };
251 }; 204 };
205
206 pci@e0008500 {
207 interrupt-map-mask = <f800 0 0 7>;
208 interrupt-map = <
209 /* IDSEL 0x10 - SATA */
210 8000 0 0 1 &ipic 16 8 /* SATA_INTA */
211 >;
212 interrupt-parent = < &ipic >;
213 interrupts = <42 8>;
214 bus-range = <0 0>;
215 ranges = <42000000 0 80000000 80000000 0 10000000
216 02000000 0 90000000 90000000 0 10000000
217 01000000 0 00000000 e2000000 0 01000000>;
218 clock-frequency = <3f940aa>;
219 #interrupt-cells = <1>;
220 #size-cells = <2>;
221 #address-cells = <3>;
222 reg = <e0008500 100>;
223 compatible = "fsl,mpc8349-pci";
224 device_type = "pci";
225 };
226
227 pci@e0008600 {
228 interrupt-map-mask = <f800 0 0 7>;
229 interrupt-map = <
230 /* IDSEL 0x0E - MiniPCI Slot */
231 7000 0 0 1 &ipic 15 8 /* PCI_INTA */
232
233 /* IDSEL 0x0F - PCI Slot */
234 7800 0 0 1 &ipic 14 8 /* PCI_INTA */
235 7800 0 0 2 &ipic 15 8 /* PCI_INTB */
236 >;
237 interrupt-parent = < &ipic >;
238 interrupts = <43 8>;
239 bus-range = <0 0>;
240 ranges = <42000000 0 a0000000 a0000000 0 10000000
241 02000000 0 b0000000 b0000000 0 10000000
242 01000000 0 00000000 e3000000 0 01000000>;
243 clock-frequency = <3f940aa>;
244 #interrupt-cells = <1>;
245 #size-cells = <2>;
246 #address-cells = <3>;
247 reg = <e0008600 100>;
248 compatible = "fsl,mpc8349-pci";
249 device_type = "pci";
250 };
251
252
253
252}; 254};
diff --git a/arch/powerpc/boot/dts/mpc8349emitxgp.dts b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
index 0b8387141d88..36a27607f766 100644
--- a/arch/powerpc/boot/dts/mpc8349emitxgp.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
@@ -28,7 +28,6 @@
28 timebase-frequency = <0>; // from bootloader 28 timebase-frequency = <0>; // from bootloader
29 bus-frequency = <0>; // from bootloader 29 bus-frequency = <0>; // from bootloader
30 clock-frequency = <0>; // from bootloader 30 clock-frequency = <0>; // from bootloader
31 32-bit;
32 }; 31 };
33 }; 32 };
34 33
@@ -40,7 +39,6 @@
40 soc8349@e0000000 { 39 soc8349@e0000000 {
41 #address-cells = <1>; 40 #address-cells = <1>;
42 #size-cells = <1>; 41 #size-cells = <1>;
43 #interrupt-cells = <2>;
44 device_type = "soc"; 42 device_type = "soc";
45 ranges = <0 e0000000 00100000>; 43 ranges = <0 e0000000 00100000>;
46 reg = <e0000000 00000200>; 44 reg = <e0000000 00000200>;
@@ -116,6 +114,7 @@
116 interrupts = <20 8 21 8 22 8>; 114 interrupts = <20 8 21 8 22 8>;
117 interrupt-parent = < &ipic >; 115 interrupt-parent = < &ipic >;
118 phy-handle = < &phy1c >; 116 phy-handle = < &phy1c >;
117 linux,network-index = <0>;
119 }; 118 };
120 119
121 serial@4500 { 120 serial@4500 {
@@ -136,28 +135,6 @@
136 interrupt-parent = < &ipic >; 135 interrupt-parent = < &ipic >;
137 }; 136 };
138 137
139 pci@8600 {
140 interrupt-map-mask = <f800 0 0 7>;
141 interrupt-map = <
142 /* IDSEL 0x0F - PCI Slot */
143 7800 0 0 1 &ipic 14 8 /* PCI_INTA */
144 7800 0 0 2 &ipic 15 8 /* PCI_INTB */
145 >;
146 interrupt-parent = < &ipic >;
147 interrupts = <43 8>;
148 bus-range = <1 1>;
149 ranges = <42000000 0 a0000000 a0000000 0 10000000
150 02000000 0 b0000000 b0000000 0 10000000
151 01000000 0 00000000 e3000000 0 01000000>;
152 clock-frequency = <3f940aa>;
153 #interrupt-cells = <1>;
154 #size-cells = <2>;
155 #address-cells = <3>;
156 reg = <8600 100>;
157 compatible = "fsl,mpc8349-pci";
158 device_type = "pci";
159 };
160
161 crypto@30000 { 138 crypto@30000 {
162 device_type = "crypto"; 139 device_type = "crypto";
163 model = "SEC2"; 140 model = "SEC2";
@@ -176,8 +153,29 @@
176 #address-cells = <0>; 153 #address-cells = <0>;
177 #interrupt-cells = <2>; 154 #interrupt-cells = <2>;
178 reg = <700 100>; 155 reg = <700 100>;
179 built-in;
180 device_type = "ipic"; 156 device_type = "ipic";
181 }; 157 };
182 }; 158 };
159
160 pci@e0008600 {
161 interrupt-map-mask = <f800 0 0 7>;
162 interrupt-map = <
163 /* IDSEL 0x0F - PCI Slot */
164 7800 0 0 1 &ipic 14 8 /* PCI_INTA */
165 7800 0 0 2 &ipic 15 8 /* PCI_INTB */
166 >;
167 interrupt-parent = < &ipic >;
168 interrupts = <43 8>;
169 bus-range = <1 1>;
170 ranges = <42000000 0 a0000000 a0000000 0 10000000
171 02000000 0 b0000000 b0000000 0 10000000
172 01000000 0 00000000 e3000000 0 01000000>;
173 clock-frequency = <3f940aa>;
174 #interrupt-cells = <1>;
175 #size-cells = <2>;
176 #address-cells = <3>;
177 reg = <e0008600 100>;
178 compatible = "fsl,mpc8349-pci";
179 device_type = "pci";
180 };
183}; 181};
diff --git a/arch/powerpc/boot/dts/mpc834x_mds.dts b/arch/powerpc/boot/dts/mpc834x_mds.dts
index 481099756e44..c27e2fff5d58 100644
--- a/arch/powerpc/boot/dts/mpc834x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
@@ -29,7 +29,6 @@
29 timebase-frequency = <0>; // from bootloader 29 timebase-frequency = <0>; // from bootloader
30 bus-frequency = <0>; // from bootloader 30 bus-frequency = <0>; // from bootloader
31 clock-frequency = <0>; // from bootloader 31 clock-frequency = <0>; // from bootloader
32 32-bit;
33 }; 32 };
34 }; 33 };
35 34
@@ -46,7 +45,6 @@
46 soc8349@e0000000 { 45 soc8349@e0000000 {
47 #address-cells = <1>; 46 #address-cells = <1>;
48 #size-cells = <1>; 47 #size-cells = <1>;
49 #interrupt-cells = <2>;
50 device_type = "soc"; 48 device_type = "soc";
51 ranges = <0 e0000000 00100000>; 49 ranges = <0 e0000000 00100000>;
52 reg = <e0000000 00000200>; 50 reg = <e0000000 00000200>;
@@ -146,6 +144,7 @@
146 interrupts = <20 8 21 8 22 8>; 144 interrupts = <20 8 21 8 22 8>;
147 interrupt-parent = < &ipic >; 145 interrupt-parent = < &ipic >;
148 phy-handle = < &phy0 >; 146 phy-handle = < &phy0 >;
147 linux,network-index = <0>;
149 }; 148 };
150 149
151 ethernet@25000 { 150 ethernet@25000 {
@@ -165,6 +164,7 @@
165 interrupts = <23 8 24 8 25 8>; 164 interrupts = <23 8 24 8 25 8>;
166 interrupt-parent = < &ipic >; 165 interrupt-parent = < &ipic >;
167 phy-handle = < &phy1 >; 166 phy-handle = < &phy1 >;
167 linux,network-index = <1>;
168 }; 168 };
169 169
170 serial@4500 { 170 serial@4500 {
@@ -185,126 +185,6 @@
185 interrupt-parent = < &ipic >; 185 interrupt-parent = < &ipic >;
186 }; 186 };
187 187
188 pci@8500 {
189 interrupt-map-mask = <f800 0 0 7>;
190 interrupt-map = <
191
192 /* IDSEL 0x11 */
193 8800 0 0 1 &ipic 14 8
194 8800 0 0 2 &ipic 15 8
195 8800 0 0 3 &ipic 16 8
196 8800 0 0 4 &ipic 17 8
197
198 /* IDSEL 0x12 */
199 9000 0 0 1 &ipic 16 8
200 9000 0 0 2 &ipic 17 8
201 9000 0 0 3 &ipic 14 8
202 9000 0 0 4 &ipic 15 8
203
204 /* IDSEL 0x13 */
205 9800 0 0 1 &ipic 17 8
206 9800 0 0 2 &ipic 14 8
207 9800 0 0 3 &ipic 15 8
208 9800 0 0 4 &ipic 16 8
209
210 /* IDSEL 0x15 */
211 a800 0 0 1 &ipic 14 8
212 a800 0 0 2 &ipic 15 8
213 a800 0 0 3 &ipic 16 8
214 a800 0 0 4 &ipic 17 8
215
216 /* IDSEL 0x16 */
217 b000 0 0 1 &ipic 17 8
218 b000 0 0 2 &ipic 14 8
219 b000 0 0 3 &ipic 15 8
220 b000 0 0 4 &ipic 16 8
221
222 /* IDSEL 0x17 */
223 b800 0 0 1 &ipic 16 8
224 b800 0 0 2 &ipic 17 8
225 b800 0 0 3 &ipic 14 8
226 b800 0 0 4 &ipic 15 8
227
228 /* IDSEL 0x18 */
229 c000 0 0 1 &ipic 15 8
230 c000 0 0 2 &ipic 16 8
231 c000 0 0 3 &ipic 17 8
232 c000 0 0 4 &ipic 14 8>;
233 interrupt-parent = < &ipic >;
234 interrupts = <42 8>;
235 bus-range = <0 0>;
236 ranges = <02000000 0 90000000 90000000 0 10000000
237 42000000 0 80000000 80000000 0 10000000
238 01000000 0 00000000 e2000000 0 00100000>;
239 clock-frequency = <3f940aa>;
240 #interrupt-cells = <1>;
241 #size-cells = <2>;
242 #address-cells = <3>;
243 reg = <8500 100>;
244 compatible = "fsl,mpc8349-pci";
245 device_type = "pci";
246 };
247
248 pci@8600 {
249 interrupt-map-mask = <f800 0 0 7>;
250 interrupt-map = <
251
252 /* IDSEL 0x11 */
253 8800 0 0 1 &ipic 14 8
254 8800 0 0 2 &ipic 15 8
255 8800 0 0 3 &ipic 16 8
256 8800 0 0 4 &ipic 17 8
257
258 /* IDSEL 0x12 */
259 9000 0 0 1 &ipic 16 8
260 9000 0 0 2 &ipic 17 8
261 9000 0 0 3 &ipic 14 8
262 9000 0 0 4 &ipic 15 8
263
264 /* IDSEL 0x13 */
265 9800 0 0 1 &ipic 17 8
266 9800 0 0 2 &ipic 14 8
267 9800 0 0 3 &ipic 15 8
268 9800 0 0 4 &ipic 16 8
269
270 /* IDSEL 0x15 */
271 a800 0 0 1 &ipic 14 8
272 a800 0 0 2 &ipic 15 8
273 a800 0 0 3 &ipic 16 8
274 a800 0 0 4 &ipic 17 8
275
276 /* IDSEL 0x16 */
277 b000 0 0 1 &ipic 17 8
278 b000 0 0 2 &ipic 14 8
279 b000 0 0 3 &ipic 15 8
280 b000 0 0 4 &ipic 16 8
281
282 /* IDSEL 0x17 */
283 b800 0 0 1 &ipic 16 8
284 b800 0 0 2 &ipic 17 8
285 b800 0 0 3 &ipic 14 8
286 b800 0 0 4 &ipic 15 8
287
288 /* IDSEL 0x18 */
289 c000 0 0 1 &ipic 15 8
290 c000 0 0 2 &ipic 16 8
291 c000 0 0 3 &ipic 17 8
292 c000 0 0 4 &ipic 14 8>;
293 interrupt-parent = < &ipic >;
294 interrupts = <42 8>;
295 bus-range = <0 0>;
296 ranges = <02000000 0 b0000000 b0000000 0 10000000
297 42000000 0 a0000000 a0000000 0 10000000
298 01000000 0 00000000 e2100000 0 00100000>;
299 clock-frequency = <3f940aa>;
300 #interrupt-cells = <1>;
301 #size-cells = <2>;
302 #address-cells = <3>;
303 reg = <8600 100>;
304 compatible = "fsl,mpc8349-pci";
305 device_type = "pci";
306 };
307
308 /* May need to remove if on a part without crypto engine */ 188 /* May need to remove if on a part without crypto engine */
309 crypto@30000 { 189 crypto@30000 {
310 device_type = "crypto"; 190 device_type = "crypto";
@@ -332,8 +212,127 @@
332 #address-cells = <0>; 212 #address-cells = <0>;
333 #interrupt-cells = <2>; 213 #interrupt-cells = <2>;
334 reg = <700 100>; 214 reg = <700 100>;
335 built-in;
336 device_type = "ipic"; 215 device_type = "ipic";
337 }; 216 };
338 }; 217 };
218
219 pci@e0008500 {
220 interrupt-map-mask = <f800 0 0 7>;
221 interrupt-map = <
222
223 /* IDSEL 0x11 */
224 8800 0 0 1 &ipic 14 8
225 8800 0 0 2 &ipic 15 8
226 8800 0 0 3 &ipic 16 8
227 8800 0 0 4 &ipic 17 8
228
229 /* IDSEL 0x12 */
230 9000 0 0 1 &ipic 16 8
231 9000 0 0 2 &ipic 17 8
232 9000 0 0 3 &ipic 14 8
233 9000 0 0 4 &ipic 15 8
234
235 /* IDSEL 0x13 */
236 9800 0 0 1 &ipic 17 8
237 9800 0 0 2 &ipic 14 8
238 9800 0 0 3 &ipic 15 8
239 9800 0 0 4 &ipic 16 8
240
241 /* IDSEL 0x15 */
242 a800 0 0 1 &ipic 14 8
243 a800 0 0 2 &ipic 15 8
244 a800 0 0 3 &ipic 16 8
245 a800 0 0 4 &ipic 17 8
246
247 /* IDSEL 0x16 */
248 b000 0 0 1 &ipic 17 8
249 b000 0 0 2 &ipic 14 8
250 b000 0 0 3 &ipic 15 8
251 b000 0 0 4 &ipic 16 8
252
253 /* IDSEL 0x17 */
254 b800 0 0 1 &ipic 16 8
255 b800 0 0 2 &ipic 17 8
256 b800 0 0 3 &ipic 14 8
257 b800 0 0 4 &ipic 15 8
258
259 /* IDSEL 0x18 */
260 c000 0 0 1 &ipic 15 8
261 c000 0 0 2 &ipic 16 8
262 c000 0 0 3 &ipic 17 8
263 c000 0 0 4 &ipic 14 8>;
264 interrupt-parent = < &ipic >;
265 interrupts = <42 8>;
266 bus-range = <0 0>;
267 ranges = <02000000 0 90000000 90000000 0 10000000
268 42000000 0 80000000 80000000 0 10000000
269 01000000 0 00000000 e2000000 0 00100000>;
270 clock-frequency = <3f940aa>;
271 #interrupt-cells = <1>;
272 #size-cells = <2>;
273 #address-cells = <3>;
274 reg = <e0008500 100>;
275 compatible = "fsl,mpc8349-pci";
276 device_type = "pci";
277 };
278
279 pci@e0008600 {
280 interrupt-map-mask = <f800 0 0 7>;
281 interrupt-map = <
282
283 /* IDSEL 0x11 */
284 8800 0 0 1 &ipic 14 8
285 8800 0 0 2 &ipic 15 8
286 8800 0 0 3 &ipic 16 8
287 8800 0 0 4 &ipic 17 8
288
289 /* IDSEL 0x12 */
290 9000 0 0 1 &ipic 16 8
291 9000 0 0 2 &ipic 17 8
292 9000 0 0 3 &ipic 14 8
293 9000 0 0 4 &ipic 15 8
294
295 /* IDSEL 0x13 */
296 9800 0 0 1 &ipic 17 8
297 9800 0 0 2 &ipic 14 8
298 9800 0 0 3 &ipic 15 8
299 9800 0 0 4 &ipic 16 8
300
301 /* IDSEL 0x15 */
302 a800 0 0 1 &ipic 14 8
303 a800 0 0 2 &ipic 15 8
304 a800 0 0 3 &ipic 16 8
305 a800 0 0 4 &ipic 17 8
306
307 /* IDSEL 0x16 */
308 b000 0 0 1 &ipic 17 8
309 b000 0 0 2 &ipic 14 8
310 b000 0 0 3 &ipic 15 8
311 b000 0 0 4 &ipic 16 8
312
313 /* IDSEL 0x17 */
314 b800 0 0 1 &ipic 16 8
315 b800 0 0 2 &ipic 17 8
316 b800 0 0 3 &ipic 14 8
317 b800 0 0 4 &ipic 15 8
318
319 /* IDSEL 0x18 */
320 c000 0 0 1 &ipic 15 8
321 c000 0 0 2 &ipic 16 8
322 c000 0 0 3 &ipic 17 8
323 c000 0 0 4 &ipic 14 8>;
324 interrupt-parent = < &ipic >;
325 interrupts = <42 8>;
326 bus-range = <0 0>;
327 ranges = <02000000 0 b0000000 b0000000 0 10000000
328 42000000 0 a0000000 a0000000 0 10000000
329 01000000 0 00000000 e2100000 0 00100000>;
330 clock-frequency = <3f940aa>;
331 #interrupt-cells = <1>;
332 #size-cells = <2>;
333 #address-cells = <3>;
334 reg = <e0008600 100>;
335 compatible = "fsl,mpc8349-pci";
336 device_type = "pci";
337 };
339}; 338};
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index e3f7c1282068..fbd1573c348b 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -34,7 +34,6 @@
34 timebase-frequency = <3EF1480>; 34 timebase-frequency = <3EF1480>;
35 bus-frequency = <FBC5200>; 35 bus-frequency = <FBC5200>;
36 clock-frequency = <1F78A400>; 36 clock-frequency = <1F78A400>;
37 32-bit;
38 }; 37 };
39 }; 38 };
40 39
@@ -51,7 +50,6 @@
51 soc8360@e0000000 { 50 soc8360@e0000000 {
52 #address-cells = <1>; 51 #address-cells = <1>;
53 #size-cells = <1>; 52 #size-cells = <1>;
54 #interrupt-cells = <2>;
55 device_type = "soc"; 53 device_type = "soc";
56 ranges = <0 e0000000 00100000>; 54 ranges = <0 e0000000 00100000>;
57 reg = <e0000000 00000200>; 55 reg = <e0000000 00000200>;
@@ -113,72 +111,11 @@
113 descriptor-types-mask = <01010ebf>; 111 descriptor-types-mask = <01010ebf>;
114 }; 112 };
115 113
116 pci@8500 {
117 interrupt-map-mask = <f800 0 0 7>;
118 interrupt-map = <
119
120 /* IDSEL 0x11 AD17 */
121 8800 0 0 1 &ipic 14 8
122 8800 0 0 2 &ipic 15 8
123 8800 0 0 3 &ipic 16 8
124 8800 0 0 4 &ipic 17 8
125
126 /* IDSEL 0x12 AD18 */
127 9000 0 0 1 &ipic 16 8
128 9000 0 0 2 &ipic 17 8
129 9000 0 0 3 &ipic 14 8
130 9000 0 0 4 &ipic 15 8
131
132 /* IDSEL 0x13 AD19 */
133 9800 0 0 1 &ipic 17 8
134 9800 0 0 2 &ipic 14 8
135 9800 0 0 3 &ipic 15 8
136 9800 0 0 4 &ipic 16 8
137
138 /* IDSEL 0x15 AD21*/
139 a800 0 0 1 &ipic 14 8
140 a800 0 0 2 &ipic 15 8
141 a800 0 0 3 &ipic 16 8
142 a800 0 0 4 &ipic 17 8
143
144 /* IDSEL 0x16 AD22*/
145 b000 0 0 1 &ipic 17 8
146 b000 0 0 2 &ipic 14 8
147 b000 0 0 3 &ipic 15 8
148 b000 0 0 4 &ipic 16 8
149
150 /* IDSEL 0x17 AD23*/
151 b800 0 0 1 &ipic 16 8
152 b800 0 0 2 &ipic 17 8
153 b800 0 0 3 &ipic 14 8
154 b800 0 0 4 &ipic 15 8
155
156 /* IDSEL 0x18 AD24*/
157 c000 0 0 1 &ipic 15 8
158 c000 0 0 2 &ipic 16 8
159 c000 0 0 3 &ipic 17 8
160 c000 0 0 4 &ipic 14 8>;
161 interrupt-parent = < &ipic >;
162 interrupts = <42 8>;
163 bus-range = <0 0>;
164 ranges = <02000000 0 a0000000 a0000000 0 10000000
165 42000000 0 80000000 80000000 0 10000000
166 01000000 0 00000000 e2000000 0 00100000>;
167 clock-frequency = <3f940aa>;
168 #interrupt-cells = <1>;
169 #size-cells = <2>;
170 #address-cells = <3>;
171 reg = <8500 100>;
172 compatible = "fsl,mpc8349-pci";
173 device_type = "pci";
174 };
175
176 ipic: pic@700 { 114 ipic: pic@700 {
177 interrupt-controller; 115 interrupt-controller;
178 #address-cells = <0>; 116 #address-cells = <0>;
179 #interrupt-cells = <2>; 117 #interrupt-cells = <2>;
180 reg = <700 100>; 118 reg = <700 100>;
181 built-in;
182 device_type = "ipic"; 119 device_type = "ipic";
183 }; 120 };
184 121
@@ -364,11 +301,69 @@
364 #address-cells = <0>; 301 #address-cells = <0>;
365 #interrupt-cells = <1>; 302 #interrupt-cells = <1>;
366 reg = <80 80>; 303 reg = <80 80>;
367 built-in;
368 big-endian; 304 big-endian;
369 interrupts = <20 8 21 8>; //high:32 low:33 305 interrupts = <20 8 21 8>; //high:32 low:33
370 interrupt-parent = < &ipic >; 306 interrupt-parent = < &ipic >;
371 }; 307 };
308 };
372 309
310 pci@e0008500 {
311 interrupt-map-mask = <f800 0 0 7>;
312 interrupt-map = <
313
314 /* IDSEL 0x11 AD17 */
315 8800 0 0 1 &ipic 14 8
316 8800 0 0 2 &ipic 15 8
317 8800 0 0 3 &ipic 16 8
318 8800 0 0 4 &ipic 17 8
319
320 /* IDSEL 0x12 AD18 */
321 9000 0 0 1 &ipic 16 8
322 9000 0 0 2 &ipic 17 8
323 9000 0 0 3 &ipic 14 8
324 9000 0 0 4 &ipic 15 8
325
326 /* IDSEL 0x13 AD19 */
327 9800 0 0 1 &ipic 17 8
328 9800 0 0 2 &ipic 14 8
329 9800 0 0 3 &ipic 15 8
330 9800 0 0 4 &ipic 16 8
331
332 /* IDSEL 0x15 AD21*/
333 a800 0 0 1 &ipic 14 8
334 a800 0 0 2 &ipic 15 8
335 a800 0 0 3 &ipic 16 8
336 a800 0 0 4 &ipic 17 8
337
338 /* IDSEL 0x16 AD22*/
339 b000 0 0 1 &ipic 17 8
340 b000 0 0 2 &ipic 14 8
341 b000 0 0 3 &ipic 15 8
342 b000 0 0 4 &ipic 16 8
343
344 /* IDSEL 0x17 AD23*/
345 b800 0 0 1 &ipic 16 8
346 b800 0 0 2 &ipic 17 8
347 b800 0 0 3 &ipic 14 8
348 b800 0 0 4 &ipic 15 8
349
350 /* IDSEL 0x18 AD24*/
351 c000 0 0 1 &ipic 15 8
352 c000 0 0 2 &ipic 16 8
353 c000 0 0 3 &ipic 17 8
354 c000 0 0 4 &ipic 14 8>;
355 interrupt-parent = < &ipic >;
356 interrupts = <42 8>;
357 bus-range = <0 0>;
358 ranges = <02000000 0 a0000000 a0000000 0 10000000
359 42000000 0 80000000 80000000 0 10000000
360 01000000 0 00000000 e2000000 0 00100000>;
361 clock-frequency = <3f940aa>;
362 #interrupt-cells = <1>;
363 #size-cells = <2>;
364 #address-cells = <3>;
365 reg = <e0008500 100>;
366 compatible = "fsl,mpc8349-pci";
367 device_type = "pci";
373 }; 368 };
374}; 369};
diff --git a/arch/powerpc/boot/dts/mpc8540ads.dts b/arch/powerpc/boot/dts/mpc8540ads.dts
index fc8dff9f6201..6442a717ec3b 100644
--- a/arch/powerpc/boot/dts/mpc8540ads.dts
+++ b/arch/powerpc/boot/dts/mpc8540ads.dts
@@ -30,7 +30,6 @@
30 timebase-frequency = <0>; // 33 MHz, from uboot 30 timebase-frequency = <0>; // 33 MHz, from uboot
31 bus-frequency = <0>; // 166 MHz 31 bus-frequency = <0>; // 166 MHz
32 clock-frequency = <0>; // 825 MHz, from uboot 32 clock-frequency = <0>; // 825 MHz, from uboot
33 32-bit;
34 }; 33 };
35 }; 34 };
36 35
@@ -42,7 +41,6 @@
42 soc8540@e0000000 { 41 soc8540@e0000000 {
43 #address-cells = <1>; 42 #address-cells = <1>;
44 #size-cells = <1>; 43 #size-cells = <1>;
45 #interrupt-cells = <2>;
46 device_type = "soc"; 44 device_type = "soc";
47 ranges = <0 e0000000 00100000>; 45 ranges = <0 e0000000 00100000>;
48 reg = <e0000000 00100000>; // CCSRBAR 1M 46 reg = <e0000000 00100000>; // CCSRBAR 1M
@@ -173,105 +171,104 @@
173 interrupts = <2a 2>; 171 interrupts = <2a 2>;
174 interrupt-parent = <&mpic>; 172 interrupt-parent = <&mpic>;
175 }; 173 };
176 pci@8000 { 174 mpic: pic@40000 {
177 interrupt-map-mask = <f800 0 0 7>; 175 clock-frequency = <0>;
178 interrupt-map = < 176 interrupt-controller;
177 #address-cells = <0>;
178 #interrupt-cells = <2>;
179 reg = <40000 40000>;
180 compatible = "chrp,open-pic";
181 device_type = "open-pic";
182 big-endian;
183 };
184 };
179 185
180 /* IDSEL 0x02 */ 186 pci@e0008000 {
181 1000 0 0 1 &mpic 1 1 187 interrupt-map-mask = <f800 0 0 7>;
182 1000 0 0 2 &mpic 2 1 188 interrupt-map = <
183 1000 0 0 3 &mpic 3 1
184 1000 0 0 4 &mpic 4 1
185 189
186 /* IDSEL 0x03 */ 190 /* IDSEL 0x02 */
187 1800 0 0 1 &mpic 4 1 191 1000 0 0 1 &mpic 1 1
188 1800 0 0 2 &mpic 1 1 192 1000 0 0 2 &mpic 2 1
189 1800 0 0 3 &mpic 2 1 193 1000 0 0 3 &mpic 3 1
190 1800 0 0 4 &mpic 3 1 194 1000 0 0 4 &mpic 4 1
191 195
192 /* IDSEL 0x04 */ 196 /* IDSEL 0x03 */
193 2000 0 0 1 &mpic 3 1 197 1800 0 0 1 &mpic 4 1
194 2000 0 0 2 &mpic 4 1 198 1800 0 0 2 &mpic 1 1
195 2000 0 0 3 &mpic 1 1 199 1800 0 0 3 &mpic 2 1
196 2000 0 0 4 &mpic 2 1 200 1800 0 0 4 &mpic 3 1
197 201
198 /* IDSEL 0x05 */ 202 /* IDSEL 0x04 */
199 2800 0 0 1 &mpic 2 1 203 2000 0 0 1 &mpic 3 1
200 2800 0 0 2 &mpic 3 1 204 2000 0 0 2 &mpic 4 1
201 2800 0 0 3 &mpic 4 1 205 2000 0 0 3 &mpic 1 1
202 2800 0 0 4 &mpic 1 1 206 2000 0 0 4 &mpic 2 1
203 207
204 /* IDSEL 0x0c */ 208 /* IDSEL 0x05 */
205 6000 0 0 1 &mpic 1 1 209 2800 0 0 1 &mpic 2 1
206 6000 0 0 2 &mpic 2 1 210 2800 0 0 2 &mpic 3 1
207 6000 0 0 3 &mpic 3 1 211 2800 0 0 3 &mpic 4 1
208 6000 0 0 4 &mpic 4 1 212 2800 0 0 4 &mpic 1 1
209 213
210 /* IDSEL 0x0d */ 214 /* IDSEL 0x0c */
211 6800 0 0 1 &mpic 4 1 215 6000 0 0 1 &mpic 1 1
212 6800 0 0 2 &mpic 1 1 216 6000 0 0 2 &mpic 2 1
213 6800 0 0 3 &mpic 2 1 217 6000 0 0 3 &mpic 3 1
214 6800 0 0 4 &mpic 3 1 218 6000 0 0 4 &mpic 4 1
215 219
216 /* IDSEL 0x0e */ 220 /* IDSEL 0x0d */
217 7000 0 0 1 &mpic 3 1 221 6800 0 0 1 &mpic 4 1
218 7000 0 0 2 &mpic 4 1 222 6800 0 0 2 &mpic 1 1
219 7000 0 0 3 &mpic 1 1 223 6800 0 0 3 &mpic 2 1
220 7000 0 0 4 &mpic 2 1 224 6800 0 0 4 &mpic 3 1
221 225
222 /* IDSEL 0x0f */ 226 /* IDSEL 0x0e */
223 7800 0 0 1 &mpic 2 1 227 7000 0 0 1 &mpic 3 1
224 7800 0 0 2 &mpic 3 1 228 7000 0 0 2 &mpic 4 1
225 7800 0 0 3 &mpic 4 1 229 7000 0 0 3 &mpic 1 1
226 7800 0 0 4 &mpic 1 1 230 7000 0 0 4 &mpic 2 1
227 231
228 /* IDSEL 0x12 */ 232 /* IDSEL 0x0f */
229 9000 0 0 1 &mpic 1 1 233 7800 0 0 1 &mpic 2 1
230 9000 0 0 2 &mpic 2 1 234 7800 0 0 2 &mpic 3 1
231 9000 0 0 3 &mpic 3 1 235 7800 0 0 3 &mpic 4 1
232 9000 0 0 4 &mpic 4 1 236 7800 0 0 4 &mpic 1 1
233 237
234 /* IDSEL 0x13 */ 238 /* IDSEL 0x12 */
235 9800 0 0 1 &mpic 4 1 239 9000 0 0 1 &mpic 1 1
236 9800 0 0 2 &mpic 1 1 240 9000 0 0 2 &mpic 2 1
237 9800 0 0 3 &mpic 2 1 241 9000 0 0 3 &mpic 3 1
238 9800 0 0 4 &mpic 3 1 242 9000 0 0 4 &mpic 4 1
239 243
240 /* IDSEL 0x14 */ 244 /* IDSEL 0x13 */
241 a000 0 0 1 &mpic 3 1 245 9800 0 0 1 &mpic 4 1
242 a000 0 0 2 &mpic 4 1 246 9800 0 0 2 &mpic 1 1
243 a000 0 0 3 &mpic 1 1 247 9800 0 0 3 &mpic 2 1
244 a000 0 0 4 &mpic 2 1 248 9800 0 0 4 &mpic 3 1
245 249
246 /* IDSEL 0x15 */ 250 /* IDSEL 0x14 */
247 a800 0 0 1 &mpic 2 1 251 a000 0 0 1 &mpic 3 1
248 a800 0 0 2 &mpic 3 1 252 a000 0 0 2 &mpic 4 1
249 a800 0 0 3 &mpic 4 1 253 a000 0 0 3 &mpic 1 1
250 a800 0 0 4 &mpic 1 1>; 254 a000 0 0 4 &mpic 2 1
251 interrupt-parent = <&mpic>;
252 interrupts = <18 2>;
253 bus-range = <0 0>;
254 ranges = <02000000 0 80000000 80000000 0 20000000
255 01000000 0 00000000 e2000000 0 00100000>;
256 clock-frequency = <3f940aa>;
257 #interrupt-cells = <1>;
258 #size-cells = <2>;
259 #address-cells = <3>;
260 reg = <8000 1000>;
261 compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
262 device_type = "pci";
263 };
264 255
265 mpic: pic@40000 { 256 /* IDSEL 0x15 */
266 clock-frequency = <0>; 257 a800 0 0 1 &mpic 2 1
267 interrupt-controller; 258 a800 0 0 2 &mpic 3 1
268 #address-cells = <0>; 259 a800 0 0 3 &mpic 4 1
269 #interrupt-cells = <2>; 260 a800 0 0 4 &mpic 1 1>;
270 reg = <40000 40000>; 261 interrupt-parent = <&mpic>;
271 built-in; 262 interrupts = <18 2>;
272 compatible = "chrp,open-pic"; 263 bus-range = <0 0>;
273 device_type = "open-pic"; 264 ranges = <02000000 0 80000000 80000000 0 20000000
274 big-endian; 265 01000000 0 00000000 e2000000 0 00100000>;
275 }; 266 clock-frequency = <3f940aa>;
267 #interrupt-cells = <1>;
268 #size-cells = <2>;
269 #address-cells = <3>;
270 reg = <e0008000 1000>;
271 compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
272 device_type = "pci";
276 }; 273 };
277}; 274};
diff --git a/arch/powerpc/boot/dts/mpc8541cds.dts b/arch/powerpc/boot/dts/mpc8541cds.dts
index fb0b647f8c2a..6633e07d9f4d 100644
--- a/arch/powerpc/boot/dts/mpc8541cds.dts
+++ b/arch/powerpc/boot/dts/mpc8541cds.dts
@@ -30,7 +30,6 @@
30 timebase-frequency = <0>; // 33 MHz, from uboot 30 timebase-frequency = <0>; // 33 MHz, from uboot
31 bus-frequency = <0>; // 166 MHz 31 bus-frequency = <0>; // 166 MHz
32 clock-frequency = <0>; // 825 MHz, from uboot 32 clock-frequency = <0>; // 825 MHz, from uboot
33 32-bit;
34 }; 33 };
35 }; 34 };
36 35
@@ -42,10 +41,9 @@
42 soc8541@e0000000 { 41 soc8541@e0000000 {
43 #address-cells = <1>; 42 #address-cells = <1>;
44 #size-cells = <1>; 43 #size-cells = <1>;
45 #interrupt-cells = <2>;
46 device_type = "soc"; 44 device_type = "soc";
47 ranges = <0 e0000000 00100000>; 45 ranges = <0 e0000000 00100000>;
48 reg = <e0000000 00100000>; // CCSRBAR 1M 46 reg = <e0000000 00001000>; // CCSRBAR 1M
49 bus-frequency = <0>; 47 bus-frequency = <0>;
50 48
51 memory-controller@2000 { 49 memory-controller@2000 {
@@ -137,113 +135,109 @@
137 interrupt-parent = <&mpic>; 135 interrupt-parent = <&mpic>;
138 }; 136 };
139 137
140 pci1: pci@8000 {
141 interrupt-map-mask = <1f800 0 0 7>;
142 interrupt-map = <
143
144 /* IDSEL 0x10 */
145 08000 0 0 1 &mpic 0 1
146 08000 0 0 2 &mpic 1 1
147 08000 0 0 3 &mpic 2 1
148 08000 0 0 4 &mpic 3 1
149
150 /* IDSEL 0x11 */
151 08800 0 0 1 &mpic 0 1
152 08800 0 0 2 &mpic 1 1
153 08800 0 0 3 &mpic 2 1
154 08800 0 0 4 &mpic 3 1
155
156 /* IDSEL 0x12 (Slot 1) */
157 09000 0 0 1 &mpic 0 1
158 09000 0 0 2 &mpic 1 1
159 09000 0 0 3 &mpic 2 1
160 09000 0 0 4 &mpic 3 1
161
162 /* IDSEL 0x13 (Slot 2) */
163 09800 0 0 1 &mpic 1 1
164 09800 0 0 2 &mpic 2 1
165 09800 0 0 3 &mpic 3 1
166 09800 0 0 4 &mpic 0 1
167
168 /* IDSEL 0x14 (Slot 3) */
169 0a000 0 0 1 &mpic 2 1
170 0a000 0 0 2 &mpic 3 1
171 0a000 0 0 3 &mpic 0 1
172 0a000 0 0 4 &mpic 1 1
173
174 /* IDSEL 0x15 (Slot 4) */
175 0a800 0 0 1 &mpic 3 1
176 0a800 0 0 2 &mpic 0 1
177 0a800 0 0 3 &mpic 1 1
178 0a800 0 0 4 &mpic 2 1
179
180 /* Bus 1 (Tundra Bridge) */
181 /* IDSEL 0x12 (ISA bridge) */
182 19000 0 0 1 &mpic 0 1
183 19000 0 0 2 &mpic 1 1
184 19000 0 0 3 &mpic 2 1
185 19000 0 0 4 &mpic 3 1>;
186 interrupt-parent = <&mpic>;
187 interrupts = <18 2>;
188 bus-range = <0 0>;
189 ranges = <02000000 0 80000000 80000000 0 20000000
190 01000000 0 00000000 e2000000 0 00100000>;
191 clock-frequency = <3f940aa>;
192 #interrupt-cells = <1>;
193 #size-cells = <2>;
194 #address-cells = <3>;
195 reg = <8000 1000>;
196 compatible = "fsl,mpc8540-pci";
197 device_type = "pci";
198
199 i8259@19000 {
200 clock-frequency = <0>;
201 interrupt-controller;
202 device_type = "interrupt-controller";
203 reg = <19000 0 0 0 1>;
204 #address-cells = <0>;
205 #interrupt-cells = <2>;
206 built-in;
207 compatible = "chrp,iic";
208 big-endian;
209 interrupts = <1>;
210 interrupt-parent = <&pci1>;
211 };
212 };
213
214 pci@9000 {
215 interrupt-map-mask = <f800 0 0 7>;
216 interrupt-map = <
217
218 /* IDSEL 0x15 */
219 a800 0 0 1 &mpic b 1
220 a800 0 0 2 &mpic b 1
221 a800 0 0 3 &mpic b 1
222 a800 0 0 4 &mpic b 1>;
223 interrupt-parent = <&mpic>;
224 interrupts = <19 2>;
225 bus-range = <0 0>;
226 ranges = <02000000 0 a0000000 a0000000 0 20000000
227 01000000 0 00000000 e3000000 0 00100000>;
228 clock-frequency = <3f940aa>;
229 #interrupt-cells = <1>;
230 #size-cells = <2>;
231 #address-cells = <3>;
232 reg = <9000 1000>;
233 compatible = "fsl,mpc8540-pci";
234 device_type = "pci";
235 };
236
237 mpic: pic@40000 { 138 mpic: pic@40000 {
238 clock-frequency = <0>; 139 clock-frequency = <0>;
239 interrupt-controller; 140 interrupt-controller;
240 #address-cells = <0>; 141 #address-cells = <0>;
241 #interrupt-cells = <2>; 142 #interrupt-cells = <2>;
242 reg = <40000 40000>; 143 reg = <40000 40000>;
243 built-in;
244 compatible = "chrp,open-pic"; 144 compatible = "chrp,open-pic";
245 device_type = "open-pic"; 145 device_type = "open-pic";
246 big-endian; 146 big-endian;
247 }; 147 };
248 }; 148 };
149
150 pci1: pci@e0008000 {
151 interrupt-map-mask = <1f800 0 0 7>;
152 interrupt-map = <
153
154 /* IDSEL 0x10 */
155 08000 0 0 1 &mpic 0 1
156 08000 0 0 2 &mpic 1 1
157 08000 0 0 3 &mpic 2 1
158 08000 0 0 4 &mpic 3 1
159
160 /* IDSEL 0x11 */
161 08800 0 0 1 &mpic 0 1
162 08800 0 0 2 &mpic 1 1
163 08800 0 0 3 &mpic 2 1
164 08800 0 0 4 &mpic 3 1
165
166 /* IDSEL 0x12 (Slot 1) */
167 09000 0 0 1 &mpic 0 1
168 09000 0 0 2 &mpic 1 1
169 09000 0 0 3 &mpic 2 1
170 09000 0 0 4 &mpic 3 1
171
172 /* IDSEL 0x13 (Slot 2) */
173 09800 0 0 1 &mpic 1 1
174 09800 0 0 2 &mpic 2 1
175 09800 0 0 3 &mpic 3 1
176 09800 0 0 4 &mpic 0 1
177
178 /* IDSEL 0x14 (Slot 3) */
179 0a000 0 0 1 &mpic 2 1
180 0a000 0 0 2 &mpic 3 1
181 0a000 0 0 3 &mpic 0 1
182 0a000 0 0 4 &mpic 1 1
183
184 /* IDSEL 0x15 (Slot 4) */
185 0a800 0 0 1 &mpic 3 1
186 0a800 0 0 2 &mpic 0 1
187 0a800 0 0 3 &mpic 1 1
188 0a800 0 0 4 &mpic 2 1
189
190 /* Bus 1 (Tundra Bridge) */
191 /* IDSEL 0x12 (ISA bridge) */
192 19000 0 0 1 &mpic 0 1
193 19000 0 0 2 &mpic 1 1
194 19000 0 0 3 &mpic 2 1
195 19000 0 0 4 &mpic 3 1>;
196 interrupt-parent = <&mpic>;
197 interrupts = <18 2>;
198 bus-range = <0 0>;
199 ranges = <02000000 0 80000000 80000000 0 20000000
200 01000000 0 00000000 e2000000 0 00100000>;
201 clock-frequency = <3f940aa>;
202 #interrupt-cells = <1>;
203 #size-cells = <2>;
204 #address-cells = <3>;
205 reg = <e0008000 1000>;
206 compatible = "fsl,mpc8540-pci";
207 device_type = "pci";
208
209 i8259@19000 {
210 interrupt-controller;
211 device_type = "interrupt-controller";
212 reg = <19000 0 0 0 1>;
213 #address-cells = <0>;
214 #interrupt-cells = <2>;
215 compatible = "chrp,iic";
216 interrupts = <1>;
217 interrupt-parent = <&pci1>;
218 };
219 };
220
221 pci@e0009000 {
222 interrupt-map-mask = <f800 0 0 7>;
223 interrupt-map = <
224
225 /* IDSEL 0x15 */
226 a800 0 0 1 &mpic b 1
227 a800 0 0 2 &mpic b 1
228 a800 0 0 3 &mpic b 1
229 a800 0 0 4 &mpic b 1>;
230 interrupt-parent = <&mpic>;
231 interrupts = <19 2>;
232 bus-range = <0 0>;
233 ranges = <02000000 0 a0000000 a0000000 0 20000000
234 01000000 0 00000000 e3000000 0 00100000>;
235 clock-frequency = <3f940aa>;
236 #interrupt-cells = <1>;
237 #size-cells = <2>;
238 #address-cells = <3>;
239 reg = <e0009000 1000>;
240 compatible = "fsl,mpc8540-pci";
241 device_type = "pci";
242 };
249}; 243};
diff --git a/arch/powerpc/boot/dts/mpc8544ds.dts b/arch/powerpc/boot/dts/mpc8544ds.dts
index 3e79bf0a3159..3f9d15cf13e0 100644
--- a/arch/powerpc/boot/dts/mpc8544ds.dts
+++ b/arch/powerpc/boot/dts/mpc8544ds.dts
@@ -30,7 +30,6 @@
30 timebase-frequency = <0>; 30 timebase-frequency = <0>;
31 bus-frequency = <0>; 31 bus-frequency = <0>;
32 clock-frequency = <0>; 32 clock-frequency = <0>;
33 32-bit;
34 }; 33 };
35 }; 34 };
36 35
@@ -42,19 +41,9 @@
42 soc8544@e0000000 { 41 soc8544@e0000000 {
43 #address-cells = <1>; 42 #address-cells = <1>;
44 #size-cells = <1>; 43 #size-cells = <1>;
45 #interrupt-cells = <2>;
46 device_type = "soc"; 44 device_type = "soc";
47 45
48 46 ranges = <00000000 e0000000 00100000>;
49 ranges = <00001000 e0001000 000ff000
50 80000000 80000000 20000000
51 a0000000 a0000000 10000000
52 b0000000 b0000000 00100000
53 c0000000 c0000000 20000000
54 b0100000 b0100000 00100000
55 e1000000 e1000000 00010000
56 e1010000 e1010000 00010000
57 e1020000 e1020000 00010000>;
58 reg = <e0000000 00001000>; // CCSRBAR 1M 47 reg = <e0000000 00001000>; // CCSRBAR 1M
59 bus-frequency = <0>; // Filled out by uboot. 48 bus-frequency = <0>; // Filled out by uboot.
60 49
@@ -149,115 +138,173 @@
149 interrupt-parent = <&mpic>; 138 interrupt-parent = <&mpic>;
150 }; 139 };
151 140
152 pci@8000 { 141 global-utilities@e0000 { //global utilities block
153 compatible = "fsl,mpc8540-pci"; 142 compatible = "fsl,mpc8548-guts";
154 device_type = "pci"; 143 reg = <e0000 1000>;
155 interrupt-map-mask = <f800 0 0 7>; 144 fsl,has-rstcr;
156 interrupt-map = < 145 };
157
158 /* IDSEL 0x11 J17 Slot 1 */
159 8800 0 0 1 &mpic 2 1
160 8800 0 0 2 &mpic 3 1
161 8800 0 0 3 &mpic 4 1
162 8800 0 0 4 &mpic 1 1
163 146
164 /* IDSEL 0x12 J16 Slot 2 */ 147 mpic: pic@40000 {
148 clock-frequency = <0>;
149 interrupt-controller;
150 #address-cells = <0>;
151 #interrupt-cells = <2>;
152 reg = <40000 40000>;
153 compatible = "chrp,open-pic";
154 device_type = "open-pic";
155 big-endian;
156 };
157 };
165 158
166 9000 0 0 1 &mpic 3 1 159 pci@e0008000 {
167 9000 0 0 2 &mpic 4 1 160 compatible = "fsl,mpc8540-pci";
168 9000 0 0 3 &mpic 2 1 161 device_type = "pci";
169 9000 0 0 4 &mpic 1 1>; 162 interrupt-map-mask = <f800 0 0 7>;
163 interrupt-map = <
164
165 /* IDSEL 0x11 J17 Slot 1 */
166 8800 0 0 1 &mpic 2 1
167 8800 0 0 2 &mpic 3 1
168 8800 0 0 3 &mpic 4 1
169 8800 0 0 4 &mpic 1 1
170
171 /* IDSEL 0x12 J16 Slot 2 */
172
173 9000 0 0 1 &mpic 3 1
174 9000 0 0 2 &mpic 4 1
175 9000 0 0 3 &mpic 2 1
176 9000 0 0 4 &mpic 1 1>;
177
178 interrupt-parent = <&mpic>;
179 interrupts = <18 2>;
180 bus-range = <0 ff>;
181 ranges = <02000000 0 c0000000 c0000000 0 20000000
182 01000000 0 00000000 e1000000 0 00010000>;
183 clock-frequency = <3f940aa>;
184 #interrupt-cells = <1>;
185 #size-cells = <2>;
186 #address-cells = <3>;
187 reg = <e0008000 1000>;
188 };
170 189
171 interrupt-parent = <&mpic>; 190 pcie@e0009000 {
172 interrupts = <18 2>; 191 compatible = "fsl,mpc8548-pcie";
173 bus-range = <0 ff>; 192 device_type = "pci";
174 ranges = <02000000 0 c0000000 c0000000 0 20000000 193 #interrupt-cells = <1>;
175 01000000 0 00000000 e1000000 0 00010000>; 194 #size-cells = <2>;
176 clock-frequency = <3f940aa>; 195 #address-cells = <3>;
177 #interrupt-cells = <1>; 196 reg = <e0009000 1000>;
197 bus-range = <0 ff>;
198 ranges = <02000000 0 80000000 80000000 0 20000000
199 01000000 0 00000000 e1010000 0 00010000>;
200 clock-frequency = <1fca055>;
201 interrupt-parent = <&mpic>;
202 interrupts = <1a 2>;
203 interrupt-map-mask = <f800 0 0 7>;
204 interrupt-map = <
205 /* IDSEL 0x0 */
206 0000 0 0 1 &mpic 4 1
207 0000 0 0 2 &mpic 5 1
208 0000 0 0 3 &mpic 6 1
209 0000 0 0 4 &mpic 7 1
210 >;
211 pcie@0 {
212 reg = <0 0 0 0 0>;
178 #size-cells = <2>; 213 #size-cells = <2>;
179 #address-cells = <3>; 214 #address-cells = <3>;
180 reg = <8000 1000>;
181 };
182
183 pcie@9000 {
184 compatible = "fsl,mpc8548-pcie";
185 device_type = "pci"; 215 device_type = "pci";
186 #interrupt-cells = <1>; 216 ranges = <02000000 0 80000000
187 #size-cells = <2>; 217 02000000 0 80000000
188 #address-cells = <3>; 218 0 20000000
189 reg = <9000 1000>; 219
190 bus-range = <0 ff>; 220 01000000 0 00000000
191 ranges = <02000000 0 80000000 80000000 0 20000000 221 01000000 0 00000000
192 01000000 0 00000000 e1010000 0 00010000>; 222 0 00010000>;
193 clock-frequency = <1fca055>;
194 interrupt-parent = <&mpic>;
195 interrupts = <1a 2>;
196 interrupt-map-mask = <f800 0 0 7>;
197 interrupt-map = <
198 /* IDSEL 0x0 */
199 0000 0 0 1 &mpic 4 1
200 0000 0 0 2 &mpic 5 1
201 0000 0 0 3 &mpic 6 1
202 0000 0 0 4 &mpic 7 1
203 >;
204 }; 223 };
224 };
205 225
206 pcie@a000 { 226 pcie@e000a000 {
207 compatible = "fsl,mpc8548-pcie"; 227 compatible = "fsl,mpc8548-pcie";
208 device_type = "pci"; 228 device_type = "pci";
209 #interrupt-cells = <1>; 229 #interrupt-cells = <1>;
230 #size-cells = <2>;
231 #address-cells = <3>;
232 reg = <e000a000 1000>;
233 bus-range = <0 ff>;
234 ranges = <02000000 0 a0000000 a0000000 0 10000000
235 01000000 0 00000000 e1020000 0 00010000>;
236 clock-frequency = <1fca055>;
237 interrupt-parent = <&mpic>;
238 interrupts = <19 2>;
239 interrupt-map-mask = <f800 0 0 7>;
240 interrupt-map = <
241 /* IDSEL 0x0 */
242 0000 0 0 1 &mpic 0 1
243 0000 0 0 2 &mpic 1 1
244 0000 0 0 3 &mpic 2 1
245 0000 0 0 4 &mpic 3 1
246 >;
247 pcie@0 {
248 reg = <0 0 0 0 0>;
210 #size-cells = <2>; 249 #size-cells = <2>;
211 #address-cells = <3>; 250 #address-cells = <3>;
212 reg = <a000 1000>; 251 device_type = "pci";
213 bus-range = <0 ff>; 252 ranges = <02000000 0 a0000000
214 ranges = <02000000 0 a0000000 a0000000 0 10000000 253 02000000 0 a0000000
215 01000000 0 00000000 e1020000 0 00010000>; 254 0 10000000
216 clock-frequency = <1fca055>; 255
217 interrupt-parent = <&mpic>; 256 01000000 0 00000000
218 interrupts = <19 2>; 257 01000000 0 00000000
219 interrupt-map-mask = <f800 0 0 7>; 258 0 00010000>;
220 interrupt-map = <
221 /* IDSEL 0x0 */
222 0000 0 0 1 &mpic 0 1
223 0000 0 0 2 &mpic 1 1
224 0000 0 0 3 &mpic 2 1
225 0000 0 0 4 &mpic 3 1
226 >;
227 }; 259 };
260 };
228 261
229 pcie@b000 { 262 pcie@e000b000 {
230 compatible = "fsl,mpc8548-pcie"; 263 compatible = "fsl,mpc8548-pcie";
231 device_type = "pci"; 264 device_type = "pci";
232 #interrupt-cells = <1>; 265 #interrupt-cells = <1>;
266 #size-cells = <2>;
267 #address-cells = <3>;
268 reg = <e000b000 1000>;
269 bus-range = <0 ff>;
270 ranges = <02000000 0 b0000000 b0000000 0 00100000
271 01000000 0 00000000 b0100000 0 00100000>;
272 clock-frequency = <1fca055>;
273 interrupt-parent = <&mpic>;
274 interrupts = <1b 2>;
275 interrupt-map-mask = <fb00 0 0 0>;
276 interrupt-map = <
277 // IDSEL 0x1c USB
278 e000 0 0 0 &i8259 c 2
279 e100 0 0 0 &i8259 9 2
280 e200 0 0 0 &i8259 a 2
281 e300 0 0 0 &i8259 b 2
282
283 // IDSEL 0x1d Audio
284 e800 0 0 0 &i8259 6 2
285
286 // IDSEL 0x1e Legacy
287 f000 0 0 0 &i8259 7 2
288 f100 0 0 0 &i8259 7 2
289
290 // IDSEL 0x1f IDE/SATA
291 f800 0 0 0 &i8259 e 2
292 f900 0 0 0 &i8259 5 2
293 >;
294
295 pcie@0 {
296 reg = <0 0 0 0 0>;
233 #size-cells = <2>; 297 #size-cells = <2>;
234 #address-cells = <3>; 298 #address-cells = <3>;
235 reg = <b000 1000>; 299 device_type = "pci";
236 bus-range = <0 ff>; 300 ranges = <02000000 0 b0000000
237 ranges = <02000000 0 b0000000 b0000000 0 00100000 301 02000000 0 b0000000
238 01000000 0 00000000 b0100000 0 00100000>; 302 0 00100000
239 clock-frequency = <1fca055>; 303
240 interrupt-parent = <&mpic>; 304 01000000 0 00000000
241 interrupts = <1b 2>; 305 01000000 0 00000000
242 interrupt-map-mask = <fb00 0 0 0>; 306 0 00100000>;
243 interrupt-map = < 307
244 // IDSEL 0x1c USB
245 e000 0 0 0 &i8259 c 2
246 e100 0 0 0 &i8259 9 2
247 e200 0 0 0 &i8259 a 2
248 e300 0 0 0 &i8259 b 2
249
250 // IDSEL 0x1d Audio
251 e800 0 0 0 &i8259 6 2
252
253 // IDSEL 0x1e Legacy
254 f000 0 0 0 &i8259 7 2
255 f100 0 0 0 &i8259 7 2
256
257 // IDSEL 0x1f IDE/SATA
258 f800 0 0 0 &i8259 e 2
259 f900 0 0 0 &i8259 5 2
260 >;
261 uli1575@0 { 308 uli1575@0 {
262 reg = <0 0 0 0 0>; 309 reg = <0 0 0 0 0>;
263 #size-cells = <2>; 310 #size-cells = <2>;
@@ -265,95 +312,63 @@
265 ranges = <02000000 0 b0000000 312 ranges = <02000000 0 b0000000
266 02000000 0 b0000000 313 02000000 0 b0000000
267 0 00100000 314 0 00100000
315
268 01000000 0 00000000 316 01000000 0 00000000
269 01000000 0 00000000 317 01000000 0 00000000
270 0 00100000>; 318 0 00100000>;
271 319 isa@1e {
272 pci_bridge@0 { 320 device_type = "isa";
273 reg = <0 0 0 0 0>; 321 #interrupt-cells = <2>;
274 #size-cells = <2>; 322 #size-cells = <1>;
275 #address-cells = <3>; 323 #address-cells = <2>;
276 ranges = <02000000 0 b0000000 324 reg = <f000 0 0 0 0>;
277 02000000 0 b0000000 325 ranges = <1 0
278 0 00100000 326 01000000 0 0
279 01000000 0 00000000 327 00001000>;
280 01000000 0 00000000 328 interrupt-parent = <&i8259>;
281 0 00100000>; 329
282 330 i8259: interrupt-controller@20 {
283 isa@1e { 331 reg = <1 20 2
284 device_type = "isa"; 332 1 a0 2
333 1 4d0 2>;
334 interrupt-controller;
335 device_type = "interrupt-controller";
336 #address-cells = <0>;
285 #interrupt-cells = <2>; 337 #interrupt-cells = <2>;
286 #size-cells = <1>; 338 compatible = "chrp,iic";
287 #address-cells = <2>; 339 interrupts = <9 2>;
288 reg = <f000 0 0 0 0>; 340 interrupt-parent = <&mpic>;
289 ranges = <1 0 341 };
290 01000000 0 0 342
291 00001000>; 343 i8042@60 {
344 #size-cells = <0>;
345 #address-cells = <1>;
346 reg = <1 60 1 1 64 1>;
347 interrupts = <1 3 c 3>;
292 interrupt-parent = <&i8259>; 348 interrupt-parent = <&i8259>;
293 349
294 i8259: interrupt-controller@20 { 350 keyboard@0 {
295 reg = <1 20 2 351 reg = <0>;
296 1 a0 2 352 compatible = "pnpPNP,303";
297 1 4d0 2>;
298 clock-frequency = <0>;
299 interrupt-controller;
300 device_type = "interrupt-controller";
301 #address-cells = <0>;
302 #interrupt-cells = <2>;
303 built-in;
304 compatible = "chrp,iic";
305 interrupts = <9 2>;
306 interrupt-parent = <&mpic>;
307 }; 353 };
308 354
309 i8042@60 { 355 mouse@1 {
310 #size-cells = <0>; 356 reg = <1>;
311 #address-cells = <1>; 357 compatible = "pnpPNP,f03";
312 reg = <1 60 1 1 64 1>;
313 interrupts = <1 3 c 3>;
314 interrupt-parent = <&i8259>;
315
316 keyboard@0 {
317 reg = <0>;
318 compatible = "pnpPNP,303";
319 };
320
321 mouse@1 {
322 reg = <1>;
323 compatible = "pnpPNP,f03";
324 };
325 }; 358 };
359 };
326 360
327 rtc@70 { 361 rtc@70 {
328 compatible = "pnpPNP,b00"; 362 compatible = "pnpPNP,b00";
329 reg = <1 70 2>; 363 reg = <1 70 2>;
330 }; 364 };
331 365
332 gpio@400 { 366 gpio@400 {
333 reg = <1 400 80>; 367 reg = <1 400 80>;
334 };
335 }; 368 };
336 }; 369 };
337 }; 370 };
338
339 }; 371 };
340 372
341 global-utilities@e0000 { //global utilities block
342 compatible = "fsl,mpc8548-guts";
343 reg = <e0000 1000>;
344 fsl,has-rstcr;
345 };
346
347 mpic: pic@40000 {
348 clock-frequency = <0>;
349 interrupt-controller;
350 #address-cells = <0>;
351 #interrupt-cells = <2>;
352 reg = <40000 40000>;
353 built-in;
354 compatible = "chrp,open-pic";
355 device_type = "open-pic";
356 big-endian;
357 };
358 }; 373 };
359}; 374};
diff --git a/arch/powerpc/boot/dts/mpc8548cds.dts b/arch/powerpc/boot/dts/mpc8548cds.dts
index d215d21fff42..69ca5025d972 100644
--- a/arch/powerpc/boot/dts/mpc8548cds.dts
+++ b/arch/powerpc/boot/dts/mpc8548cds.dts
@@ -30,7 +30,6 @@
30 timebase-frequency = <0>; // 33 MHz, from uboot 30 timebase-frequency = <0>; // 33 MHz, from uboot
31 bus-frequency = <0>; // 166 MHz 31 bus-frequency = <0>; // 166 MHz
32 clock-frequency = <0>; // 825 MHz, from uboot 32 clock-frequency = <0>; // 825 MHz, from uboot
33 32-bit;
34 }; 33 };
35 }; 34 };
36 35
@@ -42,15 +41,8 @@
42 soc8548@e0000000 { 41 soc8548@e0000000 {
43 #address-cells = <1>; 42 #address-cells = <1>;
44 #size-cells = <1>; 43 #size-cells = <1>;
45 #interrupt-cells = <2>;
46 device_type = "soc"; 44 device_type = "soc";
47 ranges = <00001000 e0001000 000ff000 45 ranges = <00000000 e0000000 00100000>;
48 80000000 80000000 10000000
49 e2000000 e2000000 00800000
50 90000000 90000000 10000000
51 e2800000 e2800000 00800000
52 a0000000 a0000000 20000000
53 e3000000 e3000000 01000000>;
54 reg = <e0000000 00001000>; // CCSRBAR 46 reg = <e0000000 00001000>; // CCSRBAR
55 bus-frequency = <0>; 47 bus-frequency = <0>;
56 48
@@ -189,215 +181,225 @@
189 fsl,has-rstcr; 181 fsl,has-rstcr;
190 }; 182 };
191 183
192 pci@8000 { 184 mpic: pic@40000 {
185 clock-frequency = <0>;
186 interrupt-controller;
187 #address-cells = <0>;
188 #interrupt-cells = <2>;
189 reg = <40000 40000>;
190 compatible = "chrp,open-pic";
191 device_type = "open-pic";
192 big-endian;
193 };
194 };
195
196 pci@e0008000 {
197 interrupt-map-mask = <f800 0 0 7>;
198 interrupt-map = <
199 /* IDSEL 0x4 (PCIX Slot 2) */
200 02000 0 0 1 &mpic 0 1
201 02000 0 0 2 &mpic 1 1
202 02000 0 0 3 &mpic 2 1
203 02000 0 0 4 &mpic 3 1
204
205 /* IDSEL 0x5 (PCIX Slot 3) */
206 02800 0 0 1 &mpic 1 1
207 02800 0 0 2 &mpic 2 1
208 02800 0 0 3 &mpic 3 1
209 02800 0 0 4 &mpic 0 1
210
211 /* IDSEL 0x6 (PCIX Slot 4) */
212 03000 0 0 1 &mpic 2 1
213 03000 0 0 2 &mpic 3 1
214 03000 0 0 3 &mpic 0 1
215 03000 0 0 4 &mpic 1 1
216
217 /* IDSEL 0x8 (PCIX Slot 5) */
218 04000 0 0 1 &mpic 0 1
219 04000 0 0 2 &mpic 1 1
220 04000 0 0 3 &mpic 2 1
221 04000 0 0 4 &mpic 3 1
222
223 /* IDSEL 0xC (Tsi310 bridge) */
224 06000 0 0 1 &mpic 0 1
225 06000 0 0 2 &mpic 1 1
226 06000 0 0 3 &mpic 2 1
227 06000 0 0 4 &mpic 3 1
228
229 /* IDSEL 0x14 (Slot 2) */
230 0a000 0 0 1 &mpic 0 1
231 0a000 0 0 2 &mpic 1 1
232 0a000 0 0 3 &mpic 2 1
233 0a000 0 0 4 &mpic 3 1
234
235 /* IDSEL 0x15 (Slot 3) */
236 0a800 0 0 1 &mpic 1 1
237 0a800 0 0 2 &mpic 2 1
238 0a800 0 0 3 &mpic 3 1
239 0a800 0 0 4 &mpic 0 1
240
241 /* IDSEL 0x16 (Slot 4) */
242 0b000 0 0 1 &mpic 2 1
243 0b000 0 0 2 &mpic 3 1
244 0b000 0 0 3 &mpic 0 1
245 0b000 0 0 4 &mpic 1 1
246
247 /* IDSEL 0x18 (Slot 5) */
248 0c000 0 0 1 &mpic 0 1
249 0c000 0 0 2 &mpic 1 1
250 0c000 0 0 3 &mpic 2 1
251 0c000 0 0 4 &mpic 3 1
252
253 /* IDSEL 0x1C (Tsi310 bridge PCI primary) */
254 0E000 0 0 1 &mpic 0 1
255 0E000 0 0 2 &mpic 1 1
256 0E000 0 0 3 &mpic 2 1
257 0E000 0 0 4 &mpic 3 1>;
258
259 interrupt-parent = <&mpic>;
260 interrupts = <18 2>;
261 bus-range = <0 0>;
262 ranges = <02000000 0 80000000 80000000 0 10000000
263 01000000 0 00000000 e2000000 0 00800000>;
264 clock-frequency = <3f940aa>;
265 #interrupt-cells = <1>;
266 #size-cells = <2>;
267 #address-cells = <3>;
268 reg = <e0008000 1000>;
269 compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
270 device_type = "pci";
271
272 pci_bridge@1c {
193 interrupt-map-mask = <f800 0 0 7>; 273 interrupt-map-mask = <f800 0 0 7>;
194 interrupt-map = < 274 interrupt-map = <
195 /* IDSEL 0x4 (PCIX Slot 2) */
196 02000 0 0 1 &mpic 0 1
197 02000 0 0 2 &mpic 1 1
198 02000 0 0 3 &mpic 2 1
199 02000 0 0 4 &mpic 3 1
200
201 /* IDSEL 0x5 (PCIX Slot 3) */
202 02800 0 0 1 &mpic 1 1
203 02800 0 0 2 &mpic 2 1
204 02800 0 0 3 &mpic 3 1
205 02800 0 0 4 &mpic 0 1
206
207 /* IDSEL 0x6 (PCIX Slot 4) */
208 03000 0 0 1 &mpic 2 1
209 03000 0 0 2 &mpic 3 1
210 03000 0 0 3 &mpic 0 1
211 03000 0 0 4 &mpic 1 1
212
213 /* IDSEL 0x8 (PCIX Slot 5) */
214 04000 0 0 1 &mpic 0 1
215 04000 0 0 2 &mpic 1 1
216 04000 0 0 3 &mpic 2 1
217 04000 0 0 4 &mpic 3 1
218
219 /* IDSEL 0xC (Tsi310 bridge) */
220 06000 0 0 1 &mpic 0 1
221 06000 0 0 2 &mpic 1 1
222 06000 0 0 3 &mpic 2 1
223 06000 0 0 4 &mpic 3 1
224
225 /* IDSEL 0x14 (Slot 2) */
226 0a000 0 0 1 &mpic 0 1
227 0a000 0 0 2 &mpic 1 1
228 0a000 0 0 3 &mpic 2 1
229 0a000 0 0 4 &mpic 3 1
230
231 /* IDSEL 0x15 (Slot 3) */
232 0a800 0 0 1 &mpic 1 1
233 0a800 0 0 2 &mpic 2 1
234 0a800 0 0 3 &mpic 3 1
235 0a800 0 0 4 &mpic 0 1
236
237 /* IDSEL 0x16 (Slot 4) */
238 0b000 0 0 1 &mpic 2 1
239 0b000 0 0 2 &mpic 3 1
240 0b000 0 0 3 &mpic 0 1
241 0b000 0 0 4 &mpic 1 1
242
243 /* IDSEL 0x18 (Slot 5) */
244 0c000 0 0 1 &mpic 0 1
245 0c000 0 0 2 &mpic 1 1
246 0c000 0 0 3 &mpic 2 1
247 0c000 0 0 4 &mpic 3 1
248
249 /* IDSEL 0x1C (Tsi310 bridge PCI primary) */
250 0E000 0 0 1 &mpic 0 1
251 0E000 0 0 2 &mpic 1 1
252 0E000 0 0 3 &mpic 2 1
253 0E000 0 0 4 &mpic 3 1>;
254 275
255 interrupt-parent = <&mpic>; 276 /* IDSEL 0x00 (PrPMC Site) */
256 interrupts = <18 2>; 277 0000 0 0 1 &mpic 0 1
257 bus-range = <0 0>; 278 0000 0 0 2 &mpic 1 1
258 ranges = <02000000 0 80000000 80000000 0 10000000 279 0000 0 0 3 &mpic 2 1
259 01000000 0 00000000 e2000000 0 00800000>; 280 0000 0 0 4 &mpic 3 1
260 clock-frequency = <3f940aa>; 281
282 /* IDSEL 0x04 (VIA chip) */
283 2000 0 0 1 &mpic 0 1
284 2000 0 0 2 &mpic 1 1
285 2000 0 0 3 &mpic 2 1
286 2000 0 0 4 &mpic 3 1
287
288 /* IDSEL 0x05 (8139) */
289 2800 0 0 1 &mpic 1 1
290
291 /* IDSEL 0x06 (Slot 6) */
292 3000 0 0 1 &mpic 2 1
293 3000 0 0 2 &mpic 3 1
294 3000 0 0 3 &mpic 0 1
295 3000 0 0 4 &mpic 1 1
296
297 /* IDESL 0x07 (Slot 7) */
298 3800 0 0 1 &mpic 3 1
299 3800 0 0 2 &mpic 0 1
300 3800 0 0 3 &mpic 1 1
301 3800 0 0 4 &mpic 2 1>;
302
303 reg = <e000 0 0 0 0>;
261 #interrupt-cells = <1>; 304 #interrupt-cells = <1>;
262 #size-cells = <2>; 305 #size-cells = <2>;
263 #address-cells = <3>; 306 #address-cells = <3>;
264 reg = <8000 1000>; 307 ranges = <02000000 0 80000000
265 compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci"; 308 02000000 0 80000000
266 device_type = "pci"; 309 0 20000000
310 01000000 0 00000000
311 01000000 0 00000000
312 0 00080000>;
313 clock-frequency = <1fca055>;
267 314
268 pci_bridge@1c { 315 isa@4 {
269 interrupt-map-mask = <f800 0 0 7>; 316 device_type = "isa";
270 interrupt-map = < 317 #interrupt-cells = <2>;
271 318 #size-cells = <1>;
272 /* IDSEL 0x00 (PrPMC Site) */ 319 #address-cells = <2>;
273 0000 0 0 1 &mpic 0 1 320 reg = <2000 0 0 0 0>;
274 0000 0 0 2 &mpic 1 1 321 ranges = <1 0 01000000 0 0 00001000>;
275 0000 0 0 3 &mpic 2 1 322 interrupt-parent = <&i8259>;
276 0000 0 0 4 &mpic 3 1 323
277 324 i8259: interrupt-controller@20 {
278 /* IDSEL 0x04 (VIA chip) */ 325 interrupt-controller;
279 2000 0 0 1 &mpic 0 1 326 device_type = "interrupt-controller";
280 2000 0 0 2 &mpic 1 1 327 reg = <1 20 2
281 2000 0 0 3 &mpic 2 1 328 1 a0 2
282 2000 0 0 4 &mpic 3 1 329 1 4d0 2>;
283 330 #address-cells = <0>;
284 /* IDSEL 0x05 (8139) */
285 2800 0 0 1 &mpic 1 1
286
287 /* IDSEL 0x06 (Slot 6) */
288 3000 0 0 1 &mpic 2 1
289 3000 0 0 2 &mpic 3 1
290 3000 0 0 3 &mpic 0 1
291 3000 0 0 4 &mpic 1 1
292
293 /* IDESL 0x07 (Slot 7) */
294 3800 0 0 1 &mpic 3 1
295 3800 0 0 2 &mpic 0 1
296 3800 0 0 3 &mpic 1 1
297 3800 0 0 4 &mpic 2 1>;
298
299 reg = <e000 0 0 0 0>;
300 #interrupt-cells = <1>;
301 #size-cells = <2>;
302 #address-cells = <3>;
303 ranges = <02000000 0 80000000
304 02000000 0 80000000
305 0 20000000
306 01000000 0 00000000
307 01000000 0 00000000
308 0 00080000>;
309 clock-frequency = <1fca055>;
310
311 isa@4 {
312 device_type = "isa";
313 #interrupt-cells = <2>; 331 #interrupt-cells = <2>;
314 #size-cells = <1>; 332 compatible = "chrp,iic";
315 #address-cells = <2>; 333 interrupts = <0 1>;
316 reg = <2000 0 0 0 0>; 334 interrupt-parent = <&mpic>;
317 ranges = <1 0 01000000 0 0 00001000>;
318 interrupt-parent = <&i8259>;
319
320 i8259: interrupt-controller@20 {
321 clock-frequency = <0>;
322 interrupt-controller;
323 device_type = "interrupt-controller";
324 reg = <1 20 2
325 1 a0 2
326 1 4d0 2>;
327 #address-cells = <0>;
328 #interrupt-cells = <2>;
329 built-in;
330 compatible = "chrp,iic";
331 interrupts = <0 1>;
332 interrupt-parent = <&mpic>;
333 };
334
335 rtc@70 {
336 compatible = "pnpPNP,b00";
337 reg = <1 70 2>;
338 };
339 }; 335 };
340 };
341 };
342 336
343 pci@9000 { 337 rtc@70 {
344 interrupt-map-mask = <f800 0 0 7>; 338 compatible = "pnpPNP,b00";
345 interrupt-map = < 339 reg = <1 70 2>;
346 340 };
347 /* IDSEL 0x15 */ 341 };
348 a800 0 0 1 &mpic b 1
349 a800 0 0 2 &mpic 1 1
350 a800 0 0 3 &mpic 2 1
351 a800 0 0 4 &mpic 3 1>;
352
353 interrupt-parent = <&mpic>;
354 interrupts = <19 2>;
355 bus-range = <0 0>;
356 ranges = <02000000 0 90000000 90000000 0 10000000
357 01000000 0 00000000 e2800000 0 00800000>;
358 clock-frequency = <3f940aa>;
359 #interrupt-cells = <1>;
360 #size-cells = <2>;
361 #address-cells = <3>;
362 reg = <9000 1000>;
363 compatible = "fsl,mpc8540-pci";
364 device_type = "pci";
365 }; 342 };
366 /* PCI Express */ 343 };
367 pcie@a000 {
368 interrupt-map-mask = <f800 0 0 7>;
369 interrupt-map = <
370 344
371 /* IDSEL 0x0 (PEX) */ 345 pci@e0009000 {
372 00000 0 0 1 &mpic 0 1 346 interrupt-map-mask = <f800 0 0 7>;
373 00000 0 0 2 &mpic 1 1 347 interrupt-map = <
374 00000 0 0 3 &mpic 2 1 348
375 00000 0 0 4 &mpic 3 1>; 349 /* IDSEL 0x15 */
350 a800 0 0 1 &mpic b 1
351 a800 0 0 2 &mpic 1 1
352 a800 0 0 3 &mpic 2 1
353 a800 0 0 4 &mpic 3 1>;
354
355 interrupt-parent = <&mpic>;
356 interrupts = <19 2>;
357 bus-range = <0 0>;
358 ranges = <02000000 0 90000000 90000000 0 10000000
359 01000000 0 00000000 e2800000 0 00800000>;
360 clock-frequency = <3f940aa>;
361 #interrupt-cells = <1>;
362 #size-cells = <2>;
363 #address-cells = <3>;
364 reg = <e0009000 1000>;
365 compatible = "fsl,mpc8540-pci";
366 device_type = "pci";
367 };
376 368
377 interrupt-parent = <&mpic>; 369 pcie@e000a000 {
378 interrupts = <1a 2>; 370 interrupt-map-mask = <f800 0 0 7>;
379 bus-range = <0 ff>; 371 interrupt-map = <
380 ranges = <02000000 0 a0000000 a0000000 0 20000000 372
381 01000000 0 00000000 e3000000 0 08000000>; 373 /* IDSEL 0x0 (PEX) */
382 clock-frequency = <1fca055>; 374 00000 0 0 1 &mpic 0 1
383 #interrupt-cells = <1>; 375 00000 0 0 2 &mpic 1 1
376 00000 0 0 3 &mpic 2 1
377 00000 0 0 4 &mpic 3 1>;
378
379 interrupt-parent = <&mpic>;
380 interrupts = <1a 2>;
381 bus-range = <0 ff>;
382 ranges = <02000000 0 a0000000 a0000000 0 20000000
383 01000000 0 00000000 e3000000 0 08000000>;
384 clock-frequency = <1fca055>;
385 #interrupt-cells = <1>;
386 #size-cells = <2>;
387 #address-cells = <3>;
388 reg = <e000a000 1000>;
389 compatible = "fsl,mpc8548-pcie";
390 device_type = "pci";
391 pcie@0 {
392 reg = <0 0 0 0 0>;
384 #size-cells = <2>; 393 #size-cells = <2>;
385 #address-cells = <3>; 394 #address-cells = <3>;
386 reg = <a000 1000>;
387 compatible = "fsl,mpc8548-pcie";
388 device_type = "pci"; 395 device_type = "pci";
389 }; 396 ranges = <02000000 0 a0000000
397 02000000 0 a0000000
398 0 20000000
390 399
391 mpic: pic@40000 { 400 01000000 0 00000000
392 clock-frequency = <0>; 401 01000000 0 00000000
393 interrupt-controller; 402 0 08000000>;
394 #address-cells = <0>;
395 #interrupt-cells = <2>;
396 reg = <40000 40000>;
397 built-in;
398 compatible = "chrp,open-pic";
399 device_type = "open-pic";
400 big-endian;
401 }; 403 };
402 }; 404 };
403}; 405};
diff --git a/arch/powerpc/boot/dts/mpc8555cds.dts b/arch/powerpc/boot/dts/mpc8555cds.dts
index c3c888252121..99199295147e 100644
--- a/arch/powerpc/boot/dts/mpc8555cds.dts
+++ b/arch/powerpc/boot/dts/mpc8555cds.dts
@@ -30,7 +30,6 @@
30 timebase-frequency = <0>; // 33 MHz, from uboot 30 timebase-frequency = <0>; // 33 MHz, from uboot
31 bus-frequency = <0>; // 166 MHz 31 bus-frequency = <0>; // 166 MHz
32 clock-frequency = <0>; // 825 MHz, from uboot 32 clock-frequency = <0>; // 825 MHz, from uboot
33 32-bit;
34 }; 33 };
35 }; 34 };
36 35
@@ -42,10 +41,9 @@
42 soc8555@e0000000 { 41 soc8555@e0000000 {
43 #address-cells = <1>; 42 #address-cells = <1>;
44 #size-cells = <1>; 43 #size-cells = <1>;
45 #interrupt-cells = <2>;
46 device_type = "soc"; 44 device_type = "soc";
47 ranges = <0 e0000000 00100000>; 45 ranges = <0 e0000000 00100000>;
48 reg = <e0000000 00100000>; // CCSRBAR 1M 46 reg = <e0000000 00001000>; // CCSRBAR 1M
49 bus-frequency = <0>; 47 bus-frequency = <0>;
50 48
51 memory-controller@2000 { 49 memory-controller@2000 {
@@ -137,113 +135,109 @@
137 interrupt-parent = <&mpic>; 135 interrupt-parent = <&mpic>;
138 }; 136 };
139 137
140 pci1: pci@8000 {
141 interrupt-map-mask = <1f800 0 0 7>;
142 interrupt-map = <
143
144 /* IDSEL 0x10 */
145 08000 0 0 1 &mpic 0 1
146 08000 0 0 2 &mpic 1 1
147 08000 0 0 3 &mpic 2 1
148 08000 0 0 4 &mpic 3 1
149
150 /* IDSEL 0x11 */
151 08800 0 0 1 &mpic 0 1
152 08800 0 0 2 &mpic 1 1
153 08800 0 0 3 &mpic 2 1
154 08800 0 0 4 &mpic 3 1
155
156 /* IDSEL 0x12 (Slot 1) */
157 09000 0 0 1 &mpic 0 1
158 09000 0 0 2 &mpic 1 1
159 09000 0 0 3 &mpic 2 1
160 09000 0 0 4 &mpic 3 1
161
162 /* IDSEL 0x13 (Slot 2) */
163 09800 0 0 1 &mpic 1 1
164 09800 0 0 2 &mpic 2 1
165 09800 0 0 3 &mpic 3 1
166 09800 0 0 4 &mpic 0 1
167
168 /* IDSEL 0x14 (Slot 3) */
169 0a000 0 0 1 &mpic 2 1
170 0a000 0 0 2 &mpic 3 1
171 0a000 0 0 3 &mpic 0 1
172 0a000 0 0 4 &mpic 1 1
173
174 /* IDSEL 0x15 (Slot 4) */
175 0a800 0 0 1 &mpic 3 1
176 0a800 0 0 2 &mpic 0 1
177 0a800 0 0 3 &mpic 1 1
178 0a800 0 0 4 &mpic 2 1
179
180 /* Bus 1 (Tundra Bridge) */
181 /* IDSEL 0x12 (ISA bridge) */
182 19000 0 0 1 &mpic 0 1
183 19000 0 0 2 &mpic 1 1
184 19000 0 0 3 &mpic 2 1
185 19000 0 0 4 &mpic 3 1>;
186 interrupt-parent = <&mpic>;
187 interrupts = <18 2>;
188 bus-range = <0 0>;
189 ranges = <02000000 0 80000000 80000000 0 20000000
190 01000000 0 00000000 e2000000 0 00100000>;
191 clock-frequency = <3f940aa>;
192 #interrupt-cells = <1>;
193 #size-cells = <2>;
194 #address-cells = <3>;
195 reg = <8000 1000>;
196 compatible = "fsl,mpc8540-pci";
197 device_type = "pci";
198
199 i8259@19000 {
200 clock-frequency = <0>;
201 interrupt-controller;
202 device_type = "interrupt-controller";
203 reg = <19000 0 0 0 1>;
204 #address-cells = <0>;
205 #interrupt-cells = <2>;
206 built-in;
207 compatible = "chrp,iic";
208 big-endian;
209 interrupts = <1>;
210 interrupt-parent = <&pci1>;
211 };
212 };
213
214 pci@9000 {
215 interrupt-map-mask = <f800 0 0 7>;
216 interrupt-map = <
217
218 /* IDSEL 0x15 */
219 a800 0 0 1 &mpic b 1
220 a800 0 0 2 &mpic b 1
221 a800 0 0 3 &mpic b 1
222 a800 0 0 4 &mpic b 1>;
223 interrupt-parent = <&mpic>;
224 interrupts = <19 2>;
225 bus-range = <0 0>;
226 ranges = <02000000 0 a0000000 a0000000 0 20000000
227 01000000 0 00000000 e3000000 0 00100000>;
228 clock-frequency = <3f940aa>;
229 #interrupt-cells = <1>;
230 #size-cells = <2>;
231 #address-cells = <3>;
232 reg = <9000 1000>;
233 compatible = "fsl,mpc8540-pci";
234 device_type = "pci";
235 };
236
237 mpic: pic@40000 { 138 mpic: pic@40000 {
238 clock-frequency = <0>; 139 clock-frequency = <0>;
239 interrupt-controller; 140 interrupt-controller;
240 #address-cells = <0>; 141 #address-cells = <0>;
241 #interrupt-cells = <2>; 142 #interrupt-cells = <2>;
242 reg = <40000 40000>; 143 reg = <40000 40000>;
243 built-in;
244 compatible = "chrp,open-pic"; 144 compatible = "chrp,open-pic";
245 device_type = "open-pic"; 145 device_type = "open-pic";
246 big-endian; 146 big-endian;
247 }; 147 };
248 }; 148 };
149
150 pci1: pci@e0008000 {
151 interrupt-map-mask = <1f800 0 0 7>;
152 interrupt-map = <
153
154 /* IDSEL 0x10 */
155 08000 0 0 1 &mpic 0 1
156 08000 0 0 2 &mpic 1 1
157 08000 0 0 3 &mpic 2 1
158 08000 0 0 4 &mpic 3 1
159
160 /* IDSEL 0x11 */
161 08800 0 0 1 &mpic 0 1
162 08800 0 0 2 &mpic 1 1
163 08800 0 0 3 &mpic 2 1
164 08800 0 0 4 &mpic 3 1
165
166 /* IDSEL 0x12 (Slot 1) */
167 09000 0 0 1 &mpic 0 1
168 09000 0 0 2 &mpic 1 1
169 09000 0 0 3 &mpic 2 1
170 09000 0 0 4 &mpic 3 1
171
172 /* IDSEL 0x13 (Slot 2) */
173 09800 0 0 1 &mpic 1 1
174 09800 0 0 2 &mpic 2 1
175 09800 0 0 3 &mpic 3 1
176 09800 0 0 4 &mpic 0 1
177
178 /* IDSEL 0x14 (Slot 3) */
179 0a000 0 0 1 &mpic 2 1
180 0a000 0 0 2 &mpic 3 1
181 0a000 0 0 3 &mpic 0 1
182 0a000 0 0 4 &mpic 1 1
183
184 /* IDSEL 0x15 (Slot 4) */
185 0a800 0 0 1 &mpic 3 1
186 0a800 0 0 2 &mpic 0 1
187 0a800 0 0 3 &mpic 1 1
188 0a800 0 0 4 &mpic 2 1
189
190 /* Bus 1 (Tundra Bridge) */
191 /* IDSEL 0x12 (ISA bridge) */
192 19000 0 0 1 &mpic 0 1
193 19000 0 0 2 &mpic 1 1
194 19000 0 0 3 &mpic 2 1
195 19000 0 0 4 &mpic 3 1>;
196 interrupt-parent = <&mpic>;
197 interrupts = <18 2>;
198 bus-range = <0 0>;
199 ranges = <02000000 0 80000000 80000000 0 20000000
200 01000000 0 00000000 e2000000 0 00100000>;
201 clock-frequency = <3f940aa>;
202 #interrupt-cells = <1>;
203 #size-cells = <2>;
204 #address-cells = <3>;
205 reg = <e0008000 1000>;
206 compatible = "fsl,mpc8540-pci";
207 device_type = "pci";
208
209 i8259@19000 {
210 interrupt-controller;
211 device_type = "interrupt-controller";
212 reg = <19000 0 0 0 1>;
213 #address-cells = <0>;
214 #interrupt-cells = <2>;
215 compatible = "chrp,iic";
216 interrupts = <1>;
217 interrupt-parent = <&pci1>;
218 };
219 };
220
221 pci@e0009000 {
222 interrupt-map-mask = <f800 0 0 7>;
223 interrupt-map = <
224
225 /* IDSEL 0x15 */
226 a800 0 0 1 &mpic b 1
227 a800 0 0 2 &mpic b 1
228 a800 0 0 3 &mpic b 1
229 a800 0 0 4 &mpic b 1>;
230 interrupt-parent = <&mpic>;
231 interrupts = <19 2>;
232 bus-range = <0 0>;
233 ranges = <02000000 0 a0000000 a0000000 0 20000000
234 01000000 0 00000000 e3000000 0 00100000>;
235 clock-frequency = <3f940aa>;
236 #interrupt-cells = <1>;
237 #size-cells = <2>;
238 #address-cells = <3>;
239 reg = <e0009000 1000>;
240 compatible = "fsl,mpc8540-pci";
241 device_type = "pci";
242 };
249}; 243};
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index 16dbe848cecf..5577ec1f312b 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -30,7 +30,6 @@
30 timebase-frequency = <04ead9a0>; 30 timebase-frequency = <04ead9a0>;
31 bus-frequency = <13ab6680>; 31 bus-frequency = <13ab6680>;
32 clock-frequency = <312c8040>; 32 clock-frequency = <312c8040>;
33 32-bit;
34 }; 33 };
35 }; 34 };
36 35
@@ -42,7 +41,6 @@
42 soc8560@e0000000 { 41 soc8560@e0000000 {
43 #address-cells = <1>; 42 #address-cells = <1>;
44 #size-cells = <1>; 43 #size-cells = <1>;
45 #interrupt-cells = <2>;
46 device_type = "soc"; 44 device_type = "soc";
47 ranges = <0 e0000000 00100000>; 45 ranges = <0 e0000000 00100000>;
48 reg = <e0000000 00000200>; 46 reg = <e0000000 00000200>;
@@ -132,109 +130,17 @@
132 phy-handle = <&phy1>; 130 phy-handle = <&phy1>;
133 }; 131 };
134 132
135 pci@8000 {
136 #interrupt-cells = <1>;
137 #size-cells = <2>;
138 #address-cells = <3>;
139 compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
140 device_type = "pci";
141 reg = <8000 1000>;
142 clock-frequency = <3f940aa>;
143 interrupt-map-mask = <f800 0 0 7>;
144 interrupt-map = <
145
146 /* IDSEL 0x2 */
147 1000 0 0 1 &mpic 1 1
148 1000 0 0 2 &mpic 2 1
149 1000 0 0 3 &mpic 3 1
150 1000 0 0 4 &mpic 4 1
151
152 /* IDSEL 0x3 */
153 1800 0 0 1 &mpic 4 1
154 1800 0 0 2 &mpic 1 1
155 1800 0 0 3 &mpic 2 1
156 1800 0 0 4 &mpic 3 1
157
158 /* IDSEL 0x4 */
159 2000 0 0 1 &mpic 3 1
160 2000 0 0 2 &mpic 4 1
161 2000 0 0 3 &mpic 1 1
162 2000 0 0 4 &mpic 2 1
163
164 /* IDSEL 0x5 */
165 2800 0 0 1 &mpic 2 1
166 2800 0 0 2 &mpic 3 1
167 2800 0 0 3 &mpic 4 1
168 2800 0 0 4 &mpic 1 1
169
170 /* IDSEL 12 */
171 6000 0 0 1 &mpic 1 1
172 6000 0 0 2 &mpic 2 1
173 6000 0 0 3 &mpic 3 1
174 6000 0 0 4 &mpic 4 1
175
176 /* IDSEL 13 */
177 6800 0 0 1 &mpic 4 1
178 6800 0 0 2 &mpic 1 1
179 6800 0 0 3 &mpic 2 1
180 6800 0 0 4 &mpic 3 1
181
182 /* IDSEL 14*/
183 7000 0 0 1 &mpic 3 1
184 7000 0 0 2 &mpic 4 1
185 7000 0 0 3 &mpic 1 1
186 7000 0 0 4 &mpic 2 1
187
188 /* IDSEL 15 */
189 7800 0 0 1 &mpic 2 1
190 7800 0 0 2 &mpic 3 1
191 7800 0 0 3 &mpic 4 1
192 7800 0 0 4 &mpic 1 1
193
194 /* IDSEL 18 */
195 9000 0 0 1 &mpic 1 1
196 9000 0 0 2 &mpic 2 1
197 9000 0 0 3 &mpic 3 1
198 9000 0 0 4 &mpic 4 1
199
200 /* IDSEL 19 */
201 9800 0 0 1 &mpic 4 1
202 9800 0 0 2 &mpic 1 1
203 9800 0 0 3 &mpic 2 1
204 9800 0 0 4 &mpic 3 1
205
206 /* IDSEL 20 */
207 a000 0 0 1 &mpic 3 1
208 a000 0 0 2 &mpic 4 1
209 a000 0 0 3 &mpic 1 1
210 a000 0 0 4 &mpic 2 1
211
212 /* IDSEL 21 */
213 a800 0 0 1 &mpic 2 1
214 a800 0 0 2 &mpic 3 1
215 a800 0 0 3 &mpic 4 1
216 a800 0 0 4 &mpic 1 1>;
217
218 interrupt-parent = <&mpic>;
219 interrupts = <18 2>;
220 bus-range = <0 0>;
221 ranges = <02000000 0 80000000 80000000 0 20000000
222 01000000 0 00000000 e2000000 0 01000000>;
223 };
224
225 mpic: pic@40000 { 133 mpic: pic@40000 {
226 interrupt-controller; 134 interrupt-controller;
227 #address-cells = <0>; 135 #address-cells = <0>;
228 #interrupt-cells = <2>; 136 #interrupt-cells = <2>;
229 reg = <40000 40000>; 137 reg = <40000 40000>;
230 built-in;
231 device_type = "open-pic"; 138 device_type = "open-pic";
232 }; 139 };
233 140
234 cpm@e0000000 { 141 cpm@e0000000 {
235 #address-cells = <1>; 142 #address-cells = <1>;
236 #size-cells = <1>; 143 #size-cells = <1>;
237 #interrupt-cells = <2>;
238 device_type = "cpm"; 144 device_type = "cpm";
239 model = "CPM2"; 145 model = "CPM2";
240 ranges = <0 0 c0000>; 146 ranges = <0 0 c0000>;
@@ -249,7 +155,6 @@
249 interrupts = <2e 2>; 155 interrupts = <2e 2>;
250 interrupt-parent = <&mpic>; 156 interrupt-parent = <&mpic>;
251 reg = <90c00 80>; 157 reg = <90c00 80>;
252 built-in;
253 device_type = "cpm-pic"; 158 device_type = "cpm-pic";
254 }; 159 };
255 160
@@ -324,4 +229,94 @@
324 }; 229 };
325 }; 230 };
326 }; 231 };
232
233 pci@e0008000 {
234 #interrupt-cells = <1>;
235 #size-cells = <2>;
236 #address-cells = <3>;
237 compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
238 device_type = "pci";
239 reg = <e0008000 1000>;
240 clock-frequency = <3f940aa>;
241 interrupt-map-mask = <f800 0 0 7>;
242 interrupt-map = <
243
244 /* IDSEL 0x2 */
245 1000 0 0 1 &mpic 1 1
246 1000 0 0 2 &mpic 2 1
247 1000 0 0 3 &mpic 3 1
248 1000 0 0 4 &mpic 4 1
249
250 /* IDSEL 0x3 */
251 1800 0 0 1 &mpic 4 1
252 1800 0 0 2 &mpic 1 1
253 1800 0 0 3 &mpic 2 1
254 1800 0 0 4 &mpic 3 1
255
256 /* IDSEL 0x4 */
257 2000 0 0 1 &mpic 3 1
258 2000 0 0 2 &mpic 4 1
259 2000 0 0 3 &mpic 1 1
260 2000 0 0 4 &mpic 2 1
261
262 /* IDSEL 0x5 */
263 2800 0 0 1 &mpic 2 1
264 2800 0 0 2 &mpic 3 1
265 2800 0 0 3 &mpic 4 1
266 2800 0 0 4 &mpic 1 1
267
268 /* IDSEL 12 */
269 6000 0 0 1 &mpic 1 1
270 6000 0 0 2 &mpic 2 1
271 6000 0 0 3 &mpic 3 1
272 6000 0 0 4 &mpic 4 1
273
274 /* IDSEL 13 */
275 6800 0 0 1 &mpic 4 1
276 6800 0 0 2 &mpic 1 1
277 6800 0 0 3 &mpic 2 1
278 6800 0 0 4 &mpic 3 1
279
280 /* IDSEL 14*/
281 7000 0 0 1 &mpic 3 1
282 7000 0 0 2 &mpic 4 1
283 7000 0 0 3 &mpic 1 1
284 7000 0 0 4 &mpic 2 1
285
286 /* IDSEL 15 */
287 7800 0 0 1 &mpic 2 1
288 7800 0 0 2 &mpic 3 1
289 7800 0 0 3 &mpic 4 1
290 7800 0 0 4 &mpic 1 1
291
292 /* IDSEL 18 */
293 9000 0 0 1 &mpic 1 1
294 9000 0 0 2 &mpic 2 1
295 9000 0 0 3 &mpic 3 1
296 9000 0 0 4 &mpic 4 1
297
298 /* IDSEL 19 */
299 9800 0 0 1 &mpic 4 1
300 9800 0 0 2 &mpic 1 1
301 9800 0 0 3 &mpic 2 1
302 9800 0 0 4 &mpic 3 1
303
304 /* IDSEL 20 */
305 a000 0 0 1 &mpic 3 1
306 a000 0 0 2 &mpic 4 1
307 a000 0 0 3 &mpic 1 1
308 a000 0 0 4 &mpic 2 1
309
310 /* IDSEL 21 */
311 a800 0 0 1 &mpic 2 1
312 a800 0 0 2 &mpic 3 1
313 a800 0 0 3 &mpic 4 1
314 a800 0 0 4 &mpic 1 1>;
315
316 interrupt-parent = <&mpic>;
317 interrupts = <18 2>;
318 bus-range = <0 0>;
319 ranges = <02000000 0 80000000 80000000 0 20000000
320 01000000 0 00000000 e2000000 0 01000000>;
321 };
327}; 322};
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index b1dcfbe8c1f8..c472a4b488e9 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -34,7 +34,6 @@
34 timebase-frequency = <0>; 34 timebase-frequency = <0>;
35 bus-frequency = <0>; 35 bus-frequency = <0>;
36 clock-frequency = <0>; 36 clock-frequency = <0>;
37 32-bit;
38 }; 37 };
39 }; 38 };
40 39
@@ -51,7 +50,6 @@
51 soc8568@e0000000 { 50 soc8568@e0000000 {
52 #address-cells = <1>; 51 #address-cells = <1>;
53 #size-cells = <1>; 52 #size-cells = <1>;
54 #interrupt-cells = <2>;
55 device_type = "soc"; 53 device_type = "soc";
56 ranges = <0 e0000000 00100000>; 54 ranges = <0 e0000000 00100000>;
57 reg = <e0000000 00100000>; 55 reg = <e0000000 00100000>;
@@ -258,7 +256,6 @@
258 #address-cells = <0>; 256 #address-cells = <0>;
259 #interrupt-cells = <2>; 257 #interrupt-cells = <2>;
260 reg = <40000 40000>; 258 reg = <40000 40000>;
261 built-in;
262 compatible = "chrp,open-pic"; 259 compatible = "chrp,open-pic";
263 device_type = "open-pic"; 260 device_type = "open-pic";
264 big-endian; 261 big-endian;
@@ -449,7 +446,6 @@
449 #address-cells = <0>; 446 #address-cells = <0>;
450 #interrupt-cells = <1>; 447 #interrupt-cells = <1>;
451 reg = <80 80>; 448 reg = <80 80>;
452 built-in;
453 big-endian; 449 big-endian;
454 interrupts = <2e 2 2e 2>; //high:30 low:30 450 interrupts = <2e 2 2e 2>; //high:30 low:30
455 interrupt-parent = <&mpic>; 451 interrupt-parent = <&mpic>;
diff --git a/arch/powerpc/boot/dts/mpc8572ds.dts b/arch/powerpc/boot/dts/mpc8572ds.dts
new file mode 100644
index 000000000000..d638deec7652
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8572ds.dts
@@ -0,0 +1,404 @@
1/*
2 * MPC8572 DS Device Tree Source
3 *
4 * Copyright 2007 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/ {
13 model = "fsl,MPC8572DS";
14 compatible = "fsl,MPC8572DS";
15 #address-cells = <1>;
16 #size-cells = <1>;
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 PowerPC,8572@0 {
23 device_type = "cpu";
24 reg = <0>;
25 d-cache-line-size = <20>; // 32 bytes
26 i-cache-line-size = <20>; // 32 bytes
27 d-cache-size = <8000>; // L1, 32K
28 i-cache-size = <8000>; // L1, 32K
29 timebase-frequency = <0>;
30 bus-frequency = <0>;
31 clock-frequency = <0>;
32 };
33 };
34
35 memory {
36 device_type = "memory";
37 reg = <00000000 00000000>; // Filled by U-Boot
38 };
39
40 soc8572@ffe00000 {
41 #address-cells = <1>;
42 #size-cells = <1>;
43 device_type = "soc";
44 ranges = <00000000 ffe00000 00100000>;
45 reg = <ffe00000 00001000>; // CCSRBAR & soc regs, remove once parse code for immrbase fixed
46 bus-frequency = <0>; // Filled out by uboot.
47
48 memory-controller@2000 {
49 compatible = "fsl,mpc8572-memory-controller";
50 reg = <2000 1000>;
51 interrupt-parent = <&mpic>;
52 interrupts = <12 2>;
53 };
54
55 memory-controller@6000 {
56 compatible = "fsl,mpc8572-memory-controller";
57 reg = <6000 1000>;
58 interrupt-parent = <&mpic>;
59 interrupts = <12 2>;
60 };
61
62 l2-cache-controller@20000 {
63 compatible = "fsl,mpc8572-l2-cache-controller";
64 reg = <20000 1000>;
65 cache-line-size = <20>; // 32 bytes
66 cache-size = <80000>; // L2, 512K
67 interrupt-parent = <&mpic>;
68 interrupts = <10 2>;
69 };
70
71 i2c@3000 {
72 device_type = "i2c";
73 compatible = "fsl-i2c";
74 reg = <3000 100>;
75 interrupts = <2b 2>;
76 interrupt-parent = <&mpic>;
77 dfsrr;
78 };
79
80 i2c@3100 {
81 device_type = "i2c";
82 compatible = "fsl-i2c";
83 reg = <3100 100>;
84 interrupts = <2b 2>;
85 interrupt-parent = <&mpic>;
86 dfsrr;
87 };
88
89 mdio@24520 {
90 #address-cells = <1>;
91 #size-cells = <0>;
92 device_type = "mdio";
93 compatible = "gianfar";
94 reg = <24520 20>;
95 phy0: ethernet-phy@0 {
96 interrupt-parent = <&mpic>;
97 interrupts = <a 1>;
98 reg = <0>;
99 };
100 phy1: ethernet-phy@1 {
101 interrupt-parent = <&mpic>;
102 interrupts = <a 1>;
103 reg = <1>;
104 };
105 phy2: ethernet-phy@2 {
106 interrupt-parent = <&mpic>;
107 interrupts = <a 1>;
108 reg = <2>;
109 };
110 phy3: ethernet-phy@3 {
111 interrupt-parent = <&mpic>;
112 interrupts = <a 1>;
113 reg = <3>;
114 };
115 };
116
117 ethernet@24000 {
118 #address-cells = <1>;
119 #size-cells = <0>;
120 device_type = "network";
121 model = "eTSEC";
122 compatible = "gianfar";
123 reg = <24000 1000>;
124 local-mac-address = [ 00 00 00 00 00 00 ];
125 interrupts = <1d 2 1e 2 22 2>;
126 interrupt-parent = <&mpic>;
127 phy-handle = <&phy0>;
128 phy-connection-type = "rgmii-id";
129 };
130
131 ethernet@25000 {
132 #address-cells = <1>;
133 #size-cells = <0>;
134 device_type = "network";
135 model = "eTSEC";
136 compatible = "gianfar";
137 reg = <25000 1000>;
138 local-mac-address = [ 00 00 00 00 00 00 ];
139 interrupts = <23 2 24 2 28 2>;
140 interrupt-parent = <&mpic>;
141 phy-handle = <&phy1>;
142 phy-connection-type = "rgmii-id";
143 };
144
145 ethernet@26000 {
146 #address-cells = <1>;
147 #size-cells = <0>;
148 device_type = "network";
149 model = "eTSEC";
150 compatible = "gianfar";
151 reg = <26000 1000>;
152 local-mac-address = [ 00 00 00 00 00 00 ];
153 interrupts = <1f 2 20 2 21 2>;
154 interrupt-parent = <&mpic>;
155 phy-handle = <&phy2>;
156 phy-connection-type = "rgmii-id";
157 };
158
159 ethernet@27000 {
160 #address-cells = <1>;
161 #size-cells = <0>;
162 device_type = "network";
163 model = "eTSEC";
164 compatible = "gianfar";
165 reg = <27000 1000>;
166 local-mac-address = [ 00 00 00 00 00 00 ];
167 interrupts = <25 2 26 2 27 2>;
168 interrupt-parent = <&mpic>;
169 phy-handle = <&phy3>;
170 phy-connection-type = "rgmii-id";
171 };
172
173 serial@4500 {
174 device_type = "serial";
175 compatible = "ns16550";
176 reg = <4500 100>;
177 clock-frequency = <0>;
178 interrupts = <2a 2>;
179 interrupt-parent = <&mpic>;
180 };
181
182 serial@4600 {
183 device_type = "serial";
184 compatible = "ns16550";
185 reg = <4600 100>;
186 clock-frequency = <0>;
187 interrupts = <2a 2>;
188 interrupt-parent = <&mpic>;
189 };
190
191 global-utilities@e0000 { //global utilities block
192 compatible = "fsl,mpc8572-guts";
193 reg = <e0000 1000>;
194 fsl,has-rstcr;
195 };
196
197 mpic: pic@40000 {
198 clock-frequency = <0>;
199 interrupt-controller;
200 #address-cells = <0>;
201 #interrupt-cells = <2>;
202 reg = <40000 40000>;
203 compatible = "chrp,open-pic";
204 device_type = "open-pic";
205 big-endian;
206 };
207 };
208
209 pcie@ffe08000 {
210 compatible = "fsl,mpc8548-pcie";
211 device_type = "pci";
212 #interrupt-cells = <1>;
213 #size-cells = <2>;
214 #address-cells = <3>;
215 reg = <ffe08000 1000>;
216 bus-range = <0 ff>;
217 ranges = <02000000 0 80000000 80000000 0 20000000
218 01000000 0 00000000 ffc00000 0 00010000>;
219 clock-frequency = <1fca055>;
220 interrupt-parent = <&mpic>;
221 interrupts = <18 2>;
222 interrupt-map-mask = <fb00 0 0 0>;
223 interrupt-map = <
224 /* IDSEL 0x11 - PCI slot 1 */
225 8800 0 0 1 &mpic 2 1
226 8800 0 0 2 &mpic 3 1
227 8800 0 0 3 &mpic 4 1
228 8800 0 0 4 &mpic 1 1
229
230 /* IDSEL 0x12 - PCI slot 2 */
231 9000 0 0 1 &mpic 3 1
232 9000 0 0 2 &mpic 4 1
233 9000 0 0 3 &mpic 1 1
234 9000 0 0 4 &mpic 2 1
235
236 // IDSEL 0x1c USB
237 e000 0 0 0 &i8259 c 2
238 e100 0 0 0 &i8259 9 2
239 e200 0 0 0 &i8259 a 2
240 e300 0 0 0 &i8259 b 2
241
242 // IDSEL 0x1d Audio
243 e800 0 0 0 &i8259 6 2
244
245 // IDSEL 0x1e Legacy
246 f000 0 0 0 &i8259 7 2
247 f100 0 0 0 &i8259 7 2
248
249 // IDSEL 0x1f IDE/SATA
250 f800 0 0 0 &i8259 e 2
251 f900 0 0 0 &i8259 5 2
252
253 >;
254
255 pcie@0 {
256 reg = <0 0 0 0 0>;
257 #size-cells = <2>;
258 #address-cells = <3>;
259 device_type = "pci";
260 ranges = <02000000 0 80000000
261 02000000 0 80000000
262 0 20000000
263
264 01000000 0 00000000
265 01000000 0 00000000
266 0 00100000>;
267 uli1575@0 {
268 reg = <0 0 0 0 0>;
269 #size-cells = <2>;
270 #address-cells = <3>;
271 ranges = <02000000 0 80000000
272 02000000 0 80000000
273 0 20000000
274
275 01000000 0 00000000
276 01000000 0 00000000
277 0 00100000>;
278 isa@1e {
279 device_type = "isa";
280 #interrupt-cells = <2>;
281 #size-cells = <1>;
282 #address-cells = <2>;
283 reg = <f000 0 0 0 0>;
284 ranges = <1 0 01000000 0 0
285 00001000>;
286 interrupt-parent = <&i8259>;
287
288 i8259: interrupt-controller@20 {
289 reg = <1 20 2
290 1 a0 2
291 1 4d0 2>;
292 interrupt-controller;
293 device_type = "interrupt-controller";
294 #address-cells = <0>;
295 #interrupt-cells = <2>;
296 compatible = "chrp,iic";
297 interrupts = <9 2>;
298 interrupt-parent = <&mpic>;
299 };
300
301 i8042@60 {
302 #size-cells = <0>;
303 #address-cells = <1>;
304 reg = <1 60 1 1 64 1>;
305 interrupts = <1 3 c 3>;
306 interrupt-parent =
307 <&i8259>;
308
309 keyboard@0 {
310 reg = <0>;
311 compatible = "pnpPNP,303";
312 };
313
314 mouse@1 {
315 reg = <1>;
316 compatible = "pnpPNP,f03";
317 };
318 };
319
320 rtc@70 {
321 compatible = "pnpPNP,b00";
322 reg = <1 70 2>;
323 };
324
325 gpio@400 {
326 reg = <1 400 80>;
327 };
328 };
329 };
330 };
331
332 };
333
334 pcie@ffe09000 {
335 compatible = "fsl,mpc8548-pcie";
336 device_type = "pci";
337 #interrupt-cells = <1>;
338 #size-cells = <2>;
339 #address-cells = <3>;
340 reg = <ffe09000 1000>;
341 bus-range = <0 ff>;
342 ranges = <02000000 0 a0000000 a0000000 0 20000000
343 01000000 0 00000000 ffc10000 0 00010000>;
344 clock-frequency = <1fca055>;
345 interrupt-parent = <&mpic>;
346 interrupts = <1a 2>;
347 interrupt-map-mask = <f800 0 0 7>;
348 interrupt-map = <
349 /* IDSEL 0x0 */
350 0000 0 0 1 &mpic 4 1
351 0000 0 0 2 &mpic 5 1
352 0000 0 0 3 &mpic 6 1
353 0000 0 0 4 &mpic 7 1
354 >;
355 pcie@0 {
356 reg = <0 0 0 0 0>;
357 #size-cells = <2>;
358 #address-cells = <3>;
359 device_type = "pci";
360 ranges = <02000000 0 a0000000
361 02000000 0 a0000000
362 0 20000000
363
364 01000000 0 00000000
365 01000000 0 00000000
366 0 00100000>;
367 };
368 };
369
370 pcie@ffe0a000 {
371 compatible = "fsl,mpc8548-pcie";
372 device_type = "pci";
373 #interrupt-cells = <1>;
374 #size-cells = <2>;
375 #address-cells = <3>;
376 reg = <ffe0a000 1000>;
377 bus-range = <0 ff>;
378 ranges = <02000000 0 c0000000 c0000000 0 20000000
379 01000000 0 00000000 ffc20000 0 00010000>;
380 clock-frequency = <1fca055>;
381 interrupt-parent = <&mpic>;
382 interrupts = <1b 2>;
383 interrupt-map = <
384 /* IDSEL 0x0 */
385 0000 0 0 1 &mpic 0 1
386 0000 0 0 2 &mpic 1 1
387 0000 0 0 3 &mpic 2 1
388 0000 0 0 4 &mpic 3 1
389 >;
390 pcie@0 {
391 reg = <0 0 0 0 0>;
392 #size-cells = <2>;
393 #address-cells = <3>;
394 device_type = "pci";
395 ranges = <02000000 0 c0000000
396 02000000 0 c0000000
397 0 20000000
398
399 01000000 0 00000000
400 01000000 0 00000000
401 0 00100000>;
402 };
403 };
404};
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index b0166e5c177e..f797662212ba 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -30,7 +30,6 @@
30 timebase-frequency = <0>; // 33 MHz, from uboot 30 timebase-frequency = <0>; // 33 MHz, from uboot
31 bus-frequency = <0>; // From uboot 31 bus-frequency = <0>; // From uboot
32 clock-frequency = <0>; // From uboot 32 clock-frequency = <0>; // From uboot
33 32-bit;
34 }; 33 };
35 PowerPC,8641@1 { 34 PowerPC,8641@1 {
36 device_type = "cpu"; 35 device_type = "cpu";
@@ -42,7 +41,6 @@
42 timebase-frequency = <0>; // 33 MHz, from uboot 41 timebase-frequency = <0>; // 33 MHz, from uboot
43 bus-frequency = <0>; // From uboot 42 bus-frequency = <0>; // From uboot
44 clock-frequency = <0>; // From uboot 43 clock-frequency = <0>; // From uboot
45 32-bit;
46 }; 44 };
47 }; 45 };
48 46
@@ -54,13 +52,8 @@
54 soc8641@f8000000 { 52 soc8641@f8000000 {
55 #address-cells = <1>; 53 #address-cells = <1>;
56 #size-cells = <1>; 54 #size-cells = <1>;
57 #interrupt-cells = <2>;
58 device_type = "soc"; 55 device_type = "soc";
59 ranges = <00001000 f8001000 000ff000 56 ranges = <00000000 f8000000 00100000>;
60 80000000 80000000 20000000
61 e2000000 e2000000 00100000
62 a0000000 a0000000 20000000
63 e3000000 e3000000 00100000>;
64 reg = <f8000000 00001000>; // CCSRBAR 57 reg = <f8000000 00001000>; // CCSRBAR
65 bus-frequency = <0>; 58 bus-frequency = <0>;
66 59
@@ -211,50 +204,75 @@
211 interrupt-parent = <&mpic>; 204 interrupt-parent = <&mpic>;
212 }; 205 };
213 206
214 pcie@8000 { 207 mpic: pic@40000 {
215 compatible = "fsl,mpc8641-pcie"; 208 clock-frequency = <0>;
216 device_type = "pci"; 209 interrupt-controller;
217 #interrupt-cells = <1>; 210 #address-cells = <0>;
218 #size-cells = <2>; 211 #interrupt-cells = <2>;
219 #address-cells = <3>; 212 reg = <40000 40000>;
220 reg = <8000 1000>; 213 compatible = "chrp,open-pic";
221 bus-range = <0 ff>; 214 device_type = "open-pic";
222 ranges = <02000000 0 80000000 80000000 0 20000000 215 big-endian;
223 01000000 0 00000000 e2000000 0 00100000>; 216 };
224 clock-frequency = <1fca055>; 217 };
225 interrupt-parent = <&mpic>;
226 interrupts = <18 2>;
227 interrupt-map-mask = <fb00 0 0 0>;
228 interrupt-map = <
229 /* IDSEL 0x11 */
230 8800 0 0 1 &i8259 9 2
231 8800 0 0 2 &i8259 a 2
232 8800 0 0 3 &i8259 b 2
233 8800 0 0 4 &i8259 c 2
234 218
235 /* IDSEL 0x12 */ 219 pcie@f8008000 {
236 9000 0 0 1 &i8259 a 2 220 compatible = "fsl,mpc8641-pcie";
237 9000 0 0 2 &i8259 b 2 221 device_type = "pci";
238 9000 0 0 3 &i8259 c 2 222 #interrupt-cells = <1>;
239 9000 0 0 4 &i8259 9 2 223 #size-cells = <2>;
224 #address-cells = <3>;
225 reg = <f8008000 1000>;
226 bus-range = <0 ff>;
227 ranges = <02000000 0 80000000 80000000 0 20000000
228 01000000 0 00000000 e2000000 0 00100000>;
229 clock-frequency = <1fca055>;
230 interrupt-parent = <&mpic>;
231 interrupts = <18 2>;
232 interrupt-map-mask = <fb00 0 0 0>;
233 interrupt-map = <
234 /* IDSEL 0x11 */
235 8800 0 0 1 &i8259 9 2
236 8800 0 0 2 &i8259 a 2
237 8800 0 0 3 &i8259 b 2
238 8800 0 0 4 &i8259 c 2
240 239
241 // IDSEL 0x1c USB 240 /* IDSEL 0x12 */
242 e000 0 0 0 &i8259 c 2 241 9000 0 0 1 &i8259 a 2
243 e100 0 0 0 &i8259 9 2 242 9000 0 0 2 &i8259 b 2
244 e200 0 0 0 &i8259 a 2 243 9000 0 0 3 &i8259 c 2
245 e300 0 0 0 &i8259 b 2 244 9000 0 0 4 &i8259 9 2
246 245
247 // IDSEL 0x1d Audio 246 // IDSEL 0x1c USB
248 e800 0 0 0 &i8259 6 2 247 e000 0 0 0 &i8259 c 2
248 e100 0 0 0 &i8259 9 2
249 e200 0 0 0 &i8259 a 2
250 e300 0 0 0 &i8259 b 2
249 251
250 // IDSEL 0x1e Legacy 252 // IDSEL 0x1d Audio
251 f000 0 0 0 &i8259 7 2 253 e800 0 0 0 &i8259 6 2
252 f100 0 0 0 &i8259 7 2
253 254
254 // IDSEL 0x1f IDE/SATA 255 // IDSEL 0x1e Legacy
255 f800 0 0 0 &i8259 e 2 256 f000 0 0 0 &i8259 7 2
256 f900 0 0 0 &i8259 5 2 257 f100 0 0 0 &i8259 7 2
257 >; 258
259 // IDSEL 0x1f IDE/SATA
260 f800 0 0 0 &i8259 e 2
261 f900 0 0 0 &i8259 5 2
262 >;
263
264 pcie@0 {
265 reg = <0 0 0 0 0>;
266 #size-cells = <2>;
267 #address-cells = <3>;
268 device_type = "pci";
269 ranges = <02000000 0 80000000
270 02000000 0 80000000
271 0 20000000
272
273 01000000 0 00000000
274 01000000 0 00000000
275 0 00100000>;
258 uli1575@0 { 276 uli1575@0 {
259 reg = <0 0 0 0 0>; 277 reg = <0 0 0 0 0>;
260 #size-cells = <2>; 278 #size-cells = <2>;
@@ -265,111 +283,96 @@
265 01000000 0 00000000 283 01000000 0 00000000
266 01000000 0 00000000 284 01000000 0 00000000
267 0 00100000>; 285 0 00100000>;
286 isa@1e {
287 device_type = "isa";
288 #interrupt-cells = <2>;
289 #size-cells = <1>;
290 #address-cells = <2>;
291 reg = <f000 0 0 0 0>;
292 ranges = <1 0 01000000 0 0
293 00001000>;
294 interrupt-parent = <&i8259>;
268 295
269 pci_bridge@0 { 296 i8259: interrupt-controller@20 {
270 reg = <0 0 0 0 0>; 297 reg = <1 20 2
271 #size-cells = <2>; 298 1 a0 2
272 #address-cells = <3>; 299 1 4d0 2>;
273 ranges = <02000000 0 80000000 300 interrupt-controller;
274 02000000 0 80000000 301 device_type = "interrupt-controller";
275 0 20000000 302 #address-cells = <0>;
276 01000000 0 00000000
277 01000000 0 00000000
278 0 00100000>;
279
280 isa@1e {
281 device_type = "isa";
282 #interrupt-cells = <2>; 303 #interrupt-cells = <2>;
283 #size-cells = <1>; 304 compatible = "chrp,iic";
284 #address-cells = <2>; 305 interrupts = <9 2>;
285 reg = <f000 0 0 0 0>; 306 interrupt-parent = <&mpic>;
286 ranges = <1 0 01000000 0 0 307 };
287 00001000>;
288 interrupt-parent = <&i8259>;
289
290 i8259: interrupt-controller@20 {
291 reg = <1 20 2
292 1 a0 2
293 1 4d0 2>;
294 clock-frequency = <0>;
295 interrupt-controller;
296 device_type = "interrupt-controller";
297 #address-cells = <0>;
298 #interrupt-cells = <2>;
299 built-in;
300 compatible = "chrp,iic";
301 interrupts = <9 2>;
302 interrupt-parent =
303 <&mpic>;
304 };
305
306 i8042@60 {
307 #size-cells = <0>;
308 #address-cells = <1>;
309 reg = <1 60 1 1 64 1>;
310 interrupts = <1 3 c 3>;
311 interrupt-parent =
312 <&i8259>;
313 308
314 keyboard@0 { 309 i8042@60 {
315 reg = <0>; 310 #size-cells = <0>;
316 compatible = "pnpPNP,303"; 311 #address-cells = <1>;
317 }; 312 reg = <1 60 1 1 64 1>;
313 interrupts = <1 3 c 3>;
314 interrupt-parent =
315 <&i8259>;
318 316
319 mouse@1 { 317 keyboard@0 {
320 reg = <1>; 318 reg = <0>;
321 compatible = "pnpPNP,f03"; 319 compatible = "pnpPNP,303";
322 };
323 }; 320 };
324 321
325 rtc@70 { 322 mouse@1 {
326 compatible = 323 reg = <1>;
327 "pnpPNP,b00"; 324 compatible = "pnpPNP,f03";
328 reg = <1 70 2>;
329 }; 325 };
326 };
330 327
331 gpio@400 { 328 rtc@70 {
332 reg = <1 400 80>; 329 compatible =
333 }; 330 "pnpPNP,b00";
331 reg = <1 70 2>;
332 };
333
334 gpio@400 {
335 reg = <1 400 80>;
334 }; 336 };
335 }; 337 };
336 }; 338 };
337
338 }; 339 };
339 340
340 pcie@9000 { 341 };
341 compatible = "fsl,mpc8641-pcie"; 342
342 device_type = "pci"; 343 pcie@f8009000 {
343 #interrupt-cells = <1>; 344 compatible = "fsl,mpc8641-pcie";
345 device_type = "pci";
346 #interrupt-cells = <1>;
347 #size-cells = <2>;
348 #address-cells = <3>;
349 reg = <f8009000 1000>;
350 bus-range = <0 ff>;
351 ranges = <02000000 0 a0000000 a0000000 0 20000000
352 01000000 0 00000000 e3000000 0 00100000>;
353 clock-frequency = <1fca055>;
354 interrupt-parent = <&mpic>;
355 interrupts = <19 2>;
356 interrupt-map-mask = <f800 0 0 7>;
357 interrupt-map = <
358 /* IDSEL 0x0 */
359 0000 0 0 1 &mpic 4 1
360 0000 0 0 2 &mpic 5 1
361 0000 0 0 3 &mpic 6 1
362 0000 0 0 4 &mpic 7 1
363 >;
364 pcie@0 {
365 reg = <0 0 0 0 0>;
344 #size-cells = <2>; 366 #size-cells = <2>;
345 #address-cells = <3>; 367 #address-cells = <3>;
346 reg = <9000 1000>; 368 device_type = "pci";
347 bus-range = <0 ff>; 369 ranges = <02000000 0 a0000000
348 ranges = <02000000 0 a0000000 a0000000 0 20000000 370 02000000 0 a0000000
349 01000000 0 00000000 e3000000 0 00100000>; 371 0 20000000
350 clock-frequency = <1fca055>;
351 interrupt-parent = <&mpic>;
352 interrupts = <19 2>;
353 interrupt-map-mask = <f800 0 0 7>;
354 interrupt-map = <
355 /* IDSEL 0x0 */
356 0000 0 0 1 &mpic 4 1
357 0000 0 0 2 &mpic 5 1
358 0000 0 0 3 &mpic 6 1
359 0000 0 0 4 &mpic 7 1
360 >;
361 };
362 372
363 mpic: pic@40000 { 373 01000000 0 00000000
364 clock-frequency = <0>; 374 01000000 0 00000000
365 interrupt-controller; 375 0 00100000>;
366 #address-cells = <0>;
367 #interrupt-cells = <2>;
368 reg = <40000 40000>;
369 built-in;
370 compatible = "chrp,open-pic";
371 device_type = "open-pic";
372 big-endian;
373 }; 376 };
374 }; 377 };
375}; 378};
diff --git a/arch/powerpc/boot/dts/mpc866ads.dts b/arch/powerpc/boot/dts/mpc866ads.dts
index e5e7726ddb03..90f2293ed3cd 100644
--- a/arch/powerpc/boot/dts/mpc866ads.dts
+++ b/arch/powerpc/boot/dts/mpc866ads.dts
@@ -30,7 +30,6 @@
30 timebase-frequency = <0>; 30 timebase-frequency = <0>;
31 bus-frequency = <0>; 31 bus-frequency = <0>;
32 clock-frequency = <0>; 32 clock-frequency = <0>;
33 32-bit;
34 interrupts = <f 2>; // decrementer interrupt 33 interrupts = <f 2>; // decrementer interrupt
35 interrupt-parent = <&Mpc8xx_pic>; 34 interrupt-parent = <&Mpc8xx_pic>;
36 }; 35 };
@@ -44,7 +43,6 @@
44 soc866@ff000000 { 43 soc866@ff000000 {
45 #address-cells = <1>; 44 #address-cells = <1>;
46 #size-cells = <1>; 45 #size-cells = <1>;
47 #interrupt-cells = <2>;
48 device_type = "soc"; 46 device_type = "soc";
49 ranges = <0 ff000000 00100000>; 47 ranges = <0 ff000000 00100000>;
50 reg = <ff000000 00000200>; 48 reg = <ff000000 00000200>;
@@ -78,7 +76,6 @@
78 #address-cells = <0>; 76 #address-cells = <0>;
79 #interrupt-cells = <2>; 77 #interrupt-cells = <2>;
80 reg = <0 24>; 78 reg = <0 24>;
81 built-in;
82 device_type = "mpc8xx-pic"; 79 device_type = "mpc8xx-pic";
83 compatible = "CPM"; 80 compatible = "CPM";
84 }; 81 };
@@ -86,7 +83,6 @@
86 cpm@ff000000 { 83 cpm@ff000000 {
87 #address-cells = <1>; 84 #address-cells = <1>;
88 #size-cells = <1>; 85 #size-cells = <1>;
89 #interrupt-cells = <2>;
90 device_type = "cpm"; 86 device_type = "cpm";
91 model = "CPM"; 87 model = "CPM";
92 ranges = <0 0 4000>; 88 ranges = <0 0 4000>;
@@ -103,7 +99,6 @@
103 interrupts = <5 2 0 2>; 99 interrupts = <5 2 0 2>;
104 interrupt-parent = <&Mpc8xx_pic>; 100 interrupt-parent = <&Mpc8xx_pic>;
105 reg = <930 20>; 101 reg = <930 20>;
106 built-in;
107 device_type = "cpm-pic"; 102 device_type = "cpm-pic";
108 compatible = "CPM"; 103 compatible = "CPM";
109 }; 104 };
diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts
index dc7ab9c80611..e9aa9d00da24 100644
--- a/arch/powerpc/boot/dts/mpc885ads.dts
+++ b/arch/powerpc/boot/dts/mpc885ads.dts
@@ -30,7 +30,6 @@
30 timebase-frequency = <0>; 30 timebase-frequency = <0>;
31 bus-frequency = <0>; 31 bus-frequency = <0>;
32 clock-frequency = <0>; 32 clock-frequency = <0>;
33 32-bit;
34 interrupts = <f 2>; // decrementer interrupt 33 interrupts = <f 2>; // decrementer interrupt
35 interrupt-parent = <&Mpc8xx_pic>; 34 interrupt-parent = <&Mpc8xx_pic>;
36 }; 35 };
@@ -44,7 +43,6 @@
44 soc885@ff000000 { 43 soc885@ff000000 {
45 #address-cells = <1>; 44 #address-cells = <1>;
46 #size-cells = <1>; 45 #size-cells = <1>;
47 #interrupt-cells = <2>;
48 device_type = "soc"; 46 device_type = "soc";
49 ranges = <0 ff000000 00100000>; 47 ranges = <0 ff000000 00100000>;
50 reg = <ff000000 00000200>; 48 reg = <ff000000 00000200>;
@@ -98,7 +96,6 @@
98 #address-cells = <0>; 96 #address-cells = <0>;
99 #interrupt-cells = <2>; 97 #interrupt-cells = <2>;
100 reg = <0 24>; 98 reg = <0 24>;
101 built-in;
102 device_type = "mpc8xx-pic"; 99 device_type = "mpc8xx-pic";
103 compatible = "CPM"; 100 compatible = "CPM";
104 }; 101 };
@@ -117,7 +114,6 @@
117 cpm@ff000000 { 114 cpm@ff000000 {
118 #address-cells = <1>; 115 #address-cells = <1>;
119 #size-cells = <1>; 116 #size-cells = <1>;
120 #interrupt-cells = <2>;
121 device_type = "cpm"; 117 device_type = "cpm";
122 model = "CPM"; 118 model = "CPM";
123 ranges = <0 0 4000>; 119 ranges = <0 0 4000>;
@@ -134,7 +130,6 @@
134 interrupts = <5 2 0 2>; 130 interrupts = <5 2 0 2>;
135 interrupt-parent = <&Mpc8xx_pic>; 131 interrupt-parent = <&Mpc8xx_pic>;
136 reg = <930 20>; 132 reg = <930 20>;
137 built-in;
138 device_type = "cpm-pic"; 133 device_type = "cpm-pic";
139 compatible = "CPM"; 134 compatible = "CPM";
140 }; 135 };
diff --git a/arch/powerpc/boot/dts/prpmc2800.dts b/arch/powerpc/boot/dts/prpmc2800.dts
index 5300b50cdc2f..297dfa53fe9e 100644
--- a/arch/powerpc/boot/dts/prpmc2800.dts
+++ b/arch/powerpc/boot/dts/prpmc2800.dts
@@ -9,10 +9,6 @@
9 * 9 *
10 * Property values that are labeled as "Default" will be updated by bootwrapper 10 * Property values that are labeled as "Default" will be updated by bootwrapper
11 * if it can determine the exact PrPMC type. 11 * if it can determine the exact PrPMC type.
12 *
13 * To build:
14 * dtc -I dts -O asm -o prpmc2800.S -b 0 prpmc2800.dts
15 * dtc -I dts -O dtb -o prpmc2800.dtb -b 0 prpmc2800.dts
16 */ 12 */
17 13
18/ { 14/ {
@@ -47,7 +43,6 @@
47 mv64x60@f1000000 { /* Marvell Discovery */ 43 mv64x60@f1000000 { /* Marvell Discovery */
48 #address-cells = <1>; 44 #address-cells = <1>;
49 #size-cells = <1>; 45 #size-cells = <1>;
50 #interrupt-cells = <1>;
51 model = "mv64360"; /* Default */ 46 model = "mv64360"; /* Default */
52 compatible = "marvell,mv64x60"; 47 compatible = "marvell,mv64x60";
53 clock-frequency = <7f28155>; /* 133.333333 MHz */ 48 clock-frequency = <7f28155>; /* 133.333333 MHz */
diff --git a/arch/powerpc/boot/dts/sequoia.dts b/arch/powerpc/boot/dts/sequoia.dts
new file mode 100644
index 000000000000..36be75b04de1
--- /dev/null
+++ b/arch/powerpc/boot/dts/sequoia.dts
@@ -0,0 +1,302 @@
1/*
2 * Device Tree Source for AMCC Sequoia
3 *
4 * Based on Bamboo code by Josh Boyer <jwboyer@linux.vnet.ibm.com>
5 * Copyright (c) 2006, 2007 IBM Corp.
6 *
7 * FIXME: Draft only!
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without
11 * any warranty of any kind, whether express or implied.
12 *
13 */
14
15/ {
16 #address-cells = <2>;
17 #size-cells = <1>;
18 model = "amcc,sequoia";
19 compatible = "amcc,sequoia";
20 dcr-parent = <&/cpus/PowerPC,440EPx@0>;
21
22 cpus {
23 #address-cells = <1>;
24 #size-cells = <0>;
25
26 PowerPC,440EPx@0 {
27 device_type = "cpu";
28 reg = <0>;
29 clock-frequency = <0>; /* Filled in by zImage */
30 timebase-frequency = <0>; /* Filled in by zImage */
31 i-cache-line-size = <20>;
32 d-cache-line-size = <20>;
33 i-cache-size = <8000>;
34 d-cache-size = <8000>;
35 dcr-controller;
36 dcr-access-method = "native";
37 };
38 };
39
40 memory {
41 device_type = "memory";
42 reg = <0 0 0>; /* Filled in by zImage */
43 };
44
45 UIC0: interrupt-controller0 {
46 compatible = "ibm,uic-440epx","ibm,uic";
47 interrupt-controller;
48 cell-index = <0>;
49 dcr-reg = <0c0 009>;
50 #address-cells = <0>;
51 #size-cells = <0>;
52 #interrupt-cells = <2>;
53 };
54
55 UIC1: interrupt-controller1 {
56 compatible = "ibm,uic-440epx","ibm,uic";
57 interrupt-controller;
58 cell-index = <1>;
59 dcr-reg = <0d0 009>;
60 #address-cells = <0>;
61 #size-cells = <0>;
62 #interrupt-cells = <2>;
63 interrupts = <1e 4 1f 4>; /* cascade */
64 interrupt-parent = <&UIC0>;
65 };
66
67 UIC2: interrupt-controller2 {
68 compatible = "ibm,uic-440epx","ibm,uic";
69 interrupt-controller;
70 cell-index = <2>;
71 dcr-reg = <0e0 009>;
72 #address-cells = <0>;
73 #size-cells = <0>;
74 #interrupt-cells = <2>;
75 interrupts = <1c 4 1d 4>; /* cascade */
76 interrupt-parent = <&UIC0>;
77 };
78
79 SDR0: sdr {
80 compatible = "ibm,sdr-440epx", "ibm,sdr-440ep";
81 dcr-reg = <00e 002>;
82 };
83
84 CPR0: cpr {
85 compatible = "ibm,cpr-440epx", "ibm,cpr-440ep";
86 dcr-reg = <00c 002>;
87 };
88
89 plb {
90 compatible = "ibm,plb-440epx", "ibm,plb4";
91 #address-cells = <2>;
92 #size-cells = <1>;
93 ranges;
94 clock-frequency = <0>; /* Filled in by zImage */
95
96 SDRAM0: sdram {
97 device_type = "memory-controller";
98 compatible = "ibm,sdram-440epx", "ibm,sdram-44x-ddr2denali";
99 dcr-reg = <010 2>;
100 };
101
102 DMA0: dma {
103 compatible = "ibm,dma-440epx", "ibm,dma-4xx";
104 dcr-reg = <100 027>;
105 };
106
107 MAL0: mcmal {
108 compatible = "ibm,mcmal-440epx", "ibm,mcmal2";
109 dcr-reg = <180 62>;
110 num-tx-chans = <2>;
111 num-rx-chans = <2>;
112 interrupt-parent = <&MAL0>;
113 interrupts = <0 1 2 3 4>;
114 #interrupt-cells = <1>;
115 #address-cells = <0>;
116 #size-cells = <0>;
117 interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
118 /*RXEOB*/ 1 &UIC0 b 4
119 /*SERR*/ 2 &UIC1 0 4
120 /*TXDE*/ 3 &UIC1 1 4
121 /*RXDE*/ 4 &UIC1 2 4>;
122 interrupt-map-mask = <ffffffff>;
123 };
124
125 POB0: opb {
126 compatible = "ibm,opb-440epx", "ibm,opb";
127 #address-cells = <1>;
128 #size-cells = <1>;
129 ranges = <00000000 1 00000000 80000000
130 80000000 1 80000000 80000000>;
131 interrupt-parent = <&UIC1>;
132 interrupts = <7 4>;
133 clock-frequency = <0>; /* Filled in by zImage */
134
135 EBC0: ebc {
136 compatible = "ibm,ebc-440epx", "ibm,ebc";
137 dcr-reg = <012 2>;
138 #address-cells = <2>;
139 #size-cells = <1>;
140 clock-frequency = <0>; /* Filled in by zImage */
141 interrupts = <5 1>;
142 interrupt-parent = <&UIC1>;
143
144 nor_flash@0,0 {
145 compatible = "amd,s29gl256n", "cfi-flash";
146 bank-width = <2>;
147 reg = <0 000000 4000000>;
148 #address-cells = <1>;
149 #size-cells = <1>;
150 partition@0 {
151 label = "Kernel";
152 reg = <0 180000>;
153 };
154 partition@180000 {
155 label = "ramdisk";
156 reg = <180000 200000>;
157 };
158 partition@380000 {
159 label = "file system";
160 reg = <380000 3aa0000>;
161 };
162 partition@3e20000 {
163 label = "kozio";
164 reg = <3e20000 140000>;
165 };
166 partition@3f60000 {
167 label = "env";
168 reg = <3f60000 40000>;
169 };
170 partition@3fa0000 {
171 label = "u-boot";
172 reg = <3fa0000 60000>;
173 };
174 };
175
176 };
177
178 UART0: serial@ef600300 {
179 device_type = "serial";
180 compatible = "ns16550";
181 reg = <ef600300 8>;
182 virtual-reg = <ef600300>;
183 clock-frequency = <0>; /* Filled in by zImage */
184 current-speed = <1c200>;
185 interrupt-parent = <&UIC0>;
186 interrupts = <0 4>;
187 };
188
189 UART1: serial@ef600400 {
190 device_type = "serial";
191 compatible = "ns16550";
192 reg = <ef600400 8>;
193 virtual-reg = <ef600400>;
194 clock-frequency = <0>;
195 current-speed = <0>;
196 interrupt-parent = <&UIC0>;
197 interrupts = <1 4>;
198 };
199
200 UART2: serial@ef600500 {
201 device_type = "serial";
202 compatible = "ns16550";
203 reg = <ef600500 8>;
204 virtual-reg = <ef600500>;
205 clock-frequency = <0>;
206 current-speed = <0>;
207 interrupt-parent = <&UIC1>;
208 interrupts = <3 4>;
209 };
210
211 UART3: serial@ef600600 {
212 device_type = "serial";
213 compatible = "ns16550";
214 reg = <ef600600 8>;
215 virtual-reg = <ef600600>;
216 clock-frequency = <0>;
217 current-speed = <0>;
218 interrupt-parent = <&UIC1>;
219 interrupts = <4 4>;
220 };
221
222 IIC0: i2c@ef600700 {
223 device_type = "i2c";
224 compatible = "ibm,iic-440epx", "ibm,iic";
225 reg = <ef600700 14>;
226 interrupt-parent = <&UIC0>;
227 interrupts = <2 4>;
228 };
229
230 IIC1: i2c@ef600800 {
231 device_type = "i2c";
232 compatible = "ibm,iic-440epx", "ibm,iic";
233 reg = <ef600800 14>;
234 interrupt-parent = <&UIC0>;
235 interrupts = <7 4>;
236 };
237
238 ZMII0: emac-zmii@ef600d00 {
239 device_type = "zmii-interface";
240 compatible = "ibm,zmii-440epx", "ibm,zmii";
241 reg = <ef600d00 c>;
242 };
243
244 EMAC0: ethernet@ef600e00 {
245 linux,network-index = <0>;
246 device_type = "network";
247 compatible = "ibm,emac-440epx", "ibm,emac4";
248 interrupt-parent = <&EMAC0>;
249 interrupts = <0 1>;
250 #interrupt-cells = <1>;
251 #address-cells = <0>;
252 #size-cells = <0>;
253 interrupt-map = </*Status*/ 0 &UIC0 18 4
254 /*Wake*/ 1 &UIC1 1d 4>;
255 reg = <ef600e00 70>;
256 local-mac-address = [000000000000];
257 mal-device = <&MAL0>;
258 mal-tx-channel = <0>;
259 mal-rx-channel = <0>;
260 cell-index = <0>;
261 max-frame-size = <5dc>;
262 rx-fifo-size = <1000>;
263 tx-fifo-size = <800>;
264 phy-mode = "rmii";
265 phy-map = <00000000>;
266 zmii-device = <&ZMII0>;
267 zmii-channel = <0>;
268 };
269
270 EMAC1: ethernet@ef600f00 {
271 linux,network-index = <1>;
272 device_type = "network";
273 compatible = "ibm,emac-440epx", "ibm,emac4";
274 interrupt-parent = <&EMAC1>;
275 interrupts = <0 1>;
276 #interrupt-cells = <1>;
277 #address-cells = <0>;
278 #size-cells = <0>;
279 interrupt-map = </*Status*/ 0 &UIC0 19 4
280 /*Wake*/ 1 &UIC1 1f 4>;
281 reg = <ef600f00 70>;
282 local-mac-address = [000000000000];
283 mal-device = <&MAL0>;
284 mal-tx-channel = <1>;
285 mal-rx-channel = <1>;
286 cell-index = <1>;
287 max-frame-size = <5dc>;
288 rx-fifo-size = <1000>;
289 tx-fifo-size = <800>;
290 phy-mode = "rmii";
291 phy-map = <00000000>;
292 zmii-device = <&ZMII0>;
293 zmii-channel = <1>;
294 };
295 };
296 };
297
298 chosen {
299 linux,stdout-path = "/plb/opb/serial@ef600300";
300 bootargs = "console=ttyS0,115200";
301 };
302};
diff --git a/arch/powerpc/boot/dts/walnut.dts b/arch/powerpc/boot/dts/walnut.dts
new file mode 100644
index 000000000000..ec54f4e04ad6
--- /dev/null
+++ b/arch/powerpc/boot/dts/walnut.dts
@@ -0,0 +1,190 @@
1/*
2 * Device Tree Source for IBM Walnut
3 *
4 * Copyright 2007 IBM Corp.
5 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without
9 * any warranty of any kind, whether express or implied.
10 */
11
12/ {
13 #address-cells = <1>;
14 #size-cells = <1>;
15 model = "ibm,walnut";
16 compatible = "ibm,walnut";
17 dcr-parent = <&/cpus/PowerPC,405GP@0>;
18
19 cpus {
20 #address-cells = <1>;
21 #size-cells = <0>;
22
23 PowerPC,405GP@0 {
24 device_type = "cpu";
25 reg = <0>;
26 clock-frequency = <bebc200>; /* Filled in by zImage */
27 timebase-frequency = <0>; /* Filled in by zImage */
28 i-cache-line-size = <20>;
29 d-cache-line-size = <20>;
30 i-cache-size = <4000>;
31 d-cache-size = <4000>;
32 dcr-controller;
33 dcr-access-method = "native";
34 };
35 };
36
37 memory {
38 device_type = "memory";
39 reg = <0 0>; /* Filled in by zImage */
40 };
41
42 UIC0: interrupt-controller {
43 compatible = "ibm,uic";
44 interrupt-controller;
45 cell-index = <0>;
46 dcr-reg = <0c0 9>;
47 #address-cells = <0>;
48 #size-cells = <0>;
49 #interrupt-cells = <2>;
50 };
51
52 plb {
53 compatible = "ibm,plb3";
54 #address-cells = <1>;
55 #size-cells = <1>;
56 ranges;
57 clock-frequency = <0>; /* Filled in by zImage */
58
59 SDRAM0: memory-controller {
60 compatible = "ibm,sdram-405gp";
61 dcr-reg = <010 2>;
62 };
63
64 MAL: mcmal {
65 compatible = "ibm,mcmal-405gp", "ibm,mcmal";
66 dcr-reg = <180 62>;
67 num-tx-chans = <2>;
68 num-rx-chans = <1>;
69 interrupt-parent = <&UIC0>;
70 interrupts = <a 4 b 4 c 4 d 4 e 4>;
71 };
72
73 POB0: opb {
74 compatible = "ibm,opb-405gp", "ibm,opb";
75 #address-cells = <1>;
76 #size-cells = <1>;
77 ranges = <ef600000 ef600000 a00000>;
78 dcr-reg = <0a0 5>;
79 clock-frequency = <0>; /* Filled in by zImage */
80
81 UART0: serial@ef600300 {
82 device_type = "serial";
83 compatible = "ns16550";
84 reg = <ef600300 8>;
85 virtual-reg = <ef600300>;
86 clock-frequency = <0>; /* Filled in by zImage */
87 current-speed = <2580>;
88 interrupt-parent = <&UIC0>;
89 interrupts = <0 4>;
90 };
91
92 UART1: serial@ef600400 {
93 device_type = "serial";
94 compatible = "ns16550";
95 reg = <ef600400 8>;
96 virtual-reg = <ef600400>;
97 clock-frequency = <0>; /* Filled in by zImage */
98 current-speed = <2580>;
99 interrupt-parent = <&UIC0>;
100 interrupts = <1 4>;
101 };
102
103 IIC: i2c@ef600500 {
104 compatible = "ibm,iic-405gp", "ibm,iic";
105 reg = <ef600500 11>;
106 interrupt-parent = <&UIC0>;
107 interrupts = <2 4>;
108 };
109
110 GPIO: gpio@ef600700 {
111 compatible = "ibm,gpio-405gp";
112 reg = <ef600700 20>;
113 };
114
115 EMAC: ethernet@ef600800 {
116 linux,network-index = <0>;
117 device_type = "network";
118 compatible = "ibm,emac-405gp", "ibm,emac";
119 interrupt-parent = <&UIC0>;
120 interrupts = <9 4 f 4>;
121 reg = <ef600800 70>;
122 mal-device = <&MAL>;
123 mal-tx-channel = <0 1>;
124 mal-rx-channel = <0>;
125 cell-index = <0>;
126 max-frame-size = <5dc>;
127 rx-fifo-size = <1000>;
128 tx-fifo-size = <800>;
129 phy-mode = "rmii";
130 phy-map = <00000001>;
131 };
132
133 };
134
135 EBC0: ebc {
136 compatible = "ibm,ebc-405gp", "ibm,ebc";
137 dcr-reg = <012 2>;
138 #address-cells = <2>;
139 #size-cells = <1>;
140 /* The ranges property is supplied by the bootwrapper
141 * and is based on the firmware's configuration of the
142 * EBC bridge
143 */
144 clock-frequency = <0>; /* Filled in by zImage */
145
146 sram@0,0 {
147 reg = <0 0 80000>;
148 };
149
150 flash@0,80000 {
151 compatible = "jedec-flash";
152 bank-width = <1>;
153 reg = <0 80000 80000>;
154 #address-cells = <1>;
155 #size-cells = <1>;
156 partition@0 {
157 label = "OpenBIOS";
158 reg = <0 80000>;
159 read-only;
160 };
161 };
162
163 ds1743@1,0 {
164 /* NVRAM and RTC */
165 compatible = "ds1743";
166 reg = <1 0 2000>;
167 };
168
169 keyboard@2,0 {
170 compatible = "intel,82C42PC";
171 reg = <2 0 2>;
172 };
173
174 ir@3,0 {
175 compatible = "ti,TIR2000PAG";
176 reg = <3 0 10>;
177 };
178
179 fpga@7,0 {
180 compatible = "Walnut-FPGA";
181 reg = <7 0 10>;
182 virtual-reg = <f0300005>;
183 };
184 };
185 };
186
187 chosen {
188 linux,stdout-path = "/plb/opb/serial@ef600300";
189 };
190};
diff --git a/arch/powerpc/boot/ebony.c b/arch/powerpc/boot/ebony.c
index 75daedafd0a4..86c0f5df0a86 100644
--- a/arch/powerpc/boot/ebony.c
+++ b/arch/powerpc/boot/ebony.c
@@ -24,12 +24,11 @@
24#include "page.h" 24#include "page.h"
25#include "ops.h" 25#include "ops.h"
26#include "reg.h" 26#include "reg.h"
27#include "io.h"
27#include "dcr.h" 28#include "dcr.h"
29#include "4xx.h"
28#include "44x.h" 30#include "44x.h"
29 31
30extern char _dtb_start[];
31extern char _dtb_end[];
32
33static u8 *ebony_mac0, *ebony_mac1; 32static u8 *ebony_mac0, *ebony_mac1;
34 33
35/* Calculate 440GP clocks */ 34/* Calculate 440GP clocks */
@@ -92,15 +91,53 @@ void ibm440gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
92 dt_fixup_clock("/plb/opb/serial@40000300", uart1); 91 dt_fixup_clock("/plb/opb/serial@40000300", uart1);
93} 92}
94 93
94#define EBONY_FPGA_PATH "/plb/opb/ebc/fpga"
95#define EBONY_FPGA_FLASH_SEL 0x01
96#define EBONY_SMALL_FLASH_PATH "/plb/opb/ebc/small-flash"
97
98static void ebony_flashsel_fixup(void)
99{
100 void *devp;
101 u32 reg[3] = {0x0, 0x0, 0x80000};
102 u8 *fpga;
103 u8 fpga_reg0 = 0x0;
104
105 devp = finddevice(EBONY_FPGA_PATH);
106 if (!devp)
107 fatal("Couldn't locate FPGA node %s\n\r", EBONY_FPGA_PATH);
108
109 if (getprop(devp, "virtual-reg", &fpga, sizeof(fpga)) != sizeof(fpga))
110 fatal("%s has missing or invalid virtual-reg property\n\r",
111 EBONY_FPGA_PATH);
112
113 fpga_reg0 = in_8(fpga);
114
115 devp = finddevice(EBONY_SMALL_FLASH_PATH);
116 if (!devp)
117 fatal("Couldn't locate small flash node %s\n\r",
118 EBONY_SMALL_FLASH_PATH);
119
120 if (getprop(devp, "reg", reg, sizeof(reg)) != sizeof(reg))
121 fatal("%s has reg property of unexpected size\n\r",
122 EBONY_SMALL_FLASH_PATH);
123
124 /* Invert address bit 14 (IBM-endian) if FLASH_SEL fpga bit is set */
125 if (fpga_reg0 & EBONY_FPGA_FLASH_SEL)
126 reg[1] ^= 0x80000;
127
128 setprop(devp, "reg", reg, sizeof(reg));
129}
130
95static void ebony_fixups(void) 131static void ebony_fixups(void)
96{ 132{
97 // FIXME: sysclk should be derived by reading the FPGA registers 133 // FIXME: sysclk should be derived by reading the FPGA registers
98 unsigned long sysclk = 33000000; 134 unsigned long sysclk = 33000000;
99 135
100 ibm440gp_fixup_clocks(sysclk, 6 * 1843200); 136 ibm440gp_fixup_clocks(sysclk, 6 * 1843200);
101 ibm44x_fixup_memsize(); 137 ibm4xx_fixup_memsize();
102 dt_fixup_mac_addresses(ebony_mac0, ebony_mac1); 138 dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
103 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); 139 ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
140 ebony_flashsel_fixup();
104} 141}
105 142
106void ebony_init(void *mac0, void *mac1) 143void ebony_init(void *mac0, void *mac1)
diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c
index 13761bf160c4..cf30675c6116 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -354,16 +354,21 @@ static void ft_put_bin(struct ft_cxt *cxt, const void *data, unsigned int sz)
354 cxt->p += sza; 354 cxt->p += sza;
355} 355}
356 356
357int ft_begin_node(struct ft_cxt *cxt, const char *name) 357char *ft_begin_node(struct ft_cxt *cxt, const char *name)
358{ 358{
359 unsigned long nlen = strlen(name) + 1; 359 unsigned long nlen = strlen(name) + 1;
360 unsigned long len = 8 + _ALIGN(nlen, 4); 360 unsigned long len = 8 + _ALIGN(nlen, 4);
361 char *ret;
361 362
362 if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, len)) 363 if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, len))
363 return -1; 364 return NULL;
365
366 ret = cxt->p;
367
364 ft_put_word(cxt, OF_DT_BEGIN_NODE); 368 ft_put_word(cxt, OF_DT_BEGIN_NODE);
365 ft_put_bin(cxt, name, strlen(name) + 1); 369 ft_put_bin(cxt, name, strlen(name) + 1);
366 return 0; 370
371 return ret;
367} 372}
368 373
369void ft_end_node(struct ft_cxt *cxt) 374void ft_end_node(struct ft_cxt *cxt)
@@ -625,25 +630,17 @@ void ft_end_tree(struct ft_cxt *cxt)
625 bph->dt_strings_size = cpu_to_be32(ssize); 630 bph->dt_strings_size = cpu_to_be32(ssize);
626} 631}
627 632
628void *ft_find_device(struct ft_cxt *cxt, const char *srch_path) 633void *ft_find_device(struct ft_cxt *cxt, const void *top, const char *srch_path)
629{
630 char *node;
631
632 /* require absolute path */
633 if (srch_path[0] != '/')
634 return NULL;
635 node = ft_find_descendent(cxt, ft_root_node(cxt), srch_path);
636 return ft_get_phandle(cxt, node);
637}
638
639void *ft_find_device_rel(struct ft_cxt *cxt, const void *top,
640 const char *srch_path)
641{ 634{
642 char *node; 635 char *node;
643 636
644 node = ft_node_ph2node(cxt, top); 637 if (top) {
645 if (node == NULL) 638 node = ft_node_ph2node(cxt, top);
646 return NULL; 639 if (node == NULL)
640 return NULL;
641 } else {
642 node = ft_root_node(cxt);
643 }
647 644
648 node = ft_find_descendent(cxt, node, srch_path); 645 node = ft_find_descendent(cxt, node, srch_path);
649 return ft_get_phandle(cxt, node); 646 return ft_get_phandle(cxt, node);
@@ -945,7 +942,7 @@ int ft_del_prop(struct ft_cxt *cxt, const void *phandle, const char *propname)
945void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name) 942void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name)
946{ 943{
947 struct ft_atom atom; 944 struct ft_atom atom;
948 char *p, *next; 945 char *p, *next, *ret;
949 int depth = 0; 946 int depth = 0;
950 947
951 if (parent) { 948 if (parent) {
@@ -970,11 +967,70 @@ void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name)
970 break; 967 break;
971 /* end of node, insert here */ 968 /* end of node, insert here */
972 cxt->p = p; 969 cxt->p = p;
973 ft_begin_node(cxt, name); 970 ret = ft_begin_node(cxt, name);
974 ft_end_node(cxt); 971 ft_end_node(cxt);
975 return p; 972 return ft_get_phandle(cxt, ret);
976 } 973 }
977 p = next; 974 p = next;
978 } 975 }
979 return NULL; 976 return NULL;
980} 977}
978
979/* Returns the start of the path within the provided buffer, or NULL on
980 * error.
981 */
982char *ft_get_path(struct ft_cxt *cxt, const void *phandle,
983 char *buf, int len)
984{
985 const char *path_comp[FT_MAX_DEPTH];
986 struct ft_atom atom;
987 char *p, *next, *pos;
988 int depth = 0, i;
989 void *node;
990
991 node = ft_node_ph2node(cxt, phandle);
992 if (node == NULL)
993 return NULL;
994
995 p = ft_root_node(cxt);
996
997 while ((next = ft_next(cxt, p, &atom)) != NULL) {
998 switch (atom.tag) {
999 case OF_DT_BEGIN_NODE:
1000 path_comp[depth++] = atom.name;
1001 if (p == node)
1002 goto found;
1003
1004 break;
1005
1006 case OF_DT_END_NODE:
1007 if (--depth == 0)
1008 return NULL;
1009 }
1010
1011 p = next;
1012 }
1013
1014found:
1015 pos = buf;
1016 for (i = 1; i < depth; i++) {
1017 int this_len;
1018
1019 if (len <= 1)
1020 return NULL;
1021
1022 *pos++ = '/';
1023 len--;
1024
1025 strncpy(pos, path_comp[i], len);
1026
1027 if (pos[len - 1] != 0)
1028 return NULL;
1029
1030 this_len = strlen(pos);
1031 len -= this_len;
1032 pos += this_len;
1033 }
1034
1035 return buf;
1036}
diff --git a/arch/powerpc/boot/flatdevtree.h b/arch/powerpc/boot/flatdevtree.h
index cb26325d72db..b0957a2d967f 100644
--- a/arch/powerpc/boot/flatdevtree.h
+++ b/arch/powerpc/boot/flatdevtree.h
@@ -76,7 +76,7 @@ struct ft_cxt {
76 unsigned int nodes_used; 76 unsigned int nodes_used;
77}; 77};
78 78
79int ft_begin_node(struct ft_cxt *cxt, const char *name); 79char *ft_begin_node(struct ft_cxt *cxt, const char *name);
80void ft_end_node(struct ft_cxt *cxt); 80void ft_end_node(struct ft_cxt *cxt);
81 81
82void ft_begin_tree(struct ft_cxt *cxt); 82void ft_begin_tree(struct ft_cxt *cxt);
@@ -96,9 +96,8 @@ int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
96 96
97void ft_dump_blob(const void *bphp); 97void ft_dump_blob(const void *bphp);
98void ft_merge_blob(struct ft_cxt *cxt, void *blob); 98void ft_merge_blob(struct ft_cxt *cxt, void *blob);
99void *ft_find_device(struct ft_cxt *cxt, const char *srch_path); 99void *ft_find_device(struct ft_cxt *cxt, const void *top,
100void *ft_find_device_rel(struct ft_cxt *cxt, const void *top, 100 const char *srch_path);
101 const char *srch_path);
102void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path); 101void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path);
103int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname, 102int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
104 void *buf, const unsigned int buflen); 103 void *buf, const unsigned int buflen);
@@ -109,5 +108,6 @@ void *ft_find_node_by_prop_value(struct ft_cxt *cxt, const void *prev,
109 const char *propname, const char *propval, 108 const char *propname, const char *propval,
110 int proplen); 109 int proplen);
111void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name); 110void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name);
111char *ft_get_path(struct ft_cxt *cxt, const void *phandle, char *buf, int len);
112 112
113#endif /* FLATDEVTREE_H */ 113#endif /* FLATDEVTREE_H */
diff --git a/arch/powerpc/boot/flatdevtree_env.h b/arch/powerpc/boot/flatdevtree_env.h
index 83bc1c718836..ad0420da8921 100644
--- a/arch/powerpc/boot/flatdevtree_env.h
+++ b/arch/powerpc/boot/flatdevtree_env.h
@@ -24,24 +24,4 @@
24#define be64_to_cpu(x) (x) 24#define be64_to_cpu(x) (x)
25#define cpu_to_be64(x) (x) 25#define cpu_to_be64(x) (x)
26 26
27static inline int strncmp(const char *cs, const char *ct, size_t count)
28{
29 signed char __res = 0;
30
31 while (count) {
32 if ((__res = *cs - *ct++) != 0 || !*cs++)
33 break;
34 count--;
35 }
36 return __res;
37}
38
39static inline char *strchr(const char *s, int c)
40{
41 for (; *s != (char)c; ++s)
42 if (*s == '\0')
43 return NULL;
44 return (char *)s;
45}
46
47#endif /* _PPC_BOOT_FLATDEVTREE_ENV_H_ */ 27#endif /* _PPC_BOOT_FLATDEVTREE_ENV_H_ */
diff --git a/arch/powerpc/boot/flatdevtree_misc.c b/arch/powerpc/boot/flatdevtree_misc.c
index 4341e6558c1a..b3670096fa71 100644
--- a/arch/powerpc/boot/flatdevtree_misc.c
+++ b/arch/powerpc/boot/flatdevtree_misc.c
@@ -18,7 +18,7 @@ static struct ft_cxt cxt;
18 18
19static void *fdtm_finddevice(const char *name) 19static void *fdtm_finddevice(const char *name)
20{ 20{
21 return ft_find_device(&cxt, name); 21 return ft_find_device(&cxt, NULL, name);
22} 22}
23 23
24static int fdtm_getprop(const void *phandle, const char *propname, 24static int fdtm_getprop(const void *phandle, const char *propname,
@@ -58,6 +58,11 @@ static unsigned long fdtm_finalize(void)
58 return (unsigned long)cxt.bph; 58 return (unsigned long)cxt.bph;
59} 59}
60 60
61static char *fdtm_get_path(const void *phandle, char *buf, int len)
62{
63 return ft_get_path(&cxt, phandle, buf, len);
64}
65
61int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device) 66int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device)
62{ 67{
63 dt_ops.finddevice = fdtm_finddevice; 68 dt_ops.finddevice = fdtm_finddevice;
@@ -67,6 +72,7 @@ int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device)
67 dt_ops.create_node = fdtm_create_node; 72 dt_ops.create_node = fdtm_create_node;
68 dt_ops.find_node_by_prop_value = fdtm_find_node_by_prop_value; 73 dt_ops.find_node_by_prop_value = fdtm_find_node_by_prop_value;
69 dt_ops.finalize = fdtm_finalize; 74 dt_ops.finalize = fdtm_finalize;
75 dt_ops.get_path = fdtm_get_path;
70 76
71 return ft_open(&cxt, dt_blob, max_size, max_find_device, 77 return ft_open(&cxt, dt_blob, max_size, max_find_device,
72 platform_ops.realloc); 78 platform_ops.realloc);
diff --git a/arch/powerpc/boot/gunzip_util.c b/arch/powerpc/boot/gunzip_util.c
index df8ab07e9ff4..ef2aed0f63ca 100644
--- a/arch/powerpc/boot/gunzip_util.c
+++ b/arch/powerpc/boot/gunzip_util.c
@@ -78,6 +78,7 @@ void gunzip_start(struct gunzip_state *state, void *src, int srclen)
78 fatal("inflateInit2 returned %d\n\r", r); 78 fatal("inflateInit2 returned %d\n\r", r);
79 } 79 }
80 80
81 state->s.total_in = hdrlen;
81 state->s.next_in = src + hdrlen; 82 state->s.next_in = src + hdrlen;
82 state->s.avail_in = srclen - hdrlen; 83 state->s.avail_in = srclen - hdrlen;
83} 84}
@@ -193,13 +194,10 @@ int gunzip_finish(struct gunzip_state *state, void *dst, int dstlen)
193{ 194{
194 int len; 195 int len;
195 196
197 len = gunzip_partial(state, dst, dstlen);
198
196 if (state->s.workspace) { 199 if (state->s.workspace) {
197 len = gunzip_partial(state, dst, dstlen);
198 zlib_inflateEnd(&state->s); 200 zlib_inflateEnd(&state->s);
199 } else {
200 /* uncompressed image */
201 len = min(state->s.avail_in, (unsigned)dstlen);
202 memcpy(dst, state->s.next_in, len);
203 } 201 }
204 202
205 return len; 203 return len;
diff --git a/arch/powerpc/boot/holly.c b/arch/powerpc/boot/holly.c
index 7d6539f5e22c..199e783aea4d 100644
--- a/arch/powerpc/boot/holly.c
+++ b/arch/powerpc/boot/holly.c
@@ -21,11 +21,6 @@
21#include "ops.h" 21#include "ops.h"
22#include "io.h" 22#include "io.h"
23 23
24extern char _start[];
25extern char _end[];
26extern char _dtb_start[];
27extern char _dtb_end[];
28
29BSS_STACK(4096); 24BSS_STACK(4096);
30 25
31void platform_init(unsigned long r3, unsigned long r4, unsigned long r5) 26void platform_init(unsigned long r3, unsigned long r4, unsigned long r5)
diff --git a/arch/powerpc/boot/io.h b/arch/powerpc/boot/io.h
index 32974ed49e02..ccaedaec50d5 100644
--- a/arch/powerpc/boot/io.h
+++ b/arch/powerpc/boot/io.h
@@ -1,5 +1,8 @@
1#ifndef _IO_H 1#ifndef _IO_H
2#define __IO_H 2#define __IO_H
3
4#include "types.h"
5
3/* 6/*
4 * Low-level I/O routines. 7 * Low-level I/O routines.
5 * 8 *
@@ -20,6 +23,37 @@ static inline void out_8(volatile unsigned char *addr, int val)
20 : "=m" (*addr) : "r" (val)); 23 : "=m" (*addr) : "r" (val));
21} 24}
22 25
26static inline unsigned in_le16(const volatile u16 *addr)
27{
28 unsigned ret;
29
30 __asm__ __volatile__("lhbrx %0,0,%1; twi 0,%0,0; isync"
31 : "=r" (ret) : "r" (addr), "m" (*addr));
32
33 return ret;
34}
35
36static inline unsigned in_be16(const volatile u16 *addr)
37{
38 unsigned ret;
39
40 __asm__ __volatile__("lhz%U1%X1 %0,%1; twi 0,%0,0; isync"
41 : "=r" (ret) : "m" (*addr));
42 return ret;
43}
44
45static inline void out_le16(volatile u16 *addr, int val)
46{
47 __asm__ __volatile__("sthbrx %1,0,%2; sync" : "=m" (*addr)
48 : "r" (val), "r" (addr));
49}
50
51static inline void out_be16(volatile u16 *addr, int val)
52{
53 __asm__ __volatile__("sth%U0%X0 %1,%0; sync"
54 : "=m" (*addr) : "r" (val));
55}
56
23static inline unsigned in_le32(const volatile unsigned *addr) 57static inline unsigned in_le32(const volatile unsigned *addr)
24{ 58{
25 unsigned ret; 59 unsigned ret;
@@ -50,4 +84,19 @@ static inline void out_be32(volatile unsigned *addr, int val)
50 : "=m" (*addr) : "r" (val)); 84 : "=m" (*addr) : "r" (val));
51} 85}
52 86
87static inline void sync(void)
88{
89 asm volatile("sync" : : : "memory");
90}
91
92static inline void eieio(void)
93{
94 asm volatile("eieio" : : : "memory");
95}
96
97static inline void barrier(void)
98{
99 asm volatile("" : : : "memory");
100}
101
53#endif /* _IO_H */ 102#endif /* _IO_H */
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c
index 416dc3857bfe..1b496b37eca0 100644
--- a/arch/powerpc/boot/main.c
+++ b/arch/powerpc/boot/main.c
@@ -19,16 +19,6 @@
19#include "flatdevtree.h" 19#include "flatdevtree.h"
20#include "reg.h" 20#include "reg.h"
21 21
22extern char _start[];
23extern char __bss_start[];
24extern char _end[];
25extern char _vmlinux_start[];
26extern char _vmlinux_end[];
27extern char _initrd_start[];
28extern char _initrd_end[];
29extern char _dtb_start[];
30extern char _dtb_end[];
31
32static struct gunzip_state gzstate; 22static struct gunzip_state gzstate;
33 23
34struct addr_range { 24struct addr_range {
diff --git a/arch/powerpc/boot/mpc52xx-psc.c b/arch/powerpc/boot/mpc52xx-psc.c
new file mode 100644
index 000000000000..1074626e6a37
--- /dev/null
+++ b/arch/powerpc/boot/mpc52xx-psc.c
@@ -0,0 +1,69 @@
1/*
2 * MPC5200 PSC serial console support.
3 *
4 * Author: Grant Likely <grant.likely@secretlab.ca>
5 *
6 * Copyright (c) 2007 Secret Lab Technologies Ltd.
7 * Copyright (c) 2007 Freescale Semiconductor, Inc.
8 *
9 * It is assumed that the firmware (or the platform file) has already set
10 * up the port.
11 */
12
13#include "types.h"
14#include "io.h"
15#include "ops.h"
16
17/* Programmable Serial Controller (PSC) status register bits */
18#define MPC52xx_PSC_SR 0x04
19#define MPC52xx_PSC_SR_RXRDY 0x0100
20#define MPC52xx_PSC_SR_RXFULL 0x0200
21#define MPC52xx_PSC_SR_TXRDY 0x0400
22#define MPC52xx_PSC_SR_TXEMP 0x0800
23
24#define MPC52xx_PSC_BUFFER 0x0C
25
26static void *psc;
27
28static int psc_open(void)
29{
30 /* Assume the firmware has already configured the PSC into
31 * uart mode */
32 return 0;
33}
34
35static void psc_putc(unsigned char c)
36{
37 while (!(in_be16(psc + MPC52xx_PSC_SR) & MPC52xx_PSC_SR_TXRDY)) ;
38 out_8(psc + MPC52xx_PSC_BUFFER, c);
39}
40
41static unsigned char psc_tstc(void)
42{
43 return (in_be16(psc + MPC52xx_PSC_SR) & MPC52xx_PSC_SR_RXRDY) != 0;
44}
45
46static unsigned char psc_getc(void)
47{
48 while (!(in_be16(psc + MPC52xx_PSC_SR) & MPC52xx_PSC_SR_RXRDY)) ;
49 return in_8(psc + MPC52xx_PSC_BUFFER);
50}
51
52int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp)
53{
54 int n;
55
56 /* Get the base address of the psc registers */
57 n = getprop(devp, "virtual-reg", &psc, sizeof(psc));
58 if (n != sizeof(psc)) {
59 if (!dt_xlate_reg(devp, 0, (void *)&psc, NULL))
60 return -1;
61 }
62
63 scdp->open = psc_open;
64 scdp->putc = psc_putc;
65 scdp->getc = psc_getc;
66 scdp->tstc = psc_tstc;
67
68 return 0;
69}
diff --git a/arch/powerpc/boot/mpsc.c b/arch/powerpc/boot/mpsc.c
index f1c0e965e5ce..802ea53790d8 100644
--- a/arch/powerpc/boot/mpsc.c
+++ b/arch/powerpc/boot/mpsc.c
@@ -17,7 +17,6 @@
17#include "io.h" 17#include "io.h"
18#include "ops.h" 18#include "ops.h"
19 19
20extern void udelay(long delay);
21 20
22#define MPSC_CHR_1 0x000c 21#define MPSC_CHR_1 0x000c
23 22
diff --git a/arch/powerpc/boot/mv64x60_i2c.c b/arch/powerpc/boot/mv64x60_i2c.c
index 435fe8528680..d085377be3bc 100644
--- a/arch/powerpc/boot/mv64x60_i2c.c
+++ b/arch/powerpc/boot/mv64x60_i2c.c
@@ -21,8 +21,6 @@
21#include "ops.h" 21#include "ops.h"
22#include "mv64x60.h" 22#include "mv64x60.h"
23 23
24extern void udelay(long);
25
26/* Register defines */ 24/* Register defines */
27#define MV64x60_I2C_REG_SLAVE_ADDR 0x00 25#define MV64x60_I2C_REG_SLAVE_ADDR 0x00
28#define MV64x60_I2C_REG_DATA 0x04 26#define MV64x60_I2C_REG_DATA 0x04
diff --git a/arch/powerpc/boot/of.c b/arch/powerpc/boot/of.c
index 385e08b83b7e..61d9899aa0d0 100644
--- a/arch/powerpc/boot/of.c
+++ b/arch/powerpc/boot/of.c
@@ -17,8 +17,6 @@
17 17
18#include "of.h" 18#include "of.h"
19 19
20extern char _end[];
21
22/* Value picked to match that used by yaboot */ 20/* Value picked to match that used by yaboot */
23#define PROG_START 0x01400000 /* only used on 64-bit systems */ 21#define PROG_START 0x01400000 /* only used on 64-bit systems */
24#define RAM_END (512<<20) /* Fixme: use OF */ 22#define RAM_END (512<<20) /* Fixme: use OF */
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index 86077066cd7c..e948e57abef8 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -47,6 +47,7 @@ struct dt_ops {
47 const char *propname, 47 const char *propname,
48 const char *propval, int proplen); 48 const char *propval, int proplen);
49 unsigned long (*finalize)(void); 49 unsigned long (*finalize)(void);
50 char *(*get_path)(const void *phandle, char *buf, int len);
50}; 51};
51extern struct dt_ops dt_ops; 52extern struct dt_ops dt_ops;
52 53
@@ -82,11 +83,15 @@ int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device);
82int serial_console_init(void); 83int serial_console_init(void);
83int ns16550_console_init(void *devp, struct serial_console_data *scdp); 84int ns16550_console_init(void *devp, struct serial_console_data *scdp);
84int mpsc_console_init(void *devp, struct serial_console_data *scdp); 85int mpsc_console_init(void *devp, struct serial_console_data *scdp);
86int cpm_console_init(void *devp, struct serial_console_data *scdp);
87int mpc5200_psc_console_init(void *devp, struct serial_console_data *scdp);
85void *simple_alloc_init(char *base, unsigned long heap_size, 88void *simple_alloc_init(char *base, unsigned long heap_size,
86 unsigned long granularity, unsigned long max_allocs); 89 unsigned long granularity, unsigned long max_allocs);
87extern void flush_cache(void *, unsigned long); 90extern void flush_cache(void *, unsigned long);
88int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size); 91int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size);
89int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr); 92int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr);
93int dt_is_compatible(void *node, const char *compat);
94void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize);
90 95
91static inline void *finddevice(const char *name) 96static inline void *finddevice(const char *name)
92{ 97{
@@ -156,6 +161,7 @@ static inline void *find_node_by_devtype(const void *prev,
156void dt_fixup_memory(u64 start, u64 size); 161void dt_fixup_memory(u64 start, u64 size);
157void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq); 162void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq);
158void dt_fixup_clock(const char *path, u32 freq); 163void dt_fixup_clock(const char *path, u32 freq);
164void dt_fixup_mac_address(u32 index, const u8 *addr);
159void __dt_fixup_mac_addresses(u32 startindex, ...); 165void __dt_fixup_mac_addresses(u32 startindex, ...);
160#define dt_fixup_mac_addresses(...) \ 166#define dt_fixup_mac_addresses(...) \
161 __dt_fixup_mac_addresses(0, __VA_ARGS__, NULL) 167 __dt_fixup_mac_addresses(0, __VA_ARGS__, NULL)
@@ -167,6 +173,14 @@ static inline void *find_node_by_linuxphandle(const u32 linuxphandle)
167 (char *)&linuxphandle, sizeof(u32)); 173 (char *)&linuxphandle, sizeof(u32));
168} 174}
169 175
176static inline char *get_path(const void *phandle, char *buf, int len)
177{
178 if (dt_ops.get_path)
179 return dt_ops.get_path(phandle, buf, len);
180
181 return NULL;
182}
183
170static inline void *malloc(unsigned long size) 184static inline void *malloc(unsigned long size)
171{ 185{
172 return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL; 186 return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL;
@@ -191,4 +205,25 @@ static inline void exit(void)
191 static char _bss_stack[size]; \ 205 static char _bss_stack[size]; \
192 void *_platform_stack_top = _bss_stack + sizeof(_bss_stack); 206 void *_platform_stack_top = _bss_stack + sizeof(_bss_stack);
193 207
208extern unsigned long timebase_period_ns;
209void udelay(long delay);
210
211extern char _start[];
212extern char __bss_start[];
213extern char _end[];
214extern char _vmlinux_start[];
215extern char _vmlinux_end[];
216extern char _initrd_start[];
217extern char _initrd_end[];
218extern char _dtb_start[];
219extern char _dtb_end[];
220
221static inline __attribute__((const))
222int __ilog2_u32(u32 n)
223{
224 int bit;
225 asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n));
226 return 31 - bit;
227}
228
194#endif /* _PPC_BOOT_OPS_H_ */ 229#endif /* _PPC_BOOT_OPS_H_ */
diff --git a/arch/powerpc/boot/planetcore.c b/arch/powerpc/boot/planetcore.c
new file mode 100644
index 000000000000..0d8558a475bb
--- /dev/null
+++ b/arch/powerpc/boot/planetcore.c
@@ -0,0 +1,166 @@
1/*
2 * PlanetCore configuration data support functions
3 *
4 * Author: Scott Wood <scottwood@freescale.com>
5 *
6 * Copyright (c) 2007 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 version 2 as published
10 * by the Free Software Foundation.
11 */
12
13#include "stdio.h"
14#include "stdlib.h"
15#include "ops.h"
16#include "planetcore.h"
17#include "io.h"
18
19/* PlanetCore passes information to the OS in the form of
20 * a table of key=value strings, separated by newlines.
21 *
22 * The list is terminated by an empty string (i.e. two
23 * consecutive newlines).
24 *
25 * To make it easier to parse, we first convert all the
26 * newlines into null bytes.
27 */
28
29void planetcore_prepare_table(char *table)
30{
31 do {
32 if (*table == '\n')
33 *table = 0;
34
35 table++;
36 } while (*(table - 1) || *table != '\n');
37
38 *table = 0;
39}
40
41const char *planetcore_get_key(const char *table, const char *key)
42{
43 int keylen = strlen(key);
44
45 do {
46 if (!strncmp(table, key, keylen) && table[keylen] == '=')
47 return table + keylen + 1;
48
49 table += strlen(table) + 1;
50 } while (strlen(table) != 0);
51
52 return NULL;
53}
54
55int planetcore_get_decimal(const char *table, const char *key, u64 *val)
56{
57 const char *str = planetcore_get_key(table, key);
58 if (!str)
59 return 0;
60
61 *val = strtoull(str, NULL, 10);
62 return 1;
63}
64
65int planetcore_get_hex(const char *table, const char *key, u64 *val)
66{
67 const char *str = planetcore_get_key(table, key);
68 if (!str)
69 return 0;
70
71 *val = strtoull(str, NULL, 16);
72 return 1;
73}
74
75static u64 mac_table[4] = {
76 0x000000000000,
77 0x000000800000,
78 0x000000400000,
79 0x000000c00000,
80};
81
82void planetcore_set_mac_addrs(const char *table)
83{
84 u8 addr[4][6];
85 u64 int_addr;
86 u32 i;
87 int j;
88
89 if (!planetcore_get_hex(table, PLANETCORE_KEY_MAC_ADDR, &int_addr))
90 return;
91
92 for (i = 0; i < 4; i++) {
93 u64 this_dev_addr = (int_addr & ~0x000000c00000) |
94 mac_table[i];
95
96 for (j = 5; j >= 0; j--) {
97 addr[i][j] = this_dev_addr & 0xff;
98 this_dev_addr >>= 8;
99 }
100
101 dt_fixup_mac_address(i, addr[i]);
102 }
103}
104
105static char prop_buf[MAX_PROP_LEN];
106
107void planetcore_set_stdout_path(const char *table)
108{
109 char *path;
110 const char *label;
111 void *node, *chosen;
112
113 label = planetcore_get_key(table, PLANETCORE_KEY_SERIAL_PORT);
114 if (!label)
115 return;
116
117 node = find_node_by_prop_value_str(NULL, "linux,planetcore-label",
118 label);
119 if (!node)
120 return;
121
122 path = get_path(node, prop_buf, MAX_PROP_LEN);
123 if (!path)
124 return;
125
126 chosen = finddevice("/chosen");
127 if (!chosen)
128 chosen = create_node(NULL, "chosen");
129 if (!chosen)
130 return;
131
132 setprop_str(chosen, "linux,stdout-path", path);
133}
134
135void planetcore_set_serial_speed(const char *table)
136{
137 void *chosen, *stdout;
138 u64 baud;
139 u32 baud32;
140 int len;
141
142 chosen = finddevice("/chosen");
143 if (!chosen)
144 return;
145
146 len = getprop(chosen, "linux,stdout-path", prop_buf, MAX_PROP_LEN);
147 if (len <= 0)
148 return;
149
150 stdout = finddevice(prop_buf);
151 if (!stdout) {
152 printf("planetcore_set_serial_speed: "
153 "Bad /chosen/linux,stdout-path.\r\n");
154
155 return;
156 }
157
158 if (!planetcore_get_decimal(table, PLANETCORE_KEY_SERIAL_BAUD,
159 &baud)) {
160 printf("planetcore_set_serial_speed: No SB tag.\r\n");
161 return;
162 }
163
164 baud32 = baud;
165 setprop(stdout, "current-speed", &baud32, 4);
166}
diff --git a/arch/powerpc/boot/planetcore.h b/arch/powerpc/boot/planetcore.h
new file mode 100644
index 000000000000..0d4094f1771c
--- /dev/null
+++ b/arch/powerpc/boot/planetcore.h
@@ -0,0 +1,49 @@
1#ifndef _PPC_BOOT_PLANETCORE_H_
2#define _PPC_BOOT_PLANETCORE_H_
3
4#include "types.h"
5
6#define PLANETCORE_KEY_BOARD_TYPE "BO"
7#define PLANETCORE_KEY_BOARD_REV "BR"
8#define PLANETCORE_KEY_MB_RAM "D1"
9#define PLANETCORE_KEY_MAC_ADDR "EA"
10#define PLANETCORE_KEY_FLASH_SPEED "FS"
11#define PLANETCORE_KEY_IP_ADDR "IP"
12#define PLANETCORE_KEY_KB_NVRAM "NV"
13#define PLANETCORE_KEY_PROCESSOR "PR"
14#define PLANETCORE_KEY_PROC_VARIANT "PV"
15#define PLANETCORE_KEY_SERIAL_BAUD "SB"
16#define PLANETCORE_KEY_SERIAL_PORT "SP"
17#define PLANETCORE_KEY_SWITCH "SW"
18#define PLANETCORE_KEY_TEMP_OFFSET "TC"
19#define PLANETCORE_KEY_TARGET_IP "TIP"
20#define PLANETCORE_KEY_CRYSTAL_HZ "XT"
21
22/* Prepare the table for processing, by turning all newlines
23 * into NULL bytes.
24 */
25void planetcore_prepare_table(char *table);
26
27/* Return the value associated with a given key in text,
28 * decimal, or hex format.
29 *
30 * Returns zero/NULL on failure, non-zero on success.
31 */
32const char *planetcore_get_key(const char *table, const char *key);
33int planetcore_get_decimal(const char *table, const char *key, u64 *val);
34int planetcore_get_hex(const char *table, const char *key, u64 *val);
35
36/* Updates the device tree local-mac-address properties based
37 * on the EA tag.
38 */
39void planetcore_set_mac_addrs(const char *table);
40
41/* Sets the linux,stdout-path in the /chosen node. This requires the
42 * linux,planetcore-label property in each serial node.
43 */
44void planetcore_set_stdout_path(const char *table);
45
46/* Sets the current-speed property in the serial node. */
47void planetcore_set_serial_speed(const char *table);
48
49#endif
diff --git a/arch/powerpc/boot/ppcboot.h b/arch/powerpc/boot/ppcboot.h
index 5290ff2c2b2b..6ae6f9063952 100644
--- a/arch/powerpc/boot/ppcboot.h
+++ b/arch/powerpc/boot/ppcboot.h
@@ -78,17 +78,18 @@ typedef struct bd_info {
78 hymod_conf_t bi_hymod_conf; /* hymod configuration information */ 78 hymod_conf_t bi_hymod_conf; /* hymod configuration information */
79#endif 79#endif
80#if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \ 80#if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \
81 defined(TARGET_85xx) || defined(TARGET_83xx) 81 defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1)
82 /* second onboard ethernet port */ 82 /* second onboard ethernet port */
83 unsigned char bi_enet1addr[6]; 83 unsigned char bi_enet1addr[6];
84#define HAVE_ENET1ADDR 84#define HAVE_ENET1ADDR
85#endif 85#endif
86#if defined(TARGET_EVB64260) || defined(TARGET_440GX) || defined(TARGET_85xx) 86#if defined(TARGET_EVB64260) || defined(TARGET_440GX) || \
87 defined(TARGET_85xx) || defined(TARGET_HAS_ETH2)
87 /* third onboard ethernet ports */ 88 /* third onboard ethernet ports */
88 unsigned char bi_enet2addr[6]; 89 unsigned char bi_enet2addr[6];
89#define HAVE_ENET2ADDR 90#define HAVE_ENET2ADDR
90#endif 91#endif
91#if defined(TARGET_440GX) 92#if defined(TARGET_440GX) || defined(TARGET_HAS_ETH3)
92 /* fourth onboard ethernet ports */ 93 /* fourth onboard ethernet ports */
93 unsigned char bi_enet3addr[6]; 94 unsigned char bi_enet3addr[6];
94#define HAVE_ENET3ADDR 95#define HAVE_ENET3ADDR
diff --git a/arch/powerpc/boot/prpmc2800.c b/arch/powerpc/boot/prpmc2800.c
index f428bac10d4a..9614e1db9dae 100644
--- a/arch/powerpc/boot/prpmc2800.c
+++ b/arch/powerpc/boot/prpmc2800.c
@@ -21,12 +21,6 @@
21#include "gunzip_util.h" 21#include "gunzip_util.h"
22#include "mv64x60.h" 22#include "mv64x60.h"
23 23
24extern char _end[];
25extern char _vmlinux_start[], _vmlinux_end[];
26extern char _dtb_start[], _dtb_end[];
27
28extern void udelay(long delay);
29
30#define KB 1024U 24#define KB 1024U
31#define MB (KB*KB) 25#define MB (KB*KB)
32#define GB (KB*MB) 26#define GB (KB*MB)
diff --git a/arch/powerpc/boot/ps3.c b/arch/powerpc/boot/ps3.c
index 893d59339c26..d6661151b494 100644
--- a/arch/powerpc/boot/ps3.c
+++ b/arch/powerpc/boot/ps3.c
@@ -120,10 +120,6 @@ void ps3_copy_vectors(void)
120 120
121void platform_init(void) 121void platform_init(void)
122{ 122{
123 extern char _end[];
124 extern char _dtb_start[];
125 extern char _initrd_start[];
126 extern char _initrd_end[];
127 const u32 heapsize = 0x1000000 - (u32)_end; /* 16MiB */ 123 const u32 heapsize = 0x1000000 - (u32)_end; /* 16MiB */
128 void *chosen; 124 void *chosen;
129 unsigned long ft_addr; 125 unsigned long ft_addr;
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
index eaa0d3ae3518..95e08e4ddcd2 100644
--- a/arch/powerpc/boot/serial.c
+++ b/arch/powerpc/boot/serial.c
@@ -19,8 +19,6 @@
19#include "io.h" 19#include "io.h"
20#include "ops.h" 20#include "ops.h"
21 21
22extern void udelay(long delay);
23
24static int serial_open(void) 22static int serial_open(void)
25{ 23{
26 struct serial_console_data *scdp = console_ops.data; 24 struct serial_console_data *scdp = console_ops.data;
@@ -114,29 +112,34 @@ int serial_console_init(void)
114{ 112{
115 void *devp; 113 void *devp;
116 int rc = -1; 114 int rc = -1;
117 char compat[MAX_PROP_LEN];
118 115
119 devp = serial_get_stdout_devp(); 116 devp = serial_get_stdout_devp();
120 if (devp == NULL) 117 if (devp == NULL)
121 goto err_out; 118 goto err_out;
122 119
123 if (getprop(devp, "compatible", compat, sizeof(compat)) < 0) 120 if (dt_is_compatible(devp, "ns16550"))
124 goto err_out;
125
126 if (!strcmp(compat, "ns16550"))
127 rc = ns16550_console_init(devp, &serial_cd); 121 rc = ns16550_console_init(devp, &serial_cd);
128 else if (!strcmp(compat, "marvell,mpsc")) 122 else if (dt_is_compatible(devp, "marvell,mpsc"))
129 rc = mpsc_console_init(devp, &serial_cd); 123 rc = mpsc_console_init(devp, &serial_cd);
124 else if (dt_is_compatible(devp, "fsl,cpm1-scc-uart") ||
125 dt_is_compatible(devp, "fsl,cpm1-smc-uart") ||
126 dt_is_compatible(devp, "fsl,cpm2-scc-uart") ||
127 dt_is_compatible(devp, "fsl,cpm2-smc-uart"))
128 rc = cpm_console_init(devp, &serial_cd);
129 else if (dt_is_compatible(devp, "mpc5200-psc-uart"))
130 rc = mpc5200_psc_console_init(devp, &serial_cd);
130 131
131 /* Add other serial console driver calls here */ 132 /* Add other serial console driver calls here */
132 133
133 if (!rc) { 134 if (!rc) {
134 console_ops.open = serial_open; 135 console_ops.open = serial_open;
135 console_ops.write = serial_write; 136 console_ops.write = serial_write;
136 console_ops.edit_cmdline = serial_edit_cmdline;
137 console_ops.close = serial_close; 137 console_ops.close = serial_close;
138 console_ops.data = &serial_cd; 138 console_ops.data = &serial_cd;
139 139
140 if (serial_cd.getc)
141 console_ops.edit_cmdline = serial_edit_cmdline;
142
140 return 0; 143 return 0;
141 } 144 }
142err_out: 145err_out:
diff --git a/arch/powerpc/boot/stdlib.c b/arch/powerpc/boot/stdlib.c
new file mode 100644
index 000000000000..e00d58c29eea
--- /dev/null
+++ b/arch/powerpc/boot/stdlib.c
@@ -0,0 +1,45 @@
1/*
2 * stdlib functions
3 *
4 * Author: Scott Wood <scottwood@freescale.com>
5 *
6 * Copyright (c) 2007 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 version 2 as published
10 * by the Free Software Foundation.
11 */
12
13#include "stdlib.h"
14
15/* Not currently supported: leading whitespace, sign, 0x prefix, zero base */
16unsigned long long int strtoull(const char *ptr, char **end, int base)
17{
18 unsigned long long ret = 0;
19
20 if (base > 36)
21 goto out;
22
23 while (*ptr) {
24 int digit;
25
26 if (*ptr >= '0' && *ptr <= '9' && *ptr < '0' + base)
27 digit = *ptr - '0';
28 else if (*ptr >= 'A' && *ptr < 'A' + base - 10)
29 digit = *ptr - 'A' + 10;
30 else if (*ptr >= 'a' && *ptr < 'a' + base - 10)
31 digit = *ptr - 'a' + 10;
32 else
33 break;
34
35 ret *= base;
36 ret += digit;
37 ptr++;
38 }
39
40out:
41 if (end)
42 *end = (char *)ptr;
43
44 return ret;
45}
diff --git a/arch/powerpc/boot/stdlib.h b/arch/powerpc/boot/stdlib.h
new file mode 100644
index 000000000000..1bf01ac73aba
--- /dev/null
+++ b/arch/powerpc/boot/stdlib.h
@@ -0,0 +1,6 @@
1#ifndef _PPC_BOOT_STDLIB_H_
2#define _PPC_BOOT_STDLIB_H_
3
4unsigned long long int strtoull(const char *ptr, char **end, int base);
5
6#endif
diff --git a/arch/powerpc/boot/string.S b/arch/powerpc/boot/string.S
index ac3d43b6a324..2627558bcb71 100644
--- a/arch/powerpc/boot/string.S
+++ b/arch/powerpc/boot/string.S
@@ -49,6 +49,17 @@ strcat:
49 bne 1b 49 bne 1b
50 blr 50 blr
51 51
52 .globl strchr
53strchr:
54 addi r3,r3,-1
551: lbzu r0,1(r3)
56 cmpw 0,r0,r4
57 beqlr
58 cmpwi 0,r0,0
59 bne 1b
60 li r3,0
61 blr
62
52 .globl strcmp 63 .globl strcmp
53strcmp: 64strcmp:
54 addi r5,r3,-1 65 addi r5,r3,-1
@@ -61,6 +72,19 @@ strcmp:
61 beq 1b 72 beq 1b
62 blr 73 blr
63 74
75 .globl strncmp
76strncmp:
77 mtctr r5
78 addi r5,r3,-1
79 addi r4,r4,-1
801: lbzu r3,1(r5)
81 cmpwi 1,r3,0
82 lbzu r0,1(r4)
83 subf. r3,r0,r3
84 beqlr 1
85 bdnzt eq,1b
86 blr
87
64 .globl strlen 88 .globl strlen
65strlen: 89strlen:
66 addi r4,r3,-1 90 addi r4,r3,-1
diff --git a/arch/powerpc/boot/string.h b/arch/powerpc/boot/string.h
index 9fdff1cc0d70..4650030d1040 100644
--- a/arch/powerpc/boot/string.h
+++ b/arch/powerpc/boot/string.h
@@ -5,7 +5,9 @@
5extern char *strcpy(char *dest, const char *src); 5extern char *strcpy(char *dest, const char *src);
6extern char *strncpy(char *dest, const char *src, size_t n); 6extern char *strncpy(char *dest, const char *src, size_t n);
7extern char *strcat(char *dest, const char *src); 7extern char *strcat(char *dest, const char *src);
8extern char *strchr(const char *s, int c);
8extern int strcmp(const char *s1, const char *s2); 9extern int strcmp(const char *s1, const char *s2);
10extern int strncmp(const char *s1, const char *s2, size_t n);
9extern size_t strlen(const char *s); 11extern size_t strlen(const char *s);
10extern size_t strnlen(const char *s, size_t count); 12extern size_t strnlen(const char *s, size_t count);
11 13
diff --git a/arch/powerpc/boot/treeboot-bamboo.c b/arch/powerpc/boot/treeboot-bamboo.c
new file mode 100644
index 000000000000..9eee48fc7114
--- /dev/null
+++ b/arch/powerpc/boot/treeboot-bamboo.c
@@ -0,0 +1,43 @@
1/*
2 * Copyright IBM Corporation, 2007
3 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
4 *
5 * Based on ebony wrapper:
6 * Copyright 2007 David Gibson, IBM Corporation.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; version 2 of the License
11 */
12#include "ops.h"
13#include "stdio.h"
14#include "44x.h"
15#include "stdlib.h"
16
17BSS_STACK(4096);
18
19#define PIBS_MAC0 0xfffc0400
20#define PIBS_MAC1 0xfffc0500
21char pibs_mac0[6];
22char pibs_mac1[6];
23
24static void read_pibs_mac(void)
25{
26 unsigned long long mac64;
27
28 mac64 = strtoull((char *)PIBS_MAC0, 0, 16);
29 memcpy(&pibs_mac0, (char *)&mac64+2, 6);
30
31 mac64 = strtoull((char *)PIBS_MAC1, 0, 16);
32 memcpy(&pibs_mac1, (char *)&mac64+2, 6);
33}
34
35void platform_init(void)
36{
37 unsigned long end_of_ram = 0x8000000;
38 unsigned long avail_ram = end_of_ram - (unsigned long)_end;
39
40 simple_alloc_init(_end, avail_ram, 32, 64);
41 read_pibs_mac();
42 bamboo_init((u8 *)&pibs_mac0, (u8 *)&pibs_mac1);
43}
diff --git a/arch/powerpc/boot/treeboot-ebony.c b/arch/powerpc/boot/treeboot-ebony.c
index 8436a9c55192..21cc4834a384 100644
--- a/arch/powerpc/boot/treeboot-ebony.c
+++ b/arch/powerpc/boot/treeboot-ebony.c
@@ -16,8 +16,6 @@
16#include "stdio.h" 16#include "stdio.h"
17#include "44x.h" 17#include "44x.h"
18 18
19extern char _end[];
20
21BSS_STACK(4096); 19BSS_STACK(4096);
22 20
23#define OPENBIOS_MAC_BASE 0xfffffe0c 21#define OPENBIOS_MAC_BASE 0xfffffe0c
diff --git a/arch/powerpc/boot/treeboot-walnut.c b/arch/powerpc/boot/treeboot-walnut.c
new file mode 100644
index 000000000000..3adf2d08a230
--- /dev/null
+++ b/arch/powerpc/boot/treeboot-walnut.c
@@ -0,0 +1,131 @@
1/*
2 * Old U-boot compatibility for Walnut
3 *
4 * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com>
5 *
6 * Copyright 2007 IBM Corporation
7 * Based on cuboot-83xx.c, which is:
8 * Copyright (c) 2007 Freescale Semiconductor, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License version 2 as published
12 * by the Free Software Foundation.
13 */
14
15#include "ops.h"
16#include "stdio.h"
17#include "dcr.h"
18#include "4xx.h"
19#include "io.h"
20
21BSS_STACK(4096);
22
23void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
24{
25 u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
26 u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
27 u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
28 u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
29 u32 fwdv, fbdv, cbdv, opdv, epdv, udiv;
30
31 fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
32 fbdv = (pllmr & 0x1e000000) >> 25;
33 cbdv = ((pllmr & 0x00060000) >> 17) + 1;
34 opdv = ((pllmr & 0x00018000) >> 15) + 1;
35 epdv = ((pllmr & 0x00001800) >> 13) + 2;
36 udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
37
38 m = fwdv * fbdv * cbdv;
39
40 cpu = sysclk * m / fwdv;
41 plb = cpu / cbdv;
42 opb = plb / opdv;
43 ebc = plb / epdv;
44
45 if (cpc0_cr0 & 0x80) {
46 /* uart0 uses the external clock */
47 uart0 = ser_clk;
48 } else {
49 uart0 = cpu / udiv;
50 }
51
52 if (cpc0_cr0 & 0x40) {
53 /* uart1 uses the external clock */
54 uart1 = ser_clk;
55 } else {
56 uart1 = cpu / udiv;
57 }
58
59 /* setup the timebase clock to tick at the cpu frequency */
60 cpc0_cr1 = cpc0_cr1 & ~ 0x00800000;
61 mtdcr(DCRN_CPC0_CR1, cpc0_cr1);
62 tb = cpu;
63
64 dt_fixup_cpu_clocks(cpu, tb, 0);
65 dt_fixup_clock("/plb", plb);
66 dt_fixup_clock("/plb/opb", opb);
67 dt_fixup_clock("/plb/ebc", ebc);
68 dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
69 dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
70}
71
72static void walnut_flashsel_fixup(void)
73{
74 void *devp, *sram;
75 u32 reg_flash[3] = {0x0, 0x0, 0x80000};
76 u32 reg_sram[3] = {0x0, 0x0, 0x80000};
77 u8 *fpga;
78 u8 fpga_brds1 = 0x0;
79
80 devp = finddevice("/plb/ebc/fpga");
81 if (!devp)
82 fatal("Couldn't locate FPGA node\n\r");
83
84 if (getprop(devp, "virtual-reg", &fpga, sizeof(fpga)) != sizeof(fpga))
85 fatal("no virtual-reg property\n\r");
86
87 fpga_brds1 = in_8(fpga);
88
89 devp = finddevice("/plb/ebc/flash");
90 if (!devp)
91 fatal("Couldn't locate flash node\n\r");
92
93 if (getprop(devp, "reg", reg_flash, sizeof(reg_flash)) != sizeof(reg_flash))
94 fatal("flash reg property has unexpected size\n\r");
95
96 sram = finddevice("/plb/ebc/sram");
97 if (!sram)
98 fatal("Couldn't locate sram node\n\r");
99
100 if (getprop(sram, "reg", reg_sram, sizeof(reg_sram)) != sizeof(reg_sram))
101 fatal("sram reg property has unexpected size\n\r");
102
103 if (fpga_brds1 & 0x1) {
104 reg_flash[1] ^= 0x80000;
105 reg_sram[1] ^= 0x80000;
106 }
107
108 setprop(devp, "reg", reg_flash, sizeof(reg_flash));
109 setprop(sram, "reg", reg_sram, sizeof(reg_sram));
110}
111
112static void walnut_fixups(void)
113{
114 ibm4xx_fixup_memsize();
115 ibm405gp_fixup_clocks(33330000, 0xa8c000);
116 ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
117 ibm4xx_fixup_ebc_ranges("/plb/ebc");
118 walnut_flashsel_fixup();
119}
120
121void platform_init(void)
122{
123 unsigned long end_of_ram = 0x2000000;
124 unsigned long avail_ram = end_of_ram - (unsigned long) _end;
125
126 simple_alloc_init(_end, avail_ram, 32, 32);
127 platform_ops.fixups = walnut_fixups;
128 platform_ops.exit = ibm40x_dbcr_reset;
129 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
130 serial_console_init();
131}
diff --git a/arch/powerpc/configs/bamboo_defconfig b/arch/powerpc/configs/bamboo_defconfig
new file mode 100644
index 000000000000..b592dec4640f
--- /dev/null
+++ b/arch/powerpc/configs/bamboo_defconfig
@@ -0,0 +1,775 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc1
4# Fri Aug 3 10:46:53 2007
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11# CONFIG_6xx is not set
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set
15CONFIG_44x=y
16# CONFIG_E200 is not set
17CONFIG_PPC_FPU=y
18CONFIG_4xx=y
19CONFIG_BOOKE=y
20CONFIG_PTE_64BIT=y
21CONFIG_PHYS_64BIT=y
22# CONFIG_PPC_MM_SLICES is not set
23CONFIG_NOT_COHERENT_CACHE=y
24CONFIG_PPC32=y
25CONFIG_PPC_MERGE=y
26CONFIG_MMU=y
27CONFIG_GENERIC_HARDIRQS=y
28CONFIG_IRQ_PER_CPU=y
29CONFIG_RWSEM_XCHGADD_ALGORITHM=y
30CONFIG_ARCH_HAS_ILOG2_U32=y
31CONFIG_GENERIC_HWEIGHT=y
32CONFIG_GENERIC_CALIBRATE_DELAY=y
33CONFIG_GENERIC_FIND_NEXT_BIT=y
34# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
35CONFIG_PPC=y
36CONFIG_EARLY_PRINTK=y
37CONFIG_GENERIC_NVRAM=y
38CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
39CONFIG_ARCH_MAY_HAVE_PC_FDC=y
40CONFIG_PPC_OF=y
41CONFIG_OF=y
42CONFIG_PPC_UDBG_16550=y
43# CONFIG_GENERIC_TBSYNC is not set
44CONFIG_AUDIT_ARCH=y
45CONFIG_GENERIC_BUG=y
46# CONFIG_DEFAULT_UIMAGE is not set
47CONFIG_PPC_DCR_NATIVE=y
48# CONFIG_PPC_DCR_MMIO is not set
49CONFIG_PPC_DCR=y
50CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
51
52#
53# General setup
54#
55CONFIG_EXPERIMENTAL=y
56CONFIG_BROKEN_ON_SMP=y
57CONFIG_INIT_ENV_ARG_LIMIT=32
58CONFIG_LOCALVERSION=""
59CONFIG_LOCALVERSION_AUTO=y
60CONFIG_SWAP=y
61CONFIG_SYSVIPC=y
62CONFIG_SYSVIPC_SYSCTL=y
63CONFIG_POSIX_MQUEUE=y
64# CONFIG_BSD_PROCESS_ACCT is not set
65# CONFIG_TASKSTATS is not set
66# CONFIG_USER_NS is not set
67# CONFIG_AUDIT is not set
68# CONFIG_IKCONFIG is not set
69CONFIG_LOG_BUF_SHIFT=14
70CONFIG_SYSFS_DEPRECATED=y
71# CONFIG_RELAY is not set
72CONFIG_BLK_DEV_INITRD=y
73CONFIG_INITRAMFS_SOURCE=""
74# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
75CONFIG_SYSCTL=y
76CONFIG_EMBEDDED=y
77CONFIG_SYSCTL_SYSCALL=y
78CONFIG_KALLSYMS=y
79# CONFIG_KALLSYMS_ALL is not set
80# CONFIG_KALLSYMS_EXTRA_PASS is not set
81CONFIG_HOTPLUG=y
82CONFIG_PRINTK=y
83CONFIG_BUG=y
84CONFIG_ELF_CORE=y
85CONFIG_BASE_FULL=y
86CONFIG_FUTEX=y
87CONFIG_ANON_INODES=y
88CONFIG_EPOLL=y
89CONFIG_SIGNALFD=y
90CONFIG_TIMERFD=y
91CONFIG_EVENTFD=y
92CONFIG_SHMEM=y
93CONFIG_VM_EVENT_COUNTERS=y
94CONFIG_SLAB=y
95# CONFIG_SLUB is not set
96# CONFIG_SLOB is not set
97CONFIG_RT_MUTEXES=y
98# CONFIG_TINY_SHMEM is not set
99CONFIG_BASE_SMALL=0
100CONFIG_MODULES=y
101CONFIG_MODULE_UNLOAD=y
102# CONFIG_MODULE_FORCE_UNLOAD is not set
103# CONFIG_MODVERSIONS is not set
104# CONFIG_MODULE_SRCVERSION_ALL is not set
105CONFIG_KMOD=y
106CONFIG_BLOCK=y
107CONFIG_LBD=y
108# CONFIG_BLK_DEV_IO_TRACE is not set
109# CONFIG_LSF is not set
110# CONFIG_BLK_DEV_BSG is not set
111
112#
113# IO Schedulers
114#
115CONFIG_IOSCHED_NOOP=y
116CONFIG_IOSCHED_AS=y
117CONFIG_IOSCHED_DEADLINE=y
118CONFIG_IOSCHED_CFQ=y
119CONFIG_DEFAULT_AS=y
120# CONFIG_DEFAULT_DEADLINE is not set
121# CONFIG_DEFAULT_CFQ is not set
122# CONFIG_DEFAULT_NOOP is not set
123CONFIG_DEFAULT_IOSCHED="anticipatory"
124
125#
126# Platform support
127#
128# CONFIG_PPC_MPC52xx is not set
129# CONFIG_PPC_MPC5200 is not set
130# CONFIG_PPC_CELL is not set
131# CONFIG_PPC_CELL_NATIVE is not set
132# CONFIG_PQ2ADS is not set
133CONFIG_BAMBOO=y
134# CONFIG_EBONY is not set
135CONFIG_440EP=y
136CONFIG_IBM440EP_ERR42=y
137# CONFIG_MPIC is not set
138# CONFIG_MPIC_WEIRD is not set
139# CONFIG_PPC_I8259 is not set
140# CONFIG_PPC_RTAS is not set
141# CONFIG_MMIO_NVRAM is not set
142# CONFIG_PPC_MPC106 is not set
143# CONFIG_PPC_970_NAP is not set
144# CONFIG_PPC_INDIRECT_IO is not set
145# CONFIG_GENERIC_IOMAP is not set
146# CONFIG_CPU_FREQ is not set
147# CONFIG_CPM2 is not set
148
149#
150# Kernel options
151#
152# CONFIG_HIGHMEM is not set
153# CONFIG_HZ_100 is not set
154CONFIG_HZ_250=y
155# CONFIG_HZ_300 is not set
156# CONFIG_HZ_1000 is not set
157CONFIG_HZ=250
158CONFIG_PREEMPT_NONE=y
159# CONFIG_PREEMPT_VOLUNTARY is not set
160# CONFIG_PREEMPT is not set
161CONFIG_BINFMT_ELF=y
162# CONFIG_BINFMT_MISC is not set
163# CONFIG_MATH_EMULATION is not set
164CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
165CONFIG_ARCH_FLATMEM_ENABLE=y
166CONFIG_ARCH_POPULATES_NODE_MAP=y
167CONFIG_SELECT_MEMORY_MODEL=y
168CONFIG_FLATMEM_MANUAL=y
169# CONFIG_DISCONTIGMEM_MANUAL is not set
170# CONFIG_SPARSEMEM_MANUAL is not set
171CONFIG_FLATMEM=y
172CONFIG_FLAT_NODE_MEM_MAP=y
173# CONFIG_SPARSEMEM_STATIC is not set
174CONFIG_SPLIT_PTLOCK_CPUS=4
175CONFIG_RESOURCES_64BIT=y
176CONFIG_ZONE_DMA_FLAG=1
177CONFIG_BOUNCE=y
178CONFIG_VIRT_TO_BUS=y
179CONFIG_PROC_DEVICETREE=y
180CONFIG_CMDLINE_BOOL=y
181CONFIG_CMDLINE=""
182CONFIG_SECCOMP=y
183CONFIG_WANT_DEVICE_TREE=y
184CONFIG_DEVICE_TREE="bamboo.dts"
185CONFIG_ISA_DMA_API=y
186
187#
188# Bus options
189#
190CONFIG_ZONE_DMA=y
191CONFIG_PPC_INDIRECT_PCI=y
192CONFIG_PCI=y
193CONFIG_PCI_DOMAINS=y
194CONFIG_PCI_SYSCALL=y
195# CONFIG_PCIEPORTBUS is not set
196CONFIG_ARCH_SUPPORTS_MSI=y
197# CONFIG_PCI_MSI is not set
198# CONFIG_PCI_DEBUG is not set
199
200#
201# PCCARD (PCMCIA/CardBus) support
202#
203# CONFIG_PCCARD is not set
204# CONFIG_HOTPLUG_PCI is not set
205
206#
207# Advanced setup
208#
209# CONFIG_ADVANCED_OPTIONS is not set
210
211#
212# Default settings for advanced configuration options are used
213#
214CONFIG_HIGHMEM_START=0xfe000000
215CONFIG_LOWMEM_SIZE=0x30000000
216CONFIG_KERNEL_START=0xc0000000
217CONFIG_TASK_SIZE=0x80000000
218CONFIG_CONSISTENT_START=0xff100000
219CONFIG_CONSISTENT_SIZE=0x00200000
220CONFIG_BOOT_LOAD=0x01000000
221
222#
223# Networking
224#
225CONFIG_NET=y
226
227#
228# Networking options
229#
230CONFIG_PACKET=y
231# CONFIG_PACKET_MMAP is not set
232CONFIG_UNIX=y
233# CONFIG_NET_KEY is not set
234CONFIG_INET=y
235# CONFIG_IP_MULTICAST is not set
236# CONFIG_IP_ADVANCED_ROUTER is not set
237CONFIG_IP_FIB_HASH=y
238CONFIG_IP_PNP=y
239CONFIG_IP_PNP_DHCP=y
240CONFIG_IP_PNP_BOOTP=y
241# CONFIG_IP_PNP_RARP is not set
242# CONFIG_NET_IPIP is not set
243# CONFIG_NET_IPGRE is not set
244# CONFIG_ARPD is not set
245# CONFIG_SYN_COOKIES is not set
246# CONFIG_INET_AH is not set
247# CONFIG_INET_ESP is not set
248# CONFIG_INET_IPCOMP is not set
249# CONFIG_INET_XFRM_TUNNEL is not set
250# CONFIG_INET_TUNNEL is not set
251# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
252# CONFIG_INET_XFRM_MODE_TUNNEL is not set
253# CONFIG_INET_XFRM_MODE_BEET is not set
254CONFIG_INET_DIAG=y
255CONFIG_INET_TCP_DIAG=y
256# CONFIG_TCP_CONG_ADVANCED is not set
257CONFIG_TCP_CONG_CUBIC=y
258CONFIG_DEFAULT_TCP_CONG="cubic"
259# CONFIG_TCP_MD5SIG is not set
260# CONFIG_IPV6 is not set
261# CONFIG_INET6_XFRM_TUNNEL is not set
262# CONFIG_INET6_TUNNEL is not set
263# CONFIG_NETWORK_SECMARK is not set
264# CONFIG_NETFILTER is not set
265# CONFIG_IP_DCCP is not set
266# CONFIG_IP_SCTP is not set
267# CONFIG_TIPC is not set
268# CONFIG_ATM is not set
269# CONFIG_BRIDGE is not set
270# CONFIG_VLAN_8021Q is not set
271# CONFIG_DECNET is not set
272# CONFIG_LLC2 is not set
273# CONFIG_IPX is not set
274# CONFIG_ATALK is not set
275# CONFIG_X25 is not set
276# CONFIG_LAPB is not set
277# CONFIG_ECONET is not set
278# CONFIG_WAN_ROUTER is not set
279
280#
281# QoS and/or fair queueing
282#
283# CONFIG_NET_SCHED is not set
284
285#
286# Network testing
287#
288# CONFIG_NET_PKTGEN is not set
289# CONFIG_HAMRADIO is not set
290# CONFIG_IRDA is not set
291# CONFIG_BT is not set
292# CONFIG_AF_RXRPC is not set
293
294#
295# Wireless
296#
297# CONFIG_CFG80211 is not set
298# CONFIG_WIRELESS_EXT is not set
299# CONFIG_MAC80211 is not set
300# CONFIG_IEEE80211 is not set
301# CONFIG_RFKILL is not set
302# CONFIG_NET_9P is not set
303
304#
305# Device Drivers
306#
307
308#
309# Generic Driver Options
310#
311CONFIG_STANDALONE=y
312CONFIG_PREVENT_FIRMWARE_BUILD=y
313CONFIG_FW_LOADER=y
314# CONFIG_DEBUG_DRIVER is not set
315# CONFIG_DEBUG_DEVRES is not set
316# CONFIG_SYS_HYPERVISOR is not set
317CONFIG_CONNECTOR=y
318CONFIG_PROC_EVENTS=y
319# CONFIG_MTD is not set
320CONFIG_OF_DEVICE=y
321# CONFIG_PARPORT is not set
322CONFIG_BLK_DEV=y
323# CONFIG_BLK_DEV_FD is not set
324# CONFIG_BLK_CPQ_DA is not set
325# CONFIG_BLK_CPQ_CISS_DA is not set
326# CONFIG_BLK_DEV_DAC960 is not set
327# CONFIG_BLK_DEV_UMEM is not set
328# CONFIG_BLK_DEV_COW_COMMON is not set
329# CONFIG_BLK_DEV_LOOP is not set
330# CONFIG_BLK_DEV_NBD is not set
331# CONFIG_BLK_DEV_SX8 is not set
332CONFIG_BLK_DEV_RAM=y
333CONFIG_BLK_DEV_RAM_COUNT=16
334CONFIG_BLK_DEV_RAM_SIZE=35000
335CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
336# CONFIG_CDROM_PKTCDVD is not set
337# CONFIG_ATA_OVER_ETH is not set
338# CONFIG_XILINX_SYSACE is not set
339CONFIG_MISC_DEVICES=y
340# CONFIG_PHANTOM is not set
341# CONFIG_EEPROM_93CX6 is not set
342# CONFIG_SGI_IOC4 is not set
343# CONFIG_TIFM_CORE is not set
344# CONFIG_IDE is not set
345
346#
347# SCSI device support
348#
349# CONFIG_RAID_ATTRS is not set
350# CONFIG_SCSI is not set
351# CONFIG_SCSI_DMA is not set
352# CONFIG_SCSI_NETLINK is not set
353# CONFIG_ATA is not set
354# CONFIG_MD is not set
355
356#
357# Fusion MPT device support
358#
359# CONFIG_FUSION is not set
360
361#
362# IEEE 1394 (FireWire) support
363#
364# CONFIG_FIREWIRE is not set
365# CONFIG_IEEE1394 is not set
366# CONFIG_I2O is not set
367CONFIG_MACINTOSH_DRIVERS=y
368# CONFIG_MAC_EMUMOUSEBTN is not set
369# CONFIG_WINDFARM is not set
370CONFIG_NETDEVICES=y
371# CONFIG_NETDEVICES_MULTIQUEUE is not set
372# CONFIG_DUMMY is not set
373# CONFIG_BONDING is not set
374# CONFIG_MACVLAN is not set
375# CONFIG_EQUALIZER is not set
376# CONFIG_TUN is not set
377# CONFIG_ARCNET is not set
378# CONFIG_NET_ETHERNET is not set
379CONFIG_NETDEV_1000=y
380# CONFIG_ACENIC is not set
381# CONFIG_DL2K is not set
382# CONFIG_E1000 is not set
383# CONFIG_NS83820 is not set
384# CONFIG_HAMACHI is not set
385# CONFIG_YELLOWFIN is not set
386# CONFIG_R8169 is not set
387# CONFIG_SIS190 is not set
388# CONFIG_SKGE is not set
389# CONFIG_SKY2 is not set
390# CONFIG_VIA_VELOCITY is not set
391# CONFIG_TIGON3 is not set
392# CONFIG_BNX2 is not set
393# CONFIG_QLA3XXX is not set
394# CONFIG_ATL1 is not set
395CONFIG_NETDEV_10000=y
396# CONFIG_CHELSIO_T1 is not set
397# CONFIG_CHELSIO_T3 is not set
398# CONFIG_IXGB is not set
399# CONFIG_S2IO is not set
400# CONFIG_MYRI10GE is not set
401# CONFIG_NETXEN_NIC is not set
402# CONFIG_MLX4_CORE is not set
403# CONFIG_TR is not set
404
405#
406# Wireless LAN
407#
408# CONFIG_WLAN_PRE80211 is not set
409# CONFIG_WLAN_80211 is not set
410# CONFIG_WAN is not set
411# CONFIG_FDDI is not set
412# CONFIG_HIPPI is not set
413# CONFIG_PPP is not set
414# CONFIG_SLIP is not set
415# CONFIG_SHAPER is not set
416# CONFIG_NETCONSOLE is not set
417# CONFIG_NETPOLL is not set
418# CONFIG_NET_POLL_CONTROLLER is not set
419# CONFIG_ISDN is not set
420# CONFIG_PHONE is not set
421
422#
423# Input device support
424#
425# CONFIG_INPUT is not set
426
427#
428# Hardware I/O ports
429#
430# CONFIG_SERIO is not set
431# CONFIG_GAMEPORT is not set
432
433#
434# Character devices
435#
436# CONFIG_VT is not set
437# CONFIG_SERIAL_NONSTANDARD is not set
438
439#
440# Serial drivers
441#
442CONFIG_SERIAL_8250=y
443CONFIG_SERIAL_8250_CONSOLE=y
444# CONFIG_SERIAL_8250_PCI is not set
445CONFIG_SERIAL_8250_NR_UARTS=4
446CONFIG_SERIAL_8250_RUNTIME_UARTS=4
447CONFIG_SERIAL_8250_EXTENDED=y
448# CONFIG_SERIAL_8250_MANY_PORTS is not set
449CONFIG_SERIAL_8250_SHARE_IRQ=y
450# CONFIG_SERIAL_8250_DETECT_IRQ is not set
451# CONFIG_SERIAL_8250_RSA is not set
452
453#
454# Non-8250 serial port support
455#
456# CONFIG_SERIAL_UARTLITE is not set
457CONFIG_SERIAL_CORE=y
458CONFIG_SERIAL_CORE_CONSOLE=y
459# CONFIG_SERIAL_JSM is not set
460CONFIG_SERIAL_OF_PLATFORM=y
461CONFIG_UNIX98_PTYS=y
462CONFIG_LEGACY_PTYS=y
463CONFIG_LEGACY_PTY_COUNT=256
464# CONFIG_IPMI_HANDLER is not set
465# CONFIG_WATCHDOG is not set
466# CONFIG_HW_RANDOM is not set
467# CONFIG_NVRAM is not set
468# CONFIG_GEN_RTC is not set
469# CONFIG_R3964 is not set
470# CONFIG_APPLICOM is not set
471# CONFIG_AGP is not set
472# CONFIG_DRM is not set
473# CONFIG_RAW_DRIVER is not set
474# CONFIG_TCG_TPM is not set
475CONFIG_DEVPORT=y
476# CONFIG_I2C is not set
477
478#
479# SPI support
480#
481# CONFIG_SPI is not set
482# CONFIG_SPI_MASTER is not set
483# CONFIG_W1 is not set
484# CONFIG_POWER_SUPPLY is not set
485# CONFIG_HWMON is not set
486
487#
488# Multifunction device drivers
489#
490# CONFIG_MFD_SM501 is not set
491
492#
493# Multimedia devices
494#
495# CONFIG_VIDEO_DEV is not set
496# CONFIG_DVB_CORE is not set
497CONFIG_DAB=y
498
499#
500# Graphics support
501#
502# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
503
504#
505# Display device support
506#
507# CONFIG_DISPLAY_SUPPORT is not set
508# CONFIG_VGASTATE is not set
509CONFIG_VIDEO_OUTPUT_CONTROL=m
510# CONFIG_FB is not set
511# CONFIG_FB_IBM_GXT4500 is not set
512
513#
514# Sound
515#
516# CONFIG_SOUND is not set
517CONFIG_USB_SUPPORT=y
518CONFIG_USB_ARCH_HAS_HCD=y
519CONFIG_USB_ARCH_HAS_OHCI=y
520CONFIG_USB_ARCH_HAS_EHCI=y
521# CONFIG_USB is not set
522
523#
524# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
525#
526
527#
528# USB Gadget Support
529#
530# CONFIG_USB_GADGET is not set
531# CONFIG_MMC is not set
532# CONFIG_NEW_LEDS is not set
533# CONFIG_INFINIBAND is not set
534# CONFIG_EDAC is not set
535# CONFIG_RTC_CLASS is not set
536
537#
538# DMA Engine support
539#
540# CONFIG_DMA_ENGINE is not set
541
542#
543# DMA Clients
544#
545
546#
547# DMA Devices
548#
549
550#
551# Userspace I/O
552#
553# CONFIG_UIO is not set
554
555#
556# File systems
557#
558CONFIG_EXT2_FS=y
559# CONFIG_EXT2_FS_XATTR is not set
560# CONFIG_EXT2_FS_XIP is not set
561# CONFIG_EXT3_FS is not set
562# CONFIG_EXT4DEV_FS is not set
563# CONFIG_REISERFS_FS is not set
564# CONFIG_JFS_FS is not set
565# CONFIG_FS_POSIX_ACL is not set
566# CONFIG_XFS_FS is not set
567# CONFIG_GFS2_FS is not set
568# CONFIG_OCFS2_FS is not set
569# CONFIG_MINIX_FS is not set
570# CONFIG_ROMFS_FS is not set
571CONFIG_INOTIFY=y
572CONFIG_INOTIFY_USER=y
573# CONFIG_QUOTA is not set
574CONFIG_DNOTIFY=y
575# CONFIG_AUTOFS_FS is not set
576# CONFIG_AUTOFS4_FS is not set
577# CONFIG_FUSE_FS is not set
578
579#
580# CD-ROM/DVD Filesystems
581#
582# CONFIG_ISO9660_FS is not set
583# CONFIG_UDF_FS is not set
584
585#
586# DOS/FAT/NT Filesystems
587#
588# CONFIG_MSDOS_FS is not set
589# CONFIG_VFAT_FS is not set
590# CONFIG_NTFS_FS is not set
591
592#
593# Pseudo filesystems
594#
595CONFIG_PROC_FS=y
596CONFIG_PROC_KCORE=y
597CONFIG_PROC_SYSCTL=y
598CONFIG_SYSFS=y
599CONFIG_TMPFS=y
600# CONFIG_TMPFS_POSIX_ACL is not set
601# CONFIG_HUGETLB_PAGE is not set
602CONFIG_RAMFS=y
603# CONFIG_CONFIGFS_FS is not set
604
605#
606# Miscellaneous filesystems
607#
608# CONFIG_ADFS_FS is not set
609# CONFIG_AFFS_FS is not set
610# CONFIG_HFS_FS is not set
611# CONFIG_HFSPLUS_FS is not set
612# CONFIG_BEFS_FS is not set
613# CONFIG_BFS_FS is not set
614# CONFIG_EFS_FS is not set
615CONFIG_CRAMFS=y
616# CONFIG_VXFS_FS is not set
617# CONFIG_HPFS_FS is not set
618# CONFIG_QNX4FS_FS is not set
619# CONFIG_SYSV_FS is not set
620# CONFIG_UFS_FS is not set
621
622#
623# Network File Systems
624#
625CONFIG_NFS_FS=y
626CONFIG_NFS_V3=y
627# CONFIG_NFS_V3_ACL is not set
628# CONFIG_NFS_V4 is not set
629# CONFIG_NFS_DIRECTIO is not set
630# CONFIG_NFSD is not set
631CONFIG_ROOT_NFS=y
632CONFIG_LOCKD=y
633CONFIG_LOCKD_V4=y
634CONFIG_NFS_COMMON=y
635CONFIG_SUNRPC=y
636# CONFIG_SUNRPC_BIND34 is not set
637# CONFIG_RPCSEC_GSS_KRB5 is not set
638# CONFIG_RPCSEC_GSS_SPKM3 is not set
639# CONFIG_SMB_FS is not set
640# CONFIG_CIFS is not set
641# CONFIG_NCP_FS is not set
642# CONFIG_CODA_FS is not set
643# CONFIG_AFS_FS is not set
644
645#
646# Partition Types
647#
648# CONFIG_PARTITION_ADVANCED is not set
649CONFIG_MSDOS_PARTITION=y
650
651#
652# Native Language Support
653#
654# CONFIG_NLS is not set
655
656#
657# Distributed Lock Manager
658#
659# CONFIG_DLM is not set
660# CONFIG_UCC_SLOW is not set
661
662#
663# Library routines
664#
665CONFIG_BITREVERSE=y
666# CONFIG_CRC_CCITT is not set
667# CONFIG_CRC16 is not set
668# CONFIG_CRC_ITU_T is not set
669CONFIG_CRC32=y
670# CONFIG_CRC7 is not set
671# CONFIG_LIBCRC32C is not set
672CONFIG_ZLIB_INFLATE=y
673CONFIG_PLIST=y
674CONFIG_HAS_IOMEM=y
675CONFIG_HAS_IOPORT=y
676CONFIG_HAS_DMA=y
677
678#
679# Instrumentation Support
680#
681# CONFIG_PROFILING is not set
682
683#
684# Kernel hacking
685#
686# CONFIG_PRINTK_TIME is not set
687CONFIG_ENABLE_MUST_CHECK=y
688CONFIG_MAGIC_SYSRQ=y
689# CONFIG_UNUSED_SYMBOLS is not set
690# CONFIG_DEBUG_FS is not set
691# CONFIG_HEADERS_CHECK is not set
692CONFIG_DEBUG_KERNEL=y
693# CONFIG_DEBUG_SHIRQ is not set
694CONFIG_DETECT_SOFTLOCKUP=y
695CONFIG_SCHED_DEBUG=y
696# CONFIG_SCHEDSTATS is not set
697# CONFIG_TIMER_STATS is not set
698# CONFIG_DEBUG_SLAB is not set
699# CONFIG_DEBUG_RT_MUTEXES is not set
700# CONFIG_RT_MUTEX_TESTER is not set
701# CONFIG_DEBUG_SPINLOCK is not set
702# CONFIG_DEBUG_MUTEXES is not set
703# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
704# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
705# CONFIG_DEBUG_KOBJECT is not set
706# CONFIG_DEBUG_BUGVERBOSE is not set
707# CONFIG_DEBUG_INFO is not set
708# CONFIG_DEBUG_VM is not set
709# CONFIG_DEBUG_LIST is not set
710CONFIG_FORCED_INLINING=y
711# CONFIG_RCU_TORTURE_TEST is not set
712# CONFIG_FAULT_INJECTION is not set
713# CONFIG_DEBUG_STACKOVERFLOW is not set
714# CONFIG_DEBUG_STACK_USAGE is not set
715# CONFIG_DEBUG_PAGEALLOC is not set
716CONFIG_DEBUGGER=y
717# CONFIG_KGDB is not set
718# CONFIG_XMON is not set
719# CONFIG_BDI_SWITCH is not set
720CONFIG_PPC_EARLY_DEBUG=y
721# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
722# CONFIG_PPC_EARLY_DEBUG_G5 is not set
723# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
724# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
725# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
726# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
727# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
728# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
729CONFIG_PPC_EARLY_DEBUG_44x=y
730CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
731CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x0
732
733#
734# Security options
735#
736# CONFIG_KEYS is not set
737# CONFIG_SECURITY is not set
738CONFIG_CRYPTO=y
739CONFIG_CRYPTO_ALGAPI=y
740CONFIG_CRYPTO_BLKCIPHER=y
741CONFIG_CRYPTO_MANAGER=y
742# CONFIG_CRYPTO_HMAC is not set
743# CONFIG_CRYPTO_XCBC is not set
744# CONFIG_CRYPTO_NULL is not set
745# CONFIG_CRYPTO_MD4 is not set
746CONFIG_CRYPTO_MD5=y
747# CONFIG_CRYPTO_SHA1 is not set
748# CONFIG_CRYPTO_SHA256 is not set
749# CONFIG_CRYPTO_SHA512 is not set
750# CONFIG_CRYPTO_WP512 is not set
751# CONFIG_CRYPTO_TGR192 is not set
752# CONFIG_CRYPTO_GF128MUL is not set
753CONFIG_CRYPTO_ECB=y
754CONFIG_CRYPTO_CBC=y
755CONFIG_CRYPTO_PCBC=y
756# CONFIG_CRYPTO_LRW is not set
757# CONFIG_CRYPTO_CRYPTD is not set
758CONFIG_CRYPTO_DES=y
759# CONFIG_CRYPTO_FCRYPT is not set
760# CONFIG_CRYPTO_BLOWFISH is not set
761# CONFIG_CRYPTO_TWOFISH is not set
762# CONFIG_CRYPTO_SERPENT is not set
763# CONFIG_CRYPTO_AES is not set
764# CONFIG_CRYPTO_CAST5 is not set
765# CONFIG_CRYPTO_CAST6 is not set
766# CONFIG_CRYPTO_TEA is not set
767# CONFIG_CRYPTO_ARC4 is not set
768# CONFIG_CRYPTO_KHAZAD is not set
769# CONFIG_CRYPTO_ANUBIS is not set
770# CONFIG_CRYPTO_DEFLATE is not set
771# CONFIG_CRYPTO_MICHAEL_MIC is not set
772# CONFIG_CRYPTO_CRC32C is not set
773# CONFIG_CRYPTO_CAMELLIA is not set
774# CONFIG_CRYPTO_TEST is not set
775CONFIG_CRYPTO_HW=y
diff --git a/arch/powerpc/configs/ebony_defconfig b/arch/powerpc/configs/ebony_defconfig
index ebb8167608b8..3a50467b1f75 100644
--- a/arch/powerpc/configs/ebony_defconfig
+++ b/arch/powerpc/configs/ebony_defconfig
@@ -313,7 +313,80 @@ CONFIG_FW_LOADER=y
313# CONFIG_SYS_HYPERVISOR is not set 313# CONFIG_SYS_HYPERVISOR is not set
314CONFIG_CONNECTOR=y 314CONFIG_CONNECTOR=y
315CONFIG_PROC_EVENTS=y 315CONFIG_PROC_EVENTS=y
316# CONFIG_MTD is not set 316CONFIG_MTD=y
317# CONFIG_MTD_DEBUG is not set
318# CONFIG_MTD_CONCAT is not set
319CONFIG_MTD_PARTITIONS=y
320# CONFIG_MTD_REDBOOT_PARTS is not set
321# CONFIG_MTD_CMDLINE_PARTS is not set
322
323#
324# User Modules And Translation Layers
325#
326CONFIG_MTD_CHAR=y
327CONFIG_MTD_BLKDEVS=y
328CONFIG_MTD_BLOCK=y
329# CONFIG_FTL is not set
330# CONFIG_NFTL is not set
331# CONFIG_INFTL is not set
332# CONFIG_RFD_FTL is not set
333# CONFIG_SSFDC is not set
334
335#
336# RAM/ROM/Flash chip drivers
337#
338CONFIG_MTD_CFI=y
339CONFIG_MTD_JEDECPROBE=y
340CONFIG_MTD_GEN_PROBE=y
341# CONFIG_MTD_CFI_ADV_OPTIONS is not set
342CONFIG_MTD_MAP_BANK_WIDTH_1=y
343CONFIG_MTD_MAP_BANK_WIDTH_2=y
344CONFIG_MTD_MAP_BANK_WIDTH_4=y
345# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
346# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
347# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
348CONFIG_MTD_CFI_I1=y
349CONFIG_MTD_CFI_I2=y
350# CONFIG_MTD_CFI_I4 is not set
351# CONFIG_MTD_CFI_I8 is not set
352# CONFIG_MTD_CFI_INTELEXT is not set
353CONFIG_MTD_CFI_AMDSTD=y
354# CONFIG_MTD_CFI_STAA is not set
355CONFIG_MTD_CFI_UTIL=y
356# CONFIG_MTD_RAM is not set
357# CONFIG_MTD_ROM is not set
358# CONFIG_MTD_ABSENT is not set
359
360#
361# Mapping drivers for chip access
362#
363# CONFIG_MTD_COMPLEX_MAPPINGS is not set
364# CONFIG_MTD_PHYSMAP is not set
365CONFIG_MTD_PHYSMAP_OF=y
366# CONFIG_MTD_PLATRAM is not set
367
368#
369# Self-contained MTD device drivers
370#
371# CONFIG_MTD_PMC551 is not set
372# CONFIG_MTD_SLRAM is not set
373# CONFIG_MTD_PHRAM is not set
374# CONFIG_MTD_MTDRAM is not set
375# CONFIG_MTD_BLOCK2MTD is not set
376
377#
378# Disk-On-Chip Device Drivers
379#
380# CONFIG_MTD_DOC2000 is not set
381# CONFIG_MTD_DOC2001 is not set
382# CONFIG_MTD_DOC2001PLUS is not set
383# CONFIG_MTD_NAND is not set
384# CONFIG_MTD_ONENAND is not set
385
386#
387# UBI - Unsorted block images
388#
389# CONFIG_MTD_UBI is not set
317CONFIG_OF_DEVICE=y 390CONFIG_OF_DEVICE=y
318# CONFIG_PARPORT is not set 391# CONFIG_PARPORT is not set
319CONFIG_BLK_DEV=y 392CONFIG_BLK_DEV=y
@@ -607,6 +680,15 @@ CONFIG_RAMFS=y
607# CONFIG_BEFS_FS is not set 680# CONFIG_BEFS_FS is not set
608# CONFIG_BFS_FS is not set 681# CONFIG_BFS_FS is not set
609# CONFIG_EFS_FS is not set 682# CONFIG_EFS_FS is not set
683CONFIG_JFFS2_FS=y
684CONFIG_JFFS2_FS_DEBUG=0
685CONFIG_JFFS2_FS_WRITEBUFFER=y
686# CONFIG_JFFS2_SUMMARY is not set
687# CONFIG_JFFS2_FS_XATTR is not set
688# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
689CONFIG_JFFS2_ZLIB=y
690CONFIG_JFFS2_RTIME=y
691# CONFIG_JFFS2_RUBIN is not set
610CONFIG_CRAMFS=y 692CONFIG_CRAMFS=y
611# CONFIG_VXFS_FS is not set 693# CONFIG_VXFS_FS is not set
612# CONFIG_HPFS_FS is not set 694# CONFIG_HPFS_FS is not set
@@ -665,6 +747,7 @@ CONFIG_CRC32=y
665# CONFIG_CRC7 is not set 747# CONFIG_CRC7 is not set
666# CONFIG_LIBCRC32C is not set 748# CONFIG_LIBCRC32C is not set
667CONFIG_ZLIB_INFLATE=y 749CONFIG_ZLIB_INFLATE=y
750CONFIG_ZLIB_DEFLATE=y
668CONFIG_PLIST=y 751CONFIG_PLIST=y
669CONFIG_HAS_IOMEM=y 752CONFIG_HAS_IOMEM=y
670CONFIG_HAS_IOPORT=y 753CONFIG_HAS_IOPORT=y
diff --git a/arch/powerpc/configs/mpc8544_ds_defconfig b/arch/powerpc/configs/mpc8544_ds_defconfig
index 86582aefab93..150221f6f723 100644
--- a/arch/powerpc/configs/mpc8544_ds_defconfig
+++ b/arch/powerpc/configs/mpc8544_ds_defconfig
@@ -136,7 +136,7 @@ CONFIG_DEFAULT_IOSCHED="cfq"
136# CONFIG_MPC8560_ADS is not set 136# CONFIG_MPC8560_ADS is not set
137# CONFIG_MPC85xx_CDS is not set 137# CONFIG_MPC85xx_CDS is not set
138# CONFIG_MPC85xx_MDS is not set 138# CONFIG_MPC85xx_MDS is not set
139CONFIG_MPC8544_DS=y 139CONFIG_MPC85xx_DS=y
140CONFIG_MPC85xx=y 140CONFIG_MPC85xx=y
141CONFIG_MPIC=y 141CONFIG_MPIC=y
142# CONFIG_MPIC_WEIRD is not set 142# CONFIG_MPIC_WEIRD is not set
diff --git a/arch/powerpc/configs/mpc8572_ds_defconfig b/arch/powerpc/configs/mpc8572_ds_defconfig
new file mode 100644
index 000000000000..7f1a3e987138
--- /dev/null
+++ b/arch/powerpc/configs/mpc8572_ds_defconfig
@@ -0,0 +1,1496 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc4
4# Tue Sep 11 01:19:35 2007
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11# CONFIG_6xx is not set
12CONFIG_PPC_85xx=y
13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set
15# CONFIG_44x is not set
16# CONFIG_E200 is not set
17CONFIG_85xx=y
18CONFIG_E500=y
19CONFIG_BOOKE=y
20CONFIG_FSL_BOOKE=y
21# CONFIG_PHYS_64BIT is not set
22CONFIG_SPE=y
23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC32=y
25CONFIG_PPC_MERGE=y
26CONFIG_MMU=y
27CONFIG_GENERIC_HARDIRQS=y
28CONFIG_IRQ_PER_CPU=y
29CONFIG_RWSEM_XCHGADD_ALGORITHM=y
30CONFIG_ARCH_HAS_ILOG2_U32=y
31CONFIG_GENERIC_HWEIGHT=y
32CONFIG_GENERIC_CALIBRATE_DELAY=y
33CONFIG_GENERIC_FIND_NEXT_BIT=y
34# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
35CONFIG_PPC=y
36CONFIG_EARLY_PRINTK=y
37CONFIG_GENERIC_NVRAM=y
38CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
39CONFIG_ARCH_MAY_HAVE_PC_FDC=y
40CONFIG_PPC_OF=y
41CONFIG_OF=y
42CONFIG_PPC_UDBG_16550=y
43# CONFIG_GENERIC_TBSYNC is not set
44CONFIG_AUDIT_ARCH=y
45CONFIG_GENERIC_BUG=y
46CONFIG_DEFAULT_UIMAGE=y
47# CONFIG_PPC_DCR_NATIVE is not set
48# CONFIG_PPC_DCR_MMIO is not set
49CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
50
51#
52# General setup
53#
54CONFIG_EXPERIMENTAL=y
55CONFIG_BROKEN_ON_SMP=y
56CONFIG_INIT_ENV_ARG_LIMIT=32
57CONFIG_LOCALVERSION=""
58CONFIG_LOCALVERSION_AUTO=y
59CONFIG_SWAP=y
60CONFIG_SYSVIPC=y
61CONFIG_SYSVIPC_SYSCTL=y
62CONFIG_POSIX_MQUEUE=y
63CONFIG_BSD_PROCESS_ACCT=y
64# CONFIG_BSD_PROCESS_ACCT_V3 is not set
65# CONFIG_TASKSTATS is not set
66# CONFIG_USER_NS is not set
67CONFIG_AUDIT=y
68# CONFIG_AUDITSYSCALL is not set
69CONFIG_IKCONFIG=y
70CONFIG_IKCONFIG_PROC=y
71CONFIG_LOG_BUF_SHIFT=14
72CONFIG_SYSFS_DEPRECATED=y
73# CONFIG_RELAY is not set
74CONFIG_BLK_DEV_INITRD=y
75CONFIG_INITRAMFS_SOURCE=""
76# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
77CONFIG_SYSCTL=y
78CONFIG_EMBEDDED=y
79CONFIG_SYSCTL_SYSCALL=y
80CONFIG_KALLSYMS=y
81CONFIG_KALLSYMS_ALL=y
82CONFIG_KALLSYMS_EXTRA_PASS=y
83CONFIG_HOTPLUG=y
84CONFIG_PRINTK=y
85CONFIG_BUG=y
86CONFIG_ELF_CORE=y
87CONFIG_BASE_FULL=y
88CONFIG_FUTEX=y
89CONFIG_ANON_INODES=y
90CONFIG_EPOLL=y
91CONFIG_SIGNALFD=y
92CONFIG_TIMERFD=y
93CONFIG_EVENTFD=y
94CONFIG_SHMEM=y
95CONFIG_VM_EVENT_COUNTERS=y
96CONFIG_SLAB=y
97# CONFIG_SLUB is not set
98# CONFIG_SLOB is not set
99CONFIG_RT_MUTEXES=y
100# CONFIG_TINY_SHMEM is not set
101CONFIG_BASE_SMALL=0
102CONFIG_MODULES=y
103CONFIG_MODULE_UNLOAD=y
104CONFIG_MODULE_FORCE_UNLOAD=y
105CONFIG_MODVERSIONS=y
106# CONFIG_MODULE_SRCVERSION_ALL is not set
107CONFIG_KMOD=y
108CONFIG_BLOCK=y
109CONFIG_LBD=y
110# CONFIG_BLK_DEV_IO_TRACE is not set
111# CONFIG_LSF is not set
112# CONFIG_BLK_DEV_BSG is not set
113
114#
115# IO Schedulers
116#
117CONFIG_IOSCHED_NOOP=y
118CONFIG_IOSCHED_AS=y
119CONFIG_IOSCHED_DEADLINE=y
120CONFIG_IOSCHED_CFQ=y
121# CONFIG_DEFAULT_AS is not set
122# CONFIG_DEFAULT_DEADLINE is not set
123CONFIG_DEFAULT_CFQ=y
124# CONFIG_DEFAULT_NOOP is not set
125CONFIG_DEFAULT_IOSCHED="cfq"
126
127#
128# Platform support
129#
130# CONFIG_PPC_MPC52xx is not set
131# CONFIG_PPC_MPC5200 is not set
132# CONFIG_PPC_CELL is not set
133# CONFIG_PPC_CELL_NATIVE is not set
134# CONFIG_PQ2ADS is not set
135# CONFIG_MPC8540_ADS is not set
136# CONFIG_MPC8560_ADS is not set
137# CONFIG_MPC85xx_CDS is not set
138# CONFIG_MPC85xx_MDS is not set
139CONFIG_MPC85xx_DS=y
140CONFIG_MPC85xx=y
141CONFIG_MPIC=y
142# CONFIG_MPIC_WEIRD is not set
143CONFIG_PPC_I8259=y
144# CONFIG_PPC_RTAS is not set
145# CONFIG_MMIO_NVRAM is not set
146# CONFIG_PPC_MPC106 is not set
147# CONFIG_PPC_970_NAP is not set
148# CONFIG_PPC_INDIRECT_IO is not set
149# CONFIG_GENERIC_IOMAP is not set
150# CONFIG_CPU_FREQ is not set
151# CONFIG_CPM2 is not set
152CONFIG_FSL_ULI1575=y
153
154#
155# Kernel options
156#
157CONFIG_HIGHMEM=y
158# CONFIG_HZ_100 is not set
159CONFIG_HZ_250=y
160# CONFIG_HZ_300 is not set
161# CONFIG_HZ_1000 is not set
162CONFIG_HZ=250
163CONFIG_PREEMPT_NONE=y
164# CONFIG_PREEMPT_VOLUNTARY is not set
165# CONFIG_PREEMPT is not set
166CONFIG_BINFMT_ELF=y
167CONFIG_BINFMT_MISC=m
168CONFIG_MATH_EMULATION=y
169CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
170CONFIG_ARCH_FLATMEM_ENABLE=y
171CONFIG_ARCH_POPULATES_NODE_MAP=y
172CONFIG_SELECT_MEMORY_MODEL=y
173CONFIG_FLATMEM_MANUAL=y
174# CONFIG_DISCONTIGMEM_MANUAL is not set
175# CONFIG_SPARSEMEM_MANUAL is not set
176CONFIG_FLATMEM=y
177CONFIG_FLAT_NODE_MEM_MAP=y
178# CONFIG_SPARSEMEM_STATIC is not set
179CONFIG_SPLIT_PTLOCK_CPUS=4
180# CONFIG_RESOURCES_64BIT is not set
181CONFIG_ZONE_DMA_FLAG=1
182CONFIG_BOUNCE=y
183CONFIG_VIRT_TO_BUS=y
184CONFIG_PROC_DEVICETREE=y
185# CONFIG_CMDLINE_BOOL is not set
186# CONFIG_PM is not set
187CONFIG_SECCOMP=y
188CONFIG_WANT_DEVICE_TREE=y
189CONFIG_DEVICE_TREE=""
190CONFIG_ISA_DMA_API=y
191
192#
193# Bus options
194#
195CONFIG_ZONE_DMA=y
196CONFIG_PPC_INDIRECT_PCI=y
197CONFIG_FSL_SOC=y
198CONFIG_FSL_PCI=y
199CONFIG_PCI=y
200CONFIG_PCI_DOMAINS=y
201CONFIG_PCI_SYSCALL=y
202# CONFIG_PCIEPORTBUS is not set
203CONFIG_ARCH_SUPPORTS_MSI=y
204# CONFIG_PCI_MSI is not set
205# CONFIG_PCI_DEBUG is not set
206
207#
208# PCCARD (PCMCIA/CardBus) support
209#
210# CONFIG_PCCARD is not set
211# CONFIG_HOTPLUG_PCI is not set
212
213#
214# Advanced setup
215#
216# CONFIG_ADVANCED_OPTIONS is not set
217
218#
219# Default settings for advanced configuration options are used
220#
221CONFIG_HIGHMEM_START=0xfe000000
222CONFIG_LOWMEM_SIZE=0x30000000
223CONFIG_KERNEL_START=0xc0000000
224CONFIG_TASK_SIZE=0x80000000
225CONFIG_BOOT_LOAD=0x00800000
226
227#
228# Networking
229#
230CONFIG_NET=y
231
232#
233# Networking options
234#
235CONFIG_PACKET=y
236# CONFIG_PACKET_MMAP is not set
237CONFIG_UNIX=y
238CONFIG_XFRM=y
239CONFIG_XFRM_USER=y
240# CONFIG_XFRM_SUB_POLICY is not set
241# CONFIG_XFRM_MIGRATE is not set
242CONFIG_NET_KEY=m
243# CONFIG_NET_KEY_MIGRATE is not set
244CONFIG_INET=y
245CONFIG_IP_MULTICAST=y
246CONFIG_IP_ADVANCED_ROUTER=y
247CONFIG_ASK_IP_FIB_HASH=y
248# CONFIG_IP_FIB_TRIE is not set
249CONFIG_IP_FIB_HASH=y
250CONFIG_IP_MULTIPLE_TABLES=y
251CONFIG_IP_ROUTE_MULTIPATH=y
252CONFIG_IP_ROUTE_VERBOSE=y
253CONFIG_IP_PNP=y
254CONFIG_IP_PNP_DHCP=y
255CONFIG_IP_PNP_BOOTP=y
256CONFIG_IP_PNP_RARP=y
257CONFIG_NET_IPIP=y
258CONFIG_NET_IPGRE=y
259CONFIG_NET_IPGRE_BROADCAST=y
260CONFIG_IP_MROUTE=y
261CONFIG_IP_PIMSM_V1=y
262CONFIG_IP_PIMSM_V2=y
263CONFIG_ARPD=y
264# CONFIG_SYN_COOKIES is not set
265# CONFIG_INET_AH is not set
266# CONFIG_INET_ESP is not set
267# CONFIG_INET_IPCOMP is not set
268# CONFIG_INET_XFRM_TUNNEL is not set
269CONFIG_INET_TUNNEL=y
270# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
271# CONFIG_INET_XFRM_MODE_TUNNEL is not set
272# CONFIG_INET_XFRM_MODE_BEET is not set
273CONFIG_INET_DIAG=y
274CONFIG_INET_TCP_DIAG=y
275# CONFIG_TCP_CONG_ADVANCED is not set
276CONFIG_TCP_CONG_CUBIC=y
277CONFIG_DEFAULT_TCP_CONG="cubic"
278# CONFIG_TCP_MD5SIG is not set
279CONFIG_IPV6=y
280# CONFIG_IPV6_PRIVACY is not set
281# CONFIG_IPV6_ROUTER_PREF is not set
282# CONFIG_IPV6_OPTIMISTIC_DAD is not set
283# CONFIG_INET6_AH is not set
284# CONFIG_INET6_ESP is not set
285# CONFIG_INET6_IPCOMP is not set
286# CONFIG_IPV6_MIP6 is not set
287# CONFIG_INET6_XFRM_TUNNEL is not set
288# CONFIG_INET6_TUNNEL is not set
289CONFIG_INET6_XFRM_MODE_TRANSPORT=y
290CONFIG_INET6_XFRM_MODE_TUNNEL=y
291CONFIG_INET6_XFRM_MODE_BEET=y
292# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
293CONFIG_IPV6_SIT=y
294# CONFIG_IPV6_TUNNEL is not set
295# CONFIG_IPV6_MULTIPLE_TABLES is not set
296# CONFIG_NETWORK_SECMARK is not set
297# CONFIG_NETFILTER is not set
298# CONFIG_IP_DCCP is not set
299CONFIG_IP_SCTP=m
300# CONFIG_SCTP_DBG_MSG is not set
301# CONFIG_SCTP_DBG_OBJCNT is not set
302# CONFIG_SCTP_HMAC_NONE is not set
303# CONFIG_SCTP_HMAC_SHA1 is not set
304CONFIG_SCTP_HMAC_MD5=y
305# CONFIG_TIPC is not set
306# CONFIG_ATM is not set
307# CONFIG_BRIDGE is not set
308# CONFIG_VLAN_8021Q is not set
309# CONFIG_DECNET is not set
310# CONFIG_LLC2 is not set
311# CONFIG_IPX is not set
312# CONFIG_ATALK is not set
313# CONFIG_X25 is not set
314# CONFIG_LAPB is not set
315# CONFIG_ECONET is not set
316# CONFIG_WAN_ROUTER is not set
317
318#
319# QoS and/or fair queueing
320#
321# CONFIG_NET_SCHED is not set
322
323#
324# Network testing
325#
326# CONFIG_NET_PKTGEN is not set
327# CONFIG_HAMRADIO is not set
328# CONFIG_IRDA is not set
329# CONFIG_BT is not set
330# CONFIG_AF_RXRPC is not set
331CONFIG_FIB_RULES=y
332
333#
334# Wireless
335#
336# CONFIG_CFG80211 is not set
337# CONFIG_WIRELESS_EXT is not set
338# CONFIG_MAC80211 is not set
339# CONFIG_IEEE80211 is not set
340# CONFIG_RFKILL is not set
341# CONFIG_NET_9P is not set
342
343#
344# Device Drivers
345#
346
347#
348# Generic Driver Options
349#
350CONFIG_STANDALONE=y
351CONFIG_PREVENT_FIRMWARE_BUILD=y
352CONFIG_FW_LOADER=y
353# CONFIG_DEBUG_DRIVER is not set
354# CONFIG_DEBUG_DEVRES is not set
355# CONFIG_SYS_HYPERVISOR is not set
356# CONFIG_CONNECTOR is not set
357# CONFIG_MTD is not set
358CONFIG_OF_DEVICE=y
359# CONFIG_PARPORT is not set
360CONFIG_BLK_DEV=y
361# CONFIG_BLK_DEV_FD is not set
362# CONFIG_BLK_CPQ_DA is not set
363# CONFIG_BLK_CPQ_CISS_DA is not set
364# CONFIG_BLK_DEV_DAC960 is not set
365# CONFIG_BLK_DEV_UMEM is not set
366# CONFIG_BLK_DEV_COW_COMMON is not set
367CONFIG_BLK_DEV_LOOP=y
368# CONFIG_BLK_DEV_CRYPTOLOOP is not set
369CONFIG_BLK_DEV_NBD=y
370# CONFIG_BLK_DEV_SX8 is not set
371# CONFIG_BLK_DEV_UB is not set
372CONFIG_BLK_DEV_RAM=y
373CONFIG_BLK_DEV_RAM_COUNT=16
374CONFIG_BLK_DEV_RAM_SIZE=131072
375CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
376# CONFIG_CDROM_PKTCDVD is not set
377# CONFIG_ATA_OVER_ETH is not set
378CONFIG_MISC_DEVICES=y
379# CONFIG_PHANTOM is not set
380# CONFIG_EEPROM_93CX6 is not set
381# CONFIG_SGI_IOC4 is not set
382# CONFIG_TIFM_CORE is not set
383# CONFIG_IDE is not set
384
385#
386# SCSI device support
387#
388# CONFIG_RAID_ATTRS is not set
389CONFIG_SCSI=y
390CONFIG_SCSI_DMA=y
391# CONFIG_SCSI_TGT is not set
392# CONFIG_SCSI_NETLINK is not set
393CONFIG_SCSI_PROC_FS=y
394
395#
396# SCSI support type (disk, tape, CD-ROM)
397#
398CONFIG_BLK_DEV_SD=y
399CONFIG_CHR_DEV_ST=y
400# CONFIG_CHR_DEV_OSST is not set
401CONFIG_BLK_DEV_SR=y
402# CONFIG_BLK_DEV_SR_VENDOR is not set
403CONFIG_CHR_DEV_SG=y
404# CONFIG_CHR_DEV_SCH is not set
405
406#
407# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
408#
409CONFIG_SCSI_MULTI_LUN=y
410# CONFIG_SCSI_CONSTANTS is not set
411CONFIG_SCSI_LOGGING=y
412# CONFIG_SCSI_SCAN_ASYNC is not set
413CONFIG_SCSI_WAIT_SCAN=m
414
415#
416# SCSI Transports
417#
418# CONFIG_SCSI_SPI_ATTRS is not set
419# CONFIG_SCSI_FC_ATTRS is not set
420# CONFIG_SCSI_ISCSI_ATTRS is not set
421# CONFIG_SCSI_SAS_LIBSAS is not set
422CONFIG_SCSI_LOWLEVEL=y
423# CONFIG_ISCSI_TCP is not set
424# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
425# CONFIG_SCSI_3W_9XXX is not set
426# CONFIG_SCSI_ACARD is not set
427# CONFIG_SCSI_AACRAID is not set
428# CONFIG_SCSI_AIC7XXX is not set
429# CONFIG_SCSI_AIC7XXX_OLD is not set
430# CONFIG_SCSI_AIC79XX is not set
431# CONFIG_SCSI_AIC94XX is not set
432# CONFIG_SCSI_DPT_I2O is not set
433# CONFIG_SCSI_ARCMSR is not set
434# CONFIG_MEGARAID_NEWGEN is not set
435# CONFIG_MEGARAID_LEGACY is not set
436# CONFIG_MEGARAID_SAS is not set
437# CONFIG_SCSI_HPTIOP is not set
438# CONFIG_SCSI_BUSLOGIC is not set
439# CONFIG_SCSI_DMX3191D is not set
440# CONFIG_SCSI_EATA is not set
441# CONFIG_SCSI_FUTURE_DOMAIN is not set
442# CONFIG_SCSI_GDTH is not set
443# CONFIG_SCSI_IPS is not set
444# CONFIG_SCSI_INITIO is not set
445# CONFIG_SCSI_INIA100 is not set
446# CONFIG_SCSI_STEX is not set
447# CONFIG_SCSI_SYM53C8XX_2 is not set
448# CONFIG_SCSI_IPR is not set
449# CONFIG_SCSI_QLOGIC_1280 is not set
450# CONFIG_SCSI_QLA_FC is not set
451# CONFIG_SCSI_QLA_ISCSI is not set
452# CONFIG_SCSI_LPFC is not set
453# CONFIG_SCSI_DC395x is not set
454# CONFIG_SCSI_DC390T is not set
455# CONFIG_SCSI_NSP32 is not set
456# CONFIG_SCSI_DEBUG is not set
457# CONFIG_SCSI_SRP is not set
458CONFIG_ATA=y
459# CONFIG_ATA_NONSTANDARD is not set
460CONFIG_SATA_AHCI=y
461# CONFIG_SATA_SVW is not set
462# CONFIG_ATA_PIIX is not set
463# CONFIG_SATA_MV is not set
464# CONFIG_SATA_NV is not set
465# CONFIG_PDC_ADMA is not set
466# CONFIG_SATA_QSTOR is not set
467# CONFIG_SATA_PROMISE is not set
468# CONFIG_SATA_SX4 is not set
469# CONFIG_SATA_SIL is not set
470# CONFIG_SATA_SIL24 is not set
471# CONFIG_SATA_SIS is not set
472# CONFIG_SATA_ULI is not set
473# CONFIG_SATA_VIA is not set
474# CONFIG_SATA_VITESSE is not set
475# CONFIG_SATA_INIC162X is not set
476CONFIG_PATA_ALI=y
477# CONFIG_PATA_AMD is not set
478# CONFIG_PATA_ARTOP is not set
479# CONFIG_PATA_ATIIXP is not set
480# CONFIG_PATA_CMD640_PCI is not set
481# CONFIG_PATA_CMD64X is not set
482# CONFIG_PATA_CS5520 is not set
483# CONFIG_PATA_CS5530 is not set
484# CONFIG_PATA_CYPRESS is not set
485# CONFIG_PATA_EFAR is not set
486# CONFIG_ATA_GENERIC is not set
487# CONFIG_PATA_HPT366 is not set
488# CONFIG_PATA_HPT37X is not set
489# CONFIG_PATA_HPT3X2N is not set
490# CONFIG_PATA_HPT3X3 is not set
491# CONFIG_PATA_IT821X is not set
492# CONFIG_PATA_IT8213 is not set
493# CONFIG_PATA_JMICRON is not set
494# CONFIG_PATA_TRIFLEX is not set
495# CONFIG_PATA_MARVELL is not set
496# CONFIG_PATA_MPIIX is not set
497# CONFIG_PATA_OLDPIIX is not set
498# CONFIG_PATA_NETCELL is not set
499# CONFIG_PATA_NS87410 is not set
500# CONFIG_PATA_OPTI is not set
501# CONFIG_PATA_OPTIDMA is not set
502# CONFIG_PATA_PDC_OLD is not set
503# CONFIG_PATA_RADISYS is not set
504# CONFIG_PATA_RZ1000 is not set
505# CONFIG_PATA_SC1200 is not set
506# CONFIG_PATA_SERVERWORKS is not set
507# CONFIG_PATA_PDC2027X is not set
508# CONFIG_PATA_SIL680 is not set
509# CONFIG_PATA_SIS is not set
510# CONFIG_PATA_VIA is not set
511# CONFIG_PATA_WINBOND is not set
512# CONFIG_PATA_PLATFORM is not set
513# CONFIG_MD is not set
514
515#
516# Fusion MPT device support
517#
518# CONFIG_FUSION is not set
519# CONFIG_FUSION_SPI is not set
520# CONFIG_FUSION_FC is not set
521# CONFIG_FUSION_SAS is not set
522
523#
524# IEEE 1394 (FireWire) support
525#
526# CONFIG_FIREWIRE is not set
527# CONFIG_IEEE1394 is not set
528# CONFIG_I2O is not set
529# CONFIG_MACINTOSH_DRIVERS is not set
530CONFIG_NETDEVICES=y
531# CONFIG_NETDEVICES_MULTIQUEUE is not set
532CONFIG_DUMMY=y
533# CONFIG_BONDING is not set
534# CONFIG_MACVLAN is not set
535# CONFIG_EQUALIZER is not set
536# CONFIG_TUN is not set
537# CONFIG_ARCNET is not set
538CONFIG_PHYLIB=y
539
540#
541# MII PHY device drivers
542#
543# CONFIG_MARVELL_PHY is not set
544# CONFIG_DAVICOM_PHY is not set
545# CONFIG_QSEMI_PHY is not set
546# CONFIG_LXT_PHY is not set
547# CONFIG_CICADA_PHY is not set
548CONFIG_VITESSE_PHY=y
549# CONFIG_SMSC_PHY is not set
550# CONFIG_BROADCOM_PHY is not set
551# CONFIG_ICPLUS_PHY is not set
552# CONFIG_FIXED_PHY is not set
553CONFIG_NET_ETHERNET=y
554CONFIG_MII=y
555# CONFIG_HAPPYMEAL is not set
556# CONFIG_SUNGEM is not set
557# CONFIG_CASSINI is not set
558# CONFIG_NET_VENDOR_3COM is not set
559# CONFIG_NET_TULIP is not set
560# CONFIG_HP100 is not set
561# CONFIG_NET_PCI is not set
562CONFIG_NETDEV_1000=y
563# CONFIG_ACENIC is not set
564# CONFIG_DL2K is not set
565# CONFIG_E1000 is not set
566# CONFIG_NS83820 is not set
567# CONFIG_HAMACHI is not set
568# CONFIG_YELLOWFIN is not set
569# CONFIG_R8169 is not set
570# CONFIG_SIS190 is not set
571# CONFIG_SKGE is not set
572# CONFIG_SKY2 is not set
573# CONFIG_VIA_VELOCITY is not set
574# CONFIG_TIGON3 is not set
575# CONFIG_BNX2 is not set
576CONFIG_GIANFAR=y
577CONFIG_GFAR_NAPI=y
578# CONFIG_QLA3XXX is not set
579# CONFIG_ATL1 is not set
580CONFIG_NETDEV_10000=y
581# CONFIG_CHELSIO_T1 is not set
582# CONFIG_CHELSIO_T3 is not set
583# CONFIG_IXGB is not set
584# CONFIG_S2IO is not set
585# CONFIG_MYRI10GE is not set
586# CONFIG_NETXEN_NIC is not set
587# CONFIG_MLX4_CORE is not set
588# CONFIG_TR is not set
589
590#
591# Wireless LAN
592#
593# CONFIG_WLAN_PRE80211 is not set
594# CONFIG_WLAN_80211 is not set
595
596#
597# USB Network Adapters
598#
599# CONFIG_USB_CATC is not set
600# CONFIG_USB_KAWETH is not set
601# CONFIG_USB_PEGASUS is not set
602# CONFIG_USB_RTL8150 is not set
603# CONFIG_USB_USBNET_MII is not set
604# CONFIG_USB_USBNET is not set
605# CONFIG_WAN is not set
606# CONFIG_FDDI is not set
607# CONFIG_HIPPI is not set
608# CONFIG_PPP is not set
609# CONFIG_SLIP is not set
610# CONFIG_NET_FC is not set
611# CONFIG_SHAPER is not set
612# CONFIG_NETCONSOLE is not set
613# CONFIG_NETPOLL is not set
614# CONFIG_NET_POLL_CONTROLLER is not set
615# CONFIG_ISDN is not set
616# CONFIG_PHONE is not set
617
618#
619# Input device support
620#
621CONFIG_INPUT=y
622# CONFIG_INPUT_FF_MEMLESS is not set
623# CONFIG_INPUT_POLLDEV is not set
624
625#
626# Userland interfaces
627#
628# CONFIG_INPUT_MOUSEDEV is not set
629# CONFIG_INPUT_JOYDEV is not set
630# CONFIG_INPUT_TSDEV is not set
631# CONFIG_INPUT_EVDEV is not set
632# CONFIG_INPUT_EVBUG is not set
633
634#
635# Input Device Drivers
636#
637# CONFIG_INPUT_KEYBOARD is not set
638# CONFIG_INPUT_MOUSE is not set
639# CONFIG_INPUT_JOYSTICK is not set
640# CONFIG_INPUT_TABLET is not set
641# CONFIG_INPUT_TOUCHSCREEN is not set
642# CONFIG_INPUT_MISC is not set
643
644#
645# Hardware I/O ports
646#
647CONFIG_SERIO=y
648CONFIG_SERIO_I8042=y
649CONFIG_SERIO_SERPORT=y
650# CONFIG_SERIO_PCIPS2 is not set
651CONFIG_SERIO_LIBPS2=y
652# CONFIG_SERIO_RAW is not set
653# CONFIG_GAMEPORT is not set
654
655#
656# Character devices
657#
658CONFIG_VT=y
659CONFIG_VT_CONSOLE=y
660CONFIG_HW_CONSOLE=y
661# CONFIG_VT_HW_CONSOLE_BINDING is not set
662# CONFIG_SERIAL_NONSTANDARD is not set
663
664#
665# Serial drivers
666#
667CONFIG_SERIAL_8250=y
668CONFIG_SERIAL_8250_CONSOLE=y
669CONFIG_SERIAL_8250_PCI=y
670CONFIG_SERIAL_8250_NR_UARTS=2
671CONFIG_SERIAL_8250_RUNTIME_UARTS=2
672CONFIG_SERIAL_8250_EXTENDED=y
673CONFIG_SERIAL_8250_MANY_PORTS=y
674CONFIG_SERIAL_8250_SHARE_IRQ=y
675CONFIG_SERIAL_8250_DETECT_IRQ=y
676CONFIG_SERIAL_8250_RSA=y
677
678#
679# Non-8250 serial port support
680#
681# CONFIG_SERIAL_UARTLITE is not set
682CONFIG_SERIAL_CORE=y
683CONFIG_SERIAL_CORE_CONSOLE=y
684# CONFIG_SERIAL_JSM is not set
685# CONFIG_SERIAL_OF_PLATFORM is not set
686CONFIG_UNIX98_PTYS=y
687CONFIG_LEGACY_PTYS=y
688CONFIG_LEGACY_PTY_COUNT=256
689# CONFIG_IPMI_HANDLER is not set
690# CONFIG_WATCHDOG is not set
691# CONFIG_HW_RANDOM is not set
692CONFIG_NVRAM=y
693CONFIG_GEN_RTC=y
694CONFIG_GEN_RTC_X=y
695# CONFIG_R3964 is not set
696# CONFIG_APPLICOM is not set
697# CONFIG_AGP is not set
698# CONFIG_DRM is not set
699# CONFIG_RAW_DRIVER is not set
700# CONFIG_TCG_TPM is not set
701CONFIG_DEVPORT=y
702CONFIG_I2C=y
703CONFIG_I2C_BOARDINFO=y
704# CONFIG_I2C_CHARDEV is not set
705
706#
707# I2C Algorithms
708#
709# CONFIG_I2C_ALGOBIT is not set
710# CONFIG_I2C_ALGOPCF is not set
711# CONFIG_I2C_ALGOPCA is not set
712
713#
714# I2C Hardware Bus support
715#
716# CONFIG_I2C_ALI1535 is not set
717# CONFIG_I2C_ALI1563 is not set
718# CONFIG_I2C_ALI15X3 is not set
719# CONFIG_I2C_AMD756 is not set
720# CONFIG_I2C_AMD8111 is not set
721# CONFIG_I2C_I801 is not set
722# CONFIG_I2C_I810 is not set
723# CONFIG_I2C_PIIX4 is not set
724CONFIG_I2C_MPC=y
725# CONFIG_I2C_NFORCE2 is not set
726# CONFIG_I2C_OCORES is not set
727# CONFIG_I2C_PARPORT_LIGHT is not set
728# CONFIG_I2C_PROSAVAGE is not set
729# CONFIG_I2C_SAVAGE4 is not set
730# CONFIG_I2C_SIMTEC is not set
731# CONFIG_I2C_SIS5595 is not set
732# CONFIG_I2C_SIS630 is not set
733# CONFIG_I2C_SIS96X is not set
734# CONFIG_I2C_TAOS_EVM is not set
735# CONFIG_I2C_STUB is not set
736# CONFIG_I2C_TINY_USB is not set
737# CONFIG_I2C_VIA is not set
738# CONFIG_I2C_VIAPRO is not set
739# CONFIG_I2C_VOODOO3 is not set
740
741#
742# Miscellaneous I2C Chip support
743#
744# CONFIG_SENSORS_DS1337 is not set
745# CONFIG_SENSORS_DS1374 is not set
746# CONFIG_DS1682 is not set
747CONFIG_SENSORS_EEPROM=y
748# CONFIG_SENSORS_PCF8574 is not set
749# CONFIG_SENSORS_PCA9539 is not set
750# CONFIG_SENSORS_PCF8591 is not set
751# CONFIG_SENSORS_M41T00 is not set
752# CONFIG_SENSORS_MAX6875 is not set
753# CONFIG_SENSORS_TSL2550 is not set
754# CONFIG_I2C_DEBUG_CORE is not set
755# CONFIG_I2C_DEBUG_ALGO is not set
756# CONFIG_I2C_DEBUG_BUS is not set
757# CONFIG_I2C_DEBUG_CHIP is not set
758
759#
760# SPI support
761#
762# CONFIG_SPI is not set
763# CONFIG_SPI_MASTER is not set
764# CONFIG_W1 is not set
765# CONFIG_POWER_SUPPLY is not set
766# CONFIG_HWMON is not set
767
768#
769# Multifunction device drivers
770#
771# CONFIG_MFD_SM501 is not set
772
773#
774# Multimedia devices
775#
776# CONFIG_VIDEO_DEV is not set
777CONFIG_DVB_CORE=m
778# CONFIG_DVB_CORE_ATTACH is not set
779CONFIG_DVB_CAPTURE_DRIVERS=y
780
781#
782# Supported SAA7146 based PCI Adapters
783#
784
785#
786# Supported USB Adapters
787#
788# CONFIG_DVB_USB is not set
789# CONFIG_DVB_TTUSB_BUDGET is not set
790# CONFIG_DVB_TTUSB_DEC is not set
791# CONFIG_DVB_CINERGYT2 is not set
792
793#
794# Supported FlexCopII (B2C2) Adapters
795#
796# CONFIG_DVB_B2C2_FLEXCOP is not set
797
798#
799# Supported BT878 Adapters
800#
801
802#
803# Supported Pluto2 Adapters
804#
805# CONFIG_DVB_PLUTO2 is not set
806
807#
808# Supported DVB Frontends
809#
810
811#
812# Customise DVB Frontends
813#
814# CONFIG_DVB_FE_CUSTOMISE is not set
815
816#
817# DVB-S (satellite) frontends
818#
819# CONFIG_DVB_STV0299 is not set
820# CONFIG_DVB_CX24110 is not set
821# CONFIG_DVB_CX24123 is not set
822# CONFIG_DVB_TDA8083 is not set
823# CONFIG_DVB_MT312 is not set
824# CONFIG_DVB_VES1X93 is not set
825# CONFIG_DVB_S5H1420 is not set
826# CONFIG_DVB_TDA10086 is not set
827
828#
829# DVB-T (terrestrial) frontends
830#
831# CONFIG_DVB_SP8870 is not set
832# CONFIG_DVB_SP887X is not set
833# CONFIG_DVB_CX22700 is not set
834# CONFIG_DVB_CX22702 is not set
835# CONFIG_DVB_L64781 is not set
836# CONFIG_DVB_TDA1004X is not set
837# CONFIG_DVB_NXT6000 is not set
838# CONFIG_DVB_MT352 is not set
839# CONFIG_DVB_ZL10353 is not set
840# CONFIG_DVB_DIB3000MB is not set
841# CONFIG_DVB_DIB3000MC is not set
842# CONFIG_DVB_DIB7000M is not set
843# CONFIG_DVB_DIB7000P is not set
844
845#
846# DVB-C (cable) frontends
847#
848# CONFIG_DVB_VES1820 is not set
849# CONFIG_DVB_TDA10021 is not set
850# CONFIG_DVB_TDA10023 is not set
851# CONFIG_DVB_STV0297 is not set
852
853#
854# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
855#
856# CONFIG_DVB_NXT200X is not set
857# CONFIG_DVB_OR51211 is not set
858# CONFIG_DVB_OR51132 is not set
859# CONFIG_DVB_BCM3510 is not set
860# CONFIG_DVB_LGDT330X is not set
861
862#
863# Tuners/PLL support
864#
865# CONFIG_DVB_PLL is not set
866# CONFIG_DVB_TDA826X is not set
867# CONFIG_DVB_TDA827X is not set
868# CONFIG_DVB_TUNER_QT1010 is not set
869# CONFIG_DVB_TUNER_MT2060 is not set
870
871#
872# Miscellaneous devices
873#
874# CONFIG_DVB_LNBP21 is not set
875# CONFIG_DVB_ISL6421 is not set
876# CONFIG_DVB_TUA6100 is not set
877CONFIG_DAB=y
878# CONFIG_USB_DABUSB is not set
879
880#
881# Graphics support
882#
883# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
884
885#
886# Display device support
887#
888# CONFIG_DISPLAY_SUPPORT is not set
889# CONFIG_VGASTATE is not set
890CONFIG_VIDEO_OUTPUT_CONTROL=y
891# CONFIG_FB is not set
892# CONFIG_FB_IBM_GXT4500 is not set
893
894#
895# Console display driver support
896#
897CONFIG_VGA_CONSOLE=y
898# CONFIG_VGACON_SOFT_SCROLLBACK is not set
899CONFIG_DUMMY_CONSOLE=y
900
901#
902# Sound
903#
904CONFIG_SOUND=y
905
906#
907# Advanced Linux Sound Architecture
908#
909CONFIG_SND=y
910CONFIG_SND_TIMER=y
911CONFIG_SND_PCM=y
912# CONFIG_SND_SEQUENCER is not set
913# CONFIG_SND_MIXER_OSS is not set
914# CONFIG_SND_PCM_OSS is not set
915# CONFIG_SND_DYNAMIC_MINORS is not set
916CONFIG_SND_SUPPORT_OLD_API=y
917CONFIG_SND_VERBOSE_PROCFS=y
918# CONFIG_SND_VERBOSE_PRINTK is not set
919# CONFIG_SND_DEBUG is not set
920
921#
922# Generic devices
923#
924CONFIG_SND_AC97_CODEC=y
925# CONFIG_SND_DUMMY is not set
926# CONFIG_SND_MTPAV is not set
927# CONFIG_SND_SERIAL_U16550 is not set
928# CONFIG_SND_MPU401 is not set
929
930#
931# PCI devices
932#
933# CONFIG_SND_AD1889 is not set
934# CONFIG_SND_ALS300 is not set
935# CONFIG_SND_ALS4000 is not set
936# CONFIG_SND_ALI5451 is not set
937# CONFIG_SND_ATIIXP is not set
938# CONFIG_SND_ATIIXP_MODEM is not set
939# CONFIG_SND_AU8810 is not set
940# CONFIG_SND_AU8820 is not set
941# CONFIG_SND_AU8830 is not set
942# CONFIG_SND_AZT3328 is not set
943# CONFIG_SND_BT87X is not set
944# CONFIG_SND_CA0106 is not set
945# CONFIG_SND_CMIPCI is not set
946# CONFIG_SND_CS4281 is not set
947# CONFIG_SND_CS46XX is not set
948# CONFIG_SND_CS5530 is not set
949# CONFIG_SND_DARLA20 is not set
950# CONFIG_SND_GINA20 is not set
951# CONFIG_SND_LAYLA20 is not set
952# CONFIG_SND_DARLA24 is not set
953# CONFIG_SND_GINA24 is not set
954# CONFIG_SND_LAYLA24 is not set
955# CONFIG_SND_MONA is not set
956# CONFIG_SND_MIA is not set
957# CONFIG_SND_ECHO3G is not set
958# CONFIG_SND_INDIGO is not set
959# CONFIG_SND_INDIGOIO is not set
960# CONFIG_SND_INDIGODJ is not set
961# CONFIG_SND_EMU10K1 is not set
962# CONFIG_SND_EMU10K1X is not set
963# CONFIG_SND_ENS1370 is not set
964# CONFIG_SND_ENS1371 is not set
965# CONFIG_SND_ES1938 is not set
966# CONFIG_SND_ES1968 is not set
967# CONFIG_SND_FM801 is not set
968# CONFIG_SND_HDA_INTEL is not set
969# CONFIG_SND_HDSP is not set
970# CONFIG_SND_HDSPM is not set
971# CONFIG_SND_ICE1712 is not set
972# CONFIG_SND_ICE1724 is not set
973CONFIG_SND_INTEL8X0=y
974# CONFIG_SND_INTEL8X0M is not set
975# CONFIG_SND_KORG1212 is not set
976# CONFIG_SND_MAESTRO3 is not set
977# CONFIG_SND_MIXART is not set
978# CONFIG_SND_NM256 is not set
979# CONFIG_SND_PCXHR is not set
980# CONFIG_SND_RIPTIDE is not set
981# CONFIG_SND_RME32 is not set
982# CONFIG_SND_RME96 is not set
983# CONFIG_SND_RME9652 is not set
984# CONFIG_SND_SONICVIBES is not set
985# CONFIG_SND_TRIDENT is not set
986# CONFIG_SND_VIA82XX is not set
987# CONFIG_SND_VIA82XX_MODEM is not set
988# CONFIG_SND_VX222 is not set
989# CONFIG_SND_YMFPCI is not set
990# CONFIG_SND_AC97_POWER_SAVE is not set
991
992#
993# ALSA PowerMac devices
994#
995
996#
997# ALSA PowerPC devices
998#
999
1000#
1001# USB devices
1002#
1003# CONFIG_SND_USB_AUDIO is not set
1004# CONFIG_SND_USB_USX2Y is not set
1005# CONFIG_SND_USB_CAIAQ is not set
1006
1007#
1008# System on Chip audio support
1009#
1010# CONFIG_SND_SOC is not set
1011
1012#
1013# SoC Audio support for SuperH
1014#
1015
1016#
1017# Open Sound System
1018#
1019# CONFIG_SOUND_PRIME is not set
1020CONFIG_AC97_BUS=y
1021CONFIG_HID_SUPPORT=y
1022CONFIG_HID=y
1023# CONFIG_HID_DEBUG is not set
1024
1025#
1026# USB Input Devices
1027#
1028CONFIG_USB_HID=y
1029# CONFIG_USB_HIDINPUT_POWERBOOK is not set
1030# CONFIG_HID_FF is not set
1031# CONFIG_USB_HIDDEV is not set
1032CONFIG_USB_SUPPORT=y
1033CONFIG_USB_ARCH_HAS_HCD=y
1034CONFIG_USB_ARCH_HAS_OHCI=y
1035CONFIG_USB_ARCH_HAS_EHCI=y
1036CONFIG_USB=y
1037# CONFIG_USB_DEBUG is not set
1038
1039#
1040# Miscellaneous USB options
1041#
1042CONFIG_USB_DEVICEFS=y
1043CONFIG_USB_DEVICE_CLASS=y
1044# CONFIG_USB_DYNAMIC_MINORS is not set
1045# CONFIG_USB_OTG is not set
1046
1047#
1048# USB Host Controller Drivers
1049#
1050CONFIG_USB_EHCI_HCD=y
1051# CONFIG_USB_EHCI_SPLIT_ISO is not set
1052# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
1053# CONFIG_USB_EHCI_TT_NEWSCHED is not set
1054# CONFIG_USB_ISP116X_HCD is not set
1055CONFIG_USB_OHCI_HCD=y
1056CONFIG_USB_OHCI_HCD_PPC_OF=y
1057CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
1058CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
1059CONFIG_USB_OHCI_HCD_PCI=y
1060CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
1061CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
1062CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1063# CONFIG_USB_UHCI_HCD is not set
1064# CONFIG_USB_SL811_HCD is not set
1065# CONFIG_USB_R8A66597_HCD is not set
1066
1067#
1068# USB Device Class drivers
1069#
1070# CONFIG_USB_ACM is not set
1071# CONFIG_USB_PRINTER is not set
1072
1073#
1074# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
1075#
1076
1077#
1078# may also be needed; see USB_STORAGE Help for more information
1079#
1080CONFIG_USB_STORAGE=y
1081# CONFIG_USB_STORAGE_DEBUG is not set
1082# CONFIG_USB_STORAGE_DATAFAB is not set
1083# CONFIG_USB_STORAGE_FREECOM is not set
1084# CONFIG_USB_STORAGE_DPCM is not set
1085# CONFIG_USB_STORAGE_USBAT is not set
1086# CONFIG_USB_STORAGE_SDDR09 is not set
1087# CONFIG_USB_STORAGE_SDDR55 is not set
1088# CONFIG_USB_STORAGE_JUMPSHOT is not set
1089# CONFIG_USB_STORAGE_ALAUDA is not set
1090# CONFIG_USB_STORAGE_KARMA is not set
1091# CONFIG_USB_LIBUSUAL is not set
1092
1093#
1094# USB Imaging devices
1095#
1096# CONFIG_USB_MDC800 is not set
1097# CONFIG_USB_MICROTEK is not set
1098CONFIG_USB_MON=y
1099
1100#
1101# USB port drivers
1102#
1103
1104#
1105# USB Serial Converter support
1106#
1107# CONFIG_USB_SERIAL is not set
1108
1109#
1110# USB Miscellaneous drivers
1111#
1112# CONFIG_USB_EMI62 is not set
1113# CONFIG_USB_EMI26 is not set
1114# CONFIG_USB_ADUTUX is not set
1115# CONFIG_USB_AUERSWALD is not set
1116# CONFIG_USB_RIO500 is not set
1117# CONFIG_USB_LEGOTOWER is not set
1118# CONFIG_USB_LCD is not set
1119# CONFIG_USB_BERRY_CHARGE is not set
1120# CONFIG_USB_LED is not set
1121# CONFIG_USB_CYPRESS_CY7C63 is not set
1122# CONFIG_USB_CYTHERM is not set
1123# CONFIG_USB_PHIDGET is not set
1124# CONFIG_USB_IDMOUSE is not set
1125# CONFIG_USB_FTDI_ELAN is not set
1126# CONFIG_USB_APPLEDISPLAY is not set
1127# CONFIG_USB_SISUSBVGA is not set
1128# CONFIG_USB_LD is not set
1129# CONFIG_USB_TRANCEVIBRATOR is not set
1130# CONFIG_USB_IOWARRIOR is not set
1131# CONFIG_USB_TEST is not set
1132
1133#
1134# USB DSL modem support
1135#
1136
1137#
1138# USB Gadget Support
1139#
1140# CONFIG_USB_GADGET is not set
1141# CONFIG_MMC is not set
1142# CONFIG_NEW_LEDS is not set
1143# CONFIG_INFINIBAND is not set
1144# CONFIG_EDAC is not set
1145CONFIG_RTC_LIB=y
1146CONFIG_RTC_CLASS=y
1147CONFIG_RTC_HCTOSYS=y
1148CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1149# CONFIG_RTC_DEBUG is not set
1150
1151#
1152# RTC interfaces
1153#
1154CONFIG_RTC_INTF_SYSFS=y
1155CONFIG_RTC_INTF_PROC=y
1156CONFIG_RTC_INTF_DEV=y
1157# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1158# CONFIG_RTC_DRV_TEST is not set
1159
1160#
1161# I2C RTC drivers
1162#
1163# CONFIG_RTC_DRV_DS1307 is not set
1164# CONFIG_RTC_DRV_DS1672 is not set
1165# CONFIG_RTC_DRV_MAX6900 is not set
1166# CONFIG_RTC_DRV_RS5C372 is not set
1167# CONFIG_RTC_DRV_ISL1208 is not set
1168# CONFIG_RTC_DRV_X1205 is not set
1169# CONFIG_RTC_DRV_PCF8563 is not set
1170# CONFIG_RTC_DRV_PCF8583 is not set
1171# CONFIG_RTC_DRV_M41T80 is not set
1172
1173#
1174# SPI RTC drivers
1175#
1176
1177#
1178# Platform RTC drivers
1179#
1180CONFIG_RTC_DRV_CMOS=y
1181# CONFIG_RTC_DRV_DS1553 is not set
1182# CONFIG_RTC_DRV_STK17TA8 is not set
1183# CONFIG_RTC_DRV_DS1742 is not set
1184# CONFIG_RTC_DRV_M48T86 is not set
1185# CONFIG_RTC_DRV_M48T59 is not set
1186# CONFIG_RTC_DRV_V3020 is not set
1187
1188#
1189# on-CPU RTC drivers
1190#
1191
1192#
1193# DMA Engine support
1194#
1195# CONFIG_DMA_ENGINE is not set
1196
1197#
1198# DMA Clients
1199#
1200
1201#
1202# DMA Devices
1203#
1204
1205#
1206# Userspace I/O
1207#
1208# CONFIG_UIO is not set
1209
1210#
1211# File systems
1212#
1213CONFIG_EXT2_FS=y
1214# CONFIG_EXT2_FS_XATTR is not set
1215# CONFIG_EXT2_FS_XIP is not set
1216CONFIG_EXT3_FS=y
1217CONFIG_EXT3_FS_XATTR=y
1218# CONFIG_EXT3_FS_POSIX_ACL is not set
1219# CONFIG_EXT3_FS_SECURITY is not set
1220# CONFIG_EXT4DEV_FS is not set
1221CONFIG_JBD=y
1222# CONFIG_JBD_DEBUG is not set
1223CONFIG_FS_MBCACHE=y
1224# CONFIG_REISERFS_FS is not set
1225# CONFIG_JFS_FS is not set
1226# CONFIG_FS_POSIX_ACL is not set
1227# CONFIG_XFS_FS is not set
1228# CONFIG_GFS2_FS is not set
1229# CONFIG_OCFS2_FS is not set
1230# CONFIG_MINIX_FS is not set
1231# CONFIG_ROMFS_FS is not set
1232CONFIG_INOTIFY=y
1233CONFIG_INOTIFY_USER=y
1234# CONFIG_QUOTA is not set
1235CONFIG_DNOTIFY=y
1236# CONFIG_AUTOFS_FS is not set
1237# CONFIG_AUTOFS4_FS is not set
1238# CONFIG_FUSE_FS is not set
1239
1240#
1241# CD-ROM/DVD Filesystems
1242#
1243CONFIG_ISO9660_FS=m
1244CONFIG_JOLIET=y
1245CONFIG_ZISOFS=y
1246CONFIG_UDF_FS=m
1247CONFIG_UDF_NLS=y
1248
1249#
1250# DOS/FAT/NT Filesystems
1251#
1252CONFIG_FAT_FS=y
1253CONFIG_MSDOS_FS=m
1254CONFIG_VFAT_FS=y
1255CONFIG_FAT_DEFAULT_CODEPAGE=437
1256CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1257CONFIG_NTFS_FS=y
1258# CONFIG_NTFS_DEBUG is not set
1259# CONFIG_NTFS_RW is not set
1260
1261#
1262# Pseudo filesystems
1263#
1264CONFIG_PROC_FS=y
1265CONFIG_PROC_KCORE=y
1266CONFIG_PROC_SYSCTL=y
1267CONFIG_SYSFS=y
1268CONFIG_TMPFS=y
1269# CONFIG_TMPFS_POSIX_ACL is not set
1270# CONFIG_HUGETLB_PAGE is not set
1271CONFIG_RAMFS=y
1272# CONFIG_CONFIGFS_FS is not set
1273
1274#
1275# Miscellaneous filesystems
1276#
1277CONFIG_ADFS_FS=m
1278# CONFIG_ADFS_FS_RW is not set
1279CONFIG_AFFS_FS=m
1280CONFIG_HFS_FS=m
1281CONFIG_HFSPLUS_FS=m
1282CONFIG_BEFS_FS=m
1283# CONFIG_BEFS_DEBUG is not set
1284CONFIG_BFS_FS=m
1285CONFIG_EFS_FS=m
1286CONFIG_CRAMFS=y
1287CONFIG_VXFS_FS=m
1288CONFIG_HPFS_FS=m
1289CONFIG_QNX4FS_FS=m
1290CONFIG_SYSV_FS=m
1291CONFIG_UFS_FS=m
1292# CONFIG_UFS_FS_WRITE is not set
1293# CONFIG_UFS_DEBUG is not set
1294
1295#
1296# Network File Systems
1297#
1298CONFIG_NFS_FS=y
1299CONFIG_NFS_V3=y
1300# CONFIG_NFS_V3_ACL is not set
1301CONFIG_NFS_V4=y
1302# CONFIG_NFS_DIRECTIO is not set
1303CONFIG_NFSD=y
1304# CONFIG_NFSD_V3 is not set
1305CONFIG_NFSD_TCP=y
1306CONFIG_ROOT_NFS=y
1307CONFIG_LOCKD=y
1308CONFIG_LOCKD_V4=y
1309CONFIG_EXPORTFS=y
1310CONFIG_NFS_COMMON=y
1311CONFIG_SUNRPC=y
1312CONFIG_SUNRPC_GSS=y
1313# CONFIG_SUNRPC_BIND34 is not set
1314CONFIG_RPCSEC_GSS_KRB5=y
1315# CONFIG_RPCSEC_GSS_SPKM3 is not set
1316# CONFIG_SMB_FS is not set
1317# CONFIG_CIFS is not set
1318# CONFIG_NCP_FS is not set
1319# CONFIG_CODA_FS is not set
1320# CONFIG_AFS_FS is not set
1321
1322#
1323# Partition Types
1324#
1325CONFIG_PARTITION_ADVANCED=y
1326# CONFIG_ACORN_PARTITION is not set
1327# CONFIG_OSF_PARTITION is not set
1328# CONFIG_AMIGA_PARTITION is not set
1329# CONFIG_ATARI_PARTITION is not set
1330CONFIG_MAC_PARTITION=y
1331CONFIG_MSDOS_PARTITION=y
1332# CONFIG_BSD_DISKLABEL is not set
1333# CONFIG_MINIX_SUBPARTITION is not set
1334# CONFIG_SOLARIS_X86_PARTITION is not set
1335# CONFIG_UNIXWARE_DISKLABEL is not set
1336# CONFIG_LDM_PARTITION is not set
1337# CONFIG_SGI_PARTITION is not set
1338# CONFIG_ULTRIX_PARTITION is not set
1339# CONFIG_SUN_PARTITION is not set
1340# CONFIG_KARMA_PARTITION is not set
1341# CONFIG_EFI_PARTITION is not set
1342# CONFIG_SYSV68_PARTITION is not set
1343
1344#
1345# Native Language Support
1346#
1347CONFIG_NLS=y
1348CONFIG_NLS_DEFAULT="iso8859-1"
1349# CONFIG_NLS_CODEPAGE_437 is not set
1350# CONFIG_NLS_CODEPAGE_737 is not set
1351# CONFIG_NLS_CODEPAGE_775 is not set
1352# CONFIG_NLS_CODEPAGE_850 is not set
1353# CONFIG_NLS_CODEPAGE_852 is not set
1354# CONFIG_NLS_CODEPAGE_855 is not set
1355# CONFIG_NLS_CODEPAGE_857 is not set
1356# CONFIG_NLS_CODEPAGE_860 is not set
1357# CONFIG_NLS_CODEPAGE_861 is not set
1358# CONFIG_NLS_CODEPAGE_862 is not set
1359# CONFIG_NLS_CODEPAGE_863 is not set
1360# CONFIG_NLS_CODEPAGE_864 is not set
1361# CONFIG_NLS_CODEPAGE_865 is not set
1362# CONFIG_NLS_CODEPAGE_866 is not set
1363# CONFIG_NLS_CODEPAGE_869 is not set
1364# CONFIG_NLS_CODEPAGE_936 is not set
1365# CONFIG_NLS_CODEPAGE_950 is not set
1366# CONFIG_NLS_CODEPAGE_932 is not set
1367# CONFIG_NLS_CODEPAGE_949 is not set
1368# CONFIG_NLS_CODEPAGE_874 is not set
1369# CONFIG_NLS_ISO8859_8 is not set
1370# CONFIG_NLS_CODEPAGE_1250 is not set
1371# CONFIG_NLS_CODEPAGE_1251 is not set
1372# CONFIG_NLS_ASCII is not set
1373# CONFIG_NLS_ISO8859_1 is not set
1374# CONFIG_NLS_ISO8859_2 is not set
1375# CONFIG_NLS_ISO8859_3 is not set
1376# CONFIG_NLS_ISO8859_4 is not set
1377# CONFIG_NLS_ISO8859_5 is not set
1378# CONFIG_NLS_ISO8859_6 is not set
1379# CONFIG_NLS_ISO8859_7 is not set
1380# CONFIG_NLS_ISO8859_9 is not set
1381# CONFIG_NLS_ISO8859_13 is not set
1382# CONFIG_NLS_ISO8859_14 is not set
1383# CONFIG_NLS_ISO8859_15 is not set
1384# CONFIG_NLS_KOI8_R is not set
1385# CONFIG_NLS_KOI8_U is not set
1386CONFIG_NLS_UTF8=m
1387
1388#
1389# Distributed Lock Manager
1390#
1391# CONFIG_DLM is not set
1392# CONFIG_UCC_SLOW is not set
1393
1394#
1395# Library routines
1396#
1397CONFIG_BITREVERSE=y
1398# CONFIG_CRC_CCITT is not set
1399# CONFIG_CRC16 is not set
1400# CONFIG_CRC_ITU_T is not set
1401CONFIG_CRC32=y
1402# CONFIG_CRC7 is not set
1403CONFIG_LIBCRC32C=m
1404CONFIG_ZLIB_INFLATE=y
1405CONFIG_PLIST=y
1406CONFIG_HAS_IOMEM=y
1407CONFIG_HAS_IOPORT=y
1408CONFIG_HAS_DMA=y
1409
1410#
1411# Instrumentation Support
1412#
1413# CONFIG_PROFILING is not set
1414
1415#
1416# Kernel hacking
1417#
1418# CONFIG_PRINTK_TIME is not set
1419CONFIG_ENABLE_MUST_CHECK=y
1420# CONFIG_MAGIC_SYSRQ is not set
1421# CONFIG_UNUSED_SYMBOLS is not set
1422# CONFIG_DEBUG_FS is not set
1423# CONFIG_HEADERS_CHECK is not set
1424CONFIG_DEBUG_KERNEL=y
1425# CONFIG_DEBUG_SHIRQ is not set
1426CONFIG_DETECT_SOFTLOCKUP=y
1427CONFIG_SCHED_DEBUG=y
1428# CONFIG_SCHEDSTATS is not set
1429# CONFIG_TIMER_STATS is not set
1430# CONFIG_DEBUG_SLAB is not set
1431# CONFIG_DEBUG_RT_MUTEXES is not set
1432# CONFIG_RT_MUTEX_TESTER is not set
1433# CONFIG_DEBUG_SPINLOCK is not set
1434# CONFIG_DEBUG_MUTEXES is not set
1435# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1436# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1437# CONFIG_DEBUG_KOBJECT is not set
1438# CONFIG_DEBUG_HIGHMEM is not set
1439# CONFIG_DEBUG_BUGVERBOSE is not set
1440CONFIG_DEBUG_INFO=y
1441# CONFIG_DEBUG_VM is not set
1442# CONFIG_DEBUG_LIST is not set
1443CONFIG_FORCED_INLINING=y
1444# CONFIG_RCU_TORTURE_TEST is not set
1445# CONFIG_FAULT_INJECTION is not set
1446# CONFIG_DEBUG_STACKOVERFLOW is not set
1447# CONFIG_DEBUG_STACK_USAGE is not set
1448# CONFIG_DEBUG_PAGEALLOC is not set
1449# CONFIG_DEBUGGER is not set
1450# CONFIG_BDI_SWITCH is not set
1451# CONFIG_PPC_EARLY_DEBUG is not set
1452
1453#
1454# Security options
1455#
1456# CONFIG_KEYS is not set
1457# CONFIG_SECURITY is not set
1458CONFIG_CRYPTO=y
1459CONFIG_CRYPTO_ALGAPI=y
1460CONFIG_CRYPTO_BLKCIPHER=y
1461CONFIG_CRYPTO_HASH=y
1462CONFIG_CRYPTO_MANAGER=y
1463CONFIG_CRYPTO_HMAC=y
1464# CONFIG_CRYPTO_XCBC is not set
1465# CONFIG_CRYPTO_NULL is not set
1466# CONFIG_CRYPTO_MD4 is not set
1467CONFIG_CRYPTO_MD5=y
1468# CONFIG_CRYPTO_SHA1 is not set
1469# CONFIG_CRYPTO_SHA256 is not set
1470# CONFIG_CRYPTO_SHA512 is not set
1471# CONFIG_CRYPTO_WP512 is not set
1472# CONFIG_CRYPTO_TGR192 is not set
1473# CONFIG_CRYPTO_GF128MUL is not set
1474# CONFIG_CRYPTO_ECB is not set
1475CONFIG_CRYPTO_CBC=y
1476CONFIG_CRYPTO_PCBC=m
1477# CONFIG_CRYPTO_LRW is not set
1478# CONFIG_CRYPTO_CRYPTD is not set
1479CONFIG_CRYPTO_DES=y
1480# CONFIG_CRYPTO_FCRYPT is not set
1481# CONFIG_CRYPTO_BLOWFISH is not set
1482# CONFIG_CRYPTO_TWOFISH is not set
1483# CONFIG_CRYPTO_SERPENT is not set
1484# CONFIG_CRYPTO_AES is not set
1485# CONFIG_CRYPTO_CAST5 is not set
1486# CONFIG_CRYPTO_CAST6 is not set
1487# CONFIG_CRYPTO_TEA is not set
1488# CONFIG_CRYPTO_ARC4 is not set
1489# CONFIG_CRYPTO_KHAZAD is not set
1490# CONFIG_CRYPTO_ANUBIS is not set
1491# CONFIG_CRYPTO_DEFLATE is not set
1492# CONFIG_CRYPTO_MICHAEL_MIC is not set
1493# CONFIG_CRYPTO_CRC32C is not set
1494# CONFIG_CRYPTO_CAMELLIA is not set
1495# CONFIG_CRYPTO_TEST is not set
1496CONFIG_CRYPTO_HW=y
diff --git a/arch/powerpc/configs/sequoia_defconfig b/arch/powerpc/configs/sequoia_defconfig
new file mode 100644
index 000000000000..bc7f5089a894
--- /dev/null
+++ b/arch/powerpc/configs/sequoia_defconfig
@@ -0,0 +1,861 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc6
4# Fri Sep 14 13:20:06 2007
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11# CONFIG_6xx is not set
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set
15CONFIG_44x=y
16# CONFIG_E200 is not set
17CONFIG_PPC_FPU=y
18CONFIG_4xx=y
19CONFIG_BOOKE=y
20CONFIG_PTE_64BIT=y
21CONFIG_PHYS_64BIT=y
22# CONFIG_PPC_MM_SLICES is not set
23CONFIG_NOT_COHERENT_CACHE=y
24CONFIG_PPC32=y
25CONFIG_PPC_MERGE=y
26CONFIG_MMU=y
27CONFIG_GENERIC_HARDIRQS=y
28CONFIG_IRQ_PER_CPU=y
29CONFIG_RWSEM_XCHGADD_ALGORITHM=y
30CONFIG_ARCH_HAS_ILOG2_U32=y
31CONFIG_GENERIC_HWEIGHT=y
32CONFIG_GENERIC_CALIBRATE_DELAY=y
33CONFIG_GENERIC_FIND_NEXT_BIT=y
34# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
35CONFIG_PPC=y
36CONFIG_EARLY_PRINTK=y
37CONFIG_GENERIC_NVRAM=y
38CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
39CONFIG_ARCH_MAY_HAVE_PC_FDC=y
40CONFIG_PPC_OF=y
41CONFIG_OF=y
42CONFIG_PPC_UDBG_16550=y
43# CONFIG_GENERIC_TBSYNC is not set
44CONFIG_AUDIT_ARCH=y
45CONFIG_GENERIC_BUG=y
46# CONFIG_DEFAULT_UIMAGE is not set
47CONFIG_PPC_DCR_NATIVE=y
48# CONFIG_PPC_DCR_MMIO is not set
49CONFIG_PPC_DCR=y
50CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
51
52#
53# General setup
54#
55CONFIG_EXPERIMENTAL=y
56CONFIG_BROKEN_ON_SMP=y
57CONFIG_INIT_ENV_ARG_LIMIT=32
58CONFIG_LOCALVERSION=""
59CONFIG_LOCALVERSION_AUTO=y
60CONFIG_SWAP=y
61CONFIG_SYSVIPC=y
62CONFIG_SYSVIPC_SYSCTL=y
63CONFIG_POSIX_MQUEUE=y
64# CONFIG_BSD_PROCESS_ACCT is not set
65# CONFIG_TASKSTATS is not set
66# CONFIG_USER_NS is not set
67# CONFIG_AUDIT is not set
68# CONFIG_IKCONFIG is not set
69CONFIG_LOG_BUF_SHIFT=14
70CONFIG_SYSFS_DEPRECATED=y
71# CONFIG_RELAY is not set
72CONFIG_BLK_DEV_INITRD=y
73CONFIG_INITRAMFS_SOURCE=""
74# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
75CONFIG_SYSCTL=y
76CONFIG_EMBEDDED=y
77CONFIG_SYSCTL_SYSCALL=y
78CONFIG_KALLSYMS=y
79# CONFIG_KALLSYMS_ALL is not set
80# CONFIG_KALLSYMS_EXTRA_PASS is not set
81CONFIG_HOTPLUG=y
82CONFIG_PRINTK=y
83CONFIG_BUG=y
84CONFIG_ELF_CORE=y
85CONFIG_BASE_FULL=y
86CONFIG_FUTEX=y
87CONFIG_ANON_INODES=y
88CONFIG_EPOLL=y
89CONFIG_SIGNALFD=y
90CONFIG_TIMERFD=y
91CONFIG_EVENTFD=y
92CONFIG_SHMEM=y
93CONFIG_VM_EVENT_COUNTERS=y
94CONFIG_SLAB=y
95# CONFIG_SLUB is not set
96# CONFIG_SLOB is not set
97CONFIG_RT_MUTEXES=y
98# CONFIG_TINY_SHMEM is not set
99CONFIG_BASE_SMALL=0
100CONFIG_MODULES=y
101CONFIG_MODULE_UNLOAD=y
102# CONFIG_MODULE_FORCE_UNLOAD is not set
103# CONFIG_MODVERSIONS is not set
104# CONFIG_MODULE_SRCVERSION_ALL is not set
105CONFIG_KMOD=y
106CONFIG_BLOCK=y
107CONFIG_LBD=y
108# CONFIG_BLK_DEV_IO_TRACE is not set
109# CONFIG_LSF is not set
110# CONFIG_BLK_DEV_BSG is not set
111
112#
113# IO Schedulers
114#
115CONFIG_IOSCHED_NOOP=y
116CONFIG_IOSCHED_AS=y
117CONFIG_IOSCHED_DEADLINE=y
118CONFIG_IOSCHED_CFQ=y
119CONFIG_DEFAULT_AS=y
120# CONFIG_DEFAULT_DEADLINE is not set
121# CONFIG_DEFAULT_CFQ is not set
122# CONFIG_DEFAULT_NOOP is not set
123CONFIG_DEFAULT_IOSCHED="anticipatory"
124
125#
126# Platform support
127#
128# CONFIG_PPC_MPC52xx is not set
129# CONFIG_PPC_MPC5200 is not set
130# CONFIG_PPC_CELL is not set
131# CONFIG_PPC_CELL_NATIVE is not set
132# CONFIG_PQ2ADS is not set
133# CONFIG_BAMBOO is not set
134# CONFIG_EBONY is not set
135CONFIG_SEQUOIA=y
136CONFIG_440EPX=y
137CONFIG_440A=y
138# CONFIG_MPIC is not set
139# CONFIG_MPIC_WEIRD is not set
140# CONFIG_PPC_I8259 is not set
141# CONFIG_PPC_RTAS is not set
142# CONFIG_MMIO_NVRAM is not set
143# CONFIG_PPC_MPC106 is not set
144# CONFIG_PPC_970_NAP is not set
145# CONFIG_PPC_INDIRECT_IO is not set
146# CONFIG_GENERIC_IOMAP is not set
147# CONFIG_CPU_FREQ is not set
148# CONFIG_CPM2 is not set
149# CONFIG_FSL_ULI1575 is not set
150
151#
152# Kernel options
153#
154# CONFIG_HIGHMEM is not set
155# CONFIG_HZ_100 is not set
156CONFIG_HZ_250=y
157# CONFIG_HZ_300 is not set
158# CONFIG_HZ_1000 is not set
159CONFIG_HZ=250
160CONFIG_PREEMPT_NONE=y
161# CONFIG_PREEMPT_VOLUNTARY is not set
162# CONFIG_PREEMPT is not set
163CONFIG_BINFMT_ELF=y
164# CONFIG_BINFMT_MISC is not set
165# CONFIG_MATH_EMULATION is not set
166CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
167CONFIG_ARCH_FLATMEM_ENABLE=y
168CONFIG_ARCH_POPULATES_NODE_MAP=y
169CONFIG_SELECT_MEMORY_MODEL=y
170CONFIG_FLATMEM_MANUAL=y
171# CONFIG_DISCONTIGMEM_MANUAL is not set
172# CONFIG_SPARSEMEM_MANUAL is not set
173CONFIG_FLATMEM=y
174CONFIG_FLAT_NODE_MEM_MAP=y
175# CONFIG_SPARSEMEM_STATIC is not set
176CONFIG_SPLIT_PTLOCK_CPUS=4
177CONFIG_RESOURCES_64BIT=y
178CONFIG_ZONE_DMA_FLAG=1
179CONFIG_BOUNCE=y
180CONFIG_VIRT_TO_BUS=y
181CONFIG_PROC_DEVICETREE=y
182CONFIG_CMDLINE_BOOL=y
183CONFIG_CMDLINE=""
184CONFIG_SECCOMP=y
185CONFIG_WANT_DEVICE_TREE=y
186CONFIG_DEVICE_TREE="sequoia.dts"
187CONFIG_ISA_DMA_API=y
188
189#
190# Bus options
191#
192CONFIG_ZONE_DMA=y
193CONFIG_PPC_INDIRECT_PCI=y
194CONFIG_PCI=y
195CONFIG_PCI_DOMAINS=y
196CONFIG_PCI_SYSCALL=y
197# CONFIG_PCIEPORTBUS is not set
198CONFIG_ARCH_SUPPORTS_MSI=y
199# CONFIG_PCI_MSI is not set
200# CONFIG_PCI_DEBUG is not set
201
202#
203# PCCARD (PCMCIA/CardBus) support
204#
205# CONFIG_PCCARD is not set
206# CONFIG_HOTPLUG_PCI is not set
207
208#
209# Advanced setup
210#
211# CONFIG_ADVANCED_OPTIONS is not set
212
213#
214# Default settings for advanced configuration options are used
215#
216CONFIG_HIGHMEM_START=0xfe000000
217CONFIG_LOWMEM_SIZE=0x30000000
218CONFIG_KERNEL_START=0xc0000000
219CONFIG_TASK_SIZE=0x80000000
220CONFIG_CONSISTENT_START=0xff100000
221CONFIG_CONSISTENT_SIZE=0x00200000
222CONFIG_BOOT_LOAD=0x01000000
223
224#
225# Networking
226#
227CONFIG_NET=y
228
229#
230# Networking options
231#
232CONFIG_PACKET=y
233# CONFIG_PACKET_MMAP is not set
234CONFIG_UNIX=y
235# CONFIG_NET_KEY is not set
236CONFIG_INET=y
237# CONFIG_IP_MULTICAST is not set
238# CONFIG_IP_ADVANCED_ROUTER is not set
239CONFIG_IP_FIB_HASH=y
240CONFIG_IP_PNP=y
241CONFIG_IP_PNP_DHCP=y
242CONFIG_IP_PNP_BOOTP=y
243# CONFIG_IP_PNP_RARP is not set
244# CONFIG_NET_IPIP is not set
245# CONFIG_NET_IPGRE is not set
246# CONFIG_ARPD is not set
247# CONFIG_SYN_COOKIES is not set
248# CONFIG_INET_AH is not set
249# CONFIG_INET_ESP is not set
250# CONFIG_INET_IPCOMP is not set
251# CONFIG_INET_XFRM_TUNNEL is not set
252# CONFIG_INET_TUNNEL is not set
253# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
254# CONFIG_INET_XFRM_MODE_TUNNEL is not set
255# CONFIG_INET_XFRM_MODE_BEET is not set
256CONFIG_INET_DIAG=y
257CONFIG_INET_TCP_DIAG=y
258# CONFIG_TCP_CONG_ADVANCED is not set
259CONFIG_TCP_CONG_CUBIC=y
260CONFIG_DEFAULT_TCP_CONG="cubic"
261# CONFIG_TCP_MD5SIG is not set
262# CONFIG_IPV6 is not set
263# CONFIG_INET6_XFRM_TUNNEL is not set
264# CONFIG_INET6_TUNNEL is not set
265# CONFIG_NETWORK_SECMARK is not set
266# CONFIG_NETFILTER is not set
267# CONFIG_IP_DCCP is not set
268# CONFIG_IP_SCTP is not set
269# CONFIG_TIPC is not set
270# CONFIG_ATM is not set
271# CONFIG_BRIDGE is not set
272# CONFIG_VLAN_8021Q is not set
273# CONFIG_DECNET is not set
274# CONFIG_LLC2 is not set
275# CONFIG_IPX is not set
276# CONFIG_ATALK is not set
277# CONFIG_X25 is not set
278# CONFIG_LAPB is not set
279# CONFIG_ECONET is not set
280# CONFIG_WAN_ROUTER is not set
281
282#
283# QoS and/or fair queueing
284#
285# CONFIG_NET_SCHED is not set
286
287#
288# Network testing
289#
290# CONFIG_NET_PKTGEN is not set
291# CONFIG_HAMRADIO is not set
292# CONFIG_IRDA is not set
293# CONFIG_BT is not set
294# CONFIG_AF_RXRPC is not set
295
296#
297# Wireless
298#
299# CONFIG_CFG80211 is not set
300# CONFIG_WIRELESS_EXT is not set
301# CONFIG_MAC80211 is not set
302# CONFIG_IEEE80211 is not set
303# CONFIG_RFKILL is not set
304# CONFIG_NET_9P is not set
305
306#
307# Device Drivers
308#
309
310#
311# Generic Driver Options
312#
313CONFIG_STANDALONE=y
314CONFIG_PREVENT_FIRMWARE_BUILD=y
315CONFIG_FW_LOADER=y
316# CONFIG_DEBUG_DRIVER is not set
317# CONFIG_DEBUG_DEVRES is not set
318# CONFIG_SYS_HYPERVISOR is not set
319CONFIG_CONNECTOR=y
320CONFIG_PROC_EVENTS=y
321CONFIG_MTD=y
322# CONFIG_MTD_DEBUG is not set
323# CONFIG_MTD_CONCAT is not set
324CONFIG_MTD_PARTITIONS=y
325# CONFIG_MTD_REDBOOT_PARTS is not set
326CONFIG_MTD_CMDLINE_PARTS=y
327
328#
329# User Modules And Translation Layers
330#
331CONFIG_MTD_CHAR=y
332# CONFIG_MTD_BLKDEVS is not set
333# CONFIG_MTD_BLOCK is not set
334# CONFIG_MTD_BLOCK_RO is not set
335# CONFIG_FTL is not set
336# CONFIG_NFTL is not set
337# CONFIG_INFTL is not set
338# CONFIG_RFD_FTL is not set
339# CONFIG_SSFDC is not set
340
341#
342# RAM/ROM/Flash chip drivers
343#
344CONFIG_MTD_CFI=y
345CONFIG_MTD_JEDECPROBE=y
346CONFIG_MTD_GEN_PROBE=y
347# CONFIG_MTD_CFI_ADV_OPTIONS is not set
348CONFIG_MTD_MAP_BANK_WIDTH_1=y
349CONFIG_MTD_MAP_BANK_WIDTH_2=y
350CONFIG_MTD_MAP_BANK_WIDTH_4=y
351# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
352# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
353# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
354CONFIG_MTD_CFI_I1=y
355CONFIG_MTD_CFI_I2=y
356# CONFIG_MTD_CFI_I4 is not set
357# CONFIG_MTD_CFI_I8 is not set
358CONFIG_MTD_CFI_INTELEXT=y
359CONFIG_MTD_CFI_AMDSTD=y
360# CONFIG_MTD_CFI_STAA is not set
361CONFIG_MTD_CFI_UTIL=y
362# CONFIG_MTD_RAM is not set
363# CONFIG_MTD_ROM is not set
364# CONFIG_MTD_ABSENT is not set
365
366#
367# Mapping drivers for chip access
368#
369# CONFIG_MTD_COMPLEX_MAPPINGS is not set
370# CONFIG_MTD_PHYSMAP is not set
371CONFIG_MTD_PHYSMAP_OF=y
372# CONFIG_MTD_PLATRAM is not set
373
374#
375# Self-contained MTD device drivers
376#
377# CONFIG_MTD_PMC551 is not set
378# CONFIG_MTD_SLRAM is not set
379# CONFIG_MTD_PHRAM is not set
380# CONFIG_MTD_MTDRAM is not set
381# CONFIG_MTD_BLOCK2MTD is not set
382
383#
384# Disk-On-Chip Device Drivers
385#
386# CONFIG_MTD_DOC2000 is not set
387# CONFIG_MTD_DOC2001 is not set
388# CONFIG_MTD_DOC2001PLUS is not set
389# CONFIG_MTD_NAND is not set
390# CONFIG_MTD_ONENAND is not set
391
392#
393# UBI - Unsorted block images
394#
395# CONFIG_MTD_UBI is not set
396CONFIG_OF_DEVICE=y
397# CONFIG_PARPORT is not set
398CONFIG_BLK_DEV=y
399# CONFIG_BLK_DEV_FD is not set
400# CONFIG_BLK_CPQ_DA is not set
401# CONFIG_BLK_CPQ_CISS_DA is not set
402# CONFIG_BLK_DEV_DAC960 is not set
403# CONFIG_BLK_DEV_UMEM is not set
404# CONFIG_BLK_DEV_COW_COMMON is not set
405# CONFIG_BLK_DEV_LOOP is not set
406# CONFIG_BLK_DEV_NBD is not set
407# CONFIG_BLK_DEV_SX8 is not set
408CONFIG_BLK_DEV_RAM=y
409CONFIG_BLK_DEV_RAM_COUNT=16
410CONFIG_BLK_DEV_RAM_SIZE=35000
411CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
412# CONFIG_CDROM_PKTCDVD is not set
413# CONFIG_ATA_OVER_ETH is not set
414# CONFIG_XILINX_SYSACE is not set
415CONFIG_MISC_DEVICES=y
416# CONFIG_PHANTOM is not set
417# CONFIG_EEPROM_93CX6 is not set
418# CONFIG_SGI_IOC4 is not set
419# CONFIG_TIFM_CORE is not set
420# CONFIG_IDE is not set
421
422#
423# SCSI device support
424#
425# CONFIG_RAID_ATTRS is not set
426# CONFIG_SCSI is not set
427# CONFIG_SCSI_DMA is not set
428# CONFIG_SCSI_NETLINK is not set
429# CONFIG_ATA is not set
430# CONFIG_MD is not set
431
432#
433# Fusion MPT device support
434#
435# CONFIG_FUSION is not set
436
437#
438# IEEE 1394 (FireWire) support
439#
440# CONFIG_FIREWIRE is not set
441# CONFIG_IEEE1394 is not set
442# CONFIG_I2O is not set
443CONFIG_MACINTOSH_DRIVERS=y
444# CONFIG_MAC_EMUMOUSEBTN is not set
445# CONFIG_WINDFARM is not set
446CONFIG_NETDEVICES=y
447# CONFIG_NETDEVICES_MULTIQUEUE is not set
448# CONFIG_DUMMY is not set
449# CONFIG_BONDING is not set
450# CONFIG_MACVLAN is not set
451# CONFIG_EQUALIZER is not set
452# CONFIG_TUN is not set
453# CONFIG_ARCNET is not set
454# CONFIG_NET_ETHERNET is not set
455CONFIG_NETDEV_1000=y
456# CONFIG_ACENIC is not set
457# CONFIG_DL2K is not set
458# CONFIG_E1000 is not set
459# CONFIG_NS83820 is not set
460# CONFIG_HAMACHI is not set
461# CONFIG_YELLOWFIN is not set
462# CONFIG_R8169 is not set
463# CONFIG_SIS190 is not set
464# CONFIG_SKGE is not set
465# CONFIG_SKY2 is not set
466# CONFIG_VIA_VELOCITY is not set
467# CONFIG_TIGON3 is not set
468# CONFIG_BNX2 is not set
469# CONFIG_QLA3XXX is not set
470# CONFIG_ATL1 is not set
471CONFIG_NETDEV_10000=y
472# CONFIG_CHELSIO_T1 is not set
473# CONFIG_CHELSIO_T3 is not set
474# CONFIG_IXGB is not set
475# CONFIG_S2IO is not set
476# CONFIG_MYRI10GE is not set
477# CONFIG_NETXEN_NIC is not set
478# CONFIG_MLX4_CORE is not set
479# CONFIG_TR is not set
480
481#
482# Wireless LAN
483#
484# CONFIG_WLAN_PRE80211 is not set
485# CONFIG_WLAN_80211 is not set
486# CONFIG_WAN is not set
487# CONFIG_FDDI is not set
488# CONFIG_HIPPI is not set
489# CONFIG_PPP is not set
490# CONFIG_SLIP is not set
491# CONFIG_SHAPER is not set
492# CONFIG_NETCONSOLE is not set
493# CONFIG_NETPOLL is not set
494# CONFIG_NET_POLL_CONTROLLER is not set
495# CONFIG_ISDN is not set
496# CONFIG_PHONE is not set
497
498#
499# Input device support
500#
501# CONFIG_INPUT is not set
502
503#
504# Hardware I/O ports
505#
506# CONFIG_SERIO is not set
507# CONFIG_GAMEPORT is not set
508
509#
510# Character devices
511#
512# CONFIG_VT is not set
513# CONFIG_SERIAL_NONSTANDARD is not set
514
515#
516# Serial drivers
517#
518CONFIG_SERIAL_8250=y
519CONFIG_SERIAL_8250_CONSOLE=y
520# CONFIG_SERIAL_8250_PCI is not set
521CONFIG_SERIAL_8250_NR_UARTS=4
522CONFIG_SERIAL_8250_RUNTIME_UARTS=4
523CONFIG_SERIAL_8250_EXTENDED=y
524# CONFIG_SERIAL_8250_MANY_PORTS is not set
525CONFIG_SERIAL_8250_SHARE_IRQ=y
526# CONFIG_SERIAL_8250_DETECT_IRQ is not set
527# CONFIG_SERIAL_8250_RSA is not set
528
529#
530# Non-8250 serial port support
531#
532# CONFIG_SERIAL_UARTLITE is not set
533CONFIG_SERIAL_CORE=y
534CONFIG_SERIAL_CORE_CONSOLE=y
535# CONFIG_SERIAL_JSM is not set
536CONFIG_SERIAL_OF_PLATFORM=y
537CONFIG_UNIX98_PTYS=y
538CONFIG_LEGACY_PTYS=y
539CONFIG_LEGACY_PTY_COUNT=256
540# CONFIG_IPMI_HANDLER is not set
541# CONFIG_WATCHDOG is not set
542# CONFIG_HW_RANDOM is not set
543# CONFIG_NVRAM is not set
544# CONFIG_GEN_RTC is not set
545# CONFIG_R3964 is not set
546# CONFIG_APPLICOM is not set
547# CONFIG_AGP is not set
548# CONFIG_DRM is not set
549# CONFIG_RAW_DRIVER is not set
550# CONFIG_TCG_TPM is not set
551CONFIG_DEVPORT=y
552# CONFIG_I2C is not set
553
554#
555# SPI support
556#
557# CONFIG_SPI is not set
558# CONFIG_SPI_MASTER is not set
559# CONFIG_W1 is not set
560# CONFIG_POWER_SUPPLY is not set
561# CONFIG_HWMON is not set
562
563#
564# Multifunction device drivers
565#
566# CONFIG_MFD_SM501 is not set
567
568#
569# Multimedia devices
570#
571# CONFIG_VIDEO_DEV is not set
572# CONFIG_DVB_CORE is not set
573CONFIG_DAB=y
574
575#
576# Graphics support
577#
578# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
579
580#
581# Display device support
582#
583# CONFIG_DISPLAY_SUPPORT is not set
584# CONFIG_VGASTATE is not set
585CONFIG_VIDEO_OUTPUT_CONTROL=m
586# CONFIG_FB is not set
587# CONFIG_FB_IBM_GXT4500 is not set
588
589#
590# Sound
591#
592# CONFIG_SOUND is not set
593CONFIG_USB_SUPPORT=y
594CONFIG_USB_ARCH_HAS_HCD=y
595CONFIG_USB_ARCH_HAS_OHCI=y
596CONFIG_USB_ARCH_HAS_EHCI=y
597# CONFIG_USB is not set
598
599#
600# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
601#
602
603#
604# USB Gadget Support
605#
606# CONFIG_USB_GADGET is not set
607# CONFIG_MMC is not set
608# CONFIG_NEW_LEDS is not set
609# CONFIG_INFINIBAND is not set
610# CONFIG_EDAC is not set
611# CONFIG_RTC_CLASS is not set
612
613#
614# DMA Engine support
615#
616# CONFIG_DMA_ENGINE is not set
617
618#
619# DMA Clients
620#
621
622#
623# DMA Devices
624#
625
626#
627# Userspace I/O
628#
629# CONFIG_UIO is not set
630
631#
632# File systems
633#
634CONFIG_EXT2_FS=y
635# CONFIG_EXT2_FS_XATTR is not set
636# CONFIG_EXT2_FS_XIP is not set
637# CONFIG_EXT3_FS is not set
638# CONFIG_EXT4DEV_FS is not set
639# CONFIG_REISERFS_FS is not set
640# CONFIG_JFS_FS is not set
641# CONFIG_FS_POSIX_ACL is not set
642# CONFIG_XFS_FS is not set
643# CONFIG_GFS2_FS is not set
644# CONFIG_OCFS2_FS is not set
645# CONFIG_MINIX_FS is not set
646# CONFIG_ROMFS_FS is not set
647CONFIG_INOTIFY=y
648CONFIG_INOTIFY_USER=y
649# CONFIG_QUOTA is not set
650CONFIG_DNOTIFY=y
651# CONFIG_AUTOFS_FS is not set
652# CONFIG_AUTOFS4_FS is not set
653# CONFIG_FUSE_FS is not set
654
655#
656# CD-ROM/DVD Filesystems
657#
658# CONFIG_ISO9660_FS is not set
659# CONFIG_UDF_FS is not set
660
661#
662# DOS/FAT/NT Filesystems
663#
664# CONFIG_MSDOS_FS is not set
665# CONFIG_VFAT_FS is not set
666# CONFIG_NTFS_FS is not set
667
668#
669# Pseudo filesystems
670#
671CONFIG_PROC_FS=y
672CONFIG_PROC_KCORE=y
673CONFIG_PROC_SYSCTL=y
674CONFIG_SYSFS=y
675CONFIG_TMPFS=y
676# CONFIG_TMPFS_POSIX_ACL is not set
677# CONFIG_HUGETLB_PAGE is not set
678CONFIG_RAMFS=y
679# CONFIG_CONFIGFS_FS is not set
680
681#
682# Miscellaneous filesystems
683#
684# CONFIG_ADFS_FS is not set
685# CONFIG_AFFS_FS is not set
686# CONFIG_HFS_FS is not set
687# CONFIG_HFSPLUS_FS is not set
688# CONFIG_BEFS_FS is not set
689# CONFIG_BFS_FS is not set
690# CONFIG_EFS_FS is not set
691CONFIG_JFFS2_FS=y
692CONFIG_JFFS2_FS_DEBUG=0
693CONFIG_JFFS2_FS_WRITEBUFFER=y
694# CONFIG_JFFS2_SUMMARY is not set
695# CONFIG_JFFS2_FS_XATTR is not set
696# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
697CONFIG_JFFS2_ZLIB=y
698CONFIG_JFFS2_RTIME=y
699# CONFIG_JFFS2_RUBIN is not set
700CONFIG_CRAMFS=y
701# CONFIG_VXFS_FS is not set
702# CONFIG_HPFS_FS is not set
703# CONFIG_QNX4FS_FS is not set
704# CONFIG_SYSV_FS is not set
705# CONFIG_UFS_FS is not set
706
707#
708# Network File Systems
709#
710CONFIG_NFS_FS=y
711CONFIG_NFS_V3=y
712# CONFIG_NFS_V3_ACL is not set
713# CONFIG_NFS_V4 is not set
714# CONFIG_NFS_DIRECTIO is not set
715# CONFIG_NFSD is not set
716CONFIG_ROOT_NFS=y
717CONFIG_LOCKD=y
718CONFIG_LOCKD_V4=y
719CONFIG_NFS_COMMON=y
720CONFIG_SUNRPC=y
721# CONFIG_SUNRPC_BIND34 is not set
722# CONFIG_RPCSEC_GSS_KRB5 is not set
723# CONFIG_RPCSEC_GSS_SPKM3 is not set
724# CONFIG_SMB_FS is not set
725# CONFIG_CIFS is not set
726# CONFIG_NCP_FS is not set
727# CONFIG_CODA_FS is not set
728# CONFIG_AFS_FS is not set
729
730#
731# Partition Types
732#
733# CONFIG_PARTITION_ADVANCED is not set
734CONFIG_MSDOS_PARTITION=y
735
736#
737# Native Language Support
738#
739# CONFIG_NLS is not set
740
741#
742# Distributed Lock Manager
743#
744# CONFIG_DLM is not set
745# CONFIG_UCC_SLOW is not set
746
747#
748# Library routines
749#
750CONFIG_BITREVERSE=y
751# CONFIG_CRC_CCITT is not set
752# CONFIG_CRC16 is not set
753# CONFIG_CRC_ITU_T is not set
754CONFIG_CRC32=y
755# CONFIG_CRC7 is not set
756# CONFIG_LIBCRC32C is not set
757CONFIG_ZLIB_INFLATE=y
758CONFIG_ZLIB_DEFLATE=y
759CONFIG_PLIST=y
760CONFIG_HAS_IOMEM=y
761CONFIG_HAS_IOPORT=y
762CONFIG_HAS_DMA=y
763
764#
765# Instrumentation Support
766#
767# CONFIG_PROFILING is not set
768
769#
770# Kernel hacking
771#
772# CONFIG_PRINTK_TIME is not set
773CONFIG_ENABLE_MUST_CHECK=y
774CONFIG_MAGIC_SYSRQ=y
775# CONFIG_UNUSED_SYMBOLS is not set
776# CONFIG_DEBUG_FS is not set
777# CONFIG_HEADERS_CHECK is not set
778CONFIG_DEBUG_KERNEL=y
779# CONFIG_DEBUG_SHIRQ is not set
780CONFIG_DETECT_SOFTLOCKUP=y
781CONFIG_SCHED_DEBUG=y
782# CONFIG_SCHEDSTATS is not set
783# CONFIG_TIMER_STATS is not set
784# CONFIG_DEBUG_SLAB is not set
785# CONFIG_DEBUG_RT_MUTEXES is not set
786# CONFIG_RT_MUTEX_TESTER is not set
787# CONFIG_DEBUG_SPINLOCK is not set
788# CONFIG_DEBUG_MUTEXES is not set
789# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
790# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
791# CONFIG_DEBUG_KOBJECT is not set
792# CONFIG_DEBUG_BUGVERBOSE is not set
793# CONFIG_DEBUG_INFO is not set
794# CONFIG_DEBUG_VM is not set
795# CONFIG_DEBUG_LIST is not set
796CONFIG_FORCED_INLINING=y
797# CONFIG_RCU_TORTURE_TEST is not set
798# CONFIG_FAULT_INJECTION is not set
799# CONFIG_DEBUG_STACKOVERFLOW is not set
800# CONFIG_DEBUG_STACK_USAGE is not set
801# CONFIG_DEBUG_PAGEALLOC is not set
802CONFIG_DEBUGGER=y
803# CONFIG_KGDB is not set
804# CONFIG_XMON is not set
805# CONFIG_BDI_SWITCH is not set
806CONFIG_PPC_EARLY_DEBUG=y
807# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
808# CONFIG_PPC_EARLY_DEBUG_G5 is not set
809# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
810# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
811# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
812# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
813# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
814# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
815CONFIG_PPC_EARLY_DEBUG_44x=y
816CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
817CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x1
818
819#
820# Security options
821#
822# CONFIG_KEYS is not set
823# CONFIG_SECURITY is not set
824CONFIG_CRYPTO=y
825CONFIG_CRYPTO_ALGAPI=y
826CONFIG_CRYPTO_BLKCIPHER=y
827CONFIG_CRYPTO_MANAGER=y
828# CONFIG_CRYPTO_HMAC is not set
829# CONFIG_CRYPTO_XCBC is not set
830# CONFIG_CRYPTO_NULL is not set
831# CONFIG_CRYPTO_MD4 is not set
832CONFIG_CRYPTO_MD5=y
833# CONFIG_CRYPTO_SHA1 is not set
834# CONFIG_CRYPTO_SHA256 is not set
835# CONFIG_CRYPTO_SHA512 is not set
836# CONFIG_CRYPTO_WP512 is not set
837# CONFIG_CRYPTO_TGR192 is not set
838# CONFIG_CRYPTO_GF128MUL is not set
839CONFIG_CRYPTO_ECB=y
840CONFIG_CRYPTO_CBC=y
841CONFIG_CRYPTO_PCBC=y
842# CONFIG_CRYPTO_LRW is not set
843# CONFIG_CRYPTO_CRYPTD is not set
844CONFIG_CRYPTO_DES=y
845# CONFIG_CRYPTO_FCRYPT is not set
846# CONFIG_CRYPTO_BLOWFISH is not set
847# CONFIG_CRYPTO_TWOFISH is not set
848# CONFIG_CRYPTO_SERPENT is not set
849# CONFIG_CRYPTO_AES is not set
850# CONFIG_CRYPTO_CAST5 is not set
851# CONFIG_CRYPTO_CAST6 is not set
852# CONFIG_CRYPTO_TEA is not set
853# CONFIG_CRYPTO_ARC4 is not set
854# CONFIG_CRYPTO_KHAZAD is not set
855# CONFIG_CRYPTO_ANUBIS is not set
856# CONFIG_CRYPTO_DEFLATE is not set
857# CONFIG_CRYPTO_MICHAEL_MIC is not set
858# CONFIG_CRYPTO_CRC32C is not set
859# CONFIG_CRYPTO_CAMELLIA is not set
860# CONFIG_CRYPTO_TEST is not set
861CONFIG_CRYPTO_HW=y
diff --git a/arch/powerpc/configs/walnut_defconfig b/arch/powerpc/configs/walnut_defconfig
new file mode 100644
index 000000000000..766bf840c18d
--- /dev/null
+++ b/arch/powerpc/configs/walnut_defconfig
@@ -0,0 +1,773 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc4
4# Wed Sep 5 12:06:37 2007
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11# CONFIG_6xx is not set
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14CONFIG_40x=y
15# CONFIG_44x is not set
16# CONFIG_E200 is not set
17CONFIG_4xx=y
18# CONFIG_PPC_MM_SLICES is not set
19CONFIG_NOT_COHERENT_CACHE=y
20CONFIG_PPC32=y
21CONFIG_PPC_MERGE=y
22CONFIG_MMU=y
23CONFIG_GENERIC_HARDIRQS=y
24CONFIG_IRQ_PER_CPU=y
25CONFIG_RWSEM_XCHGADD_ALGORITHM=y
26CONFIG_ARCH_HAS_ILOG2_U32=y
27CONFIG_GENERIC_HWEIGHT=y
28CONFIG_GENERIC_CALIBRATE_DELAY=y
29CONFIG_GENERIC_FIND_NEXT_BIT=y
30# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
31CONFIG_PPC=y
32CONFIG_EARLY_PRINTK=y
33CONFIG_GENERIC_NVRAM=y
34CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
35CONFIG_ARCH_MAY_HAVE_PC_FDC=y
36CONFIG_PPC_OF=y
37CONFIG_OF=y
38# CONFIG_PPC_UDBG_16550 is not set
39# CONFIG_GENERIC_TBSYNC is not set
40CONFIG_AUDIT_ARCH=y
41CONFIG_GENERIC_BUG=y
42# CONFIG_DEFAULT_UIMAGE is not set
43CONFIG_PPC_DCR_NATIVE=y
44# CONFIG_PPC_DCR_MMIO is not set
45CONFIG_PPC_DCR=y
46CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
47
48#
49# General setup
50#
51CONFIG_EXPERIMENTAL=y
52CONFIG_BROKEN_ON_SMP=y
53CONFIG_INIT_ENV_ARG_LIMIT=32
54CONFIG_LOCALVERSION=""
55CONFIG_LOCALVERSION_AUTO=y
56CONFIG_SWAP=y
57CONFIG_SYSVIPC=y
58CONFIG_SYSVIPC_SYSCTL=y
59CONFIG_POSIX_MQUEUE=y
60# CONFIG_BSD_PROCESS_ACCT is not set
61# CONFIG_TASKSTATS is not set
62# CONFIG_USER_NS is not set
63# CONFIG_AUDIT is not set
64# CONFIG_IKCONFIG is not set
65CONFIG_LOG_BUF_SHIFT=14
66CONFIG_SYSFS_DEPRECATED=y
67# CONFIG_RELAY is not set
68CONFIG_BLK_DEV_INITRD=y
69CONFIG_INITRAMFS_SOURCE=""
70# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
71CONFIG_SYSCTL=y
72CONFIG_EMBEDDED=y
73CONFIG_SYSCTL_SYSCALL=y
74CONFIG_KALLSYMS=y
75CONFIG_KALLSYMS_ALL=y
76CONFIG_KALLSYMS_EXTRA_PASS=y
77CONFIG_HOTPLUG=y
78CONFIG_PRINTK=y
79CONFIG_BUG=y
80CONFIG_ELF_CORE=y
81CONFIG_BASE_FULL=y
82CONFIG_FUTEX=y
83CONFIG_ANON_INODES=y
84CONFIG_EPOLL=y
85CONFIG_SIGNALFD=y
86CONFIG_TIMERFD=y
87CONFIG_EVENTFD=y
88CONFIG_SHMEM=y
89CONFIG_VM_EVENT_COUNTERS=y
90CONFIG_SLAB=y
91# CONFIG_SLUB is not set
92# CONFIG_SLOB is not set
93CONFIG_RT_MUTEXES=y
94# CONFIG_TINY_SHMEM is not set
95CONFIG_BASE_SMALL=0
96CONFIG_MODULES=y
97CONFIG_MODULE_UNLOAD=y
98# CONFIG_MODULE_FORCE_UNLOAD is not set
99# CONFIG_MODVERSIONS is not set
100# CONFIG_MODULE_SRCVERSION_ALL is not set
101CONFIG_KMOD=y
102CONFIG_BLOCK=y
103CONFIG_LBD=y
104# CONFIG_BLK_DEV_IO_TRACE is not set
105# CONFIG_LSF is not set
106# CONFIG_BLK_DEV_BSG is not set
107
108#
109# IO Schedulers
110#
111CONFIG_IOSCHED_NOOP=y
112CONFIG_IOSCHED_AS=y
113CONFIG_IOSCHED_DEADLINE=y
114CONFIG_IOSCHED_CFQ=y
115CONFIG_DEFAULT_AS=y
116# CONFIG_DEFAULT_DEADLINE is not set
117# CONFIG_DEFAULT_CFQ is not set
118# CONFIG_DEFAULT_NOOP is not set
119CONFIG_DEFAULT_IOSCHED="anticipatory"
120
121#
122# Platform support
123#
124# CONFIG_PPC_MPC52xx is not set
125# CONFIG_PPC_MPC5200 is not set
126# CONFIG_PPC_CELL is not set
127# CONFIG_PPC_CELL_NATIVE is not set
128# CONFIG_PQ2ADS is not set
129CONFIG_WALNUT=y
130CONFIG_405GP=y
131CONFIG_IBM405_ERR77=y
132CONFIG_IBM405_ERR51=y
133# CONFIG_MPIC is not set
134# CONFIG_MPIC_WEIRD is not set
135# CONFIG_PPC_I8259 is not set
136# CONFIG_PPC_RTAS is not set
137# CONFIG_MMIO_NVRAM is not set
138# CONFIG_PPC_MPC106 is not set
139# CONFIG_PPC_970_NAP is not set
140# CONFIG_PPC_INDIRECT_IO is not set
141# CONFIG_GENERIC_IOMAP is not set
142# CONFIG_CPU_FREQ is not set
143# CONFIG_CPM2 is not set
144# CONFIG_FSL_ULI1575 is not set
145
146#
147# Kernel options
148#
149# CONFIG_HIGHMEM is not set
150# CONFIG_HZ_100 is not set
151CONFIG_HZ_250=y
152# CONFIG_HZ_300 is not set
153# CONFIG_HZ_1000 is not set
154CONFIG_HZ=250
155CONFIG_PREEMPT_NONE=y
156# CONFIG_PREEMPT_VOLUNTARY is not set
157# CONFIG_PREEMPT is not set
158CONFIG_BINFMT_ELF=y
159# CONFIG_BINFMT_MISC is not set
160# CONFIG_MATH_EMULATION is not set
161CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
162CONFIG_ARCH_FLATMEM_ENABLE=y
163CONFIG_ARCH_POPULATES_NODE_MAP=y
164CONFIG_SELECT_MEMORY_MODEL=y
165CONFIG_FLATMEM_MANUAL=y
166# CONFIG_DISCONTIGMEM_MANUAL is not set
167# CONFIG_SPARSEMEM_MANUAL is not set
168CONFIG_FLATMEM=y
169CONFIG_FLAT_NODE_MEM_MAP=y
170# CONFIG_SPARSEMEM_STATIC is not set
171CONFIG_SPLIT_PTLOCK_CPUS=4
172CONFIG_RESOURCES_64BIT=y
173CONFIG_ZONE_DMA_FLAG=1
174CONFIG_BOUNCE=y
175CONFIG_VIRT_TO_BUS=y
176CONFIG_PROC_DEVICETREE=y
177# CONFIG_CMDLINE_BOOL is not set
178# CONFIG_PM is not set
179CONFIG_SECCOMP=y
180CONFIG_WANT_DEVICE_TREE=y
181CONFIG_DEVICE_TREE="walnut.dts"
182CONFIG_ISA_DMA_API=y
183
184#
185# Bus options
186#
187CONFIG_ZONE_DMA=y
188# CONFIG_PCI is not set
189# CONFIG_PCI_DOMAINS is not set
190# CONFIG_PCI_SYSCALL is not set
191# CONFIG_ARCH_SUPPORTS_MSI is not set
192
193#
194# PCCARD (PCMCIA/CardBus) support
195#
196# CONFIG_PCCARD is not set
197
198#
199# Advanced setup
200#
201# CONFIG_ADVANCED_OPTIONS is not set
202
203#
204# Default settings for advanced configuration options are used
205#
206CONFIG_HIGHMEM_START=0xfe000000
207CONFIG_LOWMEM_SIZE=0x30000000
208CONFIG_KERNEL_START=0xc0000000
209CONFIG_TASK_SIZE=0x80000000
210CONFIG_CONSISTENT_START=0xff100000
211CONFIG_CONSISTENT_SIZE=0x00200000
212CONFIG_BOOT_LOAD=0x00400000
213
214#
215# Networking
216#
217CONFIG_NET=y
218
219#
220# Networking options
221#
222CONFIG_PACKET=y
223# CONFIG_PACKET_MMAP is not set
224CONFIG_UNIX=y
225# CONFIG_NET_KEY is not set
226CONFIG_INET=y
227# CONFIG_IP_MULTICAST is not set
228# CONFIG_IP_ADVANCED_ROUTER is not set
229CONFIG_IP_FIB_HASH=y
230CONFIG_IP_PNP=y
231CONFIG_IP_PNP_DHCP=y
232CONFIG_IP_PNP_BOOTP=y
233# CONFIG_IP_PNP_RARP is not set
234# CONFIG_NET_IPIP is not set
235# CONFIG_NET_IPGRE is not set
236# CONFIG_ARPD is not set
237# CONFIG_SYN_COOKIES is not set
238# CONFIG_INET_AH is not set
239# CONFIG_INET_ESP is not set
240# CONFIG_INET_IPCOMP is not set
241# CONFIG_INET_XFRM_TUNNEL is not set
242# CONFIG_INET_TUNNEL is not set
243# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
244# CONFIG_INET_XFRM_MODE_TUNNEL is not set
245# CONFIG_INET_XFRM_MODE_BEET is not set
246CONFIG_INET_DIAG=y
247CONFIG_INET_TCP_DIAG=y
248# CONFIG_TCP_CONG_ADVANCED is not set
249CONFIG_TCP_CONG_CUBIC=y
250CONFIG_DEFAULT_TCP_CONG="cubic"
251# CONFIG_TCP_MD5SIG is not set
252# CONFIG_IPV6 is not set
253# CONFIG_INET6_XFRM_TUNNEL is not set
254# CONFIG_INET6_TUNNEL is not set
255# CONFIG_NETWORK_SECMARK is not set
256# CONFIG_NETFILTER is not set
257# CONFIG_IP_DCCP is not set
258# CONFIG_IP_SCTP is not set
259# CONFIG_TIPC is not set
260# CONFIG_ATM is not set
261# CONFIG_BRIDGE is not set
262# CONFIG_VLAN_8021Q is not set
263# CONFIG_DECNET is not set
264# CONFIG_LLC2 is not set
265# CONFIG_IPX is not set
266# CONFIG_ATALK is not set
267# CONFIG_X25 is not set
268# CONFIG_LAPB is not set
269# CONFIG_ECONET is not set
270# CONFIG_WAN_ROUTER is not set
271
272#
273# QoS and/or fair queueing
274#
275# CONFIG_NET_SCHED is not set
276
277#
278# Network testing
279#
280# CONFIG_NET_PKTGEN is not set
281# CONFIG_HAMRADIO is not set
282# CONFIG_IRDA is not set
283# CONFIG_BT is not set
284# CONFIG_AF_RXRPC is not set
285
286#
287# Wireless
288#
289# CONFIG_CFG80211 is not set
290# CONFIG_WIRELESS_EXT is not set
291# CONFIG_MAC80211 is not set
292# CONFIG_IEEE80211 is not set
293# CONFIG_RFKILL is not set
294# CONFIG_NET_9P is not set
295
296#
297# Device Drivers
298#
299
300#
301# Generic Driver Options
302#
303CONFIG_STANDALONE=y
304CONFIG_PREVENT_FIRMWARE_BUILD=y
305CONFIG_FW_LOADER=y
306# CONFIG_DEBUG_DRIVER is not set
307# CONFIG_DEBUG_DEVRES is not set
308# CONFIG_SYS_HYPERVISOR is not set
309CONFIG_CONNECTOR=y
310CONFIG_PROC_EVENTS=y
311CONFIG_MTD=y
312# CONFIG_MTD_DEBUG is not set
313# CONFIG_MTD_CONCAT is not set
314CONFIG_MTD_PARTITIONS=y
315# CONFIG_MTD_REDBOOT_PARTS is not set
316CONFIG_MTD_CMDLINE_PARTS=y
317
318#
319# User Modules And Translation Layers
320#
321CONFIG_MTD_CHAR=y
322CONFIG_MTD_BLKDEVS=m
323CONFIG_MTD_BLOCK=m
324# CONFIG_MTD_BLOCK_RO is not set
325# CONFIG_FTL is not set
326# CONFIG_NFTL is not set
327# CONFIG_INFTL is not set
328# CONFIG_RFD_FTL is not set
329# CONFIG_SSFDC is not set
330
331#
332# RAM/ROM/Flash chip drivers
333#
334CONFIG_MTD_CFI=y
335CONFIG_MTD_JEDECPROBE=y
336CONFIG_MTD_GEN_PROBE=y
337# CONFIG_MTD_CFI_ADV_OPTIONS is not set
338CONFIG_MTD_MAP_BANK_WIDTH_1=y
339CONFIG_MTD_MAP_BANK_WIDTH_2=y
340CONFIG_MTD_MAP_BANK_WIDTH_4=y
341# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
342# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
343# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
344CONFIG_MTD_CFI_I1=y
345CONFIG_MTD_CFI_I2=y
346# CONFIG_MTD_CFI_I4 is not set
347# CONFIG_MTD_CFI_I8 is not set
348# CONFIG_MTD_CFI_INTELEXT is not set
349CONFIG_MTD_CFI_AMDSTD=y
350# CONFIG_MTD_CFI_STAA is not set
351CONFIG_MTD_CFI_UTIL=y
352# CONFIG_MTD_RAM is not set
353# CONFIG_MTD_ROM is not set
354# CONFIG_MTD_ABSENT is not set
355
356#
357# Mapping drivers for chip access
358#
359# CONFIG_MTD_COMPLEX_MAPPINGS is not set
360# CONFIG_MTD_PHYSMAP is not set
361CONFIG_MTD_PHYSMAP_OF=y
362# CONFIG_MTD_WALNUT is not set
363# CONFIG_MTD_PLATRAM is not set
364
365#
366# Self-contained MTD device drivers
367#
368# CONFIG_MTD_SLRAM is not set
369# CONFIG_MTD_PHRAM is not set
370# CONFIG_MTD_MTDRAM is not set
371# CONFIG_MTD_BLOCK2MTD is not set
372
373#
374# Disk-On-Chip Device Drivers
375#
376# CONFIG_MTD_DOC2000 is not set
377# CONFIG_MTD_DOC2001 is not set
378# CONFIG_MTD_DOC2001PLUS is not set
379# CONFIG_MTD_NAND is not set
380# CONFIG_MTD_ONENAND is not set
381
382#
383# UBI - Unsorted block images
384#
385# CONFIG_MTD_UBI is not set
386CONFIG_OF_DEVICE=y
387# CONFIG_PARPORT is not set
388CONFIG_BLK_DEV=y
389# CONFIG_BLK_DEV_FD is not set
390# CONFIG_BLK_DEV_COW_COMMON is not set
391# CONFIG_BLK_DEV_LOOP is not set
392# CONFIG_BLK_DEV_NBD is not set
393CONFIG_BLK_DEV_RAM=y
394CONFIG_BLK_DEV_RAM_COUNT=16
395CONFIG_BLK_DEV_RAM_SIZE=35000
396CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
397# CONFIG_CDROM_PKTCDVD is not set
398# CONFIG_ATA_OVER_ETH is not set
399# CONFIG_XILINX_SYSACE is not set
400CONFIG_MISC_DEVICES=y
401# CONFIG_EEPROM_93CX6 is not set
402# CONFIG_IDE is not set
403
404#
405# SCSI device support
406#
407# CONFIG_RAID_ATTRS is not set
408# CONFIG_SCSI is not set
409# CONFIG_SCSI_DMA is not set
410# CONFIG_SCSI_NETLINK is not set
411# CONFIG_ATA is not set
412# CONFIG_MD is not set
413# CONFIG_MACINTOSH_DRIVERS is not set
414CONFIG_NETDEVICES=y
415# CONFIG_NETDEVICES_MULTIQUEUE is not set
416# CONFIG_DUMMY is not set
417# CONFIG_BONDING is not set
418# CONFIG_MACVLAN is not set
419# CONFIG_EQUALIZER is not set
420# CONFIG_TUN is not set
421# CONFIG_NET_ETHERNET is not set
422CONFIG_NETDEV_1000=y
423CONFIG_NETDEV_10000=y
424
425#
426# Wireless LAN
427#
428# CONFIG_WLAN_PRE80211 is not set
429# CONFIG_WLAN_80211 is not set
430# CONFIG_WAN is not set
431# CONFIG_PPP is not set
432# CONFIG_SLIP is not set
433# CONFIG_SHAPER is not set
434# CONFIG_NETCONSOLE is not set
435# CONFIG_NETPOLL is not set
436# CONFIG_NET_POLL_CONTROLLER is not set
437# CONFIG_ISDN is not set
438# CONFIG_PHONE is not set
439
440#
441# Input device support
442#
443# CONFIG_INPUT is not set
444
445#
446# Hardware I/O ports
447#
448# CONFIG_SERIO is not set
449# CONFIG_GAMEPORT is not set
450
451#
452# Character devices
453#
454# CONFIG_VT is not set
455# CONFIG_SERIAL_NONSTANDARD is not set
456
457#
458# Serial drivers
459#
460CONFIG_SERIAL_8250=y
461CONFIG_SERIAL_8250_CONSOLE=y
462CONFIG_SERIAL_8250_NR_UARTS=4
463CONFIG_SERIAL_8250_RUNTIME_UARTS=4
464CONFIG_SERIAL_8250_EXTENDED=y
465# CONFIG_SERIAL_8250_MANY_PORTS is not set
466CONFIG_SERIAL_8250_SHARE_IRQ=y
467# CONFIG_SERIAL_8250_DETECT_IRQ is not set
468# CONFIG_SERIAL_8250_RSA is not set
469
470#
471# Non-8250 serial port support
472#
473# CONFIG_SERIAL_UARTLITE is not set
474CONFIG_SERIAL_CORE=y
475CONFIG_SERIAL_CORE_CONSOLE=y
476CONFIG_SERIAL_OF_PLATFORM=y
477CONFIG_UNIX98_PTYS=y
478CONFIG_LEGACY_PTYS=y
479CONFIG_LEGACY_PTY_COUNT=256
480# CONFIG_IPMI_HANDLER is not set
481# CONFIG_WATCHDOG is not set
482# CONFIG_HW_RANDOM is not set
483# CONFIG_NVRAM is not set
484# CONFIG_GEN_RTC is not set
485# CONFIG_R3964 is not set
486# CONFIG_RAW_DRIVER is not set
487# CONFIG_TCG_TPM is not set
488# CONFIG_I2C is not set
489
490#
491# SPI support
492#
493# CONFIG_SPI is not set
494# CONFIG_SPI_MASTER is not set
495# CONFIG_W1 is not set
496# CONFIG_POWER_SUPPLY is not set
497# CONFIG_HWMON is not set
498
499#
500# Multifunction device drivers
501#
502# CONFIG_MFD_SM501 is not set
503
504#
505# Multimedia devices
506#
507# CONFIG_VIDEO_DEV is not set
508# CONFIG_DVB_CORE is not set
509# CONFIG_DAB is not set
510
511#
512# Graphics support
513#
514# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
515
516#
517# Display device support
518#
519# CONFIG_DISPLAY_SUPPORT is not set
520# CONFIG_VGASTATE is not set
521CONFIG_VIDEO_OUTPUT_CONTROL=m
522# CONFIG_FB is not set
523# CONFIG_FB_IBM_GXT4500 is not set
524
525#
526# Sound
527#
528# CONFIG_SOUND is not set
529CONFIG_USB_SUPPORT=y
530# CONFIG_USB_ARCH_HAS_HCD is not set
531# CONFIG_USB_ARCH_HAS_OHCI is not set
532# CONFIG_USB_ARCH_HAS_EHCI is not set
533
534#
535# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
536#
537
538#
539# USB Gadget Support
540#
541# CONFIG_USB_GADGET is not set
542# CONFIG_MMC is not set
543# CONFIG_NEW_LEDS is not set
544# CONFIG_EDAC is not set
545# CONFIG_RTC_CLASS is not set
546
547#
548# DMA Engine support
549#
550# CONFIG_DMA_ENGINE is not set
551
552#
553# DMA Clients
554#
555
556#
557# DMA Devices
558#
559
560#
561# Userspace I/O
562#
563# CONFIG_UIO is not set
564
565#
566# File systems
567#
568CONFIG_EXT2_FS=y
569# CONFIG_EXT2_FS_XATTR is not set
570# CONFIG_EXT2_FS_XIP is not set
571# CONFIG_EXT3_FS is not set
572# CONFIG_EXT4DEV_FS is not set
573# CONFIG_REISERFS_FS is not set
574# CONFIG_JFS_FS is not set
575# CONFIG_FS_POSIX_ACL is not set
576# CONFIG_XFS_FS is not set
577# CONFIG_GFS2_FS is not set
578# CONFIG_OCFS2_FS is not set
579# CONFIG_MINIX_FS is not set
580# CONFIG_ROMFS_FS is not set
581CONFIG_INOTIFY=y
582CONFIG_INOTIFY_USER=y
583# CONFIG_QUOTA is not set
584CONFIG_DNOTIFY=y
585# CONFIG_AUTOFS_FS is not set
586# CONFIG_AUTOFS4_FS is not set
587# CONFIG_FUSE_FS is not set
588
589#
590# CD-ROM/DVD Filesystems
591#
592# CONFIG_ISO9660_FS is not set
593# CONFIG_UDF_FS is not set
594
595#
596# DOS/FAT/NT Filesystems
597#
598# CONFIG_MSDOS_FS is not set
599# CONFIG_VFAT_FS is not set
600# CONFIG_NTFS_FS is not set
601
602#
603# Pseudo filesystems
604#
605CONFIG_PROC_FS=y
606CONFIG_PROC_KCORE=y
607CONFIG_PROC_SYSCTL=y
608CONFIG_SYSFS=y
609CONFIG_TMPFS=y
610# CONFIG_TMPFS_POSIX_ACL is not set
611# CONFIG_HUGETLB_PAGE is not set
612CONFIG_RAMFS=y
613# CONFIG_CONFIGFS_FS is not set
614
615#
616# Miscellaneous filesystems
617#
618# CONFIG_ADFS_FS is not set
619# CONFIG_AFFS_FS is not set
620# CONFIG_HFS_FS is not set
621# CONFIG_HFSPLUS_FS is not set
622# CONFIG_BEFS_FS is not set
623# CONFIG_BFS_FS is not set
624# CONFIG_EFS_FS is not set
625# CONFIG_JFFS2_FS is not set
626CONFIG_CRAMFS=y
627# CONFIG_VXFS_FS is not set
628# CONFIG_HPFS_FS is not set
629# CONFIG_QNX4FS_FS is not set
630# CONFIG_SYSV_FS is not set
631# CONFIG_UFS_FS is not set
632
633#
634# Network File Systems
635#
636CONFIG_NFS_FS=y
637CONFIG_NFS_V3=y
638# CONFIG_NFS_V3_ACL is not set
639# CONFIG_NFS_V4 is not set
640# CONFIG_NFS_DIRECTIO is not set
641# CONFIG_NFSD is not set
642CONFIG_ROOT_NFS=y
643CONFIG_LOCKD=y
644CONFIG_LOCKD_V4=y
645CONFIG_NFS_COMMON=y
646CONFIG_SUNRPC=y
647# CONFIG_SUNRPC_BIND34 is not set
648# CONFIG_RPCSEC_GSS_KRB5 is not set
649# CONFIG_RPCSEC_GSS_SPKM3 is not set
650# CONFIG_SMB_FS is not set
651# CONFIG_CIFS is not set
652# CONFIG_NCP_FS is not set
653# CONFIG_CODA_FS is not set
654# CONFIG_AFS_FS is not set
655
656#
657# Partition Types
658#
659# CONFIG_PARTITION_ADVANCED is not set
660CONFIG_MSDOS_PARTITION=y
661
662#
663# Native Language Support
664#
665# CONFIG_NLS is not set
666
667#
668# Distributed Lock Manager
669#
670# CONFIG_DLM is not set
671# CONFIG_UCC_SLOW is not set
672
673#
674# Library routines
675#
676CONFIG_BITREVERSE=y
677# CONFIG_CRC_CCITT is not set
678# CONFIG_CRC16 is not set
679# CONFIG_CRC_ITU_T is not set
680CONFIG_CRC32=y
681# CONFIG_CRC7 is not set
682# CONFIG_LIBCRC32C is not set
683CONFIG_ZLIB_INFLATE=y
684CONFIG_PLIST=y
685CONFIG_HAS_IOMEM=y
686CONFIG_HAS_IOPORT=y
687CONFIG_HAS_DMA=y
688
689#
690# Instrumentation Support
691#
692# CONFIG_PROFILING is not set
693
694#
695# Kernel hacking
696#
697# CONFIG_PRINTK_TIME is not set
698CONFIG_ENABLE_MUST_CHECK=y
699CONFIG_MAGIC_SYSRQ=y
700# CONFIG_UNUSED_SYMBOLS is not set
701# CONFIG_DEBUG_FS is not set
702# CONFIG_HEADERS_CHECK is not set
703CONFIG_DEBUG_KERNEL=y
704# CONFIG_DEBUG_SHIRQ is not set
705CONFIG_DETECT_SOFTLOCKUP=y
706CONFIG_SCHED_DEBUG=y
707# CONFIG_SCHEDSTATS is not set
708# CONFIG_TIMER_STATS is not set
709# CONFIG_DEBUG_SLAB is not set
710# CONFIG_DEBUG_RT_MUTEXES is not set
711# CONFIG_RT_MUTEX_TESTER is not set
712# CONFIG_DEBUG_SPINLOCK is not set
713# CONFIG_DEBUG_MUTEXES is not set
714# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
715# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
716# CONFIG_DEBUG_KOBJECT is not set
717CONFIG_DEBUG_BUGVERBOSE=y
718# CONFIG_DEBUG_INFO is not set
719# CONFIG_DEBUG_VM is not set
720# CONFIG_DEBUG_LIST is not set
721CONFIG_FORCED_INLINING=y
722# CONFIG_RCU_TORTURE_TEST is not set
723# CONFIG_FAULT_INJECTION is not set
724# CONFIG_DEBUG_STACKOVERFLOW is not set
725# CONFIG_DEBUG_STACK_USAGE is not set
726# CONFIG_DEBUG_PAGEALLOC is not set
727# CONFIG_DEBUGGER is not set
728# CONFIG_BDI_SWITCH is not set
729# CONFIG_PPC_EARLY_DEBUG is not set
730
731#
732# Security options
733#
734# CONFIG_KEYS is not set
735# CONFIG_SECURITY is not set
736CONFIG_CRYPTO=y
737CONFIG_CRYPTO_ALGAPI=y
738CONFIG_CRYPTO_BLKCIPHER=y
739CONFIG_CRYPTO_MANAGER=y
740# CONFIG_CRYPTO_HMAC is not set
741# CONFIG_CRYPTO_XCBC is not set
742# CONFIG_CRYPTO_NULL is not set
743# CONFIG_CRYPTO_MD4 is not set
744CONFIG_CRYPTO_MD5=y
745# CONFIG_CRYPTO_SHA1 is not set
746# CONFIG_CRYPTO_SHA256 is not set
747# CONFIG_CRYPTO_SHA512 is not set
748# CONFIG_CRYPTO_WP512 is not set
749# CONFIG_CRYPTO_TGR192 is not set
750# CONFIG_CRYPTO_GF128MUL is not set
751CONFIG_CRYPTO_ECB=y
752CONFIG_CRYPTO_CBC=y
753CONFIG_CRYPTO_PCBC=y
754# CONFIG_CRYPTO_LRW is not set
755# CONFIG_CRYPTO_CRYPTD is not set
756CONFIG_CRYPTO_DES=y
757# CONFIG_CRYPTO_FCRYPT is not set
758# CONFIG_CRYPTO_BLOWFISH is not set
759# CONFIG_CRYPTO_TWOFISH is not set
760# CONFIG_CRYPTO_SERPENT is not set
761# CONFIG_CRYPTO_AES is not set
762# CONFIG_CRYPTO_CAST5 is not set
763# CONFIG_CRYPTO_CAST6 is not set
764# CONFIG_CRYPTO_TEA is not set
765# CONFIG_CRYPTO_ARC4 is not set
766# CONFIG_CRYPTO_KHAZAD is not set
767# CONFIG_CRYPTO_ANUBIS is not set
768# CONFIG_CRYPTO_DEFLATE is not set
769# CONFIG_CRYPTO_MICHAEL_MIC is not set
770# CONFIG_CRYPTO_CRC32C is not set
771# CONFIG_CRYPTO_CAMELLIA is not set
772# CONFIG_CRYPTO_TEST is not set
773CONFIG_CRYPTO_HW=y
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index b0cb2e662c25..fb33a7e71941 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -24,6 +24,7 @@ obj-$(CONFIG_PPC64) += vdso64/
24obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o 24obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
25obj-$(CONFIG_PPC_970_NAP) += idle_power4.o 25obj-$(CONFIG_PPC_970_NAP) += idle_power4.o
26obj-$(CONFIG_PPC_OF) += of_device.o of_platform.o prom_parse.o 26obj-$(CONFIG_PPC_OF) += of_device.o of_platform.o prom_parse.o
27obj-$(CONFIG_PPC_CLOCK) += clock.o
27procfs-$(CONFIG_PPC64) := proc_ppc64.o 28procfs-$(CONFIG_PPC64) := proc_ppc64.o
28obj-$(CONFIG_PROC_FS) += $(procfs-y) 29obj-$(CONFIG_PROC_FS) += $(procfs-y)
29rtaspci-$(CONFIG_PPC64)-$(CONFIG_PCI) := rtas_pci.o 30rtaspci-$(CONFIG_PPC64)-$(CONFIG_PCI) := rtas_pci.o
@@ -37,25 +38,26 @@ obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
37obj-$(CONFIG_CRASH_DUMP) += crash_dump.o 38obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
38obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o 39obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
39obj-$(CONFIG_TAU) += tau_6xx.o 40obj-$(CONFIG_TAU) += tau_6xx.o
40obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o 41obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o \
41obj32-$(CONFIG_HIBERNATION) += swsusp_32.o 42 swsusp_$(CONFIG_WORD_SIZE).o
42obj64-$(CONFIG_HIBERNATION) += swsusp_64.o swsusp_asm64.o 43obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o
43obj32-$(CONFIG_MODULES) += module_32.o 44obj-$(CONFIG_MODULES) += module_$(CONFIG_WORD_SIZE).o
44 45
45ifeq ($(CONFIG_PPC_MERGE),y) 46ifeq ($(CONFIG_PPC_MERGE),y)
46 47
47extra-$(CONFIG_PPC_STD_MMU) := head_32.o 48extra-$(CONFIG_PPC_STD_MMU) := head_32.o
48extra-$(CONFIG_PPC64) := head_64.o 49extra-$(CONFIG_PPC64) := head_64.o
49extra-$(CONFIG_40x) := head_4xx.o 50extra-$(CONFIG_40x) := head_40x.o
50extra-$(CONFIG_44x) := head_44x.o 51extra-$(CONFIG_44x) := head_44x.o
51extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o 52extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
52extra-$(CONFIG_8xx) := head_8xx.o 53extra-$(CONFIG_8xx) := head_8xx.o
53extra-y += vmlinux.lds 54extra-y += vmlinux.lds
54 55
55obj-y += time.o prom.o traps.o setup-common.o \ 56obj-y += time.o prom.o traps.o setup-common.o \
56 udbg.o misc.o io.o 57 udbg.o misc.o io.o \
57obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o 58 misc_$(CONFIG_WORD_SIZE).o
58obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o 59obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
60obj-$(CONFIG_PPC64) += dma_64.o iommu.o
59obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o 61obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o
60obj-$(CONFIG_MODULES) += ppc_ksyms.o 62obj-$(CONFIG_MODULES) += ppc_ksyms.o
61obj-$(CONFIG_BOOTX_TEXT) += btext.o 63obj-$(CONFIG_BOOTX_TEXT) += btext.o
@@ -63,16 +65,12 @@ obj-$(CONFIG_SMP) += smp.o
63obj-$(CONFIG_KPROBES) += kprobes.o 65obj-$(CONFIG_KPROBES) += kprobes.o
64obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o 66obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
65 67
66module-$(CONFIG_PPC64) += module_64.o 68pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o
67obj-$(CONFIG_MODULES) += $(module-y) 69obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
68 70 pci-common.o
69pci64-$(CONFIG_PPC64) += pci_64.o pci_dn.o isa-bridge.o
70pci32-$(CONFIG_PPC32) := pci_32.o
71obj-$(CONFIG_PCI) += $(pci64-y) $(pci32-y) pci-common.o
72obj-$(CONFIG_PCI_MSI) += msi.o 71obj-$(CONFIG_PCI_MSI) += msi.o
73kexec-$(CONFIG_PPC64) := machine_kexec_64.o 72obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o \
74kexec-$(CONFIG_PPC32) := machine_kexec_32.o 73 machine_kexec_$(CONFIG_WORD_SIZE).o
75obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o $(kexec-y)
76obj-$(CONFIG_AUDIT) += audit.o 74obj-$(CONFIG_AUDIT) += audit.o
77obj64-$(CONFIG_AUDIT) += compat_audit.o 75obj64-$(CONFIG_AUDIT) += compat_audit.o
78 76
@@ -80,20 +78,12 @@ ifneq ($(CONFIG_PPC_INDIRECT_IO),y)
80obj-y += iomap.o 78obj-y += iomap.o
81endif 79endif
82 80
83ifeq ($(CONFIG_PPC_ISERIES),y)
84CFLAGS_lparmap.s += -g0
85extra-y += lparmap.s
86$(obj)/head_64.o: $(obj)/lparmap.s
87AFLAGS_head_64.o += -I$(obj)
88endif
89
90else 81else
91# stuff used from here for ARCH=ppc 82# stuff used from here for ARCH=ppc
92smpobj-$(CONFIG_SMP) += smp.o 83smpobj-$(CONFIG_SMP) += smp.o
93 84
94endif 85endif
95 86
96obj-$(CONFIG_PPC32) += $(obj32-y)
97obj-$(CONFIG_PPC64) += $(obj64-y) 87obj-$(CONFIG_PPC64) += $(obj64-y)
98 88
99extra-$(CONFIG_PPC_FPU) += fpu.o 89extra-$(CONFIG_PPC_FPU) += fpu.o
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 5c9ff7f5c44e..e06f75daeba3 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -38,7 +38,7 @@ struct aligninfo {
38/* Bits in the flags field */ 38/* Bits in the flags field */
39#define LD 0 /* load */ 39#define LD 0 /* load */
40#define ST 1 /* store */ 40#define ST 1 /* store */
41#define SE 2 /* sign-extend value */ 41#define SE 2 /* sign-extend value, or FP ld/st as word */
42#define F 4 /* to/from fp regs */ 42#define F 4 /* to/from fp regs */
43#define U 8 /* update index register */ 43#define U 8 /* update index register */
44#define M 0x10 /* multiple load/store */ 44#define M 0x10 /* multiple load/store */
@@ -46,6 +46,8 @@ struct aligninfo {
46#define S 0x40 /* single-precision fp or... */ 46#define S 0x40 /* single-precision fp or... */
47#define SX 0x40 /* ... byte count in XER */ 47#define SX 0x40 /* ... byte count in XER */
48#define HARD 0x80 /* string, stwcx. */ 48#define HARD 0x80 /* string, stwcx. */
49#define E4 0x40 /* SPE endianness is word */
50#define E8 0x80 /* SPE endianness is double word */
49 51
50/* DSISR bits reported for a DCBZ instruction: */ 52/* DSISR bits reported for a DCBZ instruction: */
51#define DCBZ 0x5f /* 8xx/82xx dcbz faults when cache not enabled */ 53#define DCBZ 0x5f /* 8xx/82xx dcbz faults when cache not enabled */
@@ -87,9 +89,9 @@ static struct aligninfo aligninfo[128] = {
87 { 8, LD+F+U }, /* 00 1 1001: lfdu */ 89 { 8, LD+F+U }, /* 00 1 1001: lfdu */
88 { 4, ST+F+S+U }, /* 00 1 1010: stfsu */ 90 { 4, ST+F+S+U }, /* 00 1 1010: stfsu */
89 { 8, ST+F+U }, /* 00 1 1011: stfdu */ 91 { 8, ST+F+U }, /* 00 1 1011: stfdu */
90 INVALID, /* 00 1 1100 */ 92 { 16, LD+F }, /* 00 1 1100: lfdp */
91 INVALID, /* 00 1 1101 */ 93 INVALID, /* 00 1 1101 */
92 INVALID, /* 00 1 1110 */ 94 { 16, ST+F }, /* 00 1 1110: stfdp */
93 INVALID, /* 00 1 1111 */ 95 INVALID, /* 00 1 1111 */
94 { 8, LD }, /* 01 0 0000: ldx */ 96 { 8, LD }, /* 01 0 0000: ldx */
95 INVALID, /* 01 0 0001 */ 97 INVALID, /* 01 0 0001 */
@@ -167,10 +169,10 @@ static struct aligninfo aligninfo[128] = {
167 { 8, LD+F }, /* 11 0 1001: lfdx */ 169 { 8, LD+F }, /* 11 0 1001: lfdx */
168 { 4, ST+F+S }, /* 11 0 1010: stfsx */ 170 { 4, ST+F+S }, /* 11 0 1010: stfsx */
169 { 8, ST+F }, /* 11 0 1011: stfdx */ 171 { 8, ST+F }, /* 11 0 1011: stfdx */
170 INVALID, /* 11 0 1100 */ 172 { 16, LD+F }, /* 11 0 1100: lfdpx */
171 { 8, LD+M }, /* 11 0 1101: lmd */ 173 { 4, LD+F+SE }, /* 11 0 1101: lfiwax */
172 INVALID, /* 11 0 1110 */ 174 { 16, ST+F }, /* 11 0 1110: stfdpx */
173 { 8, ST+M }, /* 11 0 1111: stmd */ 175 { 4, ST+F }, /* 11 0 1111: stfiwx */
174 { 4, LD+U }, /* 11 1 0000: lwzux */ 176 { 4, LD+U }, /* 11 1 0000: lwzux */
175 INVALID, /* 11 1 0001 */ 177 INVALID, /* 11 1 0001 */
176 { 4, ST+U }, /* 11 1 0010: stwux */ 178 { 4, ST+U }, /* 11 1 0010: stwux */
@@ -356,6 +358,284 @@ static int emulate_multiple(struct pt_regs *regs, unsigned char __user *addr,
356 return 1; 358 return 1;
357} 359}
358 360
361/*
362 * Emulate floating-point pair loads and stores.
363 * Only POWER6 has these instructions, and it does true little-endian,
364 * so we don't need the address swizzling.
365 */
366static int emulate_fp_pair(struct pt_regs *regs, unsigned char __user *addr,
367 unsigned int reg, unsigned int flags)
368{
369 char *ptr = (char *) &current->thread.fpr[reg];
370 int i, ret;
371
372 if (!(flags & F))
373 return 0;
374 if (reg & 1)
375 return 0; /* invalid form: FRS/FRT must be even */
376 if (!(flags & SW)) {
377 /* not byte-swapped - easy */
378 if (!(flags & ST))
379 ret = __copy_from_user(ptr, addr, 16);
380 else
381 ret = __copy_to_user(addr, ptr, 16);
382 } else {
383 /* each FPR value is byte-swapped separately */
384 ret = 0;
385 for (i = 0; i < 16; ++i) {
386 if (!(flags & ST))
387 ret |= __get_user(ptr[i^7], addr + i);
388 else
389 ret |= __put_user(ptr[i^7], addr + i);
390 }
391 }
392 if (ret)
393 return -EFAULT;
394 return 1; /* exception handled and fixed up */
395}
396
397#ifdef CONFIG_SPE
398
399static struct aligninfo spe_aligninfo[32] = {
400 { 8, LD+E8 }, /* 0 00 00: evldd[x] */
401 { 8, LD+E4 }, /* 0 00 01: evldw[x] */
402 { 8, LD }, /* 0 00 10: evldh[x] */
403 INVALID, /* 0 00 11 */
404 { 2, LD }, /* 0 01 00: evlhhesplat[x] */
405 INVALID, /* 0 01 01 */
406 { 2, LD }, /* 0 01 10: evlhhousplat[x] */
407 { 2, LD+SE }, /* 0 01 11: evlhhossplat[x] */
408 { 4, LD }, /* 0 10 00: evlwhe[x] */
409 INVALID, /* 0 10 01 */
410 { 4, LD }, /* 0 10 10: evlwhou[x] */
411 { 4, LD+SE }, /* 0 10 11: evlwhos[x] */
412 { 4, LD+E4 }, /* 0 11 00: evlwwsplat[x] */
413 INVALID, /* 0 11 01 */
414 { 4, LD }, /* 0 11 10: evlwhsplat[x] */
415 INVALID, /* 0 11 11 */
416
417 { 8, ST+E8 }, /* 1 00 00: evstdd[x] */
418 { 8, ST+E4 }, /* 1 00 01: evstdw[x] */
419 { 8, ST }, /* 1 00 10: evstdh[x] */
420 INVALID, /* 1 00 11 */
421 INVALID, /* 1 01 00 */
422 INVALID, /* 1 01 01 */
423 INVALID, /* 1 01 10 */
424 INVALID, /* 1 01 11 */
425 { 4, ST }, /* 1 10 00: evstwhe[x] */
426 INVALID, /* 1 10 01 */
427 { 4, ST }, /* 1 10 10: evstwho[x] */
428 INVALID, /* 1 10 11 */
429 { 4, ST+E4 }, /* 1 11 00: evstwwe[x] */
430 INVALID, /* 1 11 01 */
431 { 4, ST+E4 }, /* 1 11 10: evstwwo[x] */
432 INVALID, /* 1 11 11 */
433};
434
435#define EVLDD 0x00
436#define EVLDW 0x01
437#define EVLDH 0x02
438#define EVLHHESPLAT 0x04
439#define EVLHHOUSPLAT 0x06
440#define EVLHHOSSPLAT 0x07
441#define EVLWHE 0x08
442#define EVLWHOU 0x0A
443#define EVLWHOS 0x0B
444#define EVLWWSPLAT 0x0C
445#define EVLWHSPLAT 0x0E
446#define EVSTDD 0x10
447#define EVSTDW 0x11
448#define EVSTDH 0x12
449#define EVSTWHE 0x18
450#define EVSTWHO 0x1A
451#define EVSTWWE 0x1C
452#define EVSTWWO 0x1E
453
454/*
455 * Emulate SPE loads and stores.
456 * Only Book-E has these instructions, and it does true little-endian,
457 * so we don't need the address swizzling.
458 */
459static int emulate_spe(struct pt_regs *regs, unsigned int reg,
460 unsigned int instr)
461{
462 int t, ret;
463 union {
464 u64 ll;
465 u32 w[2];
466 u16 h[4];
467 u8 v[8];
468 } data, temp;
469 unsigned char __user *p, *addr;
470 unsigned long *evr = &current->thread.evr[reg];
471 unsigned int nb, flags;
472
473 instr = (instr >> 1) & 0x1f;
474
475 /* DAR has the operand effective address */
476 addr = (unsigned char __user *)regs->dar;
477
478 nb = spe_aligninfo[instr].len;
479 flags = spe_aligninfo[instr].flags;
480
481 /* Verify the address of the operand */
482 if (unlikely(user_mode(regs) &&
483 !access_ok((flags & ST ? VERIFY_WRITE : VERIFY_READ),
484 addr, nb)))
485 return -EFAULT;
486
487 /* userland only */
488 if (unlikely(!user_mode(regs)))
489 return 0;
490
491 flush_spe_to_thread(current);
492
493 /* If we are loading, get the data from user space, else
494 * get it from register values
495 */
496 if (flags & ST) {
497 data.ll = 0;
498 switch (instr) {
499 case EVSTDD:
500 case EVSTDW:
501 case EVSTDH:
502 data.w[0] = *evr;
503 data.w[1] = regs->gpr[reg];
504 break;
505 case EVSTWHE:
506 data.h[2] = *evr >> 16;
507 data.h[3] = regs->gpr[reg] >> 16;
508 break;
509 case EVSTWHO:
510 data.h[2] = *evr & 0xffff;
511 data.h[3] = regs->gpr[reg] & 0xffff;
512 break;
513 case EVSTWWE:
514 data.w[1] = *evr;
515 break;
516 case EVSTWWO:
517 data.w[1] = regs->gpr[reg];
518 break;
519 default:
520 return -EINVAL;
521 }
522 } else {
523 temp.ll = data.ll = 0;
524 ret = 0;
525 p = addr;
526
527 switch (nb) {
528 case 8:
529 ret |= __get_user_inatomic(temp.v[0], p++);
530 ret |= __get_user_inatomic(temp.v[1], p++);
531 ret |= __get_user_inatomic(temp.v[2], p++);
532 ret |= __get_user_inatomic(temp.v[3], p++);
533 case 4:
534 ret |= __get_user_inatomic(temp.v[4], p++);
535 ret |= __get_user_inatomic(temp.v[5], p++);
536 case 2:
537 ret |= __get_user_inatomic(temp.v[6], p++);
538 ret |= __get_user_inatomic(temp.v[7], p++);
539 if (unlikely(ret))
540 return -EFAULT;
541 }
542
543 switch (instr) {
544 case EVLDD:
545 case EVLDW:
546 case EVLDH:
547 data.ll = temp.ll;
548 break;
549 case EVLHHESPLAT:
550 data.h[0] = temp.h[3];
551 data.h[2] = temp.h[3];
552 break;
553 case EVLHHOUSPLAT:
554 case EVLHHOSSPLAT:
555 data.h[1] = temp.h[3];
556 data.h[3] = temp.h[3];
557 break;
558 case EVLWHE:
559 data.h[0] = temp.h[2];
560 data.h[2] = temp.h[3];
561 break;
562 case EVLWHOU:
563 case EVLWHOS:
564 data.h[1] = temp.h[2];
565 data.h[3] = temp.h[3];
566 break;
567 case EVLWWSPLAT:
568 data.w[0] = temp.w[1];
569 data.w[1] = temp.w[1];
570 break;
571 case EVLWHSPLAT:
572 data.h[0] = temp.h[2];
573 data.h[1] = temp.h[2];
574 data.h[2] = temp.h[3];
575 data.h[3] = temp.h[3];
576 break;
577 default:
578 return -EINVAL;
579 }
580 }
581
582 if (flags & SW) {
583 switch (flags & 0xf0) {
584 case E8:
585 SWAP(data.v[0], data.v[7]);
586 SWAP(data.v[1], data.v[6]);
587 SWAP(data.v[2], data.v[5]);
588 SWAP(data.v[3], data.v[4]);
589 break;
590 case E4:
591
592 SWAP(data.v[0], data.v[3]);
593 SWAP(data.v[1], data.v[2]);
594 SWAP(data.v[4], data.v[7]);
595 SWAP(data.v[5], data.v[6]);
596 break;
597 /* Its half word endian */
598 default:
599 SWAP(data.v[0], data.v[1]);
600 SWAP(data.v[2], data.v[3]);
601 SWAP(data.v[4], data.v[5]);
602 SWAP(data.v[6], data.v[7]);
603 break;
604 }
605 }
606
607 if (flags & SE) {
608 data.w[0] = (s16)data.h[1];
609 data.w[1] = (s16)data.h[3];
610 }
611
612 /* Store result to memory or update registers */
613 if (flags & ST) {
614 ret = 0;
615 p = addr;
616 switch (nb) {
617 case 8:
618 ret |= __put_user_inatomic(data.v[0], p++);
619 ret |= __put_user_inatomic(data.v[1], p++);
620 ret |= __put_user_inatomic(data.v[2], p++);
621 ret |= __put_user_inatomic(data.v[3], p++);
622 case 4:
623 ret |= __put_user_inatomic(data.v[4], p++);
624 ret |= __put_user_inatomic(data.v[5], p++);
625 case 2:
626 ret |= __put_user_inatomic(data.v[6], p++);
627 ret |= __put_user_inatomic(data.v[7], p++);
628 }
629 if (unlikely(ret))
630 return -EFAULT;
631 } else {
632 *evr = data.w[0];
633 regs->gpr[reg] = data.w[1];
634 }
635
636 return 1;
637}
638#endif /* CONFIG_SPE */
359 639
360/* 640/*
361 * Called on alignment exception. Attempts to fixup 641 * Called on alignment exception. Attempts to fixup
@@ -414,6 +694,12 @@ int fix_alignment(struct pt_regs *regs)
414 /* extract the operation and registers from the dsisr */ 694 /* extract the operation and registers from the dsisr */
415 reg = (dsisr >> 5) & 0x1f; /* source/dest register */ 695 reg = (dsisr >> 5) & 0x1f; /* source/dest register */
416 areg = dsisr & 0x1f; /* register to update */ 696 areg = dsisr & 0x1f; /* register to update */
697
698#ifdef CONFIG_SPE
699 if ((instr >> 26) == 0x4)
700 return emulate_spe(regs, reg, instr);
701#endif
702
417 instr = (dsisr >> 10) & 0x7f; 703 instr = (dsisr >> 10) & 0x7f;
418 instr |= (dsisr >> 13) & 0x60; 704 instr |= (dsisr >> 13) & 0x60;
419 705
@@ -471,6 +757,10 @@ int fix_alignment(struct pt_regs *regs)
471 flush_fp_to_thread(current); 757 flush_fp_to_thread(current);
472 } 758 }
473 759
760 /* Special case for 16-byte FP loads and stores */
761 if (nb == 16)
762 return emulate_fp_pair(regs, addr, reg, flags);
763
474 /* If we are loading, get the data from user space, else 764 /* If we are loading, get the data from user space, else
475 * get it from register values 765 * get it from register values
476 */ 766 */
@@ -531,7 +821,8 @@ int fix_alignment(struct pt_regs *regs)
531 * or floating point single precision conversion 821 * or floating point single precision conversion
532 */ 822 */
533 switch (flags & ~(U|SW)) { 823 switch (flags & ~(U|SW)) {
534 case LD+SE: /* sign extend */ 824 case LD+SE: /* sign extending integer loads */
825 case LD+F+SE: /* sign extend for lfiwax */
535 if ( nb == 2 ) 826 if ( nb == 2 )
536 data.ll = data.x16.low16; 827 data.ll = data.x16.low16;
537 else /* nb must be 4 */ 828 else /* nb must be 4 */
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 2cb1d9487796..0ae5d57b9368 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -312,5 +312,17 @@ int main(void)
312#ifdef CONFIG_BUG 312#ifdef CONFIG_BUG
313 DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry)); 313 DEFINE(BUG_ENTRY_SIZE, sizeof(struct bug_entry));
314#endif 314#endif
315
316#ifdef CONFIG_PPC_ISERIES
317 /* the assembler miscalculates the VSID values */
318 DEFINE(PAGE_OFFSET_ESID, GET_ESID(PAGE_OFFSET));
319 DEFINE(PAGE_OFFSET_VSID, KERNEL_VSID(PAGE_OFFSET));
320 DEFINE(VMALLOC_START_ESID, GET_ESID(VMALLOC_START));
321 DEFINE(VMALLOC_START_VSID, KERNEL_VSID(VMALLOC_START));
322#endif
323
324#ifdef CONFIG_PPC64
325 DEFINE(PGD_TABLE_SIZE, PGD_TABLE_SIZE);
326#endif
315 return 0; 327 return 0;
316} 328}
diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c
index e7b684689e04..3ef51fb6f107 100644
--- a/arch/powerpc/kernel/btext.c
+++ b/arch/powerpc/kernel/btext.c
@@ -11,7 +11,6 @@
11#include <asm/sections.h> 11#include <asm/sections.h>
12#include <asm/prom.h> 12#include <asm/prom.h>
13#include <asm/btext.h> 13#include <asm/btext.h>
14#include <asm/prom.h>
15#include <asm/page.h> 14#include <asm/page.h>
16#include <asm/mmu.h> 15#include <asm/mmu.h>
17#include <asm/pgtable.h> 16#include <asm/pgtable.h>
diff --git a/arch/powerpc/kernel/clock.c b/arch/powerpc/kernel/clock.c
new file mode 100644
index 000000000000..ce668f545758
--- /dev/null
+++ b/arch/powerpc/kernel/clock.c
@@ -0,0 +1,82 @@
1/*
2 * Dummy clk implementations for powerpc.
3 * These need to be overridden in platform code.
4 */
5
6#include <linux/clk.h>
7#include <linux/err.h>
8#include <linux/errno.h>
9#include <linux/module.h>
10#include <asm/clk_interface.h>
11
12struct clk_interface clk_functions;
13
14struct clk *clk_get(struct device *dev, const char *id)
15{
16 if (clk_functions.clk_get)
17 return clk_functions.clk_get(dev, id);
18 return ERR_PTR(-ENOSYS);
19}
20EXPORT_SYMBOL(clk_get);
21
22void clk_put(struct clk *clk)
23{
24 if (clk_functions.clk_put)
25 clk_functions.clk_put(clk);
26}
27EXPORT_SYMBOL(clk_put);
28
29int clk_enable(struct clk *clk)
30{
31 if (clk_functions.clk_enable)
32 return clk_functions.clk_enable(clk);
33 return -ENOSYS;
34}
35EXPORT_SYMBOL(clk_enable);
36
37void clk_disable(struct clk *clk)
38{
39 if (clk_functions.clk_disable)
40 clk_functions.clk_disable(clk);
41}
42EXPORT_SYMBOL(clk_disable);
43
44unsigned long clk_get_rate(struct clk *clk)
45{
46 if (clk_functions.clk_get_rate)
47 return clk_functions.clk_get_rate(clk);
48 return 0;
49}
50EXPORT_SYMBOL(clk_get_rate);
51
52long clk_round_rate(struct clk *clk, unsigned long rate)
53{
54 if (clk_functions.clk_round_rate)
55 return clk_functions.clk_round_rate(clk, rate);
56 return -ENOSYS;
57}
58EXPORT_SYMBOL(clk_round_rate);
59
60int clk_set_rate(struct clk *clk, unsigned long rate)
61{
62 if (clk_functions.clk_set_rate)
63 return clk_functions.clk_set_rate(clk, rate);
64 return -ENOSYS;
65}
66EXPORT_SYMBOL(clk_set_rate);
67
68struct clk *clk_get_parent(struct clk *clk)
69{
70 if (clk_functions.clk_get_parent)
71 return clk_functions.clk_get_parent(clk);
72 return ERR_PTR(-ENOSYS);
73}
74EXPORT_SYMBOL(clk_get_parent);
75
76int clk_set_parent(struct clk *clk, struct clk *parent)
77{
78 if (clk_functions.clk_set_parent)
79 return clk_functions.clk_set_parent(clk, parent);
80 return -ENOSYS;
81}
82EXPORT_SYMBOL(clk_set_parent);
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index b1f8000952f3..8eb8087383eb 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -68,15 +68,6 @@ extern void __restore_cpu_ppc970(void);
68#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \ 68#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
69 PPC_FEATURE_BOOKE) 69 PPC_FEATURE_BOOKE)
70 70
71/* We only set the spe features if the kernel was compiled with
72 * spe support
73 */
74#ifdef CONFIG_SPE
75#define PPC_FEATURE_SPE_COMP PPC_FEATURE_HAS_SPE
76#else
77#define PPC_FEATURE_SPE_COMP 0
78#endif
79
80static struct cpu_spec cpu_specs[] = { 71static struct cpu_spec cpu_specs[] = {
81#ifdef CONFIG_PPC64 72#ifdef CONFIG_PPC64
82 { /* Power3 */ 73 { /* Power3 */
@@ -1132,6 +1123,24 @@ static struct cpu_spec cpu_specs[] = {
1132 .dcache_bsize = 32, 1123 .dcache_bsize = 32,
1133 .platform = "ppc440", 1124 .platform = "ppc440",
1134 }, 1125 },
1126 { /* 440EPX */
1127 .pvr_mask = 0xf0000ffb,
1128 .pvr_value = 0x200008D0,
1129 .cpu_name = "440EPX",
1130 .cpu_features = CPU_FTRS_44X,
1131 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1132 .icache_bsize = 32,
1133 .dcache_bsize = 32,
1134 },
1135 { /* 440GRX */
1136 .pvr_mask = 0xf0000ffb,
1137 .pvr_value = 0x200008D8,
1138 .cpu_name = "440GRX",
1139 .cpu_features = CPU_FTRS_44X,
1140 .cpu_user_features = COMMON_USER_BOOKE,
1141 .icache_bsize = 32,
1142 .dcache_bsize = 32,
1143 },
1135 { /* 440GP Rev. B */ 1144 { /* 440GP Rev. B */
1136 .pvr_mask = 0xf0000fff, 1145 .pvr_mask = 0xf0000fff,
1137 .pvr_value = 0x40000440, 1146 .pvr_value = 0x40000440,
@@ -1243,8 +1252,8 @@ static struct cpu_spec cpu_specs[] = {
1243 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ 1252 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1244 .cpu_features = CPU_FTRS_E200, 1253 .cpu_features = CPU_FTRS_E200,
1245 .cpu_user_features = COMMON_USER_BOOKE | 1254 .cpu_user_features = COMMON_USER_BOOKE |
1246 PPC_FEATURE_SPE_COMP | 1255 PPC_FEATURE_HAS_SPE_COMP |
1247 PPC_FEATURE_HAS_EFP_SINGLE | 1256 PPC_FEATURE_HAS_EFP_SINGLE_COMP |
1248 PPC_FEATURE_UNIFIED_CACHE, 1257 PPC_FEATURE_UNIFIED_CACHE,
1249 .dcache_bsize = 32, 1258 .dcache_bsize = 32,
1250 .platform = "ppc5554", 1259 .platform = "ppc5554",
@@ -1256,8 +1265,8 @@ static struct cpu_spec cpu_specs[] = {
1256 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ 1265 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1257 .cpu_features = CPU_FTRS_E500, 1266 .cpu_features = CPU_FTRS_E500,
1258 .cpu_user_features = COMMON_USER_BOOKE | 1267 .cpu_user_features = COMMON_USER_BOOKE |
1259 PPC_FEATURE_SPE_COMP | 1268 PPC_FEATURE_HAS_SPE_COMP |
1260 PPC_FEATURE_HAS_EFP_SINGLE, 1269 PPC_FEATURE_HAS_EFP_SINGLE_COMP,
1261 .icache_bsize = 32, 1270 .icache_bsize = 32,
1262 .dcache_bsize = 32, 1271 .dcache_bsize = 32,
1263 .num_pmcs = 4, 1272 .num_pmcs = 4,
@@ -1272,9 +1281,9 @@ static struct cpu_spec cpu_specs[] = {
1272 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ 1281 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1273 .cpu_features = CPU_FTRS_E500_2, 1282 .cpu_features = CPU_FTRS_E500_2,
1274 .cpu_user_features = COMMON_USER_BOOKE | 1283 .cpu_user_features = COMMON_USER_BOOKE |
1275 PPC_FEATURE_SPE_COMP | 1284 PPC_FEATURE_HAS_SPE_COMP |
1276 PPC_FEATURE_HAS_EFP_SINGLE | 1285 PPC_FEATURE_HAS_EFP_SINGLE_COMP |
1277 PPC_FEATURE_HAS_EFP_DOUBLE, 1286 PPC_FEATURE_HAS_EFP_DOUBLE_COMP,
1278 .icache_bsize = 32, 1287 .icache_bsize = 32,
1279 .dcache_bsize = 32, 1288 .dcache_bsize = 32,
1280 .num_pmcs = 4, 1289 .num_pmcs = 4,
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index 37658ea417fa..77c749a13378 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -24,7 +24,6 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/irq.h>
28 27
29#include <asm/processor.h> 28#include <asm/processor.h>
30#include <asm/machdep.h> 29#include <asm/machdep.h>
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c
index 2f6f5a7bc69e..29ff77c468ac 100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
@@ -25,7 +25,7 @@
25#define DBG(fmt...) 25#define DBG(fmt...)
26#endif 26#endif
27 27
28void reserve_kdump_trampoline(void) 28void __init reserve_kdump_trampoline(void)
29{ 29{
30 lmb_reserve(0, KDUMP_RESERVE_LIMIT); 30 lmb_reserve(0, KDUMP_RESERVE_LIMIT);
31} 31}
@@ -54,8 +54,10 @@ void __init setup_kdump_trampoline(void)
54 create_trampoline(i); 54 create_trampoline(i);
55 } 55 }
56 56
57#ifdef CONFIG_PPC_PSERIES
57 create_trampoline(__pa(system_reset_fwnmi) - PHYSICAL_START); 58 create_trampoline(__pa(system_reset_fwnmi) - PHYSICAL_START);
58 create_trampoline(__pa(machine_check_fwnmi) - PHYSICAL_START); 59 create_trampoline(__pa(machine_check_fwnmi) - PHYSICAL_START);
60#endif /* CONFIG_PPC_PSERIES */
59 61
60 DBG(" <- setup_kdump_trampoline()\n"); 62 DBG(" <- setup_kdump_trampoline()\n");
61} 63}
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 4074c0b31453..21d889e63e87 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -504,9 +504,11 @@ BEGIN_FTR_SECTION
504END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 504END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
505#endif /* CONFIG_ALTIVEC */ 505#endif /* CONFIG_ALTIVEC */
506#ifdef CONFIG_SPE 506#ifdef CONFIG_SPE
507BEGIN_FTR_SECTION
507 oris r0,r0,MSR_SPE@h /* Disable SPE */ 508 oris r0,r0,MSR_SPE@h /* Disable SPE */
508 mfspr r12,SPRN_SPEFSCR /* save spefscr register value */ 509 mfspr r12,SPRN_SPEFSCR /* save spefscr register value */
509 stw r12,THREAD+THREAD_SPEFSCR(r2) 510 stw r12,THREAD+THREAD_SPEFSCR(r2)
511END_FTR_SECTION_IFSET(CPU_FTR_SPE)
510#endif /* CONFIG_SPE */ 512#endif /* CONFIG_SPE */
511 and. r0,r0,r11 /* FP or altivec or SPE enabled? */ 513 and. r0,r0,r11 /* FP or altivec or SPE enabled? */
512 beq+ 1f 514 beq+ 1f
@@ -542,8 +544,10 @@ BEGIN_FTR_SECTION
542END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 544END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
543#endif /* CONFIG_ALTIVEC */ 545#endif /* CONFIG_ALTIVEC */
544#ifdef CONFIG_SPE 546#ifdef CONFIG_SPE
547BEGIN_FTR_SECTION
545 lwz r0,THREAD+THREAD_SPEFSCR(r2) 548 lwz r0,THREAD+THREAD_SPEFSCR(r2)
546 mtspr SPRN_SPEFSCR,r0 /* restore SPEFSCR reg */ 549 mtspr SPRN_SPEFSCR,r0 /* restore SPEFSCR reg */
550END_FTR_SECTION_IFSET(CPU_FTR_SPE)
547#endif /* CONFIG_SPE */ 551#endif /* CONFIG_SPE */
548 552
549 lwz r0,_CCR(r1) 553 lwz r0,_CCR(r1)
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 952eba6701f4..fbbd3f6f0064 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -385,15 +385,15 @@ BEGIN_FTR_SECTION
385 oris r0,r6,(SLB_ESID_V)@h 385 oris r0,r6,(SLB_ESID_V)@h
386 ori r0,r0,(SLB_NUM_BOLTED-1)@l 386 ori r0,r0,(SLB_NUM_BOLTED-1)@l
387 387
388 /* Update the last bolted SLB */ 388 /* Update the last bolted SLB. No write barriers are needed
389 * here, provided we only update the current CPU's SLB shadow
390 * buffer.
391 */
389 ld r9,PACA_SLBSHADOWPTR(r13) 392 ld r9,PACA_SLBSHADOWPTR(r13)
390 li r12,0 393 li r12,0
391 std r12,SLBSHADOW_STACKESID(r9) /* Clear ESID */ 394 std r12,SLBSHADOW_STACKESID(r9) /* Clear ESID */
392 eieio
393 std r7,SLBSHADOW_STACKVSID(r9) /* Save VSID */ 395 std r7,SLBSHADOW_STACKVSID(r9) /* Save VSID */
394 eieio
395 std r0,SLBSHADOW_STACKESID(r9) /* Save ESID */ 396 std r0,SLBSHADOW_STACKESID(r9) /* Save ESID */
396 eieio
397 397
398 slbie r6 398 slbie r6
399 slbie r6 /* Workaround POWER5 < DD2.1 issue */ 399 slbie r6 /* Workaround POWER5 < DD2.1 issue */
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 7d73a13450b0..c86c626cf156 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -48,20 +48,17 @@
48 mtspr SPRN_DBAT##n##L,RB; \ 48 mtspr SPRN_DBAT##n##L,RB; \
491: 491:
50 50
51 .text 51 .section .text.head, "ax"
52 .stabs "arch/powerpc/kernel/",N_SO,0,0,0f 52 .stabs "arch/powerpc/kernel/",N_SO,0,0,0f
53 .stabs "head_32.S",N_SO,0,0,0f 53 .stabs "head_32.S",N_SO,0,0,0f
540: 540:
55 .globl _stext 55_ENTRY(_stext);
56_stext:
57 56
58/* 57/*
59 * _start is defined this way because the XCOFF loader in the OpenFirmware 58 * _start is defined this way because the XCOFF loader in the OpenFirmware
60 * on the powermac expects the entry point to be a procedure descriptor. 59 * on the powermac expects the entry point to be a procedure descriptor.
61 */ 60 */
62 .text 61_ENTRY(_start);
63 .globl _start
64_start:
65 /* 62 /*
66 * These are here for legacy reasons, the kernel used to 63 * These are here for legacy reasons, the kernel used to
67 * need to look like a coff function entry for the pmac 64 * need to look like a coff function entry for the pmac
@@ -475,10 +472,10 @@ InstructionTLBMiss:
475 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */ 472 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
476 lwz r2,PGDIR(r2) 473 lwz r2,PGDIR(r2)
477 blt+ 112f 474 blt+ 112f
475 mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
476 rlwimi r1,r2,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
478 lis r2,swapper_pg_dir@ha /* if kernel address, use */ 477 lis r2,swapper_pg_dir@ha /* if kernel address, use */
479 addi r2,r2,swapper_pg_dir@l /* kernel page table */ 478 addi r2,r2,swapper_pg_dir@l /* kernel page table */
480 mfspr r1,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
481 rlwinm r1,r1,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
482112: tophys(r2,r2) 479112: tophys(r2,r2)
483 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ 480 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
484 lwz r2,0(r2) /* get pmd entry */ 481 lwz r2,0(r2) /* get pmd entry */
@@ -549,10 +546,10 @@ DataLoadTLBMiss:
549 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */ 546 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
550 lwz r2,PGDIR(r2) 547 lwz r2,PGDIR(r2)
551 blt+ 112f 548 blt+ 112f
549 mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
550 rlwimi r1,r2,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
552 lis r2,swapper_pg_dir@ha /* if kernel address, use */ 551 lis r2,swapper_pg_dir@ha /* if kernel address, use */
553 addi r2,r2,swapper_pg_dir@l /* kernel page table */ 552 addi r2,r2,swapper_pg_dir@l /* kernel page table */
554 mfspr r1,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
555 rlwinm r1,r1,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
556112: tophys(r2,r2) 553112: tophys(r2,r2)
557 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ 554 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
558 lwz r2,0(r2) /* get pmd entry */ 555 lwz r2,0(r2) /* get pmd entry */
@@ -621,10 +618,10 @@ DataStoreTLBMiss:
621 li r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */ 618 li r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */
622 lwz r2,PGDIR(r2) 619 lwz r2,PGDIR(r2)
623 blt+ 112f 620 blt+ 112f
621 mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
622 rlwimi r1,r2,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
624 lis r2,swapper_pg_dir@ha /* if kernel address, use */ 623 lis r2,swapper_pg_dir@ha /* if kernel address, use */
625 addi r2,r2,swapper_pg_dir@l /* kernel page table */ 624 addi r2,r2,swapper_pg_dir@l /* kernel page table */
626 mfspr r1,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
627 rlwinm r1,r1,32-12,29,29 /* shift MSR_PR to _PAGE_USER posn */
628112: tophys(r2,r2) 625112: tophys(r2,r2)
629 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ 626 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
630 lwz r2,0(r2) /* get pmd entry */ 627 lwz r2,0(r2) /* get pmd entry */
@@ -841,7 +838,7 @@ relocate_kernel:
841 * r3 = dest addr, r4 = source addr, r5 = copy limit, r6 = start offset 838 * r3 = dest addr, r4 = source addr, r5 = copy limit, r6 = start offset
842 * on exit, r3, r4, r5 are unchanged, r6 is updated to be >= r5. 839 * on exit, r3, r4, r5 are unchanged, r6 is updated to be >= r5.
843 */ 840 */
844_GLOBAL(copy_and_flush) 841_ENTRY(copy_and_flush)
845 addi r5,r5,-4 842 addi r5,r5,-4
846 addi r6,r6,-4 843 addi r6,r6,-4
8474: li r0,L1_CACHE_BYTES/4 8444: li r0,L1_CACHE_BYTES/4
@@ -954,9 +951,9 @@ __secondary_start:
954 * included in CONFIG_6xx 951 * included in CONFIG_6xx
955 */ 952 */
956#if !defined(CONFIG_6xx) 953#if !defined(CONFIG_6xx)
957_GLOBAL(__save_cpu_setup) 954_ENTRY(__save_cpu_setup)
958 blr 955 blr
959_GLOBAL(__restore_cpu_setup) 956_ENTRY(__restore_cpu_setup)
960 blr 957 blr
961#endif /* !defined(CONFIG_6xx) */ 958#endif /* !defined(CONFIG_6xx) */
962 959
@@ -1080,7 +1077,7 @@ start_here:
1080/* 1077/*
1081 * Set up the segment registers for a new context. 1078 * Set up the segment registers for a new context.
1082 */ 1079 */
1083_GLOBAL(set_context) 1080_ENTRY(set_context)
1084 mulli r3,r3,897 /* multiply context by skew factor */ 1081 mulli r3,r3,897 /* multiply context by skew factor */
1085 rlwinm r3,r3,4,8,27 /* VSID = (context & 0xfffff) << 4 */ 1082 rlwinm r3,r3,4,8,27 /* VSID = (context & 0xfffff) << 4 */
1086 addis r3,r3,0x6000 /* Set Ks, Ku bits */ 1083 addis r3,r3,0x6000 /* Set Ks, Ku bits */
@@ -1300,14 +1297,6 @@ empty_zero_page:
1300swapper_pg_dir: 1297swapper_pg_dir:
1301 .space 4096 1298 .space 4096
1302 1299
1303/*
1304 * This space gets a copy of optional info passed to us by the bootstrap
1305 * Used to pass parameters into the kernel like root=/dev/sda1, etc.
1306 */
1307 .globl cmd_line
1308cmd_line:
1309 .space 512
1310
1311 .globl intercept_table 1300 .globl intercept_table
1312intercept_table: 1301intercept_table:
1313 .long 0, 0, i0x200, i0x300, i0x400, 0, i0x600, i0x700 1302 .long 0, 0, i0x200, i0x300, i0x400, 0, i0x600, i0x700
diff --git a/arch/powerpc/kernel/head_4xx.S b/arch/powerpc/kernel/head_40x.S
index adc7f8097cd4..e312824bdd98 100644
--- a/arch/powerpc/kernel/head_4xx.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -35,7 +35,6 @@
35#include <asm/page.h> 35#include <asm/page.h>
36#include <asm/mmu.h> 36#include <asm/mmu.h>
37#include <asm/pgtable.h> 37#include <asm/pgtable.h>
38#include <asm/ibm4xx.h>
39#include <asm/cputable.h> 38#include <asm/cputable.h>
40#include <asm/thread_info.h> 39#include <asm/thread_info.h>
41#include <asm/ppc_asm.h> 40#include <asm/ppc_asm.h>
@@ -53,9 +52,9 @@
53 * 52 *
54 * This is all going to change RSN when we add bi_recs....... -- Dan 53 * This is all going to change RSN when we add bi_recs....... -- Dan
55 */ 54 */
56 .text 55 .section .text.head, "ax"
57_GLOBAL(_stext) 56_ENTRY(_stext);
58_GLOBAL(_start) 57_ENTRY(_start);
59 58
60 /* Save parameters we are passed. 59 /* Save parameters we are passed.
61 */ 60 */
@@ -90,9 +89,9 @@ turn_on_mmu:
90 */ 89 */
91 . = 0xc0 90 . = 0xc0
92crit_save: 91crit_save:
93_GLOBAL(crit_r10) 92_ENTRY(crit_r10)
94 .space 4 93 .space 4
95_GLOBAL(crit_r11) 94_ENTRY(crit_r11)
96 .space 4 95 .space 4
97 96
98/* 97/*
@@ -772,7 +771,7 @@ finish_tlb_load:
772 */ 771 */
773 lwz r9, tlb_4xx_index@l(0) 772 lwz r9, tlb_4xx_index@l(0)
774 addi r9, r9, 1 773 addi r9, r9, 1
775 andi. r9, r9, (PPC4XX_TLB_SIZE-1) 774 andi. r9, r9, (PPC40X_TLB_SIZE-1)
776 stw r9, tlb_4xx_index@l(0) 775 stw r9, tlb_4xx_index@l(0)
777 776
7786: 7776:
@@ -815,7 +814,7 @@ finish_tlb_load:
815 * The PowerPC 4xx family of processors do not have an FPU, so this just 814 * The PowerPC 4xx family of processors do not have an FPU, so this just
816 * returns. 815 * returns.
817 */ 816 */
818_GLOBAL(giveup_fpu) 817_ENTRY(giveup_fpu)
819 blr 818 blr
820 819
821/* This is where the main kernel code starts. 820/* This is where the main kernel code starts.
@@ -1007,13 +1006,6 @@ critical_stack_top:
1007 .globl exception_stack_top 1006 .globl exception_stack_top
1008exception_stack_top: 1007exception_stack_top:
1009 1008
1010/* This space gets a copy of optional info passed to us by the bootstrap
1011 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
1012 */
1013 .globl cmd_line
1014cmd_line:
1015 .space 512
1016
1017/* Room for two PTE pointers, usually the kernel and current user pointers 1009/* Room for two PTE pointers, usually the kernel and current user pointers
1018 * to their respective root page table. 1010 * to their respective root page table.
1019 */ 1011 */
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index 88695963f587..c6a510bdefd4 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -50,9 +50,9 @@
50 * r7 - End of kernel command line string 50 * r7 - End of kernel command line string
51 * 51 *
52 */ 52 */
53 .text 53 .section .text.head, "ax"
54_GLOBAL(_stext) 54_ENTRY(_stext);
55_GLOBAL(_start) 55_ENTRY(_start);
56 /* 56 /*
57 * Reserve a word at a fixed location to store the address 57 * Reserve a word at a fixed location to store the address
58 * of abatron_pteptrs 58 * of abatron_pteptrs
@@ -217,7 +217,7 @@ skpinv: addi r4,r4,1 /* Increment */
217 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ 217 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
218 mtspr SPRN_IVPR,r4 218 mtspr SPRN_IVPR,r4
219 219
220#ifdef CONFIG_440EP 220#if defined(CONFIG_440EP) || defined(CONFIG_440EPX)
221 /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */ 221 /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */
222 mfspr r2,SPRN_CCR0 222 mfspr r2,SPRN_CCR0
223 lis r3,0xffef 223 lis r3,0xffef
@@ -744,14 +744,6 @@ exception_stack_bottom:
744exception_stack_top: 744exception_stack_top:
745 745
746/* 746/*
747 * This space gets a copy of optional info passed to us by the bootstrap
748 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
749 */
750 .globl cmd_line
751cmd_line:
752 .space 512
753
754/*
755 * Room for two PTE pointers, usually the kernel and current user pointers 747 * Room for two PTE pointers, usually the kernel and current user pointers
756 * to their respective root page table. 748 * to their respective root page table.
757 */ 749 */
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 171800002ede..22ac245bd59a 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -34,6 +34,8 @@
34#include <asm/iseries/lpar_map.h> 34#include <asm/iseries/lpar_map.h>
35#include <asm/thread_info.h> 35#include <asm/thread_info.h>
36#include <asm/firmware.h> 36#include <asm/firmware.h>
37#include <asm/page_64.h>
38#include <asm/exception.h>
37 39
38#define DO_SOFT_DISABLE 40#define DO_SOFT_DISABLE
39 41
@@ -144,344 +146,9 @@ exception_marker:
144 .text 146 .text
145 147
146/* 148/*
147 * The following macros define the code that appears as
148 * the prologue to each of the exception handlers. They
149 * are split into two parts to allow a single kernel binary
150 * to be used for pSeries and iSeries.
151 * LOL. One day... - paulus
152 */
153
154/*
155 * We make as much of the exception code common between native
156 * exception handlers (including pSeries LPAR) and iSeries LPAR
157 * implementations as possible.
158 */
159
160/*
161 * This is the start of the interrupt handlers for pSeries 149 * This is the start of the interrupt handlers for pSeries
162 * This code runs with relocation off. 150 * This code runs with relocation off.
163 */ 151 */
164#define EX_R9 0
165#define EX_R10 8
166#define EX_R11 16
167#define EX_R12 24
168#define EX_R13 32
169#define EX_SRR0 40
170#define EX_DAR 48
171#define EX_DSISR 56
172#define EX_CCR 60
173#define EX_R3 64
174#define EX_LR 72
175
176/*
177 * We're short on space and time in the exception prolog, so we can't
178 * use the normal SET_REG_IMMEDIATE macro. Normally we just need the
179 * low halfword of the address, but for Kdump we need the whole low
180 * word.
181 */
182#ifdef CONFIG_CRASH_DUMP
183#define LOAD_HANDLER(reg, label) \
184 oris reg,reg,(label)@h; /* virt addr of handler ... */ \
185 ori reg,reg,(label)@l; /* .. and the rest */
186#else
187#define LOAD_HANDLER(reg, label) \
188 ori reg,reg,(label)@l; /* virt addr of handler ... */
189#endif
190
191/*
192 * Equal to EXCEPTION_PROLOG_PSERIES, except that it forces 64bit mode.
193 * The firmware calls the registered system_reset_fwnmi and
194 * machine_check_fwnmi handlers in 32bit mode if the cpu happens to run
195 * a 32bit application at the time of the event.
196 * This firmware bug is present on POWER4 and JS20.
197 */
198#define EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(area, label) \
199 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
200 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
201 std r10,area+EX_R10(r13); \
202 std r11,area+EX_R11(r13); \
203 std r12,area+EX_R12(r13); \
204 mfspr r9,SPRN_SPRG1; \
205 std r9,area+EX_R13(r13); \
206 mfcr r9; \
207 clrrdi r12,r13,32; /* get high part of &label */ \
208 mfmsr r10; \
209 /* force 64bit mode */ \
210 li r11,5; /* MSR_SF_LG|MSR_ISF_LG */ \
211 rldimi r10,r11,61,0; /* insert into top 3 bits */ \
212 /* done 64bit mode */ \
213 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
214 LOAD_HANDLER(r12,label) \
215 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
216 mtspr SPRN_SRR0,r12; \
217 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
218 mtspr SPRN_SRR1,r10; \
219 rfid; \
220 b . /* prevent speculative execution */
221
222#define EXCEPTION_PROLOG_PSERIES(area, label) \
223 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
224 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
225 std r10,area+EX_R10(r13); \
226 std r11,area+EX_R11(r13); \
227 std r12,area+EX_R12(r13); \
228 mfspr r9,SPRN_SPRG1; \
229 std r9,area+EX_R13(r13); \
230 mfcr r9; \
231 clrrdi r12,r13,32; /* get high part of &label */ \
232 mfmsr r10; \
233 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
234 LOAD_HANDLER(r12,label) \
235 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
236 mtspr SPRN_SRR0,r12; \
237 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
238 mtspr SPRN_SRR1,r10; \
239 rfid; \
240 b . /* prevent speculative execution */
241
242/*
243 * This is the start of the interrupt handlers for iSeries
244 * This code runs with relocation on.
245 */
246#define EXCEPTION_PROLOG_ISERIES_1(area) \
247 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
248 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
249 std r10,area+EX_R10(r13); \
250 std r11,area+EX_R11(r13); \
251 std r12,area+EX_R12(r13); \
252 mfspr r9,SPRN_SPRG1; \
253 std r9,area+EX_R13(r13); \
254 mfcr r9
255
256#define EXCEPTION_PROLOG_ISERIES_2 \
257 mfmsr r10; \
258 ld r12,PACALPPACAPTR(r13); \
259 ld r11,LPPACASRR0(r12); \
260 ld r12,LPPACASRR1(r12); \
261 ori r10,r10,MSR_RI; \
262 mtmsrd r10,1
263
264/*
265 * The common exception prolog is used for all except a few exceptions
266 * such as a segment miss on a kernel address. We have to be prepared
267 * to take another exception from the point where we first touch the
268 * kernel stack onwards.
269 *
270 * On entry r13 points to the paca, r9-r13 are saved in the paca,
271 * r9 contains the saved CR, r11 and r12 contain the saved SRR0 and
272 * SRR1, and relocation is on.
273 */
274#define EXCEPTION_PROLOG_COMMON(n, area) \
275 andi. r10,r12,MSR_PR; /* See if coming from user */ \
276 mr r10,r1; /* Save r1 */ \
277 subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \
278 beq- 1f; \
279 ld r1,PACAKSAVE(r13); /* kernel stack to use */ \
2801: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \
281 bge- cr1,2f; /* abort if it is */ \
282 b 3f; \
2832: li r1,(n); /* will be reloaded later */ \
284 sth r1,PACA_TRAP_SAVE(r13); \
285 b bad_stack; \
2863: std r9,_CCR(r1); /* save CR in stackframe */ \
287 std r11,_NIP(r1); /* save SRR0 in stackframe */ \
288 std r12,_MSR(r1); /* save SRR1 in stackframe */ \
289 std r10,0(r1); /* make stack chain pointer */ \
290 std r0,GPR0(r1); /* save r0 in stackframe */ \
291 std r10,GPR1(r1); /* save r1 in stackframe */ \
292 ACCOUNT_CPU_USER_ENTRY(r9, r10); \
293 std r2,GPR2(r1); /* save r2 in stackframe */ \
294 SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \
295 SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \
296 ld r9,area+EX_R9(r13); /* move r9, r10 to stackframe */ \
297 ld r10,area+EX_R10(r13); \
298 std r9,GPR9(r1); \
299 std r10,GPR10(r1); \
300 ld r9,area+EX_R11(r13); /* move r11 - r13 to stackframe */ \
301 ld r10,area+EX_R12(r13); \
302 ld r11,area+EX_R13(r13); \
303 std r9,GPR11(r1); \
304 std r10,GPR12(r1); \
305 std r11,GPR13(r1); \
306 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \
307 mflr r9; /* save LR in stackframe */ \
308 std r9,_LINK(r1); \
309 mfctr r10; /* save CTR in stackframe */ \
310 std r10,_CTR(r1); \
311 lbz r10,PACASOFTIRQEN(r13); \
312 mfspr r11,SPRN_XER; /* save XER in stackframe */ \
313 std r10,SOFTE(r1); \
314 std r11,_XER(r1); \
315 li r9,(n)+1; \
316 std r9,_TRAP(r1); /* set trap number */ \
317 li r10,0; \
318 ld r11,exception_marker@toc(r2); \
319 std r10,RESULT(r1); /* clear regs->result */ \
320 std r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */
321
322/*
323 * Exception vectors.
324 */
325#define STD_EXCEPTION_PSERIES(n, label) \
326 . = n; \
327 .globl label##_pSeries; \
328label##_pSeries: \
329 HMT_MEDIUM; \
330 mtspr SPRN_SPRG1,r13; /* save r13 */ \
331 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
332
333#define HSTD_EXCEPTION_PSERIES(n, label) \
334 . = n; \
335 .globl label##_pSeries; \
336label##_pSeries: \
337 HMT_MEDIUM; \
338 mtspr SPRN_SPRG1,r20; /* save r20 */ \
339 mfspr r20,SPRN_HSRR0; /* copy HSRR0 to SRR0 */ \
340 mtspr SPRN_SRR0,r20; \
341 mfspr r20,SPRN_HSRR1; /* copy HSRR0 to SRR0 */ \
342 mtspr SPRN_SRR1,r20; \
343 mfspr r20,SPRN_SPRG1; /* restore r20 */ \
344 mtspr SPRN_SPRG1,r13; /* save r13 */ \
345 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
346
347
348#define MASKABLE_EXCEPTION_PSERIES(n, label) \
349 . = n; \
350 .globl label##_pSeries; \
351label##_pSeries: \
352 HMT_MEDIUM; \
353 mtspr SPRN_SPRG1,r13; /* save r13 */ \
354 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
355 std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \
356 std r10,PACA_EXGEN+EX_R10(r13); \
357 lbz r10,PACASOFTIRQEN(r13); \
358 mfcr r9; \
359 cmpwi r10,0; \
360 beq masked_interrupt; \
361 mfspr r10,SPRN_SPRG1; \
362 std r10,PACA_EXGEN+EX_R13(r13); \
363 std r11,PACA_EXGEN+EX_R11(r13); \
364 std r12,PACA_EXGEN+EX_R12(r13); \
365 clrrdi r12,r13,32; /* get high part of &label */ \
366 mfmsr r10; \
367 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
368 LOAD_HANDLER(r12,label##_common) \
369 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
370 mtspr SPRN_SRR0,r12; \
371 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
372 mtspr SPRN_SRR1,r10; \
373 rfid; \
374 b . /* prevent speculative execution */
375
376#define STD_EXCEPTION_ISERIES(n, label, area) \
377 .globl label##_iSeries; \
378label##_iSeries: \
379 HMT_MEDIUM; \
380 mtspr SPRN_SPRG1,r13; /* save r13 */ \
381 EXCEPTION_PROLOG_ISERIES_1(area); \
382 EXCEPTION_PROLOG_ISERIES_2; \
383 b label##_common
384
385#define MASKABLE_EXCEPTION_ISERIES(n, label) \
386 .globl label##_iSeries; \
387label##_iSeries: \
388 HMT_MEDIUM; \
389 mtspr SPRN_SPRG1,r13; /* save r13 */ \
390 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \
391 lbz r10,PACASOFTIRQEN(r13); \
392 cmpwi 0,r10,0; \
393 beq- label##_iSeries_masked; \
394 EXCEPTION_PROLOG_ISERIES_2; \
395 b label##_common; \
396
397#ifdef CONFIG_PPC_ISERIES
398#define DISABLE_INTS \
399 li r11,0; \
400 stb r11,PACASOFTIRQEN(r13); \
401BEGIN_FW_FTR_SECTION; \
402 stb r11,PACAHARDIRQEN(r13); \
403END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \
404BEGIN_FW_FTR_SECTION; \
405 mfmsr r10; \
406 ori r10,r10,MSR_EE; \
407 mtmsrd r10,1; \
408END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
409
410#else
411#define DISABLE_INTS \
412 li r11,0; \
413 stb r11,PACASOFTIRQEN(r13); \
414 stb r11,PACAHARDIRQEN(r13)
415
416#endif /* CONFIG_PPC_ISERIES */
417
418#define ENABLE_INTS \
419 ld r12,_MSR(r1); \
420 mfmsr r11; \
421 rlwimi r11,r12,0,MSR_EE; \
422 mtmsrd r11,1
423
424#define STD_EXCEPTION_COMMON(trap, label, hdlr) \
425 .align 7; \
426 .globl label##_common; \
427label##_common: \
428 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
429 DISABLE_INTS; \
430 bl .save_nvgprs; \
431 addi r3,r1,STACK_FRAME_OVERHEAD; \
432 bl hdlr; \
433 b .ret_from_except
434
435/*
436 * Like STD_EXCEPTION_COMMON, but for exceptions that can occur
437 * in the idle task and therefore need the special idle handling.
438 */
439#define STD_EXCEPTION_COMMON_IDLE(trap, label, hdlr) \
440 .align 7; \
441 .globl label##_common; \
442label##_common: \
443 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
444 FINISH_NAP; \
445 DISABLE_INTS; \
446 bl .save_nvgprs; \
447 addi r3,r1,STACK_FRAME_OVERHEAD; \
448 bl hdlr; \
449 b .ret_from_except
450
451#define STD_EXCEPTION_COMMON_LITE(trap, label, hdlr) \
452 .align 7; \
453 .globl label##_common; \
454label##_common: \
455 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
456 FINISH_NAP; \
457 DISABLE_INTS; \
458 bl .ppc64_runlatch_on; \
459 addi r3,r1,STACK_FRAME_OVERHEAD; \
460 bl hdlr; \
461 b .ret_from_except_lite
462
463/*
464 * When the idle code in power4_idle puts the CPU into NAP mode,
465 * it has to do so in a loop, and relies on the external interrupt
466 * and decrementer interrupt entry code to get it out of the loop.
467 * It sets the _TLF_NAPPING bit in current_thread_info()->local_flags
468 * to signal that it is in the loop and needs help to get out.
469 */
470#ifdef CONFIG_PPC_970_NAP
471#define FINISH_NAP \
472BEGIN_FTR_SECTION \
473 clrrdi r11,r1,THREAD_SHIFT; \
474 ld r9,TI_LOCAL_FLAGS(r11); \
475 andi. r10,r9,_TLF_NAPPING; \
476 bnel power4_fixup_nap; \
477END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
478#else
479#define FINISH_NAP
480#endif
481
482/*
483 * Start of pSeries system interrupt routines
484 */
485 . = 0x100 152 . = 0x100
486 .globl __start_interrupts 153 .globl __start_interrupts
487__start_interrupts: 154__start_interrupts:
@@ -674,6 +341,7 @@ slb_miss_user_pseries:
674 b . /* prevent spec. execution */ 341 b . /* prevent spec. execution */
675#endif /* __DISABLED__ */ 342#endif /* __DISABLED__ */
676 343
344#ifdef CONFIG_PPC_PSERIES
677/* 345/*
678 * Vectors for the FWNMI option. Share common code. 346 * Vectors for the FWNMI option. Share common code.
679 */ 347 */
@@ -691,191 +359,7 @@ machine_check_fwnmi:
691 mtspr SPRN_SPRG1,r13 /* save r13 */ 359 mtspr SPRN_SPRG1,r13 /* save r13 */
692 EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXMC, machine_check_common) 360 EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(PACA_EXMC, machine_check_common)
693 361
694#ifdef CONFIG_PPC_ISERIES 362#endif /* CONFIG_PPC_PSERIES */
695/*** ISeries-LPAR interrupt handlers ***/
696
697 STD_EXCEPTION_ISERIES(0x200, machine_check, PACA_EXMC)
698
699 .globl data_access_iSeries
700data_access_iSeries:
701 mtspr SPRN_SPRG1,r13
702BEGIN_FTR_SECTION
703 mtspr SPRN_SPRG2,r12
704 mfspr r13,SPRN_DAR
705 mfspr r12,SPRN_DSISR
706 srdi r13,r13,60
707 rlwimi r13,r12,16,0x20
708 mfcr r12
709 cmpwi r13,0x2c
710 beq .do_stab_bolted_iSeries
711 mtcrf 0x80,r12
712 mfspr r12,SPRN_SPRG2
713END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
714 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN)
715 EXCEPTION_PROLOG_ISERIES_2
716 b data_access_common
717
718.do_stab_bolted_iSeries:
719 mtcrf 0x80,r12
720 mfspr r12,SPRN_SPRG2
721 EXCEPTION_PROLOG_ISERIES_1(PACA_EXSLB)
722 EXCEPTION_PROLOG_ISERIES_2
723 b .do_stab_bolted
724
725 .globl data_access_slb_iSeries
726data_access_slb_iSeries:
727 mtspr SPRN_SPRG1,r13 /* save r13 */
728 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
729 std r3,PACA_EXSLB+EX_R3(r13)
730 mfspr r3,SPRN_DAR
731 std r9,PACA_EXSLB+EX_R9(r13)
732 mfcr r9
733#ifdef __DISABLED__
734 cmpdi r3,0
735 bge slb_miss_user_iseries
736#endif
737 std r10,PACA_EXSLB+EX_R10(r13)
738 std r11,PACA_EXSLB+EX_R11(r13)
739 std r12,PACA_EXSLB+EX_R12(r13)
740 mfspr r10,SPRN_SPRG1
741 std r10,PACA_EXSLB+EX_R13(r13)
742 ld r12,PACALPPACAPTR(r13)
743 ld r12,LPPACASRR1(r12)
744 b .slb_miss_realmode
745
746 STD_EXCEPTION_ISERIES(0x400, instruction_access, PACA_EXGEN)
747
748 .globl instruction_access_slb_iSeries
749instruction_access_slb_iSeries:
750 mtspr SPRN_SPRG1,r13 /* save r13 */
751 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
752 std r3,PACA_EXSLB+EX_R3(r13)
753 ld r3,PACALPPACAPTR(r13)
754 ld r3,LPPACASRR0(r3) /* get SRR0 value */
755 std r9,PACA_EXSLB+EX_R9(r13)
756 mfcr r9
757#ifdef __DISABLED__
758 cmpdi r3,0
759 bge .slb_miss_user_iseries
760#endif
761 std r10,PACA_EXSLB+EX_R10(r13)
762 std r11,PACA_EXSLB+EX_R11(r13)
763 std r12,PACA_EXSLB+EX_R12(r13)
764 mfspr r10,SPRN_SPRG1
765 std r10,PACA_EXSLB+EX_R13(r13)
766 ld r12,PACALPPACAPTR(r13)
767 ld r12,LPPACASRR1(r12)
768 b .slb_miss_realmode
769
770#ifdef __DISABLED__
771slb_miss_user_iseries:
772 std r10,PACA_EXGEN+EX_R10(r13)
773 std r11,PACA_EXGEN+EX_R11(r13)
774 std r12,PACA_EXGEN+EX_R12(r13)
775 mfspr r10,SPRG1
776 ld r11,PACA_EXSLB+EX_R9(r13)
777 ld r12,PACA_EXSLB+EX_R3(r13)
778 std r10,PACA_EXGEN+EX_R13(r13)
779 std r11,PACA_EXGEN+EX_R9(r13)
780 std r12,PACA_EXGEN+EX_R3(r13)
781 EXCEPTION_PROLOG_ISERIES_2
782 b slb_miss_user_common
783#endif
784
785 MASKABLE_EXCEPTION_ISERIES(0x500, hardware_interrupt)
786 STD_EXCEPTION_ISERIES(0x600, alignment, PACA_EXGEN)
787 STD_EXCEPTION_ISERIES(0x700, program_check, PACA_EXGEN)
788 STD_EXCEPTION_ISERIES(0x800, fp_unavailable, PACA_EXGEN)
789 MASKABLE_EXCEPTION_ISERIES(0x900, decrementer)
790 STD_EXCEPTION_ISERIES(0xa00, trap_0a, PACA_EXGEN)
791 STD_EXCEPTION_ISERIES(0xb00, trap_0b, PACA_EXGEN)
792
793 .globl system_call_iSeries
794system_call_iSeries:
795 mr r9,r13
796 mfspr r13,SPRN_SPRG3
797 EXCEPTION_PROLOG_ISERIES_2
798 b system_call_common
799
800 STD_EXCEPTION_ISERIES( 0xd00, single_step, PACA_EXGEN)
801 STD_EXCEPTION_ISERIES( 0xe00, trap_0e, PACA_EXGEN)
802 STD_EXCEPTION_ISERIES( 0xf00, performance_monitor, PACA_EXGEN)
803
804 .globl system_reset_iSeries
805system_reset_iSeries:
806 mfspr r13,SPRN_SPRG3 /* Get paca address */
807 mfmsr r24
808 ori r24,r24,MSR_RI
809 mtmsrd r24 /* RI on */
810 lhz r24,PACAPACAINDEX(r13) /* Get processor # */
811 cmpwi 0,r24,0 /* Are we processor 0? */
812 bne 1f
813 b .__start_initialization_iSeries /* Start up the first processor */
8141: mfspr r4,SPRN_CTRLF
815 li r5,CTRL_RUNLATCH /* Turn off the run light */
816 andc r4,r4,r5
817 mtspr SPRN_CTRLT,r4
818
8191:
820 HMT_LOW
821#ifdef CONFIG_SMP
822 lbz r23,PACAPROCSTART(r13) /* Test if this processor
823 * should start */
824 sync
825 LOAD_REG_IMMEDIATE(r3,current_set)
826 sldi r28,r24,3 /* get current_set[cpu#] */
827 ldx r3,r3,r28
828 addi r1,r3,THREAD_SIZE
829 subi r1,r1,STACK_FRAME_OVERHEAD
830
831 cmpwi 0,r23,0
832 beq iSeries_secondary_smp_loop /* Loop until told to go */
833 bne __secondary_start /* Loop until told to go */
834iSeries_secondary_smp_loop:
835 /* Let the Hypervisor know we are alive */
836 /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
837 lis r3,0x8002
838 rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */
839#else /* CONFIG_SMP */
840 /* Yield the processor. This is required for non-SMP kernels
841 which are running on multi-threaded machines. */
842 lis r3,0x8000
843 rldicr r3,r3,32,15 /* r3 = (r3 << 32) & 0xffff000000000000 */
844 addi r3,r3,18 /* r3 = 0x8000000000000012 which is "yield" */
845 li r4,0 /* "yield timed" */
846 li r5,-1 /* "yield forever" */
847#endif /* CONFIG_SMP */
848 li r0,-1 /* r0=-1 indicates a Hypervisor call */
849 sc /* Invoke the hypervisor via a system call */
850 mfspr r13,SPRN_SPRG3 /* Put r13 back ???? */
851 b 1b /* If SMP not configured, secondaries
852 * loop forever */
853
854decrementer_iSeries_masked:
855 /* We may not have a valid TOC pointer in here. */
856 li r11,1
857 ld r12,PACALPPACAPTR(r13)
858 stb r11,LPPACADECRINT(r12)
859 LOAD_REG_IMMEDIATE(r12, tb_ticks_per_jiffy)
860 lwz r12,0(r12)
861 mtspr SPRN_DEC,r12
862 /* fall through */
863
864hardware_interrupt_iSeries_masked:
865 mtcrf 0x80,r9 /* Restore regs */
866 ld r12,PACALPPACAPTR(r13)
867 ld r11,LPPACASRR0(r12)
868 ld r12,LPPACASRR1(r12)
869 mtspr SPRN_SRR0,r11
870 mtspr SPRN_SRR1,r12
871 ld r9,PACA_EXGEN+EX_R9(r13)
872 ld r10,PACA_EXGEN+EX_R10(r13)
873 ld r11,PACA_EXGEN+EX_R11(r13)
874 ld r12,PACA_EXGEN+EX_R12(r13)
875 ld r13,PACA_EXGEN+EX_R13(r13)
876 rfid
877 b . /* prevent speculative execution */
878#endif /* CONFIG_PPC_ISERIES */
879 363
880/*** Common interrupt handlers ***/ 364/*** Common interrupt handlers ***/
881 365
@@ -1175,7 +659,9 @@ hardware_interrupt_common:
1175 FINISH_NAP 659 FINISH_NAP
1176hardware_interrupt_entry: 660hardware_interrupt_entry:
1177 DISABLE_INTS 661 DISABLE_INTS
662BEGIN_FTR_SECTION
1178 bl .ppc64_runlatch_on 663 bl .ppc64_runlatch_on
664END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
1179 addi r3,r1,STACK_FRAME_OVERHEAD 665 addi r3,r1,STACK_FRAME_OVERHEAD
1180 bl .do_IRQ 666 bl .do_IRQ
1181 b .ret_from_except_lite 667 b .ret_from_except_lite
@@ -1519,8 +1005,8 @@ _GLOBAL(do_stab_bolted)
1519 * Space for CPU0's segment table. 1005 * Space for CPU0's segment table.
1520 * 1006 *
1521 * On iSeries, the hypervisor must fill in at least one entry before 1007 * On iSeries, the hypervisor must fill in at least one entry before
1522 * we get control (with relocate on). The address is give to the hv 1008 * we get control (with relocate on). The address is given to the hv
1523 * as a page number (see xLparMap in lpardata.c), so this must be at a 1009 * as a page number (see xLparMap below), so this must be at a
1524 * fixed address (the linker can't compute (u64)&initial_stab >> 1010 * fixed address (the linker can't compute (u64)&initial_stab >>
1525 * PAGE_SHIFT). 1011 * PAGE_SHIFT).
1526 */ 1012 */
@@ -1529,6 +1015,7 @@ _GLOBAL(do_stab_bolted)
1529initial_stab: 1015initial_stab:
1530 .space 4096 1016 .space 4096
1531 1017
1018#ifdef CONFIG_PPC_PSERIES
1532/* 1019/*
1533 * Data area reserved for FWNMI option. 1020 * Data area reserved for FWNMI option.
1534 * This address (0x7000) is fixed by the RPA. 1021 * This address (0x7000) is fixed by the RPA.
@@ -1536,21 +1023,34 @@ initial_stab:
1536 .= 0x7000 1023 .= 0x7000
1537 .globl fwnmi_data_area 1024 .globl fwnmi_data_area
1538fwnmi_data_area: 1025fwnmi_data_area:
1026#endif /* CONFIG_PPC_PSERIES */
1539 1027
1540 /* iSeries does not use the FWNMI stuff, so it is safe to put 1028 /* iSeries does not use the FWNMI stuff, so it is safe to put
1541 * this here, even if we later allow kernels that will boot on 1029 * this here, even if we later allow kernels that will boot on
1542 * both pSeries and iSeries */ 1030 * both pSeries and iSeries */
1543#ifdef CONFIG_PPC_ISERIES 1031#ifdef CONFIG_PPC_ISERIES
1544 . = LPARMAP_PHYS 1032 . = LPARMAP_PHYS
1545#include "lparmap.s" 1033 .globl xLparMap
1546/* 1034xLparMap:
1547 * This ".text" is here for old compilers that generate a trailing 1035 .quad HvEsidsToMap /* xNumberEsids */
1548 * .note section when compiling .c files to .s 1036 .quad HvRangesToMap /* xNumberRanges */
1549 */ 1037 .quad STAB0_PAGE /* xSegmentTableOffs */
1550 .text 1038 .zero 40 /* xRsvd */
1039 /* xEsids (HvEsidsToMap entries of 2 quads) */
1040 .quad PAGE_OFFSET_ESID /* xKernelEsid */
1041 .quad PAGE_OFFSET_VSID /* xKernelVsid */
1042 .quad VMALLOC_START_ESID /* xKernelEsid */
1043 .quad VMALLOC_START_VSID /* xKernelVsid */
1044 /* xRanges (HvRangesToMap entries of 3 quads) */
1045 .quad HvPagesToMap /* xPages */
1046 .quad 0 /* xOffset */
1047 .quad PAGE_OFFSET_VSID << (SID_SHIFT - HW_PAGE_SHIFT) /* xVPN */
1048
1551#endif /* CONFIG_PPC_ISERIES */ 1049#endif /* CONFIG_PPC_ISERIES */
1552 1050
1051#ifdef CONFIG_PPC_PSERIES
1553 . = 0x8000 1052 . = 0x8000
1053#endif /* CONFIG_PPC_PSERIES */
1554 1054
1555/* 1055/*
1556 * On pSeries and most other platforms, secondary processors spin 1056 * On pSeries and most other platforms, secondary processors spin
@@ -1611,39 +1111,6 @@ _GLOBAL(generic_secondary_smp_init)
1611 b __secondary_start 1111 b __secondary_start
1612#endif 1112#endif
1613 1113
1614#ifdef CONFIG_PPC_ISERIES
1615_INIT_STATIC(__start_initialization_iSeries)
1616 /* Clear out the BSS */
1617 LOAD_REG_IMMEDIATE(r11,__bss_stop)
1618 LOAD_REG_IMMEDIATE(r8,__bss_start)
1619 sub r11,r11,r8 /* bss size */
1620 addi r11,r11,7 /* round up to an even double word */
1621 rldicl. r11,r11,61,3 /* shift right by 3 */
1622 beq 4f
1623 addi r8,r8,-8
1624 li r0,0
1625 mtctr r11 /* zero this many doublewords */
16263: stdu r0,8(r8)
1627 bdnz 3b
16284:
1629 LOAD_REG_IMMEDIATE(r1,init_thread_union)
1630 addi r1,r1,THREAD_SIZE
1631 li r0,0
1632 stdu r0,-STACK_FRAME_OVERHEAD(r1)
1633
1634 LOAD_REG_IMMEDIATE(r2,__toc_start)
1635 addi r2,r2,0x4000
1636 addi r2,r2,0x4000
1637
1638 bl .iSeries_early_setup
1639 bl .early_setup
1640
1641 /* relocation is on at this point */
1642
1643 b .start_here_common
1644#endif /* CONFIG_PPC_ISERIES */
1645
1646
1647_STATIC(__mmu_off) 1114_STATIC(__mmu_off)
1648 mfmsr r3 1115 mfmsr r3
1649 andi. r0,r3,MSR_IR|MSR_DR 1116 andi. r0,r3,MSR_IR|MSR_DR
@@ -1891,6 +1358,7 @@ _GLOBAL(pmac_secondary_start)
1891 * r13 = paca virtual address 1358 * r13 = paca virtual address
1892 * SPRG3 = paca virtual address 1359 * SPRG3 = paca virtual address
1893 */ 1360 */
1361 .globl __secondary_start
1894__secondary_start: 1362__secondary_start:
1895 /* Set thread priority to MEDIUM */ 1363 /* Set thread priority to MEDIUM */
1896 HMT_MEDIUM 1364 HMT_MEDIUM
@@ -2021,7 +1489,7 @@ _INIT_STATIC(start_here_multiplatform)
2021 b . /* prevent speculative execution */ 1489 b . /* prevent speculative execution */
2022 1490
2023 /* This is where all platforms converge execution */ 1491 /* This is where all platforms converge execution */
2024_INIT_STATIC(start_here_common) 1492_INIT_GLOBAL(start_here_common)
2025 /* relocation is on at this point */ 1493 /* relocation is on at this point */
2026 1494
2027 /* The following code sets up the SP and TOC now that we are */ 1495 /* The following code sets up the SP and TOC now that we are */
@@ -2078,12 +1546,4 @@ empty_zero_page:
2078 1546
2079 .globl swapper_pg_dir 1547 .globl swapper_pg_dir
2080swapper_pg_dir: 1548swapper_pg_dir:
2081 .space PAGE_SIZE 1549 .space PGD_TABLE_SIZE
2082
2083/*
2084 * This space gets a copy of optional info passed to us by the bootstrap
2085 * Used to pass parameters into the kernel like root=/dev/sda1, etc.
2086 */
2087 .globl cmd_line
2088cmd_line:
2089 .space COMMAND_LINE_SIZE
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 901be47a02a9..96cea8e753c4 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -38,12 +38,9 @@
38#else 38#else
39#define DO_8xx_CPU6(val, reg) 39#define DO_8xx_CPU6(val, reg)
40#endif 40#endif
41 .text 41 .section .text.head, "ax"
42 .globl _stext 42_ENTRY(_stext);
43_stext: 43_ENTRY(_start);
44 .text
45 .globl _start
46_start:
47 44
48/* MPC8xx 45/* MPC8xx
49 * This port was done on an MBX board with an 860. Right now I only 46 * This port was done on an MBX board with an 860. Right now I only
@@ -835,14 +832,6 @@ empty_zero_page:
835swapper_pg_dir: 832swapper_pg_dir:
836 .space 4096 833 .space 4096
837 834
838/*
839 * This space gets a copy of optional info passed to us by the bootstrap
840 * Used to pass parameters into the kernel like root=/dev/sda1, etc.
841 */
842 .globl cmd_line
843cmd_line:
844 .space 512
845
846/* Room for two PTE table poiners, usually the kernel and current user 835/* Room for two PTE table poiners, usually the kernel and current user
847 * pointer to their respective root page table (pgdir). 836 * pointer to their respective root page table (pgdir).
848 */ 837 */
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 1f155d399d57..bfc38703a8ac 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -52,9 +52,9 @@
52 * r7 - End of kernel command line string 52 * r7 - End of kernel command line string
53 * 53 *
54 */ 54 */
55 .text 55 .section .text.head, "ax"
56_GLOBAL(_stext) 56_ENTRY(_stext);
57_GLOBAL(_start) 57_ENTRY(_start);
58 /* 58 /*
59 * Reserve a word at a fixed location to store the address 59 * Reserve a word at a fixed location to store the address
60 * of abatron_pteptrs 60 * of abatron_pteptrs
@@ -1050,14 +1050,6 @@ exception_stack_bottom:
1050exception_stack_top: 1050exception_stack_top:
1051 1051
1052/* 1052/*
1053 * This space gets a copy of optional info passed to us by the bootstrap
1054 * which is used to pass parameters into the kernel like root=/dev/sda1, etc.
1055 */
1056 .globl cmd_line
1057cmd_line:
1058 .space 512
1059
1060/*
1061 * Room for two PTE pointers, usually the kernel and current user pointers 1053 * Room for two PTE pointers, usually the kernel and current user pointers
1062 * to their respective root page table. 1054 * to their respective root page table.
1063 */ 1055 */
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index d6a38cd5018e..53bf64623bd8 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -371,7 +371,8 @@ static int ibmebus_match_path(struct device *dev, void *data)
371 371
372static char *ibmebus_chomp(const char *in, size_t count) 372static char *ibmebus_chomp(const char *in, size_t count)
373{ 373{
374 char *out = (char*)kmalloc(count + 1, GFP_KERNEL); 374 char *out = kmalloc(count + 1, GFP_KERNEL);
375
375 if (!out) 376 if (!out)
376 return NULL; 377 return NULL;
377 378
@@ -396,10 +397,10 @@ static ssize_t ibmebus_store_probe(struct bus_type *bus,
396 return -ENOMEM; 397 return -ENOMEM;
397 398
398 if (bus_find_device(&ibmebus_bus_type, NULL, path, 399 if (bus_find_device(&ibmebus_bus_type, NULL, path,
399 ibmebus_match_path)) { 400 ibmebus_match_path)) {
400 printk(KERN_WARNING "%s: %s has already been probed\n", 401 printk(KERN_WARNING "%s: %s has already been probed\n",
401 __FUNCTION__, path); 402 __FUNCTION__, path);
402 rc = -EINVAL; 403 rc = -EEXIST;
403 goto out; 404 goto out;
404 } 405 }
405 406
diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c
index 2a5cf8680370..1577434f4088 100644
--- a/arch/powerpc/kernel/iomap.c
+++ b/arch/powerpc/kernel/iomap.c
@@ -119,8 +119,8 @@ EXPORT_SYMBOL(ioport_unmap);
119 119
120void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max) 120void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
121{ 121{
122 unsigned long start = pci_resource_start(dev, bar); 122 resource_size_t start = pci_resource_start(dev, bar);
123 unsigned long len = pci_resource_len(dev, bar); 123 resource_size_t len = pci_resource_len(dev, bar);
124 unsigned long flags = pci_resource_flags(dev, bar); 124 unsigned long flags = pci_resource_flags(dev, bar);
125 125
126 if (!len) 126 if (!len)
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index c08ceca6277d..e4ec6eee81a8 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -30,7 +30,6 @@
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <linux/string.h> 31#include <linux/string.h>
32#include <linux/dma-mapping.h> 32#include <linux/dma-mapping.h>
33#include <linux/init.h>
34#include <linux/bitops.h> 33#include <linux/bitops.h>
35#include <asm/io.h> 34#include <asm/io.h>
36#include <asm/prom.h> 35#include <asm/prom.h>
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 24bea97c736c..151b13119208 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -52,6 +52,7 @@
52#include <linux/mutex.h> 52#include <linux/mutex.h>
53#include <linux/bootmem.h> 53#include <linux/bootmem.h>
54#include <linux/pci.h> 54#include <linux/pci.h>
55#include <linux/debugfs.h>
55 56
56#include <asm/uaccess.h> 57#include <asm/uaccess.h>
57#include <asm/system.h> 58#include <asm/system.h>
@@ -272,7 +273,7 @@ void do_IRQ(struct pt_regs *regs)
272 struct thread_info *curtp, *irqtp; 273 struct thread_info *curtp, *irqtp;
273#endif 274#endif
274 275
275 irq_enter(); 276 irq_enter();
276 277
277#ifdef CONFIG_DEBUG_STACKOVERFLOW 278#ifdef CONFIG_DEBUG_STACKOVERFLOW
278 /* Debugging check for stack overflow: is there less than 2KB free? */ 279 /* Debugging check for stack overflow: is there less than 2KB free? */
@@ -321,7 +322,7 @@ void do_IRQ(struct pt_regs *regs)
321 /* That's not SMP safe ... but who cares ? */ 322 /* That's not SMP safe ... but who cares ? */
322 ppc_spurious_interrupts++; 323 ppc_spurious_interrupts++;
323 324
324 irq_exit(); 325 irq_exit();
325 set_irq_regs(old_regs); 326 set_irq_regs(old_regs);
326 327
327#ifdef CONFIG_PPC_ISERIES 328#ifdef CONFIG_PPC_ISERIES
@@ -418,10 +419,16 @@ irq_hw_number_t virq_to_hw(unsigned int virq)
418} 419}
419EXPORT_SYMBOL_GPL(virq_to_hw); 420EXPORT_SYMBOL_GPL(virq_to_hw);
420 421
421__init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type, 422static int default_irq_host_match(struct irq_host *h, struct device_node *np)
422 unsigned int revmap_arg, 423{
423 struct irq_host_ops *ops, 424 return h->of_node != NULL && h->of_node == np;
424 irq_hw_number_t inval_irq) 425}
426
427struct irq_host *irq_alloc_host(struct device_node *of_node,
428 unsigned int revmap_type,
429 unsigned int revmap_arg,
430 struct irq_host_ops *ops,
431 irq_hw_number_t inval_irq)
425{ 432{
426 struct irq_host *host; 433 struct irq_host *host;
427 unsigned int size = sizeof(struct irq_host); 434 unsigned int size = sizeof(struct irq_host);
@@ -432,13 +439,7 @@ __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
432 /* Allocate structure and revmap table if using linear mapping */ 439 /* Allocate structure and revmap table if using linear mapping */
433 if (revmap_type == IRQ_HOST_MAP_LINEAR) 440 if (revmap_type == IRQ_HOST_MAP_LINEAR)
434 size += revmap_arg * sizeof(unsigned int); 441 size += revmap_arg * sizeof(unsigned int);
435 if (mem_init_done) 442 host = zalloc_maybe_bootmem(size, GFP_KERNEL);
436 host = kzalloc(size, GFP_KERNEL);
437 else {
438 host = alloc_bootmem(size);
439 if (host)
440 memset(host, 0, size);
441 }
442 if (host == NULL) 443 if (host == NULL)
443 return NULL; 444 return NULL;
444 445
@@ -446,6 +447,10 @@ __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
446 host->revmap_type = revmap_type; 447 host->revmap_type = revmap_type;
447 host->inval_irq = inval_irq; 448 host->inval_irq = inval_irq;
448 host->ops = ops; 449 host->ops = ops;
450 host->of_node = of_node;
451
452 if (host->ops->match == NULL)
453 host->ops->match = default_irq_host_match;
449 454
450 spin_lock_irqsave(&irq_big_lock, flags); 455 spin_lock_irqsave(&irq_big_lock, flags);
451 456
@@ -477,7 +482,7 @@ __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
477 host->inval_irq = 0; 482 host->inval_irq = 0;
478 /* setup us as the host for all legacy interrupts */ 483 /* setup us as the host for all legacy interrupts */
479 for (i = 1; i < NUM_ISA_INTERRUPTS; i++) { 484 for (i = 1; i < NUM_ISA_INTERRUPTS; i++) {
480 irq_map[i].hwirq = 0; 485 irq_map[i].hwirq = i;
481 smp_wmb(); 486 smp_wmb();
482 irq_map[i].host = host; 487 irq_map[i].host = host;
483 smp_wmb(); 488 smp_wmb();
@@ -521,7 +526,7 @@ struct irq_host *irq_find_host(struct device_node *node)
521 */ 526 */
522 spin_lock_irqsave(&irq_big_lock, flags); 527 spin_lock_irqsave(&irq_big_lock, flags);
523 list_for_each_entry(h, &irq_hosts, link) 528 list_for_each_entry(h, &irq_hosts, link)
524 if (h->ops->match == NULL || h->ops->match(h, node)) { 529 if (h->ops->match(h, node)) {
525 found = h; 530 found = h;
526 break; 531 break;
527 } 532 }
@@ -996,6 +1001,68 @@ static int irq_late_init(void)
996} 1001}
997arch_initcall(irq_late_init); 1002arch_initcall(irq_late_init);
998 1003
1004#ifdef CONFIG_VIRQ_DEBUG
1005static int virq_debug_show(struct seq_file *m, void *private)
1006{
1007 unsigned long flags;
1008 irq_desc_t *desc;
1009 const char *p;
1010 char none[] = "none";
1011 int i;
1012
1013 seq_printf(m, "%-5s %-7s %-15s %s\n", "virq", "hwirq",
1014 "chip name", "host name");
1015
1016 for (i = 1; i < NR_IRQS; i++) {
1017 desc = get_irq_desc(i);
1018 spin_lock_irqsave(&desc->lock, flags);
1019
1020 if (desc->action && desc->action->handler) {
1021 seq_printf(m, "%5d ", i);
1022 seq_printf(m, "0x%05lx ", virq_to_hw(i));
1023
1024 if (desc->chip && desc->chip->typename)
1025 p = desc->chip->typename;
1026 else
1027 p = none;
1028 seq_printf(m, "%-15s ", p);
1029
1030 if (irq_map[i].host && irq_map[i].host->of_node)
1031 p = irq_map[i].host->of_node->full_name;
1032 else
1033 p = none;
1034 seq_printf(m, "%s\n", p);
1035 }
1036
1037 spin_unlock_irqrestore(&desc->lock, flags);
1038 }
1039
1040 return 0;
1041}
1042
1043static int virq_debug_open(struct inode *inode, struct file *file)
1044{
1045 return single_open(file, virq_debug_show, inode->i_private);
1046}
1047
1048static const struct file_operations virq_debug_fops = {
1049 .open = virq_debug_open,
1050 .read = seq_read,
1051 .llseek = seq_lseek,
1052 .release = single_release,
1053};
1054
1055static int __init irq_debugfs_init(void)
1056{
1057 if (debugfs_create_file("virq_mapping", S_IRUGO, powerpc_debugfs_root,
1058 NULL, &virq_debug_fops))
1059 return -ENOMEM;
1060
1061 return 0;
1062}
1063__initcall(irq_debugfs_init);
1064#endif /* CONFIG_VIRQ_DEBUG */
1065
999#endif /* CONFIG_PPC_MERGE */ 1066#endif /* CONFIG_PPC_MERGE */
1000 1067
1001#ifdef CONFIG_PPC64 1068#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index 6444eaa30a2f..ff781b2eddec 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -77,7 +77,7 @@ static int iseries_lparcfg_data(struct seq_file *m, void *v)
77 int processors, max_processors; 77 int processors, max_processors;
78 unsigned long purr = get_purr(); 78 unsigned long purr = get_purr();
79 79
80 shared = (int)(get_lppaca()->shared_proc); 80 shared = (int)(local_paca->lppaca_ptr->shared_proc);
81 81
82 seq_printf(m, "system_active_processors=%d\n", 82 seq_printf(m, "system_active_processors=%d\n",
83 (int)HvLpConfig_getSystemPhysicalProcessors()); 83 (int)HvLpConfig_getSystemPhysicalProcessors());
diff --git a/arch/powerpc/kernel/lparmap.c b/arch/powerpc/kernel/lparmap.c
deleted file mode 100644
index af11285ffbd1..000000000000
--- a/arch/powerpc/kernel/lparmap.c
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Copyright (C) 2005 Stephen Rothwell IBM Corp.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#include <asm/mmu.h>
10#include <asm/pgtable.h>
11#include <asm/iseries/lpar_map.h>
12
13/* The # is to stop gcc trying to make .text nonexecutable */
14const struct LparMap __attribute__((__section__(".text #"))) xLparMap = {
15 .xNumberEsids = HvEsidsToMap,
16 .xNumberRanges = HvRangesToMap,
17 .xSegmentTableOffs = STAB0_PAGE,
18
19 .xEsids = {
20 { .xKernelEsid = GET_ESID(PAGE_OFFSET),
21 .xKernelVsid = KERNEL_VSID(PAGE_OFFSET), },
22 { .xKernelEsid = GET_ESID(VMALLOC_START),
23 .xKernelVsid = KERNEL_VSID(VMALLOC_START), },
24 },
25
26 .xRanges = {
27 { .xPages = HvPagesToMap,
28 .xOffset = 0,
29 .xVPN = KERNEL_VSID(PAGE_OFFSET) << (SID_SHIFT - HW_PAGE_SHIFT),
30 },
31 },
32};
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index f9676f52c6d8..0ed31f220482 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -34,21 +34,10 @@
34 34
35#undef DEBUG_NVRAM 35#undef DEBUG_NVRAM
36 36
37static int nvram_scan_partitions(void);
38static int nvram_setup_partition(void);
39static int nvram_create_os_partition(void);
40static int nvram_remove_os_partition(void);
41
42static struct nvram_partition * nvram_part; 37static struct nvram_partition * nvram_part;
43static long nvram_error_log_index = -1; 38static long nvram_error_log_index = -1;
44static long nvram_error_log_size = 0; 39static long nvram_error_log_size = 0;
45 40
46int no_logging = 1; /* Until we initialize everything,
47 * make sure we don't try logging
48 * anything */
49
50extern volatile int error_log_cnt;
51
52struct err_log_info { 41struct err_log_info {
53 int error_type; 42 int error_type;
54 unsigned int seq_num; 43 unsigned int seq_num;
@@ -636,16 +625,13 @@ void __exit nvram_cleanup(void)
636 * sequence #: The unique sequence # for each event. (until it wraps) 625 * sequence #: The unique sequence # for each event. (until it wraps)
637 * error log: The error log from event_scan 626 * error log: The error log from event_scan
638 */ 627 */
639int nvram_write_error_log(char * buff, int length, unsigned int err_type) 628int nvram_write_error_log(char * buff, int length,
629 unsigned int err_type, unsigned int error_log_cnt)
640{ 630{
641 int rc; 631 int rc;
642 loff_t tmp_index; 632 loff_t tmp_index;
643 struct err_log_info info; 633 struct err_log_info info;
644 634
645 if (no_logging) {
646 return -EPERM;
647 }
648
649 if (nvram_error_log_index == -1) { 635 if (nvram_error_log_index == -1) {
650 return -ESPIPE; 636 return -ESPIPE;
651 } 637 }
@@ -678,7 +664,8 @@ int nvram_write_error_log(char * buff, int length, unsigned int err_type)
678 * 664 *
679 * Reads nvram for error log for at most 'length' 665 * Reads nvram for error log for at most 'length'
680 */ 666 */
681int nvram_read_error_log(char * buff, int length, unsigned int * err_type) 667int nvram_read_error_log(char * buff, int length,
668 unsigned int * err_type, unsigned int * error_log_cnt)
682{ 669{
683 int rc; 670 int rc;
684 loff_t tmp_index; 671 loff_t tmp_index;
@@ -704,7 +691,7 @@ int nvram_read_error_log(char * buff, int length, unsigned int * err_type)
704 return rc; 691 return rc;
705 } 692 }
706 693
707 error_log_cnt = info.seq_num; 694 *error_log_cnt = info.seq_num;
708 *err_type = info.error_type; 695 *err_type = info.error_type;
709 696
710 return 0; 697 return 0;
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 083cfbdbe0b2..2ae3b6f778a3 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -65,14 +65,11 @@ static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
65 spin_unlock(&hose_spinlock); 65 spin_unlock(&hose_spinlock);
66} 66}
67 67
68__init_refok struct pci_controller * pcibios_alloc_controller(struct device_node *dev) 68struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
69{ 69{
70 struct pci_controller *phb; 70 struct pci_controller *phb;
71 71
72 if (mem_init_done) 72 phb = alloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
73 phb = kmalloc(sizeof(struct pci_controller), GFP_KERNEL);
74 else
75 phb = alloc_bootmem(sizeof (struct pci_controller));
76 if (phb == NULL) 73 if (phb == NULL)
77 return NULL; 74 return NULL;
78 pci_setup_pci_controller(phb); 75 pci_setup_pci_controller(phb);
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 04a3109ae3c6..0e2bee46304c 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -1457,8 +1457,8 @@ null_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
1457 1457
1458static struct pci_ops null_pci_ops = 1458static struct pci_ops null_pci_ops =
1459{ 1459{
1460 null_read_config, 1460 .read = null_read_config,
1461 null_write_config 1461 .write = null_write_config,
1462}; 1462};
1463 1463
1464/* 1464/*
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 291ffbc360c9..9f63bdcb0bdf 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -588,7 +588,7 @@ int pci_proc_domain(struct pci_bus *bus)
588 return 0; 588 return 0;
589 else { 589 else {
590 struct pci_controller *hose = pci_bus_to_host(bus); 590 struct pci_controller *hose = pci_bus_to_host(bus);
591 return hose->buid; 591 return hose->buid != 0;
592 } 592 }
593} 593}
594 594
diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c
index d7d36df9c053..b4839038613d 100644
--- a/arch/powerpc/kernel/pci_dn.c
+++ b/arch/powerpc/kernel/pci_dn.c
@@ -23,8 +23,6 @@
23#include <linux/pci.h> 23#include <linux/pci.h>
24#include <linux/string.h> 24#include <linux/string.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/slab.h>
27#include <linux/bootmem.h>
28 26
29#include <asm/io.h> 27#include <asm/io.h>
30#include <asm/prom.h> 28#include <asm/prom.h>
@@ -45,10 +43,7 @@ static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
45 const u32 *regs; 43 const u32 *regs;
46 struct pci_dn *pdn; 44 struct pci_dn *pdn;
47 45
48 if (mem_init_done) 46 pdn = alloc_maybe_bootmem(sizeof(*pdn), GFP_KERNEL);
49 pdn = kmalloc(sizeof(*pdn), GFP_KERNEL);
50 else
51 pdn = alloc_bootmem(sizeof(*pdn));
52 if (pdn == NULL) 47 if (pdn == NULL)
53 return NULL; 48 return NULL;
54 memset(pdn, 0, sizeof(*pdn)); 49 memset(pdn, 0, sizeof(*pdn));
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index a20f1951a5ce..c6b1aa3efbb9 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -12,12 +12,12 @@
12#include <linux/irq.h> 12#include <linux/irq.h>
13#include <linux/pci.h> 13#include <linux/pci.h>
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/ide.h>
16#include <linux/bitops.h> 15#include <linux/bitops.h>
17 16
18#include <asm/page.h> 17#include <asm/page.h>
19#include <asm/semaphore.h> 18#include <asm/semaphore.h>
20#include <asm/processor.h> 19#include <asm/processor.h>
20#include <asm/cacheflush.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/io.h> 22#include <asm/io.h>
23#include <asm/atomic.h> 23#include <asm/atomic.h>
@@ -95,10 +95,6 @@ EXPORT_SYMBOL(__strnlen_user);
95EXPORT_SYMBOL(copy_4K_page); 95EXPORT_SYMBOL(copy_4K_page);
96#endif 96#endif
97 97
98#if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE))
99EXPORT_SYMBOL(ppc_ide_md);
100#endif
101
102#if defined(CONFIG_PCI) && defined(CONFIG_PPC32) 98#if defined(CONFIG_PCI) && defined(CONFIG_PPC32)
103EXPORT_SYMBOL(isa_io_base); 99EXPORT_SYMBOL(isa_io_base);
104EXPORT_SYMBOL(isa_mem_base); 100EXPORT_SYMBOL(isa_mem_base);
@@ -180,7 +176,7 @@ EXPORT_SYMBOL(cacheable_memcpy);
180EXPORT_SYMBOL(cpm_install_handler); 176EXPORT_SYMBOL(cpm_install_handler);
181EXPORT_SYMBOL(cpm_free_handler); 177EXPORT_SYMBOL(cpm_free_handler);
182#endif /* CONFIG_8xx */ 178#endif /* CONFIG_8xx */
183#if defined(CONFIG_8xx) || defined(CONFIG_40x) 179#if defined(CONFIG_8xx)
184EXPORT_SYMBOL(__res); 180EXPORT_SYMBOL(__res);
185#endif 181#endif
186 182
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 8a1b001d0b11..15998b57767c 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -354,6 +354,14 @@ static void show_instructions(struct pt_regs *regs)
354 if (!(i % 8)) 354 if (!(i % 8))
355 printk("\n"); 355 printk("\n");
356 356
357#if !defined(CONFIG_BOOKE)
358 /* If executing with the IMMU off, adjust pc rather
359 * than print XXXXXXXX.
360 */
361 if (!(regs->msr & MSR_IR))
362 pc = (unsigned long)phys_to_virt(pc);
363#endif
364
357 /* We use __get_user here *only* to avoid an OOPS on a 365 /* We use __get_user here *only* to avoid an OOPS on a
358 * bad address because the pc *should* only be a 366 * bad address because the pc *should* only be a
359 * kernel address. 367 * kernel address.
@@ -676,9 +684,13 @@ int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
676 * mode (asyn, precise, disabled) for 'Classic' FP. */ 684 * mode (asyn, precise, disabled) for 'Classic' FP. */
677 if (val & PR_FP_EXC_SW_ENABLE) { 685 if (val & PR_FP_EXC_SW_ENABLE) {
678#ifdef CONFIG_SPE 686#ifdef CONFIG_SPE
679 tsk->thread.fpexc_mode = val & 687 if (cpu_has_feature(CPU_FTR_SPE)) {
680 (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT); 688 tsk->thread.fpexc_mode = val &
681 return 0; 689 (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT);
690 return 0;
691 } else {
692 return -EINVAL;
693 }
682#else 694#else
683 return -EINVAL; 695 return -EINVAL;
684#endif 696#endif
@@ -704,7 +716,10 @@ int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
704 716
705 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) 717 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE)
706#ifdef CONFIG_SPE 718#ifdef CONFIG_SPE
707 val = tsk->thread.fpexc_mode; 719 if (cpu_has_feature(CPU_FTR_SPE))
720 val = tsk->thread.fpexc_mode;
721 else
722 return -EINVAL;
708#else 723#else
709 return -EINVAL; 724 return -EINVAL;
710#endif 725#endif
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index a38197b12d3e..172dcc3849a0 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -52,7 +52,6 @@
52#include <asm/pSeries_reconfig.h> 52#include <asm/pSeries_reconfig.h>
53#include <asm/pci-bridge.h> 53#include <asm/pci-bridge.h>
54#include <asm/kexec.h> 54#include <asm/kexec.h>
55#include <asm/system.h>
56 55
57#ifdef DEBUG 56#ifdef DEBUG
58#define DBG(fmt...) printk(KERN_ERR fmt) 57#define DBG(fmt...) printk(KERN_ERR fmt)
@@ -431,9 +430,11 @@ static int __init early_parse_mem(char *p)
431} 430}
432early_param("mem", early_parse_mem); 431early_param("mem", early_parse_mem);
433 432
434/* 433/**
435 * The device tree may be allocated below our memory limit, or inside the 434 * move_device_tree - move tree to an unused area, if needed.
436 * crash kernel region for kdump. If so, move it out now. 435 *
436 * The device tree may be allocated beyond our memory limit, or inside the
437 * crash kernel region for kdump. If so, move it out of the way.
437 */ 438 */
438static void move_device_tree(void) 439static void move_device_tree(void)
439{ 440{
@@ -780,13 +781,13 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
780#endif 781#endif
781 782
782#ifdef CONFIG_KEXEC 783#ifdef CONFIG_KEXEC
783 lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL); 784 lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL);
784 if (lprop) 785 if (lprop)
785 crashk_res.start = *lprop; 786 crashk_res.start = *lprop;
786 787
787 lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-size", NULL); 788 lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-size", NULL);
788 if (lprop) 789 if (lprop)
789 crashk_res.end = crashk_res.start + *lprop - 1; 790 crashk_res.end = crashk_res.start + *lprop - 1;
790#endif 791#endif
791 792
792 early_init_dt_check_for_initrd(node); 793 early_init_dt_check_for_initrd(node);
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index a1d582e38627..1db10f70ae69 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1199,7 +1199,7 @@ static void __init prom_initialize_tce_table(void)
1199 if ((type[0] == 0) || (strstr(type, RELOC("pci")) == NULL)) 1199 if ((type[0] == 0) || (strstr(type, RELOC("pci")) == NULL))
1200 continue; 1200 continue;
1201 1201
1202 /* Keep the old logic in tack to avoid regression. */ 1202 /* Keep the old logic intact to avoid regression. */
1203 if (compatible[0] != 0) { 1203 if (compatible[0] != 0) {
1204 if ((strstr(compatible, RELOC("python")) == NULL) && 1204 if ((strstr(compatible, RELOC("python")) == NULL) &&
1205 (strstr(compatible, RELOC("Speedwagon")) == NULL) && 1205 (strstr(compatible, RELOC("Speedwagon")) == NULL) &&
@@ -2046,6 +2046,7 @@ static void __init fixup_device_tree_maple(void)
2046/* 2046/*
2047 * Pegasos and BriQ lacks the "ranges" property in the isa node 2047 * Pegasos and BriQ lacks the "ranges" property in the isa node
2048 * Pegasos needs decimal IRQ 14/15, not hexadecimal 2048 * Pegasos needs decimal IRQ 14/15, not hexadecimal
2049 * Pegasos has the IDE configured in legacy mode, but advertised as native
2049 */ 2050 */
2050static void __init fixup_device_tree_chrp(void) 2051static void __init fixup_device_tree_chrp(void)
2051{ 2052{
@@ -2083,9 +2084,13 @@ static void __init fixup_device_tree_chrp(void)
2083 prom_printf("Fixing up IDE interrupt on Pegasos...\n"); 2084 prom_printf("Fixing up IDE interrupt on Pegasos...\n");
2084 prop[0] = 14; 2085 prop[0] = 14;
2085 prop[1] = 0x0; 2086 prop[1] = 0x0;
2086 prop[2] = 15; 2087 prom_setprop(ph, name, "interrupts", prop, 2*sizeof(u32));
2087 prop[3] = 0x0; 2088 prom_printf("Fixing up IDE class-code on Pegasos...\n");
2088 prom_setprop(ph, name, "interrupts", prop, 4*sizeof(u32)); 2089 rc = prom_getprop(ph, "class-code", prop, sizeof(u32));
2090 if (rc == sizeof(u32)) {
2091 prop[0] &= ~0x5;
2092 prom_setprop(ph, name, "class-code", prop, sizeof(u32));
2093 }
2089 } 2094 }
2090} 2095}
2091#else 2096#else
@@ -2226,7 +2231,7 @@ static void __init fixup_device_tree(void)
2226 2231
2227static void __init prom_find_boot_cpu(void) 2232static void __init prom_find_boot_cpu(void)
2228{ 2233{
2229 struct prom_t *_prom = &RELOC(prom); 2234 struct prom_t *_prom = &RELOC(prom);
2230 u32 getprop_rval; 2235 u32 getprop_rval;
2231 ihandle prom_cpu; 2236 ihandle prom_cpu;
2232 phandle cpu_pkg; 2237 phandle cpu_pkg;
@@ -2246,7 +2251,7 @@ static void __init prom_find_boot_cpu(void)
2246static void __init prom_check_initrd(unsigned long r3, unsigned long r4) 2251static void __init prom_check_initrd(unsigned long r3, unsigned long r4)
2247{ 2252{
2248#ifdef CONFIG_BLK_DEV_INITRD 2253#ifdef CONFIG_BLK_DEV_INITRD
2249 struct prom_t *_prom = &RELOC(prom); 2254 struct prom_t *_prom = &RELOC(prom);
2250 2255
2251 if (r3 && r4 && r4 != 0xdeadbeef) { 2256 if (r3 && r4 && r4 != 0xdeadbeef) {
2252 unsigned long val; 2257 unsigned long val;
@@ -2279,7 +2284,7 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2279 unsigned long pp, 2284 unsigned long pp,
2280 unsigned long r6, unsigned long r7) 2285 unsigned long r6, unsigned long r7)
2281{ 2286{
2282 struct prom_t *_prom; 2287 struct prom_t *_prom;
2283 unsigned long hdr; 2288 unsigned long hdr;
2284 unsigned long offset = reloc_offset(); 2289 unsigned long offset = reloc_offset();
2285 2290
@@ -2338,8 +2343,8 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2338 /* 2343 /*
2339 * Copy the CPU hold code 2344 * Copy the CPU hold code
2340 */ 2345 */
2341 if (RELOC(of_platform) != PLATFORM_POWERMAC) 2346 if (RELOC(of_platform) != PLATFORM_POWERMAC)
2342 copy_and_flush(0, KERNELBASE + offset, 0x100, 0); 2347 copy_and_flush(0, KERNELBASE + offset, 0x100, 0);
2343 2348
2344 /* 2349 /*
2345 * Do early parsing of command line 2350 * Do early parsing of command line
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 8a177bd9eab4..cf7732cdd6c7 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -331,6 +331,7 @@ static long arch_ptrace_old(struct task_struct *child, long request, long addr,
331 unsigned long *reg = &((unsigned long *)child->thread.regs)[0]; 331 unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
332 unsigned long __user *tmp = (unsigned long __user *)addr; 332 unsigned long __user *tmp = (unsigned long __user *)addr;
333 333
334 CHECK_FULL_REGS(child->thread.regs);
334 for (i = 0; i < 32; i++) { 335 for (i = 0; i < 32; i++) {
335 ret = put_user(*reg, tmp); 336 ret = put_user(*reg, tmp);
336 if (ret) 337 if (ret)
@@ -346,6 +347,7 @@ static long arch_ptrace_old(struct task_struct *child, long request, long addr,
346 unsigned long *reg = &((unsigned long *)child->thread.regs)[0]; 347 unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
347 unsigned long __user *tmp = (unsigned long __user *)addr; 348 unsigned long __user *tmp = (unsigned long __user *)addr;
348 349
350 CHECK_FULL_REGS(child->thread.regs);
349 for (i = 0; i < 32; i++) { 351 for (i = 0; i < 32; i++) {
350 ret = get_user(*reg, tmp); 352 ret = get_user(*reg, tmp);
351 if (ret) 353 if (ret)
@@ -517,6 +519,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
517 ret = -EIO; 519 ret = -EIO;
518 break; 520 break;
519 } 521 }
522 CHECK_FULL_REGS(child->thread.regs);
520 ret = 0; 523 ret = 0;
521 for (ui = 0; ui < PT_REGS_COUNT; ui ++) { 524 for (ui = 0; ui < PT_REGS_COUNT; ui ++) {
522 ret |= __put_user(ptrace_get_reg(child, ui), 525 ret |= __put_user(ptrace_get_reg(child, ui),
@@ -537,6 +540,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
537 ret = -EIO; 540 ret = -EIO;
538 break; 541 break;
539 } 542 }
543 CHECK_FULL_REGS(child->thread.regs);
540 ret = 0; 544 ret = 0;
541 for (ui = 0; ui < PT_REGS_COUNT; ui ++) { 545 for (ui = 0; ui < PT_REGS_COUNT; ui ++) {
542 ret = __get_user(tmp, (unsigned long __user *) data); 546 ret = __get_user(tmp, (unsigned long __user *) data);
@@ -576,8 +580,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
576#ifdef CONFIG_SPE 580#ifdef CONFIG_SPE
577 case PTRACE_GETEVRREGS: 581 case PTRACE_GETEVRREGS:
578 /* Get the child spe register state. */ 582 /* Get the child spe register state. */
579 if (child->thread.regs->msr & MSR_SPE) 583 flush_spe_to_thread(child);
580 giveup_spe(child);
581 ret = get_evrregs((unsigned long __user *)data, child); 584 ret = get_evrregs((unsigned long __user *)data, child);
582 break; 585 break;
583 586
@@ -585,8 +588,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
585 /* Set the child spe register state. */ 588 /* Set the child spe register state. */
586 /* this is to clear the MSR_SPE bit to force a reload 589 /* this is to clear the MSR_SPE bit to force a reload
587 * of register state from memory */ 590 * of register state from memory */
588 if (child->thread.regs->msr & MSR_SPE) 591 flush_spe_to_thread(child);
589 giveup_spe(child);
590 ret = set_evrregs(child, (unsigned long __user *)data); 592 ret = set_evrregs(child, (unsigned long __user *)data);
591 break; 593 break;
592#endif 594#endif
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
index 9e6baeac0fb1..fea6206ff90f 100644
--- a/arch/powerpc/kernel/ptrace32.c
+++ b/arch/powerpc/kernel/ptrace32.c
@@ -53,6 +53,7 @@ static long compat_ptrace_old(struct task_struct *child, long request,
53 unsigned long *reg = &((unsigned long *)child->thread.regs)[0]; 53 unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
54 unsigned int __user *tmp = (unsigned int __user *)addr; 54 unsigned int __user *tmp = (unsigned int __user *)addr;
55 55
56 CHECK_FULL_REGS(child->thread.regs);
56 for (i = 0; i < 32; i++) { 57 for (i = 0; i < 32; i++) {
57 ret = put_user(*reg, tmp); 58 ret = put_user(*reg, tmp);
58 if (ret) 59 if (ret)
@@ -68,6 +69,7 @@ static long compat_ptrace_old(struct task_struct *child, long request,
68 unsigned long *reg = &((unsigned long *)child->thread.regs)[0]; 69 unsigned long *reg = &((unsigned long *)child->thread.regs)[0];
69 unsigned int __user *tmp = (unsigned int __user *)addr; 70 unsigned int __user *tmp = (unsigned int __user *)addr;
70 71
72 CHECK_FULL_REGS(child->thread.regs);
71 for (i = 0; i < 32; i++) { 73 for (i = 0; i < 32; i++) {
72 ret = get_user(*reg, tmp); 74 ret = get_user(*reg, tmp);
73 if (ret) 75 if (ret)
@@ -164,6 +166,7 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr,
164 if ((addr & 3) || (index > PT_FPSCR32)) 166 if ((addr & 3) || (index > PT_FPSCR32))
165 break; 167 break;
166 168
169 CHECK_FULL_REGS(child->thread.regs);
167 if (index < PT_FPR0) { 170 if (index < PT_FPR0) {
168 tmp = ptrace_get_reg(child, index); 171 tmp = ptrace_get_reg(child, index);
169 } else { 172 } else {
@@ -210,6 +213,7 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr,
210 if ((addr & 3) || numReg > PT_FPSCR) 213 if ((addr & 3) || numReg > PT_FPSCR)
211 break; 214 break;
212 215
216 CHECK_FULL_REGS(child->thread.regs);
213 if (numReg >= PT_FPR0) { 217 if (numReg >= PT_FPR0) {
214 flush_fp_to_thread(child); 218 flush_fp_to_thread(child);
215 tmp = ((unsigned long int *)child->thread.fpr)[numReg - PT_FPR0]; 219 tmp = ((unsigned long int *)child->thread.fpr)[numReg - PT_FPR0];
@@ -270,6 +274,7 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr,
270 if ((addr & 3) || (index > PT_FPSCR32)) 274 if ((addr & 3) || (index > PT_FPSCR32))
271 break; 275 break;
272 276
277 CHECK_FULL_REGS(child->thread.regs);
273 if (index < PT_FPR0) { 278 if (index < PT_FPR0) {
274 ret = ptrace_put_reg(child, index, data); 279 ret = ptrace_put_reg(child, index, data);
275 } else { 280 } else {
@@ -307,6 +312,7 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr,
307 */ 312 */
308 if ((addr & 3) || (numReg > PT_FPSCR)) 313 if ((addr & 3) || (numReg > PT_FPSCR))
309 break; 314 break;
315 CHECK_FULL_REGS(child->thread.regs);
310 if (numReg < PT_FPR0) { 316 if (numReg < PT_FPR0) {
311 unsigned long freg = ptrace_get_reg(child, numReg); 317 unsigned long freg = ptrace_get_reg(child, numReg);
312 if (index % 2) 318 if (index % 2)
@@ -342,6 +348,7 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr,
342 ret = -EIO; 348 ret = -EIO;
343 break; 349 break;
344 } 350 }
351 CHECK_FULL_REGS(child->thread.regs);
345 ret = 0; 352 ret = 0;
346 for (ui = 0; ui < PT_REGS_COUNT; ui ++) { 353 for (ui = 0; ui < PT_REGS_COUNT; ui ++) {
347 ret |= __put_user(ptrace_get_reg(child, ui), 354 ret |= __put_user(ptrace_get_reg(child, ui),
@@ -359,6 +366,7 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr,
359 ret = -EIO; 366 ret = -EIO;
360 break; 367 break;
361 } 368 }
369 CHECK_FULL_REGS(child->thread.regs);
362 ret = 0; 370 ret = 0;
363 for (ui = 0; ui < PT_REGS_COUNT; ui ++) { 371 for (ui = 0; ui < PT_REGS_COUNT; ui ++) {
364 ret = __get_user(tmp, (unsigned int __user *) data); 372 ret = __get_user(tmp, (unsigned int __user *) data);
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index a5de6211b97a..21f14e57d1f3 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -171,8 +171,8 @@ static int rtas_pci_write_config(struct pci_bus *bus,
171} 171}
172 172
173struct pci_ops rtas_pci_ops = { 173struct pci_ops rtas_pci_ops = {
174 rtas_pci_read_config, 174 .read = rtas_pci_read_config,
175 rtas_pci_write_config 175 .write = rtas_pci_write_config,
176}; 176};
177 177
178int is_python(struct device_node *dev) 178int is_python(struct device_node *dev)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 50ef38cffdbf..36c90ba2d312 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -76,6 +76,8 @@ EXPORT_SYMBOL(machine_id);
76 76
77unsigned long klimit = (unsigned long) _end; 77unsigned long klimit = (unsigned long) _end;
78 78
79char cmd_line[COMMAND_LINE_SIZE];
80
79/* 81/*
80 * This still seems to be needed... -- paulus 82 * This still seems to be needed... -- paulus
81 */ 83 */
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 7ec6ba56d83d..7474502dace5 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -10,7 +10,9 @@
10#include <linux/reboot.h> 10#include <linux/reboot.h>
11#include <linux/delay.h> 11#include <linux/delay.h>
12#include <linux/initrd.h> 12#include <linux/initrd.h>
13#if defined(CONFIG_IDE) || defined(CONFIG_IDE_MODULE)
13#include <linux/ide.h> 14#include <linux/ide.h>
15#endif
14#include <linux/tty.h> 16#include <linux/tty.h>
15#include <linux/bootmem.h> 17#include <linux/bootmem.h>
16#include <linux/seq_file.h> 18#include <linux/seq_file.h>
@@ -18,13 +20,11 @@
18#include <linux/cpu.h> 20#include <linux/cpu.h>
19#include <linux/console.h> 21#include <linux/console.h>
20 22
21#include <asm/residual.h>
22#include <asm/io.h> 23#include <asm/io.h>
23#include <asm/prom.h> 24#include <asm/prom.h>
24#include <asm/processor.h> 25#include <asm/processor.h>
25#include <asm/pgtable.h> 26#include <asm/pgtable.h>
26#include <asm/setup.h> 27#include <asm/setup.h>
27#include <asm/amigappc.h>
28#include <asm/smp.h> 28#include <asm/smp.h>
29#include <asm/elf.h> 29#include <asm/elf.h>
30#include <asm/cputable.h> 30#include <asm/cputable.h>
@@ -51,7 +51,10 @@
51 51
52extern void bootx_init(unsigned long r4, unsigned long phys); 52extern void bootx_init(unsigned long r4, unsigned long phys);
53 53
54#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
54struct ide_machdep_calls ppc_ide_md; 55struct ide_machdep_calls ppc_ide_md;
56EXPORT_SYMBOL(ppc_ide_md);
57#endif
55 58
56int boot_cpuid; 59int boot_cpuid;
57EXPORT_SYMBOL_GPL(boot_cpuid); 60EXPORT_SYMBOL_GPL(boot_cpuid);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 6018178708a5..3089eaed3256 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -181,9 +181,9 @@ void __init early_setup(unsigned long dt_ptr)
181 DBG(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr); 181 DBG(" -> early_setup(), dt_ptr: 0x%lx\n", dt_ptr);
182 182
183 /* 183 /*
184 * Do early initializations using the flattened device 184 * Do early initialization using the flattened device
185 * tree, like retreiving the physical memory map or 185 * tree, such as retrieving the physical memory map or
186 * calculating/retreiving the hash table size 186 * calculating/retrieving the hash table size.
187 */ 187 */
188 early_init_devtree(__va(dt_ptr)); 188 early_init_devtree(__va(dt_ptr));
189 189
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 1ea43160f543..b24dcbaeecaa 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -152,11 +152,6 @@ static void stop_this_cpu(void *dummy)
152 ; 152 ;
153} 153}
154 154
155void smp_send_stop(void)
156{
157 smp_call_function(stop_this_cpu, NULL, 1, 0);
158}
159
160/* 155/*
161 * Structure and data for smp_call_function(). This is designed to minimise 156 * Structure and data for smp_call_function(). This is designed to minimise
162 * static memory requirements. It also looks cleaner. 157 * static memory requirements. It also looks cleaner.
@@ -198,9 +193,6 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
198 int cpu; 193 int cpu;
199 u64 timeout; 194 u64 timeout;
200 195
201 /* Can deadlock when called with interrupts disabled */
202 WARN_ON(irqs_disabled());
203
204 if (unlikely(smp_ops == NULL)) 196 if (unlikely(smp_ops == NULL))
205 return ret; 197 return ret;
206 198
@@ -270,10 +262,19 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
270 return ret; 262 return ret;
271} 263}
272 264
265static int __smp_call_function(void (*func)(void *info), void *info,
266 int nonatomic, int wait)
267{
268 return smp_call_function_map(func,info,nonatomic,wait,cpu_online_map);
269}
270
273int smp_call_function(void (*func) (void *info), void *info, int nonatomic, 271int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
274 int wait) 272 int wait)
275{ 273{
276 return smp_call_function_map(func,info,nonatomic,wait,cpu_online_map); 274 /* Can deadlock when called with interrupts disabled */
275 WARN_ON(irqs_disabled());
276
277 return __smp_call_function(func, info, nonatomic, wait);
277} 278}
278EXPORT_SYMBOL(smp_call_function); 279EXPORT_SYMBOL(smp_call_function);
279 280
@@ -283,6 +284,9 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
283 cpumask_t map = CPU_MASK_NONE; 284 cpumask_t map = CPU_MASK_NONE;
284 int ret = 0; 285 int ret = 0;
285 286
287 /* Can deadlock when called with interrupts disabled */
288 WARN_ON(irqs_disabled());
289
286 if (!cpu_online(cpu)) 290 if (!cpu_online(cpu))
287 return -EINVAL; 291 return -EINVAL;
288 292
@@ -299,6 +303,11 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
299} 303}
300EXPORT_SYMBOL(smp_call_function_single); 304EXPORT_SYMBOL(smp_call_function_single);
301 305
306void smp_send_stop(void)
307{
308 __smp_call_function(stop_this_cpu, NULL, 1, 0);
309}
310
302void smp_call_function_interrupt(void) 311void smp_call_function_interrupt(void)
303{ 312{
304 void (*func) (void *info); 313 void (*func) (void *info);
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 55d29ed4b7a0..25d9a96484dd 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -197,6 +197,36 @@ SYSFS_PMCSETUP(pa6t_pmc3, SPRN_PA6T_PMC3);
197SYSFS_PMCSETUP(pa6t_pmc4, SPRN_PA6T_PMC4); 197SYSFS_PMCSETUP(pa6t_pmc4, SPRN_PA6T_PMC4);
198SYSFS_PMCSETUP(pa6t_pmc5, SPRN_PA6T_PMC5); 198SYSFS_PMCSETUP(pa6t_pmc5, SPRN_PA6T_PMC5);
199 199
200#ifdef CONFIG_DEBUG_KERNEL
201SYSFS_PMCSETUP(hid0, SPRN_HID0);
202SYSFS_PMCSETUP(hid1, SPRN_HID1);
203SYSFS_PMCSETUP(hid4, SPRN_HID4);
204SYSFS_PMCSETUP(hid5, SPRN_HID5);
205SYSFS_PMCSETUP(ima0, SPRN_PA6T_IMA0);
206SYSFS_PMCSETUP(ima1, SPRN_PA6T_IMA1);
207SYSFS_PMCSETUP(ima2, SPRN_PA6T_IMA2);
208SYSFS_PMCSETUP(ima3, SPRN_PA6T_IMA3);
209SYSFS_PMCSETUP(ima4, SPRN_PA6T_IMA4);
210SYSFS_PMCSETUP(ima5, SPRN_PA6T_IMA5);
211SYSFS_PMCSETUP(ima6, SPRN_PA6T_IMA6);
212SYSFS_PMCSETUP(ima7, SPRN_PA6T_IMA7);
213SYSFS_PMCSETUP(ima8, SPRN_PA6T_IMA8);
214SYSFS_PMCSETUP(ima9, SPRN_PA6T_IMA9);
215SYSFS_PMCSETUP(imaat, SPRN_PA6T_IMAAT);
216SYSFS_PMCSETUP(btcr, SPRN_PA6T_BTCR);
217SYSFS_PMCSETUP(pccr, SPRN_PA6T_PCCR);
218SYSFS_PMCSETUP(rpccr, SPRN_PA6T_RPCCR);
219SYSFS_PMCSETUP(der, SPRN_PA6T_DER);
220SYSFS_PMCSETUP(mer, SPRN_PA6T_MER);
221SYSFS_PMCSETUP(ber, SPRN_PA6T_BER);
222SYSFS_PMCSETUP(ier, SPRN_PA6T_IER);
223SYSFS_PMCSETUP(sier, SPRN_PA6T_SIER);
224SYSFS_PMCSETUP(siar, SPRN_PA6T_SIAR);
225SYSFS_PMCSETUP(tsr0, SPRN_PA6T_TSR0);
226SYSFS_PMCSETUP(tsr1, SPRN_PA6T_TSR1);
227SYSFS_PMCSETUP(tsr2, SPRN_PA6T_TSR2);
228SYSFS_PMCSETUP(tsr3, SPRN_PA6T_TSR3);
229#endif /* CONFIG_DEBUG_KERNEL */
200 230
201static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra); 231static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
202static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL); 232static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL);
@@ -228,6 +258,36 @@ static struct sysdev_attribute pa6t_attrs[] = {
228 _SYSDEV_ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3), 258 _SYSDEV_ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3),
229 _SYSDEV_ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4), 259 _SYSDEV_ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4),
230 _SYSDEV_ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5), 260 _SYSDEV_ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5),
261#ifdef CONFIG_DEBUG_KERNEL
262 _SYSDEV_ATTR(hid0, 0600, show_hid0, store_hid0),
263 _SYSDEV_ATTR(hid1, 0600, show_hid1, store_hid1),
264 _SYSDEV_ATTR(hid4, 0600, show_hid4, store_hid4),
265 _SYSDEV_ATTR(hid5, 0600, show_hid5, store_hid5),
266 _SYSDEV_ATTR(ima0, 0600, show_ima0, store_ima0),
267 _SYSDEV_ATTR(ima1, 0600, show_ima1, store_ima1),
268 _SYSDEV_ATTR(ima2, 0600, show_ima2, store_ima2),
269 _SYSDEV_ATTR(ima3, 0600, show_ima3, store_ima3),
270 _SYSDEV_ATTR(ima4, 0600, show_ima4, store_ima4),
271 _SYSDEV_ATTR(ima5, 0600, show_ima5, store_ima5),
272 _SYSDEV_ATTR(ima6, 0600, show_ima6, store_ima6),
273 _SYSDEV_ATTR(ima7, 0600, show_ima7, store_ima7),
274 _SYSDEV_ATTR(ima8, 0600, show_ima8, store_ima8),
275 _SYSDEV_ATTR(ima9, 0600, show_ima9, store_ima9),
276 _SYSDEV_ATTR(imaat, 0600, show_imaat, store_imaat),
277 _SYSDEV_ATTR(btcr, 0600, show_btcr, store_btcr),
278 _SYSDEV_ATTR(pccr, 0600, show_pccr, store_pccr),
279 _SYSDEV_ATTR(rpccr, 0600, show_rpccr, store_rpccr),
280 _SYSDEV_ATTR(der, 0600, show_der, store_der),
281 _SYSDEV_ATTR(mer, 0600, show_mer, store_mer),
282 _SYSDEV_ATTR(ber, 0600, show_ber, store_ber),
283 _SYSDEV_ATTR(ier, 0600, show_ier, store_ier),
284 _SYSDEV_ATTR(sier, 0600, show_sier, store_sier),
285 _SYSDEV_ATTR(siar, 0600, show_siar, store_siar),
286 _SYSDEV_ATTR(tsr0, 0600, show_tsr0, store_tsr0),
287 _SYSDEV_ATTR(tsr1, 0600, show_tsr1, store_tsr1),
288 _SYSDEV_ATTR(tsr2, 0600, show_tsr2, store_tsr2),
289 _SYSDEV_ATTR(tsr3, 0600, show_tsr3, store_tsr3),
290#endif /* CONFIG_DEBUG_KERNEL */
231}; 291};
232 292
233 293
@@ -380,12 +440,14 @@ int cpu_add_sysdev_attr_group(struct attribute_group *attrs)
380{ 440{
381 int cpu; 441 int cpu;
382 struct sys_device *sysdev; 442 struct sys_device *sysdev;
443 int ret;
383 444
384 mutex_lock(&cpu_mutex); 445 mutex_lock(&cpu_mutex);
385 446
386 for_each_possible_cpu(cpu) { 447 for_each_possible_cpu(cpu) {
387 sysdev = get_cpu_sysdev(cpu); 448 sysdev = get_cpu_sysdev(cpu);
388 sysfs_create_group(&sysdev->kobj, attrs); 449 ret = sysfs_create_group(&sysdev->kobj, attrs);
450 WARN_ON(ret != 0);
389 } 451 }
390 452
391 mutex_unlock(&cpu_mutex); 453 mutex_unlock(&cpu_mutex);
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index c627cf86d1e3..e71a0d8c597a 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -65,24 +65,45 @@
65#include <asm/div64.h> 65#include <asm/div64.h>
66#include <asm/smp.h> 66#include <asm/smp.h>
67#include <asm/vdso_datapage.h> 67#include <asm/vdso_datapage.h>
68#ifdef CONFIG_PPC64
69#include <asm/firmware.h> 68#include <asm/firmware.h>
70#endif
71#ifdef CONFIG_PPC_ISERIES 69#ifdef CONFIG_PPC_ISERIES
72#include <asm/iseries/it_lp_queue.h> 70#include <asm/iseries/it_lp_queue.h>
73#include <asm/iseries/hv_call_xm.h> 71#include <asm/iseries/hv_call_xm.h>
74#endif 72#endif
75#include <asm/smp.h>
76 73
77/* keep track of when we need to update the rtc */ 74/* powerpc clocksource/clockevent code */
78time_t last_rtc_update; 75
76#include <linux/clocksource.h>
77
78static cycle_t rtc_read(void);
79static struct clocksource clocksource_rtc = {
80 .name = "rtc",
81 .rating = 400,
82 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
83 .mask = CLOCKSOURCE_MASK(64),
84 .shift = 22,
85 .mult = 0, /* To be filled in */
86 .read = rtc_read,
87};
88
89static cycle_t timebase_read(void);
90static struct clocksource clocksource_timebase = {
91 .name = "timebase",
92 .rating = 400,
93 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
94 .mask = CLOCKSOURCE_MASK(64),
95 .shift = 22,
96 .mult = 0, /* To be filled in */
97 .read = timebase_read,
98};
99
79#ifdef CONFIG_PPC_ISERIES 100#ifdef CONFIG_PPC_ISERIES
80static unsigned long __initdata iSeries_recal_titan; 101static unsigned long __initdata iSeries_recal_titan;
81static signed long __initdata iSeries_recal_tb; 102static signed long __initdata iSeries_recal_tb;
82#endif
83 103
84/* The decrementer counts down by 128 every 128ns on a 601. */ 104/* Forward declaration is only needed for iSereis compiles */
85#define DECREMENTER_COUNT_601 (1000000000 / HZ) 105void __init clocksource_init(void);
106#endif
86 107
87#define XSEC_PER_SEC (1024*1024) 108#define XSEC_PER_SEC (1024*1024)
88 109
@@ -349,98 +370,6 @@ void udelay(unsigned long usecs)
349} 370}
350EXPORT_SYMBOL(udelay); 371EXPORT_SYMBOL(udelay);
351 372
352static __inline__ void timer_check_rtc(void)
353{
354 /*
355 * update the rtc when needed, this should be performed on the
356 * right fraction of a second. Half or full second ?
357 * Full second works on mk48t59 clocks, others need testing.
358 * Note that this update is basically only used through
359 * the adjtimex system calls. Setting the HW clock in
360 * any other way is a /dev/rtc and userland business.
361 * This is still wrong by -0.5/+1.5 jiffies because of the
362 * timer interrupt resolution and possible delay, but here we
363 * hit a quantization limit which can only be solved by higher
364 * resolution timers and decoupling time management from timer
365 * interrupts. This is also wrong on the clocks
366 * which require being written at the half second boundary.
367 * We should have an rtc call that only sets the minutes and
368 * seconds like on Intel to avoid problems with non UTC clocks.
369 */
370 if (ppc_md.set_rtc_time && ntp_synced() &&
371 xtime.tv_sec - last_rtc_update >= 659 &&
372 abs((xtime.tv_nsec/1000) - (1000000-1000000/HZ)) < 500000/HZ) {
373 struct rtc_time tm;
374 to_tm(xtime.tv_sec + 1 + timezone_offset, &tm);
375 tm.tm_year -= 1900;
376 tm.tm_mon -= 1;
377 if (ppc_md.set_rtc_time(&tm) == 0)
378 last_rtc_update = xtime.tv_sec + 1;
379 else
380 /* Try again one minute later */
381 last_rtc_update += 60;
382 }
383}
384
385/*
386 * This version of gettimeofday has microsecond resolution.
387 */
388static inline void __do_gettimeofday(struct timeval *tv)
389{
390 unsigned long sec, usec;
391 u64 tb_ticks, xsec;
392 struct gettimeofday_vars *temp_varp;
393 u64 temp_tb_to_xs, temp_stamp_xsec;
394
395 /*
396 * These calculations are faster (gets rid of divides)
397 * if done in units of 1/2^20 rather than microseconds.
398 * The conversion to microseconds at the end is done
399 * without a divide (and in fact, without a multiply)
400 */
401 temp_varp = do_gtod.varp;
402
403 /* Sampling the time base must be done after loading
404 * do_gtod.varp in order to avoid racing with update_gtod.
405 */
406 data_barrier(temp_varp);
407 tb_ticks = get_tb() - temp_varp->tb_orig_stamp;
408 temp_tb_to_xs = temp_varp->tb_to_xs;
409 temp_stamp_xsec = temp_varp->stamp_xsec;
410 xsec = temp_stamp_xsec + mulhdu(tb_ticks, temp_tb_to_xs);
411 sec = xsec / XSEC_PER_SEC;
412 usec = (unsigned long)xsec & (XSEC_PER_SEC - 1);
413 usec = SCALE_XSEC(usec, 1000000);
414
415 tv->tv_sec = sec;
416 tv->tv_usec = usec;
417}
418
419void do_gettimeofday(struct timeval *tv)
420{
421 if (__USE_RTC()) {
422 /* do this the old way */
423 unsigned long flags, seq;
424 unsigned int sec, nsec, usec;
425
426 do {
427 seq = read_seqbegin_irqsave(&xtime_lock, flags);
428 sec = xtime.tv_sec;
429 nsec = xtime.tv_nsec + tb_ticks_since(tb_last_jiffy);
430 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
431 usec = nsec / 1000;
432 while (usec >= 1000000) {
433 usec -= 1000000;
434 ++sec;
435 }
436 tv->tv_sec = sec;
437 tv->tv_usec = usec;
438 return;
439 }
440 __do_gettimeofday(tv);
441}
442
443EXPORT_SYMBOL(do_gettimeofday);
444 373
445/* 374/*
446 * There are two copies of tb_to_xs and stamp_xsec so that no 375 * There are two copies of tb_to_xs and stamp_xsec so that no
@@ -486,56 +415,6 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
486 ++(vdso_data->tb_update_count); 415 ++(vdso_data->tb_update_count);
487} 416}
488 417
489/*
490 * When the timebase - tb_orig_stamp gets too big, we do a manipulation
491 * between tb_orig_stamp and stamp_xsec. The goal here is to keep the
492 * difference tb - tb_orig_stamp small enough to always fit inside a
493 * 32 bits number. This is a requirement of our fast 32 bits userland
494 * implementation in the vdso. If we "miss" a call to this function
495 * (interrupt latency, CPU locked in a spinlock, ...) and we end up
496 * with a too big difference, then the vdso will fallback to calling
497 * the syscall
498 */
499static __inline__ void timer_recalc_offset(u64 cur_tb)
500{
501 unsigned long offset;
502 u64 new_stamp_xsec;
503 u64 tlen, t2x;
504 u64 tb, xsec_old, xsec_new;
505 struct gettimeofday_vars *varp;
506
507 if (__USE_RTC())
508 return;
509 tlen = current_tick_length();
510 offset = cur_tb - do_gtod.varp->tb_orig_stamp;
511 if (tlen == last_tick_len && offset < 0x80000000u)
512 return;
513 if (tlen != last_tick_len) {
514 t2x = mulhdu(tlen << TICKLEN_SHIFT, ticklen_to_xs);
515 last_tick_len = tlen;
516 } else
517 t2x = do_gtod.varp->tb_to_xs;
518 new_stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC;
519 do_div(new_stamp_xsec, 1000000000);
520 new_stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC;
521
522 ++vdso_data->tb_update_count;
523 smp_mb();
524
525 /*
526 * Make sure time doesn't go backwards for userspace gettimeofday.
527 */
528 tb = get_tb();
529 varp = do_gtod.varp;
530 xsec_old = mulhdu(tb - varp->tb_orig_stamp, varp->tb_to_xs)
531 + varp->stamp_xsec;
532 xsec_new = mulhdu(tb - cur_tb, t2x) + new_stamp_xsec;
533 if (xsec_new < xsec_old)
534 new_stamp_xsec += xsec_old - xsec_new;
535
536 update_gtod(cur_tb, new_stamp_xsec, t2x);
537}
538
539#ifdef CONFIG_SMP 418#ifdef CONFIG_SMP
540unsigned long profile_pc(struct pt_regs *regs) 419unsigned long profile_pc(struct pt_regs *regs)
541{ 420{
@@ -607,6 +486,8 @@ static int __init iSeries_tb_recal(void)
607 iSeries_recal_titan = titan; 486 iSeries_recal_titan = titan;
608 iSeries_recal_tb = tb; 487 iSeries_recal_tb = tb;
609 488
489 /* Called here as now we know accurate values for the timebase */
490 clocksource_init();
610 return 0; 491 return 0;
611} 492}
612late_initcall(iSeries_tb_recal); 493late_initcall(iSeries_tb_recal);
@@ -689,8 +570,6 @@ void timer_interrupt(struct pt_regs * regs)
689 if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) { 570 if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) {
690 tb_last_jiffy = tb_next_jiffy; 571 tb_last_jiffy = tb_next_jiffy;
691 do_timer(1); 572 do_timer(1);
692 timer_recalc_offset(tb_last_jiffy);
693 timer_check_rtc();
694 } 573 }
695 write_sequnlock(&xtime_lock); 574 write_sequnlock(&xtime_lock);
696 } 575 }
@@ -762,71 +641,6 @@ unsigned long long sched_clock(void)
762 return mulhdu(get_tb() - boot_tb, tb_to_ns_scale) << tb_to_ns_shift; 641 return mulhdu(get_tb() - boot_tb, tb_to_ns_scale) << tb_to_ns_shift;
763} 642}
764 643
765int do_settimeofday(struct timespec *tv)
766{
767 time_t wtm_sec, new_sec = tv->tv_sec;
768 long wtm_nsec, new_nsec = tv->tv_nsec;
769 unsigned long flags;
770 u64 new_xsec;
771 unsigned long tb_delta;
772
773 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
774 return -EINVAL;
775
776 write_seqlock_irqsave(&xtime_lock, flags);
777
778 /*
779 * Updating the RTC is not the job of this code. If the time is
780 * stepped under NTP, the RTC will be updated after STA_UNSYNC
781 * is cleared. Tools like clock/hwclock either copy the RTC
782 * to the system time, in which case there is no point in writing
783 * to the RTC again, or write to the RTC but then they don't call
784 * settimeofday to perform this operation.
785 */
786
787 /* Make userspace gettimeofday spin until we're done. */
788 ++vdso_data->tb_update_count;
789 smp_mb();
790
791 /*
792 * Subtract off the number of nanoseconds since the
793 * beginning of the last tick.
794 */
795 tb_delta = tb_ticks_since(tb_last_jiffy);
796 tb_delta = mulhdu(tb_delta, do_gtod.varp->tb_to_xs); /* in xsec */
797 new_nsec -= SCALE_XSEC(tb_delta, 1000000000);
798
799 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - new_sec);
800 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - new_nsec);
801
802 set_normalized_timespec(&xtime, new_sec, new_nsec);
803 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
804
805 /* In case of a large backwards jump in time with NTP, we want the
806 * clock to be updated as soon as the PLL is again in lock.
807 */
808 last_rtc_update = new_sec - 658;
809
810 ntp_clear();
811
812 new_xsec = xtime.tv_nsec;
813 if (new_xsec != 0) {
814 new_xsec *= XSEC_PER_SEC;
815 do_div(new_xsec, NSEC_PER_SEC);
816 }
817 new_xsec += (u64)xtime.tv_sec * XSEC_PER_SEC;
818 update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs);
819
820 vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
821 vdso_data->tz_dsttime = sys_tz.tz_dsttime;
822
823 write_sequnlock_irqrestore(&xtime_lock, flags);
824 clock_was_set();
825 return 0;
826}
827
828EXPORT_SYMBOL(do_settimeofday);
829
830static int __init get_freq(char *name, int cells, unsigned long *val) 644static int __init get_freq(char *name, int cells, unsigned long *val)
831{ 645{
832 struct device_node *cpu; 646 struct device_node *cpu;
@@ -869,7 +683,7 @@ void __init generic_calibrate_decr(void)
869 "(not found)\n"); 683 "(not found)\n");
870 } 684 }
871 685
872#ifdef CONFIG_BOOKE 686#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
873 /* Set the time base to zero */ 687 /* Set the time base to zero */
874 mtspr(SPRN_TBWL, 0); 688 mtspr(SPRN_TBWL, 0);
875 mtspr(SPRN_TBWU, 0); 689 mtspr(SPRN_TBWU, 0);
@@ -882,12 +696,35 @@ void __init generic_calibrate_decr(void)
882#endif 696#endif
883} 697}
884 698
885unsigned long get_boot_time(void) 699int update_persistent_clock(struct timespec now)
700{
701 struct rtc_time tm;
702
703 if (!ppc_md.set_rtc_time)
704 return 0;
705
706 to_tm(now.tv_sec + 1 + timezone_offset, &tm);
707 tm.tm_year -= 1900;
708 tm.tm_mon -= 1;
709
710 return ppc_md.set_rtc_time(&tm);
711}
712
713unsigned long read_persistent_clock(void)
886{ 714{
887 struct rtc_time tm; 715 struct rtc_time tm;
716 static int first = 1;
888 717
889 if (ppc_md.get_boot_time) 718 /* XXX this is a litle fragile but will work okay in the short term */
890 return ppc_md.get_boot_time(); 719 if (first) {
720 first = 0;
721 if (ppc_md.time_init)
722 timezone_offset = ppc_md.time_init();
723
724 /* get_boot_time() isn't guaranteed to be safe to call late */
725 if (ppc_md.get_boot_time)
726 return ppc_md.get_boot_time() -timezone_offset;
727 }
891 if (!ppc_md.get_rtc_time) 728 if (!ppc_md.get_rtc_time)
892 return 0; 729 return 0;
893 ppc_md.get_rtc_time(&tm); 730 ppc_md.get_rtc_time(&tm);
@@ -895,18 +732,77 @@ unsigned long get_boot_time(void)
895 tm.tm_hour, tm.tm_min, tm.tm_sec); 732 tm.tm_hour, tm.tm_min, tm.tm_sec);
896} 733}
897 734
735/* clocksource code */
736static cycle_t rtc_read(void)
737{
738 return (cycle_t)get_rtc();
739}
740
741static cycle_t timebase_read(void)
742{
743 return (cycle_t)get_tb();
744}
745
746void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
747{
748 u64 t2x, stamp_xsec;
749
750 if (clock != &clocksource_timebase)
751 return;
752
753 /* Make userspace gettimeofday spin until we're done. */
754 ++vdso_data->tb_update_count;
755 smp_mb();
756
757 /* XXX this assumes clock->shift == 22 */
758 /* 4611686018 ~= 2^(20+64-22) / 1e9 */
759 t2x = (u64) clock->mult * 4611686018ULL;
760 stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC;
761 do_div(stamp_xsec, 1000000000);
762 stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC;
763 update_gtod(clock->cycle_last, stamp_xsec, t2x);
764}
765
766void update_vsyscall_tz(void)
767{
768 /* Make userspace gettimeofday spin until we're done. */
769 ++vdso_data->tb_update_count;
770 smp_mb();
771 vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
772 vdso_data->tz_dsttime = sys_tz.tz_dsttime;
773 smp_mb();
774 ++vdso_data->tb_update_count;
775}
776
777void __init clocksource_init(void)
778{
779 struct clocksource *clock;
780
781 if (__USE_RTC())
782 clock = &clocksource_rtc;
783 else
784 clock = &clocksource_timebase;
785
786 clock->mult = clocksource_hz2mult(tb_ticks_per_sec, clock->shift);
787
788 if (clocksource_register(clock)) {
789 printk(KERN_ERR "clocksource: %s is already registered\n",
790 clock->name);
791 return;
792 }
793
794 printk(KERN_INFO "clocksource: %s mult[%x] shift[%d] registered\n",
795 clock->name, clock->mult, clock->shift);
796}
797
898/* This function is only called on the boot processor */ 798/* This function is only called on the boot processor */
899void __init time_init(void) 799void __init time_init(void)
900{ 800{
901 unsigned long flags; 801 unsigned long flags;
902 unsigned long tm = 0;
903 struct div_result res; 802 struct div_result res;
904 u64 scale, x; 803 u64 scale, x;
905 unsigned shift; 804 unsigned shift;
906 805
907 if (ppc_md.time_init != NULL)
908 timezone_offset = ppc_md.time_init();
909
910 if (__USE_RTC()) { 806 if (__USE_RTC()) {
911 /* 601 processor: dec counts down by 128 every 128ns */ 807 /* 601 processor: dec counts down by 128 every 128ns */
912 ppc_tb_freq = 1000000000; 808 ppc_tb_freq = 1000000000;
@@ -981,19 +877,14 @@ void __init time_init(void)
981 /* Save the current timebase to pretty up CONFIG_PRINTK_TIME */ 877 /* Save the current timebase to pretty up CONFIG_PRINTK_TIME */
982 boot_tb = get_tb_or_rtc(); 878 boot_tb = get_tb_or_rtc();
983 879
984 tm = get_boot_time();
985
986 write_seqlock_irqsave(&xtime_lock, flags); 880 write_seqlock_irqsave(&xtime_lock, flags);
987 881
988 /* If platform provided a timezone (pmac), we correct the time */ 882 /* If platform provided a timezone (pmac), we correct the time */
989 if (timezone_offset) { 883 if (timezone_offset) {
990 sys_tz.tz_minuteswest = -timezone_offset / 60; 884 sys_tz.tz_minuteswest = -timezone_offset / 60;
991 sys_tz.tz_dsttime = 0; 885 sys_tz.tz_dsttime = 0;
992 tm -= timezone_offset;
993 } 886 }
994 887
995 xtime.tv_sec = tm;
996 xtime.tv_nsec = 0;
997 do_gtod.varp = &do_gtod.vars[0]; 888 do_gtod.varp = &do_gtod.vars[0];
998 do_gtod.var_idx = 0; 889 do_gtod.var_idx = 0;
999 do_gtod.varp->tb_orig_stamp = tb_last_jiffy; 890 do_gtod.varp->tb_orig_stamp = tb_last_jiffy;
@@ -1011,11 +902,12 @@ void __init time_init(void)
1011 902
1012 time_freq = 0; 903 time_freq = 0;
1013 904
1014 last_rtc_update = xtime.tv_sec;
1015 set_normalized_timespec(&wall_to_monotonic,
1016 -xtime.tv_sec, -xtime.tv_nsec);
1017 write_sequnlock_irqrestore(&xtime_lock, flags); 905 write_sequnlock_irqrestore(&xtime_lock, flags);
1018 906
907 /* Register the clocksource, if we're not running on iSeries */
908 if (!firmware_has_feature(FW_FEATURE_ISERIES))
909 clocksource_init();
910
1019 /* Not exact, but the timer interrupt takes care of this */ 911 /* Not exact, but the timer interrupt takes care of this */
1020 set_dec(tb_ticks_per_jiffy); 912 set_dec(tb_ticks_per_jiffy);
1021} 913}
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index d8502e377518..5a49eabd492e 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -324,47 +324,10 @@ static inline int check_io_access(struct pt_regs *regs)
324#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE) 324#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
325#endif 325#endif
326 326
327/* 327static int generic_machine_check_exception(struct pt_regs *regs)
328 * This is "fall-back" implementation for configurations
329 * which don't provide platform-specific machine check info
330 */
331void __attribute__ ((weak))
332platform_machine_check(struct pt_regs *regs)
333{ 328{
334}
335
336void machine_check_exception(struct pt_regs *regs)
337{
338 int recover = 0;
339 unsigned long reason = get_mc_reason(regs); 329 unsigned long reason = get_mc_reason(regs);
340 330
341 /* See if any machine dependent calls */
342 if (ppc_md.machine_check_exception)
343 recover = ppc_md.machine_check_exception(regs);
344
345 if (recover)
346 return;
347
348 if (user_mode(regs)) {
349 regs->msr |= MSR_RI;
350 _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
351 return;
352 }
353
354#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
355 /* the qspan pci read routines can cause machine checks -- Cort */
356 bad_page_fault(regs, regs->dar, SIGBUS);
357 return;
358#endif
359
360 if (debugger_fault_handler(regs)) {
361 regs->msr |= MSR_RI;
362 return;
363 }
364
365 if (check_io_access(regs))
366 return;
367
368#if defined(CONFIG_4xx) && !defined(CONFIG_440A) 331#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
369 if (reason & ESR_IMCP) { 332 if (reason & ESR_IMCP) {
370 printk("Instruction"); 333 printk("Instruction");
@@ -480,11 +443,41 @@ void machine_check_exception(struct pt_regs *regs)
480 } 443 }
481#endif /* CONFIG_4xx */ 444#endif /* CONFIG_4xx */
482 445
483 /* 446 return 0;
484 * Optional platform-provided routine to print out 447}
485 * additional info, e.g. bus error registers. 448
486 */ 449void machine_check_exception(struct pt_regs *regs)
487 platform_machine_check(regs); 450{
451 int recover = 0;
452
453 /* See if any machine dependent calls */
454 if (ppc_md.machine_check_exception)
455 recover = ppc_md.machine_check_exception(regs);
456 else
457 recover = generic_machine_check_exception(regs);
458
459 if (recover)
460 return;
461
462 if (user_mode(regs)) {
463 regs->msr |= MSR_RI;
464 _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
465 return;
466 }
467
468#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
469 /* the qspan pci read routines can cause machine checks -- Cort */
470 bad_page_fault(regs, regs->dar, SIGBUS);
471 return;
472#endif
473
474 if (debugger_fault_handler(regs)) {
475 regs->msr |= MSR_RI;
476 return;
477 }
478
479 if (check_io_access(regs))
480 return;
488 481
489 if (debugger_fault_handler(regs)) 482 if (debugger_fault_handler(regs))
490 return; 483 return;
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c
index 7afab5bcd61a..833a3d0bcfa7 100644
--- a/arch/powerpc/kernel/udbg_16550.c
+++ b/arch/powerpc/kernel/udbg_16550.c
@@ -206,11 +206,22 @@ static void udbg_44x_as1_putc(char c)
206 } 206 }
207} 207}
208 208
209static int udbg_44x_as1_getc(void)
210{
211 if (udbg_comport) {
212 while ((as1_readb(&udbg_comport->lsr) & LSR_DR) == 0)
213 ; /* wait for char */
214 return as1_readb(&udbg_comport->rbr);
215 }
216 return -1;
217}
218
209void __init udbg_init_44x_as1(void) 219void __init udbg_init_44x_as1(void)
210{ 220{
211 udbg_comport = 221 udbg_comport =
212 (volatile struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR; 222 (volatile struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR;
213 223
214 udbg_putc = udbg_44x_as1_putc; 224 udbg_putc = udbg_44x_as1_putc;
225 udbg_getc = udbg_44x_as1_getc;
215} 226}
216#endif /* CONFIG_PPC_EARLY_DEBUG_44x */ 227#endif /* CONFIG_PPC_EARLY_DEBUG_44x */
diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile
index 3726358faae8..c3d57bd01a88 100644
--- a/arch/powerpc/kernel/vdso32/Makefile
+++ b/arch/powerpc/kernel/vdso32/Makefile
@@ -9,11 +9,11 @@ ifeq ($(CONFIG_PPC32),y)
9CROSS32CC := $(CC) 9CROSS32CC := $(CC)
10endif 10endif
11 11
12targets := $(obj-vdso32) vdso32.so 12targets := $(obj-vdso32) vdso32.so vdso32.so.dbg
13obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32)) 13obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))
14 14
15 15
16EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin 16EXTRA_CFLAGS := -shared -fno-common -fno-builtin
17EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ 17EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \
18 $(call ld-option, -Wl$(comma)--hash-style=sysv) 18 $(call ld-option, -Wl$(comma)--hash-style=sysv)
19EXTRA_AFLAGS := -D__VDSO32__ -s 19EXTRA_AFLAGS := -D__VDSO32__ -s
@@ -26,9 +26,14 @@ CPPFLAGS_vdso32.lds += -P -C -Upowerpc
26$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so 26$(obj)/vdso32_wrapper.o : $(obj)/vdso32.so
27 27
28# link rule for the .so file, .lds has to be first 28# link rule for the .so file, .lds has to be first
29$(obj)/vdso32.so: $(src)/vdso32.lds $(obj-vdso32) 29$(obj)/vdso32.so.dbg: $(src)/vdso32.lds $(obj-vdso32)
30 $(call if_changed,vdso32ld) 30 $(call if_changed,vdso32ld)
31 31
32# strip rule for the .so file
33$(obj)/%.so: OBJCOPYFLAGS := -S
34$(obj)/%.so: $(obj)/%.so.dbg FORCE
35 $(call if_changed,objcopy)
36
32# assembly rules for the .S files 37# assembly rules for the .S files
33$(obj-vdso32): %.o: %.S 38$(obj-vdso32): %.o: %.S
34 $(call if_changed_dep,vdso32as) 39 $(call if_changed_dep,vdso32as)
@@ -39,3 +44,12 @@ quiet_cmd_vdso32ld = VDSO32L $@
39quiet_cmd_vdso32as = VDSO32A $@ 44quiet_cmd_vdso32as = VDSO32A $@
40 cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $< 45 cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
41 46
47# install commands for the unstripped file
48quiet_cmd_vdso_install = INSTALL $@
49 cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
50
51vdso32.so: $(obj)/vdso32.so.dbg
52 @mkdir -p $(MODLIB)/vdso
53 $(call cmd,vdso_install)
54
55vdso_install: vdso32.so
diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile
index 43af9b2a6f3b..fa7f1b8f3e50 100644
--- a/arch/powerpc/kernel/vdso64/Makefile
+++ b/arch/powerpc/kernel/vdso64/Makefile
@@ -4,10 +4,10 @@ obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o
4 4
5# Build rules 5# Build rules
6 6
7targets := $(obj-vdso64) vdso64.so 7targets := $(obj-vdso64) vdso64.so vdso64.so.dbg
8obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64)) 8obj-vdso64 := $(addprefix $(obj)/, $(obj-vdso64))
9 9
10EXTRA_CFLAGS := -shared -s -fno-common -fno-builtin 10EXTRA_CFLAGS := -shared -fno-common -fno-builtin
11EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ 11EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \
12 $(call ld-option, -Wl$(comma)--hash-style=sysv) 12 $(call ld-option, -Wl$(comma)--hash-style=sysv)
13EXTRA_AFLAGS := -D__VDSO64__ -s 13EXTRA_AFLAGS := -D__VDSO64__ -s
@@ -20,9 +20,14 @@ CPPFLAGS_vdso64.lds += -P -C -U$(ARCH)
20$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so 20$(obj)/vdso64_wrapper.o : $(obj)/vdso64.so
21 21
22# link rule for the .so file, .lds has to be first 22# link rule for the .so file, .lds has to be first
23$(obj)/vdso64.so: $(src)/vdso64.lds $(obj-vdso64) 23$(obj)/vdso64.so.dbg: $(src)/vdso64.lds $(obj-vdso64)
24 $(call if_changed,vdso64ld) 24 $(call if_changed,vdso64ld)
25 25
26# strip rule for the .so file
27$(obj)/%.so: OBJCOPYFLAGS := -S
28$(obj)/%.so: $(obj)/%.so.dbg FORCE
29 $(call if_changed,objcopy)
30
26# assembly rules for the .S files 31# assembly rules for the .S files
27$(obj-vdso64): %.o: %.S 32$(obj-vdso64): %.o: %.S
28 $(call if_changed_dep,vdso64as) 33 $(call if_changed_dep,vdso64as)
@@ -33,4 +38,12 @@ quiet_cmd_vdso64ld = VDSO64L $@
33quiet_cmd_vdso64as = VDSO64A $@ 38quiet_cmd_vdso64as = VDSO64A $@
34 cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $< 39 cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
35 40
41# install commands for the unstripped file
42quiet_cmd_vdso_install = INSTALL $@
43 cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
44
45vdso64.so: $(obj)/vdso64.so.dbg
46 @mkdir -p $(MODLIB)/vdso
47 $(call cmd,vdso_install)
36 48
49vdso_install: vdso64.so
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 62c1bc12ea39..1d7b272b3737 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -39,6 +39,8 @@
39 39
40extern struct kset devices_subsys; /* needed for vio_find_name() */ 40extern struct kset devices_subsys; /* needed for vio_find_name() */
41 41
42static struct bus_type vio_bus_type;
43
42static struct vio_dev vio_bus_device = { /* fake "parent" device */ 44static struct vio_dev vio_bus_device = { /* fake "parent" device */
43 .name = vio_bus_device.dev.bus_id, 45 .name = vio_bus_device.dev.bus_id,
44 .type = "", 46 .type = "",
@@ -64,6 +66,12 @@ static void __init iommu_vio_init(void)
64 printk("Virtual Bus VETH TCE table failed.\n"); 66 printk("Virtual Bus VETH TCE table failed.\n");
65 if (!iommu_init_table(&vio_iommu_table, -1)) 67 if (!iommu_init_table(&vio_iommu_table, -1))
66 printk("Virtual Bus VIO TCE table failed.\n"); 68 printk("Virtual Bus VIO TCE table failed.\n");
69 vio_bus_device.dev.archdata.dma_ops = &dma_iommu_ops;
70 vio_bus_device.dev.archdata.dma_data = &vio_iommu_table;
71}
72#else
73static void __init iommu_vio_init(void)
74{
67} 75}
68#endif 76#endif
69 77
@@ -282,14 +290,8 @@ static int __init vio_bus_init(void)
282 int err; 290 int err;
283 struct device_node *node_vroot; 291 struct device_node *node_vroot;
284 292
285#ifdef CONFIG_PPC_ISERIES 293 if (firmware_has_feature(FW_FEATURE_ISERIES))
286 if (firmware_has_feature(FW_FEATURE_ISERIES)) {
287 iommu_vio_init(); 294 iommu_vio_init();
288 vio_bus_device.dev.archdata.dma_ops = &dma_iommu_ops;
289 vio_bus_device.dev.archdata.dma_data = &vio_iommu_table;
290 iSeries_vio_dev = &vio_bus_device.dev;
291 }
292#endif /* CONFIG_PPC_ISERIES */
293 295
294 err = bus_register(&vio_bus_type); 296 err = bus_register(&vio_bus_type);
295 if (err) { 297 if (err) {
@@ -317,11 +319,8 @@ static int __init vio_bus_init(void)
317 * the device tree. Drivers will associate with them later. 319 * the device tree. Drivers will associate with them later.
318 */ 320 */
319 for (of_node = node_vroot->child; of_node != NULL; 321 for (of_node = node_vroot->child; of_node != NULL;
320 of_node = of_node->sibling) { 322 of_node = of_node->sibling)
321 printk(KERN_DEBUG "%s: processing %p\n",
322 __FUNCTION__, of_node);
323 vio_register_device_node(of_node); 323 vio_register_device_node(of_node);
324 }
325 of_node_put(node_vroot); 324 of_node_put(node_vroot);
326 } 325 }
327 326
@@ -391,7 +390,7 @@ static int vio_hotplug(struct device *dev, char **envp, int num_envp,
391 return 0; 390 return 0;
392} 391}
393 392
394struct bus_type vio_bus_type = { 393static struct bus_type vio_bus_type = {
395 .name = "vio", 394 .name = "vio",
396 .dev_attrs = vio_dev_attrs, 395 .dev_attrs = vio_dev_attrs,
397 .uevent = vio_hotplug, 396 .uevent = vio_hotplug,
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 0c458556399f..823a8cbd60b5 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -34,6 +34,8 @@ SECTIONS
34 34
35 /* Text and gots */ 35 /* Text and gots */
36 .text : { 36 .text : {
37 ALIGN_FUNCTION();
38 *(.text.head)
37 _text = .; 39 _text = .;
38 TEXT_TEXT 40 TEXT_TEXT
39 SCHED_TEXT 41 SCHED_TEXT
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 0a486d4b2547..65d492e316a6 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -7,11 +7,12 @@ EXTRA_CFLAGS += -mno-minimal-toc
7endif 7endif
8 8
9ifeq ($(CONFIG_PPC_MERGE),y) 9ifeq ($(CONFIG_PPC_MERGE),y)
10obj-y := string.o 10obj-y := string.o alloc.o \
11obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o 11 checksum_$(CONFIG_WORD_SIZE).o
12obj-$(CONFIG_PPC32) += div64.o copy_32.o
12endif 13endif
13 14
14obj-$(CONFIG_PPC64) += checksum_64.o copypage_64.o copyuser_64.o \ 15obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \
15 memcpy_64.o usercopy_64.o mem_64.o string.o 16 memcpy_64.o usercopy_64.o mem_64.o string.o
16obj-$(CONFIG_QUICC_ENGINE) += rheap.o 17obj-$(CONFIG_QUICC_ENGINE) += rheap.o
17obj-$(CONFIG_XMON) += sstep.o 18obj-$(CONFIG_XMON) += sstep.o
diff --git a/arch/powerpc/lib/alloc.c b/arch/powerpc/lib/alloc.c
new file mode 100644
index 000000000000..f53e09c7dac7
--- /dev/null
+++ b/arch/powerpc/lib/alloc.c
@@ -0,0 +1,29 @@
1#include <linux/types.h>
2#include <linux/init.h>
3#include <linux/slab.h>
4#include <linux/bootmem.h>
5#include <linux/string.h>
6
7#include <asm/system.h>
8
9void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask)
10{
11 if (mem_init_done)
12 return kmalloc(size, mask);
13 else
14 return alloc_bootmem(size);
15}
16
17void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask)
18{
19 void *p;
20
21 if (mem_init_done)
22 p = kzalloc(size, mask);
23 else {
24 p = alloc_bootmem(size);
25 if (p)
26 memset(p, 0, size);
27 }
28 return p;
29}
diff --git a/arch/powerpc/mm/4xx_mmu.c b/arch/powerpc/mm/40x_mmu.c
index 7ff2609b64d1..e067df836be2 100644
--- a/arch/powerpc/mm/4xx_mmu.c
+++ b/arch/powerpc/mm/40x_mmu.c
@@ -108,7 +108,7 @@ unsigned long __init mmu_mapin_ram(void)
108 pmd_t *pmdp; 108 pmd_t *pmdp;
109 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE; 109 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;
110 110
111 pmdp = pmd_offset(pgd_offset_k(v), v); 111 pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v);
112 pmd_val(*pmdp++) = val; 112 pmd_val(*pmdp++) = val;
113 pmd_val(*pmdp++) = val; 113 pmd_val(*pmdp++) = val;
114 pmd_val(*pmdp++) = val; 114 pmd_val(*pmdp++) = val;
@@ -123,7 +123,7 @@ unsigned long __init mmu_mapin_ram(void)
123 pmd_t *pmdp; 123 pmd_t *pmdp;
124 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE; 124 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;
125 125
126 pmdp = pmd_offset(pgd_offset_k(v), v); 126 pmdp = pmd_offset(pud_offset(pgd_offset_k(v), v), v);
127 pmd_val(*pmdp) = val; 127 pmd_val(*pmdp) = val;
128 128
129 v += LARGE_PAGE_SIZE_4M; 129 v += LARGE_PAGE_SIZE_4M;
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 7e4d27ad3dee..20629ae95c50 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -6,14 +6,17 @@ ifeq ($(CONFIG_PPC64),y)
6EXTRA_CFLAGS += -mno-minimal-toc 6EXTRA_CFLAGS += -mno-minimal-toc
7endif 7endif
8 8
9obj-y := fault.o mem.o lmb.o 9obj-y := fault.o mem.o lmb.o \
10obj-$(CONFIG_PPC32) += init_32.o pgtable_32.o mmu_context_32.o 10 init_$(CONFIG_WORD_SIZE).o \
11 pgtable_$(CONFIG_WORD_SIZE).o \
12 mmu_context_$(CONFIG_WORD_SIZE).o
11hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o 13hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o
12obj-$(CONFIG_PPC64) += init_64.o pgtable_64.o mmu_context_64.o \ 14obj-$(CONFIG_PPC64) += hash_utils_64.o \
13 hash_utils_64.o hash_low_64.o tlb_64.o \
14 slb_low.o slb.o stab.o mmap.o $(hash-y) 15 slb_low.o slb.o stab.o mmap.o $(hash-y)
15obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o hash_low_32.o tlb_32.o 16obj-$(CONFIG_PPC_STD_MMU_32) += ppc_mmu_32.o
16obj-$(CONFIG_40x) += 4xx_mmu.o 17obj-$(CONFIG_PPC_STD_MMU) += hash_low_$(CONFIG_WORD_SIZE).o \
18 tlb_$(CONFIG_WORD_SIZE).o
19obj-$(CONFIG_40x) += 40x_mmu.o
17obj-$(CONFIG_44x) += 44x_mmu.o 20obj-$(CONFIG_44x) += 44x_mmu.o
18obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o 21obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o
19obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o 22obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index a47151e806ca..d525f2eba313 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -49,7 +49,6 @@
49#include <asm/tlb.h> 49#include <asm/tlb.h>
50#include <asm/cacheflush.h> 50#include <asm/cacheflush.h>
51#include <asm/cputable.h> 51#include <asm/cputable.h>
52#include <asm/abs_addr.h>
53#include <asm/sections.h> 52#include <asm/sections.h>
54#include <asm/spu.h> 53#include <asm/spu.h>
55 54
@@ -602,13 +601,7 @@ static void demote_segment_4k(struct mm_struct *mm, unsigned long addr)
602{ 601{
603 if (mm->context.user_psize == MMU_PAGE_4K) 602 if (mm->context.user_psize == MMU_PAGE_4K)
604 return; 603 return;
605#ifdef CONFIG_PPC_MM_SLICES
606 slice_set_user_psize(mm, MMU_PAGE_4K); 604 slice_set_user_psize(mm, MMU_PAGE_4K);
607#else /* CONFIG_PPC_MM_SLICES */
608 mm->context.user_psize = MMU_PAGE_4K;
609 mm->context.sllp = SLB_VSID_USER | mmu_psize_defs[MMU_PAGE_4K].sllp;
610#endif /* CONFIG_PPC_MM_SLICES */
611
612#ifdef CONFIG_SPU_BASE 605#ifdef CONFIG_SPU_BASE
613 spu_flush_all_slbs(mm); 606 spu_flush_all_slbs(mm);
614#endif 607#endif
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 4835f73af304..ba5f12a60467 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -22,11 +22,8 @@
22#include <asm/mmu_context.h> 22#include <asm/mmu_context.h>
23#include <asm/machdep.h> 23#include <asm/machdep.h>
24#include <asm/cputable.h> 24#include <asm/cputable.h>
25#include <asm/tlb.h>
26#include <asm/spu.h> 25#include <asm/spu.h>
27 26
28#include <linux/sysctl.h>
29
30#define NUM_LOW_AREAS (0x100000000UL >> SID_SHIFT) 27#define NUM_LOW_AREAS (0x100000000UL >> SID_SHIFT)
31#define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT) 28#define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT)
32 29
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index e1f5ded851f6..27c234fb5118 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -41,7 +41,6 @@
41#include <asm/machdep.h> 41#include <asm/machdep.h>
42#include <asm/btext.h> 42#include <asm/btext.h>
43#include <asm/tlb.h> 43#include <asm/tlb.h>
44#include <asm/prom.h>
45#include <asm/lmb.h> 44#include <asm/lmb.h>
46#include <asm/sections.h> 45#include <asm/sections.h>
47 46
@@ -256,3 +255,40 @@ void free_initrd_mem(unsigned long start, unsigned long end)
256 } 255 }
257} 256}
258#endif 257#endif
258
259#ifdef CONFIG_PROC_KCORE
260static struct kcore_list kcore_vmem;
261
262static int __init setup_kcore(void)
263{
264 int i;
265
266 for (i = 0; i < lmb.memory.cnt; i++) {
267 unsigned long base;
268 unsigned long size;
269 struct kcore_list *kcore_mem;
270
271 base = lmb.memory.region[i].base;
272 size = lmb.memory.region[i].size;
273
274 kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
275 if (!kcore_mem)
276 panic("%s: kmalloc failed\n", __FUNCTION__);
277
278 /* must stay under 32 bits */
279 if ( 0xfffffffful - (unsigned long)__va(base) < size) {
280 size = 0xfffffffful - (unsigned long)(__va(base));
281 printk(KERN_DEBUG "setup_kcore: restrict size=%lx\n",
282 size);
283 }
284
285 kclist_add(kcore_mem, __va(base), size);
286 }
287
288 kclist_add(&kcore_vmem, (void *)VMALLOC_START,
289 VMALLOC_END-VMALLOC_START);
290
291 return 0;
292}
293module_init(setup_kcore);
294#endif
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 9f27bb56a61d..fa90f6561b9f 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -113,6 +113,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
113} 113}
114#endif 114#endif
115 115
116#ifdef CONFIG_PROC_KCORE
116static struct kcore_list kcore_vmem; 117static struct kcore_list kcore_vmem;
117 118
118static int __init setup_kcore(void) 119static int __init setup_kcore(void)
@@ -139,6 +140,7 @@ static int __init setup_kcore(void)
139 return 0; 140 return 0;
140} 141}
141module_init(setup_kcore); 142module_init(setup_kcore);
143#endif
142 144
143static void zero_ctor(void *addr, struct kmem_cache *cache, unsigned long flags) 145static void zero_ctor(void *addr, struct kmem_cache *cache, unsigned long flags)
144{ 146{
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index f0e7eedb1ba3..32dcfc9b0082 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -42,7 +42,6 @@
42#include <asm/machdep.h> 42#include <asm/machdep.h>
43#include <asm/btext.h> 43#include <asm/btext.h>
44#include <asm/tlb.h> 44#include <asm/tlb.h>
45#include <asm/prom.h>
46#include <asm/lmb.h> 45#include <asm/lmb.h>
47#include <asm/sections.h> 46#include <asm/sections.h>
48#include <asm/vdso.h> 47#include <asm/vdso.h>
diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c
index 7a78cdc0515a..1db38ba1f544 100644
--- a/arch/powerpc/mm/mmu_context_64.c
+++ b/arch/powerpc/mm/mmu_context_64.c
@@ -28,7 +28,6 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
28{ 28{
29 int index; 29 int index;
30 int err; 30 int err;
31 int new_context = (mm->context.id == 0);
32 31
33again: 32again:
34 if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL)) 33 if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL))
@@ -50,19 +49,13 @@ again:
50 return -ENOMEM; 49 return -ENOMEM;
51 } 50 }
52 51
53 mm->context.id = index;
54#ifdef CONFIG_PPC_MM_SLICES
55 /* The old code would re-promote on fork, we don't do that 52 /* The old code would re-promote on fork, we don't do that
56 * when using slices as it could cause problem promoting slices 53 * when using slices as it could cause problem promoting slices
57 * that have been forced down to 4K 54 * that have been forced down to 4K
58 */ 55 */
59 if (new_context) 56 if (slice_mm_new_context(mm))
60 slice_set_user_psize(mm, mmu_virtual_psize); 57 slice_set_user_psize(mm, mmu_virtual_psize);
61#else 58 mm->context.id = index;
62 mm->context.user_psize = mmu_virtual_psize;
63 mm->context.sllp = SLB_VSID_USER |
64 mmu_psize_defs[mmu_virtual_psize].sllp;
65#endif
66 59
67 return 0; 60 return 0;
68} 61}
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index 3dfd10db931a..60fd52cd270f 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -228,5 +228,7 @@ void iounmap(volatile void __iomem *token)
228EXPORT_SYMBOL(ioremap); 228EXPORT_SYMBOL(ioremap);
229EXPORT_SYMBOL(ioremap_flags); 229EXPORT_SYMBOL(ioremap_flags);
230EXPORT_SYMBOL(__ioremap); 230EXPORT_SYMBOL(__ioremap);
231EXPORT_SYMBOL(__ioremap_at);
231EXPORT_SYMBOL(iounmap); 232EXPORT_SYMBOL(iounmap);
232EXPORT_SYMBOL(__iounmap); 233EXPORT_SYMBOL(__iounmap);
234EXPORT_SYMBOL(__iounmap_at);
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index ff1811ac6c81..4bee1cfa9dea 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -59,14 +59,12 @@ static inline void slb_shadow_update(unsigned long ea,
59{ 59{
60 /* 60 /*
61 * Clear the ESID first so the entry is not valid while we are 61 * Clear the ESID first so the entry is not valid while we are
62 * updating it. 62 * updating it. No write barriers are needed here, provided
63 * we only update the current CPU's SLB shadow buffer.
63 */ 64 */
64 get_slb_shadow()->save_area[entry].esid = 0; 65 get_slb_shadow()->save_area[entry].esid = 0;
65 smp_wmb();
66 get_slb_shadow()->save_area[entry].vsid = mk_vsid_data(ea, flags); 66 get_slb_shadow()->save_area[entry].vsid = mk_vsid_data(ea, flags);
67 smp_wmb();
68 get_slb_shadow()->save_area[entry].esid = mk_esid_data(ea, entry); 67 get_slb_shadow()->save_area[entry].esid = mk_esid_data(ea, entry);
69 smp_wmb();
70} 68}
71 69
72static inline void slb_shadow_clear(unsigned long entry) 70static inline void slb_shadow_clear(unsigned long entry)
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index d5fd3909d13a..319826ef1645 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -551,6 +551,7 @@ EXPORT_SYMBOL_GPL(get_slice_psize);
551 * 551 *
552 * This is also called in init_new_context() to change back the user 552 * This is also called in init_new_context() to change back the user
553 * psize from whatever the parent context had it set to 553 * psize from whatever the parent context had it set to
554 * N.B. This may be called before mm->context.id has been set.
554 * 555 *
555 * This function will only change the content of the {low,high)_slice_psize 556 * This function will only change the content of the {low,high)_slice_psize
556 * masks, it will not flush SLBs as this shall be handled lazily by the 557 * masks, it will not flush SLBs as this shall be handled lazily by the
diff --git a/arch/powerpc/platforms/4xx/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index ded357c17414..c3dce3b3d524 100644
--- a/arch/powerpc/platforms/4xx/Kconfig
+++ b/arch/powerpc/platforms/40x/Kconfig
@@ -1,16 +1,3 @@
1config 4xx
2 bool
3 depends on 40x || 44x
4 default y
5
6config BOOKE
7 bool
8 depends on 44x
9 default y
10
11menu "AMCC 40x options"
12 depends on 40x
13
14#config BUBINGA 1#config BUBINGA
15# bool "Bubinga" 2# bool "Bubinga"
16# depends on 40x 3# depends on 40x
@@ -66,13 +53,13 @@ menu "AMCC 40x options"
66# help 53# help
67# This option enables support for the IBM PPC405GPr evaluation board. 54# This option enables support for the IBM PPC405GPr evaluation board.
68 55
69#config WALNUT 56config WALNUT
70# bool "Walnut" 57 bool "Walnut"
71# depends on 40x 58 depends on 40x
72# default y 59 default y
73# select 405GP 60 select 405GP
74# help 61 help
75# This option enables support for the IBM PPC405GP evaluation board. 62 This option enables support for the IBM PPC405GP evaluation board.
76 63
77#config XILINX_ML300 64#config XILINX_ML300
78# bool "Xilinx-ML300" 65# bool "Xilinx-ML300"
@@ -82,8 +69,6 @@ menu "AMCC 40x options"
82# help 69# help
83# This option enables support for the Xilinx ML300 evaluation board. 70# This option enables support for the Xilinx ML300 evaluation board.
84 71
85endmenu
86
87# 40x specific CPU modules, selected based on the board above. 72# 40x specific CPU modules, selected based on the board above.
88config NP405H 73config NP405H
89 bool 74 bool
@@ -126,68 +111,6 @@ config IBM405_ERR77
126config IBM405_ERR51 111config IBM405_ERR51
127 bool 112 bool
128 113
129menu "AMCC 44x options"
130 depends on 44x
131
132#config BAMBOO
133# bool "Bamboo"
134# depends on 44x
135# default n
136# select 440EP
137# help
138# This option enables support for the IBM PPC440EP evaluation board.
139
140config EBONY
141 bool "Ebony"
142 depends on 44x
143 default y
144 select 440GP
145 help
146 This option enables support for the IBM PPC440GP evaluation board.
147
148#config LUAN
149# bool "Luan"
150# depends on 44x
151# default n
152# select 440SP
153# help
154# This option enables support for the IBM PPC440SP evaluation board.
155
156#config OCOTEA
157# bool "Ocotea"
158# depends on 44x
159# default n
160# select 440GX
161# help
162# This option enables support for the IBM PPC440GX evaluation board.
163
164endmenu
165
166# 44x specific CPU modules, selected based on the board above.
167config 440EP
168 bool
169 select PPC_FPU
170 select IBM440EP_ERR42
171
172config 440GP
173 bool
174 select IBM_NEW_EMAC_ZMII
175
176config 440GX
177 bool
178
179config 440SP
180 bool
181
182config 440A
183 bool
184 depends on 440GX
185 default y
186
187# 44x errata/workaround config symbols, selected by the CPU models above
188config IBM440EP_ERR42
189 bool
190
191#config XILINX_OCP 114#config XILINX_OCP
192# bool 115# bool
193# depends on XILINX_ML300 116# depends on XILINX_ML300
diff --git a/arch/powerpc/platforms/40x/Makefile b/arch/powerpc/platforms/40x/Makefile
new file mode 100644
index 000000000000..e6c0bbd063a4
--- /dev/null
+++ b/arch/powerpc/platforms/40x/Makefile
@@ -0,0 +1 @@
obj-$(CONFIG_WALNUT) += walnut.o
diff --git a/arch/powerpc/platforms/40x/walnut.c b/arch/powerpc/platforms/40x/walnut.c
new file mode 100644
index 000000000000..c17fdf23b492
--- /dev/null
+++ b/arch/powerpc/platforms/40x/walnut.c
@@ -0,0 +1,68 @@
1/*
2 * Architecture- / platform-specific boot-time initialization code for
3 * IBM PowerPC 4xx based boards. Adapted from original
4 * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
5 * <dan@net4x.com>.
6 *
7 * Copyright(c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
8 *
9 * Rewritten and ported to the merged powerpc tree:
10 * Copyright 2007 IBM Corporation
11 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
12 *
13 * 2002 (c) MontaVista, Software, Inc. This file is licensed under
14 * the terms of the GNU General Public License version 2. This program
15 * is licensed "as is" without any warranty of any kind, whether express
16 * or implied.
17 */
18
19#include <linux/init.h>
20#include <asm/machdep.h>
21#include <asm/prom.h>
22#include <asm/udbg.h>
23#include <asm/time.h>
24#include <asm/uic.h>
25#include <asm/of_platform.h>
26
27static struct of_device_id walnut_of_bus[] = {
28 { .compatible = "ibm,plb3", },
29 { .compatible = "ibm,opb", },
30 { .compatible = "ibm,ebc", },
31 {},
32};
33
34static int __init walnut_device_probe(void)
35{
36 if (!machine_is(walnut))
37 return 0;
38
39 /* FIXME: do bus probe here */
40 of_platform_bus_probe(NULL, walnut_of_bus, NULL);
41
42 return 0;
43}
44device_initcall(walnut_device_probe);
45
46static int __init walnut_probe(void)
47{
48 unsigned long root = of_get_flat_dt_root();
49
50 if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
51 return 0;
52
53 return 1;
54}
55
56static void __init walnut_setup_arch(void)
57{
58}
59
60define_machine(walnut) {
61 .name = "Walnut",
62 .probe = walnut_probe,
63 .setup_arch = walnut_setup_arch,
64 .progress = udbg_progress,
65 .init_IRQ = uic_init_tree,
66 .get_irq = uic_get_irq,
67 .calibrate_decr = generic_calibrate_decr,
68};
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 1b3e008fd148..f28acdcbd6c9 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -1,10 +1,10 @@
1#config BAMBOO 1config BAMBOO
2# bool "Bamboo" 2 bool "Bamboo"
3# depends on 44x 3 depends on 44x
4# default n 4 default n
5# select 440EP 5 select 440EP
6# help 6 help
7# This option enables support for the IBM PPC440EP evaluation board. 7 This option enables support for the IBM PPC440EP evaluation board.
8 8
9config EBONY 9config EBONY
10 bool "Ebony" 10 bool "Ebony"
@@ -14,6 +14,14 @@ config EBONY
14 help 14 help
15 This option enables support for the IBM PPC440GP evaluation board. 15 This option enables support for the IBM PPC440GP evaluation board.
16 16
17config SEQUOIA
18 bool "Sequoia"
19 depends on 44x
20 default n
21 select 440EPX
22 help
23 This option enables support for the AMCC PPC440EPX evaluation board.
24
17#config LUAN 25#config LUAN
18# bool "Luan" 26# bool "Luan"
19# depends on 44x 27# depends on 44x
@@ -35,6 +43,14 @@ config 440EP
35 bool 43 bool
36 select PPC_FPU 44 select PPC_FPU
37 select IBM440EP_ERR42 45 select IBM440EP_ERR42
46# select IBM_NEW_EMAC_ZMII
47
48config 440EPX
49 bool
50 select PPC_FPU
51# Disabled until the new EMAC Driver is merged.
52# select IBM_NEW_EMAC_EMAC4
53# select IBM_NEW_EMAC_ZMII
38 54
39config 440GP 55config 440GP
40 bool 56 bool
@@ -49,7 +65,7 @@ config 440SP
49 65
50config 440A 66config 440A
51 bool 67 bool
52 depends on 440GX 68 depends on 440GX || 440EPX
53 default y 69 default y
54 70
55# 44x errata/workaround config symbols, selected by the CPU models above 71# 44x errata/workaround config symbols, selected by the CPU models above
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 41d0a18a0e44..10ce6740cc7d 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -1,2 +1,4 @@
1obj-$(CONFIG_44x) := misc_44x.o 1obj-$(CONFIG_44x) := misc_44x.o
2obj-$(CONFIG_EBONY) += ebony.o 2obj-$(CONFIG_EBONY) += ebony.o
3obj-$(CONFIG_BAMBOO) += bamboo.o
4obj-$(CONFIG_SEQUOIA) += sequoia.o
diff --git a/arch/powerpc/platforms/44x/bamboo.c b/arch/powerpc/platforms/44x/bamboo.c
new file mode 100644
index 000000000000..9bc45dea078f
--- /dev/null
+++ b/arch/powerpc/platforms/44x/bamboo.c
@@ -0,0 +1,66 @@
1/*
2 * Bamboo board specific routines
3 *
4 * Wade Farnsworth <wfarnsworth@mvista.com>
5 * Copyright 2004 MontaVista Software Inc.
6 *
7 * Rewritten and ported to the merged powerpc tree:
8 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
9 * Copyright 2007 IBM Corporation
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 */
16#include <linux/init.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/of_platform.h>
23#include "44x.h"
24
25static struct of_device_id bamboo_of_bus[] = {
26 { .compatible = "ibm,plb4", },
27 { .compatible = "ibm,opb", },
28 { .compatible = "ibm,ebc", },
29 {},
30};
31
32static int __init bamboo_device_probe(void)
33{
34 if (!machine_is(bamboo))
35 return 0;
36
37 of_platform_bus_probe(NULL, bamboo_of_bus, NULL);
38
39 return 0;
40}
41device_initcall(bamboo_device_probe);
42
43static int __init bamboo_probe(void)
44{
45 unsigned long root = of_get_flat_dt_root();
46
47 if (!of_flat_dt_is_compatible(root, "amcc,bamboo"))
48 return 0;
49
50 return 1;
51}
52
53static void __init bamboo_setup_arch(void)
54{
55}
56
57define_machine(bamboo) {
58 .name = "Bamboo",
59 .probe = bamboo_probe,
60 .setup_arch = bamboo_setup_arch,
61 .progress = udbg_progress,
62 .init_IRQ = uic_init_tree,
63 .get_irq = uic_get_irq,
64 .restart = ppc44x_reset_system,
65 .calibrate_decr = generic_calibrate_decr,
66};
diff --git a/arch/powerpc/platforms/44x/sequoia.c b/arch/powerpc/platforms/44x/sequoia.c
new file mode 100644
index 000000000000..7d0d9d567d25
--- /dev/null
+++ b/arch/powerpc/platforms/44x/sequoia.c
@@ -0,0 +1,66 @@
1/*
2 * Sequoia board specific routines
3 *
4 * Valentine Barshak <vbarshak@ru.mvista.com>
5 * Copyright 2007 MontaVista Software Inc.
6 *
7 * Based on the Bamboo code by
8 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
9 * Copyright 2007 IBM Corporation
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 */
16#include <linux/init.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/of_platform.h>
23#include "44x.h"
24
25static struct of_device_id sequoia_of_bus[] = {
26 { .compatible = "ibm,plb4", },
27 { .compatible = "ibm,opb", },
28 { .compatible = "ibm,ebc", },
29 {},
30};
31
32static int __init sequoia_device_probe(void)
33{
34 if (!machine_is(sequoia))
35 return 0;
36
37 of_platform_bus_probe(NULL, sequoia_of_bus, NULL);
38
39 return 0;
40}
41device_initcall(sequoia_device_probe);
42
43static int __init sequoia_probe(void)
44{
45 unsigned long root = of_get_flat_dt_root();
46
47 if (!of_flat_dt_is_compatible(root, "amcc,sequoia"))
48 return 0;
49
50 return 1;
51}
52
53static void __init sequoia_setup_arch(void)
54{
55}
56
57define_machine(sequoia) {
58 .name = "Sequoia",
59 .probe = sequoia_probe,
60 .setup_arch = sequoia_setup_arch,
61 .progress = udbg_progress,
62 .init_IRQ = uic_init_tree,
63 .get_irq = uic_get_irq,
64 .restart = ppc44x_reset_system,
65 .calibrate_decr = generic_calibrate_decr,
66};
diff --git a/arch/powerpc/platforms/4xx/Makefile b/arch/powerpc/platforms/4xx/Makefile
deleted file mode 100644
index 79ff6b1e887c..000000000000
--- a/arch/powerpc/platforms/4xx/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1# empty makefile so make clean works \ No newline at end of file
diff --git a/arch/powerpc/platforms/52xx/Kconfig b/arch/powerpc/platforms/52xx/Kconfig
index 3ffaa066c2c8..2938d4927b83 100644
--- a/arch/powerpc/platforms/52xx/Kconfig
+++ b/arch/powerpc/platforms/52xx/Kconfig
@@ -1,6 +1,7 @@
1config PPC_MPC52xx 1config PPC_MPC52xx
2 bool 2 bool
3 select FSL_SOC 3 select FSL_SOC
4 select PPC_CLOCK
4 default n 5 default n
5 6
6config PPC_MPC5200 7config PPC_MPC5200
@@ -30,6 +31,7 @@ config PPC_EFIKA
30config PPC_LITE5200 31config PPC_LITE5200
31 bool "Freescale Lite5200 Eval Board" 32 bool "Freescale Lite5200 Eval Board"
32 depends on PPC_MULTIPLATFORM && PPC32 33 depends on PPC_MULTIPLATFORM && PPC32
34 select WANT_DEVICE_TREE
33 select PPC_MPC5200 35 select PPC_MPC5200
34 default n 36 default n
35 37
diff --git a/arch/powerpc/platforms/52xx/Makefile b/arch/powerpc/platforms/52xx/Makefile
index b91e39c84d46..307dbc178091 100644
--- a/arch/powerpc/platforms/52xx/Makefile
+++ b/arch/powerpc/platforms/52xx/Makefile
@@ -10,3 +10,6 @@ obj-$(CONFIG_PPC_EFIKA) += efika.o
10obj-$(CONFIG_PPC_LITE5200) += lite5200.o 10obj-$(CONFIG_PPC_LITE5200) += lite5200.o
11 11
12obj-$(CONFIG_PM) += mpc52xx_sleep.o mpc52xx_pm.o 12obj-$(CONFIG_PM) += mpc52xx_sleep.o mpc52xx_pm.o
13ifeq ($(CONFIG_PPC_LITE5200),y)
14 obj-$(CONFIG_PM) += lite5200_sleep.o lite5200_pm.o
15endif
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index 4be6e7a17b66..4263158b3274 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -78,8 +78,8 @@ static int rtas_write_config(struct pci_bus *bus, unsigned int devfn,
78} 78}
79 79
80static struct pci_ops rtas_pci_ops = { 80static struct pci_ops rtas_pci_ops = {
81 rtas_read_config, 81 .read = rtas_read_config,
82 rtas_write_config 82 .write = rtas_write_config,
83}; 83};
84 84
85 85
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 5c46e898fd45..e11d27f9c4f0 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -35,7 +35,6 @@
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/machdep.h> 36#include <asm/machdep.h>
37#include <asm/ipic.h> 37#include <asm/ipic.h>
38#include <asm/bootinfo.h>
39#include <asm/irq.h> 38#include <asm/irq.h>
40#include <asm/prom.h> 39#include <asm/prom.h>
41#include <asm/udbg.h> 40#include <asm/udbg.h>
@@ -86,7 +85,6 @@ error:
86} 85}
87 86
88#ifdef CONFIG_PM 87#ifdef CONFIG_PM
89static u32 descr_a;
90static void lite5200_suspend_prepare(void __iomem *mbar) 88static void lite5200_suspend_prepare(void __iomem *mbar)
91{ 89{
92 u8 pin = 1; /* GPIO_WKUP_1 (GPIO_PSC2_4) */ 90 u8 pin = 1; /* GPIO_WKUP_1 (GPIO_PSC2_4) */
@@ -97,34 +95,30 @@ static void lite5200_suspend_prepare(void __iomem *mbar)
97 * power down usb port 95 * power down usb port
98 * this needs to be called before of-ohci suspend code 96 * this needs to be called before of-ohci suspend code
99 */ 97 */
100 descr_a = in_be32(mbar + 0x1048); 98
101 out_be32(mbar + 0x1048, (descr_a & ~0x200) | 0x100); 99 /* set ports to "power switched" and "powered at the same time"
100 * USB Rh descriptor A: NPS = 0, PSM = 0 */
101 out_be32(mbar + 0x1048, in_be32(mbar + 0x1048) & ~0x300);
102 /* USB Rh status: LPS = 1 - turn off power */
103 out_be32(mbar + 0x1050, 0x00000001);
102} 104}
103 105
104static void lite5200_resume_finish(void __iomem *mbar) 106static void lite5200_resume_finish(void __iomem *mbar)
105{ 107{
106 out_be32(mbar + 0x1048, descr_a); 108 /* USB Rh status: LPSC = 1 - turn on power */
109 out_be32(mbar + 0x1050, 0x00010000);
107} 110}
108#endif 111#endif
109 112
110static void __init lite5200_setup_arch(void) 113static void __init lite5200_setup_arch(void)
111{ 114{
115#ifdef CONFIG_PCI
112 struct device_node *np; 116 struct device_node *np;
117#endif
113 118
114 if (ppc_md.progress) 119 if (ppc_md.progress)
115 ppc_md.progress("lite5200_setup_arch()", 0); 120 ppc_md.progress("lite5200_setup_arch()", 0);
116 121
117 np = of_find_node_by_type(NULL, "cpu");
118 if (np) {
119 const unsigned int *fp =
120 of_get_property(np, "clock-frequency", NULL);
121 if (fp != 0)
122 loops_per_jiffy = *fp / HZ;
123 else
124 loops_per_jiffy = 50000000 / HZ;
125 of_node_put(np);
126 }
127
128 /* CPU & Port mux setup */ 122 /* CPU & Port mux setup */
129 mpc52xx_setup_cpu(); /* Generic */ 123 mpc52xx_setup_cpu(); /* Generic */
130 lite5200_setup_cpu(); /* Platorm specific */ 124 lite5200_setup_cpu(); /* Platorm specific */
@@ -132,7 +126,7 @@ static void __init lite5200_setup_arch(void)
132#ifdef CONFIG_PM 126#ifdef CONFIG_PM
133 mpc52xx_suspend.board_suspend_prepare = lite5200_suspend_prepare; 127 mpc52xx_suspend.board_suspend_prepare = lite5200_suspend_prepare;
134 mpc52xx_suspend.board_resume_finish = lite5200_resume_finish; 128 mpc52xx_suspend.board_resume_finish = lite5200_resume_finish;
135 mpc52xx_pm_init(); 129 lite5200_pm_init();
136#endif 130#endif
137 131
138#ifdef CONFIG_PCI 132#ifdef CONFIG_PCI
diff --git a/arch/powerpc/platforms/52xx/lite5200_pm.c b/arch/powerpc/platforms/52xx/lite5200_pm.c
new file mode 100644
index 000000000000..f26afcd41757
--- /dev/null
+++ b/arch/powerpc/platforms/52xx/lite5200_pm.c
@@ -0,0 +1,213 @@
1#include <linux/init.h>
2#include <linux/pm.h>
3#include <asm/io.h>
4#include <asm/time.h>
5#include <asm/mpc52xx.h>
6#include "mpc52xx_pic.h"
7
8/* defined in lite5200_sleep.S and only used here */
9extern void lite5200_low_power(void __iomem *sram, void __iomem *mbar);
10
11static struct mpc52xx_cdm __iomem *cdm;
12static struct mpc52xx_intr __iomem *pic;
13static struct mpc52xx_sdma __iomem *bes;
14static struct mpc52xx_xlb __iomem *xlb;
15static struct mpc52xx_gpio __iomem *gps;
16static struct mpc52xx_gpio_wkup __iomem *gpw;
17static void __iomem *sram;
18static const int sram_size = 0x4000; /* 16 kBytes */
19static void __iomem *mbar;
20
21static int lite5200_pm_valid(suspend_state_t state)
22{
23 switch (state) {
24 case PM_SUSPEND_STANDBY:
25 case PM_SUSPEND_MEM:
26 return 1;
27 default:
28 return 0;
29 }
30}
31
32static int lite5200_pm_prepare(suspend_state_t state)
33{
34 /* deep sleep? let mpc52xx code handle that */
35 if (state == PM_SUSPEND_STANDBY)
36 return mpc52xx_pm_prepare(state);
37
38 if (state != PM_SUSPEND_MEM)
39 return -EINVAL;
40
41 /* map registers */
42 mbar = mpc52xx_find_and_map("mpc5200");
43 if (!mbar) {
44 printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__);
45 return -ENOSYS;
46 }
47
48 cdm = mbar + 0x200;
49 pic = mbar + 0x500;
50 gps = mbar + 0xb00;
51 gpw = mbar + 0xc00;
52 bes = mbar + 0x1200;
53 xlb = mbar + 0x1f00;
54 sram = mbar + 0x8000;
55
56 return 0;
57}
58
59/* save and restore registers not bound to any real devices */
60static struct mpc52xx_cdm scdm;
61static struct mpc52xx_intr spic;
62static struct mpc52xx_sdma sbes;
63static struct mpc52xx_xlb sxlb;
64static struct mpc52xx_gpio sgps;
65static struct mpc52xx_gpio_wkup sgpw;
66
67static void lite5200_save_regs(void)
68{
69 _memcpy_fromio(&spic, pic, sizeof(*pic));
70 _memcpy_fromio(&sbes, bes, sizeof(*bes));
71 _memcpy_fromio(&scdm, cdm, sizeof(*cdm));
72 _memcpy_fromio(&sxlb, xlb, sizeof(*xlb));
73 _memcpy_fromio(&sgps, gps, sizeof(*gps));
74 _memcpy_fromio(&sgpw, gpw, sizeof(*gpw));
75
76 _memcpy_fromio(saved_sram, sram, sram_size);
77}
78
79static void lite5200_restore_regs(void)
80{
81 int i;
82 _memcpy_toio(sram, saved_sram, sram_size);
83
84
85 /*
86 * GPIOs. Interrupt Master Enable has higher address then other
87 * registers, so just memcpy is ok.
88 */
89 _memcpy_toio(gpw, &sgpw, sizeof(*gpw));
90 _memcpy_toio(gps, &sgps, sizeof(*gps));
91
92
93 /* XLB Arbitrer */
94 out_be32(&xlb->snoop_window, sxlb.snoop_window);
95 out_be32(&xlb->master_priority, sxlb.master_priority);
96 out_be32(&xlb->master_pri_enable, sxlb.master_pri_enable);
97
98 /* enable */
99 out_be32(&xlb->int_enable, sxlb.int_enable);
100 out_be32(&xlb->config, sxlb.config);
101
102
103 /* CDM - Clock Distribution Module */
104 out_8(&cdm->ipb_clk_sel, scdm.ipb_clk_sel);
105 out_8(&cdm->pci_clk_sel, scdm.pci_clk_sel);
106
107 out_8(&cdm->ext_48mhz_en, scdm.ext_48mhz_en);
108 out_8(&cdm->fd_enable, scdm.fd_enable);
109 out_be16(&cdm->fd_counters, scdm.fd_counters);
110
111 out_be32(&cdm->clk_enables, scdm.clk_enables);
112
113 out_8(&cdm->osc_disable, scdm.osc_disable);
114
115 out_be16(&cdm->mclken_div_psc1, scdm.mclken_div_psc1);
116 out_be16(&cdm->mclken_div_psc2, scdm.mclken_div_psc2);
117 out_be16(&cdm->mclken_div_psc3, scdm.mclken_div_psc3);
118 out_be16(&cdm->mclken_div_psc6, scdm.mclken_div_psc6);
119
120
121 /* BESTCOMM */
122 out_be32(&bes->taskBar, sbes.taskBar);
123 out_be32(&bes->currentPointer, sbes.currentPointer);
124 out_be32(&bes->endPointer, sbes.endPointer);
125 out_be32(&bes->variablePointer, sbes.variablePointer);
126
127 out_8(&bes->IntVect1, sbes.IntVect1);
128 out_8(&bes->IntVect2, sbes.IntVect2);
129 out_be16(&bes->PtdCntrl, sbes.PtdCntrl);
130
131 for (i=0; i<32; i++)
132 out_8(&bes->ipr[i], sbes.ipr[i]);
133
134 out_be32(&bes->cReqSelect, sbes.cReqSelect);
135 out_be32(&bes->task_size0, sbes.task_size0);
136 out_be32(&bes->task_size1, sbes.task_size1);
137 out_be32(&bes->MDEDebug, sbes.MDEDebug);
138 out_be32(&bes->ADSDebug, sbes.ADSDebug);
139 out_be32(&bes->Value1, sbes.Value1);
140 out_be32(&bes->Value2, sbes.Value2);
141 out_be32(&bes->Control, sbes.Control);
142 out_be32(&bes->Status, sbes.Status);
143 out_be32(&bes->PTDDebug, sbes.PTDDebug);
144
145 /* restore tasks */
146 for (i=0; i<16; i++)
147 out_be16(&bes->tcr[i], sbes.tcr[i]);
148
149 /* enable interrupts */
150 out_be32(&bes->IntPend, sbes.IntPend);
151 out_be32(&bes->IntMask, sbes.IntMask);
152
153
154 /* PIC */
155 out_be32(&pic->per_pri1, spic.per_pri1);
156 out_be32(&pic->per_pri2, spic.per_pri2);
157 out_be32(&pic->per_pri3, spic.per_pri3);
158
159 out_be32(&pic->main_pri1, spic.main_pri1);
160 out_be32(&pic->main_pri2, spic.main_pri2);
161
162 out_be32(&pic->enc_status, spic.enc_status);
163
164 /* unmask and enable interrupts */
165 out_be32(&pic->per_mask, spic.per_mask);
166 out_be32(&pic->main_mask, spic.main_mask);
167 out_be32(&pic->ctrl, spic.ctrl);
168}
169
170static int lite5200_pm_enter(suspend_state_t state)
171{
172 /* deep sleep? let mpc52xx code handle that */
173 if (state == PM_SUSPEND_STANDBY) {
174 return mpc52xx_pm_enter(state);
175 }
176
177 lite5200_save_regs();
178
179 /* effectively save FP regs */
180 enable_kernel_fp();
181
182 lite5200_low_power(sram, mbar);
183
184 lite5200_restore_regs();
185
186 /* restart jiffies */
187 wakeup_decrementer();
188
189 iounmap(mbar);
190 return 0;
191}
192
193static int lite5200_pm_finish(suspend_state_t state)
194{
195 /* deep sleep? let mpc52xx code handle that */
196 if (state == PM_SUSPEND_STANDBY) {
197 return mpc52xx_pm_finish(state);
198 }
199 return 0;
200}
201
202static struct pm_ops lite5200_pm_ops = {
203 .valid = lite5200_pm_valid,
204 .prepare = lite5200_pm_prepare,
205 .enter = lite5200_pm_enter,
206 .finish = lite5200_pm_finish,
207};
208
209int __init lite5200_pm_init(void)
210{
211 pm_set_ops(&lite5200_pm_ops);
212 return 0;
213}
diff --git a/arch/powerpc/platforms/52xx/lite5200_sleep.S b/arch/powerpc/platforms/52xx/lite5200_sleep.S
new file mode 100644
index 000000000000..08ab6fefcf7a
--- /dev/null
+++ b/arch/powerpc/platforms/52xx/lite5200_sleep.S
@@ -0,0 +1,412 @@
1#include <asm/reg.h>
2#include <asm/ppc_asm.h>
3#include <asm/processor.h>
4#include <asm/cache.h>
5
6
7#define SDRAM_CTRL 0x104
8#define SC_MODE_EN (1<<31)
9#define SC_CKE (1<<30)
10#define SC_REF_EN (1<<28)
11#define SC_SOFT_PRE (1<<1)
12
13#define GPIOW_GPIOE 0xc00
14#define GPIOW_DDR 0xc08
15#define GPIOW_DVO 0xc0c
16
17#define CDM_CE 0x214
18#define CDM_SDRAM (1<<3)
19
20
21/* helpers... beware: r10 and r4 are overwritten */
22#define SAVE_SPRN(reg, addr) \
23 mfspr r10, SPRN_##reg; \
24 stw r10, ((addr)*4)(r4);
25
26#define LOAD_SPRN(reg, addr) \
27 lwz r10, ((addr)*4)(r4); \
28 mtspr SPRN_##reg, r10; \
29 sync; \
30 isync;
31
32
33 .data
34registers:
35 .space 0x5c*4
36 .text
37
38/* ---------------------------------------------------------------------- */
39/* low-power mode with help of M68HLC908QT1 */
40
41 .globl lite5200_low_power
42lite5200_low_power:
43
44 mr r7, r3 /* save SRAM va */
45 mr r8, r4 /* save MBAR va */
46
47 /* setup wakeup address for u-boot at physical location 0x0 */
48 lis r3, CONFIG_KERNEL_START@h
49 lis r4, lite5200_wakeup@h
50 ori r4, r4, lite5200_wakeup@l
51 sub r4, r4, r3
52 stw r4, 0(r3)
53
54
55 /*
56 * save stuff BDI overwrites
57 * 0xf0 (0xe0->0x100 gets overwritten when BDI connected;
58 * even when CONFIG_BDI* is disabled and MMU XLAT commented; heisenbug?))
59 * WARNING: self-refresh doesn't seem to work when BDI2000 is connected,
60 * possibly because BDI sets SDRAM registers before wakeup code does
61 */
62 lis r4, registers@h
63 ori r4, r4, registers@l
64 lwz r10, 0xf0(r3)
65 stw r10, (0x1d*4)(r4)
66
67 /* save registers to r4 [destroys r10] */
68 SAVE_SPRN(LR, 0x1c)
69 bl save_regs
70
71 /* flush caches [destroys r3, r4] */
72 bl flush_data_cache
73
74
75 /* copy code to sram */
76 mr r4, r7
77 li r3, (sram_code_end - sram_code)/4
78 mtctr r3
79 lis r3, sram_code@h
80 ori r3, r3, sram_code@l
811:
82 lwz r5, 0(r3)
83 stw r5, 0(r4)
84 addi r3, r3, 4
85 addi r4, r4, 4
86 bdnz 1b
87
88 /* get tb_ticks_per_usec */
89 lis r3, tb_ticks_per_usec@h
90 lwz r11, tb_ticks_per_usec@l(r3)
91
92 /* disable I and D caches */
93 mfspr r3, SPRN_HID0
94 ori r3, r3, HID0_ICE | HID0_DCE
95 xori r3, r3, HID0_ICE | HID0_DCE
96 sync; isync;
97 mtspr SPRN_HID0, r3
98 sync; isync;
99
100 /* jump to sram */
101 mtlr r7
102 blrl
103 /* doesn't return */
104
105
106sram_code:
107 /* self refresh */
108 lwz r4, SDRAM_CTRL(r8)
109
110 /* send NOP (precharge) */
111 oris r4, r4, SC_MODE_EN@h /* mode_en */
112 stw r4, SDRAM_CTRL(r8)
113 sync
114
115 ori r4, r4, SC_SOFT_PRE /* soft_pre */
116 stw r4, SDRAM_CTRL(r8)
117 sync
118 xori r4, r4, SC_SOFT_PRE
119
120 xoris r4, r4, SC_MODE_EN@h /* !mode_en */
121 stw r4, SDRAM_CTRL(r8)
122 sync
123
124 /* delay (for NOP to finish) */
125 li r12, 1
126 bl udelay
127
128 /*
129 * mode_en must not be set when enabling self-refresh
130 * send AR with CKE low (self-refresh)
131 */
132 oris r4, r4, (SC_REF_EN | SC_CKE)@h
133 xoris r4, r4, (SC_CKE)@h /* ref_en !cke */
134 stw r4, SDRAM_CTRL(r8)
135 sync
136
137 /* delay (after !CKE there should be two cycles) */
138 li r12, 1
139 bl udelay
140
141 /* disable clock */
142 lwz r4, CDM_CE(r8)
143 ori r4, r4, CDM_SDRAM
144 xori r4, r4, CDM_SDRAM
145 stw r4, CDM_CE(r8)
146 sync
147
148 /* delay a bit */
149 li r12, 1
150 bl udelay
151
152
153 /* turn off with QT chip */
154 li r4, 0x02
155 stb r4, GPIOW_GPIOE(r8) /* enable gpio_wkup1 */
156 sync
157
158 stb r4, GPIOW_DVO(r8) /* "output" high */
159 sync
160 stb r4, GPIOW_DDR(r8) /* output */
161 sync
162 stb r4, GPIOW_DVO(r8) /* output high */
163 sync
164
165 /* 10uS delay */
166 li r12, 10
167 bl udelay
168
169 /* turn off */
170 li r4, 0
171 stb r4, GPIOW_DVO(r8) /* output low */
172 sync
173
174 /* wait until we're offline */
175 1:
176 b 1b
177
178
179 /* local udelay in sram is needed */
180 udelay: /* r11 - tb_ticks_per_usec, r12 - usecs, overwrites r13 */
181 mullw r12, r12, r11
182 mftb r13 /* start */
183 addi r12, r13, r12 /* end */
184 1:
185 mftb r13 /* current */
186 cmp cr0, r13, r12
187 blt 1b
188 blr
189
190sram_code_end:
191
192
193
194/* uboot jumps here on resume */
195lite5200_wakeup:
196 bl restore_regs
197
198
199 /* HIDs, MSR */
200 LOAD_SPRN(HID1, 0x19)
201 LOAD_SPRN(HID2, 0x1a)
202
203
204 /* address translation is tricky (see turn_on_mmu) */
205 mfmsr r10
206 ori r10, r10, MSR_DR | MSR_IR
207
208
209 mtspr SPRN_SRR1, r10
210 lis r10, mmu_on@h
211 ori r10, r10, mmu_on@l
212 mtspr SPRN_SRR0, r10
213 sync
214 rfi
215mmu_on:
216 /* kernel offset (r4 is still set from restore_registers) */
217 addis r4, r4, CONFIG_KERNEL_START@h
218
219
220 /* restore MSR */
221 lwz r10, (4*0x1b)(r4)
222 mtmsr r10
223 sync; isync;
224
225 /* invalidate caches */
226 mfspr r10, SPRN_HID0
227 ori r5, r10, HID0_ICFI | HID0_DCI
228 mtspr SPRN_HID0, r5 /* invalidate caches */
229 sync; isync;
230 mtspr SPRN_HID0, r10
231 sync; isync;
232
233 /* enable caches */
234 lwz r10, (4*0x18)(r4)
235 mtspr SPRN_HID0, r10 /* restore (enable caches, DPM) */
236 /* ^ this has to be after address translation set in MSR */
237 sync
238 isync
239
240
241 /* restore 0xf0 (BDI2000) */
242 lis r3, CONFIG_KERNEL_START@h
243 lwz r10, (0x1d*4)(r4)
244 stw r10, 0xf0(r3)
245
246 LOAD_SPRN(LR, 0x1c)
247
248
249 blr
250
251
252/* ---------------------------------------------------------------------- */
253/* boring code: helpers */
254
255/* save registers */
256#define SAVE_BAT(n, addr) \
257 SAVE_SPRN(DBAT##n##L, addr); \
258 SAVE_SPRN(DBAT##n##U, addr+1); \
259 SAVE_SPRN(IBAT##n##L, addr+2); \
260 SAVE_SPRN(IBAT##n##U, addr+3);
261
262#define SAVE_SR(n, addr) \
263 mfsr r10, n; \
264 stw r10, ((addr)*4)(r4);
265
266#define SAVE_4SR(n, addr) \
267 SAVE_SR(n, addr); \
268 SAVE_SR(n+1, addr+1); \
269 SAVE_SR(n+2, addr+2); \
270 SAVE_SR(n+3, addr+3);
271
272save_regs:
273 stw r0, 0(r4)
274 stw r1, 0x4(r4)
275 stw r2, 0x8(r4)
276 stmw r11, 0xc(r4) /* 0xc -> 0x5f, (0x18*4-1) */
277
278 SAVE_SPRN(HID0, 0x18)
279 SAVE_SPRN(HID1, 0x19)
280 SAVE_SPRN(HID2, 0x1a)
281 mfmsr r10
282 stw r10, (4*0x1b)(r4)
283 /*SAVE_SPRN(LR, 0x1c) have to save it before the call */
284 /* 0x1d reserved by 0xf0 */
285 SAVE_SPRN(RPA, 0x1e)
286 SAVE_SPRN(SDR1, 0x1f)
287
288 /* save MMU regs */
289 SAVE_BAT(0, 0x20)
290 SAVE_BAT(1, 0x24)
291 SAVE_BAT(2, 0x28)
292 SAVE_BAT(3, 0x2c)
293 SAVE_BAT(4, 0x30)
294 SAVE_BAT(5, 0x34)
295 SAVE_BAT(6, 0x38)
296 SAVE_BAT(7, 0x3c)
297
298 SAVE_4SR(0, 0x40)
299 SAVE_4SR(4, 0x44)
300 SAVE_4SR(8, 0x48)
301 SAVE_4SR(12, 0x4c)
302
303 SAVE_SPRN(SPRG0, 0x50)
304 SAVE_SPRN(SPRG1, 0x51)
305 SAVE_SPRN(SPRG2, 0x52)
306 SAVE_SPRN(SPRG3, 0x53)
307 SAVE_SPRN(SPRG4, 0x54)
308 SAVE_SPRN(SPRG5, 0x55)
309 SAVE_SPRN(SPRG6, 0x56)
310 SAVE_SPRN(SPRG7, 0x57)
311
312 SAVE_SPRN(IABR, 0x58)
313 SAVE_SPRN(DABR, 0x59)
314 SAVE_SPRN(TBRL, 0x5a)
315 SAVE_SPRN(TBRU, 0x5b)
316
317 blr
318
319
320/* restore registers */
321#define LOAD_BAT(n, addr) \
322 LOAD_SPRN(DBAT##n##L, addr); \
323 LOAD_SPRN(DBAT##n##U, addr+1); \
324 LOAD_SPRN(IBAT##n##L, addr+2); \
325 LOAD_SPRN(IBAT##n##U, addr+3);
326
327#define LOAD_SR(n, addr) \
328 lwz r10, ((addr)*4)(r4); \
329 mtsr n, r10;
330
331#define LOAD_4SR(n, addr) \
332 LOAD_SR(n, addr); \
333 LOAD_SR(n+1, addr+1); \
334 LOAD_SR(n+2, addr+2); \
335 LOAD_SR(n+3, addr+3);
336
337restore_regs:
338 lis r4, registers@h
339 ori r4, r4, registers@l
340
341 /* MMU is not up yet */
342 subis r4, r4, CONFIG_KERNEL_START@h
343
344 lwz r0, 0(r4)
345 lwz r1, 0x4(r4)
346 lwz r2, 0x8(r4)
347 lmw r11, 0xc(r4)
348
349 /*
350 * these are a bit tricky
351 *
352 * 0x18 - HID0
353 * 0x19 - HID1
354 * 0x1a - HID2
355 * 0x1b - MSR
356 * 0x1c - LR
357 * 0x1d - reserved by 0xf0 (BDI2000)
358 */
359 LOAD_SPRN(RPA, 0x1e);
360 LOAD_SPRN(SDR1, 0x1f);
361
362 /* restore MMU regs */
363 LOAD_BAT(0, 0x20)
364 LOAD_BAT(1, 0x24)
365 LOAD_BAT(2, 0x28)
366 LOAD_BAT(3, 0x2c)
367 LOAD_BAT(4, 0x30)
368 LOAD_BAT(5, 0x34)
369 LOAD_BAT(6, 0x38)
370 LOAD_BAT(7, 0x3c)
371
372 LOAD_4SR(0, 0x40)
373 LOAD_4SR(4, 0x44)
374 LOAD_4SR(8, 0x48)
375 LOAD_4SR(12, 0x4c)
376
377 /* rest of regs */
378 LOAD_SPRN(SPRG0, 0x50);
379 LOAD_SPRN(SPRG1, 0x51);
380 LOAD_SPRN(SPRG2, 0x52);
381 LOAD_SPRN(SPRG3, 0x53);
382 LOAD_SPRN(SPRG4, 0x54);
383 LOAD_SPRN(SPRG5, 0x55);
384 LOAD_SPRN(SPRG6, 0x56);
385 LOAD_SPRN(SPRG7, 0x57);
386
387 LOAD_SPRN(IABR, 0x58);
388 LOAD_SPRN(DABR, 0x59);
389 LOAD_SPRN(TBWL, 0x5a); /* these two have separate R/W regs */
390 LOAD_SPRN(TBWU, 0x5b);
391
392 blr
393
394
395
396/* cache flushing code. copied from arch/ppc/boot/util.S */
397#define NUM_CACHE_LINES (128*8)
398
399/*
400 * Flush data cache
401 * Do this by just reading lots of stuff into the cache.
402 */
403flush_data_cache:
404 lis r3,CONFIG_KERNEL_START@h
405 ori r3,r3,CONFIG_KERNEL_START@l
406 li r4,NUM_CACHE_LINES
407 mtctr r4
4081:
409 lwz r4,0(r3)
410 addi r3,r3,L1_CACHE_BYTES /* Next line, please */
411 bdnz 1b
412 blr
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index fbfff95b4437..0f4ca8a2b777 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -22,7 +22,6 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/sched.h> 23#include <linux/sched.h>
24#include <linux/signal.h> 24#include <linux/signal.h>
25#include <linux/stddef.h>
26#include <linux/delay.h> 25#include <linux/delay.h>
27#include <linux/irq.h> 26#include <linux/irq.h>
28#include <linux/hardirq.h> 27#include <linux/hardirq.h>
@@ -242,12 +241,6 @@ static struct irq_chip mpc52xx_sdma_irqchip = {
242 * irq_host 241 * irq_host
243*/ 242*/
244 243
245static int mpc52xx_irqhost_match(struct irq_host *h, struct device_node *node)
246{
247 pr_debug("%s: node=%p\n", __func__, node);
248 return mpc52xx_irqhost->host_data == node;
249}
250
251static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct, 244static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct,
252 u32 * intspec, unsigned int intsize, 245 u32 * intspec, unsigned int intsize,
253 irq_hw_number_t * out_hwirq, 246 irq_hw_number_t * out_hwirq,
@@ -368,7 +361,6 @@ static int mpc52xx_irqhost_map(struct irq_host *h, unsigned int virq,
368} 361}
369 362
370static struct irq_host_ops mpc52xx_irqhost_ops = { 363static struct irq_host_ops mpc52xx_irqhost_ops = {
371 .match = mpc52xx_irqhost_match,
372 .xlate = mpc52xx_irqhost_xlate, 364 .xlate = mpc52xx_irqhost_xlate,
373 .map = mpc52xx_irqhost_map, 365 .map = mpc52xx_irqhost_map,
374}; 366};
@@ -420,14 +412,13 @@ void __init mpc52xx_init_irq(void)
420 * hw irq information provided by the ofw to linux virq 412 * hw irq information provided by the ofw to linux virq
421 */ 413 */
422 414
423 mpc52xx_irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 415 mpc52xx_irqhost = irq_alloc_host(picnode, IRQ_HOST_MAP_LINEAR,
424 MPC52xx_IRQ_HIGHTESTHWIRQ, 416 MPC52xx_IRQ_HIGHTESTHWIRQ,
425 &mpc52xx_irqhost_ops, -1); 417 &mpc52xx_irqhost_ops, -1);
426 418
427 if (!mpc52xx_irqhost) 419 if (!mpc52xx_irqhost)
428 panic(__FILE__ ": Cannot allocate the IRQ host\n"); 420 panic(__FILE__ ": Cannot allocate the IRQ host\n");
429 421
430 mpc52xx_irqhost->host_data = picnode;
431 printk(KERN_INFO "MPC52xx PIC is up and running!\n"); 422 printk(KERN_INFO "MPC52xx PIC is up and running!\n");
432} 423}
433 424
diff --git a/arch/powerpc/platforms/82xx/m82xx_pci.h b/arch/powerpc/platforms/82xx/m82xx_pci.h
index 9cd8893b5a32..65e38a7ff48f 100644
--- a/arch/powerpc/platforms/82xx/m82xx_pci.h
+++ b/arch/powerpc/platforms/82xx/m82xx_pci.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#include <asm/m8260_pci.h>
12
13#define SIU_INT_IRQ1 ((uint)0x13 + CPM_IRQ_OFFSET) 11#define SIU_INT_IRQ1 ((uint)0x13 + CPM_IRQ_OFFSET)
14 12
15#ifndef _IO_BASE 13#ifndef _IO_BASE
diff --git a/arch/powerpc/platforms/82xx/mpc82xx.c b/arch/powerpc/platforms/82xx/mpc82xx.c
index cc9900d2e5ee..c706871aec1a 100644
--- a/arch/powerpc/platforms/82xx/mpc82xx.c
+++ b/arch/powerpc/platforms/82xx/mpc82xx.c
@@ -36,7 +36,6 @@
36#include <asm/time.h> 36#include <asm/time.h>
37#include <asm/io.h> 37#include <asm/io.h>
38#include <asm/machdep.h> 38#include <asm/machdep.h>
39#include <asm/bootinfo.h>
40#include <asm/pci-bridge.h> 39#include <asm/pci-bridge.h>
41#include <asm/mpc8260.h> 40#include <asm/mpc8260.h>
42#include <asm/irq.h> 41#include <asm/irq.h>
diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
index 2d1b05b9f8ef..40087952935a 100644
--- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c
+++ b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
@@ -37,7 +37,6 @@
37#include <asm/time.h> 37#include <asm/time.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/machdep.h> 39#include <asm/machdep.h>
40#include <asm/bootinfo.h>
41#include <asm/pci-bridge.h> 40#include <asm/pci-bridge.h>
42#include <asm/mpc8260.h> 41#include <asm/mpc8260.h>
43#include <asm/irq.h> 42#include <asm/irq.h>
@@ -62,7 +61,6 @@ static struct {
62 61
63static unsigned long pci_int_base; 62static unsigned long pci_int_base;
64static struct irq_host *pci_pic_host; 63static struct irq_host *pci_pic_host;
65static struct device_node *pci_pic_node;
66#endif 64#endif
67 65
68static void __init mpc82xx_ads_pic_init(void) 66static void __init mpc82xx_ads_pic_init(void)
@@ -400,11 +398,6 @@ m82xx_pci_irq_demux(unsigned int irq, struct irq_desc *desc)
400 } 398 }
401} 399}
402 400
403static int pci_pic_host_match(struct irq_host *h, struct device_node *node)
404{
405 return node == pci_pic_node;
406}
407
408static int pci_pic_host_map(struct irq_host *h, unsigned int virq, 401static int pci_pic_host_map(struct irq_host *h, unsigned int virq,
409 irq_hw_number_t hw) 402 irq_hw_number_t hw)
410{ 403{
@@ -420,7 +413,6 @@ static void pci_host_unmap(struct irq_host *h, unsigned int virq)
420} 413}
421 414
422static struct irq_host_ops pci_pic_host_ops = { 415static struct irq_host_ops pci_pic_host_ops = {
423 .match = pci_pic_host_match,
424 .map = pci_pic_host_map, 416 .map = pci_pic_host_map,
425 .unmap = pci_host_unmap, 417 .unmap = pci_host_unmap,
426}; 418};
@@ -479,7 +471,6 @@ void m82xx_pci_init_irq(void)
479 iounmap(immap); 471 iounmap(immap);
480 return; 472 return;
481 } 473 }
482 pci_pic_node = of_node_get(np);
483 /* PCI interrupt controller registers: status and mask */ 474 /* PCI interrupt controller registers: status and mask */
484 regs = of_get_property(np, "reg", &size); 475 regs = of_get_property(np, "reg", &size);
485 if ((!regs) || (size <= 2)) { 476 if ((!regs) || (size <= 2)) {
@@ -491,7 +482,6 @@ void m82xx_pci_init_irq(void)
491 ioremap(regs[0], sizeof(*pci_regs.pci_int_stat_reg)); 482 ioremap(regs[0], sizeof(*pci_regs.pci_int_stat_reg));
492 pci_regs.pci_int_mask_reg = 483 pci_regs.pci_int_mask_reg =
493 ioremap(regs[1], sizeof(*pci_regs.pci_int_mask_reg)); 484 ioremap(regs[1], sizeof(*pci_regs.pci_int_mask_reg));
494 of_node_put(np);
495 /* configure chip select for PCI interrupt controller */ 485 /* configure chip select for PCI interrupt controller */
496 immap->im_memctl.memc_br3 = regs[0] | 0x00001801; 486 immap->im_memctl.memc_br3 = regs[0] | 0x00001801;
497 immap->im_memctl.memc_or3 = 0xffff8010; 487 immap->im_memctl.memc_or3 = 0xffff8010;
@@ -502,7 +492,7 @@ void m82xx_pci_init_irq(void)
502 *pci_regs.pci_int_mask_reg |= 0xfff00000; 492 *pci_regs.pci_int_mask_reg |= 0xfff00000;
503 iounmap(immap); 493 iounmap(immap);
504 pci_pic_host = 494 pci_pic_host =
505 irq_alloc_host(IRQ_HOST_MAP_LINEAR, irq_max - irq_min + 1, 495 irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, irq_max - irq_min + 1,
506 &pci_pic_host_ops, irq_max + 1); 496 &pci_pic_host_ops, irq_max + 1);
507 return; 497 return;
508} 498}
diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h
index 5b5cca6c8c88..6f749b76dd8f 100644
--- a/arch/powerpc/platforms/82xx/pq2ads.h
+++ b/arch/powerpc/platforms/82xx/pq2ads.h
@@ -23,7 +23,6 @@
23#define __MACH_ADS8260_DEFS 23#define __MACH_ADS8260_DEFS
24 24
25#include <linux/seq_file.h> 25#include <linux/seq_file.h>
26#include <asm/ppcboot.h>
27 26
28/* For our show_cpuinfo hooks. */ 27/* For our show_cpuinfo hooks. */
29#define CPUINFO_VENDOR "Freescale Semiconductor" 28#define CPUINFO_VENDOR "Freescale Semiconductor"
diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
index 3edfe170a03b..140b46ffdb19 100644
--- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
@@ -45,8 +45,6 @@ static void __init mpc8313_rdb_setup_arch(void)
45#ifdef CONFIG_PCI 45#ifdef CONFIG_PCI
46 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 46 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
47 mpc83xx_add_bridge(np); 47 mpc83xx_add_bridge(np);
48
49 ppc_md.pci_exclude_device = mpc83xx_exclude_device;
50#endif 48#endif
51 mpc831x_usb_cfg(); 49 mpc831x_usb_cfg();
52} 50}
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 2c8e641a739b..d494bc456458 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -32,7 +32,6 @@
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/machdep.h> 33#include <asm/machdep.h>
34#include <asm/ipic.h> 34#include <asm/ipic.h>
35#include <asm/bootinfo.h>
36#include <asm/irq.h> 35#include <asm/irq.h>
37#include <asm/prom.h> 36#include <asm/prom.h>
38#include <asm/udbg.h> 37#include <asm/udbg.h>
@@ -76,7 +75,6 @@ static void __init mpc832x_sys_setup_arch(void)
76#ifdef CONFIG_PCI 75#ifdef CONFIG_PCI
77 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 76 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
78 mpc83xx_add_bridge(np); 77 mpc83xx_add_bridge(np);
79 ppc_md.pci_exclude_device = mpc83xx_exclude_device;
80#endif 78#endif
81 79
82#ifdef CONFIG_QUICC_ENGINE 80#ifdef CONFIG_QUICC_ENGINE
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 090906170a41..24a790c79ec0 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <linux/pci.h> 17#include <linux/pci.h>
18#include <linux/spi/spi.h>
18 19
19#include <asm/of_platform.h> 20#include <asm/of_platform.h>
20#include <asm/time.h> 21#include <asm/time.h>
@@ -22,6 +23,7 @@
22#include <asm/udbg.h> 23#include <asm/udbg.h>
23#include <asm/qe.h> 24#include <asm/qe.h>
24#include <asm/qe_ic.h> 25#include <asm/qe_ic.h>
26#include <sysdev/fsl_soc.h>
25 27
26#include "mpc83xx.h" 28#include "mpc83xx.h"
27 29
@@ -32,6 +34,50 @@
32#define DBG(fmt...) 34#define DBG(fmt...)
33#endif 35#endif
34 36
37static void mpc83xx_spi_activate_cs(u8 cs, u8 polarity)
38{
39 pr_debug("%s %d %d\n", __func__, cs, polarity);
40 par_io_data_set(3, 13, polarity);
41}
42
43static void mpc83xx_spi_deactivate_cs(u8 cs, u8 polarity)
44{
45 pr_debug("%s %d %d\n", __func__, cs, polarity);
46 par_io_data_set(3, 13, !polarity);
47}
48
49static struct spi_board_info mpc832x_spi_boardinfo = {
50 .bus_num = 0x4c0,
51 .chip_select = 0,
52 .max_speed_hz = 50000000,
53 /*
54 * XXX: This is spidev (spi in userspace) stub, should
55 * be replaced by "mmc_spi" when mmc_spi will hit mainline.
56 */
57 .modalias = "spidev",
58};
59
60static int __init mpc832x_spi_init(void)
61{
62 if (!machine_is(mpc832x_rdb))
63 return 0;
64
65 par_io_config_pin(3, 0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
66 par_io_config_pin(3, 1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
67 par_io_config_pin(3, 2, 3, 0, 1, 0); /* SPI1 CLK, I/O */
68 par_io_config_pin(3, 3, 2, 0, 1, 0); /* SPI1 SEL, I */
69
70 par_io_config_pin(3, 13, 1, 0, 0, 0); /* !SD_CS, O */
71 par_io_config_pin(3, 14, 2, 0, 0, 0); /* SD_INSERT, I */
72 par_io_config_pin(3, 15, 2, 0, 0, 0); /* SD_PROTECT,I */
73
74 return fsl_spi_init(&mpc832x_spi_boardinfo, 1,
75 mpc83xx_spi_activate_cs,
76 mpc83xx_spi_deactivate_cs);
77}
78
79device_initcall(mpc832x_spi_init);
80
35/* ************************************************************************ 81/* ************************************************************************
36 * 82 *
37 * Setup the architecture 83 * Setup the architecture
@@ -49,8 +95,6 @@ static void __init mpc832x_rdb_setup_arch(void)
49#ifdef CONFIG_PCI 95#ifdef CONFIG_PCI
50 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 96 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
51 mpc83xx_add_bridge(np); 97 mpc83xx_add_bridge(np);
52
53 ppc_md.pci_exclude_device = mpc83xx_exclude_device;
54#endif 98#endif
55 99
56#ifdef CONFIG_QUICC_ENGINE 100#ifdef CONFIG_QUICC_ENGINE
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 47ba5446f63c..870fd20461ce 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -30,7 +30,6 @@
30#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/machdep.h> 31#include <asm/machdep.h>
32#include <asm/ipic.h> 32#include <asm/ipic.h>
33#include <asm/bootinfo.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
35#include <asm/prom.h> 34#include <asm/prom.h>
36#include <asm/udbg.h> 35#include <asm/udbg.h>
@@ -55,8 +54,6 @@ static void __init mpc834x_itx_setup_arch(void)
55#ifdef CONFIG_PCI 54#ifdef CONFIG_PCI
56 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 55 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
57 mpc83xx_add_bridge(np); 56 mpc83xx_add_bridge(np);
58
59 ppc_md.pci_exclude_device = mpc83xx_exclude_device;
60#endif 57#endif
61 58
62 mpc834x_usb_cfg(); 59 mpc834x_usb_cfg();
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 4c9ff9cadfe4..a9140b64b98a 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -30,7 +30,6 @@
30#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/machdep.h> 31#include <asm/machdep.h>
32#include <asm/ipic.h> 32#include <asm/ipic.h>
33#include <asm/bootinfo.h>
34#include <asm/irq.h> 33#include <asm/irq.h>
35#include <asm/prom.h> 34#include <asm/prom.h>
36#include <asm/udbg.h> 35#include <asm/udbg.h>
@@ -86,8 +85,6 @@ static void __init mpc834x_mds_setup_arch(void)
86#ifdef CONFIG_PCI 85#ifdef CONFIG_PCI
87 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 86 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
88 mpc83xx_add_bridge(np); 87 mpc83xx_add_bridge(np);
89
90 ppc_md.pci_exclude_device = mpc83xx_exclude_device;
91#endif 88#endif
92 89
93 mpc834xemds_usb_cfg(); 90 mpc834xemds_usb_cfg();
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 84b58934aafd..db6957611585 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -38,7 +38,6 @@
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/machdep.h> 39#include <asm/machdep.h>
40#include <asm/ipic.h> 40#include <asm/ipic.h>
41#include <asm/bootinfo.h>
42#include <asm/irq.h> 41#include <asm/irq.h>
43#include <asm/prom.h> 42#include <asm/prom.h>
44#include <asm/udbg.h> 43#include <asm/udbg.h>
@@ -82,7 +81,6 @@ static void __init mpc836x_mds_setup_arch(void)
82#ifdef CONFIG_PCI 81#ifdef CONFIG_PCI
83 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 82 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
84 mpc83xx_add_bridge(np); 83 mpc83xx_add_bridge(np);
85 ppc_md.pci_exclude_device = mpc83xx_exclude_device;
86#endif 84#endif
87 85
88#ifdef CONFIG_QUICC_ENGINE 86#ifdef CONFIG_QUICC_ENGINE
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 589ee55730f3..b778cb4f3fb5 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -49,8 +49,6 @@
49 */ 49 */
50 50
51extern int mpc83xx_add_bridge(struct device_node *dev); 51extern int mpc83xx_add_bridge(struct device_node *dev);
52extern int mpc83xx_exclude_device(struct pci_controller *hose,
53 u_char bus, u_char devfn);
54extern void mpc83xx_restart(char *cmd); 52extern void mpc83xx_restart(char *cmd);
55extern long mpc83xx_time_init(void); 53extern long mpc83xx_time_init(void);
56extern int mpc834x_usb_cfg(void); 54extern int mpc834x_usb_cfg(void);
diff --git a/arch/powerpc/platforms/83xx/pci.c b/arch/powerpc/platforms/83xx/pci.c
index 92069469de20..80425d7b14f8 100644
--- a/arch/powerpc/platforms/83xx/pci.c
+++ b/arch/powerpc/platforms/83xx/pci.c
@@ -33,13 +33,6 @@
33#define DBG(x...) 33#define DBG(x...)
34#endif 34#endif
35 35
36int mpc83xx_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn)
37{
38 if ((bus == hose->first_busno) && PCI_SLOT(devfn) == 0)
39 return PCIBIOS_DEVICE_NOT_FOUND;
40 return PCIBIOS_SUCCESSFUL;
41}
42
43int __init mpc83xx_add_bridge(struct device_node *dev) 36int __init mpc83xx_add_bridge(struct device_node *dev)
44{ 37{
45 int len; 38 int len;
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index f620171ad6b1..b8476b20a424 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -29,13 +29,13 @@ config MPC85xx_MDS
29 help 29 help
30 This option enables support for the MPC85xx MDS board 30 This option enables support for the MPC85xx MDS board
31 31
32config MPC8544_DS 32config MPC85xx_DS
33 bool "Freescale MPC8544 DS" 33 bool "Freescale MPC85xx DS"
34 select PPC_I8259 34 select PPC_I8259
35 select DEFAULT_UIMAGE 35 select DEFAULT_UIMAGE
36 select FSL_ULI1575 36 select FSL_ULI1575
37 help 37 help
38 This option enables support for the MPC8544 DS board 38 This option enables support for the MPC85xx DS (MPC8544 DS) board
39 39
40endchoice 40endchoice
41 41
@@ -58,4 +58,4 @@ config MPC85xx
58 select FSL_PCI if PCI 58 select FSL_PCI if PCI
59 select SERIAL_8250_SHARE_IRQ if SERIAL_8250 59 select SERIAL_8250_SHARE_IRQ if SERIAL_8250
60 default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \ 60 default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
61 || MPC85xx_MDS || MPC8544_DS 61 || MPC85xx_MDS || MPC85xx_DS
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index d70f2d0f9d36..25bd9e2d4946 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -5,5 +5,5 @@ obj-$(CONFIG_PPC_85xx) += misc.o
5obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o 5obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
6obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o 6obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
7obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o 7obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
8obj-$(CONFIG_MPC8544_DS) += mpc8544_ds.o 8obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o
9obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o 9obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 40a828675c7b..c22bc1c4f591 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -192,7 +192,6 @@ void init_fcc_ioports(struct fs_platform_info *fpi)
192 192
193static void __init mpc85xx_ads_setup_arch(void) 193static void __init mpc85xx_ads_setup_arch(void)
194{ 194{
195 struct device_node *cpu;
196#ifdef CONFIG_PCI 195#ifdef CONFIG_PCI
197 struct device_node *np; 196 struct device_node *np;
198#endif 197#endif
@@ -200,18 +199,6 @@ static void __init mpc85xx_ads_setup_arch(void)
200 if (ppc_md.progress) 199 if (ppc_md.progress)
201 ppc_md.progress("mpc85xx_ads_setup_arch()", 0); 200 ppc_md.progress("mpc85xx_ads_setup_arch()", 0);
202 201
203 cpu = of_find_node_by_type(NULL, "cpu");
204 if (cpu != 0) {
205 const unsigned int *fp;
206
207 fp = of_get_property(cpu, "clock-frequency", NULL);
208 if (fp != 0)
209 loops_per_jiffy = *fp / HZ;
210 else
211 loops_per_jiffy = 50000000 / HZ;
212 of_node_put(cpu);
213 }
214
215#ifdef CONFIG_CPM2 202#ifdef CONFIG_CPM2
216 cpm2_reset(); 203 cpm2_reset();
217#endif 204#endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 2d4cb7847604..665e8df05dc5 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -35,7 +35,6 @@
35#include <asm/io.h> 35#include <asm/io.h>
36#include <asm/machdep.h> 36#include <asm/machdep.h>
37#include <asm/ipic.h> 37#include <asm/ipic.h>
38#include <asm/bootinfo.h>
39#include <asm/pci-bridge.h> 38#include <asm/pci-bridge.h>
40#include <asm/mpc85xx.h> 39#include <asm/mpc85xx.h>
41#include <asm/irq.h> 40#include <asm/irq.h>
@@ -266,7 +265,6 @@ device_initcall(mpc85xx_cds_8259_attach);
266 */ 265 */
267static void __init mpc85xx_cds_setup_arch(void) 266static void __init mpc85xx_cds_setup_arch(void)
268{ 267{
269 struct device_node *cpu;
270#ifdef CONFIG_PCI 268#ifdef CONFIG_PCI
271 struct device_node *np; 269 struct device_node *np;
272#endif 270#endif
@@ -274,18 +272,6 @@ static void __init mpc85xx_cds_setup_arch(void)
274 if (ppc_md.progress) 272 if (ppc_md.progress)
275 ppc_md.progress("mpc85xx_cds_setup_arch()", 0); 273 ppc_md.progress("mpc85xx_cds_setup_arch()", 0);
276 274
277 cpu = of_find_node_by_type(NULL, "cpu");
278 if (cpu != 0) {
279 const unsigned int *fp;
280
281 fp = of_get_property(cpu, "clock-frequency", NULL);
282 if (fp != 0)
283 loops_per_jiffy = *fp / HZ;
284 else
285 loops_per_jiffy = 500000000 / HZ;
286 of_node_put(cpu);
287 }
288
289 cadmus = ioremap(CADMUS_BASE, CADMUS_SIZE); 275 cadmus = ioremap(CADMUS_BASE, CADMUS_SIZE);
290 cds_pci_slot = ((cadmus[CM_CSR] >> 6) & 0x3) + 1; 276 cds_pci_slot = ((cadmus[CM_CSR] >> 6) & 0x3) + 1;
291 277
diff --git a/arch/powerpc/platforms/85xx/mpc8544_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 48983bc56d46..4d449022ac9b 100644
--- a/arch/powerpc/platforms/85xx/mpc8544_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * MPC8544 DS Board Setup 2 * MPC85xx DS Board Setup
3 * 3 *
4 * Author Xianghua Xiao (x.xiao@freescale.com) 4 * Author Xianghua Xiao (x.xiao@freescale.com)
5 * Roy Zang <tie-fei.zang@freescale.com> 5 * Roy Zang <tie-fei.zang@freescale.com>
@@ -44,7 +44,7 @@
44#endif 44#endif
45 45
46#ifdef CONFIG_PPC_I8259 46#ifdef CONFIG_PPC_I8259
47static void mpc8544_8259_cascade(unsigned int irq, struct irq_desc *desc) 47static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
48{ 48{
49 unsigned int cascade_irq = i8259_irq(); 49 unsigned int cascade_irq = i8259_irq();
50 50
@@ -55,7 +55,7 @@ static void mpc8544_8259_cascade(unsigned int irq, struct irq_desc *desc)
55} 55}
56#endif /* CONFIG_PPC_I8259 */ 56#endif /* CONFIG_PPC_I8259 */
57 57
58void __init mpc8544_ds_pic_init(void) 58void __init mpc85xx_ds_pic_init(void)
59{ 59{
60 struct mpic *mpic; 60 struct mpic *mpic;
61 struct resource r; 61 struct resource r;
@@ -104,16 +104,17 @@ void __init mpc8544_ds_pic_init(void)
104 return; 104 return;
105 } 105 }
106 106
107 DBG("mpc8544ds: cascade mapped to irq %d\n", cascade_irq); 107 DBG("mpc85xxds: cascade mapped to irq %d\n", cascade_irq);
108 108
109 i8259_init(cascade_node, 0); 109 i8259_init(cascade_node, 0);
110 of_node_put(cascade_node); 110 of_node_put(cascade_node);
111 111
112 set_irq_chained_handler(cascade_irq, mpc8544_8259_cascade); 112 set_irq_chained_handler(cascade_irq, mpc85xx_8259_cascade);
113#endif /* CONFIG_PPC_I8259 */ 113#endif /* CONFIG_PPC_I8259 */
114} 114}
115 115
116#ifdef CONFIG_PCI 116#ifdef CONFIG_PCI
117static int primary_phb_addr;
117extern int uses_fsl_uli_m1575; 118extern int uses_fsl_uli_m1575;
118extern int uli_exclude_device(struct pci_controller *hose, 119extern int uli_exclude_device(struct pci_controller *hose,
119 u_char bus, u_char devfn); 120 u_char bus, u_char devfn);
@@ -121,13 +122,13 @@ extern int uli_exclude_device(struct pci_controller *hose,
121static int mpc85xx_exclude_device(struct pci_controller *hose, 122static int mpc85xx_exclude_device(struct pci_controller *hose,
122 u_char bus, u_char devfn) 123 u_char bus, u_char devfn)
123{ 124{
124 struct device_node* node; 125 struct device_node* node;
125 struct resource rsrc; 126 struct resource rsrc;
126 127
127 node = (struct device_node *)hose->arch_data; 128 node = (struct device_node *)hose->arch_data;
128 of_address_to_resource(node, 0, &rsrc); 129 of_address_to_resource(node, 0, &rsrc);
129 130
130 if ((rsrc.start & 0xfffff) == 0xb000) { 131 if ((rsrc.start & 0xfffff) == primary_phb_addr) {
131 return uli_exclude_device(hose, bus, devfn); 132 return uli_exclude_device(hose, bus, devfn);
132 } 133 }
133 134
@@ -138,20 +139,20 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
138/* 139/*
139 * Setup the architecture 140 * Setup the architecture
140 */ 141 */
141static void __init mpc8544_ds_setup_arch(void) 142static void __init mpc85xx_ds_setup_arch(void)
142{ 143{
143#ifdef CONFIG_PCI 144#ifdef CONFIG_PCI
144 struct device_node *np; 145 struct device_node *np;
145#endif 146#endif
146 147
147 if (ppc_md.progress) 148 if (ppc_md.progress)
148 ppc_md.progress("mpc8544_ds_setup_arch()", 0); 149 ppc_md.progress("mpc85xx_ds_setup_arch()", 0);
149 150
150#ifdef CONFIG_PCI 151#ifdef CONFIG_PCI
151 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) { 152 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
152 struct resource rsrc; 153 struct resource rsrc;
153 of_address_to_resource(np, 0, &rsrc); 154 of_address_to_resource(np, 0, &rsrc);
154 if ((rsrc.start & 0xfffff) == 0xb000) 155 if ((rsrc.start & 0xfffff) == primary_phb_addr)
155 fsl_add_bridge(np, 1); 156 fsl_add_bridge(np, 1);
156 else 157 else
157 fsl_add_bridge(np, 0); 158 fsl_add_bridge(np, 0);
@@ -160,7 +161,7 @@ static void __init mpc8544_ds_setup_arch(void)
160 ppc_md.pci_exclude_device = mpc85xx_exclude_device; 161 ppc_md.pci_exclude_device = mpc85xx_exclude_device;
161#endif 162#endif
162 163
163 printk("MPC8544 DS board from Freescale Semiconductor\n"); 164 printk("MPC85xx DS board from Freescale Semiconductor\n");
164} 165}
165 166
166/* 167/*
@@ -170,14 +171,52 @@ static int __init mpc8544_ds_probe(void)
170{ 171{
171 unsigned long root = of_get_flat_dt_root(); 172 unsigned long root = of_get_flat_dt_root();
172 173
173 return of_flat_dt_is_compatible(root, "MPC8544DS"); 174 if (of_flat_dt_is_compatible(root, "MPC8544DS")) {
175#ifdef CONFIG_PCI
176 primary_phb_addr = 0xb000;
177#endif
178 return 1;
179 } else {
180 return 0;
181 }
182}
183
184/*
185 * Called very early, device-tree isn't unflattened
186 */
187static int __init mpc8572_ds_probe(void)
188{
189 unsigned long root = of_get_flat_dt_root();
190
191 if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS")) {
192#ifdef CONFIG_PCI
193 primary_phb_addr = 0x8000;
194#endif
195 return 1;
196 } else {
197 return 0;
198 }
174} 199}
175 200
176define_machine(mpc8544_ds) { 201define_machine(mpc8544_ds) {
177 .name = "MPC8544 DS", 202 .name = "MPC8544 DS",
178 .probe = mpc8544_ds_probe, 203 .probe = mpc8544_ds_probe,
179 .setup_arch = mpc8544_ds_setup_arch, 204 .setup_arch = mpc85xx_ds_setup_arch,
180 .init_IRQ = mpc8544_ds_pic_init, 205 .init_IRQ = mpc85xx_ds_pic_init,
206#ifdef CONFIG_PCI
207 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
208#endif
209 .get_irq = mpic_get_irq,
210 .restart = mpc85xx_restart,
211 .calibrate_decr = generic_calibrate_decr,
212 .progress = udbg_progress,
213};
214
215define_machine(mpc8572_ds) {
216 .name = "MPC8572 DS",
217 .probe = mpc8572_ds_probe,
218 .setup_arch = mpc85xx_ds_setup_arch,
219 .init_IRQ = mpc85xx_ds_pic_init,
181#ifdef CONFIG_PCI 220#ifdef CONFIG_PCI
182 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 221 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
183#endif 222#endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 7ca7e676f1c4..c379286c3730 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -38,7 +38,6 @@
38#include <asm/time.h> 38#include <asm/time.h>
39#include <asm/io.h> 39#include <asm/io.h>
40#include <asm/machdep.h> 40#include <asm/machdep.h>
41#include <asm/bootinfo.h>
42#include <asm/pci-bridge.h> 41#include <asm/pci-bridge.h>
43#include <asm/mpc85xx.h> 42#include <asm/mpc85xx.h>
44#include <asm/irq.h> 43#include <asm/irq.h>
@@ -73,17 +72,6 @@ static void __init mpc85xx_mds_setup_arch(void)
73 if (ppc_md.progress) 72 if (ppc_md.progress)
74 ppc_md.progress("mpc85xx_mds_setup_arch()", 0); 73 ppc_md.progress("mpc85xx_mds_setup_arch()", 0);
75 74
76 np = of_find_node_by_type(NULL, "cpu");
77 if (np != NULL) {
78 const unsigned int *fp =
79 of_get_property(np, "clock-frequency", NULL);
80 if (fp != NULL)
81 loops_per_jiffy = *fp / HZ;
82 else
83 loops_per_jiffy = 50000000 / HZ;
84 of_node_put(np);
85 }
86
87 /* Map BCSR area */ 75 /* Map BCSR area */
88 np = of_find_node_by_name(NULL, "bcsr"); 76 np = of_find_node_by_name(NULL, "bcsr");
89 if (np != NULL) { 77 if (np != NULL) {
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 47aafa76c933..3ec9d5a25750 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -132,23 +132,13 @@ static int mpc86xx_exclude_device(struct pci_controller *hose,
132static void __init 132static void __init
133mpc86xx_hpcn_setup_arch(void) 133mpc86xx_hpcn_setup_arch(void)
134{ 134{
135#ifdef CONFIG_PCI
135 struct device_node *np; 136 struct device_node *np;
137#endif
136 138
137 if (ppc_md.progress) 139 if (ppc_md.progress)
138 ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0); 140 ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0);
139 141
140 np = of_find_node_by_type(NULL, "cpu");
141 if (np != 0) {
142 const unsigned int *fp;
143
144 fp = of_get_property(np, "clock-frequency", NULL);
145 if (fp != 0)
146 loops_per_jiffy = *fp / HZ;
147 else
148 loops_per_jiffy = 50000000 / HZ;
149 of_node_put(np);
150 }
151
152#ifdef CONFIG_PCI 142#ifdef CONFIG_PCI
153 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) { 143 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) {
154 struct resource rsrc; 144 struct resource rsrc;
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c
index f1693550c70c..b2b98dd8be6a 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -36,13 +36,11 @@
36 36
37#include <asm/mmu.h> 37#include <asm/mmu.h>
38#include <asm/reg.h> 38#include <asm/reg.h>
39#include <asm/residual.h>
40#include <asm/io.h> 39#include <asm/io.h>
41#include <asm/pgtable.h> 40#include <asm/pgtable.h>
42#include <asm/mpc8xx.h> 41#include <asm/mpc8xx.h>
43#include <asm/8xx_immap.h> 42#include <asm/8xx_immap.h>
44#include <asm/machdep.h> 43#include <asm/machdep.h>
45#include <asm/bootinfo.h>
46#include <asm/time.h> 44#include <asm/time.h>
47#include <asm/prom.h> 45#include <asm/prom.h>
48#include <asm/fs_pd.h> 46#include <asm/fs_pd.h>
@@ -55,7 +53,9 @@ struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
55#endif 53#endif
56 54
57void m8xx_calibrate_decr(void); 55void m8xx_calibrate_decr(void);
56#ifdef CONFIG_8xx_WDT
58extern void m8xx_wdt_handler_install(bd_t *bp); 57extern void m8xx_wdt_handler_install(bd_t *bp);
58#endif
59extern int cpm_pic_init(void); 59extern int cpm_pic_init(void);
60extern int cpm_get_irq(void); 60extern int cpm_get_irq(void);
61 61
@@ -89,24 +89,24 @@ init_internal_rtc(void)
89 89
90static int __init get_freq(char *name, unsigned long *val) 90static int __init get_freq(char *name, unsigned long *val)
91{ 91{
92 struct device_node *cpu; 92 struct device_node *cpu;
93 const unsigned int *fp; 93 const unsigned int *fp;
94 int found = 0; 94 int found = 0;
95 95
96 /* The cpu node should have timebase and clock frequency properties */ 96 /* The cpu node should have timebase and clock frequency properties */
97 cpu = of_find_node_by_type(NULL, "cpu"); 97 cpu = of_find_node_by_type(NULL, "cpu");
98 98
99 if (cpu) { 99 if (cpu) {
100 fp = of_get_property(cpu, name, NULL); 100 fp = of_get_property(cpu, name, NULL);
101 if (fp) { 101 if (fp) {
102 found = 1; 102 found = 1;
103 *val = *fp; 103 *val = *fp;
104 } 104 }
105 105
106 of_node_put(cpu); 106 of_node_put(cpu);
107 } 107 }
108 108
109 return found; 109 return found;
110} 110}
111 111
112/* The decrementer counts at the system (internal) clock frequency divided by 112/* The decrementer counts at the system (internal) clock frequency divided by
@@ -122,7 +122,7 @@ void __init mpc8xx_calibrate_decr(void)
122 sit8xx_t *sys_tmr2; 122 sit8xx_t *sys_tmr2;
123 int irq, virq; 123 int irq, virq;
124 124
125 clk_r1 = (cark8xx_t *) immr_map(im_clkrstk); 125 clk_r1 = (cark8xx_t *) immr_map(im_clkrstk);
126 126
127 /* Unlock the SCCR. */ 127 /* Unlock the SCCR. */
128 out_be32(&clk_r1->cark_sccrk, ~KAPWR_KEY); 128 out_be32(&clk_r1->cark_sccrk, ~KAPWR_KEY);
@@ -130,24 +130,24 @@ void __init mpc8xx_calibrate_decr(void)
130 immr_unmap(clk_r1); 130 immr_unmap(clk_r1);
131 131
132 /* Force all 8xx processors to use divide by 16 processor clock. */ 132 /* Force all 8xx processors to use divide by 16 processor clock. */
133 clk_r2 = (car8xx_t *) immr_map(im_clkrst); 133 clk_r2 = (car8xx_t *) immr_map(im_clkrst);
134 setbits32(&clk_r2->car_sccr, 0x02000000); 134 setbits32(&clk_r2->car_sccr, 0x02000000);
135 immr_unmap(clk_r2); 135 immr_unmap(clk_r2);
136 136
137 /* Processor frequency is MHz. 137 /* Processor frequency is MHz.
138 */ 138 */
139 ppc_tb_freq = 50000000; 139 ppc_tb_freq = 50000000;
140 if (!get_freq("bus-frequency", &ppc_tb_freq)) { 140 if (!get_freq("bus-frequency", &ppc_tb_freq)) {
141 printk(KERN_ERR "WARNING: Estimating decrementer frequency " 141 printk(KERN_ERR "WARNING: Estimating decrementer frequency "
142 "(not found)\n"); 142 "(not found)\n");
143 } 143 }
144 ppc_tb_freq /= 16; 144 ppc_tb_freq /= 16;
145 ppc_proc_freq = 50000000; 145 ppc_proc_freq = 50000000;
146 if (!get_freq("clock-frequency", &ppc_proc_freq)) 146 if (!get_freq("clock-frequency", &ppc_proc_freq))
147 printk(KERN_ERR "WARNING: Estimating processor frequency" 147 printk(KERN_ERR "WARNING: Estimating processor frequency"
148 "(not found)\n"); 148 "(not found)\n");
149 149
150 printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq); 150 printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq);
151 151
152 /* Perform some more timer/timebase initialization. This used 152 /* Perform some more timer/timebase initialization. This used
153 * to be done elsewhere, but other changes caused it to get 153 * to be done elsewhere, but other changes caused it to get
@@ -164,7 +164,7 @@ void __init mpc8xx_calibrate_decr(void)
164 * we guarantee the registers are locked, then we unlock them 164 * we guarantee the registers are locked, then we unlock them
165 * for our use. 165 * for our use.
166 */ 166 */
167 sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk); 167 sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk);
168 out_be32(&sys_tmr1->sitk_tbscrk, ~KAPWR_KEY); 168 out_be32(&sys_tmr1->sitk_tbscrk, ~KAPWR_KEY);
169 out_be32(&sys_tmr1->sitk_rtcsck, ~KAPWR_KEY); 169 out_be32(&sys_tmr1->sitk_rtcsck, ~KAPWR_KEY);
170 out_be32(&sys_tmr1->sitk_tbk, ~KAPWR_KEY); 170 out_be32(&sys_tmr1->sitk_tbk, ~KAPWR_KEY);
@@ -180,8 +180,8 @@ void __init mpc8xx_calibrate_decr(void)
180 * we have to enable the timebase). The decrementer interrupt 180 * we have to enable the timebase). The decrementer interrupt
181 * is wired into the vector table, nothing to do here for that. 181 * is wired into the vector table, nothing to do here for that.
182 */ 182 */
183 cpu = of_find_node_by_type(NULL, "cpu"); 183 cpu = of_find_node_by_type(NULL, "cpu");
184 virq= irq_of_parse_and_map(cpu, 0); 184 virq= irq_of_parse_and_map(cpu, 0);
185 irq = irq_map[virq].hwirq; 185 irq = irq_map[virq].hwirq;
186 186
187 sys_tmr2 = (sit8xx_t *) immr_map(im_sit); 187 sys_tmr2 = (sit8xx_t *) immr_map(im_sit);
@@ -211,10 +211,10 @@ int mpc8xx_set_rtc_time(struct rtc_time *tm)
211 sit8xx_t *sys_tmr2; 211 sit8xx_t *sys_tmr2;
212 int time; 212 int time;
213 213
214 sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk); 214 sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk);
215 sys_tmr2 = (sit8xx_t *) immr_map(im_sit); 215 sys_tmr2 = (sit8xx_t *) immr_map(im_sit);
216 time = mktime(tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, 216 time = mktime(tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
217 tm->tm_hour, tm->tm_min, tm->tm_sec); 217 tm->tm_hour, tm->tm_min, tm->tm_sec);
218 218
219 out_be32(&sys_tmr1->sitk_rtck, KAPWR_KEY); 219 out_be32(&sys_tmr1->sitk_rtck, KAPWR_KEY);
220 out_be32(&sys_tmr2->sit_rtc, time); 220 out_be32(&sys_tmr2->sit_rtc, time);
@@ -233,8 +233,8 @@ void mpc8xx_get_rtc_time(struct rtc_time *tm)
233 /* Get time from the RTC. */ 233 /* Get time from the RTC. */
234 data = in_be32(&sys_tmr->sit_rtc); 234 data = in_be32(&sys_tmr->sit_rtc);
235 to_tm(data, tm); 235 to_tm(data, tm);
236 tm->tm_year -= 1900; 236 tm->tm_year -= 1900;
237 tm->tm_mon -= 1; 237 tm->tm_mon -= 1;
238 immr_unmap(sys_tmr); 238 immr_unmap(sys_tmr);
239 return; 239 return;
240} 240}
@@ -298,7 +298,7 @@ void __init m8xx_pic_init(void)
298 int irq; 298 int irq;
299 299
300 if (mpc8xx_pic_init()) { 300 if (mpc8xx_pic_init()) {
301 printk(KERN_ERR "Failed interrupt 8xx controller initialization\n"); 301 printk(KERN_ERR "Failed interrupt 8xx controller initialization\n");
302 return; 302 return;
303 } 303 }
304 304
diff --git a/arch/powerpc/platforms/8xx/mpc86xads.h b/arch/powerpc/platforms/8xx/mpc86xads.h
index 59bad2f9ae51..dd10cd20b6a7 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads.h
+++ b/arch/powerpc/platforms/8xx/mpc86xads.h
@@ -15,7 +15,6 @@
15#ifndef __ASM_MPC86XADS_H__ 15#ifndef __ASM_MPC86XADS_H__
16#define __ASM_MPC86XADS_H__ 16#define __ASM_MPC86XADS_H__
17 17
18#include <asm/ppcboot.h>
19#include <sysdev/fsl_soc.h> 18#include <sysdev/fsl_soc.h>
20 19
21/* U-Boot maps BCSR to 0xff080000 */ 20/* U-Boot maps BCSR to 0xff080000 */
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index cf0e7bc8c2e7..8f64f48698ab 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -31,7 +31,6 @@
31#include <asm/processor.h> 31#include <asm/processor.h>
32#include <asm/system.h> 32#include <asm/system.h>
33#include <asm/time.h> 33#include <asm/time.h>
34#include <asm/ppcboot.h>
35#include <asm/mpc8xx.h> 34#include <asm/mpc8xx.h>
36#include <asm/8xx_immap.h> 35#include <asm/8xx_immap.h>
37#include <asm/commproc.h> 36#include <asm/commproc.h>
@@ -254,20 +253,6 @@ int platform_device_skip(const char *model, int id)
254 253
255static void __init mpc86xads_setup_arch(void) 254static void __init mpc86xads_setup_arch(void)
256{ 255{
257 struct device_node *cpu;
258
259 cpu = of_find_node_by_type(NULL, "cpu");
260 if (cpu != 0) {
261 const unsigned int *fp;
262
263 fp = of_get_property(cpu, "clock-frequency", NULL);
264 if (fp != 0)
265 loops_per_jiffy = *fp / HZ;
266 else
267 loops_per_jiffy = 50000000 / HZ;
268 of_node_put(cpu);
269 }
270
271 cpm_reset(); 256 cpm_reset();
272 257
273 mpc86xads_board_setup(); 258 mpc86xads_board_setup();
diff --git a/arch/powerpc/platforms/8xx/mpc885ads.h b/arch/powerpc/platforms/8xx/mpc885ads.h
index 7c31aec284c2..14db12417064 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads.h
+++ b/arch/powerpc/platforms/8xx/mpc885ads.h
@@ -15,7 +15,6 @@
15#ifndef __ASM_MPC885ADS_H__ 15#ifndef __ASM_MPC885ADS_H__
16#define __ASM_MPC885ADS_H__ 16#define __ASM_MPC885ADS_H__
17 17
18#include <asm/ppcboot.h>
19#include <sysdev/fsl_soc.h> 18#include <sysdev/fsl_soc.h>
20 19
21/* U-Boot maps BCSR to 0xff080000 */ 20/* U-Boot maps BCSR to 0xff080000 */
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 5a808d611ae3..a1dab4cfd3de 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -32,7 +32,6 @@
32#include <asm/processor.h> 32#include <asm/processor.h>
33#include <asm/system.h> 33#include <asm/system.h>
34#include <asm/time.h> 34#include <asm/time.h>
35#include <asm/ppcboot.h>
36#include <asm/mpc8xx.h> 35#include <asm/mpc8xx.h>
37#include <asm/8xx_immap.h> 36#include <asm/8xx_immap.h>
38#include <asm/commproc.h> 37#include <asm/commproc.h>
@@ -406,20 +405,6 @@ int platform_device_skip(const char *model, int id)
406 405
407static void __init mpc885ads_setup_arch(void) 406static void __init mpc885ads_setup_arch(void)
408{ 407{
409 struct device_node *cpu;
410
411 cpu = of_find_node_by_type(NULL, "cpu");
412 if (cpu != 0) {
413 const unsigned int *fp;
414
415 fp = of_get_property(cpu, "clock-frequency", NULL);
416 if (fp != 0)
417 loops_per_jiffy = *fp / HZ;
418 else
419 loops_per_jiffy = 50000000 / HZ;
420 of_node_put(cpu);
421 }
422
423 cpm_reset(); 408 cpm_reset();
424 409
425 mpc885ads_board_setup(); 410 mpc885ads_board_setup();
@@ -441,9 +426,14 @@ static int __init mpc885ads_probe(void)
441 426
442define_machine(mpc885_ads) 427define_machine(mpc885_ads)
443{ 428{
444.name = "MPC885 ADS",.probe = mpc885ads_probe,.setup_arch = 429 .name = "MPC885 ADS",
445 mpc885ads_setup_arch,.init_IRQ = 430 .probe = mpc885ads_probe,
446 m8xx_pic_init,.show_cpuinfo = mpc8xx_show_cpuinfo,.get_irq = 431 .setup_arch = mpc885ads_setup_arch,
447 mpc8xx_get_irq,.restart = mpc8xx_restart,.calibrate_decr = 432 .init_IRQ = m8xx_pic_init,
448 mpc8xx_calibrate_decr,.set_rtc_time = 433 .show_cpuinfo = mpc8xx_show_cpuinfo,
449 mpc8xx_set_rtc_time,.get_rtc_time = mpc8xx_get_rtc_time,}; 434 .get_irq = mpc8xx_get_irq,
435 .restart = mpc8xx_restart,
436 .calibrate_decr = mpc8xx_calibrate_decr,
437 .set_rtc_time = mpc8xx_set_rtc_time,
438 .get_rtc_time = mpc8xx_get_rtc_time,
439};
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 19d4628edf79..92fcd6e35b51 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -12,13 +12,10 @@ config PPC_MULTIPLATFORM
12 RS/6000 machine, an Apple machine, or a PReP, CHRP, 12 RS/6000 machine, an Apple machine, or a PReP, CHRP,
13 Maple or Cell-based machine. 13 Maple or Cell-based machine.
14 14
15config EMBEDDED6xx
16 bool "Embedded 6xx/7xx/7xxx-based board"
17 depends on PPC32 && (BROKEN||BROKEN_ON_SMP)
18
19config PPC_82xx 15config PPC_82xx
20 bool "Freescale 82xx" 16 bool "Freescale 82xx"
21 depends on 6xx 17 depends on 6xx
18 select WANT_DEVICE_TREE
22 19
23config PPC_83xx 20config PPC_83xx
24 bool "Freescale 83xx" 21 bool "Freescale 83xx"
@@ -58,7 +55,7 @@ source "arch/powerpc/platforms/85xx/Kconfig"
58source "arch/powerpc/platforms/86xx/Kconfig" 55source "arch/powerpc/platforms/86xx/Kconfig"
59source "arch/powerpc/platforms/embedded6xx/Kconfig" 56source "arch/powerpc/platforms/embedded6xx/Kconfig"
60source "arch/powerpc/platforms/44x/Kconfig" 57source "arch/powerpc/platforms/44x/Kconfig"
61#source "arch/powerpc/platforms/4xx/Kconfig 58source "arch/powerpc/platforms/40x/Kconfig"
62 59
63config PPC_NATIVE 60config PPC_NATIVE
64 bool 61 bool
@@ -136,6 +133,16 @@ config MPIC_U3_HT_IRQS
136 depends on PPC_MAPLE 133 depends on PPC_MAPLE
137 default y 134 default y
138 135
136config MPIC_BROKEN_REGREAD
137 bool
138 depends on MPIC
139 help
140 This option enables a MPIC driver workaround for some chips
141 that have a bug that causes some interrupt source information
142 to not read back properly. It is safe to use on other chips as
143 well, but enabling it uses about 8KB of memory to keep copies
144 of the register contents in software.
145
139config IBMVIO 146config IBMVIO
140 depends on PPC_PSERIES || PPC_ISERIES 147 depends on PPC_PSERIES || PPC_ISERIES
141 bool 148 bool
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index e4b2aee53a73..4c315be25015 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -36,10 +36,12 @@ config PPC_8xx
36 bool "Freescale 8xx" 36 bool "Freescale 8xx"
37 select FSL_SOC 37 select FSL_SOC
38 select 8xx 38 select 8xx
39 select WANT_DEVICE_TREE
39 40
40config 40x 41config 40x
41 bool "AMCC 40x" 42 bool "AMCC 40x"
42 select PPC_DCR_NATIVE 43 select PPC_DCR_NATIVE
44 select WANT_DEVICE_TREE
43 45
44config 44x 46config 44x
45 bool "AMCC 44x" 47 bool "AMCC 44x"
@@ -69,6 +71,18 @@ config POWER4
69 depends on PPC64 71 depends on PPC64
70 def_bool y 72 def_bool y
71 73
74config TUNE_CELL
75 bool "Optimize for Cell Broadband Engine"
76 depends on PPC64
77 help
78 Cause the compiler to optimize for the PPE of the Cell Broadband
79 Engine. This will make the code run considerably faster on Cell
80 but somewhat slower on other machines. This option only changes
81 the scheduling of instructions, not the selection of instructions
82 itself, so the resulting kernel will keep running on all other
83 machines. When building a kernel that is supposed to run only
84 on Cell, you should also select the POWER4_ONLY option.
85
72config 6xx 86config 6xx
73 bool 87 bool
74 88
diff --git a/arch/powerpc/platforms/Makefile b/arch/powerpc/platforms/Makefile
index d44e832b01f2..6d9079da5f5a 100644
--- a/arch/powerpc/platforms/Makefile
+++ b/arch/powerpc/platforms/Makefile
@@ -9,7 +9,7 @@ obj-$(CONFIG_PPC_PMAC) += powermac/
9endif 9endif
10endif 10endif
11obj-$(CONFIG_PPC_CHRP) += chrp/ 11obj-$(CONFIG_PPC_CHRP) += chrp/
12#obj-$(CONFIG_4xx) += 4xx/ 12obj-$(CONFIG_40x) += 40x/
13obj-$(CONFIG_44x) += 44x/ 13obj-$(CONFIG_44x) += 44x/
14obj-$(CONFIG_PPC_MPC52xx) += 52xx/ 14obj-$(CONFIG_PPC_MPC52xx) += 52xx/
15obj-$(CONFIG_PPC_8xx) += 8xx/ 15obj-$(CONFIG_PPC_8xx) += 8xx/
diff --git a/arch/powerpc/platforms/cell/Makefile b/arch/powerpc/platforms/cell/Makefile
index f88a7c76f296..61d12f183036 100644
--- a/arch/powerpc/platforms/cell/Makefile
+++ b/arch/powerpc/platforms/cell/Makefile
@@ -13,15 +13,13 @@ obj-$(CONFIG_PPC_CELL_NATIVE) += smp.o
13endif 13endif
14 14
15# needed only when building loadable spufs.ko 15# needed only when building loadable spufs.ko
16spufs-modular-$(CONFIG_SPU_FS) += spu_syscalls.o
17spu-priv1-$(CONFIG_PPC_CELL_NATIVE) += spu_priv1_mmio.o 16spu-priv1-$(CONFIG_PPC_CELL_NATIVE) += spu_priv1_mmio.o
18 17
19spu-manage-$(CONFIG_PPC_CELLEB) += spu_manage.o 18spu-manage-$(CONFIG_PPC_CELLEB) += spu_manage.o
20spu-manage-$(CONFIG_PPC_CELL_NATIVE) += spu_manage.o 19spu-manage-$(CONFIG_PPC_CELL_NATIVE) += spu_manage.o
21 20
22obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \ 21obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \
23 spu_coredump.o \ 22 spu_syscalls.o \
24 $(spufs-modular-m) \
25 $(spu-priv1-y) \ 23 $(spu-priv1-y) \
26 $(spu-manage-y) \ 24 $(spu-manage-y) \
27 spufs/ 25 spufs/
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index 4c9ab5b70bae..1245b2f517bb 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -64,13 +64,11 @@
64 64
65 65
66struct axon_msic { 66struct axon_msic {
67 struct device_node *dn;
68 struct irq_host *irq_host; 67 struct irq_host *irq_host;
69 __le32 *fifo; 68 __le32 *fifo;
70 dcr_host_t dcr_host; 69 dcr_host_t dcr_host;
71 struct list_head list; 70 struct list_head list;
72 u32 read_offset; 71 u32 read_offset;
73 u32 dcr_base;
74}; 72};
75 73
76static LIST_HEAD(axon_msic_list); 74static LIST_HEAD(axon_msic_list);
@@ -79,12 +77,12 @@ static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val)
79{ 77{
80 pr_debug("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n); 78 pr_debug("axon_msi: dcr_write(0x%x, 0x%x)\n", val, dcr_n);
81 79
82 dcr_write(msic->dcr_host, msic->dcr_base + dcr_n, val); 80 dcr_write(msic->dcr_host, msic->dcr_host.base + dcr_n, val);
83} 81}
84 82
85static u32 msic_dcr_read(struct axon_msic *msic, unsigned int dcr_n) 83static u32 msic_dcr_read(struct axon_msic *msic, unsigned int dcr_n)
86{ 84{
87 return dcr_read(msic->dcr_host, msic->dcr_base + dcr_n); 85 return dcr_read(msic->dcr_host, msic->dcr_host.base + dcr_n);
88} 86}
89 87
90static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc) 88static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
@@ -126,7 +124,7 @@ static struct axon_msic *find_msi_translator(struct pci_dev *dev)
126 const phandle *ph; 124 const phandle *ph;
127 struct axon_msic *msic = NULL; 125 struct axon_msic *msic = NULL;
128 126
129 dn = pci_device_to_OF_node(dev); 127 dn = of_node_get(pci_device_to_OF_node(dev));
130 if (!dn) { 128 if (!dn) {
131 dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n"); 129 dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
132 return NULL; 130 return NULL;
@@ -183,7 +181,7 @@ static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg)
183 int len; 181 int len;
184 const u32 *prop; 182 const u32 *prop;
185 183
186 dn = pci_device_to_OF_node(dev); 184 dn = of_node_get(pci_device_to_OF_node(dev));
187 if (!dn) { 185 if (!dn) {
188 dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n"); 186 dev_dbg(&dev->dev, "axon_msi: no pci_dn found\n");
189 return -ENODEV; 187 return -ENODEV;
@@ -295,15 +293,7 @@ static int msic_host_map(struct irq_host *h, unsigned int virq,
295 return 0; 293 return 0;
296} 294}
297 295
298static int msic_host_match(struct irq_host *host, struct device_node *dn)
299{
300 struct axon_msic *msic = host->host_data;
301
302 return msic->dn == dn;
303}
304
305static struct irq_host_ops msic_host_ops = { 296static struct irq_host_ops msic_host_ops = {
306 .match = msic_host_match,
307 .map = msic_host_map, 297 .map = msic_host_map,
308}; 298};
309 299
@@ -314,7 +304,8 @@ static int axon_msi_notify_reboot(struct notifier_block *nb,
314 u32 tmp; 304 u32 tmp;
315 305
316 list_for_each_entry(msic, &axon_msic_list, list) { 306 list_for_each_entry(msic, &axon_msic_list, list) {
317 pr_debug("axon_msi: disabling %s\n", msic->dn->full_name); 307 pr_debug("axon_msi: disabling %s\n",
308 msic->irq_host->of_node->full_name);
318 tmp = msic_dcr_read(msic, MSIC_CTRL_REG); 309 tmp = msic_dcr_read(msic, MSIC_CTRL_REG);
319 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE; 310 tmp &= ~MSIC_CTRL_ENABLE & ~MSIC_CTRL_IRQ_ENABLE;
320 msic_dcr_write(msic, MSIC_CTRL_REG, tmp); 311 msic_dcr_write(msic, MSIC_CTRL_REG, tmp);
@@ -332,7 +323,7 @@ static int axon_msi_setup_one(struct device_node *dn)
332 struct page *page; 323 struct page *page;
333 struct axon_msic *msic; 324 struct axon_msic *msic;
334 unsigned int virq; 325 unsigned int virq;
335 int dcr_len; 326 int dcr_base, dcr_len;
336 327
337 pr_debug("axon_msi: setting up dn %s\n", dn->full_name); 328 pr_debug("axon_msi: setting up dn %s\n", dn->full_name);
338 329
@@ -343,17 +334,17 @@ static int axon_msi_setup_one(struct device_node *dn)
343 goto out; 334 goto out;
344 } 335 }
345 336
346 msic->dcr_base = dcr_resource_start(dn, 0); 337 dcr_base = dcr_resource_start(dn, 0);
347 dcr_len = dcr_resource_len(dn, 0); 338 dcr_len = dcr_resource_len(dn, 0);
348 339
349 if (msic->dcr_base == 0 || dcr_len == 0) { 340 if (dcr_base == 0 || dcr_len == 0) {
350 printk(KERN_ERR 341 printk(KERN_ERR
351 "axon_msi: couldn't parse dcr properties on %s\n", 342 "axon_msi: couldn't parse dcr properties on %s\n",
352 dn->full_name); 343 dn->full_name);
353 goto out; 344 goto out;
354 } 345 }
355 346
356 msic->dcr_host = dcr_map(dn, msic->dcr_base, dcr_len); 347 msic->dcr_host = dcr_map(dn, dcr_base, dcr_len);
357 if (!DCR_MAP_OK(msic->dcr_host)) { 348 if (!DCR_MAP_OK(msic->dcr_host)) {
358 printk(KERN_ERR "axon_msi: dcr_map failed for %s\n", 349 printk(KERN_ERR "axon_msi: dcr_map failed for %s\n",
359 dn->full_name); 350 dn->full_name);
@@ -370,8 +361,8 @@ static int axon_msi_setup_one(struct device_node *dn)
370 361
371 msic->fifo = page_address(page); 362 msic->fifo = page_address(page);
372 363
373 msic->irq_host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, NR_IRQS, 364 msic->irq_host = irq_alloc_host(of_node_get(dn), IRQ_HOST_MAP_NOMAP,
374 &msic_host_ops, 0); 365 NR_IRQS, &msic_host_ops, 0);
375 if (!msic->irq_host) { 366 if (!msic->irq_host) {
376 printk(KERN_ERR "axon_msi: couldn't allocate irq_host for %s\n", 367 printk(KERN_ERR "axon_msi: couldn't allocate irq_host for %s\n",
377 dn->full_name); 368 dn->full_name);
@@ -387,8 +378,6 @@ static int axon_msi_setup_one(struct device_node *dn)
387 goto out_free_host; 378 goto out_free_host;
388 } 379 }
389 380
390 msic->dn = of_node_get(dn);
391
392 set_irq_data(virq, msic); 381 set_irq_data(virq, msic);
393 set_irq_chained_handler(virq, axon_msi_cascade); 382 set_irq_chained_handler(virq, axon_msi_cascade);
394 pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq); 383 pr_debug("axon_msi: irq 0x%x setup for axon_msi\n", virq);
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 47264e722029..c29e634177fa 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -381,7 +381,7 @@ static int __init setup_iic(void)
381void __init iic_init_IRQ(void) 381void __init iic_init_IRQ(void)
382{ 382{
383 /* Setup an irq host data structure */ 383 /* Setup an irq host data structure */
384 iic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, IIC_SOURCE_COUNT, 384 iic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_LINEAR, IIC_SOURCE_COUNT,
385 &iic_host_ops, IIC_IRQ_INVALID); 385 &iic_host_ops, IIC_IRQ_INVALID);
386 BUG_ON(iic_host == NULL); 386 BUG_ON(iic_host == NULL);
387 irq_set_default_host(iic_host); 387 irq_set_default_host(iic_host);
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index 05f4b3d3d756..3f4b4aef756d 100644
--- a/arch/powerpc/platforms/cell/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -63,7 +63,6 @@ enum {
63 63
64struct spider_pic { 64struct spider_pic {
65 struct irq_host *host; 65 struct irq_host *host;
66 struct device_node *of_node;
67 void __iomem *regs; 66 void __iomem *regs;
68 unsigned int node_id; 67 unsigned int node_id;
69}; 68};
@@ -176,12 +175,6 @@ static struct irq_chip spider_pic = {
176 .set_type = spider_set_irq_type, 175 .set_type = spider_set_irq_type,
177}; 176};
178 177
179static int spider_host_match(struct irq_host *h, struct device_node *node)
180{
181 struct spider_pic *pic = h->host_data;
182 return node == pic->of_node;
183}
184
185static int spider_host_map(struct irq_host *h, unsigned int virq, 178static int spider_host_map(struct irq_host *h, unsigned int virq,
186 irq_hw_number_t hw) 179 irq_hw_number_t hw)
187{ 180{
@@ -208,7 +201,6 @@ static int spider_host_xlate(struct irq_host *h, struct device_node *ct,
208} 201}
209 202
210static struct irq_host_ops spider_host_ops = { 203static struct irq_host_ops spider_host_ops = {
211 .match = spider_host_match,
212 .map = spider_host_map, 204 .map = spider_host_map,
213 .xlate = spider_host_xlate, 205 .xlate = spider_host_xlate,
214}; 206};
@@ -247,18 +239,18 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
247 * tree in case the device-tree is ever fixed 239 * tree in case the device-tree is ever fixed
248 */ 240 */
249 struct of_irq oirq; 241 struct of_irq oirq;
250 if (of_irq_map_one(pic->of_node, 0, &oirq) == 0) { 242 if (of_irq_map_one(pic->host->of_node, 0, &oirq) == 0) {
251 virq = irq_create_of_mapping(oirq.controller, oirq.specifier, 243 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
252 oirq.size); 244 oirq.size);
253 return virq; 245 return virq;
254 } 246 }
255 247
256 /* Now do the horrible hacks */ 248 /* Now do the horrible hacks */
257 tmp = of_get_property(pic->of_node, "#interrupt-cells", NULL); 249 tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL);
258 if (tmp == NULL) 250 if (tmp == NULL)
259 return NO_IRQ; 251 return NO_IRQ;
260 intsize = *tmp; 252 intsize = *tmp;
261 imap = of_get_property(pic->of_node, "interrupt-map", &imaplen); 253 imap = of_get_property(pic->host->of_node, "interrupt-map", &imaplen);
262 if (imap == NULL || imaplen < (intsize + 1)) 254 if (imap == NULL || imaplen < (intsize + 1))
263 return NO_IRQ; 255 return NO_IRQ;
264 iic = of_find_node_by_phandle(imap[intsize]); 256 iic = of_find_node_by_phandle(imap[intsize]);
@@ -308,15 +300,13 @@ static void __init spider_init_one(struct device_node *of_node, int chip,
308 panic("spider_pic: can't map registers !"); 300 panic("spider_pic: can't map registers !");
309 301
310 /* Allocate a host */ 302 /* Allocate a host */
311 pic->host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, SPIDER_SRC_COUNT, 303 pic->host = irq_alloc_host(of_node_get(of_node), IRQ_HOST_MAP_LINEAR,
312 &spider_host_ops, SPIDER_IRQ_INVALID); 304 SPIDER_SRC_COUNT, &spider_host_ops,
305 SPIDER_IRQ_INVALID);
313 if (pic->host == NULL) 306 if (pic->host == NULL)
314 panic("spider_pic: can't allocate irq host !"); 307 panic("spider_pic: can't allocate irq host !");
315 pic->host->host_data = pic; 308 pic->host->host_data = pic;
316 309
317 /* Fill out other bits */
318 pic->of_node = of_node_get(of_node);
319
320 /* Go through all sources and disable them */ 310 /* Go through all sources and disable them */
321 for (i = 0; i < SPIDER_SRC_COUNT; i++) { 311 for (i = 0; i < SPIDER_SRC_COUNT; i++) {
322 void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i; 312 void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i;
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 106d2921e2d9..b5a21177bb32 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -458,7 +458,7 @@ static int spu_shutdown(struct sys_device *sysdev)
458 return 0; 458 return 0;
459} 459}
460 460
461struct sysdev_class spu_sysdev_class = { 461static struct sysdev_class spu_sysdev_class = {
462 set_kset_name("spu"), 462 set_kset_name("spu"),
463 .shutdown = spu_shutdown, 463 .shutdown = spu_shutdown,
464}; 464};
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index 47ec3be3edcd..dceb8b6a9382 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -2,7 +2,7 @@
2 * System call callback functions for SPUs 2 * System call callback functions for SPUs
3 */ 3 */
4 4
5#define DEBUG 5#undef DEBUG
6 6
7#include <linux/kallsyms.h> 7#include <linux/kallsyms.h>
8#include <linux/module.h> 8#include <linux/module.h>
@@ -33,7 +33,7 @@
33 * mbind, mq_open, ipc, ... 33 * mbind, mq_open, ipc, ...
34 */ 34 */
35 35
36void *spu_syscall_table[] = { 36static void *spu_syscall_table[] = {
37#define SYSCALL(func) sys_ni_syscall, 37#define SYSCALL(func) sys_ni_syscall,
38#define COMPAT_SYS(func) sys_ni_syscall, 38#define COMPAT_SYS(func) sys_ni_syscall,
39#define PPC_SYS(func) sys_ni_syscall, 39#define PPC_SYS(func) sys_ni_syscall,
diff --git a/arch/powerpc/platforms/cell/spu_coredump.c b/arch/powerpc/platforms/cell/spu_coredump.c
deleted file mode 100644
index 4fd37ff1e210..000000000000
--- a/arch/powerpc/platforms/cell/spu_coredump.c
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * SPU core dump code
3 *
4 * (C) Copyright 2006 IBM Corp.
5 *
6 * Author: Dwayne Grant McConnell <decimal@us.ibm.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#include <linux/file.h>
24#include <linux/module.h>
25#include <linux/syscalls.h>
26
27#include <asm/spu.h>
28
29static struct spu_coredump_calls *spu_coredump_calls;
30static DEFINE_MUTEX(spu_coredump_mutex);
31
32int arch_notes_size(void)
33{
34 long ret;
35
36 ret = -ENOSYS;
37 mutex_lock(&spu_coredump_mutex);
38 if (spu_coredump_calls && try_module_get(spu_coredump_calls->owner)) {
39 ret = spu_coredump_calls->arch_notes_size();
40 module_put(spu_coredump_calls->owner);
41 }
42 mutex_unlock(&spu_coredump_mutex);
43 return ret;
44}
45
46void arch_write_notes(struct file *file)
47{
48 mutex_lock(&spu_coredump_mutex);
49 if (spu_coredump_calls && try_module_get(spu_coredump_calls->owner)) {
50 spu_coredump_calls->arch_write_notes(file);
51 module_put(spu_coredump_calls->owner);
52 }
53 mutex_unlock(&spu_coredump_mutex);
54}
55
56int register_arch_coredump_calls(struct spu_coredump_calls *calls)
57{
58 int ret = 0;
59
60
61 mutex_lock(&spu_coredump_mutex);
62 if (spu_coredump_calls)
63 ret = -EBUSY;
64 else
65 spu_coredump_calls = calls;
66 mutex_unlock(&spu_coredump_mutex);
67 return ret;
68}
69EXPORT_SYMBOL_GPL(register_arch_coredump_calls);
70
71void unregister_arch_coredump_calls(struct spu_coredump_calls *calls)
72{
73 BUG_ON(spu_coredump_calls != calls);
74
75 mutex_lock(&spu_coredump_mutex);
76 spu_coredump_calls = NULL;
77 mutex_unlock(&spu_coredump_mutex);
78}
79EXPORT_SYMBOL_GPL(unregister_arch_coredump_calls);
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c
index 0e14f532500e..1b010707488d 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -377,10 +377,10 @@ static int qs20_reg_memory[QS20_SPES_PER_BE] = { 1, 1, 0, 0, 0, 0, 0, 0 };
377static struct spu *spu_lookup_reg(int node, u32 reg) 377static struct spu *spu_lookup_reg(int node, u32 reg)
378{ 378{
379 struct spu *spu; 379 struct spu *spu;
380 u32 *spu_reg; 380 const u32 *spu_reg;
381 381
382 list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) { 382 list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) {
383 spu_reg = (u32*)of_get_property(spu_devnode(spu), "reg", NULL); 383 spu_reg = of_get_property(spu_devnode(spu), "reg", NULL);
384 if (*spu_reg == reg) 384 if (*spu_reg == reg)
385 return spu; 385 return spu;
386 } 386 }
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c
index 027ac32cc636..a9438b719fe8 100644
--- a/arch/powerpc/platforms/cell/spu_syscalls.c
+++ b/arch/powerpc/platforms/cell/spu_syscalls.c
@@ -2,6 +2,7 @@
2 * SPU file system -- system call stubs 2 * SPU file system -- system call stubs
3 * 3 *
4 * (C) Copyright IBM Deutschland Entwicklung GmbH 2005 4 * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
5 * (C) Copyright 2006-2007, IBM Corporation
5 * 6 *
6 * Author: Arnd Bergmann <arndb@de.ibm.com> 7 * Author: Arnd Bergmann <arndb@de.ibm.com>
7 * 8 *
@@ -20,44 +21,73 @@
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */ 22 */
22#include <linux/file.h> 23#include <linux/file.h>
24#include <linux/fs.h>
23#include <linux/module.h> 25#include <linux/module.h>
24#include <linux/syscalls.h> 26#include <linux/syscalls.h>
27#include <linux/rcupdate.h>
25 28
26#include <asm/spu.h> 29#include <asm/spu.h>
27 30
28struct spufs_calls spufs_calls = { 31/* protected by rcu */
29 .owner = NULL, 32static struct spufs_calls *spufs_calls;
30};
31 33
32/* These stub syscalls are needed to have the actual implementation 34#ifdef CONFIG_SPU_FS_MODULE
33 * within a loadable module. When spufs is built into the kernel, 35
34 * this file is not used and the syscalls directly enter the fs code */ 36static inline struct spufs_calls *spufs_calls_get(void)
37{
38 struct spufs_calls *calls = NULL;
39
40 rcu_read_lock();
41 calls = rcu_dereference(spufs_calls);
42 if (calls && !try_module_get(calls->owner))
43 calls = NULL;
44 rcu_read_unlock();
45
46 return calls;
47}
48
49static inline void spufs_calls_put(struct spufs_calls *calls)
50{
51 BUG_ON(calls != spufs_calls);
52
53 /* we don't need to rcu this, as we hold a reference to the module */
54 module_put(spufs_calls->owner);
55}
56
57#else /* !defined CONFIG_SPU_FS_MODULE */
58
59static inline struct spufs_calls *spufs_calls_get(void)
60{
61 return spufs_calls;
62}
63
64static inline void spufs_calls_put(struct spufs_calls *calls) { }
65
66#endif /* CONFIG_SPU_FS_MODULE */
35 67
36asmlinkage long sys_spu_create(const char __user *name, 68asmlinkage long sys_spu_create(const char __user *name,
37 unsigned int flags, mode_t mode, int neighbor_fd) 69 unsigned int flags, mode_t mode, int neighbor_fd)
38{ 70{
39 long ret; 71 long ret;
40 struct module *owner = spufs_calls.owner;
41 struct file *neighbor; 72 struct file *neighbor;
42 int fput_needed; 73 int fput_needed;
74 struct spufs_calls *calls;
43 75
44 ret = -ENOSYS; 76 calls = spufs_calls_get();
45 if (owner && try_module_get(owner)) { 77 if (!calls)
46 if (flags & SPU_CREATE_AFFINITY_SPU) { 78 return -ENOSYS;
47 neighbor = fget_light(neighbor_fd, &fput_needed); 79
48 ret = -EBADF; 80 if (flags & SPU_CREATE_AFFINITY_SPU) {
49 if (neighbor) { 81 ret = -EBADF;
50 ret = spufs_calls.create_thread(name, flags, 82 neighbor = fget_light(neighbor_fd, &fput_needed);
51 mode, neighbor); 83 if (neighbor) {
52 fput_light(neighbor, fput_needed); 84 ret = calls->create_thread(name, flags, mode, neighbor);
53 } 85 fput_light(neighbor, fput_needed);
54 }
55 else {
56 ret = spufs_calls.create_thread(name, flags,
57 mode, NULL);
58 } 86 }
59 module_put(owner); 87 } else
60 } 88 ret = calls->create_thread(name, flags, mode, NULL);
89
90 spufs_calls_put(calls);
61 return ret; 91 return ret;
62} 92}
63 93
@@ -66,37 +96,69 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
66 long ret; 96 long ret;
67 struct file *filp; 97 struct file *filp;
68 int fput_needed; 98 int fput_needed;
69 struct module *owner = spufs_calls.owner; 99 struct spufs_calls *calls;
70 100
71 ret = -ENOSYS; 101 calls = spufs_calls_get();
72 if (owner && try_module_get(owner)) { 102 if (!calls)
73 ret = -EBADF; 103 return -ENOSYS;
74 filp = fget_light(fd, &fput_needed); 104
75 if (filp) { 105 ret = -EBADF;
76 ret = spufs_calls.spu_run(filp, unpc, ustatus); 106 filp = fget_light(fd, &fput_needed);
77 fput_light(filp, fput_needed); 107 if (filp) {
78 } 108 ret = calls->spu_run(filp, unpc, ustatus);
79 module_put(owner); 109 fput_light(filp, fput_needed);
80 } 110 }
111
112 spufs_calls_put(calls);
113 return ret;
114}
115
116int elf_coredump_extra_notes_size(void)
117{
118 struct spufs_calls *calls;
119 int ret;
120
121 calls = spufs_calls_get();
122 if (!calls)
123 return 0;
124
125 ret = calls->coredump_extra_notes_size();
126
127 spufs_calls_put(calls);
128
129 return ret;
130}
131
132int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset)
133{
134 struct spufs_calls *calls;
135 int ret;
136
137 calls = spufs_calls_get();
138 if (!calls)
139 return 0;
140
141 ret = calls->coredump_extra_notes_write(file, foffset);
142
143 spufs_calls_put(calls);
144
81 return ret; 145 return ret;
82} 146}
83 147
84int register_spu_syscalls(struct spufs_calls *calls) 148int register_spu_syscalls(struct spufs_calls *calls)
85{ 149{
86 if (spufs_calls.owner) 150 if (spufs_calls)
87 return -EBUSY; 151 return -EBUSY;
88 152
89 spufs_calls.create_thread = calls->create_thread; 153 rcu_assign_pointer(spufs_calls, calls);
90 spufs_calls.spu_run = calls->spu_run;
91 smp_mb();
92 spufs_calls.owner = calls->owner;
93 return 0; 154 return 0;
94} 155}
95EXPORT_SYMBOL_GPL(register_spu_syscalls); 156EXPORT_SYMBOL_GPL(register_spu_syscalls);
96 157
97void unregister_spu_syscalls(struct spufs_calls *calls) 158void unregister_spu_syscalls(struct spufs_calls *calls)
98{ 159{
99 BUG_ON(spufs_calls.owner != calls->owner); 160 BUG_ON(spufs_calls->owner != calls->owner);
100 spufs_calls.owner = NULL; 161 rcu_assign_pointer(spufs_calls, NULL);
162 synchronize_rcu();
101} 163}
102EXPORT_SYMBOL_GPL(unregister_spu_syscalls); 164EXPORT_SYMBOL_GPL(unregister_spu_syscalls);
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index 5e31799b1e3f..80f62363e1ce 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -31,16 +31,7 @@
31 31
32#include "spufs.h" 32#include "spufs.h"
33 33
34struct spufs_ctx_info { 34static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
35 struct list_head list;
36 int dfd;
37 int memsize; /* in bytes */
38 struct spu_context *ctx;
39};
40
41static LIST_HEAD(ctx_info_list);
42
43static ssize_t do_coredump_read(int num, struct spu_context *ctx, void __user *buffer,
44 size_t size, loff_t *off) 35 size_t size, loff_t *off)
45{ 36{
46 u64 data; 37 u64 data;
@@ -50,49 +41,57 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void __user *b
50 return spufs_coredump_read[num].read(ctx, buffer, size, off); 41 return spufs_coredump_read[num].read(ctx, buffer, size, off);
51 42
52 data = spufs_coredump_read[num].get(ctx); 43 data = spufs_coredump_read[num].get(ctx);
53 ret = copy_to_user(buffer, &data, 8); 44 ret = snprintf(buffer, size, "0x%.16lx", data);
54 return ret ? -EFAULT : 8; 45 if (ret >= size)
46 return size;
47 return ++ret; /* count trailing NULL */
55} 48}
56 49
57/* 50/*
58 * These are the only things you should do on a core-file: use only these 51 * These are the only things you should do on a core-file: use only these
59 * functions to write out all the necessary info. 52 * functions to write out all the necessary info.
60 */ 53 */
61static int spufs_dump_write(struct file *file, const void *addr, int nr) 54static int spufs_dump_write(struct file *file, const void *addr, int nr, loff_t *foffset)
62{ 55{
63 return file->f_op->write(file, addr, nr, &file->f_pos) == nr; 56 unsigned long limit = current->signal->rlim[RLIMIT_CORE].rlim_cur;
64} 57 ssize_t written;
65 58
66static int spufs_dump_seek(struct file *file, loff_t off) 59 if (*foffset + nr > limit)
67{ 60 return -EIO;
68 if (file->f_op->llseek) { 61
69 if (file->f_op->llseek(file, off, 0) != off) 62 written = file->f_op->write(file, addr, nr, &file->f_pos);
70 return 0; 63 *foffset += written;
71 } else 64
72 file->f_pos = off; 65 if (written != nr)
73 return 1; 66 return -EIO;
67
68 return 0;
74} 69}
75 70
76static void spufs_fill_memsize(struct spufs_ctx_info *ctx_info) 71static int spufs_dump_align(struct file *file, char *buf, loff_t new_off,
72 loff_t *foffset)
77{ 73{
78 struct spu_context *ctx; 74 int rc, size;
79 unsigned long long lslr; 75
76 size = min((loff_t)PAGE_SIZE, new_off - *foffset);
77 memset(buf, 0, size);
78
79 rc = 0;
80 while (rc == 0 && new_off > *foffset) {
81 size = min((loff_t)PAGE_SIZE, new_off - *foffset);
82 rc = spufs_dump_write(file, buf, size, foffset);
83 }
80 84
81 ctx = ctx_info->ctx; 85 return rc;
82 lslr = ctx->csa.priv2.spu_lslr_RW;
83 ctx_info->memsize = lslr + 1;
84} 86}
85 87
86static int spufs_ctx_note_size(struct spufs_ctx_info *ctx_info) 88static int spufs_ctx_note_size(struct spu_context *ctx, int dfd)
87{ 89{
88 int dfd, memsize, i, sz, total = 0; 90 int i, sz, total = 0;
89 char *name; 91 char *name;
90 char fullname[80]; 92 char fullname[80];
91 93
92 dfd = ctx_info->dfd; 94 for (i = 0; spufs_coredump_read[i].name != NULL; i++) {
93 memsize = ctx_info->memsize;
94
95 for (i = 0; spufs_coredump_read[i].name; i++) {
96 name = spufs_coredump_read[i].name; 95 name = spufs_coredump_read[i].name;
97 sz = spufs_coredump_read[i].size; 96 sz = spufs_coredump_read[i].size;
98 97
@@ -100,39 +99,12 @@ static int spufs_ctx_note_size(struct spufs_ctx_info *ctx_info)
100 99
101 total += sizeof(struct elf_note); 100 total += sizeof(struct elf_note);
102 total += roundup(strlen(fullname) + 1, 4); 101 total += roundup(strlen(fullname) + 1, 4);
103 if (!strcmp(name, "mem")) 102 total += roundup(sz, 4);
104 total += roundup(memsize, 4);
105 else
106 total += roundup(sz, 4);
107 } 103 }
108 104
109 return total; 105 return total;
110} 106}
111 107
112static int spufs_add_one_context(struct file *file, int dfd)
113{
114 struct spu_context *ctx;
115 struct spufs_ctx_info *ctx_info;
116 int size;
117
118 ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx;
119 if (ctx->flags & SPU_CREATE_NOSCHED)
120 return 0;
121
122 ctx_info = kzalloc(sizeof(*ctx_info), GFP_KERNEL);
123 if (unlikely(!ctx_info))
124 return -ENOMEM;
125
126 ctx_info->dfd = dfd;
127 ctx_info->ctx = ctx;
128
129 spufs_fill_memsize(ctx_info);
130
131 size = spufs_ctx_note_size(ctx_info);
132 list_add(&ctx_info->list, &ctx_info_list);
133 return size;
134}
135
136/* 108/*
137 * The additional architecture-specific notes for Cell are various 109 * The additional architecture-specific notes for Cell are various
138 * context files in the spu context. 110 * context files in the spu context.
@@ -142,33 +114,57 @@ static int spufs_add_one_context(struct file *file, int dfd)
142 * internal functionality to dump them without needing to actually 114 * internal functionality to dump them without needing to actually
143 * open the files. 115 * open the files.
144 */ 116 */
145static int spufs_arch_notes_size(void) 117static struct spu_context *coredump_next_context(int *fd)
146{ 118{
147 struct fdtable *fdt = files_fdtable(current->files); 119 struct fdtable *fdt = files_fdtable(current->files);
148 int size = 0, fd; 120 struct file *file;
121 struct spu_context *ctx = NULL;
149 122
150 for (fd = 0; fd < fdt->max_fds; fd++) { 123 for (; *fd < fdt->max_fds; (*fd)++) {
151 if (FD_ISSET(fd, fdt->open_fds)) { 124 if (!FD_ISSET(*fd, fdt->open_fds))
152 struct file *file = fcheck(fd); 125 continue;
153 126
154 if (file && file->f_op == &spufs_context_fops) { 127 file = fcheck(*fd);
155 int rval = spufs_add_one_context(file, fd); 128
156 if (rval < 0) 129 if (!file || file->f_op != &spufs_context_fops)
157 break; 130 continue;
158 size += rval; 131
159 } 132 ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx;
160 } 133 if (ctx->flags & SPU_CREATE_NOSCHED)
134 continue;
135
136 /* start searching the next fd next time we're called */
137 (*fd)++;
138 break;
161 } 139 }
162 140
163 return size; 141 return ctx;
164} 142}
165 143
166static void spufs_arch_write_note(struct spufs_ctx_info *ctx_info, int i, 144int spufs_coredump_extra_notes_size(void)
167 struct file *file)
168{ 145{
169 struct spu_context *ctx; 146 struct spu_context *ctx;
147 int size = 0, rc, fd;
148
149 fd = 0;
150 while ((ctx = coredump_next_context(&fd)) != NULL) {
151 spu_acquire_saved(ctx);
152 rc = spufs_ctx_note_size(ctx, fd);
153 spu_release_saved(ctx);
154 if (rc < 0)
155 break;
156
157 size += rc;
158 }
159
160 return size;
161}
162
163static int spufs_arch_write_note(struct spu_context *ctx, int i,
164 struct file *file, int dfd, loff_t *foffset)
165{
170 loff_t pos = 0; 166 loff_t pos = 0;
171 int sz, dfd, rc, total = 0; 167 int sz, rc, nread, total = 0;
172 const int bufsz = PAGE_SIZE; 168 const int bufsz = PAGE_SIZE;
173 char *name; 169 char *name;
174 char fullname[80], *buf; 170 char fullname[80], *buf;
@@ -176,64 +172,70 @@ static void spufs_arch_write_note(struct spufs_ctx_info *ctx_info, int i,
176 172
177 buf = (void *)get_zeroed_page(GFP_KERNEL); 173 buf = (void *)get_zeroed_page(GFP_KERNEL);
178 if (!buf) 174 if (!buf)
179 return; 175 return -ENOMEM;
180 176
181 dfd = ctx_info->dfd;
182 name = spufs_coredump_read[i].name; 177 name = spufs_coredump_read[i].name;
183 178 sz = spufs_coredump_read[i].size;
184 if (!strcmp(name, "mem"))
185 sz = ctx_info->memsize;
186 else
187 sz = spufs_coredump_read[i].size;
188
189 ctx = ctx_info->ctx;
190 if (!ctx)
191 goto out;
192 179
193 sprintf(fullname, "SPU/%d/%s", dfd, name); 180 sprintf(fullname, "SPU/%d/%s", dfd, name);
194 en.n_namesz = strlen(fullname) + 1; 181 en.n_namesz = strlen(fullname) + 1;
195 en.n_descsz = sz; 182 en.n_descsz = sz;
196 en.n_type = NT_SPU; 183 en.n_type = NT_SPU;
197 184
198 if (!spufs_dump_write(file, &en, sizeof(en))) 185 rc = spufs_dump_write(file, &en, sizeof(en), foffset);
186 if (rc)
199 goto out; 187 goto out;
200 if (!spufs_dump_write(file, fullname, en.n_namesz)) 188
189 rc = spufs_dump_write(file, fullname, en.n_namesz, foffset);
190 if (rc)
201 goto out; 191 goto out;
202 if (!spufs_dump_seek(file, roundup((unsigned long)file->f_pos, 4))) 192
193 rc = spufs_dump_align(file, buf, roundup(*foffset, 4), foffset);
194 if (rc)
203 goto out; 195 goto out;
204 196
205 do { 197 do {
206 rc = do_coredump_read(i, ctx, buf, bufsz, &pos); 198 nread = do_coredump_read(i, ctx, buf, bufsz, &pos);
207 if (rc > 0) { 199 if (nread > 0) {
208 if (!spufs_dump_write(file, buf, rc)) 200 rc = spufs_dump_write(file, buf, nread, foffset);
201 if (rc)
209 goto out; 202 goto out;
210 total += rc; 203 total += nread;
211 } 204 }
212 } while (rc == bufsz && total < sz); 205 } while (nread == bufsz && total < sz);
206
207 if (nread < 0) {
208 rc = nread;
209 goto out;
210 }
211
212 rc = spufs_dump_align(file, buf, roundup(*foffset - total + sz, 4),
213 foffset);
213 214
214 spufs_dump_seek(file, roundup((unsigned long)file->f_pos
215 - total + sz, 4));
216out: 215out:
217 free_page((unsigned long)buf); 216 free_page((unsigned long)buf);
217 return rc;
218} 218}
219 219
220static void spufs_arch_write_notes(struct file *file) 220int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset)
221{ 221{
222 int j; 222 struct spu_context *ctx;
223 struct spufs_ctx_info *ctx_info, *next; 223 int fd, j, rc;
224 224
225 list_for_each_entry_safe(ctx_info, next, &ctx_info_list, list) { 225 fd = 0;
226 spu_acquire_saved(ctx_info->ctx); 226 while ((ctx = coredump_next_context(&fd)) != NULL) {
227 for (j = 0; j < spufs_coredump_num_notes; j++) 227 spu_acquire_saved(ctx);
228 spufs_arch_write_note(ctx_info, j, file); 228
229 spu_release_saved(ctx_info->ctx); 229 for (j = 0; spufs_coredump_read[j].name != NULL; j++) {
230 list_del(&ctx_info->list); 230 rc = spufs_arch_write_note(ctx, j, file, fd, foffset);
231 kfree(ctx_info); 231 if (rc) {
232 spu_release_saved(ctx);
233 return rc;
234 }
235 }
236
237 spu_release_saved(ctx);
232 } 238 }
233}
234 239
235struct spu_coredump_calls spufs_coredump_calls = { 240 return 0;
236 .arch_notes_size = spufs_arch_notes_size, 241}
237 .arch_write_notes = spufs_arch_write_notes,
238 .owner = THIS_MODULE,
239};
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 7de4e919687b..d72b16d6816e 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -199,9 +199,9 @@ static int spufs_mem_mmap(struct file *file, struct vm_area_struct *vma)
199} 199}
200 200
201#ifdef CONFIG_SPU_FS_64K_LS 201#ifdef CONFIG_SPU_FS_64K_LS
202unsigned long spufs_get_unmapped_area(struct file *file, unsigned long addr, 202static unsigned long spufs_get_unmapped_area(struct file *file,
203 unsigned long len, unsigned long pgoff, 203 unsigned long addr, unsigned long len, unsigned long pgoff,
204 unsigned long flags) 204 unsigned long flags)
205{ 205{
206 struct spu_context *ctx = file->private_data; 206 struct spu_context *ctx = file->private_data;
207 struct spu_state *csa = &ctx->csa; 207 struct spu_state *csa = &ctx->csa;
@@ -1076,6 +1076,36 @@ static const struct file_operations spufs_signal2_nosched_fops = {
1076 .mmap = spufs_signal2_mmap, 1076 .mmap = spufs_signal2_mmap,
1077}; 1077};
1078 1078
1079/*
1080 * This is a wrapper around DEFINE_SIMPLE_ATTRIBUTE which does the
1081 * work of acquiring (or not) the SPU context before calling through
1082 * to the actual get routine. The set routine is called directly.
1083 */
1084#define SPU_ATTR_NOACQUIRE 0
1085#define SPU_ATTR_ACQUIRE 1
1086#define SPU_ATTR_ACQUIRE_SAVED 2
1087
1088#define DEFINE_SPUFS_ATTRIBUTE(__name, __get, __set, __fmt, __acquire) \
1089static u64 __##__get(void *data) \
1090{ \
1091 struct spu_context *ctx = data; \
1092 u64 ret; \
1093 \
1094 if (__acquire == SPU_ATTR_ACQUIRE) { \
1095 spu_acquire(ctx); \
1096 ret = __get(ctx); \
1097 spu_release(ctx); \
1098 } else if (__acquire == SPU_ATTR_ACQUIRE_SAVED) { \
1099 spu_acquire_saved(ctx); \
1100 ret = __get(ctx); \
1101 spu_release_saved(ctx); \
1102 } else \
1103 ret = __get(ctx); \
1104 \
1105 return ret; \
1106} \
1107DEFINE_SIMPLE_ATTRIBUTE(__name, __##__get, __set, __fmt);
1108
1079static void spufs_signal1_type_set(void *data, u64 val) 1109static void spufs_signal1_type_set(void *data, u64 val)
1080{ 1110{
1081 struct spu_context *ctx = data; 1111 struct spu_context *ctx = data;
@@ -1085,25 +1115,13 @@ static void spufs_signal1_type_set(void *data, u64 val)
1085 spu_release(ctx); 1115 spu_release(ctx);
1086} 1116}
1087 1117
1088static u64 __spufs_signal1_type_get(void *data) 1118static u64 spufs_signal1_type_get(struct spu_context *ctx)
1089{ 1119{
1090 struct spu_context *ctx = data;
1091 return ctx->ops->signal1_type_get(ctx); 1120 return ctx->ops->signal1_type_get(ctx);
1092} 1121}
1122DEFINE_SPUFS_ATTRIBUTE(spufs_signal1_type, spufs_signal1_type_get,
1123 spufs_signal1_type_set, "%llu", SPU_ATTR_ACQUIRE);
1093 1124
1094static u64 spufs_signal1_type_get(void *data)
1095{
1096 struct spu_context *ctx = data;
1097 u64 ret;
1098
1099 spu_acquire(ctx);
1100 ret = __spufs_signal1_type_get(data);
1101 spu_release(ctx);
1102
1103 return ret;
1104}
1105DEFINE_SIMPLE_ATTRIBUTE(spufs_signal1_type, spufs_signal1_type_get,
1106 spufs_signal1_type_set, "%llu");
1107 1125
1108static void spufs_signal2_type_set(void *data, u64 val) 1126static void spufs_signal2_type_set(void *data, u64 val)
1109{ 1127{
@@ -1114,25 +1132,12 @@ static void spufs_signal2_type_set(void *data, u64 val)
1114 spu_release(ctx); 1132 spu_release(ctx);
1115} 1133}
1116 1134
1117static u64 __spufs_signal2_type_get(void *data) 1135static u64 spufs_signal2_type_get(struct spu_context *ctx)
1118{ 1136{
1119 struct spu_context *ctx = data;
1120 return ctx->ops->signal2_type_get(ctx); 1137 return ctx->ops->signal2_type_get(ctx);
1121} 1138}
1122 1139DEFINE_SPUFS_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
1123static u64 spufs_signal2_type_get(void *data) 1140 spufs_signal2_type_set, "%llu", SPU_ATTR_ACQUIRE);
1124{
1125 struct spu_context *ctx = data;
1126 u64 ret;
1127
1128 spu_acquire(ctx);
1129 ret = __spufs_signal2_type_get(data);
1130 spu_release(ctx);
1131
1132 return ret;
1133}
1134DEFINE_SIMPLE_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
1135 spufs_signal2_type_set, "%llu");
1136 1141
1137#if SPUFS_MMAP_4K 1142#if SPUFS_MMAP_4K
1138static unsigned long spufs_mss_mmap_nopfn(struct vm_area_struct *vma, 1143static unsigned long spufs_mss_mmap_nopfn(struct vm_area_struct *vma,
@@ -1608,17 +1613,12 @@ static void spufs_npc_set(void *data, u64 val)
1608 spu_release(ctx); 1613 spu_release(ctx);
1609} 1614}
1610 1615
1611static u64 spufs_npc_get(void *data) 1616static u64 spufs_npc_get(struct spu_context *ctx)
1612{ 1617{
1613 struct spu_context *ctx = data; 1618 return ctx->ops->npc_read(ctx);
1614 u64 ret;
1615 spu_acquire(ctx);
1616 ret = ctx->ops->npc_read(ctx);
1617 spu_release(ctx);
1618 return ret;
1619} 1619}
1620DEFINE_SIMPLE_ATTRIBUTE(spufs_npc_ops, spufs_npc_get, spufs_npc_set, 1620DEFINE_SPUFS_ATTRIBUTE(spufs_npc_ops, spufs_npc_get, spufs_npc_set,
1621 "0x%llx\n") 1621 "0x%llx\n", SPU_ATTR_ACQUIRE);
1622 1622
1623static void spufs_decr_set(void *data, u64 val) 1623static void spufs_decr_set(void *data, u64 val)
1624{ 1624{
@@ -1629,24 +1629,13 @@ static void spufs_decr_set(void *data, u64 val)
1629 spu_release_saved(ctx); 1629 spu_release_saved(ctx);
1630} 1630}
1631 1631
1632static u64 __spufs_decr_get(void *data) 1632static u64 spufs_decr_get(struct spu_context *ctx)
1633{ 1633{
1634 struct spu_context *ctx = data;
1635 struct spu_lscsa *lscsa = ctx->csa.lscsa; 1634 struct spu_lscsa *lscsa = ctx->csa.lscsa;
1636 return lscsa->decr.slot[0]; 1635 return lscsa->decr.slot[0];
1637} 1636}
1638 1637DEFINE_SPUFS_ATTRIBUTE(spufs_decr_ops, spufs_decr_get, spufs_decr_set,
1639static u64 spufs_decr_get(void *data) 1638 "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED);
1640{
1641 struct spu_context *ctx = data;
1642 u64 ret;
1643 spu_acquire_saved(ctx);
1644 ret = __spufs_decr_get(data);
1645 spu_release_saved(ctx);
1646 return ret;
1647}
1648DEFINE_SIMPLE_ATTRIBUTE(spufs_decr_ops, spufs_decr_get, spufs_decr_set,
1649 "0x%llx\n")
1650 1639
1651static void spufs_decr_status_set(void *data, u64 val) 1640static void spufs_decr_status_set(void *data, u64 val)
1652{ 1641{
@@ -1659,26 +1648,16 @@ static void spufs_decr_status_set(void *data, u64 val)
1659 spu_release_saved(ctx); 1648 spu_release_saved(ctx);
1660} 1649}
1661 1650
1662static u64 __spufs_decr_status_get(void *data) 1651static u64 spufs_decr_status_get(struct spu_context *ctx)
1663{ 1652{
1664 struct spu_context *ctx = data;
1665 if (ctx->csa.priv2.mfc_control_RW & MFC_CNTL_DECREMENTER_RUNNING) 1653 if (ctx->csa.priv2.mfc_control_RW & MFC_CNTL_DECREMENTER_RUNNING)
1666 return SPU_DECR_STATUS_RUNNING; 1654 return SPU_DECR_STATUS_RUNNING;
1667 else 1655 else
1668 return 0; 1656 return 0;
1669} 1657}
1670 1658DEFINE_SPUFS_ATTRIBUTE(spufs_decr_status_ops, spufs_decr_status_get,
1671static u64 spufs_decr_status_get(void *data) 1659 spufs_decr_status_set, "0x%llx\n",
1672{ 1660 SPU_ATTR_ACQUIRE_SAVED);
1673 struct spu_context *ctx = data;
1674 u64 ret;
1675 spu_acquire_saved(ctx);
1676 ret = __spufs_decr_status_get(data);
1677 spu_release_saved(ctx);
1678 return ret;
1679}
1680DEFINE_SIMPLE_ATTRIBUTE(spufs_decr_status_ops, spufs_decr_status_get,
1681 spufs_decr_status_set, "0x%llx\n")
1682 1661
1683static void spufs_event_mask_set(void *data, u64 val) 1662static void spufs_event_mask_set(void *data, u64 val)
1684{ 1663{
@@ -1689,28 +1668,18 @@ static void spufs_event_mask_set(void *data, u64 val)
1689 spu_release_saved(ctx); 1668 spu_release_saved(ctx);
1690} 1669}
1691 1670
1692static u64 __spufs_event_mask_get(void *data) 1671static u64 spufs_event_mask_get(struct spu_context *ctx)
1693{ 1672{
1694 struct spu_context *ctx = data;
1695 struct spu_lscsa *lscsa = ctx->csa.lscsa; 1673 struct spu_lscsa *lscsa = ctx->csa.lscsa;
1696 return lscsa->event_mask.slot[0]; 1674 return lscsa->event_mask.slot[0];
1697} 1675}
1698 1676
1699static u64 spufs_event_mask_get(void *data) 1677DEFINE_SPUFS_ATTRIBUTE(spufs_event_mask_ops, spufs_event_mask_get,
1700{ 1678 spufs_event_mask_set, "0x%llx\n",
1701 struct spu_context *ctx = data; 1679 SPU_ATTR_ACQUIRE_SAVED);
1702 u64 ret;
1703 spu_acquire_saved(ctx);
1704 ret = __spufs_event_mask_get(data);
1705 spu_release_saved(ctx);
1706 return ret;
1707}
1708DEFINE_SIMPLE_ATTRIBUTE(spufs_event_mask_ops, spufs_event_mask_get,
1709 spufs_event_mask_set, "0x%llx\n")
1710 1680
1711static u64 __spufs_event_status_get(void *data) 1681static u64 spufs_event_status_get(struct spu_context *ctx)
1712{ 1682{
1713 struct spu_context *ctx = data;
1714 struct spu_state *state = &ctx->csa; 1683 struct spu_state *state = &ctx->csa;
1715 u64 stat; 1684 u64 stat;
1716 stat = state->spu_chnlcnt_RW[0]; 1685 stat = state->spu_chnlcnt_RW[0];
@@ -1718,19 +1687,8 @@ static u64 __spufs_event_status_get(void *data)
1718 return state->spu_chnldata_RW[0]; 1687 return state->spu_chnldata_RW[0];
1719 return 0; 1688 return 0;
1720} 1689}
1721 1690DEFINE_SPUFS_ATTRIBUTE(spufs_event_status_ops, spufs_event_status_get,
1722static u64 spufs_event_status_get(void *data) 1691 NULL, "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED)
1723{
1724 struct spu_context *ctx = data;
1725 u64 ret = 0;
1726
1727 spu_acquire_saved(ctx);
1728 ret = __spufs_event_status_get(data);
1729 spu_release_saved(ctx);
1730 return ret;
1731}
1732DEFINE_SIMPLE_ATTRIBUTE(spufs_event_status_ops, spufs_event_status_get,
1733 NULL, "0x%llx\n")
1734 1692
1735static void spufs_srr0_set(void *data, u64 val) 1693static void spufs_srr0_set(void *data, u64 val)
1736{ 1694{
@@ -1741,45 +1699,32 @@ static void spufs_srr0_set(void *data, u64 val)
1741 spu_release_saved(ctx); 1699 spu_release_saved(ctx);
1742} 1700}
1743 1701
1744static u64 spufs_srr0_get(void *data) 1702static u64 spufs_srr0_get(struct spu_context *ctx)
1745{ 1703{
1746 struct spu_context *ctx = data;
1747 struct spu_lscsa *lscsa = ctx->csa.lscsa; 1704 struct spu_lscsa *lscsa = ctx->csa.lscsa;
1748 u64 ret; 1705 return lscsa->srr0.slot[0];
1749 spu_acquire_saved(ctx);
1750 ret = lscsa->srr0.slot[0];
1751 spu_release_saved(ctx);
1752 return ret;
1753} 1706}
1754DEFINE_SIMPLE_ATTRIBUTE(spufs_srr0_ops, spufs_srr0_get, spufs_srr0_set, 1707DEFINE_SPUFS_ATTRIBUTE(spufs_srr0_ops, spufs_srr0_get, spufs_srr0_set,
1755 "0x%llx\n") 1708 "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED)
1756 1709
1757static u64 spufs_id_get(void *data) 1710static u64 spufs_id_get(struct spu_context *ctx)
1758{ 1711{
1759 struct spu_context *ctx = data;
1760 u64 num; 1712 u64 num;
1761 1713
1762 spu_acquire(ctx);
1763 if (ctx->state == SPU_STATE_RUNNABLE) 1714 if (ctx->state == SPU_STATE_RUNNABLE)
1764 num = ctx->spu->number; 1715 num = ctx->spu->number;
1765 else 1716 else
1766 num = (unsigned int)-1; 1717 num = (unsigned int)-1;
1767 spu_release(ctx);
1768 1718
1769 return num; 1719 return num;
1770} 1720}
1771DEFINE_SIMPLE_ATTRIBUTE(spufs_id_ops, spufs_id_get, NULL, "0x%llx\n") 1721DEFINE_SPUFS_ATTRIBUTE(spufs_id_ops, spufs_id_get, NULL, "0x%llx\n",
1772 1722 SPU_ATTR_ACQUIRE)
1773static u64 __spufs_object_id_get(void *data)
1774{
1775 struct spu_context *ctx = data;
1776 return ctx->object_id;
1777}
1778 1723
1779static u64 spufs_object_id_get(void *data) 1724static u64 spufs_object_id_get(struct spu_context *ctx)
1780{ 1725{
1781 /* FIXME: Should there really be no locking here? */ 1726 /* FIXME: Should there really be no locking here? */
1782 return __spufs_object_id_get(data); 1727 return ctx->object_id;
1783} 1728}
1784 1729
1785static void spufs_object_id_set(void *data, u64 id) 1730static void spufs_object_id_set(void *data, u64 id)
@@ -1788,27 +1733,15 @@ static void spufs_object_id_set(void *data, u64 id)
1788 ctx->object_id = id; 1733 ctx->object_id = id;
1789} 1734}
1790 1735
1791DEFINE_SIMPLE_ATTRIBUTE(spufs_object_id_ops, spufs_object_id_get, 1736DEFINE_SPUFS_ATTRIBUTE(spufs_object_id_ops, spufs_object_id_get,
1792 spufs_object_id_set, "0x%llx\n"); 1737 spufs_object_id_set, "0x%llx\n", SPU_ATTR_NOACQUIRE);
1793 1738
1794static u64 __spufs_lslr_get(void *data) 1739static u64 spufs_lslr_get(struct spu_context *ctx)
1795{ 1740{
1796 struct spu_context *ctx = data;
1797 return ctx->csa.priv2.spu_lslr_RW; 1741 return ctx->csa.priv2.spu_lslr_RW;
1798} 1742}
1799 1743DEFINE_SPUFS_ATTRIBUTE(spufs_lslr_ops, spufs_lslr_get, NULL, "0x%llx\n",
1800static u64 spufs_lslr_get(void *data) 1744 SPU_ATTR_ACQUIRE_SAVED);
1801{
1802 struct spu_context *ctx = data;
1803 u64 ret;
1804
1805 spu_acquire_saved(ctx);
1806 ret = __spufs_lslr_get(data);
1807 spu_release_saved(ctx);
1808
1809 return ret;
1810}
1811DEFINE_SIMPLE_ATTRIBUTE(spufs_lslr_ops, spufs_lslr_get, NULL, "0x%llx\n")
1812 1745
1813static int spufs_info_open(struct inode *inode, struct file *file) 1746static int spufs_info_open(struct inode *inode, struct file *file)
1814{ 1747{
@@ -2231,25 +2164,25 @@ struct tree_descr spufs_dir_nosched_contents[] = {
2231}; 2164};
2232 2165
2233struct spufs_coredump_reader spufs_coredump_read[] = { 2166struct spufs_coredump_reader spufs_coredump_read[] = {
2234 { "regs", __spufs_regs_read, NULL, 128 * 16 }, 2167 { "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])},
2235 { "fpcr", __spufs_fpcr_read, NULL, 16 }, 2168 { "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) },
2236 { "lslr", NULL, __spufs_lslr_get, 11 }, 2169 { "lslr", NULL, spufs_lslr_get, 19 },
2237 { "decr", NULL, __spufs_decr_get, 11 }, 2170 { "decr", NULL, spufs_decr_get, 19 },
2238 { "decr_status", NULL, __spufs_decr_status_get, 11 }, 2171 { "decr_status", NULL, spufs_decr_status_get, 19 },
2239 { "mem", __spufs_mem_read, NULL, 256 * 1024, }, 2172 { "mem", __spufs_mem_read, NULL, LS_SIZE, },
2240 { "signal1", __spufs_signal1_read, NULL, 4 }, 2173 { "signal1", __spufs_signal1_read, NULL, sizeof(u32) },
2241 { "signal1_type", NULL, __spufs_signal1_type_get, 2 }, 2174 { "signal1_type", NULL, spufs_signal1_type_get, 19 },
2242 { "signal2", __spufs_signal2_read, NULL, 4 }, 2175 { "signal2", __spufs_signal2_read, NULL, sizeof(u32) },
2243 { "signal2_type", NULL, __spufs_signal2_type_get, 2 }, 2176 { "signal2_type", NULL, spufs_signal2_type_get, 19 },
2244 { "event_mask", NULL, __spufs_event_mask_get, 8 }, 2177 { "event_mask", NULL, spufs_event_mask_get, 19 },
2245 { "event_status", NULL, __spufs_event_status_get, 8 }, 2178 { "event_status", NULL, spufs_event_status_get, 19 },
2246 { "mbox_info", __spufs_mbox_info_read, NULL, 4 }, 2179 { "mbox_info", __spufs_mbox_info_read, NULL, sizeof(u32) },
2247 { "ibox_info", __spufs_ibox_info_read, NULL, 4 }, 2180 { "ibox_info", __spufs_ibox_info_read, NULL, sizeof(u32) },
2248 { "wbox_info", __spufs_wbox_info_read, NULL, 16 }, 2181 { "wbox_info", __spufs_wbox_info_read, NULL, 4 * sizeof(u32)},
2249 { "dma_info", __spufs_dma_info_read, NULL, 69 * 8 }, 2182 { "dma_info", __spufs_dma_info_read, NULL, sizeof(struct spu_dma_info)},
2250 { "proxydma_info", __spufs_proxydma_info_read, NULL, 35 * 8 }, 2183 { "proxydma_info", __spufs_proxydma_info_read,
2251 { "object-id", NULL, __spufs_object_id_get, 19 }, 2184 NULL, sizeof(struct spu_proxydma_info)},
2252 { }, 2185 { "object-id", NULL, spufs_object_id_get, 19 },
2186 { "npc", NULL, spufs_npc_get, 19 },
2187 { NULL },
2253}; 2188};
2254int spufs_coredump_num_notes = ARRAY_SIZE(spufs_coredump_read) - 1;
2255
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index b3d0dd118dd0..11098747d09b 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -43,6 +43,7 @@
43 43
44static struct kmem_cache *spufs_inode_cache; 44static struct kmem_cache *spufs_inode_cache;
45char *isolated_loader; 45char *isolated_loader;
46static int isolated_loader_size;
46 47
47static struct inode * 48static struct inode *
48spufs_alloc_inode(struct super_block *sb) 49spufs_alloc_inode(struct super_block *sb)
@@ -667,7 +668,8 @@ spufs_parse_options(char *options, struct inode *root)
667 668
668static void spufs_exit_isolated_loader(void) 669static void spufs_exit_isolated_loader(void)
669{ 670{
670 kfree(isolated_loader); 671 free_pages((unsigned long) isolated_loader,
672 get_order(isolated_loader_size));
671} 673}
672 674
673static void 675static void
@@ -685,11 +687,12 @@ spufs_init_isolated_loader(void)
685 if (!loader) 687 if (!loader)
686 return; 688 return;
687 689
688 /* kmalloc should align on a 16 byte boundary..* */ 690 /* the loader must be align on a 16 byte boundary */
689 isolated_loader = kmalloc(size, GFP_KERNEL); 691 isolated_loader = (char *)__get_free_pages(GFP_KERNEL, get_order(size));
690 if (!isolated_loader) 692 if (!isolated_loader)
691 return; 693 return;
692 694
695 isolated_loader_size = size;
693 memcpy(isolated_loader, loader, size); 696 memcpy(isolated_loader, loader, size);
694 printk(KERN_INFO "spufs: SPU isolation mode enabled\n"); 697 printk(KERN_INFO "spufs: SPU isolation mode enabled\n");
695} 698}
@@ -787,16 +790,11 @@ static int __init spufs_init(void)
787 ret = register_spu_syscalls(&spufs_calls); 790 ret = register_spu_syscalls(&spufs_calls);
788 if (ret) 791 if (ret)
789 goto out_fs; 792 goto out_fs;
790 ret = register_arch_coredump_calls(&spufs_coredump_calls);
791 if (ret)
792 goto out_syscalls;
793 793
794 spufs_init_isolated_loader(); 794 spufs_init_isolated_loader();
795 795
796 return 0; 796 return 0;
797 797
798out_syscalls:
799 unregister_spu_syscalls(&spufs_calls);
800out_fs: 798out_fs:
801 unregister_filesystem(&spufs_type); 799 unregister_filesystem(&spufs_type);
802out_sched: 800out_sched:
@@ -812,7 +810,6 @@ static void __exit spufs_exit(void)
812{ 810{
813 spu_sched_exit(); 811 spu_sched_exit();
814 spufs_exit_isolated_loader(); 812 spufs_exit_isolated_loader();
815 unregister_arch_coredump_calls(&spufs_coredump_calls);
816 unregister_spu_syscalls(&spufs_calls); 813 unregister_spu_syscalls(&spufs_calls);
817 unregister_filesystem(&spufs_type); 814 unregister_filesystem(&spufs_type);
818 kmem_cache_destroy(spufs_inode_cache); 815 kmem_cache_destroy(spufs_inode_cache);
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index 958f10e90fdd..1ce5e22ea5f4 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -205,7 +205,7 @@ static int spu_reacquire_runnable(struct spu_context *ctx, u32 *npc,
205 * This means we can only do a very rough approximation of POSIX 205 * This means we can only do a very rough approximation of POSIX
206 * signal semantics. 206 * signal semantics.
207 */ 207 */
208int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret, 208static int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret,
209 unsigned int *npc) 209 unsigned int *npc)
210{ 210{
211 int ret; 211 int ret;
@@ -241,7 +241,7 @@ int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret,
241 return ret; 241 return ret;
242} 242}
243 243
244int spu_process_callback(struct spu_context *ctx) 244static int spu_process_callback(struct spu_context *ctx)
245{ 245{
246 struct spu_syscall_block s; 246 struct spu_syscall_block s;
247 u32 ls_pointer, npc; 247 u32 ls_pointer, npc;
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 5bebe7fbe056..4d257b3f9336 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -230,8 +230,6 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx)
230 230
231 if (ctx->flags & SPU_CREATE_NOSCHED) 231 if (ctx->flags & SPU_CREATE_NOSCHED)
232 atomic_inc(&cbe_spu_info[spu->node].reserved_spus); 232 atomic_inc(&cbe_spu_info[spu->node].reserved_spus);
233 if (!list_empty(&ctx->aff_list))
234 atomic_inc(&ctx->gang->aff_sched_count);
235 233
236 ctx->stats.slb_flt_base = spu->stats.slb_flt; 234 ctx->stats.slb_flt_base = spu->stats.slb_flt;
237 ctx->stats.class2_intr_base = spu->stats.class2_intr; 235 ctx->stats.class2_intr_base = spu->stats.class2_intr;
@@ -392,7 +390,6 @@ static int has_affinity(struct spu_context *ctx)
392 if (list_empty(&ctx->aff_list)) 390 if (list_empty(&ctx->aff_list))
393 return 0; 391 return 0;
394 392
395 mutex_lock(&gang->aff_mutex);
396 if (!gang->aff_ref_spu) { 393 if (!gang->aff_ref_spu) {
397 if (!(gang->aff_flags & AFF_MERGED)) 394 if (!(gang->aff_flags & AFF_MERGED))
398 aff_merge_remaining_ctxs(gang); 395 aff_merge_remaining_ctxs(gang);
@@ -400,7 +397,6 @@ static int has_affinity(struct spu_context *ctx)
400 aff_set_offsets(gang); 397 aff_set_offsets(gang);
401 aff_set_ref_point_location(gang); 398 aff_set_ref_point_location(gang);
402 } 399 }
403 mutex_unlock(&gang->aff_mutex);
404 400
405 return gang->aff_ref_spu != NULL; 401 return gang->aff_ref_spu != NULL;
406} 402}
@@ -418,9 +414,16 @@ static void spu_unbind_context(struct spu *spu, struct spu_context *ctx)
418 414
419 if (spu->ctx->flags & SPU_CREATE_NOSCHED) 415 if (spu->ctx->flags & SPU_CREATE_NOSCHED)
420 atomic_dec(&cbe_spu_info[spu->node].reserved_spus); 416 atomic_dec(&cbe_spu_info[spu->node].reserved_spus);
421 if (!list_empty(&ctx->aff_list)) 417
422 if (atomic_dec_and_test(&ctx->gang->aff_sched_count)) 418 if (ctx->gang){
423 ctx->gang->aff_ref_spu = NULL; 419 mutex_lock(&ctx->gang->aff_mutex);
420 if (has_affinity(ctx)) {
421 if (atomic_dec_and_test(&ctx->gang->aff_sched_count))
422 ctx->gang->aff_ref_spu = NULL;
423 }
424 mutex_unlock(&ctx->gang->aff_mutex);
425 }
426
424 spu_switch_notify(spu, NULL); 427 spu_switch_notify(spu, NULL);
425 spu_unmap_mappings(ctx); 428 spu_unmap_mappings(ctx);
426 spu_save(&ctx->csa, spu); 429 spu_save(&ctx->csa, spu);
@@ -511,20 +514,32 @@ static void spu_prio_wait(struct spu_context *ctx)
511 514
512static struct spu *spu_get_idle(struct spu_context *ctx) 515static struct spu *spu_get_idle(struct spu_context *ctx)
513{ 516{
514 struct spu *spu; 517 struct spu *spu, *aff_ref_spu;
515 int node, n; 518 int node, n;
516 519
517 if (has_affinity(ctx)) { 520 if (ctx->gang) {
518 node = ctx->gang->aff_ref_spu->node; 521 mutex_lock(&ctx->gang->aff_mutex);
522 if (has_affinity(ctx)) {
523 aff_ref_spu = ctx->gang->aff_ref_spu;
524 atomic_inc(&ctx->gang->aff_sched_count);
525 mutex_unlock(&ctx->gang->aff_mutex);
526 node = aff_ref_spu->node;
519 527
520 mutex_lock(&cbe_spu_info[node].list_mutex); 528 mutex_lock(&cbe_spu_info[node].list_mutex);
521 spu = ctx_location(ctx->gang->aff_ref_spu, ctx->aff_offset, node); 529 spu = ctx_location(aff_ref_spu, ctx->aff_offset, node);
522 if (spu && spu->alloc_state == SPU_FREE) 530 if (spu && spu->alloc_state == SPU_FREE)
523 goto found; 531 goto found;
524 mutex_unlock(&cbe_spu_info[node].list_mutex); 532 mutex_unlock(&cbe_spu_info[node].list_mutex);
525 return NULL;
526 }
527 533
534 mutex_lock(&ctx->gang->aff_mutex);
535 if (atomic_dec_and_test(&ctx->gang->aff_sched_count))
536 ctx->gang->aff_ref_spu = NULL;
537 mutex_unlock(&ctx->gang->aff_mutex);
538
539 return NULL;
540 }
541 mutex_unlock(&ctx->gang->aff_mutex);
542 }
528 node = cpu_to_node(raw_smp_processor_id()); 543 node = cpu_to_node(raw_smp_processor_id());
529 for (n = 0; n < MAX_NUMNODES; n++, node++) { 544 for (n = 0; n < MAX_NUMNODES; n++, node++) {
530 node = (node < MAX_NUMNODES) ? node : 0; 545 node = (node < MAX_NUMNODES) ? node : 0;
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 2bfdeb8ea8bd..ca47b991bda5 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -200,9 +200,14 @@ extern struct tree_descr spufs_dir_contents[];
200extern struct tree_descr spufs_dir_nosched_contents[]; 200extern struct tree_descr spufs_dir_nosched_contents[];
201 201
202/* system call implementation */ 202/* system call implementation */
203extern struct spufs_calls spufs_calls;
203long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status); 204long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status);
204long spufs_create(struct nameidata *nd, unsigned int flags, 205long spufs_create(struct nameidata *nd, unsigned int flags,
205 mode_t mode, struct file *filp); 206 mode_t mode, struct file *filp);
207/* ELF coredump callbacks for writing SPU ELF notes */
208extern int spufs_coredump_extra_notes_size(void);
209extern int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset);
210
206extern const struct file_operations spufs_context_fops; 211extern const struct file_operations spufs_context_fops;
207 212
208/* gang management */ 213/* gang management */
@@ -295,7 +300,7 @@ struct spufs_coredump_reader {
295 char *name; 300 char *name;
296 ssize_t (*read)(struct spu_context *ctx, 301 ssize_t (*read)(struct spu_context *ctx,
297 char __user *buffer, size_t size, loff_t *pos); 302 char __user *buffer, size_t size, loff_t *pos);
298 u64 (*get)(void *data); 303 u64 (*get)(struct spu_context *ctx);
299 size_t size; 304 size_t size;
300}; 305};
301extern struct spufs_coredump_reader spufs_coredump_read[]; 306extern struct spufs_coredump_reader spufs_coredump_read[];
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index 27ffdae98e5a..de7e5ee451d2 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -1559,15 +1559,15 @@ static inline void restore_decr_wrapped(struct spu_state *csa, struct spu *spu)
1559 * "wrapped" flag is set, OR in a '1' to 1559 * "wrapped" flag is set, OR in a '1' to
1560 * CSA.SPU_Event_Status[Tm]. 1560 * CSA.SPU_Event_Status[Tm].
1561 */ 1561 */
1562 if (csa->lscsa->decr_status.slot[0] & SPU_DECR_STATUS_WRAPPED) { 1562 if (!(csa->lscsa->decr_status.slot[0] & SPU_DECR_STATUS_WRAPPED))
1563 csa->spu_chnldata_RW[0] |= 0x20; 1563 return;
1564 } 1564
1565 if ((csa->lscsa->decr_status.slot[0] & SPU_DECR_STATUS_WRAPPED) && 1565 if ((csa->spu_chnlcnt_RW[0] == 0) &&
1566 (csa->spu_chnlcnt_RW[0] == 0 && 1566 (csa->spu_chnldata_RW[1] & 0x20) &&
1567 ((csa->spu_chnldata_RW[2] & 0x20) == 0x0) && 1567 !(csa->spu_chnldata_RW[0] & 0x20))
1568 ((csa->spu_chnldata_RW[0] & 0x20) != 0x1))) {
1569 csa->spu_chnlcnt_RW[0] = 1; 1568 csa->spu_chnlcnt_RW[0] = 1;
1570 } 1569
1570 csa->spu_chnldata_RW[0] |= 0x20;
1571} 1571}
1572 1572
1573static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu) 1573static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu)
@@ -2146,19 +2146,6 @@ int spu_restore(struct spu_state *new, struct spu *spu)
2146} 2146}
2147EXPORT_SYMBOL_GPL(spu_restore); 2147EXPORT_SYMBOL_GPL(spu_restore);
2148 2148
2149/**
2150 * spu_harvest - SPU harvest (reset) operation
2151 * @spu: pointer to SPU iomem structure.
2152 *
2153 * Perform SPU harvest (reset) operation.
2154 */
2155void spu_harvest(struct spu *spu)
2156{
2157 acquire_spu_lock(spu);
2158 harvest(NULL, spu);
2159 release_spu_lock(spu);
2160}
2161
2162static void init_prob(struct spu_state *csa) 2149static void init_prob(struct spu_state *csa)
2163{ 2150{
2164 csa->spu_chnlcnt_RW[9] = 1; 2151 csa->spu_chnlcnt_RW[9] = 1;
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c
index 43f0fb88abbc..2c34f7170190 100644
--- a/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ b/arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -58,26 +58,8 @@ out:
58 return ret; 58 return ret;
59} 59}
60 60
61#ifndef MODULE 61static long do_spu_create(const char __user *pathname, unsigned int flags,
62asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus) 62 mode_t mode, struct file *neighbor)
63{
64 int fput_needed;
65 struct file *filp;
66 long ret;
67
68 ret = -EBADF;
69 filp = fget_light(fd, &fput_needed);
70 if (filp) {
71 ret = do_spu_run(filp, unpc, ustatus);
72 fput_light(filp, fput_needed);
73 }
74
75 return ret;
76}
77#endif
78
79asmlinkage long do_spu_create(const char __user *pathname, unsigned int flags,
80 mode_t mode, struct file *neighbor)
81{ 63{
82 char *tmp; 64 char *tmp;
83 int ret; 65 int ret;
@@ -99,32 +81,10 @@ asmlinkage long do_spu_create(const char __user *pathname, unsigned int flags,
99 return ret; 81 return ret;
100} 82}
101 83
102#ifndef MODULE
103asmlinkage long sys_spu_create(const char __user *pathname, unsigned int flags,
104 mode_t mode, int neighbor_fd)
105{
106 int fput_needed;
107 struct file *neighbor;
108 long ret;
109
110 if (flags & SPU_CREATE_AFFINITY_SPU) {
111 ret = -EBADF;
112 neighbor = fget_light(neighbor_fd, &fput_needed);
113 if (neighbor) {
114 ret = do_spu_create(pathname, flags, mode, neighbor);
115 fput_light(neighbor, fput_needed);
116 }
117 }
118 else {
119 ret = do_spu_create(pathname, flags, mode, NULL);
120 }
121
122 return ret;
123}
124#endif
125
126struct spufs_calls spufs_calls = { 84struct spufs_calls spufs_calls = {
127 .create_thread = do_spu_create, 85 .create_thread = do_spu_create,
128 .spu_run = do_spu_run, 86 .spu_run = do_spu_run,
87 .coredump_extra_notes_size = spufs_coredump_extra_notes_size,
88 .coredump_extra_notes_write = spufs_coredump_extra_notes_write,
129 .owner = THIS_MODULE, 89 .owner = THIS_MODULE,
130}; 90};
diff --git a/arch/powerpc/platforms/celleb/Kconfig b/arch/powerpc/platforms/celleb/Kconfig
index 2db1e293433e..04748d410fc9 100644
--- a/arch/powerpc/platforms/celleb/Kconfig
+++ b/arch/powerpc/platforms/celleb/Kconfig
@@ -2,6 +2,7 @@ config PPC_CELLEB
2 bool "Toshiba's Cell Reference Set 'Celleb' Architecture" 2 bool "Toshiba's Cell Reference Set 'Celleb' Architecture"
3 depends on PPC_MULTIPLATFORM && PPC64 3 depends on PPC_MULTIPLATFORM && PPC64
4 select PPC_CELL 4 select PPC_CELL
5 select PPC_INDIRECT_IO
5 select PPC_OF_PLATFORM_PCI 6 select PPC_OF_PLATFORM_PCI
6 select HAS_TXX9_SERIAL 7 select HAS_TXX9_SERIAL
7 select PPC_UDBG_BEAT 8 select PPC_UDBG_BEAT
diff --git a/arch/powerpc/platforms/celleb/Makefile b/arch/powerpc/platforms/celleb/Makefile
index 5240046d8671..889d43f715ea 100644
--- a/arch/powerpc/platforms/celleb/Makefile
+++ b/arch/powerpc/platforms/celleb/Makefile
@@ -1,6 +1,7 @@
1obj-y += interrupt.o iommu.o setup.o \ 1obj-y += interrupt.o iommu.o setup.o \
2 htab.o beat.o pci.o \ 2 htab.o beat.o hvCall.o pci.o \
3 scc_epci.o scc_uhc.o hvCall.o 3 scc_epci.o scc_uhc.o \
4 io-workarounds.o
4 5
5obj-$(CONFIG_SMP) += smp.o 6obj-$(CONFIG_SMP) += smp.o
6obj-$(CONFIG_PPC_UDBG_BEAT) += udbg_beat.o 7obj-$(CONFIG_PPC_UDBG_BEAT) += udbg_beat.o
diff --git a/arch/powerpc/platforms/celleb/beat.c b/arch/powerpc/platforms/celleb/beat.c
index 99341ce8a697..93ebb7d85120 100644
--- a/arch/powerpc/platforms/celleb/beat.c
+++ b/arch/powerpc/platforms/celleb/beat.c
@@ -22,16 +22,24 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/err.h> 23#include <linux/err.h>
24#include <linux/rtc.h> 24#include <linux/rtc.h>
25#include <linux/interrupt.h>
26#include <linux/irqreturn.h>
27#include <linux/reboot.h>
25 28
26#include <asm/hvconsole.h> 29#include <asm/hvconsole.h>
27#include <asm/time.h> 30#include <asm/time.h>
31#include <asm/machdep.h>
32#include <asm/firmware.h>
28 33
29#include "beat_wrapper.h" 34#include "beat_wrapper.h"
30#include "beat.h" 35#include "beat.h"
36#include "interrupt.h"
37
38static int beat_pm_poweroff_flag;
31 39
32void beat_restart(char *cmd) 40void beat_restart(char *cmd)
33{ 41{
34 beat_shutdown_logical_partition(1); 42 beat_shutdown_logical_partition(!beat_pm_poweroff_flag);
35} 43}
36 44
37void beat_power_off(void) 45void beat_power_off(void)
@@ -158,6 +166,102 @@ int64_t beat_put_term_char(u64 vterm, u64 len, u64 t1, u64 t2)
158 return beat_put_characters_to_console(vterm, len, (u8*)db); 166 return beat_put_characters_to_console(vterm, len, (u8*)db);
159} 167}
160 168
169void beat_power_save(void)
170{
171 beat_pause(0);
172}
173
174#ifdef CONFIG_KEXEC
175void beat_kexec_cpu_down(int crash, int secondary)
176{
177 beatic_deinit_IRQ();
178}
179#endif
180
181static irqreturn_t beat_power_event(int virq, void *arg)
182{
183 printk(KERN_DEBUG "Beat: power button pressed\n");
184 beat_pm_poweroff_flag = 1;
185 ctrl_alt_del();
186 return IRQ_HANDLED;
187}
188
189static irqreturn_t beat_reset_event(int virq, void *arg)
190{
191 printk(KERN_DEBUG "Beat: reset button pressed\n");
192 beat_pm_poweroff_flag = 0;
193 ctrl_alt_del();
194 return IRQ_HANDLED;
195}
196
197static struct beat_event_list {
198 const char *typecode;
199 irq_handler_t handler;
200 unsigned int virq;
201} beat_event_list[] = {
202 { "power", beat_power_event, 0 },
203 { "reset", beat_reset_event, 0 },
204};
205
206static int __init beat_register_event(void)
207{
208 u64 path[4], data[2];
209 int rc, i;
210 unsigned int virq;
211
212 for (i = 0; i < ARRAY_SIZE(beat_event_list); i++) {
213 struct beat_event_list *ev = &beat_event_list[i];
214
215 if (beat_construct_event_receive_port(data) != 0) {
216 printk(KERN_ERR "Beat: "
217 "cannot construct event receive port for %s\n",
218 ev->typecode);
219 return -EINVAL;
220 }
221
222 virq = irq_create_mapping(NULL, data[0]);
223 if (virq == NO_IRQ) {
224 printk(KERN_ERR "Beat: failed to get virtual IRQ"
225 " for event receive port for %s\n",
226 ev->typecode);
227 beat_destruct_event_receive_port(data[0]);
228 return -EIO;
229 }
230 ev->virq = virq;
231
232 rc = request_irq(virq, ev->handler, IRQF_DISABLED,
233 ev->typecode, NULL);
234 if (rc != 0) {
235 printk(KERN_ERR "Beat: failed to request virtual IRQ"
236 " for event receive port for %s\n",
237 ev->typecode);
238 beat_destruct_event_receive_port(data[0]);
239 return rc;
240 }
241
242 path[0] = 0x1000000065780000ul; /* 1,ex */
243 path[1] = 0x627574746f6e0000ul; /* button */
244 path[2] = 0;
245 strncpy((char *)&path[2], ev->typecode, 8);
246 path[3] = 0;
247 data[1] = 0;
248
249 beat_create_repository_node(path, data);
250 }
251 return 0;
252}
253
254static int __init beat_event_init(void)
255{
256 if (!firmware_has_feature(FW_FEATURE_BEAT))
257 return -EINVAL;
258
259 beat_pm_poweroff_flag = 0;
260 return beat_register_event();
261}
262
263device_initcall(beat_event_init);
264
161EXPORT_SYMBOL(beat_get_term_char); 265EXPORT_SYMBOL(beat_get_term_char);
162EXPORT_SYMBOL(beat_put_term_char); 266EXPORT_SYMBOL(beat_put_term_char);
163EXPORT_SYMBOL(beat_halt_code); 267EXPORT_SYMBOL(beat_halt_code);
diff --git a/arch/powerpc/platforms/celleb/beat.h b/arch/powerpc/platforms/celleb/beat.h
index 2b16bf3bee89..b2e292df13ca 100644
--- a/arch/powerpc/platforms/celleb/beat.h
+++ b/arch/powerpc/platforms/celleb/beat.h
@@ -36,5 +36,7 @@ ssize_t beat_nvram_get_size(void);
36ssize_t beat_nvram_read(char *, size_t, loff_t *); 36ssize_t beat_nvram_read(char *, size_t, loff_t *);
37ssize_t beat_nvram_write(char *, size_t, loff_t *); 37ssize_t beat_nvram_write(char *, size_t, loff_t *);
38int beat_set_xdabr(unsigned long); 38int beat_set_xdabr(unsigned long);
39void beat_power_save(void);
40void beat_kexec_cpu_down(int, int);
39 41
40#endif /* _CELLEB_BEAT_H */ 42#endif /* _CELLEB_BEAT_H */
diff --git a/arch/powerpc/platforms/celleb/beat_syscall.h b/arch/powerpc/platforms/celleb/beat_syscall.h
index 14e16974773f..8580dc7e1798 100644
--- a/arch/powerpc/platforms/celleb/beat_syscall.h
+++ b/arch/powerpc/platforms/celleb/beat_syscall.h
@@ -157,4 +157,8 @@
157#define HV_rtc_write __BEAT_ADD_VENDOR_ID(0x191, 1) 157#define HV_rtc_write __BEAT_ADD_VENDOR_ID(0x191, 1)
158#define HV_eeprom_read __BEAT_ADD_VENDOR_ID(0x192, 1) 158#define HV_eeprom_read __BEAT_ADD_VENDOR_ID(0x192, 1)
159#define HV_eeprom_write __BEAT_ADD_VENDOR_ID(0x193, 1) 159#define HV_eeprom_write __BEAT_ADD_VENDOR_ID(0x193, 1)
160#define HV_insert_htab_entry3 __BEAT_ADD_VENDOR_ID(0x104, 1)
161#define HV_invalidate_htab_entry3 __BEAT_ADD_VENDOR_ID(0x105, 1)
162#define HV_update_htab_permission3 __BEAT_ADD_VENDOR_ID(0x106, 1)
163#define HV_clear_htab3 __BEAT_ADD_VENDOR_ID(0x107, 1)
160#endif 164#endif
diff --git a/arch/powerpc/platforms/celleb/beat_wrapper.h b/arch/powerpc/platforms/celleb/beat_wrapper.h
index 76ea0a6a9011..cbc1487df7de 100644
--- a/arch/powerpc/platforms/celleb/beat_wrapper.h
+++ b/arch/powerpc/platforms/celleb/beat_wrapper.h
@@ -98,6 +98,37 @@ static inline s64 beat_write_htab_entry(u64 htab_id, u64 slot,
98 return ret; 98 return ret;
99} 99}
100 100
101static inline s64 beat_insert_htab_entry3(u64 htab_id, u64 group,
102 u64 hpte_v, u64 hpte_r, u64 mask_v, u64 value_v, u64 *slot)
103{
104 u64 dummy[1];
105 s64 ret;
106
107 ret = beat_hcall1(HV_insert_htab_entry3, dummy, htab_id, group,
108 hpte_v, hpte_r, mask_v, value_v);
109 *slot = dummy[0];
110 return ret;
111}
112
113static inline s64 beat_invalidate_htab_entry3(u64 htab_id, u64 group,
114 u64 va, u64 pss)
115{
116 return beat_hcall_norets(HV_invalidate_htab_entry3,
117 htab_id, group, va, pss);
118}
119
120static inline s64 beat_update_htab_permission3(u64 htab_id, u64 group,
121 u64 va, u64 pss, u64 ptel_mask, u64 ptel_value)
122{
123 return beat_hcall_norets(HV_update_htab_permission3,
124 htab_id, group, va, pss, ptel_mask, ptel_value);
125}
126
127static inline s64 beat_clear_htab3(u64 htab_id)
128{
129 return beat_hcall_norets(HV_clear_htab3, htab_id);
130}
131
101static inline void beat_shutdown_logical_partition(u64 code) 132static inline void beat_shutdown_logical_partition(u64 code)
102{ 133{
103 (void)beat_hcall_norets(HV_shutdown_logical_partition, code); 134 (void)beat_hcall_norets(HV_shutdown_logical_partition, code);
@@ -217,4 +248,41 @@ static inline s64 beat_put_iopte(u64 ioas_id, u64 io_addr, u64 real_addr,
217 ioid, flags); 248 ioid, flags);
218} 249}
219 250
251static inline s64 beat_construct_event_receive_port(u64 *port)
252{
253 u64 dummy[1];
254 s64 ret;
255
256 ret = beat_hcall1(HV_construct_event_receive_port, dummy);
257 *port = dummy[0];
258 return ret;
259}
260
261static inline s64 beat_destruct_event_receive_port(u64 port)
262{
263 s64 ret;
264
265 ret = beat_hcall_norets(HV_destruct_event_receive_port, port);
266 return ret;
267}
268
269static inline s64 beat_create_repository_node(u64 path[4], u64 data[2])
270{
271 s64 ret;
272
273 ret = beat_hcall_norets(HV_create_repository_node2,
274 path[0], path[1], path[2], path[3], data[0], data[1]);
275 return ret;
276}
277
278static inline s64 beat_get_repository_node_value(u64 lpid, u64 path[4],
279 u64 data[2])
280{
281 s64 ret;
282
283 ret = beat_hcall2(HV_get_repository_node_value2, data,
284 lpid, path[0], path[1], path[2], path[3]);
285 return ret;
286}
287
220#endif 288#endif
diff --git a/arch/powerpc/platforms/celleb/htab.c b/arch/powerpc/platforms/celleb/htab.c
index 279d7339e170..5e75c77ea8f3 100644
--- a/arch/powerpc/platforms/celleb/htab.c
+++ b/arch/powerpc/platforms/celleb/htab.c
@@ -306,3 +306,133 @@ void __init hpte_init_beat(void)
306 ppc_md.hpte_remove = beat_lpar_hpte_remove; 306 ppc_md.hpte_remove = beat_lpar_hpte_remove;
307 ppc_md.hpte_clear_all = beat_lpar_hptab_clear; 307 ppc_md.hpte_clear_all = beat_lpar_hptab_clear;
308} 308}
309
310static long beat_lpar_hpte_insert_v3(unsigned long hpte_group,
311 unsigned long va, unsigned long pa,
312 unsigned long rflags, unsigned long vflags,
313 int psize)
314{
315 unsigned long lpar_rc;
316 unsigned long slot;
317 unsigned long hpte_v, hpte_r;
318
319 /* same as iseries */
320 if (vflags & HPTE_V_SECONDARY)
321 return -1;
322
323 if (!(vflags & HPTE_V_BOLTED))
324 DBG_LOW("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
325 "rflags=%lx, vflags=%lx, psize=%d)\n",
326 hpte_group, va, pa, rflags, vflags, psize);
327
328 hpte_v = hpte_encode_v(va, psize) | vflags | HPTE_V_VALID;
329 hpte_r = hpte_encode_r(pa, psize) | rflags;
330
331 if (!(vflags & HPTE_V_BOLTED))
332 DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
333
334 if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
335 hpte_r &= ~_PAGE_COHERENT;
336
337 /* insert into not-volted entry */
338 lpar_rc = beat_insert_htab_entry3(0, hpte_group, hpte_v, hpte_r,
339 HPTE_V_BOLTED, 0, &slot);
340 /*
341 * Since we try and ioremap PHBs we don't own, the pte insert
342 * will fail. However we must catch the failure in hash_page
343 * or we will loop forever, so return -2 in this case.
344 */
345 if (unlikely(lpar_rc != 0)) {
346 if (!(vflags & HPTE_V_BOLTED))
347 DBG_LOW(" lpar err %lx\n", lpar_rc);
348 return -2;
349 }
350 if (!(vflags & HPTE_V_BOLTED))
351 DBG_LOW(" -> slot: %lx\n", slot);
352
353 /* We have to pass down the secondary bucket bit here as well */
354 return (slot ^ hpte_group) & 15;
355}
356
357/*
358 * NOTE: for updatepp ops we are fortunate that the linux "newpp" bits and
359 * the low 3 bits of flags happen to line up. So no transform is needed.
360 * We can probably optimize here and assume the high bits of newpp are
361 * already zero. For now I am paranoid.
362 */
363static long beat_lpar_hpte_updatepp_v3(unsigned long slot,
364 unsigned long newpp,
365 unsigned long va,
366 int psize, int local)
367{
368 unsigned long lpar_rc;
369 unsigned long want_v;
370 unsigned long pss;
371
372 want_v = hpte_encode_v(va, psize);
373 pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc;
374
375 DBG_LOW(" update: "
376 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ",
377 want_v & HPTE_V_AVPN, slot, psize, newpp);
378
379 lpar_rc = beat_update_htab_permission3(0, slot, want_v, pss, 7, newpp);
380
381 if (lpar_rc == 0xfffffff7) {
382 DBG_LOW("not found !\n");
383 return -1;
384 }
385
386 DBG_LOW("ok\n");
387
388 BUG_ON(lpar_rc != 0);
389
390 return 0;
391}
392
393static void beat_lpar_hpte_invalidate_v3(unsigned long slot, unsigned long va,
394 int psize, int local)
395{
396 unsigned long want_v;
397 unsigned long lpar_rc;
398 unsigned long pss;
399
400 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
401 slot, va, psize, local);
402 want_v = hpte_encode_v(va, psize);
403 pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc;
404
405 lpar_rc = beat_invalidate_htab_entry3(0, slot, want_v, pss);
406
407 /* E_busy can be valid output: page may be already replaced */
408 BUG_ON(lpar_rc != 0 && lpar_rc != 0xfffffff7);
409}
410
411static int64_t _beat_lpar_hptab_clear_v3(void)
412{
413 return beat_clear_htab3(0);
414}
415
416static void beat_lpar_hptab_clear_v3(void)
417{
418 _beat_lpar_hptab_clear_v3();
419}
420
421void __init hpte_init_beat_v3(void)
422{
423 if (_beat_lpar_hptab_clear_v3() == 0) {
424 ppc_md.hpte_invalidate = beat_lpar_hpte_invalidate_v3;
425 ppc_md.hpte_updatepp = beat_lpar_hpte_updatepp_v3;
426 ppc_md.hpte_updateboltedpp = beat_lpar_hpte_updateboltedpp;
427 ppc_md.hpte_insert = beat_lpar_hpte_insert_v3;
428 ppc_md.hpte_remove = beat_lpar_hpte_remove;
429 ppc_md.hpte_clear_all = beat_lpar_hptab_clear_v3;
430 } else {
431 ppc_md.hpte_invalidate = beat_lpar_hpte_invalidate;
432 ppc_md.hpte_updatepp = beat_lpar_hpte_updatepp;
433 ppc_md.hpte_updateboltedpp = beat_lpar_hpte_updateboltedpp;
434 ppc_md.hpte_insert = beat_lpar_hpte_insert;
435 ppc_md.hpte_remove = beat_lpar_hpte_remove;
436 ppc_md.hpte_clear_all = beat_lpar_hptab_clear;
437 }
438}
diff --git a/arch/powerpc/platforms/celleb/interrupt.c b/arch/powerpc/platforms/celleb/interrupt.c
index 98e6665681d3..c7c68ca70c82 100644
--- a/arch/powerpc/platforms/celleb/interrupt.c
+++ b/arch/powerpc/platforms/celleb/interrupt.c
@@ -175,11 +175,18 @@ static int beatic_pic_host_xlate(struct irq_host *h, struct device_node *ct,
175 return 0; 175 return 0;
176} 176}
177 177
178static int beatic_pic_host_match(struct irq_host *h, struct device_node *np)
179{
180 /* Match all */
181 return 1;
182}
183
178static struct irq_host_ops beatic_pic_host_ops = { 184static struct irq_host_ops beatic_pic_host_ops = {
179 .map = beatic_pic_host_map, 185 .map = beatic_pic_host_map,
180 .remap = beatic_pic_host_remap, 186 .remap = beatic_pic_host_remap,
181 .unmap = beatic_pic_host_unmap, 187 .unmap = beatic_pic_host_unmap,
182 .xlate = beatic_pic_host_xlate, 188 .xlate = beatic_pic_host_xlate,
189 .match = beatic_pic_host_match,
183}; 190};
184 191
185/* 192/*
@@ -242,7 +249,7 @@ void __init beatic_init_IRQ(void)
242 ppc_md.get_irq = beatic_get_irq; 249 ppc_md.get_irq = beatic_get_irq;
243 250
244 /* Allocate an irq host */ 251 /* Allocate an irq host */
245 beatic_host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, 252 beatic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0,
246 &beatic_pic_host_ops, 253 &beatic_pic_host_ops,
247 0); 254 0);
248 BUG_ON(beatic_host == NULL); 255 BUG_ON(beatic_host == NULL);
diff --git a/arch/powerpc/platforms/celleb/io-workarounds.c b/arch/powerpc/platforms/celleb/io-workarounds.c
new file mode 100644
index 000000000000..2b912140bcbb
--- /dev/null
+++ b/arch/powerpc/platforms/celleb/io-workarounds.c
@@ -0,0 +1,279 @@
1/*
2 * Support for Celleb io workarounds
3 *
4 * (C) Copyright 2006-2007 TOSHIBA CORPORATION
5 *
6 * This file is based to arch/powerpc/platform/cell/io-workarounds.c
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#undef DEBUG
24
25#include <linux/of_device.h>
26#include <linux/irq.h>
27
28#include <asm/io.h>
29#include <asm/prom.h>
30#include <asm/machdep.h>
31#include <asm/pci-bridge.h>
32#include <asm/ppc-pci.h>
33
34#include "pci.h"
35
36#define MAX_CELLEB_PCI_BUS 4
37
38void *celleb_dummy_page_va;
39
40static struct celleb_pci_bus {
41 struct pci_controller *phb;
42 void (*dummy_read)(struct pci_controller *);
43} celleb_pci_busses[MAX_CELLEB_PCI_BUS];
44
45static int celleb_pci_count = 0;
46
47static struct celleb_pci_bus *celleb_pci_find(unsigned long vaddr,
48 unsigned long paddr)
49{
50 int i, j;
51 struct resource *res;
52
53 for (i = 0; i < celleb_pci_count; i++) {
54 struct celleb_pci_bus *bus = &celleb_pci_busses[i];
55 struct pci_controller *phb = bus->phb;
56 if (paddr)
57 for (j = 0; j < 3; j++) {
58 res = &phb->mem_resources[j];
59 if (paddr >= res->start && paddr <= res->end)
60 return bus;
61 }
62 res = &phb->io_resource;
63 if (vaddr && vaddr >= res->start && vaddr <= res->end)
64 return bus;
65 }
66 return NULL;
67}
68
69static void celleb_io_flush(const PCI_IO_ADDR addr)
70{
71 struct celleb_pci_bus *bus;
72 int token;
73
74 token = PCI_GET_ADDR_TOKEN(addr);
75
76 if (token && token <= celleb_pci_count)
77 bus = &celleb_pci_busses[token - 1];
78 else {
79 unsigned long vaddr, paddr;
80 pte_t *ptep;
81
82 vaddr = (unsigned long)PCI_FIX_ADDR(addr);
83 if (vaddr < PHB_IO_BASE || vaddr >= PHB_IO_END)
84 return;
85
86 ptep = find_linux_pte(init_mm.pgd, vaddr);
87 if (ptep == NULL)
88 paddr = 0;
89 else
90 paddr = pte_pfn(*ptep) << PAGE_SHIFT;
91 bus = celleb_pci_find(vaddr, paddr);
92
93 if (bus == NULL)
94 return;
95 }
96
97 if (bus->dummy_read)
98 bus->dummy_read(bus->phb);
99}
100
101static u8 celleb_readb(const PCI_IO_ADDR addr)
102{
103 u8 val;
104 val = __do_readb(addr);
105 celleb_io_flush(addr);
106 return val;
107}
108
109static u16 celleb_readw(const PCI_IO_ADDR addr)
110{
111 u16 val;
112 val = __do_readw(addr);
113 celleb_io_flush(addr);
114 return val;
115}
116
117static u32 celleb_readl(const PCI_IO_ADDR addr)
118{
119 u32 val;
120 val = __do_readl(addr);
121 celleb_io_flush(addr);
122 return val;
123}
124
125static u64 celleb_readq(const PCI_IO_ADDR addr)
126{
127 u64 val;
128 val = __do_readq(addr);
129 celleb_io_flush(addr);
130 return val;
131}
132
133static u16 celleb_readw_be(const PCI_IO_ADDR addr)
134{
135 u16 val;
136 val = __do_readw_be(addr);
137 celleb_io_flush(addr);
138 return val;
139}
140
141static u32 celleb_readl_be(const PCI_IO_ADDR addr)
142{
143 u32 val;
144 val = __do_readl_be(addr);
145 celleb_io_flush(addr);
146 return val;
147}
148
149static u64 celleb_readq_be(const PCI_IO_ADDR addr)
150{
151 u64 val;
152 val = __do_readq_be(addr);
153 celleb_io_flush(addr);
154 return val;
155}
156
157static void celleb_readsb(const PCI_IO_ADDR addr,
158 void *buf, unsigned long count)
159{
160 __do_readsb(addr, buf, count);
161 celleb_io_flush(addr);
162}
163
164static void celleb_readsw(const PCI_IO_ADDR addr,
165 void *buf, unsigned long count)
166{
167 __do_readsw(addr, buf, count);
168 celleb_io_flush(addr);
169}
170
171static void celleb_readsl(const PCI_IO_ADDR addr,
172 void *buf, unsigned long count)
173{
174 __do_readsl(addr, buf, count);
175 celleb_io_flush(addr);
176}
177
178static void celleb_memcpy_fromio(void *dest,
179 const PCI_IO_ADDR src,
180 unsigned long n)
181{
182 __do_memcpy_fromio(dest, src, n);
183 celleb_io_flush(src);
184}
185
186static void __iomem *celleb_ioremap(unsigned long addr,
187 unsigned long size,
188 unsigned long flags)
189{
190 struct celleb_pci_bus *bus;
191 void __iomem *res = __ioremap(addr, size, flags);
192 int busno;
193
194 bus = celleb_pci_find(0, addr);
195 if (bus != NULL) {
196 busno = bus - celleb_pci_busses;
197 PCI_SET_ADDR_TOKEN(res, busno + 1);
198 }
199 return res;
200}
201
202static void celleb_iounmap(volatile void __iomem *addr)
203{
204 return __iounmap(PCI_FIX_ADDR(addr));
205}
206
207static struct ppc_pci_io celleb_pci_io __initdata = {
208 .readb = celleb_readb,
209 .readw = celleb_readw,
210 .readl = celleb_readl,
211 .readq = celleb_readq,
212 .readw_be = celleb_readw_be,
213 .readl_be = celleb_readl_be,
214 .readq_be = celleb_readq_be,
215 .readsb = celleb_readsb,
216 .readsw = celleb_readsw,
217 .readsl = celleb_readsl,
218 .memcpy_fromio = celleb_memcpy_fromio,
219};
220
221void __init celleb_pci_add_one(struct pci_controller *phb,
222 void (*dummy_read)(struct pci_controller *))
223{
224 struct celleb_pci_bus *bus = &celleb_pci_busses[celleb_pci_count];
225 struct device_node *np = phb->arch_data;
226
227 if (celleb_pci_count >= MAX_CELLEB_PCI_BUS) {
228 printk(KERN_ERR "Too many pci bridges, workarounds"
229 " disabled for %s\n", np->full_name);
230 return;
231 }
232
233 celleb_pci_count++;
234
235 bus->phb = phb;
236 bus->dummy_read = dummy_read;
237}
238
239static struct of_device_id celleb_pci_workaround_match[] __initdata = {
240 {
241 .name = "pci-pseudo",
242 .data = fake_pci_workaround_init,
243 }, {
244 .name = "epci",
245 .data = epci_workaround_init,
246 }, {
247 },
248};
249
250int __init celleb_pci_workaround_init(void)
251{
252 struct pci_controller *phb;
253 struct device_node *node;
254 const struct of_device_id *match;
255 void (*init_func)(struct pci_controller *);
256
257 celleb_dummy_page_va = kmalloc(PAGE_SIZE, GFP_KERNEL);
258 if (!celleb_dummy_page_va) {
259 printk(KERN_ERR "Celleb: dummy read disabled."
260 "Alloc celleb_dummy_page_va failed\n");
261 return 1;
262 }
263
264 list_for_each_entry(phb, &hose_list, list_node) {
265 node = phb->arch_data;
266 match = of_match_node(celleb_pci_workaround_match, node);
267
268 if (match) {
269 init_func = match->data;
270 (*init_func)(phb);
271 }
272 }
273
274 ppc_pci_io = celleb_pci_io;
275 ppc_md.ioremap = celleb_ioremap;
276 ppc_md.iounmap = celleb_iounmap;
277
278 return 0;
279}
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c
index e9ac19c4bba4..6bc32fda7a6b 100644
--- a/arch/powerpc/platforms/celleb/pci.c
+++ b/arch/powerpc/platforms/celleb/pci.c
@@ -31,6 +31,7 @@
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/bootmem.h> 32#include <linux/bootmem.h>
33#include <linux/pci_regs.h> 33#include <linux/pci_regs.h>
34#include <linux/of_device.h>
34 35
35#include <asm/io.h> 36#include <asm/io.h>
36#include <asm/irq.h> 37#include <asm/irq.h>
@@ -242,8 +243,8 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus,
242} 243}
243 244
244static struct pci_ops celleb_fake_pci_ops = { 245static struct pci_ops celleb_fake_pci_ops = {
245 celleb_fake_pci_read_config, 246 .read = celleb_fake_pci_read_config,
246 celleb_fake_pci_write_config 247 .write = celleb_fake_pci_write_config,
247}; 248};
248 249
249static inline void celleb_setup_pci_base_addrs(struct pci_controller *hose, 250static inline void celleb_setup_pci_base_addrs(struct pci_controller *hose,
@@ -288,8 +289,8 @@ static inline void celleb_setup_pci_base_addrs(struct pci_controller *hose,
288 celleb_config_write_fake(config, PCI_COMMAND, 2, val); 289 celleb_config_write_fake(config, PCI_COMMAND, 2, val);
289} 290}
290 291
291static int __devinit celleb_setup_fake_pci_device(struct device_node *node, 292static int __init celleb_setup_fake_pci_device(struct device_node *node,
292 struct pci_controller *hose) 293 struct pci_controller *hose)
293{ 294{
294 unsigned int rlen; 295 unsigned int rlen;
295 int num_base_addr = 0; 296 int num_base_addr = 0;
@@ -327,10 +328,7 @@ static int __devinit celleb_setup_fake_pci_device(struct device_node *node,
327 328
328 size = 256; 329 size = 256;
329 config = &private->fake_config[devno][fn]; 330 config = &private->fake_config[devno][fn];
330 if (mem_init_done) 331 *config = alloc_maybe_bootmem(size, GFP_KERNEL);
331 *config = kzalloc(size, GFP_KERNEL);
332 else
333 *config = alloc_bootmem(size);
334 if (*config == NULL) { 332 if (*config == NULL) {
335 printk(KERN_ERR "PCI: " 333 printk(KERN_ERR "PCI: "
336 "not enough memory for fake configuration space\n"); 334 "not enough memory for fake configuration space\n");
@@ -341,10 +339,7 @@ static int __devinit celleb_setup_fake_pci_device(struct device_node *node,
341 339
342 size = sizeof(struct celleb_pci_resource); 340 size = sizeof(struct celleb_pci_resource);
343 res = &private->res[devno][fn]; 341 res = &private->res[devno][fn];
344 if (mem_init_done) 342 *res = alloc_maybe_bootmem(size, GFP_KERNEL);
345 *res = kzalloc(size, GFP_KERNEL);
346 else
347 *res = alloc_bootmem(size);
348 if (*res == NULL) { 343 if (*res == NULL) {
349 printk(KERN_ERR 344 printk(KERN_ERR
350 "PCI: not enough memory for resource data space\n"); 345 "PCI: not enough memory for resource data space\n");
@@ -418,8 +413,8 @@ error:
418 return 1; 413 return 1;
419} 414}
420 415
421static int __devinit phb_set_bus_ranges(struct device_node *dev, 416static int __init phb_set_bus_ranges(struct device_node *dev,
422 struct pci_controller *phb) 417 struct pci_controller *phb)
423{ 418{
424 const int *bus_range; 419 const int *bus_range;
425 unsigned int len; 420 unsigned int len;
@@ -434,46 +429,65 @@ static int __devinit phb_set_bus_ranges(struct device_node *dev,
434 return 0; 429 return 0;
435} 430}
436 431
437static void __devinit celleb_alloc_private_mem(struct pci_controller *hose) 432static void __init celleb_alloc_private_mem(struct pci_controller *hose)
438{ 433{
439 if (mem_init_done) 434 hose->private_data =
440 hose->private_data = 435 alloc_maybe_bootmem(sizeof(struct celleb_pci_private),
441 kzalloc(sizeof(struct celleb_pci_private), GFP_KERNEL); 436 GFP_KERNEL);
442 else
443 hose->private_data =
444 alloc_bootmem(sizeof(struct celleb_pci_private));
445} 437}
446 438
447int __devinit celleb_setup_phb(struct pci_controller *phb) 439static int __init celleb_setup_fake_pci(struct device_node *dev,
440 struct pci_controller *phb)
448{ 441{
449 const char *name;
450 struct device_node *dev = phb->arch_data;
451 struct device_node *node; 442 struct device_node *node;
452 unsigned int rlen;
453 443
454 name = of_get_property(dev, "name", &rlen); 444 phb->ops = &celleb_fake_pci_ops;
455 if (!name) 445 celleb_alloc_private_mem(phb);
456 return 1;
457 446
458 pr_debug("PCI: celleb_setup_phb() %s\n", name); 447 for (node = of_get_next_child(dev, NULL);
459 phb_set_bus_ranges(dev, phb); 448 node != NULL; node = of_get_next_child(dev, node))
460 phb->buid = 1; 449 celleb_setup_fake_pci_device(node, phb);
450
451 return 0;
452}
461 453
462 if (strcmp(name, "epci") == 0) { 454void __init fake_pci_workaround_init(struct pci_controller *phb)
463 phb->ops = &celleb_epci_ops; 455{
464 return celleb_setup_epci(dev, phb); 456 /**
457 * We will add fake pci bus to scc_pci_bus for the purpose to improve
458 * I/O Macro performance. But device-tree and device drivers
459 * are not ready to use address with a token.
460 */
461
462 /* celleb_pci_add_one(phb, NULL); */
463}
465 464
466 } else if (strcmp(name, "pci-pseudo") == 0) { 465static struct of_device_id celleb_phb_match[] __initdata = {
467 phb->ops = &celleb_fake_pci_ops; 466 {
468 celleb_alloc_private_mem(phb); 467 .name = "pci-pseudo",
469 for (node = of_get_next_child(dev, NULL); 468 .data = celleb_setup_fake_pci,
470 node != NULL; node = of_get_next_child(dev, node)) 469 }, {
471 celleb_setup_fake_pci_device(node, phb); 470 .name = "epci",
471 .data = celleb_setup_epci,
472 }, {
473 },
474};
472 475
473 } else 476int __init celleb_setup_phb(struct pci_controller *phb)
477{
478 struct device_node *dev = phb->arch_data;
479 const struct of_device_id *match;
480 int (*setup_func)(struct device_node *, struct pci_controller *);
481
482 match = of_match_node(celleb_phb_match, dev);
483 if (!match)
474 return 1; 484 return 1;
475 485
476 return 0; 486 phb_set_bus_ranges(dev, phb);
487 phb->buid = 1;
488
489 setup_func = match->data;
490 return (*setup_func)(dev, phb);
477} 491}
478 492
479int celleb_pci_probe_mode(struct pci_bus *bus) 493int celleb_pci_probe_mode(struct pci_bus *bus)
diff --git a/arch/powerpc/platforms/celleb/pci.h b/arch/powerpc/platforms/celleb/pci.h
index 5340e348e297..5d5544ffeddb 100644
--- a/arch/powerpc/platforms/celleb/pci.h
+++ b/arch/powerpc/platforms/celleb/pci.h
@@ -25,11 +25,18 @@
25 25
26#include <asm/pci-bridge.h> 26#include <asm/pci-bridge.h>
27#include <asm/prom.h> 27#include <asm/prom.h>
28#include <asm/ppc-pci.h>
28 29
29extern int celleb_setup_phb(struct pci_controller *); 30extern int celleb_setup_phb(struct pci_controller *);
30extern int celleb_pci_probe_mode(struct pci_bus *); 31extern int celleb_pci_probe_mode(struct pci_bus *);
31 32
32extern struct pci_ops celleb_epci_ops;
33extern int celleb_setup_epci(struct device_node *, struct pci_controller *); 33extern int celleb_setup_epci(struct device_node *, struct pci_controller *);
34 34
35extern void *celleb_dummy_page_va;
36extern int __init celleb_pci_workaround_init(void);
37extern void __init celleb_pci_add_one(struct pci_controller *,
38 void (*)(struct pci_controller *));
39extern void fake_pci_workaround_init(struct pci_controller *);
40extern void epci_workaround_init(struct pci_controller *);
41
35#endif /* _CELLEB_PCI_H */ 42#endif /* _CELLEB_PCI_H */
diff --git a/arch/powerpc/platforms/celleb/scc.h b/arch/powerpc/platforms/celleb/scc.h
index e9ce8a7c1882..6be1542a6e66 100644
--- a/arch/powerpc/platforms/celleb/scc.h
+++ b/arch/powerpc/platforms/celleb/scc.h
@@ -53,7 +53,7 @@
53#define SCC_EPCI_STATUS 0x808 53#define SCC_EPCI_STATUS 0x808
54#define SCC_EPCI_ABTSET 0x80c 54#define SCC_EPCI_ABTSET 0x80c
55#define SCC_EPCI_WATRP 0x810 55#define SCC_EPCI_WATRP 0x810
56#define SCC_EPCI_DUMMYRADR 0x814 56#define SCC_EPCI_DUMYRADR 0x814
57#define SCC_EPCI_SWRESP 0x818 57#define SCC_EPCI_SWRESP 0x818
58#define SCC_EPCI_CNTOPT 0x81c 58#define SCC_EPCI_CNTOPT 0x81c
59#define SCC_EPCI_ECMODE 0xf00 59#define SCC_EPCI_ECMODE 0xf00
diff --git a/arch/powerpc/platforms/celleb/scc_epci.c b/arch/powerpc/platforms/celleb/scc_epci.c
index c4b011094bd6..9d076426676c 100644
--- a/arch/powerpc/platforms/celleb/scc_epci.c
+++ b/arch/powerpc/platforms/celleb/scc_epci.c
@@ -43,7 +43,11 @@
43 43
44#define iob() __asm__ __volatile__("eieio; sync":::"memory") 44#define iob() __asm__ __volatile__("eieio; sync":::"memory")
45 45
46static inline volatile void __iomem *celleb_epci_get_epci_base( 46struct epci_private {
47 dma_addr_t dummy_page_da;
48};
49
50static inline PCI_IO_ADDR celleb_epci_get_epci_base(
47 struct pci_controller *hose) 51 struct pci_controller *hose)
48{ 52{
49 /* 53 /*
@@ -55,7 +59,7 @@ static inline volatile void __iomem *celleb_epci_get_epci_base(
55 return hose->cfg_addr; 59 return hose->cfg_addr;
56} 60}
57 61
58static inline volatile void __iomem *celleb_epci_get_epci_cfg( 62static inline PCI_IO_ADDR celleb_epci_get_epci_cfg(
59 struct pci_controller *hose) 63 struct pci_controller *hose)
60{ 64{
61 /* 65 /*
@@ -67,20 +71,11 @@ static inline volatile void __iomem *celleb_epci_get_epci_cfg(
67 return hose->cfg_data; 71 return hose->cfg_data;
68} 72}
69 73
70#if 0 /* test code for epci dummy read */ 74static void scc_epci_dummy_read(struct pci_controller *hose)
71static void celleb_epci_dummy_read(struct pci_dev *dev)
72{ 75{
73 volatile void __iomem *epci_base; 76 PCI_IO_ADDR epci_base;
74 struct device_node *node;
75 struct pci_controller *hose;
76 u32 val; 77 u32 val;
77 78
78 node = (struct device_node *)dev->bus->sysdata;
79 hose = pci_find_hose_for_OF_device(node);
80
81 if (!hose)
82 return;
83
84 epci_base = celleb_epci_get_epci_base(hose); 79 epci_base = celleb_epci_get_epci_base(hose);
85 80
86 val = in_be32(epci_base + SCC_EPCI_WATRP); 81 val = in_be32(epci_base + SCC_EPCI_WATRP);
@@ -88,21 +83,45 @@ static void celleb_epci_dummy_read(struct pci_dev *dev)
88 83
89 return; 84 return;
90} 85}
91#endif 86
87void __init epci_workaround_init(struct pci_controller *hose)
88{
89 PCI_IO_ADDR epci_base;
90 PCI_IO_ADDR reg;
91 struct epci_private *private = hose->private_data;
92
93 BUG_ON(!private);
94
95 private->dummy_page_da = dma_map_single(hose->parent,
96 celleb_dummy_page_va, PAGE_SIZE, DMA_FROM_DEVICE);
97 if (private->dummy_page_da == DMA_ERROR_CODE) {
98 printk(KERN_ERR "EPCI: dummy read disabled."
99 "Map dummy page failed.\n");
100 return;
101 }
102
103 celleb_pci_add_one(hose, scc_epci_dummy_read);
104 epci_base = celleb_epci_get_epci_base(hose);
105
106 reg = epci_base + SCC_EPCI_DUMYRADR;
107 out_be32(reg, private->dummy_page_da);
108}
92 109
93static inline void clear_and_disable_master_abort_interrupt( 110static inline void clear_and_disable_master_abort_interrupt(
94 struct pci_controller *hose) 111 struct pci_controller *hose)
95{ 112{
96 volatile void __iomem *epci_base, *reg; 113 PCI_IO_ADDR epci_base;
114 PCI_IO_ADDR reg;
97 epci_base = celleb_epci_get_epci_base(hose); 115 epci_base = celleb_epci_get_epci_base(hose);
98 reg = epci_base + PCI_COMMAND; 116 reg = epci_base + PCI_COMMAND;
99 out_be32(reg, in_be32(reg) | (PCI_STATUS_REC_MASTER_ABORT << 16)); 117 out_be32(reg, in_be32(reg) | (PCI_STATUS_REC_MASTER_ABORT << 16));
100} 118}
101 119
102static int celleb_epci_check_abort(struct pci_controller *hose, 120static int celleb_epci_check_abort(struct pci_controller *hose,
103 volatile void __iomem *addr) 121 PCI_IO_ADDR addr)
104{ 122{
105 volatile void __iomem *reg, *epci_base; 123 PCI_IO_ADDR reg;
124 PCI_IO_ADDR epci_base;
106 u32 val; 125 u32 val;
107 126
108 iob(); 127 iob();
@@ -132,12 +151,12 @@ static int celleb_epci_check_abort(struct pci_controller *hose,
132 return PCIBIOS_SUCCESSFUL; 151 return PCIBIOS_SUCCESSFUL;
133} 152}
134 153
135static volatile void __iomem *celleb_epci_make_config_addr( 154static PCI_IO_ADDR celleb_epci_make_config_addr(
136 struct pci_bus *bus, 155 struct pci_bus *bus,
137 struct pci_controller *hose, 156 struct pci_controller *hose,
138 unsigned int devfn, int where) 157 unsigned int devfn, int where)
139{ 158{
140 volatile void __iomem *addr; 159 PCI_IO_ADDR addr;
141 160
142 if (bus != hose->bus) 161 if (bus != hose->bus)
143 addr = celleb_epci_get_epci_cfg(hose) + 162 addr = celleb_epci_get_epci_cfg(hose) +
@@ -157,7 +176,8 @@ static volatile void __iomem *celleb_epci_make_config_addr(
157static int celleb_epci_read_config(struct pci_bus *bus, 176static int celleb_epci_read_config(struct pci_bus *bus,
158 unsigned int devfn, int where, int size, u32 * val) 177 unsigned int devfn, int where, int size, u32 * val)
159{ 178{
160 volatile void __iomem *epci_base, *addr; 179 PCI_IO_ADDR epci_base;
180 PCI_IO_ADDR addr;
161 struct device_node *node; 181 struct device_node *node;
162 struct pci_controller *hose; 182 struct pci_controller *hose;
163 183
@@ -220,7 +240,8 @@ static int celleb_epci_read_config(struct pci_bus *bus,
220static int celleb_epci_write_config(struct pci_bus *bus, 240static int celleb_epci_write_config(struct pci_bus *bus,
221 unsigned int devfn, int where, int size, u32 val) 241 unsigned int devfn, int where, int size, u32 val)
222{ 242{
223 volatile void __iomem *epci_base, *addr; 243 PCI_IO_ADDR epci_base;
244 PCI_IO_ADDR addr;
224 struct device_node *node; 245 struct device_node *node;
225 struct pci_controller *hose; 246 struct pci_controller *hose;
226 247
@@ -278,15 +299,16 @@ static int celleb_epci_write_config(struct pci_bus *bus,
278} 299}
279 300
280struct pci_ops celleb_epci_ops = { 301struct pci_ops celleb_epci_ops = {
281 celleb_epci_read_config, 302 .read = celleb_epci_read_config,
282 celleb_epci_write_config, 303 .write = celleb_epci_write_config,
283}; 304};
284 305
285/* to be moved in FW */ 306/* to be moved in FW */
286static int __devinit celleb_epci_init(struct pci_controller *hose) 307static int __init celleb_epci_init(struct pci_controller *hose)
287{ 308{
288 u32 val; 309 u32 val;
289 volatile void __iomem *reg, *epci_base; 310 PCI_IO_ADDR reg;
311 PCI_IO_ADDR epci_base;
290 int hwres = 0; 312 int hwres = 0;
291 313
292 epci_base = celleb_epci_get_epci_base(hose); 314 epci_base = celleb_epci_get_epci_base(hose);
@@ -403,7 +425,7 @@ static int __devinit celleb_epci_init(struct pci_controller *hose)
403 return 0; 425 return 0;
404} 426}
405 427
406int __devinit celleb_setup_epci(struct device_node *node, 428int __init celleb_setup_epci(struct device_node *node,
407 struct pci_controller *hose) 429 struct pci_controller *hose)
408{ 430{
409 struct resource r; 431 struct resource r;
@@ -440,10 +462,24 @@ int __devinit celleb_setup_epci(struct device_node *node,
440 r.start, (unsigned long)hose->cfg_data, 462 r.start, (unsigned long)hose->cfg_data,
441 (r.end - r.start + 1)); 463 (r.end - r.start + 1));
442 464
465 hose->private_data = kzalloc(sizeof(struct epci_private), GFP_KERNEL);
466 if (hose->private_data == NULL) {
467 printk(KERN_ERR "EPCI: no memory for private data.\n");
468 goto error;
469 }
470
471 hose->ops = &celleb_epci_ops;
443 celleb_epci_init(hose); 472 celleb_epci_init(hose);
444 473
445 return 0; 474 return 0;
446 475
447error: 476error:
477 kfree(hose->private_data);
478
479 if (hose->cfg_addr)
480 iounmap(hose->cfg_addr);
481
482 if (hose->cfg_data)
483 iounmap(hose->cfg_data);
448 return 1; 484 return 1;
449} 485}
diff --git a/arch/powerpc/platforms/celleb/scc_sio.c b/arch/powerpc/platforms/celleb/scc_sio.c
index bcd25f54d986..610008211ca1 100644
--- a/arch/powerpc/platforms/celleb/scc_sio.c
+++ b/arch/powerpc/platforms/celleb/scc_sio.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * setup serial port in SCC 2 * setup serial port in SCC
3 * 3 *
4 * (C) Copyright 2006 TOSHIBA CORPORATION 4 * (C) Copyright 2006-2007 TOSHIBA CORPORATION
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -28,58 +28,58 @@
28 28
29/* sio irq0=0xb00010022 irq0=0xb00010023 irq2=0xb00010024 29/* sio irq0=0xb00010022 irq0=0xb00010023 irq2=0xb00010024
30 mmio=0xfff000-0x1000,0xff2000-0x1000 */ 30 mmio=0xfff000-0x1000,0xff2000-0x1000 */
31static int txx9_serial_bitmap = 0; 31static int txx9_serial_bitmap __initdata = 0;
32 32
33static struct { 33static struct {
34 uint32_t offset; 34 uint32_t offset;
35 uint32_t index; 35 uint32_t index;
36} txx9_scc_tab[3] = { 36} txx9_scc_tab[3] __initdata = {
37 { 0x300, 0 }, /* 0xFFF300 */ 37 { 0x300, 0 }, /* 0xFFF300 */
38 { 0x400, 0 }, /* 0xFFF400 */ 38 { 0x400, 0 }, /* 0xFFF400 */
39 { 0x800, 1 } /* 0xFF2800 */ 39 { 0x800, 1 } /* 0xFF2800 */
40}; 40};
41 41
42static int txx9_serial_init(void) 42static int __init txx9_serial_init(void)
43{ 43{
44 extern int early_serial_txx9_setup(struct uart_port *port); 44 extern int early_serial_txx9_setup(struct uart_port *port);
45 struct device_node *node; 45 struct device_node *node = NULL;
46 int i; 46 int i;
47 struct uart_port req; 47 struct uart_port req;
48 struct of_irq irq; 48 struct of_irq irq;
49 struct resource res; 49 struct resource res;
50 50
51 node = of_find_node_by_path("/ioif1/sio"); 51 while ((node = of_find_compatible_node(node,
52 if (!node) 52 "serial", "toshiba,sio-scc")) != NULL) {
53 return 0; 53 for (i = 0; i < ARRAY_SIZE(txx9_scc_tab); i++) {
54 if (!(txx9_serial_bitmap & (1<<i)))
55 continue;
54 56
55 for(i = 0; i < sizeof(txx9_scc_tab)/sizeof(txx9_scc_tab[0]); i++) { 57 if (of_irq_map_one(node, i, &irq))
56 if (!(txx9_serial_bitmap & (1<<i))) 58 continue;
57 continue; 59 if (of_address_to_resource(node,
60 txx9_scc_tab[i].index, &res))
61 continue;
58 62
59 if (of_irq_map_one(node, i, &irq)) 63 memset(&req, 0, sizeof(req));
60 continue; 64 req.line = i;
61 if (of_address_to_resource(node, txx9_scc_tab[i].index, &res)) 65 req.iotype = UPIO_MEM;
62 continue; 66 req.mapbase = res.start + txx9_scc_tab[i].offset;
63
64 memset(&req, 0, sizeof(req));
65 req.line = i;
66 req.iotype = UPIO_MEM;
67 req.mapbase = res.start + txx9_scc_tab[i].offset;
68#ifdef CONFIG_SERIAL_TXX9_CONSOLE 67#ifdef CONFIG_SERIAL_TXX9_CONSOLE
69 req.membase = ioremap(req.mapbase, 0x24); 68 req.membase = ioremap(req.mapbase, 0x24);
70#endif 69#endif
71 req.irq = irq_create_of_mapping(irq.controller, 70 req.irq = irq_create_of_mapping(irq.controller,
72 irq.specifier, irq.size); 71 irq.specifier, irq.size);
73 req.flags |= UPF_IOREMAP | UPF_BUGGY_UART /*HAVE_CTS_LINE*/; 72 req.flags |= UPF_IOREMAP | UPF_BUGGY_UART
74 req.uartclk = 83300000; 73 /*HAVE_CTS_LINE*/;
75 early_serial_txx9_setup(&req); 74 req.uartclk = 83300000;
75 early_serial_txx9_setup(&req);
76 }
76 } 77 }
77 78
78 of_node_put(node);
79 return 0; 79 return 0;
80} 80}
81 81
82static int txx9_serial_config(char *ptr) 82static int __init txx9_serial_config(char *ptr)
83{ 83{
84 int i; 84 int i;
85 85
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
index 5e9f7f163571..0f1dddb81cd2 100644
--- a/arch/powerpc/platforms/celleb/setup.c
+++ b/arch/powerpc/platforms/celleb/setup.c
@@ -73,7 +73,7 @@ static void celleb_show_cpuinfo(struct seq_file *m)
73 of_node_put(root); 73 of_node_put(root);
74} 74}
75 75
76static int celleb_machine_type_hack(char *ptr) 76static int __init celleb_machine_type_hack(char *ptr)
77{ 77{
78 strncpy(celleb_machine_type, ptr, sizeof(celleb_machine_type)); 78 strncpy(celleb_machine_type, ptr, sizeof(celleb_machine_type));
79 celleb_machine_type[sizeof(celleb_machine_type)-1] = 0; 79 celleb_machine_type[sizeof(celleb_machine_type)-1] = 0;
@@ -111,11 +111,6 @@ static void __init celleb_setup_arch(void)
111#endif 111#endif
112} 112}
113 113
114static void beat_power_save(void)
115{
116 beat_pause(0);
117}
118
119static int __init celleb_probe(void) 114static int __init celleb_probe(void)
120{ 115{
121 unsigned long root = of_get_flat_dt_root(); 116 unsigned long root = of_get_flat_dt_root();
@@ -124,18 +119,11 @@ static int __init celleb_probe(void)
124 return 0; 119 return 0;
125 120
126 powerpc_firmware_features |= FW_FEATURE_CELLEB_POSSIBLE; 121 powerpc_firmware_features |= FW_FEATURE_CELLEB_POSSIBLE;
127 hpte_init_beat(); 122 hpte_init_beat_v3();
128 return 1; 123 return 1;
129} 124}
130 125
131#ifdef CONFIG_KEXEC 126static struct of_device_id celleb_bus_ids[] __initdata = {
132static void celleb_kexec_cpu_down(int crash, int secondary)
133{
134 beatic_deinit_IRQ();
135}
136#endif
137
138static struct of_device_id celleb_bus_ids[] = {
139 { .type = "scc", }, 127 { .type = "scc", },
140 { .type = "ioif", }, /* old style */ 128 { .type = "ioif", }, /* old style */
141 {}, 129 {},
@@ -149,6 +137,8 @@ static int __init celleb_publish_devices(void)
149 /* Publish OF platform devices for southbridge IOs */ 137 /* Publish OF platform devices for southbridge IOs */
150 of_platform_bus_probe(NULL, celleb_bus_ids, NULL); 138 of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
151 139
140 celleb_pci_workaround_init();
141
152 return 0; 142 return 0;
153} 143}
154device_initcall(celleb_publish_devices); 144device_initcall(celleb_publish_devices);
@@ -175,7 +165,7 @@ define_machine(celleb) {
175 .pci_probe_mode = celleb_pci_probe_mode, 165 .pci_probe_mode = celleb_pci_probe_mode,
176 .pci_setup_phb = celleb_setup_phb, 166 .pci_setup_phb = celleb_setup_phb,
177#ifdef CONFIG_KEXEC 167#ifdef CONFIG_KEXEC
178 .kexec_cpu_down = celleb_kexec_cpu_down, 168 .kexec_cpu_down = beat_kexec_cpu_down,
179 .machine_kexec = default_machine_kexec, 169 .machine_kexec = default_machine_kexec,
180 .machine_kexec_prepare = default_machine_kexec_prepare, 170 .machine_kexec_prepare = default_machine_kexec_prepare,
181 .machine_crash_shutdown = default_machine_crash_shutdown, 171 .machine_crash_shutdown = default_machine_crash_shutdown,
diff --git a/arch/powerpc/platforms/chrp/gg2.h b/arch/powerpc/platforms/chrp/gg2.h
new file mode 100644
index 000000000000..341ae55b99fb
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/gg2.h
@@ -0,0 +1,61 @@
1/*
2 * include/asm-ppc/gg2.h -- VLSI VAS96011/12 `Golden Gate 2' register definitions
3 *
4 * Copyright (C) 1997 Geert Uytterhoeven
5 *
6 * This file is based on the following documentation:
7 *
8 * The VAS96011/12 Chipset, Data Book, Edition 1.0
9 * VLSI Technology, Inc.
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file COPYING in the main directory of this archive
13 * for more details.
14 */
15
16#ifndef _ASMPPC_GG2_H
17#define _ASMPPC_GG2_H
18
19 /*
20 * Memory Map (CHRP mode)
21 */
22
23#define GG2_PCI_MEM_BASE 0xc0000000 /* Peripheral memory space */
24#define GG2_ISA_MEM_BASE 0xf7000000 /* Peripheral memory alias */
25#define GG2_ISA_IO_BASE 0xf8000000 /* Peripheral I/O space */
26#define GG2_PCI_CONFIG_BASE 0xfec00000 /* PCI configuration space */
27#define GG2_INT_ACK_SPECIAL 0xfec80000 /* Interrupt acknowledge and */
28 /* special PCI cycles */
29#define GG2_ROM_BASE0 0xff000000 /* ROM bank 0 */
30#define GG2_ROM_BASE1 0xff800000 /* ROM bank 1 */
31
32
33 /*
34 * GG2 specific PCI Registers
35 */
36
37extern void __iomem *gg2_pci_config_base; /* kernel virtual address */
38
39#define GG2_PCI_BUSNO 0x40 /* Bus number */
40#define GG2_PCI_SUBBUSNO 0x41 /* Subordinate bus number */
41#define GG2_PCI_DISCCTR 0x42 /* Disconnect counter */
42#define GG2_PCI_PPC_CTRL 0x50 /* PowerPC interface control register */
43#define GG2_PCI_ADDR_MAP 0x5c /* Address map */
44#define GG2_PCI_PCI_CTRL 0x60 /* PCI interface control register */
45#define GG2_PCI_ROM_CTRL 0x70 /* ROM interface control register */
46#define GG2_PCI_ROM_TIME 0x74 /* ROM timing */
47#define GG2_PCI_CC_CTRL 0x80 /* Cache controller control register */
48#define GG2_PCI_DRAM_BANK0 0x90 /* Control register for DRAM bank #0 */
49#define GG2_PCI_DRAM_BANK1 0x94 /* Control register for DRAM bank #1 */
50#define GG2_PCI_DRAM_BANK2 0x98 /* Control register for DRAM bank #2 */
51#define GG2_PCI_DRAM_BANK3 0x9c /* Control register for DRAM bank #3 */
52#define GG2_PCI_DRAM_BANK4 0xa0 /* Control register for DRAM bank #4 */
53#define GG2_PCI_DRAM_BANK5 0xa4 /* Control register for DRAM bank #5 */
54#define GG2_PCI_DRAM_TIME0 0xb0 /* Timing parameters set #0 */
55#define GG2_PCI_DRAM_TIME1 0xb4 /* Timing parameters set #1 */
56#define GG2_PCI_DRAM_CTRL 0xc0 /* DRAM control */
57#define GG2_PCI_ERR_CTRL 0xd0 /* Error control register */
58#define GG2_PCI_ERR_STATUS 0xd4 /* Error status register */
59 /* Cleared when read */
60
61#endif /* _ASMPPC_GG2_H */
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 28d1647b204e..e43465d34d29 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -13,7 +13,6 @@
13#include <asm/irq.h> 13#include <asm/irq.h>
14#include <asm/hydra.h> 14#include <asm/hydra.h>
15#include <asm/prom.h> 15#include <asm/prom.h>
16#include <asm/gg2.h>
17#include <asm/machdep.h> 16#include <asm/machdep.h>
18#include <asm/sections.h> 17#include <asm/sections.h>
19#include <asm/pci-bridge.h> 18#include <asm/pci-bridge.h>
@@ -21,6 +20,7 @@
21#include <asm/rtas.h> 20#include <asm/rtas.h>
22 21
23#include "chrp.h" 22#include "chrp.h"
23#include "gg2.h"
24 24
25/* LongTrail */ 25/* LongTrail */
26void __iomem *gg2_pci_config_base; 26void __iomem *gg2_pci_config_base;
@@ -86,8 +86,8 @@ int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
86 86
87static struct pci_ops gg2_pci_ops = 87static struct pci_ops gg2_pci_ops =
88{ 88{
89 gg2_read_config, 89 .read = gg2_read_config,
90 gg2_write_config 90 .write = gg2_write_config,
91}; 91};
92 92
93/* 93/*
@@ -124,8 +124,8 @@ int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
124 124
125static struct pci_ops rtas_pci_ops = 125static struct pci_ops rtas_pci_ops =
126{ 126{
127 rtas_read_config, 127 .read = rtas_read_config,
128 rtas_write_config 128 .write = rtas_write_config,
129}; 129};
130 130
131volatile struct Hydra __iomem *Hydra = NULL; 131volatile struct Hydra __iomem *Hydra = NULL;
@@ -338,3 +338,32 @@ void chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105)
338} 338}
339DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, 339DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
340 chrp_pci_fixup_winbond_ata); 340 chrp_pci_fixup_winbond_ata);
341
342/* Pegasos2 firmware version 20040810 configures the built-in IDE controller
343 * in legacy mode, but sets the PCI registers to PCI native mode.
344 * The chip can only operate in legacy mode, so force the PCI class into legacy
345 * mode as well. The same fixup must be done to the class-code property in
346 * the IDE node /pci@80000000/ide@C,1
347 */
348static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide)
349{
350 u8 progif;
351 struct pci_dev *viaisa;
352
353 if (!machine_is(chrp) || _chrp_type != _CHRP_Pegasos)
354 return;
355 if (viaide->irq != 14)
356 return;
357
358 viaisa = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
359 if (!viaisa)
360 return;
361 printk("Fixing VIA IDE, force legacy mode on '%s'\n", viaide->dev.bus_id);
362
363 pci_read_config_byte(viaide, PCI_CLASS_PROG, &progif);
364 pci_write_config_byte(viaide, PCI_CLASS_PROG, progif & ~0x5);
365 viaide->class &= ~0x5;
366
367 pci_dev_put(viaisa);
368}
369DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, chrp_pci_fixup_vt8231_ata);
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 373de4c063db..96498ad7b943 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -32,13 +32,11 @@
32#include <linux/seq_file.h> 32#include <linux/seq_file.h>
33#include <linux/root_dev.h> 33#include <linux/root_dev.h>
34#include <linux/initrd.h> 34#include <linux/initrd.h>
35#include <linux/module.h>
36#include <linux/timer.h> 35#include <linux/timer.h>
37 36
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
40#include <asm/prom.h> 39#include <asm/prom.h>
41#include <asm/gg2.h>
42#include <asm/pci-bridge.h> 40#include <asm/pci-bridge.h>
43#include <asm/dma.h> 41#include <asm/dma.h>
44#include <asm/machdep.h> 42#include <asm/machdep.h>
@@ -52,6 +50,7 @@
52#include <asm/xmon.h> 50#include <asm/xmon.h>
53 51
54#include "chrp.h" 52#include "chrp.h"
53#include "gg2.h"
55 54
56void rtas_indicator_progress(char *, unsigned short); 55void rtas_indicator_progress(char *, unsigned short);
57 56
diff --git a/arch/powerpc/platforms/chrp/smp.c b/arch/powerpc/platforms/chrp/smp.c
index 3ea0eb78568e..10a4a4d063b6 100644
--- a/arch/powerpc/platforms/chrp/smp.c
+++ b/arch/powerpc/platforms/chrp/smp.c
@@ -26,10 +26,8 @@
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/prom.h> 27#include <asm/prom.h>
28#include <asm/smp.h> 28#include <asm/smp.h>
29#include <asm/residual.h>
30#include <asm/time.h> 29#include <asm/time.h>
31#include <asm/machdep.h> 30#include <asm/machdep.h>
32#include <asm/smp.h>
33#include <asm/mpic.h> 31#include <asm/mpic.h>
34#include <asm/rtas.h> 32#include <asm/rtas.h>
35 33
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 2d12f77e46bc..da66103009c6 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -1,9 +1,10 @@
1choice 1config EMBEDDED6xx
2 prompt "Machine Type" 2 bool "Embedded 6xx/7xx/7xxx-based boards"
3 depends on EMBEDDED6xx 3 depends on PPC32 && BROKEN_ON_SMP && PPC_MULTIPLATFORM
4 4
5config LINKSTATION 5config LINKSTATION
6 bool "Linkstation / Kurobox(HG) from Buffalo" 6 bool "Linkstation / Kurobox(HG) from Buffalo"
7 depends on EMBEDDED6xx
7 select MPIC 8 select MPIC
8 select FSL_SOC 9 select FSL_SOC
9 select PPC_UDBG_16550 if SERIAL_8250 10 select PPC_UDBG_16550 if SERIAL_8250
@@ -17,6 +18,7 @@ config LINKSTATION
17 18
18config MPC7448HPC2 19config MPC7448HPC2
19 bool "Freescale MPC7448HPC2(Taiga)" 20 bool "Freescale MPC7448HPC2(Taiga)"
21 depends on EMBEDDED6xx
20 select TSI108_BRIDGE 22 select TSI108_BRIDGE
21 select DEFAULT_UIMAGE 23 select DEFAULT_UIMAGE
22 select PPC_UDBG_16550 24 select PPC_UDBG_16550
@@ -26,6 +28,7 @@ config MPC7448HPC2
26 28
27config PPC_HOLLY 29config PPC_HOLLY
28 bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)" 30 bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)"
31 depends on EMBEDDED6xx
29 select TSI108_BRIDGE 32 select TSI108_BRIDGE
30 select PPC_UDBG_16550 33 select PPC_UDBG_16550
31 select WANT_DEVICE_TREE 34 select WANT_DEVICE_TREE
@@ -35,12 +38,12 @@ config PPC_HOLLY
35 38
36config PPC_PRPMC2800 39config PPC_PRPMC2800
37 bool "Motorola-PrPMC2800" 40 bool "Motorola-PrPMC2800"
41 depends on EMBEDDED6xx
38 select MV64X60 42 select MV64X60
39 select NOT_COHERENT_CACHE 43 select NOT_COHERENT_CACHE
40 select WANT_DEVICE_TREE 44 select WANT_DEVICE_TREE
41 help 45 help
42 This option enables support for the Motorola PrPMC2800 board 46 This option enables support for the Motorola PrPMC2800 board
43endchoice
44 47
45config TSI108_BRIDGE 48config TSI108_BRIDGE
46 bool 49 bool
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
index 6292e36dc577..b6de2b5223dd 100644
--- a/arch/powerpc/platforms/embedded6xx/holly.c
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -113,23 +113,11 @@ static void holly_remap_bridge(void)
113 113
114static void __init holly_setup_arch(void) 114static void __init holly_setup_arch(void)
115{ 115{
116 struct device_node *cpu;
117 struct device_node *np; 116 struct device_node *np;
118 117
119 if (ppc_md.progress) 118 if (ppc_md.progress)
120 ppc_md.progress("holly_setup_arch():set_bridge", 0); 119 ppc_md.progress("holly_setup_arch():set_bridge", 0);
121 120
122 cpu = of_find_node_by_type(NULL, "cpu");
123 if (cpu) {
124 const unsigned int *fp;
125
126 fp = of_get_property(cpu, "clock-frequency", NULL);
127 if (fp)
128 loops_per_jiffy = *fp / HZ;
129 else
130 loops_per_jiffy = 50000000 / HZ;
131 of_node_put(cpu);
132 }
133 tsi108_csr_vir_base = get_vir_csrbase(); 121 tsi108_csr_vir_base = get_vir_csrbase();
134 122
135 /* setup PCI host bridge */ 123 /* setup PCI host bridge */
@@ -147,7 +135,7 @@ static void __init holly_setup_arch(void)
147} 135}
148 136
149/* 137/*
150 * Interrupt setup and service. Interrrupts on the holly come 138 * Interrupt setup and service. Interrupts on the holly come
151 * from the four external INT pins, PCI interrupts are routed via 139 * from the four external INT pins, PCI interrupts are routed via
152 * PCI interrupt control registers, it generates internal IRQ23 140 * PCI interrupt control registers, it generates internal IRQ23
153 * 141 *
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
index bd5ca58345a1..f392374309b3 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -11,16 +11,16 @@
11 */ 11 */
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/initrd.h> 14#include <linux/initrd.h>
16#include <linux/mtd/physmap.h> 15#include <linux/mtd/physmap.h>
17 16
18#include <asm/time.h> 17#include <asm/time.h>
19#include <asm/prom.h> 18#include <asm/prom.h>
20#include <asm/mpic.h> 19#include <asm/mpic.h>
21#include <asm/mpc10x.h>
22#include <asm/pci-bridge.h> 20#include <asm/pci-bridge.h>
23 21
22#include "mpc10x.h"
23
24static struct mtd_partition linkstation_physmap_partitions[] = { 24static struct mtd_partition linkstation_physmap_partitions[] = {
25 { 25 {
26 .name = "mtd_firmimg", 26 .name = "mtd_firmimg",
@@ -99,7 +99,7 @@ static void __init linkstation_setup_arch(void)
99} 99}
100 100
101/* 101/*
102 * Interrupt setup and service. Interrrupts on the linkstation come 102 * Interrupt setup and service. Interrupts on the linkstation come
103 * from the four PCI slots plus onboard 8241 devices: I2C, DUART. 103 * from the four PCI slots plus onboard 8241 devices: I2C, DUART.
104 */ 104 */
105static void __init linkstation_init_IRQ(void) 105static void __init linkstation_init_IRQ(void)
diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c b/arch/powerpc/platforms/embedded6xx/ls_uart.c
index d0bee9f19e4e..c99264cedda5 100644
--- a/arch/powerpc/platforms/embedded6xx/ls_uart.c
+++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c
@@ -1,14 +1,25 @@
1/*
2 * AVR power-management chip interface for the Buffalo Linkstation /
3 * Kurobox Platform.
4 *
5 * Author: 2006 (c) G. Liakhovetski
6 * g.liakhovetski@gmx.de
7 *
8 * This file is licensed under the terms of the GNU General Public License
9 * version 2. This program is licensed "as is" without any warranty of
10 * any kind, whether express or implied.
11 */
1#include <linux/workqueue.h> 12#include <linux/workqueue.h>
2#include <linux/string.h> 13#include <linux/string.h>
3#include <linux/delay.h> 14#include <linux/delay.h>
4#include <linux/serial_reg.h> 15#include <linux/serial_reg.h>
5#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
6#include <asm/io.h> 17#include <asm/io.h>
7#include <asm/mpc10x.h>
8#include <asm/ppc_sys.h>
9#include <asm/prom.h> 18#include <asm/prom.h>
10#include <asm/termbits.h> 19#include <asm/termbits.h>
11 20
21#include "mpc10x.h"
22
12static void __iomem *avr_addr; 23static void __iomem *avr_addr;
13static unsigned long avr_clock; 24static unsigned long avr_clock;
14 25
@@ -106,6 +117,9 @@ static int __init ls_uarts_init(void)
106 phys_addr_t phys_addr; 117 phys_addr_t phys_addr;
107 int len; 118 int len;
108 119
120 if (!machine_is(linkstation))
121 return 0;
122
109 avr = of_find_node_by_path("/soc10x/serial@80004500"); 123 avr = of_find_node_by_path("/soc10x/serial@80004500");
110 if (!avr) 124 if (!avr)
111 return -EINVAL; 125 return -EINVAL;
diff --git a/arch/powerpc/platforms/embedded6xx/mpc10x.h b/arch/powerpc/platforms/embedded6xx/mpc10x.h
new file mode 100644
index 000000000000..b30a6a3b5bd2
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/mpc10x.h
@@ -0,0 +1,180 @@
1/*
2 * Common routines for the Motorola SPS MPC106/8240/107 Host bridge/Mem
3 * ctlr/EPIC/etc.
4 *
5 * Author: Mark A. Greer
6 * mgreer@mvista.com
7 *
8 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef __PPC_KERNEL_MPC10X_H
14#define __PPC_KERNEL_MPC10X_H
15
16#include <linux/pci_ids.h>
17#include <asm/pci-bridge.h>
18
19/*
20 * The values here don't completely map everything but should work in most
21 * cases.
22 *
23 * MAP A (PReP Map)
24 * Processor: 0x80000000 - 0x807fffff -> PCI I/O: 0x00000000 - 0x007fffff
25 * Processor: 0xc0000000 - 0xdfffffff -> PCI MEM: 0x00000000 - 0x1fffffff
26 * PCI MEM: 0x80000000 -> Processor System Memory: 0x00000000
27 * EUMB mapped to: ioremap_base - 0x00100000 (ioremap_base - 1 MB)
28 *
29 * MAP B (CHRP Map)
30 * Processor: 0xfe000000 - 0xfebfffff -> PCI I/O: 0x00000000 - 0x00bfffff
31 * Processor: 0x80000000 - 0xbfffffff -> PCI MEM: 0x80000000 - 0xbfffffff
32 * PCI MEM: 0x00000000 -> Processor System Memory: 0x00000000
33 * EUMB mapped to: ioremap_base - 0x00100000 (ioremap_base - 1 MB)
34 */
35
36/*
37 * Define the vendor/device IDs for the various bridges--should be added to
38 * <linux/pci_ids.h>
39 */
40#define MPC10X_BRIDGE_106 ((PCI_DEVICE_ID_MOTOROLA_MPC106 << 16) | \
41 PCI_VENDOR_ID_MOTOROLA)
42#define MPC10X_BRIDGE_8240 ((0x0003 << 16) | PCI_VENDOR_ID_MOTOROLA)
43#define MPC10X_BRIDGE_107 ((0x0004 << 16) | PCI_VENDOR_ID_MOTOROLA)
44#define MPC10X_BRIDGE_8245 ((0x0006 << 16) | PCI_VENDOR_ID_MOTOROLA)
45
46/* Define the type of map to use */
47#define MPC10X_MEM_MAP_A 1
48#define MPC10X_MEM_MAP_B 2
49
50/* Map A (PReP Map) Defines */
51#define MPC10X_MAPA_CNFG_ADDR 0x80000cf8
52#define MPC10X_MAPA_CNFG_DATA 0x80000cfc
53
54#define MPC10X_MAPA_ISA_IO_BASE 0x80000000
55#define MPC10X_MAPA_ISA_MEM_BASE 0xc0000000
56#define MPC10X_MAPA_DRAM_OFFSET 0x80000000
57
58#define MPC10X_MAPA_PCI_INTACK_ADDR 0xbffffff0
59#define MPC10X_MAPA_PCI_IO_START 0x00000000
60#define MPC10X_MAPA_PCI_IO_END (0x00800000 - 1)
61#define MPC10X_MAPA_PCI_MEM_START 0x00000000
62#define MPC10X_MAPA_PCI_MEM_END (0x20000000 - 1)
63
64#define MPC10X_MAPA_PCI_MEM_OFFSET (MPC10X_MAPA_ISA_MEM_BASE - \
65 MPC10X_MAPA_PCI_MEM_START)
66
67/* Map B (CHRP Map) Defines */
68#define MPC10X_MAPB_CNFG_ADDR 0xfec00000
69#define MPC10X_MAPB_CNFG_DATA 0xfee00000
70
71#define MPC10X_MAPB_ISA_IO_BASE 0xfe000000
72#define MPC10X_MAPB_ISA_MEM_BASE 0x80000000
73#define MPC10X_MAPB_DRAM_OFFSET 0x00000000
74
75#define MPC10X_MAPB_PCI_INTACK_ADDR 0xfef00000
76#define MPC10X_MAPB_PCI_IO_START 0x00000000
77#define MPC10X_MAPB_PCI_IO_END (0x00c00000 - 1)
78#define MPC10X_MAPB_PCI_MEM_START 0x80000000
79#define MPC10X_MAPB_PCI_MEM_END (0xc0000000 - 1)
80
81#define MPC10X_MAPB_PCI_MEM_OFFSET (MPC10X_MAPB_ISA_MEM_BASE - \
82 MPC10X_MAPB_PCI_MEM_START)
83
84/* Set hose members to values appropriate for the mem map used */
85#define MPC10X_SETUP_HOSE(hose, map) { \
86 (hose)->pci_mem_offset = MPC10X_MAP##map##_PCI_MEM_OFFSET; \
87 (hose)->io_space.start = MPC10X_MAP##map##_PCI_IO_START; \
88 (hose)->io_space.end = MPC10X_MAP##map##_PCI_IO_END; \
89 (hose)->mem_space.start = MPC10X_MAP##map##_PCI_MEM_START; \
90 (hose)->mem_space.end = MPC10X_MAP##map##_PCI_MEM_END; \
91 (hose)->io_base_virt = (void *)MPC10X_MAP##map##_ISA_IO_BASE; \
92}
93
94
95/* Miscellaneous Configuration register offsets */
96#define MPC10X_CFG_PIR_REG 0x09
97#define MPC10X_CFG_PIR_HOST_BRIDGE 0x00
98#define MPC10X_CFG_PIR_AGENT 0x01
99
100#define MPC10X_CFG_EUMBBAR 0x78
101
102#define MPC10X_CFG_PICR1_REG 0xa8
103#define MPC10X_CFG_PICR1_ADDR_MAP_MASK 0x00010000
104#define MPC10X_CFG_PICR1_ADDR_MAP_A 0x00010000
105#define MPC10X_CFG_PICR1_ADDR_MAP_B 0x00000000
106#define MPC10X_CFG_PICR1_SPEC_PCI_RD 0x00000004
107#define MPC10X_CFG_PICR1_ST_GATH_EN 0x00000040
108
109#define MPC10X_CFG_PICR2_REG 0xac
110#define MPC10X_CFG_PICR2_COPYBACK_OPT 0x00000001
111
112#define MPC10X_CFG_MAPB_OPTIONS_REG 0xe0
113#define MPC10X_CFG_MAPB_OPTIONS_CFAE 0x80 /* CPU_FD_ALIAS_EN */
114#define MPC10X_CFG_MAPB_OPTIONS_PFAE 0x40 /* PCI_FD_ALIAS_EN */
115#define MPC10X_CFG_MAPB_OPTIONS_DR 0x20 /* DLL_RESET */
116#define MPC10X_CFG_MAPB_OPTIONS_PCICH 0x08 /* PCI_COMPATIBILITY_HOLE */
117#define MPC10X_CFG_MAPB_OPTIONS_PROCCH 0x04 /* PROC_COMPATIBILITY_HOLE */
118
119/* Define offsets for the memory controller registers in the config space */
120#define MPC10X_MCTLR_MEM_START_1 0x80 /* Banks 0-3 */
121#define MPC10X_MCTLR_MEM_START_2 0x84 /* Banks 4-7 */
122#define MPC10X_MCTLR_EXT_MEM_START_1 0x88 /* Banks 0-3 */
123#define MPC10X_MCTLR_EXT_MEM_START_2 0x8c /* Banks 4-7 */
124
125#define MPC10X_MCTLR_MEM_END_1 0x90 /* Banks 0-3 */
126#define MPC10X_MCTLR_MEM_END_2 0x94 /* Banks 4-7 */
127#define MPC10X_MCTLR_EXT_MEM_END_1 0x98 /* Banks 0-3 */
128#define MPC10X_MCTLR_EXT_MEM_END_2 0x9c /* Banks 4-7 */
129
130#define MPC10X_MCTLR_MEM_BANK_ENABLES 0xa0
131
132/* Define some offset in the EUMB */
133#define MPC10X_EUMB_SIZE 0x00100000 /* Total EUMB size (1MB) */
134
135#define MPC10X_EUMB_MU_OFFSET 0x00000000 /* Msg Unit reg offset */
136#define MPC10X_EUMB_MU_SIZE 0x00001000 /* Msg Unit reg size */
137#define MPC10X_EUMB_DMA_OFFSET 0x00001000 /* DMA Unit reg offset */
138#define MPC10X_EUMB_DMA_SIZE 0x00001000 /* DMA Unit reg size */
139#define MPC10X_EUMB_ATU_OFFSET 0x00002000 /* Addr xlate reg offset */
140#define MPC10X_EUMB_ATU_SIZE 0x00001000 /* Addr xlate reg size */
141#define MPC10X_EUMB_I2C_OFFSET 0x00003000 /* I2C Unit reg offset */
142#define MPC10X_EUMB_I2C_SIZE 0x00001000 /* I2C Unit reg size */
143#define MPC10X_EUMB_DUART_OFFSET 0x00004000 /* DUART Unit reg offset (8245) */
144#define MPC10X_EUMB_DUART_SIZE 0x00001000 /* DUART Unit reg size (8245) */
145#define MPC10X_EUMB_EPIC_OFFSET 0x00040000 /* EPIC offset in EUMB */
146#define MPC10X_EUMB_EPIC_SIZE 0x00030000 /* EPIC size */
147#define MPC10X_EUMB_PM_OFFSET 0x000fe000 /* Performance Monitor reg offset (8245) */
148#define MPC10X_EUMB_PM_SIZE 0x00001000 /* Performance Monitor reg size (8245) */
149#define MPC10X_EUMB_WP_OFFSET 0x000ff000 /* Data path diagnostic, watchpoint reg offset */
150#define MPC10X_EUMB_WP_SIZE 0x00001000 /* Data path diagnostic, watchpoint reg size */
151
152/*
153 * Define some recommended places to put the EUMB regs.
154 * For both maps, recommend putting the EUMB from 0xeff00000 to 0xefffffff.
155 */
156extern unsigned long ioremap_base;
157#define MPC10X_MAPA_EUMB_BASE (ioremap_base - MPC10X_EUMB_SIZE)
158#define MPC10X_MAPB_EUMB_BASE MPC10X_MAPA_EUMB_BASE
159
160enum ppc_sys_devices {
161 MPC10X_IIC1,
162 MPC10X_DMA0,
163 MPC10X_DMA1,
164 MPC10X_UART0,
165 MPC10X_UART1,
166 NUM_PPC_SYS_DEVS,
167};
168
169int mpc10x_bridge_init(struct pci_controller *hose,
170 uint current_map,
171 uint new_map,
172 uint phys_eumb_base);
173unsigned long mpc10x_get_mem_size(uint mem_map);
174int mpc10x_enable_store_gathering(struct pci_controller *hose);
175int mpc10x_disable_store_gathering(struct pci_controller *hose);
176
177/* For MPC107 boards that use the built-in openpic */
178void mpc10x_set_openpic(void);
179
180#endif /* __PPC_KERNEL_MPC10X_H */
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index 1e3cc69487b5..96737e5608d3 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -40,7 +40,6 @@
40#include <asm/pci-bridge.h> 40#include <asm/pci-bridge.h>
41#include <asm/reg.h> 41#include <asm/reg.h>
42#include <mm/mmu_decl.h> 42#include <mm/mmu_decl.h>
43#include "mpc7448_hpc2.h"
44#include <asm/tsi108_pci.h> 43#include <asm/tsi108_pci.h>
45#include <asm/tsi108_irq.h> 44#include <asm/tsi108_irq.h>
46#include <asm/mpic.h> 45#include <asm/mpic.h>
@@ -91,7 +90,7 @@ static void __init mpc7448_hpc2_setup_arch(void)
91} 90}
92 91
93/* 92/*
94 * Interrupt setup and service. Interrrupts on the mpc7448_hpc2 come 93 * Interrupt setup and service. Interrupts on the mpc7448_hpc2 come
95 * from the four external INT pins, PCI interrupts are routed via 94 * from the four external INT pins, PCI interrupts are routed via
96 * PCI interrupt control registers, it generates internal IRQ23 95 * PCI interrupt control registers, it generates internal IRQ23
97 * 96 *
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h
deleted file mode 100644
index f7e0e0c7f8d8..000000000000
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * mpc7448_hpc2.h
3 *
4 * Definitions for Freescale MPC7448_HPC2 platform
5 *
6 * Author: Jacob Pan
7 * jacob.pan@freescale.com
8 * Maintainer: Roy Zang <roy.zang@freescale.com>
9 *
10 * 2006 (c) Freescale Semiconductor, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16#ifndef __PPC_PLATFORMS_MPC7448_HPC2_H
17#define __PPC_PLATFORMS_MPC7448_HPC2_H
18
19#include <asm/ppcboot.h>
20
21#endif /* __PPC_PLATFORMS_MPC7448_HPC2_H */
diff --git a/arch/powerpc/platforms/embedded6xx/prpmc2800.c b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
index 53420951dc53..e484cac75095 100644
--- a/arch/powerpc/platforms/embedded6xx/prpmc2800.c
+++ b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
@@ -44,7 +44,6 @@ static void __init prpmc2800_setup_arch(void)
44 struct device_node *np; 44 struct device_node *np;
45 phys_addr_t paddr; 45 phys_addr_t paddr;
46 const unsigned int *reg; 46 const unsigned int *reg;
47 const unsigned int *prop;
48 47
49 /* 48 /*
50 * ioremap mpp and gpp registers in case they are later 49 * ioremap mpp and gpp registers in case they are later
@@ -62,12 +61,6 @@ static void __init prpmc2800_setup_arch(void)
62 of_node_put(np); 61 of_node_put(np);
63 mv64x60_gpp_reg_base = ioremap(paddr, reg[1]); 62 mv64x60_gpp_reg_base = ioremap(paddr, reg[1]);
64 63
65 np = of_find_node_by_type(NULL, "cpu");
66 prop = of_get_property(np, "clock-frequency", NULL);
67 if (prop)
68 loops_per_jiffy = *prop / HZ;
69 of_node_put(np);
70
71#ifdef CONFIG_PCI 64#ifdef CONFIG_PCI
72 mv64x60_pci_init(); 65 mv64x60_pci_init();
73#endif 66#endif
@@ -158,6 +151,7 @@ define_machine(prpmc2800){
158 .name = prpmc2800_platform_name, 151 .name = prpmc2800_platform_name,
159 .probe = prpmc2800_probe, 152 .probe = prpmc2800_probe,
160 .setup_arch = prpmc2800_setup_arch, 153 .setup_arch = prpmc2800_setup_arch,
154 .init_early = mv64x60_init_early,
161 .show_cpuinfo = prpmc2800_show_cpuinfo, 155 .show_cpuinfo = prpmc2800_show_cpuinfo,
162 .init_IRQ = mv64x60_init_irq, 156 .init_IRQ = mv64x60_init_irq,
163 .get_irq = mv64x60_get_irq, 157 .get_irq = mv64x60_get_irq,
diff --git a/arch/powerpc/platforms/iseries/Makefile b/arch/powerpc/platforms/iseries/Makefile
index 13ac3015d91c..60db509638f1 100644
--- a/arch/powerpc/platforms/iseries/Makefile
+++ b/arch/powerpc/platforms/iseries/Makefile
@@ -2,6 +2,7 @@ EXTRA_CFLAGS += -mno-minimal-toc
2 2
3extra-y += dt.o 3extra-y += dt.o
4 4
5obj-y += exception.o
5obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt_mod.o mf.o lpevents.o \ 6obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt_mod.o mf.o lpevents.o \
6 hvcall.o proc.o htab.o iommu.o misc.o irq.o 7 hvcall.o proc.o htab.o iommu.o misc.o irq.o
7obj-$(CONFIG_PCI) += pci.o vpdinfo.o 8obj-$(CONFIG_PCI) += pci.o vpdinfo.o
diff --git a/arch/powerpc/platforms/iseries/exception.S b/arch/powerpc/platforms/iseries/exception.S
new file mode 100644
index 000000000000..5381038f0881
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/exception.S
@@ -0,0 +1,251 @@
1/*
2 * Low level routines for legacy iSeries support.
3 *
4 * Extracted from head_64.S
5 *
6 * PowerPC version
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 *
9 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
10 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
11 * Adapted for Power Macintosh by Paul Mackerras.
12 * Low-level exception handlers and MMU support
13 * rewritten by Paul Mackerras.
14 * Copyright (C) 1996 Paul Mackerras.
15 *
16 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
17 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com
18 *
19 * This file contains the low-level support and setup for the
20 * PowerPC-64 platform, including trap and interrupt dispatch.
21 *
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * as published by the Free Software Foundation; either version
25 * 2 of the License, or (at your option) any later version.
26 */
27
28#include <asm/reg.h>
29#include <asm/ppc_asm.h>
30#include <asm/asm-offsets.h>
31#include <asm/thread_info.h>
32#include <asm/ptrace.h>
33#include <asm/cputable.h>
34
35#include "exception.h"
36
37 .text
38
39 .globl system_reset_iSeries
40system_reset_iSeries:
41 mfspr r13,SPRN_SPRG3 /* Get paca address */
42 mfmsr r24
43 ori r24,r24,MSR_RI
44 mtmsrd r24 /* RI on */
45 lhz r24,PACAPACAINDEX(r13) /* Get processor # */
46 cmpwi 0,r24,0 /* Are we processor 0? */
47 bne 1f
48 b .__start_initialization_iSeries /* Start up the first processor */
491: mfspr r4,SPRN_CTRLF
50 li r5,CTRL_RUNLATCH /* Turn off the run light */
51 andc r4,r4,r5
52 mtspr SPRN_CTRLT,r4
53
541:
55 HMT_LOW
56#ifdef CONFIG_SMP
57 lbz r23,PACAPROCSTART(r13) /* Test if this processor
58 * should start */
59 sync
60 LOAD_REG_IMMEDIATE(r3,current_set)
61 sldi r28,r24,3 /* get current_set[cpu#] */
62 ldx r3,r3,r28
63 addi r1,r3,THREAD_SIZE
64 subi r1,r1,STACK_FRAME_OVERHEAD
65
66 cmpwi 0,r23,0
67 beq iSeries_secondary_smp_loop /* Loop until told to go */
68 b __secondary_start /* Loop until told to go */
69iSeries_secondary_smp_loop:
70 /* Let the Hypervisor know we are alive */
71 /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
72 lis r3,0x8002
73 rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */
74#else /* CONFIG_SMP */
75 /* Yield the processor. This is required for non-SMP kernels
76 which are running on multi-threaded machines. */
77 lis r3,0x8000
78 rldicr r3,r3,32,15 /* r3 = (r3 << 32) & 0xffff000000000000 */
79 addi r3,r3,18 /* r3 = 0x8000000000000012 which is "yield" */
80 li r4,0 /* "yield timed" */
81 li r5,-1 /* "yield forever" */
82#endif /* CONFIG_SMP */
83 li r0,-1 /* r0=-1 indicates a Hypervisor call */
84 sc /* Invoke the hypervisor via a system call */
85 mfspr r13,SPRN_SPRG3 /* Put r13 back ???? */
86 b 1b /* If SMP not configured, secondaries
87 * loop forever */
88
89/*** ISeries-LPAR interrupt handlers ***/
90
91 STD_EXCEPTION_ISERIES(machine_check, PACA_EXMC)
92
93 .globl data_access_iSeries
94data_access_iSeries:
95 mtspr SPRN_SPRG1,r13
96BEGIN_FTR_SECTION
97 mtspr SPRN_SPRG2,r12
98 mfspr r13,SPRN_DAR
99 mfspr r12,SPRN_DSISR
100 srdi r13,r13,60
101 rlwimi r13,r12,16,0x20
102 mfcr r12
103 cmpwi r13,0x2c
104 beq .do_stab_bolted_iSeries
105 mtcrf 0x80,r12
106 mfspr r12,SPRN_SPRG2
107END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
108 EXCEPTION_PROLOG_1(PACA_EXGEN)
109 EXCEPTION_PROLOG_ISERIES_1
110 b data_access_common
111
112.do_stab_bolted_iSeries:
113 mtcrf 0x80,r12
114 mfspr r12,SPRN_SPRG2
115 EXCEPTION_PROLOG_1(PACA_EXSLB)
116 EXCEPTION_PROLOG_ISERIES_1
117 b .do_stab_bolted
118
119 .globl data_access_slb_iSeries
120data_access_slb_iSeries:
121 mtspr SPRN_SPRG1,r13 /* save r13 */
122 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
123 std r3,PACA_EXSLB+EX_R3(r13)
124 mfspr r3,SPRN_DAR
125 std r9,PACA_EXSLB+EX_R9(r13)
126 mfcr r9
127#ifdef __DISABLED__
128 cmpdi r3,0
129 bge slb_miss_user_iseries
130#endif
131 std r10,PACA_EXSLB+EX_R10(r13)
132 std r11,PACA_EXSLB+EX_R11(r13)
133 std r12,PACA_EXSLB+EX_R12(r13)
134 mfspr r10,SPRN_SPRG1
135 std r10,PACA_EXSLB+EX_R13(r13)
136 ld r12,PACALPPACAPTR(r13)
137 ld r12,LPPACASRR1(r12)
138 b .slb_miss_realmode
139
140 STD_EXCEPTION_ISERIES(instruction_access, PACA_EXGEN)
141
142 .globl instruction_access_slb_iSeries
143instruction_access_slb_iSeries:
144 mtspr SPRN_SPRG1,r13 /* save r13 */
145 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
146 std r3,PACA_EXSLB+EX_R3(r13)
147 ld r3,PACALPPACAPTR(r13)
148 ld r3,LPPACASRR0(r3) /* get SRR0 value */
149 std r9,PACA_EXSLB+EX_R9(r13)
150 mfcr r9
151#ifdef __DISABLED__
152 cmpdi r3,0
153 bge slb_miss_user_iseries
154#endif
155 std r10,PACA_EXSLB+EX_R10(r13)
156 std r11,PACA_EXSLB+EX_R11(r13)
157 std r12,PACA_EXSLB+EX_R12(r13)
158 mfspr r10,SPRN_SPRG1
159 std r10,PACA_EXSLB+EX_R13(r13)
160 ld r12,PACALPPACAPTR(r13)
161 ld r12,LPPACASRR1(r12)
162 b .slb_miss_realmode
163
164#ifdef __DISABLED__
165slb_miss_user_iseries:
166 std r10,PACA_EXGEN+EX_R10(r13)
167 std r11,PACA_EXGEN+EX_R11(r13)
168 std r12,PACA_EXGEN+EX_R12(r13)
169 mfspr r10,SPRG1
170 ld r11,PACA_EXSLB+EX_R9(r13)
171 ld r12,PACA_EXSLB+EX_R3(r13)
172 std r10,PACA_EXGEN+EX_R13(r13)
173 std r11,PACA_EXGEN+EX_R9(r13)
174 std r12,PACA_EXGEN+EX_R3(r13)
175 EXCEPTION_PROLOG_ISERIES_1
176 b slb_miss_user_common
177#endif
178
179 MASKABLE_EXCEPTION_ISERIES(hardware_interrupt)
180 STD_EXCEPTION_ISERIES(alignment, PACA_EXGEN)
181 STD_EXCEPTION_ISERIES(program_check, PACA_EXGEN)
182 STD_EXCEPTION_ISERIES(fp_unavailable, PACA_EXGEN)
183 MASKABLE_EXCEPTION_ISERIES(decrementer)
184 STD_EXCEPTION_ISERIES(trap_0a, PACA_EXGEN)
185 STD_EXCEPTION_ISERIES(trap_0b, PACA_EXGEN)
186
187 .globl system_call_iSeries
188system_call_iSeries:
189 mr r9,r13
190 mfspr r13,SPRN_SPRG3
191 EXCEPTION_PROLOG_ISERIES_1
192 b system_call_common
193
194 STD_EXCEPTION_ISERIES(single_step, PACA_EXGEN)
195 STD_EXCEPTION_ISERIES(trap_0e, PACA_EXGEN)
196 STD_EXCEPTION_ISERIES(performance_monitor, PACA_EXGEN)
197
198decrementer_iSeries_masked:
199 /* We may not have a valid TOC pointer in here. */
200 li r11,1
201 ld r12,PACALPPACAPTR(r13)
202 stb r11,LPPACADECRINT(r12)
203 LOAD_REG_IMMEDIATE(r12, tb_ticks_per_jiffy)
204 lwz r12,0(r12)
205 mtspr SPRN_DEC,r12
206 /* fall through */
207
208hardware_interrupt_iSeries_masked:
209 mtcrf 0x80,r9 /* Restore regs */
210 ld r12,PACALPPACAPTR(r13)
211 ld r11,LPPACASRR0(r12)
212 ld r12,LPPACASRR1(r12)
213 mtspr SPRN_SRR0,r11
214 mtspr SPRN_SRR1,r12
215 ld r9,PACA_EXGEN+EX_R9(r13)
216 ld r10,PACA_EXGEN+EX_R10(r13)
217 ld r11,PACA_EXGEN+EX_R11(r13)
218 ld r12,PACA_EXGEN+EX_R12(r13)
219 ld r13,PACA_EXGEN+EX_R13(r13)
220 rfid
221 b . /* prevent speculative execution */
222
223_INIT_STATIC(__start_initialization_iSeries)
224 /* Clear out the BSS */
225 LOAD_REG_IMMEDIATE(r11,__bss_stop)
226 LOAD_REG_IMMEDIATE(r8,__bss_start)
227 sub r11,r11,r8 /* bss size */
228 addi r11,r11,7 /* round up to an even double word */
229 rldicl. r11,r11,61,3 /* shift right by 3 */
230 beq 4f
231 addi r8,r8,-8
232 li r0,0
233 mtctr r11 /* zero this many doublewords */
2343: stdu r0,8(r8)
235 bdnz 3b
2364:
237 LOAD_REG_IMMEDIATE(r1,init_thread_union)
238 addi r1,r1,THREAD_SIZE
239 li r0,0
240 stdu r0,-STACK_FRAME_OVERHEAD(r1)
241
242 LOAD_REG_IMMEDIATE(r2,__toc_start)
243 addi r2,r2,0x4000
244 addi r2,r2,0x4000
245
246 bl .iSeries_early_setup
247 bl .early_setup
248
249 /* relocation is on at this point */
250
251 b .start_here_common
diff --git a/arch/powerpc/platforms/iseries/exception.h b/arch/powerpc/platforms/iseries/exception.h
new file mode 100644
index 000000000000..ced45a8fa1aa
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/exception.h
@@ -0,0 +1,58 @@
1#ifndef _ASM_POWERPC_ISERIES_EXCEPTION_H
2#define _ASM_POWERPC_ISERIES_EXCEPTION_H
3/*
4 * Extracted from head_64.S
5 *
6 * PowerPC version
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 *
9 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
10 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
11 * Adapted for Power Macintosh by Paul Mackerras.
12 * Low-level exception handlers and MMU support
13 * rewritten by Paul Mackerras.
14 * Copyright (C) 1996 Paul Mackerras.
15 *
16 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
17 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com
18 *
19 * This file contains the low-level support and setup for the
20 * PowerPC-64 platform, including trap and interrupt dispatch.
21 *
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * as published by the Free Software Foundation; either version
25 * 2 of the License, or (at your option) any later version.
26 */
27#include <asm/exception.h>
28
29#define EXCEPTION_PROLOG_ISERIES_1 \
30 mfmsr r10; \
31 ld r12,PACALPPACAPTR(r13); \
32 ld r11,LPPACASRR0(r12); \
33 ld r12,LPPACASRR1(r12); \
34 ori r10,r10,MSR_RI; \
35 mtmsrd r10,1
36
37#define STD_EXCEPTION_ISERIES(label, area) \
38 .globl label##_iSeries; \
39label##_iSeries: \
40 HMT_MEDIUM; \
41 mtspr SPRN_SPRG1,r13; /* save r13 */ \
42 EXCEPTION_PROLOG_1(area); \
43 EXCEPTION_PROLOG_ISERIES_1; \
44 b label##_common
45
46#define MASKABLE_EXCEPTION_ISERIES(label) \
47 .globl label##_iSeries; \
48label##_iSeries: \
49 HMT_MEDIUM; \
50 mtspr SPRN_SPRG1,r13; /* save r13 */ \
51 EXCEPTION_PROLOG_1(PACA_EXGEN); \
52 lbz r10,PACASOFTIRQEN(r13); \
53 cmpwi 0,r10,0; \
54 beq- label##_iSeries_masked; \
55 EXCEPTION_PROLOG_ISERIES_1; \
56 b label##_common; \
57
58#endif /* _ASM_POWERPC_ISERIES_EXCEPTION_H */
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 63b33675848b..701d9297c207 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -346,8 +346,15 @@ static int iseries_irq_host_map(struct irq_host *h, unsigned int virq,
346 return 0; 346 return 0;
347} 347}
348 348
349static int iseries_irq_host_match(struct irq_host *h, struct device_node *np)
350{
351 /* Match all */
352 return 1;
353}
354
349static struct irq_host_ops iseries_irq_host_ops = { 355static struct irq_host_ops iseries_irq_host_ops = {
350 .map = iseries_irq_host_map, 356 .map = iseries_irq_host_map,
357 .match = iseries_irq_host_match,
351}; 358};
352 359
353/* 360/*
@@ -369,7 +376,8 @@ void __init iSeries_init_IRQ(void)
369 /* Create irq host. No need for a revmap since HV will give us 376 /* Create irq host. No need for a revmap since HV will give us
370 * back our virtual irq number 377 * back our virtual irq number
371 */ 378 */
372 host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, &iseries_irq_host_ops, 0); 379 host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0,
380 &iseries_irq_host_ops, 0);
373 BUG_ON(host == NULL); 381 BUG_ON(host == NULL);
374 irq_set_default_host(host); 382 irq_set_default_host(host);
375 383
diff --git a/arch/powerpc/platforms/iseries/it_lp_naca.h b/arch/powerpc/platforms/iseries/it_lp_naca.h
index 9bbf58986819..cf6dcf6ef07b 100644
--- a/arch/powerpc/platforms/iseries/it_lp_naca.h
+++ b/arch/powerpc/platforms/iseries/it_lp_naca.h
@@ -60,7 +60,7 @@ struct ItLpNaca {
60 u8 xRsvd2_0[128]; // Reserved x00-x7F 60 u8 xRsvd2_0[128]; // Reserved x00-x7F
61 61
62// CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators 62// CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators
63// NB: Padding required to keep xInterrruptHdlr at x300 which is required 63// NB: Padding required to keep xInterruptHdlr at x300 which is required
64// for v4r4 PLIC. 64// for v4r4 PLIC.
65 u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F 65 u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F
66 u8 xRsvd3_0[384]; // Reserved 180-2FF 66 u8 xRsvd3_0[384]; // Reserved 180-2FF
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 13a8b1908ded..fad493e29d37 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -41,7 +41,6 @@
41#include <asm/time.h> 41#include <asm/time.h>
42#include <asm/paca.h> 42#include <asm/paca.h>
43#include <asm/cache.h> 43#include <asm/cache.h>
44#include <asm/sections.h>
45#include <asm/abs_addr.h> 44#include <asm/abs_addr.h>
46#include <asm/iseries/hv_lp_config.h> 45#include <asm/iseries/hv_lp_config.h>
47#include <asm/iseries/hv_call_event.h> 46#include <asm/iseries/hv_call_event.h>
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index 2542403288f9..771ed0cf29a5 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -169,15 +169,12 @@ static int u3_agp_write_config(struct pci_bus *bus, unsigned int devfn,
169 switch (len) { 169 switch (len) {
170 case 1: 170 case 1:
171 out_8(addr, val); 171 out_8(addr, val);
172 (void) in_8(addr);
173 break; 172 break;
174 case 2: 173 case 2:
175 out_le16(addr, val); 174 out_le16(addr, val);
176 (void) in_le16(addr);
177 break; 175 break;
178 default: 176 default:
179 out_le32(addr, val); 177 out_le32(addr, val);
180 (void) in_le32(addr);
181 break; 178 break;
182 } 179 }
183 return PCIBIOS_SUCCESSFUL; 180 return PCIBIOS_SUCCESSFUL;
@@ -185,8 +182,8 @@ static int u3_agp_write_config(struct pci_bus *bus, unsigned int devfn,
185 182
186static struct pci_ops u3_agp_pci_ops = 183static struct pci_ops u3_agp_pci_ops =
187{ 184{
188 u3_agp_read_config, 185 .read = u3_agp_read_config,
189 u3_agp_write_config 186 .write = u3_agp_write_config,
190}; 187};
191 188
192static unsigned long u3_ht_cfa0(u8 devfn, u8 off) 189static unsigned long u3_ht_cfa0(u8 devfn, u8 off)
@@ -268,15 +265,12 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
268 switch (len) { 265 switch (len) {
269 case 1: 266 case 1:
270 out_8(addr, val); 267 out_8(addr, val);
271 (void) in_8(addr);
272 break; 268 break;
273 case 2: 269 case 2:
274 out_le16(addr, val); 270 out_le16(addr, val);
275 (void) in_le16(addr);
276 break; 271 break;
277 default: 272 default:
278 out_le32(addr, val); 273 out_le32(addr, val);
279 (void) in_le32(addr);
280 break; 274 break;
281 } 275 }
282 return PCIBIOS_SUCCESSFUL; 276 return PCIBIOS_SUCCESSFUL;
@@ -284,8 +278,8 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
284 278
285static struct pci_ops u3_ht_pci_ops = 279static struct pci_ops u3_ht_pci_ops =
286{ 280{
287 u3_ht_read_config, 281 .read = u3_ht_read_config,
288 u3_ht_write_config 282 .write = u3_ht_write_config,
289}; 283};
290 284
291static unsigned int u4_pcie_cfa0(unsigned int devfn, unsigned int off) 285static unsigned int u4_pcie_cfa0(unsigned int devfn, unsigned int off)
@@ -376,15 +370,12 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
376 switch (len) { 370 switch (len) {
377 case 1: 371 case 1:
378 out_8(addr, val); 372 out_8(addr, val);
379 (void) in_8(addr);
380 break; 373 break;
381 case 2: 374 case 2:
382 out_le16(addr, val); 375 out_le16(addr, val);
383 (void) in_le16(addr);
384 break; 376 break;
385 default: 377 default:
386 out_le32(addr, val); 378 out_le32(addr, val);
387 (void) in_le32(addr);
388 break; 379 break;
389 } 380 }
390 return PCIBIOS_SUCCESSFUL; 381 return PCIBIOS_SUCCESSFUL;
@@ -392,8 +383,8 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
392 383
393static struct pci_ops u4_pcie_pci_ops = 384static struct pci_ops u4_pcie_pci_ops =
394{ 385{
395 u4_pcie_read_config, 386 .read = u4_pcie_read_config,
396 u4_pcie_write_config 387 .write = u4_pcie_write_config,
397}; 388};
398 389
399static void __init setup_u3_agp(struct pci_controller* hose) 390static void __init setup_u3_agp(struct pci_controller* hose)
diff --git a/arch/powerpc/platforms/pasemi/Kconfig b/arch/powerpc/platforms/pasemi/Kconfig
index 95cd90fd81c7..117d90aa5008 100644
--- a/arch/powerpc/platforms/pasemi/Kconfig
+++ b/arch/powerpc/platforms/pasemi/Kconfig
@@ -5,6 +5,7 @@ config PPC_PASEMI
5 select MPIC 5 select MPIC
6 select PPC_UDBG_16550 6 select PPC_UDBG_16550
7 select PPC_NATIVE 7 select PPC_NATIVE
8 select MPIC_BROKEN_REGREAD
8 help 9 help
9 This option enables support for PA Semi's PWRficient line 10 This option enables support for PA Semi's PWRficient line
10 of SoC processors, including PA6T-1682M 11 of SoC processors, including PA6T-1682M
diff --git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c
index 3c962d5757be..d8e1fcc78513 100644
--- a/arch/powerpc/platforms/pasemi/idle.c
+++ b/arch/powerpc/platforms/pasemi/idle.c
@@ -72,8 +72,11 @@ static int pasemi_system_reset_exception(struct pt_regs *regs)
72 return 1; 72 return 1;
73} 73}
74 74
75void __init pasemi_idle_init(void) 75static int __init pasemi_idle_init(void)
76{ 76{
77 if (!machine_is(pasemi))
78 return -ENODEV;
79
77#ifndef CONFIG_PPC_PASEMI_CPUFREQ 80#ifndef CONFIG_PPC_PASEMI_CPUFREQ
78 printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n"); 81 printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n");
79 current_mode = 0; 82 current_mode = 0;
@@ -82,7 +85,10 @@ void __init pasemi_idle_init(void)
82 ppc_md.system_reset_exception = pasemi_system_reset_exception; 85 ppc_md.system_reset_exception = pasemi_system_reset_exception;
83 ppc_md.power_save = modes[current_mode].entry; 86 ppc_md.power_save = modes[current_mode].entry;
84 printk(KERN_INFO "Using PA6T idle loop (%s)\n", modes[current_mode].name); 87 printk(KERN_INFO "Using PA6T idle loop (%s)\n", modes[current_mode].name);
88
89 return 0;
85} 90}
91late_initcall(pasemi_idle_init);
86 92
87static int __init idle_param(char *p) 93static int __init idle_param(char *p)
88{ 94{
diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c
index 9014d55c717b..6c42787fb382 100644
--- a/arch/powerpc/platforms/pasemi/iommu.c
+++ b/arch/powerpc/platforms/pasemi/iommu.c
@@ -187,7 +187,7 @@ static void pci_dma_dev_setup_pasemi(struct pci_dev *dev)
187static void pci_dma_bus_setup_null(struct pci_bus *b) { } 187static void pci_dma_bus_setup_null(struct pci_bus *b) { }
188static void pci_dma_dev_setup_null(struct pci_dev *d) { } 188static void pci_dma_dev_setup_null(struct pci_dev *d) { }
189 189
190int iob_init(struct device_node *dn) 190int __init iob_init(struct device_node *dn)
191{ 191{
192 unsigned long tmp; 192 unsigned long tmp;
193 u32 regword; 193 u32 regword;
@@ -233,7 +233,7 @@ int iob_init(struct device_node *dn)
233 233
234 234
235/* These are called very early. */ 235/* These are called very early. */
236void iommu_init_early_pasemi(void) 236void __init iommu_init_early_pasemi(void)
237{ 237{
238 int iommu_off; 238 int iommu_off;
239 239
diff --git a/arch/powerpc/platforms/pasemi/pasemi.h b/arch/powerpc/platforms/pasemi/pasemi.h
index be8495497611..516acabb4e96 100644
--- a/arch/powerpc/platforms/pasemi/pasemi.h
+++ b/arch/powerpc/platforms/pasemi/pasemi.h
@@ -6,9 +6,9 @@ extern void pas_pci_init(void);
6extern void __devinit pas_pci_irq_fixup(struct pci_dev *dev); 6extern void __devinit pas_pci_irq_fixup(struct pci_dev *dev);
7extern void __devinit pas_pci_dma_dev_setup(struct pci_dev *dev); 7extern void __devinit pas_pci_dma_dev_setup(struct pci_dev *dev);
8 8
9extern void __init alloc_iobmap_l2(void); 9extern void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset);
10 10
11extern void __init pasemi_idle_init(void); 11extern void __init alloc_iobmap_l2(void);
12 12
13/* Power savings modes, implemented in asm */ 13/* Power savings modes, implemented in asm */
14extern void idle_spin(void); 14extern void idle_spin(void);
diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index ab1f5f62bcd8..b6a0ec45c695 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -51,6 +51,61 @@ static void volatile __iomem *pa_pxp_cfg_addr(struct pci_controller *hose,
51 return hose->cfg_data + PA_PXP_CFA(bus, devfn, offset); 51 return hose->cfg_data + PA_PXP_CFA(bus, devfn, offset);
52} 52}
53 53
54static inline int is_root_port(int busno, int devfn)
55{
56 return ((busno == 0) && (PCI_FUNC(devfn) < 4) &&
57 ((PCI_SLOT(devfn) == 16) || (PCI_SLOT(devfn) == 17)));
58}
59
60static inline int is_5945_reg(int reg)
61{
62 return (((reg >= 0x18) && (reg < 0x34)) ||
63 ((reg >= 0x158) && (reg < 0x178)));
64}
65
66static int workaround_5945(struct pci_bus *bus, unsigned int devfn,
67 int offset, int len, u32 *val)
68{
69 struct pci_controller *hose;
70 void volatile __iomem *addr, *dummy;
71 int byte;
72 u32 tmp;
73
74 if (!is_root_port(bus->number, devfn) || !is_5945_reg(offset))
75 return 0;
76
77 hose = pci_bus_to_host(bus);
78
79 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset & ~0x3);
80 byte = offset & 0x3;
81
82 /* Workaround bug 5945: write 0 to a dummy register before reading,
83 * and write back what we read. We must read/write the full 32-bit
84 * contents so we need to shift and mask by hand.
85 */
86 dummy = pa_pxp_cfg_addr(hose, bus->number, devfn, 0x10);
87 out_le32(dummy, 0);
88 tmp = in_le32(addr);
89 out_le32(addr, tmp);
90
91 switch (len) {
92 case 1:
93 *val = (tmp >> (8*byte)) & 0xff;
94 break;
95 case 2:
96 if (byte == 0)
97 *val = tmp & 0xffff;
98 else
99 *val = (tmp >> 16) & 0xffff;
100 break;
101 default:
102 *val = tmp;
103 break;
104 }
105
106 return 1;
107}
108
54static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn, 109static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn,
55 int offset, int len, u32 *val) 110 int offset, int len, u32 *val)
56{ 111{
@@ -64,6 +119,9 @@ static int pa_pxp_read_config(struct pci_bus *bus, unsigned int devfn,
64 if (!pa_pxp_offset_valid(bus->number, devfn, offset)) 119 if (!pa_pxp_offset_valid(bus->number, devfn, offset))
65 return PCIBIOS_BAD_REGISTER_NUMBER; 120 return PCIBIOS_BAD_REGISTER_NUMBER;
66 121
122 if (workaround_5945(bus, devfn, offset, len, val))
123 return PCIBIOS_SUCCESSFUL;
124
67 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset); 125 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset);
68 126
69 /* 127 /*
@@ -107,23 +165,20 @@ static int pa_pxp_write_config(struct pci_bus *bus, unsigned int devfn,
107 switch (len) { 165 switch (len) {
108 case 1: 166 case 1:
109 out_8(addr, val); 167 out_8(addr, val);
110 (void) in_8(addr);
111 break; 168 break;
112 case 2: 169 case 2:
113 out_le16(addr, val); 170 out_le16(addr, val);
114 (void) in_le16(addr);
115 break; 171 break;
116 default: 172 default:
117 out_le32(addr, val); 173 out_le32(addr, val);
118 (void) in_le32(addr);
119 break; 174 break;
120 } 175 }
121 return PCIBIOS_SUCCESSFUL; 176 return PCIBIOS_SUCCESSFUL;
122} 177}
123 178
124static struct pci_ops pa_pxp_ops = { 179static struct pci_ops pa_pxp_ops = {
125 pa_pxp_read_config, 180 .read = pa_pxp_read_config,
126 pa_pxp_write_config, 181 .write = pa_pxp_write_config,
127}; 182};
128 183
129static void __init setup_pa_pxp(struct pci_controller *hose) 184static void __init setup_pa_pxp(struct pci_controller *hose)
@@ -178,3 +233,12 @@ void __init pas_pci_init(void)
178 /* Use the common resource allocation mechanism */ 233 /* Use the common resource allocation mechanism */
179 pci_probe_only = 1; 234 pci_probe_only = 1;
180} 235}
236
237void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)
238{
239 struct pci_controller *hose;
240
241 hose = pci_bus_to_host(dev->bus);
242
243 return (void __iomem *)pa_pxp_cfg_addr(hose, dev->bus->number, dev->devfn, offset);
244}
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index ffe6528048b5..5ddf40a66ae8 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -39,8 +39,21 @@
39 39
40#include "pasemi.h" 40#include "pasemi.h"
41 41
42/* SDC reset register, must be pre-mapped at reset time */
42static void __iomem *reset_reg; 43static void __iomem *reset_reg;
43 44
45/* Various error status registers, must be pre-mapped at MCE time */
46
47#define MAX_MCE_REGS 32
48struct mce_regs {
49 char *name;
50 void __iomem *addr;
51};
52
53static struct mce_regs mce_regs[MAX_MCE_REGS];
54static int num_mce_regs;
55
56
44static void pas_restart(char *cmd) 57static void pas_restart(char *cmd)
45{ 58{
46 printk("Restarting...\n"); 59 printk("Restarting...\n");
@@ -50,26 +63,30 @@ static void pas_restart(char *cmd)
50 63
51#ifdef CONFIG_SMP 64#ifdef CONFIG_SMP
52static DEFINE_SPINLOCK(timebase_lock); 65static DEFINE_SPINLOCK(timebase_lock);
66static unsigned long timebase;
53 67
54static void __devinit pas_give_timebase(void) 68static void __devinit pas_give_timebase(void)
55{ 69{
56 unsigned long tb;
57
58 spin_lock(&timebase_lock); 70 spin_lock(&timebase_lock);
59 mtspr(SPRN_TBCTL, TBCTL_FREEZE); 71 mtspr(SPRN_TBCTL, TBCTL_FREEZE);
60 tb = mftb(); 72 isync();
61 mtspr(SPRN_TBCTL, TBCTL_UPDATE_LOWER | (tb & 0xffffffff)); 73 timebase = get_tb();
62 mtspr(SPRN_TBCTL, TBCTL_UPDATE_UPPER | (tb >> 32));
63 mtspr(SPRN_TBCTL, TBCTL_RESTART);
64 spin_unlock(&timebase_lock); 74 spin_unlock(&timebase_lock);
65 pr_debug("pas_give_timebase: cpu %d gave tb %lx\n", 75
66 smp_processor_id(), tb); 76 while (timebase)
77 barrier();
78 mtspr(SPRN_TBCTL, TBCTL_RESTART);
67} 79}
68 80
69static void __devinit pas_take_timebase(void) 81static void __devinit pas_take_timebase(void)
70{ 82{
71 pr_debug("pas_take_timebase: cpu %d has tb %lx\n", 83 while (!timebase)
72 smp_processor_id(), mftb()); 84 smp_rmb();
85
86 spin_lock(&timebase_lock);
87 set_tb(timebase >> 32, timebase & 0xffffffff);
88 timebase = 0;
89 spin_unlock(&timebase_lock);
73} 90}
74 91
75struct smp_ops_t pas_smp_ops = { 92struct smp_ops_t pas_smp_ops = {
@@ -98,9 +115,60 @@ void __init pas_setup_arch(void)
98 /* Remap SDC register for doing reset */ 115 /* Remap SDC register for doing reset */
99 /* XXXOJN This should maybe come out of the device tree */ 116 /* XXXOJN This should maybe come out of the device tree */
100 reset_reg = ioremap(0xfc101100, 4); 117 reset_reg = ioremap(0xfc101100, 4);
118}
119
120static int __init pas_setup_mce_regs(void)
121{
122 struct pci_dev *dev;
123 int reg;
124
125 if (!machine_is(pasemi))
126 return -ENODEV;
127
128 /* Remap various SoC status registers for use by the MCE handler */
129
130 reg = 0;
131
132 dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa00a, NULL);
133 while (dev && reg < MAX_MCE_REGS) {
134 mce_regs[reg].name = kasprintf(GFP_KERNEL,
135 "mc%d_mcdebug_errsta", reg);
136 mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x730);
137 dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa00a, dev);
138 reg++;
139 }
140
141 dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL);
142 if (dev && reg+4 < MAX_MCE_REGS) {
143 mce_regs[reg].name = "iobdbg_IntStatus1";
144 mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x438);
145 reg++;
146 mce_regs[reg].name = "iobdbg_IOCTbusIntDbgReg";
147 mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x454);
148 reg++;
149 mce_regs[reg].name = "iobiom_IntStatus";
150 mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0xc10);
151 reg++;
152 mce_regs[reg].name = "iobiom_IntDbgReg";
153 mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0xc1c);
154 reg++;
155 }
156
157 dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa009, NULL);
158 if (dev && reg+2 < MAX_MCE_REGS) {
159 mce_regs[reg].name = "l2csts_IntStatus";
160 mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x200);
161 reg++;
162 mce_regs[reg].name = "l2csts_Cnt";
163 mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x214);
164 reg++;
165 }
101 166
102 pasemi_idle_init(); 167 num_mce_regs = reg;
168
169 return 0;
103} 170}
171device_initcall(pas_setup_mce_regs);
104 172
105static __init void pas_init_IRQ(void) 173static __init void pas_init_IRQ(void)
106{ 174{
@@ -162,25 +230,34 @@ static int pas_machine_check_handler(struct pt_regs *regs)
162{ 230{
163 int cpu = smp_processor_id(); 231 int cpu = smp_processor_id();
164 unsigned long srr0, srr1, dsisr; 232 unsigned long srr0, srr1, dsisr;
233 int dump_slb = 0;
234 int i;
165 235
166 srr0 = regs->nip; 236 srr0 = regs->nip;
167 srr1 = regs->msr; 237 srr1 = regs->msr;
168 dsisr = mfspr(SPRN_DSISR); 238 dsisr = mfspr(SPRN_DSISR);
169 printk(KERN_ERR "Machine Check on CPU %d\n", cpu); 239 printk(KERN_ERR "Machine Check on CPU %d\n", cpu);
170 printk(KERN_ERR "SRR0 0x%016lx SRR1 0x%016lx\n", srr0, srr1); 240 printk(KERN_ERR "SRR0 0x%016lx SRR1 0x%016lx\n", srr0, srr1);
171 printk(KERN_ERR "DSISR 0x%016lx DAR 0x%016lx\n", dsisr, regs->dar); 241 printk(KERN_ERR "DSISR 0x%016lx DAR 0x%016lx\n", dsisr, regs->dar);
242 printk(KERN_ERR "BER 0x%016lx MER 0x%016lx\n", mfspr(SPRN_PA6T_BER),
243 mfspr(SPRN_PA6T_MER));
244 printk(KERN_ERR "IER 0x%016lx DER 0x%016lx\n", mfspr(SPRN_PA6T_IER),
245 mfspr(SPRN_PA6T_DER));
172 printk(KERN_ERR "Cause:\n"); 246 printk(KERN_ERR "Cause:\n");
173 247
174 if (srr1 & 0x200000) 248 if (srr1 & 0x200000)
175 printk(KERN_ERR "Signalled by SDC\n"); 249 printk(KERN_ERR "Signalled by SDC\n");
250
176 if (srr1 & 0x100000) { 251 if (srr1 & 0x100000) {
177 printk(KERN_ERR "Load/Store detected error:\n"); 252 printk(KERN_ERR "Load/Store detected error:\n");
178 if (dsisr & 0x8000) 253 if (dsisr & 0x8000)
179 printk(KERN_ERR "D-cache ECC double-bit error or bus error\n"); 254 printk(KERN_ERR "D-cache ECC double-bit error or bus error\n");
180 if (dsisr & 0x4000) 255 if (dsisr & 0x4000)
181 printk(KERN_ERR "LSU snoop response error\n"); 256 printk(KERN_ERR "LSU snoop response error\n");
182 if (dsisr & 0x2000) 257 if (dsisr & 0x2000) {
183 printk(KERN_ERR "MMU SLB multi-hit or invalid B field\n"); 258 printk(KERN_ERR "MMU SLB multi-hit or invalid B field\n");
259 dump_slb = 1;
260 }
184 if (dsisr & 0x1000) 261 if (dsisr & 0x1000)
185 printk(KERN_ERR "Recoverable Duptags\n"); 262 printk(KERN_ERR "Recoverable Duptags\n");
186 if (dsisr & 0x800) 263 if (dsisr & 0x800)
@@ -188,13 +265,40 @@ static int pas_machine_check_handler(struct pt_regs *regs)
188 if (dsisr & 0x400) 265 if (dsisr & 0x400)
189 printk(KERN_ERR "TLB parity error count overflow\n"); 266 printk(KERN_ERR "TLB parity error count overflow\n");
190 } 267 }
268
191 if (srr1 & 0x80000) 269 if (srr1 & 0x80000)
192 printk(KERN_ERR "Bus Error\n"); 270 printk(KERN_ERR "Bus Error\n");
193 if (srr1 & 0x40000) 271
272 if (srr1 & 0x40000) {
194 printk(KERN_ERR "I-side SLB multiple hit\n"); 273 printk(KERN_ERR "I-side SLB multiple hit\n");
274 dump_slb = 1;
275 }
276
195 if (srr1 & 0x20000) 277 if (srr1 & 0x20000)
196 printk(KERN_ERR "I-cache parity error hit\n"); 278 printk(KERN_ERR "I-cache parity error hit\n");
197 279
280 if (num_mce_regs == 0)
281 printk(KERN_ERR "No MCE registers mapped yet, can't dump\n");
282 else
283 printk(KERN_ERR "SoC debug registers:\n");
284
285 for (i = 0; i < num_mce_regs; i++)
286 printk(KERN_ERR "%s: 0x%08x\n", mce_regs[i].name,
287 in_le32(mce_regs[i].addr));
288
289 if (dump_slb) {
290 unsigned long e, v;
291 int i;
292
293 printk(KERN_ERR "slb contents:\n");
294 for (i = 0; i < SLB_NUM_ENTRIES; i++) {
295 asm volatile("slbmfee %0,%1" : "=r" (e) : "r" (i));
296 asm volatile("slbmfev %0,%1" : "=r" (v) : "r" (i));
297 printk(KERN_ERR "%02d %016lx %016lx\n", i, e, v);
298 }
299 }
300
301
198 /* SRR1[62] is from MSR[62] if recoverable, so pass that back */ 302 /* SRR1[62] is from MSR[62] if recoverable, so pass that back */
199 return !!(srr1 & 0x2); 303 return !!(srr1 & 0x2);
200} 304}
diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c
index 9d73d0234c5d..cf660916ae0b 100644
--- a/arch/powerpc/platforms/powermac/bootx_init.c
+++ b/arch/powerpc/platforms/powermac/bootx_init.c
@@ -17,7 +17,6 @@
17#include <asm/prom.h> 17#include <asm/prom.h>
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/bootx.h> 19#include <asm/bootx.h>
20#include <asm/bootinfo.h>
21#include <asm/btext.h> 20#include <asm/btext.h>
22#include <asm/io.h> 21#include <asm/io.h>
23 22
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index efdf5eb81ecc..da2007e3db0e 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -40,7 +40,6 @@
40#include <linux/completion.h> 40#include <linux/completion.h>
41#include <linux/platform_device.h> 41#include <linux/platform_device.h>
42#include <linux/interrupt.h> 42#include <linux/interrupt.h>
43#include <linux/completion.h>
44#include <linux/timer.h> 43#include <linux/timer.h>
45#include <linux/mutex.h> 44#include <linux/mutex.h>
46#include <asm/keylargo.h> 45#include <asm/keylargo.h>
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 92586db19754..ec49099830d5 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -209,15 +209,12 @@ static int macrisc_write_config(struct pci_bus *bus, unsigned int devfn,
209 switch (len) { 209 switch (len) {
210 case 1: 210 case 1:
211 out_8(addr, val); 211 out_8(addr, val);
212 (void) in_8(addr);
213 break; 212 break;
214 case 2: 213 case 2:
215 out_le16(addr, val); 214 out_le16(addr, val);
216 (void) in_le16(addr);
217 break; 215 break;
218 default: 216 default:
219 out_le32(addr, val); 217 out_le32(addr, val);
220 (void) in_le32(addr);
221 break; 218 break;
222 } 219 }
223 return PCIBIOS_SUCCESSFUL; 220 return PCIBIOS_SUCCESSFUL;
@@ -225,8 +222,8 @@ static int macrisc_write_config(struct pci_bus *bus, unsigned int devfn,
225 222
226static struct pci_ops macrisc_pci_ops = 223static struct pci_ops macrisc_pci_ops =
227{ 224{
228 macrisc_read_config, 225 .read = macrisc_read_config,
229 macrisc_write_config 226 .write = macrisc_write_config,
230}; 227};
231 228
232#ifdef CONFIG_PPC32 229#ifdef CONFIG_PPC32
@@ -280,8 +277,8 @@ chaos_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
280 277
281static struct pci_ops chaos_pci_ops = 278static struct pci_ops chaos_pci_ops =
282{ 279{
283 chaos_read_config, 280 .read = chaos_read_config,
284 chaos_write_config 281 .write = chaos_write_config,
285}; 282};
286 283
287static void __init setup_chaos(struct pci_controller *hose, 284static void __init setup_chaos(struct pci_controller *hose,
@@ -440,15 +437,12 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
440 switch (len) { 437 switch (len) {
441 case 1: 438 case 1:
442 out_8(addr, val); 439 out_8(addr, val);
443 (void) in_8(addr);
444 break; 440 break;
445 case 2: 441 case 2:
446 out_le16(addr, val); 442 out_le16(addr, val);
447 (void) in_le16(addr);
448 break; 443 break;
449 default: 444 default:
450 out_le32((u32 __iomem *)addr, val); 445 out_le32((u32 __iomem *)addr, val);
451 (void) in_le32(addr);
452 break; 446 break;
453 } 447 }
454 return PCIBIOS_SUCCESSFUL; 448 return PCIBIOS_SUCCESSFUL;
@@ -456,8 +450,8 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
456 450
457static struct pci_ops u3_ht_pci_ops = 451static struct pci_ops u3_ht_pci_ops =
458{ 452{
459 u3_ht_read_config, 453 .read = u3_ht_read_config,
460 u3_ht_write_config 454 .write = u3_ht_write_config,
461}; 455};
462 456
463#define U4_PCIE_CFA0(devfn, off) \ 457#define U4_PCIE_CFA0(devfn, off) \
@@ -545,15 +539,12 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
545 switch (len) { 539 switch (len) {
546 case 1: 540 case 1:
547 out_8(addr, val); 541 out_8(addr, val);
548 (void) in_8(addr);
549 break; 542 break;
550 case 2: 543 case 2:
551 out_le16(addr, val); 544 out_le16(addr, val);
552 (void) in_le16(addr);
553 break; 545 break;
554 default: 546 default:
555 out_le32(addr, val); 547 out_le32(addr, val);
556 (void) in_le32(addr);
557 break; 548 break;
558 } 549 }
559 return PCIBIOS_SUCCESSFUL; 550 return PCIBIOS_SUCCESSFUL;
@@ -561,8 +552,8 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
561 552
562static struct pci_ops u4_pcie_pci_ops = 553static struct pci_ops u4_pcie_pci_ops =
563{ 554{
564 u4_pcie_read_config, 555 .read = u4_pcie_read_config,
565 u4_pcie_write_config 556 .write = u4_pcie_write_config,
566}; 557};
567 558
568#endif /* CONFIG_PPC64 */ 559#endif /* CONFIG_PPC64 */
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 87cd6805171a..999f5e160897 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -384,7 +384,7 @@ static void __init pmac_pic_probe_oldstyle(void)
384 /* 384 /*
385 * Allocate an irq host 385 * Allocate an irq host
386 */ 386 */
387 pmac_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, max_irqs, 387 pmac_pic_host = irq_alloc_host(master, IRQ_HOST_MAP_LINEAR, max_irqs,
388 &pmac_pic_host_ops, 388 &pmac_pic_host_ops,
389 max_irqs); 389 max_irqs);
390 BUG_ON(pmac_pic_host == NULL); 390 BUG_ON(pmac_pic_host == NULL);
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h
index 6e090a7dea83..fcde070f7054 100644
--- a/arch/powerpc/platforms/powermac/pmac.h
+++ b/arch/powerpc/platforms/powermac/pmac.h
@@ -22,9 +22,6 @@ extern void pmac_read_rtc_time(void);
22extern void pmac_calibrate_decr(void); 22extern void pmac_calibrate_decr(void);
23extern void pmac_pci_irq_fixup(struct pci_dev *); 23extern void pmac_pci_irq_fixup(struct pci_dev *);
24extern void pmac_pci_init(void); 24extern void pmac_pci_init(void);
25extern unsigned long pmac_ide_get_base(int index);
26extern void pmac_ide_init_hwif_ports(hw_regs_t *hw,
27 unsigned long data_port, unsigned long ctrl_port, int *irq);
28 25
29extern void pmac_nvram_update(void); 26extern void pmac_nvram_update(void);
30extern unsigned char pmac_nvram_read_byte(int addr); 27extern unsigned char pmac_nvram_read_byte(int addr);
@@ -33,7 +30,6 @@ extern int pmac_pci_enable_device_hook(struct pci_dev *dev, int initial);
33extern void pmac_pcibios_after_init(void); 30extern void pmac_pcibios_after_init(void);
34extern int of_show_percpuinfo(struct seq_file *m, int i); 31extern int of_show_percpuinfo(struct seq_file *m, int i);
35 32
36extern void pmac_pci_init(void);
37extern void pmac_setup_pci_dma(void); 33extern void pmac_setup_pci_dma(void);
38extern void pmac_check_ht_link(void); 34extern void pmac_check_ht_link(void);
39 35
diff --git a/arch/powerpc/platforms/powermac/udbg_adb.c b/arch/powerpc/platforms/powermac/udbg_adb.c
index 6124e59e1038..44e0b55a2a02 100644
--- a/arch/powerpc/platforms/powermac/udbg_adb.c
+++ b/arch/powerpc/platforms/powermac/udbg_adb.c
@@ -12,7 +12,6 @@
12#include <asm/xmon.h> 12#include <asm/xmon.h>
13#include <asm/prom.h> 13#include <asm/prom.h>
14#include <asm/bootx.h> 14#include <asm/bootx.h>
15#include <asm/machdep.h>
16#include <asm/errno.h> 15#include <asm/errno.h>
17#include <asm/pmac_feature.h> 16#include <asm/pmac_feature.h>
18#include <asm/processor.h> 17#include <asm/processor.h>
@@ -150,7 +149,7 @@ static void udbg_adb_putc(char c)
150 return udbg_adb_old_putc(c); 149 return udbg_adb_old_putc(c);
151} 150}
152 151
153void udbg_adb_init_early(void) 152void __init udbg_adb_init_early(void)
154{ 153{
155#ifdef CONFIG_BOOTX_TEXT 154#ifdef CONFIG_BOOTX_TEXT
156 if (btext_find_display(1) == 0) { 155 if (btext_find_display(1) == 0) {
@@ -160,7 +159,7 @@ void udbg_adb_init_early(void)
160#endif 159#endif
161} 160}
162 161
163int udbg_adb_init(int force_btext) 162int __init udbg_adb_init(int force_btext)
164{ 163{
165 struct device_node *np; 164 struct device_node *np;
166 165
diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c
index ce15cada88d4..fd063fe0c9b3 100644
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -297,8 +297,8 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
297 u64 dev_port; 297 u64 dev_port;
298 } *notify_event; 298 } *notify_event;
299 299
300 pr_debug(" -> %s:%u: bus_id %u, dev_id %u, dev_type %u\n", __func__, 300 pr_debug(" -> %s:%u: (%u:%u:%u)\n", __func__, __LINE__, repo->bus_id,
301 __LINE__, repo->bus_id, repo->dev_id, repo->dev_type); 301 repo->dev_id, repo->dev_type);
302 302
303 buf = kzalloc(512, GFP_KERNEL); 303 buf = kzalloc(512, GFP_KERNEL);
304 if (!buf) 304 if (!buf)
@@ -359,6 +359,11 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
359 break; 359 break;
360 } 360 }
361 361
362 pr_debug("%s:%d: notify event (%u:%u:%u): event_type 0x%lx, "
363 "port %lu\n", __func__, __LINE__, repo->bus_index,
364 repo->dev_index, repo->dev_type,
365 notify_event->event_type, notify_event->dev_port);
366
362 if (notify_event->event_type != notify_region_probe || 367 if (notify_event->event_type != notify_region_probe ||
363 notify_event->bus_id != repo->bus_id) { 368 notify_event->bus_id != repo->bus_id) {
364 pr_debug("%s:%u: bad notify_event: event %lu, " 369 pr_debug("%s:%u: bad notify_event: event %lu, "
@@ -370,8 +375,9 @@ static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
370 375
371 if (notify_event->dev_id == repo->dev_id && 376 if (notify_event->dev_id == repo->dev_id &&
372 notify_event->dev_type == repo->dev_type) { 377 notify_event->dev_type == repo->dev_type) {
373 pr_debug("%s:%u: device ready: dev_id %u\n", __func__, 378 pr_debug("%s:%u: device ready (%u:%u:%u)\n", __func__,
374 __LINE__, repo->dev_id); 379 __LINE__, repo->bus_index, repo->dev_index,
380 repo->dev_type);
375 error = 0; 381 error = 0;
376 break; 382 break;
377 } 383 }
@@ -412,9 +418,10 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
412 return -ENODEV; 418 return -ENODEV;
413 } 419 }
414 420
415 pr_debug("%s:%u: index %u:%u: port %lu blk_size %lu num_blocks %lu " 421 pr_debug("%s:%u: (%u:%u:%u): port %lu blk_size %lu num_blocks %lu "
416 "num_regions %u\n", __func__, __LINE__, repo->bus_index, 422 "num_regions %u\n", __func__, __LINE__, repo->bus_index,
417 repo->dev_index, port, blk_size, num_blocks, num_regions); 423 repo->dev_index, repo->dev_type, port, blk_size, num_blocks,
424 num_regions);
418 425
419 p = kzalloc(sizeof(struct ps3_storage_device) + 426 p = kzalloc(sizeof(struct ps3_storage_device) +
420 num_regions * sizeof(struct ps3_storage_region), 427 num_regions * sizeof(struct ps3_storage_region),
@@ -681,8 +688,9 @@ static int ps3_probe_thread(void *data)
681 pr_debug("%s:%u: find device error.\n", 688 pr_debug("%s:%u: find device error.\n",
682 __func__, __LINE__); 689 __func__, __LINE__);
683 else { 690 else {
684 pr_debug("%s:%u: found device\n", __func__, 691 pr_debug("%s:%u: found device (%u:%u:%u)\n",
685 __LINE__); 692 __func__, __LINE__, repo->bus_index,
693 repo->dev_index, repo->dev_type);
686 ps3_register_repository_device(repo); 694 ps3_register_repository_device(repo);
687 ps3_repository_bump_device(repo); 695 ps3_repository_bump_device(repo);
688 ms = 250; 696 ms = 250;
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
index 67e32ec9b37e..3a6db04aa940 100644
--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -673,9 +673,16 @@ static int ps3_host_map(struct irq_host *h, unsigned int virq,
673 return 0; 673 return 0;
674} 674}
675 675
676static int ps3_host_match(struct irq_host *h, struct device_node *np)
677{
678 /* Match all */
679 return 1;
680}
681
676static struct irq_host_ops ps3_host_ops = { 682static struct irq_host_ops ps3_host_ops = {
677 .map = ps3_host_map, 683 .map = ps3_host_map,
678 .unmap = ps3_host_unmap, 684 .unmap = ps3_host_unmap,
685 .match = ps3_host_match,
679}; 686};
680 687
681void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq) 688void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq)
@@ -726,7 +733,7 @@ void __init ps3_init_IRQ(void)
726 unsigned cpu; 733 unsigned cpu;
727 struct irq_host *host; 734 struct irq_host *host;
728 735
729 host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, &ps3_host_ops, 736 host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0, &ps3_host_ops,
730 PS3_INVALID_OUTLET); 737 PS3_INVALID_OUTLET);
731 irq_set_default_host(host); 738 irq_set_default_host(host);
732 irq_set_virq_count(PS3_PLUG_MAX + 1); 739 irq_set_virq_count(PS3_PLUG_MAX + 1);
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h
index 2eb8f92704b4..27c7d099816a 100644
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -47,7 +47,11 @@ void __init ps3_register_ipi_debug_brk(unsigned int cpu, unsigned int virq);
47/* smp */ 47/* smp */
48 48
49void smp_init_ps3(void); 49void smp_init_ps3(void);
50#ifdef CONFIG_SMP
50void ps3_smp_cleanup_cpu(int cpu); 51void ps3_smp_cleanup_cpu(int cpu);
52#else
53static inline void ps3_smp_cleanup_cpu(int cpu) { }
54#endif
51 55
52/* time */ 56/* time */
53 57
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index b8770395013d..22322b35a0ff 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -169,6 +169,8 @@ static void rtas_slot_error_detail(struct pci_dn *pdn, int severity,
169 */ 169 */
170static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len) 170static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
171{ 171{
172 struct device_node *dn;
173 struct pci_dev *dev = pdn->pcidev;
172 u32 cfg; 174 u32 cfg;
173 int cap, i; 175 int cap, i;
174 int n = 0; 176 int n = 0;
@@ -184,6 +186,17 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
184 n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg); 186 n += scnprintf(buf+n, len-n, "cmd/stat:%x\n", cfg);
185 printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg); 187 printk(KERN_WARNING "EEH: PCI cmd/status register: %08x\n", cfg);
186 188
189 /* Gather bridge-specific registers */
190 if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
191 rtas_read_config(pdn, PCI_SEC_STATUS, 2, &cfg);
192 n += scnprintf(buf+n, len-n, "sec stat:%x\n", cfg);
193 printk(KERN_WARNING "EEH: Bridge secondary status: %04x\n", cfg);
194
195 rtas_read_config(pdn, PCI_BRIDGE_CONTROL, 2, &cfg);
196 n += scnprintf(buf+n, len-n, "brdg ctl:%x\n", cfg);
197 printk(KERN_WARNING "EEH: Bridge control: %04x\n", cfg);
198 }
199
187 /* Dump out the PCI-X command and status regs */ 200 /* Dump out the PCI-X command and status regs */
188 cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_PCIX); 201 cap = pci_find_capability(pdn->pcidev, PCI_CAP_ID_PCIX);
189 if (cap) { 202 if (cap) {
@@ -209,7 +222,7 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
209 printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg); 222 printk(KERN_WARNING "EEH: PCI-E %02x: %08x\n", i, cfg);
210 } 223 }
211 224
212 cap = pci_find_ext_capability(pdn->pcidev,PCI_EXT_CAP_ID_ERR); 225 cap = pci_find_ext_capability(pdn->pcidev, PCI_EXT_CAP_ID_ERR);
213 if (cap) { 226 if (cap) {
214 n += scnprintf(buf+n, len-n, "pci-e AER:\n"); 227 n += scnprintf(buf+n, len-n, "pci-e AER:\n");
215 printk(KERN_WARNING 228 printk(KERN_WARNING
@@ -222,6 +235,18 @@ static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
222 } 235 }
223 } 236 }
224 } 237 }
238
239 /* Gather status on devices under the bridge */
240 if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
241 dn = pdn->node->child;
242 while (dn) {
243 pdn = PCI_DN(dn);
244 if (pdn)
245 n += gather_pci_data(pdn, buf+n, len-n);
246 dn = dn->sibling;
247 }
248 }
249
225 return n; 250 return n;
226} 251}
227 252
@@ -750,12 +775,12 @@ int rtas_set_slot_reset(struct pci_dn *pdn)
750 return 0; 775 return 0;
751 776
752 if (rc < 0) { 777 if (rc < 0) {
753 printk (KERN_ERR "EEH: unrecoverable slot failure %s\n", 778 printk(KERN_ERR "EEH: unrecoverable slot failure %s\n",
754 pdn->node->full_name); 779 pdn->node->full_name);
755 return -1; 780 return -1;
756 } 781 }
757 printk (KERN_ERR "EEH: bus reset %d failed on slot %s\n", 782 printk(KERN_ERR "EEH: bus reset %d failed on slot %s, rc=%d\n",
758 i+1, pdn->node->full_name); 783 i+1, pdn->node->full_name, rc);
759 } 784 }
760 785
761 return -1; 786 return -1;
@@ -930,7 +955,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
930 pdn->eeh_freeze_count = 0; 955 pdn->eeh_freeze_count = 0;
931 pdn->eeh_false_positives = 0; 956 pdn->eeh_false_positives = 0;
932 957
933 if (status && strcmp(status, "ok") != 0) 958 if (status && strncmp(status, "ok", 2) != 0)
934 return NULL; /* ignore devices with bad status */ 959 return NULL; /* ignore devices with bad status */
935 960
936 /* Ignore bad nodes. */ 961 /* Ignore bad nodes. */
@@ -944,23 +969,6 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
944 } 969 }
945 pdn->class_code = *class_code; 970 pdn->class_code = *class_code;
946 971
947 /*
948 * Now decide if we are going to "Disable" EEH checking
949 * for this device. We still run with the EEH hardware active,
950 * but we won't be checking for ff's. This means a driver
951 * could return bad data (very bad!), an interrupt handler could
952 * hang waiting on status bits that won't change, etc.
953 * But there are a few cases like display devices that make sense.
954 */
955 enable = 1; /* i.e. we will do checking */
956#if 0
957 if ((*class_code >> 16) == PCI_BASE_CLASS_DISPLAY)
958 enable = 0;
959#endif
960
961 if (!enable)
962 pdn->eeh_mode |= EEH_MODE_NOCHECK;
963
964 /* Ok... see if this device supports EEH. Some do, some don't, 972 /* Ok... see if this device supports EEH. Some do, some don't,
965 * and the only way to find out is to check each and every one. */ 973 * and the only way to find out is to check each and every one. */
966 regs = of_get_property(dn, "reg", NULL); 974 regs = of_get_property(dn, "reg", NULL);
diff --git a/arch/powerpc/platforms/pseries/eeh_cache.c b/arch/powerpc/platforms/pseries/eeh_cache.c
index e49c815eae23..1e83fcd0df31 100644
--- a/arch/powerpc/platforms/pseries/eeh_cache.c
+++ b/arch/powerpc/platforms/pseries/eeh_cache.c
@@ -225,6 +225,10 @@ void pci_addr_cache_insert_device(struct pci_dev *dev)
225{ 225{
226 unsigned long flags; 226 unsigned long flags;
227 227
228 /* Ignore PCI bridges */
229 if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE)
230 return;
231
228 spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags); 232 spin_lock_irqsave(&pci_io_addr_cache_root.piar_lock, flags);
229 __pci_addr_cache_insert_device(dev); 233 __pci_addr_cache_insert_device(dev);
230 spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags); 234 spin_unlock_irqrestore(&pci_io_addr_cache_root.piar_lock, flags);
@@ -285,16 +289,13 @@ void __init pci_addr_cache_build(void)
285 spin_lock_init(&pci_io_addr_cache_root.piar_lock); 289 spin_lock_init(&pci_io_addr_cache_root.piar_lock);
286 290
287 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 291 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
288 /* Ignore PCI bridges */
289 if ((dev->class >> 16) == PCI_BASE_CLASS_BRIDGE)
290 continue;
291 292
292 pci_addr_cache_insert_device(dev); 293 pci_addr_cache_insert_device(dev);
293 294
294 dn = pci_device_to_OF_node(dev); 295 dn = pci_device_to_OF_node(dev);
295 if (!dn) 296 if (!dn)
296 continue; 297 continue;
297 pci_dev_get (dev); /* matching put is in eeh_remove_device() */ 298 pci_dev_get(dev); /* matching put is in eeh_remove_device() */
298 PCI_DN(dn)->pcidev = dev; 299 PCI_DN(dn)->pcidev = dev;
299 300
300 eeh_sysfs_add_device(dev); 301 eeh_sysfs_add_device(dev);
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 8cc6eeeaae2f..ea327ca345c6 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -35,7 +35,6 @@
35#include <asm/tlbflush.h> 35#include <asm/tlbflush.h>
36#include <asm/tlb.h> 36#include <asm/tlb.h>
37#include <asm/prom.h> 37#include <asm/prom.h>
38#include <asm/abs_addr.h>
39#include <asm/cputable.h> 38#include <asm/cputable.h>
40#include <asm/udbg.h> 39#include <asm/udbg.h>
41#include <asm/smp.h> 40#include <asm/smp.h>
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index 6063ea2f67ad..2793a1b100e6 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -70,11 +70,15 @@ static int rtas_change_msi(struct pci_dn *pdn, u32 func, u32 num_irqs)
70 seq_num = rtas_ret[1]; 70 seq_num = rtas_ret[1];
71 } while (rtas_busy_delay(rc)); 71 } while (rtas_busy_delay(rc));
72 72
73 if (rc == 0) /* Success */ 73 /*
74 rc = rtas_ret[0]; 74 * If the RTAS call succeeded, check the number of irqs is actually
75 * what we asked for. If not, return an error.
76 */
77 if (rc == 0 && rtas_ret[0] != num_irqs)
78 rc = -ENOSPC;
75 79
76 pr_debug("rtas_msi: ibm,change_msi(func=%d,num=%d) = (%d)\n", 80 pr_debug("rtas_msi: ibm,change_msi(func=%d,num=%d), got %d rc = %d\n",
77 func, num_irqs, rc); 81 func, num_irqs, rtas_ret[0], rc);
78 82
79 return rc; 83 return rc;
80} 84}
@@ -87,7 +91,7 @@ static void rtas_disable_msi(struct pci_dev *pdev)
87 if (!pdn) 91 if (!pdn)
88 return; 92 return;
89 93
90 if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0) != 0) 94 if (rtas_change_msi(pdn, RTAS_CHANGE_FN, 0))
91 pr_debug("rtas_msi: Setting MSIs to 0 failed!\n"); 95 pr_debug("rtas_msi: Setting MSIs to 0 failed!\n");
92} 96}
93 97
@@ -180,38 +184,31 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
180 if (type == PCI_CAP_ID_MSI) { 184 if (type == PCI_CAP_ID_MSI) {
181 rc = rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, nvec); 185 rc = rtas_change_msi(pdn, RTAS_CHANGE_MSI_FN, nvec);
182 186
183 if (rc != nvec) { 187 if (rc) {
184 pr_debug("rtas_msi: trying the old firmware call.\n"); 188 pr_debug("rtas_msi: trying the old firmware call.\n");
185 rc = rtas_change_msi(pdn, RTAS_CHANGE_FN, nvec); 189 rc = rtas_change_msi(pdn, RTAS_CHANGE_FN, nvec);
186 } 190 }
187 } else 191 } else
188 rc = rtas_change_msi(pdn, RTAS_CHANGE_MSIX_FN, nvec); 192 rc = rtas_change_msi(pdn, RTAS_CHANGE_MSIX_FN, nvec);
189 193
190 if (rc != nvec) { 194 if (rc) {
191 pr_debug("rtas_msi: rtas_change_msi() failed\n"); 195 pr_debug("rtas_msi: rtas_change_msi() failed\n");
192 196 return rc;
193 /*
194 * In case of an error it's not clear whether the device is
195 * left with MSI enabled or not, so we explicitly disable.
196 */
197 goto out_free;
198 } 197 }
199 198
200 i = 0; 199 i = 0;
201 list_for_each_entry(entry, &pdev->msi_list, list) { 200 list_for_each_entry(entry, &pdev->msi_list, list) {
202 hwirq = rtas_query_irq_number(pdn, i); 201 hwirq = rtas_query_irq_number(pdn, i);
203 if (hwirq < 0) { 202 if (hwirq < 0) {
204 rc = hwirq;
205 pr_debug("rtas_msi: error (%d) getting hwirq\n", rc); 203 pr_debug("rtas_msi: error (%d) getting hwirq\n", rc);
206 goto out_free; 204 return hwirq;
207 } 205 }
208 206
209 virq = irq_create_mapping(NULL, hwirq); 207 virq = irq_create_mapping(NULL, hwirq);
210 208
211 if (virq == NO_IRQ) { 209 if (virq == NO_IRQ) {
212 pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); 210 pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq);
213 rc = -ENOSPC; 211 return -ENOSPC;
214 goto out_free;
215 } 212 }
216 213
217 dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq); 214 dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq);
@@ -220,10 +217,6 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
220 } 217 }
221 218
222 return 0; 219 return 0;
223
224 out_free:
225 rtas_teardown_msi_irqs(pdev);
226 return rc;
227} 220}
228 221
229static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev) 222static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev)
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index 9797b10b2935..73401c820110 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -44,15 +44,20 @@ static unsigned long rtas_log_start;
44static unsigned long rtas_log_size; 44static unsigned long rtas_log_size;
45 45
46static int surveillance_timeout = -1; 46static int surveillance_timeout = -1;
47static unsigned int rtas_event_scan_rate;
48static unsigned int rtas_error_log_max; 47static unsigned int rtas_error_log_max;
49static unsigned int rtas_error_log_buffer_max; 48static unsigned int rtas_error_log_buffer_max;
50 49
51static int full_rtas_msgs = 0; 50/* RTAS service tokens */
51static unsigned int event_scan;
52static unsigned int rtas_event_scan_rate;
52 53
53extern int no_logging; 54static int full_rtas_msgs = 0;
54 55
55volatile int error_log_cnt = 0; 56/* Stop logging to nvram after first fatal error */
57static int logging_enabled; /* Until we initialize everything,
58 * make sure we don't try logging
59 * anything */
60static int error_log_cnt;
56 61
57/* 62/*
58 * Since we use 32 bit RTAS, the physical address of this must be below 63 * Since we use 32 bit RTAS, the physical address of this must be below
@@ -61,8 +66,6 @@ volatile int error_log_cnt = 0;
61 */ 66 */
62static unsigned char logdata[RTAS_ERROR_LOG_MAX]; 67static unsigned char logdata[RTAS_ERROR_LOG_MAX];
63 68
64static int get_eventscan_parms(void);
65
66static char *rtas_type[] = { 69static char *rtas_type[] = {
67 "Unknown", "Retry", "TCE Error", "Internal Device Failure", 70 "Unknown", "Retry", "TCE Error", "Internal Device Failure",
68 "Timeout", "Data Parity", "Address Parity", "Cache Parity", 71 "Timeout", "Data Parity", "Address Parity", "Cache Parity",
@@ -166,9 +169,9 @@ static int log_rtas_len(char * buf)
166 len += err->extended_log_length; 169 len += err->extended_log_length;
167 } 170 }
168 171
169 if (rtas_error_log_max == 0) { 172 if (rtas_error_log_max == 0)
170 get_eventscan_parms(); 173 rtas_error_log_max = rtas_get_error_log_max();
171 } 174
172 if (len > rtas_error_log_max) 175 if (len > rtas_error_log_max)
173 len = rtas_error_log_max; 176 len = rtas_error_log_max;
174 177
@@ -215,8 +218,8 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
215 } 218 }
216 219
217 /* Write error to NVRAM */ 220 /* Write error to NVRAM */
218 if (!no_logging && !(err_type & ERR_FLAG_BOOT)) 221 if (logging_enabled && !(err_type & ERR_FLAG_BOOT))
219 nvram_write_error_log(buf, len, err_type); 222 nvram_write_error_log(buf, len, err_type, error_log_cnt);
220 223
221 /* 224 /*
222 * rtas errors can occur during boot, and we do want to capture 225 * rtas errors can occur during boot, and we do want to capture
@@ -227,8 +230,8 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
227 printk_log_rtas(buf, len); 230 printk_log_rtas(buf, len);
228 231
229 /* Check to see if we need to or have stopped logging */ 232 /* Check to see if we need to or have stopped logging */
230 if (fatal || no_logging) { 233 if (fatal || !logging_enabled) {
231 no_logging = 1; 234 logging_enabled = 0;
232 spin_unlock_irqrestore(&rtasd_log_lock, s); 235 spin_unlock_irqrestore(&rtasd_log_lock, s);
233 return; 236 return;
234 } 237 }
@@ -300,7 +303,7 @@ static ssize_t rtas_log_read(struct file * file, char __user * buf,
300 303
301 spin_lock_irqsave(&rtasd_log_lock, s); 304 spin_lock_irqsave(&rtasd_log_lock, s);
302 /* if it's 0, then we know we got the last one (the one in NVRAM) */ 305 /* if it's 0, then we know we got the last one (the one in NVRAM) */
303 if (rtas_log_size == 0 && !no_logging) 306 if (rtas_log_size == 0 && logging_enabled)
304 nvram_clear_error_log(); 307 nvram_clear_error_log();
305 spin_unlock_irqrestore(&rtasd_log_lock, s); 308 spin_unlock_irqrestore(&rtasd_log_lock, s);
306 309
@@ -356,32 +359,7 @@ static int enable_surveillance(int timeout)
356 return -1; 359 return -1;
357} 360}
358 361
359static int get_eventscan_parms(void) 362static void do_event_scan(void)
360{
361 struct device_node *node;
362 const int *ip;
363
364 node = of_find_node_by_path("/rtas");
365
366 ip = of_get_property(node, "rtas-event-scan-rate", NULL);
367 if (ip == NULL) {
368 printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n");
369 of_node_put(node);
370 return -1;
371 }
372 rtas_event_scan_rate = *ip;
373 DEBUG("rtas-event-scan-rate %d\n", rtas_event_scan_rate);
374
375 /* Make room for the sequence number */
376 rtas_error_log_max = rtas_get_error_log_max();
377 rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
378
379 of_node_put(node);
380
381 return 0;
382}
383
384static void do_event_scan(int event_scan)
385{ 363{
386 int error; 364 int error;
387 do { 365 do {
@@ -408,7 +386,7 @@ static void do_event_scan_all_cpus(long delay)
408 cpu = first_cpu(cpu_online_map); 386 cpu = first_cpu(cpu_online_map);
409 for (;;) { 387 for (;;) {
410 set_cpus_allowed(current, cpumask_of_cpu(cpu)); 388 set_cpus_allowed(current, cpumask_of_cpu(cpu));
411 do_event_scan(rtas_token("event-scan")); 389 do_event_scan();
412 set_cpus_allowed(current, CPU_MASK_ALL); 390 set_cpus_allowed(current, CPU_MASK_ALL);
413 391
414 /* Drop hotplug lock, and sleep for the specified delay */ 392 /* Drop hotplug lock, and sleep for the specified delay */
@@ -426,31 +404,19 @@ static void do_event_scan_all_cpus(long delay)
426static int rtasd(void *unused) 404static int rtasd(void *unused)
427{ 405{
428 unsigned int err_type; 406 unsigned int err_type;
429 int event_scan = rtas_token("event-scan");
430 int rc; 407 int rc;
431 408
432 daemonize("rtasd"); 409 daemonize("rtasd");
433 410
434 if (event_scan == RTAS_UNKNOWN_SERVICE || get_eventscan_parms() == -1)
435 goto error;
436
437 rtas_log_buf = vmalloc(rtas_error_log_buffer_max*LOG_NUMBER);
438 if (!rtas_log_buf) {
439 printk(KERN_ERR "rtasd: no memory\n");
440 goto error;
441 }
442
443 printk(KERN_DEBUG "RTAS daemon started\n"); 411 printk(KERN_DEBUG "RTAS daemon started\n");
444
445 DEBUG("will sleep for %d milliseconds\n", (30000/rtas_event_scan_rate)); 412 DEBUG("will sleep for %d milliseconds\n", (30000/rtas_event_scan_rate));
446 413
447 /* See if we have any error stored in NVRAM */ 414 /* See if we have any error stored in NVRAM */
448 memset(logdata, 0, rtas_error_log_max); 415 memset(logdata, 0, rtas_error_log_max);
449 416 rc = nvram_read_error_log(logdata, rtas_error_log_max,
450 rc = nvram_read_error_log(logdata, rtas_error_log_max, &err_type); 417 &err_type, &error_log_cnt);
451
452 /* We can use rtas_log_buf now */ 418 /* We can use rtas_log_buf now */
453 no_logging = 0; 419 logging_enabled = 1;
454 420
455 if (!rc) { 421 if (!rc) {
456 if (err_type != ERR_FLAG_ALREADY_LOGGED) { 422 if (err_type != ERR_FLAG_ALREADY_LOGGED) {
@@ -473,8 +439,6 @@ static int rtasd(void *unused)
473 for (;;) 439 for (;;)
474 do_event_scan_all_cpus(30000/rtas_event_scan_rate); 440 do_event_scan_all_cpus(30000/rtas_event_scan_rate);
475 441
476error:
477 /* Should delete proc entries */
478 return -EINVAL; 442 return -EINVAL;
479} 443}
480 444
@@ -486,11 +450,28 @@ static int __init rtas_init(void)
486 return 0; 450 return 0;
487 451
488 /* No RTAS */ 452 /* No RTAS */
489 if (rtas_token("event-scan") == RTAS_UNKNOWN_SERVICE) { 453 event_scan = rtas_token("event-scan");
454 if (event_scan == RTAS_UNKNOWN_SERVICE) {
490 printk(KERN_DEBUG "rtasd: no event-scan on system\n"); 455 printk(KERN_DEBUG "rtasd: no event-scan on system\n");
491 return -ENODEV; 456 return -ENODEV;
492 } 457 }
493 458
459 rtas_event_scan_rate = rtas_token("rtas-event-scan-rate");
460 if (rtas_event_scan_rate == RTAS_UNKNOWN_SERVICE) {
461 printk(KERN_ERR "rtasd: no rtas-event-scan-rate on system\n");
462 return -ENODEV;
463 }
464
465 /* Make room for the sequence number */
466 rtas_error_log_max = rtas_get_error_log_max();
467 rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
468
469 rtas_log_buf = vmalloc(rtas_error_log_buffer_max*LOG_NUMBER);
470 if (!rtas_log_buf) {
471 printk(KERN_ERR "rtasd: no memory\n");
472 return -ENOMEM;
473 }
474
494 entry = create_proc_entry("ppc64/rtas/error_log", S_IRUSR, NULL); 475 entry = create_proc_entry("ppc64/rtas/error_log", S_IRUSR, NULL);
495 if (entry) 476 if (entry)
496 entry->proc_fops = &proc_rtas_log_operations; 477 entry->proc_fops = &proc_rtas_log_operations;
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index f0b5ff17d860..66e7d68ffeb1 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -540,7 +540,7 @@ static void __init xics_init_host(void)
540 ops = &xics_host_lpar_ops; 540 ops = &xics_host_lpar_ops;
541 else 541 else
542 ops = &xics_host_direct_ops; 542 ops = &xics_host_direct_ops;
543 xics_host = irq_alloc_host(IRQ_HOST_MAP_TREE, 0, ops, 543 xics_host = irq_alloc_host(NULL, IRQ_HOST_MAP_TREE, 0, ops,
544 XICS_IRQ_SPURIOUS); 544 XICS_IRQ_SPURIOUS);
545 BUG_ON(xics_host == NULL); 545 BUG_ON(xics_host == NULL);
546 irq_set_default_host(xics_host); 546 irq_set_default_host(xics_host);
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 08ce31e612c2..b0ea8e9495e8 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -16,15 +16,11 @@ obj-$(CONFIG_FSL_PCI) += fsl_pci.o
16obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o 16obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o
17obj-$(CONFIG_QUICC_ENGINE) += qe_lib/ 17obj-$(CONFIG_QUICC_ENGINE) += qe_lib/
18mv64x60-$(CONFIG_PCI) += mv64x60_pci.o 18mv64x60-$(CONFIG_PCI) += mv64x60_pci.o
19obj-$(CONFIG_MV64X60) += $(mv64x60-y) mv64x60_pic.o mv64x60_dev.o 19obj-$(CONFIG_MV64X60) += $(mv64x60-y) mv64x60_pic.o mv64x60_dev.o \
20 mv64x60_udbg.o
20obj-$(CONFIG_RTC_DRV_CMOS) += rtc_cmos_setup.o 21obj-$(CONFIG_RTC_DRV_CMOS) += rtc_cmos_setup.o
21obj-$(CONFIG_AXON_RAM) += axonram.o 22obj-$(CONFIG_AXON_RAM) += axonram.o
22 23
23# contains only the suspend handler for time
24ifeq ($(CONFIG_RTC_CLASS),)
25obj-$(CONFIG_PM) += timer.o
26endif
27
28ifeq ($(CONFIG_PPC_MERGE),y) 24ifeq ($(CONFIG_PPC_MERGE),y)
29obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o 25obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
30obj-$(CONFIG_PPC_I8259) += i8259.o 26obj-$(CONFIG_PPC_I8259) += i8259.o
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index dd5417aec1b4..160a8b49bdea 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -45,12 +45,11 @@
45#define CPM_MAP_SIZE (0x4000) 45#define CPM_MAP_SIZE (0x4000)
46 46
47static void m8xx_cpm_dpinit(void); 47static void m8xx_cpm_dpinit(void);
48static uint host_buffer; /* One page of host buffer */ 48static uint host_buffer; /* One page of host buffer */
49static uint host_end; /* end + 1 */ 49static uint host_end; /* end + 1 */
50cpm8xx_t *cpmp; /* Pointer to comm processor space */ 50cpm8xx_t *cpmp; /* Pointer to comm processor space */
51cpic8xx_t *cpic_reg; 51cpic8xx_t *cpic_reg;
52 52
53static struct device_node *cpm_pic_node;
54static struct irq_host *cpm_pic_host; 53static struct irq_host *cpm_pic_host;
55 54
56static void cpm_mask_irq(unsigned int irq) 55static void cpm_mask_irq(unsigned int irq)
@@ -95,11 +94,6 @@ int cpm_get_irq(void)
95 return irq_linear_revmap(cpm_pic_host, cpm_vec); 94 return irq_linear_revmap(cpm_pic_host, cpm_vec);
96} 95}
97 96
98static int cpm_pic_host_match(struct irq_host *h, struct device_node *node)
99{
100 return cpm_pic_node == node;
101}
102
103static int cpm_pic_host_map(struct irq_host *h, unsigned int virq, 97static int cpm_pic_host_map(struct irq_host *h, unsigned int virq,
104 irq_hw_number_t hw) 98 irq_hw_number_t hw)
105{ 99{
@@ -115,7 +109,7 @@ static int cpm_pic_host_map(struct irq_host *h, unsigned int virq,
115 * and return. This is a no-op function so we don't need any special 109 * and return. This is a no-op function so we don't need any special
116 * tests in the interrupt handler. 110 * tests in the interrupt handler.
117 */ 111 */
118static irqreturn_t cpm_error_interrupt(int irq, void *dev) 112static irqreturn_t cpm_error_interrupt(int irq, void *dev)
119{ 113{
120 return IRQ_HANDLED; 114 return IRQ_HANDLED;
121} 115}
@@ -127,7 +121,6 @@ static struct irqaction cpm_error_irqaction = {
127}; 121};
128 122
129static struct irq_host_ops cpm_pic_host_ops = { 123static struct irq_host_ops cpm_pic_host_ops = {
130 .match = cpm_pic_host_match,
131 .map = cpm_pic_host_map, 124 .map = cpm_pic_host_map,
132}; 125};
133 126
@@ -165,9 +158,8 @@ unsigned int cpm_pic_init(void)
165 158
166 out_be32(&cpic_reg->cpic_cimr, 0); 159 out_be32(&cpic_reg->cpic_cimr, 0);
167 160
168 cpm_pic_node = of_node_get(np); 161 cpm_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR,
169 162 64, &cpm_pic_host_ops, 64);
170 cpm_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &cpm_pic_host_ops, 64);
171 if (cpm_pic_host == NULL) { 163 if (cpm_pic_host == NULL) {
172 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); 164 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
173 sirq = NO_IRQ; 165 sirq = NO_IRQ;
@@ -181,7 +173,7 @@ unsigned int cpm_pic_init(void)
181 printk(KERN_ERR "CPM PIC init: can not find cpm node\n"); 173 printk(KERN_ERR "CPM PIC init: can not find cpm node\n");
182 goto end; 174 goto end;
183 } 175 }
184 eirq= irq_of_parse_and_map(np, 0); 176 eirq = irq_of_parse_and_map(np, 0);
185 if (eirq == NO_IRQ) 177 if (eirq == NO_IRQ)
186 goto end; 178 goto end;
187 179
@@ -197,15 +189,15 @@ end:
197 189
198void cpm_reset(void) 190void cpm_reset(void)
199{ 191{
200 cpm8xx_t *commproc; 192 cpm8xx_t *commproc;
201 sysconf8xx_t *siu_conf; 193 sysconf8xx_t *siu_conf;
202 194
203 commproc = (cpm8xx_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE); 195 commproc = (cpm8xx_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE);
204 196
205#ifdef CONFIG_UCODE_PATCH 197#ifdef CONFIG_UCODE_PATCH
206 /* Perform a reset. 198 /* Perform a reset.
207 */ 199 */
208 out_be16(&commproc->cp_cpcr, CPM_CR_RST | CPM_CR_FLG); 200 out_be16(&commproc->cp_cpcr, CPM_CR_RST | CPM_CR_FLG);
209 201
210 /* Wait for it. 202 /* Wait for it.
211 */ 203 */
@@ -307,7 +299,7 @@ static rh_block_t cpm_boot_dpmem_rh_block[16];
307static rh_info_t cpm_dpmem_info; 299static rh_info_t cpm_dpmem_info;
308 300
309#define CPM_DPMEM_ALIGNMENT 8 301#define CPM_DPMEM_ALIGNMENT 8
310static u8* dpram_vbase; 302static u8 *dpram_vbase;
311static uint dpram_pbase; 303static uint dpram_pbase;
312 304
313void m8xx_cpm_dpinit(void) 305void m8xx_cpm_dpinit(void)
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index c827715a5090..3bf89b324760 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -201,7 +201,7 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode)
201 } 201 }
202 202
203 if (mode == CPM_CLK_RX) 203 if (mode == CPM_CLK_RX)
204 shift +=3; 204 shift += 3;
205 205
206 for (i=0; i<24; i++) { 206 for (i=0; i<24; i++) {
207 if (clk_map[i][0] == target && clk_map[i][1] == clock) { 207 if (clk_map[i][0] == target && clk_map[i][1] == clock) {
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
index eabfe06fe05c..d5b36e0ecbda 100644
--- a/arch/powerpc/sysdev/cpm2_pic.c
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -50,7 +50,6 @@
50 50
51static intctl_cpm2_t *cpm2_intctl; 51static intctl_cpm2_t *cpm2_intctl;
52 52
53static struct device_node *cpm2_pic_node;
54static struct irq_host *cpm2_pic_host; 53static struct irq_host *cpm2_pic_host;
55#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 54#define NR_MASK_WORDS ((NR_IRQS + 31) / 32)
56static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; 55static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
@@ -206,11 +205,6 @@ unsigned int cpm2_get_irq(void)
206 return irq_linear_revmap(cpm2_pic_host, irq); 205 return irq_linear_revmap(cpm2_pic_host, irq);
207} 206}
208 207
209static int cpm2_pic_host_match(struct irq_host *h, struct device_node *node)
210{
211 return cpm2_pic_node == node;
212}
213
214static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq, 208static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq,
215 irq_hw_number_t hw) 209 irq_hw_number_t hw)
216{ 210{
@@ -234,7 +228,6 @@ static int cpm2_pic_host_xlate(struct irq_host *h, struct device_node *ct,
234} 228}
235 229
236static struct irq_host_ops cpm2_pic_host_ops = { 230static struct irq_host_ops cpm2_pic_host_ops = {
237 .match = cpm2_pic_host_match,
238 .map = cpm2_pic_host_map, 231 .map = cpm2_pic_host_map,
239 .xlate = cpm2_pic_host_xlate, 232 .xlate = cpm2_pic_host_xlate,
240}; 233};
@@ -273,8 +266,8 @@ void cpm2_pic_init(struct device_node *node)
273 out_be32(&cpm2_intctl->ic_scprrl, 0x05309770); 266 out_be32(&cpm2_intctl->ic_scprrl, 0x05309770);
274 267
275 /* create a legacy host */ 268 /* create a legacy host */
276 cpm2_pic_node = of_node_get(node); 269 cpm2_pic_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR,
277 cpm2_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &cpm2_pic_host_ops, 64); 270 64, &cpm2_pic_host_ops, 64);
278 if (cpm2_pic_host == NULL) { 271 if (cpm2_pic_host == NULL) {
279 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); 272 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
280 return; 273 return;
diff --git a/arch/powerpc/sysdev/dart_iommu.c b/arch/powerpc/sysdev/dart_iommu.c
index a1d2042bb304..e0e24b01e3a6 100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
@@ -204,7 +204,7 @@ static void dart_free(struct iommu_table *tbl, long index, long npages)
204} 204}
205 205
206 206
207static int dart_init(struct device_node *dart_node) 207static int __init dart_init(struct device_node *dart_node)
208{ 208{
209 unsigned int i; 209 unsigned int i;
210 unsigned long tmp, base, size; 210 unsigned long tmp, base, size;
@@ -313,7 +313,7 @@ static void pci_dma_bus_setup_dart(struct pci_bus *bus)
313 PCI_DN(dn)->iommu_table = &iommu_table_dart; 313 PCI_DN(dn)->iommu_table = &iommu_table_dart;
314} 314}
315 315
316void iommu_init_early_dart(void) 316void __init iommu_init_early_dart(void)
317{ 317{
318 struct device_node *dn; 318 struct device_node *dn;
319 319
diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index 574b6ef44e0b..ab11c0b29024 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -33,6 +33,7 @@ unsigned int dcr_resource_start(struct device_node *np, unsigned int index)
33 33
34 return dr[index * 2]; 34 return dr[index * 2];
35} 35}
36EXPORT_SYMBOL_GPL(dcr_resource_start);
36 37
37unsigned int dcr_resource_len(struct device_node *np, unsigned int index) 38unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
38{ 39{
@@ -44,6 +45,7 @@ unsigned int dcr_resource_len(struct device_node *np, unsigned int index)
44 45
45 return dr[index * 2 + 1]; 46 return dr[index * 2 + 1];
46} 47}
48EXPORT_SYMBOL_GPL(dcr_resource_len);
47 49
48#ifndef CONFIG_PPC_DCR_NATIVE 50#ifndef CONFIG_PPC_DCR_NATIVE
49 51
@@ -102,7 +104,7 @@ u64 of_translate_dcr_address(struct device_node *dev,
102dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n, 104dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
103 unsigned int dcr_c) 105 unsigned int dcr_c)
104{ 106{
105 dcr_host_t ret = { .token = NULL, .stride = 0 }; 107 dcr_host_t ret = { .token = NULL, .stride = 0, .base = dcr_n };
106 u64 addr; 108 u64 addr;
107 109
108 pr_debug("dcr_map(%s, 0x%x, 0x%x)\n", 110 pr_debug("dcr_map(%s, 0x%x, 0x%x)\n",
@@ -122,6 +124,7 @@ dcr_host_t dcr_map(struct device_node *dev, unsigned int dcr_n,
122 ret.token -= dcr_n * ret.stride; 124 ret.token -= dcr_n * ret.stride;
123 return ret; 125 return ret;
124} 126}
127EXPORT_SYMBOL_GPL(dcr_map);
125 128
126void dcr_unmap(dcr_host_t host, unsigned int dcr_n, unsigned int dcr_c) 129void dcr_unmap(dcr_host_t host, unsigned int dcr_n, unsigned int dcr_c)
127{ 130{
@@ -133,5 +136,6 @@ void dcr_unmap(dcr_host_t host, unsigned int dcr_n, unsigned int dcr_c)
133 iounmap(h.token); 136 iounmap(h.token);
134 h.token = NULL; 137 h.token = NULL;
135} 138}
139EXPORT_SYMBOL_GPL(dcr_unmap);
136 140
137#endif /* !defined(CONFIG_PPC_DCR_NATIVE) */ 141#endif /* !defined(CONFIG_PPC_DCR_NATIVE) */
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 114c90f8f560..34cad96e0de9 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -255,5 +255,7 @@ DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533E, quirk_fsl_pcie_transpare
255DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533, quirk_fsl_pcie_transparent); 255DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533, quirk_fsl_pcie_transparent);
256DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_transparent); 256DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_transparent);
257DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_transparent); 257DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_transparent);
258DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8572E, quirk_fsl_pcie_transparent)
259DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8572, quirk_fsl_pcie_transparent);
258DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_transparent); 260DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_transparent);
259DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_transparent); 261DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_transparent);
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 1cf29c9d4408..d028e8da027b 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -24,6 +24,7 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/of_platform.h> 25#include <linux/of_platform.h>
26#include <linux/phy.h> 26#include <linux/phy.h>
27#include <linux/spi/spi.h>
27#include <linux/fsl_devices.h> 28#include <linux/fsl_devices.h>
28#include <linux/fs_enet_pd.h> 29#include <linux/fs_enet_pd.h>
29#include <linux/fs_uart_pd.h> 30#include <linux/fs_uart_pd.h>
@@ -52,13 +53,13 @@ phys_addr_t get_immrbase(void)
52 53
53 soc = of_find_node_by_type(NULL, "soc"); 54 soc = of_find_node_by_type(NULL, "soc");
54 if (soc) { 55 if (soc) {
55 unsigned int size; 56 int size;
56 const void *prop = of_get_property(soc, "reg", &size); 57 const void *prop = of_get_property(soc, "reg", &size);
57 58
58 if (prop) 59 if (prop)
59 immrbase = of_translate_address(soc, prop); 60 immrbase = of_translate_address(soc, prop);
60 of_node_put(soc); 61 of_node_put(soc);
61 }; 62 }
62 63
63 return immrbase; 64 return immrbase;
64} 65}
@@ -76,16 +77,23 @@ u32 get_brgfreq(void)
76 if (brgfreq != -1) 77 if (brgfreq != -1)
77 return brgfreq; 78 return brgfreq;
78 79
79 node = of_find_node_by_type(NULL, "cpm"); 80 node = of_find_compatible_node(NULL, NULL, "fsl,cpm1");
81 if (!node)
82 node = of_find_compatible_node(NULL, NULL, "fsl,cpm2");
83 if (!node)
84 node = of_find_node_by_type(NULL, "cpm");
80 if (node) { 85 if (node) {
81 unsigned int size; 86 int size;
82 const unsigned int *prop = of_get_property(node, 87 const unsigned int *prop;
83 "brg-frequency", &size);
84 88
85 if (prop) 89 prop = of_get_property(node, "fsl,brg-frequency", &size);
90 if (!prop)
91 prop = of_get_property(node, "brg-frequency", &size);
92 if (prop && size == 4)
86 brgfreq = *prop; 93 brgfreq = *prop;
94
87 of_node_put(node); 95 of_node_put(node);
88 }; 96 }
89 97
90 return brgfreq; 98 return brgfreq;
91} 99}
@@ -103,14 +111,14 @@ u32 get_baudrate(void)
103 111
104 node = of_find_node_by_type(NULL, "serial"); 112 node = of_find_node_by_type(NULL, "serial");
105 if (node) { 113 if (node) {
106 unsigned int size; 114 int size;
107 const unsigned int *prop = of_get_property(node, 115 const unsigned int *prop = of_get_property(node,
108 "current-speed", &size); 116 "current-speed", &size);
109 117
110 if (prop) 118 if (prop)
111 fs_baudrate = *prop; 119 fs_baudrate = *prop;
112 of_node_put(node); 120 of_node_put(node);
113 }; 121 }
114 122
115 return fs_baudrate; 123 return fs_baudrate;
116} 124}
@@ -321,21 +329,26 @@ static struct i2c_driver_device i2c_devices[] __initdata = {
321 {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",}, 329 {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
322}; 330};
323 331
324static int __init of_find_i2c_driver(struct device_node *node, struct i2c_board_info *info) 332static int __init of_find_i2c_driver(struct device_node *node,
333 struct i2c_board_info *info)
325{ 334{
326 int i; 335 int i;
327 336
328 for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) { 337 for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
329 if (!of_device_is_compatible(node, i2c_devices[i].of_device)) 338 if (!of_device_is_compatible(node, i2c_devices[i].of_device))
330 continue; 339 continue;
331 strncpy(info->driver_name, i2c_devices[i].i2c_driver, KOBJ_NAME_LEN); 340 if (strlcpy(info->driver_name, i2c_devices[i].i2c_driver,
332 strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE); 341 KOBJ_NAME_LEN) >= KOBJ_NAME_LEN ||
342 strlcpy(info->type, i2c_devices[i].i2c_type,
343 I2C_NAME_SIZE) >= I2C_NAME_SIZE)
344 return -ENOMEM;
333 return 0; 345 return 0;
334 } 346 }
335 return -ENODEV; 347 return -ENODEV;
336} 348}
337 349
338static void __init of_register_i2c_devices(struct device_node *adap_node, int bus_num) 350static void __init of_register_i2c_devices(struct device_node *adap_node,
351 int bus_num)
339{ 352{
340 struct device_node *node = NULL; 353 struct device_node *node = NULL;
341 354
@@ -1187,3 +1200,89 @@ err:
1187arch_initcall(cpm_smc_uart_of_init); 1200arch_initcall(cpm_smc_uart_of_init);
1188 1201
1189#endif /* CONFIG_8xx */ 1202#endif /* CONFIG_8xx */
1203
1204int __init fsl_spi_init(struct spi_board_info *board_infos,
1205 unsigned int num_board_infos,
1206 void (*activate_cs)(u8 cs, u8 polarity),
1207 void (*deactivate_cs)(u8 cs, u8 polarity))
1208{
1209 struct device_node *np;
1210 unsigned int i;
1211 const u32 *sysclk;
1212
1213 np = of_find_node_by_type(NULL, "qe");
1214 if (!np)
1215 return -ENODEV;
1216
1217 sysclk = of_get_property(np, "bus-frequency", NULL);
1218 if (!sysclk)
1219 return -ENODEV;
1220
1221 for (np = NULL, i = 1;
1222 (np = of_find_compatible_node(np, "spi", "fsl_spi")) != NULL;
1223 i++) {
1224 int ret = 0;
1225 unsigned int j;
1226 const void *prop;
1227 struct resource res[2];
1228 struct platform_device *pdev;
1229 struct fsl_spi_platform_data pdata = {
1230 .activate_cs = activate_cs,
1231 .deactivate_cs = deactivate_cs,
1232 };
1233
1234 memset(res, 0, sizeof(res));
1235
1236 pdata.sysclk = *sysclk;
1237
1238 prop = of_get_property(np, "reg", NULL);
1239 if (!prop)
1240 goto err;
1241 pdata.bus_num = *(u32 *)prop;
1242
1243 prop = of_get_property(np, "mode", NULL);
1244 if (prop && !strcmp(prop, "cpu-qe"))
1245 pdata.qe_mode = 1;
1246
1247 for (j = 0; j < num_board_infos; j++) {
1248 if (board_infos[j].bus_num == pdata.bus_num)
1249 pdata.max_chipselect++;
1250 }
1251
1252 if (!pdata.max_chipselect)
1253 goto err;
1254
1255 ret = of_address_to_resource(np, 0, &res[0]);
1256 if (ret)
1257 goto err;
1258
1259 ret = of_irq_to_resource(np, 0, &res[1]);
1260 if (ret == NO_IRQ)
1261 goto err;
1262
1263 pdev = platform_device_alloc("mpc83xx_spi", i);
1264 if (!pdev)
1265 goto err;
1266
1267 ret = platform_device_add_data(pdev, &pdata, sizeof(pdata));
1268 if (ret)
1269 goto unreg;
1270
1271 ret = platform_device_add_resources(pdev, res,
1272 ARRAY_SIZE(res));
1273 if (ret)
1274 goto unreg;
1275
1276 ret = platform_device_register(pdev);
1277 if (ret)
1278 goto unreg;
1279
1280 continue;
1281unreg:
1282 platform_device_del(pdev);
1283err:
1284 continue;
1285 }
1286
1287 return spi_register_board_info(board_infos, num_board_infos);
1288}
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h
index 04e145b5fc32..618d91d1e103 100644
--- a/arch/powerpc/sysdev/fsl_soc.h
+++ b/arch/powerpc/sysdev/fsl_soc.h
@@ -8,5 +8,12 @@ extern phys_addr_t get_immrbase(void);
8extern u32 get_brgfreq(void); 8extern u32 get_brgfreq(void);
9extern u32 get_baudrate(void); 9extern u32 get_baudrate(void);
10 10
11struct spi_board_info;
12
13extern int fsl_spi_init(struct spi_board_info *board_infos,
14 unsigned int num_board_infos,
15 void (*activate_cs)(u8 cs, u8 polarity),
16 void (*deactivate_cs)(u8 cs, u8 polarity));
17
11#endif 18#endif
12#endif 19#endif
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c
index ad87adc975bc..7c1b27ac7d3c 100644
--- a/arch/powerpc/sysdev/i8259.c
+++ b/arch/powerpc/sysdev/i8259.c
@@ -25,7 +25,6 @@ static unsigned char cached_8259[2] = { 0xff, 0xff };
25 25
26static DEFINE_SPINLOCK(i8259_lock); 26static DEFINE_SPINLOCK(i8259_lock);
27 27
28static struct device_node *i8259_node;
29static struct irq_host *i8259_host; 28static struct irq_host *i8259_host;
30 29
31/* 30/*
@@ -165,7 +164,7 @@ static struct resource pic_edgectrl_iores = {
165 164
166static int i8259_host_match(struct irq_host *h, struct device_node *node) 165static int i8259_host_match(struct irq_host *h, struct device_node *node)
167{ 166{
168 return i8259_node == NULL || i8259_node == node; 167 return h->of_node == NULL || h->of_node == node;
169} 168}
170 169
171static int i8259_host_map(struct irq_host *h, unsigned int virq, 170static int i8259_host_map(struct irq_host *h, unsigned int virq,
@@ -276,9 +275,8 @@ void i8259_init(struct device_node *node, unsigned long intack_addr)
276 spin_unlock_irqrestore(&i8259_lock, flags); 275 spin_unlock_irqrestore(&i8259_lock, flags);
277 276
278 /* create a legacy host */ 277 /* create a legacy host */
279 if (node) 278 i8259_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LEGACY,
280 i8259_node = of_node_get(node); 279 0, &i8259_host_ops, 0);
281 i8259_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &i8259_host_ops, 0);
282 if (i8259_host == NULL) { 280 if (i8259_host == NULL) {
283 printk(KERN_ERR "i8259: failed to allocate irq host !\n"); 281 printk(KERN_ERR "i8259: failed to allocate irq host !\n");
284 return; 282 return;
diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
index 5294560c7b00..b5d068204aa3 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -144,8 +144,8 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
144 144
145static struct pci_ops indirect_pci_ops = 145static struct pci_ops indirect_pci_ops =
146{ 146{
147 indirect_read_config, 147 .read = indirect_read_config,
148 indirect_write_config 148 .write = indirect_write_config,
149}; 149};
150 150
151void __init 151void __init
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index 473c415e9e25..05a56e55804c 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -511,10 +511,8 @@ static struct irq_chip ipic_irq_chip = {
511 511
512static int ipic_host_match(struct irq_host *h, struct device_node *node) 512static int ipic_host_match(struct irq_host *h, struct device_node *node)
513{ 513{
514 struct ipic *ipic = h->host_data;
515
516 /* Exact match, unless ipic node is NULL */ 514 /* Exact match, unless ipic node is NULL */
517 return ipic->of_node == NULL || ipic->of_node == node; 515 return h->of_node == NULL || h->of_node == node;
518} 516}
519 517
520static int ipic_host_map(struct irq_host *h, unsigned int virq, 518static int ipic_host_map(struct irq_host *h, unsigned int virq,
@@ -568,9 +566,8 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
568 return NULL; 566 return NULL;
569 567
570 memset(ipic, 0, sizeof(struct ipic)); 568 memset(ipic, 0, sizeof(struct ipic));
571 ipic->of_node = of_node_get(node);
572 569
573 ipic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 570 ipic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR,
574 NR_IPIC_INTS, 571 NR_IPIC_INTS,
575 &ipic_host_ops, 0); 572 &ipic_host_ops, 0);
576 if (ipic->irqhost == NULL) { 573 if (ipic->irqhost == NULL) {
diff --git a/arch/powerpc/sysdev/ipic.h b/arch/powerpc/sysdev/ipic.h
index c28e589877eb..bb309a501b2d 100644
--- a/arch/powerpc/sysdev/ipic.h
+++ b/arch/powerpc/sysdev/ipic.h
@@ -48,9 +48,6 @@ struct ipic {
48 48
49 /* The "linux" controller struct */ 49 /* The "linux" controller struct */
50 struct irq_chip hc_irq; 50 struct irq_chip hc_irq;
51
52 /* The device node of the interrupt controller */
53 struct device_node *of_node;
54}; 51};
55 52
56struct ipic_info { 53struct ipic_info {
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c
index 2fc2bcd79b5e..565156ae65bc 100644
--- a/arch/powerpc/sysdev/mpc8xx_pic.c
+++ b/arch/powerpc/sysdev/mpc8xx_pic.c
@@ -19,7 +19,6 @@
19 19
20extern int cpm_get_irq(struct pt_regs *regs); 20extern int cpm_get_irq(struct pt_regs *regs);
21 21
22static struct device_node *mpc8xx_pic_node;
23static struct irq_host *mpc8xx_pic_host; 22static struct irq_host *mpc8xx_pic_host;
24#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 23#define NR_MASK_WORDS ((NR_IRQS + 31) / 32)
25static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; 24static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
@@ -120,11 +119,6 @@ unsigned int mpc8xx_get_irq(void)
120 119
121} 120}
122 121
123static int mpc8xx_pic_host_match(struct irq_host *h, struct device_node *node)
124{
125 return mpc8xx_pic_node == node;
126}
127
128static int mpc8xx_pic_host_map(struct irq_host *h, unsigned int virq, 122static int mpc8xx_pic_host_map(struct irq_host *h, unsigned int virq,
129 irq_hw_number_t hw) 123 irq_hw_number_t hw)
130{ 124{
@@ -158,7 +152,6 @@ static int mpc8xx_pic_host_xlate(struct irq_host *h, struct device_node *ct,
158 152
159 153
160static struct irq_host_ops mpc8xx_pic_host_ops = { 154static struct irq_host_ops mpc8xx_pic_host_ops = {
161 .match = mpc8xx_pic_host_match,
162 .map = mpc8xx_pic_host_map, 155 .map = mpc8xx_pic_host_map,
163 .xlate = mpc8xx_pic_host_xlate, 156 .xlate = mpc8xx_pic_host_xlate,
164}; 157};
@@ -176,22 +169,24 @@ int mpc8xx_pic_init(void)
176 return -ENOMEM; 169 return -ENOMEM;
177 } 170 }
178 171
179 mpc8xx_pic_node = of_node_get(np);
180
181 ret = of_address_to_resource(np, 0, &res); 172 ret = of_address_to_resource(np, 0, &res);
182 of_node_put(np);
183 if (ret) 173 if (ret)
184 return ret; 174 goto out;
185 175
186 siu_reg = (void *)ioremap(res.start, res.end - res.start + 1); 176 siu_reg = (void *)ioremap(res.start, res.end - res.start + 1);
187 if (siu_reg == NULL) 177 if (siu_reg == NULL) {
188 return -EINVAL; 178 ret = -EINVAL;
179 goto out;
180 }
189 181
190 mpc8xx_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &mpc8xx_pic_host_ops, 64); 182 mpc8xx_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR,
183 64, &mpc8xx_pic_host_ops, 64);
191 if (mpc8xx_pic_host == NULL) { 184 if (mpc8xx_pic_host == NULL) {
192 printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n"); 185 printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
193 ret = -ENOMEM; 186 ret = -ENOMEM;
194 } 187 }
195 188
189out:
190 of_node_put(np);
196 return ret; 191 return ret;
197} 192}
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 74c64c0d3b71..893e65439e85 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -156,8 +156,7 @@ static inline u32 _mpic_read(enum mpic_reg_type type,
156 switch(type) { 156 switch(type) {
157#ifdef CONFIG_PPC_DCR 157#ifdef CONFIG_PPC_DCR
158 case mpic_access_dcr: 158 case mpic_access_dcr:
159 return dcr_read(rb->dhost, 159 return dcr_read(rb->dhost, rb->dhost.base + reg);
160 rb->dbase + reg + rb->doff);
161#endif 160#endif
162 case mpic_access_mmio_be: 161 case mpic_access_mmio_be:
163 return in_be32(rb->base + (reg >> 2)); 162 return in_be32(rb->base + (reg >> 2));
@@ -174,8 +173,7 @@ static inline void _mpic_write(enum mpic_reg_type type,
174 switch(type) { 173 switch(type) {
175#ifdef CONFIG_PPC_DCR 174#ifdef CONFIG_PPC_DCR
176 case mpic_access_dcr: 175 case mpic_access_dcr:
177 return dcr_write(rb->dhost, 176 return dcr_write(rb->dhost, rb->dhost.base + reg, value);
178 rb->dbase + reg + rb->doff, value);
179#endif 177#endif
180 case mpic_access_mmio_be: 178 case mpic_access_mmio_be:
181 return out_be32(rb->base + (reg >> 2), value); 179 return out_be32(rb->base + (reg >> 2), value);
@@ -228,8 +226,13 @@ static inline u32 _mpic_irq_read(struct mpic *mpic, unsigned int src_no, unsigne
228 unsigned int isu = src_no >> mpic->isu_shift; 226 unsigned int isu = src_no >> mpic->isu_shift;
229 unsigned int idx = src_no & mpic->isu_mask; 227 unsigned int idx = src_no & mpic->isu_mask;
230 228
231 return _mpic_read(mpic->reg_type, &mpic->isus[isu], 229#ifdef CONFIG_MPIC_BROKEN_REGREAD
232 reg + (idx * MPIC_INFO(IRQ_STRIDE))); 230 if (reg == 0)
231 return mpic->isu_reg0_shadow[idx];
232 else
233#endif
234 return _mpic_read(mpic->reg_type, &mpic->isus[isu],
235 reg + (idx * MPIC_INFO(IRQ_STRIDE)));
233} 236}
234 237
235static inline void _mpic_irq_write(struct mpic *mpic, unsigned int src_no, 238static inline void _mpic_irq_write(struct mpic *mpic, unsigned int src_no,
@@ -240,6 +243,11 @@ static inline void _mpic_irq_write(struct mpic *mpic, unsigned int src_no,
240 243
241 _mpic_write(mpic->reg_type, &mpic->isus[isu], 244 _mpic_write(mpic->reg_type, &mpic->isus[isu],
242 reg + (idx * MPIC_INFO(IRQ_STRIDE)), value); 245 reg + (idx * MPIC_INFO(IRQ_STRIDE)), value);
246
247#ifdef CONFIG_MPIC_BROKEN_REGREAD
248 if (reg == 0)
249 mpic->isu_reg0_shadow[idx] = value;
250#endif
243} 251}
244 252
245#define mpic_read(b,r) _mpic_read(mpic->reg_type,&(b),(r)) 253#define mpic_read(b,r) _mpic_read(mpic->reg_type,&(b),(r))
@@ -269,9 +277,11 @@ static void _mpic_map_mmio(struct mpic *mpic, unsigned long phys_addr,
269static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb, 277static void _mpic_map_dcr(struct mpic *mpic, struct mpic_reg_bank *rb,
270 unsigned int offset, unsigned int size) 278 unsigned int offset, unsigned int size)
271{ 279{
272 rb->dbase = mpic->dcr_base; 280 const u32 *dbasep;
273 rb->doff = offset; 281
274 rb->dhost = dcr_map(mpic->of_node, rb->dbase + rb->doff, size); 282 dbasep = of_get_property(mpic->irqhost->of_node, "dcr-reg", NULL);
283
284 rb->dhost = dcr_map(mpic->irqhost->of_node, *dbasep + offset, size);
275 BUG_ON(!DCR_MAP_OK(rb->dhost)); 285 BUG_ON(!DCR_MAP_OK(rb->dhost));
276} 286}
277 287
@@ -758,7 +768,7 @@ static void mpic_end_ipi(unsigned int irq)
758 768
759#endif /* CONFIG_SMP */ 769#endif /* CONFIG_SMP */
760 770
761static void mpic_set_affinity(unsigned int irq, cpumask_t cpumask) 771void mpic_set_affinity(unsigned int irq, cpumask_t cpumask)
762{ 772{
763 struct mpic *mpic = mpic_from_irq(irq); 773 struct mpic *mpic = mpic_from_irq(irq);
764 unsigned int src = mpic_irq_to_hw(irq); 774 unsigned int src = mpic_irq_to_hw(irq);
@@ -861,10 +871,8 @@ static struct irq_chip mpic_irq_ht_chip = {
861 871
862static int mpic_host_match(struct irq_host *h, struct device_node *node) 872static int mpic_host_match(struct irq_host *h, struct device_node *node)
863{ 873{
864 struct mpic *mpic = h->host_data;
865
866 /* Exact match, unless mpic node is NULL */ 874 /* Exact match, unless mpic node is NULL */
867 return mpic->of_node == NULL || mpic->of_node == node; 875 return h->of_node == NULL || h->of_node == node;
868} 876}
869 877
870static int mpic_host_map(struct irq_host *h, unsigned int virq, 878static int mpic_host_map(struct irq_host *h, unsigned int virq,
@@ -985,10 +993,9 @@ struct mpic * __init mpic_alloc(struct device_node *node,
985 993
986 memset(mpic, 0, sizeof(struct mpic)); 994 memset(mpic, 0, sizeof(struct mpic));
987 mpic->name = name; 995 mpic->name = name;
988 mpic->of_node = of_node_get(node);
989 996
990 mpic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, isu_size, 997 mpic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR,
991 &mpic_host_ops, 998 isu_size, &mpic_host_ops,
992 flags & MPIC_LARGE_VECTORS ? 2048 : 256); 999 flags & MPIC_LARGE_VECTORS ? 2048 : 256);
993 if (mpic->irqhost == NULL) { 1000 if (mpic->irqhost == NULL) {
994 of_node_put(node); 1001 of_node_put(node);
@@ -1068,20 +1075,14 @@ struct mpic * __init mpic_alloc(struct device_node *node,
1068 BUG_ON(paddr == 0 && node == NULL); 1075 BUG_ON(paddr == 0 && node == NULL);
1069 1076
1070 /* If no physical address passed in, check if it's dcr based */ 1077 /* If no physical address passed in, check if it's dcr based */
1071 if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL) 1078 if (paddr == 0 && of_get_property(node, "dcr-reg", NULL) != NULL) {
1072 mpic->flags |= MPIC_USES_DCR;
1073
1074#ifdef CONFIG_PPC_DCR 1079#ifdef CONFIG_PPC_DCR
1075 if (mpic->flags & MPIC_USES_DCR) { 1080 mpic->flags |= MPIC_USES_DCR;
1076 const u32 *dbasep;
1077 dbasep = of_get_property(node, "dcr-reg", NULL);
1078 BUG_ON(dbasep == NULL);
1079 mpic->dcr_base = *dbasep;
1080 mpic->reg_type = mpic_access_dcr; 1081 mpic->reg_type = mpic_access_dcr;
1081 }
1082#else 1082#else
1083 BUG_ON (mpic->flags & MPIC_USES_DCR); 1083 BUG();
1084#endif /* CONFIG_PPC_DCR */ 1084#endif /* CONFIG_PPC_DCR */
1085 }
1085 1086
1086 /* If the MPIC is not DCR based, and no physical address was passed 1087 /* If the MPIC is not DCR based, and no physical address was passed
1087 * in, try to obtain one 1088 * in, try to obtain one
diff --git a/arch/powerpc/sysdev/mpic.h b/arch/powerpc/sysdev/mpic.h
index 3a1c3d2c594d..1cb6bd841027 100644
--- a/arch/powerpc/sysdev/mpic.h
+++ b/arch/powerpc/sysdev/mpic.h
@@ -34,5 +34,6 @@ extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type);
34extern void mpic_end_irq(unsigned int irq); 34extern void mpic_end_irq(unsigned int irq);
35extern void mpic_mask_irq(unsigned int irq); 35extern void mpic_mask_irq(unsigned int irq);
36extern void mpic_unmask_irq(unsigned int irq); 36extern void mpic_unmask_irq(unsigned int irq);
37extern void mpic_set_affinity(unsigned int irq, cpumask_t cpumask);
37 38
38#endif /* _POWERPC_SYSDEV_MPIC_H */ 39#endif /* _POWERPC_SYSDEV_MPIC_H */
diff --git a/arch/powerpc/sysdev/mpic_msi.c b/arch/powerpc/sysdev/mpic_msi.c
index b076793033c2..d272a52ecd24 100644
--- a/arch/powerpc/sysdev/mpic_msi.c
+++ b/arch/powerpc/sysdev/mpic_msi.c
@@ -9,7 +9,6 @@
9 */ 9 */
10 10
11#include <linux/irq.h> 11#include <linux/irq.h>
12#include <linux/bootmem.h>
13#include <linux/bitmap.h> 12#include <linux/bitmap.h>
14#include <linux/msi.h> 13#include <linux/msi.h>
15#include <asm/mpic.h> 14#include <asm/mpic.h>
@@ -117,16 +116,17 @@ static int mpic_msi_reserve_dt_hwirqs(struct mpic *mpic)
117 int i, len; 116 int i, len;
118 const u32 *p; 117 const u32 *p;
119 118
120 p = of_get_property(mpic->of_node, "msi-available-ranges", &len); 119 p = of_get_property(mpic->irqhost->of_node,
120 "msi-available-ranges", &len);
121 if (!p) { 121 if (!p) {
122 pr_debug("mpic: no msi-available-ranges property found on %s\n", 122 pr_debug("mpic: no msi-available-ranges property found on %s\n",
123 mpic->of_node->full_name); 123 mpic->irqhost->of_node->full_name);
124 return -ENODEV; 124 return -ENODEV;
125 } 125 }
126 126
127 if (len % 8 != 0) { 127 if (len % 8 != 0) {
128 printk(KERN_WARNING "mpic: Malformed msi-available-ranges " 128 printk(KERN_WARNING "mpic: Malformed msi-available-ranges "
129 "property on %s\n", mpic->of_node->full_name); 129 "property on %s\n", mpic->irqhost->of_node->full_name);
130 return -EINVAL; 130 return -EINVAL;
131 } 131 }
132 132
@@ -151,10 +151,7 @@ int mpic_msi_init_allocator(struct mpic *mpic)
151 size = BITS_TO_LONGS(mpic->irq_count) * sizeof(long); 151 size = BITS_TO_LONGS(mpic->irq_count) * sizeof(long);
152 pr_debug("mpic: allocator bitmap size is 0x%x bytes\n", size); 152 pr_debug("mpic: allocator bitmap size is 0x%x bytes\n", size);
153 153
154 if (mem_init_done) 154 mpic->hwirq_bitmap = alloc_maybe_bootmem(size, GFP_KERNEL);
155 mpic->hwirq_bitmap = kmalloc(size, GFP_KERNEL);
156 else
157 mpic->hwirq_bitmap = alloc_bootmem(size);
158 155
159 if (!mpic->hwirq_bitmap) { 156 if (!mpic->hwirq_bitmap) {
160 pr_debug("mpic: ENOMEM allocating allocator bitmap!\n"); 157 pr_debug("mpic: ENOMEM allocating allocator bitmap!\n");
diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c
index 305b864c25d9..1d5a40899b74 100644
--- a/arch/powerpc/sysdev/mpic_u3msi.c
+++ b/arch/powerpc/sysdev/mpic_u3msi.c
@@ -40,6 +40,7 @@ static struct irq_chip mpic_u3msi_chip = {
40 .unmask = mpic_u3msi_unmask_irq, 40 .unmask = mpic_u3msi_unmask_irq,
41 .eoi = mpic_end_irq, 41 .eoi = mpic_end_irq,
42 .set_type = mpic_set_irq_type, 42 .set_type = mpic_set_irq_type,
43 .set_affinity = mpic_set_affinity,
43 .typename = "MPIC-U3MSI", 44 .typename = "MPIC-U3MSI",
44}; 45};
45 46
@@ -107,59 +108,46 @@ static void u3msi_teardown_msi_irqs(struct pci_dev *pdev)
107 return; 108 return;
108} 109}
109 110
110static void u3msi_compose_msi_msg(struct pci_dev *pdev, int virq,
111 struct msi_msg *msg)
112{
113 u64 addr;
114
115 addr = find_ht_magic_addr(pdev);
116 msg->address_lo = addr & 0xFFFFFFFF;
117 msg->address_hi = addr >> 32;
118 msg->data = virq_to_hw(virq);
119
120 pr_debug("u3msi: allocated virq 0x%x (hw 0x%lx) at address 0x%lx\n",
121 virq, virq_to_hw(virq), addr);
122}
123
124static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) 111static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
125{ 112{
126 irq_hw_number_t hwirq; 113 irq_hw_number_t hwirq;
127 int rc;
128 unsigned int virq; 114 unsigned int virq;
129 struct msi_desc *entry; 115 struct msi_desc *entry;
130 struct msi_msg msg; 116 struct msi_msg msg;
117 u64 addr;
118
119 addr = find_ht_magic_addr(pdev);
120 msg.address_lo = addr & 0xFFFFFFFF;
121 msg.address_hi = addr >> 32;
131 122
132 list_for_each_entry(entry, &pdev->msi_list, list) { 123 list_for_each_entry(entry, &pdev->msi_list, list) {
133 hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1); 124 hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1);
134 if (hwirq < 0) { 125 if (hwirq < 0) {
135 rc = hwirq;
136 pr_debug("u3msi: failed allocating hwirq\n"); 126 pr_debug("u3msi: failed allocating hwirq\n");
137 goto out_free; 127 return hwirq;
138 } 128 }
139 129
140 virq = irq_create_mapping(msi_mpic->irqhost, hwirq); 130 virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
141 if (virq == NO_IRQ) { 131 if (virq == NO_IRQ) {
142 pr_debug("u3msi: failed mapping hwirq 0x%lx\n", hwirq); 132 pr_debug("u3msi: failed mapping hwirq 0x%lx\n", hwirq);
143 mpic_msi_free_hwirqs(msi_mpic, hwirq, 1); 133 mpic_msi_free_hwirqs(msi_mpic, hwirq, 1);
144 rc = -ENOSPC; 134 return -ENOSPC;
145 goto out_free;
146 } 135 }
147 136
148 set_irq_msi(virq, entry); 137 set_irq_msi(virq, entry);
149 set_irq_chip(virq, &mpic_u3msi_chip); 138 set_irq_chip(virq, &mpic_u3msi_chip);
150 set_irq_type(virq, IRQ_TYPE_EDGE_RISING); 139 set_irq_type(virq, IRQ_TYPE_EDGE_RISING);
151 140
152 u3msi_compose_msi_msg(pdev, virq, &msg); 141 pr_debug("u3msi: allocated virq 0x%x (hw 0x%lx) addr 0x%lx\n",
142 virq, hwirq, addr);
143
144 msg.data = hwirq;
153 write_msi_msg(virq, &msg); 145 write_msi_msg(virq, &msg);
154 146
155 hwirq++; 147 hwirq++;
156 } 148 }
157 149
158 return 0; 150 return 0;
159
160 out_free:
161 u3msi_teardown_msi_irqs(pdev);
162 return rc;
163} 151}
164 152
165int mpic_u3msi_init(struct mpic *mpic) 153int mpic_u3msi_init(struct mpic *mpic)
diff --git a/arch/powerpc/sysdev/mv64x60.h b/arch/powerpc/sysdev/mv64x60.h
index 2ff0b4ef2681..4f618fa465c0 100644
--- a/arch/powerpc/sysdev/mv64x60.h
+++ b/arch/powerpc/sysdev/mv64x60.h
@@ -7,5 +7,6 @@ extern void __init mv64x60_init_irq(void);
7extern unsigned int mv64x60_get_irq(void); 7extern unsigned int mv64x60_get_irq(void);
8 8
9extern void __init mv64x60_pci_init(void); 9extern void __init mv64x60_pci_init(void);
10extern void __init mv64x60_init_early(void);
10 11
11#endif /* __MV64X60_H__ */ 12#endif /* __MV64X60_H__ */
diff --git a/arch/powerpc/sysdev/mv64x60_pic.c b/arch/powerpc/sysdev/mv64x60_pic.c
index 01d316287772..19e6ef263797 100644
--- a/arch/powerpc/sysdev/mv64x60_pic.c
+++ b/arch/powerpc/sysdev/mv64x60_pic.c
@@ -202,11 +202,6 @@ static struct irq_chip mv64x60_chip_gpp = {
202 * mv64x60_host_ops functions 202 * mv64x60_host_ops functions
203 */ 203 */
204 204
205static int mv64x60_host_match(struct irq_host *h, struct device_node *np)
206{
207 return mv64x60_irq_host->host_data == np;
208}
209
210static struct irq_chip *mv64x60_chips[] = { 205static struct irq_chip *mv64x60_chips[] = {
211 [MV64x60_LEVEL1_LOW] = &mv64x60_chip_low, 206 [MV64x60_LEVEL1_LOW] = &mv64x60_chip_low,
212 [MV64x60_LEVEL1_HIGH] = &mv64x60_chip_high, 207 [MV64x60_LEVEL1_HIGH] = &mv64x60_chip_high,
@@ -228,7 +223,6 @@ static int mv64x60_host_map(struct irq_host *h, unsigned int virq,
228} 223}
229 224
230static struct irq_host_ops mv64x60_host_ops = { 225static struct irq_host_ops mv64x60_host_ops = {
231 .match = mv64x60_host_match,
232 .map = mv64x60_host_map, 226 .map = mv64x60_host_map,
233}; 227};
234 228
@@ -253,14 +247,12 @@ void __init mv64x60_init_irq(void)
253 np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-pic"); 247 np = of_find_compatible_node(NULL, NULL, "marvell,mv64x60-pic");
254 reg = of_get_property(np, "reg", &size); 248 reg = of_get_property(np, "reg", &size);
255 paddr = of_translate_address(np, reg); 249 paddr = of_translate_address(np, reg);
256 of_node_put(np);
257 mv64x60_irq_reg_base = ioremap(paddr, reg[1]); 250 mv64x60_irq_reg_base = ioremap(paddr, reg[1]);
258 251
259 mv64x60_irq_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, MV64x60_NUM_IRQS, 252 mv64x60_irq_host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR,
253 MV64x60_NUM_IRQS,
260 &mv64x60_host_ops, MV64x60_NUM_IRQS); 254 &mv64x60_host_ops, MV64x60_NUM_IRQS);
261 255
262 mv64x60_irq_host->host_data = np;
263
264 spin_lock_irqsave(&mv64x60_lock, flags); 256 spin_lock_irqsave(&mv64x60_lock, flags);
265 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_INTR_MASK, 257 out_le32(mv64x60_gpp_reg_base + MV64x60_GPP_INTR_MASK,
266 mv64x60_cached_gpp_mask); 258 mv64x60_cached_gpp_mask);
diff --git a/arch/powerpc/sysdev/mv64x60_udbg.c b/arch/powerpc/sysdev/mv64x60_udbg.c
new file mode 100644
index 000000000000..367e7b13ec00
--- /dev/null
+++ b/arch/powerpc/sysdev/mv64x60_udbg.c
@@ -0,0 +1,152 @@
1/*
2 * udbg serial input/output routines for the Marvell MV64x60 (Discovery).
3 *
4 * Author: Dale Farnsworth <dale@farnsworth.org>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <asm/io.h>
13#include <asm/prom.h>
14#include <asm/udbg.h>
15
16#include <sysdev/mv64x60.h>
17
18#define MPSC_0_CR1_OFFSET 0x000c
19
20#define MPSC_0_CR2_OFFSET 0x0010
21#define MPSC_CHR_2_TCS (1 << 9)
22
23#define MPSC_0_CHR_10_OFFSET 0x0030
24
25#define MPSC_INTR_CAUSE_OFF_0 0x0004
26#define MPSC_INTR_CAUSE_OFF_1 0x000c
27#define MPSC_INTR_CAUSE_RCC (1<<6)
28
29static void __iomem *mpsc_base;
30static void __iomem *mpsc_intr_cause;
31
32static void mv64x60_udbg_putc(char c)
33{
34 if (c == '\n')
35 mv64x60_udbg_putc('\r');
36
37 while(in_le32(mpsc_base + MPSC_0_CR2_OFFSET) & MPSC_CHR_2_TCS)
38 ;
39 out_le32(mpsc_base + MPSC_0_CR1_OFFSET, c);
40 out_le32(mpsc_base + MPSC_0_CR2_OFFSET, MPSC_CHR_2_TCS);
41}
42
43static int mv64x60_udbg_testc(void)
44{
45 return (in_le32(mpsc_intr_cause) & MPSC_INTR_CAUSE_RCC) != 0;
46}
47
48static int mv64x60_udbg_getc(void)
49{
50 int cause = 0;
51 int c;
52
53 while (!mv64x60_udbg_testc())
54 ;
55
56 c = in_8(mpsc_base + MPSC_0_CHR_10_OFFSET + 2);
57 out_8(mpsc_base + MPSC_0_CHR_10_OFFSET + 2, c);
58 out_le32(mpsc_intr_cause, cause & ~MPSC_INTR_CAUSE_RCC);
59 return c;
60}
61
62static int mv64x60_udbg_getc_poll(void)
63{
64 if (!mv64x60_udbg_testc())
65 return -1;
66
67 return mv64x60_udbg_getc();
68}
69
70static void mv64x60_udbg_init(void)
71{
72 struct device_node *np, *mpscintr, *stdout = NULL;
73 const char *path;
74 const phandle *ph;
75 struct resource r[2];
76 const int *block_index;
77 int intr_cause_offset;
78 int err;
79
80 path = of_get_property(of_chosen, "linux,stdout-path", NULL);
81 if (!path)
82 return;
83
84 stdout = of_find_node_by_path(path);
85 if (!stdout)
86 return;
87
88 for (np = NULL;
89 (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); )
90 if (np == stdout)
91 break;
92
93 of_node_put(stdout);
94 if (!np)
95 return;
96
97 block_index = of_get_property(np, "block-index", NULL);
98 if (!block_index)
99 goto error;
100
101 switch (*block_index) {
102 case 0:
103 intr_cause_offset = MPSC_INTR_CAUSE_OFF_0;
104 break;
105 case 1:
106 intr_cause_offset = MPSC_INTR_CAUSE_OFF_1;
107 break;
108 default:
109 goto error;
110 }
111
112 err = of_address_to_resource(np, 0, &r[0]);
113 if (err)
114 goto error;
115
116 ph = of_get_property(np, "mpscintr", NULL);
117 mpscintr = of_find_node_by_phandle(*ph);
118 if (!mpscintr)
119 goto error;
120
121 err = of_address_to_resource(mpscintr, 0, &r[1]);
122 of_node_put(mpscintr);
123 if (err)
124 goto error;
125
126 of_node_put(np);
127
128 mpsc_base = ioremap(r[0].start, r[0].end - r[0].start + 1);
129 if (!mpsc_base)
130 return;
131
132 mpsc_intr_cause = ioremap(r[1].start, r[1].end - r[1].start + 1);
133 if (!mpsc_intr_cause) {
134 iounmap(mpsc_base);
135 return;
136 }
137 mpsc_intr_cause += intr_cause_offset;
138
139 udbg_putc = mv64x60_udbg_putc;
140 udbg_getc = mv64x60_udbg_getc;
141 udbg_getc_poll = mv64x60_udbg_getc_poll;
142
143 return;
144
145error:
146 of_node_put(np);
147}
148
149void mv64x60_init_early(void)
150{
151 mv64x60_udbg_init();
152}
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 4d1dcb45963d..55e6f394af82 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -245,10 +245,8 @@ static struct irq_chip qe_ic_irq_chip = {
245 245
246static int qe_ic_host_match(struct irq_host *h, struct device_node *node) 246static int qe_ic_host_match(struct irq_host *h, struct device_node *node)
247{ 247{
248 struct qe_ic *qe_ic = h->host_data;
249
250 /* Exact match, unless qe_ic node is NULL */ 248 /* Exact match, unless qe_ic node is NULL */
251 return qe_ic->of_node == NULL || qe_ic->of_node == node; 249 return h->of_node == NULL || h->of_node == node;
252} 250}
253 251
254static int qe_ic_host_map(struct irq_host *h, unsigned int virq, 252static int qe_ic_host_map(struct irq_host *h, unsigned int virq,
@@ -352,9 +350,8 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags)
352 return; 350 return;
353 351
354 memset(qe_ic, 0, sizeof(struct qe_ic)); 352 memset(qe_ic, 0, sizeof(struct qe_ic));
355 qe_ic->of_node = of_node_get(node);
356 353
357 qe_ic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 354 qe_ic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR,
358 NR_QE_IC_INTS, &qe_ic_host_ops, 0); 355 NR_QE_IC_INTS, &qe_ic_host_ops, 0);
359 if (qe_ic->irqhost == NULL) { 356 if (qe_ic->irqhost == NULL) {
360 of_node_put(node); 357 of_node_put(node);
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.h b/arch/powerpc/sysdev/qe_lib/qe_ic.h
index 9a631adb189d..c1361d005a8a 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.h
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.h
@@ -84,9 +84,6 @@ struct qe_ic {
84 /* The "linux" controller struct */ 84 /* The "linux" controller struct */
85 struct irq_chip hc_irq; 85 struct irq_chip hc_irq;
86 86
87 /* The device node of the interrupt controller */
88 struct device_node *of_node;
89
90 /* VIRQ numbers of QE high/low irqs */ 87 /* VIRQ numbers of QE high/low irqs */
91 unsigned int virq_high; 88 unsigned int virq_high;
92 unsigned int virq_low; 89 unsigned int virq_low;
diff --git a/arch/powerpc/sysdev/timer.c b/arch/powerpc/sysdev/timer.c
deleted file mode 100644
index e81e7ec2e799..000000000000
--- a/arch/powerpc/sysdev/timer.c
+++ /dev/null
@@ -1,81 +0,0 @@
1/*
2 * Common code to keep time when machine suspends.
3 *
4 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
5 *
6 * GPLv2
7 */
8
9#include <linux/time.h>
10#include <linux/sysdev.h>
11#include <asm/rtc.h>
12
13static unsigned long suspend_rtc_time;
14
15/*
16 * Reset the time after a sleep.
17 */
18static int timer_resume(struct sys_device *dev)
19{
20 struct timeval tv;
21 struct timespec ts;
22 struct rtc_time cur_rtc_tm;
23 unsigned long cur_rtc_time, diff;
24
25 /* get current RTC time and convert to seconds */
26 get_rtc_time(&cur_rtc_tm);
27 cur_rtc_time = mktime(cur_rtc_tm.tm_year + 1900,
28 cur_rtc_tm.tm_mon + 1,
29 cur_rtc_tm.tm_mday,
30 cur_rtc_tm.tm_hour,
31 cur_rtc_tm.tm_min,
32 cur_rtc_tm.tm_sec);
33
34 diff = cur_rtc_time - suspend_rtc_time;
35
36 /* adjust time of day by seconds that elapsed while
37 * we were suspended */
38 do_gettimeofday(&tv);
39 ts.tv_sec = tv.tv_sec + diff;
40 ts.tv_nsec = tv.tv_usec * NSEC_PER_USEC;
41 do_settimeofday(&ts);
42
43 return 0;
44}
45
46static int timer_suspend(struct sys_device *dev, pm_message_t state)
47{
48 struct rtc_time suspend_rtc_tm;
49 WARN_ON(!ppc_md.get_rtc_time);
50
51 get_rtc_time(&suspend_rtc_tm);
52 suspend_rtc_time = mktime(suspend_rtc_tm.tm_year + 1900,
53 suspend_rtc_tm.tm_mon + 1,
54 suspend_rtc_tm.tm_mday,
55 suspend_rtc_tm.tm_hour,
56 suspend_rtc_tm.tm_min,
57 suspend_rtc_tm.tm_sec);
58
59 return 0;
60}
61
62static struct sysdev_class timer_sysclass = {
63 .resume = timer_resume,
64 .suspend = timer_suspend,
65 set_kset_name("timer"),
66};
67
68static struct sys_device device_timer = {
69 .id = 0,
70 .cls = &timer_sysclass,
71};
72
73static int time_init_device(void)
74{
75 int error = sysdev_class_register(&timer_sysclass);
76 if (!error)
77 error = sysdev_register(&device_timer);
78 return error;
79}
80
81device_initcall(time_init_device);
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c
index 90db8a720fed..31d3d33d91fc 100644
--- a/arch/powerpc/sysdev/tsi108_pci.c
+++ b/arch/powerpc/sysdev/tsi108_pci.c
@@ -52,7 +52,6 @@
52u32 tsi108_pci_cfg_base; 52u32 tsi108_pci_cfg_base;
53static u32 tsi108_pci_cfg_phys; 53static u32 tsi108_pci_cfg_phys;
54u32 tsi108_csr_vir_base; 54u32 tsi108_csr_vir_base;
55static struct device_node *pci_irq_node;
56static struct irq_host *pci_irq_host; 55static struct irq_host *pci_irq_host;
57 56
58extern u32 get_vir_csrbase(void); 57extern u32 get_vir_csrbase(void);
@@ -193,8 +192,8 @@ void tsi108_clear_pci_cfg_error(void)
193} 192}
194 193
195static struct pci_ops tsi108_direct_pci_ops = { 194static struct pci_ops tsi108_direct_pci_ops = {
196 tsi108_direct_read_config, 195 .read = tsi108_direct_read_config,
197 tsi108_direct_write_config 196 .write = tsi108_direct_write_config,
198}; 197};
199 198
200int __init tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary) 199int __init tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary)
@@ -405,13 +404,7 @@ static int pci_irq_host_map(struct irq_host *h, unsigned int virq,
405 return 0; 404 return 0;
406} 405}
407 406
408static int pci_irq_host_match(struct irq_host *h, struct device_node *node)
409{
410 return pci_irq_node == node;
411}
412
413static struct irq_host_ops pci_irq_host_ops = { 407static struct irq_host_ops pci_irq_host_ops = {
414 .match = pci_irq_host_match,
415 .map = pci_irq_host_map, 408 .map = pci_irq_host_map,
416 .xlate = pci_irq_host_xlate, 409 .xlate = pci_irq_host_xlate,
417}; 410};
@@ -433,10 +426,11 @@ void __init tsi108_pci_int_init(struct device_node *node)
433{ 426{
434 DBG("Tsi108_pci_int_init: initializing PCI interrupts\n"); 427 DBG("Tsi108_pci_int_init: initializing PCI interrupts\n");
435 428
436 pci_irq_node = of_node_get(node); 429 pci_irq_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LEGACY,
437 pci_irq_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &pci_irq_host_ops, 0); 430 0, &pci_irq_host_ops, 0);
438 if (pci_irq_host == NULL) { 431 if (pci_irq_host == NULL) {
439 printk(KERN_ERR "pci_irq_host: failed to allocate irq host !\n"); 432 printk(KERN_ERR "pci_irq_host: failed to allocate irq host !\n");
433 of_node_put(node);
440 return; 434 return;
441 } 435 }
442 436
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 89059895a20d..5149716c734d 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -24,6 +24,7 @@
24#include <linux/spinlock.h> 24#include <linux/spinlock.h>
25#include <linux/irq.h> 25#include <linux/irq.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/kernel_stat.h>
27#include <asm/irq.h> 28#include <asm/irq.h>
28#include <asm/io.h> 29#include <asm/io.h>
29#include <asm/prom.h> 30#include <asm/prom.h>
@@ -55,9 +56,6 @@ struct uic {
55 56
56 /* For secondary UICs, the cascade interrupt's irqaction */ 57 /* For secondary UICs, the cascade interrupt's irqaction */
57 struct irqaction cascade; 58 struct irqaction cascade;
58
59 /* The device node of the interrupt controller */
60 struct device_node *of_node;
61}; 59};
62 60
63static void uic_unmask_irq(unsigned int virq) 61static void uic_unmask_irq(unsigned int virq)
@@ -142,7 +140,7 @@ static int uic_set_irq_type(unsigned int virq, unsigned int flow_type)
142 140
143 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL); 141 desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
144 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK; 142 desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
145 if (trigger) 143 if (!trigger)
146 desc->status |= IRQ_LEVEL; 144 desc->status |= IRQ_LEVEL;
147 145
148 spin_unlock_irqrestore(&uic->lock, flags); 146 spin_unlock_irqrestore(&uic->lock, flags);
@@ -159,10 +157,62 @@ static struct irq_chip uic_irq_chip = {
159 .set_type = uic_set_irq_type, 157 .set_type = uic_set_irq_type,
160}; 158};
161 159
162static int uic_host_match(struct irq_host *h, struct device_node *node) 160/**
161 * handle_uic_irq - irq flow handler for UIC
162 * @irq: the interrupt number
163 * @desc: the interrupt description structure for this irq
164 *
165 * This is modified version of the generic handle_level_irq() suitable
166 * for the UIC. On the UIC, acking (i.e. clearing the SR bit) a level
167 * irq will have no effect if the interrupt is still asserted by the
168 * device, even if the interrupt is already masked. Therefore, unlike
169 * the standard handle_level_irq(), we must ack the interrupt *after*
170 * invoking the ISR (which should have de-asserted the interrupt in
171 * the external source). For edge interrupts we ack at the beginning
172 * instead of the end, to keep the window in which we can miss an
173 * interrupt as small as possible.
174 */
175void fastcall handle_uic_irq(unsigned int irq, struct irq_desc *desc)
163{ 176{
164 struct uic *uic = h->host_data; 177 unsigned int cpu = smp_processor_id();
165 return uic->of_node == node; 178 struct irqaction *action;
179 irqreturn_t action_ret;
180
181 spin_lock(&desc->lock);
182 if (desc->status & IRQ_LEVEL)
183 desc->chip->mask(irq);
184 else
185 desc->chip->mask_ack(irq);
186
187 if (unlikely(desc->status & IRQ_INPROGRESS))
188 goto out_unlock;
189 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
190 kstat_cpu(cpu).irqs[irq]++;
191
192 /*
193 * If its disabled or no action available
194 * keep it masked and get out of here
195 */
196 action = desc->action;
197 if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
198 desc->status |= IRQ_PENDING;
199 goto out_unlock;
200 }
201
202 desc->status |= IRQ_INPROGRESS;
203 desc->status &= ~IRQ_PENDING;
204 spin_unlock(&desc->lock);
205
206 action_ret = handle_IRQ_event(irq, action);
207
208 spin_lock(&desc->lock);
209 desc->status &= ~IRQ_INPROGRESS;
210 if (desc->status & IRQ_LEVEL)
211 desc->chip->ack(irq);
212 if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
213 desc->chip->unmask(irq);
214out_unlock:
215 spin_unlock(&desc->lock);
166} 216}
167 217
168static int uic_host_map(struct irq_host *h, unsigned int virq, 218static int uic_host_map(struct irq_host *h, unsigned int virq,
@@ -173,7 +223,7 @@ static int uic_host_map(struct irq_host *h, unsigned int virq,
173 set_irq_chip_data(virq, uic); 223 set_irq_chip_data(virq, uic);
174 /* Despite the name, handle_level_irq() works for both level 224 /* Despite the name, handle_level_irq() works for both level
175 * and edge irqs on UIC. FIXME: check this is correct */ 225 * and edge irqs on UIC. FIXME: check this is correct */
176 set_irq_chip_and_handler(virq, &uic_irq_chip, handle_level_irq); 226 set_irq_chip_and_handler(virq, &uic_irq_chip, handle_uic_irq);
177 227
178 /* Set default irq type */ 228 /* Set default irq type */
179 set_irq_type(virq, IRQ_TYPE_NONE); 229 set_irq_type(virq, IRQ_TYPE_NONE);
@@ -194,7 +244,6 @@ static int uic_host_xlate(struct irq_host *h, struct device_node *ct,
194} 244}
195 245
196static struct irq_host_ops uic_host_ops = { 246static struct irq_host_ops uic_host_ops = {
197 .match = uic_host_match,
198 .map = uic_host_map, 247 .map = uic_host_map,
199 .xlate = uic_host_xlate, 248 .xlate = uic_host_xlate,
200}; 249};
@@ -207,6 +256,9 @@ irqreturn_t uic_cascade(int virq, void *data)
207 int subvirq; 256 int subvirq;
208 257
209 msr = mfdcr(uic->dcrbase + UIC_MSR); 258 msr = mfdcr(uic->dcrbase + UIC_MSR);
259 if (!msr) /* spurious interrupt */
260 return IRQ_HANDLED;
261
210 src = 32 - ffs(msr); 262 src = 32 - ffs(msr);
211 263
212 subvirq = irq_linear_revmap(uic->irqhost, src); 264 subvirq = irq_linear_revmap(uic->irqhost, src);
@@ -229,7 +281,6 @@ static struct uic * __init uic_init_one(struct device_node *node)
229 281
230 memset(uic, 0, sizeof(*uic)); 282 memset(uic, 0, sizeof(*uic));
231 spin_lock_init(&uic->lock); 283 spin_lock_init(&uic->lock);
232 uic->of_node = of_node_get(node);
233 indexp = of_get_property(node, "cell-index", &len); 284 indexp = of_get_property(node, "cell-index", &len);
234 if (!indexp || (len != sizeof(u32))) { 285 if (!indexp || (len != sizeof(u32))) {
235 printk(KERN_ERR "uic: Device node %s has missing or invalid " 286 printk(KERN_ERR "uic: Device node %s has missing or invalid "
@@ -246,8 +297,8 @@ static struct uic * __init uic_init_one(struct device_node *node)
246 } 297 }
247 uic->dcrbase = *dcrreg; 298 uic->dcrbase = *dcrreg;
248 299
249 uic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, NR_UIC_INTS, 300 uic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR,
250 &uic_host_ops, -1); 301 NR_UIC_INTS, &uic_host_ops, -1);
251 if (! uic->irqhost) { 302 if (! uic->irqhost) {
252 of_node_put(node); 303 of_node_put(node);
253 return NULL; /* FIXME: panic? */ 304 return NULL; /* FIXME: panic? */
diff --git a/arch/ppc/.gitignore b/arch/ppc/.gitignore
index a1a869c8c840..1e79a0ae4473 100644
--- a/arch/ppc/.gitignore
+++ b/arch/ppc/.gitignore
@@ -1 +1 @@
include /include
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 6bdeeb70b157..20dce4681259 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -4,6 +4,10 @@
4 4
5mainmenu "Linux/PowerPC Kernel Configuration" 5mainmenu "Linux/PowerPC Kernel Configuration"
6 6
7config WORD_SIZE
8 int
9 default 32
10
7config MMU 11config MMU
8 bool 12 bool
9 default y 13 default y
@@ -573,24 +577,9 @@ choice
573 577
574 Select PReP if configuring for a PReP machine. 578 Select PReP if configuring for a PReP machine.
575 579
576 Select Gemini if configuring for a Synergy Microsystems' Gemini
577 series Single Board Computer. More information is available at:
578 <http://www.synergymicro.com/PressRel/97_10_15.html>.
579
580 Select APUS if configuring for a PowerUP Amiga. More information is
581 available at: <http://linux-apus.sourceforge.net/>.
582
583config PPC_PREP 580config PPC_PREP
584 bool "PReP" 581 bool "PReP"
585 582
586config APUS
587 bool "Amiga-APUS"
588 depends on BROKEN
589 help
590 Select APUS if configuring for a PowerUP Amiga.
591 More information is available at:
592 <http://linux-apus.sourceforge.net/>.
593
594config KATANA 583config KATANA
595 bool "Artesyn-Katana" 584 bool "Artesyn-Katana"
596 help 585 help
@@ -1027,133 +1016,7 @@ config CMDLINE
1027 some command-line options at build time by entering them here. In 1016 some command-line options at build time by entering them here. In
1028 most cases you will need to specify the root device here. 1017 most cases you will need to specify the root device here.
1029 1018
1030config AMIGA 1019if BROKEN
1031 bool
1032 depends on APUS
1033 default y
1034 help
1035 This option enables support for the Amiga series of computers.
1036
1037config ZORRO
1038 bool
1039 depends on APUS
1040 default y
1041 help
1042 This enables support for the Zorro bus in the Amiga. If you have
1043 expansion cards in your Amiga that conform to the Amiga
1044 AutoConfig(tm) specification, say Y, otherwise N. Note that even
1045 expansion cards that do not fit in the Zorro slots but fit in e.g.
1046 the CPU slot may fall in this category, so you have to say Y to let
1047 Linux use these.
1048
1049config ABSTRACT_CONSOLE
1050 bool
1051 depends on APUS
1052 default y
1053
1054config APUS_FAST_EXCEPT
1055 bool
1056 depends on APUS
1057 default y
1058
1059config AMIGA_PCMCIA
1060 bool "Amiga 1200/600 PCMCIA support"
1061 depends on APUS && EXPERIMENTAL
1062 help
1063 Include support in the kernel for pcmcia on Amiga 1200 and Amiga
1064 600. If you intend to use pcmcia cards say Y; otherwise say N.
1065
1066config AMIGA_BUILTIN_SERIAL
1067 tristate "Amiga builtin serial support"
1068 depends on APUS
1069 help
1070 If you want to use your Amiga's built-in serial port in Linux,
1071 answer Y.
1072
1073 To compile this driver as a module, choose M here.
1074
1075config GVPIOEXT
1076 tristate "GVP IO-Extender support"
1077 depends on APUS
1078 help
1079 If you want to use a GVP IO-Extender serial card in Linux, say Y.
1080 Otherwise, say N.
1081
1082config GVPIOEXT_LP
1083 tristate "GVP IO-Extender parallel printer support"
1084 depends on GVPIOEXT
1085 help
1086 Say Y to enable driving a printer from the parallel port on your
1087 GVP IO-Extender card, N otherwise.
1088
1089config GVPIOEXT_PLIP
1090 tristate "GVP IO-Extender PLIP support"
1091 depends on GVPIOEXT
1092 help
1093 Say Y to enable doing IP over the parallel port on your GVP
1094 IO-Extender card, N otherwise.
1095
1096config MULTIFACE_III_TTY
1097 tristate "Multiface Card III serial support"
1098 depends on APUS
1099 help
1100 If you want to use a Multiface III card's serial port in Linux,
1101 answer Y.
1102
1103 To compile this driver as a module, choose M here.
1104
1105config A2232
1106 tristate "Commodore A2232 serial support (EXPERIMENTAL)"
1107 depends on EXPERIMENTAL && APUS
1108 ---help---
1109 This option supports the 2232 7-port serial card shipped with the
1110 Amiga 2000 and other Zorro-bus machines, dating from 1989. At
1111 a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip
1112 each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The
1113 ports were connected with 8 pin DIN connectors on the card bracket,
1114 for which 8 pin to DB25 adapters were supplied. The card also had
1115 jumpers internally to toggle various pinning configurations.
1116
1117 This driver can be built as a module; but then "generic_serial"
1118 will also be built as a module. This has to be loaded before
1119 "ser_a2232". If you want to do this, answer M here.
1120
1121config WHIPPET_SERIAL
1122 tristate "Hisoft Whippet PCMCIA serial support"
1123 depends on AMIGA_PCMCIA
1124 help
1125 HiSoft has a web page at <http://www.hisoft.co.uk/>, but there
1126 is no listing for the Whippet in their Amiga section.
1127
1128config APNE
1129 tristate "PCMCIA NE2000 support"
1130 depends on AMIGA_PCMCIA
1131 help
1132 If you have a PCMCIA NE2000 compatible adapter, say Y. Otherwise,
1133 say N.
1134
1135 To compile this driver as a module, choose M here: the
1136 module will be called apne.
1137
1138config SERIAL_CONSOLE
1139 bool "Support for serial port console"
1140 depends on APUS && (AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y)
1141
1142config HEARTBEAT
1143 bool "Use power LED as a heartbeat"
1144 depends on APUS
1145 help
1146 Use the power-on LED on your machine as a load meter. The exact
1147 behavior is platform-dependent, but normally the flash frequency is
1148 a hyperbolic function of the 5-minute load average.
1149
1150config PROC_HARDWARE
1151 bool "/proc/hardware support"
1152 depends on APUS
1153
1154source "drivers/zorro/Kconfig"
1155
1156if !44x || BROKEN
1157source kernel/power/Kconfig 1020source kernel/power/Kconfig
1158endif 1021endif
1159 1022
@@ -1227,8 +1090,7 @@ config MCA
1227 1090
1228config PCI 1091config PCI
1229 bool "PCI support" if 40x || CPM2 || 83xx || 85xx || PPC_MPC52xx 1092 bool "PCI support" if 40x || CPM2 || 83xx || 85xx || PPC_MPC52xx
1230 default y if !40x && !CPM2 && !8xx && !APUS && !83xx && !85xx 1093 default y if !40x && !CPM2 && !8xx && !83xx && !85xx
1231 default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
1232 default PCI_QSPAN if !4xx && !CPM2 && 8xx 1094 default PCI_QSPAN if !4xx && !CPM2 && 8xx
1233 help 1095 help
1234 Find out whether your system includes a PCI bus. PCI is the name of 1096 Find out whether your system includes a PCI bus. PCI is the name of
@@ -1284,10 +1146,6 @@ config 8260_PCI9_IDMA4
1284 1146
1285endchoice 1147endchoice
1286 1148
1287config PCI_PERMEDIA
1288 bool "PCI for Permedia2"
1289 depends on !4xx && !8xx && APUS
1290
1291source "drivers/pci/Kconfig" 1149source "drivers/pci/Kconfig"
1292 1150
1293source "drivers/pcmcia/Kconfig" 1151source "drivers/pcmcia/Kconfig"
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index 0db66dcf0723..eee6264e8a04 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -69,7 +69,6 @@ core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/
69core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/ 69core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/
70core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/ 70core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/
71core-$(CONFIG_XMON) += arch/ppc/xmon/ 71core-$(CONFIG_XMON) += arch/ppc/xmon/
72core-$(CONFIG_APUS) += arch/ppc/amiga/
73drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/ 72drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
74drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/ 73drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
75drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/ 74drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
diff --git a/arch/ppc/amiga/Makefile b/arch/ppc/amiga/Makefile
deleted file mode 100644
index 59fec0a3ac8e..000000000000
--- a/arch/ppc/amiga/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
1#
2# Makefile for Linux arch/m68k/amiga source directory
3#
4
5obj-y := config.o amiints.o cia.o time.o bootinfo.o amisound.o \
6 chipram.o amiga_ksyms.o
7
8obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o
diff --git a/arch/ppc/amiga/amiga_ksyms.c b/arch/ppc/amiga/amiga_ksyms.c
deleted file mode 100644
index ec74e5b7a1ce..000000000000
--- a/arch/ppc/amiga/amiga_ksyms.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/amiga_ksyms.c"
diff --git a/arch/ppc/amiga/amiints.c b/arch/ppc/amiga/amiints.c
deleted file mode 100644
index 265fcd3c6ab2..000000000000
--- a/arch/ppc/amiga/amiints.c
+++ /dev/null
@@ -1,322 +0,0 @@
1/*
2 * Amiga Linux interrupt handling code
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 * 11/07/96: rewritten interrupt handling, irq lists are exists now only for
9 * this sources where it makes sense (VERTB/PORTS/EXTER) and you must
10 * be careful that dev_id for this sources is unique since this the
11 * only possibility to distinguish between different handlers for
12 * free_irq. irq lists also have different irq flags:
13 * - IRQ_FLG_FAST: handler is inserted at top of list (after other
14 * fast handlers)
15 * - IRQ_FLG_SLOW: handler is inserted at bottom of list and before
16 * they're executed irq level is set to the previous
17 * one, but handlers don't need to be reentrant, if
18 * reentrance occurred, slow handlers will be just
19 * called again.
20 * The whole interrupt handling for CIAs is moved to cia.c
21 * /Roman Zippel
22 *
23 * 07/08/99: rewamp of the interrupt handling - we now have two types of
24 * interrupts, normal and fast handlers, fast handlers being
25 * marked with SA_INTERRUPT and runs with all other interrupts
26 * disabled. Normal interrupts disable their own source but
27 * run with all other interrupt sources enabled.
28 * PORTS and EXTER interrupts are always shared even if the
29 * drivers do not explicitly mark this when calling
30 * request_irq which they really should do.
31 * This is similar to the way interrupts are handled on all
32 * other architectures and makes a ton of sense besides
33 * having the advantage of making it easier to share
34 * drivers.
35 * /Jes
36 */
37
38#include <linux/types.h>
39#include <linux/kernel.h>
40#include <linux/sched.h>
41#include <linux/interrupt.h>
42#include <linux/irq.h>
43#include <linux/kernel_stat.h>
44#include <linux/init.h>
45
46#include <asm/system.h>
47#include <asm/irq.h>
48#include <asm/traps.h>
49#include <asm/amigahw.h>
50#include <asm/amigaints.h>
51#include <asm/amipcmcia.h>
52
53#ifdef CONFIG_APUS
54#include <asm/amigappc.h>
55#endif
56
57extern void cia_init_IRQ(struct ciabase *base);
58
59unsigned short ami_intena_vals[AMI_STD_IRQS] = {
60 IF_VERTB, IF_COPER, IF_AUD0, IF_AUD1, IF_AUD2, IF_AUD3, IF_BLIT,
61 IF_DSKSYN, IF_DSKBLK, IF_RBF, IF_TBE, IF_SOFT, IF_PORTS, IF_EXTER
62};
63static const unsigned char ami_servers[AMI_STD_IRQS] = {
64 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1
65};
66
67static short ami_ablecount[AMI_IRQS];
68
69static void ami_badint(int irq, void *dev_id, struct pt_regs *fp)
70{
71/* num_spurious += 1;*/
72}
73
74/*
75 * void amiga_init_IRQ(void)
76 *
77 * Parameters: None
78 *
79 * Returns: Nothing
80 *
81 * This function should be called during kernel startup to initialize
82 * the amiga IRQ handling routines.
83 */
84
85__init
86void amiga_init_IRQ(void)
87{
88 int i;
89
90 for (i = 0; i < AMI_IRQS; i++)
91 ami_ablecount[i] = 0;
92
93 /* turn off PCMCIA interrupts */
94 if (AMIGAHW_PRESENT(PCMCIA))
95 gayle.inten = GAYLE_IRQ_IDE;
96
97 /* turn off all interrupts... */
98 amiga_custom.intena = 0x7fff;
99 amiga_custom.intreq = 0x7fff;
100
101#ifdef CONFIG_APUS
102 /* Clear any inter-CPU interrupt requests. Circumvents bug in
103 Blizzard IPL emulation HW (or so it appears). */
104 APUS_WRITE(APUS_INT_LVL, INTLVL_SETRESET | INTLVL_MASK);
105
106 /* Init IPL emulation. */
107 APUS_WRITE(APUS_REG_INT, REGINT_INTMASTER | REGINT_ENABLEIPL);
108 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT);
109 APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_IPLMASK);
110#endif
111 /* ... and enable the master interrupt bit */
112 amiga_custom.intena = IF_SETCLR | IF_INTEN;
113
114 cia_init_IRQ(&ciaa_base);
115 cia_init_IRQ(&ciab_base);
116}
117
118/*
119 * Enable/disable a particular machine specific interrupt source.
120 * Note that this may affect other interrupts in case of a shared interrupt.
121 * This function should only be called for a _very_ short time to change some
122 * internal data, that may not be changed by the interrupt at the same time.
123 * ami_(enable|disable)_irq calls may also be nested.
124 */
125
126void amiga_enable_irq(unsigned int irq)
127{
128 if (irq >= AMI_IRQS) {
129 printk("%s: Unknown IRQ %d\n", __FUNCTION__, irq);
130 return;
131 }
132
133 ami_ablecount[irq]--;
134 if (ami_ablecount[irq]<0)
135 ami_ablecount[irq]=0;
136 else if (ami_ablecount[irq])
137 return;
138
139 /* No action for auto-vector interrupts */
140 if (irq >= IRQ_AMIGA_AUTO){
141 printk("%s: Trying to enable auto-vector IRQ %i\n",
142 __FUNCTION__, irq - IRQ_AMIGA_AUTO);
143 return;
144 }
145
146 if (irq >= IRQ_AMIGA_CIAA) {
147 cia_set_irq(irq, 0);
148 cia_able_irq(irq, 1);
149 return;
150 }
151
152 /* enable the interrupt */
153 amiga_custom.intena = IF_SETCLR | ami_intena_vals[irq];
154}
155
156void amiga_disable_irq(unsigned int irq)
157{
158 if (irq >= AMI_IRQS) {
159 printk("%s: Unknown IRQ %d\n", __FUNCTION__, irq);
160 return;
161 }
162
163 if (ami_ablecount[irq]++)
164 return;
165
166 /* No action for auto-vector interrupts */
167 if (irq >= IRQ_AMIGA_AUTO) {
168 printk("%s: Trying to disable auto-vector IRQ %i\n",
169 __FUNCTION__, irq - IRQ_AMIGA_AUTO);
170 return;
171 }
172
173 if (irq >= IRQ_AMIGA_CIAA) {
174 cia_able_irq(irq, 0);
175 return;
176 }
177
178 /* disable the interrupt */
179 amiga_custom.intena = ami_intena_vals[irq];
180}
181
182inline void amiga_do_irq(int irq, struct pt_regs *fp)
183{
184 irq_desc_t *desc = irq_desc + irq;
185 struct irqaction *action = desc->action;
186
187 kstat_cpu(0).irqs[irq]++;
188 action->handler(irq, action->dev_id, fp);
189}
190
191void amiga_do_irq_list(int irq, struct pt_regs *fp)
192{
193 irq_desc_t *desc = irq_desc + irq;
194 struct irqaction *action;
195
196 kstat_cpu(0).irqs[irq]++;
197
198 amiga_custom.intreq = ami_intena_vals[irq];
199
200 for (action = desc->action; action; action = action->next)
201 action->handler(irq, action->dev_id, fp);
202}
203
204/*
205 * The builtin Amiga hardware interrupt handlers.
206 */
207
208static void ami_int1(int irq, void *dev_id, struct pt_regs *fp)
209{
210 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
211
212 /* if serial transmit buffer empty, interrupt */
213 if (ints & IF_TBE) {
214 amiga_custom.intreq = IF_TBE;
215 amiga_do_irq(IRQ_AMIGA_TBE, fp);
216 }
217
218 /* if floppy disk transfer complete, interrupt */
219 if (ints & IF_DSKBLK) {
220 amiga_custom.intreq = IF_DSKBLK;
221 amiga_do_irq(IRQ_AMIGA_DSKBLK, fp);
222 }
223
224 /* if software interrupt set, interrupt */
225 if (ints & IF_SOFT) {
226 amiga_custom.intreq = IF_SOFT;
227 amiga_do_irq(IRQ_AMIGA_SOFT, fp);
228 }
229}
230
231static void ami_int3(int irq, void *dev_id, struct pt_regs *fp)
232{
233 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
234
235 /* if a blitter interrupt */
236 if (ints & IF_BLIT) {
237 amiga_custom.intreq = IF_BLIT;
238 amiga_do_irq(IRQ_AMIGA_BLIT, fp);
239 }
240
241 /* if a copper interrupt */
242 if (ints & IF_COPER) {
243 amiga_custom.intreq = IF_COPER;
244 amiga_do_irq(IRQ_AMIGA_COPPER, fp);
245 }
246
247 /* if a vertical blank interrupt */
248 if (ints & IF_VERTB)
249 amiga_do_irq_list(IRQ_AMIGA_VERTB, fp);
250}
251
252static void ami_int4(int irq, void *dev_id, struct pt_regs *fp)
253{
254 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
255
256 /* if audio 0 interrupt */
257 if (ints & IF_AUD0) {
258 amiga_custom.intreq = IF_AUD0;
259 amiga_do_irq(IRQ_AMIGA_AUD0, fp);
260 }
261
262 /* if audio 1 interrupt */
263 if (ints & IF_AUD1) {
264 amiga_custom.intreq = IF_AUD1;
265 amiga_do_irq(IRQ_AMIGA_AUD1, fp);
266 }
267
268 /* if audio 2 interrupt */
269 if (ints & IF_AUD2) {
270 amiga_custom.intreq = IF_AUD2;
271 amiga_do_irq(IRQ_AMIGA_AUD2, fp);
272 }
273
274 /* if audio 3 interrupt */
275 if (ints & IF_AUD3) {
276 amiga_custom.intreq = IF_AUD3;
277 amiga_do_irq(IRQ_AMIGA_AUD3, fp);
278 }
279}
280
281static void ami_int5(int irq, void *dev_id, struct pt_regs *fp)
282{
283 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
284
285 /* if serial receive buffer full interrupt */
286 if (ints & IF_RBF) {
287 /* acknowledge of IF_RBF must be done by the serial interrupt */
288 amiga_do_irq(IRQ_AMIGA_RBF, fp);
289 }
290
291 /* if a disk sync interrupt */
292 if (ints & IF_DSKSYN) {
293 amiga_custom.intreq = IF_DSKSYN;
294 amiga_do_irq(IRQ_AMIGA_DSKSYN, fp);
295 }
296}
297
298static void ami_int7(int irq, void *dev_id, struct pt_regs *fp)
299{
300 panic ("level 7 interrupt received\n");
301}
302
303#ifdef CONFIG_APUS
304/* The PPC irq handling links all handlers requested on the same vector
305 and executes them in a loop. Having ami_badint at the end of the chain
306 is a bad idea. */
307struct irqaction amiga_sys_irqaction[AUTO_IRQS] = {
308 { .handler = ami_badint, .name = "spurious int" },
309 { .handler = ami_int1, .name = "int1 handler" },
310 { 0, /* CIAA */ },
311 { .handler = ami_int3, .name = "int3 handler" },
312 { .handler = ami_int4, .name = "int4 handler" },
313 { .handler = ami_int5, .name = "int5 handler" },
314 { 0, /* CIAB */ },
315 { .handler = ami_int7, .name = "int7 handler" },
316};
317#else
318void (*amiga_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
319 ami_badint, ami_int1, ami_badint, ami_int3,
320 ami_int4, ami_int5, ami_badint, ami_int7
321};
322#endif
diff --git a/arch/ppc/amiga/amisound.c b/arch/ppc/amiga/amisound.c
deleted file mode 100644
index 2b86cbef79f6..000000000000
--- a/arch/ppc/amiga/amisound.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/amisound.c"
diff --git a/arch/ppc/amiga/bootinfo.c b/arch/ppc/amiga/bootinfo.c
deleted file mode 100644
index efd869a3ed9b..000000000000
--- a/arch/ppc/amiga/bootinfo.c
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 * Extracted from arch/m68k/kernel/setup.c.
3 * Should be properly generalized and put somewhere else.
4 * Jesper
5 */
6
7#include <linux/types.h>
8#include <linux/kernel.h>
9#include <linux/string.h>
10#include <linux/init.h>
11
12#include <asm/setup.h>
13#include <asm/bootinfo.h>
14
15extern char cmd_line[CL_SIZE];
16
17extern int num_memory;
18extern int m68k_realnum_memory;
19extern struct mem_info memory[NUM_MEMINFO];
20extern struct mem_info m68k_memory[NUM_MEMINFO];
21extern struct mem_info ramdisk;
22
23extern int amiga_parse_bootinfo(const struct bi_record *);
24extern int atari_parse_bootinfo(const struct bi_record *);
25extern int mac_parse_bootinfo(const struct bi_record *);
26
27void __init parse_bootinfo(const struct bi_record *record)
28{
29 while (record->tag != BI_LAST) {
30 int unknown = 0;
31 const u_long *data = record->data;
32 switch (record->tag) {
33 case BI_MACHTYPE:
34 case BI_CPUTYPE:
35 case BI_FPUTYPE:
36 case BI_MMUTYPE:
37 /* Already set up by head.S */
38 break;
39
40 case BI_MEMCHUNK:
41 if (num_memory < NUM_MEMINFO) {
42 memory[num_memory].addr = data[0];
43 memory[num_memory].size = data[1];
44 num_memory++;
45
46 /* FIXME: duplicate for m68k drivers. */
47 m68k_memory[m68k_realnum_memory].addr = data[0];
48 m68k_memory[m68k_realnum_memory].size = data[1];
49 m68k_realnum_memory++;
50 } else
51 printk("parse_bootinfo: too many memory chunks\n");
52 break;
53
54 case BI_RAMDISK:
55 ramdisk.addr = data[0];
56 ramdisk.size = data[1];
57 break;
58
59 case BI_COMMAND_LINE:
60 strlcpy(cmd_line, (const char *)data, sizeof(cmd_line));
61 break;
62
63 default:
64 if (MACH_IS_AMIGA)
65 unknown = amiga_parse_bootinfo(record);
66 else if (MACH_IS_ATARI)
67 unknown = atari_parse_bootinfo(record);
68 else if (MACH_IS_MAC)
69 unknown = mac_parse_bootinfo(record);
70 else
71 unknown = 1;
72 }
73 if (unknown)
74 printk("parse_bootinfo: unknown tag 0x%04x ignored\n",
75 record->tag);
76 record = (struct bi_record *)((u_long)record+record->size);
77 }
78}
diff --git a/arch/ppc/amiga/chipram.c b/arch/ppc/amiga/chipram.c
deleted file mode 100644
index e6ab3c6b223c..000000000000
--- a/arch/ppc/amiga/chipram.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/chipram.c"
diff --git a/arch/ppc/amiga/cia.c b/arch/ppc/amiga/cia.c
deleted file mode 100644
index 9558f2f40e64..000000000000
--- a/arch/ppc/amiga/cia.c
+++ /dev/null
@@ -1,176 +0,0 @@
1/*
2 * Copyright (C) 1996 Roman Zippel
3 *
4 * The concept of some functions bases on the original Amiga OS function
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/types.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/kernel_stat.h>
17#include <linux/init.h>
18
19#include <asm/irq.h>
20#include <asm/amigahw.h>
21#include <asm/amigaints.h>
22
23struct ciabase {
24 volatile struct CIA *cia;
25 u_char icr_mask, icr_data;
26 u_short int_mask;
27 int handler_irq, cia_irq, server_irq;
28 char *name;
29} ciaa_base = {
30 &ciaa, 0, 0, IF_PORTS,
31 IRQ_AMIGA_AUTO_2, IRQ_AMIGA_CIAA,
32 IRQ_AMIGA_PORTS,
33 "CIAA handler"
34}, ciab_base = {
35 &ciab, 0, 0, IF_EXTER,
36 IRQ_AMIGA_AUTO_6, IRQ_AMIGA_CIAB,
37 IRQ_AMIGA_EXTER,
38 "CIAB handler"
39};
40
41#define CIA_SET_BASE_ADJUST_IRQ(base, irq) \
42do { \
43 if (irq >= IRQ_AMIGA_CIAB) { \
44 base = &ciab_base; \
45 irq -= IRQ_AMIGA_CIAB; \
46 } else { \
47 base = &ciaa_base; \
48 irq -= IRQ_AMIGA_CIAA; \
49 } \
50} while (0)
51
52/*
53 * Cause or clear CIA interrupts, return old interrupt status.
54 */
55
56static unsigned char cia_set_irq_private(struct ciabase *base,
57 unsigned char mask)
58{
59 u_char old;
60
61 old = (base->icr_data |= base->cia->icr);
62 if (mask & CIA_ICR_SETCLR)
63 base->icr_data |= mask;
64 else
65 base->icr_data &= ~mask;
66 if (base->icr_data & base->icr_mask)
67 amiga_custom.intreq = IF_SETCLR | base->int_mask;
68 return old & base->icr_mask;
69}
70
71unsigned char cia_set_irq(unsigned int irq, int set)
72{
73 struct ciabase *base;
74 unsigned char mask;
75
76 if (irq >= IRQ_AMIGA_CIAB)
77 mask = (1 << (irq - IRQ_AMIGA_CIAB));
78 else
79 mask = (1 << (irq - IRQ_AMIGA_CIAA));
80 mask |= (set) ? CIA_ICR_SETCLR : 0;
81
82 CIA_SET_BASE_ADJUST_IRQ(base, irq);
83
84 return cia_set_irq_private(base, mask);
85}
86
87unsigned char cia_get_irq_mask(unsigned int irq)
88{
89 struct ciabase *base;
90
91 CIA_SET_BASE_ADJUST_IRQ(base, irq);
92
93 return base->cia->icr;
94}
95
96/*
97 * Enable or disable CIA interrupts, return old interrupt mask.
98 */
99
100static unsigned char cia_able_irq_private(struct ciabase *base,
101 unsigned char mask)
102{
103 u_char old;
104
105 old = base->icr_mask;
106 base->icr_data |= base->cia->icr;
107 base->cia->icr = mask;
108 if (mask & CIA_ICR_SETCLR)
109 base->icr_mask |= mask;
110 else
111 base->icr_mask &= ~mask;
112 base->icr_mask &= CIA_ICR_ALL;
113
114 if (base->icr_data & base->icr_mask)
115 amiga_custom.intreq = IF_SETCLR | base->int_mask;
116 return old;
117}
118
119unsigned char cia_able_irq(unsigned int irq, int enable)
120{
121 struct ciabase *base;
122 unsigned char mask;
123
124 if (irq >= IRQ_AMIGA_CIAB)
125 mask = (1 << (irq - IRQ_AMIGA_CIAB));
126 else
127 mask = (1 << (irq - IRQ_AMIGA_CIAA));
128 mask |= (enable) ? CIA_ICR_SETCLR : 0;
129
130 CIA_SET_BASE_ADJUST_IRQ(base, irq);
131
132 return cia_able_irq_private(base, mask);
133}
134
135static void cia_handler(int irq, void *dev_id, struct pt_regs *fp)
136{
137 struct ciabase *base = (struct ciabase *)dev_id;
138 irq_desc_t *desc;
139 struct irqaction *action;
140 int i;
141 unsigned char ints;
142
143 irq = base->cia_irq;
144 desc = irq_desc + irq;
145 ints = cia_set_irq_private(base, CIA_ICR_ALL);
146 amiga_custom.intreq = base->int_mask;
147 for (i = 0; i < CIA_IRQS; i++, irq++) {
148 if (ints & 1) {
149 kstat_cpu(0).irqs[irq]++;
150 action = desc->action;
151 action->handler(irq, action->dev_id, fp);
152 }
153 ints >>= 1;
154 desc++;
155 }
156 amiga_do_irq_list(base->server_irq, fp);
157}
158
159void __init cia_init_IRQ(struct ciabase *base)
160{
161 extern struct irqaction amiga_sys_irqaction[AUTO_IRQS];
162 struct irqaction *action;
163
164 /* clear any pending interrupt and turn off all interrupts */
165 cia_set_irq_private(base, CIA_ICR_ALL);
166 cia_able_irq_private(base, CIA_ICR_ALL);
167
168 /* install CIA handler */
169 action = &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO];
170 action->handler = cia_handler;
171 action->dev_id = base;
172 action->name = base->name;
173 setup_irq(base->handler_irq, &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO]);
174
175 amiga_custom.intena = IF_SETCLR | base->int_mask;
176}
diff --git a/arch/ppc/amiga/config.c b/arch/ppc/amiga/config.c
deleted file mode 100644
index bc50ed11957d..000000000000
--- a/arch/ppc/amiga/config.c
+++ /dev/null
@@ -1,953 +0,0 @@
1#define m68k_debug_device debug_device
2
3/*
4 * Copyright (C) 1993 Hamish Macdonald
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11/*
12 * Miscellaneous Amiga stuff
13 */
14
15#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/mm.h>
18#include <linux/kd.h>
19#include <linux/tty.h>
20#include <linux/console.h>
21#include <linux/init.h>
22#ifdef CONFIG_ZORRO
23#include <linux/zorro.h>
24#endif
25
26#include <asm/bootinfo.h>
27#include <asm/setup.h>
28#include <asm/system.h>
29#include <asm/pgtable.h>
30#include <asm/amigahw.h>
31#include <asm/amigaints.h>
32#include <asm/irq.h>
33#include <asm/machdep.h>
34#include <asm/io.h>
35
36unsigned long powerup_PCI_present;
37unsigned long powerup_BPPCPLUS_present;
38unsigned long amiga_model;
39unsigned long amiga_eclock;
40unsigned long amiga_masterclock;
41unsigned long amiga_colorclock;
42unsigned long amiga_chipset;
43unsigned char amiga_vblank;
44unsigned char amiga_psfreq;
45struct amiga_hw_present amiga_hw_present;
46
47static char s_a500[] __initdata = "A500";
48static char s_a500p[] __initdata = "A500+";
49static char s_a600[] __initdata = "A600";
50static char s_a1000[] __initdata = "A1000";
51static char s_a1200[] __initdata = "A1200";
52static char s_a2000[] __initdata = "A2000";
53static char s_a2500[] __initdata = "A2500";
54static char s_a3000[] __initdata = "A3000";
55static char s_a3000t[] __initdata = "A3000T";
56static char s_a3000p[] __initdata = "A3000+";
57static char s_a4000[] __initdata = "A4000";
58static char s_a4000t[] __initdata = "A4000T";
59static char s_cdtv[] __initdata = "CDTV";
60static char s_cd32[] __initdata = "CD32";
61static char s_draco[] __initdata = "Draco";
62static char *amiga_models[] __initdata = {
63 s_a500, s_a500p, s_a600, s_a1000, s_a1200, s_a2000, s_a2500, s_a3000,
64 s_a3000t, s_a3000p, s_a4000, s_a4000t, s_cdtv, s_cd32, s_draco,
65};
66
67static char amiga_model_name[13] = "Amiga ";
68
69extern char m68k_debug_device[];
70
71static void amiga_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
72/* amiga specific irq functions */
73extern void amiga_init_IRQ (void);
74extern void (*amiga_default_handler[]) (int, void *, struct pt_regs *);
75extern int amiga_request_irq (unsigned int irq,
76 void (*handler)(int, void *, struct pt_regs *),
77 unsigned long flags, const char *devname,
78 void *dev_id);
79extern void amiga_free_irq (unsigned int irq, void *dev_id);
80extern void amiga_enable_irq (unsigned int);
81extern void amiga_disable_irq (unsigned int);
82static void amiga_get_model(char *model);
83static int amiga_get_hardware_list(char *buffer);
84/* amiga specific timer functions */
85static unsigned long amiga_gettimeoffset (void);
86static void a3000_gettod (int *, int *, int *, int *, int *, int *);
87static void a2000_gettod (int *, int *, int *, int *, int *, int *);
88static int amiga_hwclk (int, struct hwclk_time *);
89static int amiga_set_clock_mmss (unsigned long);
90static void amiga_reset (void);
91extern void amiga_init_sound(void);
92static void amiga_savekmsg_init(void);
93static void amiga_mem_console_write(struct console *co, const char *b,
94 unsigned int count);
95void amiga_serial_console_write(struct console *co, const char *s,
96 unsigned int count);
97static void amiga_debug_init(void);
98#ifdef CONFIG_HEARTBEAT
99static void amiga_heartbeat(int on);
100#endif
101
102static struct console amiga_console_driver = {
103 .name = "debug",
104 .flags = CON_PRINTBUFFER,
105 .index = -1,
106};
107
108
109 /*
110 * Motherboard Resources present in all Amiga models
111 */
112
113static struct {
114 struct resource _ciab, _ciaa, _custom, _kickstart;
115} mb_resources = {
116// { "Ranger Memory", 0x00c00000, 0x00c7ffff },
117 ._ciab = { "CIA B", 0x00bfd000, 0x00bfdfff },
118 ._ciaa = { "CIA A", 0x00bfe000, 0x00bfefff },
119 ._custom = { "Custom I/O", 0x00dff000, 0x00dfffff },
120 ._kickstart = { "Kickstart ROM", 0x00f80000, 0x00ffffff }
121};
122
123static struct resource rtc_resource = {
124 NULL, 0x00dc0000, 0x00dcffff
125};
126
127static struct resource ram_resource[NUM_MEMINFO];
128
129
130 /*
131 * Parse an Amiga-specific record in the bootinfo
132 */
133
134int amiga_parse_bootinfo(const struct bi_record *record)
135{
136 int unknown = 0;
137 const unsigned long *data = record->data;
138
139 switch (record->tag) {
140 case BI_AMIGA_MODEL:
141 {
142 unsigned long d = *data;
143
144 powerup_PCI_present = d & 0x100;
145 amiga_model = d & 0xff;
146 }
147 break;
148
149 case BI_AMIGA_ECLOCK:
150 amiga_eclock = *data;
151 break;
152
153 case BI_AMIGA_CHIPSET:
154 amiga_chipset = *data;
155 break;
156
157 case BI_AMIGA_CHIP_SIZE:
158 amiga_chip_size = *(const int *)data;
159 break;
160
161 case BI_AMIGA_VBLANK:
162 amiga_vblank = *(const unsigned char *)data;
163 break;
164
165 case BI_AMIGA_PSFREQ:
166 amiga_psfreq = *(const unsigned char *)data;
167 break;
168
169 case BI_AMIGA_AUTOCON:
170#ifdef CONFIG_ZORRO
171 if (zorro_num_autocon < ZORRO_NUM_AUTO) {
172 const struct ConfigDev *cd = (struct ConfigDev *)data;
173 struct zorro_dev *dev = &zorro_autocon[zorro_num_autocon++];
174 dev->rom = cd->cd_Rom;
175 dev->slotaddr = cd->cd_SlotAddr;
176 dev->slotsize = cd->cd_SlotSize;
177 dev->resource.start = (unsigned long)cd->cd_BoardAddr;
178 dev->resource.end = dev->resource.start+cd->cd_BoardSize-1;
179 } else
180 printk("amiga_parse_bootinfo: too many AutoConfig devices\n");
181#endif /* CONFIG_ZORRO */
182 break;
183
184 case BI_AMIGA_SERPER:
185 /* serial port period: ignored here */
186 break;
187
188 case BI_AMIGA_PUP_BRIDGE:
189 powerup_PCI_present = *(const unsigned short *)data;
190 break;
191
192 case BI_AMIGA_BPPC_SCSI:
193 powerup_BPPCPLUS_present = *(const unsigned short *)data;
194 break;
195
196 default:
197 unknown = 1;
198 }
199 return(unknown);
200}
201
202 /*
203 * Identify builtin hardware
204 */
205
206static void __init amiga_identify(void)
207{
208 /* Fill in some default values, if necessary */
209 if (amiga_eclock == 0)
210 amiga_eclock = 709379;
211
212 memset(&amiga_hw_present, 0, sizeof(amiga_hw_present));
213
214 printk("Amiga hardware found: ");
215 if (amiga_model >= AMI_500 && amiga_model <= AMI_DRACO) {
216 printk("[%s] ", amiga_models[amiga_model-AMI_500]);
217 strcat(amiga_model_name, amiga_models[amiga_model-AMI_500]);
218 }
219
220 switch(amiga_model) {
221 case AMI_UNKNOWN:
222 goto Generic;
223
224 case AMI_600:
225 case AMI_1200:
226 AMIGAHW_SET(A1200_IDE);
227 AMIGAHW_SET(PCMCIA);
228 case AMI_500:
229 case AMI_500PLUS:
230 case AMI_1000:
231 case AMI_2000:
232 case AMI_2500:
233 AMIGAHW_SET(A2000_CLK); /* Is this correct for all models? */
234 goto Generic;
235
236 case AMI_3000:
237 case AMI_3000T:
238 AMIGAHW_SET(AMBER_FF);
239 AMIGAHW_SET(MAGIC_REKICK);
240 /* fall through */
241 case AMI_3000PLUS:
242 AMIGAHW_SET(A3000_SCSI);
243 AMIGAHW_SET(A3000_CLK);
244 AMIGAHW_SET(ZORRO3);
245 goto Generic;
246
247 case AMI_4000T:
248 AMIGAHW_SET(A4000_SCSI);
249 /* fall through */
250 case AMI_4000:
251 AMIGAHW_SET(A4000_IDE);
252 AMIGAHW_SET(A3000_CLK);
253 AMIGAHW_SET(ZORRO3);
254 goto Generic;
255
256 case AMI_CDTV:
257 case AMI_CD32:
258 AMIGAHW_SET(CD_ROM);
259 AMIGAHW_SET(A2000_CLK); /* Is this correct? */
260 goto Generic;
261
262 Generic:
263 AMIGAHW_SET(AMI_VIDEO);
264 AMIGAHW_SET(AMI_BLITTER);
265 AMIGAHW_SET(AMI_AUDIO);
266 AMIGAHW_SET(AMI_FLOPPY);
267 AMIGAHW_SET(AMI_KEYBOARD);
268 AMIGAHW_SET(AMI_MOUSE);
269 AMIGAHW_SET(AMI_SERIAL);
270 AMIGAHW_SET(AMI_PARALLEL);
271 AMIGAHW_SET(CHIP_RAM);
272 AMIGAHW_SET(PAULA);
273
274 switch(amiga_chipset) {
275 case CS_OCS:
276 case CS_ECS:
277 case CS_AGA:
278 switch (amiga_custom.deniseid & 0xf) {
279 case 0x0c:
280 AMIGAHW_SET(DENISE_HR);
281 break;
282 case 0x08:
283 AMIGAHW_SET(LISA);
284 break;
285 }
286 break;
287 default:
288 AMIGAHW_SET(DENISE);
289 break;
290 }
291 switch ((amiga_custom.vposr>>8) & 0x7f) {
292 case 0x00:
293 AMIGAHW_SET(AGNUS_PAL);
294 break;
295 case 0x10:
296 AMIGAHW_SET(AGNUS_NTSC);
297 break;
298 case 0x20:
299 case 0x21:
300 AMIGAHW_SET(AGNUS_HR_PAL);
301 break;
302 case 0x30:
303 case 0x31:
304 AMIGAHW_SET(AGNUS_HR_NTSC);
305 break;
306 case 0x22:
307 case 0x23:
308 AMIGAHW_SET(ALICE_PAL);
309 break;
310 case 0x32:
311 case 0x33:
312 AMIGAHW_SET(ALICE_NTSC);
313 break;
314 }
315 AMIGAHW_SET(ZORRO);
316 break;
317
318 case AMI_DRACO:
319 panic("No support for Draco yet");
320
321 default:
322 panic("Unknown Amiga Model");
323 }
324
325#define AMIGAHW_ANNOUNCE(name, str) \
326 if (AMIGAHW_PRESENT(name)) \
327 printk(str)
328
329 AMIGAHW_ANNOUNCE(AMI_VIDEO, "VIDEO ");
330 AMIGAHW_ANNOUNCE(AMI_BLITTER, "BLITTER ");
331 AMIGAHW_ANNOUNCE(AMBER_FF, "AMBER_FF ");
332 AMIGAHW_ANNOUNCE(AMI_AUDIO, "AUDIO ");
333 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "FLOPPY ");
334 AMIGAHW_ANNOUNCE(A3000_SCSI, "A3000_SCSI ");
335 AMIGAHW_ANNOUNCE(A4000_SCSI, "A4000_SCSI ");
336 AMIGAHW_ANNOUNCE(A1200_IDE, "A1200_IDE ");
337 AMIGAHW_ANNOUNCE(A4000_IDE, "A4000_IDE ");
338 AMIGAHW_ANNOUNCE(CD_ROM, "CD_ROM ");
339 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "KEYBOARD ");
340 AMIGAHW_ANNOUNCE(AMI_MOUSE, "MOUSE ");
341 AMIGAHW_ANNOUNCE(AMI_SERIAL, "SERIAL ");
342 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "PARALLEL ");
343 AMIGAHW_ANNOUNCE(A2000_CLK, "A2000_CLK ");
344 AMIGAHW_ANNOUNCE(A3000_CLK, "A3000_CLK ");
345 AMIGAHW_ANNOUNCE(CHIP_RAM, "CHIP_RAM ");
346 AMIGAHW_ANNOUNCE(PAULA, "PAULA ");
347 AMIGAHW_ANNOUNCE(DENISE, "DENISE ");
348 AMIGAHW_ANNOUNCE(DENISE_HR, "DENISE_HR ");
349 AMIGAHW_ANNOUNCE(LISA, "LISA ");
350 AMIGAHW_ANNOUNCE(AGNUS_PAL, "AGNUS_PAL ");
351 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "AGNUS_NTSC ");
352 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "AGNUS_HR_PAL ");
353 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "AGNUS_HR_NTSC ");
354 AMIGAHW_ANNOUNCE(ALICE_PAL, "ALICE_PAL ");
355 AMIGAHW_ANNOUNCE(ALICE_NTSC, "ALICE_NTSC ");
356 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "MAGIC_REKICK ");
357 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA ");
358 if (AMIGAHW_PRESENT(ZORRO))
359 printk("ZORRO%s ", AMIGAHW_PRESENT(ZORRO3) ? "3" : "");
360 printk("\n");
361
362#undef AMIGAHW_ANNOUNCE
363}
364
365 /*
366 * Setup the Amiga configuration info
367 */
368
369void __init config_amiga(void)
370{
371 int i;
372
373 amiga_debug_init();
374 amiga_identify();
375
376 /* Some APUS boxes may have PCI memory, but ... */
377 iomem_resource.name = "Memory";
378 for (i = 0; i < 4; i++)
379 request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]);
380
381 mach_sched_init = amiga_sched_init;
382 mach_init_IRQ = amiga_init_IRQ;
383#ifndef CONFIG_APUS
384 mach_default_handler = &amiga_default_handler;
385 mach_request_irq = amiga_request_irq;
386 mach_free_irq = amiga_free_irq;
387 enable_irq = amiga_enable_irq;
388 disable_irq = amiga_disable_irq;
389#endif
390 mach_get_model = amiga_get_model;
391 mach_get_hardware_list = amiga_get_hardware_list;
392 mach_gettimeoffset = amiga_gettimeoffset;
393 if (AMIGAHW_PRESENT(A3000_CLK)){
394 mach_gettod = a3000_gettod;
395 rtc_resource.name = "A3000 RTC";
396 request_resource(&iomem_resource, &rtc_resource);
397 }
398 else{ /* if (AMIGAHW_PRESENT(A2000_CLK)) */
399 mach_gettod = a2000_gettod;
400 rtc_resource.name = "A2000 RTC";
401 request_resource(&iomem_resource, &rtc_resource);
402 }
403
404 mach_max_dma_address = 0xffffffff; /*
405 * default MAX_DMA=0xffffffff
406 * on all machines. If we don't
407 * do so, the SCSI code will not
408 * be able to allocate any mem
409 * for transfers, unless we are
410 * dealing with a Z2 mem only
411 * system. /Jes
412 */
413
414 mach_hwclk = amiga_hwclk;
415 mach_set_clock_mmss = amiga_set_clock_mmss;
416 mach_reset = amiga_reset;
417#ifdef CONFIG_HEARTBEAT
418 mach_heartbeat = amiga_heartbeat;
419#endif
420
421 /* Fill in the clock values (based on the 700 kHz E-Clock) */
422 amiga_masterclock = 40*amiga_eclock; /* 28 MHz */
423 amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */
424
425 /* clear all DMA bits */
426 amiga_custom.dmacon = DMAF_ALL;
427 /* ensure that the DMA master bit is set */
428 amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER;
429
430 /* request all RAM */
431 for (i = 0; i < m68k_num_memory; i++) {
432 ram_resource[i].name =
433 (m68k_memory[i].addr >= 0x01000000) ? "32-bit Fast RAM" :
434 (m68k_memory[i].addr < 0x00c00000) ? "16-bit Fast RAM" :
435 "16-bit Slow RAM";
436 ram_resource[i].start = m68k_memory[i].addr;
437 ram_resource[i].end = m68k_memory[i].addr+m68k_memory[i].size-1;
438 request_resource(&iomem_resource, &ram_resource[i]);
439 }
440
441 /* initialize chipram allocator */
442 amiga_chip_init ();
443
444 /* debugging using chipram */
445 if (!strcmp( m68k_debug_device, "mem" )){
446 if (!AMIGAHW_PRESENT(CHIP_RAM))
447 printk("Warning: no chipram present for debugging\n");
448 else {
449 amiga_savekmsg_init();
450 amiga_console_driver.write = amiga_mem_console_write;
451 register_console(&amiga_console_driver);
452 }
453 }
454
455 /* our beloved beeper */
456 if (AMIGAHW_PRESENT(AMI_AUDIO))
457 amiga_init_sound();
458
459 /*
460 * if it is an A3000, set the magic bit that forces
461 * a hard rekick
462 */
463 if (AMIGAHW_PRESENT(MAGIC_REKICK))
464 *(unsigned char *)ZTWO_VADDR(0xde0002) |= 0x80;
465}
466
467static unsigned short jiffy_ticks;
468
469static void __init amiga_sched_init(irqreturn_t (*timer_routine)(int, void *,
470 struct pt_regs *))
471{
472 static struct resource sched_res = {
473 "timer", 0x00bfd400, 0x00bfd5ff,
474 };
475 jiffy_ticks = (amiga_eclock+HZ/2)/HZ;
476
477 if (request_resource(&mb_resources._ciab, &sched_res))
478 printk("Cannot allocate ciab.ta{lo,hi}\n");
479 ciab.cra &= 0xC0; /* turn off timer A, continuous mode, from Eclk */
480 ciab.talo = jiffy_ticks % 256;
481 ciab.tahi = jiffy_ticks / 256;
482
483 /* install interrupt service routine for CIAB Timer A
484 *
485 * Please don't change this to use ciaa, as it interferes with the
486 * SCSI code. We'll have to take a look at this later
487 */
488 request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL);
489 /* start timer */
490 ciab.cra |= 0x11;
491}
492
493#define TICK_SIZE 10000
494
495extern unsigned char cia_get_irq_mask(unsigned int irq);
496
497/* This is always executed with interrupts disabled. */
498static unsigned long amiga_gettimeoffset (void)
499{
500 unsigned short hi, lo, hi2;
501 unsigned long ticks, offset = 0;
502
503 /* read CIA B timer A current value */
504 hi = ciab.tahi;
505 lo = ciab.talo;
506 hi2 = ciab.tahi;
507
508 if (hi != hi2) {
509 lo = ciab.talo;
510 hi = hi2;
511 }
512
513 ticks = hi << 8 | lo;
514
515 if (ticks > jiffy_ticks / 2)
516 /* check for pending interrupt */
517 if (cia_get_irq_mask(IRQ_AMIGA_CIAB) & CIA_ICR_TA)
518 offset = 10000;
519
520 ticks = jiffy_ticks - ticks;
521 ticks = (10000 * ticks) / jiffy_ticks;
522
523 return ticks + offset;
524}
525
526static void a3000_gettod (int *yearp, int *monp, int *dayp,
527 int *hourp, int *minp, int *secp)
528{
529 volatile struct tod3000 *tod = TOD_3000;
530
531 tod->cntrl1 = TOD3000_CNTRL1_HOLD;
532
533 *secp = tod->second1 * 10 + tod->second2;
534 *minp = tod->minute1 * 10 + tod->minute2;
535 *hourp = tod->hour1 * 10 + tod->hour2;
536 *dayp = tod->day1 * 10 + tod->day2;
537 *monp = tod->month1 * 10 + tod->month2;
538 *yearp = tod->year1 * 10 + tod->year2;
539
540 tod->cntrl1 = TOD3000_CNTRL1_FREE;
541}
542
543static void a2000_gettod (int *yearp, int *monp, int *dayp,
544 int *hourp, int *minp, int *secp)
545{
546 volatile struct tod2000 *tod = TOD_2000;
547
548 tod->cntrl1 = TOD2000_CNTRL1_HOLD;
549
550 while (tod->cntrl1 & TOD2000_CNTRL1_BUSY)
551 ;
552
553 *secp = tod->second1 * 10 + tod->second2;
554 *minp = tod->minute1 * 10 + tod->minute2;
555 *hourp = (tod->hour1 & 3) * 10 + tod->hour2;
556 *dayp = tod->day1 * 10 + tod->day2;
557 *monp = tod->month1 * 10 + tod->month2;
558 *yearp = tod->year1 * 10 + tod->year2;
559
560 if (!(tod->cntrl3 & TOD2000_CNTRL3_24HMODE)){
561 if (!(tod->hour1 & TOD2000_HOUR1_PM) && *hourp == 12)
562 *hourp = 0;
563 else if ((tod->hour1 & TOD2000_HOUR1_PM) && *hourp != 12)
564 *hourp += 12;
565 }
566
567 tod->cntrl1 &= ~TOD2000_CNTRL1_HOLD;
568}
569
570static int amiga_hwclk(int op, struct hwclk_time *t)
571{
572 if (AMIGAHW_PRESENT(A3000_CLK)) {
573 volatile struct tod3000 *tod = TOD_3000;
574
575 tod->cntrl1 = TOD3000_CNTRL1_HOLD;
576
577 if (!op) { /* read */
578 t->sec = tod->second1 * 10 + tod->second2;
579 t->min = tod->minute1 * 10 + tod->minute2;
580 t->hour = tod->hour1 * 10 + tod->hour2;
581 t->day = tod->day1 * 10 + tod->day2;
582 t->wday = tod->weekday;
583 t->mon = tod->month1 * 10 + tod->month2 - 1;
584 t->year = tod->year1 * 10 + tod->year2;
585 if (t->year <= 69)
586 t->year += 100;
587 } else {
588 tod->second1 = t->sec / 10;
589 tod->second2 = t->sec % 10;
590 tod->minute1 = t->min / 10;
591 tod->minute2 = t->min % 10;
592 tod->hour1 = t->hour / 10;
593 tod->hour2 = t->hour % 10;
594 tod->day1 = t->day / 10;
595 tod->day2 = t->day % 10;
596 if (t->wday != -1)
597 tod->weekday = t->wday;
598 tod->month1 = (t->mon + 1) / 10;
599 tod->month2 = (t->mon + 1) % 10;
600 if (t->year >= 100)
601 t->year -= 100;
602 tod->year1 = t->year / 10;
603 tod->year2 = t->year % 10;
604 }
605
606 tod->cntrl1 = TOD3000_CNTRL1_FREE;
607 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
608 volatile struct tod2000 *tod = TOD_2000;
609
610 tod->cntrl1 = TOD2000_CNTRL1_HOLD;
611
612 while (tod->cntrl1 & TOD2000_CNTRL1_BUSY)
613 ;
614
615 if (!op) { /* read */
616 t->sec = tod->second1 * 10 + tod->second2;
617 t->min = tod->minute1 * 10 + tod->minute2;
618 t->hour = (tod->hour1 & 3) * 10 + tod->hour2;
619 t->day = tod->day1 * 10 + tod->day2;
620 t->wday = tod->weekday;
621 t->mon = tod->month1 * 10 + tod->month2 - 1;
622 t->year = tod->year1 * 10 + tod->year2;
623 if (t->year <= 69)
624 t->year += 100;
625
626 if (!(tod->cntrl3 & TOD2000_CNTRL3_24HMODE)){
627 if (!(tod->hour1 & TOD2000_HOUR1_PM) && t->hour == 12)
628 t->hour = 0;
629 else if ((tod->hour1 & TOD2000_HOUR1_PM) && t->hour != 12)
630 t->hour += 12;
631 }
632 } else {
633 tod->second1 = t->sec / 10;
634 tod->second2 = t->sec % 10;
635 tod->minute1 = t->min / 10;
636 tod->minute2 = t->min % 10;
637 if (tod->cntrl3 & TOD2000_CNTRL3_24HMODE)
638 tod->hour1 = t->hour / 10;
639 else if (t->hour >= 12)
640 tod->hour1 = TOD2000_HOUR1_PM +
641 (t->hour - 12) / 10;
642 else
643 tod->hour1 = t->hour / 10;
644 tod->hour2 = t->hour % 10;
645 tod->day1 = t->day / 10;
646 tod->day2 = t->day % 10;
647 if (t->wday != -1)
648 tod->weekday = t->wday;
649 tod->month1 = (t->mon + 1) / 10;
650 tod->month2 = (t->mon + 1) % 10;
651 if (t->year >= 100)
652 t->year -= 100;
653 tod->year1 = t->year / 10;
654 tod->year2 = t->year % 10;
655 }
656
657 tod->cntrl1 &= ~TOD2000_CNTRL1_HOLD;
658 }
659
660 return 0;
661}
662
663static int amiga_set_clock_mmss (unsigned long nowtime)
664{
665 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
666
667 if (AMIGAHW_PRESENT(A3000_CLK)) {
668 volatile struct tod3000 *tod = TOD_3000;
669
670 tod->cntrl1 = TOD3000_CNTRL1_HOLD;
671
672 tod->second1 = real_seconds / 10;
673 tod->second2 = real_seconds % 10;
674 tod->minute1 = real_minutes / 10;
675 tod->minute2 = real_minutes % 10;
676
677 tod->cntrl1 = TOD3000_CNTRL1_FREE;
678 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
679 volatile struct tod2000 *tod = TOD_2000;
680
681 tod->cntrl1 = TOD2000_CNTRL1_HOLD;
682
683 while (tod->cntrl1 & TOD2000_CNTRL1_BUSY)
684 ;
685
686 tod->second1 = real_seconds / 10;
687 tod->second2 = real_seconds % 10;
688 tod->minute1 = real_minutes / 10;
689 tod->minute2 = real_minutes % 10;
690
691 tod->cntrl1 &= ~TOD2000_CNTRL1_HOLD;
692 }
693
694 return 0;
695}
696
697static NORET_TYPE void amiga_reset( void )
698 ATTRIB_NORET;
699
700static void amiga_reset (void)
701{
702 for (;;);
703}
704
705
706 /*
707 * Debugging
708 */
709
710#define SAVEKMSG_MAXMEM 128*1024
711
712#define SAVEKMSG_MAGIC1 0x53415645 /* 'SAVE' */
713#define SAVEKMSG_MAGIC2 0x4B4D5347 /* 'KMSG' */
714
715struct savekmsg {
716 unsigned long magic1; /* SAVEKMSG_MAGIC1 */
717 unsigned long magic2; /* SAVEKMSG_MAGIC2 */
718 unsigned long magicptr; /* address of magic1 */
719 unsigned long size;
720 char data[0];
721};
722
723static struct savekmsg *savekmsg = NULL;
724
725static void amiga_mem_console_write(struct console *co, const char *s,
726 unsigned int count)
727{
728 if (savekmsg->size+count <= SAVEKMSG_MAXMEM-sizeof(struct savekmsg)) {
729 memcpy(savekmsg->data+savekmsg->size, s, count);
730 savekmsg->size += count;
731 }
732}
733
734static void amiga_savekmsg_init(void)
735{
736 static struct resource debug_res = { "Debug" };
737
738 savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res);
739 savekmsg->magic1 = SAVEKMSG_MAGIC1;
740 savekmsg->magic2 = SAVEKMSG_MAGIC2;
741 savekmsg->magicptr = virt_to_phys(savekmsg);
742 savekmsg->size = 0;
743}
744
745static void amiga_serial_putc(char c)
746{
747 amiga_custom.serdat = (unsigned char)c | 0x100;
748 mb();
749 while (!(amiga_custom.serdatr & 0x2000))
750 ;
751}
752
753void amiga_serial_console_write(struct console *co, const char *s,
754 unsigned int count)
755{
756#if 0 /* def CONFIG_KGDB */
757 /* FIXME:APUS GDB doesn't seem to like O-packages before it is
758 properly connected with the target. */
759 __gdb_output_string (s, count);
760#else
761 while (count--) {
762 if (*s == '\n')
763 amiga_serial_putc('\r');
764 amiga_serial_putc(*s++);
765 }
766#endif
767}
768
769#ifdef CONFIG_SERIAL_CONSOLE
770void amiga_serial_puts(const char *s)
771{
772 amiga_serial_console_write(NULL, s, strlen(s));
773}
774
775int amiga_serial_console_wait_key(struct console *co)
776{
777 int ch;
778
779 while (!(amiga_custom.intreqr & IF_RBF))
780 barrier();
781 ch = amiga_custom.serdatr & 0xff;
782 /* clear the interrupt, so that another character can be read */
783 amiga_custom.intreq = IF_RBF;
784 return ch;
785}
786
787void amiga_serial_gets(struct console *co, char *s, int len)
788{
789 int ch, cnt = 0;
790
791 while (1) {
792 ch = amiga_serial_console_wait_key(co);
793
794 /* Check for backspace. */
795 if (ch == 8 || ch == 127) {
796 if (cnt == 0) {
797 amiga_serial_putc('\007');
798 continue;
799 }
800 cnt--;
801 amiga_serial_puts("\010 \010");
802 continue;
803 }
804
805 /* Check for enter. */
806 if (ch == 10 || ch == 13)
807 break;
808
809 /* See if line is too long. */
810 if (cnt >= len + 1) {
811 amiga_serial_putc(7);
812 cnt--;
813 continue;
814 }
815
816 /* Store and echo character. */
817 s[cnt++] = ch;
818 amiga_serial_putc(ch);
819 }
820 /* Print enter. */
821 amiga_serial_puts("\r\n");
822 s[cnt] = 0;
823}
824#endif
825
826static void __init amiga_debug_init(void)
827{
828 if (!strcmp( m68k_debug_device, "ser" )) {
829 /* no initialization required (?) */
830 amiga_console_driver.write = amiga_serial_console_write;
831 register_console(&amiga_console_driver);
832 }
833}
834
835#ifdef CONFIG_HEARTBEAT
836static void amiga_heartbeat(int on)
837{
838 if (on)
839 ciaa.pra &= ~2;
840 else
841 ciaa.pra |= 2;
842}
843#endif
844
845 /*
846 * Amiga specific parts of /proc
847 */
848
849static void amiga_get_model(char *model)
850{
851 strcpy(model, amiga_model_name);
852}
853
854
855static int amiga_get_hardware_list(char *buffer)
856{
857 int len = 0;
858
859 if (AMIGAHW_PRESENT(CHIP_RAM))
860 len += sprintf(buffer+len, "Chip RAM:\t%ldK\n", amiga_chip_size>>10);
861 len += sprintf(buffer+len, "PS Freq:\t%dHz\nEClock Freq:\t%ldHz\n",
862 amiga_psfreq, amiga_eclock);
863 if (AMIGAHW_PRESENT(AMI_VIDEO)) {
864 char *type;
865 switch(amiga_chipset) {
866 case CS_OCS:
867 type = "OCS";
868 break;
869 case CS_ECS:
870 type = "ECS";
871 break;
872 case CS_AGA:
873 type = "AGA";
874 break;
875 default:
876 type = "Old or Unknown";
877 break;
878 }
879 len += sprintf(buffer+len, "Graphics:\t%s\n", type);
880 }
881
882#define AMIGAHW_ANNOUNCE(name, str) \
883 if (AMIGAHW_PRESENT(name)) \
884 len += sprintf (buffer+len, "\t%s\n", str)
885
886 len += sprintf (buffer + len, "Detected hardware:\n");
887
888 AMIGAHW_ANNOUNCE(AMI_VIDEO, "Amiga Video");
889 AMIGAHW_ANNOUNCE(AMI_BLITTER, "Blitter");
890 AMIGAHW_ANNOUNCE(AMBER_FF, "Amber Flicker Fixer");
891 AMIGAHW_ANNOUNCE(AMI_AUDIO, "Amiga Audio");
892 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "Floppy Controller");
893 AMIGAHW_ANNOUNCE(A3000_SCSI, "SCSI Controller WD33C93 (A3000 style)");
894 AMIGAHW_ANNOUNCE(A4000_SCSI, "SCSI Controller NCR53C710 (A4000T style)");
895 AMIGAHW_ANNOUNCE(A1200_IDE, "IDE Interface (A1200 style)");
896 AMIGAHW_ANNOUNCE(A4000_IDE, "IDE Interface (A4000 style)");
897 AMIGAHW_ANNOUNCE(CD_ROM, "Internal CD ROM drive");
898 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "Keyboard");
899 AMIGAHW_ANNOUNCE(AMI_MOUSE, "Mouse Port");
900 AMIGAHW_ANNOUNCE(AMI_SERIAL, "Serial Port");
901 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "Parallel Port");
902 AMIGAHW_ANNOUNCE(A2000_CLK, "Hardware Clock (A2000 style)");
903 AMIGAHW_ANNOUNCE(A3000_CLK, "Hardware Clock (A3000 style)");
904 AMIGAHW_ANNOUNCE(CHIP_RAM, "Chip RAM");
905 AMIGAHW_ANNOUNCE(PAULA, "Paula 8364");
906 AMIGAHW_ANNOUNCE(DENISE, "Denise 8362");
907 AMIGAHW_ANNOUNCE(DENISE_HR, "Denise 8373");
908 AMIGAHW_ANNOUNCE(LISA, "Lisa 8375");
909 AMIGAHW_ANNOUNCE(AGNUS_PAL, "Normal/Fat PAL Agnus 8367/8371");
910 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "Normal/Fat NTSC Agnus 8361/8370");
911 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "Fat Hires PAL Agnus 8372");
912 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "Fat Hires NTSC Agnus 8372");
913 AMIGAHW_ANNOUNCE(ALICE_PAL, "PAL Alice 8374");
914 AMIGAHW_ANNOUNCE(ALICE_NTSC, "NTSC Alice 8374");
915 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "Magic Hard Rekick");
916 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA Slot");
917 if (AMIGAHW_PRESENT(ZORRO))
918 len += sprintf(buffer+len, "\tZorro II%s AutoConfig: %d Expansion "
919 "Device%s\n",
920 AMIGAHW_PRESENT(ZORRO3) ? "I" : "",
921 zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s");
922
923#undef AMIGAHW_ANNOUNCE
924
925 return(len);
926}
927
928#ifdef CONFIG_APUS
929int get_hardware_list(char *buffer)
930{
931 extern int get_cpuinfo(char *buffer);
932 int len = 0;
933 char model[80];
934 u_long mem;
935 int i;
936
937 if (mach_get_model)
938 mach_get_model(model);
939 else
940 strcpy(model, "Unknown PowerPC");
941
942 len += sprintf(buffer+len, "Model:\t\t%s\n", model);
943 len += get_cpuinfo(buffer+len);
944 for (mem = 0, i = 0; i < m68k_realnum_memory; i++)
945 mem += m68k_memory[i].size;
946 len += sprintf(buffer+len, "System Memory:\t%ldK\n", mem>>10);
947
948 if (mach_get_hardware_list)
949 len += mach_get_hardware_list(buffer+len);
950
951 return(len);
952}
953#endif
diff --git a/arch/ppc/amiga/ints.c b/arch/ppc/amiga/ints.c
deleted file mode 100644
index 083a17462190..000000000000
--- a/arch/ppc/amiga/ints.c
+++ /dev/null
@@ -1,158 +0,0 @@
1/*
2 * Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c
3 * Needed to drive the m68k emulating IRQ hardware on the PowerUp boards.
4 */
5
6#include <linux/types.h>
7#include <linux/sched.h>
8#include <linux/kernel_stat.h>
9#include <linux/errno.h>
10#include <linux/init.h>
11#include <linux/seq_file.h>
12
13#include <asm/setup.h>
14#include <asm/system.h>
15#include <asm/irq.h>
16#include <asm/traps.h>
17#include <asm/page.h>
18#include <asm/machdep.h>
19
20/* table for system interrupt handlers */
21static irq_handler_t irq_list[SYS_IRQS];
22
23static const char *default_names[SYS_IRQS] = {
24 "spurious int", "int1 handler", "int2 handler", "int3 handler",
25 "int4 handler", "int5 handler", "int6 handler", "int7 handler"
26};
27
28/* The number of spurious interrupts */
29volatile unsigned int num_spurious;
30
31#define NUM_IRQ_NODES 100
32static irq_node_t nodes[NUM_IRQ_NODES];
33
34
35/*
36 * void init_IRQ(void)
37 *
38 * Parameters: None
39 *
40 * Returns: Nothing
41 *
42 * This function should be called during kernel startup to initialize
43 * the IRQ handling routines.
44 */
45
46__init
47void m68k_init_IRQ(void)
48{
49 int i;
50
51 for (i = 0; i < SYS_IRQS; i++) {
52 if (mach_default_handler)
53 irq_list[i].handler = (*mach_default_handler)[i];
54 irq_list[i].flags = 0;
55 irq_list[i].dev_id = NULL;
56 irq_list[i].devname = default_names[i];
57 }
58
59 for (i = 0; i < NUM_IRQ_NODES; i++)
60 nodes[i].handler = NULL;
61
62 mach_init_IRQ ();
63}
64
65irq_node_t *new_irq_node(void)
66{
67 irq_node_t *node;
68 short i;
69
70 for (node = nodes, i = NUM_IRQ_NODES-1; i >= 0; node++, i--)
71 if (!node->handler)
72 return node;
73
74 printk ("new_irq_node: out of nodes\n");
75 return NULL;
76}
77
78int sys_request_irq(unsigned int irq,
79 void (*handler)(int, void *, struct pt_regs *),
80 unsigned long flags, const char *devname, void *dev_id)
81{
82 if (irq < IRQ1 || irq > IRQ7) {
83 printk("%s: Incorrect IRQ %d from %s\n",
84 __FUNCTION__, irq, devname);
85 return -ENXIO;
86 }
87
88#if 0
89 if (!(irq_list[irq].flags & IRQ_FLG_STD)) {
90 if (irq_list[irq].flags & IRQ_FLG_LOCK) {
91 printk("%s: IRQ %d from %s is not replaceable\n",
92 __FUNCTION__, irq, irq_list[irq].devname);
93 return -EBUSY;
94 }
95 if (!(flags & IRQ_FLG_REPLACE)) {
96 printk("%s: %s can't replace IRQ %d from %s\n",
97 __FUNCTION__, devname, irq, irq_list[irq].devname);
98 return -EBUSY;
99 }
100 }
101#endif
102
103 irq_list[irq].handler = handler;
104 irq_list[irq].flags = flags;
105 irq_list[irq].dev_id = dev_id;
106 irq_list[irq].devname = devname;
107 return 0;
108}
109
110void sys_free_irq(unsigned int irq, void *dev_id)
111{
112 if (irq < IRQ1 || irq > IRQ7) {
113 printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
114 return;
115 }
116
117 if (irq_list[irq].dev_id != dev_id)
118 printk("%s: Removing probably wrong IRQ %d from %s\n",
119 __FUNCTION__, irq, irq_list[irq].devname);
120
121 irq_list[irq].handler = (*mach_default_handler)[irq];
122 irq_list[irq].flags = 0;
123 irq_list[irq].dev_id = NULL;
124 irq_list[irq].devname = default_names[irq];
125}
126
127asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
128{
129 if (vec >= VEC_INT1 && vec <= VEC_INT7 && !MACH_IS_BVME6000) {
130 vec -= VEC_SPUR;
131 kstat_cpu(0).irqs[vec]++;
132 irq_list[vec].handler(vec, irq_list[vec].dev_id, fp);
133 } else {
134 if (mach_process_int)
135 mach_process_int(vec, fp);
136 else
137 panic("Can't process interrupt vector %ld\n", vec);
138 return;
139 }
140}
141
142int m68k_get_irq_list(struct seq_file *p, void *v)
143{
144 int i;
145
146 /* autovector interrupts */
147 if (mach_default_handler) {
148 for (i = 0; i < SYS_IRQS; i++) {
149 seq_printf(p, "auto %2d: %10u ", i,
150 i ? kstat_cpu(0).irqs[i] : num_spurious);
151 seq_puts(p, " ");
152 seq_printf(p, "%s\n", irq_list[i].devname);
153 }
154 }
155
156 mach_get_irq_list(p, v);
157 return 0;
158}
diff --git a/arch/ppc/amiga/pcmcia.c b/arch/ppc/amiga/pcmcia.c
deleted file mode 100644
index 5d29dc65093c..000000000000
--- a/arch/ppc/amiga/pcmcia.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/pcmcia.c"
diff --git a/arch/ppc/amiga/time.c b/arch/ppc/amiga/time.c
deleted file mode 100644
index 8c880c0ca380..000000000000
--- a/arch/ppc/amiga/time.c
+++ /dev/null
@@ -1,57 +0,0 @@
1#include <linux/errno.h>
2#include <linux/sched.h>
3#include <linux/kernel.h>
4#include <linux/param.h>
5#include <linux/string.h>
6#include <linux/mm.h>
7
8#include <asm/machdep.h>
9#include <asm/io.h>
10
11#include <linux/timex.h>
12
13unsigned long m68k_get_rtc_time(void)
14{
15 unsigned int year, mon, day, hour, min, sec;
16
17 extern void arch_gettod(int *year, int *mon, int *day, int *hour,
18 int *min, int *sec);
19
20 arch_gettod (&year, &mon, &day, &hour, &min, &sec);
21
22 if ((year += 1900) < 1970)
23 year += 100;
24
25 return mktime(year, mon, day, hour, min, sec);
26}
27
28int m68k_set_rtc_time(unsigned long nowtime)
29{
30 if (mach_set_clock_mmss)
31 return mach_set_clock_mmss (nowtime);
32 return -1;
33}
34
35void apus_heartbeat (void)
36{
37#ifdef CONFIG_HEARTBEAT
38 static unsigned cnt = 0, period = 0, dist = 0;
39
40 if (cnt == 0 || cnt == dist)
41 mach_heartbeat( 1 );
42 else if (cnt == 7 || cnt == dist+7)
43 mach_heartbeat( 0 );
44
45 if (++cnt > period) {
46 cnt = 0;
47 /* The hyperbolic function below modifies the heartbeat period
48 * length in dependency of the current (5min) load. It goes
49 * through the points f(0)=126, f(1)=86, f(5)=51,
50 * f(inf)->30. */
51 period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
52 dist = period / 4;
53 }
54#endif
55 /* should be made smarter */
56 ppc_md.heartbeat_count = 1;
57}
diff --git a/arch/ppc/configs/apus_defconfig b/arch/ppc/configs/apus_defconfig
deleted file mode 100644
index e2245252d31f..000000000000
--- a/arch/ppc/configs/apus_defconfig
+++ /dev/null
@@ -1,920 +0,0 @@
1#
2# Automatically generated make config: don't edit
3#
4CONFIG_MMU=y
5CONFIG_RWSEM_XCHGADD_ALGORITHM=y
6CONFIG_HAVE_DEC_LOCK=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21# CONFIG_EMBEDDED is not set
22CONFIG_FUTEX=y
23CONFIG_EPOLL=y
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30CONFIG_MODULE_FORCE_UNLOAD=y
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40CONFIG_6xx=y
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43# CONFIG_8xx is not set
44
45#
46# IBM 4xx options
47#
48# CONFIG_8260 is not set
49CONFIG_GENERIC_ISA_DMA=y
50CONFIG_PPC_STD_MMU=y
51CONFIG_SERIAL_CONSOLE=y
52# CONFIG_PPC_MULTIPLATFORM is not set
53CONFIG_APUS=y
54# CONFIG_WILLOW_2 is not set
55# CONFIG_PCORE is not set
56# CONFIG_POWERPMC250 is not set
57# CONFIG_EV64260 is not set
58# CONFIG_SPRUCE is not set
59# CONFIG_LOPEC is not set
60# CONFIG_MCPN765 is not set
61# CONFIG_MVME5100 is not set
62# CONFIG_PPLUS is not set
63# CONFIG_PRPMC750 is not set
64# CONFIG_PRPMC800 is not set
65# CONFIG_SANDPOINT is not set
66# CONFIG_ADIR is not set
67# CONFIG_K2 is not set
68# CONFIG_PAL4 is not set
69# CONFIG_GEMINI is not set
70# CONFIG_SMP is not set
71# CONFIG_PREEMPT is not set
72# CONFIG_ALTIVEC is not set
73# CONFIG_TAU is not set
74# CONFIG_CPU_FREQ is not set
75
76#
77# General setup
78#
79# CONFIG_HIGHMEM is not set
80CONFIG_PCI=y
81CONFIG_PCI_DOMAINS=y
82CONFIG_PCI_PERMEDIA=y
83CONFIG_KCORE_ELF=y
84CONFIG_BINFMT_ELF=y
85CONFIG_KERNEL_ELF=y
86CONFIG_BINFMT_MISC=m
87CONFIG_PCI_LEGACY_PROC=y
88CONFIG_PCI_NAMES=y
89# CONFIG_HOTPLUG is not set
90
91#
92# Parallel port support
93#
94CONFIG_PARPORT=m
95# CONFIG_PARPORT_PC is not set
96CONFIG_PARPORT_AMIGA=m
97# CONFIG_PARPORT_MFC3 is not set
98# CONFIG_PARPORT_OTHER is not set
99# CONFIG_PARPORT_1284 is not set
100CONFIG_PPC601_SYNC_FIX=y
101# CONFIG_CMDLINE_BOOL is not set
102CONFIG_AMIGA=y
103CONFIG_ZORRO=y
104CONFIG_ABSTRACT_CONSOLE=y
105CONFIG_APUS_FAST_EXCEPT=y
106CONFIG_AMIGA_PCMCIA=y
107CONFIG_AMIGA_BUILTIN_SERIAL=y
108CONFIG_GVPIOEXT=y
109CONFIG_GVPIOEXT_LP=m
110CONFIG_GVPIOEXT_PLIP=m
111CONFIG_MULTIFACE_III_TTY=y
112CONFIG_A2232=y
113CONFIG_WHIPPET_SERIAL=y
114CONFIG_APNE=y
115CONFIG_HEARTBEAT=y
116CONFIG_PROC_HARDWARE=y
117CONFIG_ZORRO_NAMES=y
118
119#
120# Advanced setup
121#
122# CONFIG_ADVANCED_OPTIONS is not set
123
124#
125# Default settings for advanced configuration options are used
126#
127CONFIG_HIGHMEM_START=0xfe000000
128CONFIG_LOWMEM_SIZE=0x30000000
129CONFIG_KERNEL_START=0xc0000000
130CONFIG_TASK_SIZE=0x80000000
131CONFIG_BOOT_LOAD=0x00800000
132
133#
134# Memory Technology Devices (MTD)
135#
136# CONFIG_MTD is not set
137
138#
139# Plug and Play support
140#
141# CONFIG_PNP is not set
142
143#
144# Block devices
145#
146# CONFIG_BLK_DEV_FD is not set
147CONFIG_AMIGA_FLOPPY=y
148CONFIG_AMIGA_Z2RAM=m
149# CONFIG_PARIDE is not set
150# CONFIG_BLK_CPQ_DA is not set
151# CONFIG_BLK_CPQ_CISS_DA is not set
152# CONFIG_BLK_DEV_DAC960 is not set
153# CONFIG_BLK_DEV_UMEM is not set
154CONFIG_BLK_DEV_LOOP=y
155CONFIG_BLK_DEV_NBD=m
156CONFIG_BLK_DEV_RAM=y
157CONFIG_BLK_DEV_RAM_SIZE=4096
158CONFIG_BLK_DEV_INITRD=y
159
160#
161# Multi-device support (RAID and LVM)
162#
163CONFIG_MD=y
164CONFIG_BLK_DEV_MD=m
165CONFIG_MD_LINEAR=m
166CONFIG_MD_RAID0=m
167CONFIG_MD_RAID1=m
168CONFIG_MD_RAID5=m
169# CONFIG_MD_MULTIPATH is not set
170CONFIG_BLK_DEV_DM=m
171
172#
173# ATA/IDE/MFM/RLL support
174#
175CONFIG_IDE=y
176
177#
178# IDE, ATA and ATAPI Block devices
179#
180CONFIG_BLK_DEV_IDE=y
181
182#
183# Please see Documentation/ide.txt for help/info on IDE drives
184#
185# CONFIG_BLK_DEV_HD is not set
186CONFIG_BLK_DEV_IDEDISK=y
187# CONFIG_IDEDISK_MULTI_MODE is not set
188# CONFIG_IDEDISK_STROKE is not set
189CONFIG_BLK_DEV_IDECD=y
190CONFIG_BLK_DEV_IDEFLOPPY=y
191CONFIG_BLK_DEV_IDESCSI=m
192# CONFIG_IDE_TASK_IOCTL is not set
193
194#
195# IDE chipset support/bugfixes
196#
197# CONFIG_BLK_DEV_IDEPCI is not set
198CONFIG_BLK_DEV_GAYLE=y
199CONFIG_BLK_DEV_IDEDOUBLER=y
200CONFIG_BLK_DEV_BUDDHA=y
201
202#
203# SCSI support
204#
205CONFIG_SCSI=y
206
207#
208# SCSI support type (disk, tape, CD-ROM)
209#
210CONFIG_BLK_DEV_SD=y
211CONFIG_CHR_DEV_ST=m
212CONFIG_CHR_DEV_OSST=m
213CONFIG_BLK_DEV_SR=y
214CONFIG_BLK_DEV_SR_VENDOR=y
215CONFIG_CHR_DEV_SG=m
216
217#
218# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
219#
220# CONFIG_SCSI_MULTI_LUN is not set
221# CONFIG_SCSI_REPORT_LUNS is not set
222CONFIG_SCSI_CONSTANTS=y
223CONFIG_SCSI_LOGGING=y
224
225#
226# SCSI low-level drivers
227#
228# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
229# CONFIG_SCSI_ACARD is not set
230# CONFIG_SCSI_AACRAID is not set
231# CONFIG_SCSI_AIC7XXX is not set
232# CONFIG_SCSI_AIC7XXX_OLD is not set
233# CONFIG_SCSI_AIC79XX is not set
234# CONFIG_SCSI_DPT_I2O is not set
235# CONFIG_SCSI_ADVANSYS is not set
236# CONFIG_SCSI_IN2000 is not set
237# CONFIG_SCSI_AM53C974 is not set
238# CONFIG_SCSI_MEGARAID is not set
239# CONFIG_SCSI_BUSLOGIC is not set
240# CONFIG_SCSI_CPQFCTS is not set
241# CONFIG_SCSI_DMX3191D is not set
242# CONFIG_SCSI_EATA is not set
243# CONFIG_SCSI_EATA_PIO is not set
244# CONFIG_SCSI_FUTURE_DOMAIN is not set
245# CONFIG_SCSI_GDTH is not set
246# CONFIG_SCSI_GENERIC_NCR5380 is not set
247# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
248# CONFIG_SCSI_INITIO is not set
249# CONFIG_SCSI_INIA100 is not set
250# CONFIG_SCSI_PPA is not set
251# CONFIG_SCSI_IMM is not set
252# CONFIG_SCSI_NCR53C7xx is not set
253# CONFIG_SCSI_SYM53C8XX_2 is not set
254# CONFIG_SCSI_NCR53C8XX is not set
255# CONFIG_SCSI_SYM53C8XX is not set
256# CONFIG_SCSI_PCI2000 is not set
257# CONFIG_SCSI_PCI2220I is not set
258# CONFIG_SCSI_QLOGIC_ISP is not set
259# CONFIG_SCSI_QLOGIC_FC is not set
260# CONFIG_SCSI_QLOGIC_1280 is not set
261# CONFIG_SCSI_DC395x is not set
262# CONFIG_SCSI_DC390T is not set
263# CONFIG_SCSI_U14_34F is not set
264# CONFIG_SCSI_NSP32 is not set
265# CONFIG_SCSI_DEBUG is not set
266CONFIG_A3000_SCSI=y
267CONFIG_A4000T_SCSI=y
268CONFIG_A2091_SCSI=y
269CONFIG_GVP11_SCSI=y
270CONFIG_CYBERSTORM_SCSI=y
271CONFIG_CYBERSTORMII_SCSI=y
272CONFIG_BLZ2060_SCSI=y
273CONFIG_BLZ1230_SCSI=y
274CONFIG_FASTLANE_SCSI=y
275CONFIG_A4091_SCSI=y
276CONFIG_WARPENGINE_SCSI=y
277CONFIG_BLZ603EPLUS_SCSI=y
278CONFIG_OKTAGON_SCSI=y
279
280#
281# Fusion MPT device support
282#
283# CONFIG_FUSION is not set
284
285#
286# IEEE 1394 (FireWire) support (EXPERIMENTAL)
287#
288# CONFIG_IEEE1394 is not set
289
290#
291# I2O device support
292#
293# CONFIG_I2O is not set
294
295#
296# Networking support
297#
298CONFIG_NET=y
299
300#
301# Networking options
302#
303CONFIG_PACKET=m
304CONFIG_PACKET_MMAP=y
305CONFIG_NETLINK_DEV=m
306CONFIG_NETFILTER=y
307# CONFIG_NETFILTER_DEBUG is not set
308CONFIG_UNIX=y
309# CONFIG_NET_KEY is not set
310CONFIG_INET=y
311# CONFIG_IP_MULTICAST is not set
312# CONFIG_IP_ADVANCED_ROUTER is not set
313# CONFIG_IP_PNP is not set
314# CONFIG_NET_IPIP is not set
315# CONFIG_NET_IPGRE is not set
316# CONFIG_ARPD is not set
317# CONFIG_INET_ECN is not set
318CONFIG_SYN_COOKIES=y
319# CONFIG_INET_AH is not set
320# CONFIG_INET_ESP is not set
321# CONFIG_INET_IPCOMP is not set
322
323#
324# IP: Netfilter Configuration
325#
326CONFIG_IP_NF_CONNTRACK=m
327CONFIG_IP_NF_FTP=m
328CONFIG_IP_NF_IRC=m
329CONFIG_IP_NF_TFTP=m
330CONFIG_IP_NF_AMANDA=m
331CONFIG_IP_NF_QUEUE=m
332CONFIG_IP_NF_IPTABLES=m
333CONFIG_IP_NF_MATCH_LIMIT=m
334CONFIG_IP_NF_MATCH_MAC=m
335# CONFIG_IP_NF_MATCH_PKTTYPE is not set
336CONFIG_IP_NF_MATCH_MARK=m
337CONFIG_IP_NF_MATCH_MULTIPORT=m
338CONFIG_IP_NF_MATCH_TOS=m
339# CONFIG_IP_NF_MATCH_ECN is not set
340# CONFIG_IP_NF_MATCH_DSCP is not set
341# CONFIG_IP_NF_MATCH_AH_ESP is not set
342CONFIG_IP_NF_MATCH_LENGTH=m
343CONFIG_IP_NF_MATCH_TTL=m
344CONFIG_IP_NF_MATCH_TCPMSS=m
345CONFIG_IP_NF_MATCH_HELPER=m
346CONFIG_IP_NF_MATCH_STATE=m
347CONFIG_IP_NF_MATCH_CONNTRACK=m
348CONFIG_IP_NF_MATCH_UNCLEAN=m
349CONFIG_IP_NF_MATCH_OWNER=m
350CONFIG_IP_NF_FILTER=m
351CONFIG_IP_NF_TARGET_REJECT=m
352CONFIG_IP_NF_TARGET_MIRROR=m
353CONFIG_IP_NF_NAT=m
354CONFIG_IP_NF_NAT_NEEDED=y
355CONFIG_IP_NF_TARGET_MASQUERADE=m
356CONFIG_IP_NF_TARGET_REDIRECT=m
357CONFIG_IP_NF_NAT_SNMP_BASIC=m
358CONFIG_IP_NF_NAT_IRC=m
359CONFIG_IP_NF_NAT_FTP=m
360CONFIG_IP_NF_NAT_TFTP=m
361CONFIG_IP_NF_NAT_AMANDA=m
362CONFIG_IP_NF_MANGLE=m
363CONFIG_IP_NF_TARGET_TOS=m
364CONFIG_IP_NF_TARGET_ECN=m
365CONFIG_IP_NF_TARGET_DSCP=m
366CONFIG_IP_NF_TARGET_MARK=m
367CONFIG_IP_NF_TARGET_LOG=m
368CONFIG_IP_NF_TARGET_ULOG=m
369CONFIG_IP_NF_TARGET_TCPMSS=m
370CONFIG_IP_NF_ARPTABLES=m
371CONFIG_IP_NF_ARPFILTER=m
372CONFIG_IP_NF_COMPAT_IPCHAINS=m
373# CONFIG_IP_NF_COMPAT_IPFWADM is not set
374# CONFIG_IPV6 is not set
375# CONFIG_XFRM_USER is not set
376
377#
378# SCTP Configuration (EXPERIMENTAL)
379#
380CONFIG_IPV6_SCTP__=y
381# CONFIG_IP_SCTP is not set
382# CONFIG_ATM is not set
383# CONFIG_VLAN_8021Q is not set
384# CONFIG_LLC is not set
385# CONFIG_DECNET is not set
386# CONFIG_BRIDGE is not set
387# CONFIG_X25 is not set
388# CONFIG_LAPB is not set
389# CONFIG_NET_DIVERT is not set
390# CONFIG_ECONET is not set
391# CONFIG_WAN_ROUTER is not set
392# CONFIG_NET_HW_FLOWCONTROL is not set
393
394#
395# QoS and/or fair queueing
396#
397# CONFIG_NET_SCHED is not set
398
399#
400# Network testing
401#
402# CONFIG_NET_PKTGEN is not set
403CONFIG_NETDEVICES=y
404
405#
406# ARCnet devices
407#
408# CONFIG_ARCNET is not set
409CONFIG_DUMMY=m
410# CONFIG_BONDING is not set
411# CONFIG_EQUALIZER is not set
412CONFIG_TUN=m
413# CONFIG_ETHERTAP is not set
414
415#
416# Ethernet (10 or 100Mbit)
417#
418CONFIG_NET_ETHERNET=y
419# CONFIG_MII is not set
420# CONFIG_OAKNET is not set
421CONFIG_ARIADNE=y
422# CONFIG_ZORRO8390 is not set
423CONFIG_A2065=y
424CONFIG_HYDRA=y
425# CONFIG_HAPPYMEAL is not set
426# CONFIG_SUNGEM is not set
427# CONFIG_NET_VENDOR_3COM is not set
428
429#
430# Tulip family network device support
431#
432# CONFIG_NET_TULIP is not set
433# CONFIG_HP100 is not set
434# CONFIG_NET_PCI is not set
435
436#
437# Ethernet (1000 Mbit)
438#
439# CONFIG_ACENIC is not set
440# CONFIG_DL2K is not set
441# CONFIG_E1000 is not set
442# CONFIG_NS83820 is not set
443# CONFIG_HAMACHI is not set
444# CONFIG_YELLOWFIN is not set
445# CONFIG_R8169 is not set
446# CONFIG_SK98LIN is not set
447# CONFIG_TIGON3 is not set
448
449#
450# Ethernet (10000 Mbit)
451#
452# CONFIG_IXGB is not set
453# CONFIG_FDDI is not set
454# CONFIG_HIPPI is not set
455CONFIG_PLIP=m
456CONFIG_PPP=y
457CONFIG_PPP_MULTILINK=y
458CONFIG_PPP_FILTER=y
459CONFIG_PPP_ASYNC=y
460CONFIG_PPP_SYNC_TTY=y
461CONFIG_PPP_DEFLATE=y
462CONFIG_PPP_BSDCOMP=y
463CONFIG_PPPOE=y
464CONFIG_SLIP=y
465CONFIG_SLIP_COMPRESSED=y
466CONFIG_SLIP_SMART=y
467CONFIG_SLIP_MODE_SLIP6=y
468
469#
470# Wireless LAN (non-hamradio)
471#
472# CONFIG_NET_RADIO is not set
473
474#
475# Token Ring devices (depends on LLC=y)
476#
477# CONFIG_NET_FC is not set
478# CONFIG_RCPCI is not set
479# CONFIG_SHAPER is not set
480
481#
482# Wan interfaces
483#
484# CONFIG_WAN is not set
485
486#
487# Amateur Radio support
488#
489# CONFIG_HAMRADIO is not set
490
491#
492# IrDA (infrared) support
493#
494# CONFIG_IRDA is not set
495
496#
497# ISDN subsystem
498#
499# CONFIG_ISDN_BOOL is not set
500
501#
502# Graphics support
503#
504CONFIG_FB=y
505# CONFIG_FB_CIRRUS is not set
506CONFIG_FB_PM2=y
507# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
508# CONFIG_FB_PM2_PCI is not set
509CONFIG_FB_PM2_CVPPC=y
510CONFIG_FB_CYBER2000=y
511CONFIG_FB_AMIGA=y
512CONFIG_FB_AMIGA_OCS=y
513CONFIG_FB_AMIGA_ECS=y
514CONFIG_FB_AMIGA_AGA=y
515CONFIG_FB_CYBER=y
516CONFIG_FB_VIRGE=y
517CONFIG_FB_RETINAZ3=y
518CONFIG_FB_FM2=y
519# CONFIG_FB_CT65550 is not set
520# CONFIG_FB_IMSTT is not set
521# CONFIG_FB_S3TRIO is not set
522# CONFIG_FB_VGA16 is not set
523# CONFIG_FB_RIVA is not set
524# CONFIG_FB_MATROX is not set
525# CONFIG_FB_RADEON is not set
526# CONFIG_FB_ATY128 is not set
527# CONFIG_FB_ATY is not set
528# CONFIG_FB_SIS is not set
529# CONFIG_FB_NEOMAGIC is not set
530# CONFIG_FB_3DFX is not set
531# CONFIG_FB_VOODOO1 is not set
532# CONFIG_FB_TRIDENT is not set
533# CONFIG_FB_PM3 is not set
534# CONFIG_FB_VIRTUAL is not set
535
536#
537# Logo configuration
538#
539CONFIG_LOGO=y
540CONFIG_LOGO_LINUX_MONO=y
541CONFIG_LOGO_LINUX_VGA16=y
542CONFIG_LOGO_LINUX_CLUT224=y
543
544#
545# Old CD-ROM drivers (not SCSI, not IDE)
546#
547# CONFIG_CD_NO_IDESCSI is not set
548
549#
550# Input device support
551#
552CONFIG_INPUT=m
553
554#
555# Userland interfaces
556#
557CONFIG_INPUT_MOUSEDEV=m
558CONFIG_INPUT_MOUSEDEV_PSAUX=y
559CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
560CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
561CONFIG_INPUT_JOYDEV=m
562# CONFIG_INPUT_TSDEV is not set
563CONFIG_INPUT_EVDEV=m
564CONFIG_INPUT_EVBUG=m
565
566#
567# Input I/O drivers
568#
569# CONFIG_GAMEPORT is not set
570CONFIG_SOUND_GAMEPORT=y
571CONFIG_SERIO=y
572# CONFIG_SERIO_I8042 is not set
573CONFIG_SERIO_SERPORT=y
574# CONFIG_SERIO_CT82C710 is not set
575# CONFIG_SERIO_PARKBD is not set
576
577#
578# Input Device Drivers
579#
580CONFIG_INPUT_KEYBOARD=y
581CONFIG_KEYBOARD_ATKBD=m
582# CONFIG_KEYBOARD_SUNKBD is not set
583# CONFIG_KEYBOARD_XTKBD is not set
584# CONFIG_KEYBOARD_NEWTON is not set
585CONFIG_KEYBOARD_AMIGA=m
586CONFIG_INPUT_MOUSE=y
587CONFIG_MOUSE_PS2=m
588CONFIG_MOUSE_SERIAL=m
589CONFIG_MOUSE_AMIGA=m
590# CONFIG_INPUT_JOYSTICK is not set
591# CONFIG_INPUT_TOUCHSCREEN is not set
592CONFIG_INPUT_MISC=y
593# CONFIG_INPUT_PCSPKR is not set
594CONFIG_INPUT_UINPUT=m
595
596#
597# Macintosh device drivers
598#
599
600#
601# Character devices
602#
603# CONFIG_SERIAL_NONSTANDARD is not set
604
605#
606# Serial drivers
607#
608# CONFIG_SERIAL_8250 is not set
609
610#
611# Non-8250 serial port support
612#
613CONFIG_UNIX98_PTYS=y
614CONFIG_UNIX98_PTY_COUNT=256
615CONFIG_PRINTER=m
616# CONFIG_LP_CONSOLE is not set
617# CONFIG_PPDEV is not set
618# CONFIG_TIPAR is not set
619
620#
621# I2C support
622#
623# CONFIG_I2C is not set
624
625#
626# I2C Hardware Sensors Mainboard support
627#
628
629#
630# I2C Hardware Sensors Chip support
631#
632# CONFIG_I2C_SENSOR is not set
633
634#
635# Mice
636#
637CONFIG_BUSMOUSE=y
638# CONFIG_QIC02_TAPE is not set
639
640#
641# IPMI
642#
643# CONFIG_IPMI_HANDLER is not set
644
645#
646# Watchdog Cards
647#
648# CONFIG_WATCHDOG is not set
649# CONFIG_NVRAM is not set
650CONFIG_GEN_RTC=y
651# CONFIG_GEN_RTC_X is not set
652# CONFIG_DTLK is not set
653# CONFIG_R3964 is not set
654# CONFIG_APPLICOM is not set
655
656#
657# Ftape, the floppy tape device driver
658#
659# CONFIG_FTAPE is not set
660# CONFIG_AGP is not set
661# CONFIG_DRM is not set
662# CONFIG_RAW_DRIVER is not set
663# CONFIG_HANGCHECK_TIMER is not set
664
665#
666# Multimedia devices
667#
668# CONFIG_VIDEO_DEV is not set
669
670#
671# Digital Video Broadcasting Devices
672#
673# CONFIG_DVB is not set
674
675#
676# File systems
677#
678CONFIG_EXT2_FS=y
679# CONFIG_EXT2_FS_XATTR is not set
680CONFIG_EXT3_FS=y
681CONFIG_EXT3_FS_XATTR=y
682# CONFIG_EXT3_FS_POSIX_ACL is not set
683# CONFIG_EXT3_FS_SECURITY is not set
684CONFIG_JBD=y
685# CONFIG_JBD_DEBUG is not set
686CONFIG_FS_MBCACHE=y
687# CONFIG_REISERFS_FS is not set
688# CONFIG_JFS_FS is not set
689# CONFIG_XFS_FS is not set
690CONFIG_MINIX_FS=y
691CONFIG_ROMFS_FS=y
692# CONFIG_QUOTA is not set
693CONFIG_AUTOFS_FS=m
694CONFIG_AUTOFS4_FS=m
695
696#
697# CD-ROM/DVD Filesystems
698#
699CONFIG_ISO9660_FS=y
700CONFIG_JOLIET=y
701# CONFIG_ZISOFS is not set
702# CONFIG_UDF_FS is not set
703
704#
705# DOS/FAT/NT Filesystems
706#
707CONFIG_FAT_FS=y
708CONFIG_MSDOS_FS=y
709CONFIG_VFAT_FS=y
710# CONFIG_NTFS_FS is not set
711
712#
713# Pseudo filesystems
714#
715CONFIG_PROC_FS=y
716# CONFIG_DEVFS_FS is not set
717CONFIG_DEVPTS_FS=y
718# CONFIG_DEVPTS_FS_XATTR is not set
719CONFIG_TMPFS=y
720CONFIG_RAMFS=y
721
722#
723# Miscellaneous filesystems
724#
725# CONFIG_ADFS_FS is not set
726CONFIG_AFFS_FS=y
727CONFIG_HFS_FS=y
728# CONFIG_BEFS_FS is not set
729# CONFIG_BFS_FS is not set
730# CONFIG_EFS_FS is not set
731CONFIG_CRAMFS=y
732# CONFIG_VXFS_FS is not set
733# CONFIG_HPFS_FS is not set
734# CONFIG_QNX4FS_FS is not set
735# CONFIG_SYSV_FS is not set
736# CONFIG_UFS_FS is not set
737
738#
739# Network File Systems
740#
741CONFIG_NFS_FS=y
742CONFIG_NFS_V3=y
743# CONFIG_NFS_V4 is not set
744CONFIG_NFSD=m
745CONFIG_NFSD_V3=y
746# CONFIG_NFSD_V4 is not set
747# CONFIG_NFSD_TCP is not set
748CONFIG_LOCKD=y
749CONFIG_LOCKD_V4=y
750CONFIG_EXPORTFS=m
751CONFIG_SUNRPC=y
752# CONFIG_SUNRPC_GSS is not set
753CONFIG_SMB_FS=m
754# CONFIG_SMB_NLS_DEFAULT is not set
755# CONFIG_CIFS is not set
756# CONFIG_NCP_FS is not set
757CONFIG_CODA_FS=m
758# CONFIG_INTERMEZZO_FS is not set
759# CONFIG_AFS_FS is not set
760
761#
762# Partition Types
763#
764CONFIG_PARTITION_ADVANCED=y
765# CONFIG_ACORN_PARTITION is not set
766# CONFIG_OSF_PARTITION is not set
767CONFIG_AMIGA_PARTITION=y
768CONFIG_ATARI_PARTITION=y
769# CONFIG_MAC_PARTITION is not set
770CONFIG_MSDOS_PARTITION=y
771CONFIG_BSD_DISKLABEL=y
772# CONFIG_MINIX_SUBPARTITION is not set
773CONFIG_SOLARIS_X86_PARTITION=y
774CONFIG_UNIXWARE_DISKLABEL=y
775# CONFIG_LDM_PARTITION is not set
776# CONFIG_NEC98_PARTITION is not set
777# CONFIG_SGI_PARTITION is not set
778# CONFIG_ULTRIX_PARTITION is not set
779# CONFIG_SUN_PARTITION is not set
780# CONFIG_EFI_PARTITION is not set
781CONFIG_SMB_NLS=y
782CONFIG_NLS=y
783
784#
785# Native Language Support
786#
787CONFIG_NLS_DEFAULT="iso8859-1"
788CONFIG_NLS_CODEPAGE_437=m
789CONFIG_NLS_CODEPAGE_737=m
790CONFIG_NLS_CODEPAGE_775=m
791CONFIG_NLS_CODEPAGE_850=m
792CONFIG_NLS_CODEPAGE_852=m
793CONFIG_NLS_CODEPAGE_855=m
794CONFIG_NLS_CODEPAGE_857=m
795CONFIG_NLS_CODEPAGE_860=m
796CONFIG_NLS_CODEPAGE_861=m
797CONFIG_NLS_CODEPAGE_862=m
798CONFIG_NLS_CODEPAGE_863=m
799CONFIG_NLS_CODEPAGE_864=m
800CONFIG_NLS_CODEPAGE_865=m
801CONFIG_NLS_CODEPAGE_866=m
802CONFIG_NLS_CODEPAGE_869=m
803CONFIG_NLS_CODEPAGE_936=m
804CONFIG_NLS_CODEPAGE_950=m
805CONFIG_NLS_CODEPAGE_932=m
806CONFIG_NLS_CODEPAGE_949=m
807CONFIG_NLS_CODEPAGE_874=m
808CONFIG_NLS_ISO8859_8=m
809# CONFIG_NLS_CODEPAGE_1250 is not set
810CONFIG_NLS_CODEPAGE_1251=m
811CONFIG_NLS_ISO8859_1=m
812CONFIG_NLS_ISO8859_2=m
813CONFIG_NLS_ISO8859_3=m
814CONFIG_NLS_ISO8859_4=m
815CONFIG_NLS_ISO8859_5=m
816CONFIG_NLS_ISO8859_6=m
817CONFIG_NLS_ISO8859_7=m
818CONFIG_NLS_ISO8859_9=m
819CONFIG_NLS_ISO8859_13=m
820CONFIG_NLS_ISO8859_14=m
821CONFIG_NLS_ISO8859_15=m
822CONFIG_NLS_KOI8_R=m
823CONFIG_NLS_KOI8_U=m
824CONFIG_NLS_UTF8=m
825
826#
827# Sound
828#
829CONFIG_SOUND=y
830CONFIG_DMASOUND_PAULA=m
831CONFIG_DMASOUND=m
832
833#
834# Advanced Linux Sound Architecture
835#
836# CONFIG_SND is not set
837
838#
839# Open Sound System
840#
841CONFIG_SOUND_PRIME=m
842# CONFIG_SOUND_BT878 is not set
843# CONFIG_SOUND_CMPCI is not set
844# CONFIG_SOUND_EMU10K1 is not set
845# CONFIG_SOUND_FUSION is not set
846# CONFIG_SOUND_CS4281 is not set
847# CONFIG_SOUND_ES1370 is not set
848# CONFIG_SOUND_ES1371 is not set
849# CONFIG_SOUND_ESSSOLO1 is not set
850# CONFIG_SOUND_MAESTRO is not set
851# CONFIG_SOUND_MAESTRO3 is not set
852# CONFIG_SOUND_ICH is not set
853# CONFIG_SOUND_RME96XX is not set
854# CONFIG_SOUND_SONICVIBES is not set
855# CONFIG_SOUND_TRIDENT is not set
856# CONFIG_SOUND_MSNDCLAS is not set
857# CONFIG_SOUND_MSNDPIN is not set
858# CONFIG_SOUND_VIA82CXXX is not set
859CONFIG_SOUND_OSS=m
860CONFIG_SOUND_TRACEINIT=y
861CONFIG_SOUND_DMAP=y
862# CONFIG_SOUND_AD1816 is not set
863# CONFIG_SOUND_SGALAXY is not set
864# CONFIG_SOUND_ADLIB is not set
865# CONFIG_SOUND_ACI_MIXER is not set
866# CONFIG_SOUND_CS4232 is not set
867# CONFIG_SOUND_SSCAPE is not set
868# CONFIG_SOUND_GUS is not set
869CONFIG_SOUND_VMIDI=m
870# CONFIG_SOUND_TRIX is not set
871# CONFIG_SOUND_MSS is not set
872# CONFIG_SOUND_MPU401 is not set
873# CONFIG_SOUND_NM256 is not set
874# CONFIG_SOUND_MAD16 is not set
875# CONFIG_SOUND_PAS is not set
876# CONFIG_SOUND_PSS is not set
877# CONFIG_SOUND_SB is not set
878# CONFIG_SOUND_AWE32_SYNTH is not set
879# CONFIG_SOUND_WAVEFRONT is not set
880# CONFIG_SOUND_MAUI is not set
881# CONFIG_SOUND_YM3812 is not set
882# CONFIG_SOUND_OPL3SA1 is not set
883# CONFIG_SOUND_OPL3SA2 is not set
884# CONFIG_SOUND_YMFPCI is not set
885# CONFIG_SOUND_UART6850 is not set
886# CONFIG_SOUND_AEDSP16 is not set
887
888#
889# USB support
890#
891# CONFIG_USB is not set
892# CONFIG_USB_GADGET is not set
893
894#
895# Bluetooth support
896#
897# CONFIG_BT is not set
898
899#
900# Library routines
901#
902# CONFIG_CRC32 is not set
903CONFIG_ZLIB_INFLATE=y
904CONFIG_ZLIB_DEFLATE=y
905
906#
907# Kernel hacking
908#
909# CONFIG_DEBUG_KERNEL is not set
910# CONFIG_KALLSYMS is not set
911
912#
913# Security options
914#
915# CONFIG_SECURITY is not set
916
917#
918# Cryptographic options
919#
920# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index c7cb9d5f24a3..1b0ec7202dd5 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -32,10 +32,6 @@
32#include <asm/ppc_asm.h> 32#include <asm/ppc_asm.h>
33#include <asm/asm-offsets.h> 33#include <asm/asm-offsets.h>
34 34
35#ifdef CONFIG_APUS
36#include <asm/amigappc.h>
37#endif
38
39/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */ 35/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
40#define LOAD_BAT(n, reg, RA, RB) \ 36#define LOAD_BAT(n, reg, RA, RB) \
41 /* see the comment for clear_bats() -- Cort */ \ 37 /* see the comment for clear_bats() -- Cort */ \
@@ -128,14 +124,6 @@ __start:
128 */ 124 */
129 bl early_init 125 bl early_init
130 126
131#ifdef CONFIG_APUS
132/* On APUS the __va/__pa constants need to be set to the correct
133 * values before continuing.
134 */
135 mr r4,r30
136 bl fix_mem_constants
137#endif /* CONFIG_APUS */
138
139/* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains 127/* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains
140 * the physical address we are running at, returned by early_init() 128 * the physical address we are running at, returned by early_init()
141 */ 129 */
@@ -145,7 +133,7 @@ __after_mmu_off:
145 bl flush_tlbs 133 bl flush_tlbs
146 134
147 bl initial_bats 135 bl initial_bats
148#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 136#ifdef CONFIG_BOOTX_TEXT
149 bl setup_disp_bat 137 bl setup_disp_bat
150#endif 138#endif
151 139
@@ -161,7 +149,6 @@ __after_mmu_off:
161#endif /* CONFIG_6xx */ 149#endif /* CONFIG_6xx */
162 150
163 151
164#ifndef CONFIG_APUS
165/* 152/*
166 * We need to run with _start at physical address 0. 153 * We need to run with _start at physical address 0.
167 * If the MMU is already turned on, we copy stuff to KERNELBASE, 154 * If the MMU is already turned on, we copy stuff to KERNELBASE,
@@ -172,7 +159,7 @@ __after_mmu_off:
172 addis r4,r3,KERNELBASE@h /* current address of _start */ 159 addis r4,r3,KERNELBASE@h /* current address of _start */
173 cmpwi 0,r4,0 /* are we already running at 0? */ 160 cmpwi 0,r4,0 /* are we already running at 0? */
174 bne relocate_kernel 161 bne relocate_kernel
175#endif /* CONFIG_APUS */ 162
176/* 163/*
177 * we now have the 1st 16M of ram mapped with the bats. 164 * we now have the 1st 16M of ram mapped with the bats.
178 * prep needs the mmu to be turned on here, but pmac already has it on. 165 * prep needs the mmu to be turned on here, but pmac already has it on.
@@ -812,85 +799,6 @@ copy_and_flush:
812 addi r6,r6,4 799 addi r6,r6,4
813 blr 800 blr
814 801
815#ifdef CONFIG_APUS
816/*
817 * On APUS the physical base address of the kernel is not known at compile
818 * time, which means the __pa/__va constants used are incorrect. In the
819 * __init section is recorded the virtual addresses of instructions using
820 * these constants, so all that has to be done is fix these before
821 * continuing the kernel boot.
822 *
823 * r4 = The physical address of the kernel base.
824 */
825fix_mem_constants:
826 mr r10,r4
827 addis r10,r10,-KERNELBASE@h /* virt_to_phys constant */
828 neg r11,r10 /* phys_to_virt constant */
829
830 lis r12,__vtop_table_begin@h
831 ori r12,r12,__vtop_table_begin@l
832 add r12,r12,r10 /* table begin phys address */
833 lis r13,__vtop_table_end@h
834 ori r13,r13,__vtop_table_end@l
835 add r13,r13,r10 /* table end phys address */
836 subi r12,r12,4
837 subi r13,r13,4
8381: lwzu r14,4(r12) /* virt address of instruction */
839 add r14,r14,r10 /* phys address of instruction */
840 lwz r15,0(r14) /* instruction, now insert top */
841 rlwimi r15,r10,16,16,31 /* half of vp const in low half */
842 stw r15,0(r14) /* of instruction and restore. */
843 dcbst r0,r14 /* write it to memory */
844 sync
845 icbi r0,r14 /* flush the icache line */
846 cmpw r12,r13
847 bne 1b
848 sync /* additional sync needed on g4 */
849 isync
850
851/*
852 * Map the memory where the exception handlers will
853 * be copied to when hash constants have been patched.
854 */
855#ifdef CONFIG_APUS_FAST_EXCEPT
856 lis r8,0xfff0
857#else
858 lis r8,0
859#endif
860 ori r8,r8,0x2 /* 128KB, supervisor */
861 mtspr SPRN_DBAT3U,r8
862 mtspr SPRN_DBAT3L,r8
863
864 lis r12,__ptov_table_begin@h
865 ori r12,r12,__ptov_table_begin@l
866 add r12,r12,r10 /* table begin phys address */
867 lis r13,__ptov_table_end@h
868 ori r13,r13,__ptov_table_end@l
869 add r13,r13,r10 /* table end phys address */
870 subi r12,r12,4
871 subi r13,r13,4
8721: lwzu r14,4(r12) /* virt address of instruction */
873 add r14,r14,r10 /* phys address of instruction */
874 lwz r15,0(r14) /* instruction, now insert top */
875 rlwimi r15,r11,16,16,31 /* half of pv const in low half*/
876 stw r15,0(r14) /* of instruction and restore. */
877 dcbst r0,r14 /* write it to memory */
878 sync
879 icbi r0,r14 /* flush the icache line */
880 cmpw r12,r13
881 bne 1b
882
883 sync /* additional sync needed on g4 */
884 isync /* No speculative loading until now */
885 blr
886
887/***********************************************************************
888 * Please note that on APUS the exception handlers are located at the
889 * physical address 0xfff0000. For this reason, the exception handlers
890 * cannot use relative branches to access the code below.
891 ***********************************************************************/
892#endif /* CONFIG_APUS */
893
894#ifdef CONFIG_SMP 802#ifdef CONFIG_SMP
895 .globl __secondary_start_pmac_0 803 .globl __secondary_start_pmac_0
896__secondary_start_pmac_0: 804__secondary_start_pmac_0:
@@ -1043,19 +951,6 @@ start_here:
1043 bl machine_init 951 bl machine_init
1044 bl MMU_init 952 bl MMU_init
1045 953
1046#ifdef CONFIG_APUS
1047 /* Copy exception code to exception vector base on APUS. */
1048 lis r4,KERNELBASE@h
1049#ifdef CONFIG_APUS_FAST_EXCEPT
1050 lis r3,0xfff0 /* Copy to 0xfff00000 */
1051#else
1052 lis r3,0 /* Copy to 0x00000000 */
1053#endif
1054 li r5,0x4000 /* # bytes of memory to copy */
1055 li r6,0
1056 bl copy_and_flush /* copy the first 0x4000 bytes */
1057#endif /* CONFIG_APUS */
1058
1059/* 954/*
1060 * Go back to running unmapped so we can load up new values 955 * Go back to running unmapped so we can load up new values
1061 * for SDR1 (hash table pointer) and the segment registers 956 * for SDR1 (hash table pointer) and the segment registers
@@ -1232,11 +1127,7 @@ initial_bats:
1232#else 1127#else
1233 ori r8,r8,2 /* R/W access */ 1128 ori r8,r8,2 /* R/W access */
1234#endif /* CONFIG_SMP */ 1129#endif /* CONFIG_SMP */
1235#ifdef CONFIG_APUS
1236 ori r11,r11,BL_8M<<2|0x2 /* set up 8MB BAT registers for 604 */
1237#else
1238 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */ 1130 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */
1239#endif /* CONFIG_APUS */
1240 1131
1241 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */ 1132 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */
1242 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */ 1133 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */
@@ -1245,7 +1136,7 @@ initial_bats:
1245 isync 1136 isync
1246 blr 1137 blr
1247 1138
1248#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 1139#ifdef CONFIG_BOOTX_TEXT
1249setup_disp_bat: 1140setup_disp_bat:
1250 /* 1141 /*
1251 * setup the display bat prepared for us in prom.c 1142 * setup the display bat prepared for us in prom.c
@@ -1268,7 +1159,7 @@ setup_disp_bat:
1268 mtspr SPRN_IBAT3U,r11 1159 mtspr SPRN_IBAT3U,r11
1269 blr 1160 blr
1270 1161
1271#endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */ 1162#endif /* defined(CONFIG_BOOTX_TEXT) */
1272 1163
1273#ifdef CONFIG_8260 1164#ifdef CONFIG_8260
1274/* Jump into the system reset for the rom. 1165/* Jump into the system reset for the rom.
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 63f0a987139b..22494ec123ea 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -60,8 +60,6 @@ long long __ashrdi3(long long, int);
60long long __ashldi3(long long, int); 60long long __ashldi3(long long, int);
61long long __lshrdi3(long long, int); 61long long __lshrdi3(long long, int);
62 62
63extern unsigned long mm_ptov (unsigned long paddr);
64
65EXPORT_SYMBOL(clear_pages); 63EXPORT_SYMBOL(clear_pages);
66EXPORT_SYMBOL(clear_user_page); 64EXPORT_SYMBOL(clear_user_page);
67EXPORT_SYMBOL(transfer_to_handler); 65EXPORT_SYMBOL(transfer_to_handler);
@@ -118,7 +116,6 @@ EXPORT_SYMBOL(_outsw_ns);
118EXPORT_SYMBOL(_insl_ns); 116EXPORT_SYMBOL(_insl_ns);
119EXPORT_SYMBOL(_outsl_ns); 117EXPORT_SYMBOL(_outsl_ns);
120EXPORT_SYMBOL(iopa); 118EXPORT_SYMBOL(iopa);
121EXPORT_SYMBOL(mm_ptov);
122EXPORT_SYMBOL(ioremap); 119EXPORT_SYMBOL(ioremap);
123#ifdef CONFIG_44x 120#ifdef CONFIG_44x
124EXPORT_SYMBOL(ioremap64); 121EXPORT_SYMBOL(ioremap64);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 967c1ef59a6b..aac88c2f3db9 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -25,7 +25,6 @@
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/bootinfo.h> 26#include <asm/bootinfo.h>
27#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/amigappc.h>
29#include <asm/smp.h> 28#include <asm/smp.h>
30#include <asm/elf.h> 29#include <asm/elf.h>
31#include <asm/cputable.h> 30#include <asm/cputable.h>
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index c0aac3ff9e91..98c1212674f6 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -91,6 +91,8 @@ SECTIONS
91 . = ALIGN(8192); 91 . = ALIGN(8192);
92 .data.init_task : { *(.data.init_task) } 92 .data.init_task : { *(.data.init_task) }
93 93
94 NOTES
95
94 . = ALIGN(4096); 96 . = ALIGN(4096);
95 __init_begin = .; 97 __init_begin = .;
96 .init.text : { 98 .init.text : {
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index 35ebb6395ae3..1f51e6c94507 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -426,41 +426,3 @@ unsigned long iopa(unsigned long addr)
426 return(pa); 426 return(pa);
427} 427}
428 428
429/* This is will find the virtual address for a physical one....
430 * Swiped from APUS, could be dangerous :-).
431 * This is only a placeholder until I really find a way to make this
432 * work. -- Dan
433 */
434unsigned long
435mm_ptov (unsigned long paddr)
436{
437 unsigned long ret;
438#if 0
439 if (paddr < 16*1024*1024)
440 ret = ZTWO_VADDR(paddr);
441 else {
442 int i;
443
444 for (i = 0; i < kmap_chunk_count;){
445 unsigned long phys = kmap_chunks[i++];
446 unsigned long size = kmap_chunks[i++];
447 unsigned long virt = kmap_chunks[i++];
448 if (paddr >= phys
449 && paddr < (phys + size)){
450 ret = virt + paddr - phys;
451 goto exit;
452 }
453 }
454
455 ret = (unsigned long) __va(paddr);
456 }
457exit:
458#ifdef DEBUGPV
459 printk ("PTOV(%lx)=%lx\n", paddr, ret);
460#endif
461#else
462 ret = (unsigned long)paddr + KERNELBASE;
463#endif
464 return ret;
465}
466
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
index e17fad470621..40f53fbe6d35 100644
--- a/arch/ppc/platforms/Makefile
+++ b/arch/ppc/platforms/Makefile
@@ -2,10 +2,6 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-$(CONFIG_APUS) += apus_setup.o
6ifeq ($(CONFIG_APUS),y)
7obj-$(CONFIG_PCI) += apus_pci.o
8endif
9obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o 5obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o
10obj-$(CONFIG_PREP_RESIDUAL) += residual.o 6obj-$(CONFIG_PREP_RESIDUAL) += residual.o
11obj-$(CONFIG_PQ2ADS) += pq2ads.o 7obj-$(CONFIG_PQ2ADS) += pq2ads.o
diff --git a/arch/ppc/platforms/apus_pci.c b/arch/ppc/platforms/apus_pci.c
deleted file mode 100644
index dc165f0c8908..000000000000
--- a/arch/ppc/platforms/apus_pci.c
+++ /dev/null
@@ -1,207 +0,0 @@
1/*
2 * Copyright (C) Michel Dänzer <michdaen@iiic.ethz.ch>
3 *
4 * APUS PCI routines.
5 *
6 * Currently, only B/CVisionPPC cards (Permedia2) are supported.
7 *
8 * Thanks to Geert Uytterhoeven for the idea:
9 * Read values from given config space(s) for the first devices, -1 otherwise
10 *
11 */
12
13#ifdef CONFIG_AMIGA
14
15#include <linux/kernel.h>
16#include <linux/pci.h>
17#include <linux/delay.h>
18#include <linux/string.h>
19#include <linux/init.h>
20
21#include <asm/io.h>
22#include <asm/pci-bridge.h>
23#include <asm/machdep.h>
24
25#include "apus_pci.h"
26
27
28/* These definitions are mostly adapted from pm2fb.c */
29
30#undef APUS_PCI_MASTER_DEBUG
31#ifdef APUS_PCI_MASTER_DEBUG
32#define DPRINTK(a,b...) printk(KERN_DEBUG "apus_pci: %s: " a, __FUNCTION__ , ## b)
33#else
34#define DPRINTK(a,b...)
35#endif
36
37/*
38 * The _DEFINITIVE_ memory mapping/unmapping functions.
39 * This is due to the fact that they're changing soooo often...
40 */
41#define DEFW() wmb()
42#define DEFR() rmb()
43#define DEFRW() mb()
44
45#define DEVNO(d) ((d)>>3)
46#define FNNO(d) ((d)&7)
47
48
49extern unsigned long powerup_PCI_present;
50
51static struct pci_controller *apus_hose;
52
53
54void *pci_io_base(unsigned int bus)
55{
56 return 0;
57}
58
59
60int
61apus_pcibios_read_config(struct pci_bus *bus, int devfn, int offset,
62 int len, u32 *val)
63{
64 int fnno = FNNO(devfn);
65 int devno = DEVNO(devfn);
66 volatile unsigned char *cfg_data;
67
68 if (bus->number > 0 || devno != 1) {
69 *val = ~0;
70 return PCIBIOS_DEVICE_NOT_FOUND;
71 }
72 /* base address + function offset + offset ^ endianness conversion */
73 /* XXX the fnno<<5 bit seems wacky -- paulus */
74 cfg_data = apus_hose->cfg_data + (fnno<<5) + (offset ^ (len - 1));
75 switch (len) {
76 case 1:
77 *val = readb(cfg_data);
78 break;
79 case 2:
80 *val = readw(cfg_data);
81 break;
82 default:
83 *val = readl(cfg_data);
84 break;
85 }
86
87 DPRINTK("read b: 0x%x, d: 0x%x, f: 0x%x, o: 0x%x, l: %d, v: 0x%x\n",
88 bus->number, devfn>>3, devfn&7, offset, len, *val);
89 return PCIBIOS_SUCCESSFUL;
90}
91
92int
93apus_pcibios_write_config(struct pci_bus *bus, int devfn, int offset,
94 int len, u32 *val)
95{
96 int fnno = FNNO(devfn);
97 int devno = DEVNO(devfn);
98 volatile unsigned char *cfg_data;
99
100 if (bus->number > 0 || devno != 1) {
101 return PCIBIOS_DEVICE_NOT_FOUND;
102 }
103 /* base address + function offset + offset ^ endianness conversion */
104 /* XXX the fnno<<5 bit seems wacky -- paulus */
105 cfg_data = apus_hose->cfg_data + (fnno<<5) + (offset ^ (len - 1));
106 switch (len) {
107 case 1:
108 writeb(val, cfg_data); DEFW();
109 break;
110 case 2:
111 writew(val, cfg_data); DEFW();
112 break;
113 default:
114 writel(val, cfg_data); DEFW();
115 break;
116 }
117
118 DPRINTK("write b: 0x%x, d: 0x%x, f: 0x%x, o: 0x%x, l: %d, v: 0x%x\n",
119 bus->number, devfn>>3, devfn&7, offset, len, val);
120 return PCIBIOS_SUCCESSFUL;
121}
122
123static struct pci_ops apus_pci_ops = {
124 apus_pcibios_read_config,
125 apus_pcibios_write_config
126};
127
128static struct resource pci_mem = { "B/CVisionPPC PCI mem", CVPPC_FB_APERTURE_ONE, CVPPC_PCI_CONFIG, IORESOURCE_MEM };
129
130void __init
131apus_pcibios_fixup(void)
132{
133/* struct pci_dev *dev = pci_find_slot(0, 1<<3);
134 unsigned int reg, val, offset;*/
135
136 /* FIXME: interrupt? */
137 /*dev->interrupt = xxx;*/
138
139 request_resource(&iomem_resource, &pci_mem);
140 printk("%s: PCI mem resource requested\n", __FUNCTION__);
141}
142
143static void __init apus_pcibios_fixup_bus(struct pci_bus *bus)
144{
145 bus->resource[1] = &pci_mem;
146}
147
148
149/*
150 * This is from pm2fb.c again
151 *
152 * Check if PCI (B/CVisionPPC) is available, initialize it and set up
153 * the pcibios_* pointers
154 */
155
156
157void __init
158apus_setup_pci_ptrs(void)
159{
160 if (!powerup_PCI_present) {
161 DPRINTK("no PCI bridge detected\n");
162 return;
163 }
164 DPRINTK("Phase5 B/CVisionPPC PCI bridge detected.\n");
165
166 apus_hose = pcibios_alloc_controller();
167 if (!apus_hose) {
168 printk("apus_pci: Can't allocate PCI controller structure\n");
169 return;
170 }
171
172 if (!(apus_hose->cfg_data = ioremap(CVPPC_PCI_CONFIG, 256))) {
173 printk("apus_pci: unable to map PCI config region\n");
174 return;
175 }
176
177 if (!(apus_hose->cfg_addr = ioremap(CSPPC_PCI_BRIDGE, 256))) {
178 printk("apus_pci: unable to map PCI bridge\n");
179 return;
180 }
181
182 writel(CSPPCF_BRIDGE_BIG_ENDIAN, apus_hose->cfg_addr + CSPPC_BRIDGE_ENDIAN);
183 DEFW();
184
185 writel(CVPPC_REGS_REGION, apus_hose->cfg_data+ PCI_BASE_ADDRESS_0);
186 DEFW();
187 writel(CVPPC_FB_APERTURE_ONE, apus_hose->cfg_data + PCI_BASE_ADDRESS_1);
188 DEFW();
189 writel(CVPPC_FB_APERTURE_TWO, apus_hose->cfg_data + PCI_BASE_ADDRESS_2);
190 DEFW();
191 writel(CVPPC_ROM_ADDRESS, apus_hose->cfg_data + PCI_ROM_ADDRESS);
192 DEFW();
193
194 writel(0xef000000 | PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
195 PCI_COMMAND_MASTER, apus_hose->cfg_data + PCI_COMMAND);
196 DEFW();
197
198 apus_hose->first_busno = 0;
199 apus_hose->last_busno = 0;
200 apus_hose->ops = &apus_pci_ops;
201 ppc_md.pcibios_fixup = apus_pcibios_fixup;
202 ppc_md.pcibios_fixup_bus = apus_pcibios_fixup_bus;
203
204 return;
205}
206
207#endif /* CONFIG_AMIGA */
diff --git a/arch/ppc/platforms/apus_pci.h b/arch/ppc/platforms/apus_pci.h
deleted file mode 100644
index f15974ae0189..000000000000
--- a/arch/ppc/platforms/apus_pci.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Phase5 CybervisionPPC (TVP4020) definitions for the Permedia2 framebuffer
3 * driver.
4 *
5 * Copyright (c) 1998-1999 Ilario Nardinocchi (nardinoc@CS.UniBO.IT)
6 * --------------------------------------------------------------------------
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file README.legal in the main directory of this archive
9 * for more details.
10 */
11
12#ifndef APUS_PCI_H
13#define APUS_PCI_H
14
15
16#define CSPPC_PCI_BRIDGE 0xfffe0000
17#define CSPPC_BRIDGE_ENDIAN 0x0000
18#define CSPPC_BRIDGE_INT 0x0010
19
20#define CVPPC_PCI_CONFIG 0xfffc0000
21#define CVPPC_ROM_ADDRESS 0xe2000001
22#define CVPPC_REGS_REGION 0xef000000
23#define CVPPC_FB_APERTURE_ONE 0xe0000000
24#define CVPPC_FB_APERTURE_TWO 0xe1000000
25#define CVPPC_FB_SIZE 0x00800000
26
27/* CVPPC_BRIDGE_ENDIAN */
28#define CSPPCF_BRIDGE_BIG_ENDIAN 0x02
29
30/* CVPPC_BRIDGE_INT */
31#define CSPPCF_BRIDGE_ACTIVE_INT2 0x01
32
33
34#endif /* APUS_PCI_H */
diff --git a/arch/ppc/platforms/apus_setup.c b/arch/ppc/platforms/apus_setup.c
deleted file mode 100644
index 063274d2c503..000000000000
--- a/arch/ppc/platforms/apus_setup.c
+++ /dev/null
@@ -1,798 +0,0 @@
1/*
2 * Copyright (C) 1998, 1999 Jesper Skov
3 *
4 * Basically what is needed to replace functionality found in
5 * arch/m68k allowing Amiga drivers to work under APUS.
6 * Bits of code and/or ideas from arch/m68k and arch/ppc files.
7 *
8 * TODO:
9 * This file needs a *really* good cleanup. Restructure and optimize.
10 * Make sure it can be compiled for non-APUS configs. Begin to move
11 * Amiga specific stuff into mach/amiga.
12 */
13
14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/init.h>
17#include <linux/initrd.h>
18#include <linux/seq_file.h>
19
20/* Needs INITSERIAL call in head.S! */
21#undef APUS_DEBUG
22
23#include <asm/bootinfo.h>
24#include <asm/setup.h>
25#include <asm/amigahw.h>
26#include <asm/amigaints.h>
27#include <asm/amigappc.h>
28#include <asm/pgtable.h>
29#include <asm/dma.h>
30#include <asm/machdep.h>
31#include <asm/time.h>
32
33unsigned long m68k_machtype;
34char debug_device[6] = "";
35
36extern void amiga_init_IRQ(void);
37
38extern void apus_setup_pci_ptrs(void);
39
40void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)) __initdata = NULL;
41/* machine dependent irq functions */
42void (*mach_init_IRQ) (void) __initdata = NULL;
43void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
44void (*mach_get_model) (char *model) = NULL;
45int (*mach_get_hardware_list) (char *buffer) = NULL;
46int (*mach_get_irq_list) (struct seq_file *, void *) = NULL;
47void (*mach_process_int) (int, struct pt_regs *) = NULL;
48/* machine dependent timer functions */
49unsigned long (*mach_gettimeoffset) (void);
50void (*mach_gettod) (int*, int*, int*, int*, int*, int*);
51int (*mach_hwclk) (int, struct hwclk_time*) = NULL;
52int (*mach_set_clock_mmss) (unsigned long) = NULL;
53void (*mach_reset)( void );
54long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
55#ifdef CONFIG_HEARTBEAT
56void (*mach_heartbeat) (int) = NULL;
57extern void apus_heartbeat (void);
58#endif
59
60extern unsigned long amiga_model;
61extern unsigned decrementer_count;/* count value for 1e6/HZ microseconds */
62extern unsigned count_period_num; /* 1 decrementer count equals */
63extern unsigned count_period_den; /* count_period_num / count_period_den us */
64
65int num_memory = 0;
66struct mem_info memory[NUM_MEMINFO];/* memory description */
67/* FIXME: Duplicate memory data to avoid conflicts with m68k shared code. */
68int m68k_realnum_memory = 0;
69struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */
70
71struct mem_info ramdisk;
72
73extern void config_amiga(void);
74
75static int __60nsram = 0;
76
77/* for cpuinfo */
78static int __bus_speed = 0;
79static int __speed_test_failed = 0;
80
81/********************************************** COMPILE PROTECTION */
82/* Provide some stubs that links to Amiga specific functions.
83 * This allows CONFIG_APUS to be removed from generic PPC files while
84 * preventing link errors for other PPC targets.
85 */
86unsigned long apus_get_rtc_time(void)
87{
88#ifdef CONFIG_APUS
89 extern unsigned long m68k_get_rtc_time(void);
90
91 return m68k_get_rtc_time ();
92#else
93 return 0;
94#endif
95}
96
97int apus_set_rtc_time(unsigned long nowtime)
98{
99#ifdef CONFIG_APUS
100 extern int m68k_set_rtc_time(unsigned long nowtime);
101
102 return m68k_set_rtc_time (nowtime);
103#else
104 return 0;
105#endif
106}
107
108/*********************************************************** SETUP */
109/* From arch/m68k/kernel/setup.c. */
110void __init apus_setup_arch(void)
111{
112#ifdef CONFIG_APUS
113 extern char cmd_line[];
114 int i;
115 char *p, *q;
116
117 /* Let m68k-shared code know it should do the Amiga thing. */
118 m68k_machtype = MACH_AMIGA;
119
120 /* Parse the command line for arch-specific options.
121 * For the m68k, this is currently only "debug=xxx" to enable printing
122 * certain kernel messages to some machine-specific device. */
123 for( p = cmd_line; p && *p; ) {
124 i = 0;
125 if (!strncmp( p, "debug=", 6 )) {
126 strlcpy( debug_device, p+6, sizeof(debug_device) );
127 if ((q = strchr( debug_device, ' ' ))) *q = 0;
128 i = 1;
129 } else if (!strncmp( p, "60nsram", 7 )) {
130 APUS_WRITE (APUS_REG_WAITSTATE,
131 REGWAITSTATE_SETRESET
132 |REGWAITSTATE_PPCR
133 |REGWAITSTATE_PPCW);
134 __60nsram = 1;
135 i = 1;
136 }
137
138 if (i) {
139 /* option processed, delete it */
140 if ((q = strchr( p, ' ' )))
141 strcpy( p, q+1 );
142 else
143 *p = 0;
144 } else {
145 if ((p = strchr( p, ' ' ))) ++p;
146 }
147 }
148
149 config_amiga();
150
151#if 0 /* Enable for logging - also include logging.o in Makefile rule */
152 {
153#define LOG_SIZE 4096
154 void* base;
155
156 /* Throw away some memory - the P5 firmare stomps on top
157 * of CHIP memory during bootup.
158 */
159 amiga_chip_alloc(0x1000);
160
161 base = amiga_chip_alloc(LOG_SIZE+sizeof(klog_data_t));
162 LOG_INIT(base, base+sizeof(klog_data_t), LOG_SIZE);
163 }
164#endif
165#endif
166}
167
168int
169apus_show_cpuinfo(struct seq_file *m)
170{
171 extern int __map_without_bats;
172 extern unsigned long powerup_PCI_present;
173
174 seq_printf(m, "machine\t\t: Amiga\n");
175 seq_printf(m, "bus speed\t: %d%s", __bus_speed,
176 (__speed_test_failed) ? " [failed]\n" : "\n");
177 seq_printf(m, "using BATs\t: %s\n",
178 (__map_without_bats) ? "No" : "Yes");
179 seq_printf(m, "ram speed\t: %dns\n", (__60nsram) ? 60 : 70);
180 seq_printf(m, "PCI bridge\t: %s\n",
181 (powerup_PCI_present) ? "Yes" : "No");
182 return 0;
183}
184
185static void get_current_tb(unsigned long long *time)
186{
187 __asm __volatile ("1:mftbu 4 \n\t"
188 " mftb 5 \n\t"
189 " mftbu 6 \n\t"
190 " cmpw 4,6 \n\t"
191 " bne 1b \n\t"
192 " stw 4,0(%0)\n\t"
193 " stw 5,4(%0)\n\t"
194 :
195 : "r" (time)
196 : "r4", "r5", "r6");
197}
198
199
200void apus_calibrate_decr(void)
201{
202#ifdef CONFIG_APUS
203 unsigned long freq;
204
205 /* This algorithm for determining the bus speed was
206 contributed by Ralph Schmidt. */
207 unsigned long long start, stop;
208 int bus_speed;
209 int speed_test_failed = 0;
210
211 {
212 unsigned long loop = amiga_eclock / 10;
213
214 get_current_tb (&start);
215 while (loop--) {
216 unsigned char tmp;
217
218 tmp = ciaa.pra;
219 }
220 get_current_tb (&stop);
221 }
222
223 bus_speed = (((unsigned long)(stop-start))*10*4) / 1000000;
224 if (AMI_1200 == amiga_model)
225 bus_speed /= 2;
226
227 if ((bus_speed >= 47) && (bus_speed < 53)) {
228 bus_speed = 50;
229 freq = 12500000;
230 } else if ((bus_speed >= 57) && (bus_speed < 63)) {
231 bus_speed = 60;
232 freq = 15000000;
233 } else if ((bus_speed >= 63) && (bus_speed < 69)) {
234 bus_speed = 67;
235 freq = 16666667;
236 } else {
237 printk ("APUS: Unable to determine bus speed (%d). "
238 "Defaulting to 50MHz", bus_speed);
239 bus_speed = 50;
240 freq = 12500000;
241 speed_test_failed = 1;
242 }
243
244 /* Ease diagnostics... */
245 {
246 extern int __map_without_bats;
247 extern unsigned long powerup_PCI_present;
248
249 printk ("APUS: BATs=%d, BUS=%dMHz",
250 (__map_without_bats) ? 0 : 1,
251 bus_speed);
252 if (speed_test_failed)
253 printk ("[FAILED - please report]");
254
255 printk (", RAM=%dns, PCI bridge=%d\n",
256 (__60nsram) ? 60 : 70,
257 (powerup_PCI_present) ? 1 : 0);
258
259 /* print a bit more if asked politely... */
260 if (!(ciaa.pra & 0x40)){
261 extern unsigned int bat_addrs[4][3];
262 int b;
263 for (b = 0; b < 4; ++b) {
264 printk ("APUS: BAT%d ", b);
265 printk ("%08x-%08x -> %08x\n",
266 bat_addrs[b][0],
267 bat_addrs[b][1],
268 bat_addrs[b][2]);
269 }
270 }
271
272 }
273
274 printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
275 freq/1000000, freq%1000000);
276 tb_ticks_per_jiffy = freq / HZ;
277 tb_to_us = mulhwu_scale_factor(freq, 1000000);
278
279 __bus_speed = bus_speed;
280 __speed_test_failed = speed_test_failed;
281#endif
282}
283
284void arch_gettod(int *year, int *mon, int *day, int *hour,
285 int *min, int *sec)
286{
287#ifdef CONFIG_APUS
288 if (mach_gettod)
289 mach_gettod(year, mon, day, hour, min, sec);
290 else
291 *year = *mon = *day = *hour = *min = *sec = 0;
292#endif
293}
294
295/* for "kbd-reset" cmdline param */
296__init
297void kbd_reset_setup(char *str, int *ints)
298{
299}
300
301/*********************************************************** MEMORY */
302#define KMAP_MAX 32
303unsigned long kmap_chunks[KMAP_MAX*3];
304int kmap_chunk_count = 0;
305
306/* From pgtable.h */
307static __inline__ pte_t *my_find_pte(struct mm_struct *mm,unsigned long va)
308{
309 pgd_t *dir = 0;
310 pmd_t *pmd = 0;
311 pte_t *pte = 0;
312
313 va &= PAGE_MASK;
314
315 dir = pgd_offset( mm, va );
316 if (dir)
317 {
318 pmd = pmd_offset(dir, va & PAGE_MASK);
319 if (pmd && pmd_present(*pmd))
320 {
321 pte = pte_offset(pmd, va);
322 }
323 }
324 return pte;
325}
326
327
328/* Again simulating an m68k/mm/kmap.c function. */
329void kernel_set_cachemode( unsigned long address, unsigned long size,
330 unsigned int cmode )
331{
332 unsigned long mask, flags;
333
334 switch (cmode)
335 {
336 case IOMAP_FULL_CACHING:
337 mask = ~(_PAGE_NO_CACHE | _PAGE_GUARDED);
338 flags = 0;
339 break;
340 case IOMAP_NOCACHE_SER:
341 mask = ~0;
342 flags = (_PAGE_NO_CACHE | _PAGE_GUARDED);
343 break;
344 default:
345 panic ("kernel_set_cachemode() doesn't support mode %d\n",
346 cmode);
347 break;
348 }
349
350 size /= PAGE_SIZE;
351 address &= PAGE_MASK;
352 while (size--)
353 {
354 pte_t *pte;
355
356 pte = my_find_pte(&init_mm, address);
357 if ( !pte )
358 {
359 printk("pte NULL in kernel_set_cachemode()\n");
360 return;
361 }
362
363 pte_val (*pte) &= mask;
364 pte_val (*pte) |= flags;
365 flush_tlb_page(find_vma(&init_mm,address),address);
366
367 address += PAGE_SIZE;
368 }
369}
370
371unsigned long mm_ptov (unsigned long paddr)
372{
373 unsigned long ret;
374 if (paddr < 16*1024*1024)
375 ret = ZTWO_VADDR(paddr);
376 else {
377 int i;
378
379 for (i = 0; i < kmap_chunk_count;){
380 unsigned long phys = kmap_chunks[i++];
381 unsigned long size = kmap_chunks[i++];
382 unsigned long virt = kmap_chunks[i++];
383 if (paddr >= phys
384 && paddr < (phys + size)){
385 ret = virt + paddr - phys;
386 goto exit;
387 }
388 }
389
390 ret = (unsigned long) __va(paddr);
391 }
392exit:
393#ifdef DEBUGPV
394 printk ("PTOV(%lx)=%lx\n", paddr, ret);
395#endif
396 return ret;
397}
398
399int mm_end_of_chunk (unsigned long addr, int len)
400{
401 if (memory[0].addr + memory[0].size == addr + len)
402 return 1;
403 return 0;
404}
405
406/*********************************************************** CACHE */
407
408#define L1_CACHE_BYTES 32
409#define MAX_CACHE_SIZE 8192
410void cache_push(__u32 addr, int length)
411{
412 addr = mm_ptov(addr);
413
414 if (MAX_CACHE_SIZE < length)
415 length = MAX_CACHE_SIZE;
416
417 while(length > 0){
418 __asm ("dcbf 0,%0\n\t"
419 : : "r" (addr));
420 addr += L1_CACHE_BYTES;
421 length -= L1_CACHE_BYTES;
422 }
423 /* Also flush trailing block */
424 __asm ("dcbf 0,%0\n\t"
425 "sync \n\t"
426 : : "r" (addr));
427}
428
429void cache_clear(__u32 addr, int length)
430{
431 if (MAX_CACHE_SIZE < length)
432 length = MAX_CACHE_SIZE;
433
434 addr = mm_ptov(addr);
435
436 __asm ("dcbf 0,%0\n\t"
437 "sync \n\t"
438 "icbi 0,%0 \n\t"
439 "isync \n\t"
440 : : "r" (addr));
441
442 addr += L1_CACHE_BYTES;
443 length -= L1_CACHE_BYTES;
444
445 while(length > 0){
446 __asm ("dcbf 0,%0\n\t"
447 "sync \n\t"
448 "icbi 0,%0 \n\t"
449 "isync \n\t"
450 : : "r" (addr));
451 addr += L1_CACHE_BYTES;
452 length -= L1_CACHE_BYTES;
453 }
454
455 __asm ("dcbf 0,%0\n\t"
456 "sync \n\t"
457 "icbi 0,%0 \n\t"
458 "isync \n\t"
459 : : "r" (addr));
460}
461
462/****************************************************** from setup.c */
463void
464apus_restart(char *cmd)
465{
466 local_irq_disable();
467
468 APUS_WRITE(APUS_REG_LOCK,
469 REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK2);
470 APUS_WRITE(APUS_REG_LOCK,
471 REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK3);
472 APUS_WRITE(APUS_REG_LOCK,
473 REGLOCK_BLACKMAGICK2|REGLOCK_BLACKMAGICK3);
474 APUS_WRITE(APUS_REG_SHADOW, REGSHADOW_SELFRESET);
475 APUS_WRITE(APUS_REG_RESET, REGRESET_AMIGARESET);
476 for(;;);
477}
478
479void
480apus_power_off(void)
481{
482 for (;;);
483}
484
485void
486apus_halt(void)
487{
488 apus_restart(NULL);
489}
490
491/****************************************************** IRQ stuff */
492
493static unsigned char last_ipl[8];
494
495int apus_get_irq(void)
496{
497 unsigned char ipl_emu, mask;
498 unsigned int level;
499
500 APUS_READ(APUS_IPL_EMU, ipl_emu);
501 level = (ipl_emu >> 3) & IPLEMU_IPLMASK;
502 mask = IPLEMU_SETRESET|IPLEMU_DISABLEINT|level;
503 level ^= 7;
504
505 /* Save previous IPL value */
506 if (last_ipl[level])
507 return -2;
508 last_ipl[level] = ipl_emu;
509
510 /* Set to current IPL value */
511 APUS_WRITE(APUS_IPL_EMU, mask);
512 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT|level);
513
514
515#ifdef __INTERRUPT_DEBUG
516 printk("<%d:%d>", level, ~ipl_emu & IPLEMU_IPLMASK);
517#endif
518 return level + IRQ_AMIGA_AUTO;
519}
520
521void apus_end_irq(unsigned int irq)
522{
523 unsigned char ipl_emu;
524 unsigned int level = irq - IRQ_AMIGA_AUTO;
525#ifdef __INTERRUPT_DEBUG
526 printk("{%d}", ~last_ipl[level] & IPLEMU_IPLMASK);
527#endif
528 /* Restore IPL to the previous value */
529 ipl_emu = last_ipl[level] & IPLEMU_IPLMASK;
530 APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET|IPLEMU_DISABLEINT|ipl_emu);
531 last_ipl[level] = 0;
532 ipl_emu ^= 7;
533 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT|ipl_emu);
534}
535
536/****************************************************** debugging */
537
538/* some serial hardware definitions */
539#define SDR_OVRUN (1<<15)
540#define SDR_RBF (1<<14)
541#define SDR_TBE (1<<13)
542#define SDR_TSRE (1<<12)
543
544#define AC_SETCLR (1<<15)
545#define AC_UARTBRK (1<<11)
546
547#define SER_DTR (1<<7)
548#define SER_RTS (1<<6)
549#define SER_DCD (1<<5)
550#define SER_CTS (1<<4)
551#define SER_DSR (1<<3)
552
553static __inline__ void ser_RTSon(void)
554{
555 ciab.pra &= ~SER_RTS; /* active low */
556}
557
558int __debug_ser_out( unsigned char c )
559{
560 amiga_custom.serdat = c | 0x100;
561 mb();
562 while (!(amiga_custom.serdatr & 0x2000))
563 barrier();
564 return 1;
565}
566
567unsigned char __debug_ser_in( void )
568{
569 unsigned char c;
570
571 /* XXX: is that ok?? derived from amiga_ser.c... */
572 while( !(amiga_custom.intreqr & IF_RBF) )
573 barrier();
574 c = amiga_custom.serdatr;
575 /* clear the interrupt, so that another character can be read */
576 amiga_custom.intreq = IF_RBF;
577 return c;
578}
579
580int __debug_serinit( void )
581{
582 unsigned long flags;
583
584 local_irq_save(flags);
585
586 /* turn off Rx and Tx interrupts */
587 amiga_custom.intena = IF_RBF | IF_TBE;
588
589 /* clear any pending interrupt */
590 amiga_custom.intreq = IF_RBF | IF_TBE;
591
592 local_irq_restore(flags);
593
594 /*
595 * set the appropriate directions for the modem control flags,
596 * and clear RTS and DTR
597 */
598 ciab.ddra |= (SER_DTR | SER_RTS); /* outputs */
599 ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
600
601#ifdef CONFIG_KGDB
602 /* turn Rx interrupts on for GDB */
603 amiga_custom.intena = IF_SETCLR | IF_RBF;
604 ser_RTSon();
605#endif
606
607 return 0;
608}
609
610void __debug_print_hex(unsigned long x)
611{
612 int i;
613 char hexchars[] = "0123456789ABCDEF";
614
615 for (i = 0; i < 8; i++) {
616 __debug_ser_out(hexchars[(x >> 28) & 15]);
617 x <<= 4;
618 }
619 __debug_ser_out('\n');
620 __debug_ser_out('\r');
621}
622
623void __debug_print_string(char* s)
624{
625 unsigned char c;
626 while((c = *s++))
627 __debug_ser_out(c);
628 __debug_ser_out('\n');
629 __debug_ser_out('\r');
630}
631
632static void apus_progress(char *s, unsigned short value)
633{
634 __debug_print_string(s);
635}
636
637/****************************************************** init */
638
639/* The number of spurious interrupts */
640volatile unsigned int num_spurious;
641
642extern struct irqaction amiga_sys_irqaction[AUTO_IRQS];
643
644
645extern void amiga_enable_irq(unsigned int irq);
646extern void amiga_disable_irq(unsigned int irq);
647
648struct hw_interrupt_type amiga_sys_irqctrl = {
649 .typename = "Amiga IPL",
650 .end = apus_end_irq,
651};
652
653struct hw_interrupt_type amiga_irqctrl = {
654 .typename = "Amiga ",
655 .enable = amiga_enable_irq,
656 .disable = amiga_disable_irq,
657};
658
659#define HARDWARE_MAPPED_SIZE (512*1024)
660unsigned long __init apus_find_end_of_memory(void)
661{
662 int shadow = 0;
663 unsigned long total;
664
665 /* The memory size reported by ADOS excludes the 512KB
666 reserved for PPC exception registers and possibly 512KB
667 containing a shadow of the ADOS ROM. */
668 {
669 unsigned long size = memory[0].size;
670
671 /* If 2MB aligned, size was probably user
672 specified. We can't tell anything about shadowing
673 in this case so skip shadow assignment. */
674 if (0 != (size & 0x1fffff)){
675 /* Align to 512KB to ensure correct handling
676 of both memfile and system specified
677 sizes. */
678 size = ((size+0x0007ffff) & 0xfff80000);
679 /* If memory is 1MB aligned, assume
680 shadowing. */
681 shadow = !(size & 0x80000);
682 }
683
684 /* Add the chunk that ADOS does not see. by aligning
685 the size to the nearest 2MB limit upwards. */
686 memory[0].size = ((size+0x001fffff) & 0xffe00000);
687 }
688
689 ppc_memstart = memory[0].addr;
690 ppc_memoffset = PAGE_OFFSET - PPC_MEMSTART;
691 total = memory[0].size;
692
693 /* Remove the memory chunks that are controlled by special
694 Phase5 hardware. */
695
696 /* Remove the upper 512KB if it contains a shadow of
697 the ADOS ROM. FIXME: It might be possible to
698 disable this shadow HW. Check the booter
699 (ppc_boot.c) */
700 if (shadow)
701 total -= HARDWARE_MAPPED_SIZE;
702
703 /* Remove the upper 512KB where the PPC exception
704 vectors are mapped. */
705 total -= HARDWARE_MAPPED_SIZE;
706
707 /* Linux/APUS only handles one block of memory -- the one on
708 the PowerUP board. Other system memory is horrible slow in
709 comparison. The user can use other memory for swapping
710 using the z2ram device. */
711 return total;
712}
713
714static void __init
715apus_map_io(void)
716{
717 /* Map PPC exception vectors. */
718 io_block_mapping(0xfff00000, 0xfff00000, 0x00020000, _PAGE_KERNEL);
719 /* Map chip and ZorroII memory */
720 io_block_mapping(zTwoBase, 0x00000000, 0x01000000, _PAGE_IO);
721}
722
723__init
724void apus_init_IRQ(void)
725{
726 struct irqaction *action;
727 int i;
728
729#ifdef CONFIG_PCI
730 apus_setup_pci_ptrs();
731#endif
732
733 for ( i = 0 ; i < AMI_IRQS; i++ ) {
734 irq_desc[i].status = IRQ_LEVEL;
735 if (i < IRQ_AMIGA_AUTO) {
736 irq_desc[i].chip = &amiga_irqctrl;
737 } else {
738 irq_desc[i].chip = &amiga_sys_irqctrl;
739 action = &amiga_sys_irqaction[i-IRQ_AMIGA_AUTO];
740 if (action->name)
741 setup_irq(i, action);
742 }
743 }
744
745 amiga_init_IRQ();
746
747}
748
749__init
750void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
751 unsigned long r6, unsigned long r7)
752{
753 extern int parse_bootinfo(const struct bi_record *);
754 extern char _end[];
755
756 /* Parse bootinfo. The bootinfo is located right after
757 the kernel bss */
758 parse_bootinfo((const struct bi_record *)&_end);
759#ifdef CONFIG_BLK_DEV_INITRD
760 /* Take care of initrd if we have one. Use data from
761 bootinfo to avoid the need to initialize PPC
762 registers when kernel is booted via a PPC reset. */
763 if ( ramdisk.addr ) {
764 initrd_start = (unsigned long) __va(ramdisk.addr);
765 initrd_end = (unsigned long)
766 __va(ramdisk.size + ramdisk.addr);
767 }
768#endif /* CONFIG_BLK_DEV_INITRD */
769
770 ISA_DMA_THRESHOLD = 0x00ffffff;
771
772 ppc_md.setup_arch = apus_setup_arch;
773 ppc_md.show_cpuinfo = apus_show_cpuinfo;
774 ppc_md.init_IRQ = apus_init_IRQ;
775 ppc_md.get_irq = apus_get_irq;
776
777#ifdef CONFIG_HEARTBEAT
778 ppc_md.heartbeat = apus_heartbeat;
779 ppc_md.heartbeat_count = 1;
780#endif
781#ifdef APUS_DEBUG
782 __debug_serinit();
783 ppc_md.progress = apus_progress;
784#endif
785 ppc_md.init = NULL;
786
787 ppc_md.restart = apus_restart;
788 ppc_md.power_off = apus_power_off;
789 ppc_md.halt = apus_halt;
790
791 ppc_md.time_init = NULL;
792 ppc_md.set_rtc_time = apus_set_rtc_time;
793 ppc_md.get_rtc_time = apus_get_rtc_time;
794 ppc_md.calibrate_decr = apus_calibrate_decr;
795
796 ppc_md.find_end_of_memory = apus_find_end_of_memory;
797 ppc_md.setup_io_mappings = apus_map_io;
798}
diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c
index 491fe9a57229..3f5be2c5ce99 100644
--- a/arch/ppc/syslib/ocp.c
+++ b/arch/ppc/syslib/ocp.c
@@ -44,11 +44,11 @@
44#include <linux/pm.h> 44#include <linux/pm.h>
45#include <linux/bootmem.h> 45#include <linux/bootmem.h>
46#include <linux/device.h> 46#include <linux/device.h>
47#include <linux/rwsem.h>
47 48
48#include <asm/io.h> 49#include <asm/io.h>
49#include <asm/ocp.h> 50#include <asm/ocp.h>
50#include <asm/errno.h> 51#include <asm/errno.h>
51#include <asm/rwsem.h>
52#include <asm/semaphore.h> 52#include <asm/semaphore.h>
53 53
54//#define DBG(x) printk x 54//#define DBG(x) printk x