aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-12 00:55:47 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-12 00:55:47 -0400
commite86908614f2c7fec401827e5cefd7a6ea9407f85 (patch)
treefcb5d9e52422b37bdaf0e647126ebdfc1680f162 /arch/powerpc
parent547307420931344a868275bd7ea7a30f117a15a9 (diff)
parent9b4b8feb962f4b3e74768b7205f1f8f6cce87238 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (408 commits) [POWERPC] Add memchr() to the bootwrapper [POWERPC] Implement logging of unhandled signals [POWERPC] Add legacy serial support for OPB with flattened device tree [POWERPC] Use 1TB segments [POWERPC] XilinxFB: Allow fixed framebuffer base address [POWERPC] XilinxFB: Add support for custom screen resolution [POWERPC] XilinxFB: Use pdata to pass around framebuffer parameters [POWERPC] PCI: Add 64-bit physical address support to setup_indirect_pci [POWERPC] 4xx: Kilauea defconfig file [POWERPC] 4xx: Kilauea DTS [POWERPC] 4xx: Add AMCC Kilauea eval board support to platforms/40x [POWERPC] 4xx: Add AMCC 405EX support to cputable.c [POWERPC] Adjust TASK_SIZE on ppc32 systems to 3GB that are capable [POWERPC] Use PAGE_OFFSET to tell if an address is user/kernel in SW TLB handlers [POWERPC] 85xx: Enable FP emulation in MPC8560 ADS defconfig [POWERPC] 85xx: Killed <asm/mpc85xx.h> [POWERPC] 85xx: Add cpm nodes for 8541/8555 CDS [POWERPC] 85xx: Convert mpc8560ads to the new CPM binding. [POWERPC] mpc8272ads: Remove muram from the CPM reg property. [POWERPC] Make clockevents work on PPC601 processors ... Fixed up conflict in Documentation/powerpc/booting-without-of.txt manually.
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/Kconfig50
-rw-r--r--arch/powerpc/Kconfig.debug31
-rw-r--r--arch/powerpc/Makefile56
-rw-r--r--arch/powerpc/boot/.gitignore9
-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/Makefile25
-rw-r--r--arch/powerpc/boot/bamboo.c47
-rw-r--r--arch/powerpc/boot/cpm-serial.c269
-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.c47
-rw-r--r--arch/powerpc/boot/cuboot-bamboo.c30
-rw-r--r--arch/powerpc/boot/cuboot-hpc2.c48
-rw-r--r--arch/powerpc/boot/cuboot-pq2.c261
-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/ep88xc.dts214
-rw-r--r--arch/powerpc/boot/dts/holly.dts5
-rw-r--r--arch/powerpc/boot/dts/kilauea.dts252
-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.dts59
-rw-r--r--arch/powerpc/boot/dts/lite5200b.dts119
-rw-r--r--arch/powerpc/boot/dts/mpc7448hpc2.dts9
-rw-r--r--arch/powerpc/boot/dts/mpc8272ads.dts431
-rw-r--r--arch/powerpc/boot/dts/mpc8313erdb.dts67
-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.dts104
-rw-r--r--arch/powerpc/boot/dts/mpc8349emitxgp.dts52
-rw-r--r--arch/powerpc/boot/dts/mpc834x_mds.dts249
-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.dts228
-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.dts228
-rw-r--r--arch/powerpc/boot/dts/mpc8560ads.dts267
-rw-r--r--arch/powerpc/boot/dts/mpc8568mds.dts160
-rw-r--r--arch/powerpc/boot/dts/mpc8572ds.dts404
-rw-r--r--arch/powerpc/boot/dts/mpc8610_hpcd.dts191
-rw-r--r--arch/powerpc/boot/dts/mpc8641_hpcn.dts289
-rw-r--r--arch/powerpc/boot/dts/mpc866ads.dts5
-rw-r--r--arch/powerpc/boot/dts/mpc885ads.dts211
-rw-r--r--arch/powerpc/boot/dts/pq2fads.dts240
-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/ep88xc.c54
-rw-r--r--arch/powerpc/boot/fixed-head.S4
-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/fsl-soc.c57
-rw-r--r--arch/powerpc/boot/fsl-soc.h8
-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/mpc8xx.c82
-rw-r--r--arch/powerpc/boot/mpc8xx.h11
-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.h36
-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/pq2.c102
-rw-r--r--arch/powerpc/boot/pq2.h11
-rw-r--r--arch/powerpc/boot/prpmc2800.c6
-rw-r--r--arch/powerpc/boot/ps3.c4
-rw-r--r--arch/powerpc/boot/serial.c23
-rw-r--r--arch/powerpc/boot/stdlib.c45
-rw-r--r--arch/powerpc/boot/stdlib.h6
-rw-r--r--arch/powerpc/boot/string.S37
-rw-r--r--arch/powerpc/boot/string.h3
-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/boot/uartlite.c79
-rwxr-xr-xarch/powerpc/boot/wrapper20
-rw-r--r--arch/powerpc/configs/bamboo_defconfig775
-rw-r--r--arch/powerpc/configs/ebony_defconfig85
-rw-r--r--arch/powerpc/configs/ep88xc_defconfig751
-rw-r--r--arch/powerpc/configs/kilauea_defconfig768
-rw-r--r--arch/powerpc/configs/mpc8272_ads_defconfig248
-rw-r--r--arch/powerpc/configs/mpc8544_ds_defconfig2
-rw-r--r--arch/powerpc/configs/mpc8560_ads_defconfig23
-rw-r--r--arch/powerpc/configs/mpc8572_ds_defconfig1496
-rw-r--r--arch/powerpc/configs/mpc8610_hpcd_defconfig1023
-rw-r--r--arch/powerpc/configs/mpc885_ads_defconfig297
-rw-r--r--arch/powerpc/configs/pq2fads_defconfig1003
-rw-r--r--arch/powerpc/configs/sequoia_defconfig861
-rw-r--r--arch/powerpc/configs/walnut_defconfig773
-rw-r--r--arch/powerpc/kernel/Makefile43
-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/cpu_setup_44x.S56
-rw-r--r--arch/powerpc/kernel/cputable.c119
-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.S24
-rw-r--r--arch/powerpc/kernel/head_32.S71
-rw-r--r--arch/powerpc/kernel/head_40x.S (renamed from arch/powerpc/kernel/head_4xx.S)28
-rw-r--r--arch/powerpc/kernel/head_44x.S30
-rw-r--r--arch/powerpc/kernel/head_64.S604
-rw-r--r--arch/powerpc/kernel/head_8xx.S27
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S99
-rw-r--r--arch/powerpc/kernel/ibmebus.c7
-rw-r--r--arch/powerpc/kernel/idle.c3
-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/legacy_serial.c5
-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/of_platform.c17
-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.c32
-rw-r--r--arch/powerpc/kernel/prom.c24
-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.c10
-rw-r--r--arch/powerpc/kernel/setup_64.c9
-rw-r--r--arch/powerpc/kernel/signal.c6
-rw-r--r--arch/powerpc/kernel/signal_32.c38
-rw-r--r--arch/powerpc/kernel/signal_64.c15
-rw-r--r--arch/powerpc/kernel/smp.c29
-rw-r--r--arch/powerpc/kernel/softemu8xx.c202
-rw-r--r--arch/powerpc/kernel/sysfs.c64
-rw-r--r--arch/powerpc/kernel/systbl.S2
-rw-r--r--arch/powerpc/kernel/time.c503
-rw-r--r--arch/powerpc/kernel/traps.c97
-rw-r--r--arch/powerpc/kernel/udbg.c2
-rw-r--r--arch/powerpc/kernel/udbg_16550.c11
-rw-r--r--arch/powerpc/kernel/vdso.c2
-rw-r--r--arch/powerpc/kernel/vdso32/.gitignore1
-rw-r--r--arch/powerpc/kernel/vdso32/Makefile20
-rw-r--r--arch/powerpc/kernel/vdso64/.gitignore1
-rw-r--r--arch/powerpc/kernel/vdso64/Makefile19
-rw-r--r--arch/powerpc/kernel/vio.c104
-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/fsl_booke_mmu.c2
-rw-r--r--arch/powerpc/mm/hash_low_64.S73
-rw-r--r--arch/powerpc/mm/hash_native_64.c92
-rw-r--r--arch/powerpc/mm/hash_utils_64.c121
-rw-r--r--arch/powerpc/mm/hugetlbpage.c16
-rw-r--r--arch/powerpc/mm/init_32.c41
-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.c6
-rw-r--r--arch/powerpc/mm/slb.c73
-rw-r--r--arch/powerpc/mm/slb_low.S37
-rw-r--r--arch/powerpc/mm/slice.c1
-rw-r--r--arch/powerpc/mm/stab.c6
-rw-r--r--arch/powerpc/mm/tlb_64.c20
-rw-r--r--arch/powerpc/oprofile/cell/pr_util.h3
-rw-r--r--arch/powerpc/oprofile/op_model_cell.c2
-rw-r--r--arch/powerpc/platforms/40x/Kconfig (renamed from arch/powerpc/platforms/4xx/Kconfig)134
-rw-r--r--arch/powerpc/platforms/40x/Makefile3
-rw-r--r--arch/powerpc/platforms/40x/kilauea.c58
-rw-r--r--arch/powerpc/platforms/40x/virtex.c45
-rw-r--r--arch/powerpc/platforms/40x/walnut.c63
-rw-r--r--arch/powerpc/platforms/44x/Kconfig32
-rw-r--r--arch/powerpc/platforms/44x/Makefile2
-rw-r--r--arch/powerpc/platforms/44x/bamboo.c61
-rw-r--r--arch/powerpc/platforms/44x/ebony.c5
-rw-r--r--arch/powerpc/platforms/44x/sequoia.c61
-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.c32
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c121
-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_common.c38
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pic.c22
-rw-r--r--arch/powerpc/platforms/82xx/Kconfig24
-rw-r--r--arch/powerpc/platforms/82xx/Makefile6
-rw-r--r--arch/powerpc/platforms/82xx/m82xx_pci.h2
-rw-r--r--arch/powerpc/platforms/82xx/mpc8272_ads.c196
-rw-r--r--arch/powerpc/platforms/82xx/mpc82xx.c110
-rw-r--r--arch/powerpc/platforms/82xx/mpc82xx_ads.c641
-rw-r--r--arch/powerpc/platforms/82xx/pq2.c82
-rw-r--r--arch/powerpc/platforms/82xx/pq2.h20
-rw-r--r--arch/powerpc/platforms/82xx/pq2ads-pci-pic.c195
-rw-r--r--arch/powerpc/platforms/82xx/pq2ads.h9
-rw-r--r--arch/powerpc/platforms/82xx/pq2fads.c198
-rw-r--r--arch/powerpc/platforms/83xx/mpc8313_rdb.c4
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c6
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c52
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_itx.c5
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_mds.c5
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_mds.c6
-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/Kconfig11
-rw-r--r--arch/powerpc/platforms/85xx/Makefile3
-rw-r--r--arch/powerpc/platforms/85xx/misc.c55
-rw-r--r--arch/powerpc/platforms/85xx/mpc8540_ads.h35
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx.h17
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c187
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.h60
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c47
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.h43
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c (renamed from arch/powerpc/platforms/85xx/mpc8544_ds.c)87
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c55
-rw-r--r--arch/powerpc/platforms/86xx/Kconfig13
-rw-r--r--arch/powerpc/platforms/86xx/Makefile1
-rw-r--r--arch/powerpc/platforms/86xx/mpc8610_hpcd.c216
-rw-r--r--arch/powerpc/platforms/86xx/mpc8641_hpcn.h21
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c37
-rw-r--r--arch/powerpc/platforms/8xx/Kconfig28
-rw-r--r--arch/powerpc/platforms/8xx/Makefile1
-rw-r--r--arch/powerpc/platforms/8xx/ep88xc.c176
-rw-r--r--arch/powerpc/platforms/8xx/m8xx_setup.c154
-rw-r--r--arch/powerpc/platforms/8xx/mpc86xads.h4
-rw-r--r--arch/powerpc/platforms/8xx/mpc86xads_setup.c25
-rw-r--r--arch/powerpc/platforms/8xx/mpc885ads.h42
-rw-r--r--arch/powerpc/platforms/8xx/mpc885ads_setup.c472
-rw-r--r--arch/powerpc/platforms/Kconfig32
-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/cbe_cpufreq.c2
-rw-r--r--arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c2
-rw-r--r--arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c2
-rw-r--r--arch/powerpc/platforms/cell/cbe_regs.c3
-rw-r--r--arch/powerpc/platforms/cell/cbe_regs.h271
-rw-r--r--arch/powerpc/platforms/cell/cbe_thermal.c2
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c4
-rw-r--r--arch/powerpc/platforms/cell/iommu.c2
-rw-r--r--arch/powerpc/platforms/cell/pervasive.c2
-rw-r--r--arch/powerpc/platforms/cell/pmu.c2
-rw-r--r--arch/powerpc/platforms/cell/ras.c2
-rw-r--r--arch/powerpc/platforms/cell/setup.c17
-rw-r--r--arch/powerpc/platforms/cell/spider-pic.c22
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c8
-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.c31
-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.c152
-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.c27
-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.c13
-rw-r--r--arch/powerpc/platforms/chrp/smp.c2
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig12
-rw-r--r--arch/powerpc/platforms/embedded6xx/holly.c14
-rw-r--r--arch/powerpc/platforms/embedded6xx/linkstation.c8
-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.c5
-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/Makefile3
-rw-r--r--arch/powerpc/platforms/iseries/dt.c17
-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/htab.c13
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c52
-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/mf.c23
-rw-r--r--arch/powerpc/platforms/iseries/setup.c7
-rw-r--r--arch/powerpc/platforms/iseries/vio.c553
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c8
-rw-r--r--arch/powerpc/platforms/maple/pci.c21
-rw-r--r--arch/powerpc/platforms/pasemi/Kconfig1
-rw-r--r--arch/powerpc/platforms/pasemi/gpio_mdio.c4
-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/setup.c77
-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/htab.c14
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c9
-rw-r--r--arch/powerpc/platforms/ps3/os-area.c646
-rw-r--r--arch/powerpc/platforms/ps3/platform.h10
-rw-r--r--arch/powerpc/platforms/ps3/setup.c3
-rw-r--r--arch/powerpc/platforms/ps3/time.c14
-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/hotplug-cpu.c14
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c90
-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/setup.c5
-rw-r--r--arch/powerpc/platforms/pseries/xics.c2
-rw-r--r--arch/powerpc/sysdev/Makefile12
-rw-r--r--arch/powerpc/sysdev/axonram.c8
-rw-r--r--arch/powerpc/sysdev/commproc.c299
-rw-r--r--arch/powerpc/sysdev/commproc.h12
-rw-r--r--arch/powerpc/sysdev/cpm2_common.c178
-rw-r--r--arch/powerpc/sysdev/cpm2_pic.c13
-rw-r--r--arch/powerpc/sysdev/cpm_common.c205
-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.c7
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c187
-rw-r--r--arch/powerpc/sysdev/fsl_soc.h8
-rw-r--r--arch/powerpc/sysdev/i8259.c8
-rw-r--r--arch/powerpc/sysdev/indirect_pci.c10
-rw-r--r--arch/powerpc/sysdev/ipic.c7
-rw-r--r--arch/powerpc/sysdev/ipic.h3
-rw-r--r--arch/powerpc/sysdev/mpc8xx_pic.c30
-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/pmi.c6
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe.c36
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c38
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.h3
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_io.c38
-rw-r--r--arch/powerpc/sysdev/qe_lib/ucc.c270
-rw-r--r--arch/powerpc/sysdev/qe_lib/ucc_fast.c127
-rw-r--r--arch/powerpc/sysdev/qe_lib/ucc_slow.c48
-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/powerpc/sysdev/xilinx_intc.c151
384 files changed, 24185 insertions, 7936 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 00099efe0e9f..037664d496d7 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,18 @@ 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
38config GENERIC_CLOCKEVENTS
39 def_bool y
40
24config GENERIC_HARDIRQS 41config GENERIC_HARDIRQS
25 bool 42 bool
26 default y 43 default y
@@ -156,6 +173,7 @@ config HIGHMEM
156 bool "High memory support" 173 bool "High memory support"
157 depends on PPC32 174 depends on PPC32
158 175
176source kernel/time/Kconfig
159source kernel/Kconfig.hz 177source kernel/Kconfig.hz
160source kernel/Kconfig.preempt 178source kernel/Kconfig.preempt
161source "fs/Kconfig.binfmt" 179source "fs/Kconfig.binfmt"
@@ -180,17 +198,29 @@ config MATH_EMULATION
180 unit, which will allow programs that use floating-point 198 unit, which will allow programs that use floating-point
181 instructions to run. 199 instructions to run.
182 200
201config 8XX_MINIMAL_FPEMU
202 bool "Minimal math emulation for 8xx"
203 depends on 8xx && !MATH_EMULATION
204 help
205 Older arch/ppc kernels still emulated a few floating point
206 instructions such as load and store, even when full math
207 emulation is disabled. Say "Y" here if you want to preserve
208 this behavior.
209
210 It is recommended that you build a soft-float userspace instead.
211
183config IOMMU_VMERGE 212config IOMMU_VMERGE
184 bool "Enable IOMMU virtual merging (EXPERIMENTAL)" 213 bool "Enable IOMMU virtual merging"
185 depends on EXPERIMENTAL && PPC64 214 depends on PPC64
186 default n 215 default y
187 help 216 help
188 Cause IO segments sent to a device for DMA to be merged virtually 217 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. 218 by the IOMMU when they happen to have been allocated contiguously.
190 This doesn't add pressure to the IOMMU allocator. However, some 219 This doesn't add pressure to the IOMMU allocator. However, some
191 drivers don't support getting large merged segments coming back 220 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 221 from *_map_sg().
193 properly handling this case. 222
223 Most drivers don't have this problem; it is safe to say Y here.
194 224
195config HOTPLUG_CPU 225config HOTPLUG_CPU
196 bool "Support for enabling/disabling CPUs" 226 bool "Support for enabling/disabling CPUs"
@@ -465,7 +495,7 @@ config PCI_8260
465 495
466config 8260_PCI9 496config 8260_PCI9
467 bool "Enable workaround for MPC826x erratum PCI 9" 497 bool "Enable workaround for MPC826x erratum PCI 9"
468 depends on PCI_8260 && !ADS8272 498 depends on PCI_8260 && !8272
469 default y 499 default y
470 500
471choice 501choice
@@ -569,7 +599,8 @@ config TASK_SIZE_BOOL
569 599
570config TASK_SIZE 600config TASK_SIZE
571 hex "Size of user task space" if TASK_SIZE_BOOL 601 hex "Size of user task space" if TASK_SIZE_BOOL
572 default "0x80000000" 602 default "0x80000000" if PPC_PREP || PPC_8xx
603 default "0xc0000000"
573 604
574config CONSISTENT_START_BOOL 605config CONSISTENT_START_BOOL
575 bool "Set custom consistent memory pool address" 606 bool "Set custom consistent memory pool address"
@@ -581,6 +612,7 @@ config CONSISTENT_START_BOOL
581 612
582config CONSISTENT_START 613config CONSISTENT_START
583 hex "Base virtual address of consistent memory pool" if CONSISTENT_START_BOOL 614 hex "Base virtual address of consistent memory pool" if CONSISTENT_START_BOOL
615 default "0xfd000000" if (NOT_COHERENT_CACHE && 8xx)
584 default "0xff100000" if NOT_COHERENT_CACHE 616 default "0xff100000" if NOT_COHERENT_CACHE
585 617
586config CONSISTENT_SIZE_BOOL 618config CONSISTENT_SIZE_BOOL
@@ -662,3 +694,7 @@ config KEYS_COMPAT
662 default y 694 default y
663 695
664source "crypto/Kconfig" 696source "crypto/Kconfig"
697
698config PPC_CLOCK
699 bool
700 default n
diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
index 22acece95b11..464f9b4b3169 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
@@ -211,6 +221,15 @@ config PPC_EARLY_DEBUG_44x
211 Select this to enable early debugging for IBM 44x chips via the 221 Select this to enable early debugging for IBM 44x chips via the
212 inbuilt serial port. 222 inbuilt serial port.
213 223
224config PPC_EARLY_DEBUG_CPM
225 bool "Early serial debugging for Freescale CPM-based serial ports"
226 depends on SERIAL_CPM
227 select PIN_TLB if PPC_8xx
228 help
229 Select this to enable early debugging for Freescale chips
230 using a CPM-based serial port. This assumes that the bootwrapper
231 has run, and set up the CPM in a particular way.
232
214endchoice 233endchoice
215 234
216config PPC_EARLY_DEBUG_44x_PHYSLOW 235config PPC_EARLY_DEBUG_44x_PHYSLOW
@@ -223,4 +242,16 @@ config PPC_EARLY_DEBUG_44x_PHYSHIGH
223 depends PPC_EARLY_DEBUG_44x 242 depends PPC_EARLY_DEBUG_44x
224 default "0x1" 243 default "0x1"
225 244
245config PPC_EARLY_DEBUG_CPM_ADDR
246 hex "CPM UART early debug transmit descriptor address"
247 depends on PPC_EARLY_DEBUG_CPM
248 default "0xfa202008" if PPC_EP88XC
249 default "0xf0000008" if CPM2
250 default "0xff002008" if CPM1
251 help
252 This specifies the address of the transmit descriptor
253 used for early debug output. Because it is needed before
254 platform probing is done, all platforms selected must
255 share the same address.
256
226endmenu 257endmenu
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..65f4118cbe78 100644
--- a/arch/powerpc/boot/.gitignore
+++ b/arch/powerpc/boot/.gitignore
@@ -18,14 +18,15 @@ kernel-vmlinux.strip.c
18kernel-vmlinux.strip.gz 18kernel-vmlinux.strip.gz
19mktree 19mktree
20uImage 20uImage
21cuImage 21cuImage.*
22cuImage.bin.gz 22treeImage.*
23cuImage.elf
24zImage 23zImage
24zImage.bin.*
25zImage.chrp 25zImage.chrp
26zImage.coff 26zImage.coff
27zImage.coff.lds 27zImage.coff.lds
28zImage.lds 28zImage.ep*
29zImage.*lds
29zImage.miboot 30zImage.miboot
30zImage.pmac 31zImage.pmac
31zImage.pseries 32zImage.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..18e32719d0ed 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -25,14 +25,19 @@ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
25 -isystem $(shell $(CROSS32CC) -print-file-name=include) 25 -isystem $(shell $(CROSS32CC) -print-file-name=include)
26BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc 26BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
27 27
28ifdef CONFIG_DEBUG_INFO
29BOOTCFLAGS += -g
30endif
31
28ifeq ($(call cc-option-yn, -fstack-protector),y) 32ifeq ($(call cc-option-yn, -fstack-protector),y)
29BOOTCFLAGS += -fno-stack-protector 33BOOTCFLAGS += -fno-stack-protector
30endif 34endif
31 35
32BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj) 36BOOTCFLAGS += -I$(obj) -I$(srctree)/$(obj)
33 37
34$(obj)/44x.o: BOOTCFLAGS += -mcpu=440 38$(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
35$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440 39$(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
40$(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
36 41
37zlib := inffast.c inflate.c inftrees.c 42zlib := inffast.c inflate.c inftrees.c
38zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h 43zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
@@ -44,10 +49,14 @@ $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \
44src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \ 49src-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 \ 50 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 \ 51 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 52 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 \ 53 cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \
54 fsl-soc.c mpc8xx.c pq2.c
55src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
49 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ 56 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
50 ps3-head.S ps3-hvcall.S ps3.c 57 ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
58 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \
59 fixed-head.S ep88xc.c cuboot-hpc2.c
51src-boot := $(src-wlib) $(src-plat) empty.c 60src-boot := $(src-wlib) $(src-plat) empty.c
52 61
53src-boot := $(addprefix $(obj)/, $(src-boot)) 62src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -139,9 +148,17 @@ image-$(CONFIG_PPC_ISERIES) += zImage.iseries
139image-$(CONFIG_DEFAULT_UIMAGE) += uImage 148image-$(CONFIG_DEFAULT_UIMAGE) += uImage
140 149
141ifneq ($(CONFIG_DEVICE_TREE),"") 150ifneq ($(CONFIG_DEVICE_TREE),"")
151image-$(CONFIG_PPC_8xx) += cuImage.8xx
152image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc
153image-$(CONFIG_8260) += cuImage.pq2
154image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx
142image-$(CONFIG_PPC_83xx) += cuImage.83xx 155image-$(CONFIG_PPC_83xx) += cuImage.83xx
143image-$(CONFIG_PPC_85xx) += cuImage.85xx 156image-$(CONFIG_PPC_85xx) += cuImage.85xx
157image-$(CONFIG_MPC7448HPC2) += cuImage.hpc2
144image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony 158image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
159image-$(CONFIG_BAMBOO) += treeImage.bamboo cuImage.bamboo
160image-$(CONFIG_SEQUOIA) += cuImage.sequoia
161image-$(CONFIG_WALNUT) += treeImage.walnut
145endif 162endif
146 163
147# For 32-bit powermacs, build the COFF and miboot images 164# 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..28296facb2ae
--- /dev/null
+++ b/arch/powerpc/boot/cpm-serial.c
@@ -0,0 +1,269 @@
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 *muram_start;
60static u32 muram_offset;
61
62static void (*do_cmd)(int op);
63static void (*enable_port)(void);
64static void (*disable_port)(void);
65
66#define CPM_CMD_STOP_TX 4
67#define CPM_CMD_RESTART_TX 6
68#define CPM_CMD_INIT_RX_TX 0
69
70static void cpm1_cmd(int op)
71{
72 while (in_be16(cpcr) & 1)
73 ;
74
75 out_be16(cpcr, (op << 8) | cpm_cmd | 1);
76
77 while (in_be16(cpcr) & 1)
78 ;
79}
80
81static void cpm2_cmd(int op)
82{
83 while (in_be32(cpcr) & 0x10000)
84 ;
85
86 out_be32(cpcr, op | cpm_cmd | 0x10000);
87
88 while (in_be32(cpcr) & 0x10000)
89 ;
90}
91
92static void smc_disable_port(void)
93{
94 do_cmd(CPM_CMD_STOP_TX);
95 out_be16(&smc->smcmr, in_be16(&smc->smcmr) & ~3);
96}
97
98static void scc_disable_port(void)
99{
100 do_cmd(CPM_CMD_STOP_TX);
101 out_be32(&scc->gsmrl, in_be32(&scc->gsmrl) & ~0x30);
102}
103
104static void smc_enable_port(void)
105{
106 out_be16(&smc->smcmr, in_be16(&smc->smcmr) | 3);
107 do_cmd(CPM_CMD_RESTART_TX);
108}
109
110static void scc_enable_port(void)
111{
112 out_be32(&scc->gsmrl, in_be32(&scc->gsmrl) | 0x30);
113 do_cmd(CPM_CMD_RESTART_TX);
114}
115
116static int cpm_serial_open(void)
117{
118 disable_port();
119
120 out_8(&param->rfcr, 0x10);
121 out_8(&param->tfcr, 0x10);
122
123 rbdf = (struct cpm_bd *)muram_start;
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, muram_offset);
135 out_be16(&param->tbase, muram_offset + 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, *muram;
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 if (!dt_xlate_reg(parent, 0, &reg_phys, NULL))
233 return -1;
234
235 reg_virt[0] = (void *)reg_phys;
236 }
237
238 cpcr = reg_virt[0];
239
240 muram = finddevice("/soc/cpm/muram/data");
241 if (!muram)
242 return -1;
243
244 /* For bootwrapper-compatible device trees, we assume that the first
245 * entry has at least 18 bytes, and that #address-cells/#data-cells
246 * is one for both parent and child.
247 */
248
249 n = getprop(muram, "virtual-reg", reg_virt, sizeof(reg_virt));
250 if (n < (int)sizeof(reg_virt)) {
251 if (!dt_xlate_reg(muram, 0, &reg_phys, NULL))
252 return -1;
253
254 reg_virt[0] = (void *)reg_phys;
255 }
256
257 muram_start = reg_virt[0];
258
259 n = getprop(muram, "reg", &muram_offset, 4);
260 if (n < 4)
261 return -1;
262
263 scdp->open = cpm_serial_open;
264 scdp->putc = cpm_serial_putc;
265 scdp->getc = cpm_serial_getc;
266 scdp->tstc = cpm_serial_tstc;
267
268 return 0;
269}
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..0e82015a5f95
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-8xx.c
@@ -0,0 +1,47 @@
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
35 node = finddevice("/soc/cpm/brg");
36 if (node)
37 setprop(node, "clock-frequency", &bd.bi_busfreq, 4);
38}
39
40void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
41 unsigned long r6, unsigned long r7)
42{
43 CUBOOT_INIT();
44 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
45 serial_console_init();
46 platform_ops.fixups = platform_fixups;
47}
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-hpc2.c b/arch/powerpc/boot/cuboot-hpc2.c
new file mode 100644
index 000000000000..d333898bca30
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-hpc2.c
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
3 *
4 * Author: Roy Zang <tie-fei.zang@freescale.com>
5 *
6 * Description:
7 * Old U-boot compatibility for mpc7448hpc2 board
8 * Based on the code of Scott Wood <scottwood@freescale.com>
9 * for 83xx and 85xx.
10 *
11 * This is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 */
17
18#include "ops.h"
19#include "stdio.h"
20#include "cuboot.h"
21
22#define TARGET_HAS_ETH1
23#include "ppcboot.h"
24
25static bd_t bd;
26extern char _dtb_start[], _dtb_end[];
27
28static void platform_fixups(void)
29{
30 void *tsi;
31
32 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
33 dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
34 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
35 tsi = find_node_by_devtype(NULL, "tsi-bridge");
36 if (tsi)
37 setprop(tsi, "bus-frequency", &bd.bi_busfreq,
38 sizeof(bd.bi_busfreq));
39}
40
41void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
42 unsigned long r6, unsigned long r7)
43{
44 CUBOOT_INIT();
45 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
46 serial_console_init();
47 platform_ops.fixups = platform_fixups;
48}
diff --git a/arch/powerpc/boot/cuboot-pq2.c b/arch/powerpc/boot/cuboot-pq2.c
new file mode 100644
index 000000000000..61574f3272dd
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-pq2.c
@@ -0,0 +1,261 @@
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#include "fsl-soc.h"
19
20#define TARGET_CPM2
21#define TARGET_HAS_ETH1
22#include "ppcboot.h"
23
24static bd_t bd;
25
26struct cs_range {
27 u32 csnum;
28 u32 base; /* must be zero */
29 u32 addr;
30 u32 size;
31};
32
33struct pci_range {
34 u32 flags;
35 u32 pci_addr[2];
36 u32 phys_addr;
37 u32 size[2];
38};
39
40struct cs_range cs_ranges_buf[MAX_PROP_LEN / sizeof(struct cs_range)];
41struct pci_range pci_ranges_buf[MAX_PROP_LEN / sizeof(struct pci_range)];
42
43/* Different versions of u-boot put the BCSR in different places, and
44 * some don't set up the PCI PIC at all, so we assume the device tree is
45 * sane and update the BRx registers appropriately.
46 *
47 * For any node defined as compatible with fsl,pq2-localbus,
48 * #address/#size must be 2/1 for the localbus, and 1/1 for the parent bus.
49 * Ranges must be for whole chip selects.
50 */
51static void update_cs_ranges(void)
52{
53 void *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("/localbus");
61 if (!bus_node || !dt_is_compatible(bus_node, "fsl,pq2-localbus"))
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 if (!dt_xlate_reg(bus_node, 0, (unsigned long *)&ctrl_addr,
77 &ctrl_size))
78 goto err;
79
80 len = getprop(bus_node, "ranges", cs_ranges_buf, sizeof(cs_ranges_buf));
81
82 for (i = 0; i < len / sizeof(struct cs_range); i++) {
83 u32 base, option;
84 int cs = cs_ranges_buf[i].csnum;
85 if (cs >= ctrl_size / 8)
86 goto err;
87
88 if (cs_ranges_buf[i].base != 0)
89 goto err;
90
91 base = in_be32(&ctrl_addr[cs * 2]);
92
93 /* If CS is already valid, use the existing flags.
94 * Otherwise, guess a sane default.
95 */
96 if (base & 1) {
97 base &= 0x7fff;
98 option = in_be32(&ctrl_addr[cs * 2 + 1]) & 0x7fff;
99 } else {
100 base = 0x1801;
101 option = 0x10;
102 }
103
104 out_be32(&ctrl_addr[cs * 2], 0);
105 out_be32(&ctrl_addr[cs * 2 + 1],
106 option | ~(cs_ranges_buf[i].size - 1));
107 out_be32(&ctrl_addr[cs * 2], base | cs_ranges_buf[i].addr);
108 }
109
110 return;
111
112err:
113 printf("Bad /localbus node\r\n");
114}
115
116/* Older u-boots don't set PCI up properly. Update the hardware to match
117 * the device tree. The prefetch mem region and non-prefetch mem region
118 * must be contiguous in the host bus. As required by the PCI binding,
119 * PCI #addr/#size must be 3/2. The parent bus must be 1/1. Only
120 * 32-bit PCI is supported. All three region types (prefetchable mem,
121 * non-prefetchable mem, and I/O) must be present.
122 */
123static void fixup_pci(void)
124{
125 struct pci_range *mem = NULL, *mmio = NULL,
126 *io = NULL, *mem_base = NULL;
127 u32 *pci_regs[3];
128 u8 *soc_regs;
129 int i, len;
130 void *node, *parent_node;
131 u32 naddr, nsize, mem_log2;
132
133 node = finddevice("/pci");
134 if (!node || !dt_is_compatible(node, "fsl,pq2-pci"))
135 return;
136
137 for (i = 0; i < 3; i++)
138 if (!dt_xlate_reg(node, i,
139 (unsigned long *)&pci_regs[i], NULL))
140 goto err;
141
142 soc_regs = (u8 *)fsl_get_immr();
143 if (!soc_regs)
144 goto err;
145
146 dt_get_reg_format(node, &naddr, &nsize);
147 if (naddr != 3 || nsize != 2)
148 goto err;
149
150 parent_node = get_parent(node);
151 if (!parent_node)
152 goto err;
153
154 dt_get_reg_format(parent_node, &naddr, &nsize);
155 if (naddr != 1 || nsize != 1)
156 goto err;
157
158 len = getprop(node, "ranges", pci_ranges_buf,
159 sizeof(pci_ranges_buf));
160
161 for (i = 0; i < len / sizeof(struct pci_range); i++) {
162 u32 flags = pci_ranges_buf[i].flags & 0x43000000;
163
164 if (flags == 0x42000000)
165 mem = &pci_ranges_buf[i];
166 else if (flags == 0x02000000)
167 mmio = &pci_ranges_buf[i];
168 else if (flags == 0x01000000)
169 io = &pci_ranges_buf[i];
170 }
171
172 if (!mem || !mmio || !io)
173 goto err;
174
175 if (mem->phys_addr + mem->size[1] == mmio->phys_addr)
176 mem_base = mem;
177 else if (mmio->phys_addr + mmio->size[1] == mem->phys_addr)
178 mem_base = mmio;
179 else
180 goto err;
181
182 out_be32(&pci_regs[1][0], mem_base->phys_addr | 1);
183 out_be32(&pci_regs[2][0], ~(mem->size[1] + mmio->size[1] - 1));
184
185 out_be32(&pci_regs[1][1], io->phys_addr | 1);
186 out_be32(&pci_regs[2][1], ~(io->size[1] - 1));
187
188 out_le32(&pci_regs[0][0], mem->pci_addr[1] >> 12);
189 out_le32(&pci_regs[0][2], mem->phys_addr >> 12);
190 out_le32(&pci_regs[0][4], (~(mem->size[1] - 1) >> 12) | 0xa0000000);
191
192 out_le32(&pci_regs[0][6], mmio->pci_addr[1] >> 12);
193 out_le32(&pci_regs[0][8], mmio->phys_addr >> 12);
194 out_le32(&pci_regs[0][10], (~(mmio->size[1] - 1) >> 12) | 0x80000000);
195
196 out_le32(&pci_regs[0][12], io->pci_addr[1] >> 12);
197 out_le32(&pci_regs[0][14], io->phys_addr >> 12);
198 out_le32(&pci_regs[0][16], (~(io->size[1] - 1) >> 12) | 0xc0000000);
199
200 /* Inbound translation */
201 out_le32(&pci_regs[0][58], 0);
202 out_le32(&pci_regs[0][60], 0);
203
204 mem_log2 = 1 << (__ilog2_u32(bd.bi_memsize - 1) + 1);
205 out_le32(&pci_regs[0][62], 0xa0000000 | ~((1 << (mem_log2 - 12)) - 1));
206
207 /* If PCI is disabled, drive RST high to enable. */
208 if (!(in_le32(&pci_regs[0][32]) & 1)) {
209 /* Tpvrh (Power valid to RST# high) 100 ms */
210 udelay(100000);
211
212 out_le32(&pci_regs[0][32], 1);
213
214 /* Trhfa (RST# high to first cfg access) 2^25 clocks */
215 udelay(1020000);
216 }
217
218 /* Enable bus master and memory access */
219 out_le32(&pci_regs[0][64], 0x80000004);
220 out_le32(&pci_regs[0][65], in_le32(&pci_regs[0][65]) | 6);
221
222 /* Park the bus on PCI, and elevate PCI's arbitration priority,
223 * as required by section 9.6 of the user's manual.
224 */
225 out_8(&soc_regs[0x10028], 3);
226 out_be32((u32 *)&soc_regs[0x1002c], 0x01236745);
227
228 return;
229
230err:
231 printf("Bad PCI node\r\n");
232}
233
234static void pq2_platform_fixups(void)
235{
236 void *node;
237
238 dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
239 dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
240 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
241
242 node = finddevice("/soc/cpm");
243 if (node)
244 setprop(node, "clock-frequency", &bd.bi_cpmfreq, 4);
245
246 node = finddevice("/soc/cpm/brg");
247 if (node)
248 setprop(node, "clock-frequency", &bd.bi_brgfreq, 4);
249
250 update_cs_ranges();
251 fixup_pci();
252}
253
254void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
255 unsigned long r6, unsigned long r7)
256{
257 CUBOOT_INIT();
258 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
259 serial_console_init();
260 platform_ops.fixups = pq2_platform_fixups;
261}
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/ep88xc.dts b/arch/powerpc/boot/dts/ep88xc.dts
new file mode 100644
index 000000000000..02705f299790
--- /dev/null
+++ b/arch/powerpc/boot/dts/ep88xc.dts
@@ -0,0 +1,214 @@
1/*
2 * EP88xC Device Tree Source
3 *
4 * Copyright 2006 MontaVista Software, Inc.
5 * Copyright 2007 Freescale Semiconductor, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13
14/ {
15 model = "EP88xC";
16 compatible = "fsl,ep88xc";
17 #address-cells = <1>;
18 #size-cells = <1>;
19
20 cpus {
21 #address-cells = <1>;
22 #size-cells = <0>;
23
24 PowerPC,885@0 {
25 device_type = "cpu";
26 reg = <0>;
27 d-cache-line-size = <d#16>;
28 i-cache-line-size = <d#16>;
29 d-cache-size = <d#8192>;
30 i-cache-size = <d#8192>;
31 timebase-frequency = <0>;
32 bus-frequency = <0>;
33 clock-frequency = <0>;
34 interrupts = <f 2>; // decrementer interrupt
35 interrupt-parent = <&PIC>;
36 };
37 };
38
39 memory {
40 device_type = "memory";
41 reg = <0 0>;
42 };
43
44 localbus@fa200100 {
45 compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus";
46 #address-cells = <2>;
47 #size-cells = <1>;
48 reg = <fa200100 40>;
49
50 ranges = <
51 0 0 fc000000 04000000
52 3 0 fa000000 01000000
53 >;
54
55 flash@0,2000000 {
56 compatible = "cfi-flash";
57 reg = <0 2000000 2000000>;
58 bank-width = <4>;
59 device-width = <2>;
60 };
61
62 board-control@3,400000 {
63 reg = <3 400000 10>;
64 compatible = "fsl,ep88xc-bcsr";
65 };
66 };
67
68 soc@fa200000 {
69 compatible = "fsl,mpc885", "fsl,pq1-soc";
70 #address-cells = <1>;
71 #size-cells = <1>;
72 device_type = "soc";
73 ranges = <0 fa200000 00004000>;
74 bus-frequency = <0>;
75
76 // Temporary -- will go away once kernel uses ranges for get_immrbase().
77 reg = <fa200000 4000>;
78
79 mdio@e00 {
80 compatible = "fsl,mpc885-fec-mdio", "fsl,pq1-fec-mdio";
81 reg = <e00 188>;
82 #address-cells = <1>;
83 #size-cells = <0>;
84
85 PHY0: ethernet-phy@0 {
86 reg = <0>;
87 device_type = "ethernet-phy";
88 };
89
90 PHY1: ethernet-phy@1 {
91 reg = <1>;
92 device_type = "ethernet-phy";
93 };
94 };
95
96 ethernet@e00 {
97 device_type = "network";
98 compatible = "fsl,mpc885-fec-enet",
99 "fsl,pq1-fec-enet";
100 reg = <e00 188>;
101 local-mac-address = [ 00 00 00 00 00 00 ];
102 interrupts = <3 1>;
103 interrupt-parent = <&PIC>;
104 phy-handle = <&PHY0>;
105 linux,network-index = <0>;
106 };
107
108 ethernet@1e00 {
109 device_type = "network";
110 compatible = "fsl,mpc885-fec-enet",
111 "fsl,pq1-fec-enet";
112 reg = <1e00 188>;
113 local-mac-address = [ 00 00 00 00 00 00 ];
114 interrupts = <7 1>;
115 interrupt-parent = <&PIC>;
116 phy-handle = <&PHY1>;
117 linux,network-index = <1>;
118 };
119
120 PIC: interrupt-controller@0 {
121 interrupt-controller;
122 #interrupt-cells = <2>;
123 reg = <0 24>;
124 compatible = "fsl,mpc885-pic", "fsl,pq1-pic";
125 };
126
127 pcmcia@80 {
128 #address-cells = <3>;
129 #interrupt-cells = <1>;
130 #size-cells = <2>;
131 compatible = "fsl,pq-pcmcia";
132 device_type = "pcmcia";
133 reg = <80 80>;
134 interrupt-parent = <&PIC>;
135 interrupts = <d 1>;
136 };
137
138 cpm@9c0 {
139 #address-cells = <1>;
140 #size-cells = <1>;
141 compatible = "fsl,mpc885-cpm", "fsl,cpm1";
142 command-proc = <9c0>;
143 interrupts = <0>; // cpm error interrupt
144 interrupt-parent = <&CPM_PIC>;
145 reg = <9c0 40>;
146 ranges;
147
148 muram@2000 {
149 #address-cells = <1>;
150 #size-cells = <1>;
151 ranges = <0 2000 2000>;
152
153 data@0 {
154 compatible = "fsl,cpm-muram-data";
155 reg = <0 1c00>;
156 };
157 };
158
159 brg@9f0 {
160 compatible = "fsl,mpc885-brg",
161 "fsl,cpm1-brg",
162 "fsl,cpm-brg";
163 reg = <9f0 10>;
164 };
165
166 CPM_PIC: interrupt-controller@930 {
167 interrupt-controller;
168 #interrupt-cells = <1>;
169 interrupts = <5 2 0 2>;
170 interrupt-parent = <&PIC>;
171 reg = <930 20>;
172 compatible = "fsl,mpc885-cpm-pic",
173 "fsl,cpm1-pic";
174 };
175
176 // MON-1
177 serial@a80 {
178 device_type = "serial";
179 compatible = "fsl,mpc885-smc-uart",
180 "fsl,cpm1-smc-uart";
181 reg = <a80 10 3e80 40>;
182 interrupts = <4>;
183 interrupt-parent = <&CPM_PIC>;
184 fsl,cpm-brg = <1>;
185 fsl,cpm-command = <0090>;
186 linux,planetcore-label = "SMC1";
187 };
188
189 // SER-1
190 serial@a20 {
191 device_type = "serial";
192 compatible = "fsl,mpc885-scc-uart",
193 "fsl,cpm1-scc-uart";
194 reg = <a20 20 3d00 80>;
195 interrupts = <1d>;
196 interrupt-parent = <&CPM_PIC>;
197 fsl,cpm-brg = <2>;
198 fsl,cpm-command = <0040>;
199 linux,planetcore-label = "SCC2";
200 };
201
202 usb@a00 {
203 #address-cells = <1>;
204 #size-cells = <0>;
205 compatible = "fsl,mpc885-usb",
206 "fsl,cpm1-usb";
207 reg = <a00 18 1c00 80>;
208 interrupt-parent = <&CPM_PIC>;
209 interrupts = <1e>;
210 fsl,cpm-command = <0000>;
211 };
212 };
213 };
214};
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/kilauea.dts b/arch/powerpc/boot/dts/kilauea.dts
new file mode 100644
index 000000000000..c824e8f06454
--- /dev/null
+++ b/arch/powerpc/boot/dts/kilauea.dts
@@ -0,0 +1,252 @@
1/*
2 * Device Tree Source for AMCC Kilauea (405EX)
3 *
4 * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without
8 * any warranty of any kind, whether express or implied.
9 */
10
11/ {
12 #address-cells = <1>;
13 #size-cells = <1>;
14 model = "amcc,kilauea";
15 compatible = "amcc,kilauea";
16 dcr-parent = <&/cpus/PowerPC,405EX@0>;
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 PowerPC,405EX@0 {
23 device_type = "cpu";
24 reg = <0>;
25 clock-frequency = <0>; /* Filled in by U-Boot */
26 timebase-frequency = <0>; /* Filled in by U-Boot */
27 i-cache-line-size = <20>;
28 d-cache-line-size = <20>;
29 i-cache-size = <4000>; /* 16 kB */
30 d-cache-size = <4000>; /* 16 kB */
31 dcr-controller;
32 dcr-access-method = "native";
33 };
34 };
35
36 memory {
37 device_type = "memory";
38 reg = <0 0>; /* Filled in by U-Boot */
39 };
40
41 UIC0: interrupt-controller {
42 compatible = "ibm,uic-405ex", "ibm,uic";
43 interrupt-controller;
44 cell-index = <0>;
45 dcr-reg = <0c0 009>;
46 #address-cells = <0>;
47 #size-cells = <0>;
48 #interrupt-cells = <2>;
49 };
50
51 UIC1: interrupt-controller1 {
52 compatible = "ibm,uic-405ex","ibm,uic";
53 interrupt-controller;
54 cell-index = <1>;
55 dcr-reg = <0d0 009>;
56 #address-cells = <0>;
57 #size-cells = <0>;
58 #interrupt-cells = <2>;
59 interrupts = <1e 4 1f 4>; /* cascade */
60 interrupt-parent = <&UIC0>;
61 };
62
63 UIC2: interrupt-controller2 {
64 compatible = "ibm,uic-405ex","ibm,uic";
65 interrupt-controller;
66 cell-index = <2>;
67 dcr-reg = <0e0 009>;
68 #address-cells = <0>;
69 #size-cells = <0>;
70 #interrupt-cells = <2>;
71 interrupts = <1c 4 1d 4>; /* cascade */
72 interrupt-parent = <&UIC0>;
73 };
74
75 plb {
76 compatible = "ibm,plb-405ex", "ibm,plb4";
77 #address-cells = <1>;
78 #size-cells = <1>;
79 ranges;
80 clock-frequency = <0>; /* Filled in by U-Boot */
81
82 SDRAM0: memory-controller {
83 compatible = "ibm,sdram-405ex";
84 dcr-reg = <010 2>;
85 };
86
87 MAL0: mcmal {
88 compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
89 dcr-reg = <180 62>;
90 num-tx-chans = <2>;
91 num-rx-chans = <2>;
92 interrupt-parent = <&MAL0>;
93 interrupts = <0 1 2 3 4>;
94 #interrupt-cells = <1>;
95 #address-cells = <0>;
96 #size-cells = <0>;
97 interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
98 /*RXEOB*/ 1 &UIC0 b 4
99 /*SERR*/ 2 &UIC1 0 4
100 /*TXDE*/ 3 &UIC1 1 4
101 /*RXDE*/ 4 &UIC1 2 4>;
102 interrupt-map-mask = <ffffffff>;
103 };
104
105 POB0: opb {
106 compatible = "ibm,opb-405ex", "ibm,opb";
107 #address-cells = <1>;
108 #size-cells = <1>;
109 ranges = <80000000 80000000 10000000
110 ef600000 ef600000 a00000
111 f0000000 f0000000 10000000>;
112 dcr-reg = <0a0 5>;
113 clock-frequency = <0>; /* Filled in by U-Boot */
114
115 EBC0: ebc {
116 compatible = "ibm,ebc-405ex", "ibm,ebc";
117 dcr-reg = <012 2>;
118 #address-cells = <2>;
119 #size-cells = <1>;
120 clock-frequency = <0>; /* Filled in by U-Boot */
121 /* ranges property is supplied by U-Boot */
122 interrupts = <5 1>;
123 interrupt-parent = <&UIC1>;
124
125 nor_flash@0,0 {
126 compatible = "amd,s29gl512n", "cfi-flash";
127 bank-width = <2>;
128 reg = <0 000000 4000000>;
129 #address-cells = <1>;
130 #size-cells = <1>;
131 partition@0 {
132 label = "kernel";
133 reg = <0 200000>;
134 };
135 partition@200000 {
136 label = "root";
137 reg = <200000 200000>;
138 };
139 partition@400000 {
140 label = "user";
141 reg = <400000 3b60000>;
142 };
143 partition@3f60000 {
144 label = "env";
145 reg = <3f60000 40000>;
146 };
147 partition@3fa0000 {
148 label = "u-boot";
149 reg = <3fa0000 60000>;
150 };
151 };
152 };
153
154 UART0: serial@ef600200 {
155 device_type = "serial";
156 compatible = "ns16550";
157 reg = <ef600200 8>;
158 virtual-reg = <ef600200>;
159 clock-frequency = <0>; /* Filled in by U-Boot */
160 current-speed = <0>;
161 interrupt-parent = <&UIC0>;
162 interrupts = <1a 4>;
163 };
164
165 UART1: serial@ef600300 {
166 device_type = "serial";
167 compatible = "ns16550";
168 reg = <ef600300 8>;
169 virtual-reg = <ef600300>;
170 clock-frequency = <0>; /* Filled in by U-Boot */
171 current-speed = <0>;
172 interrupt-parent = <&UIC0>;
173 interrupts = <1 4>;
174 };
175
176 IIC0: i2c@ef600400 {
177 device_type = "i2c";
178 compatible = "ibm,iic-405ex", "ibm,iic";
179 reg = <ef600400 14>;
180 interrupt-parent = <&UIC0>;
181 interrupts = <2 4>;
182 };
183
184 IIC1: i2c@ef600500 {
185 device_type = "i2c";
186 compatible = "ibm,iic-405ex", "ibm,iic";
187 reg = <ef600500 14>;
188 interrupt-parent = <&UIC0>;
189 interrupts = <7 4>;
190 };
191
192
193 RGMII0: emac-rgmii@ef600b00 {
194 device_type = "rgmii-interface";
195 compatible = "ibm,rgmii-405ex", "ibm,rgmii";
196 reg = <ef600b00 104>;
197 };
198
199 EMAC0: ethernet@ef600900 {
200 linux,network-index = <0>;
201 device_type = "network";
202 compatible = "ibm,emac-405ex", "ibm,emac4";
203 interrupt-parent = <&EMAC0>;
204 interrupts = <0 1>;
205 #interrupt-cells = <1>;
206 #address-cells = <0>;
207 #size-cells = <0>;
208 interrupt-map = </*Status*/ 0 &UIC0 18 4
209 /*Wake*/ 1 &UIC1 1d 4>;
210 reg = <ef600900 70>;
211 local-mac-address = [000000000000]; /* Filled in by U-Boot */
212 mal-device = <&MAL0>;
213 mal-tx-channel = <0>;
214 mal-rx-channel = <0>;
215 cell-index = <0>;
216 max-frame-size = <5dc>;
217 rx-fifo-size = <1000>;
218 tx-fifo-size = <800>;
219 phy-mode = "rgmii";
220 phy-map = <00000000>;
221 rgmii-device = <&RGMII0>;
222 rgmii-channel = <0>;
223 };
224
225 EMAC1: ethernet@ef600a00 {
226 linux,network-index = <1>;
227 device_type = "network";
228 compatible = "ibm,emac-405ex", "ibm,emac4";
229 interrupt-parent = <&EMAC1>;
230 interrupts = <0 1>;
231 #interrupt-cells = <1>;
232 #address-cells = <0>;
233 #size-cells = <0>;
234 interrupt-map = </*Status*/ 0 &UIC0 19 4
235 /*Wake*/ 1 &UIC1 1f 4>;
236 reg = <ef600a00 70>;
237 local-mac-address = [000000000000]; /* Filled in by U-Boot */
238 mal-device = <&MAL0>;
239 mal-tx-channel = <1>;
240 mal-rx-channel = <1>;
241 cell-index = <1>;
242 max-frame-size = <5dc>;
243 rx-fifo-size = <1000>;
244 tx-fifo-size = <800>;
245 phy-mode = "rgmii";
246 phy-map = <00000000>;
247 rgmii-device = <&RGMII0>;
248 rgmii-channel = <1>;
249 };
250 };
251 };
252};
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..bc45f5fbb060 100644
--- a/arch/powerpc/boot/dts/lite5200.dts
+++ b/arch/powerpc/boot/dts/lite5200.dts
@@ -19,7 +19,7 @@
19/ { 19/ {
20 model = "fsl,lite5200"; 20 model = "fsl,lite5200";
21 // revision = "1.0"; 21 // revision = "1.0";
22 compatible = "fsl,lite5200\0generic-mpc5200"; 22 compatible = "fsl,lite5200","generic-mpc5200";
23 #address-cells = <1>; 23 #address-cells = <1>;
24 #size-cells = <1>; 24 #size-cells = <1>;
25 25
@@ -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";
@@ -216,7 +192,7 @@
216 192
217 usb@1000 { 193 usb@1000 {
218 device_type = "usb-ohci-be"; 194 device_type = "usb-ohci-be";
219 compatible = "mpc5200-ohci\0ohci-be"; 195 compatible = "mpc5200-ohci","ohci-be";
220 reg = <1000 ff>; 196 reg = <1000 ff>;
221 interrupts = <2 6 0>; 197 interrupts = <2 6 0>;
222 interrupt-parent = <&mpc5200_pic>; 198 interrupt-parent = <&mpc5200_pic>;
@@ -317,7 +293,7 @@
317 293
318 i2c@3d00 { 294 i2c@3d00 {
319 device_type = "i2c"; 295 device_type = "i2c";
320 compatible = "mpc5200-i2c\0fsl-i2c"; 296 compatible = "mpc5200-i2c","fsl-i2c";
321 cell-index = <0>; 297 cell-index = <0>;
322 reg = <3d00 40>; 298 reg = <3d00 40>;
323 interrupts = <2 f 0>; 299 interrupts = <2 f 0>;
@@ -327,7 +303,7 @@
327 303
328 i2c@3d40 { 304 i2c@3d40 {
329 device_type = "i2c"; 305 device_type = "i2c";
330 compatible = "mpc5200-i2c\0fsl-i2c"; 306 compatible = "mpc5200-i2c","fsl-i2c";
331 cell-index = <1>; 307 cell-index = <1>;
332 reg = <3d40 40>; 308 reg = <3d40 40>;
333 interrupts = <2 10 0>; 309 interrupts = <2 10 0>;
@@ -336,8 +312,29 @@
336 }; 312 };
337 sram@8000 { 313 sram@8000 {
338 device_type = "sram"; 314 device_type = "sram";
339 compatible = "mpc5200-sram\0sram"; 315 compatible = "mpc5200-sram","sram";
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..a6bb1d0558ef 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -19,7 +19,7 @@
19/ { 19/ {
20 model = "fsl,lite5200b"; 20 model = "fsl,lite5200b";
21 // revision = "1.0"; 21 // revision = "1.0";
22 compatible = "fsl,lite5200b\0generic-mpc5200"; 22 compatible = "fsl,lite5200b","generic-mpc5200";
23 #address-cells = <1>; 23 #address-cells = <1>;
24 #size-cells = <1>; 24 #size-cells = <1>;
25 25
@@ -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,15 +49,14 @@
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
60 cdm@200 { 58 cdm@200 {
61 compatible = "mpc5200b-cdm\0mpc5200-cdm"; 59 compatible = "mpc5200b-cdm","mpc5200-cdm";
62 reg = <200 38>; 60 reg = <200 38>;
63 }; 61 };
64 62
@@ -67,13 +65,12 @@
67 interrupt-controller; 65 interrupt-controller;
68 #interrupt-cells = <3>; 66 #interrupt-cells = <3>;
69 device_type = "interrupt-controller"; 67 device_type = "interrupt-controller";
70 compatible = "mpc5200b-pic\0mpc5200-pic"; 68 compatible = "mpc5200b-pic","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
76 compatible = "mpc5200b-gpt\0mpc5200-gpt"; 73 compatible = "mpc5200b-gpt","mpc5200-gpt";
77 device_type = "gpt"; 74 device_type = "gpt";
78 cell-index = <0>; 75 cell-index = <0>;
79 reg = <600 10>; 76 reg = <600 10>;
@@ -83,7 +80,7 @@
83 }; 80 };
84 81
85 gpt@610 { // General Purpose Timer 82 gpt@610 { // General Purpose Timer
86 compatible = "mpc5200b-gpt\0mpc5200-gpt"; 83 compatible = "mpc5200b-gpt","mpc5200-gpt";
87 device_type = "gpt"; 84 device_type = "gpt";
88 cell-index = <1>; 85 cell-index = <1>;
89 reg = <610 10>; 86 reg = <610 10>;
@@ -92,7 +89,7 @@
92 }; 89 };
93 90
94 gpt@620 { // General Purpose Timer 91 gpt@620 { // General Purpose Timer
95 compatible = "mpc5200b-gpt\0mpc5200-gpt"; 92 compatible = "mpc5200b-gpt","mpc5200-gpt";
96 device_type = "gpt"; 93 device_type = "gpt";
97 cell-index = <2>; 94 cell-index = <2>;
98 reg = <620 10>; 95 reg = <620 10>;
@@ -101,7 +98,7 @@
101 }; 98 };
102 99
103 gpt@630 { // General Purpose Timer 100 gpt@630 { // General Purpose Timer
104 compatible = "mpc5200b-gpt\0mpc5200-gpt"; 101 compatible = "mpc5200b-gpt","mpc5200-gpt";
105 device_type = "gpt"; 102 device_type = "gpt";
106 cell-index = <3>; 103 cell-index = <3>;
107 reg = <630 10>; 104 reg = <630 10>;
@@ -110,7 +107,7 @@
110 }; 107 };
111 108
112 gpt@640 { // General Purpose Timer 109 gpt@640 { // General Purpose Timer
113 compatible = "mpc5200b-gpt\0mpc5200-gpt"; 110 compatible = "mpc5200b-gpt","mpc5200-gpt";
114 device_type = "gpt"; 111 device_type = "gpt";
115 cell-index = <4>; 112 cell-index = <4>;
116 reg = <640 10>; 113 reg = <640 10>;
@@ -119,7 +116,7 @@
119 }; 116 };
120 117
121 gpt@650 { // General Purpose Timer 118 gpt@650 { // General Purpose Timer
122 compatible = "mpc5200b-gpt\0mpc5200-gpt"; 119 compatible = "mpc5200b-gpt","mpc5200-gpt";
123 device_type = "gpt"; 120 device_type = "gpt";
124 cell-index = <5>; 121 cell-index = <5>;
125 reg = <650 10>; 122 reg = <650 10>;
@@ -128,7 +125,7 @@
128 }; 125 };
129 126
130 gpt@660 { // General Purpose Timer 127 gpt@660 { // General Purpose Timer
131 compatible = "mpc5200b-gpt\0mpc5200-gpt"; 128 compatible = "mpc5200b-gpt","mpc5200-gpt";
132 device_type = "gpt"; 129 device_type = "gpt";
133 cell-index = <6>; 130 cell-index = <6>;
134 reg = <660 10>; 131 reg = <660 10>;
@@ -137,7 +134,7 @@
137 }; 134 };
138 135
139 gpt@670 { // General Purpose Timer 136 gpt@670 { // General Purpose Timer
140 compatible = "mpc5200b-gpt\0mpc5200-gpt"; 137 compatible = "mpc5200b-gpt","mpc5200-gpt";
141 device_type = "gpt"; 138 device_type = "gpt";
142 cell-index = <7>; 139 cell-index = <7>;
143 reg = <670 10>; 140 reg = <670 10>;
@@ -146,7 +143,7 @@
146 }; 143 };
147 144
148 rtc@800 { // Real time clock 145 rtc@800 { // Real time clock
149 compatible = "mpc5200b-rtc\0mpc5200-rtc"; 146 compatible = "mpc5200b-rtc","mpc5200-rtc";
150 device_type = "rtc"; 147 device_type = "rtc";
151 reg = <800 100>; 148 reg = <800 100>;
152 interrupts = <1 5 0 1 6 0>; 149 interrupts = <1 5 0 1 6 0>;
@@ -155,7 +152,7 @@
155 152
156 mscan@900 { 153 mscan@900 {
157 device_type = "mscan"; 154 device_type = "mscan";
158 compatible = "mpc5200b-mscan\0mpc5200-mscan"; 155 compatible = "mpc5200b-mscan","mpc5200-mscan";
159 cell-index = <0>; 156 cell-index = <0>;
160 interrupts = <2 11 0>; 157 interrupts = <2 11 0>;
161 interrupt-parent = <&mpc5200_pic>; 158 interrupt-parent = <&mpc5200_pic>;
@@ -164,7 +161,7 @@
164 161
165 mscan@980 { 162 mscan@980 {
166 device_type = "mscan"; 163 device_type = "mscan";
167 compatible = "mpc5200b-mscan\0mpc5200-mscan"; 164 compatible = "mpc5200b-mscan","mpc5200-mscan";
168 cell-index = <1>; 165 cell-index = <1>;
169 interrupts = <2 12 0>; 166 interrupts = <2 12 0>;
170 interrupt-parent = <&mpc5200_pic>; 167 interrupt-parent = <&mpc5200_pic>;
@@ -172,48 +169,22 @@
172 }; 169 };
173 170
174 gpio@b00 { 171 gpio@b00 {
175 compatible = "mpc5200b-gpio\0mpc5200-gpio"; 172 compatible = "mpc5200b-gpio","mpc5200-gpio";
176 reg = <b00 40>; 173 reg = <b00 40>;
177 interrupts = <1 7 0>; 174 interrupts = <1 7 0>;
178 interrupt-parent = <&mpc5200_pic>; 175 interrupt-parent = <&mpc5200_pic>;
179 }; 176 };
180 177
181 gpio-wkup@c00 { 178 gpio-wkup@c00 {
182 compatible = "mpc5200b-gpio-wkup\0mpc5200-gpio-wkup"; 179 compatible = "mpc5200b-gpio-wkup","mpc5200-gpio-wkup";
183 reg = <c00 40>; 180 reg = <c00 40>;
184 interrupts = <1 8 0 0 3 0>; 181 interrupts = <1 8 0 0 3 0>;
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","mpc5200-spi";
217 reg = <f00 20>; 188 reg = <f00 20>;
218 interrupts = <2 d 0 2 e 0>; 189 interrupts = <2 d 0 2 e 0>;
219 interrupt-parent = <&mpc5200_pic>; 190 interrupt-parent = <&mpc5200_pic>;
@@ -221,7 +192,7 @@
221 192
222 usb@1000 { 193 usb@1000 {
223 device_type = "usb-ohci-be"; 194 device_type = "usb-ohci-be";
224 compatible = "mpc5200b-ohci\0mpc5200-ohci\0ohci-be"; 195 compatible = "mpc5200b-ohci","mpc5200-ohci","ohci-be";
225 reg = <1000 ff>; 196 reg = <1000 ff>;
226 interrupts = <2 6 0>; 197 interrupts = <2 6 0>;
227 interrupt-parent = <&mpc5200_pic>; 198 interrupt-parent = <&mpc5200_pic>;
@@ -229,7 +200,7 @@
229 200
230 bestcomm@1200 { 201 bestcomm@1200 {
231 device_type = "dma-controller"; 202 device_type = "dma-controller";
232 compatible = "mpc5200b-bestcomm\0mpc5200-bestcomm"; 203 compatible = "mpc5200b-bestcomm","mpc5200-bestcomm";
233 reg = <1200 80>; 204 reg = <1200 80>;
234 interrupts = <3 0 0 3 1 0 3 2 0 3 3 0 205 interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
235 3 4 0 3 5 0 3 6 0 3 7 0 206 3 4 0 3 5 0 3 6 0 3 7 0
@@ -239,13 +210,13 @@
239 }; 210 };
240 211
241 xlb@1f00 { 212 xlb@1f00 {
242 compatible = "mpc5200b-xlb\0mpc5200-xlb"; 213 compatible = "mpc5200b-xlb","mpc5200-xlb";
243 reg = <1f00 100>; 214 reg = <1f00 100>;
244 }; 215 };
245 216
246 serial@2000 { // PSC1 217 serial@2000 { // PSC1
247 device_type = "serial"; 218 device_type = "serial";
248 compatible = "mpc5200b-psc-uart\0mpc5200-psc-uart"; 219 compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
249 port-number = <0>; // Logical port assignment 220 port-number = <0>; // Logical port assignment
250 cell-index = <0>; 221 cell-index = <0>;
251 reg = <2000 100>; 222 reg = <2000 100>;
@@ -256,7 +227,7 @@
256 // PSC2 in ac97 mode example 227 // PSC2 in ac97 mode example
257 //ac97@2200 { // PSC2 228 //ac97@2200 { // PSC2
258 // device_type = "sound"; 229 // device_type = "sound";
259 // compatible = "mpc5200b-psc-ac97\0mpc5200-psc-ac97"; 230 // compatible = "mpc5200b-psc-ac97","mpc5200-psc-ac97";
260 // cell-index = <1>; 231 // cell-index = <1>;
261 // reg = <2200 100>; 232 // reg = <2200 100>;
262 // interrupts = <2 2 0>; 233 // interrupts = <2 2 0>;
@@ -276,7 +247,7 @@
276 // PSC4 in uart mode example 247 // PSC4 in uart mode example
277 //serial@2600 { // PSC4 248 //serial@2600 { // PSC4
278 // device_type = "serial"; 249 // device_type = "serial";
279 // compatible = "mpc5200b-psc-uart\0mpc5200-psc-uart"; 250 // compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
280 // cell-index = <3>; 251 // cell-index = <3>;
281 // reg = <2600 100>; 252 // reg = <2600 100>;
282 // interrupts = <2 b 0>; 253 // interrupts = <2 b 0>;
@@ -286,7 +257,7 @@
286 // PSC5 in uart mode example 257 // PSC5 in uart mode example
287 //serial@2800 { // PSC5 258 //serial@2800 { // PSC5
288 // device_type = "serial"; 259 // device_type = "serial";
289 // compatible = "mpc5200b-psc-uart\0mpc5200-psc-uart"; 260 // compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
290 // cell-index = <4>; 261 // cell-index = <4>;
291 // reg = <2800 100>; 262 // reg = <2800 100>;
292 // interrupts = <2 c 0>; 263 // interrupts = <2 c 0>;
@@ -296,7 +267,7 @@
296 // PSC6 in spi mode example 267 // PSC6 in spi mode example
297 //spi@2c00 { // PSC6 268 //spi@2c00 { // PSC6
298 // device_type = "spi"; 269 // device_type = "spi";
299 // compatible = "mpc5200b-psc-spi\0mpc5200-psc-spi"; 270 // compatible = "mpc5200b-psc-spi","mpc5200-psc-spi";
300 // cell-index = <5>; 271 // cell-index = <5>;
301 // reg = <2c00 100>; 272 // reg = <2c00 100>;
302 // interrupts = <2 4 0>; 273 // interrupts = <2 4 0>;
@@ -305,7 +276,7 @@
305 276
306 ethernet@3000 { 277 ethernet@3000 {
307 device_type = "network"; 278 device_type = "network";
308 compatible = "mpc5200b-fec\0mpc5200-fec"; 279 compatible = "mpc5200b-fec","mpc5200-fec";
309 reg = <3000 800>; 280 reg = <3000 800>;
310 mac-address = [ 02 03 04 05 06 07 ]; // Bad! 281 mac-address = [ 02 03 04 05 06 07 ]; // Bad!
311 interrupts = <2 5 0>; 282 interrupts = <2 5 0>;
@@ -314,7 +285,7 @@
314 285
315 ata@3a00 { 286 ata@3a00 {
316 device_type = "ata"; 287 device_type = "ata";
317 compatible = "mpc5200b-ata\0mpc5200-ata"; 288 compatible = "mpc5200b-ata","mpc5200-ata";
318 reg = <3a00 100>; 289 reg = <3a00 100>;
319 interrupts = <2 7 0>; 290 interrupts = <2 7 0>;
320 interrupt-parent = <&mpc5200_pic>; 291 interrupt-parent = <&mpc5200_pic>;
@@ -322,7 +293,7 @@
322 293
323 i2c@3d00 { 294 i2c@3d00 {
324 device_type = "i2c"; 295 device_type = "i2c";
325 compatible = "mpc5200b-i2c\0mpc5200-i2c\0fsl-i2c"; 296 compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
326 cell-index = <0>; 297 cell-index = <0>;
327 reg = <3d00 40>; 298 reg = <3d00 40>;
328 interrupts = <2 f 0>; 299 interrupts = <2 f 0>;
@@ -332,7 +303,7 @@
332 303
333 i2c@3d40 { 304 i2c@3d40 {
334 device_type = "i2c"; 305 device_type = "i2c";
335 compatible = "mpc5200b-i2c\0mpc5200-i2c\0fsl-i2c"; 306 compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
336 cell-index = <1>; 307 cell-index = <1>;
337 reg = <3d40 40>; 308 reg = <3d40 40>;
338 interrupts = <2 10 0>; 309 interrupts = <2 10 0>;
@@ -341,8 +312,34 @@
341 }; 312 };
342 sram@8000 { 313 sram@8000 {
343 device_type = "sram"; 314 device_type = "sram";
344 compatible = "mpc5200b-sram\0mpc5200-sram\0sram"; 315 compatible = "mpc5200b-sram","mpc5200-sram","sram";
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","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 // 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..8fb542387436 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>;
@@ -80,6 +78,7 @@
80 }; 78 };
81 79
82 ethernet@6200 { 80 ethernet@6200 {
81 linux,network-index = <0>;
83 #size-cells = <0>; 82 #size-cells = <0>;
84 device_type = "network"; 83 device_type = "network";
85 compatible = "tsi108-ethernet"; 84 compatible = "tsi108-ethernet";
@@ -92,6 +91,7 @@
92 }; 91 };
93 92
94 ethernet@6600 { 93 ethernet@6600 {
94 linux,network-index = <1>;
95 #address-cells = <1>; 95 #address-cells = <1>;
96 #size-cells = <0>; 96 #size-cells = <0>;
97 device_type = "network"; 97 device_type = "network";
@@ -128,7 +128,6 @@
128 #address-cells = <0>; 128 #address-cells = <0>;
129 #interrupt-cells = <2>; 129 #interrupt-cells = <2>;
130 reg = <7400 400>; 130 reg = <7400 400>;
131 built-in;
132 compatible = "chrp,open-pic"; 131 compatible = "chrp,open-pic";
133 device_type = "open-pic"; 132 device_type = "open-pic";
134 big-endian; 133 big-endian;
@@ -180,12 +179,14 @@
180 device_type = "pic-router"; 179 device_type = "pic-router";
181 #address-cells = <0>; 180 #address-cells = <0>;
182 #interrupt-cells = <2>; 181 #interrupt-cells = <2>;
183 built-in;
184 big-endian; 182 big-endian;
185 interrupts = <17 2>; 183 interrupts = <17 2>;
186 interrupt-parent = <&mpic>; 184 interrupt-parent = <&mpic>;
187 }; 185 };
188 }; 186 };
189 }; 187 };
188 chosen {
189 linux,stdout-path = "/tsi108@c0000000/serial@7808";
190 };
190 191
191}; 192};
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/boot/dts/mpc8272ads.dts
index 1934b800278e..7285ca1325fd 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -10,207 +10,240 @@
10 */ 10 */
11 11
12/ { 12/ {
13 model = "MPC8272ADS"; 13 model = "MPC8272ADS";
14 compatible = "MPC8260ADS"; 14 compatible = "fsl,mpc8272ads";
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 = <d#32>;
26 i-cache-line-size = <20>; // 32 bytes 26 i-cache-line-size = <d#32>;
27 d-cache-size = <4000>; // L1, 16K 27 d-cache-size = <d#16384>;
28 i-cache-size = <4000>; // L1, 16K 28 i-cache-size = <d#16384>;
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 memory {
36 pci_pic: interrupt-controller@f8200000 { 36 device_type = "memory";
37 #address-cells = <0>; 37 reg = <0 0>;
38 #interrupt-cells = <2>; 38 };
39 interrupt-controller; 39
40 reg = <f8200000 f8200004>; 40 localbus@f0010100 {
41 built-in; 41 compatible = "fsl,mpc8272-localbus",
42 device_type = "pci-pic"; 42 "fsl,pq2-localbus";
43 }; 43 #address-cells = <2>;
44 memory { 44 #size-cells = <1>;
45 device_type = "memory"; 45 reg = <f0010100 40>;
46 reg = <00000000 4000000 f4500000 00000020>; 46
47 }; 47 ranges = <0 0 fe000000 02000000
48 48 1 0 f4500000 00008000
49 chosen { 49 3 0 f8200000 00008000>;
50 name = "chosen"; 50
51 linux,platform = <0>; 51 flash@0,0 {
52 interrupt-controller = <&Cpm_pic>; 52 compatible = "jedec-flash";
53 }; 53 reg = <0 0 2000000>;
54 54 bank-width = <4>;
55 soc8272@f0000000 { 55 device-width = <1>;
56 #address-cells = <1>; 56 };
57 #size-cells = <1>; 57
58 #interrupt-cells = <2>; 58 board-control@1,0 {
59 device_type = "soc"; 59 reg = <1 0 20>;
60 ranges = <00000000 f0000000 00053000>; 60 compatible = "fsl,mpc8272ads-bcsr";
61 reg = <f0000000 10000>; 61 };
62 62
63 mdio@0 { 63 PCI_PIC: interrupt-controller@3,0 {
64 device_type = "mdio"; 64 compatible = "fsl,mpc8272ads-pci-pic",
65 compatible = "fs_enet"; 65 "fsl,pq2ads-pci-pic";
66 reg = <0 0>; 66 #interrupt-cells = <1>;
67 #address-cells = <1>; 67 interrupt-controller;
68 #size-cells = <0>; 68 reg = <3 0 8>;
69 phy0:ethernet-phy@0 { 69 interrupt-parent = <&PIC>;
70 interrupt-parent = <&Cpm_pic>; 70 interrupts = <14 8>;
71 interrupts = <17 4>; 71 };
72 reg = <0>; 72 };
73 bitbang = [ 12 12 13 02 02 01 ]; 73
74 device_type = "ethernet-phy"; 74
75 }; 75 pci@f0010800 {
76 phy1:ethernet-phy@1 { 76 device_type = "pci";
77 interrupt-parent = <&Cpm_pic>; 77 reg = <f0010800 10c f00101ac 8 f00101c4 8>;
78 interrupts = <17 4>; 78 compatible = "fsl,mpc8272-pci", "fsl,pq2-pci";
79 bitbang = [ 12 12 13 02 02 01 ]; 79 #interrupt-cells = <1>;
80 reg = <3>; 80 #size-cells = <2>;
81 device_type = "ethernet-phy"; 81 #address-cells = <3>;
82 }; 82 clock-frequency = <d#66666666>;
83 }; 83 interrupt-map-mask = <f800 0 0 7>;
84 84 interrupt-map = <
85 ethernet@24000 { 85 /* IDSEL 0x16 */
86 #address-cells = <1>; 86 b000 0 0 1 &PCI_PIC 0
87 #size-cells = <0>; 87 b000 0 0 2 &PCI_PIC 1
88 device_type = "network"; 88 b000 0 0 3 &PCI_PIC 2
89 device-id = <1>; 89 b000 0 0 4 &PCI_PIC 3
90 compatible = "fs_enet"; 90
91 model = "FCC"; 91 /* IDSEL 0x17 */
92 reg = <11300 20 8400 100 11380 30>; 92 b800 0 0 1 &PCI_PIC 4
93 mac-address = [ 00 11 2F 99 43 54 ]; 93 b800 0 0 2 &PCI_PIC 5
94 interrupts = <20 2>; 94 b800 0 0 3 &PCI_PIC 6
95 interrupt-parent = <&Cpm_pic>; 95 b800 0 0 4 &PCI_PIC 7
96 phy-handle = <&Phy0>; 96
97 rx-clock = <13>; 97 /* IDSEL 0x18 */
98 tx-clock = <12>; 98 c000 0 0 1 &PCI_PIC 8
99 }; 99 c000 0 0 2 &PCI_PIC 9
100 100 c000 0 0 3 &PCI_PIC a
101 ethernet@25000 { 101 c000 0 0 4 &PCI_PIC b>;
102 device_type = "network"; 102
103 device-id = <2>; 103 interrupt-parent = <&PIC>;
104 compatible = "fs_enet"; 104 interrupts = <12 8>;
105 model = "FCC"; 105 ranges = <42000000 0 80000000 80000000 0 20000000
106 reg = <11320 20 8500 100 113b0 30>; 106 02000000 0 a0000000 a0000000 0 20000000
107 mac-address = [ 00 11 2F 99 44 54 ]; 107 01000000 0 00000000 f6000000 0 02000000>;
108 interrupts = <21 2>; 108 };
109 interrupt-parent = <&Cpm_pic>; 109
110 phy-handle = <&Phy1>; 110 soc@f0000000 {
111 rx-clock = <17>; 111 #address-cells = <1>;
112 tx-clock = <18>; 112 #size-cells = <1>;
113 }; 113 device_type = "soc";
114 114 compatible = "fsl,mpc8272", "fsl,pq2-soc";
115 cpm@f0000000 { 115 ranges = <00000000 f0000000 00053000>;
116 #address-cells = <1>; 116
117 #size-cells = <1>; 117 // Temporary -- will go away once kernel uses ranges for get_immrbase().
118 #interrupt-cells = <2>; 118 reg = <f0000000 00053000>;
119 device_type = "cpm"; 119
120 model = "CPM2"; 120 cpm@119c0 {
121 ranges = <00000000 00000000 20000>; 121 #address-cells = <1>;
122 reg = <0 20000>; 122 #size-cells = <1>;
123 command-proc = <119c0>; 123 compatible = "fsl,mpc8272-cpm", "fsl,cpm2";
124 brg-frequency = <17D7840>; 124 reg = <119c0 30>;
125 cpm_clk = <BEBC200>; 125 ranges;
126 126
127 scc@11a00 { 127 muram@0 {
128 device_type = "serial"; 128 #address-cells = <1>;
129 compatible = "cpm_uart"; 129 #size-cells = <1>;
130 model = "SCC"; 130 ranges = <0 0 10000>;
131 device-id = <1>; 131
132 reg = <11a00 20 8000 100>; 132 data@0 {
133 current-speed = <1c200>; 133 compatible = "fsl,cpm-muram-data";
134 interrupts = <28 2>; 134 reg = <0 2000 9800 800>;
135 interrupt-parent = <&Cpm_pic>; 135 };
136 clock-setup = <0 00ffffff>; 136 };
137 rx-clock = <1>; 137
138 tx-clock = <1>; 138 brg@119f0 {
139 }; 139 compatible = "fsl,mpc8272-brg",
140 140 "fsl,cpm2-brg",
141 scc@11a60 { 141 "fsl,cpm-brg";
142 device_type = "serial"; 142 reg = <119f0 10 115f0 10>;
143 compatible = "cpm_uart"; 143 };
144 model = "SCC"; 144
145 device-id = <4>; 145 serial@11a00 {
146 reg = <11a60 20 8300 100>; 146 device_type = "serial";
147 current-speed = <1c200>; 147 compatible = "fsl,mpc8272-scc-uart",
148 interrupts = <2b 2>; 148 "fsl,cpm2-scc-uart";
149 interrupt-parent = <&Cpm_pic>; 149 reg = <11a00 20 8000 100>;
150 clock-setup = <1b ffffff00>; 150 interrupts = <28 8>;
151 rx-clock = <4>; 151 interrupt-parent = <&PIC>;
152 tx-clock = <4>; 152 fsl,cpm-brg = <1>;
153 }; 153 fsl,cpm-command = <00800000>;
154 154 };
155 }; 155
156 cpm_pic:interrupt-controller@10c00 { 156 serial@11a60 {
157 #address-cells = <0>; 157 device_type = "serial";
158 #interrupt-cells = <2>; 158 compatible = "fsl,mpc8272-scc-uart",
159 interrupt-controller; 159 "fsl,cpm2-scc-uart";
160 reg = <10c00 80>; 160 reg = <11a60 20 8300 100>;
161 built-in; 161 interrupts = <2b 8>;
162 device_type = "cpm-pic"; 162 interrupt-parent = <&PIC>;
163 compatible = "CPM2"; 163 fsl,cpm-brg = <4>;
164 }; 164 fsl,cpm-command = <0ce00000>;
165 pci@0500 { 165 };
166 #interrupt-cells = <1>; 166
167 #size-cells = <2>; 167 mdio@10d40 {
168 #address-cells = <3>; 168 device_type = "mdio";
169 compatible = "8272"; 169 compatible = "fsl,mpc8272ads-mdio-bitbang",
170 device_type = "pci"; 170 "fsl,mpc8272-mdio-bitbang",
171 reg = <10430 4dc>; 171 "fsl,cpm2-mdio-bitbang";
172 clock-frequency = <3f940aa>; 172 reg = <10d40 14>;
173 interrupt-map-mask = <f800 0 0 7>; 173 #address-cells = <1>;
174 interrupt-map = < 174 #size-cells = <0>;
175 175 fsl,mdio-pin = <12>;
176 /* IDSEL 0x16 */ 176 fsl,mdc-pin = <13>;
177 b000 0 0 1 f8200000 40 8 177
178 b000 0 0 2 f8200000 41 8 178 PHY0: ethernet-phy@0 {
179 b000 0 0 3 f8200000 42 8 179 interrupt-parent = <&PIC>;
180 b000 0 0 4 f8200000 43 8 180 interrupts = <17 8>;
181 181 reg = <0>;
182 /* IDSEL 0x17 */ 182 device_type = "ethernet-phy";
183 b800 0 0 1 f8200000 43 8 183 };
184 b800 0 0 2 f8200000 40 8 184
185 b800 0 0 3 f8200000 41 8 185 PHY1: ethernet-phy@1 {
186 b800 0 0 4 f8200000 42 8 186 interrupt-parent = <&PIC>;
187 187 interrupts = <17 8>;
188 /* IDSEL 0x18 */ 188 reg = <3>;
189 c000 0 0 1 f8200000 42 8 189 device_type = "ethernet-phy";
190 c000 0 0 2 f8200000 43 8 190 };
191 c000 0 0 3 f8200000 40 8 191 };
192 c000 0 0 4 f8200000 41 8>; 192
193 interrupt-parent = <&Cpm_pic>; 193 ethernet@11300 {
194 interrupts = <14 8>; 194 device_type = "network";
195 bus-range = <0 0>; 195 compatible = "fsl,mpc8272-fcc-enet",
196 ranges = <02000000 0 80000000 80000000 0 40000000 196 "fsl,cpm2-fcc-enet";
197 01000000 0 00000000 f6000000 0 02000000>; 197 reg = <11300 20 8400 100 11390 1>;
198 }; 198 local-mac-address = [ 00 00 00 00 00 00 ];
199 interrupts = <20 8>;
200 interrupt-parent = <&PIC>;
201 phy-handle = <&PHY0>;
202 linux,network-index = <0>;
203 fsl,cpm-command = <12000300>;
204 };
205
206 ethernet@11320 {
207 device_type = "network";
208 compatible = "fsl,mpc8272-fcc-enet",
209 "fsl,cpm2-fcc-enet";
210 reg = <11320 20 8500 100 113b0 1>;
211 local-mac-address = [ 00 00 00 00 00 00 ];
212 interrupts = <21 8>;
213 interrupt-parent = <&PIC>;
214 phy-handle = <&PHY1>;
215 linux,network-index = <1>;
216 fsl,cpm-command = <16200300>;
217 };
218 };
219
220 PIC: interrupt-controller@10c00 {
221 #interrupt-cells = <2>;
222 interrupt-controller;
223 reg = <10c00 80>;
224 compatible = "fsl,mpc8272-pic", "fsl,cpm2-pic";
225 };
199 226
200/* May need to remove if on a part without crypto engine */ 227/* May need to remove if on a part without crypto engine */
201 crypto@30000 { 228 crypto@30000 {
202 device_type = "crypto"; 229 device_type = "crypto";
203 model = "SEC2"; 230 model = "SEC2";
204 compatible = "talitos"; 231 compatible = "fsl,mpc8272-talitos-sec2",
205 reg = <30000 10000>; 232 "fsl,talitos-sec2",
206 interrupts = <b 2>; 233 "fsl,talitos",
207 interrupt-parent = <&Cpm_pic>; 234 "talitos";
208 num-channels = <4>; 235 reg = <30000 10000>;
209 channel-fifo-len = <18>; 236 interrupts = <b 8>;
210 exec-units-mask = <0000007e>; 237 interrupt-parent = <&PIC>;
238 num-channels = <4>;
239 channel-fifo-len = <18>;
240 exec-units-mask = <0000007e>;
211/* desc mask is for rev1.x, we need runtime fixup for >=2.x */ 241/* desc mask is for rev1.x, we need runtime fixup for >=2.x */
212 descriptor-types-mask = <01010ebf>; 242 descriptor-types-mask = <01010ebf>;
213 }; 243 };
244 };
214 245
215 }; 246 chosen {
247 linux,stdout-path = "/soc/cpm/serial@11a00";
248 };
216}; 249};
diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
index c5adbe40364e..9e7eba973262 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>;
@@ -73,11 +71,11 @@
73 71
74 spi@7000 { 72 spi@7000 {
75 device_type = "spi"; 73 device_type = "spi";
76 compatible = "mpc83xx_spi"; 74 compatible = "fsl_spi";
77 reg = <7000 1000>; 75 reg = <7000 1000>;
78 interrupts = <10 8>; 76 interrupts = <10 8>;
79 interrupt-parent = < &ipic >; 77 interrupt-parent = < &ipic >;
80 mode = <0>; 78 mode = "cpu";
81 }; 79 };
82 80
83 /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */ 81 /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
@@ -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..5072f6d0a46d 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>;
@@ -72,11 +70,11 @@
72 70
73 spi@7000 { 71 spi@7000 {
74 device_type = "spi"; 72 device_type = "spi";
75 compatible = "mpc83xx_spi"; 73 compatible = "fsl_spi";
76 reg = <7000 1000>; 74 reg = <7000 1000>;
77 interrupts = <10 8>; 75 interrupts = <10 8>;
78 interrupt-parent = < &ipic >; 76 interrupt-parent = < &ipic >;
79 mode = <0>; 77 mode = "cpu";
80 }; 78 };
81 79
82 usb@22000 { 80 usb@22000 {
@@ -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..074f7a2ab7e4 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>;
@@ -72,11 +70,11 @@
72 70
73 spi@7000 { 71 spi@7000 {
74 device_type = "spi"; 72 device_type = "spi";
75 compatible = "mpc83xx_spi"; 73 compatible = "fsl_spi";
76 reg = <7000 1000>; 74 reg = <7000 1000>;
77 interrupts = <10 8>; 75 interrupts = <10 8>;
78 interrupt-parent = < &ipic >; 76 interrupt-parent = < &ipic >;
79 mode = <0>; 77 mode = "cpu";
80 }; 78 };
81 79
82 usb@23000 { 80 usb@23000 {
@@ -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..e5a84ef9f4b0 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>;
@@ -78,11 +76,11 @@
78 76
79 spi@7000 { 77 spi@7000 {
80 device_type = "spi"; 78 device_type = "spi";
81 compatible = "mpc83xx_spi"; 79 compatible = "fsl_spi";
82 reg = <7000 1000>; 80 reg = <7000 1000>;
83 interrupts = <10 8>; 81 interrupts = <10 8>;
84 interrupt-parent = < &ipic >; 82 interrupt-parent = < &ipic >;
85 mode = <0>; 83 mode = "cpu";
86 }; 84 };
87 85
88 /* phy type (ULPI or SERIAL) are only types supportted for MPH */ 86 /* phy type (ULPI or SERIAL) are only types supportted for MPH */
@@ -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..f3f4d79deb63 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,145 @@
137 interrupt-parent = <&mpic>; 135 interrupt-parent = <&mpic>;
138 }; 136 };
139 137
140 pci1: pci@8000 { 138 mpic: pic@40000 {
141 interrupt-map-mask = <1f800 0 0 7>; 139 clock-frequency = <0>;
142 interrupt-map = < 140 interrupt-controller;
143 141 #address-cells = <0>;
144 /* IDSEL 0x10 */ 142 #interrupt-cells = <2>;
145 08000 0 0 1 &mpic 0 1 143 reg = <40000 40000>;
146 08000 0 0 2 &mpic 1 1 144 compatible = "chrp,open-pic";
147 08000 0 0 3 &mpic 2 1 145 device_type = "open-pic";
148 08000 0 0 4 &mpic 3 1 146 big-endian;
149 147 };
150 /* IDSEL 0x11 */ 148
151 08800 0 0 1 &mpic 0 1 149 cpm@919c0 {
152 08800 0 0 2 &mpic 1 1 150 #address-cells = <1>;
153 08800 0 0 3 &mpic 2 1 151 #size-cells = <1>;
154 08800 0 0 4 &mpic 3 1 152 compatible = "fsl,mpc8541-cpm", "fsl,cpm2";
155 153 reg = <919c0 30>;
156 /* IDSEL 0x12 (Slot 1) */ 154 ranges;
157 09000 0 0 1 &mpic 0 1 155
158 09000 0 0 2 &mpic 1 1 156 muram@80000 {
159 09000 0 0 3 &mpic 2 1 157 #address-cells = <1>;
160 09000 0 0 4 &mpic 3 1 158 #size-cells = <1>;
161 159 ranges = <0 80000 10000>;
162 /* IDSEL 0x13 (Slot 2) */ 160
163 09800 0 0 1 &mpic 1 1 161 data@0 {
164 09800 0 0 2 &mpic 2 1 162 compatible = "fsl,cpm-muram-data";
165 09800 0 0 3 &mpic 3 1 163 reg = <0 2000 9000 1000>;
166 09800 0 0 4 &mpic 0 1 164 };
167 165 };
168 /* IDSEL 0x14 (Slot 3) */ 166
169 0a000 0 0 1 &mpic 2 1 167 brg@919f0 {
170 0a000 0 0 2 &mpic 3 1 168 compatible = "fsl,mpc8541-brg",
171 0a000 0 0 3 &mpic 0 1 169 "fsl,cpm2-brg",
172 0a000 0 0 4 &mpic 1 1 170 "fsl,cpm-brg";
173 171 reg = <919f0 10 915f0 10>;
174 /* IDSEL 0x15 (Slot 4) */ 172 };
175 0a800 0 0 1 &mpic 3 1 173
176 0a800 0 0 2 &mpic 0 1 174 cpmpic: pic@90c00 {
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; 175 interrupt-controller;
202 device_type = "interrupt-controller";
203 reg = <19000 0 0 0 1>;
204 #address-cells = <0>; 176 #address-cells = <0>;
205 #interrupt-cells = <2>; 177 #interrupt-cells = <2>;
206 built-in; 178 interrupts = <2e 2>;
207 compatible = "chrp,iic"; 179 interrupt-parent = <&mpic>;
208 big-endian; 180 reg = <90c00 80>;
209 interrupts = <1>; 181 compatible = "fsl,mpc8541-cpm-pic", "fsl,cpm2-pic";
210 interrupt-parent = <&pci1>;
211 }; 182 };
212 }; 183 };
184 };
213 185
214 pci@9000 { 186 pci1: pci@e0008000 {
215 interrupt-map-mask = <f800 0 0 7>; 187 interrupt-map-mask = <1f800 0 0 7>;
216 interrupt-map = < 188 interrupt-map = <
217 189
218 /* IDSEL 0x15 */ 190 /* IDSEL 0x10 */
219 a800 0 0 1 &mpic b 1 191 08000 0 0 1 &mpic 0 1
220 a800 0 0 2 &mpic b 1 192 08000 0 0 2 &mpic 1 1
221 a800 0 0 3 &mpic b 1 193 08000 0 0 3 &mpic 2 1
222 a800 0 0 4 &mpic b 1>; 194 08000 0 0 4 &mpic 3 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 195
237 mpic: pic@40000 { 196 /* IDSEL 0x11 */
238 clock-frequency = <0>; 197 08800 0 0 1 &mpic 0 1
198 08800 0 0 2 &mpic 1 1
199 08800 0 0 3 &mpic 2 1
200 08800 0 0 4 &mpic 3 1
201
202 /* IDSEL 0x12 (Slot 1) */
203 09000 0 0 1 &mpic 0 1
204 09000 0 0 2 &mpic 1 1
205 09000 0 0 3 &mpic 2 1
206 09000 0 0 4 &mpic 3 1
207
208 /* IDSEL 0x13 (Slot 2) */
209 09800 0 0 1 &mpic 1 1
210 09800 0 0 2 &mpic 2 1
211 09800 0 0 3 &mpic 3 1
212 09800 0 0 4 &mpic 0 1
213
214 /* IDSEL 0x14 (Slot 3) */
215 0a000 0 0 1 &mpic 2 1
216 0a000 0 0 2 &mpic 3 1
217 0a000 0 0 3 &mpic 0 1
218 0a000 0 0 4 &mpic 1 1
219
220 /* IDSEL 0x15 (Slot 4) */
221 0a800 0 0 1 &mpic 3 1
222 0a800 0 0 2 &mpic 0 1
223 0a800 0 0 3 &mpic 1 1
224 0a800 0 0 4 &mpic 2 1
225
226 /* Bus 1 (Tundra Bridge) */
227 /* IDSEL 0x12 (ISA bridge) */
228 19000 0 0 1 &mpic 0 1
229 19000 0 0 2 &mpic 1 1
230 19000 0 0 3 &mpic 2 1
231 19000 0 0 4 &mpic 3 1>;
232 interrupt-parent = <&mpic>;
233 interrupts = <18 2>;
234 bus-range = <0 0>;
235 ranges = <02000000 0 80000000 80000000 0 20000000
236 01000000 0 00000000 e2000000 0 00100000>;
237 clock-frequency = <3f940aa>;
238 #interrupt-cells = <1>;
239 #size-cells = <2>;
240 #address-cells = <3>;
241 reg = <e0008000 1000>;
242 compatible = "fsl,mpc8540-pci";
243 device_type = "pci";
244
245 i8259@19000 {
239 interrupt-controller; 246 interrupt-controller;
247 device_type = "interrupt-controller";
248 reg = <19000 0 0 0 1>;
240 #address-cells = <0>; 249 #address-cells = <0>;
241 #interrupt-cells = <2>; 250 #interrupt-cells = <2>;
242 reg = <40000 40000>; 251 compatible = "chrp,iic";
243 built-in; 252 interrupts = <1>;
244 compatible = "chrp,open-pic"; 253 interrupt-parent = <&pci1>;
245 device_type = "open-pic";
246 big-endian;
247 }; 254 };
248 }; 255 };
256
257 pci@e0009000 {
258 interrupt-map-mask = <f800 0 0 7>;
259 interrupt-map = <
260
261 /* IDSEL 0x15 */
262 a800 0 0 1 &mpic b 1
263 a800 0 0 2 &mpic b 1
264 a800 0 0 3 &mpic b 1
265 a800 0 0 4 &mpic b 1>;
266 interrupt-parent = <&mpic>;
267 interrupts = <19 2>;
268 bus-range = <0 0>;
269 ranges = <02000000 0 a0000000 a0000000 0 20000000
270 01000000 0 00000000 e3000000 0 00100000>;
271 clock-frequency = <3f940aa>;
272 #interrupt-cells = <1>;
273 #size-cells = <2>;
274 #address-cells = <3>;
275 reg = <e0009000 1000>;
276 compatible = "fsl,mpc8540-pci";
277 device_type = "pci";
278 };
249}; 279};
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..57029cca32b2 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,145 @@
137 interrupt-parent = <&mpic>; 135 interrupt-parent = <&mpic>;
138 }; 136 };
139 137
140 pci1: pci@8000 { 138 mpic: pic@40000 {
141 interrupt-map-mask = <1f800 0 0 7>; 139 clock-frequency = <0>;
142 interrupt-map = < 140 interrupt-controller;
143 141 #address-cells = <0>;
144 /* IDSEL 0x10 */ 142 #interrupt-cells = <2>;
145 08000 0 0 1 &mpic 0 1 143 reg = <40000 40000>;
146 08000 0 0 2 &mpic 1 1 144 compatible = "chrp,open-pic";
147 08000 0 0 3 &mpic 2 1 145 device_type = "open-pic";
148 08000 0 0 4 &mpic 3 1 146 big-endian;
149 147 };
150 /* IDSEL 0x11 */ 148
151 08800 0 0 1 &mpic 0 1 149 cpm@919c0 {
152 08800 0 0 2 &mpic 1 1 150 #address-cells = <1>;
153 08800 0 0 3 &mpic 2 1 151 #size-cells = <1>;
154 08800 0 0 4 &mpic 3 1 152 compatible = "fsl,mpc8555-cpm", "fsl,cpm2";
155 153 reg = <919c0 30>;
156 /* IDSEL 0x12 (Slot 1) */ 154 ranges;
157 09000 0 0 1 &mpic 0 1 155
158 09000 0 0 2 &mpic 1 1 156 muram@80000 {
159 09000 0 0 3 &mpic 2 1 157 #address-cells = <1>;
160 09000 0 0 4 &mpic 3 1 158 #size-cells = <1>;
161 159 ranges = <0 80000 10000>;
162 /* IDSEL 0x13 (Slot 2) */ 160
163 09800 0 0 1 &mpic 1 1 161 data@0 {
164 09800 0 0 2 &mpic 2 1 162 compatible = "fsl,cpm-muram-data";
165 09800 0 0 3 &mpic 3 1 163 reg = <0 2000 9000 1000>;
166 09800 0 0 4 &mpic 0 1 164 };
167 165 };
168 /* IDSEL 0x14 (Slot 3) */ 166
169 0a000 0 0 1 &mpic 2 1 167 brg@919f0 {
170 0a000 0 0 2 &mpic 3 1 168 compatible = "fsl,mpc8555-brg",
171 0a000 0 0 3 &mpic 0 1 169 "fsl,cpm2-brg",
172 0a000 0 0 4 &mpic 1 1 170 "fsl,cpm-brg";
173 171 reg = <919f0 10 915f0 10>;
174 /* IDSEL 0x15 (Slot 4) */ 172 };
175 0a800 0 0 1 &mpic 3 1 173
176 0a800 0 0 2 &mpic 0 1 174 cpmpic: pic@90c00 {
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; 175 interrupt-controller;
202 device_type = "interrupt-controller";
203 reg = <19000 0 0 0 1>;
204 #address-cells = <0>; 176 #address-cells = <0>;
205 #interrupt-cells = <2>; 177 #interrupt-cells = <2>;
206 built-in; 178 interrupts = <2e 2>;
207 compatible = "chrp,iic"; 179 interrupt-parent = <&mpic>;
208 big-endian; 180 reg = <90c00 80>;
209 interrupts = <1>; 181 compatible = "fsl,mpc8555-cpm-pic", "fsl,cpm2-pic";
210 interrupt-parent = <&pci1>;
211 }; 182 };
212 }; 183 };
184 };
213 185
214 pci@9000 { 186 pci1: pci@e0008000 {
215 interrupt-map-mask = <f800 0 0 7>; 187 interrupt-map-mask = <1f800 0 0 7>;
216 interrupt-map = < 188 interrupt-map = <
217 189
218 /* IDSEL 0x15 */ 190 /* IDSEL 0x10 */
219 a800 0 0 1 &mpic b 1 191 08000 0 0 1 &mpic 0 1
220 a800 0 0 2 &mpic b 1 192 08000 0 0 2 &mpic 1 1
221 a800 0 0 3 &mpic b 1 193 08000 0 0 3 &mpic 2 1
222 a800 0 0 4 &mpic b 1>; 194 08000 0 0 4 &mpic 3 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 195
237 mpic: pic@40000 { 196 /* IDSEL 0x11 */
238 clock-frequency = <0>; 197 08800 0 0 1 &mpic 0 1
198 08800 0 0 2 &mpic 1 1
199 08800 0 0 3 &mpic 2 1
200 08800 0 0 4 &mpic 3 1
201
202 /* IDSEL 0x12 (Slot 1) */
203 09000 0 0 1 &mpic 0 1
204 09000 0 0 2 &mpic 1 1
205 09000 0 0 3 &mpic 2 1
206 09000 0 0 4 &mpic 3 1
207
208 /* IDSEL 0x13 (Slot 2) */
209 09800 0 0 1 &mpic 1 1
210 09800 0 0 2 &mpic 2 1
211 09800 0 0 3 &mpic 3 1
212 09800 0 0 4 &mpic 0 1
213
214 /* IDSEL 0x14 (Slot 3) */
215 0a000 0 0 1 &mpic 2 1
216 0a000 0 0 2 &mpic 3 1
217 0a000 0 0 3 &mpic 0 1
218 0a000 0 0 4 &mpic 1 1
219
220 /* IDSEL 0x15 (Slot 4) */
221 0a800 0 0 1 &mpic 3 1
222 0a800 0 0 2 &mpic 0 1
223 0a800 0 0 3 &mpic 1 1
224 0a800 0 0 4 &mpic 2 1
225
226 /* Bus 1 (Tundra Bridge) */
227 /* IDSEL 0x12 (ISA bridge) */
228 19000 0 0 1 &mpic 0 1
229 19000 0 0 2 &mpic 1 1
230 19000 0 0 3 &mpic 2 1
231 19000 0 0 4 &mpic 3 1>;
232 interrupt-parent = <&mpic>;
233 interrupts = <18 2>;
234 bus-range = <0 0>;
235 ranges = <02000000 0 80000000 80000000 0 20000000
236 01000000 0 00000000 e2000000 0 00100000>;
237 clock-frequency = <3f940aa>;
238 #interrupt-cells = <1>;
239 #size-cells = <2>;
240 #address-cells = <3>;
241 reg = <e0008000 1000>;
242 compatible = "fsl,mpc8540-pci";
243 device_type = "pci";
244
245 i8259@19000 {
239 interrupt-controller; 246 interrupt-controller;
247 device_type = "interrupt-controller";
248 reg = <19000 0 0 0 1>;
240 #address-cells = <0>; 249 #address-cells = <0>;
241 #interrupt-cells = <2>; 250 #interrupt-cells = <2>;
242 reg = <40000 40000>; 251 compatible = "chrp,iic";
243 built-in; 252 interrupts = <1>;
244 compatible = "chrp,open-pic"; 253 interrupt-parent = <&pci1>;
245 device_type = "open-pic";
246 big-endian;
247 }; 254 };
248 }; 255 };
256
257 pci@e0009000 {
258 interrupt-map-mask = <f800 0 0 7>;
259 interrupt-map = <
260
261 /* IDSEL 0x15 */
262 a800 0 0 1 &mpic b 1
263 a800 0 0 2 &mpic b 1
264 a800 0 0 3 &mpic b 1
265 a800 0 0 4 &mpic b 1>;
266 interrupt-parent = <&mpic>;
267 interrupts = <19 2>;
268 bus-range = <0 0>;
269 ranges = <02000000 0 a0000000 a0000000 0 20000000
270 01000000 0 00000000 e3000000 0 00100000>;
271 clock-frequency = <3f940aa>;
272 #interrupt-cells = <1>;
273 #size-cells = <2>;
274 #address-cells = <3>;
275 reg = <e0009000 1000>;
276 compatible = "fsl,mpc8540-pci";
277 device_type = "pci";
278 };
249}; 279};
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index 16dbe848cecf..6b362f8222c1 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,115 +130,39 @@
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@919c0 {
235 #address-cells = <1>; 142 #address-cells = <1>;
236 #size-cells = <1>; 143 #size-cells = <1>;
237 #interrupt-cells = <2>; 144 compatible = "fsl,mpc8560-cpm", "fsl,cpm2";
238 device_type = "cpm"; 145 reg = <919c0 30>;
239 model = "CPM2"; 146 ranges;
240 ranges = <0 0 c0000>; 147
241 reg = <80000 40000>; 148 muram@80000 {
242 command-proc = <919c0>; 149 #address-cells = <1>;
243 brg-frequency = <9d5b340>; 150 #size-cells = <1>;
151 ranges = <0 80000 10000>;
152
153 data@0 {
154 compatible = "fsl,cpm-muram-data";
155 reg = <0 4000 9000 2000>;
156 };
157 };
158
159 brg@919f0 {
160 compatible = "fsl,mpc8560-brg",
161 "fsl,cpm2-brg",
162 "fsl,cpm-brg";
163 reg = <919f0 10 915f0 10>;
164 clock-frequency = <d#165000000>;
165 };
244 166
245 cpmpic: pic@90c00 { 167 cpmpic: pic@90c00 {
246 interrupt-controller; 168 interrupt-controller;
@@ -249,44 +171,38 @@
249 interrupts = <2e 2>; 171 interrupts = <2e 2>;
250 interrupt-parent = <&mpic>; 172 interrupt-parent = <&mpic>;
251 reg = <90c00 80>; 173 reg = <90c00 80>;
252 built-in; 174 compatible = "fsl,mpc8560-cpm-pic", "fsl,cpm2-pic";
253 device_type = "cpm-pic";
254 }; 175 };
255 176
256 scc@91a00 { 177 serial@91a00 {
257 device_type = "serial"; 178 device_type = "serial";
258 compatible = "cpm_uart"; 179 compatible = "fsl,mpc8560-scc-uart",
259 model = "SCC"; 180 "fsl,cpm2-scc-uart";
260 device-id = <1>;
261 reg = <91a00 20 88000 100>; 181 reg = <91a00 20 88000 100>;
262 clock-setup = <00ffffff 0>; 182 fsl,cpm-brg = <1>;
263 rx-clock = <1>; 183 fsl,cpm-command = <00800000>;
264 tx-clock = <1>;
265 current-speed = <1c200>; 184 current-speed = <1c200>;
266 interrupts = <28 8>; 185 interrupts = <28 8>;
267 interrupt-parent = <&cpmpic>; 186 interrupt-parent = <&cpmpic>;
268 }; 187 };
269 188
270 scc@91a20 { 189 serial@91a20 {
271 device_type = "serial"; 190 device_type = "serial";
272 compatible = "cpm_uart"; 191 compatible = "fsl,mpc8560-scc-uart",
273 model = "SCC"; 192 "fsl,cpm2-scc-uart";
274 device-id = <2>;
275 reg = <91a20 20 88100 100>; 193 reg = <91a20 20 88100 100>;
276 clock-setup = <ff00ffff 90000>; 194 fsl,cpm-brg = <2>;
277 rx-clock = <2>; 195 fsl,cpm-command = <04a00000>;
278 tx-clock = <2>;
279 current-speed = <1c200>; 196 current-speed = <1c200>;
280 interrupts = <29 8>; 197 interrupts = <29 8>;
281 interrupt-parent = <&cpmpic>; 198 interrupt-parent = <&cpmpic>;
282 }; 199 };
283 200
284 fcc@91320 { 201 ethernet@91320 {
285 device_type = "network"; 202 device_type = "network";
286 compatible = "fs_enet"; 203 compatible = "fsl,mpc8560-fcc-enet",
287 model = "FCC"; 204 "fsl,cpm2-fcc-enet";
288 device-id = <2>; 205 reg = <91320 20 88500 100 913b0 1>;
289 reg = <91320 20 88500 100 913a0 30>;
290 /* 206 /*
291 * mac-address is deprecated and will be removed 207 * mac-address is deprecated and will be removed
292 * in 2.6.25. Only recent versions of 208 * in 2.6.25. Only recent versions of
@@ -294,20 +210,17 @@
294 */ 210 */
295 mac-address = [ 00 00 00 00 00 00 ]; 211 mac-address = [ 00 00 00 00 00 00 ];
296 local-mac-address = [ 00 00 00 00 00 00 ]; 212 local-mac-address = [ 00 00 00 00 00 00 ];
297 clock-setup = <ff00ffff 250000>; 213 fsl,cpm-command = <16200300>;
298 rx-clock = <15>;
299 tx-clock = <16>;
300 interrupts = <21 8>; 214 interrupts = <21 8>;
301 interrupt-parent = <&cpmpic>; 215 interrupt-parent = <&cpmpic>;
302 phy-handle = <&phy2>; 216 phy-handle = <&phy2>;
303 }; 217 };
304 218
305 fcc@91340 { 219 ethernet@91340 {
306 device_type = "network"; 220 device_type = "network";
307 compatible = "fs_enet"; 221 compatible = "fsl,mpc8560-fcc-enet",
308 model = "FCC"; 222 "fsl,cpm2-fcc-enet";
309 device-id = <3>; 223 reg = <91340 20 88600 100 913d0 1>;
310 reg = <91340 20 88600 100 913d0 30>;
311 /* 224 /*
312 * mac-address is deprecated and will be removed 225 * mac-address is deprecated and will be removed
313 * in 2.6.25. Only recent versions of 226 * in 2.6.25. Only recent versions of
@@ -315,13 +228,101 @@
315 */ 228 */
316 mac-address = [ 00 00 00 00 00 00 ]; 229 mac-address = [ 00 00 00 00 00 00 ];
317 local-mac-address = [ 00 00 00 00 00 00 ]; 230 local-mac-address = [ 00 00 00 00 00 00 ];
318 clock-setup = <ffff00ff 3700>; 231 fsl,cpm-command = <1a400300>;
319 rx-clock = <17>;
320 tx-clock = <18>;
321 interrupts = <22 8>; 232 interrupts = <22 8>;
322 interrupt-parent = <&cpmpic>; 233 interrupt-parent = <&cpmpic>;
323 phy-handle = <&phy3>; 234 phy-handle = <&phy3>;
324 }; 235 };
325 }; 236 };
326 }; 237 };
238
239 pci@e0008000 {
240 #interrupt-cells = <1>;
241 #size-cells = <2>;
242 #address-cells = <3>;
243 compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci";
244 device_type = "pci";
245 reg = <e0008000 1000>;
246 clock-frequency = <3f940aa>;
247 interrupt-map-mask = <f800 0 0 7>;
248 interrupt-map = <
249
250 /* IDSEL 0x2 */
251 1000 0 0 1 &mpic 1 1
252 1000 0 0 2 &mpic 2 1
253 1000 0 0 3 &mpic 3 1
254 1000 0 0 4 &mpic 4 1
255
256 /* IDSEL 0x3 */
257 1800 0 0 1 &mpic 4 1
258 1800 0 0 2 &mpic 1 1
259 1800 0 0 3 &mpic 2 1
260 1800 0 0 4 &mpic 3 1
261
262 /* IDSEL 0x4 */
263 2000 0 0 1 &mpic 3 1
264 2000 0 0 2 &mpic 4 1
265 2000 0 0 3 &mpic 1 1
266 2000 0 0 4 &mpic 2 1
267
268 /* IDSEL 0x5 */
269 2800 0 0 1 &mpic 2 1
270 2800 0 0 2 &mpic 3 1
271 2800 0 0 3 &mpic 4 1
272 2800 0 0 4 &mpic 1 1
273
274 /* IDSEL 12 */
275 6000 0 0 1 &mpic 1 1
276 6000 0 0 2 &mpic 2 1
277 6000 0 0 3 &mpic 3 1
278 6000 0 0 4 &mpic 4 1
279
280 /* IDSEL 13 */
281 6800 0 0 1 &mpic 4 1
282 6800 0 0 2 &mpic 1 1
283 6800 0 0 3 &mpic 2 1
284 6800 0 0 4 &mpic 3 1
285
286 /* IDSEL 14*/
287 7000 0 0 1 &mpic 3 1
288 7000 0 0 2 &mpic 4 1
289 7000 0 0 3 &mpic 1 1
290 7000 0 0 4 &mpic 2 1
291
292 /* IDSEL 15 */
293 7800 0 0 1 &mpic 2 1
294 7800 0 0 2 &mpic 3 1
295 7800 0 0 3 &mpic 4 1
296 7800 0 0 4 &mpic 1 1
297
298 /* IDSEL 18 */
299 9000 0 0 1 &mpic 1 1
300 9000 0 0 2 &mpic 2 1
301 9000 0 0 3 &mpic 3 1
302 9000 0 0 4 &mpic 4 1
303
304 /* IDSEL 19 */
305 9800 0 0 1 &mpic 4 1
306 9800 0 0 2 &mpic 1 1
307 9800 0 0 3 &mpic 2 1
308 9800 0 0 4 &mpic 3 1
309
310 /* IDSEL 20 */
311 a000 0 0 1 &mpic 3 1
312 a000 0 0 2 &mpic 4 1
313 a000 0 0 3 &mpic 1 1
314 a000 0 0 4 &mpic 2 1
315
316 /* IDSEL 21 */
317 a800 0 0 1 &mpic 2 1
318 a800 0 0 2 &mpic 3 1
319 a800 0 0 3 &mpic 4 1
320 a800 0 0 4 &mpic 1 1>;
321
322 interrupt-parent = <&mpic>;
323 interrupts = <18 2>;
324 bus-range = <0 0>;
325 ranges = <02000000 0 80000000 80000000 0 20000000
326 01000000 0 00000000 e2000000 0 01000000>;
327 };
327}; 328};
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index b1dcfbe8c1f8..54394372b12a 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,10 +50,9 @@
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 00001000>;
58 bus-frequency = <0>; 56 bus-frequency = <0>;
59 57
60 memory-controller@2000 { 58 memory-controller@2000 {
@@ -74,15 +72,24 @@
74 }; 72 };
75 73
76 i2c@3000 { 74 i2c@3000 {
75 #address-cells = <1>;
76 #size-cells = <0>;
77 device_type = "i2c"; 77 device_type = "i2c";
78 compatible = "fsl-i2c"; 78 compatible = "fsl-i2c";
79 reg = <3000 100>; 79 reg = <3000 100>;
80 interrupts = <2b 2>; 80 interrupts = <2b 2>;
81 interrupt-parent = <&mpic>; 81 interrupt-parent = <&mpic>;
82 dfsrr; 82 dfsrr;
83
84 rtc@68 {
85 compatible = "dallas,ds1374";
86 reg = <68>;
87 };
83 }; 88 };
84 89
85 i2c@3100 { 90 i2c@3100 {
91 #address-cells = <1>;
92 #size-cells = <0>;
86 device_type = "i2c"; 93 device_type = "i2c";
87 compatible = "fsl-i2c"; 94 compatible = "fsl-i2c";
88 reg = <3100 100>; 95 reg = <3100 100>;
@@ -97,10 +104,10 @@
97 device_type = "mdio"; 104 device_type = "mdio";
98 compatible = "gianfar"; 105 compatible = "gianfar";
99 reg = <24520 20>; 106 reg = <24520 20>;
100 phy0: ethernet-phy@0 { 107 phy0: ethernet-phy@7 {
101 interrupt-parent = <&mpic>; 108 interrupt-parent = <&mpic>;
102 interrupts = <1 1>; 109 interrupts = <1 1>;
103 reg = <0>; 110 reg = <7>;
104 device_type = "ethernet-phy"; 111 device_type = "ethernet-phy";
105 }; 112 };
106 phy1: ethernet-phy@1 { 113 phy1: ethernet-phy@1 {
@@ -176,60 +183,6 @@
176 fsl,has-rstcr; 183 fsl,has-rstcr;
177 }; 184 };
178 185
179 pci@8000 {
180 interrupt-map-mask = <f800 0 0 7>;
181 interrupt-map = <
182 /* IDSEL 0x12 AD18 */
183 9000 0 0 1 &mpic 5 1
184 9000 0 0 2 &mpic 6 1
185 9000 0 0 3 &mpic 7 1
186 9000 0 0 4 &mpic 4 1
187
188 /* IDSEL 0x13 AD19 */
189 9800 0 0 1 &mpic 6 1
190 9800 0 0 2 &mpic 7 1
191 9800 0 0 3 &mpic 4 1
192 9800 0 0 4 &mpic 5 1>;
193
194 interrupt-parent = <&mpic>;
195 interrupts = <18 2>;
196 bus-range = <0 ff>;
197 ranges = <02000000 0 80000000 80000000 0 20000000
198 01000000 0 00000000 e2000000 0 00800000>;
199 clock-frequency = <3f940aa>;
200 #interrupt-cells = <1>;
201 #size-cells = <2>;
202 #address-cells = <3>;
203 reg = <8000 1000>;
204 compatible = "fsl,mpc8540-pci";
205 device_type = "pci";
206 };
207
208 /* PCI Express */
209 pcie@a000 {
210 interrupt-map-mask = <f800 0 0 7>;
211 interrupt-map = <
212
213 /* IDSEL 0x0 (PEX) */
214 00000 0 0 1 &mpic 0 1
215 00000 0 0 2 &mpic 1 1
216 00000 0 0 3 &mpic 2 1
217 00000 0 0 4 &mpic 3 1>;
218
219 interrupt-parent = <&mpic>;
220 interrupts = <1a 2>;
221 bus-range = <0 ff>;
222 ranges = <02000000 0 a0000000 a0000000 0 20000000
223 01000000 0 00000000 e3000000 0 08000000>;
224 clock-frequency = <1fca055>;
225 #interrupt-cells = <1>;
226 #size-cells = <2>;
227 #address-cells = <3>;
228 reg = <a000 1000>;
229 compatible = "fsl,mpc8548-pcie";
230 device_type = "pci";
231 };
232
233 serial@4600 { 186 serial@4600 {
234 device_type = "serial"; 187 device_type = "serial";
235 compatible = "ns16550"; 188 compatible = "ns16550";
@@ -258,11 +211,11 @@
258 #address-cells = <0>; 211 #address-cells = <0>;
259 #interrupt-cells = <2>; 212 #interrupt-cells = <2>;
260 reg = <40000 40000>; 213 reg = <40000 40000>;
261 built-in;
262 compatible = "chrp,open-pic"; 214 compatible = "chrp,open-pic";
263 device_type = "open-pic"; 215 device_type = "open-pic";
264 big-endian; 216 big-endian;
265 }; 217 };
218
266 par_io@e0100 { 219 par_io@e0100 {
267 reg = <e0100 100>; 220 reg = <e0100 100>;
268 device_type = "par_io"; 221 device_type = "par_io";
@@ -289,12 +242,13 @@
289 4 1a 2 0 2 0 /* RxD7 */ 242 4 1a 2 0 2 0 /* RxD7 */
290 4 0b 1 0 2 0 /* TX_EN */ 243 4 0b 1 0 2 0 /* TX_EN */
291 4 18 1 0 2 0 /* TX_ER */ 244 4 18 1 0 2 0 /* TX_ER */
292 4 0f 2 0 2 0 /* RX_DV */ 245 4 10 2 0 2 0 /* RX_DV */
293 4 1e 2 0 2 0 /* RX_ER */ 246 4 1e 2 0 2 0 /* RX_ER */
294 4 11 2 0 2 0 /* RX_CLK */ 247 4 11 2 0 2 0 /* RX_CLK */
295 4 13 1 0 2 0 /* GTX_CLK */ 248 4 13 1 0 2 0 /* GTX_CLK */
296 1 1f 2 0 3 0>; /* GTX125 */ 249 1 1f 2 0 3 0>; /* GTX125 */
297 }; 250 };
251
298 pio2: ucc_pin@02 { 252 pio2: ucc_pin@02 {
299 pio-map = < 253 pio-map = <
300 /* port pin dir open_drain assignment has_irq */ 254 /* port pin dir open_drain assignment has_irq */
@@ -380,10 +334,10 @@
380 mac-address = [ 00 00 00 00 00 00 ]; 334 mac-address = [ 00 00 00 00 00 00 ];
381 local-mac-address = [ 00 00 00 00 00 00 ]; 335 local-mac-address = [ 00 00 00 00 00 00 ];
382 rx-clock = <0>; 336 rx-clock = <0>;
383 tx-clock = <19>; 337 tx-clock = <20>;
384 phy-handle = <&qe_phy0>;
385 phy-connection-type = "gmii";
386 pio-handle = <&pio1>; 338 pio-handle = <&pio1>;
339 phy-handle = <&phy0>;
340 phy-connection-type = "rgmii-id";
387 }; 341 };
388 342
389 ucc@3000 { 343 ucc@3000 {
@@ -402,10 +356,10 @@
402 mac-address = [ 00 00 00 00 00 00 ]; 356 mac-address = [ 00 00 00 00 00 00 ];
403 local-mac-address = [ 00 00 00 00 00 00 ]; 357 local-mac-address = [ 00 00 00 00 00 00 ];
404 rx-clock = <0>; 358 rx-clock = <0>;
405 tx-clock = <14>; 359 tx-clock = <20>;
406 phy-handle = <&qe_phy1>;
407 phy-connection-type = "gmii";
408 pio-handle = <&pio2>; 360 pio-handle = <&pio2>;
361 phy-handle = <&phy1>;
362 phy-connection-type = "rgmii-id";
409 }; 363 };
410 364
411 mdio@2120 { 365 mdio@2120 {
@@ -417,10 +371,10 @@
417 371
418 /* These are the same PHYs as on 372 /* These are the same PHYs as on
419 * gianfar's MDIO bus */ 373 * gianfar's MDIO bus */
420 qe_phy0: ethernet-phy@00 { 374 qe_phy0: ethernet-phy@07 {
421 interrupt-parent = <&mpic>; 375 interrupt-parent = <&mpic>;
422 interrupts = <1 1>; 376 interrupts = <1 1>;
423 reg = <0>; 377 reg = <7>;
424 device_type = "ethernet-phy"; 378 device_type = "ethernet-phy";
425 }; 379 };
426 qe_phy1: ethernet-phy@01 { 380 qe_phy1: ethernet-phy@01 {
@@ -449,11 +403,77 @@
449 #address-cells = <0>; 403 #address-cells = <0>;
450 #interrupt-cells = <1>; 404 #interrupt-cells = <1>;
451 reg = <80 80>; 405 reg = <80 80>;
452 built-in;
453 big-endian; 406 big-endian;
454 interrupts = <2e 2 2e 2>; //high:30 low:30 407 interrupts = <2e 2 2e 2>; //high:30 low:30
455 interrupt-parent = <&mpic>; 408 interrupt-parent = <&mpic>;
456 }; 409 };
457 410
458 }; 411 };
412
413 pci@e0008000 {
414 interrupt-map-mask = <f800 0 0 7>;
415 interrupt-map = <
416 /* IDSEL 0x12 AD18 */
417 9000 0 0 1 &mpic 5 1
418 9000 0 0 2 &mpic 6 1
419 9000 0 0 3 &mpic 7 1
420 9000 0 0 4 &mpic 4 1
421
422 /* IDSEL 0x13 AD19 */
423 9800 0 0 1 &mpic 6 1
424 9800 0 0 2 &mpic 7 1
425 9800 0 0 3 &mpic 4 1
426 9800 0 0 4 &mpic 5 1>;
427
428 interrupt-parent = <&mpic>;
429 interrupts = <18 2>;
430 bus-range = <0 ff>;
431 ranges = <02000000 0 80000000 80000000 0 20000000
432 01000000 0 00000000 e2000000 0 00800000>;
433 clock-frequency = <3f940aa>;
434 #interrupt-cells = <1>;
435 #size-cells = <2>;
436 #address-cells = <3>;
437 reg = <e0008000 1000>;
438 compatible = "fsl,mpc8540-pci";
439 device_type = "pci";
440 };
441
442 /* PCI Express */
443 pcie@e000a000 {
444 interrupt-map-mask = <f800 0 0 7>;
445 interrupt-map = <
446
447 /* IDSEL 0x0 (PEX) */
448 00000 0 0 1 &mpic 0 1
449 00000 0 0 2 &mpic 1 1
450 00000 0 0 3 &mpic 2 1
451 00000 0 0 4 &mpic 3 1>;
452
453 interrupt-parent = <&mpic>;
454 interrupts = <1a 2>;
455 bus-range = <0 ff>;
456 ranges = <02000000 0 a0000000 a0000000 0 10000000
457 01000000 0 00000000 e2800000 0 00800000>;
458 clock-frequency = <1fca055>;
459 #interrupt-cells = <1>;
460 #size-cells = <2>;
461 #address-cells = <3>;
462 reg = <e000a000 1000>;
463 compatible = "fsl,mpc8548-pcie";
464 device_type = "pci";
465 pcie@0 {
466 reg = <0 0 0 0 0>;
467 #size-cells = <2>;
468 #address-cells = <3>;
469 device_type = "pci";
470 ranges = <02000000 0 a0000000
471 02000000 0 a0000000
472 0 10000000
473
474 01000000 0 00000000
475 01000000 0 00000000
476 0 00800000>;
477 };
478 };
459}; 479};
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/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
new file mode 100644
index 000000000000..966edf1161a6
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -0,0 +1,191 @@
1/*
2 * MPC8610 HPCD 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 Version 2 as published
8 * by the Free Software Foundation.
9 */
10
11
12/ {
13 model = "MPC8610HPCD";
14 compatible = "fsl,MPC8610HPCD";
15 #address-cells = <1>;
16 #size-cells = <1>;
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 PowerPC,8610@0 {
23 device_type = "cpu";
24 reg = <0>;
25 d-cache-line-size = <d# 32>; // bytes
26 i-cache-line-size = <d# 32>; // bytes
27 d-cache-size = <8000>; // L1, 32K
28 i-cache-size = <8000>; // L1, 32K
29 timebase-frequency = <0>; // 33 MHz, from uboot
30 bus-frequency = <0>; // From uboot
31 clock-frequency = <0>; // From uboot
32 };
33 };
34
35 memory {
36 device_type = "memory";
37 reg = <00000000 20000000>; // 512M at 0x0
38 };
39
40 soc@e0000000 {
41 #address-cells = <1>;
42 #size-cells = <1>;
43 #interrupt-cells = <2>;
44 device_type = "soc";
45 ranges = <0 e0000000 00100000>;
46 reg = <e0000000 1000>;
47 bus-frequency = <0>;
48
49 i2c@3000 {
50 device_type = "i2c";
51 compatible = "fsl-i2c";
52 #address-cells = <1>;
53 #size-cells = <0>;
54 reg = <3000 100>;
55 interrupts = <2b 2>;
56 interrupt-parent = <&mpic>;
57 dfsrr;
58 };
59
60 i2c@3100 {
61 device_type = "i2c";
62 compatible = "fsl-i2c";
63 #address-cells = <1>;
64 #size-cells = <0>;
65 reg = <3100 100>;
66 interrupts = <2b 2>;
67 interrupt-parent = <&mpic>;
68 dfsrr;
69 };
70
71 serial@4500 {
72 device_type = "serial";
73 compatible = "ns16550";
74 reg = <4500 100>;
75 clock-frequency = <0>;
76 interrupts = <2a 2>;
77 interrupt-parent = <&mpic>;
78 };
79
80 serial@4600 {
81 device_type = "serial";
82 compatible = "ns16550";
83 reg = <4600 100>;
84 clock-frequency = <0>;
85 interrupts = <1c 2>;
86 interrupt-parent = <&mpic>;
87 };
88
89
90 mpic: interrupt-controller@40000 {
91 clock-frequency = <0>;
92 interrupt-controller;
93 #address-cells = <0>;
94 #interrupt-cells = <2>;
95 reg = <40000 40000>;
96 compatible = "chrp,open-pic";
97 device_type = "open-pic";
98 big-endian;
99 };
100
101 global-utilities@e0000 {
102 compatible = "fsl,mpc8610-guts";
103 reg = <e0000 1000>;
104 fsl,has-rstcr;
105 };
106 };
107
108 pci@e0008000 {
109 compatible = "fsl,mpc8610-pci";
110 device_type = "pci";
111 #interrupt-cells = <1>;
112 #size-cells = <2>;
113 #address-cells = <3>;
114 reg = <e0008000 1000>;
115 bus-range = <0 0>;
116 ranges = <02000000 0 80000000 80000000 0 10000000
117 01000000 0 00000000 e1000000 0 00100000>;
118 clock-frequency = <1fca055>;
119 interrupt-parent = <&mpic>;
120 interrupts = <18 2>;
121 interrupt-map-mask = <f800 0 0 7>;
122 interrupt-map = <
123 /* IDSEL 0x11 */
124 8800 0 0 1 &mpic 4 1
125 8800 0 0 2 &mpic 5 1
126 8800 0 0 3 &mpic 6 1
127 8800 0 0 4 &mpic 7 1
128
129 /* IDSEL 0x12 */
130 9000 0 0 1 &mpic 5 1
131 9000 0 0 2 &mpic 6 1
132 9000 0 0 3 &mpic 7 1
133 9000 0 0 4 &mpic 4 1
134 >;
135 };
136
137 pcie@e000a000 {
138 compatible = "fsl,mpc8641-pcie";
139 device_type = "pci";
140 #interrupt-cells = <1>;
141 #size-cells = <2>;
142 #address-cells = <3>;
143 reg = <e000a000 1000>;
144 bus-range = <1 3>;
145 ranges = <02000000 0 a0000000 a0000000 0 10000000
146 01000000 0 00000000 e3000000 0 00100000>;
147 clock-frequency = <1fca055>;
148 interrupt-parent = <&mpic>;
149 interrupts = <1a 2>;
150 interrupt-map-mask = <f800 0 0 7>;
151
152 interrupt-map = <
153 /* IDSEL 0x1b */
154 d800 0 0 1 &mpic 2 1
155
156 /* IDSEL 0x1c*/
157 e000 0 0 1 &mpic 1 1
158 e000 0 0 2 &mpic 1 1
159 e000 0 0 3 &mpic 1 1
160 e000 0 0 4 &mpic 1 1
161
162 /* IDSEL 0x1f */
163 f800 0 0 1 &mpic 3 0
164 f800 0 0 2 &mpic 0 1
165 >;
166
167 pcie@0 {
168 reg = <0 0 0 0 0>;
169 #size-cells = <2>;
170 #address-cells = <3>;
171 device_type = "pci";
172 ranges = <02000000 0 a0000000
173 02000000 0 a0000000
174 0 10000000
175 01000000 0 00000000
176 01000000 0 00000000
177 0 00100000>;
178 uli1575@0 {
179 reg = <0 0 0 0 0>;
180 #size-cells = <2>;
181 #address-cells = <3>;
182 ranges = <02000000 0 a0000000
183 02000000 0 a0000000
184 0 10000000
185 01000000 0 00000000
186 01000000 0 00000000
187 0 00100000>;
188 };
189 };
190 };
191};
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index b0166e5c177e..367765937a06 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,81 @@
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>;
211 #interrupt-cells = <2>;
212 reg = <40000 40000>;
213 compatible = "chrp,open-pic";
214 device_type = "open-pic";
215 big-endian;
216 };
217
218 global-utilities@e0000 {
219 compatible = "fsl,mpc8641-guts";
220 reg = <e0000 1000>;
221 fsl,has-rstcr;
222 };
223 };
224
225 pcie@f8008000 {
226 compatible = "fsl,mpc8641-pcie";
227 device_type = "pci";
228 #interrupt-cells = <1>;
229 #size-cells = <2>;
230 #address-cells = <3>;
231 reg = <f8008000 1000>;
232 bus-range = <0 ff>;
233 ranges = <02000000 0 80000000 80000000 0 20000000
234 01000000 0 00000000 e2000000 0 00100000>;
235 clock-frequency = <1fca055>;
236 interrupt-parent = <&mpic>;
237 interrupts = <18 2>;
238 interrupt-map-mask = <fb00 0 0 0>;
239 interrupt-map = <
240 /* IDSEL 0x11 */
241 8800 0 0 1 &i8259 9 2
242 8800 0 0 2 &i8259 a 2
243 8800 0 0 3 &i8259 b 2
244 8800 0 0 4 &i8259 c 2
245
246 /* IDSEL 0x12 */
247 9000 0 0 1 &i8259 a 2
248 9000 0 0 2 &i8259 b 2
249 9000 0 0 3 &i8259 c 2
250 9000 0 0 4 &i8259 9 2
251
252 // IDSEL 0x1c USB
253 e000 0 0 0 &i8259 c 2
254 e100 0 0 0 &i8259 9 2
255 e200 0 0 0 &i8259 a 2
256 e300 0 0 0 &i8259 b 2
257
258 // IDSEL 0x1d Audio
259 e800 0 0 0 &i8259 6 2
260
261 // IDSEL 0x1e Legacy
262 f000 0 0 0 &i8259 7 2
263 f100 0 0 0 &i8259 7 2
264
265 // IDSEL 0x1f IDE/SATA
266 f800 0 0 0 &i8259 e 2
267 f900 0 0 0 &i8259 5 2
268 >;
269
270 pcie@0 {
271 reg = <0 0 0 0 0>;
218 #size-cells = <2>; 272 #size-cells = <2>;
219 #address-cells = <3>; 273 #address-cells = <3>;
220 reg = <8000 1000>; 274 device_type = "pci";
221 bus-range = <0 ff>; 275 ranges = <02000000 0 80000000
222 ranges = <02000000 0 80000000 80000000 0 20000000 276 02000000 0 80000000
223 01000000 0 00000000 e2000000 0 00100000>; 277 0 20000000
224 clock-frequency = <1fca055>; 278
225 interrupt-parent = <&mpic>; 279 01000000 0 00000000
226 interrupts = <18 2>; 280 01000000 0 00000000
227 interrupt-map-mask = <fb00 0 0 0>; 281 0 00100000>;
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
235 /* IDSEL 0x12 */
236 9000 0 0 1 &i8259 a 2
237 9000 0 0 2 &i8259 b 2
238 9000 0 0 3 &i8259 c 2
239 9000 0 0 4 &i8259 9 2
240
241 // IDSEL 0x1c USB
242 e000 0 0 0 &i8259 c 2
243 e100 0 0 0 &i8259 9 2
244 e200 0 0 0 &i8259 a 2
245 e300 0 0 0 &i8259 b 2
246
247 // IDSEL 0x1d Audio
248 e800 0 0 0 &i8259 6 2
249
250 // IDSEL 0x1e Legacy
251 f000 0 0 0 &i8259 7 2
252 f100 0 0 0 &i8259 7 2
253
254 // IDSEL 0x1f IDE/SATA
255 f800 0 0 0 &i8259 e 2
256 f900 0 0 0 &i8259 5 2
257 >;
258 uli1575@0 { 282 uli1575@0 {
259 reg = <0 0 0 0 0>; 283 reg = <0 0 0 0 0>;
260 #size-cells = <2>; 284 #size-cells = <2>;
@@ -265,111 +289,96 @@
265 01000000 0 00000000 289 01000000 0 00000000
266 01000000 0 00000000 290 01000000 0 00000000
267 0 00100000>; 291 0 00100000>;
292 isa@1e {
293 device_type = "isa";
294 #interrupt-cells = <2>;
295 #size-cells = <1>;
296 #address-cells = <2>;
297 reg = <f000 0 0 0 0>;
298 ranges = <1 0 01000000 0 0
299 00001000>;
300 interrupt-parent = <&i8259>;
268 301
269 pci_bridge@0 { 302 i8259: interrupt-controller@20 {
270 reg = <0 0 0 0 0>; 303 reg = <1 20 2
271 #size-cells = <2>; 304 1 a0 2
272 #address-cells = <3>; 305 1 4d0 2>;
273 ranges = <02000000 0 80000000 306 interrupt-controller;
274 02000000 0 80000000 307 device_type = "interrupt-controller";
275 0 20000000 308 #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>; 309 #interrupt-cells = <2>;
283 #size-cells = <1>; 310 compatible = "chrp,iic";
284 #address-cells = <2>; 311 interrupts = <9 2>;
285 reg = <f000 0 0 0 0>; 312 interrupt-parent = <&mpic>;
286 ranges = <1 0 01000000 0 0 313 };
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 314
306 i8042@60 { 315 i8042@60 {
307 #size-cells = <0>; 316 #size-cells = <0>;
308 #address-cells = <1>; 317 #address-cells = <1>;
309 reg = <1 60 1 1 64 1>; 318 reg = <1 60 1 1 64 1>;
310 interrupts = <1 3 c 3>; 319 interrupts = <1 3 c 3>;
311 interrupt-parent = 320 interrupt-parent =
312 <&i8259>; 321 <&i8259>;
313
314 keyboard@0 {
315 reg = <0>;
316 compatible = "pnpPNP,303";
317 };
318
319 mouse@1 {
320 reg = <1>;
321 compatible = "pnpPNP,f03";
322 };
323 };
324 322
325 rtc@70 { 323 keyboard@0 {
326 compatible = 324 reg = <0>;
327 "pnpPNP,b00"; 325 compatible = "pnpPNP,303";
328 reg = <1 70 2>;
329 }; 326 };
330 327
331 gpio@400 { 328 mouse@1 {
332 reg = <1 400 80>; 329 reg = <1>;
330 compatible = "pnpPNP,f03";
333 }; 331 };
334 }; 332 };
333
334 rtc@70 {
335 compatible =
336 "pnpPNP,b00";
337 reg = <1 70 2>;
338 };
339
340 gpio@400 {
341 reg = <1 400 80>;
342 };
335 }; 343 };
336 }; 344 };
337
338 }; 345 };
339 346
340 pcie@9000 { 347 };
341 compatible = "fsl,mpc8641-pcie"; 348
342 device_type = "pci"; 349 pcie@f8009000 {
343 #interrupt-cells = <1>; 350 compatible = "fsl,mpc8641-pcie";
351 device_type = "pci";
352 #interrupt-cells = <1>;
353 #size-cells = <2>;
354 #address-cells = <3>;
355 reg = <f8009000 1000>;
356 bus-range = <0 ff>;
357 ranges = <02000000 0 a0000000 a0000000 0 20000000
358 01000000 0 00000000 e3000000 0 00100000>;
359 clock-frequency = <1fca055>;
360 interrupt-parent = <&mpic>;
361 interrupts = <19 2>;
362 interrupt-map-mask = <f800 0 0 7>;
363 interrupt-map = <
364 /* IDSEL 0x0 */
365 0000 0 0 1 &mpic 4 1
366 0000 0 0 2 &mpic 5 1
367 0000 0 0 3 &mpic 6 1
368 0000 0 0 4 &mpic 7 1
369 >;
370 pcie@0 {
371 reg = <0 0 0 0 0>;
344 #size-cells = <2>; 372 #size-cells = <2>;
345 #address-cells = <3>; 373 #address-cells = <3>;
346 reg = <9000 1000>; 374 device_type = "pci";
347 bus-range = <0 ff>; 375 ranges = <02000000 0 a0000000
348 ranges = <02000000 0 a0000000 a0000000 0 20000000 376 02000000 0 a0000000
349 01000000 0 00000000 e3000000 0 00100000>; 377 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 378
363 mpic: pic@40000 { 379 01000000 0 00000000
364 clock-frequency = <0>; 380 01000000 0 00000000
365 interrupt-controller; 381 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 }; 382 };
374 }; 383 };
375}; 384};
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..8848e637293e 100644
--- a/arch/powerpc/boot/dts/mpc885ads.dts
+++ b/arch/powerpc/boot/dts/mpc885ads.dts
@@ -2,6 +2,7 @@
2 * MPC885 ADS Device Tree Source 2 * MPC885 ADS Device Tree Source
3 * 3 *
4 * Copyright 2006 MontaVista Software, Inc. 4 * Copyright 2006 MontaVista Software, Inc.
5 * Copyright 2007 Freescale Semiconductor, Inc.
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the 8 * under the terms of the GNU General Public License as published by the
@@ -12,7 +13,7 @@
12 13
13/ { 14/ {
14 model = "MPC885ADS"; 15 model = "MPC885ADS";
15 compatible = "mpc8xx"; 16 compatible = "fsl,mpc885ads";
16 #address-cells = <1>; 17 #address-cells = <1>;
17 #size-cells = <1>; 18 #size-cells = <1>;
18 19
@@ -23,161 +24,199 @@
23 PowerPC,885@0 { 24 PowerPC,885@0 {
24 device_type = "cpu"; 25 device_type = "cpu";
25 reg = <0>; 26 reg = <0>;
26 d-cache-line-size = <20>; // 32 bytes 27 d-cache-line-size = <d#16>;
27 i-cache-line-size = <20>; // 32 bytes 28 i-cache-line-size = <d#16>;
28 d-cache-size = <2000>; // L1, 8K 29 d-cache-size = <d#8192>;
29 i-cache-size = <2000>; // L1, 8K 30 i-cache-size = <d#8192>;
30 timebase-frequency = <0>; 31 timebase-frequency = <0>;
31 bus-frequency = <0>; 32 bus-frequency = <0>;
32 clock-frequency = <0>; 33 clock-frequency = <0>;
33 32-bit;
34 interrupts = <f 2>; // decrementer interrupt 34 interrupts = <f 2>; // decrementer interrupt
35 interrupt-parent = <&Mpc8xx_pic>; 35 interrupt-parent = <&PIC>;
36 }; 36 };
37 }; 37 };
38 38
39 memory { 39 memory {
40 device_type = "memory"; 40 device_type = "memory";
41 reg = <00000000 800000>; 41 reg = <0 0>;
42 }; 42 };
43 43
44 soc885@ff000000 { 44 localbus@ff000100 {
45 compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus";
46 #address-cells = <2>;
47 #size-cells = <1>;
48 reg = <ff000100 40>;
49
50 ranges = <
51 0 0 fe000000 00800000
52 1 0 ff080000 00008000
53 5 0 ff0a0000 00008000
54 >;
55
56 flash@0,0 {
57 compatible = "jedec-flash";
58 reg = <0 0 800000>;
59 bank-width = <4>;
60 device-width = <1>;
61 };
62
63 board-control@1,0 {
64 reg = <1 0 20 5 300 4>;
65 compatible = "fsl,mpc885ads-bcsr";
66 };
67 };
68
69 soc@ff000000 {
70 compatible = "fsl,mpc885", "fsl,pq1-soc";
45 #address-cells = <1>; 71 #address-cells = <1>;
46 #size-cells = <1>; 72 #size-cells = <1>;
47 #interrupt-cells = <2>;
48 device_type = "soc"; 73 device_type = "soc";
49 ranges = <0 ff000000 00100000>; 74 ranges = <0 ff000000 00004000>;
50 reg = <ff000000 00000200>;
51 bus-frequency = <0>; 75 bus-frequency = <0>;
52 mdio@e80 { 76
53 device_type = "mdio"; 77 // Temporary -- will go away once kernel uses ranges for get_immrbase().
54 compatible = "fs_enet"; 78 reg = <ff000000 4000>;
55 reg = <e80 8>; 79
80 mdio@e00 {
81 compatible = "fsl,mpc885-fec-mdio", "fsl,pq1-fec-mdio";
82 reg = <e00 188>;
56 #address-cells = <1>; 83 #address-cells = <1>;
57 #size-cells = <0>; 84 #size-cells = <0>;
58 Phy0: ethernet-phy@0 { 85
86 PHY0: ethernet-phy@0 {
59 reg = <0>; 87 reg = <0>;
60 device_type = "ethernet-phy"; 88 device_type = "ethernet-phy";
61 }; 89 };
62 Phy1: ethernet-phy@1 { 90
91 PHY1: ethernet-phy@1 {
63 reg = <1>; 92 reg = <1>;
64 device_type = "ethernet-phy"; 93 device_type = "ethernet-phy";
65 }; 94 };
66 Phy2: ethernet-phy@2 { 95
96 PHY2: ethernet-phy@2 {
67 reg = <2>; 97 reg = <2>;
68 device_type = "ethernet-phy"; 98 device_type = "ethernet-phy";
69 }; 99 };
70 }; 100 };
71 101
72 fec@e00 { 102 ethernet@e00 {
73 device_type = "network"; 103 device_type = "network";
74 compatible = "fs_enet"; 104 compatible = "fsl,mpc885-fec-enet",
75 model = "FEC"; 105 "fsl,pq1-fec-enet";
76 device-id = <1>;
77 reg = <e00 188>; 106 reg = <e00 188>;
78 mac-address = [ 00 00 0C 00 01 FD ]; 107 local-mac-address = [ 00 00 00 00 00 00 ];
79 interrupts = <3 1>; 108 interrupts = <3 1>;
80 interrupt-parent = <&Mpc8xx_pic>; 109 interrupt-parent = <&PIC>;
81 phy-handle = <&Phy1>; 110 phy-handle = <&PHY0>;
111 linux,network-index = <0>;
82 }; 112 };
83 113
84 fec@1e00 { 114 ethernet@1e00 {
85 device_type = "network"; 115 device_type = "network";
86 compatible = "fs_enet"; 116 compatible = "fsl,mpc885-fec-enet",
87 model = "FEC"; 117 "fsl,pq1-fec-enet";
88 device-id = <2>;
89 reg = <1e00 188>; 118 reg = <1e00 188>;
90 mac-address = [ 00 00 0C 00 02 FD ]; 119 local-mac-address = [ 00 00 00 00 00 00 ];
91 interrupts = <7 1>; 120 interrupts = <7 1>;
92 interrupt-parent = <&Mpc8xx_pic>; 121 interrupt-parent = <&PIC>;
93 phy-handle = <&Phy2>; 122 phy-handle = <&PHY1>;
123 linux,network-index = <1>;
94 }; 124 };
95 125
96 Mpc8xx_pic: pic@ff000000 { 126 PIC: interrupt-controller@0 {
97 interrupt-controller; 127 interrupt-controller;
98 #address-cells = <0>;
99 #interrupt-cells = <2>; 128 #interrupt-cells = <2>;
100 reg = <0 24>; 129 reg = <0 24>;
101 built-in; 130 compatible = "fsl,mpc885-pic", "fsl,pq1-pic";
102 device_type = "mpc8xx-pic";
103 compatible = "CPM";
104 }; 131 };
105 132
106 pcmcia@0080 { 133 pcmcia@80 {
107 #address-cells = <3>; 134 #address-cells = <3>;
108 #interrupt-cells = <1>; 135 #interrupt-cells = <1>;
109 #size-cells = <2>; 136 #size-cells = <2>;
110 compatible = "fsl,pq-pcmcia"; 137 compatible = "fsl,pq-pcmcia";
111 device_type = "pcmcia"; 138 device_type = "pcmcia";
112 reg = <80 80>; 139 reg = <80 80>;
113 interrupt-parent = <&Mpc8xx_pic>; 140 interrupt-parent = <&PIC>;
114 interrupts = <d 1>; 141 interrupts = <d 1>;
115 }; 142 };
116 143
117 cpm@ff000000 { 144 cpm@9c0 {
118 #address-cells = <1>; 145 #address-cells = <1>;
119 #size-cells = <1>; 146 #size-cells = <1>;
120 #interrupt-cells = <2>; 147 compatible = "fsl,mpc885-cpm", "fsl,cpm1";
121 device_type = "cpm";
122 model = "CPM";
123 ranges = <0 0 4000>;
124 reg = <860 f0>;
125 command-proc = <9c0>; 148 command-proc = <9c0>;
126 brg-frequency = <0>; 149 interrupts = <0>; // cpm error interrupt
127 interrupts = <0 2>; // cpm error interrupt 150 interrupt-parent = <&CPM_PIC>;
128 interrupt-parent = <&Cpm_pic>; 151 reg = <9c0 40>;
152 ranges;
153
154 muram@2000 {
155 #address-cells = <1>;
156 #size-cells = <1>;
157 ranges = <0 2000 2000>;
129 158
130 Cpm_pic: pic@930 { 159 data@0 {
160 compatible = "fsl,cpm-muram-data";
161 reg = <0 1c00>;
162 };
163 };
164
165 brg@9f0 {
166 compatible = "fsl,mpc885-brg",
167 "fsl,cpm1-brg",
168 "fsl,cpm-brg";
169 reg = <9f0 10>;
170 };
171
172 CPM_PIC: interrupt-controller@930 {
131 interrupt-controller; 173 interrupt-controller;
132 #address-cells = <0>; 174 #interrupt-cells = <1>;
133 #interrupt-cells = <2>;
134 interrupts = <5 2 0 2>; 175 interrupts = <5 2 0 2>;
135 interrupt-parent = <&Mpc8xx_pic>; 176 interrupt-parent = <&PIC>;
136 reg = <930 20>; 177 reg = <930 20>;
137 built-in; 178 compatible = "fsl,mpc885-cpm-pic",
138 device_type = "cpm-pic"; 179 "fsl,cpm1-pic";
139 compatible = "CPM";
140 }; 180 };
141 181
142 smc@a80 { 182 serial@a80 {
143 device_type = "serial"; 183 device_type = "serial";
144 compatible = "cpm_uart"; 184 compatible = "fsl,mpc885-smc-uart",
145 model = "SMC"; 185 "fsl,cpm1-smc-uart";
146 device-id = <1>;
147 reg = <a80 10 3e80 40>; 186 reg = <a80 10 3e80 40>;
148 clock-setup = <00ffffff 0>; 187 interrupts = <4>;
149 rx-clock = <1>; 188 interrupt-parent = <&CPM_PIC>;
150 tx-clock = <1>; 189 fsl,cpm-brg = <1>;
151 current-speed = <0>; 190 fsl,cpm-command = <0090>;
152 interrupts = <4 3>;
153 interrupt-parent = <&Cpm_pic>;
154 }; 191 };
155 192
156 smc@a90 { 193 serial@a90 {
157 device_type = "serial"; 194 device_type = "serial";
158 compatible = "cpm_uart"; 195 compatible = "fsl,mpc885-smc-uart",
159 model = "SMC"; 196 "fsl,cpm1-smc-uart";
160 device-id = <2>; 197 reg = <a90 10 3f80 40>;
161 reg = <a90 20 3f80 40>; 198 interrupts = <3>;
162 clock-setup = <ff00ffff 90000>; 199 interrupt-parent = <&CPM_PIC>;
163 rx-clock = <2>; 200 fsl,cpm-brg = <2>;
164 tx-clock = <2>; 201 fsl,cpm-command = <00d0>;
165 current-speed = <0>;
166 interrupts = <3 3>;
167 interrupt-parent = <&Cpm_pic>;
168 }; 202 };
169 203
170 scc@a40 { 204 ethernet@a40 {
171 device_type = "network"; 205 device_type = "network";
172 compatible = "fs_enet"; 206 compatible = "fsl,mpc885-scc-enet",
173 model = "SCC"; 207 "fsl,cpm1-scc-enet";
174 device-id = <3>; 208 reg = <a40 18 3e00 100>;
175 reg = <a40 18 3e00 80>; 209 local-mac-address = [ 00 00 00 00 00 00 ];
176 mac-address = [ 00 00 0C 00 03 FD ]; 210 interrupts = <1c>;
177 interrupts = <1c 3>; 211 interrupt-parent = <&CPM_PIC>;
178 interrupt-parent = <&Cpm_pic>; 212 phy-handle = <&PHY2>;
179 phy-handle = <&Phy2>; 213 fsl,cpm-command = <0080>;
214 linux,network-index = <2>;
180 }; 215 };
181 }; 216 };
182 }; 217 };
218
219 chosen {
220 linux,stdout-path = "/soc/cpm/serial@a80";
221 };
183}; 222};
diff --git a/arch/powerpc/boot/dts/pq2fads.dts b/arch/powerpc/boot/dts/pq2fads.dts
new file mode 100644
index 000000000000..2d564921897a
--- /dev/null
+++ b/arch/powerpc/boot/dts/pq2fads.dts
@@ -0,0 +1,240 @@
1/*
2 * Device Tree for the PQ2FADS-ZU board with an MPC8280 chip.
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 = "pq2fads";
14 compatible = "fsl,pq2fads";
15 #address-cells = <1>;
16 #size-cells = <1>;
17
18 cpus {
19 #address-cells = <1>;
20 #size-cells = <0>;
21
22 cpu@0 {
23 device_type = "cpu";
24 reg = <0>;
25 d-cache-line-size = <d#32>;
26 i-cache-line-size = <d#32>;
27 d-cache-size = <d#16384>;
28 i-cache-size = <d#16384>;
29 timebase-frequency = <0>;
30 clock-frequency = <0>;
31 };
32 };
33
34 memory {
35 device_type = "memory";
36 reg = <0 0>;
37 };
38
39 localbus@f0010100 {
40 compatible = "fsl,mpc8280-localbus",
41 "fsl,pq2-localbus";
42 #address-cells = <2>;
43 #size-cells = <1>;
44 reg = <f0010100 60>;
45
46 ranges = <0 0 fe000000 00800000
47 1 0 f4500000 00008000
48 8 0 f8200000 00008000>;
49
50 flash@0,0 {
51 compatible = "jedec-flash";
52 reg = <0 0 800000>;
53 bank-width = <4>;
54 device-width = <1>;
55 };
56
57 bcsr@1,0 {
58 reg = <1 0 20>;
59 compatible = "fsl,pq2fads-bcsr";
60 };
61
62 PCI_PIC: pic@8,0 {
63 #interrupt-cells = <1>;
64 interrupt-controller;
65 reg = <8 0 8>;
66 compatible = "fsl,pq2ads-pci-pic";
67 interrupt-parent = <&PIC>;
68 interrupts = <18 8>;
69 };
70 };
71
72 pci@f0010800 {
73 device_type = "pci";
74 reg = <f0010800 10c f00101ac 8 f00101c4 8>;
75 compatible = "fsl,mpc8280-pci", "fsl,pq2-pci";
76 #interrupt-cells = <1>;
77 #size-cells = <2>;
78 #address-cells = <3>;
79 clock-frequency = <d#66000000>;
80 interrupt-map-mask = <f800 0 0 7>;
81 interrupt-map = <
82 /* IDSEL 0x16 */
83 b000 0 0 1 &PCI_PIC 0
84 b000 0 0 2 &PCI_PIC 1
85 b000 0 0 3 &PCI_PIC 2
86 b000 0 0 4 &PCI_PIC 3
87
88 /* IDSEL 0x17 */
89 b800 0 0 1 &PCI_PIC 4
90 b800 0 0 2 &PCI_PIC 5
91 b800 0 0 3 &PCI_PIC 6
92 b800 0 0 4 &PCI_PIC 7
93
94 /* IDSEL 0x18 */
95 c000 0 0 1 &PCI_PIC 8
96 c000 0 0 2 &PCI_PIC 9
97 c000 0 0 3 &PCI_PIC a
98 c000 0 0 4 &PCI_PIC b>;
99
100 interrupt-parent = <&PIC>;
101 interrupts = <12 8>;
102 ranges = <42000000 0 80000000 80000000 0 20000000
103 02000000 0 a0000000 a0000000 0 20000000
104 01000000 0 00000000 f6000000 0 02000000>;
105 };
106
107 soc@f0000000 {
108 #address-cells = <1>;
109 #size-cells = <1>;
110 device_type = "soc";
111 compatible = "fsl,mpc8280", "fsl,pq2-soc";
112 ranges = <00000000 f0000000 00053000>;
113
114 // Temporary -- will go away once kernel uses ranges for get_immrbase().
115 reg = <f0000000 00053000>;
116
117 cpm@119c0 {
118 #address-cells = <1>;
119 #size-cells = <1>;
120 #interrupt-cells = <2>;
121 compatible = "fsl,mpc8280-cpm", "fsl,cpm2";
122 reg = <119c0 30>;
123 ranges;
124
125 muram@0 {
126 #address-cells = <1>;
127 #size-cells = <1>;
128 ranges = <0 0 10000>;
129
130 data@0 {
131 compatible = "fsl,cpm-muram-data";
132 reg = <0 2000 9800 800>;
133 };
134 };
135
136 brg@119f0 {
137 compatible = "fsl,mpc8280-brg",
138 "fsl,cpm2-brg",
139 "fsl,cpm-brg";
140 reg = <119f0 10 115f0 10>;
141 };
142
143 serial@11a00 {
144 device_type = "serial";
145 compatible = "fsl,mpc8280-scc-uart",
146 "fsl,cpm2-scc-uart";
147 reg = <11a00 20 8000 100>;
148 interrupts = <28 8>;
149 interrupt-parent = <&PIC>;
150 fsl,cpm-brg = <1>;
151 fsl,cpm-command = <00800000>;
152 };
153
154 serial@11a20 {
155 device_type = "serial";
156 compatible = "fsl,mpc8280-scc-uart",
157 "fsl,cpm2-scc-uart";
158 reg = <11a20 20 8100 100>;
159 interrupts = <29 8>;
160 interrupt-parent = <&PIC>;
161 fsl,cpm-brg = <2>;
162 fsl,cpm-command = <04a00000>;
163 };
164
165 ethernet@11320 {
166 device_type = "network";
167 compatible = "fsl,mpc8280-fcc-enet",
168 "fsl,cpm2-fcc-enet";
169 reg = <11320 20 8500 100 113b0 1>;
170 interrupts = <21 8>;
171 interrupt-parent = <&PIC>;
172 phy-handle = <&PHY0>;
173 linux,network-index = <0>;
174 fsl,cpm-command = <16200300>;
175 };
176
177 ethernet@11340 {
178 device_type = "network";
179 compatible = "fsl,mpc8280-fcc-enet",
180 "fsl,cpm2-fcc-enet";
181 reg = <11340 20 8600 100 113d0 1>;
182 interrupts = <22 8>;
183 interrupt-parent = <&PIC>;
184 phy-handle = <&PHY1>;
185 linux,network-index = <1>;
186 fsl,cpm-command = <1a400300>;
187 local-mac-address = [00 e0 0c 00 79 01];
188 };
189
190 mdio@10d40 {
191 device_type = "mdio";
192 compatible = "fsl,pq2fads-mdio-bitbang",
193 "fsl,mpc8280-mdio-bitbang",
194 "fsl,cpm2-mdio-bitbang";
195 #address-cells = <1>;
196 #size-cells = <0>;
197 reg = <10d40 14>;
198 fsl,mdio-pin = <9>;
199 fsl,mdc-pin = <a>;
200
201 PHY0: ethernet-phy@0 {
202 interrupt-parent = <&PIC>;
203 interrupts = <19 2>;
204 reg = <0>;
205 device_type = "ethernet-phy";
206 };
207
208 PHY1: ethernet-phy@1 {
209 interrupt-parent = <&PIC>;
210 interrupts = <19 2>;
211 reg = <3>;
212 device_type = "ethernet-phy";
213 };
214 };
215
216 usb@11b60 {
217 #address-cells = <1>;
218 #size-cells = <0>;
219 compatible = "fsl,mpc8280-usb",
220 "fsl,cpm2-usb";
221 reg = <11b60 18 8b00 100>;
222 interrupt-parent = <&PIC>;
223 interrupts = <b 8>;
224 fsl,cpm-command = <2e600000>;
225 };
226 };
227
228 PIC: interrupt-controller@10c00 {
229 #interrupt-cells = <2>;
230 interrupt-controller;
231 reg = <10c00 80>;
232 compatible = "fsl,mpc8280-pic", "fsl,cpm2-pic";
233 };
234
235 };
236
237 chosen {
238 linux,stdout-path = "/soc/cpm/serial@11a00";
239 };
240};
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/ep88xc.c b/arch/powerpc/boot/ep88xc.c
new file mode 100644
index 000000000000..6b87cdce3fe7
--- /dev/null
+++ b/arch/powerpc/boot/ep88xc.c
@@ -0,0 +1,54 @@
1/*
2 * Embedded Planet EP88xC with PlanetCore firmware
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 "planetcore.h"
16#include "mpc8xx.h"
17
18static char *table;
19static u64 mem_size;
20
21static void platform_fixups(void)
22{
23 u64 val;
24
25 dt_fixup_memory(0, mem_size);
26 planetcore_set_mac_addrs(table);
27
28 if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
29 printf("No PlanetCore crystal frequency key.\r\n");
30 return;
31 }
32
33 mpc885_fixup_clocks(val);
34}
35
36void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
37 unsigned long r6, unsigned long r7)
38{
39 table = (char *)r3;
40 planetcore_prepare_table(table);
41
42 if (!planetcore_get_decimal(table, PLANETCORE_KEY_MB_RAM, &mem_size))
43 return;
44
45 mem_size *= 1024 * 1024;
46 simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
47
48 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
49
50 planetcore_set_stdout_path(table);
51
52 serial_console_init();
53 platform_ops.fixups = platform_fixups;
54}
diff --git a/arch/powerpc/boot/fixed-head.S b/arch/powerpc/boot/fixed-head.S
new file mode 100644
index 000000000000..8e14cd9e1a54
--- /dev/null
+++ b/arch/powerpc/boot/fixed-head.S
@@ -0,0 +1,4 @@
1 .text
2 .global _zimage_start
3_zimage_start:
4 b _zimage_start_lib
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/fsl-soc.c b/arch/powerpc/boot/fsl-soc.c
new file mode 100644
index 000000000000..b835ed69e1a1
--- /dev/null
+++ b/arch/powerpc/boot/fsl-soc.c
@@ -0,0 +1,57 @@
1/*
2 * Freescale SOC 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 "ops.h"
14#include "types.h"
15#include "fsl-soc.h"
16#include "stdio.h"
17
18static u32 prop_buf[MAX_PROP_LEN / 4];
19
20u32 *fsl_get_immr(void)
21{
22 void *soc;
23 unsigned long ret = 0;
24
25 soc = find_node_by_devtype(NULL, "soc");
26 if (soc) {
27 int size;
28 u32 naddr;
29
30 size = getprop(soc, "#address-cells", prop_buf, MAX_PROP_LEN);
31 if (size == 4)
32 naddr = prop_buf[0];
33 else
34 naddr = 2;
35
36 if (naddr != 1 && naddr != 2)
37 goto err;
38
39 size = getprop(soc, "ranges", prop_buf, MAX_PROP_LEN);
40
41 if (size < 12)
42 goto err;
43 if (prop_buf[0] != 0)
44 goto err;
45 if (naddr == 2 && prop_buf[1] != 0)
46 goto err;
47
48 if (!dt_xlate_addr(soc, prop_buf + naddr, 8, &ret))
49 ret = 0;
50 }
51
52err:
53 if (!ret)
54 printf("fsl_get_immr: Failed to find immr base\r\n");
55
56 return (u32 *)ret;
57}
diff --git a/arch/powerpc/boot/fsl-soc.h b/arch/powerpc/boot/fsl-soc.h
new file mode 100644
index 000000000000..5da26fc6e3cf
--- /dev/null
+++ b/arch/powerpc/boot/fsl-soc.h
@@ -0,0 +1,8 @@
1#ifndef _PPC_BOOT_FSL_SOC_H_
2#define _PPC_BOOT_FSL_SOC_H_
3
4#include "types.h"
5
6u32 *fsl_get_immr(void);
7
8#endif
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/mpc8xx.c b/arch/powerpc/boot/mpc8xx.c
new file mode 100644
index 000000000000..add55a7f184f
--- /dev/null
+++ b/arch/powerpc/boot/mpc8xx.c
@@ -0,0 +1,82 @@
1/*
2 * MPC8xx 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 "ops.h"
14#include "types.h"
15#include "fsl-soc.h"
16#include "mpc8xx.h"
17#include "stdio.h"
18#include "io.h"
19
20#define MPC8XX_PLPRCR (0x284/4) /* PLL and Reset Control Register */
21
22/* Return system clock from crystal frequency */
23u32 mpc885_get_clock(u32 crystal)
24{
25 u32 *immr;
26 u32 plprcr;
27 int mfi, mfn, mfd, pdf, div;
28 u32 ret;
29
30 immr = fsl_get_immr();
31 if (!immr) {
32 printf("mpc885_get_clock: Couldn't get IMMR base.\r\n");
33 return 0;
34 }
35
36 plprcr = in_be32(&immr[MPC8XX_PLPRCR]);
37
38 mfi = (plprcr >> 16) & 15;
39 if (mfi < 5) {
40 printf("Warning: PLPRCR[MFI] value of %d out-of-bounds\r\n",
41 mfi);
42 mfi = 5;
43 }
44
45 pdf = (plprcr >> 1) & 0xf;
46 div = (plprcr >> 20) & 3;
47 mfd = (plprcr >> 22) & 0x1f;
48 mfn = (plprcr >> 27) & 0x1f;
49
50 ret = crystal * mfi;
51
52 if (mfn != 0)
53 ret += crystal * mfn / (mfd + 1);
54
55 return ret / (pdf + 1);
56}
57
58/* Set common device tree fields based on the given clock frequencies. */
59void mpc8xx_set_clocks(u32 sysclk)
60{
61 void *node;
62
63 dt_fixup_cpu_clocks(sysclk, sysclk / 16, sysclk);
64
65 node = finddevice("/soc/cpm");
66 if (node)
67 setprop(node, "clock-frequency", &sysclk, 4);
68
69 node = finddevice("/soc/cpm/brg");
70 if (node)
71 setprop(node, "clock-frequency", &sysclk, 4);
72}
73
74int mpc885_fixup_clocks(u32 crystal)
75{
76 u32 sysclk = mpc885_get_clock(crystal);
77 if (!sysclk)
78 return 0;
79
80 mpc8xx_set_clocks(sysclk);
81 return 1;
82}
diff --git a/arch/powerpc/boot/mpc8xx.h b/arch/powerpc/boot/mpc8xx.h
new file mode 100644
index 000000000000..3f59901ab1c0
--- /dev/null
+++ b/arch/powerpc/boot/mpc8xx.h
@@ -0,0 +1,11 @@
1#ifndef _PPC_BOOT_MPC8xx_H_
2#define _PPC_BOOT_MPC8xx_H_
3
4#include "types.h"
5
6void mpc8xx_set_clocks(u32 sysclk);
7
8u32 mpc885_get_clock(u32 crystal);
9int mpc885_fixup_clocks(u32 crystal);
10
11#endif
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..a180b6505f47 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,16 @@ 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);
88int uartlite_console_init(void *devp, struct serial_console_data *scdp);
85void *simple_alloc_init(char *base, unsigned long heap_size, 89void *simple_alloc_init(char *base, unsigned long heap_size,
86 unsigned long granularity, unsigned long max_allocs); 90 unsigned long granularity, unsigned long max_allocs);
87extern void flush_cache(void *, unsigned long); 91extern void flush_cache(void *, unsigned long);
88int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size); 92int 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); 93int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr);
94int dt_is_compatible(void *node, const char *compat);
95void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize);
90 96
91static inline void *finddevice(const char *name) 97static inline void *finddevice(const char *name)
92{ 98{
@@ -156,6 +162,7 @@ static inline void *find_node_by_devtype(const void *prev,
156void dt_fixup_memory(u64 start, u64 size); 162void dt_fixup_memory(u64 start, u64 size);
157void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq); 163void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq);
158void dt_fixup_clock(const char *path, u32 freq); 164void dt_fixup_clock(const char *path, u32 freq);
165void dt_fixup_mac_address(u32 index, const u8 *addr);
159void __dt_fixup_mac_addresses(u32 startindex, ...); 166void __dt_fixup_mac_addresses(u32 startindex, ...);
160#define dt_fixup_mac_addresses(...) \ 167#define dt_fixup_mac_addresses(...) \
161 __dt_fixup_mac_addresses(0, __VA_ARGS__, NULL) 168 __dt_fixup_mac_addresses(0, __VA_ARGS__, NULL)
@@ -167,6 +174,14 @@ static inline void *find_node_by_linuxphandle(const u32 linuxphandle)
167 (char *)&linuxphandle, sizeof(u32)); 174 (char *)&linuxphandle, sizeof(u32));
168} 175}
169 176
177static inline char *get_path(const void *phandle, char *buf, int len)
178{
179 if (dt_ops.get_path)
180 return dt_ops.get_path(phandle, buf, len);
181
182 return NULL;
183}
184
170static inline void *malloc(unsigned long size) 185static inline void *malloc(unsigned long size)
171{ 186{
172 return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL; 187 return (platform_ops.malloc) ? platform_ops.malloc(size) : NULL;
@@ -191,4 +206,25 @@ static inline void exit(void)
191 static char _bss_stack[size]; \ 206 static char _bss_stack[size]; \
192 void *_platform_stack_top = _bss_stack + sizeof(_bss_stack); 207 void *_platform_stack_top = _bss_stack + sizeof(_bss_stack);
193 208
209extern unsigned long timebase_period_ns;
210void udelay(long delay);
211
212extern char _start[];
213extern char __bss_start[];
214extern char _end[];
215extern char _vmlinux_start[];
216extern char _vmlinux_end[];
217extern char _initrd_start[];
218extern char _initrd_end[];
219extern char _dtb_start[];
220extern char _dtb_end[];
221
222static inline __attribute__((const))
223int __ilog2_u32(u32 n)
224{
225 int bit;
226 asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n));
227 return 31 - bit;
228}
229
194#endif /* _PPC_BOOT_OPS_H_ */ 230#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/pq2.c b/arch/powerpc/boot/pq2.c
new file mode 100644
index 000000000000..f6d118558f1d
--- /dev/null
+++ b/arch/powerpc/boot/pq2.c
@@ -0,0 +1,102 @@
1/*
2 * PowerQUICC II 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 "ops.h"
14#include "types.h"
15#include "fsl-soc.h"
16#include "pq2.h"
17#include "stdio.h"
18#include "io.h"
19
20#define PQ2_SCCR (0x10c80/4) /* System Clock Configuration Register */
21#define PQ2_SCMR (0x10c88/4) /* System Clock Mode Register */
22
23static int pq2_corecnf_map[] = {
24 3, 2, 2, 2, 4, 4, 5, 9, 6, 11, 8, 10, 3, 12, 7, -1,
25 6, 5, 13, 2, 14, 4, 15, 9, 0, 11, 8, 10, 16, 12, 7, -1
26};
27
28/* Get various clocks from crystal frequency.
29 * Returns zero on failure and non-zero on success.
30 */
31int pq2_get_clocks(u32 crystal, u32 *sysfreq, u32 *corefreq,
32 u32 *timebase, u32 *brgfreq)
33{
34 u32 *immr;
35 u32 sccr, scmr, mainclk, busclk;
36 int corecnf, busdf, plldf, pllmf, dfbrg;
37
38 immr = fsl_get_immr();
39 if (!immr) {
40 printf("pq2_get_clocks: Couldn't get IMMR base.\r\n");
41 return 0;
42 }
43
44 sccr = in_be32(&immr[PQ2_SCCR]);
45 scmr = in_be32(&immr[PQ2_SCMR]);
46
47 dfbrg = sccr & 3;
48 corecnf = (scmr >> 24) & 0x1f;
49 busdf = (scmr >> 20) & 0xf;
50 plldf = (scmr >> 12) & 1;
51 pllmf = scmr & 0xfff;
52
53 mainclk = crystal * (pllmf + 1) / (plldf + 1);
54 busclk = mainclk / (busdf + 1);
55
56 if (sysfreq)
57 *sysfreq = mainclk / 2;
58 if (timebase)
59 *timebase = busclk / 4;
60 if (brgfreq)
61 *brgfreq = mainclk / (1 << ((dfbrg + 1) * 2));
62
63 if (corefreq) {
64 int coremult = pq2_corecnf_map[corecnf];
65
66 if (coremult < 0)
67 *corefreq = mainclk / 2;
68 else if (coremult == 0)
69 return 0;
70 else
71 *corefreq = busclk * coremult / 2;
72 }
73
74 return 1;
75}
76
77/* Set common device tree fields based on the given clock frequencies. */
78void pq2_set_clocks(u32 sysfreq, u32 corefreq, u32 timebase, u32 brgfreq)
79{
80 void *node;
81
82 dt_fixup_cpu_clocks(corefreq, timebase, sysfreq);
83
84 node = finddevice("/soc/cpm");
85 if (node)
86 setprop(node, "clock-frequency", &sysfreq, 4);
87
88 node = finddevice("/soc/cpm/brg");
89 if (node)
90 setprop(node, "clock-frequency", &brgfreq, 4);
91}
92
93int pq2_fixup_clocks(u32 crystal)
94{
95 u32 sysfreq, corefreq, timebase, brgfreq;
96
97 if (!pq2_get_clocks(crystal, &sysfreq, &corefreq, &timebase, &brgfreq))
98 return 0;
99
100 pq2_set_clocks(sysfreq, corefreq, timebase, brgfreq);
101 return 1;
102}
diff --git a/arch/powerpc/boot/pq2.h b/arch/powerpc/boot/pq2.h
new file mode 100644
index 000000000000..481698c7a51a
--- /dev/null
+++ b/arch/powerpc/boot/pq2.h
@@ -0,0 +1,11 @@
1#ifndef _PPC_BOOT_PQ2_H_
2#define _PPC_BOOT_PQ2_H_
3
4#include "types.h"
5
6int pq2_get_clocks(u32 crystal, u32 *sysfreq, u32 *corefreq,
7 u32 *timebase, u32 *brgfreq);
8void pq2_set_clocks(u32 sysfreq, u32 corefreq, u32 timebase, u32 brgfreq);
9int pq2_fixup_clocks(u32 crystal);
10
11#endif
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..cafeece20ac7 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,36 @@ 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);
131 else if (dt_is_compatible(devp, "xilinx,uartlite"))
132 rc = uartlite_console_init(devp, &serial_cd);
130 133
131 /* Add other serial console driver calls here */ 134 /* Add other serial console driver calls here */
132 135
133 if (!rc) { 136 if (!rc) {
134 console_ops.open = serial_open; 137 console_ops.open = serial_open;
135 console_ops.write = serial_write; 138 console_ops.write = serial_write;
136 console_ops.edit_cmdline = serial_edit_cmdline;
137 console_ops.close = serial_close; 139 console_ops.close = serial_close;
138 console_ops.data = &serial_cd; 140 console_ops.data = &serial_cd;
139 141
142 if (serial_cd.getc)
143 console_ops.edit_cmdline = serial_edit_cmdline;
144
140 return 0; 145 return 0;
141 } 146 }
142err_out: 147err_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..643e4cb2f11d 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
@@ -195,6 +219,19 @@ backwards_memcpy:
195 mtctr r7 219 mtctr r7
196 b 1b 220 b 1b
197 221
222 .globl memchr
223memchr:
224 cmpwi 0,r5,0
225 blelr
226 mtctr r5
227 addi r3,r3,-1
2281: lbzu r0,1(r3)
229 cmpw r0,r4
230 beqlr
231 bdnz 1b
232 li r3,0
233 blr
234
198 .globl memcmp 235 .globl memcmp
199memcmp: 236memcmp:
200 cmpwi 0,r5,0 237 cmpwi 0,r5,0
diff --git a/arch/powerpc/boot/string.h b/arch/powerpc/boot/string.h
index 9fdff1cc0d70..50091cc0eed9 100644
--- a/arch/powerpc/boot/string.h
+++ b/arch/powerpc/boot/string.h
@@ -5,13 +5,16 @@
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
12extern void *memset(void *s, int c, size_t n); 14extern void *memset(void *s, int c, size_t n);
13extern void *memmove(void *dest, const void *src, unsigned long n); 15extern void *memmove(void *dest, const void *src, unsigned long n);
14extern void *memcpy(void *dest, const void *src, unsigned long n); 16extern void *memcpy(void *dest, const void *src, unsigned long n);
17extern void *memchr(const void *s, int c, size_t n);
15extern int memcmp(const void *s1, const void *s2, size_t n); 18extern int memcmp(const void *s1, const void *s2, size_t n);
16 19
17#endif /* _PPC_BOOT_STRING_H_ */ 20#endif /* _PPC_BOOT_STRING_H_ */
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/boot/uartlite.c b/arch/powerpc/boot/uartlite.c
new file mode 100644
index 000000000000..46bed69b4169
--- /dev/null
+++ b/arch/powerpc/boot/uartlite.c
@@ -0,0 +1,79 @@
1/*
2 * Xilinx UARTLITE bootloader driver
3 *
4 * Copyright (C) 2007 Secret Lab Technologies Ltd.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11#include <stdarg.h>
12#include <stddef.h>
13#include "types.h"
14#include "string.h"
15#include "stdio.h"
16#include "io.h"
17#include "ops.h"
18
19#define ULITE_RX 0x00
20#define ULITE_TX 0x04
21#define ULITE_STATUS 0x08
22#define ULITE_CONTROL 0x0c
23
24#define ULITE_STATUS_RXVALID 0x01
25#define ULITE_STATUS_TXFULL 0x08
26
27#define ULITE_CONTROL_RST_RX 0x02
28
29static void * reg_base;
30
31static int uartlite_open(void)
32{
33 /* Clear the RX FIFO */
34 out_be32(reg_base + ULITE_CONTROL, ULITE_CONTROL_RST_RX);
35 return 0;
36}
37
38static void uartlite_putc(unsigned char c)
39{
40 u32 reg = ULITE_STATUS_TXFULL;
41 while (reg & ULITE_STATUS_TXFULL) /* spin on TXFULL bit */
42 reg = in_be32(reg_base + ULITE_STATUS);
43 out_be32(reg_base + ULITE_TX, c);
44}
45
46static unsigned char uartlite_getc(void)
47{
48 u32 reg = 0;
49 while (!(reg & ULITE_STATUS_RXVALID)) /* spin waiting for RXVALID bit */
50 reg = in_be32(reg_base + ULITE_STATUS);
51 return in_be32(reg_base + ULITE_RX);
52}
53
54static u8 uartlite_tstc(void)
55{
56 u32 reg = in_be32(reg_base + ULITE_STATUS);
57 return reg & ULITE_STATUS_RXVALID;
58}
59
60int uartlite_console_init(void *devp, struct serial_console_data *scdp)
61{
62 int n;
63 unsigned long reg_phys;
64
65 n = getprop(devp, "virtual-reg", &reg_base, sizeof(reg_base));
66 if (n != sizeof(reg_base)) {
67 if (!dt_xlate_reg(devp, 0, &reg_phys, NULL))
68 return -1;
69
70 reg_base = (void *)reg_phys;
71 }
72
73 scdp->open = uartlite_open;
74 scdp->putc = uartlite_putc;
75 scdp->getc = uartlite_getc;
76 scdp->tstc = uartlite_tstc;
77 scdp->close = NULL;
78 return 0;
79}
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 65f685479175..39b27e5ef6c1 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -29,6 +29,7 @@ initrd=
29dtb= 29dtb=
30dts= 30dts=
31cacheit= 31cacheit=
32binary=
32gzip=.gz 33gzip=.gz
33 34
34# cross-compilation prefix 35# cross-compilation prefix
@@ -142,17 +143,23 @@ miboot|uboot)
142 isection=initrd 143 isection=initrd
143 ;; 144 ;;
144cuboot*) 145cuboot*)
146 binary=y
145 gzip= 147 gzip=
146 ;; 148 ;;
147ps3) 149ps3)
148 platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o" 150 platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o"
149 lds=$object/zImage.ps3.lds 151 lds=$object/zImage.ps3.lds
152 binary=y
150 gzip= 153 gzip=
151 ext=bin 154 ext=bin
152 objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data" 155 objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data"
153 ksection=.kernel:vmlinux.bin 156 ksection=.kernel:vmlinux.bin
154 isection=.kernel:initrd 157 isection=.kernel:initrd
155 ;; 158 ;;
159ep88xc)
160 platformo="$object/fixed-head.o $object/$platform.o"
161 binary=y
162 ;;
156esac 163esac
157 164
158vmz="$tmpdir/`basename \"$kernel\"`.$ext" 165vmz="$tmpdir/`basename \"$kernel\"`.$ext"
@@ -224,6 +231,11 @@ fi
224base=0x`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1` 231base=0x`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1`
225entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | cut -d' ' -f3` 232entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | cut -d' ' -f3`
226 233
234if [ -n "$binary" ]; then
235 mv "$ofile" "$ofile".elf
236 ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin
237fi
238
227# post-processing needed for some platforms 239# post-processing needed for some platforms
228case "$platform" in 240case "$platform" in
229pseries|chrp) 241pseries|chrp)
@@ -234,8 +246,6 @@ coff)
234 $object/hack-coff "$ofile" 246 $object/hack-coff "$ofile"
235 ;; 247 ;;
236cuboot*) 248cuboot*)
237 mv "$ofile" "$ofile".elf
238 ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin
239 gzip -f -9 "$ofile".bin 249 gzip -f -9 "$ofile".bin
240 mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \ 250 mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
241 $uboot_version -d "$ofile".bin.gz "$ofile" 251 $uboot_version -d "$ofile".bin.gz "$ofile"
@@ -259,11 +269,11 @@ ps3)
259 # then copied to offset 0x100. At runtime the bootwrapper program 269 # then copied to offset 0x100. At runtime the bootwrapper program
260 # copies the 0x100 bytes at __system_reset_kernel to addr 0x100. 270 # copies the 0x100 bytes at __system_reset_kernel to addr 0x100.
261 271
262 system_reset_overlay=0x`${CROSS}nm "$ofile" \ 272 system_reset_overlay=0x`${CROSS}nm "$ofile".elf \
263 | grep ' __system_reset_overlay$' \ 273 | grep ' __system_reset_overlay$' \
264 | cut -d' ' -f1` 274 | cut -d' ' -f1`
265 system_reset_overlay=`printf "%d" $system_reset_overlay` 275 system_reset_overlay=`printf "%d" $system_reset_overlay`
266 system_reset_kernel=0x`${CROSS}nm "$ofile" \ 276 system_reset_kernel=0x`${CROSS}nm "$ofile".elf \
267 | grep ' __system_reset_kernel$' \ 277 | grep ' __system_reset_kernel$' \
268 | cut -d' ' -f1` 278 | cut -d' ' -f1`
269 system_reset_kernel=`printf "%d" $system_reset_kernel` 279 system_reset_kernel=`printf "%d" $system_reset_kernel`
@@ -272,8 +282,6 @@ ps3)
272 282
273 rm -f "$object/otheros.bld" 283 rm -f "$object/otheros.bld"
274 284
275 ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
276
277 msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ 285 msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
278 skip=$overlay_dest seek=$system_reset_kernel \ 286 skip=$overlay_dest seek=$system_reset_kernel \
279 count=$overlay_size bs=1 2>&1) 287 count=$overlay_size bs=1 2>&1)
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/ep88xc_defconfig b/arch/powerpc/configs/ep88xc_defconfig
new file mode 100644
index 000000000000..d8ee3c0dcadf
--- /dev/null
+++ b/arch/powerpc/configs/ep88xc_defconfig
@@ -0,0 +1,751 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc6
4# Fri Sep 14 14:59:56 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
13CONFIG_PPC_8xx=y
14# CONFIG_40x is not set
15# CONFIG_44x is not set
16# CONFIG_E200 is not set
17CONFIG_8xx=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
43# CONFIG_PPC_DCR_NATIVE is not set
44# CONFIG_PPC_DCR_MMIO is not set
45CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
46
47#
48# General setup
49#
50CONFIG_EXPERIMENTAL=y
51CONFIG_BROKEN_ON_SMP=y
52CONFIG_INIT_ENV_ARG_LIMIT=32
53CONFIG_LOCALVERSION=""
54CONFIG_LOCALVERSION_AUTO=y
55# CONFIG_SWAP is not set
56CONFIG_SYSVIPC=y
57CONFIG_SYSVIPC_SYSCTL=y
58# CONFIG_POSIX_MQUEUE is not set
59# CONFIG_BSD_PROCESS_ACCT is not set
60# CONFIG_TASKSTATS is not set
61# CONFIG_USER_NS is not set
62# CONFIG_AUDIT is not set
63# CONFIG_IKCONFIG is not set
64CONFIG_LOG_BUF_SHIFT=14
65CONFIG_SYSFS_DEPRECATED=y
66# CONFIG_RELAY is not set
67# CONFIG_BLK_DEV_INITRD is not set
68# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
69CONFIG_SYSCTL=y
70CONFIG_EMBEDDED=y
71# CONFIG_SYSCTL_SYSCALL is not set
72CONFIG_KALLSYMS=y
73# CONFIG_KALLSYMS_ALL is not set
74# CONFIG_KALLSYMS_EXTRA_PASS is not set
75CONFIG_HOTPLUG=y
76CONFIG_PRINTK=y
77CONFIG_BUG=y
78# CONFIG_ELF_CORE is not set
79# CONFIG_BASE_FULL is not set
80# CONFIG_FUTEX is not set
81CONFIG_ANON_INODES=y
82CONFIG_EPOLL=y
83CONFIG_SIGNALFD=y
84CONFIG_TIMERFD=y
85CONFIG_EVENTFD=y
86CONFIG_SHMEM=y
87# CONFIG_VM_EVENT_COUNTERS is not set
88CONFIG_SLUB_DEBUG=y
89# CONFIG_SLAB is not set
90CONFIG_SLUB=y
91# CONFIG_SLOB is not set
92# CONFIG_TINY_SHMEM is not set
93CONFIG_BASE_SMALL=1
94# CONFIG_MODULES is not set
95CONFIG_BLOCK=y
96# CONFIG_LBD is not set
97# CONFIG_BLK_DEV_IO_TRACE is not set
98# CONFIG_LSF is not set
99# CONFIG_BLK_DEV_BSG is not set
100
101#
102# IO Schedulers
103#
104CONFIG_IOSCHED_NOOP=y
105# CONFIG_IOSCHED_AS is not set
106CONFIG_IOSCHED_DEADLINE=y
107# CONFIG_IOSCHED_CFQ is not set
108# CONFIG_DEFAULT_AS is not set
109CONFIG_DEFAULT_DEADLINE=y
110# CONFIG_DEFAULT_CFQ is not set
111# CONFIG_DEFAULT_NOOP is not set
112CONFIG_DEFAULT_IOSCHED="deadline"
113
114#
115# Platform support
116#
117# CONFIG_PPC_MPC52xx is not set
118# CONFIG_PPC_MPC5200 is not set
119# CONFIG_PPC_CELL is not set
120# CONFIG_PPC_CELL_NATIVE is not set
121CONFIG_CPM1=y
122# CONFIG_MPC8XXFADS is not set
123# CONFIG_MPC86XADS is not set
124# CONFIG_MPC885ADS is not set
125CONFIG_PPC_EP88XC=y
126
127#
128# MPC8xx CPM Options
129#
130
131#
132# Generic MPC8xx Options
133#
134CONFIG_8xx_COPYBACK=y
135# CONFIG_8xx_CPU6 is not set
136CONFIG_8xx_CPU15=y
137CONFIG_NO_UCODE_PATCH=y
138# CONFIG_USB_SOF_UCODE_PATCH is not set
139# CONFIG_I2C_SPI_UCODE_PATCH is not set
140# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
141# CONFIG_PQ2ADS is not set
142# CONFIG_MPIC is not set
143# CONFIG_MPIC_WEIRD is not set
144# CONFIG_PPC_I8259 is not set
145# CONFIG_PPC_RTAS is not set
146# CONFIG_MMIO_NVRAM is not set
147# CONFIG_PPC_MPC106 is not set
148# CONFIG_PPC_970_NAP is not set
149# CONFIG_PPC_INDIRECT_IO is not set
150# CONFIG_GENERIC_IOMAP is not set
151# CONFIG_CPU_FREQ is not set
152# CONFIG_CPM2 is not set
153CONFIG_PPC_CPM_NEW_BINDING=y
154# CONFIG_FSL_ULI1575 is not set
155CONFIG_CPM=y
156
157#
158# Kernel options
159#
160# CONFIG_HIGHMEM is not set
161CONFIG_HZ_100=y
162# CONFIG_HZ_250 is not set
163# CONFIG_HZ_300 is not set
164# CONFIG_HZ_1000 is not set
165CONFIG_HZ=100
166CONFIG_PREEMPT_NONE=y
167# CONFIG_PREEMPT_VOLUNTARY is not set
168# CONFIG_PREEMPT is not set
169CONFIG_BINFMT_ELF=y
170# CONFIG_BINFMT_MISC is not set
171# CONFIG_MATH_EMULATION is not set
172CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
173CONFIG_ARCH_FLATMEM_ENABLE=y
174CONFIG_ARCH_POPULATES_NODE_MAP=y
175CONFIG_SELECT_MEMORY_MODEL=y
176CONFIG_FLATMEM_MANUAL=y
177# CONFIG_DISCONTIGMEM_MANUAL is not set
178# CONFIG_SPARSEMEM_MANUAL is not set
179CONFIG_FLATMEM=y
180CONFIG_FLAT_NODE_MEM_MAP=y
181# CONFIG_SPARSEMEM_STATIC is not set
182CONFIG_SPLIT_PTLOCK_CPUS=4
183# CONFIG_RESOURCES_64BIT is not set
184CONFIG_ZONE_DMA_FLAG=1
185CONFIG_BOUNCE=y
186CONFIG_VIRT_TO_BUS=y
187CONFIG_PROC_DEVICETREE=y
188# CONFIG_CMDLINE_BOOL is not set
189# CONFIG_PM is not set
190CONFIG_SUSPEND_UP_POSSIBLE=y
191CONFIG_HIBERNATION_UP_POSSIBLE=y
192# CONFIG_SECCOMP is not set
193CONFIG_WANT_DEVICE_TREE=y
194CONFIG_DEVICE_TREE="ep88xc.dts"
195CONFIG_ISA_DMA_API=y
196
197#
198# Bus options
199#
200CONFIG_ZONE_DMA=y
201CONFIG_FSL_SOC=y
202# CONFIG_PCI is not set
203# CONFIG_PCI_DOMAINS is not set
204# CONFIG_PCI_SYSCALL is not set
205# CONFIG_PCI_QSPAN is not set
206# CONFIG_ARCH_SUPPORTS_MSI is not set
207
208#
209# PCCARD (PCMCIA/CardBus) support
210#
211# CONFIG_PCCARD 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_CONSISTENT_START=0xfd000000
226CONFIG_CONSISTENT_SIZE=0x00200000
227CONFIG_BOOT_LOAD=0x00400000
228
229#
230# Networking
231#
232CONFIG_NET=y
233
234#
235# Networking options
236#
237CONFIG_PACKET=y
238# CONFIG_PACKET_MMAP is not set
239CONFIG_UNIX=y
240# CONFIG_NET_KEY is not set
241CONFIG_INET=y
242CONFIG_IP_MULTICAST=y
243# CONFIG_IP_ADVANCED_ROUTER is not set
244CONFIG_IP_FIB_HASH=y
245CONFIG_IP_PNP=y
246# CONFIG_IP_PNP_DHCP is not set
247# CONFIG_IP_PNP_BOOTP is not set
248# CONFIG_IP_PNP_RARP is not set
249# CONFIG_NET_IPIP is not set
250# CONFIG_NET_IPGRE is not set
251# CONFIG_IP_MROUTE is not set
252# CONFIG_ARPD is not set
253CONFIG_SYN_COOKIES=y
254# CONFIG_INET_AH is not set
255# CONFIG_INET_ESP is not set
256# CONFIG_INET_IPCOMP is not set
257# CONFIG_INET_XFRM_TUNNEL is not set
258# CONFIG_INET_TUNNEL is not set
259# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
260# CONFIG_INET_XFRM_MODE_TUNNEL is not set
261# CONFIG_INET_XFRM_MODE_BEET is not set
262CONFIG_INET_DIAG=y
263CONFIG_INET_TCP_DIAG=y
264# CONFIG_TCP_CONG_ADVANCED is not set
265CONFIG_TCP_CONG_CUBIC=y
266CONFIG_DEFAULT_TCP_CONG="cubic"
267# CONFIG_TCP_MD5SIG is not set
268# CONFIG_IPV6 is not set
269# CONFIG_INET6_XFRM_TUNNEL is not set
270# CONFIG_INET6_TUNNEL is not set
271# CONFIG_NETWORK_SECMARK is not set
272# CONFIG_NETFILTER is not set
273# CONFIG_IP_DCCP is not set
274# CONFIG_IP_SCTP is not set
275# CONFIG_TIPC is not set
276# CONFIG_ATM is not set
277# CONFIG_BRIDGE is not set
278# CONFIG_VLAN_8021Q is not set
279# CONFIG_DECNET is not set
280# CONFIG_LLC2 is not set
281# CONFIG_IPX is not set
282# CONFIG_ATALK is not set
283# CONFIG_X25 is not set
284# CONFIG_LAPB is not set
285# CONFIG_ECONET is not set
286# CONFIG_WAN_ROUTER is not set
287
288#
289# QoS and/or fair queueing
290#
291# CONFIG_NET_SCHED is not set
292
293#
294# Network testing
295#
296# CONFIG_NET_PKTGEN is not set
297# CONFIG_HAMRADIO is not set
298# CONFIG_IRDA is not set
299# CONFIG_BT is not set
300# CONFIG_AF_RXRPC is not set
301
302#
303# Wireless
304#
305# CONFIG_CFG80211 is not set
306# CONFIG_WIRELESS_EXT is not set
307# CONFIG_MAC80211 is not set
308# CONFIG_IEEE80211 is not set
309# CONFIG_RFKILL is not set
310# CONFIG_NET_9P is not set
311
312#
313# Device Drivers
314#
315
316#
317# Generic Driver Options
318#
319CONFIG_STANDALONE=y
320CONFIG_PREVENT_FIRMWARE_BUILD=y
321# CONFIG_FW_LOADER is not set
322# CONFIG_DEBUG_DRIVER is not set
323# CONFIG_DEBUG_DEVRES is not set
324# CONFIG_SYS_HYPERVISOR is not set
325# CONFIG_CONNECTOR is not set
326CONFIG_MTD=y
327# CONFIG_MTD_DEBUG is not set
328# CONFIG_MTD_CONCAT is not set
329# CONFIG_MTD_PARTITIONS is not set
330
331#
332# User Modules And Translation Layers
333#
334CONFIG_MTD_CHAR=y
335CONFIG_MTD_BLKDEVS=y
336CONFIG_MTD_BLOCK=y
337# CONFIG_FTL is not set
338# CONFIG_NFTL is not set
339# CONFIG_INFTL is not set
340# CONFIG_RFD_FTL is not set
341# CONFIG_SSFDC is not set
342
343#
344# RAM/ROM/Flash chip drivers
345#
346CONFIG_MTD_CFI=y
347# CONFIG_MTD_JEDECPROBE is not set
348CONFIG_MTD_GEN_PROBE=y
349# CONFIG_MTD_CFI_ADV_OPTIONS is not set
350CONFIG_MTD_MAP_BANK_WIDTH_1=y
351CONFIG_MTD_MAP_BANK_WIDTH_2=y
352CONFIG_MTD_MAP_BANK_WIDTH_4=y
353# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
354# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
355# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
356CONFIG_MTD_CFI_I1=y
357CONFIG_MTD_CFI_I2=y
358# CONFIG_MTD_CFI_I4 is not set
359# CONFIG_MTD_CFI_I8 is not set
360# CONFIG_MTD_CFI_INTELEXT is not set
361CONFIG_MTD_CFI_AMDSTD=y
362# CONFIG_MTD_CFI_STAA is not set
363CONFIG_MTD_CFI_UTIL=y
364# CONFIG_MTD_RAM is not set
365# CONFIG_MTD_ROM is not set
366# CONFIG_MTD_ABSENT is not set
367
368#
369# Mapping drivers for chip access
370#
371# CONFIG_MTD_COMPLEX_MAPPINGS is not set
372# CONFIG_MTD_PHYSMAP is not set
373CONFIG_MTD_PHYSMAP_OF=y
374# CONFIG_MTD_CFI_FLAGADM is not set
375# CONFIG_MTD_PLATRAM is not set
376
377#
378# Self-contained MTD device drivers
379#
380# CONFIG_MTD_SLRAM is not set
381# CONFIG_MTD_PHRAM is not set
382# CONFIG_MTD_MTDRAM is not set
383# CONFIG_MTD_BLOCK2MTD is not set
384
385#
386# Disk-On-Chip Device Drivers
387#
388# CONFIG_MTD_DOC2000 is not set
389# CONFIG_MTD_DOC2001 is not set
390# CONFIG_MTD_DOC2001PLUS is not set
391# CONFIG_MTD_NAND is not set
392# CONFIG_MTD_ONENAND is not set
393
394#
395# UBI - Unsorted block images
396#
397# CONFIG_MTD_UBI is not set
398CONFIG_OF_DEVICE=y
399# CONFIG_PARPORT is not set
400# CONFIG_BLK_DEV is not set
401# CONFIG_MISC_DEVICES 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
421CONFIG_PHYLIB=y
422
423#
424# MII PHY device drivers
425#
426# CONFIG_MARVELL_PHY is not set
427# CONFIG_DAVICOM_PHY is not set
428# CONFIG_QSEMI_PHY is not set
429CONFIG_LXT_PHY=y
430# CONFIG_CICADA_PHY is not set
431# CONFIG_VITESSE_PHY is not set
432# CONFIG_SMSC_PHY is not set
433# CONFIG_BROADCOM_PHY is not set
434# CONFIG_ICPLUS_PHY is not set
435# CONFIG_FIXED_PHY is not set
436# CONFIG_MDIO_BITBANG is not set
437CONFIG_NET_ETHERNET=y
438CONFIG_MII=y
439CONFIG_FS_ENET=y
440# CONFIG_FS_ENET_HAS_SCC is not set
441CONFIG_FS_ENET_HAS_FEC=y
442# CONFIG_NETDEV_1000 is not set
443# CONFIG_NETDEV_10000 is not set
444
445#
446# Wireless LAN
447#
448# CONFIG_WLAN_PRE80211 is not set
449# CONFIG_WLAN_80211 is not set
450# CONFIG_WAN is not set
451# CONFIG_PPP is not set
452# CONFIG_SLIP is not set
453# CONFIG_SHAPER is not set
454# CONFIG_NETCONSOLE is not set
455# CONFIG_NETPOLL is not set
456# CONFIG_NET_POLL_CONTROLLER is not set
457# CONFIG_ISDN is not set
458# CONFIG_PHONE is not set
459
460#
461# Input device support
462#
463# CONFIG_INPUT is not set
464
465#
466# Hardware I/O ports
467#
468# CONFIG_SERIO is not set
469# CONFIG_GAMEPORT is not set
470
471#
472# Character devices
473#
474# CONFIG_VT is not set
475# CONFIG_SERIAL_NONSTANDARD is not set
476
477#
478# Serial drivers
479#
480# CONFIG_SERIAL_8250 is not set
481
482#
483# Non-8250 serial port support
484#
485# CONFIG_SERIAL_UARTLITE is not set
486CONFIG_SERIAL_CORE=y
487CONFIG_SERIAL_CORE_CONSOLE=y
488CONFIG_SERIAL_CPM=y
489CONFIG_SERIAL_CPM_CONSOLE=y
490# CONFIG_SERIAL_CPM_SCC1 is not set
491# CONFIG_SERIAL_CPM_SCC2 is not set
492# CONFIG_SERIAL_CPM_SCC3 is not set
493# CONFIG_SERIAL_CPM_SCC4 is not set
494CONFIG_SERIAL_CPM_SMC1=y
495CONFIG_SERIAL_CPM_SMC2=y
496CONFIG_UNIX98_PTYS=y
497# CONFIG_LEGACY_PTYS is not set
498# CONFIG_IPMI_HANDLER is not set
499# CONFIG_WATCHDOG is not set
500CONFIG_HW_RANDOM=y
501# CONFIG_NVRAM is not set
502CONFIG_GEN_RTC=y
503# CONFIG_GEN_RTC_X is not set
504# CONFIG_R3964 is not set
505# CONFIG_RAW_DRIVER is not set
506# CONFIG_TCG_TPM is not set
507# CONFIG_I2C is not set
508
509#
510# SPI support
511#
512# CONFIG_SPI is not set
513# CONFIG_SPI_MASTER is not set
514# CONFIG_W1 is not set
515# CONFIG_POWER_SUPPLY is not set
516# CONFIG_HWMON is not set
517
518#
519# Multifunction device drivers
520#
521# CONFIG_MFD_SM501 is not set
522
523#
524# Multimedia devices
525#
526# CONFIG_VIDEO_DEV is not set
527# CONFIG_DVB_CORE is not set
528CONFIG_DAB=y
529
530#
531# Graphics support
532#
533# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
534
535#
536# Display device support
537#
538# CONFIG_DISPLAY_SUPPORT is not set
539# CONFIG_VGASTATE is not set
540# CONFIG_VIDEO_OUTPUT_CONTROL is not set
541# CONFIG_FB is not set
542# CONFIG_FB_IBM_GXT4500 is not set
543
544#
545# Sound
546#
547# CONFIG_SOUND is not set
548# CONFIG_USB_SUPPORT is not set
549# CONFIG_MMC is not set
550# CONFIG_NEW_LEDS is not set
551# CONFIG_EDAC is not set
552# CONFIG_RTC_CLASS is not set
553
554#
555# DMA Engine support
556#
557# CONFIG_DMA_ENGINE is not set
558
559#
560# DMA Clients
561#
562
563#
564# DMA Devices
565#
566
567#
568# Userspace I/O
569#
570# CONFIG_UIO is not set
571
572#
573# File systems
574#
575# CONFIG_EXT2_FS is not set
576# CONFIG_EXT3_FS is not set
577# CONFIG_EXT4DEV_FS is not set
578# CONFIG_REISERFS_FS is not set
579# CONFIG_JFS_FS is not set
580# CONFIG_FS_POSIX_ACL is not set
581# CONFIG_XFS_FS is not set
582# CONFIG_GFS2_FS is not set
583# CONFIG_OCFS2_FS is not set
584# CONFIG_MINIX_FS is not set
585# CONFIG_ROMFS_FS is not set
586# CONFIG_INOTIFY is not set
587# CONFIG_QUOTA is not set
588# CONFIG_DNOTIFY is not set
589# CONFIG_AUTOFS_FS is not set
590# CONFIG_AUTOFS4_FS is not set
591# CONFIG_FUSE_FS is not set
592
593#
594# CD-ROM/DVD Filesystems
595#
596# CONFIG_ISO9660_FS is not set
597# CONFIG_UDF_FS is not set
598
599#
600# DOS/FAT/NT Filesystems
601#
602# CONFIG_MSDOS_FS is not set
603# CONFIG_VFAT_FS is not set
604# CONFIG_NTFS_FS is not set
605
606#
607# Pseudo filesystems
608#
609CONFIG_PROC_FS=y
610# CONFIG_PROC_KCORE is not set
611CONFIG_PROC_SYSCTL=y
612CONFIG_SYSFS=y
613CONFIG_TMPFS=y
614# CONFIG_TMPFS_POSIX_ACL is not set
615# CONFIG_HUGETLB_PAGE is not set
616CONFIG_RAMFS=y
617# CONFIG_CONFIGFS_FS is not set
618
619#
620# Miscellaneous filesystems
621#
622# CONFIG_ADFS_FS is not set
623# CONFIG_AFFS_FS is not set
624# CONFIG_HFS_FS is not set
625# CONFIG_HFSPLUS_FS is not set
626# CONFIG_BEFS_FS is not set
627# CONFIG_BFS_FS is not set
628# CONFIG_EFS_FS is not set
629# CONFIG_JFFS2_FS is not set
630CONFIG_CRAMFS=y
631# CONFIG_VXFS_FS is not set
632# CONFIG_HPFS_FS is not set
633# CONFIG_QNX4FS_FS is not set
634# CONFIG_SYSV_FS is not set
635# CONFIG_UFS_FS is not set
636
637#
638# Network File Systems
639#
640CONFIG_NFS_FS=y
641CONFIG_NFS_V3=y
642# CONFIG_NFS_V3_ACL is not set
643# CONFIG_NFS_V4 is not set
644# CONFIG_NFS_DIRECTIO is not set
645# CONFIG_NFSD is not set
646CONFIG_ROOT_NFS=y
647CONFIG_LOCKD=y
648CONFIG_LOCKD_V4=y
649CONFIG_NFS_COMMON=y
650CONFIG_SUNRPC=y
651# CONFIG_SUNRPC_BIND34 is not set
652# CONFIG_RPCSEC_GSS_KRB5 is not set
653# CONFIG_RPCSEC_GSS_SPKM3 is not set
654# CONFIG_SMB_FS is not set
655# CONFIG_CIFS is not set
656# CONFIG_NCP_FS is not set
657# CONFIG_CODA_FS is not set
658# CONFIG_AFS_FS is not set
659
660#
661# Partition Types
662#
663CONFIG_PARTITION_ADVANCED=y
664# CONFIG_ACORN_PARTITION is not set
665# CONFIG_OSF_PARTITION is not set
666# CONFIG_AMIGA_PARTITION is not set
667# CONFIG_ATARI_PARTITION is not set
668# CONFIG_MAC_PARTITION is not set
669CONFIG_MSDOS_PARTITION=y
670# CONFIG_BSD_DISKLABEL is not set
671# CONFIG_MINIX_SUBPARTITION is not set
672# CONFIG_SOLARIS_X86_PARTITION is not set
673# CONFIG_UNIXWARE_DISKLABEL is not set
674# CONFIG_LDM_PARTITION is not set
675# CONFIG_SGI_PARTITION is not set
676# CONFIG_ULTRIX_PARTITION is not set
677# CONFIG_SUN_PARTITION is not set
678# CONFIG_KARMA_PARTITION is not set
679# CONFIG_EFI_PARTITION is not set
680# CONFIG_SYSV68_PARTITION is not set
681
682#
683# Native Language Support
684#
685# CONFIG_NLS is not set
686
687#
688# Distributed Lock Manager
689#
690# CONFIG_DLM is not set
691# CONFIG_UCC_SLOW is not set
692
693#
694# Library routines
695#
696# CONFIG_CRC_CCITT is not set
697# CONFIG_CRC16 is not set
698# CONFIG_CRC_ITU_T is not set
699# CONFIG_CRC32 is not set
700# CONFIG_CRC7 is not set
701# CONFIG_LIBCRC32C is not set
702CONFIG_ZLIB_INFLATE=y
703CONFIG_HAS_IOMEM=y
704CONFIG_HAS_IOPORT=y
705CONFIG_HAS_DMA=y
706
707#
708# Instrumentation Support
709#
710# CONFIG_PROFILING is not set
711
712#
713# Kernel hacking
714#
715# CONFIG_PRINTK_TIME is not set
716CONFIG_ENABLE_MUST_CHECK=y
717CONFIG_MAGIC_SYSRQ=y
718# CONFIG_UNUSED_SYMBOLS is not set
719# CONFIG_DEBUG_FS is not set
720# CONFIG_HEADERS_CHECK is not set
721CONFIG_DEBUG_KERNEL=y
722# CONFIG_DEBUG_SHIRQ is not set
723CONFIG_DETECT_SOFTLOCKUP=y
724CONFIG_SCHED_DEBUG=y
725# CONFIG_SCHEDSTATS is not set
726# CONFIG_TIMER_STATS is not set
727# CONFIG_SLUB_DEBUG_ON is not set
728# CONFIG_DEBUG_SPINLOCK is not set
729# CONFIG_DEBUG_MUTEXES is not set
730# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
731# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
732# CONFIG_DEBUG_KOBJECT is not set
733CONFIG_DEBUG_BUGVERBOSE=y
734CONFIG_DEBUG_INFO=y
735# CONFIG_DEBUG_VM is not set
736# CONFIG_DEBUG_LIST is not set
737CONFIG_FORCED_INLINING=y
738# CONFIG_FAULT_INJECTION is not set
739# CONFIG_DEBUG_STACKOVERFLOW is not set
740# CONFIG_DEBUG_STACK_USAGE is not set
741# CONFIG_DEBUG_PAGEALLOC is not set
742# CONFIG_DEBUGGER is not set
743# CONFIG_BDI_SWITCH is not set
744# CONFIG_PPC_EARLY_DEBUG is not set
745
746#
747# Security options
748#
749# CONFIG_KEYS is not set
750# CONFIG_SECURITY is not set
751# CONFIG_CRYPTO is not set
diff --git a/arch/powerpc/configs/kilauea_defconfig b/arch/powerpc/configs/kilauea_defconfig
new file mode 100644
index 000000000000..31790d329269
--- /dev/null
+++ b/arch/powerpc/configs/kilauea_defconfig
@@ -0,0 +1,768 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc9
4# Thu Oct 11 19:05:15 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_WORD_SIZE=32
22CONFIG_PPC_MERGE=y
23CONFIG_MMU=y
24CONFIG_GENERIC_CMOS_UPDATE=y
25CONFIG_GENERIC_TIME=y
26CONFIG_GENERIC_TIME_VSYSCALL=y
27CONFIG_GENERIC_CLOCKEVENTS=y
28CONFIG_GENERIC_HARDIRQS=y
29CONFIG_IRQ_PER_CPU=y
30CONFIG_RWSEM_XCHGADD_ALGORITHM=y
31CONFIG_ARCH_HAS_ILOG2_U32=y
32CONFIG_GENERIC_HWEIGHT=y
33CONFIG_GENERIC_CALIBRATE_DELAY=y
34CONFIG_GENERIC_FIND_NEXT_BIT=y
35# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
36CONFIG_PPC=y
37CONFIG_EARLY_PRINTK=y
38CONFIG_GENERIC_NVRAM=y
39CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
40CONFIG_ARCH_MAY_HAVE_PC_FDC=y
41CONFIG_PPC_OF=y
42CONFIG_OF=y
43# CONFIG_PPC_UDBG_16550 is not set
44# CONFIG_GENERIC_TBSYNC is not set
45CONFIG_AUDIT_ARCH=y
46CONFIG_GENERIC_BUG=y
47# CONFIG_DEFAULT_UIMAGE is not set
48CONFIG_PPC_DCR_NATIVE=y
49# CONFIG_PPC_DCR_MMIO is not set
50CONFIG_PPC_DCR=y
51CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
52
53#
54# General setup
55#
56CONFIG_EXPERIMENTAL=y
57CONFIG_BROKEN_ON_SMP=y
58CONFIG_INIT_ENV_ARG_LIMIT=32
59CONFIG_LOCALVERSION=""
60CONFIG_LOCALVERSION_AUTO=y
61CONFIG_SWAP=y
62CONFIG_SYSVIPC=y
63CONFIG_SYSVIPC_SYSCTL=y
64CONFIG_POSIX_MQUEUE=y
65# CONFIG_BSD_PROCESS_ACCT is not set
66# CONFIG_TASKSTATS is not set
67# CONFIG_USER_NS is not set
68# CONFIG_AUDIT is not set
69# CONFIG_IKCONFIG is not set
70CONFIG_LOG_BUF_SHIFT=14
71CONFIG_SYSFS_DEPRECATED=y
72# CONFIG_RELAY is not set
73CONFIG_BLK_DEV_INITRD=y
74CONFIG_INITRAMFS_SOURCE=""
75# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
76CONFIG_SYSCTL=y
77CONFIG_EMBEDDED=y
78CONFIG_SYSCTL_SYSCALL=y
79CONFIG_KALLSYMS=y
80CONFIG_KALLSYMS_ALL=y
81CONFIG_KALLSYMS_EXTRA_PASS=y
82CONFIG_HOTPLUG=y
83CONFIG_PRINTK=y
84CONFIG_BUG=y
85CONFIG_ELF_CORE=y
86CONFIG_BASE_FULL=y
87CONFIG_FUTEX=y
88CONFIG_ANON_INODES=y
89CONFIG_EPOLL=y
90CONFIG_SIGNALFD=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_KILAUEA=y
134# CONFIG_WALNUT is not set
135# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
136# CONFIG_MPIC is not set
137# CONFIG_MPIC_WEIRD is not set
138# CONFIG_PPC_I8259 is not set
139# CONFIG_PPC_RTAS is not set
140# CONFIG_MMIO_NVRAM is not set
141# CONFIG_PPC_MPC106 is not set
142# CONFIG_PPC_970_NAP is not set
143# CONFIG_PPC_INDIRECT_IO is not set
144# CONFIG_GENERIC_IOMAP is not set
145# CONFIG_CPU_FREQ is not set
146# CONFIG_CPM2 is not set
147# CONFIG_FSL_ULI1575 is not set
148
149#
150# Kernel options
151#
152# CONFIG_HIGHMEM is not set
153# CONFIG_TICK_ONESHOT is not set
154# CONFIG_NO_HZ is not set
155# CONFIG_HIGH_RES_TIMERS is not set
156# CONFIG_HZ_100 is not set
157CONFIG_HZ_250=y
158# CONFIG_HZ_300 is not set
159# CONFIG_HZ_1000 is not set
160CONFIG_HZ=250
161CONFIG_PREEMPT_NONE=y
162# CONFIG_PREEMPT_VOLUNTARY is not set
163# CONFIG_PREEMPT is not set
164CONFIG_BINFMT_ELF=y
165# CONFIG_BINFMT_MISC is not set
166# CONFIG_MATH_EMULATION is not set
167CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
168CONFIG_ARCH_FLATMEM_ENABLE=y
169CONFIG_ARCH_POPULATES_NODE_MAP=y
170CONFIG_SELECT_MEMORY_MODEL=y
171CONFIG_FLATMEM_MANUAL=y
172# CONFIG_DISCONTIGMEM_MANUAL is not set
173# CONFIG_SPARSEMEM_MANUAL is not set
174CONFIG_FLATMEM=y
175CONFIG_FLAT_NODE_MEM_MAP=y
176# CONFIG_SPARSEMEM_STATIC is not set
177CONFIG_SPLIT_PTLOCK_CPUS=4
178# CONFIG_RESOURCES_64BIT is not set
179CONFIG_ZONE_DMA_FLAG=1
180CONFIG_BOUNCE=y
181CONFIG_VIRT_TO_BUS=y
182CONFIG_PROC_DEVICETREE=y
183# CONFIG_CMDLINE_BOOL is not set
184# CONFIG_PM is not set
185CONFIG_SUSPEND_UP_POSSIBLE=y
186CONFIG_HIBERNATION_UP_POSSIBLE=y
187CONFIG_SECCOMP=y
188CONFIG_WANT_DEVICE_TREE=y
189CONFIG_DEVICE_TREE="kilauea.dts"
190CONFIG_ISA_DMA_API=y
191
192#
193# Bus options
194#
195CONFIG_ZONE_DMA=y
196# CONFIG_PCI is not set
197# CONFIG_PCI_DOMAINS is not set
198# CONFIG_PCI_SYSCALL is not set
199# CONFIG_ARCH_SUPPORTS_MSI is not set
200
201#
202# PCCARD (PCMCIA/CardBus) support
203#
204# CONFIG_PCCARD 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=0x00400000
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
319CONFIG_MTD=y
320# CONFIG_MTD_DEBUG is not set
321# CONFIG_MTD_CONCAT is not set
322CONFIG_MTD_PARTITIONS=y
323# CONFIG_MTD_REDBOOT_PARTS is not set
324CONFIG_MTD_CMDLINE_PARTS=y
325
326#
327# User Modules And Translation Layers
328#
329CONFIG_MTD_CHAR=y
330CONFIG_MTD_BLKDEVS=m
331CONFIG_MTD_BLOCK=m
332# CONFIG_MTD_BLOCK_RO is not set
333# CONFIG_FTL is not set
334# CONFIG_NFTL is not set
335# CONFIG_INFTL is not set
336# CONFIG_RFD_FTL is not set
337# CONFIG_SSFDC is not set
338
339#
340# RAM/ROM/Flash chip drivers
341#
342CONFIG_MTD_CFI=y
343CONFIG_MTD_JEDECPROBE=y
344CONFIG_MTD_GEN_PROBE=y
345# CONFIG_MTD_CFI_ADV_OPTIONS is not set
346CONFIG_MTD_MAP_BANK_WIDTH_1=y
347CONFIG_MTD_MAP_BANK_WIDTH_2=y
348CONFIG_MTD_MAP_BANK_WIDTH_4=y
349# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
350# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
351# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
352CONFIG_MTD_CFI_I1=y
353CONFIG_MTD_CFI_I2=y
354# CONFIG_MTD_CFI_I4 is not set
355# CONFIG_MTD_CFI_I8 is not set
356# CONFIG_MTD_CFI_INTELEXT is not set
357CONFIG_MTD_CFI_AMDSTD=y
358# CONFIG_MTD_CFI_STAA is not set
359CONFIG_MTD_CFI_UTIL=y
360# CONFIG_MTD_RAM is not set
361# CONFIG_MTD_ROM is not set
362# CONFIG_MTD_ABSENT is not set
363
364#
365# Mapping drivers for chip access
366#
367# CONFIG_MTD_COMPLEX_MAPPINGS is not set
368# CONFIG_MTD_PHYSMAP is not set
369CONFIG_MTD_PHYSMAP_OF=y
370# CONFIG_MTD_PLATRAM is not set
371
372#
373# Self-contained MTD device drivers
374#
375# CONFIG_MTD_SLRAM is not set
376# CONFIG_MTD_PHRAM is not set
377# CONFIG_MTD_MTDRAM is not set
378# CONFIG_MTD_BLOCK2MTD is not set
379
380#
381# Disk-On-Chip Device Drivers
382#
383# CONFIG_MTD_DOC2000 is not set
384# CONFIG_MTD_DOC2001 is not set
385# CONFIG_MTD_DOC2001PLUS is not set
386# CONFIG_MTD_NAND is not set
387# CONFIG_MTD_ONENAND is not set
388
389#
390# UBI - Unsorted block images
391#
392# CONFIG_MTD_UBI is not set
393CONFIG_OF_DEVICE=y
394# CONFIG_PARPORT is not set
395CONFIG_BLK_DEV=y
396# CONFIG_BLK_DEV_FD is not set
397# CONFIG_BLK_DEV_COW_COMMON is not set
398# CONFIG_BLK_DEV_LOOP is not set
399# CONFIG_BLK_DEV_NBD is not set
400CONFIG_BLK_DEV_RAM=y
401CONFIG_BLK_DEV_RAM_COUNT=16
402CONFIG_BLK_DEV_RAM_SIZE=35000
403CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
404# CONFIG_CDROM_PKTCDVD is not set
405# CONFIG_ATA_OVER_ETH is not set
406# CONFIG_XILINX_SYSACE is not set
407# CONFIG_MISC_DEVICES is not set
408# CONFIG_IDE is not set
409
410#
411# SCSI device support
412#
413# CONFIG_RAID_ATTRS is not set
414# CONFIG_SCSI is not set
415# CONFIG_SCSI_DMA is not set
416# CONFIG_SCSI_NETLINK is not set
417# CONFIG_ATA is not set
418# CONFIG_MD is not set
419# CONFIG_MACINTOSH_DRIVERS is not set
420CONFIG_NETDEVICES=y
421# CONFIG_NETDEVICES_MULTIQUEUE is not set
422# CONFIG_DUMMY is not set
423# CONFIG_BONDING is not set
424# CONFIG_MACVLAN is not set
425# CONFIG_EQUALIZER is not set
426# CONFIG_TUN is not set
427# CONFIG_NET_ETHERNET is not set
428# CONFIG_NETDEV_1000 is not set
429# CONFIG_NETDEV_10000 is not set
430
431#
432# Wireless LAN
433#
434# CONFIG_WLAN_PRE80211 is not set
435# CONFIG_WLAN_80211 is not set
436# CONFIG_WAN is not set
437# CONFIG_PPP is not set
438# CONFIG_SLIP is not set
439# CONFIG_SHAPER is not set
440# CONFIG_NETCONSOLE is not set
441# CONFIG_NETPOLL is not set
442# CONFIG_NET_POLL_CONTROLLER is not set
443# CONFIG_ISDN is not set
444# CONFIG_PHONE is not set
445
446#
447# Input device support
448#
449# CONFIG_INPUT is not set
450
451#
452# Hardware I/O ports
453#
454# CONFIG_SERIO is not set
455# CONFIG_GAMEPORT is not set
456
457#
458# Character devices
459#
460# CONFIG_VT is not set
461# CONFIG_SERIAL_NONSTANDARD is not set
462
463#
464# Serial drivers
465#
466CONFIG_SERIAL_8250=y
467CONFIG_SERIAL_8250_CONSOLE=y
468CONFIG_SERIAL_8250_NR_UARTS=4
469CONFIG_SERIAL_8250_RUNTIME_UARTS=4
470CONFIG_SERIAL_8250_EXTENDED=y
471# CONFIG_SERIAL_8250_MANY_PORTS is not set
472CONFIG_SERIAL_8250_SHARE_IRQ=y
473# CONFIG_SERIAL_8250_DETECT_IRQ is not set
474# CONFIG_SERIAL_8250_RSA is not set
475
476#
477# Non-8250 serial port support
478#
479# CONFIG_SERIAL_UARTLITE is not set
480CONFIG_SERIAL_CORE=y
481CONFIG_SERIAL_CORE_CONSOLE=y
482CONFIG_SERIAL_OF_PLATFORM=y
483CONFIG_UNIX98_PTYS=y
484CONFIG_LEGACY_PTYS=y
485CONFIG_LEGACY_PTY_COUNT=256
486# CONFIG_IPMI_HANDLER is not set
487# CONFIG_WATCHDOG is not set
488# CONFIG_HW_RANDOM is not set
489# CONFIG_NVRAM is not set
490# CONFIG_GEN_RTC is not set
491# CONFIG_R3964 is not set
492# CONFIG_RAW_DRIVER is not set
493# CONFIG_TCG_TPM is not set
494# CONFIG_I2C is not set
495
496#
497# SPI support
498#
499# CONFIG_SPI is not set
500# CONFIG_SPI_MASTER is not set
501# CONFIG_W1 is not set
502# CONFIG_POWER_SUPPLY is not set
503# CONFIG_HWMON is not set
504
505#
506# Multifunction device drivers
507#
508# CONFIG_MFD_SM501 is not set
509
510#
511# Multimedia devices
512#
513# CONFIG_VIDEO_DEV is not set
514# CONFIG_DVB_CORE is not set
515# CONFIG_DAB is not set
516
517#
518# Graphics support
519#
520# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
521
522#
523# Display device support
524#
525# CONFIG_DISPLAY_SUPPORT is not set
526# CONFIG_VGASTATE is not set
527# CONFIG_VIDEO_OUTPUT_CONTROL is not set
528# CONFIG_FB is not set
529# CONFIG_FB_IBM_GXT4500 is not set
530
531#
532# Sound
533#
534# CONFIG_SOUND is not set
535# CONFIG_USB_SUPPORT is not set
536# CONFIG_MMC is not set
537# CONFIG_NEW_LEDS is not set
538# CONFIG_EDAC is not set
539# CONFIG_RTC_CLASS is not set
540
541#
542# DMA Engine support
543#
544# CONFIG_DMA_ENGINE is not set
545
546#
547# DMA Clients
548#
549
550#
551# DMA Devices
552#
553
554#
555# Userspace I/O
556#
557# CONFIG_UIO is not set
558
559#
560# File systems
561#
562CONFIG_EXT2_FS=y
563# CONFIG_EXT2_FS_XATTR is not set
564# CONFIG_EXT2_FS_XIP is not set
565# CONFIG_EXT3_FS is not set
566# CONFIG_EXT4DEV_FS is not set
567# CONFIG_REISERFS_FS is not set
568# CONFIG_JFS_FS is not set
569# CONFIG_FS_POSIX_ACL is not set
570# CONFIG_XFS_FS is not set
571# CONFIG_GFS2_FS is not set
572# CONFIG_OCFS2_FS is not set
573# CONFIG_MINIX_FS is not set
574# CONFIG_ROMFS_FS is not set
575CONFIG_INOTIFY=y
576CONFIG_INOTIFY_USER=y
577# CONFIG_QUOTA is not set
578CONFIG_DNOTIFY=y
579# CONFIG_AUTOFS_FS is not set
580# CONFIG_AUTOFS4_FS is not set
581# CONFIG_FUSE_FS is not set
582
583#
584# CD-ROM/DVD Filesystems
585#
586# CONFIG_ISO9660_FS is not set
587# CONFIG_UDF_FS is not set
588
589#
590# DOS/FAT/NT Filesystems
591#
592# CONFIG_MSDOS_FS is not set
593# CONFIG_VFAT_FS is not set
594# CONFIG_NTFS_FS is not set
595
596#
597# Pseudo filesystems
598#
599CONFIG_PROC_FS=y
600CONFIG_PROC_KCORE=y
601CONFIG_PROC_SYSCTL=y
602CONFIG_SYSFS=y
603CONFIG_TMPFS=y
604# CONFIG_TMPFS_POSIX_ACL is not set
605# CONFIG_HUGETLB_PAGE is not set
606CONFIG_RAMFS=y
607# CONFIG_CONFIGFS_FS is not set
608
609#
610# Miscellaneous filesystems
611#
612# CONFIG_ADFS_FS is not set
613# CONFIG_AFFS_FS is not set
614# CONFIG_HFS_FS is not set
615# CONFIG_HFSPLUS_FS is not set
616# CONFIG_BEFS_FS is not set
617# CONFIG_BFS_FS is not set
618# CONFIG_EFS_FS is not set
619# CONFIG_JFFS2_FS is not set
620CONFIG_CRAMFS=y
621# CONFIG_VXFS_FS is not set
622# CONFIG_HPFS_FS is not set
623# CONFIG_QNX4FS_FS is not set
624# CONFIG_SYSV_FS is not set
625# CONFIG_UFS_FS is not set
626
627#
628# Network File Systems
629#
630CONFIG_NFS_FS=y
631CONFIG_NFS_V3=y
632# CONFIG_NFS_V3_ACL is not set
633# CONFIG_NFS_V4 is not set
634# CONFIG_NFS_DIRECTIO is not set
635# CONFIG_NFSD is not set
636CONFIG_ROOT_NFS=y
637CONFIG_LOCKD=y
638CONFIG_LOCKD_V4=y
639CONFIG_NFS_COMMON=y
640CONFIG_SUNRPC=y
641# CONFIG_SUNRPC_BIND34 is not set
642# CONFIG_RPCSEC_GSS_KRB5 is not set
643# CONFIG_RPCSEC_GSS_SPKM3 is not set
644# CONFIG_SMB_FS is not set
645# CONFIG_CIFS is not set
646# CONFIG_NCP_FS is not set
647# CONFIG_CODA_FS is not set
648# CONFIG_AFS_FS is not set
649
650#
651# Partition Types
652#
653# CONFIG_PARTITION_ADVANCED is not set
654CONFIG_MSDOS_PARTITION=y
655
656#
657# Native Language Support
658#
659# CONFIG_NLS is not set
660
661#
662# Distributed Lock Manager
663#
664# CONFIG_DLM is not set
665# CONFIG_UCC_SLOW is not set
666
667#
668# Library routines
669#
670CONFIG_BITREVERSE=y
671# CONFIG_CRC_CCITT is not set
672# CONFIG_CRC16 is not set
673# CONFIG_CRC_ITU_T is not set
674CONFIG_CRC32=y
675# CONFIG_CRC7 is not set
676# CONFIG_LIBCRC32C is not set
677CONFIG_ZLIB_INFLATE=y
678CONFIG_PLIST=y
679CONFIG_HAS_IOMEM=y
680CONFIG_HAS_IOPORT=y
681CONFIG_HAS_DMA=y
682
683#
684# Instrumentation Support
685#
686# CONFIG_PROFILING is not set
687
688#
689# Kernel hacking
690#
691# CONFIG_PRINTK_TIME is not set
692CONFIG_ENABLE_MUST_CHECK=y
693CONFIG_MAGIC_SYSRQ=y
694# CONFIG_UNUSED_SYMBOLS is not set
695# CONFIG_DEBUG_FS is not set
696# CONFIG_HEADERS_CHECK is not set
697CONFIG_DEBUG_KERNEL=y
698# CONFIG_DEBUG_SHIRQ is not set
699CONFIG_DETECT_SOFTLOCKUP=y
700CONFIG_SCHED_DEBUG=y
701# CONFIG_SCHEDSTATS is not set
702# CONFIG_TIMER_STATS is not set
703# CONFIG_DEBUG_SLAB is not set
704# CONFIG_DEBUG_RT_MUTEXES is not set
705# CONFIG_RT_MUTEX_TESTER is not set
706# CONFIG_DEBUG_SPINLOCK is not set
707# CONFIG_DEBUG_MUTEXES is not set
708# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
709# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
710# CONFIG_DEBUG_KOBJECT is not set
711CONFIG_DEBUG_BUGVERBOSE=y
712# CONFIG_DEBUG_INFO is not set
713# CONFIG_DEBUG_VM is not set
714# CONFIG_DEBUG_LIST is not set
715CONFIG_FORCED_INLINING=y
716# CONFIG_RCU_TORTURE_TEST is not set
717# CONFIG_FAULT_INJECTION is not set
718# CONFIG_DEBUG_STACKOVERFLOW is not set
719# CONFIG_DEBUG_STACK_USAGE is not set
720# CONFIG_DEBUG_PAGEALLOC is not set
721# CONFIG_DEBUGGER is not set
722# CONFIG_BDI_SWITCH is not set
723# CONFIG_PPC_EARLY_DEBUG is not set
724
725#
726# Security options
727#
728# CONFIG_KEYS is not set
729# CONFIG_SECURITY is not set
730CONFIG_CRYPTO=y
731CONFIG_CRYPTO_ALGAPI=y
732CONFIG_CRYPTO_BLKCIPHER=y
733CONFIG_CRYPTO_MANAGER=y
734# CONFIG_CRYPTO_HMAC is not set
735# CONFIG_CRYPTO_XCBC is not set
736# CONFIG_CRYPTO_NULL is not set
737# CONFIG_CRYPTO_MD4 is not set
738CONFIG_CRYPTO_MD5=y
739# CONFIG_CRYPTO_SHA1 is not set
740# CONFIG_CRYPTO_SHA256 is not set
741# CONFIG_CRYPTO_SHA512 is not set
742# CONFIG_CRYPTO_WP512 is not set
743# CONFIG_CRYPTO_TGR192 is not set
744# CONFIG_CRYPTO_GF128MUL is not set
745CONFIG_CRYPTO_ECB=y
746CONFIG_CRYPTO_CBC=y
747CONFIG_CRYPTO_PCBC=y
748# CONFIG_CRYPTO_LRW is not set
749# CONFIG_CRYPTO_CRYPTD is not set
750CONFIG_CRYPTO_DES=y
751# CONFIG_CRYPTO_FCRYPT is not set
752# CONFIG_CRYPTO_BLOWFISH is not set
753# CONFIG_CRYPTO_TWOFISH is not set
754# CONFIG_CRYPTO_SERPENT is not set
755# CONFIG_CRYPTO_AES is not set
756# CONFIG_CRYPTO_CAST5 is not set
757# CONFIG_CRYPTO_CAST6 is not set
758# CONFIG_CRYPTO_TEA is not set
759# CONFIG_CRYPTO_ARC4 is not set
760# CONFIG_CRYPTO_KHAZAD is not set
761# CONFIG_CRYPTO_ANUBIS is not set
762# CONFIG_CRYPTO_DEFLATE is not set
763# CONFIG_CRYPTO_MICHAEL_MIC is not set
764# CONFIG_CRYPTO_CRC32C is not set
765# CONFIG_CRYPTO_CAMELLIA is not set
766# CONFIG_CRYPTO_TEST is not set
767CONFIG_CRYPTO_HW=y
768# CONFIG_PPC_CLOCK is not set
diff --git a/arch/powerpc/configs/mpc8272_ads_defconfig b/arch/powerpc/configs/mpc8272_ads_defconfig
index 4b68032588ff..6b7951ec941a 100644
--- a/arch/powerpc/configs/mpc8272_ads_defconfig
+++ b/arch/powerpc/configs/mpc8272_ads_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc4 3# Linux kernel version: 2.6.23-rc4
4# Tue Aug 28 21:24:39 2007 4# Wed Sep 5 12:43:23 2007
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -52,7 +52,7 @@ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
52# CONFIG_EXPERIMENTAL is not set 52# CONFIG_EXPERIMENTAL is not set
53CONFIG_BROKEN_ON_SMP=y 53CONFIG_BROKEN_ON_SMP=y
54CONFIG_INIT_ENV_ARG_LIMIT=32 54CONFIG_INIT_ENV_ARG_LIMIT=32
55CONFIG_LOCALVERSION="powerpc8272" 55CONFIG_LOCALVERSION=""
56CONFIG_LOCALVERSION_AUTO=y 56CONFIG_LOCALVERSION_AUTO=y
57CONFIG_SWAP=y 57CONFIG_SWAP=y
58CONFIG_SYSVIPC=y 58CONFIG_SYSVIPC=y
@@ -71,7 +71,7 @@ CONFIG_EMBEDDED=y
71CONFIG_SYSCTL_SYSCALL=y 71CONFIG_SYSCTL_SYSCALL=y
72CONFIG_KALLSYMS=y 72CONFIG_KALLSYMS=y
73CONFIG_KALLSYMS_ALL=y 73CONFIG_KALLSYMS_ALL=y
74CONFIG_KALLSYMS_EXTRA_PASS=y 74# CONFIG_KALLSYMS_EXTRA_PASS is not set
75CONFIG_HOTPLUG=y 75CONFIG_HOTPLUG=y
76CONFIG_PRINTK=y 76CONFIG_PRINTK=y
77CONFIG_BUG=y 77CONFIG_BUG=y
@@ -122,10 +122,11 @@ CONFIG_PPC_82xx=y
122# CONFIG_PPC_MPC5200 is not set 122# CONFIG_PPC_MPC5200 is not set
123# CONFIG_PPC_CELL is not set 123# CONFIG_PPC_CELL is not set
124# CONFIG_PPC_CELL_NATIVE is not set 124# CONFIG_PPC_CELL_NATIVE is not set
125CONFIG_MPC82xx_ADS=y 125CONFIG_MPC8272_ADS=y
126CONFIG_PQ2ADS=y 126CONFIG_PQ2ADS=y
127CONFIG_8260=y 127CONFIG_8260=y
128CONFIG_8272=y 128CONFIG_8272=y
129CONFIG_PQ2_ADS_PCI_PIC=y
129# CONFIG_MPIC is not set 130# CONFIG_MPIC is not set
130# CONFIG_MPIC_WEIRD is not set 131# CONFIG_MPIC_WEIRD is not set
131# CONFIG_PPC_I8259 is not set 132# CONFIG_PPC_I8259 is not set
@@ -137,7 +138,9 @@ CONFIG_8272=y
137# CONFIG_GENERIC_IOMAP is not set 138# CONFIG_GENERIC_IOMAP is not set
138# CONFIG_CPU_FREQ is not set 139# CONFIG_CPU_FREQ is not set
139CONFIG_CPM2=y 140CONFIG_CPM2=y
141CONFIG_PPC_CPM_NEW_BINDING=y
140# CONFIG_FSL_ULI1575 is not set 142# CONFIG_FSL_ULI1575 is not set
143CONFIG_CPM=y
141 144
142# 145#
143# Kernel options 146# Kernel options
@@ -168,18 +171,25 @@ CONFIG_PROC_DEVICETREE=y
168# CONFIG_CMDLINE_BOOL is not set 171# CONFIG_CMDLINE_BOOL is not set
169# CONFIG_PM is not set 172# CONFIG_PM is not set
170CONFIG_SECCOMP=y 173CONFIG_SECCOMP=y
171# CONFIG_WANT_DEVICE_TREE is not set 174CONFIG_WANT_DEVICE_TREE=y
175# CONFIG_BUILD_RAW_IMAGE is not set
176CONFIG_DEVICE_TREE="mpc8272ads.dts"
172CONFIG_ISA_DMA_API=y 177CONFIG_ISA_DMA_API=y
173 178
174# 179#
175# Bus options 180# Bus options
176# 181#
177CONFIG_ZONE_DMA=y 182CONFIG_ZONE_DMA=y
183CONFIG_PPC_INDIRECT_PCI=y
178CONFIG_FSL_SOC=y 184CONFIG_FSL_SOC=y
179# CONFIG_PCI is not set 185CONFIG_PCI=y
180# CONFIG_PCI_DOMAINS is not set 186CONFIG_PCI_DOMAINS=y
181# CONFIG_PCI_SYSCALL is not set 187CONFIG_PCI_SYSCALL=y
182# CONFIG_ARCH_SUPPORTS_MSI is not set 188CONFIG_PCI_8260=y
189# CONFIG_PCIEPORTBUS is not set
190CONFIG_ARCH_SUPPORTS_MSI=y
191# CONFIG_PCI_MSI is not set
192# CONFIG_PCI_DEBUG is not set
183 193
184# 194#
185# PCCARD (PCMCIA/CardBus) support 195# PCCARD (PCMCIA/CardBus) support
@@ -313,43 +323,101 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
313# CONFIG_DEBUG_DEVRES is not set 323# CONFIG_DEBUG_DEVRES is not set
314# CONFIG_SYS_HYPERVISOR is not set 324# CONFIG_SYS_HYPERVISOR is not set
315# CONFIG_CONNECTOR is not set 325# CONFIG_CONNECTOR is not set
316# CONFIG_MTD is not set 326CONFIG_MTD=y
327# CONFIG_MTD_DEBUG is not set
328# CONFIG_MTD_CONCAT is not set
329# CONFIG_MTD_PARTITIONS is not set
330
331#
332# User Modules And Translation Layers
333#
334CONFIG_MTD_CHAR=y
335CONFIG_MTD_BLKDEVS=y
336CONFIG_MTD_BLOCK=y
337# CONFIG_FTL is not set
338# CONFIG_NFTL is not set
339# CONFIG_INFTL is not set
340# CONFIG_RFD_FTL is not set
341# CONFIG_SSFDC is not set
342
343#
344# RAM/ROM/Flash chip drivers
345#
346# CONFIG_MTD_CFI is not set
347CONFIG_MTD_JEDECPROBE=y
348CONFIG_MTD_GEN_PROBE=y
349CONFIG_MTD_CFI_ADV_OPTIONS=y
350CONFIG_MTD_CFI_NOSWAP=y
351# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
352# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
353CONFIG_MTD_CFI_GEOMETRY=y
354# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
355# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
356CONFIG_MTD_MAP_BANK_WIDTH_4=y
357# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
358# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
359# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
360# CONFIG_MTD_CFI_I1 is not set
361# CONFIG_MTD_CFI_I2 is not set
362CONFIG_MTD_CFI_I4=y
363# CONFIG_MTD_CFI_I8 is not set
364# CONFIG_MTD_OTP is not set
365CONFIG_MTD_CFI_INTELEXT=y
366# CONFIG_MTD_CFI_AMDSTD is not set
367# CONFIG_MTD_CFI_STAA is not set
368CONFIG_MTD_CFI_UTIL=y
369# CONFIG_MTD_RAM is not set
370# CONFIG_MTD_ROM is not set
371# CONFIG_MTD_ABSENT is not set
372
373#
374# Mapping drivers for chip access
375#
376# CONFIG_MTD_COMPLEX_MAPPINGS is not set
377# CONFIG_MTD_PHYSMAP is not set
378CONFIG_MTD_PHYSMAP_OF=y
379# CONFIG_MTD_SBC8240 is not set
380# CONFIG_MTD_PLATRAM is not set
381
382#
383# Self-contained MTD device drivers
384#
385# CONFIG_MTD_PMC551 is not set
386# CONFIG_MTD_SLRAM is not set
387# CONFIG_MTD_PHRAM is not set
388# CONFIG_MTD_MTDRAM is not set
389# CONFIG_MTD_BLOCK2MTD is not set
390
391#
392# Disk-On-Chip Device Drivers
393#
394# CONFIG_MTD_DOC2000 is not set
395# CONFIG_MTD_DOC2001 is not set
396# CONFIG_MTD_DOC2001PLUS is not set
397# CONFIG_MTD_NAND is not set
398# CONFIG_MTD_ONENAND is not set
399
400#
401# UBI - Unsorted block images
402#
403# CONFIG_MTD_UBI is not set
317CONFIG_OF_DEVICE=y 404CONFIG_OF_DEVICE=y
318# CONFIG_PARPORT is not set 405# CONFIG_PARPORT is not set
319CONFIG_BLK_DEV=y 406CONFIG_BLK_DEV=y
320# CONFIG_BLK_DEV_FD is not set 407# CONFIG_BLK_DEV_FD is not set
408# CONFIG_BLK_CPQ_DA is not set
409# CONFIG_BLK_CPQ_CISS_DA is not set
410# CONFIG_BLK_DEV_DAC960 is not set
321# CONFIG_BLK_DEV_COW_COMMON is not set 411# CONFIG_BLK_DEV_COW_COMMON is not set
322CONFIG_BLK_DEV_LOOP=y 412CONFIG_BLK_DEV_LOOP=y
323# CONFIG_BLK_DEV_CRYPTOLOOP is not set 413# CONFIG_BLK_DEV_CRYPTOLOOP is not set
324# CONFIG_BLK_DEV_NBD is not set 414# CONFIG_BLK_DEV_NBD is not set
415# CONFIG_BLK_DEV_SX8 is not set
325# CONFIG_BLK_DEV_RAM is not set 416# CONFIG_BLK_DEV_RAM is not set
326# CONFIG_CDROM_PKTCDVD is not set 417# CONFIG_CDROM_PKTCDVD is not set
327# CONFIG_ATA_OVER_ETH is not set 418# CONFIG_ATA_OVER_ETH is not set
328CONFIG_MISC_DEVICES=y 419# CONFIG_MISC_DEVICES is not set
329# CONFIG_EEPROM_93CX6 is not set 420# CONFIG_IDE is not set
330CONFIG_IDE=y
331CONFIG_IDE_MAX_HWIFS=4
332CONFIG_BLK_DEV_IDE=y
333
334#
335# Please see Documentation/ide.txt for help/info on IDE drives
336#
337# CONFIG_BLK_DEV_IDE_SATA is not set
338CONFIG_BLK_DEV_IDEDISK=y
339# CONFIG_IDEDISK_MULTI_MODE is not set
340# CONFIG_BLK_DEV_IDECD is not set
341# CONFIG_BLK_DEV_IDEFLOPPY is not set
342# CONFIG_IDE_TASK_IOCTL is not set
343CONFIG_IDE_PROC_FS=y
344
345#
346# IDE chipset support/bugfixes
347#
348# CONFIG_IDE_GENERIC is not set
349# CONFIG_IDEPCI_PCIBUS_ORDER is not set
350# CONFIG_IDE_ARM is not set
351# CONFIG_BLK_DEV_IDEDMA is not set
352# CONFIG_BLK_DEV_HD is not set
353 421
354# 422#
355# SCSI device support 423# SCSI device support
@@ -360,6 +428,21 @@ CONFIG_IDE_PROC_FS=y
360# CONFIG_SCSI_NETLINK is not set 428# CONFIG_SCSI_NETLINK is not set
361# CONFIG_ATA is not set 429# CONFIG_ATA is not set
362# CONFIG_MD 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
441#
442# An alternative FireWire stack is available with EXPERIMENTAL=y
443#
444# CONFIG_IEEE1394 is not set
445# CONFIG_I2O is not set
363# CONFIG_MACINTOSH_DRIVERS is not set 446# CONFIG_MACINTOSH_DRIVERS is not set
364CONFIG_NETDEVICES=y 447CONFIG_NETDEVICES=y
365# CONFIG_NETDEVICES_MULTIQUEUE is not set 448# CONFIG_NETDEVICES_MULTIQUEUE is not set
@@ -367,6 +450,7 @@ CONFIG_NETDEVICES=y
367# CONFIG_BONDING is not set 450# CONFIG_BONDING is not set
368# CONFIG_EQUALIZER is not set 451# CONFIG_EQUALIZER is not set
369CONFIG_TUN=y 452CONFIG_TUN=y
453# CONFIG_ARCNET is not set
370CONFIG_PHYLIB=y 454CONFIG_PHYLIB=y
371 455
372# 456#
@@ -382,13 +466,42 @@ CONFIG_DAVICOM_PHY=y
382# CONFIG_BROADCOM_PHY is not set 466# CONFIG_BROADCOM_PHY is not set
383# CONFIG_ICPLUS_PHY is not set 467# CONFIG_ICPLUS_PHY is not set
384# CONFIG_FIXED_PHY is not set 468# CONFIG_FIXED_PHY is not set
469CONFIG_MDIO_BITBANG=y
385CONFIG_NET_ETHERNET=y 470CONFIG_NET_ETHERNET=y
386CONFIG_MII=y 471CONFIG_MII=y
472# CONFIG_HAPPYMEAL is not set
473# CONFIG_SUNGEM is not set
474# CONFIG_CASSINI is not set
475# CONFIG_NET_VENDOR_3COM is not set
476# CONFIG_NET_TULIP is not set
477# CONFIG_HP100 is not set
478# CONFIG_NET_PCI is not set
387CONFIG_FS_ENET=y 479CONFIG_FS_ENET=y
388# CONFIG_FS_ENET_HAS_SCC is not set 480# CONFIG_FS_ENET_HAS_SCC is not set
389CONFIG_FS_ENET_HAS_FCC=y 481CONFIG_FS_ENET_HAS_FCC=y
390CONFIG_NETDEV_1000=y 482CONFIG_NETDEV_1000=y
483# CONFIG_ACENIC is not set
484# CONFIG_DL2K is not set
485# CONFIG_E1000 is not set
486# CONFIG_NS83820 is not set
487# CONFIG_HAMACHI is not set
488# CONFIG_R8169 is not set
489# CONFIG_SIS190 is not set
490# CONFIG_SKGE is not set
491# CONFIG_SKY2 is not set
492# CONFIG_VIA_VELOCITY is not set
493# CONFIG_TIGON3 is not set
494# CONFIG_BNX2 is not set
495# CONFIG_QLA3XXX is not set
391CONFIG_NETDEV_10000=y 496CONFIG_NETDEV_10000=y
497# CONFIG_CHELSIO_T1 is not set
498# CONFIG_CHELSIO_T3 is not set
499# CONFIG_IXGB is not set
500# CONFIG_S2IO is not set
501# CONFIG_MYRI10GE is not set
502# CONFIG_NETXEN_NIC is not set
503# CONFIG_MLX4_CORE is not set
504# CONFIG_TR is not set
392 505
393# 506#
394# Wireless LAN 507# Wireless LAN
@@ -396,6 +509,7 @@ CONFIG_NETDEV_10000=y
396# CONFIG_WLAN_PRE80211 is not set 509# CONFIG_WLAN_PRE80211 is not set
397# CONFIG_WLAN_80211 is not set 510# CONFIG_WLAN_80211 is not set
398# CONFIG_WAN is not set 511# CONFIG_WAN is not set
512# CONFIG_FDDI is not set
399CONFIG_PPP=y 513CONFIG_PPP=y
400# CONFIG_PPP_FILTER is not set 514# CONFIG_PPP_FILTER is not set
401CONFIG_PPP_ASYNC=y 515CONFIG_PPP_ASYNC=y
@@ -459,6 +573,7 @@ CONFIG_MOUSE_PS2_TRACKPOINT=y
459CONFIG_SERIO=y 573CONFIG_SERIO=y
460# CONFIG_SERIO_I8042 is not set 574# CONFIG_SERIO_I8042 is not set
461CONFIG_SERIO_SERPORT=y 575CONFIG_SERIO_SERPORT=y
576# CONFIG_SERIO_PCIPS2 is not set
462CONFIG_SERIO_LIBPS2=y 577CONFIG_SERIO_LIBPS2=y
463# CONFIG_SERIO_RAW is not set 578# CONFIG_SERIO_RAW is not set
464# CONFIG_GAMEPORT is not set 579# CONFIG_GAMEPORT is not set
@@ -488,6 +603,7 @@ CONFIG_SERIAL_CPM_SCC1=y
488CONFIG_SERIAL_CPM_SCC4=y 603CONFIG_SERIAL_CPM_SCC4=y
489# CONFIG_SERIAL_CPM_SMC1 is not set 604# CONFIG_SERIAL_CPM_SMC1 is not set
490# CONFIG_SERIAL_CPM_SMC2 is not set 605# CONFIG_SERIAL_CPM_SMC2 is not set
606# CONFIG_SERIAL_JSM is not set
491CONFIG_UNIX98_PTYS=y 607CONFIG_UNIX98_PTYS=y
492CONFIG_LEGACY_PTYS=y 608CONFIG_LEGACY_PTYS=y
493CONFIG_LEGACY_PTY_COUNT=256 609CONFIG_LEGACY_PTY_COUNT=256
@@ -497,7 +613,11 @@ CONFIG_HW_RANDOM=y
497# CONFIG_NVRAM is not set 613# CONFIG_NVRAM is not set
498# CONFIG_GEN_RTC is not set 614# CONFIG_GEN_RTC is not set
499# CONFIG_R3964 is not set 615# CONFIG_R3964 is not set
616# CONFIG_APPLICOM is not set
617# CONFIG_AGP is not set
618# CONFIG_DRM is not set
500# CONFIG_RAW_DRIVER is not set 619# CONFIG_RAW_DRIVER is not set
620CONFIG_DEVPORT=y
501# CONFIG_I2C is not set 621# CONFIG_I2C is not set
502 622
503# 623#
@@ -531,7 +651,7 @@ CONFIG_DAB=y
531# 651#
532# CONFIG_DISPLAY_SUPPORT is not set 652# CONFIG_DISPLAY_SUPPORT is not set
533# CONFIG_VGASTATE is not set 653# CONFIG_VGASTATE is not set
534CONFIG_VIDEO_OUTPUT_CONTROL=y 654# CONFIG_VIDEO_OUTPUT_CONTROL is not set
535# CONFIG_FB is not set 655# CONFIG_FB is not set
536# CONFIG_FB_IBM_GXT4500 is not set 656# CONFIG_FB_IBM_GXT4500 is not set
537 657
@@ -539,45 +659,11 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
539# Sound 659# Sound
540# 660#
541# CONFIG_SOUND is not set 661# CONFIG_SOUND is not set
542CONFIG_HID_SUPPORT=y 662# CONFIG_HID_SUPPORT is not set
543CONFIG_HID=y 663# CONFIG_USB_SUPPORT is not set
544# CONFIG_HID_DEBUG is not set
545CONFIG_USB_SUPPORT=y
546# CONFIG_USB_ARCH_HAS_HCD is not set
547# CONFIG_USB_ARCH_HAS_OHCI is not set
548# CONFIG_USB_ARCH_HAS_EHCI is not set
549
550#
551# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
552#
553
554#
555# USB Gadget Support
556#
557CONFIG_USB_GADGET=y
558# CONFIG_USB_GADGET_DEBUG_FILES is not set
559CONFIG_USB_GADGET_SELECTED=y
560# CONFIG_USB_GADGET_AMD5536UDC is not set
561# CONFIG_USB_GADGET_FSL_USB2 is not set
562# CONFIG_USB_GADGET_NET2280 is not set
563# CONFIG_USB_GADGET_PXA2XX is not set
564CONFIG_USB_GADGET_M66592=y
565CONFIG_USB_M66592=y
566# CONFIG_USB_GADGET_GOKU is not set
567# CONFIG_USB_GADGET_LH7A40X is not set
568# CONFIG_USB_GADGET_OMAP is not set
569# CONFIG_USB_GADGET_S3C2410 is not set
570# CONFIG_USB_GADGET_AT91 is not set
571# CONFIG_USB_GADGET_DUMMY_HCD is not set
572CONFIG_USB_GADGET_DUALSPEED=y
573# CONFIG_USB_ZERO is not set
574CONFIG_USB_ETH=y
575# CONFIG_USB_GADGETFS is not set
576# CONFIG_USB_FILE_STORAGE is not set
577# CONFIG_USB_G_SERIAL is not set
578# CONFIG_USB_MIDI_GADGET is not set
579# CONFIG_MMC is not set 664# CONFIG_MMC is not set
580# CONFIG_NEW_LEDS is not set 665# CONFIG_NEW_LEDS is not set
666# CONFIG_INFINIBAND is not set
581# CONFIG_RTC_CLASS is not set 667# CONFIG_RTC_CLASS is not set
582 668
583# 669#
@@ -614,11 +700,7 @@ CONFIG_FS_MBCACHE=y
614# CONFIG_REISERFS_FS is not set 700# CONFIG_REISERFS_FS is not set
615# CONFIG_JFS_FS is not set 701# CONFIG_JFS_FS is not set
616CONFIG_FS_POSIX_ACL=y 702CONFIG_FS_POSIX_ACL=y
617CONFIG_XFS_FS=y 703# CONFIG_XFS_FS is not set
618# CONFIG_XFS_QUOTA is not set
619# CONFIG_XFS_SECURITY is not set
620# CONFIG_XFS_POSIX_ACL is not set
621# CONFIG_XFS_RT is not set
622# CONFIG_OCFS2_FS is not set 704# CONFIG_OCFS2_FS is not set
623# CONFIG_MINIX_FS is not set 705# CONFIG_MINIX_FS is not set
624# CONFIG_ROMFS_FS is not set 706# CONFIG_ROMFS_FS is not set
@@ -659,6 +741,7 @@ CONFIG_RAMFS=y
659# Miscellaneous filesystems 741# Miscellaneous filesystems
660# 742#
661# CONFIG_HFSPLUS_FS is not set 743# CONFIG_HFSPLUS_FS is not set
744# CONFIG_JFFS2_FS is not set
662CONFIG_CRAMFS=y 745CONFIG_CRAMFS=y
663# CONFIG_VXFS_FS is not set 746# CONFIG_VXFS_FS is not set
664# CONFIG_HPFS_FS is not set 747# CONFIG_HPFS_FS is not set
@@ -680,8 +763,7 @@ CONFIG_LOCKD_V4=y
680CONFIG_NFS_ACL_SUPPORT=y 763CONFIG_NFS_ACL_SUPPORT=y
681CONFIG_NFS_COMMON=y 764CONFIG_NFS_COMMON=y
682CONFIG_SUNRPC=y 765CONFIG_SUNRPC=y
683CONFIG_SMB_FS=y 766# CONFIG_SMB_FS is not set
684# CONFIG_SMB_NLS_DEFAULT is not set
685# CONFIG_CIFS is not set 767# CONFIG_CIFS is not set
686# CONFIG_NCP_FS is not set 768# CONFIG_NCP_FS is not set
687# CONFIG_CODA_FS is not set 769# CONFIG_CODA_FS is not set
@@ -775,7 +857,7 @@ CONFIG_HAS_DMA=y
775# 857#
776# CONFIG_PRINTK_TIME is not set 858# CONFIG_PRINTK_TIME is not set
777CONFIG_ENABLE_MUST_CHECK=y 859CONFIG_ENABLE_MUST_CHECK=y
778# CONFIG_MAGIC_SYSRQ is not set 860CONFIG_MAGIC_SYSRQ=y
779# CONFIG_UNUSED_SYMBOLS is not set 861# CONFIG_UNUSED_SYMBOLS is not set
780# CONFIG_DEBUG_FS is not set 862# CONFIG_DEBUG_FS is not set
781# CONFIG_HEADERS_CHECK is not set 863# CONFIG_HEADERS_CHECK is not set
@@ -793,7 +875,7 @@ CONFIG_SCHED_DEBUG=y
793# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 875# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
794# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 876# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
795# CONFIG_DEBUG_KOBJECT is not set 877# CONFIG_DEBUG_KOBJECT is not set
796# CONFIG_DEBUG_BUGVERBOSE is not set 878CONFIG_DEBUG_BUGVERBOSE=y
797CONFIG_DEBUG_INFO=y 879CONFIG_DEBUG_INFO=y
798# CONFIG_DEBUG_VM is not set 880# CONFIG_DEBUG_VM is not set
799# CONFIG_DEBUG_LIST is not set 881# CONFIG_DEBUG_LIST is not set
@@ -845,4 +927,4 @@ CONFIG_CRYPTO_DES=y
845# CONFIG_CRYPTO_MICHAEL_MIC is not set 927# CONFIG_CRYPTO_MICHAEL_MIC is not set
846# CONFIG_CRYPTO_CRC32C is not set 928# CONFIG_CRYPTO_CRC32C is not set
847# CONFIG_CRYPTO_CAMELLIA is not set 929# CONFIG_CRYPTO_CAMELLIA is not set
848CONFIG_CRYPTO_HW=y 930# CONFIG_CRYPTO_HW is not set
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/mpc8560_ads_defconfig b/arch/powerpc/configs/mpc8560_ads_defconfig
index 0fb54c775cf9..3d68c65212cf 100644
--- a/arch/powerpc/configs/mpc8560_ads_defconfig
+++ b/arch/powerpc/configs/mpc8560_ads_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc4 3# Linux kernel version: 2.6.23-rc9
4# Tue Aug 28 21:24:43 2007 4# Thu Oct 11 09:16:32 2007
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -22,8 +22,13 @@ CONFIG_FSL_BOOKE=y
22CONFIG_SPE=y 22CONFIG_SPE=y
23# CONFIG_PPC_MM_SLICES is not set 23# CONFIG_PPC_MM_SLICES is not set
24CONFIG_PPC32=y 24CONFIG_PPC32=y
25CONFIG_WORD_SIZE=32
25CONFIG_PPC_MERGE=y 26CONFIG_PPC_MERGE=y
26CONFIG_MMU=y 27CONFIG_MMU=y
28CONFIG_GENERIC_CMOS_UPDATE=y
29CONFIG_GENERIC_TIME=y
30CONFIG_GENERIC_TIME_VSYSCALL=y
31CONFIG_GENERIC_CLOCKEVENTS=y
27CONFIG_GENERIC_HARDIRQS=y 32CONFIG_GENERIC_HARDIRQS=y
28CONFIG_IRQ_PER_CPU=y 33CONFIG_IRQ_PER_CPU=y
29CONFIG_RWSEM_XCHGADD_ALGORITHM=y 34CONFIG_RWSEM_XCHGADD_ALGORITHM=y
@@ -86,7 +91,6 @@ CONFIG_FUTEX=y
86CONFIG_ANON_INODES=y 91CONFIG_ANON_INODES=y
87CONFIG_EPOLL=y 92CONFIG_EPOLL=y
88CONFIG_SIGNALFD=y 93CONFIG_SIGNALFD=y
89CONFIG_TIMERFD=y
90CONFIG_EVENTFD=y 94CONFIG_EVENTFD=y
91CONFIG_SHMEM=y 95CONFIG_SHMEM=y
92CONFIG_VM_EVENT_COUNTERS=y 96CONFIG_VM_EVENT_COUNTERS=y
@@ -128,7 +132,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
128CONFIG_MPC8560_ADS=y 132CONFIG_MPC8560_ADS=y
129# CONFIG_MPC85xx_CDS is not set 133# CONFIG_MPC85xx_CDS is not set
130# CONFIG_MPC85xx_MDS is not set 134# CONFIG_MPC85xx_MDS is not set
131# CONFIG_MPC8544_DS is not set 135# CONFIG_MPC85xx_DS is not set
132CONFIG_MPC8560=y 136CONFIG_MPC8560=y
133CONFIG_MPC85xx=y 137CONFIG_MPC85xx=y
134CONFIG_MPIC=y 138CONFIG_MPIC=y
@@ -142,12 +146,17 @@ CONFIG_MPIC=y
142# CONFIG_GENERIC_IOMAP is not set 146# CONFIG_GENERIC_IOMAP is not set
143# CONFIG_CPU_FREQ is not set 147# CONFIG_CPU_FREQ is not set
144CONFIG_CPM2=y 148CONFIG_CPM2=y
149CONFIG_PPC_CPM_NEW_BINDING=y
145# CONFIG_FSL_ULI1575 is not set 150# CONFIG_FSL_ULI1575 is not set
151CONFIG_CPM=y
146 152
147# 153#
148# Kernel options 154# Kernel options
149# 155#
150# CONFIG_HIGHMEM is not set 156# CONFIG_HIGHMEM is not set
157# CONFIG_TICK_ONESHOT is not set
158# CONFIG_NO_HZ is not set
159# CONFIG_HIGH_RES_TIMERS is not set
151# CONFIG_HZ_100 is not set 160# CONFIG_HZ_100 is not set
152CONFIG_HZ_250=y 161CONFIG_HZ_250=y
153# CONFIG_HZ_300 is not set 162# CONFIG_HZ_300 is not set
@@ -158,7 +167,7 @@ CONFIG_PREEMPT_NONE=y
158# CONFIG_PREEMPT is not set 167# CONFIG_PREEMPT is not set
159CONFIG_BINFMT_ELF=y 168CONFIG_BINFMT_ELF=y
160CONFIG_BINFMT_MISC=y 169CONFIG_BINFMT_MISC=y
161# CONFIG_MATH_EMULATION is not set 170CONFIG_MATH_EMULATION=y
162CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 171CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
163CONFIG_ARCH_FLATMEM_ENABLE=y 172CONFIG_ARCH_FLATMEM_ENABLE=y
164CONFIG_ARCH_POPULATES_NODE_MAP=y 173CONFIG_ARCH_POPULATES_NODE_MAP=y
@@ -177,6 +186,8 @@ CONFIG_VIRT_TO_BUS=y
177# CONFIG_PROC_DEVICETREE is not set 186# CONFIG_PROC_DEVICETREE is not set
178# CONFIG_CMDLINE_BOOL is not set 187# CONFIG_CMDLINE_BOOL is not set
179# CONFIG_PM is not set 188# CONFIG_PM is not set
189CONFIG_SUSPEND_UP_POSSIBLE=y
190CONFIG_HIBERNATION_UP_POSSIBLE=y
180# CONFIG_SECCOMP is not set 191# CONFIG_SECCOMP is not set
181CONFIG_WANT_DEVICE_TREE=y 192CONFIG_WANT_DEVICE_TREE=y
182CONFIG_DEVICE_TREE="" 193CONFIG_DEVICE_TREE=""
@@ -415,6 +426,7 @@ CONFIG_E1000_NAPI=y
415# CONFIG_SIS190 is not set 426# CONFIG_SIS190 is not set
416# CONFIG_SKGE is not set 427# CONFIG_SKGE is not set
417# CONFIG_SKY2 is not set 428# CONFIG_SKY2 is not set
429# CONFIG_SK98LIN is not set
418# CONFIG_VIA_VELOCITY is not set 430# CONFIG_VIA_VELOCITY is not set
419# CONFIG_TIGON3 is not set 431# CONFIG_TIGON3 is not set
420# CONFIG_BNX2 is not set 432# CONFIG_BNX2 is not set
@@ -807,3 +819,4 @@ CONFIG_FORCED_INLINING=y
807# CONFIG_KEYS is not set 819# CONFIG_KEYS is not set
808# CONFIG_SECURITY is not set 820# CONFIG_SECURITY is not set
809# CONFIG_CRYPTO is not set 821# CONFIG_CRYPTO is not set
822# CONFIG_PPC_CLOCK 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/mpc8610_hpcd_defconfig b/arch/powerpc/configs/mpc8610_hpcd_defconfig
new file mode 100644
index 000000000000..de19b781937f
--- /dev/null
+++ b/arch/powerpc/configs/mpc8610_hpcd_defconfig
@@ -0,0 +1,1023 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc6
4# Tue Oct 2 11:42:56 2007
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11CONFIG_6xx=y
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set
15# CONFIG_44x is not set
16# CONFIG_E200 is not set
17CONFIG_PPC_FPU=y
18CONFIG_ALTIVEC=y
19CONFIG_PPC_STD_MMU=y
20CONFIG_PPC_STD_MMU_32=y
21# CONFIG_PPC_MM_SLICES is not set
22# CONFIG_SMP is not set
23CONFIG_PPC32=y
24CONFIG_PPC_MERGE=y
25CONFIG_MMU=y
26CONFIG_GENERIC_HARDIRQS=y
27CONFIG_IRQ_PER_CPU=y
28CONFIG_RWSEM_XCHGADD_ALGORITHM=y
29CONFIG_ARCH_HAS_ILOG2_U32=y
30CONFIG_GENERIC_HWEIGHT=y
31CONFIG_GENERIC_CALIBRATE_DELAY=y
32CONFIG_GENERIC_FIND_NEXT_BIT=y
33# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
34CONFIG_PPC=y
35CONFIG_EARLY_PRINTK=y
36CONFIG_GENERIC_NVRAM=y
37CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
38CONFIG_ARCH_MAY_HAVE_PC_FDC=y
39CONFIG_PPC_OF=y
40CONFIG_OF=y
41CONFIG_PPC_UDBG_16550=y
42# CONFIG_GENERIC_TBSYNC is not set
43CONFIG_AUDIT_ARCH=y
44CONFIG_GENERIC_BUG=y
45CONFIG_DEFAULT_UIMAGE=y
46# CONFIG_PPC_DCR_NATIVE is not set
47# CONFIG_PPC_DCR_MMIO is not set
48CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
49
50#
51# General setup
52#
53CONFIG_EXPERIMENTAL=y
54CONFIG_BROKEN_ON_SMP=y
55CONFIG_INIT_ENV_ARG_LIMIT=32
56CONFIG_LOCALVERSION=""
57# CONFIG_LOCALVERSION_AUTO is not set
58# CONFIG_SWAP is not set
59# CONFIG_SYSVIPC is not set
60# CONFIG_POSIX_MQUEUE is not set
61# CONFIG_BSD_PROCESS_ACCT is not set
62# CONFIG_TASKSTATS is not set
63# CONFIG_USER_NS is not set
64# CONFIG_AUDIT is not set
65CONFIG_IKCONFIG=y
66CONFIG_IKCONFIG_PROC=y
67CONFIG_LOG_BUF_SHIFT=14
68CONFIG_SYSFS_DEPRECATED=y
69# CONFIG_RELAY is not set
70CONFIG_BLK_DEV_INITRD=y
71CONFIG_INITRAMFS_SOURCE=""
72# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
73CONFIG_SYSCTL=y
74CONFIG_EMBEDDED=y
75CONFIG_SYSCTL_SYSCALL=y
76CONFIG_KALLSYMS=y
77# CONFIG_KALLSYMS_ALL is not set
78CONFIG_KALLSYMS_EXTRA_PASS=y
79CONFIG_HOTPLUG=y
80CONFIG_PRINTK=y
81CONFIG_BUG=y
82# CONFIG_ELF_CORE is not set
83CONFIG_BASE_FULL=y
84CONFIG_FUTEX=y
85CONFIG_ANON_INODES=y
86CONFIG_EPOLL=y
87CONFIG_SIGNALFD=y
88CONFIG_EVENTFD=y
89CONFIG_SHMEM=y
90CONFIG_VM_EVENT_COUNTERS=y
91CONFIG_SLAB=y
92# CONFIG_SLUB is not set
93# CONFIG_SLOB is not set
94CONFIG_RT_MUTEXES=y
95# CONFIG_TINY_SHMEM is not set
96CONFIG_BASE_SMALL=0
97# CONFIG_MODULES is not set
98CONFIG_BLOCK=y
99# CONFIG_LBD is not set
100# CONFIG_BLK_DEV_IO_TRACE is not set
101# CONFIG_LSF is not set
102# CONFIG_BLK_DEV_BSG is not set
103
104#
105# IO Schedulers
106#
107CONFIG_IOSCHED_NOOP=y
108# CONFIG_IOSCHED_AS is not set
109CONFIG_IOSCHED_DEADLINE=y
110# CONFIG_IOSCHED_CFQ is not set
111# CONFIG_DEFAULT_AS is not set
112CONFIG_DEFAULT_DEADLINE=y
113# CONFIG_DEFAULT_CFQ is not set
114# CONFIG_DEFAULT_NOOP is not set
115CONFIG_DEFAULT_IOSCHED="deadline"
116
117#
118# Platform support
119#
120# CONFIG_PPC_MULTIPLATFORM is not set
121# CONFIG_EMBEDDED6xx is not set
122# CONFIG_PPC_82xx is not set
123# CONFIG_PPC_83xx is not set
124CONFIG_PPC_86xx=y
125# CONFIG_PPC_MPC52xx is not set
126# CONFIG_PPC_MPC5200 is not set
127# CONFIG_PPC_CELL is not set
128# CONFIG_PPC_CELL_NATIVE is not set
129# CONFIG_PQ2ADS is not set
130# CONFIG_MPC8641_HPCN is not set
131CONFIG_MPC8610_HPCD=y
132CONFIG_MPC8610=y
133CONFIG_MPIC=y
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#
149CONFIG_HIGHMEM=y
150# CONFIG_HZ_100 is not set
151# CONFIG_HZ_250 is not set
152# CONFIG_HZ_300 is not set
153CONFIG_HZ_1000=y
154CONFIG_HZ=1000
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
160CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
161CONFIG_ARCH_FLATMEM_ENABLE=y
162CONFIG_ARCH_POPULATES_NODE_MAP=y
163CONFIG_SELECT_MEMORY_MODEL=y
164CONFIG_FLATMEM_MANUAL=y
165# CONFIG_DISCONTIGMEM_MANUAL is not set
166# CONFIG_SPARSEMEM_MANUAL is not set
167CONFIG_FLATMEM=y
168CONFIG_FLAT_NODE_MEM_MAP=y
169# CONFIG_SPARSEMEM_STATIC is not set
170CONFIG_SPLIT_PTLOCK_CPUS=4
171# CONFIG_RESOURCES_64BIT is not set
172CONFIG_ZONE_DMA_FLAG=1
173CONFIG_BOUNCE=y
174CONFIG_VIRT_TO_BUS=y
175CONFIG_PROC_DEVICETREE=y
176# CONFIG_CMDLINE_BOOL is not set
177# CONFIG_PM is not set
178CONFIG_SUSPEND_UP_POSSIBLE=y
179CONFIG_HIBERNATION_UP_POSSIBLE=y
180# CONFIG_SECCOMP is not set
181# CONFIG_WANT_DEVICE_TREE is not set
182CONFIG_ISA_DMA_API=y
183
184#
185# Bus options
186#
187CONFIG_ZONE_DMA=y
188CONFIG_GENERIC_ISA_DMA=y
189CONFIG_PPC_INDIRECT_PCI=y
190CONFIG_FSL_SOC=y
191CONFIG_FSL_PCI=y
192CONFIG_PCI=y
193CONFIG_PCI_DOMAINS=y
194CONFIG_PCI_SYSCALL=y
195CONFIG_PCIEPORTBUS=y
196CONFIG_PCIEAER=y
197CONFIG_ARCH_SUPPORTS_MSI=y
198# CONFIG_PCI_MSI is not set
199CONFIG_PCI_DEBUG=y
200
201#
202# PCCARD (PCMCIA/CardBus) support
203#
204# CONFIG_PCCARD is not set
205# CONFIG_HOTPLUG_PCI is not set
206
207#
208# Advanced setup
209#
210# CONFIG_ADVANCED_OPTIONS is not set
211
212#
213# Default settings for advanced configuration options are used
214#
215CONFIG_HIGHMEM_START=0xfe000000
216CONFIG_LOWMEM_SIZE=0x30000000
217CONFIG_KERNEL_START=0xc0000000
218CONFIG_TASK_SIZE=0x80000000
219CONFIG_BOOT_LOAD=0x00800000
220
221#
222# Networking
223#
224CONFIG_NET=y
225
226#
227# Networking options
228#
229CONFIG_PACKET=y
230# CONFIG_PACKET_MMAP is not set
231CONFIG_UNIX=y
232CONFIG_XFRM=y
233CONFIG_XFRM_USER=y
234# CONFIG_XFRM_SUB_POLICY is not set
235# CONFIG_XFRM_MIGRATE is not set
236# CONFIG_NET_KEY is not set
237CONFIG_INET=y
238# CONFIG_IP_MULTICAST is not set
239# CONFIG_IP_ADVANCED_ROUTER is not set
240CONFIG_IP_FIB_HASH=y
241CONFIG_IP_PNP=y
242CONFIG_IP_PNP_DHCP=y
243CONFIG_IP_PNP_BOOTP=y
244CONFIG_IP_PNP_RARP=y
245# CONFIG_NET_IPIP is not set
246# CONFIG_NET_IPGRE is not set
247# CONFIG_ARPD is not set
248# CONFIG_SYN_COOKIES is not set
249# CONFIG_INET_AH is not set
250# CONFIG_INET_ESP is not set
251# CONFIG_INET_IPCOMP is not set
252# CONFIG_INET_XFRM_TUNNEL is not set
253CONFIG_INET_TUNNEL=y
254CONFIG_INET_XFRM_MODE_TRANSPORT=y
255CONFIG_INET_XFRM_MODE_TUNNEL=y
256CONFIG_INET_XFRM_MODE_BEET=y
257CONFIG_INET_DIAG=y
258CONFIG_INET_TCP_DIAG=y
259# CONFIG_TCP_CONG_ADVANCED is not set
260CONFIG_TCP_CONG_CUBIC=y
261CONFIG_DEFAULT_TCP_CONG="cubic"
262# CONFIG_TCP_MD5SIG is not set
263CONFIG_IPV6=y
264# CONFIG_IPV6_PRIVACY is not set
265# CONFIG_IPV6_ROUTER_PREF is not set
266# CONFIG_IPV6_OPTIMISTIC_DAD is not set
267# CONFIG_INET6_AH is not set
268# CONFIG_INET6_ESP is not set
269# CONFIG_INET6_IPCOMP is not set
270# CONFIG_IPV6_MIP6 is not set
271# CONFIG_INET6_XFRM_TUNNEL is not set
272# CONFIG_INET6_TUNNEL is not set
273CONFIG_INET6_XFRM_MODE_TRANSPORT=y
274CONFIG_INET6_XFRM_MODE_TUNNEL=y
275CONFIG_INET6_XFRM_MODE_BEET=y
276# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
277CONFIG_IPV6_SIT=y
278# CONFIG_IPV6_TUNNEL is not set
279# CONFIG_IPV6_MULTIPLE_TABLES is not set
280# CONFIG_NETWORK_SECMARK is not set
281# CONFIG_NETFILTER is not set
282# CONFIG_IP_DCCP is not set
283# CONFIG_IP_SCTP is not set
284# CONFIG_TIPC is not set
285# CONFIG_ATM is not set
286# CONFIG_BRIDGE is not set
287# CONFIG_VLAN_8021Q is not set
288# CONFIG_DECNET is not set
289# CONFIG_LLC2 is not set
290# CONFIG_IPX is not set
291# CONFIG_ATALK is not set
292# CONFIG_X25 is not set
293# CONFIG_LAPB is not set
294# CONFIG_ECONET is not set
295# CONFIG_WAN_ROUTER is not set
296
297#
298# QoS and/or fair queueing
299#
300# CONFIG_NET_SCHED is not set
301
302#
303# Network testing
304#
305# CONFIG_NET_PKTGEN is not set
306# CONFIG_HAMRADIO is not set
307# CONFIG_IRDA is not set
308# CONFIG_BT is not set
309# CONFIG_AF_RXRPC is not set
310
311#
312# Wireless
313#
314# CONFIG_CFG80211 is not set
315# CONFIG_WIRELESS_EXT is not set
316# CONFIG_MAC80211 is not set
317# CONFIG_IEEE80211 is not set
318# CONFIG_RFKILL is not set
319# CONFIG_NET_9P is not set
320
321#
322# Device Drivers
323#
324
325#
326# Generic Driver Options
327#
328CONFIG_STANDALONE=y
329CONFIG_PREVENT_FIRMWARE_BUILD=y
330CONFIG_FW_LOADER=y
331# CONFIG_DEBUG_DRIVER is not set
332# CONFIG_DEBUG_DEVRES is not set
333# CONFIG_SYS_HYPERVISOR is not set
334# CONFIG_CONNECTOR is not set
335# CONFIG_MTD is not set
336CONFIG_OF_DEVICE=y
337# CONFIG_PARPORT is not set
338CONFIG_BLK_DEV=y
339# CONFIG_BLK_DEV_FD is not set
340# CONFIG_BLK_CPQ_DA is not set
341# CONFIG_BLK_CPQ_CISS_DA is not set
342# CONFIG_BLK_DEV_DAC960 is not set
343# CONFIG_BLK_DEV_UMEM is not set
344# CONFIG_BLK_DEV_COW_COMMON is not set
345CONFIG_BLK_DEV_LOOP=y
346# CONFIG_BLK_DEV_CRYPTOLOOP is not set
347# CONFIG_BLK_DEV_NBD is not set
348# CONFIG_BLK_DEV_SX8 is not set
349CONFIG_BLK_DEV_RAM=y
350CONFIG_BLK_DEV_RAM_COUNT=16
351CONFIG_BLK_DEV_RAM_SIZE=131072
352CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
353# CONFIG_CDROM_PKTCDVD is not set
354# CONFIG_ATA_OVER_ETH is not set
355CONFIG_MISC_DEVICES=y
356# CONFIG_PHANTOM is not set
357# CONFIG_EEPROM_93CX6 is not set
358# CONFIG_SGI_IOC4 is not set
359# CONFIG_TIFM_CORE is not set
360CONFIG_IDE=y
361CONFIG_IDE_MAX_HWIFS=4
362# CONFIG_BLK_DEV_IDE is not set
363# CONFIG_BLK_DEV_HD_ONLY is not set
364# CONFIG_BLK_DEV_HD is not set
365
366#
367# SCSI device support
368#
369# CONFIG_RAID_ATTRS is not set
370CONFIG_SCSI=y
371CONFIG_SCSI_DMA=y
372CONFIG_SCSI_TGT=y
373# CONFIG_SCSI_NETLINK is not set
374CONFIG_SCSI_PROC_FS=y
375
376#
377# SCSI support type (disk, tape, CD-ROM)
378#
379CONFIG_BLK_DEV_SD=y
380# CONFIG_CHR_DEV_ST is not set
381# CONFIG_CHR_DEV_OSST is not set
382# CONFIG_BLK_DEV_SR is not set
383CONFIG_CHR_DEV_SG=y
384# CONFIG_CHR_DEV_SCH is not set
385
386#
387# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
388#
389# CONFIG_SCSI_MULTI_LUN is not set
390# CONFIG_SCSI_CONSTANTS is not set
391# CONFIG_SCSI_LOGGING is not set
392# CONFIG_SCSI_SCAN_ASYNC is not set
393
394#
395# SCSI Transports
396#
397# CONFIG_SCSI_SPI_ATTRS is not set
398# CONFIG_SCSI_FC_ATTRS is not set
399# CONFIG_SCSI_ISCSI_ATTRS is not set
400# CONFIG_SCSI_SAS_LIBSAS is not set
401CONFIG_SCSI_LOWLEVEL=y
402# CONFIG_ISCSI_TCP is not set
403# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
404# CONFIG_SCSI_3W_9XXX is not set
405# CONFIG_SCSI_ACARD is not set
406# CONFIG_SCSI_AACRAID is not set
407# CONFIG_SCSI_AIC7XXX is not set
408# CONFIG_SCSI_AIC7XXX_OLD is not set
409# CONFIG_SCSI_AIC79XX is not set
410# CONFIG_SCSI_AIC94XX is not set
411# CONFIG_SCSI_DPT_I2O is not set
412# CONFIG_SCSI_ARCMSR is not set
413# CONFIG_MEGARAID_NEWGEN is not set
414# CONFIG_MEGARAID_LEGACY is not set
415# CONFIG_MEGARAID_SAS is not set
416# CONFIG_SCSI_HPTIOP is not set
417# CONFIG_SCSI_BUSLOGIC is not set
418# CONFIG_SCSI_DMX3191D is not set
419# CONFIG_SCSI_EATA is not set
420# CONFIG_SCSI_FUTURE_DOMAIN is not set
421# CONFIG_SCSI_GDTH is not set
422# CONFIG_SCSI_IPS is not set
423# CONFIG_SCSI_INITIO is not set
424# CONFIG_SCSI_INIA100 is not set
425# CONFIG_SCSI_STEX is not set
426# CONFIG_SCSI_SYM53C8XX_2 is not set
427# CONFIG_SCSI_IPR is not set
428# CONFIG_SCSI_QLOGIC_1280 is not set
429# CONFIG_SCSI_QLA_FC is not set
430# CONFIG_SCSI_QLA_ISCSI is not set
431# CONFIG_SCSI_LPFC is not set
432# CONFIG_SCSI_DC395x is not set
433# CONFIG_SCSI_DC390T is not set
434# CONFIG_SCSI_NSP32 is not set
435# CONFIG_SCSI_DEBUG is not set
436# CONFIG_SCSI_SRP is not set
437CONFIG_ATA=y
438# CONFIG_ATA_NONSTANDARD is not set
439CONFIG_SATA_AHCI=y
440# CONFIG_SATA_SVW is not set
441# CONFIG_ATA_PIIX is not set
442# CONFIG_SATA_MV is not set
443# CONFIG_SATA_NV is not set
444# CONFIG_PDC_ADMA is not set
445# CONFIG_SATA_QSTOR is not set
446# CONFIG_SATA_PROMISE is not set
447# CONFIG_SATA_SX4 is not set
448# CONFIG_SATA_SIL is not set
449# CONFIG_SATA_SIL24 is not set
450# CONFIG_SATA_SIS is not set
451# CONFIG_SATA_ULI is not set
452# CONFIG_SATA_VIA is not set
453# CONFIG_SATA_VITESSE is not set
454# CONFIG_SATA_INIC162X is not set
455CONFIG_PATA_ALI=y
456# CONFIG_PATA_AMD is not set
457# CONFIG_PATA_ARTOP is not set
458# CONFIG_PATA_ATIIXP is not set
459# CONFIG_PATA_CMD640_PCI is not set
460# CONFIG_PATA_CMD64X is not set
461# CONFIG_PATA_CS5520 is not set
462# CONFIG_PATA_CS5530 is not set
463# CONFIG_PATA_CYPRESS is not set
464# CONFIG_PATA_EFAR is not set
465# CONFIG_ATA_GENERIC is not set
466# CONFIG_PATA_HPT366 is not set
467# CONFIG_PATA_HPT37X is not set
468# CONFIG_PATA_HPT3X2N is not set
469# CONFIG_PATA_HPT3X3 is not set
470# CONFIG_PATA_IT821X is not set
471# CONFIG_PATA_IT8213 is not set
472# CONFIG_PATA_JMICRON is not set
473# CONFIG_PATA_TRIFLEX is not set
474# CONFIG_PATA_MARVELL is not set
475# CONFIG_PATA_MPIIX is not set
476# CONFIG_PATA_OLDPIIX is not set
477# CONFIG_PATA_NETCELL is not set
478# CONFIG_PATA_NS87410 is not set
479# CONFIG_PATA_OPTI is not set
480# CONFIG_PATA_OPTIDMA is not set
481# CONFIG_PATA_PDC_OLD is not set
482# CONFIG_PATA_RADISYS is not set
483# CONFIG_PATA_RZ1000 is not set
484# CONFIG_PATA_SC1200 is not set
485# CONFIG_PATA_SERVERWORKS is not set
486# CONFIG_PATA_PDC2027X is not set
487# CONFIG_PATA_SIL680 is not set
488# CONFIG_PATA_SIS is not set
489# CONFIG_PATA_VIA is not set
490# CONFIG_PATA_WINBOND is not set
491# CONFIG_PATA_PLATFORM is not set
492# CONFIG_MD is not set
493
494#
495# Fusion MPT device support
496#
497# CONFIG_FUSION is not set
498# CONFIG_FUSION_SPI is not set
499# CONFIG_FUSION_FC is not set
500# CONFIG_FUSION_SAS is not set
501
502#
503# IEEE 1394 (FireWire) support
504#
505# CONFIG_FIREWIRE is not set
506# CONFIG_IEEE1394 is not set
507# CONFIG_I2O is not set
508# CONFIG_MACINTOSH_DRIVERS is not set
509CONFIG_NETDEVICES=y
510# CONFIG_NETDEVICES_MULTIQUEUE is not set
511CONFIG_DUMMY=y
512# CONFIG_BONDING is not set
513# CONFIG_MACVLAN is not set
514# CONFIG_EQUALIZER is not set
515# CONFIG_TUN is not set
516# CONFIG_ARCNET is not set
517CONFIG_PHYLIB=y
518
519#
520# MII PHY device drivers
521#
522# CONFIG_MARVELL_PHY is not set
523# CONFIG_DAVICOM_PHY is not set
524# CONFIG_QSEMI_PHY is not set
525# CONFIG_LXT_PHY is not set
526# CONFIG_CICADA_PHY is not set
527# CONFIG_VITESSE_PHY is not set
528# CONFIG_SMSC_PHY is not set
529# CONFIG_BROADCOM_PHY is not set
530# CONFIG_ICPLUS_PHY is not set
531# CONFIG_FIXED_PHY is not set
532CONFIG_NET_ETHERNET=y
533CONFIG_MII=y
534# CONFIG_HAPPYMEAL is not set
535# CONFIG_SUNGEM is not set
536# CONFIG_CASSINI is not set
537# CONFIG_NET_VENDOR_3COM is not set
538CONFIG_NET_TULIP=y
539# CONFIG_DE2104X is not set
540CONFIG_TULIP=y
541# CONFIG_TULIP_MWI is not set
542CONFIG_TULIP_MMIO=y
543# CONFIG_TULIP_NAPI is not set
544# CONFIG_DE4X5 is not set
545# CONFIG_WINBOND_840 is not set
546# CONFIG_DM9102 is not set
547# CONFIG_ULI526X is not set
548# CONFIG_HP100 is not set
549CONFIG_NET_PCI=y
550# CONFIG_PCNET32 is not set
551# CONFIG_AMD8111_ETH is not set
552# CONFIG_ADAPTEC_STARFIRE is not set
553# CONFIG_B44 is not set
554# CONFIG_FORCEDETH is not set
555# CONFIG_DGRS is not set
556# CONFIG_EEPRO100 is not set
557# CONFIG_E100 is not set
558# CONFIG_FEALNX is not set
559# CONFIG_NATSEMI is not set
560# CONFIG_NE2K_PCI is not set
561# CONFIG_8139CP is not set
562CONFIG_8139TOO=y
563CONFIG_8139TOO_PIO=y
564# CONFIG_8139TOO_TUNE_TWISTER is not set
565# CONFIG_8139TOO_8129 is not set
566# CONFIG_8139_OLD_RX_RESET is not set
567# CONFIG_SIS900 is not set
568# CONFIG_EPIC100 is not set
569# CONFIG_SUNDANCE is not set
570# CONFIG_TLAN is not set
571# CONFIG_VIA_RHINE is not set
572# CONFIG_SC92031 is not set
573CONFIG_NETDEV_1000=y
574# CONFIG_ACENIC is not set
575# CONFIG_DL2K is not set
576# CONFIG_E1000 is not set
577# CONFIG_NS83820 is not set
578# CONFIG_HAMACHI is not set
579# CONFIG_YELLOWFIN is not set
580# CONFIG_R8169 is not set
581# CONFIG_SIS190 is not set
582# CONFIG_SKGE is not set
583# CONFIG_SKY2 is not set
584# CONFIG_SK98LIN is not set
585# CONFIG_VIA_VELOCITY is not set
586# CONFIG_TIGON3 is not set
587# CONFIG_BNX2 is not set
588# CONFIG_GIANFAR is not set
589# CONFIG_QLA3XXX is not set
590# CONFIG_ATL1 is not set
591CONFIG_NETDEV_10000=y
592# CONFIG_CHELSIO_T1 is not set
593# CONFIG_CHELSIO_T3 is not set
594# CONFIG_IXGB is not set
595# CONFIG_S2IO is not set
596# CONFIG_MYRI10GE is not set
597# CONFIG_NETXEN_NIC is not set
598# CONFIG_MLX4_CORE is not set
599# CONFIG_TR is not set
600
601#
602# Wireless LAN
603#
604# CONFIG_WLAN_PRE80211 is not set
605# CONFIG_WLAN_80211 is not set
606# CONFIG_WAN is not set
607# CONFIG_FDDI is not set
608# CONFIG_HIPPI is not set
609# CONFIG_PPP is not set
610# CONFIG_SLIP is not set
611# CONFIG_NET_FC is not set
612# CONFIG_SHAPER is not set
613# CONFIG_NETCONSOLE is not set
614# CONFIG_NETPOLL is not set
615# CONFIG_NET_POLL_CONTROLLER is not set
616# CONFIG_ISDN is not set
617# CONFIG_PHONE is not set
618
619#
620# Input device support
621#
622CONFIG_INPUT=y
623# CONFIG_INPUT_FF_MEMLESS is not set
624# CONFIG_INPUT_POLLDEV is not set
625
626#
627# Userland interfaces
628#
629# CONFIG_INPUT_MOUSEDEV is not set
630# CONFIG_INPUT_JOYDEV is not set
631# CONFIG_INPUT_TSDEV is not set
632# CONFIG_INPUT_EVDEV is not set
633# CONFIG_INPUT_EVBUG is not set
634
635#
636# Input Device Drivers
637#
638# CONFIG_INPUT_KEYBOARD is not set
639# CONFIG_INPUT_MOUSE is not set
640# CONFIG_INPUT_JOYSTICK is not set
641# CONFIG_INPUT_TABLET is not set
642# CONFIG_INPUT_TOUCHSCREEN is not set
643# CONFIG_INPUT_MISC is not set
644
645#
646# Hardware I/O ports
647#
648CONFIG_SERIO=y
649CONFIG_SERIO_I8042=y
650CONFIG_SERIO_SERPORT=y
651# CONFIG_SERIO_PCIPS2 is not set
652CONFIG_SERIO_LIBPS2=y
653# CONFIG_SERIO_RAW is not set
654# CONFIG_GAMEPORT is not set
655
656#
657# Character devices
658#
659CONFIG_VT=y
660CONFIG_VT_CONSOLE=y
661CONFIG_HW_CONSOLE=y
662# CONFIG_VT_HW_CONSOLE_BINDING is not set
663# CONFIG_SERIAL_NONSTANDARD is not set
664
665#
666# Serial drivers
667#
668CONFIG_SERIAL_8250=y
669CONFIG_SERIAL_8250_CONSOLE=y
670CONFIG_SERIAL_8250_PCI=y
671CONFIG_SERIAL_8250_NR_UARTS=2
672CONFIG_SERIAL_8250_RUNTIME_UARTS=2
673CONFIG_SERIAL_8250_EXTENDED=y
674CONFIG_SERIAL_8250_MANY_PORTS=y
675CONFIG_SERIAL_8250_SHARE_IRQ=y
676CONFIG_SERIAL_8250_DETECT_IRQ=y
677CONFIG_SERIAL_8250_RSA=y
678
679#
680# Non-8250 serial port support
681#
682# CONFIG_SERIAL_UARTLITE is not set
683CONFIG_SERIAL_CORE=y
684CONFIG_SERIAL_CORE_CONSOLE=y
685# CONFIG_SERIAL_JSM is not set
686CONFIG_SERIAL_OF_PLATFORM=y
687CONFIG_UNIX98_PTYS=y
688# CONFIG_LEGACY_PTYS is not set
689# CONFIG_IPMI_HANDLER is not set
690# CONFIG_WATCHDOG is not set
691# CONFIG_HW_RANDOM is not set
692# CONFIG_NVRAM is not set
693# CONFIG_GEN_RTC is not set
694# CONFIG_R3964 is not set
695# CONFIG_APPLICOM is not set
696# CONFIG_AGP is not set
697# CONFIG_DRM is not set
698# CONFIG_RAW_DRIVER is not set
699# CONFIG_TCG_TPM is not set
700CONFIG_DEVPORT=y
701# CONFIG_I2C is not set
702
703#
704# SPI support
705#
706# CONFIG_SPI is not set
707# CONFIG_SPI_MASTER is not set
708# CONFIG_W1 is not set
709# CONFIG_POWER_SUPPLY is not set
710# CONFIG_HWMON is not set
711
712#
713# Multifunction device drivers
714#
715# CONFIG_MFD_SM501 is not set
716
717#
718# Multimedia devices
719#
720# CONFIG_VIDEO_DEV is not set
721# CONFIG_DVB_CORE is not set
722CONFIG_DAB=y
723
724#
725# Graphics support
726#
727# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
728
729#
730# Display device support
731#
732# CONFIG_DISPLAY_SUPPORT is not set
733# CONFIG_VGASTATE is not set
734CONFIG_VIDEO_OUTPUT_CONTROL=y
735# CONFIG_FB is not set
736# CONFIG_FB_IBM_GXT4500 is not set
737
738#
739# Console display driver support
740#
741CONFIG_VGA_CONSOLE=y
742# CONFIG_VGACON_SOFT_SCROLLBACK is not set
743CONFIG_DUMMY_CONSOLE=y
744
745#
746# Sound
747#
748# CONFIG_SOUND is not set
749CONFIG_HID_SUPPORT=y
750CONFIG_HID=y
751# CONFIG_HID_DEBUG is not set
752CONFIG_USB_SUPPORT=y
753CONFIG_USB_ARCH_HAS_HCD=y
754CONFIG_USB_ARCH_HAS_OHCI=y
755CONFIG_USB_ARCH_HAS_EHCI=y
756# CONFIG_USB is not set
757
758#
759# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
760#
761
762#
763# USB Gadget Support
764#
765# CONFIG_USB_GADGET is not set
766# CONFIG_MMC is not set
767# CONFIG_NEW_LEDS is not set
768# CONFIG_INFINIBAND is not set
769# CONFIG_EDAC is not set
770# CONFIG_RTC_CLASS is not set
771
772#
773# DMA Engine support
774#
775# CONFIG_DMA_ENGINE is not set
776
777#
778# DMA Clients
779#
780
781#
782# DMA Devices
783#
784
785#
786# Userspace I/O
787#
788# CONFIG_UIO is not set
789
790#
791# File systems
792#
793CONFIG_EXT2_FS=y
794# CONFIG_EXT2_FS_XATTR is not set
795# CONFIG_EXT2_FS_XIP is not set
796CONFIG_EXT3_FS=y
797CONFIG_EXT3_FS_XATTR=y
798# CONFIG_EXT3_FS_POSIX_ACL is not set
799# CONFIG_EXT3_FS_SECURITY is not set
800# CONFIG_EXT4DEV_FS is not set
801CONFIG_JBD=y
802# CONFIG_JBD_DEBUG is not set
803CONFIG_FS_MBCACHE=y
804# CONFIG_REISERFS_FS is not set
805# CONFIG_JFS_FS is not set
806# CONFIG_FS_POSIX_ACL is not set
807# CONFIG_XFS_FS is not set
808# CONFIG_GFS2_FS is not set
809# CONFIG_OCFS2_FS is not set
810# CONFIG_MINIX_FS is not set
811# CONFIG_ROMFS_FS is not set
812# CONFIG_INOTIFY is not set
813# CONFIG_QUOTA is not set
814# CONFIG_DNOTIFY is not set
815# CONFIG_AUTOFS_FS is not set
816# CONFIG_AUTOFS4_FS is not set
817# CONFIG_FUSE_FS is not set
818
819#
820# CD-ROM/DVD Filesystems
821#
822# CONFIG_ISO9660_FS is not set
823# CONFIG_UDF_FS is not set
824
825#
826# DOS/FAT/NT Filesystems
827#
828# CONFIG_MSDOS_FS is not set
829# CONFIG_VFAT_FS is not set
830# CONFIG_NTFS_FS is not set
831
832#
833# Pseudo filesystems
834#
835CONFIG_PROC_FS=y
836CONFIG_PROC_KCORE=y
837CONFIG_PROC_SYSCTL=y
838CONFIG_SYSFS=y
839CONFIG_TMPFS=y
840# CONFIG_TMPFS_POSIX_ACL is not set
841# CONFIG_HUGETLB_PAGE is not set
842CONFIG_RAMFS=y
843# CONFIG_CONFIGFS_FS is not set
844
845#
846# Miscellaneous filesystems
847#
848# CONFIG_ADFS_FS is not set
849# CONFIG_AFFS_FS is not set
850# CONFIG_HFS_FS is not set
851# CONFIG_HFSPLUS_FS is not set
852# CONFIG_BEFS_FS is not set
853# CONFIG_BFS_FS is not set
854# CONFIG_EFS_FS is not set
855# CONFIG_CRAMFS is not set
856# CONFIG_VXFS_FS is not set
857# CONFIG_HPFS_FS is not set
858# CONFIG_QNX4FS_FS is not set
859# CONFIG_SYSV_FS is not set
860# CONFIG_UFS_FS is not set
861
862#
863# Network File Systems
864#
865CONFIG_NFS_FS=y
866CONFIG_NFS_V3=y
867# CONFIG_NFS_V3_ACL is not set
868# CONFIG_NFS_V4 is not set
869# CONFIG_NFS_DIRECTIO is not set
870CONFIG_NFSD=y
871# CONFIG_NFSD_V3 is not set
872CONFIG_NFSD_TCP=y
873CONFIG_ROOT_NFS=y
874CONFIG_LOCKD=y
875CONFIG_LOCKD_V4=y
876CONFIG_EXPORTFS=y
877CONFIG_NFS_COMMON=y
878CONFIG_SUNRPC=y
879# CONFIG_SUNRPC_BIND34 is not set
880# CONFIG_RPCSEC_GSS_KRB5 is not set
881# CONFIG_RPCSEC_GSS_SPKM3 is not set
882# CONFIG_SMB_FS is not set
883# CONFIG_CIFS is not set
884# CONFIG_NCP_FS is not set
885# CONFIG_CODA_FS is not set
886# CONFIG_AFS_FS is not set
887
888#
889# Partition Types
890#
891CONFIG_PARTITION_ADVANCED=y
892# CONFIG_ACORN_PARTITION is not set
893# CONFIG_OSF_PARTITION is not set
894# CONFIG_AMIGA_PARTITION is not set
895# CONFIG_ATARI_PARTITION is not set
896# CONFIG_MAC_PARTITION is not set
897CONFIG_MSDOS_PARTITION=y
898# CONFIG_BSD_DISKLABEL is not set
899# CONFIG_MINIX_SUBPARTITION is not set
900# CONFIG_SOLARIS_X86_PARTITION is not set
901# CONFIG_UNIXWARE_DISKLABEL is not set
902CONFIG_LDM_PARTITION=y
903# CONFIG_LDM_DEBUG is not set
904# CONFIG_SGI_PARTITION is not set
905# CONFIG_ULTRIX_PARTITION is not set
906# CONFIG_SUN_PARTITION is not set
907# CONFIG_KARMA_PARTITION is not set
908# CONFIG_EFI_PARTITION is not set
909# CONFIG_SYSV68_PARTITION is not set
910
911#
912# Native Language Support
913#
914CONFIG_NLS=y
915CONFIG_NLS_DEFAULT="iso8859-1"
916# CONFIG_NLS_CODEPAGE_437 is not set
917# CONFIG_NLS_CODEPAGE_737 is not set
918# CONFIG_NLS_CODEPAGE_775 is not set
919# CONFIG_NLS_CODEPAGE_850 is not set
920# CONFIG_NLS_CODEPAGE_852 is not set
921# CONFIG_NLS_CODEPAGE_855 is not set
922# CONFIG_NLS_CODEPAGE_857 is not set
923# CONFIG_NLS_CODEPAGE_860 is not set
924# CONFIG_NLS_CODEPAGE_861 is not set
925# CONFIG_NLS_CODEPAGE_862 is not set
926# CONFIG_NLS_CODEPAGE_863 is not set
927# CONFIG_NLS_CODEPAGE_864 is not set
928# CONFIG_NLS_CODEPAGE_865 is not set
929# CONFIG_NLS_CODEPAGE_866 is not set
930# CONFIG_NLS_CODEPAGE_869 is not set
931# CONFIG_NLS_CODEPAGE_936 is not set
932# CONFIG_NLS_CODEPAGE_950 is not set
933# CONFIG_NLS_CODEPAGE_932 is not set
934# CONFIG_NLS_CODEPAGE_949 is not set
935# CONFIG_NLS_CODEPAGE_874 is not set
936# CONFIG_NLS_ISO8859_8 is not set
937# CONFIG_NLS_CODEPAGE_1250 is not set
938# CONFIG_NLS_CODEPAGE_1251 is not set
939# CONFIG_NLS_ASCII is not set
940# CONFIG_NLS_ISO8859_1 is not set
941# CONFIG_NLS_ISO8859_2 is not set
942# CONFIG_NLS_ISO8859_3 is not set
943# CONFIG_NLS_ISO8859_4 is not set
944# CONFIG_NLS_ISO8859_5 is not set
945# CONFIG_NLS_ISO8859_6 is not set
946# CONFIG_NLS_ISO8859_7 is not set
947# CONFIG_NLS_ISO8859_9 is not set
948# CONFIG_NLS_ISO8859_13 is not set
949# CONFIG_NLS_ISO8859_14 is not set
950# CONFIG_NLS_ISO8859_15 is not set
951# CONFIG_NLS_KOI8_R is not set
952# CONFIG_NLS_KOI8_U is not set
953# CONFIG_NLS_UTF8 is not set
954
955#
956# Distributed Lock Manager
957#
958# CONFIG_DLM is not set
959# CONFIG_UCC_SLOW is not set
960
961#
962# Library routines
963#
964CONFIG_BITREVERSE=y
965# CONFIG_CRC_CCITT is not set
966# CONFIG_CRC16 is not set
967# CONFIG_CRC_ITU_T is not set
968CONFIG_CRC32=y
969# CONFIG_CRC7 is not set
970# CONFIG_LIBCRC32C is not set
971CONFIG_PLIST=y
972CONFIG_HAS_IOMEM=y
973CONFIG_HAS_IOPORT=y
974CONFIG_HAS_DMA=y
975
976#
977# Instrumentation Support
978#
979# CONFIG_PROFILING is not set
980
981#
982# Kernel hacking
983#
984# CONFIG_PRINTK_TIME is not set
985CONFIG_ENABLE_MUST_CHECK=y
986# CONFIG_MAGIC_SYSRQ is not set
987# CONFIG_UNUSED_SYMBOLS is not set
988# CONFIG_DEBUG_FS is not set
989# CONFIG_HEADERS_CHECK is not set
990CONFIG_DEBUG_KERNEL=y
991CONFIG_DEBUG_SHIRQ=y
992CONFIG_DETECT_SOFTLOCKUP=y
993CONFIG_SCHED_DEBUG=y
994# CONFIG_SCHEDSTATS is not set
995# CONFIG_TIMER_STATS is not set
996# CONFIG_DEBUG_SLAB is not set
997# CONFIG_DEBUG_RT_MUTEXES is not set
998# CONFIG_RT_MUTEX_TESTER is not set
999# CONFIG_DEBUG_SPINLOCK is not set
1000# CONFIG_DEBUG_MUTEXES is not set
1001# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1002# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1003# CONFIG_DEBUG_KOBJECT is not set
1004# CONFIG_DEBUG_HIGHMEM is not set
1005CONFIG_DEBUG_BUGVERBOSE=y
1006CONFIG_DEBUG_INFO=y
1007# CONFIG_DEBUG_VM is not set
1008# CONFIG_DEBUG_LIST is not set
1009CONFIG_FORCED_INLINING=y
1010# CONFIG_FAULT_INJECTION is not set
1011# CONFIG_DEBUG_STACKOVERFLOW is not set
1012# CONFIG_DEBUG_STACK_USAGE is not set
1013# CONFIG_DEBUG_PAGEALLOC is not set
1014# CONFIG_DEBUGGER is not set
1015# CONFIG_BDI_SWITCH is not set
1016# CONFIG_PPC_EARLY_DEBUG is not set
1017
1018#
1019# Security options
1020#
1021# CONFIG_KEYS is not set
1022# CONFIG_SECURITY is not set
1023# CONFIG_CRYPTO is not set
diff --git a/arch/powerpc/configs/mpc885_ads_defconfig b/arch/powerpc/configs/mpc885_ads_defconfig
index d27e1f8c38fa..482d99db6870 100644
--- a/arch/powerpc/configs/mpc885_ads_defconfig
+++ b/arch/powerpc/configs/mpc885_ads_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc4 3# Linux kernel version: 2.6.23-rc3
4# Tue Aug 28 21:24:45 2007 4# Mon Aug 27 15:23:16 2007
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -38,6 +38,7 @@ CONFIG_OF=y
38# CONFIG_PPC_UDBG_16550 is not set 38# CONFIG_PPC_UDBG_16550 is not set
39# CONFIG_GENERIC_TBSYNC is not set 39# CONFIG_GENERIC_TBSYNC is not set
40CONFIG_AUDIT_ARCH=y 40CONFIG_AUDIT_ARCH=y
41CONFIG_GENERIC_BUG=y
41# CONFIG_DEFAULT_UIMAGE is not set 42# CONFIG_DEFAULT_UIMAGE is not set
42# CONFIG_PPC_DCR_NATIVE is not set 43# CONFIG_PPC_DCR_NATIVE is not set
43# CONFIG_PPC_DCR_MMIO is not set 44# CONFIG_PPC_DCR_MMIO is not set
@@ -69,24 +70,25 @@ CONFIG_SYSCTL=y
69CONFIG_EMBEDDED=y 70CONFIG_EMBEDDED=y
70# CONFIG_SYSCTL_SYSCALL is not set 71# CONFIG_SYSCTL_SYSCALL is not set
71CONFIG_KALLSYMS=y 72CONFIG_KALLSYMS=y
73# CONFIG_KALLSYMS_ALL is not set
72# CONFIG_KALLSYMS_EXTRA_PASS is not set 74# CONFIG_KALLSYMS_EXTRA_PASS is not set
73# CONFIG_HOTPLUG is not set 75CONFIG_HOTPLUG=y
74CONFIG_PRINTK=y 76CONFIG_PRINTK=y
75# CONFIG_BUG is not set 77CONFIG_BUG=y
76CONFIG_ELF_CORE=y 78# CONFIG_ELF_CORE is not set
77# CONFIG_BASE_FULL is not set 79# CONFIG_BASE_FULL is not set
78CONFIG_FUTEX=y 80# CONFIG_FUTEX is not set
79CONFIG_ANON_INODES=y 81CONFIG_ANON_INODES=y
80# CONFIG_EPOLL is not set 82CONFIG_EPOLL=y
81CONFIG_SIGNALFD=y 83CONFIG_SIGNALFD=y
82CONFIG_TIMERFD=y 84CONFIG_TIMERFD=y
83CONFIG_EVENTFD=y 85CONFIG_EVENTFD=y
84CONFIG_SHMEM=y 86CONFIG_SHMEM=y
85# CONFIG_VM_EVENT_COUNTERS is not set 87# CONFIG_VM_EVENT_COUNTERS is not set
86CONFIG_SLAB=y 88CONFIG_SLUB_DEBUG=y
87# CONFIG_SLUB is not set 89# CONFIG_SLAB is not set
90CONFIG_SLUB=y
88# CONFIG_SLOB is not set 91# CONFIG_SLOB is not set
89CONFIG_RT_MUTEXES=y
90# CONFIG_TINY_SHMEM is not set 92# CONFIG_TINY_SHMEM is not set
91CONFIG_BASE_SMALL=1 93CONFIG_BASE_SMALL=1
92# CONFIG_MODULES is not set 94# CONFIG_MODULES is not set
@@ -100,14 +102,14 @@ CONFIG_BLOCK=y
100# IO Schedulers 102# IO Schedulers
101# 103#
102CONFIG_IOSCHED_NOOP=y 104CONFIG_IOSCHED_NOOP=y
103CONFIG_IOSCHED_AS=y 105# CONFIG_IOSCHED_AS is not set
104CONFIG_IOSCHED_DEADLINE=y 106CONFIG_IOSCHED_DEADLINE=y
105CONFIG_IOSCHED_CFQ=y 107# CONFIG_IOSCHED_CFQ is not set
106CONFIG_DEFAULT_AS=y 108# CONFIG_DEFAULT_AS is not set
107# CONFIG_DEFAULT_DEADLINE is not set 109CONFIG_DEFAULT_DEADLINE=y
108# CONFIG_DEFAULT_CFQ is not set 110# CONFIG_DEFAULT_CFQ is not set
109# CONFIG_DEFAULT_NOOP is not set 111# CONFIG_DEFAULT_NOOP is not set
110CONFIG_DEFAULT_IOSCHED="anticipatory" 112CONFIG_DEFAULT_IOSCHED="deadline"
111 113
112# 114#
113# Platform support 115# Platform support
@@ -120,6 +122,7 @@ CONFIG_CPM1=y
120# CONFIG_MPC8XXFADS is not set 122# CONFIG_MPC8XXFADS is not set
121# CONFIG_MPC86XADS is not set 123# CONFIG_MPC86XADS is not set
122CONFIG_MPC885ADS=y 124CONFIG_MPC885ADS=y
125# CONFIG_PPC_EP88XC is not set
123 126
124# 127#
125# Freescale Ethernet driver platform-specific options 128# Freescale Ethernet driver platform-specific options
@@ -137,6 +140,7 @@ CONFIG_MPC8xx_SECOND_ETH_FEC2=y
137# 140#
138CONFIG_8xx_COPYBACK=y 141CONFIG_8xx_COPYBACK=y
139# CONFIG_8xx_CPU6 is not set 142# CONFIG_8xx_CPU6 is not set
143CONFIG_8xx_CPU15=y
140CONFIG_NO_UCODE_PATCH=y 144CONFIG_NO_UCODE_PATCH=y
141# CONFIG_USB_SOF_UCODE_PATCH is not set 145# CONFIG_USB_SOF_UCODE_PATCH is not set
142# CONFIG_I2C_SPI_UCODE_PATCH is not set 146# CONFIG_I2C_SPI_UCODE_PATCH is not set
@@ -153,23 +157,23 @@ CONFIG_NO_UCODE_PATCH=y
153# CONFIG_GENERIC_IOMAP is not set 157# CONFIG_GENERIC_IOMAP is not set
154# CONFIG_CPU_FREQ is not set 158# CONFIG_CPU_FREQ is not set
155# CONFIG_CPM2 is not set 159# CONFIG_CPM2 is not set
156# CONFIG_FSL_ULI1575 is not set 160CONFIG_PPC_CPM_NEW_BINDING=y
157 161
158# 162#
159# Kernel options 163# Kernel options
160# 164#
161# CONFIG_HIGHMEM is not set 165# CONFIG_HIGHMEM is not set
162# CONFIG_HZ_100 is not set 166CONFIG_HZ_100=y
163# CONFIG_HZ_250 is not set 167# CONFIG_HZ_250 is not set
164# CONFIG_HZ_300 is not set 168# CONFIG_HZ_300 is not set
165CONFIG_HZ_1000=y 169# CONFIG_HZ_1000 is not set
166CONFIG_HZ=1000 170CONFIG_HZ=100
167CONFIG_PREEMPT_NONE=y 171CONFIG_PREEMPT_NONE=y
168# CONFIG_PREEMPT_VOLUNTARY is not set 172# CONFIG_PREEMPT_VOLUNTARY is not set
169# CONFIG_PREEMPT is not set 173# CONFIG_PREEMPT is not set
170CONFIG_BINFMT_ELF=y 174CONFIG_BINFMT_ELF=y
171# CONFIG_BINFMT_MISC is not set 175# CONFIG_BINFMT_MISC is not set
172CONFIG_MATH_EMULATION=y 176# CONFIG_MATH_EMULATION is not set
173CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 177CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
174CONFIG_ARCH_FLATMEM_ENABLE=y 178CONFIG_ARCH_FLATMEM_ENABLE=y
175CONFIG_ARCH_POPULATES_NODE_MAP=y 179CONFIG_ARCH_POPULATES_NODE_MAP=y
@@ -185,11 +189,12 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
185CONFIG_ZONE_DMA_FLAG=1 189CONFIG_ZONE_DMA_FLAG=1
186CONFIG_BOUNCE=y 190CONFIG_BOUNCE=y
187CONFIG_VIRT_TO_BUS=y 191CONFIG_VIRT_TO_BUS=y
188# CONFIG_PROC_DEVICETREE is not set 192CONFIG_PROC_DEVICETREE=y
189# CONFIG_CMDLINE_BOOL is not set 193# CONFIG_CMDLINE_BOOL is not set
190# CONFIG_PM is not set 194# CONFIG_PM is not set
191# CONFIG_SECCOMP is not set 195# CONFIG_SECCOMP is not set
192# CONFIG_WANT_DEVICE_TREE is not set 196CONFIG_WANT_DEVICE_TREE=y
197CONFIG_DEVICE_TREE="mpc885ads.dts"
193CONFIG_ISA_DMA_API=y 198CONFIG_ISA_DMA_API=y
194 199
195# 200#
@@ -206,6 +211,7 @@ CONFIG_FSL_SOC=y
206# 211#
207# PCCARD (PCMCIA/CardBus) support 212# PCCARD (PCMCIA/CardBus) support
208# 213#
214# CONFIG_PCCARD is not set
209 215
210# 216#
211# Advanced setup 217# Advanced setup
@@ -234,10 +240,6 @@ CONFIG_NET=y
234CONFIG_PACKET=y 240CONFIG_PACKET=y
235# CONFIG_PACKET_MMAP is not set 241# CONFIG_PACKET_MMAP is not set
236CONFIG_UNIX=y 242CONFIG_UNIX=y
237CONFIG_XFRM=y
238# CONFIG_XFRM_USER is not set
239# CONFIG_XFRM_SUB_POLICY is not set
240# CONFIG_XFRM_MIGRATE is not set
241# CONFIG_NET_KEY is not set 243# CONFIG_NET_KEY is not set
242CONFIG_INET=y 244CONFIG_INET=y
243CONFIG_IP_MULTICAST=y 245CONFIG_IP_MULTICAST=y
@@ -257,9 +259,9 @@ CONFIG_SYN_COOKIES=y
257# CONFIG_INET_IPCOMP is not set 259# CONFIG_INET_IPCOMP is not set
258# CONFIG_INET_XFRM_TUNNEL is not set 260# CONFIG_INET_XFRM_TUNNEL is not set
259# CONFIG_INET_TUNNEL is not set 261# CONFIG_INET_TUNNEL is not set
260CONFIG_INET_XFRM_MODE_TRANSPORT=y 262# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
261CONFIG_INET_XFRM_MODE_TUNNEL=y 263# CONFIG_INET_XFRM_MODE_TUNNEL is not set
262CONFIG_INET_XFRM_MODE_BEET=y 264# CONFIG_INET_XFRM_MODE_BEET is not set
263CONFIG_INET_DIAG=y 265CONFIG_INET_DIAG=y
264CONFIG_INET_TCP_DIAG=y 266CONFIG_INET_TCP_DIAG=y
265# CONFIG_TCP_CONG_ADVANCED is not set 267# CONFIG_TCP_CONG_ADVANCED is not set
@@ -319,22 +321,91 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
319# 321#
320CONFIG_STANDALONE=y 322CONFIG_STANDALONE=y
321CONFIG_PREVENT_FIRMWARE_BUILD=y 323CONFIG_PREVENT_FIRMWARE_BUILD=y
324# CONFIG_FW_LOADER is not set
325# CONFIG_DEBUG_DRIVER is not set
326# CONFIG_DEBUG_DEVRES is not set
322# CONFIG_SYS_HYPERVISOR is not set 327# CONFIG_SYS_HYPERVISOR is not set
323# CONFIG_CONNECTOR is not set 328# CONFIG_CONNECTOR is not set
324# CONFIG_MTD is not set 329CONFIG_MTD=y
330# CONFIG_MTD_DEBUG is not set
331# CONFIG_MTD_CONCAT is not set
332# CONFIG_MTD_PARTITIONS is not set
333
334#
335# User Modules And Translation Layers
336#
337CONFIG_MTD_CHAR=y
338CONFIG_MTD_BLKDEVS=y
339CONFIG_MTD_BLOCK=y
340# CONFIG_FTL is not set
341# CONFIG_NFTL is not set
342# CONFIG_INFTL is not set
343# CONFIG_RFD_FTL is not set
344# CONFIG_SSFDC is not set
345
346#
347# RAM/ROM/Flash chip drivers
348#
349# CONFIG_MTD_CFI is not set
350CONFIG_MTD_JEDECPROBE=y
351CONFIG_MTD_GEN_PROBE=y
352CONFIG_MTD_CFI_ADV_OPTIONS=y
353CONFIG_MTD_CFI_NOSWAP=y
354# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
355# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
356CONFIG_MTD_CFI_GEOMETRY=y
357# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
358# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
359CONFIG_MTD_MAP_BANK_WIDTH_4=y
360# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
361# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
362# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
363# CONFIG_MTD_CFI_I1 is not set
364# CONFIG_MTD_CFI_I2 is not set
365CONFIG_MTD_CFI_I4=y
366# CONFIG_MTD_CFI_I8 is not set
367# CONFIG_MTD_OTP is not set
368# CONFIG_MTD_CFI_INTELEXT is not set
369CONFIG_MTD_CFI_AMDSTD=y
370# CONFIG_MTD_CFI_STAA is not set
371CONFIG_MTD_CFI_UTIL=y
372# CONFIG_MTD_RAM is not set
373# CONFIG_MTD_ROM is not set
374# CONFIG_MTD_ABSENT is not set
375
376#
377# Mapping drivers for chip access
378#
379# CONFIG_MTD_COMPLEX_MAPPINGS is not set
380# CONFIG_MTD_PHYSMAP is not set
381CONFIG_MTD_PHYSMAP_OF=y
382# CONFIG_MTD_PLATRAM is not set
383
384#
385# Self-contained MTD device drivers
386#
387# CONFIG_MTD_SLRAM is not set
388# CONFIG_MTD_PHRAM is not set
389# CONFIG_MTD_MTDRAM is not set
390# CONFIG_MTD_BLOCK2MTD is not set
391
392#
393# Disk-On-Chip Device Drivers
394#
395# CONFIG_MTD_DOC2000 is not set
396# CONFIG_MTD_DOC2001 is not set
397# CONFIG_MTD_DOC2001PLUS is not set
398# CONFIG_MTD_NAND is not set
399# CONFIG_MTD_ONENAND is not set
400
401#
402# UBI - Unsorted block images
403#
404# CONFIG_MTD_UBI is not set
325CONFIG_OF_DEVICE=y 405CONFIG_OF_DEVICE=y
326# CONFIG_PARPORT is not set 406# CONFIG_PARPORT is not set
327CONFIG_BLK_DEV=y 407# CONFIG_BLK_DEV is not set
328# CONFIG_BLK_DEV_FD is not set 408# CONFIG_MISC_DEVICES is not set
329# CONFIG_BLK_DEV_COW_COMMON is not set
330CONFIG_BLK_DEV_LOOP=y
331# CONFIG_BLK_DEV_CRYPTOLOOP is not set
332# CONFIG_BLK_DEV_NBD is not set
333# CONFIG_BLK_DEV_RAM is not set
334# CONFIG_CDROM_PKTCDVD is not set
335# CONFIG_ATA_OVER_ETH is not set
336CONFIG_MISC_DEVICES=y
337# CONFIG_EEPROM_93CX6 is not set
338# CONFIG_IDE is not set 409# CONFIG_IDE is not set
339 410
340# 411#
@@ -368,16 +439,15 @@ CONFIG_DAVICOM_PHY=y
368# CONFIG_SMSC_PHY is not set 439# CONFIG_SMSC_PHY is not set
369# CONFIG_BROADCOM_PHY is not set 440# CONFIG_BROADCOM_PHY is not set
370# CONFIG_ICPLUS_PHY is not set 441# CONFIG_ICPLUS_PHY is not set
371CONFIG_FIXED_PHY=y 442# CONFIG_FIXED_PHY is not set
372CONFIG_FIXED_MII_10_FDX=y 443# CONFIG_MDIO_BITBANG is not set
373# CONFIG_FIXED_MII_100_FDX is not set
374CONFIG_NET_ETHERNET=y 444CONFIG_NET_ETHERNET=y
375CONFIG_MII=y 445CONFIG_MII=y
376CONFIG_FS_ENET=y 446CONFIG_FS_ENET=y
377CONFIG_FS_ENET_HAS_SCC=y 447# CONFIG_FS_ENET_HAS_SCC is not set
378CONFIG_FS_ENET_HAS_FEC=y 448CONFIG_FS_ENET_HAS_FEC=y
379CONFIG_NETDEV_1000=y 449# CONFIG_NETDEV_1000 is not set
380CONFIG_NETDEV_10000=y 450# CONFIG_NETDEV_10000 is not set
381 451
382# 452#
383# Wireless LAN 453# Wireless LAN
@@ -397,55 +467,12 @@ CONFIG_NETDEV_10000=y
397# 467#
398# Input device support 468# Input device support
399# 469#
400CONFIG_INPUT=y 470# CONFIG_INPUT is not set
401# CONFIG_INPUT_FF_MEMLESS is not set
402# CONFIG_INPUT_POLLDEV is not set
403
404#
405# Userland interfaces
406#
407CONFIG_INPUT_MOUSEDEV=y
408CONFIG_INPUT_MOUSEDEV_PSAUX=y
409CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
410CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
411# CONFIG_INPUT_JOYDEV is not set
412# CONFIG_INPUT_TSDEV is not set
413# CONFIG_INPUT_EVDEV is not set
414# CONFIG_INPUT_EVBUG is not set
415
416#
417# Input Device Drivers
418#
419CONFIG_INPUT_KEYBOARD=y
420CONFIG_KEYBOARD_ATKBD=y
421# CONFIG_KEYBOARD_SUNKBD is not set
422# CONFIG_KEYBOARD_LKKBD is not set
423# CONFIG_KEYBOARD_XTKBD is not set
424# CONFIG_KEYBOARD_NEWTON is not set
425# CONFIG_KEYBOARD_STOWAWAY is not set
426CONFIG_INPUT_MOUSE=y
427CONFIG_MOUSE_PS2=y
428CONFIG_MOUSE_PS2_ALPS=y
429CONFIG_MOUSE_PS2_LOGIPS2PP=y
430CONFIG_MOUSE_PS2_SYNAPTICS=y
431CONFIG_MOUSE_PS2_LIFEBOOK=y
432CONFIG_MOUSE_PS2_TRACKPOINT=y
433# CONFIG_MOUSE_PS2_TOUCHKIT is not set
434# CONFIG_MOUSE_SERIAL is not set
435# CONFIG_MOUSE_VSXXXAA is not set
436# CONFIG_INPUT_JOYSTICK is not set
437# CONFIG_INPUT_TABLET is not set
438# CONFIG_INPUT_TOUCHSCREEN is not set
439# CONFIG_INPUT_MISC is not set
440 471
441# 472#
442# Hardware I/O ports 473# Hardware I/O ports
443# 474#
444CONFIG_SERIO=y 475# CONFIG_SERIO is not set
445CONFIG_SERIO_I8042=y
446CONFIG_SERIO_SERPORT=y
447CONFIG_SERIO_LIBPS2=y
448# CONFIG_SERIO_RAW is not set
449# CONFIG_GAMEPORT is not set 476# CONFIG_GAMEPORT is not set
450 477
451# 478#
@@ -493,20 +520,7 @@ CONFIG_GEN_RTC=y
493# CONFIG_SPI_MASTER is not set 520# CONFIG_SPI_MASTER is not set
494# CONFIG_W1 is not set 521# CONFIG_W1 is not set
495# CONFIG_POWER_SUPPLY is not set 522# CONFIG_POWER_SUPPLY is not set
496CONFIG_HWMON=y 523# CONFIG_HWMON is not set
497# CONFIG_HWMON_VID is not set
498# CONFIG_SENSORS_ABITUGURU is not set
499# CONFIG_SENSORS_ABITUGURU3 is not set
500# CONFIG_SENSORS_F71805F is not set
501# CONFIG_SENSORS_IT87 is not set
502# CONFIG_SENSORS_PC87360 is not set
503# CONFIG_SENSORS_PC87427 is not set
504# CONFIG_SENSORS_SMSC47M1 is not set
505# CONFIG_SENSORS_SMSC47B397 is not set
506# CONFIG_SENSORS_VT1211 is not set
507# CONFIG_SENSORS_W83627HF is not set
508# CONFIG_SENSORS_W83627EHF is not set
509# CONFIG_HWMON_DEBUG_CHIP is not set
510 524
511# 525#
512# Multifunction device drivers 526# Multifunction device drivers
@@ -530,7 +544,7 @@ CONFIG_DAB=y
530# 544#
531# CONFIG_DISPLAY_SUPPORT is not set 545# CONFIG_DISPLAY_SUPPORT is not set
532# CONFIG_VGASTATE is not set 546# CONFIG_VGASTATE is not set
533CONFIG_VIDEO_OUTPUT_CONTROL=y 547# CONFIG_VIDEO_OUTPUT_CONTROL is not set
534# CONFIG_FB is not set 548# CONFIG_FB is not set
535# CONFIG_FB_IBM_GXT4500 is not set 549# CONFIG_FB_IBM_GXT4500 is not set
536 550
@@ -538,22 +552,7 @@ CONFIG_VIDEO_OUTPUT_CONTROL=y
538# Sound 552# Sound
539# 553#
540# CONFIG_SOUND is not set 554# CONFIG_SOUND is not set
541CONFIG_HID_SUPPORT=y 555# CONFIG_USB_SUPPORT is not set
542CONFIG_HID=y
543# CONFIG_HID_DEBUG is not set
544CONFIG_USB_SUPPORT=y
545# CONFIG_USB_ARCH_HAS_HCD is not set
546# CONFIG_USB_ARCH_HAS_OHCI is not set
547# CONFIG_USB_ARCH_HAS_EHCI is not set
548
549#
550# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
551#
552
553#
554# USB Gadget Support
555#
556# CONFIG_USB_GADGET is not set
557# CONFIG_MMC is not set 556# CONFIG_MMC is not set
558# CONFIG_NEW_LEDS is not set 557# CONFIG_NEW_LEDS is not set
559# CONFIG_EDAC is not set 558# CONFIG_EDAC is not set
@@ -580,19 +579,9 @@ CONFIG_USB_SUPPORT=y
580# 579#
581# File systems 580# File systems
582# 581#
583CONFIG_EXT2_FS=y 582# CONFIG_EXT2_FS is not set
584CONFIG_EXT2_FS_XATTR=y 583# CONFIG_EXT3_FS is not set
585# CONFIG_EXT2_FS_POSIX_ACL is not set
586# CONFIG_EXT2_FS_SECURITY is not set
587# CONFIG_EXT2_FS_XIP is not set
588CONFIG_EXT3_FS=y
589CONFIG_EXT3_FS_XATTR=y
590# CONFIG_EXT3_FS_POSIX_ACL is not set
591# CONFIG_EXT3_FS_SECURITY is not set
592# CONFIG_EXT4DEV_FS is not set 584# CONFIG_EXT4DEV_FS is not set
593CONFIG_JBD=y
594# CONFIG_JBD_DEBUG is not set
595CONFIG_FS_MBCACHE=y
596# CONFIG_REISERFS_FS is not set 585# CONFIG_REISERFS_FS is not set
597# CONFIG_JFS_FS is not set 586# CONFIG_JFS_FS is not set
598# CONFIG_FS_POSIX_ACL is not set 587# CONFIG_FS_POSIX_ACL is not set
@@ -601,10 +590,9 @@ CONFIG_FS_MBCACHE=y
601# CONFIG_OCFS2_FS is not set 590# CONFIG_OCFS2_FS is not set
602# CONFIG_MINIX_FS is not set 591# CONFIG_MINIX_FS is not set
603# CONFIG_ROMFS_FS is not set 592# CONFIG_ROMFS_FS is not set
604CONFIG_INOTIFY=y 593# CONFIG_INOTIFY is not set
605CONFIG_INOTIFY_USER=y
606# CONFIG_QUOTA is not set 594# CONFIG_QUOTA is not set
607CONFIG_DNOTIFY=y 595# CONFIG_DNOTIFY is not set
608# CONFIG_AUTOFS_FS is not set 596# CONFIG_AUTOFS_FS is not set
609# CONFIG_AUTOFS4_FS is not set 597# CONFIG_AUTOFS4_FS is not set
610# CONFIG_FUSE_FS is not set 598# CONFIG_FUSE_FS is not set
@@ -645,6 +633,7 @@ CONFIG_RAMFS=y
645# CONFIG_BEFS_FS is not set 633# CONFIG_BEFS_FS is not set
646# CONFIG_BFS_FS is not set 634# CONFIG_BFS_FS is not set
647# CONFIG_EFS_FS is not set 635# CONFIG_EFS_FS is not set
636# CONFIG_JFFS2_FS is not set
648CONFIG_CRAMFS=y 637CONFIG_CRAMFS=y
649# CONFIG_VXFS_FS is not set 638# CONFIG_VXFS_FS is not set
650# CONFIG_HPFS_FS is not set 639# CONFIG_HPFS_FS is not set
@@ -711,15 +700,13 @@ CONFIG_MSDOS_PARTITION=y
711# 700#
712# Library routines 701# Library routines
713# 702#
714CONFIG_BITREVERSE=y 703# CONFIG_CRC_CCITT is not set
715CONFIG_CRC_CCITT=y
716# CONFIG_CRC16 is not set 704# CONFIG_CRC16 is not set
717# CONFIG_CRC_ITU_T is not set 705# CONFIG_CRC_ITU_T is not set
718CONFIG_CRC32=y 706# CONFIG_CRC32 is not set
719# CONFIG_CRC7 is not set 707# CONFIG_CRC7 is not set
720# CONFIG_LIBCRC32C is not set 708# CONFIG_LIBCRC32C is not set
721CONFIG_ZLIB_INFLATE=y 709CONFIG_ZLIB_INFLATE=y
722CONFIG_PLIST=y
723CONFIG_HAS_IOMEM=y 710CONFIG_HAS_IOMEM=y
724CONFIG_HAS_IOPORT=y 711CONFIG_HAS_IOPORT=y
725CONFIG_HAS_DMA=y 712CONFIG_HAS_DMA=y
@@ -734,11 +721,33 @@ CONFIG_HAS_DMA=y
734# 721#
735# CONFIG_PRINTK_TIME is not set 722# CONFIG_PRINTK_TIME is not set
736CONFIG_ENABLE_MUST_CHECK=y 723CONFIG_ENABLE_MUST_CHECK=y
737# CONFIG_MAGIC_SYSRQ is not set 724CONFIG_MAGIC_SYSRQ=y
738# CONFIG_UNUSED_SYMBOLS is not set 725# CONFIG_UNUSED_SYMBOLS is not set
739# CONFIG_DEBUG_FS is not set 726# CONFIG_DEBUG_FS is not set
740# CONFIG_HEADERS_CHECK is not set 727# CONFIG_HEADERS_CHECK is not set
741# CONFIG_DEBUG_KERNEL is not set 728CONFIG_DEBUG_KERNEL=y
729# CONFIG_DEBUG_SHIRQ is not set
730CONFIG_DETECT_SOFTLOCKUP=y
731CONFIG_SCHED_DEBUG=y
732# CONFIG_SCHEDSTATS is not set
733# CONFIG_TIMER_STATS is not set
734# CONFIG_SLUB_DEBUG_ON is not set
735# CONFIG_DEBUG_SPINLOCK is not set
736# CONFIG_DEBUG_MUTEXES is not set
737# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
738# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
739# CONFIG_DEBUG_KOBJECT is not set
740CONFIG_DEBUG_BUGVERBOSE=y
741CONFIG_DEBUG_INFO=y
742# CONFIG_DEBUG_VM is not set
743# CONFIG_DEBUG_LIST is not set
744CONFIG_FORCED_INLINING=y
745# CONFIG_FAULT_INJECTION is not set
746# CONFIG_DEBUG_STACKOVERFLOW is not set
747# CONFIG_DEBUG_STACK_USAGE is not set
748# CONFIG_DEBUG_PAGEALLOC is not set
749# CONFIG_DEBUGGER is not set
750# CONFIG_BDI_SWITCH is not set
742# CONFIG_PPC_EARLY_DEBUG is not set 751# CONFIG_PPC_EARLY_DEBUG is not set
743 752
744# 753#
diff --git a/arch/powerpc/configs/pq2fads_defconfig b/arch/powerpc/configs/pq2fads_defconfig
new file mode 100644
index 000000000000..a51fc39dea4e
--- /dev/null
+++ b/arch/powerpc/configs/pq2fads_defconfig
@@ -0,0 +1,1003 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc4
4# Thu Aug 30 11:58:17 2007
5#
6# CONFIG_PPC64 is not set
7
8#
9# Processor support
10#
11CONFIG_6xx=y
12# CONFIG_PPC_85xx is not set
13# CONFIG_PPC_8xx is not set
14# CONFIG_40x is not set
15# CONFIG_44x is not set
16# CONFIG_E200 is not set
17CONFIG_PPC_FPU=y
18CONFIG_PPC_STD_MMU=y
19CONFIG_PPC_STD_MMU_32=y
20# CONFIG_PPC_MM_SLICES is not set
21# CONFIG_SMP is not set
22CONFIG_PPC32=y
23CONFIG_PPC_MERGE=y
24CONFIG_MMU=y
25CONFIG_GENERIC_HARDIRQS=y
26CONFIG_IRQ_PER_CPU=y
27CONFIG_RWSEM_XCHGADD_ALGORITHM=y
28CONFIG_ARCH_HAS_ILOG2_U32=y
29CONFIG_GENERIC_HWEIGHT=y
30CONFIG_GENERIC_CALIBRATE_DELAY=y
31CONFIG_GENERIC_FIND_NEXT_BIT=y
32# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
33CONFIG_PPC=y
34CONFIG_EARLY_PRINTK=y
35CONFIG_GENERIC_NVRAM=y
36CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
37CONFIG_ARCH_MAY_HAVE_PC_FDC=y
38CONFIG_PPC_OF=y
39CONFIG_OF=y
40# CONFIG_PPC_UDBG_16550 is not set
41# CONFIG_GENERIC_TBSYNC is not set
42CONFIG_AUDIT_ARCH=y
43CONFIG_GENERIC_BUG=y
44CONFIG_DEFAULT_UIMAGE=y
45# CONFIG_PPC_DCR_NATIVE is not set
46# CONFIG_PPC_DCR_MMIO is not set
47CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
48
49#
50# General setup
51#
52# CONFIG_EXPERIMENTAL is not set
53CONFIG_BROKEN_ON_SMP=y
54CONFIG_INIT_ENV_ARG_LIMIT=32
55CONFIG_LOCALVERSION=""
56CONFIG_LOCALVERSION_AUTO=y
57CONFIG_SWAP=y
58CONFIG_SYSVIPC=y
59CONFIG_SYSVIPC_SYSCTL=y
60# CONFIG_BSD_PROCESS_ACCT is not set
61# CONFIG_TASKSTATS is not set
62# CONFIG_AUDIT is not set
63CONFIG_IKCONFIG=y
64CONFIG_IKCONFIG_PROC=y
65CONFIG_LOG_BUF_SHIFT=14
66# CONFIG_SYSFS_DEPRECATED is not set
67# CONFIG_RELAY is not set
68CONFIG_BLK_DEV_INITRD=y
69CONFIG_INITRAMFS_SOURCE=""
70CONFIG_SYSCTL=y
71CONFIG_EMBEDDED=y
72CONFIG_SYSCTL_SYSCALL=y
73CONFIG_KALLSYMS=y
74CONFIG_KALLSYMS_ALL=y
75# CONFIG_KALLSYMS_EXTRA_PASS is not set
76CONFIG_HOTPLUG=y
77CONFIG_PRINTK=y
78CONFIG_BUG=y
79CONFIG_ELF_CORE=y
80CONFIG_BASE_FULL=y
81CONFIG_FUTEX=y
82CONFIG_ANON_INODES=y
83CONFIG_EPOLL=y
84CONFIG_SIGNALFD=y
85CONFIG_TIMERFD=y
86CONFIG_EVENTFD=y
87CONFIG_SHMEM=y
88CONFIG_VM_EVENT_COUNTERS=y
89CONFIG_SLAB=y
90# CONFIG_SLUB is not set
91# CONFIG_SLOB is not set
92CONFIG_RT_MUTEXES=y
93# CONFIG_TINY_SHMEM is not set
94CONFIG_BASE_SMALL=0
95# CONFIG_MODULES is not set
96CONFIG_BLOCK=y
97# CONFIG_LBD is not set
98# CONFIG_BLK_DEV_IO_TRACE is not set
99# CONFIG_LSF is not set
100
101#
102# IO Schedulers
103#
104CONFIG_IOSCHED_NOOP=y
105CONFIG_IOSCHED_AS=y
106CONFIG_IOSCHED_DEADLINE=y
107CONFIG_IOSCHED_CFQ=y
108CONFIG_DEFAULT_AS=y
109# CONFIG_DEFAULT_DEADLINE is not set
110# CONFIG_DEFAULT_CFQ is not set
111# CONFIG_DEFAULT_NOOP is not set
112CONFIG_DEFAULT_IOSCHED="anticipatory"
113
114#
115# Platform support
116#
117# CONFIG_PPC_MULTIPLATFORM is not set
118# CONFIG_EMBEDDED6xx is not set
119CONFIG_PPC_82xx=y
120# CONFIG_PPC_83xx is not set
121# CONFIG_PPC_86xx is not set
122# CONFIG_PPC_MPC52xx is not set
123# CONFIG_PPC_MPC5200 is not set
124# CONFIG_PPC_CELL is not set
125# CONFIG_PPC_CELL_NATIVE is not set
126# CONFIG_MPC8272_ADS is not set
127CONFIG_PQ2FADS=y
128# CONFIG_EP8248E is not set
129CONFIG_PQ2ADS=y
130CONFIG_8260=y
131CONFIG_PQ2_ADS_PCI_PIC=y
132# CONFIG_MPIC is not set
133# CONFIG_MPIC_WEIRD is not set
134# CONFIG_PPC_I8259 is not set
135# CONFIG_PPC_RTAS is not set
136# CONFIG_MMIO_NVRAM is not set
137# CONFIG_PPC_MPC106 is not set
138# CONFIG_PPC_970_NAP is not set
139# CONFIG_PPC_INDIRECT_IO is not set
140# CONFIG_GENERIC_IOMAP is not set
141# CONFIG_CPU_FREQ is not set
142CONFIG_CPM2=y
143CONFIG_PPC_CPM_NEW_BINDING=y
144# CONFIG_FSL_ULI1575 is not set
145CONFIG_CPM=y
146
147#
148# Kernel options
149#
150# CONFIG_HIGHMEM is not set
151# CONFIG_HZ_100 is not set
152CONFIG_HZ_250=y
153# CONFIG_HZ_300 is not set
154# CONFIG_HZ_1000 is not set
155CONFIG_HZ=250
156CONFIG_PREEMPT_NONE=y
157# CONFIG_PREEMPT_VOLUNTARY is not set
158# CONFIG_PREEMPT is not set
159CONFIG_BINFMT_ELF=y
160CONFIG_BINFMT_MISC=y
161CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
162CONFIG_ARCH_FLATMEM_ENABLE=y
163CONFIG_ARCH_POPULATES_NODE_MAP=y
164CONFIG_FLATMEM=y
165CONFIG_FLAT_NODE_MEM_MAP=y
166# CONFIG_SPARSEMEM_STATIC is not set
167CONFIG_SPLIT_PTLOCK_CPUS=4
168# CONFIG_RESOURCES_64BIT is not set
169CONFIG_ZONE_DMA_FLAG=1
170CONFIG_BOUNCE=y
171CONFIG_VIRT_TO_BUS=y
172CONFIG_PROC_DEVICETREE=y
173# CONFIG_CMDLINE_BOOL is not set
174# CONFIG_PM is not set
175CONFIG_SECCOMP=y
176CONFIG_WANT_DEVICE_TREE=y
177CONFIG_DEVICE_TREE="pq2fads.dts"
178CONFIG_ISA_DMA_API=y
179
180#
181# Bus options
182#
183CONFIG_ZONE_DMA=y
184CONFIG_PPC_INDIRECT_PCI=y
185CONFIG_FSL_SOC=y
186CONFIG_PCI=y
187CONFIG_PCI_DOMAINS=y
188CONFIG_PCI_SYSCALL=y
189CONFIG_PCI_8260=y
190# CONFIG_8260_PCI9 is not set
191# CONFIG_PCIEPORTBUS is not set
192CONFIG_ARCH_SUPPORTS_MSI=y
193# CONFIG_PCI_MSI is not set
194# CONFIG_PCI_DEBUG is not set
195
196#
197# PCCARD (PCMCIA/CardBus) support
198#
199# CONFIG_PCCARD is not set
200
201#
202# Advanced setup
203#
204# CONFIG_ADVANCED_OPTIONS is not set
205
206#
207# Default settings for advanced configuration options are used
208#
209CONFIG_HIGHMEM_START=0xfe000000
210CONFIG_LOWMEM_SIZE=0x30000000
211CONFIG_KERNEL_START=0xc0000000
212CONFIG_TASK_SIZE=0x80000000
213CONFIG_BOOT_LOAD=0x00400000
214
215#
216# Networking
217#
218CONFIG_NET=y
219
220#
221# Networking options
222#
223CONFIG_PACKET=y
224# CONFIG_PACKET_MMAP is not set
225CONFIG_UNIX=y
226CONFIG_XFRM=y
227# CONFIG_XFRM_USER is not set
228# CONFIG_NET_KEY is not set
229CONFIG_INET=y
230CONFIG_IP_MULTICAST=y
231# CONFIG_IP_ADVANCED_ROUTER is not set
232CONFIG_IP_FIB_HASH=y
233CONFIG_IP_PNP=y
234CONFIG_IP_PNP_DHCP=y
235CONFIG_IP_PNP_BOOTP=y
236# CONFIG_IP_PNP_RARP is not set
237# CONFIG_NET_IPIP is not set
238# CONFIG_NET_IPGRE is not set
239# CONFIG_IP_MROUTE is not set
240CONFIG_SYN_COOKIES=y
241# CONFIG_INET_AH is not set
242# CONFIG_INET_ESP is not set
243# CONFIG_INET_IPCOMP is not set
244# CONFIG_INET_XFRM_TUNNEL is not set
245CONFIG_INET_TUNNEL=y
246CONFIG_INET_XFRM_MODE_TRANSPORT=y
247CONFIG_INET_XFRM_MODE_TUNNEL=y
248CONFIG_INET_XFRM_MODE_BEET=y
249CONFIG_INET_DIAG=y
250CONFIG_INET_TCP_DIAG=y
251# CONFIG_TCP_CONG_ADVANCED is not set
252CONFIG_TCP_CONG_CUBIC=y
253CONFIG_DEFAULT_TCP_CONG="cubic"
254# CONFIG_IP_VS is not set
255CONFIG_IPV6=y
256# CONFIG_IPV6_PRIVACY is not set
257# CONFIG_IPV6_ROUTER_PREF is not set
258# CONFIG_INET6_AH is not set
259# CONFIG_INET6_ESP is not set
260# CONFIG_INET6_IPCOMP is not set
261# CONFIG_INET6_XFRM_TUNNEL is not set
262# CONFIG_INET6_TUNNEL is not set
263CONFIG_INET6_XFRM_MODE_TRANSPORT=y
264CONFIG_INET6_XFRM_MODE_TUNNEL=y
265CONFIG_INET6_XFRM_MODE_BEET=y
266CONFIG_IPV6_SIT=y
267# CONFIG_IPV6_TUNNEL is not set
268# CONFIG_NETWORK_SECMARK is not set
269CONFIG_NETFILTER=y
270# CONFIG_NETFILTER_DEBUG is not set
271
272#
273# Core Netfilter Configuration
274#
275# CONFIG_NETFILTER_NETLINK is not set
276# CONFIG_NF_CONNTRACK_ENABLED is not set
277# CONFIG_NF_CONNTRACK is not set
278# CONFIG_NETFILTER_XTABLES is not set
279
280#
281# IP: Netfilter Configuration
282#
283# CONFIG_IP_NF_QUEUE is not set
284# CONFIG_IP_NF_IPTABLES is not set
285# CONFIG_IP_NF_ARPTABLES is not set
286# CONFIG_BRIDGE is not set
287# CONFIG_VLAN_8021Q is not set
288# CONFIG_DECNET is not set
289# CONFIG_LLC2 is not set
290# CONFIG_IPX is not set
291# CONFIG_ATALK is not set
292
293#
294# QoS and/or fair queueing
295#
296# CONFIG_NET_SCHED is not set
297
298#
299# Network testing
300#
301# CONFIG_NET_PKTGEN is not set
302# CONFIG_HAMRADIO is not set
303# CONFIG_IRDA is not set
304# CONFIG_BT is not set
305
306#
307# Wireless
308#
309# CONFIG_CFG80211 is not set
310# CONFIG_WIRELESS_EXT is not set
311# CONFIG_IEEE80211 is not set
312# CONFIG_RFKILL is not set
313
314#
315# Device Drivers
316#
317
318#
319# Generic Driver Options
320#
321CONFIG_STANDALONE=y
322CONFIG_PREVENT_FIRMWARE_BUILD=y
323# CONFIG_FW_LOADER is not set
324# CONFIG_DEBUG_DRIVER is not set
325# CONFIG_DEBUG_DEVRES is not set
326# CONFIG_SYS_HYPERVISOR is not set
327# CONFIG_CONNECTOR is not set
328CONFIG_MTD=y
329# CONFIG_MTD_DEBUG is not set
330# CONFIG_MTD_CONCAT is not set
331# CONFIG_MTD_PARTITIONS is not set
332
333#
334# User Modules And Translation Layers
335#
336CONFIG_MTD_CHAR=y
337CONFIG_MTD_BLKDEVS=y
338CONFIG_MTD_BLOCK=y
339# CONFIG_FTL is not set
340# CONFIG_NFTL is not set
341# CONFIG_INFTL is not set
342# CONFIG_RFD_FTL is not set
343# CONFIG_SSFDC is not set
344
345#
346# RAM/ROM/Flash chip drivers
347#
348# CONFIG_MTD_CFI is not set
349CONFIG_MTD_JEDECPROBE=y
350CONFIG_MTD_GEN_PROBE=y
351CONFIG_MTD_CFI_ADV_OPTIONS=y
352CONFIG_MTD_CFI_NOSWAP=y
353# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
354# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
355CONFIG_MTD_CFI_GEOMETRY=y
356# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
357# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
358CONFIG_MTD_MAP_BANK_WIDTH_4=y
359# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
360# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
361# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
362# CONFIG_MTD_CFI_I1 is not set
363# CONFIG_MTD_CFI_I2 is not set
364CONFIG_MTD_CFI_I4=y
365# CONFIG_MTD_CFI_I8 is not set
366# CONFIG_MTD_OTP is not set
367CONFIG_MTD_CFI_INTELEXT=y
368# CONFIG_MTD_CFI_AMDSTD is not set
369# CONFIG_MTD_CFI_STAA is not set
370CONFIG_MTD_CFI_UTIL=y
371# CONFIG_MTD_RAM is not set
372# CONFIG_MTD_ROM is not set
373# CONFIG_MTD_ABSENT is not set
374
375#
376# Mapping drivers for chip access
377#
378# CONFIG_MTD_COMPLEX_MAPPINGS is not set
379# CONFIG_MTD_PHYSMAP is not set
380CONFIG_MTD_PHYSMAP_OF=y
381# CONFIG_MTD_SBC8240 is not set
382# CONFIG_MTD_PLATRAM is not set
383
384#
385# Self-contained MTD device drivers
386#
387# CONFIG_MTD_PMC551 is not set
388# CONFIG_MTD_SLRAM is not set
389# CONFIG_MTD_PHRAM is not set
390# CONFIG_MTD_MTDRAM is not set
391# CONFIG_MTD_BLOCK2MTD is not set
392
393#
394# Disk-On-Chip Device Drivers
395#
396# CONFIG_MTD_DOC2000 is not set
397# CONFIG_MTD_DOC2001 is not set
398# CONFIG_MTD_DOC2001PLUS is not set
399# CONFIG_MTD_NAND is not set
400# CONFIG_MTD_ONENAND is not set
401
402#
403# UBI - Unsorted block images
404#
405# CONFIG_MTD_UBI is not set
406CONFIG_OF_DEVICE=y
407# CONFIG_PARPORT is not set
408CONFIG_BLK_DEV=y
409# CONFIG_BLK_DEV_FD is not set
410# CONFIG_BLK_CPQ_DA is not set
411# CONFIG_BLK_CPQ_CISS_DA is not set
412# CONFIG_BLK_DEV_DAC960 is not set
413# CONFIG_BLK_DEV_COW_COMMON is not set
414CONFIG_BLK_DEV_LOOP=y
415# CONFIG_BLK_DEV_CRYPTOLOOP is not set
416# CONFIG_BLK_DEV_NBD is not set
417# CONFIG_BLK_DEV_SX8 is not set
418# CONFIG_BLK_DEV_RAM is not set
419# CONFIG_CDROM_PKTCDVD is not set
420# CONFIG_ATA_OVER_ETH is not set
421CONFIG_MISC_DEVICES=y
422# CONFIG_PHANTOM is not set
423# CONFIG_EEPROM_93CX6 is not set
424# CONFIG_SGI_IOC4 is not set
425CONFIG_IDE=y
426CONFIG_IDE_MAX_HWIFS=4
427CONFIG_BLK_DEV_IDE=y
428
429#
430# Please see Documentation/ide.txt for help/info on IDE drives
431#
432# CONFIG_BLK_DEV_IDE_SATA is not set
433CONFIG_BLK_DEV_IDEDISK=y
434# CONFIG_IDEDISK_MULTI_MODE is not set
435# CONFIG_BLK_DEV_IDECD is not set
436# CONFIG_BLK_DEV_IDEFLOPPY is not set
437# CONFIG_IDE_TASK_IOCTL is not set
438CONFIG_IDE_PROC_FS=y
439
440#
441# IDE chipset support/bugfixes
442#
443# CONFIG_IDE_GENERIC is not set
444# CONFIG_BLK_DEV_IDEPCI is not set
445# CONFIG_IDEPCI_PCIBUS_ORDER is not set
446# CONFIG_IDE_ARM is not set
447# CONFIG_BLK_DEV_IDEDMA is not set
448# CONFIG_BLK_DEV_HD is not set
449
450#
451# SCSI device support
452#
453# CONFIG_RAID_ATTRS is not set
454# CONFIG_SCSI is not set
455# CONFIG_SCSI_DMA is not set
456# CONFIG_SCSI_NETLINK is not set
457# CONFIG_ATA is not set
458# CONFIG_MD is not set
459
460#
461# Fusion MPT device support
462#
463# CONFIG_FUSION is not set
464
465#
466# IEEE 1394 (FireWire) support
467#
468
469#
470# An alternative FireWire stack is available with EXPERIMENTAL=y
471#
472# CONFIG_IEEE1394 is not set
473# CONFIG_I2O is not set
474# CONFIG_MACINTOSH_DRIVERS is not set
475CONFIG_NETDEVICES=y
476# CONFIG_NETDEVICES_MULTIQUEUE is not set
477# CONFIG_DUMMY is not set
478# CONFIG_BONDING is not set
479# CONFIG_EQUALIZER is not set
480CONFIG_TUN=y
481# CONFIG_ARCNET is not set
482CONFIG_PHYLIB=y
483
484#
485# MII PHY device drivers
486#
487# CONFIG_MARVELL_PHY is not set
488CONFIG_DAVICOM_PHY=y
489# CONFIG_QSEMI_PHY is not set
490# CONFIG_LXT_PHY is not set
491# CONFIG_CICADA_PHY is not set
492# CONFIG_VITESSE_PHY is not set
493# CONFIG_SMSC_PHY is not set
494# CONFIG_BROADCOM_PHY is not set
495# CONFIG_ICPLUS_PHY is not set
496# CONFIG_FIXED_PHY is not set
497CONFIG_MDIO_BITBANG=y
498CONFIG_NET_ETHERNET=y
499CONFIG_MII=y
500# CONFIG_HAPPYMEAL is not set
501# CONFIG_SUNGEM is not set
502# CONFIG_CASSINI is not set
503# CONFIG_NET_VENDOR_3COM is not set
504# CONFIG_NET_TULIP is not set
505# CONFIG_HP100 is not set
506# CONFIG_NET_PCI is not set
507CONFIG_FS_ENET=y
508# CONFIG_FS_ENET_HAS_SCC is not set
509CONFIG_FS_ENET_HAS_FCC=y
510CONFIG_NETDEV_1000=y
511# CONFIG_ACENIC is not set
512# CONFIG_DL2K is not set
513# CONFIG_E1000 is not set
514# CONFIG_NS83820 is not set
515# CONFIG_HAMACHI is not set
516# CONFIG_R8169 is not set
517# CONFIG_SIS190 is not set
518# CONFIG_SKGE is not set
519# CONFIG_SKY2 is not set
520# CONFIG_VIA_VELOCITY is not set
521# CONFIG_TIGON3 is not set
522# CONFIG_BNX2 is not set
523# CONFIG_QLA3XXX is not set
524CONFIG_NETDEV_10000=y
525# CONFIG_CHELSIO_T1 is not set
526# CONFIG_CHELSIO_T3 is not set
527# CONFIG_IXGB is not set
528# CONFIG_S2IO is not set
529# CONFIG_MYRI10GE is not set
530# CONFIG_NETXEN_NIC is not set
531# CONFIG_MLX4_CORE is not set
532# CONFIG_TR is not set
533
534#
535# Wireless LAN
536#
537# CONFIG_WLAN_PRE80211 is not set
538# CONFIG_WLAN_80211 is not set
539# CONFIG_WAN is not set
540# CONFIG_FDDI is not set
541CONFIG_PPP=y
542# CONFIG_PPP_FILTER is not set
543CONFIG_PPP_ASYNC=y
544CONFIG_PPP_SYNC_TTY=y
545CONFIG_PPP_DEFLATE=y
546# CONFIG_PPP_BSDCOMP is not set
547# CONFIG_SLIP is not set
548CONFIG_SLHC=y
549# CONFIG_NETPOLL is not set
550# CONFIG_NET_POLL_CONTROLLER is not set
551# CONFIG_ISDN is not set
552# CONFIG_PHONE is not set
553
554#
555# Input device support
556#
557CONFIG_INPUT=y
558# CONFIG_INPUT_FF_MEMLESS is not set
559# CONFIG_INPUT_POLLDEV is not set
560
561#
562# Userland interfaces
563#
564CONFIG_INPUT_MOUSEDEV=y
565CONFIG_INPUT_MOUSEDEV_PSAUX=y
566CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
567CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
568# CONFIG_INPUT_JOYDEV is not set
569# CONFIG_INPUT_TSDEV is not set
570CONFIG_INPUT_EVDEV=y
571# CONFIG_INPUT_EVBUG is not set
572
573#
574# Input Device Drivers
575#
576CONFIG_INPUT_KEYBOARD=y
577CONFIG_KEYBOARD_ATKBD=y
578# CONFIG_KEYBOARD_SUNKBD is not set
579# CONFIG_KEYBOARD_LKKBD is not set
580# CONFIG_KEYBOARD_XTKBD is not set
581# CONFIG_KEYBOARD_NEWTON is not set
582# CONFIG_KEYBOARD_STOWAWAY is not set
583CONFIG_INPUT_MOUSE=y
584CONFIG_MOUSE_PS2=y
585CONFIG_MOUSE_PS2_ALPS=y
586CONFIG_MOUSE_PS2_LOGIPS2PP=y
587CONFIG_MOUSE_PS2_SYNAPTICS=y
588CONFIG_MOUSE_PS2_LIFEBOOK=y
589CONFIG_MOUSE_PS2_TRACKPOINT=y
590# CONFIG_MOUSE_PS2_TOUCHKIT is not set
591# CONFIG_MOUSE_SERIAL is not set
592# CONFIG_MOUSE_APPLETOUCH is not set
593# CONFIG_MOUSE_VSXXXAA is not set
594# CONFIG_INPUT_JOYSTICK is not set
595# CONFIG_INPUT_TABLET is not set
596# CONFIG_INPUT_TOUCHSCREEN is not set
597# CONFIG_INPUT_MISC is not set
598
599#
600# Hardware I/O ports
601#
602CONFIG_SERIO=y
603# CONFIG_SERIO_I8042 is not set
604CONFIG_SERIO_SERPORT=y
605# CONFIG_SERIO_PCIPS2 is not set
606CONFIG_SERIO_LIBPS2=y
607# CONFIG_SERIO_RAW is not set
608# CONFIG_GAMEPORT is not set
609
610#
611# Character devices
612#
613# CONFIG_VT is not set
614# CONFIG_SERIAL_NONSTANDARD is not set
615
616#
617# Serial drivers
618#
619# CONFIG_SERIAL_8250 is not set
620
621#
622# Non-8250 serial port support
623#
624# CONFIG_SERIAL_UARTLITE is not set
625CONFIG_SERIAL_CORE=y
626CONFIG_SERIAL_CORE_CONSOLE=y
627CONFIG_SERIAL_CPM=y
628CONFIG_SERIAL_CPM_CONSOLE=y
629CONFIG_SERIAL_CPM_SCC1=y
630# CONFIG_SERIAL_CPM_SCC2 is not set
631# CONFIG_SERIAL_CPM_SCC3 is not set
632CONFIG_SERIAL_CPM_SCC4=y
633# CONFIG_SERIAL_CPM_SMC1 is not set
634# CONFIG_SERIAL_CPM_SMC2 is not set
635# CONFIG_SERIAL_JSM is not set
636CONFIG_UNIX98_PTYS=y
637CONFIG_LEGACY_PTYS=y
638CONFIG_LEGACY_PTY_COUNT=256
639# CONFIG_IPMI_HANDLER is not set
640# CONFIG_WATCHDOG is not set
641CONFIG_HW_RANDOM=y
642# CONFIG_NVRAM is not set
643# CONFIG_GEN_RTC is not set
644# CONFIG_R3964 is not set
645# CONFIG_APPLICOM is not set
646# CONFIG_AGP is not set
647# CONFIG_DRM is not set
648# CONFIG_RAW_DRIVER is not set
649CONFIG_DEVPORT=y
650# CONFIG_I2C is not set
651
652#
653# SPI support
654#
655# CONFIG_SPI is not set
656# CONFIG_SPI_MASTER is not set
657# CONFIG_W1 is not set
658# CONFIG_POWER_SUPPLY is not set
659# CONFIG_HWMON is not set
660
661#
662# Multifunction device drivers
663#
664# CONFIG_MFD_SM501 is not set
665
666#
667# Multimedia devices
668#
669# CONFIG_VIDEO_DEV is not set
670# CONFIG_DVB_CORE is not set
671CONFIG_DAB=y
672
673#
674# Graphics support
675#
676# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
677
678#
679# Display device support
680#
681# CONFIG_DISPLAY_SUPPORT is not set
682# CONFIG_VGASTATE is not set
683CONFIG_VIDEO_OUTPUT_CONTROL=y
684# CONFIG_FB is not set
685# CONFIG_FB_IBM_GXT4500 is not set
686
687#
688# Sound
689#
690# CONFIG_SOUND is not set
691# CONFIG_HID_SUPPORT is not set
692CONFIG_USB_SUPPORT=y
693CONFIG_USB_ARCH_HAS_HCD=y
694CONFIG_USB_ARCH_HAS_OHCI=y
695CONFIG_USB_ARCH_HAS_EHCI=y
696# CONFIG_USB is not set
697
698#
699# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
700#
701
702#
703# USB Gadget Support
704#
705CONFIG_USB_GADGET=y
706# CONFIG_USB_GADGET_DEBUG_FILES is not set
707CONFIG_USB_GADGET_SELECTED=y
708# CONFIG_USB_GADGET_AMD5536UDC is not set
709# CONFIG_USB_GADGET_FSL_USB2 is not set
710# CONFIG_USB_GADGET_NET2280 is not set
711# CONFIG_USB_GADGET_PXA2XX is not set
712CONFIG_USB_GADGET_M66592=y
713CONFIG_USB_M66592=y
714# CONFIG_USB_GADGET_GOKU is not set
715# CONFIG_USB_GADGET_LH7A40X is not set
716# CONFIG_USB_GADGET_OMAP is not set
717# CONFIG_USB_GADGET_S3C2410 is not set
718# CONFIG_USB_GADGET_AT91 is not set
719# CONFIG_USB_GADGET_DUMMY_HCD is not set
720CONFIG_USB_GADGET_DUALSPEED=y
721# CONFIG_USB_ZERO is not set
722CONFIG_USB_ETH=y
723# CONFIG_USB_GADGETFS is not set
724# CONFIG_USB_FILE_STORAGE is not set
725# CONFIG_USB_G_SERIAL is not set
726# CONFIG_USB_MIDI_GADGET is not set
727# CONFIG_MMC is not set
728# CONFIG_NEW_LEDS is not set
729# CONFIG_INFINIBAND is not set
730# CONFIG_RTC_CLASS is not set
731
732#
733# DMA Engine support
734#
735# CONFIG_DMA_ENGINE is not set
736
737#
738# DMA Clients
739#
740
741#
742# DMA Devices
743#
744
745#
746# Userspace I/O
747#
748# CONFIG_UIO is not set
749
750#
751# File systems
752#
753CONFIG_EXT2_FS=y
754# CONFIG_EXT2_FS_XATTR is not set
755# CONFIG_EXT2_FS_XIP is not set
756CONFIG_EXT3_FS=y
757CONFIG_EXT3_FS_XATTR=y
758# CONFIG_EXT3_FS_POSIX_ACL is not set
759# CONFIG_EXT3_FS_SECURITY is not set
760CONFIG_JBD=y
761# CONFIG_JBD_DEBUG is not set
762CONFIG_FS_MBCACHE=y
763# CONFIG_REISERFS_FS is not set
764# CONFIG_JFS_FS is not set
765CONFIG_FS_POSIX_ACL=y
766# CONFIG_XFS_FS is not set
767# CONFIG_OCFS2_FS is not set
768# CONFIG_MINIX_FS is not set
769# CONFIG_ROMFS_FS is not set
770CONFIG_INOTIFY=y
771CONFIG_INOTIFY_USER=y
772# CONFIG_QUOTA is not set
773CONFIG_DNOTIFY=y
774# CONFIG_AUTOFS_FS is not set
775CONFIG_AUTOFS4_FS=y
776# CONFIG_FUSE_FS is not set
777
778#
779# CD-ROM/DVD Filesystems
780#
781# CONFIG_ISO9660_FS is not set
782# CONFIG_UDF_FS is not set
783
784#
785# DOS/FAT/NT Filesystems
786#
787# CONFIG_MSDOS_FS is not set
788# CONFIG_VFAT_FS is not set
789# CONFIG_NTFS_FS is not set
790
791#
792# Pseudo filesystems
793#
794CONFIG_PROC_FS=y
795CONFIG_PROC_KCORE=y
796CONFIG_PROC_SYSCTL=y
797CONFIG_SYSFS=y
798CONFIG_TMPFS=y
799# CONFIG_TMPFS_POSIX_ACL is not set
800# CONFIG_HUGETLB_PAGE is not set
801CONFIG_RAMFS=y
802
803#
804# Miscellaneous filesystems
805#
806# CONFIG_HFSPLUS_FS is not set
807# CONFIG_JFFS2_FS is not set
808CONFIG_CRAMFS=y
809# CONFIG_VXFS_FS is not set
810# CONFIG_HPFS_FS is not set
811# CONFIG_QNX4FS_FS is not set
812# CONFIG_SYSV_FS is not set
813# CONFIG_UFS_FS is not set
814
815#
816# Network File Systems
817#
818CONFIG_NFS_FS=y
819CONFIG_NFS_V3=y
820CONFIG_NFS_V3_ACL=y
821# CONFIG_NFS_DIRECTIO is not set
822# CONFIG_NFSD is not set
823CONFIG_ROOT_NFS=y
824CONFIG_LOCKD=y
825CONFIG_LOCKD_V4=y
826CONFIG_NFS_ACL_SUPPORT=y
827CONFIG_NFS_COMMON=y
828CONFIG_SUNRPC=y
829# CONFIG_SMB_FS is not set
830# CONFIG_CIFS is not set
831# CONFIG_NCP_FS is not set
832# CONFIG_CODA_FS is not set
833
834#
835# Partition Types
836#
837CONFIG_PARTITION_ADVANCED=y
838# CONFIG_ACORN_PARTITION is not set
839# CONFIG_OSF_PARTITION is not set
840# CONFIG_AMIGA_PARTITION is not set
841# CONFIG_ATARI_PARTITION is not set
842# CONFIG_MAC_PARTITION is not set
843CONFIG_MSDOS_PARTITION=y
844# CONFIG_BSD_DISKLABEL is not set
845# CONFIG_MINIX_SUBPARTITION is not set
846# CONFIG_SOLARIS_X86_PARTITION is not set
847# CONFIG_UNIXWARE_DISKLABEL is not set
848# CONFIG_LDM_PARTITION is not set
849# CONFIG_SGI_PARTITION is not set
850# CONFIG_ULTRIX_PARTITION is not set
851# CONFIG_SUN_PARTITION is not set
852# CONFIG_KARMA_PARTITION is not set
853# CONFIG_EFI_PARTITION is not set
854# CONFIG_SYSV68_PARTITION is not set
855
856#
857# Native Language Support
858#
859CONFIG_NLS=y
860CONFIG_NLS_DEFAULT="iso8859-1"
861CONFIG_NLS_CODEPAGE_437=y
862# CONFIG_NLS_CODEPAGE_737 is not set
863# CONFIG_NLS_CODEPAGE_775 is not set
864# CONFIG_NLS_CODEPAGE_850 is not set
865# CONFIG_NLS_CODEPAGE_852 is not set
866# CONFIG_NLS_CODEPAGE_855 is not set
867# CONFIG_NLS_CODEPAGE_857 is not set
868# CONFIG_NLS_CODEPAGE_860 is not set
869# CONFIG_NLS_CODEPAGE_861 is not set
870# CONFIG_NLS_CODEPAGE_862 is not set
871# CONFIG_NLS_CODEPAGE_863 is not set
872# CONFIG_NLS_CODEPAGE_864 is not set
873# CONFIG_NLS_CODEPAGE_865 is not set
874# CONFIG_NLS_CODEPAGE_866 is not set
875# CONFIG_NLS_CODEPAGE_869 is not set
876# CONFIG_NLS_CODEPAGE_936 is not set
877# CONFIG_NLS_CODEPAGE_950 is not set
878# CONFIG_NLS_CODEPAGE_932 is not set
879# CONFIG_NLS_CODEPAGE_949 is not set
880# CONFIG_NLS_CODEPAGE_874 is not set
881# CONFIG_NLS_ISO8859_8 is not set
882# CONFIG_NLS_CODEPAGE_1250 is not set
883# CONFIG_NLS_CODEPAGE_1251 is not set
884CONFIG_NLS_ASCII=y
885CONFIG_NLS_ISO8859_1=y
886# CONFIG_NLS_ISO8859_2 is not set
887# CONFIG_NLS_ISO8859_3 is not set
888# CONFIG_NLS_ISO8859_4 is not set
889# CONFIG_NLS_ISO8859_5 is not set
890# CONFIG_NLS_ISO8859_6 is not set
891# CONFIG_NLS_ISO8859_7 is not set
892# CONFIG_NLS_ISO8859_9 is not set
893# CONFIG_NLS_ISO8859_13 is not set
894# CONFIG_NLS_ISO8859_14 is not set
895# CONFIG_NLS_ISO8859_15 is not set
896# CONFIG_NLS_KOI8_R is not set
897# CONFIG_NLS_KOI8_U is not set
898CONFIG_NLS_UTF8=y
899# CONFIG_UCC_SLOW is not set
900
901#
902# Library routines
903#
904CONFIG_BITREVERSE=y
905CONFIG_CRC_CCITT=y
906# CONFIG_CRC16 is not set
907# CONFIG_CRC_ITU_T is not set
908CONFIG_CRC32=y
909# CONFIG_CRC7 is not set
910# CONFIG_LIBCRC32C is not set
911CONFIG_ZLIB_INFLATE=y
912CONFIG_ZLIB_DEFLATE=y
913CONFIG_PLIST=y
914CONFIG_HAS_IOMEM=y
915CONFIG_HAS_IOPORT=y
916CONFIG_HAS_DMA=y
917
918#
919# Kernel hacking
920#
921# CONFIG_PRINTK_TIME is not set
922CONFIG_ENABLE_MUST_CHECK=y
923CONFIG_MAGIC_SYSRQ=y
924# CONFIG_UNUSED_SYMBOLS is not set
925# CONFIG_DEBUG_FS is not set
926# CONFIG_HEADERS_CHECK is not set
927CONFIG_DEBUG_KERNEL=y
928# CONFIG_DEBUG_SHIRQ is not set
929CONFIG_DETECT_SOFTLOCKUP=y
930# CONFIG_SCHED_DEBUG is not set
931# CONFIG_SCHEDSTATS is not set
932# CONFIG_TIMER_STATS is not set
933# CONFIG_DEBUG_SLAB is not set
934# CONFIG_DEBUG_RT_MUTEXES is not set
935# CONFIG_RT_MUTEX_TESTER is not set
936# CONFIG_DEBUG_SPINLOCK is not set
937# CONFIG_DEBUG_MUTEXES is not set
938# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
939# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
940# CONFIG_DEBUG_KOBJECT is not set
941CONFIG_DEBUG_BUGVERBOSE=y
942CONFIG_DEBUG_INFO=y
943# CONFIG_DEBUG_VM is not set
944# CONFIG_DEBUG_LIST is not set
945CONFIG_FORCED_INLINING=y
946# CONFIG_FAULT_INJECTION is not set
947# CONFIG_DEBUG_STACKOVERFLOW is not set
948# CONFIG_DEBUG_STACK_USAGE is not set
949# CONFIG_DEBUG_PAGEALLOC is not set
950# CONFIG_DEBUGGER is not set
951# CONFIG_KGDB_CONSOLE is not set
952CONFIG_BDI_SWITCH=y
953# CONFIG_PPC_EARLY_DEBUG is not set
954# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
955# CONFIG_PPC_EARLY_DEBUG_G5 is not set
956# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
957# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
958# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
959# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
960# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
961# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
962# CONFIG_PPC_EARLY_DEBUG_44x is not set
963# CONFIG_PPC_EARLY_DEBUG_CPM is not set
964
965#
966# Security options
967#
968# CONFIG_KEYS is not set
969# CONFIG_SECURITY is not set
970CONFIG_CRYPTO=y
971CONFIG_CRYPTO_ALGAPI=y
972CONFIG_CRYPTO_BLKCIPHER=y
973CONFIG_CRYPTO_MANAGER=y
974# CONFIG_CRYPTO_HMAC is not set
975# CONFIG_CRYPTO_NULL is not set
976# CONFIG_CRYPTO_MD4 is not set
977CONFIG_CRYPTO_MD5=y
978# CONFIG_CRYPTO_SHA1 is not set
979# CONFIG_CRYPTO_SHA256 is not set
980# CONFIG_CRYPTO_SHA512 is not set
981# CONFIG_CRYPTO_WP512 is not set
982# CONFIG_CRYPTO_TGR192 is not set
983CONFIG_CRYPTO_ECB=y
984CONFIG_CRYPTO_CBC=y
985CONFIG_CRYPTO_PCBC=y
986# CONFIG_CRYPTO_CRYPTD is not set
987CONFIG_CRYPTO_DES=y
988# CONFIG_CRYPTO_FCRYPT is not set
989# CONFIG_CRYPTO_BLOWFISH is not set
990# CONFIG_CRYPTO_TWOFISH is not set
991# CONFIG_CRYPTO_SERPENT is not set
992# CONFIG_CRYPTO_AES is not set
993# CONFIG_CRYPTO_CAST5 is not set
994# CONFIG_CRYPTO_CAST6 is not set
995# CONFIG_CRYPTO_TEA is not set
996# CONFIG_CRYPTO_ARC4 is not set
997# CONFIG_CRYPTO_KHAZAD is not set
998# CONFIG_CRYPTO_ANUBIS is not set
999# CONFIG_CRYPTO_DEFLATE is not set
1000# CONFIG_CRYPTO_MICHAEL_MIC is not set
1001# CONFIG_CRYPTO_CRC32C is not set
1002# CONFIG_CRYPTO_CAMELLIA is not set
1003CONFIG_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..ca51f0cf27ab 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,27 @@ 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
45obj-$(CONFIG_44x) += cpu_setup_44x.o
44 46
45ifeq ($(CONFIG_PPC_MERGE),y) 47ifeq ($(CONFIG_PPC_MERGE),y)
46 48
47extra-$(CONFIG_PPC_STD_MMU) := head_32.o 49extra-$(CONFIG_PPC_STD_MMU) := head_32.o
48extra-$(CONFIG_PPC64) := head_64.o 50extra-$(CONFIG_PPC64) := head_64.o
49extra-$(CONFIG_40x) := head_4xx.o 51extra-$(CONFIG_40x) := head_40x.o
50extra-$(CONFIG_44x) := head_44x.o 52extra-$(CONFIG_44x) := head_44x.o
51extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o 53extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
52extra-$(CONFIG_8xx) := head_8xx.o 54extra-$(CONFIG_8xx) := head_8xx.o
53extra-y += vmlinux.lds 55extra-y += vmlinux.lds
54 56
55obj-y += time.o prom.o traps.o setup-common.o \ 57obj-y += time.o prom.o traps.o setup-common.o \
56 udbg.o misc.o io.o 58 udbg.o misc.o io.o \
57obj-$(CONFIG_PPC32) += entry_32.o setup_32.o misc_32.o 59 misc_$(CONFIG_WORD_SIZE).o
58obj-$(CONFIG_PPC64) += misc_64.o dma_64.o iommu.o 60obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
61obj-$(CONFIG_PPC64) += dma_64.o iommu.o
59obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o 62obj-$(CONFIG_PPC_MULTIPLATFORM) += prom_init.o
60obj-$(CONFIG_MODULES) += ppc_ksyms.o 63obj-$(CONFIG_MODULES) += ppc_ksyms.o
61obj-$(CONFIG_BOOTX_TEXT) += btext.o 64obj-$(CONFIG_BOOTX_TEXT) += btext.o
@@ -63,37 +66,27 @@ obj-$(CONFIG_SMP) += smp.o
63obj-$(CONFIG_KPROBES) += kprobes.o 66obj-$(CONFIG_KPROBES) += kprobes.o
64obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o 67obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
65 68
66module-$(CONFIG_PPC64) += module_64.o 69pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o
67obj-$(CONFIG_MODULES) += $(module-y) 70obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
68 71 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 72obj-$(CONFIG_PCI_MSI) += msi.o
73kexec-$(CONFIG_PPC64) := machine_kexec_64.o 73obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o \
74kexec-$(CONFIG_PPC32) := machine_kexec_32.o 74 machine_kexec_$(CONFIG_WORD_SIZE).o
75obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o $(kexec-y)
76obj-$(CONFIG_AUDIT) += audit.o 75obj-$(CONFIG_AUDIT) += audit.o
77obj64-$(CONFIG_AUDIT) += compat_audit.o 76obj64-$(CONFIG_AUDIT) += compat_audit.o
78 77
78obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o
79
79ifneq ($(CONFIG_PPC_INDIRECT_IO),y) 80ifneq ($(CONFIG_PPC_INDIRECT_IO),y)
80obj-y += iomap.o 81obj-y += iomap.o
81endif 82endif
82 83
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 84else
91# stuff used from here for ARCH=ppc 85# stuff used from here for ARCH=ppc
92smpobj-$(CONFIG_SMP) += smp.o 86smpobj-$(CONFIG_SMP) += smp.o
93 87
94endif 88endif
95 89
96obj-$(CONFIG_PPC32) += $(obj32-y)
97obj-$(CONFIG_PPC64) += $(obj64-y) 90obj-$(CONFIG_PPC64) += $(obj64-y)
98 91
99extra-$(CONFIG_PPC_FPU) += fpu.o 92extra-$(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/cpu_setup_44x.S b/arch/powerpc/kernel/cpu_setup_44x.S
new file mode 100644
index 000000000000..8e1812e2f3ee
--- /dev/null
+++ b/arch/powerpc/kernel/cpu_setup_44x.S
@@ -0,0 +1,56 @@
1/*
2 * This file contains low level CPU setup functions.
3 * Valentine Barshak <vbarshak@ru.mvista.com>
4 * MontaVista Software, Inc (c) 2007
5 *
6 * Based on cpu_setup_6xx code by
7 * Benjamin Herrenschmidt <benh@kernel.crashing.org>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 *
14 */
15
16#include <asm/processor.h>
17#include <asm/cputable.h>
18#include <asm/ppc_asm.h>
19
20_GLOBAL(__setup_cpu_440ep)
21 b __init_fpu_44x
22_GLOBAL(__setup_cpu_440epx)
23 mflr r4
24 bl __init_fpu_44x
25 bl __plb_disable_wrp
26 mtlr r4
27 blr
28_GLOBAL(__setup_cpu_440grx)
29 b __plb_disable_wrp
30
31
32/* enable APU between CPU and FPU */
33_GLOBAL(__init_fpu_44x)
34 mfspr r3,SPRN_CCR0
35 /* Clear DAPUIB flag in CCR0 */
36 rlwinm r3,r3,0,12,10
37 mtspr SPRN_CCR0,r3
38 isync
39 blr
40
41/*
42 * Workaround for the incorrect write to DDR SDRAM errata.
43 * The write address can be corrupted during writes to
44 * DDR SDRAM when write pipelining is enabled on PLB0.
45 * Disable write pipelining here.
46 */
47#define DCRN_PLB4A0_ACR 0x81
48
49_GLOBAL(__plb_disable_wrp)
50 mfdcr r3,DCRN_PLB4A0_ACR
51 /* clear WRP bit in PLB4A0_ACR */
52 rlwinm r3,r3,0,8,6
53 mtdcr DCRN_PLB4A0_ACR,r3
54 isync
55 blr
56
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index b1f8000952f3..d3fb7d0c6c1c 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -31,6 +31,9 @@ EXPORT_SYMBOL(cur_cpu_spec);
31 * and ppc64 31 * and ppc64
32 */ 32 */
33#ifdef CONFIG_PPC32 33#ifdef CONFIG_PPC32
34extern void __setup_cpu_440ep(unsigned long offset, struct cpu_spec* spec);
35extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
36extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
34extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec); 37extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
35extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec); 38extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
36extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec); 39extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
@@ -68,16 +71,7 @@ extern void __restore_cpu_ppc970(void);
68#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \ 71#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
69 PPC_FEATURE_BOOKE) 72 PPC_FEATURE_BOOKE)
70 73
71/* We only set the spe features if the kernel was compiled with 74static struct cpu_spec __initdata cpu_specs[] = {
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[] = {
81#ifdef CONFIG_PPC64 75#ifdef CONFIG_PPC64
82 { /* Power3 */ 76 { /* Power3 */
83 .pvr_mask = 0xffff0000, 77 .pvr_mask = 0xffff0000,
@@ -333,14 +327,6 @@ static struct cpu_spec cpu_specs[] = {
333 .cpu_user_features = COMMON_USER_POWER5_PLUS, 327 .cpu_user_features = COMMON_USER_POWER5_PLUS,
334 .icache_bsize = 128, 328 .icache_bsize = 128,
335 .dcache_bsize = 128, 329 .dcache_bsize = 128,
336 .num_pmcs = 6,
337 .pmc_type = PPC_PMC_IBM,
338 .oprofile_cpu_type = "ppc64/power6",
339 .oprofile_type = PPC_OPROFILE_POWER4,
340 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
341 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
342 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
343 POWER6_MMCRA_OTHER,
344 .platform = "power5+", 330 .platform = "power5+",
345 }, 331 },
346 { /* Power6 */ 332 { /* Power6 */
@@ -370,14 +356,6 @@ static struct cpu_spec cpu_specs[] = {
370 .cpu_user_features = COMMON_USER_POWER6, 356 .cpu_user_features = COMMON_USER_POWER6,
371 .icache_bsize = 128, 357 .icache_bsize = 128,
372 .dcache_bsize = 128, 358 .dcache_bsize = 128,
373 .num_pmcs = 6,
374 .pmc_type = PPC_PMC_IBM,
375 .oprofile_cpu_type = "ppc64/power6",
376 .oprofile_type = PPC_OPROFILE_POWER4,
377 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
378 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
379 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
380 POWER6_MMCRA_OTHER,
381 .platform = "power6", 359 .platform = "power6",
382 }, 360 },
383 { /* Cell Broadband Engine */ 361 { /* Cell Broadband Engine */
@@ -1109,6 +1087,17 @@ static struct cpu_spec cpu_specs[] = {
1109 .dcache_bsize = 32, 1087 .dcache_bsize = 32,
1110 .platform = "ppc405", 1088 .platform = "ppc405",
1111 }, 1089 },
1090 { /* 405EX */
1091 .pvr_mask = 0xffff0000,
1092 .pvr_value = 0x12910000,
1093 .cpu_name = "405EX",
1094 .cpu_features = CPU_FTRS_40X,
1095 .cpu_user_features = PPC_FEATURE_32 |
1096 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1097 .icache_bsize = 32,
1098 .dcache_bsize = 32,
1099 .platform = "ppc405",
1100 },
1112 1101
1113#endif /* CONFIG_40x */ 1102#endif /* CONFIG_40x */
1114#ifdef CONFIG_44x 1103#ifdef CONFIG_44x
@@ -1120,6 +1109,7 @@ static struct cpu_spec cpu_specs[] = {
1120 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, 1109 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1121 .icache_bsize = 32, 1110 .icache_bsize = 32,
1122 .dcache_bsize = 32, 1111 .dcache_bsize = 32,
1112 .cpu_setup = __setup_cpu_440ep,
1123 .platform = "ppc440", 1113 .platform = "ppc440",
1124 }, 1114 },
1125 { 1115 {
@@ -1130,6 +1120,29 @@ static struct cpu_spec cpu_specs[] = {
1130 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU, 1120 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1131 .icache_bsize = 32, 1121 .icache_bsize = 32,
1132 .dcache_bsize = 32, 1122 .dcache_bsize = 32,
1123 .cpu_setup = __setup_cpu_440ep,
1124 .platform = "ppc440",
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 .cpu_setup = __setup_cpu_440epx,
1135 .platform = "ppc440",
1136 },
1137 { /* 440GRX */
1138 .pvr_mask = 0xf0000ffb,
1139 .pvr_value = 0x200008D8,
1140 .cpu_name = "440GRX",
1141 .cpu_features = CPU_FTRS_44X,
1142 .cpu_user_features = COMMON_USER_BOOKE,
1143 .icache_bsize = 32,
1144 .dcache_bsize = 32,
1145 .cpu_setup = __setup_cpu_440grx,
1133 .platform = "ppc440", 1146 .platform = "ppc440",
1134 }, 1147 },
1135 { /* 440GP Rev. B */ 1148 { /* 440GP Rev. B */
@@ -1243,8 +1256,8 @@ static struct cpu_spec cpu_specs[] = {
1243 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ 1256 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1244 .cpu_features = CPU_FTRS_E200, 1257 .cpu_features = CPU_FTRS_E200,
1245 .cpu_user_features = COMMON_USER_BOOKE | 1258 .cpu_user_features = COMMON_USER_BOOKE |
1246 PPC_FEATURE_SPE_COMP | 1259 PPC_FEATURE_HAS_SPE_COMP |
1247 PPC_FEATURE_HAS_EFP_SINGLE | 1260 PPC_FEATURE_HAS_EFP_SINGLE_COMP |
1248 PPC_FEATURE_UNIFIED_CACHE, 1261 PPC_FEATURE_UNIFIED_CACHE,
1249 .dcache_bsize = 32, 1262 .dcache_bsize = 32,
1250 .platform = "ppc5554", 1263 .platform = "ppc5554",
@@ -1256,8 +1269,8 @@ static struct cpu_spec cpu_specs[] = {
1256 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ 1269 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1257 .cpu_features = CPU_FTRS_E500, 1270 .cpu_features = CPU_FTRS_E500,
1258 .cpu_user_features = COMMON_USER_BOOKE | 1271 .cpu_user_features = COMMON_USER_BOOKE |
1259 PPC_FEATURE_SPE_COMP | 1272 PPC_FEATURE_HAS_SPE_COMP |
1260 PPC_FEATURE_HAS_EFP_SINGLE, 1273 PPC_FEATURE_HAS_EFP_SINGLE_COMP,
1261 .icache_bsize = 32, 1274 .icache_bsize = 32,
1262 .dcache_bsize = 32, 1275 .dcache_bsize = 32,
1263 .num_pmcs = 4, 1276 .num_pmcs = 4,
@@ -1272,9 +1285,9 @@ static struct cpu_spec cpu_specs[] = {
1272 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */ 1285 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1273 .cpu_features = CPU_FTRS_E500_2, 1286 .cpu_features = CPU_FTRS_E500_2,
1274 .cpu_user_features = COMMON_USER_BOOKE | 1287 .cpu_user_features = COMMON_USER_BOOKE |
1275 PPC_FEATURE_SPE_COMP | 1288 PPC_FEATURE_HAS_SPE_COMP |
1276 PPC_FEATURE_HAS_EFP_SINGLE | 1289 PPC_FEATURE_HAS_EFP_SINGLE_COMP |
1277 PPC_FEATURE_HAS_EFP_DOUBLE, 1290 PPC_FEATURE_HAS_EFP_DOUBLE_COMP,
1278 .icache_bsize = 32, 1291 .icache_bsize = 32,
1279 .dcache_bsize = 32, 1292 .dcache_bsize = 32,
1280 .num_pmcs = 4, 1293 .num_pmcs = 4,
@@ -1298,29 +1311,49 @@ static struct cpu_spec cpu_specs[] = {
1298#endif /* CONFIG_PPC32 */ 1311#endif /* CONFIG_PPC32 */
1299}; 1312};
1300 1313
1301struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr) 1314static struct cpu_spec the_cpu_spec;
1315
1316struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
1302{ 1317{
1303 struct cpu_spec *s = cpu_specs; 1318 struct cpu_spec *s = cpu_specs;
1304 struct cpu_spec **cur = &cur_cpu_spec; 1319 struct cpu_spec *t = &the_cpu_spec;
1305 int i; 1320 int i;
1306 1321
1307 s = PTRRELOC(s); 1322 s = PTRRELOC(s);
1308 cur = PTRRELOC(cur); 1323 t = PTRRELOC(t);
1309 1324
1310 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) 1325 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1311 if ((pvr & s->pvr_mask) == s->pvr_value) { 1326 if ((pvr & s->pvr_mask) == s->pvr_value) {
1312 *cur = cpu_specs + i; 1327 /*
1313#ifdef CONFIG_PPC64 1328 * If we are overriding a previous value derived
1314 /* ppc64 expects identify_cpu to also call setup_cpu 1329 * from the real PVR with a new value obtained
1315 * for that processor. I will consolidate that at a 1330 * using a logical PVR value, don't modify the
1316 * later time, for now, just use our friend #ifdef. 1331 * performance monitor fields.
1332 */
1333 if (t->num_pmcs && !s->num_pmcs) {
1334 t->cpu_name = s->cpu_name;
1335 t->cpu_features = s->cpu_features;
1336 t->cpu_user_features = s->cpu_user_features;
1337 t->icache_bsize = s->icache_bsize;
1338 t->dcache_bsize = s->dcache_bsize;
1339 t->cpu_setup = s->cpu_setup;
1340 t->cpu_restore = s->cpu_restore;
1341 t->platform = s->platform;
1342 } else
1343 *t = *s;
1344 *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
1345#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
1346 /* ppc64 and booke expect identify_cpu to also call
1347 * setup_cpu for that processor. I will consolidate
1348 * that at a later time, for now, just use #ifdef.
1317 * we also don't need to PTRRELOC the function pointer 1349 * we also don't need to PTRRELOC the function pointer
1318 * on ppc64 as we are running at 0 in real mode. 1350 * on ppc64 and booke as we are running at 0 in real
1351 * mode on ppc64 and reloc_offset is always 0 on booke.
1319 */ 1352 */
1320 if (s->cpu_setup) { 1353 if (s->cpu_setup) {
1321 s->cpu_setup(offset, s); 1354 s->cpu_setup(offset, s);
1322 } 1355 }
1323#endif /* CONFIG_PPC64 */ 1356#endif /* CONFIG_PPC64 || CONFIG_BOOKE */
1324 return s; 1357 return s;
1325 } 1358 }
1326 BUG(); 1359 BUG();
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..0ec134034899 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -373,8 +373,16 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
373 373
374 ld r8,KSP(r4) /* new stack pointer */ 374 ld r8,KSP(r4) /* new stack pointer */
375BEGIN_FTR_SECTION 375BEGIN_FTR_SECTION
376 b 2f
377END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
378BEGIN_FTR_SECTION
376 clrrdi r6,r8,28 /* get its ESID */ 379 clrrdi r6,r8,28 /* get its ESID */
377 clrrdi r9,r1,28 /* get current sp ESID */ 380 clrrdi r9,r1,28 /* get current sp ESID */
381END_FTR_SECTION_IFCLR(CPU_FTR_1T_SEGMENT)
382BEGIN_FTR_SECTION
383 clrrdi r6,r8,40 /* get its 1T ESID */
384 clrrdi r9,r1,40 /* get current sp 1T ESID */
385END_FTR_SECTION_IFSET(CPU_FTR_1T_SEGMENT)
378 clrldi. r0,r6,2 /* is new ESID c00000000? */ 386 clrldi. r0,r6,2 /* is new ESID c00000000? */
379 cmpd cr1,r6,r9 /* or is new ESID the same as current ESID? */ 387 cmpd cr1,r6,r9 /* or is new ESID the same as current ESID? */
380 cror eq,4*cr1+eq,eq 388 cror eq,4*cr1+eq,eq
@@ -384,16 +392,21 @@ BEGIN_FTR_SECTION
384 ld r7,KSP_VSID(r4) /* Get new stack's VSID */ 392 ld r7,KSP_VSID(r4) /* Get new stack's VSID */
385 oris r0,r6,(SLB_ESID_V)@h 393 oris r0,r6,(SLB_ESID_V)@h
386 ori r0,r0,(SLB_NUM_BOLTED-1)@l 394 ori r0,r0,(SLB_NUM_BOLTED-1)@l
387 395BEGIN_FTR_SECTION
388 /* Update the last bolted SLB */ 396 li r9,MMU_SEGSIZE_1T /* insert B field */
397 oris r6,r6,(MMU_SEGSIZE_1T << SLBIE_SSIZE_SHIFT)@h
398 rldimi r7,r9,SLB_VSID_SSIZE_SHIFT,0
399END_FTR_SECTION_IFSET(CPU_FTR_1T_SEGMENT)
400
401 /* Update the last bolted SLB. No write barriers are needed
402 * here, provided we only update the current CPU's SLB shadow
403 * buffer.
404 */
389 ld r9,PACA_SLBSHADOWPTR(r13) 405 ld r9,PACA_SLBSHADOWPTR(r13)
390 li r12,0 406 li r12,0
391 std r12,SLBSHADOW_STACKESID(r9) /* Clear ESID */ 407 std r12,SLBSHADOW_STACKESID(r9) /* Clear ESID */
392 eieio
393 std r7,SLBSHADOW_STACKVSID(r9) /* Save VSID */ 408 std r7,SLBSHADOW_STACKVSID(r9) /* Save VSID */
394 eieio
395 std r0,SLBSHADOW_STACKESID(r9) /* Save ESID */ 409 std r0,SLBSHADOW_STACKESID(r9) /* Save ESID */
396 eieio
397 410
398 slbie r6 411 slbie r6
399 slbie r6 /* Workaround POWER5 < DD2.1 issue */ 412 slbie r6 /* Workaround POWER5 < DD2.1 issue */
@@ -401,7 +414,6 @@ BEGIN_FTR_SECTION
401 isync 414 isync
402 415
4032: 4162:
404END_FTR_SECTION_IFSET(CPU_FTR_SLB)
405 clrrdi r7,r8,THREAD_SHIFT /* base of new stack */ 417 clrrdi r7,r8,THREAD_SHIFT /* base of new stack */
406 /* Note: this uses SWITCH_FRAME_SIZE rather than INT_FRAME_SIZE 418 /* Note: this uses SWITCH_FRAME_SIZE rather than INT_FRAME_SIZE
407 because we don't need to leave the 288-byte ABI gap at the 419 because we don't need to leave the 288-byte ABI gap at the
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 7d73a13450b0..a5b13ae7fd20 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
@@ -152,6 +149,9 @@ __after_mmu_off:
152#if defined(CONFIG_BOOTX_TEXT) 149#if defined(CONFIG_BOOTX_TEXT)
153 bl setup_disp_bat 150 bl setup_disp_bat
154#endif 151#endif
152#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
153 bl setup_cpm_bat
154#endif
155 155
156/* 156/*
157 * Call setup_cpu for CPU 0 and initialize 6xx Idle 157 * Call setup_cpu for CPU 0 and initialize 6xx Idle
@@ -469,16 +469,16 @@ InstructionTLBMiss:
469 mfctr r0 469 mfctr r0
470 /* Get PTE (linux-style) and check access */ 470 /* Get PTE (linux-style) and check access */
471 mfspr r3,SPRN_IMISS 471 mfspr r3,SPRN_IMISS
472 lis r1,KERNELBASE@h /* check if kernel address */ 472 lis r1,PAGE_OFFSET@h /* check if kernel address */
473 cmplw 0,r3,r1 473 cmplw 0,r1,r3
474 mfspr r2,SPRN_SPRG3 474 mfspr r2,SPRN_SPRG3
475 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */ 475 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
476 lwz r2,PGDIR(r2) 476 lwz r2,PGDIR(r2)
477 blt+ 112f 477 bge- 112f
478 mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
479 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 */ 480 lis r2,swapper_pg_dir@ha /* if kernel address, use */
479 addi r2,r2,swapper_pg_dir@l /* kernel page table */ 481 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) 482112: tophys(r2,r2)
483 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ 483 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
484 lwz r2,0(r2) /* get pmd entry */ 484 lwz r2,0(r2) /* get pmd entry */
@@ -543,16 +543,16 @@ DataLoadTLBMiss:
543 mfctr r0 543 mfctr r0
544 /* Get PTE (linux-style) and check access */ 544 /* Get PTE (linux-style) and check access */
545 mfspr r3,SPRN_DMISS 545 mfspr r3,SPRN_DMISS
546 lis r1,KERNELBASE@h /* check if kernel address */ 546 lis r1,PAGE_OFFSET@h /* check if kernel address */
547 cmplw 0,r3,r1 547 cmplw 0,r1,r3
548 mfspr r2,SPRN_SPRG3 548 mfspr r2,SPRN_SPRG3
549 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */ 549 li r1,_PAGE_USER|_PAGE_PRESENT /* low addresses tested as user */
550 lwz r2,PGDIR(r2) 550 lwz r2,PGDIR(r2)
551 blt+ 112f 551 bge- 112f
552 mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
553 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 */ 554 lis r2,swapper_pg_dir@ha /* if kernel address, use */
553 addi r2,r2,swapper_pg_dir@l /* kernel page table */ 555 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) 556112: tophys(r2,r2)
557 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ 557 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
558 lwz r2,0(r2) /* get pmd entry */ 558 lwz r2,0(r2) /* get pmd entry */
@@ -615,16 +615,16 @@ DataStoreTLBMiss:
615 mfctr r0 615 mfctr r0
616 /* Get PTE (linux-style) and check access */ 616 /* Get PTE (linux-style) and check access */
617 mfspr r3,SPRN_DMISS 617 mfspr r3,SPRN_DMISS
618 lis r1,KERNELBASE@h /* check if kernel address */ 618 lis r1,PAGE_OFFSET@h /* check if kernel address */
619 cmplw 0,r3,r1 619 cmplw 0,r1,r3
620 mfspr r2,SPRN_SPRG3 620 mfspr r2,SPRN_SPRG3
621 li r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */ 621 li r1,_PAGE_RW|_PAGE_USER|_PAGE_PRESENT /* access flags */
622 lwz r2,PGDIR(r2) 622 lwz r2,PGDIR(r2)
623 blt+ 112f 623 bge- 112f
624 mfspr r2,SPRN_SRR1 /* and MSR_PR bit from SRR1 */
625 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 */ 626 lis r2,swapper_pg_dir@ha /* if kernel address, use */
625 addi r2,r2,swapper_pg_dir@l /* kernel page table */ 627 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) 628112: tophys(r2,r2)
629 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ 629 rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */
630 lwz r2,0(r2) /* get pmd entry */ 630 lwz r2,0(r2) /* get pmd entry */
@@ -841,7 +841,7 @@ relocate_kernel:
841 * r3 = dest addr, r4 = source addr, r5 = copy limit, r6 = start offset 841 * 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. 842 * on exit, r3, r4, r5 are unchanged, r6 is updated to be >= r5.
843 */ 843 */
844_GLOBAL(copy_and_flush) 844_ENTRY(copy_and_flush)
845 addi r5,r5,-4 845 addi r5,r5,-4
846 addi r6,r6,-4 846 addi r6,r6,-4
8474: li r0,L1_CACHE_BYTES/4 8474: li r0,L1_CACHE_BYTES/4
@@ -954,9 +954,9 @@ __secondary_start:
954 * included in CONFIG_6xx 954 * included in CONFIG_6xx
955 */ 955 */
956#if !defined(CONFIG_6xx) 956#if !defined(CONFIG_6xx)
957_GLOBAL(__save_cpu_setup) 957_ENTRY(__save_cpu_setup)
958 blr 958 blr
959_GLOBAL(__restore_cpu_setup) 959_ENTRY(__restore_cpu_setup)
960 blr 960 blr
961#endif /* !defined(CONFIG_6xx) */ 961#endif /* !defined(CONFIG_6xx) */
962 962
@@ -1080,7 +1080,7 @@ start_here:
1080/* 1080/*
1081 * Set up the segment registers for a new context. 1081 * Set up the segment registers for a new context.
1082 */ 1082 */
1083_GLOBAL(set_context) 1083_ENTRY(set_context)
1084 mulli r3,r3,897 /* multiply context by skew factor */ 1084 mulli r3,r3,897 /* multiply context by skew factor */
1085 rlwinm r3,r3,4,8,27 /* VSID = (context & 0xfffff) << 4 */ 1085 rlwinm r3,r3,4,8,27 /* VSID = (context & 0xfffff) << 4 */
1086 addis r3,r3,0x6000 /* Set Ks, Ku bits */ 1086 addis r3,r3,0x6000 /* Set Ks, Ku bits */
@@ -1248,6 +1248,19 @@ setup_disp_bat:
1248 blr 1248 blr
1249#endif /* CONFIG_BOOTX_TEXT */ 1249#endif /* CONFIG_BOOTX_TEXT */
1250 1250
1251#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
1252setup_cpm_bat:
1253 lis r8, 0xf000
1254 ori r8, r8, 0x002a
1255 mtspr SPRN_DBAT1L, r8
1256
1257 lis r11, 0xf000
1258 ori r11, r11, (BL_1M << 2) | 2
1259 mtspr SPRN_DBAT1U, r11
1260
1261 blr
1262#endif
1263
1251#ifdef CONFIG_8260 1264#ifdef CONFIG_8260
1252/* Jump into the system reset for the rom. 1265/* Jump into the system reset for the rom.
1253 * We first disable the MMU, and then jump to the ROM reset address. 1266 * We first disable the MMU, and then jump to the ROM reset address.
@@ -1300,14 +1313,6 @@ empty_zero_page:
1300swapper_pg_dir: 1313swapper_pg_dir:
1301 .space 4096 1314 .space 4096
1302 1315
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 1316 .globl intercept_table
1312intercept_table: 1317intercept_table:
1313 .long 0, 0, i0x200, i0x300, i0x400, 0, i0x600, i0x700 1318 .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..cfefc2df8f2a 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/*
@@ -290,7 +289,7 @@ label:
290 /* If we are faulting a kernel address, we have to use the 289 /* If we are faulting a kernel address, we have to use the
291 * kernel page tables. 290 * kernel page tables.
292 */ 291 */
293 lis r11, TASK_SIZE@h 292 lis r11, PAGE_OFFSET@h
294 cmplw r10, r11 293 cmplw r10, r11
295 blt+ 3f 294 blt+ 3f
296 lis r11, swapper_pg_dir@h 295 lis r11, swapper_pg_dir@h
@@ -482,7 +481,7 @@ label:
482 /* If we are faulting a kernel address, we have to use the 481 /* If we are faulting a kernel address, we have to use the
483 * kernel page tables. 482 * kernel page tables.
484 */ 483 */
485 lis r11, TASK_SIZE@h 484 lis r11, PAGE_OFFSET@h
486 cmplw r10, r11 485 cmplw r10, r11
487 blt+ 3f 486 blt+ 3f
488 lis r11, swapper_pg_dir@h 487 lis r11, swapper_pg_dir@h
@@ -582,7 +581,7 @@ label:
582 /* If we are faulting a kernel address, we have to use the 581 /* If we are faulting a kernel address, we have to use the
583 * kernel page tables. 582 * kernel page tables.
584 */ 583 */
585 lis r11, TASK_SIZE@h 584 lis r11, PAGE_OFFSET@h
586 cmplw r10, r11 585 cmplw r10, r11
587 blt+ 3f 586 blt+ 3f
588 lis r11, swapper_pg_dir@h 587 lis r11, swapper_pg_dir@h
@@ -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..409db6123924 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,16 +217,6 @@ 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
221 /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */
222 mfspr r2,SPRN_CCR0
223 lis r3,0xffef
224 ori r3,r3,0xffff
225 and r2,r2,r3
226 mtspr SPRN_CCR0,r2
227 isync
228#endif
229
230 /* 220 /*
231 * This is where the main kernel code starts. 221 * This is where the main kernel code starts.
232 */ 222 */
@@ -329,7 +319,7 @@ interrupt_base:
329 /* If we are faulting a kernel address, we have to use the 319 /* If we are faulting a kernel address, we have to use the
330 * kernel page tables. 320 * kernel page tables.
331 */ 321 */
332 lis r11, TASK_SIZE@h 322 lis r11, PAGE_OFFSET@h
333 cmplw r10, r11 323 cmplw r10, r11
334 blt+ 3f 324 blt+ 3f
335 lis r11, swapper_pg_dir@h 325 lis r11, swapper_pg_dir@h
@@ -468,7 +458,7 @@ interrupt_base:
468 /* If we are faulting a kernel address, we have to use the 458 /* If we are faulting a kernel address, we have to use the
469 * kernel page tables. 459 * kernel page tables.
470 */ 460 */
471 lis r11, TASK_SIZE@h 461 lis r11, PAGE_OFFSET@h
472 cmplw r10, r11 462 cmplw r10, r11
473 blt+ 3f 463 blt+ 3f
474 lis r11, swapper_pg_dir@h 464 lis r11, swapper_pg_dir@h
@@ -538,7 +528,7 @@ interrupt_base:
538 /* If we are faulting a kernel address, we have to use the 528 /* If we are faulting a kernel address, we have to use the
539 * kernel page tables. 529 * kernel page tables.
540 */ 530 */
541 lis r11, TASK_SIZE@h 531 lis r11, PAGE_OFFSET@h
542 cmplw r10, r11 532 cmplw r10, r11
543 blt+ 3f 533 blt+ 3f
544 lis r11, swapper_pg_dir@h 534 lis r11, swapper_pg_dir@h
@@ -744,14 +734,6 @@ exception_stack_bottom:
744exception_stack_top: 734exception_stack_top:
745 735
746/* 736/*
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 737 * Room for two PTE pointers, usually the kernel and current user pointers
756 * to their respective root page table. 738 * to their respective root page table.
757 */ 739 */
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 171800002ede..97c5857faf00 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
@@ -1449,7 +935,7 @@ _GLOBAL(do_stab_bolted)
1449 935
1450 /* Calculate VSID */ 936 /* Calculate VSID */
1451 /* This is a kernel address, so protovsid = ESID */ 937 /* This is a kernel address, so protovsid = ESID */
1452 ASM_VSID_SCRAMBLE(r11, r9) 938 ASM_VSID_SCRAMBLE(r11, r9, 256M)
1453 rldic r9,r11,12,16 /* r9 = vsid << 12 */ 939 rldic r9,r11,12,16 /* r9 = vsid << 12 */
1454 940
1455 /* Search the primary group for a free entry */ 941 /* Search the primary group for a free entry */
@@ -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..f7458396cd7c 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
@@ -301,6 +298,12 @@ InstructionTLBMiss:
301 stw r10, 0(r0) 298 stw r10, 0(r0)
302 stw r11, 4(r0) 299 stw r11, 4(r0)
303 mfspr r10, SPRN_SRR0 /* Get effective address of fault */ 300 mfspr r10, SPRN_SRR0 /* Get effective address of fault */
301#ifdef CONFIG_8xx_CPU15
302 addi r11, r10, 0x1000
303 tlbie r11
304 addi r11, r10, -0x1000
305 tlbie r11
306#endif
304 DO_8xx_CPU6(0x3780, r3) 307 DO_8xx_CPU6(0x3780, r3)
305 mtspr SPRN_MD_EPN, r10 /* Have to use MD_EPN for walk, MI_EPN can't */ 308 mtspr SPRN_MD_EPN, r10 /* Have to use MD_EPN for walk, MI_EPN can't */
306 mfspr r10, SPRN_M_TWB /* Get level 1 table entry address */ 309 mfspr r10, SPRN_M_TWB /* Get level 1 table entry address */
@@ -730,13 +733,13 @@ initial_mmu:
730 mtspr SPRN_MD_TWC, r9 733 mtspr SPRN_MD_TWC, r9
731 li r11, MI_BOOTINIT /* Create RPN for address 0 */ 734 li r11, MI_BOOTINIT /* Create RPN for address 0 */
732 addis r11, r11, 0x0080 /* Add 8M */ 735 addis r11, r11, 0x0080 /* Add 8M */
733 mtspr SPRN_MD_RPN, r8 736 mtspr SPRN_MD_RPN, r11
734 737
735 addis r8, r8, 0x0080 /* Add 8M */ 738 addis r8, r8, 0x0080 /* Add 8M */
736 mtspr SPRN_MD_EPN, r8 739 mtspr SPRN_MD_EPN, r8
737 mtspr SPRN_MD_TWC, r9 740 mtspr SPRN_MD_TWC, r9
738 addis r11, r11, 0x0080 /* Add 8M */ 741 addis r11, r11, 0x0080 /* Add 8M */
739 mtspr SPRN_MD_RPN, r8 742 mtspr SPRN_MD_RPN, r11
740#endif 743#endif
741 744
742 /* Since the cache is enabled according to the information we 745 /* Since the cache is enabled according to the information we
@@ -835,14 +838,6 @@ empty_zero_page:
835swapper_pg_dir: 838swapper_pg_dir:
836 .space 4096 839 .space 4096
837 840
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 841/* Room for two PTE table poiners, usually the kernel and current user
847 * pointer to their respective root page table (pgdir). 842 * pointer to their respective root page table (pgdir).
848 */ 843 */
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 1f155d399d57..4b9822728aea 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -2,27 +2,27 @@
2 * Kernel execution entry point code. 2 * Kernel execution entry point code.
3 * 3 *
4 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org> 4 * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org>
5 * Initial PowerPC version. 5 * Initial PowerPC version.
6 * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu> 6 * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu>
7 * Rewritten for PReP 7 * Rewritten for PReP
8 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au> 8 * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au>
9 * Low-level exception handers, MMU support, and rewrite. 9 * Low-level exception handers, MMU support, and rewrite.
10 * Copyright (c) 1997 Dan Malek <dmalek@jlc.net> 10 * Copyright (c) 1997 Dan Malek <dmalek@jlc.net>
11 * PowerPC 8xx modifications. 11 * PowerPC 8xx modifications.
12 * Copyright (c) 1998-1999 TiVo, Inc. 12 * Copyright (c) 1998-1999 TiVo, Inc.
13 * PowerPC 403GCX modifications. 13 * PowerPC 403GCX modifications.
14 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu> 14 * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
15 * PowerPC 403GCX/405GP modifications. 15 * PowerPC 403GCX/405GP modifications.
16 * Copyright 2000 MontaVista Software Inc. 16 * Copyright 2000 MontaVista Software Inc.
17 * PPC405 modifications 17 * PPC405 modifications
18 * PowerPC 403GCX/405GP modifications. 18 * PowerPC 403GCX/405GP modifications.
19 * Author: MontaVista Software, Inc. 19 * Author: MontaVista Software, Inc.
20 * frank_rowand@mvista.com or source@mvista.com 20 * frank_rowand@mvista.com or source@mvista.com
21 * debbie_chu@mvista.com 21 * debbie_chu@mvista.com
22 * Copyright 2002-2004 MontaVista Software, Inc. 22 * Copyright 2002-2004 MontaVista Software, Inc.
23 * PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org> 23 * PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org>
24 * Copyright 2004 Freescale Semiconductor, Inc 24 * Copyright 2004 Freescale Semiconductor, Inc
25 * PowerPC e500 modifications, Kumar Gala <galak@kernel.crashing.org> 25 * PowerPC e500 modifications, Kumar Gala <galak@kernel.crashing.org>
26 * 26 *
27 * This program is free software; you can redistribute it and/or modify it 27 * This program is free software; you can redistribute it and/or modify it
28 * under the terms of the GNU General Public License as published by the 28 * under the terms of the GNU General Public License as published by the
@@ -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
@@ -146,13 +146,13 @@ skpinv: addi r6,r6,1 /* Increment */
146 bne 1b /* If not, repeat */ 146 bne 1b /* If not, repeat */
147 147
148 /* Invalidate TLB0 */ 148 /* Invalidate TLB0 */
149 li r6,0x04 149 li r6,0x04
150 tlbivax 0,r6 150 tlbivax 0,r6
151#ifdef CONFIG_SMP 151#ifdef CONFIG_SMP
152 tlbsync 152 tlbsync
153#endif 153#endif
154 /* Invalidate TLB1 */ 154 /* Invalidate TLB1 */
155 li r6,0x0c 155 li r6,0x0c
156 tlbivax 0,r6 156 tlbivax 0,r6
157#ifdef CONFIG_SMP 157#ifdef CONFIG_SMP
158 tlbsync 158 tlbsync
@@ -211,7 +211,7 @@ skpinv: addi r6,r6,1 /* Increment */
211 mtspr SPRN_MAS1,r6 211 mtspr SPRN_MAS1,r6
212 tlbwe 212 tlbwe
213 /* Invalidate TLB1 */ 213 /* Invalidate TLB1 */
214 li r9,0x0c 214 li r9,0x0c
215 tlbivax 0,r9 215 tlbivax 0,r9
216#ifdef CONFIG_SMP 216#ifdef CONFIG_SMP
217 tlbsync 217 tlbsync
@@ -254,7 +254,7 @@ skpinv: addi r6,r6,1 /* Increment */
254 mtspr SPRN_MAS1,r8 254 mtspr SPRN_MAS1,r8
255 tlbwe 255 tlbwe
256 /* Invalidate TLB1 */ 256 /* Invalidate TLB1 */
257 li r9,0x0c 257 li r9,0x0c
258 tlbivax 0,r9 258 tlbivax 0,r9
259#ifdef CONFIG_SMP 259#ifdef CONFIG_SMP
260 tlbsync 260 tlbsync
@@ -294,7 +294,7 @@ skpinv: addi r6,r6,1 /* Increment */
294#ifdef CONFIG_E200 294#ifdef CONFIG_E200
295 oris r2,r2,MAS4_TLBSELD(1)@h 295 oris r2,r2,MAS4_TLBSELD(1)@h
296#endif 296#endif
297 mtspr SPRN_MAS4, r2 297 mtspr SPRN_MAS4, r2
298 298
299#if 0 299#if 0
300 /* Enable DOZE */ 300 /* Enable DOZE */
@@ -305,7 +305,7 @@ skpinv: addi r6,r6,1 /* Increment */
305#ifdef CONFIG_E200 305#ifdef CONFIG_E200
306 /* enable dedicated debug exception handling resources (Debug APU) */ 306 /* enable dedicated debug exception handling resources (Debug APU) */
307 mfspr r2,SPRN_HID0 307 mfspr r2,SPRN_HID0
308 ori r2,r2,HID0_DAPUEN@l 308 ori r2,r2,HID0_DAPUEN@l
309 mtspr SPRN_HID0,r2 309 mtspr SPRN_HID0,r2
310#endif 310#endif
311 311
@@ -391,7 +391,7 @@ skpinv: addi r6,r6,1 /* Increment */
391#ifdef CONFIG_PTE_64BIT 391#ifdef CONFIG_PTE_64BIT
392#define PTE_FLAGS_OFFSET 4 392#define PTE_FLAGS_OFFSET 4
393#define FIND_PTE \ 393#define FIND_PTE \
394 rlwinm r12, r10, 13, 19, 29; /* Compute pgdir/pmd offset */ \ 394 rlwinm r12, r10, 13, 19, 29; /* Compute pgdir/pmd offset */ \
395 lwzx r11, r12, r11; /* Get pgd/pmd entry */ \ 395 lwzx r11, r12, r11; /* Get pgd/pmd entry */ \
396 rlwinm. r12, r11, 0, 0, 20; /* Extract pt base address */ \ 396 rlwinm. r12, r11, 0, 0, 20; /* Extract pt base address */ \
397 beq 2f; /* Bail if no table */ \ 397 beq 2f; /* Bail if no table */ \
@@ -461,8 +461,7 @@ interrupt_base:
461 /* If we are faulting a kernel address, we have to use the 461 /* If we are faulting a kernel address, we have to use the
462 * kernel page tables. 462 * kernel page tables.
463 */ 463 */
464 lis r11, TASK_SIZE@h 464 lis r11, PAGE_OFFSET@h
465 ori r11, r11, TASK_SIZE@l
466 cmplw 0, r10, r11 465 cmplw 0, r10, r11
467 bge 2f 466 bge 2f
468 467
@@ -487,7 +486,7 @@ interrupt_base:
487 */ 486 */
488 andi. r11, r11, _PAGE_HWEXEC 487 andi. r11, r11, _PAGE_HWEXEC
489 rlwimi r11, r11, 31, 27, 27 /* SX <- _PAGE_HWEXEC */ 488 rlwimi r11, r11, 31, 27, 27 /* SX <- _PAGE_HWEXEC */
490 ori r11, r11, (MAS3_UW|MAS3_SW|MAS3_UR|MAS3_SR)@l /* set static perms */ 489 ori r11, r11, (MAS3_UW|MAS3_SW|MAS3_UR|MAS3_SR)@l /* set static perms */
491 490
492 /* update search PID in MAS6, AS = 0 */ 491 /* update search PID in MAS6, AS = 0 */
493 mfspr r12, SPRN_PID0 492 mfspr r12, SPRN_PID0
@@ -584,8 +583,7 @@ interrupt_base:
584 /* If we are faulting a kernel address, we have to use the 583 /* If we are faulting a kernel address, we have to use the
585 * kernel page tables. 584 * kernel page tables.
586 */ 585 */
587 lis r11, TASK_SIZE@h 586 lis r11, PAGE_OFFSET@h
588 ori r11, r11, TASK_SIZE@l
589 cmplw 5, r10, r11 587 cmplw 5, r10, r11
590 blt 5, 3f 588 blt 5, 3f
591 lis r11, swapper_pg_dir@h 589 lis r11, swapper_pg_dir@h
@@ -645,8 +643,7 @@ interrupt_base:
645 /* If we are faulting a kernel address, we have to use the 643 /* If we are faulting a kernel address, we have to use the
646 * kernel page tables. 644 * kernel page tables.
647 */ 645 */
648 lis r11, TASK_SIZE@h 646 lis r11, PAGE_OFFSET@h
649 ori r11, r11, TASK_SIZE@l
650 cmplw 5, r10, r11 647 cmplw 5, r10, r11
651 blt 5, 3f 648 blt 5, 3f
652 lis r11, swapper_pg_dir@h 649 lis r11, swapper_pg_dir@h
@@ -694,7 +691,7 @@ interrupt_base:
694 START_EXCEPTION(SPEUnavailable) 691 START_EXCEPTION(SPEUnavailable)
695 NORMAL_EXCEPTION_PROLOG 692 NORMAL_EXCEPTION_PROLOG
696 bne load_up_spe 693 bne load_up_spe
697 addi r3,r1,STACK_FRAME_OVERHEAD 694 addi r3,r1,STACK_FRAME_OVERHEAD
698 EXC_XFER_EE_LITE(0x2010, KernelSPE) 695 EXC_XFER_EE_LITE(0x2010, KernelSPE)
699#else 696#else
700 EXCEPTION(0x2020, SPEUnavailable, unknown_exception, EXC_XFER_EE) 697 EXCEPTION(0x2020, SPEUnavailable, unknown_exception, EXC_XFER_EE)
@@ -741,10 +738,10 @@ data_access:
741 738
742 * Both the instruction and data TLB miss get to this 739 * Both the instruction and data TLB miss get to this
743 * point to load the TLB. 740 * point to load the TLB.
744 * r10 - EA of fault 741 * r10 - EA of fault
745 * r11 - TLB (info from Linux PTE) 742 * r11 - TLB (info from Linux PTE)
746 * r12, r13 - available to use 743 * r12, r13 - available to use
747 * CR5 - results of addr < TASK_SIZE 744 * CR5 - results of addr >= PAGE_OFFSET
748 * MAS0, MAS1 - loaded with proper value when we get here 745 * MAS0, MAS1 - loaded with proper value when we get here
749 * MAS2, MAS3 - will need additional info from Linux PTE 746 * MAS2, MAS3 - will need additional info from Linux PTE
750 * Upon exit, we reload everything and RFI. 747 * Upon exit, we reload everything and RFI.
@@ -813,7 +810,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_BIG_PHYS)
813 lwz r13, tlbcam_index@l(r13) 810 lwz r13, tlbcam_index@l(r13)
814 rlwimi r12, r13, 0, 20, 31 811 rlwimi r12, r13, 0, 20, 31
8157: 8127:
816 mtspr SPRN_MAS0,r12 813 mtspr SPRN_MAS0,r12
817#endif /* CONFIG_E200 */ 814#endif /* CONFIG_E200 */
818 815
819 tlbwe 816 tlbwe
@@ -855,17 +852,17 @@ load_up_spe:
855 beq 1f 852 beq 1f
856 addi r4,r4,THREAD /* want THREAD of last_task_used_spe */ 853 addi r4,r4,THREAD /* want THREAD of last_task_used_spe */
857 SAVE_32EVRS(0,r10,r4) 854 SAVE_32EVRS(0,r10,r4)
858 evxor evr10, evr10, evr10 /* clear out evr10 */ 855 evxor evr10, evr10, evr10 /* clear out evr10 */
859 evmwumiaa evr10, evr10, evr10 /* evr10 <- ACC = 0 * 0 + ACC */ 856 evmwumiaa evr10, evr10, evr10 /* evr10 <- ACC = 0 * 0 + ACC */
860 li r5,THREAD_ACC 857 li r5,THREAD_ACC
861 evstddx evr10, r4, r5 /* save off accumulator */ 858 evstddx evr10, r4, r5 /* save off accumulator */
862 lwz r5,PT_REGS(r4) 859 lwz r5,PT_REGS(r4)
863 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5) 860 lwz r4,_MSR-STACK_FRAME_OVERHEAD(r5)
864 lis r10,MSR_SPE@h 861 lis r10,MSR_SPE@h
865 andc r4,r4,r10 /* disable SPE for previous task */ 862 andc r4,r4,r10 /* disable SPE for previous task */
866 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5) 863 stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
8671: 8641:
868#endif /* CONFIG_SMP */ 865#endif /* !CONFIG_SMP */
869 /* enable use of SPE after return */ 866 /* enable use of SPE after return */
870 oris r9,r9,MSR_SPE@h 867 oris r9,r9,MSR_SPE@h
871 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */ 868 mfspr r5,SPRN_SPRG3 /* current task's THREAD (phys) */
@@ -878,7 +875,7 @@ load_up_spe:
878#ifndef CONFIG_SMP 875#ifndef CONFIG_SMP
879 subi r4,r5,THREAD 876 subi r4,r5,THREAD
880 stw r4,last_task_used_spe@l(r3) 877 stw r4,last_task_used_spe@l(r3)
881#endif /* CONFIG_SMP */ 878#endif /* !CONFIG_SMP */
882 /* restore registers and return */ 879 /* restore registers and return */
8832: REST_4GPRS(3, r11) 8802: REST_4GPRS(3, r11)
884 lwz r10,_CCR(r11) 881 lwz r10,_CCR(r11)
@@ -963,10 +960,10 @@ _GLOBAL(giveup_spe)
963 lwz r5,PT_REGS(r3) 960 lwz r5,PT_REGS(r3)
964 cmpi 0,r5,0 961 cmpi 0,r5,0
965 SAVE_32EVRS(0, r4, r3) 962 SAVE_32EVRS(0, r4, r3)
966 evxor evr6, evr6, evr6 /* clear out evr6 */ 963 evxor evr6, evr6, evr6 /* clear out evr6 */
967 evmwumiaa evr6, evr6, evr6 /* evr6 <- ACC = 0 * 0 + ACC */ 964 evmwumiaa evr6, evr6, evr6 /* evr6 <- ACC = 0 * 0 + ACC */
968 li r4,THREAD_ACC 965 li r4,THREAD_ACC
969 evstddx evr6, r4, r3 /* save off accumulator */ 966 evstddx evr6, r4, r3 /* save off accumulator */
970 mfspr r6,SPRN_SPEFSCR 967 mfspr r6,SPRN_SPEFSCR
971 stw r6,THREAD_SPEFSCR(r3) /* save spefscr register value */ 968 stw r6,THREAD_SPEFSCR(r3) /* save spefscr register value */
972 beq 1f 969 beq 1f
@@ -979,7 +976,7 @@ _GLOBAL(giveup_spe)
979 li r5,0 976 li r5,0
980 lis r4,last_task_used_spe@ha 977 lis r4,last_task_used_spe@ha
981 stw r5,last_task_used_spe@l(r4) 978 stw r5,last_task_used_spe@l(r4)
982#endif /* CONFIG_SMP */ 979#endif /* !CONFIG_SMP */
983 blr 980 blr
984#endif /* CONFIG_SPE */ 981#endif /* CONFIG_SPE */
985 982
@@ -1000,15 +997,15 @@ _GLOBAL(giveup_fpu)
1000 */ 997 */
1001_GLOBAL(abort) 998_GLOBAL(abort)
1002 li r13,0 999 li r13,0
1003 mtspr SPRN_DBCR0,r13 /* disable all debug events */ 1000 mtspr SPRN_DBCR0,r13 /* disable all debug events */
1004 isync 1001 isync
1005 mfmsr r13 1002 mfmsr r13
1006 ori r13,r13,MSR_DE@l /* Enable Debug Events */ 1003 ori r13,r13,MSR_DE@l /* Enable Debug Events */
1007 mtmsr r13 1004 mtmsr r13
1008 isync 1005 isync
1009 mfspr r13,SPRN_DBCR0 1006 mfspr r13,SPRN_DBCR0
1010 lis r13,(DBCR0_IDM|DBCR0_RST_CHIP)@h 1007 lis r13,(DBCR0_IDM|DBCR0_RST_CHIP)@h
1011 mtspr SPRN_DBCR0,r13 1008 mtspr SPRN_DBCR0,r13
1012 isync 1009 isync
1013 1010
1014_GLOBAL(set_context) 1011_GLOBAL(set_context)
@@ -1043,21 +1040,13 @@ swapper_pg_dir:
1043/* Reserved 4k for the critical exception stack & 4k for the machine 1040/* Reserved 4k for the critical exception stack & 4k for the machine
1044 * check stack per CPU for kernel mode exceptions */ 1041 * check stack per CPU for kernel mode exceptions */
1045 .section .bss 1042 .section .bss
1046 .align 12 1043 .align 12
1047exception_stack_bottom: 1044exception_stack_bottom:
1048 .space BOOKE_EXCEPTION_STACK_SIZE * NR_CPUS 1045 .space BOOKE_EXCEPTION_STACK_SIZE * NR_CPUS
1049 .globl exception_stack_top 1046 .globl exception_stack_top
1050exception_stack_top: 1047exception_stack_top:
1051 1048
1052/* 1049/*
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 1050 * Room for two PTE pointers, usually the kernel and current user pointers
1062 * to their respective root page table. 1051 * to their respective root page table.
1063 */ 1052 */
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/idle.c b/arch/powerpc/kernel/idle.c
index a9e9cbd32975..abd2957fe537 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -24,6 +24,7 @@
24#include <linux/smp.h> 24#include <linux/smp.h>
25#include <linux/cpu.h> 25#include <linux/cpu.h>
26#include <linux/sysctl.h> 26#include <linux/sysctl.h>
27#include <linux/tick.h>
27 28
28#include <asm/system.h> 29#include <asm/system.h>
29#include <asm/processor.h> 30#include <asm/processor.h>
@@ -59,6 +60,7 @@ void cpu_idle(void)
59 60
60 set_thread_flag(TIF_POLLING_NRFLAG); 61 set_thread_flag(TIF_POLLING_NRFLAG);
61 while (1) { 62 while (1) {
63 tick_nohz_stop_sched_tick();
62 while (!need_resched() && !cpu_should_die()) { 64 while (!need_resched() && !cpu_should_die()) {
63 ppc64_runlatch_off(); 65 ppc64_runlatch_off();
64 66
@@ -90,6 +92,7 @@ void cpu_idle(void)
90 92
91 HMT_medium(); 93 HMT_medium();
92 ppc64_runlatch_on(); 94 ppc64_runlatch_on();
95 tick_nohz_restart_sched_tick();
93 if (cpu_should_die()) 96 if (cpu_should_die())
94 cpu_die(); 97 cpu_die();
95 preempt_enable_no_resched(); 98 preempt_enable_no_resched();
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 9bf63d5256db..2250f9e6c5ca 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
@@ -417,10 +418,16 @@ irq_hw_number_t virq_to_hw(unsigned int virq)
417} 418}
418EXPORT_SYMBOL_GPL(virq_to_hw); 419EXPORT_SYMBOL_GPL(virq_to_hw);
419 420
420__init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type, 421static int default_irq_host_match(struct irq_host *h, struct device_node *np)
421 unsigned int revmap_arg, 422{
422 struct irq_host_ops *ops, 423 return h->of_node != NULL && h->of_node == np;
423 irq_hw_number_t inval_irq) 424}
425
426struct irq_host *irq_alloc_host(struct device_node *of_node,
427 unsigned int revmap_type,
428 unsigned int revmap_arg,
429 struct irq_host_ops *ops,
430 irq_hw_number_t inval_irq)
424{ 431{
425 struct irq_host *host; 432 struct irq_host *host;
426 unsigned int size = sizeof(struct irq_host); 433 unsigned int size = sizeof(struct irq_host);
@@ -431,13 +438,7 @@ __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
431 /* Allocate structure and revmap table if using linear mapping */ 438 /* Allocate structure and revmap table if using linear mapping */
432 if (revmap_type == IRQ_HOST_MAP_LINEAR) 439 if (revmap_type == IRQ_HOST_MAP_LINEAR)
433 size += revmap_arg * sizeof(unsigned int); 440 size += revmap_arg * sizeof(unsigned int);
434 if (mem_init_done) 441 host = zalloc_maybe_bootmem(size, GFP_KERNEL);
435 host = kzalloc(size, GFP_KERNEL);
436 else {
437 host = alloc_bootmem(size);
438 if (host)
439 memset(host, 0, size);
440 }
441 if (host == NULL) 442 if (host == NULL)
442 return NULL; 443 return NULL;
443 444
@@ -445,6 +446,10 @@ __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
445 host->revmap_type = revmap_type; 446 host->revmap_type = revmap_type;
446 host->inval_irq = inval_irq; 447 host->inval_irq = inval_irq;
447 host->ops = ops; 448 host->ops = ops;
449 host->of_node = of_node;
450
451 if (host->ops->match == NULL)
452 host->ops->match = default_irq_host_match;
448 453
449 spin_lock_irqsave(&irq_big_lock, flags); 454 spin_lock_irqsave(&irq_big_lock, flags);
450 455
@@ -476,7 +481,7 @@ __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
476 host->inval_irq = 0; 481 host->inval_irq = 0;
477 /* setup us as the host for all legacy interrupts */ 482 /* setup us as the host for all legacy interrupts */
478 for (i = 1; i < NUM_ISA_INTERRUPTS; i++) { 483 for (i = 1; i < NUM_ISA_INTERRUPTS; i++) {
479 irq_map[i].hwirq = 0; 484 irq_map[i].hwirq = i;
480 smp_wmb(); 485 smp_wmb();
481 irq_map[i].host = host; 486 irq_map[i].host = host;
482 smp_wmb(); 487 smp_wmb();
@@ -520,7 +525,7 @@ struct irq_host *irq_find_host(struct device_node *node)
520 */ 525 */
521 spin_lock_irqsave(&irq_big_lock, flags); 526 spin_lock_irqsave(&irq_big_lock, flags);
522 list_for_each_entry(h, &irq_hosts, link) 527 list_for_each_entry(h, &irq_hosts, link)
523 if (h->ops->match == NULL || h->ops->match(h, node)) { 528 if (h->ops->match(h, node)) {
524 found = h; 529 found = h;
525 break; 530 break;
526 } 531 }
@@ -995,6 +1000,68 @@ static int irq_late_init(void)
995} 1000}
996arch_initcall(irq_late_init); 1001arch_initcall(irq_late_init);
997 1002
1003#ifdef CONFIG_VIRQ_DEBUG
1004static int virq_debug_show(struct seq_file *m, void *private)
1005{
1006 unsigned long flags;
1007 irq_desc_t *desc;
1008 const char *p;
1009 char none[] = "none";
1010 int i;
1011
1012 seq_printf(m, "%-5s %-7s %-15s %s\n", "virq", "hwirq",
1013 "chip name", "host name");
1014
1015 for (i = 1; i < NR_IRQS; i++) {
1016 desc = get_irq_desc(i);
1017 spin_lock_irqsave(&desc->lock, flags);
1018
1019 if (desc->action && desc->action->handler) {
1020 seq_printf(m, "%5d ", i);
1021 seq_printf(m, "0x%05lx ", virq_to_hw(i));
1022
1023 if (desc->chip && desc->chip->typename)
1024 p = desc->chip->typename;
1025 else
1026 p = none;
1027 seq_printf(m, "%-15s ", p);
1028
1029 if (irq_map[i].host && irq_map[i].host->of_node)
1030 p = irq_map[i].host->of_node->full_name;
1031 else
1032 p = none;
1033 seq_printf(m, "%s\n", p);
1034 }
1035
1036 spin_unlock_irqrestore(&desc->lock, flags);
1037 }
1038
1039 return 0;
1040}
1041
1042static int virq_debug_open(struct inode *inode, struct file *file)
1043{
1044 return single_open(file, virq_debug_show, inode->i_private);
1045}
1046
1047static const struct file_operations virq_debug_fops = {
1048 .open = virq_debug_open,
1049 .read = seq_read,
1050 .llseek = seq_lseek,
1051 .release = single_release,
1052};
1053
1054static int __init irq_debugfs_init(void)
1055{
1056 if (debugfs_create_file("virq_mapping", S_IRUGO, powerpc_debugfs_root,
1057 NULL, &virq_debug_fops))
1058 return -ENOMEM;
1059
1060 return 0;
1061}
1062__initcall(irq_debugfs_init);
1063#endif /* CONFIG_VIRQ_DEBUG */
1064
998#endif /* CONFIG_PPC_MERGE */ 1065#endif /* CONFIG_PPC_MERGE */
999 1066
1000#ifdef CONFIG_PPC64 1067#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 90fa11c72e1c..4ed58875ee17 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -340,9 +340,10 @@ void __init find_legacy_serial_ports(void)
340 } 340 }
341 341
342 /* First fill our array with opb bus ports */ 342 /* First fill our array with opb bus ports */
343 for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16750")) != NULL;) { 343 for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
344 struct device_node *opb = of_get_parent(np); 344 struct device_node *opb = of_get_parent(np);
345 if (opb && !strcmp(opb->type, "opb")) { 345 if (opb && (!strcmp(opb->type, "opb") ||
346 of_device_is_compatible(opb, "ibm,opb"))) {
346 index = add_legacy_soc_port(np, np); 347 index = add_legacy_soc_port(np, np);
347 if (index >= 0 && np == stdout) 348 if (index >= 0 && np == stdout)
348 legacy_serial_console = index; 349 legacy_serial_console = index;
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/of_platform.c b/arch/powerpc/kernel/of_platform.c
index f70e787d556f..eca8ccc3fa12 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -19,11 +19,11 @@
19#include <linux/mod_devicetable.h> 19#include <linux/mod_devicetable.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/pci.h> 21#include <linux/pci.h>
22#include <linux/of_device.h>
23#include <linux/of_platform.h>
22 24
23#include <asm/errno.h> 25#include <asm/errno.h>
24#include <asm/dcr.h> 26#include <asm/dcr.h>
25#include <asm/of_device.h>
26#include <asm/of_platform.h>
27#include <asm/topology.h> 27#include <asm/topology.h>
28#include <asm/pci-bridge.h> 28#include <asm/pci-bridge.h>
29#include <asm/ppc-pci.h> 29#include <asm/ppc-pci.h>
@@ -70,7 +70,10 @@ postcore_initcall(of_bus_driver_init);
70int of_register_platform_driver(struct of_platform_driver *drv) 70int of_register_platform_driver(struct of_platform_driver *drv)
71{ 71{
72 /* initialize common driver fields */ 72 /* initialize common driver fields */
73 drv->driver.name = drv->name; 73 if (!drv->driver.name)
74 drv->driver.name = drv->name;
75 if (!drv->driver.owner)
76 drv->driver.owner = drv->owner;
74 drv->driver.bus = &of_platform_bus_type; 77 drv->driver.bus = &of_platform_bus_type;
75 78
76 /* register with core */ 79 /* register with core */
@@ -385,9 +388,11 @@ static struct of_device_id of_pci_phb_ids[] = {
385}; 388};
386 389
387static struct of_platform_driver of_pci_phb_driver = { 390static struct of_platform_driver of_pci_phb_driver = {
388 .name = "of-pci", 391 .match_table = of_pci_phb_ids,
389 .match_table = of_pci_phb_ids, 392 .probe = of_pci_phb_probe,
390 .probe = of_pci_phb_probe, 393 .driver = {
394 .name = "of-pci",
395 },
391}; 396};
392 397
393static __init int of_pci_phb_init(void) 398static __init int of_pci_phb_init(void)
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..7949c203cb89 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.
@@ -556,10 +564,15 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
556 564
557#ifdef CONFIG_PPC64 565#ifdef CONFIG_PPC64
558 if (cpu_has_feature(CPU_FTR_SLB)) { 566 if (cpu_has_feature(CPU_FTR_SLB)) {
559 unsigned long sp_vsid = get_kernel_vsid(sp); 567 unsigned long sp_vsid;
560 unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp; 568 unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp;
561 569
562 sp_vsid <<= SLB_VSID_SHIFT; 570 if (cpu_has_feature(CPU_FTR_1T_SEGMENT))
571 sp_vsid = get_kernel_vsid(sp, MMU_SEGSIZE_1T)
572 << SLB_VSID_SHIFT_1T;
573 else
574 sp_vsid = get_kernel_vsid(sp, MMU_SEGSIZE_256M)
575 << SLB_VSID_SHIFT;
563 sp_vsid |= SLB_VSID_KERNEL | llp; 576 sp_vsid |= SLB_VSID_KERNEL | llp;
564 p->thread.ksp_vsid = sp_vsid; 577 p->thread.ksp_vsid = sp_vsid;
565 } 578 }
@@ -676,9 +689,13 @@ int set_fpexc_mode(struct task_struct *tsk, unsigned int val)
676 * mode (asyn, precise, disabled) for 'Classic' FP. */ 689 * mode (asyn, precise, disabled) for 'Classic' FP. */
677 if (val & PR_FP_EXC_SW_ENABLE) { 690 if (val & PR_FP_EXC_SW_ENABLE) {
678#ifdef CONFIG_SPE 691#ifdef CONFIG_SPE
679 tsk->thread.fpexc_mode = val & 692 if (cpu_has_feature(CPU_FTR_SPE)) {
680 (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT); 693 tsk->thread.fpexc_mode = val &
681 return 0; 694 (PR_FP_EXC_SW_ENABLE | PR_FP_ALL_EXCEPT);
695 return 0;
696 } else {
697 return -EINVAL;
698 }
682#else 699#else
683 return -EINVAL; 700 return -EINVAL;
684#endif 701#endif
@@ -704,7 +721,10 @@ int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
704 721
705 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) 722 if (tsk->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE)
706#ifdef CONFIG_SPE 723#ifdef CONFIG_SPE
707 val = tsk->thread.fpexc_mode; 724 if (cpu_has_feature(CPU_FTR_SPE))
725 val = tsk->thread.fpexc_mode;
726 else
727 return -EINVAL;
708#else 728#else
709 return -EINVAL; 729 return -EINVAL;
710#endif 730#endif
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index a38197b12d3e..9f329a8928ea 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{
@@ -530,10 +531,7 @@ static struct ibm_pa_feature {
530 {CPU_FTR_CTRL, 0, 0, 3, 0}, 531 {CPU_FTR_CTRL, 0, 0, 3, 0},
531 {CPU_FTR_NOEXECUTE, 0, 0, 6, 0}, 532 {CPU_FTR_NOEXECUTE, 0, 0, 6, 0},
532 {CPU_FTR_NODSISRALIGN, 0, 1, 1, 1}, 533 {CPU_FTR_NODSISRALIGN, 0, 1, 1, 1},
533#if 0
534 /* put this back once we know how to test if firmware does 64k IO */
535 {CPU_FTR_CI_LARGE_PAGE, 0, 1, 2, 0}, 534 {CPU_FTR_CI_LARGE_PAGE, 0, 1, 2, 0},
536#endif
537 {CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0}, 535 {CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0},
538}; 536};
539 537
@@ -780,13 +778,13 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
780#endif 778#endif
781 779
782#ifdef CONFIG_KEXEC 780#ifdef CONFIG_KEXEC
783 lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL); 781 lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL);
784 if (lprop) 782 if (lprop)
785 crashk_res.start = *lprop; 783 crashk_res.start = *lprop;
786 784
787 lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-size", NULL); 785 lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-size", NULL);
788 if (lprop) 786 if (lprop)
789 crashk_res.end = crashk_res.start + *lprop - 1; 787 crashk_res.end = crashk_res.start + *lprop - 1;
790#endif 788#endif
791 789
792 early_init_dt_check_for_initrd(node); 790 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..cd870a823d18 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);
@@ -287,7 +290,8 @@ void __init setup_arch(char **cmdline_p)
287 conswitchp = &dummy_con; 290 conswitchp = &dummy_con;
288#endif 291#endif
289 292
290 ppc_md.setup_arch(); 293 if (ppc_md.setup_arch)
294 ppc_md.setup_arch();
291 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab); 295 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
292 296
293 paging_init(); 297 paging_init();
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 6018178708a5..008ab6823b02 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
@@ -530,7 +530,8 @@ void __init setup_arch(char **cmdline_p)
530 conswitchp = &dummy_con; 530 conswitchp = &dummy_con;
531#endif 531#endif
532 532
533 ppc_md.setup_arch(); 533 if (ppc_md.setup_arch)
534 ppc_md.setup_arch();
534 535
535 paging_init(); 536 paging_init();
536 ppc64_boot_msg(0x15, "Setup Done"); 537 ppc64_boot_msg(0x15, "Setup Done");
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index c434d6c4e4e6..a65a44fbe523 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -16,6 +16,12 @@
16 16
17#include "signal.h" 17#include "signal.h"
18 18
19/* Log an error when sending an unhandled signal to a process. Controlled
20 * through debug.exception-trace sysctl.
21 */
22
23int show_unhandled_signals = 0;
24
19/* 25/*
20 * Allocate space for the signal frame 26 * Allocate space for the signal frame
21 */ 27 */
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 590057e9e987..6126bca8b70a 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -705,11 +705,13 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
705{ 705{
706 struct rt_sigframe __user *rt_sf; 706 struct rt_sigframe __user *rt_sf;
707 struct mcontext __user *frame; 707 struct mcontext __user *frame;
708 void __user *addr;
708 unsigned long newsp = 0; 709 unsigned long newsp = 0;
709 710
710 /* Set up Signal Frame */ 711 /* Set up Signal Frame */
711 /* Put a Real Time Context onto stack */ 712 /* Put a Real Time Context onto stack */
712 rt_sf = get_sigframe(ka, regs, sizeof(*rt_sf)); 713 rt_sf = get_sigframe(ka, regs, sizeof(*rt_sf));
714 addr = rt_sf;
713 if (unlikely(rt_sf == NULL)) 715 if (unlikely(rt_sf == NULL))
714 goto badframe; 716 goto badframe;
715 717
@@ -728,6 +730,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
728 730
729 /* Save user registers on the stack */ 731 /* Save user registers on the stack */
730 frame = &rt_sf->uc.uc_mcontext; 732 frame = &rt_sf->uc.uc_mcontext;
733 addr = frame;
731 if (vdso32_rt_sigtramp && current->mm->context.vdso_base) { 734 if (vdso32_rt_sigtramp && current->mm->context.vdso_base) {
732 if (save_user_regs(regs, frame, 0)) 735 if (save_user_regs(regs, frame, 0))
733 goto badframe; 736 goto badframe;
@@ -742,6 +745,7 @@ int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka,
742 745
743 /* create a stack frame for the caller of the handler */ 746 /* create a stack frame for the caller of the handler */
744 newsp = ((unsigned long)rt_sf) - (__SIGNAL_FRAMESIZE + 16); 747 newsp = ((unsigned long)rt_sf) - (__SIGNAL_FRAMESIZE + 16);
748 addr = (void __user *)regs->gpr[1];
745 if (put_user(regs->gpr[1], (u32 __user *)newsp)) 749 if (put_user(regs->gpr[1], (u32 __user *)newsp))
746 goto badframe; 750 goto badframe;
747 751
@@ -762,6 +766,12 @@ badframe:
762 printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n", 766 printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n",
763 regs, frame, newsp); 767 regs, frame, newsp);
764#endif 768#endif
769 if (show_unhandled_signals && printk_ratelimit())
770 printk(KERN_INFO "%s[%d]: bad frame in handle_rt_signal32: "
771 "%p nip %08lx lr %08lx\n",
772 current->comm, current->pid,
773 addr, regs->nip, regs->link);
774
765 force_sigsegv(sig, current); 775 force_sigsegv(sig, current);
766 return 0; 776 return 0;
767} 777}
@@ -886,6 +896,12 @@ long sys_rt_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
886 return 0; 896 return 0;
887 897
888 bad: 898 bad:
899 if (show_unhandled_signals && printk_ratelimit())
900 printk(KERN_INFO "%s[%d]: bad frame in sys_rt_sigreturn: "
901 "%p nip %08lx lr %08lx\n",
902 current->comm, current->pid,
903 rt_sf, regs->nip, regs->link);
904
889 force_sig(SIGSEGV, current); 905 force_sig(SIGSEGV, current);
890 return 0; 906 return 0;
891} 907}
@@ -967,6 +983,13 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
967 * We kill the task with a SIGSEGV in this situation. 983 * We kill the task with a SIGSEGV in this situation.
968 */ 984 */
969 if (do_setcontext(ctx, regs, 1)) { 985 if (do_setcontext(ctx, regs, 1)) {
986 if (show_unhandled_signals && printk_ratelimit())
987 printk(KERN_INFO "%s[%d]: bad frame in "
988 "sys_debug_setcontext: %p nip %08lx "
989 "lr %08lx\n",
990 current->comm, current->pid,
991 ctx, regs->nip, regs->link);
992
970 force_sig(SIGSEGV, current); 993 force_sig(SIGSEGV, current);
971 goto out; 994 goto out;
972 } 995 }
@@ -1048,6 +1071,12 @@ badframe:
1048 printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n", 1071 printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n",
1049 regs, frame, newsp); 1072 regs, frame, newsp);
1050#endif 1073#endif
1074 if (show_unhandled_signals && printk_ratelimit())
1075 printk(KERN_INFO "%s[%d]: bad frame in handle_signal32: "
1076 "%p nip %08lx lr %08lx\n",
1077 current->comm, current->pid,
1078 frame, regs->nip, regs->link);
1079
1051 force_sigsegv(sig, current); 1080 force_sigsegv(sig, current);
1052 return 0; 1081 return 0;
1053} 1082}
@@ -1061,12 +1090,14 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
1061 struct sigcontext __user *sc; 1090 struct sigcontext __user *sc;
1062 struct sigcontext sigctx; 1091 struct sigcontext sigctx;
1063 struct mcontext __user *sr; 1092 struct mcontext __user *sr;
1093 void __user *addr;
1064 sigset_t set; 1094 sigset_t set;
1065 1095
1066 /* Always make any pending restarted system calls return -EINTR */ 1096 /* Always make any pending restarted system calls return -EINTR */
1067 current_thread_info()->restart_block.fn = do_no_restart_syscall; 1097 current_thread_info()->restart_block.fn = do_no_restart_syscall;
1068 1098
1069 sc = (struct sigcontext __user *)(regs->gpr[1] + __SIGNAL_FRAMESIZE); 1099 sc = (struct sigcontext __user *)(regs->gpr[1] + __SIGNAL_FRAMESIZE);
1100 addr = sc;
1070 if (copy_from_user(&sigctx, sc, sizeof(sigctx))) 1101 if (copy_from_user(&sigctx, sc, sizeof(sigctx)))
1071 goto badframe; 1102 goto badframe;
1072 1103
@@ -1083,6 +1114,7 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
1083 restore_sigmask(&set); 1114 restore_sigmask(&set);
1084 1115
1085 sr = (struct mcontext __user *)from_user_ptr(sigctx.regs); 1116 sr = (struct mcontext __user *)from_user_ptr(sigctx.regs);
1117 addr = sr;
1086 if (!access_ok(VERIFY_READ, sr, sizeof(*sr)) 1118 if (!access_ok(VERIFY_READ, sr, sizeof(*sr))
1087 || restore_user_regs(regs, sr, 1)) 1119 || restore_user_regs(regs, sr, 1))
1088 goto badframe; 1120 goto badframe;
@@ -1091,6 +1123,12 @@ long sys_sigreturn(int r3, int r4, int r5, int r6, int r7, int r8,
1091 return 0; 1123 return 0;
1092 1124
1093badframe: 1125badframe:
1126 if (show_unhandled_signals && printk_ratelimit())
1127 printk(KERN_INFO "%s[%d]: bad frame in sys_sigreturn: "
1128 "%p nip %08lx lr %08lx\n",
1129 current->comm, current->pid,
1130 addr, regs->nip, regs->link);
1131
1094 force_sig(SIGSEGV, current); 1132 force_sig(SIGSEGV, current);
1095 return 0; 1133 return 0;
1096} 1134}
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index de895e6d8c62..faeb8f207ea4 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -64,6 +64,11 @@ struct rt_sigframe {
64 char abigap[288]; 64 char abigap[288];
65} __attribute__ ((aligned (16))); 65} __attribute__ ((aligned (16)));
66 66
67static const char fmt32[] = KERN_INFO \
68 "%s[%d]: bad frame in %s: %08lx nip %08lx lr %08lx\n";
69static const char fmt64[] = KERN_INFO \
70 "%s[%d]: bad frame in %s: %016lx nip %016lx lr %016lx\n";
71
67/* 72/*
68 * Set up the sigcontext for the signal frame. 73 * Set up the sigcontext for the signal frame.
69 */ 74 */
@@ -315,6 +320,11 @@ badframe:
315 printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n", 320 printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n",
316 regs, uc, &uc->uc_mcontext); 321 regs, uc, &uc->uc_mcontext);
317#endif 322#endif
323 if (show_unhandled_signals && printk_ratelimit())
324 printk(regs->msr & MSR_SF ? fmt64 : fmt32,
325 current->comm, current->pid, "rt_sigreturn",
326 (long)uc, regs->nip, regs->link);
327
318 force_sig(SIGSEGV, current); 328 force_sig(SIGSEGV, current);
319 return 0; 329 return 0;
320} 330}
@@ -398,6 +408,11 @@ badframe:
398 printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n", 408 printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",
399 regs, frame, newsp); 409 regs, frame, newsp);
400#endif 410#endif
411 if (show_unhandled_signals && printk_ratelimit())
412 printk(regs->msr & MSR_SF ? fmt64 : fmt32,
413 current->comm, current->pid, "setup_rt_frame",
414 (long)frame, regs->nip, regs->link);
415
401 force_sigsegv(signr, current); 416 force_sigsegv(signr, current);
402 return 0; 417 return 0;
403} 418}
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 1ea43160f543..d30f08fa0297 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);
@@ -560,6 +569,8 @@ int __devinit start_secondary(void *unused)
560 if (system_state > SYSTEM_BOOTING) 569 if (system_state > SYSTEM_BOOTING)
561 snapshot_timebase(); 570 snapshot_timebase();
562 571
572 secondary_cpu_time_init();
573
563 spin_lock(&call_lock); 574 spin_lock(&call_lock);
564 cpu_set(cpu, cpu_online_map); 575 cpu_set(cpu, cpu_online_map);
565 spin_unlock(&call_lock); 576 spin_unlock(&call_lock);
diff --git a/arch/powerpc/kernel/softemu8xx.c b/arch/powerpc/kernel/softemu8xx.c
new file mode 100644
index 000000000000..67d6f6890edc
--- /dev/null
+++ b/arch/powerpc/kernel/softemu8xx.c
@@ -0,0 +1,202 @@
1/*
2 * Software emulation of some PPC instructions for the 8xx core.
3 *
4 * Copyright (C) 1998 Dan Malek (dmalek@jlc.net)
5 *
6 * Software floating emuation for the MPC8xx processor. I did this mostly
7 * because it was easier than trying to get the libraries compiled for
8 * software floating point. The goal is still to get the libraries done,
9 * but I lost patience and needed some hacks to at least get init and
10 * shells running. The first problem is the setjmp/longjmp that save
11 * and restore the floating point registers.
12 *
13 * For this emulation, our working registers are found on the register
14 * save area.
15 */
16
17#include <linux/errno.h>
18#include <linux/sched.h>
19#include <linux/kernel.h>
20#include <linux/mm.h>
21#include <linux/stddef.h>
22#include <linux/unistd.h>
23#include <linux/ptrace.h>
24#include <linux/slab.h>
25#include <linux/user.h>
26#include <linux/a.out.h>
27#include <linux/interrupt.h>
28
29#include <asm/pgtable.h>
30#include <asm/uaccess.h>
31#include <asm/system.h>
32#include <asm/io.h>
33
34/* Eventually we may need a look-up table, but this works for now.
35*/
36#define LFS 48
37#define LFD 50
38#define LFDU 51
39#define STFD 54
40#define STFDU 55
41#define FMR 63
42
43void print_8xx_pte(struct mm_struct *mm, unsigned long addr)
44{
45 pgd_t *pgd;
46 pmd_t *pmd;
47 pte_t *pte;
48
49 printk(" pte @ 0x%8lx: ", addr);
50 pgd = pgd_offset(mm, addr & PAGE_MASK);
51 if (pgd) {
52 pmd = pmd_offset(pud_offset(pgd, addr & PAGE_MASK),
53 addr & PAGE_MASK);
54 if (pmd && pmd_present(*pmd)) {
55 pte = pte_offset_kernel(pmd, addr & PAGE_MASK);
56 if (pte) {
57 printk(" (0x%08lx)->(0x%08lx)->0x%08lx\n",
58 (long)pgd, (long)pte, (long)pte_val(*pte));
59#define pp ((long)pte_val(*pte))
60 printk(" RPN: %05lx PP: %lx SPS: %lx SH: %lx "
61 "CI: %lx v: %lx\n",
62 pp>>12, /* rpn */
63 (pp>>10)&3, /* pp */
64 (pp>>3)&1, /* small */
65 (pp>>2)&1, /* shared */
66 (pp>>1)&1, /* cache inhibit */
67 pp&1 /* valid */
68 );
69#undef pp
70 }
71 else {
72 printk("no pte\n");
73 }
74 }
75 else {
76 printk("no pmd\n");
77 }
78 }
79 else {
80 printk("no pgd\n");
81 }
82}
83
84int get_8xx_pte(struct mm_struct *mm, unsigned long addr)
85{
86 pgd_t *pgd;
87 pmd_t *pmd;
88 pte_t *pte;
89 int retval = 0;
90
91 pgd = pgd_offset(mm, addr & PAGE_MASK);
92 if (pgd) {
93 pmd = pmd_offset(pud_offset(pgd, addr & PAGE_MASK),
94 addr & PAGE_MASK);
95 if (pmd && pmd_present(*pmd)) {
96 pte = pte_offset_kernel(pmd, addr & PAGE_MASK);
97 if (pte) {
98 retval = (int)pte_val(*pte);
99 }
100 }
101 }
102 return retval;
103}
104
105/*
106 * We return 0 on success, 1 on unimplemented instruction, and EFAULT
107 * if a load/store faulted.
108 */
109int Soft_emulate_8xx(struct pt_regs *regs)
110{
111 u32 inst, instword;
112 u32 flreg, idxreg, disp;
113 int retval;
114 s16 sdisp;
115 u32 *ea, *ip;
116
117 retval = 0;
118
119 instword = *((u32 *)regs->nip);
120 inst = instword >> 26;
121
122 flreg = (instword >> 21) & 0x1f;
123 idxreg = (instword >> 16) & 0x1f;
124 disp = instword & 0xffff;
125
126 ea = (u32 *)(regs->gpr[idxreg] + disp);
127 ip = (u32 *)&current->thread.fpr[flreg];
128
129 switch ( inst )
130 {
131 case LFD:
132 /* this is a 16 bit quantity that is sign extended
133 * so use a signed short here -- Cort
134 */
135 sdisp = (instword & 0xffff);
136 ea = (u32 *)(regs->gpr[idxreg] + sdisp);
137 if (copy_from_user(ip, ea, sizeof(double)))
138 retval = -EFAULT;
139 break;
140
141 case LFDU:
142 if (copy_from_user(ip, ea, sizeof(double)))
143 retval = -EFAULT;
144 else
145 regs->gpr[idxreg] = (u32)ea;
146 break;
147 case LFS:
148 sdisp = (instword & 0xffff);
149 ea = (u32 *)(regs->gpr[idxreg] + sdisp);
150 if (copy_from_user(ip, ea, sizeof(float)))
151 retval = -EFAULT;
152 break;
153 case STFD:
154 /* this is a 16 bit quantity that is sign extended
155 * so use a signed short here -- Cort
156 */
157 sdisp = (instword & 0xffff);
158 ea = (u32 *)(regs->gpr[idxreg] + sdisp);
159 if (copy_to_user(ea, ip, sizeof(double)))
160 retval = -EFAULT;
161 break;
162
163 case STFDU:
164 if (copy_to_user(ea, ip, sizeof(double)))
165 retval = -EFAULT;
166 else
167 regs->gpr[idxreg] = (u32)ea;
168 break;
169 case FMR:
170 /* assume this is a fp move -- Cort */
171 memcpy(ip, &current->thread.fpr[(instword>>11)&0x1f],
172 sizeof(double));
173 break;
174 default:
175 retval = 1;
176 printk("Bad emulation %s/%d\n"
177 " NIP: %08lx instruction: %08x opcode: %x "
178 "A: %x B: %x C: %x code: %x rc: %x\n",
179 current->comm,current->pid,
180 regs->nip,
181 instword,inst,
182 (instword>>16)&0x1f,
183 (instword>>11)&0x1f,
184 (instword>>6)&0x1f,
185 (instword>>1)&0x3ff,
186 instword&1);
187 {
188 int pa;
189 print_8xx_pte(current->mm,regs->nip);
190 pa = get_8xx_pte(current->mm,regs->nip) & PAGE_MASK;
191 pa |= (regs->nip & ~PAGE_MASK);
192 pa = (unsigned long)__va(pa);
193 printk("Kernel VA for NIP %x ", pa);
194 print_8xx_pte(current->mm,pa);
195 }
196 }
197
198 if (retval == 0)
199 regs->nip += 4;
200
201 return retval;
202}
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/systbl.S b/arch/powerpc/kernel/systbl.S
index 579de70e0b4d..93219c34af32 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -39,6 +39,8 @@
39#ifdef CONFIG_PPC64 39#ifdef CONFIG_PPC64
40#define sys_sigpending sys_ni_syscall 40#define sys_sigpending sys_ni_syscall
41#define sys_old_getrlimit sys_ni_syscall 41#define sys_old_getrlimit sys_ni_syscall
42
43 .p2align 3
42#endif 44#endif
43 45
44_GLOBAL(sys_call_table) 46_GLOBAL(sys_call_table)
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index c627cf86d1e3..9368da371f36 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -65,24 +65,68 @@
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/clockchips.h>
77#include <linux/clocksource.h>
78
79static cycle_t rtc_read(void);
80static struct clocksource clocksource_rtc = {
81 .name = "rtc",
82 .rating = 400,
83 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
84 .mask = CLOCKSOURCE_MASK(64),
85 .shift = 22,
86 .mult = 0, /* To be filled in */
87 .read = rtc_read,
88};
89
90static cycle_t timebase_read(void);
91static struct clocksource clocksource_timebase = {
92 .name = "timebase",
93 .rating = 400,
94 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
95 .mask = CLOCKSOURCE_MASK(64),
96 .shift = 22,
97 .mult = 0, /* To be filled in */
98 .read = timebase_read,
99};
100
101#define DECREMENTER_MAX 0x7fffffff
102
103static int decrementer_set_next_event(unsigned long evt,
104 struct clock_event_device *dev);
105static void decrementer_set_mode(enum clock_event_mode mode,
106 struct clock_event_device *dev);
107
108static struct clock_event_device decrementer_clockevent = {
109 .name = "decrementer",
110 .rating = 200,
111 .shift = 16,
112 .mult = 0, /* To be filled in */
113 .irq = 0,
114 .set_next_event = decrementer_set_next_event,
115 .set_mode = decrementer_set_mode,
116 .features = CLOCK_EVT_FEAT_ONESHOT,
117};
118
119static DEFINE_PER_CPU(struct clock_event_device, decrementers);
120void init_decrementer_clockevent(void);
121static DEFINE_PER_CPU(u64, decrementer_next_tb);
122
79#ifdef CONFIG_PPC_ISERIES 123#ifdef CONFIG_PPC_ISERIES
80static unsigned long __initdata iSeries_recal_titan; 124static unsigned long __initdata iSeries_recal_titan;
81static signed long __initdata iSeries_recal_tb; 125static signed long __initdata iSeries_recal_tb;
82#endif
83 126
84/* The decrementer counts down by 128 every 128ns on a 601. */ 127/* Forward declaration is only needed for iSereis compiles */
85#define DECREMENTER_COUNT_601 (1000000000 / HZ) 128void __init clocksource_init(void);
129#endif
86 130
87#define XSEC_PER_SEC (1024*1024) 131#define XSEC_PER_SEC (1024*1024)
88 132
@@ -349,98 +393,6 @@ void udelay(unsigned long usecs)
349} 393}
350EXPORT_SYMBOL(udelay); 394EXPORT_SYMBOL(udelay);
351 395
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 396
445/* 397/*
446 * There are two copies of tb_to_xs and stamp_xsec so that no 398 * There are two copies of tb_to_xs and stamp_xsec so that no
@@ -486,56 +438,6 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec,
486 ++(vdso_data->tb_update_count); 438 ++(vdso_data->tb_update_count);
487} 439}
488 440
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 441#ifdef CONFIG_SMP
540unsigned long profile_pc(struct pt_regs *regs) 442unsigned long profile_pc(struct pt_regs *regs)
541{ 443{
@@ -607,6 +509,8 @@ static int __init iSeries_tb_recal(void)
607 iSeries_recal_titan = titan; 509 iSeries_recal_titan = titan;
608 iSeries_recal_tb = tb; 510 iSeries_recal_tb = tb;
609 511
512 /* Called here as now we know accurate values for the timebase */
513 clocksource_init();
610 return 0; 514 return 0;
611} 515}
612late_initcall(iSeries_tb_recal); 516late_initcall(iSeries_tb_recal);
@@ -636,20 +540,30 @@ void __init iSeries_time_init_early(void)
636void timer_interrupt(struct pt_regs * regs) 540void timer_interrupt(struct pt_regs * regs)
637{ 541{
638 struct pt_regs *old_regs; 542 struct pt_regs *old_regs;
639 int next_dec;
640 int cpu = smp_processor_id(); 543 int cpu = smp_processor_id();
641 unsigned long ticks; 544 struct clock_event_device *evt = &per_cpu(decrementers, cpu);
642 u64 tb_next_jiffy; 545 u64 now;
546
547 /* Ensure a positive value is written to the decrementer, or else
548 * some CPUs will continuue to take decrementer exceptions */
549 set_dec(DECREMENTER_MAX);
643 550
644#ifdef CONFIG_PPC32 551#ifdef CONFIG_PPC32
645 if (atomic_read(&ppc_n_lost_interrupts) != 0) 552 if (atomic_read(&ppc_n_lost_interrupts) != 0)
646 do_IRQ(regs); 553 do_IRQ(regs);
647#endif 554#endif
648 555
556 now = get_tb_or_rtc();
557 if (now < per_cpu(decrementer_next_tb, cpu)) {
558 /* not time for this event yet */
559 now = per_cpu(decrementer_next_tb, cpu) - now;
560 if (now <= DECREMENTER_MAX)
561 set_dec((unsigned int)now - 1);
562 return;
563 }
649 old_regs = set_irq_regs(regs); 564 old_regs = set_irq_regs(regs);
650 irq_enter(); 565 irq_enter();
651 566
652 profile_tick(CPU_PROFILING);
653 calculate_steal_time(); 567 calculate_steal_time();
654 568
655#ifdef CONFIG_PPC_ISERIES 569#ifdef CONFIG_PPC_ISERIES
@@ -657,46 +571,20 @@ void timer_interrupt(struct pt_regs * regs)
657 get_lppaca()->int_dword.fields.decr_int = 0; 571 get_lppaca()->int_dword.fields.decr_int = 0;
658#endif 572#endif
659 573
660 while ((ticks = tb_ticks_since(per_cpu(last_jiffy, cpu))) 574 /*
661 >= tb_ticks_per_jiffy) { 575 * We cannot disable the decrementer, so in the period
662 /* Update last_jiffy */ 576 * between this cpu's being marked offline in cpu_online_map
663 per_cpu(last_jiffy, cpu) += tb_ticks_per_jiffy; 577 * and calling stop-self, it is taking timer interrupts.
664 /* Handle RTCL overflow on 601 */ 578 * Avoid calling into the scheduler rebalancing code if this
665 if (__USE_RTC() && per_cpu(last_jiffy, cpu) >= 1000000000) 579 * is the case.
666 per_cpu(last_jiffy, cpu) -= 1000000000; 580 */
667 581 if (!cpu_is_offline(cpu))
668 /* 582 account_process_time(regs);
669 * We cannot disable the decrementer, so in the period
670 * between this cpu's being marked offline in cpu_online_map
671 * and calling stop-self, it is taking timer interrupts.
672 * Avoid calling into the scheduler rebalancing code if this
673 * is the case.
674 */
675 if (!cpu_is_offline(cpu))
676 account_process_time(regs);
677
678 /*
679 * No need to check whether cpu is offline here; boot_cpuid
680 * should have been fixed up by now.
681 */
682 if (cpu != boot_cpuid)
683 continue;
684 583
685 write_seqlock(&xtime_lock); 584 if (evt->event_handler)
686 tb_next_jiffy = tb_last_jiffy + tb_ticks_per_jiffy; 585 evt->event_handler(evt);
687 if (__USE_RTC() && tb_next_jiffy >= 1000000000) 586 else
688 tb_next_jiffy -= 1000000000; 587 evt->set_next_event(DECREMENTER_MAX, evt);
689 if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) {
690 tb_last_jiffy = tb_next_jiffy;
691 do_timer(1);
692 timer_recalc_offset(tb_last_jiffy);
693 timer_check_rtc();
694 }
695 write_sequnlock(&xtime_lock);
696 }
697
698 next_dec = tb_ticks_per_jiffy - ticks;
699 set_dec(next_dec);
700 588
701#ifdef CONFIG_PPC_ISERIES 589#ifdef CONFIG_PPC_ISERIES
702 if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending()) 590 if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending())
@@ -762,71 +650,6 @@ unsigned long long sched_clock(void)
762 return mulhdu(get_tb() - boot_tb, tb_to_ns_scale) << tb_to_ns_shift; 650 return mulhdu(get_tb() - boot_tb, tb_to_ns_scale) << tb_to_ns_shift;
763} 651}
764 652
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) 653static int __init get_freq(char *name, int cells, unsigned long *val)
831{ 654{
832 struct device_node *cpu; 655 struct device_node *cpu;
@@ -869,7 +692,7 @@ void __init generic_calibrate_decr(void)
869 "(not found)\n"); 692 "(not found)\n");
870 } 693 }
871 694
872#ifdef CONFIG_BOOKE 695#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
873 /* Set the time base to zero */ 696 /* Set the time base to zero */
874 mtspr(SPRN_TBWL, 0); 697 mtspr(SPRN_TBWL, 0);
875 mtspr(SPRN_TBWU, 0); 698 mtspr(SPRN_TBWU, 0);
@@ -882,12 +705,35 @@ void __init generic_calibrate_decr(void)
882#endif 705#endif
883} 706}
884 707
885unsigned long get_boot_time(void) 708int update_persistent_clock(struct timespec now)
886{ 709{
887 struct rtc_time tm; 710 struct rtc_time tm;
888 711
889 if (ppc_md.get_boot_time) 712 if (!ppc_md.set_rtc_time)
890 return ppc_md.get_boot_time(); 713 return 0;
714
715 to_tm(now.tv_sec + 1 + timezone_offset, &tm);
716 tm.tm_year -= 1900;
717 tm.tm_mon -= 1;
718
719 return ppc_md.set_rtc_time(&tm);
720}
721
722unsigned long read_persistent_clock(void)
723{
724 struct rtc_time tm;
725 static int first = 1;
726
727 /* XXX this is a litle fragile but will work okay in the short term */
728 if (first) {
729 first = 0;
730 if (ppc_md.time_init)
731 timezone_offset = ppc_md.time_init();
732
733 /* get_boot_time() isn't guaranteed to be safe to call late */
734 if (ppc_md.get_boot_time)
735 return ppc_md.get_boot_time() -timezone_offset;
736 }
891 if (!ppc_md.get_rtc_time) 737 if (!ppc_md.get_rtc_time)
892 return 0; 738 return 0;
893 ppc_md.get_rtc_time(&tm); 739 ppc_md.get_rtc_time(&tm);
@@ -895,18 +741,128 @@ unsigned long get_boot_time(void)
895 tm.tm_hour, tm.tm_min, tm.tm_sec); 741 tm.tm_hour, tm.tm_min, tm.tm_sec);
896} 742}
897 743
744/* clocksource code */
745static cycle_t rtc_read(void)
746{
747 return (cycle_t)get_rtc();
748}
749
750static cycle_t timebase_read(void)
751{
752 return (cycle_t)get_tb();
753}
754
755void update_vsyscall(struct timespec *wall_time, struct clocksource *clock)
756{
757 u64 t2x, stamp_xsec;
758
759 if (clock != &clocksource_timebase)
760 return;
761
762 /* Make userspace gettimeofday spin until we're done. */
763 ++vdso_data->tb_update_count;
764 smp_mb();
765
766 /* XXX this assumes clock->shift == 22 */
767 /* 4611686018 ~= 2^(20+64-22) / 1e9 */
768 t2x = (u64) clock->mult * 4611686018ULL;
769 stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC;
770 do_div(stamp_xsec, 1000000000);
771 stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC;
772 update_gtod(clock->cycle_last, stamp_xsec, t2x);
773}
774
775void update_vsyscall_tz(void)
776{
777 /* Make userspace gettimeofday spin until we're done. */
778 ++vdso_data->tb_update_count;
779 smp_mb();
780 vdso_data->tz_minuteswest = sys_tz.tz_minuteswest;
781 vdso_data->tz_dsttime = sys_tz.tz_dsttime;
782 smp_mb();
783 ++vdso_data->tb_update_count;
784}
785
786void __init clocksource_init(void)
787{
788 struct clocksource *clock;
789
790 if (__USE_RTC())
791 clock = &clocksource_rtc;
792 else
793 clock = &clocksource_timebase;
794
795 clock->mult = clocksource_hz2mult(tb_ticks_per_sec, clock->shift);
796
797 if (clocksource_register(clock)) {
798 printk(KERN_ERR "clocksource: %s is already registered\n",
799 clock->name);
800 return;
801 }
802
803 printk(KERN_INFO "clocksource: %s mult[%x] shift[%d] registered\n",
804 clock->name, clock->mult, clock->shift);
805}
806
807static int decrementer_set_next_event(unsigned long evt,
808 struct clock_event_device *dev)
809{
810 __get_cpu_var(decrementer_next_tb) = get_tb_or_rtc() + evt;
811 /* The decrementer interrupts on the 0 -> -1 transition */
812 if (evt)
813 --evt;
814 set_dec(evt);
815 return 0;
816}
817
818static void decrementer_set_mode(enum clock_event_mode mode,
819 struct clock_event_device *dev)
820{
821 if (mode != CLOCK_EVT_MODE_ONESHOT)
822 decrementer_set_next_event(DECREMENTER_MAX, dev);
823}
824
825static void register_decrementer_clockevent(int cpu)
826{
827 struct clock_event_device *dec = &per_cpu(decrementers, cpu);
828
829 *dec = decrementer_clockevent;
830 dec->cpumask = cpumask_of_cpu(cpu);
831
832 printk(KERN_ERR "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n",
833 dec->name, dec->mult, dec->shift, cpu);
834
835 clockevents_register_device(dec);
836}
837
838void init_decrementer_clockevent(void)
839{
840 int cpu = smp_processor_id();
841
842 decrementer_clockevent.mult = div_sc(ppc_tb_freq, NSEC_PER_SEC,
843 decrementer_clockevent.shift);
844 decrementer_clockevent.max_delta_ns =
845 clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent);
846 decrementer_clockevent.min_delta_ns = 1000;
847
848 register_decrementer_clockevent(cpu);
849}
850
851void secondary_cpu_time_init(void)
852{
853 /* FIME: Should make unrelatred change to move snapshot_timebase
854 * call here ! */
855 register_decrementer_clockevent(smp_processor_id());
856}
857
898/* This function is only called on the boot processor */ 858/* This function is only called on the boot processor */
899void __init time_init(void) 859void __init time_init(void)
900{ 860{
901 unsigned long flags; 861 unsigned long flags;
902 unsigned long tm = 0;
903 struct div_result res; 862 struct div_result res;
904 u64 scale, x; 863 u64 scale, x;
905 unsigned shift; 864 unsigned shift;
906 865
907 if (ppc_md.time_init != NULL)
908 timezone_offset = ppc_md.time_init();
909
910 if (__USE_RTC()) { 866 if (__USE_RTC()) {
911 /* 601 processor: dec counts down by 128 every 128ns */ 867 /* 601 processor: dec counts down by 128 every 128ns */
912 ppc_tb_freq = 1000000000; 868 ppc_tb_freq = 1000000000;
@@ -981,19 +937,14 @@ void __init time_init(void)
981 /* Save the current timebase to pretty up CONFIG_PRINTK_TIME */ 937 /* Save the current timebase to pretty up CONFIG_PRINTK_TIME */
982 boot_tb = get_tb_or_rtc(); 938 boot_tb = get_tb_or_rtc();
983 939
984 tm = get_boot_time();
985
986 write_seqlock_irqsave(&xtime_lock, flags); 940 write_seqlock_irqsave(&xtime_lock, flags);
987 941
988 /* If platform provided a timezone (pmac), we correct the time */ 942 /* If platform provided a timezone (pmac), we correct the time */
989 if (timezone_offset) { 943 if (timezone_offset) {
990 sys_tz.tz_minuteswest = -timezone_offset / 60; 944 sys_tz.tz_minuteswest = -timezone_offset / 60;
991 sys_tz.tz_dsttime = 0; 945 sys_tz.tz_dsttime = 0;
992 tm -= timezone_offset;
993 } 946 }
994 947
995 xtime.tv_sec = tm;
996 xtime.tv_nsec = 0;
997 do_gtod.varp = &do_gtod.vars[0]; 948 do_gtod.varp = &do_gtod.vars[0];
998 do_gtod.var_idx = 0; 949 do_gtod.var_idx = 0;
999 do_gtod.varp->tb_orig_stamp = tb_last_jiffy; 950 do_gtod.varp->tb_orig_stamp = tb_last_jiffy;
@@ -1011,13 +962,13 @@ void __init time_init(void)
1011 962
1012 time_freq = 0; 963 time_freq = 0;
1013 964
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); 965 write_sequnlock_irqrestore(&xtime_lock, flags);
1018 966
1019 /* Not exact, but the timer interrupt takes care of this */ 967 /* Register the clocksource, if we're not running on iSeries */
1020 set_dec(tb_ticks_per_jiffy); 968 if (!firmware_has_feature(FW_FEATURE_ISERIES))
969 clocksource_init();
970
971 init_decrementer_clockevent();
1021} 972}
1022 973
1023 974
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index d8502e377518..bf9e39c6e296 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -172,11 +172,21 @@ int die(const char *str, struct pt_regs *regs, long err)
172void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) 172void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
173{ 173{
174 siginfo_t info; 174 siginfo_t info;
175 const char fmt32[] = KERN_INFO "%s[%d]: unhandled signal %d " \
176 "at %08lx nip %08lx lr %08lx code %x\n";
177 const char fmt64[] = KERN_INFO "%s[%d]: unhandled signal %d " \
178 "at %016lx nip %016lx lr %016lx code %x\n";
175 179
176 if (!user_mode(regs)) { 180 if (!user_mode(regs)) {
177 if (die("Exception in kernel mode", regs, signr)) 181 if (die("Exception in kernel mode", regs, signr))
178 return; 182 return;
179 } 183 } else if (show_unhandled_signals &&
184 unhandled_signal(current, signr) &&
185 printk_ratelimit()) {
186 printk(regs->msr & MSR_SF ? fmt64 : fmt32,
187 current->comm, current->pid, signr,
188 addr, regs->nip, regs->link, code);
189 }
180 190
181 memset(&info, 0, sizeof(info)); 191 memset(&info, 0, sizeof(info));
182 info.si_signo = signr; 192 info.si_signo = signr;
@@ -324,47 +334,10 @@ static inline int check_io_access(struct pt_regs *regs)
324#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE) 334#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
325#endif 335#endif
326 336
327/* 337static 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{
334}
335
336void machine_check_exception(struct pt_regs *regs)
337{ 338{
338 int recover = 0;
339 unsigned long reason = get_mc_reason(regs); 339 unsigned long reason = get_mc_reason(regs);
340 340
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) 341#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
369 if (reason & ESR_IMCP) { 342 if (reason & ESR_IMCP) {
370 printk("Instruction"); 343 printk("Instruction");
@@ -480,11 +453,41 @@ void machine_check_exception(struct pt_regs *regs)
480 } 453 }
481#endif /* CONFIG_4xx */ 454#endif /* CONFIG_4xx */
482 455
483 /* 456 return 0;
484 * Optional platform-provided routine to print out 457}
485 * additional info, e.g. bus error registers. 458
486 */ 459void machine_check_exception(struct pt_regs *regs)
487 platform_machine_check(regs); 460{
461 int recover = 0;
462
463 /* See if any machine dependent calls */
464 if (ppc_md.machine_check_exception)
465 recover = ppc_md.machine_check_exception(regs);
466 else
467 recover = generic_machine_check_exception(regs);
468
469 if (recover)
470 return;
471
472 if (user_mode(regs)) {
473 regs->msr |= MSR_RI;
474 _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
475 return;
476 }
477
478#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
479 /* the qspan pci read routines can cause machine checks -- Cort */
480 bad_page_fault(regs, regs->dar, SIGBUS);
481 return;
482#endif
483
484 if (debugger_fault_handler(regs)) {
485 regs->msr |= MSR_RI;
486 return;
487 }
488
489 if (check_io_access(regs))
490 return;
488 491
489 if (debugger_fault_handler(regs)) 492 if (debugger_fault_handler(regs))
490 return; 493 return;
@@ -913,7 +916,9 @@ void SoftwareEmulation(struct pt_regs *regs)
913{ 916{
914 extern int do_mathemu(struct pt_regs *); 917 extern int do_mathemu(struct pt_regs *);
915 extern int Soft_emulate_8xx(struct pt_regs *); 918 extern int Soft_emulate_8xx(struct pt_regs *);
919#if defined(CONFIG_MATH_EMULATION) || defined(CONFIG_8XX_MINIMAL_FPEMU)
916 int errcode; 920 int errcode;
921#endif
917 922
918 CHECK_FULL_REGS(regs); 923 CHECK_FULL_REGS(regs);
919 924
@@ -943,7 +948,7 @@ void SoftwareEmulation(struct pt_regs *regs)
943 return; 948 return;
944 } 949 }
945 950
946#else 951#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
947 errcode = Soft_emulate_8xx(regs); 952 errcode = Soft_emulate_8xx(regs);
948 switch (errcode) { 953 switch (errcode) {
949 case 0: 954 case 0:
@@ -956,6 +961,8 @@ void SoftwareEmulation(struct pt_regs *regs)
956 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip); 961 _exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
957 return; 962 return;
958 } 963 }
964#else
965 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
959#endif 966#endif
960} 967}
961#endif /* CONFIG_8xx */ 968#endif /* CONFIG_8xx */
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index 0f9b4eadfbcb..d723070c9a33 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -54,6 +54,8 @@ void __init udbg_early_init(void)
54#elif defined(CONFIG_PPC_EARLY_DEBUG_44x) 54#elif defined(CONFIG_PPC_EARLY_DEBUG_44x)
55 /* PPC44x debug */ 55 /* PPC44x debug */
56 udbg_init_44x_as1(); 56 udbg_init_44x_as1();
57#elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)
58 udbg_init_cpm();
57#endif 59#endif
58} 60}
59 61
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/vdso.c b/arch/powerpc/kernel/vdso.c
index 213fa31ac537..2322ba5cce4c 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -766,7 +766,9 @@ static int __init vdso_init(void)
766 766
767 return 0; 767 return 0;
768} 768}
769#ifdef CONFIG_PPC_MERGE
769arch_initcall(vdso_init); 770arch_initcall(vdso_init);
771#endif
770 772
771int in_gate_area_no_task(unsigned long addr) 773int in_gate_area_no_task(unsigned long addr)
772{ 774{
diff --git a/arch/powerpc/kernel/vdso32/.gitignore b/arch/powerpc/kernel/vdso32/.gitignore
index e45fba9d0ced..fea5809857a5 100644
--- a/arch/powerpc/kernel/vdso32/.gitignore
+++ b/arch/powerpc/kernel/vdso32/.gitignore
@@ -1 +1,2 @@
1vdso32.lds 1vdso32.lds
2vdso32.so.dbg
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/.gitignore b/arch/powerpc/kernel/vdso64/.gitignore
index 3fd18cf9fec2..77a0b423642c 100644
--- a/arch/powerpc/kernel/vdso64/.gitignore
+++ b/arch/powerpc/kernel/vdso64/.gitignore
@@ -1 +1,2 @@
1vdso64.lds 1vdso64.lds
2vdso64.so.dbg
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..cb22a3557c4e 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 = "",
@@ -46,60 +48,33 @@ static struct vio_dev vio_bus_device = { /* fake "parent" device */
46 .dev.bus = &vio_bus_type, 48 .dev.bus = &vio_bus_type,
47}; 49};
48 50
49#ifdef CONFIG_PPC_ISERIES 51static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
50struct device *iSeries_vio_dev = &vio_bus_device.dev; 52{
51EXPORT_SYMBOL(iSeries_vio_dev); 53 const unsigned char *dma_window;
54 struct iommu_table *tbl;
55 unsigned long offset, size;
52 56
53static struct iommu_table veth_iommu_table; 57 if (firmware_has_feature(FW_FEATURE_ISERIES))
54static struct iommu_table vio_iommu_table; 58 return vio_build_iommu_table_iseries(dev);
55 59
56static void __init iommu_vio_init(void) 60 dma_window = of_get_property(dev->dev.archdata.of_node,
57{ 61 "ibm,my-dma-window", NULL);
58 iommu_table_getparms_iSeries(255, 0, 0xff, &veth_iommu_table); 62 if (!dma_window)
59 veth_iommu_table.it_size /= 2; 63 return NULL;
60 vio_iommu_table = veth_iommu_table;
61 vio_iommu_table.it_offset += veth_iommu_table.it_size;
62
63 if (!iommu_init_table(&veth_iommu_table, -1))
64 printk("Virtual Bus VETH TCE table failed.\n");
65 if (!iommu_init_table(&vio_iommu_table, -1))
66 printk("Virtual Bus VIO TCE table failed.\n");
67}
68#endif
69 64
70static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev) 65 tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);
71{ 66
72#ifdef CONFIG_PPC_ISERIES 67 of_parse_dma_window(dev->dev.archdata.of_node, dma_window,
73 if (firmware_has_feature(FW_FEATURE_ISERIES)) { 68 &tbl->it_index, &offset, &size);
74 if (strcmp(dev->type, "network") == 0) 69
75 return &veth_iommu_table; 70 /* TCE table size - measured in tce entries */
76 return &vio_iommu_table; 71 tbl->it_size = size >> IOMMU_PAGE_SHIFT;
77 } else 72 /* offset for VIO should always be 0 */
78#endif 73 tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
79 { 74 tbl->it_busno = 0;
80 const unsigned char *dma_window; 75 tbl->it_type = TCE_VB;
81 struct iommu_table *tbl; 76
82 unsigned long offset, size; 77 return iommu_init_table(tbl, -1);
83
84 dma_window = of_get_property(dev->dev.archdata.of_node,
85 "ibm,my-dma-window", NULL);
86 if (!dma_window)
87 return NULL;
88
89 tbl = kmalloc(sizeof(*tbl), GFP_KERNEL);
90
91 of_parse_dma_window(dev->dev.archdata.of_node, dma_window,
92 &tbl->it_index, &offset, &size);
93
94 /* TCE table size - measured in tce entries */
95 tbl->it_size = size >> IOMMU_PAGE_SHIFT;
96 /* offset for VIO should always be 0 */
97 tbl->it_offset = offset >> IOMMU_PAGE_SHIFT;
98 tbl->it_busno = 0;
99 tbl->it_type = TCE_VB;
100
101 return iommu_init_table(tbl, -1);
102 }
103} 78}
104 79
105/** 80/**
@@ -160,16 +135,6 @@ static int vio_bus_remove(struct device *dev)
160 return 1; 135 return 1;
161} 136}
162 137
163/* convert from struct device to struct vio_dev and pass to driver. */
164static void vio_bus_shutdown(struct device *dev)
165{
166 struct vio_dev *viodev = to_vio_dev(dev);
167 struct vio_driver *viodrv = to_vio_driver(dev->driver);
168
169 if (dev->driver && viodrv->shutdown)
170 viodrv->shutdown(viodev);
171}
172
173/** 138/**
174 * vio_register_driver: - Register a new vio driver 139 * vio_register_driver: - Register a new vio driver
175 * @drv: The vio_driver structure to be registered. 140 * @drv: The vio_driver structure to be registered.
@@ -282,15 +247,6 @@ static int __init vio_bus_init(void)
282 int err; 247 int err;
283 struct device_node *node_vroot; 248 struct device_node *node_vroot;
284 249
285#ifdef CONFIG_PPC_ISERIES
286 if (firmware_has_feature(FW_FEATURE_ISERIES)) {
287 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
294 err = bus_register(&vio_bus_type); 250 err = bus_register(&vio_bus_type);
295 if (err) { 251 if (err) {
296 printk(KERN_ERR "failed to register VIO bus\n"); 252 printk(KERN_ERR "failed to register VIO bus\n");
@@ -317,11 +273,8 @@ static int __init vio_bus_init(void)
317 * the device tree. Drivers will associate with them later. 273 * the device tree. Drivers will associate with them later.
318 */ 274 */
319 for (of_node = node_vroot->child; of_node != NULL; 275 for (of_node = node_vroot->child; of_node != NULL;
320 of_node = of_node->sibling) { 276 of_node = of_node->sibling)
321 printk(KERN_DEBUG "%s: processing %p\n",
322 __FUNCTION__, of_node);
323 vio_register_device_node(of_node); 277 vio_register_device_node(of_node);
324 }
325 of_node_put(node_vroot); 278 of_node_put(node_vroot);
326 } 279 }
327 280
@@ -391,14 +344,13 @@ static int vio_hotplug(struct device *dev, char **envp, int num_envp,
391 return 0; 344 return 0;
392} 345}
393 346
394struct bus_type vio_bus_type = { 347static struct bus_type vio_bus_type = {
395 .name = "vio", 348 .name = "vio",
396 .dev_attrs = vio_dev_attrs, 349 .dev_attrs = vio_dev_attrs,
397 .uevent = vio_hotplug, 350 .uevent = vio_hotplug,
398 .match = vio_bus_match, 351 .match = vio_bus_match,
399 .probe = vio_bus_probe, 352 .probe = vio_bus_probe,
400 .remove = vio_bus_remove, 353 .remove = vio_bus_remove,
401 .shutdown = vio_bus_shutdown,
402}; 354};
403 355
404/** 356/**
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/fsl_booke_mmu.c b/arch/powerpc/mm/fsl_booke_mmu.c
index afab247d472f..17139daeaff4 100644
--- a/arch/powerpc/mm/fsl_booke_mmu.c
+++ b/arch/powerpc/mm/fsl_booke_mmu.c
@@ -59,6 +59,7 @@ unsigned int num_tlbcam_entries;
59static unsigned long __cam0, __cam1, __cam2; 59static unsigned long __cam0, __cam1, __cam2;
60extern unsigned long total_lowmem; 60extern unsigned long total_lowmem;
61extern unsigned long __max_low_memory; 61extern unsigned long __max_low_memory;
62extern unsigned long __initial_memory_limit;
62#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE 63#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE
63 64
64#define NUM_TLBCAMS (16) 65#define NUM_TLBCAMS (16)
@@ -232,4 +233,5 @@ adjust_total_lowmem(void)
232 __cam0 >> 20, __cam1 >> 20, __cam2 >> 20, 233 __cam0 >> 20, __cam1 >> 20, __cam2 >> 20,
233 (total_lowmem - __cam0 - __cam1 - __cam2) >> 20); 234 (total_lowmem - __cam0 - __cam1 - __cam2) >> 20);
234 __max_low_memory = max_low_mem = __cam0 + __cam1 + __cam2; 235 __max_low_memory = max_low_mem = __cam0 + __cam1 + __cam2;
236 __initial_memory_limit = __max_low_memory;
235} 237}
diff --git a/arch/powerpc/mm/hash_low_64.S b/arch/powerpc/mm/hash_low_64.S
index 35eabfb50723..ad253b959030 100644
--- a/arch/powerpc/mm/hash_low_64.S
+++ b/arch/powerpc/mm/hash_low_64.S
@@ -54,7 +54,7 @@
54 54
55/* 55/*
56 * _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid, 56 * _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
57 * pte_t *ptep, unsigned long trap, int local) 57 * pte_t *ptep, unsigned long trap, int local, int ssize)
58 * 58 *
59 * Adds a 4K page to the hash table in a segment of 4K pages only 59 * Adds a 4K page to the hash table in a segment of 4K pages only
60 */ 60 */
@@ -66,6 +66,7 @@ _GLOBAL(__hash_page_4K)
66 /* Save all params that we need after a function call */ 66 /* Save all params that we need after a function call */
67 std r6,STK_PARM(r6)(r1) 67 std r6,STK_PARM(r6)(r1)
68 std r8,STK_PARM(r8)(r1) 68 std r8,STK_PARM(r8)(r1)
69 std r9,STK_PARM(r9)(r1)
69 70
70 /* Add _PAGE_PRESENT to access */ 71 /* Add _PAGE_PRESENT to access */
71 ori r4,r4,_PAGE_PRESENT 72 ori r4,r4,_PAGE_PRESENT
@@ -117,6 +118,10 @@ _GLOBAL(__hash_page_4K)
117 * r4 (access) is re-useable, we use it for the new HPTE flags 118 * r4 (access) is re-useable, we use it for the new HPTE flags
118 */ 119 */
119 120
121BEGIN_FTR_SECTION
122 cmpdi r9,0 /* check segment size */
123 bne 3f
124END_FTR_SECTION_IFSET(CPU_FTR_1T_SEGMENT)
120 /* Calc va and put it in r29 */ 125 /* Calc va and put it in r29 */
121 rldicr r29,r5,28,63-28 126 rldicr r29,r5,28,63-28
122 rldicl r3,r3,0,36 127 rldicl r3,r3,0,36
@@ -126,9 +131,20 @@ _GLOBAL(__hash_page_4K)
126 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */ 131 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */
127 rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */ 132 rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */
128 xor r28,r5,r0 133 xor r28,r5,r0
134 b 4f
135
1363: /* Calc VA and hash in r29 and r28 for 1T segment */
137 sldi r29,r5,40 /* vsid << 40 */
138 clrldi r3,r3,24 /* ea & 0xffffffffff */
139 rldic r28,r5,25,25 /* (vsid << 25) & 0x7fffffffff */
140 clrldi r5,r5,40 /* vsid & 0xffffff */
141 rldicl r0,r3,64-12,36 /* (ea >> 12) & 0xfffffff */
142 xor r28,r28,r5
143 or r29,r3,r29 /* VA */
144 xor r28,r28,r0 /* hash */
129 145
130 /* Convert linux PTE bits into HW equivalents */ 146 /* Convert linux PTE bits into HW equivalents */
131 andi. r3,r30,0x1fe /* Get basic set of flags */ 1474: andi. r3,r30,0x1fe /* Get basic set of flags */
132 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */ 148 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */
133 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */ 149 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
134 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */ 150 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */
@@ -183,6 +199,7 @@ htab_insert_pte:
183 mr r4,r29 /* Retreive va */ 199 mr r4,r29 /* Retreive va */
184 li r7,0 /* !bolted, !secondary */ 200 li r7,0 /* !bolted, !secondary */
185 li r8,MMU_PAGE_4K /* page size */ 201 li r8,MMU_PAGE_4K /* page size */
202 ld r9,STK_PARM(r9)(r1) /* segment size */
186_GLOBAL(htab_call_hpte_insert1) 203_GLOBAL(htab_call_hpte_insert1)
187 bl . /* Patched by htab_finish_init() */ 204 bl . /* Patched by htab_finish_init() */
188 cmpdi 0,r3,0 205 cmpdi 0,r3,0
@@ -205,6 +222,7 @@ _GLOBAL(htab_call_hpte_insert1)
205 mr r4,r29 /* Retreive va */ 222 mr r4,r29 /* Retreive va */
206 li r7,HPTE_V_SECONDARY /* !bolted, secondary */ 223 li r7,HPTE_V_SECONDARY /* !bolted, secondary */
207 li r8,MMU_PAGE_4K /* page size */ 224 li r8,MMU_PAGE_4K /* page size */
225 ld r9,STK_PARM(r9)(r1) /* segment size */
208_GLOBAL(htab_call_hpte_insert2) 226_GLOBAL(htab_call_hpte_insert2)
209 bl . /* Patched by htab_finish_init() */ 227 bl . /* Patched by htab_finish_init() */
210 cmpdi 0,r3,0 228 cmpdi 0,r3,0
@@ -273,7 +291,8 @@ htab_modify_pte:
273 /* Call ppc_md.hpte_updatepp */ 291 /* Call ppc_md.hpte_updatepp */
274 mr r5,r29 /* va */ 292 mr r5,r29 /* va */
275 li r6,MMU_PAGE_4K /* page size */ 293 li r6,MMU_PAGE_4K /* page size */
276 ld r7,STK_PARM(r8)(r1) /* get "local" param */ 294 ld r7,STK_PARM(r9)(r1) /* segment size */
295 ld r8,STK_PARM(r8)(r1) /* get "local" param */
277_GLOBAL(htab_call_hpte_updatepp) 296_GLOBAL(htab_call_hpte_updatepp)
278 bl . /* Patched by htab_finish_init() */ 297 bl . /* Patched by htab_finish_init() */
279 298
@@ -325,6 +344,7 @@ _GLOBAL(__hash_page_4K)
325 /* Save all params that we need after a function call */ 344 /* Save all params that we need after a function call */
326 std r6,STK_PARM(r6)(r1) 345 std r6,STK_PARM(r6)(r1)
327 std r8,STK_PARM(r8)(r1) 346 std r8,STK_PARM(r8)(r1)
347 std r9,STK_PARM(r9)(r1)
328 348
329 /* Add _PAGE_PRESENT to access */ 349 /* Add _PAGE_PRESENT to access */
330 ori r4,r4,_PAGE_PRESENT 350 ori r4,r4,_PAGE_PRESENT
@@ -383,18 +403,33 @@ _GLOBAL(__hash_page_4K)
383 /* Load the hidx index */ 403 /* Load the hidx index */
384 rldicl r25,r3,64-12,60 404 rldicl r25,r3,64-12,60
385 405
406BEGIN_FTR_SECTION
407 cmpdi r9,0 /* check segment size */
408 bne 3f
409END_FTR_SECTION_IFSET(CPU_FTR_1T_SEGMENT)
386 /* Calc va and put it in r29 */ 410 /* Calc va and put it in r29 */
387 rldicr r29,r5,28,63-28 /* r29 = (vsid << 28) */ 411 rldicr r29,r5,28,63-28 /* r29 = (vsid << 28) */
388 rldicl r3,r3,0,36 /* r3 = (ea & 0x0fffffff) */ 412 rldicl r3,r3,0,36 /* r3 = (ea & 0x0fffffff) */
389 or r29,r3,r29 /* r29 = va 413 or r29,r3,r29 /* r29 = va */
390 414
391 /* Calculate hash value for primary slot and store it in r28 */ 415 /* Calculate hash value for primary slot and store it in r28 */
392 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */ 416 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */
393 rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */ 417 rldicl r0,r3,64-12,48 /* (ea >> 12) & 0xffff */
394 xor r28,r5,r0 418 xor r28,r5,r0
419 b 4f
420
4213: /* Calc VA and hash in r29 and r28 for 1T segment */
422 sldi r29,r5,40 /* vsid << 40 */
423 clrldi r3,r3,24 /* ea & 0xffffffffff */
424 rldic r28,r5,25,25 /* (vsid << 25) & 0x7fffffffff */
425 clrldi r5,r5,40 /* vsid & 0xffffff */
426 rldicl r0,r3,64-12,36 /* (ea >> 12) & 0xfffffff */
427 xor r28,r28,r5
428 or r29,r3,r29 /* VA */
429 xor r28,r28,r0 /* hash */
395 430
396 /* Convert linux PTE bits into HW equivalents */ 431 /* Convert linux PTE bits into HW equivalents */
397 andi. r3,r30,0x1fe /* Get basic set of flags */ 4324: andi. r3,r30,0x1fe /* Get basic set of flags */
398 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */ 433 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */
399 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */ 434 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
400 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */ 435 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */
@@ -462,6 +497,7 @@ htab_special_pfn:
462 mr r4,r29 /* Retreive va */ 497 mr r4,r29 /* Retreive va */
463 li r7,0 /* !bolted, !secondary */ 498 li r7,0 /* !bolted, !secondary */
464 li r8,MMU_PAGE_4K /* page size */ 499 li r8,MMU_PAGE_4K /* page size */
500 ld r9,STK_PARM(r9)(r1) /* segment size */
465_GLOBAL(htab_call_hpte_insert1) 501_GLOBAL(htab_call_hpte_insert1)
466 bl . /* patched by htab_finish_init() */ 502 bl . /* patched by htab_finish_init() */
467 cmpdi 0,r3,0 503 cmpdi 0,r3,0
@@ -488,6 +524,7 @@ _GLOBAL(htab_call_hpte_insert1)
488 mr r4,r29 /* Retreive va */ 524 mr r4,r29 /* Retreive va */
489 li r7,HPTE_V_SECONDARY /* !bolted, secondary */ 525 li r7,HPTE_V_SECONDARY /* !bolted, secondary */
490 li r8,MMU_PAGE_4K /* page size */ 526 li r8,MMU_PAGE_4K /* page size */
527 ld r9,STK_PARM(r9)(r1) /* segment size */
491_GLOBAL(htab_call_hpte_insert2) 528_GLOBAL(htab_call_hpte_insert2)
492 bl . /* patched by htab_finish_init() */ 529 bl . /* patched by htab_finish_init() */
493 cmpdi 0,r3,0 530 cmpdi 0,r3,0
@@ -586,7 +623,8 @@ htab_modify_pte:
586 /* Call ppc_md.hpte_updatepp */ 623 /* Call ppc_md.hpte_updatepp */
587 mr r5,r29 /* va */ 624 mr r5,r29 /* va */
588 li r6,MMU_PAGE_4K /* page size */ 625 li r6,MMU_PAGE_4K /* page size */
589 ld r7,STK_PARM(r8)(r1) /* get "local" param */ 626 ld r7,STK_PARM(r9)(r1) /* segment size */
627 ld r8,STK_PARM(r8)(r1) /* get "local" param */
590_GLOBAL(htab_call_hpte_updatepp) 628_GLOBAL(htab_call_hpte_updatepp)
591 bl . /* patched by htab_finish_init() */ 629 bl . /* patched by htab_finish_init() */
592 630
@@ -634,6 +672,7 @@ _GLOBAL(__hash_page_64K)
634 /* Save all params that we need after a function call */ 672 /* Save all params that we need after a function call */
635 std r6,STK_PARM(r6)(r1) 673 std r6,STK_PARM(r6)(r1)
636 std r8,STK_PARM(r8)(r1) 674 std r8,STK_PARM(r8)(r1)
675 std r9,STK_PARM(r9)(r1)
637 676
638 /* Add _PAGE_PRESENT to access */ 677 /* Add _PAGE_PRESENT to access */
639 ori r4,r4,_PAGE_PRESENT 678 ori r4,r4,_PAGE_PRESENT
@@ -690,6 +729,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CI_LARGE_PAGE)
690 * r4 (access) is re-useable, we use it for the new HPTE flags 729 * r4 (access) is re-useable, we use it for the new HPTE flags
691 */ 730 */
692 731
732BEGIN_FTR_SECTION
733 cmpdi r9,0 /* check segment size */
734 bne 3f
735END_FTR_SECTION_IFSET(CPU_FTR_1T_SEGMENT)
693 /* Calc va and put it in r29 */ 736 /* Calc va and put it in r29 */
694 rldicr r29,r5,28,63-28 737 rldicr r29,r5,28,63-28
695 rldicl r3,r3,0,36 738 rldicl r3,r3,0,36
@@ -699,9 +742,20 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CI_LARGE_PAGE)
699 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */ 742 rldicl r5,r5,0,25 /* vsid & 0x0000007fffffffff */
700 rldicl r0,r3,64-16,52 /* (ea >> 16) & 0xfff */ 743 rldicl r0,r3,64-16,52 /* (ea >> 16) & 0xfff */
701 xor r28,r5,r0 744 xor r28,r5,r0
745 b 4f
746
7473: /* Calc VA and hash in r29 and r28 for 1T segment */
748 sldi r29,r5,40 /* vsid << 40 */
749 clrldi r3,r3,24 /* ea & 0xffffffffff */
750 rldic r28,r5,25,25 /* (vsid << 25) & 0x7fffffffff */
751 clrldi r5,r5,40 /* vsid & 0xffffff */
752 rldicl r0,r3,64-16,40 /* (ea >> 16) & 0xffffff */
753 xor r28,r28,r5
754 or r29,r3,r29 /* VA */
755 xor r28,r28,r0 /* hash */
702 756
703 /* Convert linux PTE bits into HW equivalents */ 757 /* Convert linux PTE bits into HW equivalents */
704 andi. r3,r30,0x1fe /* Get basic set of flags */ 7584: andi. r3,r30,0x1fe /* Get basic set of flags */
705 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */ 759 xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */
706 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */ 760 rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
707 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */ 761 rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */
@@ -756,6 +810,7 @@ ht64_insert_pte:
756 mr r4,r29 /* Retreive va */ 810 mr r4,r29 /* Retreive va */
757 li r7,0 /* !bolted, !secondary */ 811 li r7,0 /* !bolted, !secondary */
758 li r8,MMU_PAGE_64K 812 li r8,MMU_PAGE_64K
813 ld r9,STK_PARM(r9)(r1) /* segment size */
759_GLOBAL(ht64_call_hpte_insert1) 814_GLOBAL(ht64_call_hpte_insert1)
760 bl . /* patched by htab_finish_init() */ 815 bl . /* patched by htab_finish_init() */
761 cmpdi 0,r3,0 816 cmpdi 0,r3,0
@@ -778,6 +833,7 @@ _GLOBAL(ht64_call_hpte_insert1)
778 mr r4,r29 /* Retreive va */ 833 mr r4,r29 /* Retreive va */
779 li r7,HPTE_V_SECONDARY /* !bolted, secondary */ 834 li r7,HPTE_V_SECONDARY /* !bolted, secondary */
780 li r8,MMU_PAGE_64K 835 li r8,MMU_PAGE_64K
836 ld r9,STK_PARM(r9)(r1) /* segment size */
781_GLOBAL(ht64_call_hpte_insert2) 837_GLOBAL(ht64_call_hpte_insert2)
782 bl . /* patched by htab_finish_init() */ 838 bl . /* patched by htab_finish_init() */
783 cmpdi 0,r3,0 839 cmpdi 0,r3,0
@@ -846,7 +902,8 @@ ht64_modify_pte:
846 /* Call ppc_md.hpte_updatepp */ 902 /* Call ppc_md.hpte_updatepp */
847 mr r5,r29 /* va */ 903 mr r5,r29 /* va */
848 li r6,MMU_PAGE_64K 904 li r6,MMU_PAGE_64K
849 ld r7,STK_PARM(r8)(r1) /* get "local" param */ 905 ld r7,STK_PARM(r9)(r1) /* segment size */
906 ld r8,STK_PARM(r8)(r1) /* get "local" param */
850_GLOBAL(ht64_call_hpte_updatepp) 907_GLOBAL(ht64_call_hpte_updatepp)
851 bl . /* patched by htab_finish_init() */ 908 bl . /* patched by htab_finish_init() */
852 909
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index 6ba9b47e55af..34e5c0b219b9 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -38,7 +38,7 @@
38 38
39static DEFINE_SPINLOCK(native_tlbie_lock); 39static DEFINE_SPINLOCK(native_tlbie_lock);
40 40
41static inline void __tlbie(unsigned long va, unsigned int psize) 41static inline void __tlbie(unsigned long va, int psize, int ssize)
42{ 42{
43 unsigned int penc; 43 unsigned int penc;
44 44
@@ -48,18 +48,20 @@ static inline void __tlbie(unsigned long va, unsigned int psize)
48 switch (psize) { 48 switch (psize) {
49 case MMU_PAGE_4K: 49 case MMU_PAGE_4K:
50 va &= ~0xffful; 50 va &= ~0xffful;
51 va |= ssize << 8;
51 asm volatile("tlbie %0,0" : : "r" (va) : "memory"); 52 asm volatile("tlbie %0,0" : : "r" (va) : "memory");
52 break; 53 break;
53 default: 54 default:
54 penc = mmu_psize_defs[psize].penc; 55 penc = mmu_psize_defs[psize].penc;
55 va &= ~((1ul << mmu_psize_defs[psize].shift) - 1); 56 va &= ~((1ul << mmu_psize_defs[psize].shift) - 1);
56 va |= penc << 12; 57 va |= penc << 12;
58 va |= ssize << 8;
57 asm volatile("tlbie %0,1" : : "r" (va) : "memory"); 59 asm volatile("tlbie %0,1" : : "r" (va) : "memory");
58 break; 60 break;
59 } 61 }
60} 62}
61 63
62static inline void __tlbiel(unsigned long va, unsigned int psize) 64static inline void __tlbiel(unsigned long va, int psize, int ssize)
63{ 65{
64 unsigned int penc; 66 unsigned int penc;
65 67
@@ -69,6 +71,7 @@ static inline void __tlbiel(unsigned long va, unsigned int psize)
69 switch (psize) { 71 switch (psize) {
70 case MMU_PAGE_4K: 72 case MMU_PAGE_4K:
71 va &= ~0xffful; 73 va &= ~0xffful;
74 va |= ssize << 8;
72 asm volatile(".long 0x7c000224 | (%0 << 11) | (0 << 21)" 75 asm volatile(".long 0x7c000224 | (%0 << 11) | (0 << 21)"
73 : : "r"(va) : "memory"); 76 : : "r"(va) : "memory");
74 break; 77 break;
@@ -76,6 +79,7 @@ static inline void __tlbiel(unsigned long va, unsigned int psize)
76 penc = mmu_psize_defs[psize].penc; 79 penc = mmu_psize_defs[psize].penc;
77 va &= ~((1ul << mmu_psize_defs[psize].shift) - 1); 80 va &= ~((1ul << mmu_psize_defs[psize].shift) - 1);
78 va |= penc << 12; 81 va |= penc << 12;
82 va |= ssize << 8;
79 asm volatile(".long 0x7c000224 | (%0 << 11) | (1 << 21)" 83 asm volatile(".long 0x7c000224 | (%0 << 11) | (1 << 21)"
80 : : "r"(va) : "memory"); 84 : : "r"(va) : "memory");
81 break; 85 break;
@@ -83,7 +87,7 @@ static inline void __tlbiel(unsigned long va, unsigned int psize)
83 87
84} 88}
85 89
86static inline void tlbie(unsigned long va, int psize, int local) 90static inline void tlbie(unsigned long va, int psize, int ssize, int local)
87{ 91{
88 unsigned int use_local = local && cpu_has_feature(CPU_FTR_TLBIEL); 92 unsigned int use_local = local && cpu_has_feature(CPU_FTR_TLBIEL);
89 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE); 93 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
@@ -94,10 +98,10 @@ static inline void tlbie(unsigned long va, int psize, int local)
94 spin_lock(&native_tlbie_lock); 98 spin_lock(&native_tlbie_lock);
95 asm volatile("ptesync": : :"memory"); 99 asm volatile("ptesync": : :"memory");
96 if (use_local) { 100 if (use_local) {
97 __tlbiel(va, psize); 101 __tlbiel(va, psize, ssize);
98 asm volatile("ptesync": : :"memory"); 102 asm volatile("ptesync": : :"memory");
99 } else { 103 } else {
100 __tlbie(va, psize); 104 __tlbie(va, psize, ssize);
101 asm volatile("eieio; tlbsync; ptesync": : :"memory"); 105 asm volatile("eieio; tlbsync; ptesync": : :"memory");
102 } 106 }
103 if (lock_tlbie && !use_local) 107 if (lock_tlbie && !use_local)
@@ -126,7 +130,7 @@ static inline void native_unlock_hpte(struct hash_pte *hptep)
126 130
127static long native_hpte_insert(unsigned long hpte_group, unsigned long va, 131static long native_hpte_insert(unsigned long hpte_group, unsigned long va,
128 unsigned long pa, unsigned long rflags, 132 unsigned long pa, unsigned long rflags,
129 unsigned long vflags, int psize) 133 unsigned long vflags, int psize, int ssize)
130{ 134{
131 struct hash_pte *hptep = htab_address + hpte_group; 135 struct hash_pte *hptep = htab_address + hpte_group;
132 unsigned long hpte_v, hpte_r; 136 unsigned long hpte_v, hpte_r;
@@ -153,7 +157,7 @@ static long native_hpte_insert(unsigned long hpte_group, unsigned long va,
153 if (i == HPTES_PER_GROUP) 157 if (i == HPTES_PER_GROUP)
154 return -1; 158 return -1;
155 159
156 hpte_v = hpte_encode_v(va, psize) | vflags | HPTE_V_VALID; 160 hpte_v = hpte_encode_v(va, psize, ssize) | vflags | HPTE_V_VALID;
157 hpte_r = hpte_encode_r(pa, psize) | rflags; 161 hpte_r = hpte_encode_r(pa, psize) | rflags;
158 162
159 if (!(vflags & HPTE_V_BOLTED)) { 163 if (!(vflags & HPTE_V_BOLTED)) {
@@ -215,13 +219,14 @@ static long native_hpte_remove(unsigned long hpte_group)
215} 219}
216 220
217static long native_hpte_updatepp(unsigned long slot, unsigned long newpp, 221static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
218 unsigned long va, int psize, int local) 222 unsigned long va, int psize, int ssize,
223 int local)
219{ 224{
220 struct hash_pte *hptep = htab_address + slot; 225 struct hash_pte *hptep = htab_address + slot;
221 unsigned long hpte_v, want_v; 226 unsigned long hpte_v, want_v;
222 int ret = 0; 227 int ret = 0;
223 228
224 want_v = hpte_encode_v(va, psize); 229 want_v = hpte_encode_v(va, psize, ssize);
225 230
226 DBG_LOW(" update(va=%016lx, avpnv=%016lx, hash=%016lx, newpp=%x)", 231 DBG_LOW(" update(va=%016lx, avpnv=%016lx, hash=%016lx, newpp=%x)",
227 va, want_v & HPTE_V_AVPN, slot, newpp); 232 va, want_v & HPTE_V_AVPN, slot, newpp);
@@ -243,39 +248,32 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
243 native_unlock_hpte(hptep); 248 native_unlock_hpte(hptep);
244 249
245 /* Ensure it is out of the tlb too. */ 250 /* Ensure it is out of the tlb too. */
246 tlbie(va, psize, local); 251 tlbie(va, psize, ssize, local);
247 252
248 return ret; 253 return ret;
249} 254}
250 255
251static long native_hpte_find(unsigned long va, int psize) 256static long native_hpte_find(unsigned long va, int psize, int ssize)
252{ 257{
253 struct hash_pte *hptep; 258 struct hash_pte *hptep;
254 unsigned long hash; 259 unsigned long hash;
255 unsigned long i, j; 260 unsigned long i;
256 long slot; 261 long slot;
257 unsigned long want_v, hpte_v; 262 unsigned long want_v, hpte_v;
258 263
259 hash = hpt_hash(va, mmu_psize_defs[psize].shift); 264 hash = hpt_hash(va, mmu_psize_defs[psize].shift, ssize);
260 want_v = hpte_encode_v(va, psize); 265 want_v = hpte_encode_v(va, psize, ssize);
261 266
262 for (j = 0; j < 2; j++) { 267 /* Bolted mappings are only ever in the primary group */
263 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 268 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
264 for (i = 0; i < HPTES_PER_GROUP; i++) { 269 for (i = 0; i < HPTES_PER_GROUP; i++) {
265 hptep = htab_address + slot; 270 hptep = htab_address + slot;
266 hpte_v = hptep->v; 271 hpte_v = hptep->v;
267 272
268 if (HPTE_V_COMPARE(hpte_v, want_v) 273 if (HPTE_V_COMPARE(hpte_v, want_v) && (hpte_v & HPTE_V_VALID))
269 && (hpte_v & HPTE_V_VALID) 274 /* HPTE matches */
270 && ( !!(hpte_v & HPTE_V_SECONDARY) == j)) { 275 return slot;
271 /* HPTE matches */ 276 ++slot;
272 if (j)
273 slot = -slot;
274 return slot;
275 }
276 ++slot;
277 }
278 hash = ~hash;
279 } 277 }
280 278
281 return -1; 279 return -1;
@@ -289,16 +287,16 @@ static long native_hpte_find(unsigned long va, int psize)
289 * No need to lock here because we should be the only user. 287 * No need to lock here because we should be the only user.
290 */ 288 */
291static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea, 289static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
292 int psize) 290 int psize, int ssize)
293{ 291{
294 unsigned long vsid, va; 292 unsigned long vsid, va;
295 long slot; 293 long slot;
296 struct hash_pte *hptep; 294 struct hash_pte *hptep;
297 295
298 vsid = get_kernel_vsid(ea); 296 vsid = get_kernel_vsid(ea, ssize);
299 va = (vsid << 28) | (ea & 0x0fffffff); 297 va = hpt_va(ea, vsid, ssize);
300 298
301 slot = native_hpte_find(va, psize); 299 slot = native_hpte_find(va, psize, ssize);
302 if (slot == -1) 300 if (slot == -1)
303 panic("could not find page to bolt\n"); 301 panic("could not find page to bolt\n");
304 hptep = htab_address + slot; 302 hptep = htab_address + slot;
@@ -308,11 +306,11 @@ static void native_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
308 (newpp & (HPTE_R_PP | HPTE_R_N)); 306 (newpp & (HPTE_R_PP | HPTE_R_N));
309 307
310 /* Ensure it is out of the tlb too. */ 308 /* Ensure it is out of the tlb too. */
311 tlbie(va, psize, 0); 309 tlbie(va, psize, ssize, 0);
312} 310}
313 311
314static void native_hpte_invalidate(unsigned long slot, unsigned long va, 312static void native_hpte_invalidate(unsigned long slot, unsigned long va,
315 int psize, int local) 313 int psize, int ssize, int local)
316{ 314{
317 struct hash_pte *hptep = htab_address + slot; 315 struct hash_pte *hptep = htab_address + slot;
318 unsigned long hpte_v; 316 unsigned long hpte_v;
@@ -323,7 +321,7 @@ static void native_hpte_invalidate(unsigned long slot, unsigned long va,
323 321
324 DBG_LOW(" invalidate(va=%016lx, hash: %x)\n", va, slot); 322 DBG_LOW(" invalidate(va=%016lx, hash: %x)\n", va, slot);
325 323
326 want_v = hpte_encode_v(va, psize); 324 want_v = hpte_encode_v(va, psize, ssize);
327 native_lock_hpte(hptep); 325 native_lock_hpte(hptep);
328 hpte_v = hptep->v; 326 hpte_v = hptep->v;
329 327
@@ -335,7 +333,7 @@ static void native_hpte_invalidate(unsigned long slot, unsigned long va,
335 hptep->v = 0; 333 hptep->v = 0;
336 334
337 /* Invalidate the TLB */ 335 /* Invalidate the TLB */
338 tlbie(va, psize, local); 336 tlbie(va, psize, ssize, local);
339 337
340 local_irq_restore(flags); 338 local_irq_restore(flags);
341} 339}
@@ -345,7 +343,7 @@ static void native_hpte_invalidate(unsigned long slot, unsigned long va,
345#define LP_MASK(i) ((0xFF >> (i)) << LP_SHIFT) 343#define LP_MASK(i) ((0xFF >> (i)) << LP_SHIFT)
346 344
347static void hpte_decode(struct hash_pte *hpte, unsigned long slot, 345static void hpte_decode(struct hash_pte *hpte, unsigned long slot,
348 int *psize, unsigned long *va) 346 int *psize, int *ssize, unsigned long *va)
349{ 347{
350 unsigned long hpte_r = hpte->r; 348 unsigned long hpte_r = hpte->r;
351 unsigned long hpte_v = hpte->v; 349 unsigned long hpte_v = hpte->v;
@@ -401,6 +399,7 @@ static void hpte_decode(struct hash_pte *hpte, unsigned long slot,
401 399
402 *va = avpn; 400 *va = avpn;
403 *psize = size; 401 *psize = size;
402 *ssize = hpte_v >> HPTE_V_SSIZE_SHIFT;
404} 403}
405 404
406/* 405/*
@@ -417,7 +416,7 @@ static void native_hpte_clear(void)
417 struct hash_pte *hptep = htab_address; 416 struct hash_pte *hptep = htab_address;
418 unsigned long hpte_v, va; 417 unsigned long hpte_v, va;
419 unsigned long pteg_count; 418 unsigned long pteg_count;
420 int psize; 419 int psize, ssize;
421 420
422 pteg_count = htab_hash_mask + 1; 421 pteg_count = htab_hash_mask + 1;
423 422
@@ -443,9 +442,9 @@ static void native_hpte_clear(void)
443 * already hold the native_tlbie_lock. 442 * already hold the native_tlbie_lock.
444 */ 443 */
445 if (hpte_v & HPTE_V_VALID) { 444 if (hpte_v & HPTE_V_VALID) {
446 hpte_decode(hptep, slot, &psize, &va); 445 hpte_decode(hptep, slot, &psize, &ssize, &va);
447 hptep->v = 0; 446 hptep->v = 0;
448 __tlbie(va, psize); 447 __tlbie(va, psize, ssize);
449 } 448 }
450 } 449 }
451 450
@@ -468,6 +467,7 @@ static void native_flush_hash_range(unsigned long number, int local)
468 real_pte_t pte; 467 real_pte_t pte;
469 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 468 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
470 unsigned long psize = batch->psize; 469 unsigned long psize = batch->psize;
470 int ssize = batch->ssize;
471 int i; 471 int i;
472 472
473 local_irq_save(flags); 473 local_irq_save(flags);
@@ -477,14 +477,14 @@ static void native_flush_hash_range(unsigned long number, int local)
477 pte = batch->pte[i]; 477 pte = batch->pte[i];
478 478
479 pte_iterate_hashed_subpages(pte, psize, va, index, shift) { 479 pte_iterate_hashed_subpages(pte, psize, va, index, shift) {
480 hash = hpt_hash(va, shift); 480 hash = hpt_hash(va, shift, ssize);
481 hidx = __rpte_to_hidx(pte, index); 481 hidx = __rpte_to_hidx(pte, index);
482 if (hidx & _PTEIDX_SECONDARY) 482 if (hidx & _PTEIDX_SECONDARY)
483 hash = ~hash; 483 hash = ~hash;
484 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 484 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
485 slot += hidx & _PTEIDX_GROUP_IX; 485 slot += hidx & _PTEIDX_GROUP_IX;
486 hptep = htab_address + slot; 486 hptep = htab_address + slot;
487 want_v = hpte_encode_v(va, psize); 487 want_v = hpte_encode_v(va, psize, ssize);
488 native_lock_hpte(hptep); 488 native_lock_hpte(hptep);
489 hpte_v = hptep->v; 489 hpte_v = hptep->v;
490 if (!HPTE_V_COMPARE(hpte_v, want_v) || 490 if (!HPTE_V_COMPARE(hpte_v, want_v) ||
@@ -504,7 +504,7 @@ static void native_flush_hash_range(unsigned long number, int local)
504 504
505 pte_iterate_hashed_subpages(pte, psize, va, index, 505 pte_iterate_hashed_subpages(pte, psize, va, index,
506 shift) { 506 shift) {
507 __tlbiel(va, psize); 507 __tlbiel(va, psize, ssize);
508 } pte_iterate_hashed_end(); 508 } pte_iterate_hashed_end();
509 } 509 }
510 asm volatile("ptesync":::"memory"); 510 asm volatile("ptesync":::"memory");
@@ -521,7 +521,7 @@ static void native_flush_hash_range(unsigned long number, int local)
521 521
522 pte_iterate_hashed_subpages(pte, psize, va, index, 522 pte_iterate_hashed_subpages(pte, psize, va, index,
523 shift) { 523 shift) {
524 __tlbie(va, psize); 524 __tlbie(va, psize, ssize);
525 } pte_iterate_hashed_end(); 525 } pte_iterate_hashed_end();
526 } 526 }
527 asm volatile("eieio; tlbsync; ptesync":::"memory"); 527 asm volatile("eieio; tlbsync; ptesync":::"memory");
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index a47151e806ca..611ad084b7e7 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
@@ -94,6 +93,8 @@ int mmu_linear_psize = MMU_PAGE_4K;
94int mmu_virtual_psize = MMU_PAGE_4K; 93int mmu_virtual_psize = MMU_PAGE_4K;
95int mmu_vmalloc_psize = MMU_PAGE_4K; 94int mmu_vmalloc_psize = MMU_PAGE_4K;
96int mmu_io_psize = MMU_PAGE_4K; 95int mmu_io_psize = MMU_PAGE_4K;
96int mmu_kernel_ssize = MMU_SEGSIZE_256M;
97int mmu_highuser_ssize = MMU_SEGSIZE_256M;
97#ifdef CONFIG_HUGETLB_PAGE 98#ifdef CONFIG_HUGETLB_PAGE
98int mmu_huge_psize = MMU_PAGE_16M; 99int mmu_huge_psize = MMU_PAGE_16M;
99unsigned int HPAGE_SHIFT; 100unsigned int HPAGE_SHIFT;
@@ -146,7 +147,8 @@ struct mmu_psize_def mmu_psize_defaults_gp[] = {
146 147
147 148
148int htab_bolt_mapping(unsigned long vstart, unsigned long vend, 149int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
149 unsigned long pstart, unsigned long mode, int psize) 150 unsigned long pstart, unsigned long mode,
151 int psize, int ssize)
150{ 152{
151 unsigned long vaddr, paddr; 153 unsigned long vaddr, paddr;
152 unsigned int step, shift; 154 unsigned int step, shift;
@@ -159,8 +161,8 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
159 for (vaddr = vstart, paddr = pstart; vaddr < vend; 161 for (vaddr = vstart, paddr = pstart; vaddr < vend;
160 vaddr += step, paddr += step) { 162 vaddr += step, paddr += step) {
161 unsigned long hash, hpteg; 163 unsigned long hash, hpteg;
162 unsigned long vsid = get_kernel_vsid(vaddr); 164 unsigned long vsid = get_kernel_vsid(vaddr, ssize);
163 unsigned long va = (vsid << 28) | (vaddr & 0x0fffffff); 165 unsigned long va = hpt_va(vaddr, vsid, ssize);
164 166
165 tmp_mode = mode; 167 tmp_mode = mode;
166 168
@@ -168,14 +170,14 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
168 if (!in_kernel_text(vaddr)) 170 if (!in_kernel_text(vaddr))
169 tmp_mode = mode | HPTE_R_N; 171 tmp_mode = mode | HPTE_R_N;
170 172
171 hash = hpt_hash(va, shift); 173 hash = hpt_hash(va, shift, ssize);
172 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); 174 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
173 175
174 DBG("htab_bolt_mapping: calling %p\n", ppc_md.hpte_insert); 176 DBG("htab_bolt_mapping: calling %p\n", ppc_md.hpte_insert);
175 177
176 BUG_ON(!ppc_md.hpte_insert); 178 BUG_ON(!ppc_md.hpte_insert);
177 ret = ppc_md.hpte_insert(hpteg, va, paddr, 179 ret = ppc_md.hpte_insert(hpteg, va, paddr,
178 tmp_mode, HPTE_V_BOLTED, psize); 180 tmp_mode, HPTE_V_BOLTED, psize, ssize);
179 181
180 if (ret < 0) 182 if (ret < 0)
181 break; 183 break;
@@ -187,6 +189,37 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
187 return ret < 0 ? ret : 0; 189 return ret < 0 ? ret : 0;
188} 190}
189 191
192static int __init htab_dt_scan_seg_sizes(unsigned long node,
193 const char *uname, int depth,
194 void *data)
195{
196 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
197 u32 *prop;
198 unsigned long size = 0;
199
200 /* We are scanning "cpu" nodes only */
201 if (type == NULL || strcmp(type, "cpu") != 0)
202 return 0;
203
204 prop = (u32 *)of_get_flat_dt_prop(node, "ibm,processor-segment-sizes",
205 &size);
206 if (prop == NULL)
207 return 0;
208 for (; size >= 4; size -= 4, ++prop) {
209 if (prop[0] == 40) {
210 DBG("1T segment support detected\n");
211 cur_cpu_spec->cpu_features |= CPU_FTR_1T_SEGMENT;
212 }
213 return 1;
214 }
215 return 0;
216}
217
218static void __init htab_init_seg_sizes(void)
219{
220 of_scan_flat_dt(htab_dt_scan_seg_sizes, NULL);
221}
222
190static int __init htab_dt_scan_page_sizes(unsigned long node, 223static int __init htab_dt_scan_page_sizes(unsigned long node,
191 const char *uname, int depth, 224 const char *uname, int depth,
192 void *data) 225 void *data)
@@ -266,7 +299,6 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
266 return 0; 299 return 0;
267} 300}
268 301
269
270static void __init htab_init_page_sizes(void) 302static void __init htab_init_page_sizes(void)
271{ 303{
272 int rc; 304 int rc;
@@ -399,7 +431,7 @@ void create_section_mapping(unsigned long start, unsigned long end)
399{ 431{
400 BUG_ON(htab_bolt_mapping(start, end, __pa(start), 432 BUG_ON(htab_bolt_mapping(start, end, __pa(start),
401 _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX, 433 _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX,
402 mmu_linear_psize)); 434 mmu_linear_psize, mmu_kernel_ssize));
403} 435}
404#endif /* CONFIG_MEMORY_HOTPLUG */ 436#endif /* CONFIG_MEMORY_HOTPLUG */
405 437
@@ -450,9 +482,18 @@ void __init htab_initialize(void)
450 482
451 DBG(" -> htab_initialize()\n"); 483 DBG(" -> htab_initialize()\n");
452 484
485 /* Initialize segment sizes */
486 htab_init_seg_sizes();
487
453 /* Initialize page sizes */ 488 /* Initialize page sizes */
454 htab_init_page_sizes(); 489 htab_init_page_sizes();
455 490
491 if (cpu_has_feature(CPU_FTR_1T_SEGMENT)) {
492 mmu_kernel_ssize = MMU_SEGSIZE_1T;
493 mmu_highuser_ssize = MMU_SEGSIZE_1T;
494 printk(KERN_INFO "Using 1TB segments\n");
495 }
496
456 /* 497 /*
457 * Calculate the required size of the htab. We want the number of 498 * Calculate the required size of the htab. We want the number of
458 * PTEGs to equal one half the number of real pages. 499 * PTEGs to equal one half the number of real pages.
@@ -524,18 +565,20 @@ void __init htab_initialize(void)
524 if (base != dart_tablebase) 565 if (base != dart_tablebase)
525 BUG_ON(htab_bolt_mapping(base, dart_tablebase, 566 BUG_ON(htab_bolt_mapping(base, dart_tablebase,
526 __pa(base), mode_rw, 567 __pa(base), mode_rw,
527 mmu_linear_psize)); 568 mmu_linear_psize,
569 mmu_kernel_ssize));
528 if ((base + size) > dart_table_end) 570 if ((base + size) > dart_table_end)
529 BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, 571 BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB,
530 base + size, 572 base + size,
531 __pa(dart_table_end), 573 __pa(dart_table_end),
532 mode_rw, 574 mode_rw,
533 mmu_linear_psize)); 575 mmu_linear_psize,
576 mmu_kernel_ssize));
534 continue; 577 continue;
535 } 578 }
536#endif /* CONFIG_U3_DART */ 579#endif /* CONFIG_U3_DART */
537 BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), 580 BUG_ON(htab_bolt_mapping(base, base + size, __pa(base),
538 mode_rw, mmu_linear_psize)); 581 mode_rw, mmu_linear_psize, mmu_kernel_ssize));
539 } 582 }
540 583
541 /* 584 /*
@@ -554,7 +597,7 @@ void __init htab_initialize(void)
554 597
555 BUG_ON(htab_bolt_mapping(tce_alloc_start, tce_alloc_end, 598 BUG_ON(htab_bolt_mapping(tce_alloc_start, tce_alloc_end,
556 __pa(tce_alloc_start), mode_rw, 599 __pa(tce_alloc_start), mode_rw,
557 mmu_linear_psize)); 600 mmu_linear_psize, mmu_kernel_ssize));
558 } 601 }
559 602
560 htab_finish_init(); 603 htab_finish_init();
@@ -602,13 +645,7 @@ static void demote_segment_4k(struct mm_struct *mm, unsigned long addr)
602{ 645{
603 if (mm->context.user_psize == MMU_PAGE_4K) 646 if (mm->context.user_psize == MMU_PAGE_4K)
604 return; 647 return;
605#ifdef CONFIG_PPC_MM_SLICES
606 slice_set_user_psize(mm, MMU_PAGE_4K); 648 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 649#ifdef CONFIG_SPU_BASE
613 spu_flush_all_slbs(mm); 650 spu_flush_all_slbs(mm);
614#endif 651#endif
@@ -628,7 +665,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
628 pte_t *ptep; 665 pte_t *ptep;
629 cpumask_t tmp; 666 cpumask_t tmp;
630 int rc, user_region = 0, local = 0; 667 int rc, user_region = 0, local = 0;
631 int psize; 668 int psize, ssize;
632 669
633 DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n", 670 DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
634 ea, access, trap); 671 ea, access, trap);
@@ -647,20 +684,22 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
647 DBG_LOW(" user region with no mm !\n"); 684 DBG_LOW(" user region with no mm !\n");
648 return 1; 685 return 1;
649 } 686 }
650 vsid = get_vsid(mm->context.id, ea);
651#ifdef CONFIG_PPC_MM_SLICES 687#ifdef CONFIG_PPC_MM_SLICES
652 psize = get_slice_psize(mm, ea); 688 psize = get_slice_psize(mm, ea);
653#else 689#else
654 psize = mm->context.user_psize; 690 psize = mm->context.user_psize;
655#endif 691#endif
692 ssize = user_segment_size(ea);
693 vsid = get_vsid(mm->context.id, ea, ssize);
656 break; 694 break;
657 case VMALLOC_REGION_ID: 695 case VMALLOC_REGION_ID:
658 mm = &init_mm; 696 mm = &init_mm;
659 vsid = get_kernel_vsid(ea); 697 vsid = get_kernel_vsid(ea, mmu_kernel_ssize);
660 if (ea < VMALLOC_END) 698 if (ea < VMALLOC_END)
661 psize = mmu_vmalloc_psize; 699 psize = mmu_vmalloc_psize;
662 else 700 else
663 psize = mmu_io_psize; 701 psize = mmu_io_psize;
702 ssize = mmu_kernel_ssize;
664 break; 703 break;
665 default: 704 default:
666 /* Not a valid range 705 /* Not a valid range
@@ -765,10 +804,10 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
765 804
766#ifdef CONFIG_PPC_HAS_HASH_64K 805#ifdef CONFIG_PPC_HAS_HASH_64K
767 if (psize == MMU_PAGE_64K) 806 if (psize == MMU_PAGE_64K)
768 rc = __hash_page_64K(ea, access, vsid, ptep, trap, local); 807 rc = __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize);
769 else 808 else
770#endif /* CONFIG_PPC_HAS_HASH_64K */ 809#endif /* CONFIG_PPC_HAS_HASH_64K */
771 rc = __hash_page_4K(ea, access, vsid, ptep, trap, local); 810 rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize);
772 811
773#ifndef CONFIG_PPC_64K_PAGES 812#ifndef CONFIG_PPC_64K_PAGES
774 DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep)); 813 DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep));
@@ -790,6 +829,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
790 cpumask_t mask; 829 cpumask_t mask;
791 unsigned long flags; 830 unsigned long flags;
792 int local = 0; 831 int local = 0;
832 int ssize;
793 833
794 BUG_ON(REGION_ID(ea) != USER_REGION_ID); 834 BUG_ON(REGION_ID(ea) != USER_REGION_ID);
795 835
@@ -822,7 +862,8 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
822#endif /* CONFIG_PPC_64K_PAGES */ 862#endif /* CONFIG_PPC_64K_PAGES */
823 863
824 /* Get VSID */ 864 /* Get VSID */
825 vsid = get_vsid(mm->context.id, ea); 865 ssize = user_segment_size(ea);
866 vsid = get_vsid(mm->context.id, ea, ssize);
826 867
827 /* Hash doesn't like irqs */ 868 /* Hash doesn't like irqs */
828 local_irq_save(flags); 869 local_irq_save(flags);
@@ -835,28 +876,29 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
835 /* Hash it in */ 876 /* Hash it in */
836#ifdef CONFIG_PPC_HAS_HASH_64K 877#ifdef CONFIG_PPC_HAS_HASH_64K
837 if (mm->context.user_psize == MMU_PAGE_64K) 878 if (mm->context.user_psize == MMU_PAGE_64K)
838 __hash_page_64K(ea, access, vsid, ptep, trap, local); 879 __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize);
839 else 880 else
840#endif /* CONFIG_PPC_HAS_HASH_64K */ 881#endif /* CONFIG_PPC_HAS_HASH_64K */
841 __hash_page_4K(ea, access, vsid, ptep, trap, local); 882 __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize);
842 883
843 local_irq_restore(flags); 884 local_irq_restore(flags);
844} 885}
845 886
846void flush_hash_page(unsigned long va, real_pte_t pte, int psize, int local) 887void flush_hash_page(unsigned long va, real_pte_t pte, int psize, int ssize,
888 int local)
847{ 889{
848 unsigned long hash, index, shift, hidx, slot; 890 unsigned long hash, index, shift, hidx, slot;
849 891
850 DBG_LOW("flush_hash_page(va=%016x)\n", va); 892 DBG_LOW("flush_hash_page(va=%016x)\n", va);
851 pte_iterate_hashed_subpages(pte, psize, va, index, shift) { 893 pte_iterate_hashed_subpages(pte, psize, va, index, shift) {
852 hash = hpt_hash(va, shift); 894 hash = hpt_hash(va, shift, ssize);
853 hidx = __rpte_to_hidx(pte, index); 895 hidx = __rpte_to_hidx(pte, index);
854 if (hidx & _PTEIDX_SECONDARY) 896 if (hidx & _PTEIDX_SECONDARY)
855 hash = ~hash; 897 hash = ~hash;
856 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 898 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
857 slot += hidx & _PTEIDX_GROUP_IX; 899 slot += hidx & _PTEIDX_GROUP_IX;
858 DBG_LOW(" sub %d: hash=%x, hidx=%x\n", index, slot, hidx); 900 DBG_LOW(" sub %d: hash=%x, hidx=%x\n", index, slot, hidx);
859 ppc_md.hpte_invalidate(slot, va, psize, local); 901 ppc_md.hpte_invalidate(slot, va, psize, ssize, local);
860 } pte_iterate_hashed_end(); 902 } pte_iterate_hashed_end();
861} 903}
862 904
@@ -871,7 +913,7 @@ void flush_hash_range(unsigned long number, int local)
871 913
872 for (i = 0; i < number; i++) 914 for (i = 0; i < number; i++)
873 flush_hash_page(batch->vaddr[i], batch->pte[i], 915 flush_hash_page(batch->vaddr[i], batch->pte[i],
874 batch->psize, local); 916 batch->psize, batch->ssize, local);
875 } 917 }
876} 918}
877 919
@@ -897,17 +939,19 @@ void low_hash_fault(struct pt_regs *regs, unsigned long address)
897#ifdef CONFIG_DEBUG_PAGEALLOC 939#ifdef CONFIG_DEBUG_PAGEALLOC
898static void kernel_map_linear_page(unsigned long vaddr, unsigned long lmi) 940static void kernel_map_linear_page(unsigned long vaddr, unsigned long lmi)
899{ 941{
900 unsigned long hash, hpteg, vsid = get_kernel_vsid(vaddr); 942 unsigned long hash, hpteg;
901 unsigned long va = (vsid << 28) | (vaddr & 0x0fffffff); 943 unsigned long vsid = get_kernel_vsid(vaddr, mmu_kernel_ssize);
944 unsigned long va = hpt_va(vaddr, vsid, mmu_kernel_ssize);
902 unsigned long mode = _PAGE_ACCESSED | _PAGE_DIRTY | 945 unsigned long mode = _PAGE_ACCESSED | _PAGE_DIRTY |
903 _PAGE_COHERENT | PP_RWXX | HPTE_R_N; 946 _PAGE_COHERENT | PP_RWXX | HPTE_R_N;
904 int ret; 947 int ret;
905 948
906 hash = hpt_hash(va, PAGE_SHIFT); 949 hash = hpt_hash(va, PAGE_SHIFT, mmu_kernel_ssize);
907 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); 950 hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
908 951
909 ret = ppc_md.hpte_insert(hpteg, va, __pa(vaddr), 952 ret = ppc_md.hpte_insert(hpteg, va, __pa(vaddr),
910 mode, HPTE_V_BOLTED, mmu_linear_psize); 953 mode, HPTE_V_BOLTED,
954 mmu_linear_psize, mmu_kernel_ssize);
911 BUG_ON (ret < 0); 955 BUG_ON (ret < 0);
912 spin_lock(&linear_map_hash_lock); 956 spin_lock(&linear_map_hash_lock);
913 BUG_ON(linear_map_hash_slots[lmi] & 0x80); 957 BUG_ON(linear_map_hash_slots[lmi] & 0x80);
@@ -917,10 +961,11 @@ static void kernel_map_linear_page(unsigned long vaddr, unsigned long lmi)
917 961
918static void kernel_unmap_linear_page(unsigned long vaddr, unsigned long lmi) 962static void kernel_unmap_linear_page(unsigned long vaddr, unsigned long lmi)
919{ 963{
920 unsigned long hash, hidx, slot, vsid = get_kernel_vsid(vaddr); 964 unsigned long hash, hidx, slot;
921 unsigned long va = (vsid << 28) | (vaddr & 0x0fffffff); 965 unsigned long vsid = get_kernel_vsid(vaddr, mmu_kernel_ssize);
966 unsigned long va = hpt_va(vaddr, vsid, mmu_kernel_ssize);
922 967
923 hash = hpt_hash(va, PAGE_SHIFT); 968 hash = hpt_hash(va, PAGE_SHIFT, mmu_kernel_ssize);
924 spin_lock(&linear_map_hash_lock); 969 spin_lock(&linear_map_hash_lock);
925 BUG_ON(!(linear_map_hash_slots[lmi] & 0x80)); 970 BUG_ON(!(linear_map_hash_slots[lmi] & 0x80));
926 hidx = linear_map_hash_slots[lmi] & 0x7f; 971 hidx = linear_map_hash_slots[lmi] & 0x7f;
@@ -930,7 +975,7 @@ static void kernel_unmap_linear_page(unsigned long vaddr, unsigned long lmi)
930 hash = ~hash; 975 hash = ~hash;
931 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 976 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
932 slot += hidx & _PTEIDX_GROUP_IX; 977 slot += hidx & _PTEIDX_GROUP_IX;
933 ppc_md.hpte_invalidate(slot, va, mmu_linear_psize, 0); 978 ppc_md.hpte_invalidate(slot, va, mmu_linear_psize, mmu_kernel_ssize, 0);
934} 979}
935 980
936void kernel_map_pages(struct page *page, int numpages, int enable) 981void kernel_map_pages(struct page *page, int numpages, int enable)
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 4835f73af304..08f0d9ff7712 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
@@ -406,11 +403,12 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
406 unsigned long va, rflags, pa; 403 unsigned long va, rflags, pa;
407 long slot; 404 long slot;
408 int err = 1; 405 int err = 1;
406 int ssize = user_segment_size(ea);
409 407
410 ptep = huge_pte_offset(mm, ea); 408 ptep = huge_pte_offset(mm, ea);
411 409
412 /* Search the Linux page table for a match with va */ 410 /* Search the Linux page table for a match with va */
413 va = (vsid << 28) | (ea & 0x0fffffff); 411 va = hpt_va(ea, vsid, ssize);
414 412
415 /* 413 /*
416 * If no pte found or not present, send the problem up to 414 * If no pte found or not present, send the problem up to
@@ -461,19 +459,19 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
461 /* There MIGHT be an HPTE for this pte */ 459 /* There MIGHT be an HPTE for this pte */
462 unsigned long hash, slot; 460 unsigned long hash, slot;
463 461
464 hash = hpt_hash(va, HPAGE_SHIFT); 462 hash = hpt_hash(va, HPAGE_SHIFT, ssize);
465 if (old_pte & _PAGE_F_SECOND) 463 if (old_pte & _PAGE_F_SECOND)
466 hash = ~hash; 464 hash = ~hash;
467 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 465 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
468 slot += (old_pte & _PAGE_F_GIX) >> 12; 466 slot += (old_pte & _PAGE_F_GIX) >> 12;
469 467
470 if (ppc_md.hpte_updatepp(slot, rflags, va, mmu_huge_psize, 468 if (ppc_md.hpte_updatepp(slot, rflags, va, mmu_huge_psize,
471 local) == -1) 469 ssize, local) == -1)
472 old_pte &= ~_PAGE_HPTEFLAGS; 470 old_pte &= ~_PAGE_HPTEFLAGS;
473 } 471 }
474 472
475 if (likely(!(old_pte & _PAGE_HASHPTE))) { 473 if (likely(!(old_pte & _PAGE_HASHPTE))) {
476 unsigned long hash = hpt_hash(va, HPAGE_SHIFT); 474 unsigned long hash = hpt_hash(va, HPAGE_SHIFT, ssize);
477 unsigned long hpte_group; 475 unsigned long hpte_group;
478 476
479 pa = pte_pfn(__pte(old_pte)) << PAGE_SHIFT; 477 pa = pte_pfn(__pte(old_pte)) << PAGE_SHIFT;
@@ -492,7 +490,7 @@ repeat:
492 490
493 /* Insert into the hash table, primary slot */ 491 /* Insert into the hash table, primary slot */
494 slot = ppc_md.hpte_insert(hpte_group, va, pa, rflags, 0, 492 slot = ppc_md.hpte_insert(hpte_group, va, pa, rflags, 0,
495 mmu_huge_psize); 493 mmu_huge_psize, ssize);
496 494
497 /* Primary is full, try the secondary */ 495 /* Primary is full, try the secondary */
498 if (unlikely(slot == -1)) { 496 if (unlikely(slot == -1)) {
@@ -500,7 +498,7 @@ repeat:
500 HPTES_PER_GROUP) & ~0x7UL; 498 HPTES_PER_GROUP) & ~0x7UL;
501 slot = ppc_md.hpte_insert(hpte_group, va, pa, rflags, 499 slot = ppc_md.hpte_insert(hpte_group, va, pa, rflags,
502 HPTE_V_SECONDARY, 500 HPTE_V_SECONDARY,
503 mmu_huge_psize); 501 mmu_huge_psize, ssize);
504 if (slot == -1) { 502 if (slot == -1) {
505 if (mftb() & 0x1) 503 if (mftb() & 0x1)
506 hpte_group = ((hash & htab_hash_mask) * 504 hpte_group = ((hash & htab_hash_mask) *
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index e1f5ded851f6..977cb1ee5e72 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
@@ -133,6 +132,9 @@ void __init MMU_init(void)
133 /* 601 can only access 16MB at the moment */ 132 /* 601 can only access 16MB at the moment */
134 if (PVR_VER(mfspr(SPRN_PVR)) == 1) 133 if (PVR_VER(mfspr(SPRN_PVR)) == 1)
135 __initial_memory_limit = 0x01000000; 134 __initial_memory_limit = 0x01000000;
135 /* 8xx can only access 8MB at the moment */
136 if (PVR_VER(mfspr(SPRN_PVR)) == 0x50)
137 __initial_memory_limit = 0x00800000;
136 138
137 /* parse args from command line */ 139 /* parse args from command line */
138 MMU_setup(); 140 MMU_setup();
@@ -256,3 +258,40 @@ void free_initrd_mem(unsigned long start, unsigned long end)
256 } 258 }
257} 259}
258#endif 260#endif
261
262#ifdef CONFIG_PROC_KCORE
263static struct kcore_list kcore_vmem;
264
265static int __init setup_kcore(void)
266{
267 int i;
268
269 for (i = 0; i < lmb.memory.cnt; i++) {
270 unsigned long base;
271 unsigned long size;
272 struct kcore_list *kcore_mem;
273
274 base = lmb.memory.region[i].base;
275 size = lmb.memory.region[i].size;
276
277 kcore_mem = kmalloc(sizeof(struct kcore_list), GFP_ATOMIC);
278 if (!kcore_mem)
279 panic("%s: kmalloc failed\n", __FUNCTION__);
280
281 /* must stay under 32 bits */
282 if ( 0xfffffffful - (unsigned long)__va(base) < size) {
283 size = 0xfffffffful - (unsigned long)(__va(base));
284 printk(KERN_DEBUG "setup_kcore: restrict size=%lx\n",
285 size);
286 }
287
288 kclist_add(kcore_mem, __va(base), size);
289 }
290
291 kclist_add(&kcore_vmem, (void *)VMALLOC_START,
292 VMALLOC_END-VMALLOC_START);
293
294 return 0;
295}
296module_init(setup_kcore);
297#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..3ef0ad2f9ca0 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -87,8 +87,8 @@ static int map_io_page(unsigned long ea, unsigned long pa, int flags)
87 * entry in the hardware page table. 87 * entry in the hardware page table.
88 * 88 *
89 */ 89 */
90 if (htab_bolt_mapping(ea, (unsigned long)ea + PAGE_SIZE, 90 if (htab_bolt_mapping(ea, ea + PAGE_SIZE, pa, flags,
91 pa, flags, mmu_io_psize)) { 91 mmu_io_psize, mmu_kernel_ssize)) {
92 printk(KERN_ERR "Failed to do bolted mapping IO " 92 printk(KERN_ERR "Failed to do bolted mapping IO "
93 "memory at %016lx !\n", pa); 93 "memory at %016lx !\n", pa);
94 return -ENOMEM; 94 return -ENOMEM;
@@ -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..6c164cec9d2c 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -43,30 +43,37 @@ static void slb_allocate(unsigned long ea)
43 slb_allocate_realmode(ea); 43 slb_allocate_realmode(ea);
44} 44}
45 45
46static inline unsigned long mk_esid_data(unsigned long ea, unsigned long slot) 46static inline unsigned long mk_esid_data(unsigned long ea, int ssize,
47 unsigned long slot)
47{ 48{
48 return (ea & ESID_MASK) | SLB_ESID_V | slot; 49 unsigned long mask;
50
51 mask = (ssize == MMU_SEGSIZE_256M)? ESID_MASK: ESID_MASK_1T;
52 return (ea & mask) | SLB_ESID_V | slot;
49} 53}
50 54
51static inline unsigned long mk_vsid_data(unsigned long ea, unsigned long flags) 55#define slb_vsid_shift(ssize) \
56 ((ssize) == MMU_SEGSIZE_256M? SLB_VSID_SHIFT: SLB_VSID_SHIFT_1T)
57
58static inline unsigned long mk_vsid_data(unsigned long ea, int ssize,
59 unsigned long flags)
52{ 60{
53 return (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | flags; 61 return (get_kernel_vsid(ea, ssize) << slb_vsid_shift(ssize)) | flags |
62 ((unsigned long) ssize << SLB_VSID_SSIZE_SHIFT);
54} 63}
55 64
56static inline void slb_shadow_update(unsigned long ea, 65static inline void slb_shadow_update(unsigned long ea, int ssize,
57 unsigned long flags, 66 unsigned long flags,
58 unsigned long entry) 67 unsigned long entry)
59{ 68{
60 /* 69 /*
61 * Clear the ESID first so the entry is not valid while we are 70 * Clear the ESID first so the entry is not valid while we are
62 * updating it. 71 * updating it. No write barriers are needed here, provided
72 * we only update the current CPU's SLB shadow buffer.
63 */ 73 */
64 get_slb_shadow()->save_area[entry].esid = 0; 74 get_slb_shadow()->save_area[entry].esid = 0;
65 smp_wmb(); 75 get_slb_shadow()->save_area[entry].vsid = mk_vsid_data(ea, ssize, flags);
66 get_slb_shadow()->save_area[entry].vsid = mk_vsid_data(ea, flags); 76 get_slb_shadow()->save_area[entry].esid = mk_esid_data(ea, ssize, entry);
67 smp_wmb();
68 get_slb_shadow()->save_area[entry].esid = mk_esid_data(ea, entry);
69 smp_wmb();
70} 77}
71 78
72static inline void slb_shadow_clear(unsigned long entry) 79static inline void slb_shadow_clear(unsigned long entry)
@@ -74,7 +81,8 @@ static inline void slb_shadow_clear(unsigned long entry)
74 get_slb_shadow()->save_area[entry].esid = 0; 81 get_slb_shadow()->save_area[entry].esid = 0;
75} 82}
76 83
77static inline void create_shadowed_slbe(unsigned long ea, unsigned long flags, 84static inline void create_shadowed_slbe(unsigned long ea, int ssize,
85 unsigned long flags,
78 unsigned long entry) 86 unsigned long entry)
79{ 87{
80 /* 88 /*
@@ -82,11 +90,11 @@ static inline void create_shadowed_slbe(unsigned long ea, unsigned long flags,
82 * we don't get a stale entry here if we get preempted by PHYP 90 * we don't get a stale entry here if we get preempted by PHYP
83 * between these two statements. 91 * between these two statements.
84 */ 92 */
85 slb_shadow_update(ea, flags, entry); 93 slb_shadow_update(ea, ssize, flags, entry);
86 94
87 asm volatile("slbmte %0,%1" : 95 asm volatile("slbmte %0,%1" :
88 : "r" (mk_vsid_data(ea, flags)), 96 : "r" (mk_vsid_data(ea, ssize, flags)),
89 "r" (mk_esid_data(ea, entry)) 97 "r" (mk_esid_data(ea, ssize, entry))
90 : "memory" ); 98 : "memory" );
91} 99}
92 100
@@ -95,7 +103,7 @@ void slb_flush_and_rebolt(void)
95 /* If you change this make sure you change SLB_NUM_BOLTED 103 /* If you change this make sure you change SLB_NUM_BOLTED
96 * appropriately too. */ 104 * appropriately too. */
97 unsigned long linear_llp, vmalloc_llp, lflags, vflags; 105 unsigned long linear_llp, vmalloc_llp, lflags, vflags;
98 unsigned long ksp_esid_data; 106 unsigned long ksp_esid_data, ksp_vsid_data;
99 107
100 WARN_ON(!irqs_disabled()); 108 WARN_ON(!irqs_disabled());
101 109
@@ -104,13 +112,15 @@ void slb_flush_and_rebolt(void)
104 lflags = SLB_VSID_KERNEL | linear_llp; 112 lflags = SLB_VSID_KERNEL | linear_llp;
105 vflags = SLB_VSID_KERNEL | vmalloc_llp; 113 vflags = SLB_VSID_KERNEL | vmalloc_llp;
106 114
107 ksp_esid_data = mk_esid_data(get_paca()->kstack, 2); 115 ksp_esid_data = mk_esid_data(get_paca()->kstack, mmu_kernel_ssize, 2);
108 if ((ksp_esid_data & ESID_MASK) == PAGE_OFFSET) { 116 if ((ksp_esid_data & ~0xfffffffUL) <= PAGE_OFFSET) {
109 ksp_esid_data &= ~SLB_ESID_V; 117 ksp_esid_data &= ~SLB_ESID_V;
118 ksp_vsid_data = 0;
110 slb_shadow_clear(2); 119 slb_shadow_clear(2);
111 } else { 120 } else {
112 /* Update stack entry; others don't change */ 121 /* Update stack entry; others don't change */
113 slb_shadow_update(get_paca()->kstack, lflags, 2); 122 slb_shadow_update(get_paca()->kstack, mmu_kernel_ssize, lflags, 2);
123 ksp_vsid_data = get_slb_shadow()->save_area[2].vsid;
114 } 124 }
115 125
116 /* We need to do this all in asm, so we're sure we don't touch 126 /* We need to do this all in asm, so we're sure we don't touch
@@ -122,9 +132,9 @@ void slb_flush_and_rebolt(void)
122 /* Slot 2 - kernel stack */ 132 /* Slot 2 - kernel stack */
123 "slbmte %2,%3\n" 133 "slbmte %2,%3\n"
124 "isync" 134 "isync"
125 :: "r"(mk_vsid_data(VMALLOC_START, vflags)), 135 :: "r"(mk_vsid_data(VMALLOC_START, mmu_kernel_ssize, vflags)),
126 "r"(mk_esid_data(VMALLOC_START, 1)), 136 "r"(mk_esid_data(VMALLOC_START, mmu_kernel_ssize, 1)),
127 "r"(mk_vsid_data(ksp_esid_data, lflags)), 137 "r"(ksp_vsid_data),
128 "r"(ksp_esid_data) 138 "r"(ksp_esid_data)
129 : "memory"); 139 : "memory");
130} 140}
@@ -134,7 +144,7 @@ void slb_vmalloc_update(void)
134 unsigned long vflags; 144 unsigned long vflags;
135 145
136 vflags = SLB_VSID_KERNEL | mmu_psize_defs[mmu_vmalloc_psize].sllp; 146 vflags = SLB_VSID_KERNEL | mmu_psize_defs[mmu_vmalloc_psize].sllp;
137 slb_shadow_update(VMALLOC_START, vflags, 1); 147 slb_shadow_update(VMALLOC_START, mmu_kernel_ssize, vflags, 1);
138 slb_flush_and_rebolt(); 148 slb_flush_and_rebolt();
139} 149}
140 150
@@ -142,7 +152,7 @@ void slb_vmalloc_update(void)
142void switch_slb(struct task_struct *tsk, struct mm_struct *mm) 152void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
143{ 153{
144 unsigned long offset = get_paca()->slb_cache_ptr; 154 unsigned long offset = get_paca()->slb_cache_ptr;
145 unsigned long esid_data = 0; 155 unsigned long slbie_data = 0;
146 unsigned long pc = KSTK_EIP(tsk); 156 unsigned long pc = KSTK_EIP(tsk);
147 unsigned long stack = KSTK_ESP(tsk); 157 unsigned long stack = KSTK_ESP(tsk);
148 unsigned long unmapped_base; 158 unsigned long unmapped_base;
@@ -151,9 +161,12 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
151 int i; 161 int i;
152 asm volatile("isync" : : : "memory"); 162 asm volatile("isync" : : : "memory");
153 for (i = 0; i < offset; i++) { 163 for (i = 0; i < offset; i++) {
154 esid_data = ((unsigned long)get_paca()->slb_cache[i] 164 slbie_data = (unsigned long)get_paca()->slb_cache[i]
155 << SID_SHIFT) | SLBIE_C; 165 << SID_SHIFT; /* EA */
156 asm volatile("slbie %0" : : "r" (esid_data)); 166 slbie_data |= user_segment_size(slbie_data)
167 << SLBIE_SSIZE_SHIFT;
168 slbie_data |= SLBIE_C; /* C set for user addresses */
169 asm volatile("slbie %0" : : "r" (slbie_data));
157 } 170 }
158 asm volatile("isync" : : : "memory"); 171 asm volatile("isync" : : : "memory");
159 } else { 172 } else {
@@ -162,7 +175,7 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
162 175
163 /* Workaround POWER5 < DD2.1 issue */ 176 /* Workaround POWER5 < DD2.1 issue */
164 if (offset == 1 || offset > SLB_CACHE_ENTRIES) 177 if (offset == 1 || offset > SLB_CACHE_ENTRIES)
165 asm volatile("slbie %0" : : "r" (esid_data)); 178 asm volatile("slbie %0" : : "r" (slbie_data));
166 179
167 get_paca()->slb_cache_ptr = 0; 180 get_paca()->slb_cache_ptr = 0;
168 get_paca()->context = mm->context; 181 get_paca()->context = mm->context;
@@ -245,9 +258,9 @@ void slb_initialize(void)
245 asm volatile("isync":::"memory"); 258 asm volatile("isync":::"memory");
246 asm volatile("slbmte %0,%0"::"r" (0) : "memory"); 259 asm volatile("slbmte %0,%0"::"r" (0) : "memory");
247 asm volatile("isync; slbia; isync":::"memory"); 260 asm volatile("isync; slbia; isync":::"memory");
248 create_shadowed_slbe(PAGE_OFFSET, lflags, 0); 261 create_shadowed_slbe(PAGE_OFFSET, mmu_kernel_ssize, lflags, 0);
249 262
250 create_shadowed_slbe(VMALLOC_START, vflags, 1); 263 create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1);
251 264
252 /* We don't bolt the stack for the time being - we're in boot, 265 /* We don't bolt the stack for the time being - we're in boot,
253 * so the stack is in the bolted segment. By the time it goes 266 * so the stack is in the bolted segment. By the time it goes
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S
index cd1a93d4948c..1328a81a84aa 100644
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -57,7 +57,10 @@ _GLOBAL(slb_allocate_realmode)
57 */ 57 */
58_GLOBAL(slb_miss_kernel_load_linear) 58_GLOBAL(slb_miss_kernel_load_linear)
59 li r11,0 59 li r11,0
60BEGIN_FTR_SECTION
60 b slb_finish_load 61 b slb_finish_load
62END_FTR_SECTION_IFCLR(CPU_FTR_1T_SEGMENT)
63 b slb_finish_load_1T
61 64
621: /* vmalloc/ioremap mapping encoding bits, the "li" instructions below 651: /* vmalloc/ioremap mapping encoding bits, the "li" instructions below
63 * will be patched by the kernel at boot 66 * will be patched by the kernel at boot
@@ -68,13 +71,16 @@ BEGIN_FTR_SECTION
68 cmpldi r11,(VMALLOC_SIZE >> 28) - 1 71 cmpldi r11,(VMALLOC_SIZE >> 28) - 1
69 bgt 5f 72 bgt 5f
70 lhz r11,PACAVMALLOCSLLP(r13) 73 lhz r11,PACAVMALLOCSLLP(r13)
71 b slb_finish_load 74 b 6f
725: 755:
73END_FTR_SECTION_IFCLR(CPU_FTR_CI_LARGE_PAGE) 76END_FTR_SECTION_IFCLR(CPU_FTR_CI_LARGE_PAGE)
74_GLOBAL(slb_miss_kernel_load_io) 77_GLOBAL(slb_miss_kernel_load_io)
75 li r11,0 78 li r11,0
796:
80BEGIN_FTR_SECTION
76 b slb_finish_load 81 b slb_finish_load
77 82END_FTR_SECTION_IFCLR(CPU_FTR_1T_SEGMENT)
83 b slb_finish_load_1T
78 84
790: /* user address: proto-VSID = context << 15 | ESID. First check 850: /* user address: proto-VSID = context << 15 | ESID. First check
80 * if the address is within the boundaries of the user region 86 * if the address is within the boundaries of the user region
@@ -122,7 +128,13 @@ _GLOBAL(slb_miss_kernel_load_io)
122#endif /* CONFIG_PPC_MM_SLICES */ 128#endif /* CONFIG_PPC_MM_SLICES */
123 129
124 ld r9,PACACONTEXTID(r13) 130 ld r9,PACACONTEXTID(r13)
131BEGIN_FTR_SECTION
132 cmpldi r10,0x1000
133END_FTR_SECTION_IFSET(CPU_FTR_1T_SEGMENT)
125 rldimi r10,r9,USER_ESID_BITS,0 134 rldimi r10,r9,USER_ESID_BITS,0
135BEGIN_FTR_SECTION
136 bge slb_finish_load_1T
137END_FTR_SECTION_IFSET(CPU_FTR_1T_SEGMENT)
126 b slb_finish_load 138 b slb_finish_load
127 139
1288: /* invalid EA */ 1408: /* invalid EA */
@@ -188,7 +200,7 @@ _GLOBAL(slb_allocate_user)
188 * r3 = EA, r10 = proto-VSID, r11 = flags, clobbers r9, cr7 = <> PAGE_OFFSET 200 * r3 = EA, r10 = proto-VSID, r11 = flags, clobbers r9, cr7 = <> PAGE_OFFSET
189 */ 201 */
190slb_finish_load: 202slb_finish_load:
191 ASM_VSID_SCRAMBLE(r10,r9) 203 ASM_VSID_SCRAMBLE(r10,r9,256M)
192 rldimi r11,r10,SLB_VSID_SHIFT,16 /* combine VSID and flags */ 204 rldimi r11,r10,SLB_VSID_SHIFT,16 /* combine VSID and flags */
193 205
194 /* r3 = EA, r11 = VSID data */ 206 /* r3 = EA, r11 = VSID data */
@@ -213,7 +225,7 @@ BEGIN_FW_FTR_SECTION
213END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) 225END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
214#endif /* CONFIG_PPC_ISERIES */ 226#endif /* CONFIG_PPC_ISERIES */
215 227
216 ld r10,PACASTABRR(r13) 2287: ld r10,PACASTABRR(r13)
217 addi r10,r10,1 229 addi r10,r10,1
218 /* use a cpu feature mask if we ever change our slb size */ 230 /* use a cpu feature mask if we ever change our slb size */
219 cmpldi r10,SLB_NUM_ENTRIES 231 cmpldi r10,SLB_NUM_ENTRIES
@@ -259,3 +271,20 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
259 crclr 4*cr0+eq /* set result to "success" */ 271 crclr 4*cr0+eq /* set result to "success" */
260 blr 272 blr
261 273
274/*
275 * Finish loading of a 1T SLB entry (for the kernel linear mapping) and return.
276 * We assume legacy iSeries will never have 1T segments.
277 *
278 * r3 = EA, r10 = proto-VSID, r11 = flags, clobbers r9
279 */
280slb_finish_load_1T:
281 srdi r10,r10,40-28 /* get 1T ESID */
282 ASM_VSID_SCRAMBLE(r10,r9,1T)
283 rldimi r11,r10,SLB_VSID_SHIFT_1T,16 /* combine VSID and flags */
284 li r10,MMU_SEGSIZE_1T
285 rldimi r11,r10,SLB_VSID_SSIZE_SHIFT,0 /* insert segment size */
286
287 /* r3 = EA, r11 = VSID data */
288 clrrdi r3,r3,SID_SHIFT_1T /* clear out non-ESID bits */
289 b 7b
290
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/mm/stab.c b/arch/powerpc/mm/stab.c
index 28492bbdee8e..9e85bda76216 100644
--- a/arch/powerpc/mm/stab.c
+++ b/arch/powerpc/mm/stab.c
@@ -122,12 +122,12 @@ static int __ste_allocate(unsigned long ea, struct mm_struct *mm)
122 122
123 /* Kernel or user address? */ 123 /* Kernel or user address? */
124 if (is_kernel_addr(ea)) { 124 if (is_kernel_addr(ea)) {
125 vsid = get_kernel_vsid(ea); 125 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M);
126 } else { 126 } else {
127 if ((ea >= TASK_SIZE_USER64) || (! mm)) 127 if ((ea >= TASK_SIZE_USER64) || (! mm))
128 return 1; 128 return 1;
129 129
130 vsid = get_vsid(mm->context.id, ea); 130 vsid = get_vsid(mm->context.id, ea, MMU_SEGSIZE_256M);
131 } 131 }
132 132
133 stab_entry = make_ste(get_paca()->stab_addr, GET_ESID(ea), vsid); 133 stab_entry = make_ste(get_paca()->stab_addr, GET_ESID(ea), vsid);
@@ -261,7 +261,7 @@ void __init stabs_alloc(void)
261 */ 261 */
262void stab_initialize(unsigned long stab) 262void stab_initialize(unsigned long stab)
263{ 263{
264 unsigned long vsid = get_kernel_vsid(PAGE_OFFSET); 264 unsigned long vsid = get_kernel_vsid(PAGE_OFFSET, MMU_SEGSIZE_256M);
265 unsigned long stabreal; 265 unsigned long stabreal;
266 266
267 asm volatile("isync; slbia; isync":::"memory"); 267 asm volatile("isync; slbia; isync":::"memory");
diff --git a/arch/powerpc/mm/tlb_64.c b/arch/powerpc/mm/tlb_64.c
index cbd34fc813ee..eafbca52bff9 100644
--- a/arch/powerpc/mm/tlb_64.c
+++ b/arch/powerpc/mm/tlb_64.c
@@ -132,6 +132,7 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
132 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 132 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
133 unsigned long vsid, vaddr; 133 unsigned long vsid, vaddr;
134 unsigned int psize; 134 unsigned int psize;
135 int ssize;
135 real_pte_t rpte; 136 real_pte_t rpte;
136 int i; 137 int i;
137 138
@@ -161,11 +162,14 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
161 162
162 /* Build full vaddr */ 163 /* Build full vaddr */
163 if (!is_kernel_addr(addr)) { 164 if (!is_kernel_addr(addr)) {
164 vsid = get_vsid(mm->context.id, addr); 165 ssize = user_segment_size(addr);
166 vsid = get_vsid(mm->context.id, addr, ssize);
165 WARN_ON(vsid == 0); 167 WARN_ON(vsid == 0);
166 } else 168 } else {
167 vsid = get_kernel_vsid(addr); 169 vsid = get_kernel_vsid(addr, mmu_kernel_ssize);
168 vaddr = (vsid << 28 ) | (addr & 0x0fffffff); 170 ssize = mmu_kernel_ssize;
171 }
172 vaddr = hpt_va(addr, vsid, ssize);
169 rpte = __real_pte(__pte(pte), ptep); 173 rpte = __real_pte(__pte(pte), ptep);
170 174
171 /* 175 /*
@@ -175,7 +179,7 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
175 * and decide to use local invalidates instead... 179 * and decide to use local invalidates instead...
176 */ 180 */
177 if (!batch->active) { 181 if (!batch->active) {
178 flush_hash_page(vaddr, rpte, psize, 0); 182 flush_hash_page(vaddr, rpte, psize, ssize, 0);
179 return; 183 return;
180 } 184 }
181 185
@@ -189,13 +193,15 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr,
189 * We also need to ensure only one page size is present in a given 193 * We also need to ensure only one page size is present in a given
190 * batch 194 * batch
191 */ 195 */
192 if (i != 0 && (mm != batch->mm || batch->psize != psize)) { 196 if (i != 0 && (mm != batch->mm || batch->psize != psize ||
197 batch->ssize != ssize)) {
193 __flush_tlb_pending(batch); 198 __flush_tlb_pending(batch);
194 i = 0; 199 i = 0;
195 } 200 }
196 if (i == 0) { 201 if (i == 0) {
197 batch->mm = mm; 202 batch->mm = mm;
198 batch->psize = psize; 203 batch->psize = psize;
204 batch->ssize = ssize;
199 } 205 }
200 batch->pte[i] = rpte; 206 batch->pte[i] = rpte;
201 batch->vaddr[i] = vaddr; 207 batch->vaddr[i] = vaddr;
@@ -222,7 +228,7 @@ void __flush_tlb_pending(struct ppc64_tlb_batch *batch)
222 local = 1; 228 local = 1;
223 if (i == 1) 229 if (i == 1)
224 flush_hash_page(batch->vaddr[0], batch->pte[0], 230 flush_hash_page(batch->vaddr[0], batch->pte[0],
225 batch->psize, local); 231 batch->psize, batch->ssize, local);
226 else 232 else
227 flush_hash_range(i, local); 233 flush_hash_range(i, local);
228 batch->index = 0; 234 batch->index = 0;
diff --git a/arch/powerpc/oprofile/cell/pr_util.h b/arch/powerpc/oprofile/cell/pr_util.h
index e5704f00c8b4..22e4e8d4eb2c 100644
--- a/arch/powerpc/oprofile/cell/pr_util.h
+++ b/arch/powerpc/oprofile/cell/pr_util.h
@@ -17,10 +17,9 @@
17#include <linux/cpumask.h> 17#include <linux/cpumask.h>
18#include <linux/oprofile.h> 18#include <linux/oprofile.h>
19#include <asm/cell-pmu.h> 19#include <asm/cell-pmu.h>
20#include <asm/cell-regs.h>
20#include <asm/spu.h> 21#include <asm/spu.h>
21 22
22#include "../../platforms/cell/cbe_regs.h"
23
24/* Defines used for sync_start */ 23/* Defines used for sync_start */
25#define SKIP_GENERIC_SYNC 0 24#define SKIP_GENERIC_SYNC 0
26#define SYNC_START_ERROR -1 25#define SYNC_START_ERROR -1
diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
index d928b54f3a0f..bb6bff51ce48 100644
--- a/arch/powerpc/oprofile/op_model_cell.c
+++ b/arch/powerpc/oprofile/op_model_cell.c
@@ -35,9 +35,9 @@
35#include <asm/reg.h> 35#include <asm/reg.h>
36#include <asm/rtas.h> 36#include <asm/rtas.h>
37#include <asm/system.h> 37#include <asm/system.h>
38#include <asm/cell-regs.h>
38 39
39#include "../platforms/cell/interrupt.h" 40#include "../platforms/cell/interrupt.h"
40#include "../platforms/cell/cbe_regs.h"
41#include "cell/pr_util.h" 41#include "cell/pr_util.h"
42 42
43static void cell_global_stop_spu(void); 43static void cell_global_stop_spu(void);
diff --git a/arch/powerpc/platforms/4xx/Kconfig b/arch/powerpc/platforms/40x/Kconfig
index ded357c17414..47b3b0a3864a 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
@@ -42,6 +29,13 @@ menu "AMCC 40x options"
42# help 29# help
43# This option enables support for the extra features of the EP405PC board. 30# This option enables support for the extra features of the EP405PC board.
44 31
32config KILAUEA
33 bool "Kilauea"
34 depends on 40x
35 default n
36 help
37 This option enables support for the AMCC PPC405EX evaluation board.
38
45#config REDWOOD_5 39#config REDWOOD_5
46# bool "Redwood-5" 40# bool "Redwood-5"
47# depends on 40x 41# depends on 40x
@@ -66,23 +60,30 @@ menu "AMCC 40x options"
66# help 60# help
67# This option enables support for the IBM PPC405GPr evaluation board. 61# This option enables support for the IBM PPC405GPr evaluation board.
68 62
69#config WALNUT 63config WALNUT
70# bool "Walnut" 64 bool "Walnut"
71# depends on 40x 65 depends on 40x
72# default y 66 default y
73# select 405GP 67 select 405GP
74# help 68 help
75# This option enables support for the IBM PPC405GP evaluation board. 69 This option enables support for the IBM PPC405GP evaluation board.
76 70
77#config XILINX_ML300 71config XILINX_VIRTEX_GENERIC_BOARD
78# bool "Xilinx-ML300" 72 bool "Generic Xilinx Virtex board"
79# depends on 40x 73 depends on 40x
80# default y 74 default n
81# select VIRTEX_II_PRO 75 select XILINX_VIRTEX_II_PRO
82# help 76 select XILINX_VIRTEX_4_FX
83# This option enables support for the Xilinx ML300 evaluation board. 77 help
78 This option enables generic support for Xilinx Virtex based boards.
79
80 The generic virtex board support matches any device tree which
81 specifies 'xilinx,virtex' in its compatible field. This includes
82 the Xilinx ML3xx and ML4xx reference designs using the powerpc
83 core.
84 84
85endmenu 85 Most Virtex designs should use this unless it needs to do some
86 special configuration at board probe time.
86 87
87# 40x specific CPU modules, selected based on the board above. 88# 40x specific CPU modules, selected based on the board above.
88config NP405H 89config NP405H
@@ -106,11 +107,19 @@ config 405EP
106config 405GPR 107config 405GPR
107 bool 108 bool
108 109
109config VIRTEX_II_PRO 110config XILINX_VIRTEX
111 bool
112
113config XILINX_VIRTEX_II_PRO
110 bool 114 bool
115 select XILINX_VIRTEX
111 select IBM405_ERR77 116 select IBM405_ERR77
112 select IBM405_ERR51 117 select IBM405_ERR51
113 118
119config XILINX_VIRTEX_4_FX
120 bool
121 select XILINX_VIRTEX
122
114config STB03xxx 123config STB03xxx
115 bool 124 bool
116 select IBM405_ERR77 125 select IBM405_ERR77
@@ -126,73 +135,6 @@ config IBM405_ERR77
126config IBM405_ERR51 135config IBM405_ERR51
127 bool 136 bool
128 137
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
192# bool
193# depends on XILINX_ML300
194# default y
195
196#config BIOS_FIXUP 138#config BIOS_FIXUP
197# bool 139# bool
198# depends on BUBINGA || EP405 || SYCAMORE || WALNUT 140# depends on BUBINGA || EP405 || SYCAMORE || WALNUT
diff --git a/arch/powerpc/platforms/40x/Makefile b/arch/powerpc/platforms/40x/Makefile
new file mode 100644
index 000000000000..51dadeee6fc6
--- /dev/null
+++ b/arch/powerpc/platforms/40x/Makefile
@@ -0,0 +1,3 @@
1obj-$(CONFIG_KILAUEA) += kilauea.o
2obj-$(CONFIG_WALNUT) += walnut.o
3obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o
diff --git a/arch/powerpc/platforms/40x/kilauea.c b/arch/powerpc/platforms/40x/kilauea.c
new file mode 100644
index 000000000000..1bffdbdd21b1
--- /dev/null
+++ b/arch/powerpc/platforms/40x/kilauea.c
@@ -0,0 +1,58 @@
1/*
2 * Kilauea board specific routines
3 *
4 * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
5 *
6 * Based on the Walnut code by
7 * Josh Boyer <jwboyer@linux.vnet.ibm.com>
8 * Copyright 2007 IBM Corporation
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15#include <linux/init.h>
16#include <linux/of_platform.h>
17#include <asm/machdep.h>
18#include <asm/prom.h>
19#include <asm/udbg.h>
20#include <asm/time.h>
21#include <asm/uic.h>
22
23static struct of_device_id kilauea_of_bus[] = {
24 { .compatible = "ibm,plb4", },
25 { .compatible = "ibm,opb", },
26 { .compatible = "ibm,ebc", },
27 {},
28};
29
30static int __init kilauea_device_probe(void)
31{
32 if (!machine_is(kilauea))
33 return 0;
34
35 of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
36
37 return 0;
38}
39device_initcall(kilauea_device_probe);
40
41static int __init kilauea_probe(void)
42{
43 unsigned long root = of_get_flat_dt_root();
44
45 if (!of_flat_dt_is_compatible(root, "amcc,kilauea"))
46 return 0;
47
48 return 1;
49}
50
51define_machine(kilauea) {
52 .name = "Kilauea",
53 .probe = kilauea_probe,
54 .progress = udbg_progress,
55 .init_IRQ = uic_init_tree,
56 .get_irq = uic_get_irq,
57 .calibrate_decr = generic_calibrate_decr,
58};
diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
new file mode 100644
index 000000000000..14bbc328170f
--- /dev/null
+++ b/arch/powerpc/platforms/40x/virtex.c
@@ -0,0 +1,45 @@
1/*
2 * Xilinx Virtex (IIpro & 4FX) based board support
3 *
4 * Copyright 2007 Secret Lab Technologies Ltd.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11#include <linux/init.h>
12#include <linux/of_platform.h>
13#include <asm/machdep.h>
14#include <asm/prom.h>
15#include <asm/time.h>
16#include <asm/xilinx_intc.h>
17
18static int __init virtex_device_probe(void)
19{
20 if (!machine_is(virtex))
21 return 0;
22
23 of_platform_bus_probe(NULL, NULL, NULL);
24
25 return 0;
26}
27device_initcall(virtex_device_probe);
28
29static int __init virtex_probe(void)
30{
31 unsigned long root = of_get_flat_dt_root();
32
33 if (!of_flat_dt_is_compatible(root, "xilinx,virtex"))
34 return 0;
35
36 return 1;
37}
38
39define_machine(virtex) {
40 .name = "Xilinx Virtex",
41 .probe = virtex_probe,
42 .init_IRQ = xilinx_intc_init_tree,
43 .get_irq = xilinx_intc_get_irq,
44 .calibrate_decr = generic_calibrate_decr,
45};
diff --git a/arch/powerpc/platforms/40x/walnut.c b/arch/powerpc/platforms/40x/walnut.c
new file mode 100644
index 000000000000..eb0c136b1c44
--- /dev/null
+++ b/arch/powerpc/platforms/40x/walnut.c
@@ -0,0 +1,63 @@
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
56define_machine(walnut) {
57 .name = "Walnut",
58 .probe = walnut_probe,
59 .progress = udbg_progress,
60 .init_IRQ = uic_init_tree,
61 .get_irq = uic_get_irq,
62 .calibrate_decr = generic_calibrate_decr,
63};
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index 8e66949e7c67..51f3ea40a285 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
@@ -48,7 +64,7 @@ config 440SP
48 64
49config 440A 65config 440A
50 bool 66 bool
51 depends on 440GX 67 depends on 440GX || 440EPX
52 default y 68 default y
53 69
54# 44x errata/workaround config symbols, selected by the CPU models above 70# 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..470e1a3fd755
--- /dev/null
+++ b/arch/powerpc/platforms/44x/bamboo.c
@@ -0,0 +1,61 @@
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
53define_machine(bamboo) {
54 .name = "Bamboo",
55 .probe = bamboo_probe,
56 .progress = udbg_progress,
57 .init_IRQ = uic_init_tree,
58 .get_irq = uic_get_irq,
59 .restart = ppc44x_reset_system,
60 .calibrate_decr = generic_calibrate_decr,
61};
diff --git a/arch/powerpc/platforms/44x/ebony.c b/arch/powerpc/platforms/44x/ebony.c
index 5a7fec8d10d3..40e18fcb666c 100644
--- a/arch/powerpc/platforms/44x/ebony.c
+++ b/arch/powerpc/platforms/44x/ebony.c
@@ -57,14 +57,9 @@ static int __init ebony_probe(void)
57 return 1; 57 return 1;
58} 58}
59 59
60static void __init ebony_setup_arch(void)
61{
62}
63
64define_machine(ebony) { 60define_machine(ebony) {
65 .name = "Ebony", 61 .name = "Ebony",
66 .probe = ebony_probe, 62 .probe = ebony_probe,
67 .setup_arch = ebony_setup_arch,
68 .progress = udbg_progress, 63 .progress = udbg_progress,
69 .init_IRQ = uic_init_tree, 64 .init_IRQ = uic_init_tree,
70 .get_irq = uic_get_irq, 65 .get_irq = uic_get_irq,
diff --git a/arch/powerpc/platforms/44x/sequoia.c b/arch/powerpc/platforms/44x/sequoia.c
new file mode 100644
index 000000000000..30700b31d43b
--- /dev/null
+++ b/arch/powerpc/platforms/44x/sequoia.c
@@ -0,0 +1,61 @@
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
53define_machine(sequoia) {
54 .name = "Sequoia",
55 .probe = sequoia_probe,
56 .progress = udbg_progress,
57 .init_IRQ = uic_init_tree,
58 .get_irq = uic_get_irq,
59 .restart = ppc44x_reset_system,
60 .calibrate_decr = generic_calibrate_decr,
61};
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..a0da70c8b502 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -9,33 +9,16 @@
9 * kind, whether express or implied. 9 * kind, whether express or implied.
10 */ 10 */
11 11
12#include <linux/errno.h>
13#include <linux/kernel.h>
14#include <linux/slab.h>
15#include <linux/reboot.h>
16#include <linux/init.h> 12#include <linux/init.h>
17#include <linux/utsrelease.h> 13#include <linux/utsrelease.h>
18#include <linux/seq_file.h>
19#include <linux/string.h>
20#include <linux/root_dev.h>
21#include <linux/initrd.h>
22#include <linux/timer.h>
23#include <linux/pci.h> 14#include <linux/pci.h>
24 15#include <linux/of.h>
25#include <asm/io.h>
26#include <asm/irq.h>
27#include <asm/sections.h>
28#include <asm/pci-bridge.h>
29#include <asm/pgtable.h>
30#include <asm/prom.h> 16#include <asm/prom.h>
31#include <asm/time.h> 17#include <asm/time.h>
32#include <asm/machdep.h> 18#include <asm/machdep.h>
33#include <asm/rtas.h> 19#include <asm/rtas.h>
34#include <asm/of_device.h>
35#include <asm/of_platform.h>
36#include <asm/mpc52xx.h> 20#include <asm/mpc52xx.h>
37 21
38
39#define EFIKA_PLATFORM_NAME "Efika" 22#define EFIKA_PLATFORM_NAME "Efika"
40 23
41 24
@@ -78,8 +61,8 @@ static int rtas_write_config(struct pci_bus *bus, unsigned int devfn,
78} 61}
79 62
80static struct pci_ops rtas_pci_ops = { 63static struct pci_ops rtas_pci_ops = {
81 rtas_read_config, 64 .read = rtas_read_config,
82 rtas_write_config 65 .write = rtas_write_config,
83}; 66};
84 67
85 68
@@ -197,15 +180,6 @@ static void __init efika_setup_arch(void)
197{ 180{
198 rtas_initialize(); 181 rtas_initialize();
199 182
200#ifdef CONFIG_BLK_DEV_INITRD
201 initrd_below_start_ok = 1;
202
203 if (initrd_start)
204 ROOT_DEV = Root_RAM0;
205 else
206#endif
207 ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */
208
209 efika_pcisetup(); 183 efika_pcisetup();
210 184
211#ifdef CONFIG_PM 185#ifdef CONFIG_PM
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 5c46e898fd45..0caa3d955c3b 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -15,33 +15,13 @@
15 15
16#undef DEBUG 16#undef DEBUG
17 17
18#include <linux/stddef.h>
19#include <linux/kernel.h>
20#include <linux/init.h> 18#include <linux/init.h>
21#include <linux/errno.h>
22#include <linux/reboot.h>
23#include <linux/pci.h> 19#include <linux/pci.h>
24#include <linux/kdev_t.h> 20#include <linux/of.h>
25#include <linux/major.h>
26#include <linux/console.h>
27#include <linux/delay.h>
28#include <linux/seq_file.h>
29#include <linux/root_dev.h>
30#include <linux/initrd.h>
31
32#include <asm/system.h>
33#include <asm/atomic.h>
34#include <asm/time.h> 21#include <asm/time.h>
35#include <asm/io.h> 22#include <asm/io.h>
36#include <asm/machdep.h> 23#include <asm/machdep.h>
37#include <asm/ipic.h>
38#include <asm/bootinfo.h>
39#include <asm/irq.h>
40#include <asm/prom.h> 24#include <asm/prom.h>
41#include <asm/udbg.h>
42#include <sysdev/fsl_soc.h>
43#include <asm/of_platform.h>
44
45#include <asm/mpc52xx.h> 25#include <asm/mpc52xx.h>
46 26
47/* ************************************************************************ 27/* ************************************************************************
@@ -50,19 +30,56 @@
50 * 30 *
51 */ 31 */
52 32
33/*
34 * Fix clock configuration.
35 *
36 * Firmware is supposed to be responsible for this. If you are creating a
37 * new board port, do *NOT* duplicate this code. Fix your boot firmware
38 * to set it correctly in the first place
39 */
40static void __init
41lite5200_fix_clock_config(void)
42{
43 struct mpc52xx_cdm __iomem *cdm;
44
45 /* Map zones */
46 cdm = mpc52xx_find_and_map("mpc5200-cdm");
47 if (!cdm) {
48 printk(KERN_ERR "%s() failed; expect abnormal behaviour\n",
49 __FUNCTION__);
50 return;
51 }
52
53 /* Use internal 48 Mhz */
54 out_8(&cdm->ext_48mhz_en, 0x00);
55 out_8(&cdm->fd_enable, 0x01);
56 if (in_be32(&cdm->rstcfg) & 0x40) /* Assumes 33Mhz clock */
57 out_be16(&cdm->fd_counters, 0x0001);
58 else
59 out_be16(&cdm->fd_counters, 0x5555);
60
61 /* Unmap the regs */
62 iounmap(cdm);
63}
64
65/*
66 * Fix setting of port_config register.
67 *
68 * Firmware is supposed to be responsible for this. If you are creating a
69 * new board port, do *NOT* duplicate this code. Fix your boot firmware
70 * to set it correctly in the first place
71 */
53static void __init 72static void __init
54lite5200_setup_cpu(void) 73lite5200_fix_port_config(void)
55{ 74{
56 struct mpc52xx_gpio __iomem *gpio; 75 struct mpc52xx_gpio __iomem *gpio;
57 u32 port_config; 76 u32 port_config;
58 77
59 /* Map zones */
60 gpio = mpc52xx_find_and_map("mpc5200-gpio"); 78 gpio = mpc52xx_find_and_map("mpc5200-gpio");
61 if (!gpio) { 79 if (!gpio) {
62 printk(KERN_ERR __FILE__ ": " 80 printk(KERN_ERR "%s() failed. expect abnormal behavior\n",
63 "Error while mapping GPIO register for port config. " 81 __FUNCTION__);
64 "Expect some abnormal behavior\n"); 82 return;
65 goto error;
66 } 83 }
67 84
68 /* Set port config */ 85 /* Set port config */
@@ -81,12 +98,10 @@ lite5200_setup_cpu(void)
81 out_be32(&gpio->port_config, port_config); 98 out_be32(&gpio->port_config, port_config);
82 99
83 /* Unmap zone */ 100 /* Unmap zone */
84error:
85 iounmap(gpio); 101 iounmap(gpio);
86} 102}
87 103
88#ifdef CONFIG_PM 104#ifdef CONFIG_PM
89static u32 descr_a;
90static void lite5200_suspend_prepare(void __iomem *mbar) 105static void lite5200_suspend_prepare(void __iomem *mbar)
91{ 106{
92 u8 pin = 1; /* GPIO_WKUP_1 (GPIO_PSC2_4) */ 107 u8 pin = 1; /* GPIO_WKUP_1 (GPIO_PSC2_4) */
@@ -97,42 +112,41 @@ static void lite5200_suspend_prepare(void __iomem *mbar)
97 * power down usb port 112 * power down usb port
98 * this needs to be called before of-ohci suspend code 113 * this needs to be called before of-ohci suspend code
99 */ 114 */
100 descr_a = in_be32(mbar + 0x1048); 115
101 out_be32(mbar + 0x1048, (descr_a & ~0x200) | 0x100); 116 /* set ports to "power switched" and "powered at the same time"
117 * USB Rh descriptor A: NPS = 0, PSM = 0 */
118 out_be32(mbar + 0x1048, in_be32(mbar + 0x1048) & ~0x300);
119 /* USB Rh status: LPS = 1 - turn off power */
120 out_be32(mbar + 0x1050, 0x00000001);
102} 121}
103 122
104static void lite5200_resume_finish(void __iomem *mbar) 123static void lite5200_resume_finish(void __iomem *mbar)
105{ 124{
106 out_be32(mbar + 0x1048, descr_a); 125 /* USB Rh status: LPSC = 1 - turn on power */
126 out_be32(mbar + 0x1050, 0x00010000);
107} 127}
108#endif 128#endif
109 129
110static void __init lite5200_setup_arch(void) 130static void __init lite5200_setup_arch(void)
111{ 131{
132#ifdef CONFIG_PCI
112 struct device_node *np; 133 struct device_node *np;
134#endif
113 135
114 if (ppc_md.progress) 136 if (ppc_md.progress)
115 ppc_md.progress("lite5200_setup_arch()", 0); 137 ppc_md.progress("lite5200_setup_arch()", 0);
116 138
117 np = of_find_node_by_type(NULL, "cpu"); 139 /* Fix things that firmware should have done. */
118 if (np) { 140 lite5200_fix_clock_config();
119 const unsigned int *fp = 141 lite5200_fix_port_config();
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 142
128 /* CPU & Port mux setup */ 143 /* Some mpc5200 & mpc5200b related configuration */
129 mpc52xx_setup_cpu(); /* Generic */ 144 mpc5200_setup_xlb_arbiter();
130 lite5200_setup_cpu(); /* Platorm specific */
131 145
132#ifdef CONFIG_PM 146#ifdef CONFIG_PM
133 mpc52xx_suspend.board_suspend_prepare = lite5200_suspend_prepare; 147 mpc52xx_suspend.board_suspend_prepare = lite5200_suspend_prepare;
134 mpc52xx_suspend.board_resume_finish = lite5200_resume_finish; 148 mpc52xx_suspend.board_resume_finish = lite5200_resume_finish;
135 mpc52xx_pm_init(); 149 lite5200_pm_init();
136#endif 150#endif
137 151
138#ifdef CONFIG_PCI 152#ifdef CONFIG_PCI
@@ -156,20 +170,6 @@ static void __init lite5200_setup_arch(void)
156 170
157} 171}
158 172
159static void lite5200_show_cpuinfo(struct seq_file *m)
160{
161 struct device_node* np = of_find_all_nodes(NULL);
162 const char *model = NULL;
163
164 if (np)
165 model = of_get_property(np, "model", NULL);
166
167 seq_printf(m, "vendor\t\t: Freescale Semiconductor\n");
168 seq_printf(m, "machine\t\t: %s\n", model ? model : "unknown");
169
170 of_node_put(np);
171}
172
173/* 173/*
174 * Called very early, MMU is off, device-tree isn't unflattened 174 * Called very early, MMU is off, device-tree isn't unflattened
175 */ 175 */
@@ -193,6 +193,5 @@ define_machine(lite5200) {
193 .init = mpc52xx_declare_of_platform_devices, 193 .init = mpc52xx_declare_of_platform_devices,
194 .init_IRQ = mpc52xx_init_irq, 194 .init_IRQ = mpc52xx_init_irq,
195 .get_irq = mpc52xx_get_irq, 195 .get_irq = mpc52xx_get_irq,
196 .show_cpuinfo = lite5200_show_cpuinfo,
197 .calibrate_decr = generic_calibrate_decr, 196 .calibrate_decr = generic_calibrate_decr,
198}; 197};
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_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 2dd415ff55a9..3bc201e07e6b 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -13,10 +13,9 @@
13#undef DEBUG 13#undef DEBUG
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16 16#include <linux/of_platform.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/prom.h> 18#include <asm/prom.h>
19#include <asm/of_platform.h>
20#include <asm/mpc52xx.h> 19#include <asm/mpc52xx.h>
21 20
22 21
@@ -76,44 +75,33 @@ mpc52xx_find_ipb_freq(struct device_node *node)
76EXPORT_SYMBOL(mpc52xx_find_ipb_freq); 75EXPORT_SYMBOL(mpc52xx_find_ipb_freq);
77 76
78 77
78/*
79 * Configure the XLB arbiter settings to match what Linux expects.
80 */
79void __init 81void __init
80mpc52xx_setup_cpu(void) 82mpc5200_setup_xlb_arbiter(void)
81{ 83{
82 struct mpc52xx_cdm __iomem *cdm;
83 struct mpc52xx_xlb __iomem *xlb; 84 struct mpc52xx_xlb __iomem *xlb;
84 85
85 /* Map zones */
86 cdm = mpc52xx_find_and_map("mpc5200-cdm");
87 xlb = mpc52xx_find_and_map("mpc5200-xlb"); 86 xlb = mpc52xx_find_and_map("mpc5200-xlb");
88 87 if (!xlb) {
89 if (!cdm || !xlb) {
90 printk(KERN_ERR __FILE__ ": " 88 printk(KERN_ERR __FILE__ ": "
91 "Error while mapping CDM/XLB during mpc52xx_setup_cpu. " 89 "Error mapping XLB in mpc52xx_setup_cpu(). "
92 "Expect some abnormal behavior\n"); 90 "Expect some abnormal behavior\n");
93 goto unmap_regs; 91 return;
94 } 92 }
95 93
96 /* Use internal 48 Mhz */
97 out_8(&cdm->ext_48mhz_en, 0x00);
98 out_8(&cdm->fd_enable, 0x01);
99 if (in_be32(&cdm->rstcfg) & 0x40) /* Assumes 33Mhz clock */
100 out_be16(&cdm->fd_counters, 0x0001);
101 else
102 out_be16(&cdm->fd_counters, 0x5555);
103
104 /* Configure the XLB Arbiter priorities */ 94 /* Configure the XLB Arbiter priorities */
105 out_be32(&xlb->master_pri_enable, 0xff); 95 out_be32(&xlb->master_pri_enable, 0xff);
106 out_be32(&xlb->master_priority, 0x11111111); 96 out_be32(&xlb->master_priority, 0x11111111);
107 97
108 /* Disable XLB pipelining */ 98 /* Disable XLB pipelining
109 /* (cfr errate 292. We could do this only just before ATA PIO 99 * (cfr errate 292. We could do this only just before ATA PIO
110 transaction and re-enable it afterwards ...) */ 100 * transaction and re-enable it afterwards ...)
101 */
111 out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_PLDIS); 102 out_be32(&xlb->config, in_be32(&xlb->config) | MPC52xx_XLB_CFG_PLDIS);
112 103
113 /* Unmap zones */ 104 iounmap(xlb);
114unmap_regs:
115 if (cdm) iounmap(cdm);
116 if (xlb) iounmap(xlb);
117} 105}
118 106
119void __init 107void __init
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index fbfff95b4437..61100f270c68 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -18,19 +18,9 @@
18 18
19#undef DEBUG 19#undef DEBUG
20 20
21#include <linux/stddef.h>
22#include <linux/init.h>
23#include <linux/sched.h>
24#include <linux/signal.h>
25#include <linux/stddef.h>
26#include <linux/delay.h>
27#include <linux/irq.h> 21#include <linux/irq.h>
28#include <linux/hardirq.h> 22#include <linux/of.h>
29
30#include <asm/io.h> 23#include <asm/io.h>
31#include <asm/processor.h>
32#include <asm/system.h>
33#include <asm/irq.h>
34#include <asm/prom.h> 24#include <asm/prom.h>
35#include <asm/mpc52xx.h> 25#include <asm/mpc52xx.h>
36#include "mpc52xx_pic.h" 26#include "mpc52xx_pic.h"
@@ -242,12 +232,6 @@ static struct irq_chip mpc52xx_sdma_irqchip = {
242 * irq_host 232 * irq_host
243*/ 233*/
244 234
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, 235static int mpc52xx_irqhost_xlate(struct irq_host *h, struct device_node *ct,
252 u32 * intspec, unsigned int intsize, 236 u32 * intspec, unsigned int intsize,
253 irq_hw_number_t * out_hwirq, 237 irq_hw_number_t * out_hwirq,
@@ -368,7 +352,6 @@ static int mpc52xx_irqhost_map(struct irq_host *h, unsigned int virq,
368} 352}
369 353
370static struct irq_host_ops mpc52xx_irqhost_ops = { 354static struct irq_host_ops mpc52xx_irqhost_ops = {
371 .match = mpc52xx_irqhost_match,
372 .xlate = mpc52xx_irqhost_xlate, 355 .xlate = mpc52xx_irqhost_xlate,
373 .map = mpc52xx_irqhost_map, 356 .map = mpc52xx_irqhost_map,
374}; 357};
@@ -420,14 +403,13 @@ void __init mpc52xx_init_irq(void)
420 * hw irq information provided by the ofw to linux virq 403 * hw irq information provided by the ofw to linux virq
421 */ 404 */
422 405
423 mpc52xx_irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 406 mpc52xx_irqhost = irq_alloc_host(picnode, IRQ_HOST_MAP_LINEAR,
424 MPC52xx_IRQ_HIGHTESTHWIRQ, 407 MPC52xx_IRQ_HIGHTESTHWIRQ,
425 &mpc52xx_irqhost_ops, -1); 408 &mpc52xx_irqhost_ops, -1);
426 409
427 if (!mpc52xx_irqhost) 410 if (!mpc52xx_irqhost)
428 panic(__FILE__ ": Cannot allocate the IRQ host\n"); 411 panic(__FILE__ ": Cannot allocate the IRQ host\n");
429 412
430 mpc52xx_irqhost->host_data = picnode;
431 printk(KERN_INFO "MPC52xx PIC is up and running!\n"); 413 printk(KERN_INFO "MPC52xx PIC is up and running!\n");
432} 414}
433 415
diff --git a/arch/powerpc/platforms/82xx/Kconfig b/arch/powerpc/platforms/82xx/Kconfig
index 89fde43895c5..541fbb815631 100644
--- a/arch/powerpc/platforms/82xx/Kconfig
+++ b/arch/powerpc/platforms/82xx/Kconfig
@@ -1,17 +1,30 @@
1choice 1choice
2 prompt "82xx Board Type" 2 prompt "82xx Board Type"
3 depends on PPC_82xx 3 depends on PPC_82xx
4 default MPC82xx_ADS 4 default MPC8272_ADS
5 5
6config MPC82xx_ADS 6config MPC8272_ADS
7 bool "Freescale MPC82xx ADS" 7 bool "Freescale MPC8272 ADS"
8 select DEFAULT_UIMAGE 8 select DEFAULT_UIMAGE
9 select PQ2ADS 9 select PQ2ADS
10 select 8272 10 select 8272
11 select 8260 11 select 8260
12 select FSL_SOC 12 select FSL_SOC
13 select PQ2_ADS_PCI_PIC if PCI
14 select PPC_CPM_NEW_BINDING
13 help 15 help
14 This option enables support for the MPC8272 ADS board 16 This option enables support for the MPC8272 ADS board
17
18config PQ2FADS
19 bool "Freescale PQ2FADS"
20 select DEFAULT_UIMAGE
21 select PQ2ADS
22 select 8260
23 select FSL_SOC
24 select PQ2_ADS_PCI_PIC if PCI
25 select PPC_CPM_NEW_BINDING
26 help
27 This option enables support for the PQ2FADS board
15 28
16endchoice 29endchoice
17 30
@@ -34,3 +47,6 @@ config 8272
34 help 47 help
35 The MPC8272 CPM has a different internal dpram setup than other CPM2 48 The MPC8272 CPM has a different internal dpram setup than other CPM2
36 devices 49 devices
50
51config PQ2_ADS_PCI_PIC
52 bool
diff --git a/arch/powerpc/platforms/82xx/Makefile b/arch/powerpc/platforms/82xx/Makefile
index d9fd4c84d2e0..68c8b0c9772b 100644
--- a/arch/powerpc/platforms/82xx/Makefile
+++ b/arch/powerpc/platforms/82xx/Makefile
@@ -1,5 +1,7 @@
1# 1#
2# Makefile for the PowerPC 82xx linux kernel. 2# Makefile for the PowerPC 82xx linux kernel.
3# 3#
4obj-$(CONFIG_PPC_82xx) += mpc82xx.o 4obj-$(CONFIG_MPC8272_ADS) += mpc8272_ads.o
5obj-$(CONFIG_MPC82xx_ADS) += mpc82xx_ads.o 5obj-$(CONFIG_CPM2) += pq2.o
6obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o
7obj-$(CONFIG_PQ2FADS) += pq2fads.o
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/mpc8272_ads.c b/arch/powerpc/platforms/82xx/mpc8272_ads.c
new file mode 100644
index 000000000000..fd83440eb287
--- /dev/null
+++ b/arch/powerpc/platforms/82xx/mpc8272_ads.c
@@ -0,0 +1,196 @@
1/*
2 * MPC8272 ADS board support
3 *
4 * Copyright 2007 Freescale Semiconductor, Inc.
5 * Author: Scott Wood <scottwood@freescale.com>
6 *
7 * Based on code by Vitaly Bordug <vbordug@ru.mvista.com>
8 * Copyright (c) 2006 MontaVista Software, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#include <linux/init.h>
17#include <linux/interrupt.h>
18#include <linux/fsl_devices.h>
19#include <linux/of_platform.h>
20#include <linux/io.h>
21
22#include <asm/cpm2.h>
23#include <asm/udbg.h>
24#include <asm/machdep.h>
25#include <asm/time.h>
26
27#include <platforms/82xx/pq2.h>
28
29#include <sysdev/fsl_soc.h>
30#include <sysdev/cpm2_pic.h>
31
32#include "pq2ads.h"
33#include "pq2.h"
34
35static void __init mpc8272_ads_pic_init(void)
36{
37 struct device_node *np = of_find_compatible_node(NULL, NULL,
38 "fsl,cpm2-pic");
39 if (!np) {
40 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
41 return;
42 }
43
44 cpm2_pic_init(np);
45 of_node_put(np);
46
47 /* Initialize stuff for the 82xx CPLD IC and install demux */
48 pq2ads_pci_init_irq();
49}
50
51struct cpm_pin {
52 int port, pin, flags;
53};
54
55static struct cpm_pin mpc8272_ads_pins[] = {
56 /* SCC1 */
57 {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
58 {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
59
60 /* SCC4 */
61 {3, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
62 {3, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
63
64 /* FCC1 */
65 {0, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
66 {0, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
67 {0, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
68 {0, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
69 {0, 18, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
70 {0, 19, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
71 {0, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
72 {0, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
73 {0, 26, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
74 {0, 27, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
75 {0, 28, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
76 {0, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
77 {0, 30, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
78 {0, 31, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
79 {2, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
80 {2, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
81
82 /* FCC2 */
83 {1, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
84 {1, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
85 {1, 20, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
86 {1, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
87 {1, 22, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
88 {1, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
89 {1, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
90 {1, 25, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
91 {1, 26, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
92 {1, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
93 {1, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
94 {1, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
95 {1, 30, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
96 {1, 31, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
97 {2, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
98 {2, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
99};
100
101static void __init init_ioports(void)
102{
103 int i;
104
105 for (i = 0; i < ARRAY_SIZE(mpc8272_ads_pins); i++) {
106 struct cpm_pin *pin = &mpc8272_ads_pins[i];
107 cpm2_set_pin(pin->port, pin->pin, pin->flags);
108 }
109
110 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX);
111 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX);
112 cpm2_clk_setup(CPM_CLK_SCC4, CPM_BRG4, CPM_CLK_RX);
113 cpm2_clk_setup(CPM_CLK_SCC4, CPM_BRG4, CPM_CLK_TX);
114 cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK11, CPM_CLK_RX);
115 cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_TX);
116 cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK15, CPM_CLK_RX);
117 cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK16, CPM_CLK_TX);
118}
119
120static void __init mpc8272_ads_setup_arch(void)
121{
122 struct device_node *np;
123 __be32 __iomem *bcsr;
124
125 if (ppc_md.progress)
126 ppc_md.progress("mpc8272_ads_setup_arch()", 0);
127
128 cpm2_reset();
129
130 np = of_find_compatible_node(NULL, NULL, "fsl,mpc8272ads-bcsr");
131 if (!np) {
132 printk(KERN_ERR "No bcsr in device tree\n");
133 return;
134 }
135
136 bcsr = of_iomap(np, 0);
137 if (!bcsr) {
138 printk(KERN_ERR "Cannot map BCSR registers\n");
139 return;
140 }
141
142 of_node_put(np);
143
144 clrbits32(&bcsr[1], BCSR1_RS232_EN1 | BCSR1_RS232_EN2 | BCSR1_FETHIEN);
145 setbits32(&bcsr[1], BCSR1_FETH_RST);
146
147 clrbits32(&bcsr[3], BCSR3_FETHIEN2);
148 setbits32(&bcsr[3], BCSR3_FETH2_RST);
149
150 iounmap(bcsr);
151
152 init_ioports();
153 pq2_init_pci();
154
155 if (ppc_md.progress)
156 ppc_md.progress("mpc8272_ads_setup_arch(), finish", 0);
157}
158
159static struct of_device_id __initdata of_bus_ids[] = {
160 { .name = "soc", },
161 { .name = "cpm", },
162 { .name = "localbus", },
163 {},
164};
165
166static int __init declare_of_platform_devices(void)
167{
168 if (!machine_is(mpc8272_ads))
169 return 0;
170
171 /* Publish the QE devices */
172 of_platform_bus_probe(NULL, of_bus_ids, NULL);
173 return 0;
174}
175device_initcall(declare_of_platform_devices);
176
177/*
178 * Called very early, device-tree isn't unflattened
179 */
180static int __init mpc8272_ads_probe(void)
181{
182 unsigned long root = of_get_flat_dt_root();
183 return of_flat_dt_is_compatible(root, "fsl,mpc8272ads");
184}
185
186define_machine(mpc8272_ads)
187{
188 .name = "Freescale MPC8272 ADS",
189 .probe = mpc8272_ads_probe,
190 .setup_arch = mpc8272_ads_setup_arch,
191 .init_IRQ = mpc8272_ads_pic_init,
192 .get_irq = cpm2_get_irq,
193 .calibrate_decr = generic_calibrate_decr,
194 .restart = pq2_restart,
195 .progress = udbg_progress,
196};
diff --git a/arch/powerpc/platforms/82xx/mpc82xx.c b/arch/powerpc/platforms/82xx/mpc82xx.c
deleted file mode 100644
index cc9900d2e5ee..000000000000
--- a/arch/powerpc/platforms/82xx/mpc82xx.c
+++ /dev/null
@@ -1,110 +0,0 @@
1/*
2 * MPC82xx setup and early boot code plus other random bits.
3 *
4 * Author: Vitaly Bordug <vbordug@ru.mvista.com>
5 *
6 * Copyright (c) 2006 MontaVista Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13
14#include <linux/stddef.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/errno.h>
18#include <linux/reboot.h>
19#include <linux/pci.h>
20#include <linux/interrupt.h>
21#include <linux/kdev_t.h>
22#include <linux/major.h>
23#include <linux/console.h>
24#include <linux/delay.h>
25#include <linux/seq_file.h>
26#include <linux/root_dev.h>
27#include <linux/initrd.h>
28#include <linux/module.h>
29#include <linux/fsl_devices.h>
30#include <linux/fs_uart_pd.h>
31
32#include <asm/system.h>
33#include <asm/pgtable.h>
34#include <asm/page.h>
35#include <asm/atomic.h>
36#include <asm/time.h>
37#include <asm/io.h>
38#include <asm/machdep.h>
39#include <asm/bootinfo.h>
40#include <asm/pci-bridge.h>
41#include <asm/mpc8260.h>
42#include <asm/irq.h>
43#include <mm/mmu_decl.h>
44#include <asm/prom.h>
45#include <asm/cpm2.h>
46#include <asm/udbg.h>
47#include <asm/i8259.h>
48#include <linux/fs_enet_pd.h>
49
50#include <sysdev/fsl_soc.h>
51#include <sysdev/cpm2_pic.h>
52
53#include "pq2ads.h"
54
55static int __init get_freq(char *name, unsigned long *val)
56{
57 struct device_node *cpu;
58 const unsigned int *fp;
59 int found = 0;
60
61 /* The cpu node should have timebase and clock frequency properties */
62 cpu = of_find_node_by_type(NULL, "cpu");
63
64 if (cpu) {
65 fp = of_get_property(cpu, name, NULL);
66 if (fp) {
67 found = 1;
68 *val = *fp;
69 }
70
71 of_node_put(cpu);
72 }
73
74 return found;
75}
76
77void __init m82xx_calibrate_decr(void)
78{
79 ppc_tb_freq = 125000000;
80 if (!get_freq("bus-frequency", &ppc_tb_freq)) {
81 printk(KERN_ERR "WARNING: Estimating decrementer frequency "
82 "(not found)\n");
83 }
84 ppc_tb_freq /= 4;
85 ppc_proc_freq = 1000000000;
86 if (!get_freq("clock-frequency", &ppc_proc_freq))
87 printk(KERN_ERR "WARNING: Estimating processor frequency"
88 "(not found)\n");
89}
90
91void mpc82xx_ads_show_cpuinfo(struct seq_file *m)
92{
93 uint pvid, svid, phid1;
94 uint memsize = total_memory;
95
96 pvid = mfspr(SPRN_PVR);
97 svid = mfspr(SPRN_SVR);
98
99 seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
100 seq_printf(m, "Machine\t\t: %s\n", CPUINFO_MACHINE);
101 seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
102 seq_printf(m, "SVR\t\t: 0x%x\n", svid);
103
104 /* Display cpu Pll setting */
105 phid1 = mfspr(SPRN_HID1);
106 seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
107
108 /* Display the amount of memory */
109 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
110}
diff --git a/arch/powerpc/platforms/82xx/mpc82xx_ads.c b/arch/powerpc/platforms/82xx/mpc82xx_ads.c
deleted file mode 100644
index 2d1b05b9f8ef..000000000000
--- a/arch/powerpc/platforms/82xx/mpc82xx_ads.c
+++ /dev/null
@@ -1,641 +0,0 @@
1/*
2 * MPC82xx_ads setup and early boot code plus other random bits.
3 *
4 * Author: Vitaly Bordug <vbordug@ru.mvista.com>
5 * m82xx_restart fix by Wade Farnsworth <wfarnsworth@mvista.com>
6 *
7 * Copyright (c) 2006 MontaVista Software, 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 as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15#include <linux/stddef.h>
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/errno.h>
19#include <linux/reboot.h>
20#include <linux/pci.h>
21#include <linux/interrupt.h>
22#include <linux/kdev_t.h>
23#include <linux/major.h>
24#include <linux/console.h>
25#include <linux/delay.h>
26#include <linux/seq_file.h>
27#include <linux/root_dev.h>
28#include <linux/initrd.h>
29#include <linux/module.h>
30#include <linux/fsl_devices.h>
31#include <linux/fs_uart_pd.h>
32
33#include <asm/system.h>
34#include <asm/pgtable.h>
35#include <asm/page.h>
36#include <asm/atomic.h>
37#include <asm/time.h>
38#include <asm/io.h>
39#include <asm/machdep.h>
40#include <asm/bootinfo.h>
41#include <asm/pci-bridge.h>
42#include <asm/mpc8260.h>
43#include <asm/irq.h>
44#include <mm/mmu_decl.h>
45#include <asm/prom.h>
46#include <asm/cpm2.h>
47#include <asm/udbg.h>
48#include <asm/i8259.h>
49#include <linux/fs_enet_pd.h>
50
51#include <sysdev/fsl_soc.h>
52#include <sysdev/cpm2_pic.h>
53
54#include "pq2ads.h"
55
56#ifdef CONFIG_PCI
57static uint pci_clk_frq;
58static struct {
59 unsigned long *pci_int_stat_reg;
60 unsigned long *pci_int_mask_reg;
61} pci_regs;
62
63static unsigned long pci_int_base;
64static struct irq_host *pci_pic_host;
65static struct device_node *pci_pic_node;
66#endif
67
68static void __init mpc82xx_ads_pic_init(void)
69{
70 struct device_node *np = of_find_compatible_node(NULL, "cpm-pic", "CPM2");
71 struct resource r;
72 cpm2_map_t *cpm_reg;
73
74 if (np == NULL) {
75 printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
76 return;
77 }
78 if (of_address_to_resource(np, 0, &r)) {
79 printk(KERN_ERR "PIC init: invalid resource\n");
80 of_node_put(np);
81 return;
82 }
83 cpm2_pic_init(np);
84 of_node_put(np);
85
86 /* Initialize the default interrupt mapping priorities,
87 * in case the boot rom changed something on us.
88 */
89 cpm_reg = (cpm2_map_t *) ioremap(get_immrbase(), sizeof(cpm2_map_t));
90 cpm_reg->im_intctl.ic_siprr = 0x05309770;
91 iounmap(cpm_reg);
92#ifdef CONFIG_PCI
93 /* Initialize stuff for the 82xx CPLD IC and install demux */
94 m82xx_pci_init_irq();
95#endif
96}
97
98static void init_fcc1_ioports(struct fs_platform_info *fpi)
99{
100 struct io_port *io;
101 u32 tempval;
102 cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t));
103 struct device_node *np;
104 struct resource r;
105 u32 *bcsr;
106
107 np = of_find_node_by_type(NULL, "memory");
108 if (!np) {
109 printk(KERN_INFO "No memory node in device tree\n");
110 return;
111 }
112 if (of_address_to_resource(np, 1, &r)) {
113 printk(KERN_INFO "No memory reg property [1] in devicetree\n");
114 return;
115 }
116 of_node_put(np);
117 bcsr = ioremap(r.start + 4, sizeof(u32));
118 io = &immap->im_ioport;
119
120 /* Enable the PHY */
121 clrbits32(bcsr, BCSR1_FETHIEN);
122 setbits32(bcsr, BCSR1_FETH_RST);
123
124 /* FCC1 pins are on port A/C. */
125 /* Configure port A and C pins for FCC1 Ethernet. */
126
127 tempval = in_be32(&io->iop_pdira);
128 tempval &= ~PA1_DIRA0;
129 tempval |= PA1_DIRA1;
130 out_be32(&io->iop_pdira, tempval);
131
132 tempval = in_be32(&io->iop_psora);
133 tempval &= ~PA1_PSORA0;
134 tempval |= PA1_PSORA1;
135 out_be32(&io->iop_psora, tempval);
136
137 setbits32(&io->iop_ppara, PA1_DIRA0 | PA1_DIRA1);
138
139 /* Alter clocks */
140 tempval = PC_CLK(fpi->clk_tx - 8) | PC_CLK(fpi->clk_rx - 8);
141
142 clrbits32(&io->iop_psorc, tempval);
143 clrbits32(&io->iop_pdirc, tempval);
144 setbits32(&io->iop_pparc, tempval);
145
146 cpm2_clk_setup(CPM_CLK_FCC1, fpi->clk_rx, CPM_CLK_RX);
147 cpm2_clk_setup(CPM_CLK_FCC1, fpi->clk_tx, CPM_CLK_TX);
148
149 iounmap(bcsr);
150 iounmap(immap);
151}
152
153static void init_fcc2_ioports(struct fs_platform_info *fpi)
154{
155 cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t));
156 struct device_node *np;
157 struct resource r;
158 u32 *bcsr;
159
160 struct io_port *io;
161 u32 tempval;
162
163 np = of_find_node_by_type(NULL, "memory");
164 if (!np) {
165 printk(KERN_INFO "No memory node in device tree\n");
166 return;
167 }
168 if (of_address_to_resource(np, 1, &r)) {
169 printk(KERN_INFO "No memory reg property [1] in devicetree\n");
170 return;
171 }
172 of_node_put(np);
173 io = &immap->im_ioport;
174 bcsr = ioremap(r.start + 12, sizeof(u32));
175
176 /* Enable the PHY */
177 clrbits32(bcsr, BCSR3_FETHIEN2);
178 setbits32(bcsr, BCSR3_FETH2_RST);
179
180 /* FCC2 are port B/C. */
181 /* Configure port A and C pins for FCC2 Ethernet. */
182
183 tempval = in_be32(&io->iop_pdirb);
184 tempval &= ~PB2_DIRB0;
185 tempval |= PB2_DIRB1;
186 out_be32(&io->iop_pdirb, tempval);
187
188 tempval = in_be32(&io->iop_psorb);
189 tempval &= ~PB2_PSORB0;
190 tempval |= PB2_PSORB1;
191 out_be32(&io->iop_psorb, tempval);
192
193 setbits32(&io->iop_pparb, PB2_DIRB0 | PB2_DIRB1);
194
195 tempval = PC_CLK(fpi->clk_tx - 8) | PC_CLK(fpi->clk_rx - 8);
196
197 /* Alter clocks */
198 clrbits32(&io->iop_psorc, tempval);
199 clrbits32(&io->iop_pdirc, tempval);
200 setbits32(&io->iop_pparc, tempval);
201
202 cpm2_clk_setup(CPM_CLK_FCC2, fpi->clk_rx, CPM_CLK_RX);
203 cpm2_clk_setup(CPM_CLK_FCC2, fpi->clk_tx, CPM_CLK_TX);
204
205 iounmap(bcsr);
206 iounmap(immap);
207}
208
209void init_fcc_ioports(struct fs_platform_info *fpi)
210{
211 int fcc_no = fs_get_fcc_index(fpi->fs_no);
212
213 switch (fcc_no) {
214 case 0:
215 init_fcc1_ioports(fpi);
216 break;
217 case 1:
218 init_fcc2_ioports(fpi);
219 break;
220 default:
221 printk(KERN_ERR "init_fcc_ioports: invalid FCC number\n");
222 return;
223 }
224}
225
226static void init_scc1_uart_ioports(struct fs_uart_platform_info *data)
227{
228 cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t));
229
230 /* SCC1 is only on port D */
231 setbits32(&immap->im_ioport.iop_ppard, 0x00000003);
232 clrbits32(&immap->im_ioport.iop_psord, 0x00000001);
233 setbits32(&immap->im_ioport.iop_psord, 0x00000002);
234 clrbits32(&immap->im_ioport.iop_pdird, 0x00000001);
235 setbits32(&immap->im_ioport.iop_pdird, 0x00000002);
236
237 clrbits32(&immap->im_cpmux.cmx_scr, (0x00000007 << (4 - data->clk_tx)));
238 clrbits32(&immap->im_cpmux.cmx_scr, (0x00000038 << (4 - data->clk_rx)));
239 setbits32(&immap->im_cpmux.cmx_scr,
240 ((data->clk_tx - 1) << (4 - data->clk_tx)));
241 setbits32(&immap->im_cpmux.cmx_scr,
242 ((data->clk_rx - 1) << (4 - data->clk_rx)));
243
244 iounmap(immap);
245}
246
247static void init_scc4_uart_ioports(struct fs_uart_platform_info *data)
248{
249 cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t));
250
251 setbits32(&immap->im_ioport.iop_ppard, 0x00000600);
252 clrbits32(&immap->im_ioport.iop_psord, 0x00000600);
253 clrbits32(&immap->im_ioport.iop_pdird, 0x00000200);
254 setbits32(&immap->im_ioport.iop_pdird, 0x00000400);
255
256 clrbits32(&immap->im_cpmux.cmx_scr, (0x00000007 << (4 - data->clk_tx)));
257 clrbits32(&immap->im_cpmux.cmx_scr, (0x00000038 << (4 - data->clk_rx)));
258 setbits32(&immap->im_cpmux.cmx_scr,
259 ((data->clk_tx - 1) << (4 - data->clk_tx)));
260 setbits32(&immap->im_cpmux.cmx_scr,
261 ((data->clk_rx - 1) << (4 - data->clk_rx)));
262
263 iounmap(immap);
264}
265
266void init_scc_ioports(struct fs_uart_platform_info *data)
267{
268 int scc_no = fs_get_scc_index(data->fs_no);
269
270 switch (scc_no) {
271 case 0:
272 init_scc1_uart_ioports(data);
273 data->brg = data->clk_rx;
274 break;
275 case 3:
276 init_scc4_uart_ioports(data);
277 data->brg = data->clk_rx;
278 break;
279 default:
280 printk(KERN_ERR "init_scc_ioports: invalid SCC number\n");
281 return;
282 }
283}
284
285void __init m82xx_board_setup(void)
286{
287 cpm2_map_t *immap = ioremap(get_immrbase(), sizeof(cpm2_map_t));
288 struct device_node *np;
289 struct resource r;
290 u32 *bcsr;
291
292 np = of_find_node_by_type(NULL, "memory");
293 if (!np) {
294 printk(KERN_INFO "No memory node in device tree\n");
295 return;
296 }
297 if (of_address_to_resource(np, 1, &r)) {
298 printk(KERN_INFO "No memory reg property [1] in devicetree\n");
299 return;
300 }
301 of_node_put(np);
302 bcsr = ioremap(r.start + 4, sizeof(u32));
303 /* Enable the 2nd UART port */
304 clrbits32(bcsr, BCSR1_RS232_EN2);
305
306#ifdef CONFIG_SERIAL_CPM_SCC1
307 clrbits32((u32 *) & immap->im_scc[0].scc_sccm,
308 UART_SCCM_TX | UART_SCCM_RX);
309 clrbits32((u32 *) & immap->im_scc[0].scc_gsmrl,
310 SCC_GSMRL_ENR | SCC_GSMRL_ENT);
311#endif
312
313#ifdef CONFIG_SERIAL_CPM_SCC2
314 clrbits32((u32 *) & immap->im_scc[1].scc_sccm,
315 UART_SCCM_TX | UART_SCCM_RX);
316 clrbits32((u32 *) & immap->im_scc[1].scc_gsmrl,
317 SCC_GSMRL_ENR | SCC_GSMRL_ENT);
318#endif
319
320#ifdef CONFIG_SERIAL_CPM_SCC3
321 clrbits32((u32 *) & immap->im_scc[2].scc_sccm,
322 UART_SCCM_TX | UART_SCCM_RX);
323 clrbits32((u32 *) & immap->im_scc[2].scc_gsmrl,
324 SCC_GSMRL_ENR | SCC_GSMRL_ENT);
325#endif
326
327#ifdef CONFIG_SERIAL_CPM_SCC4
328 clrbits32((u32 *) & immap->im_scc[3].scc_sccm,
329 UART_SCCM_TX | UART_SCCM_RX);
330 clrbits32((u32 *) & immap->im_scc[3].scc_gsmrl,
331 SCC_GSMRL_ENR | SCC_GSMRL_ENT);
332#endif
333
334 iounmap(bcsr);
335 iounmap(immap);
336}
337
338#ifdef CONFIG_PCI
339static void m82xx_pci_mask_irq(unsigned int irq)
340{
341 int bit = irq - pci_int_base;
342
343 *pci_regs.pci_int_mask_reg |= (1 << (31 - bit));
344 return;
345}
346
347static void m82xx_pci_unmask_irq(unsigned int irq)
348{
349 int bit = irq - pci_int_base;
350
351 *pci_regs.pci_int_mask_reg &= ~(1 << (31 - bit));
352 return;
353}
354
355static void m82xx_pci_mask_and_ack(unsigned int irq)
356{
357 int bit = irq - pci_int_base;
358
359 *pci_regs.pci_int_mask_reg |= (1 << (31 - bit));
360 return;
361}
362
363static void m82xx_pci_end_irq(unsigned int irq)
364{
365 int bit = irq - pci_int_base;
366
367 *pci_regs.pci_int_mask_reg &= ~(1 << (31 - bit));
368 return;
369}
370
371struct hw_interrupt_type m82xx_pci_ic = {
372 .typename = "MPC82xx ADS PCI",
373 .name = "MPC82xx ADS PCI",
374 .enable = m82xx_pci_unmask_irq,
375 .disable = m82xx_pci_mask_irq,
376 .ack = m82xx_pci_mask_and_ack,
377 .end = m82xx_pci_end_irq,
378 .mask = m82xx_pci_mask_irq,
379 .mask_ack = m82xx_pci_mask_and_ack,
380 .unmask = m82xx_pci_unmask_irq,
381 .eoi = m82xx_pci_end_irq,
382};
383
384static void
385m82xx_pci_irq_demux(unsigned int irq, struct irq_desc *desc)
386{
387 unsigned long stat, mask, pend;
388 int bit;
389
390 for (;;) {
391 stat = *pci_regs.pci_int_stat_reg;
392 mask = *pci_regs.pci_int_mask_reg;
393 pend = stat & ~mask & 0xf0000000;
394 if (!pend)
395 break;
396 for (bit = 0; pend != 0; ++bit, pend <<= 1) {
397 if (pend & 0x80000000)
398 __do_IRQ(pci_int_base + bit);
399 }
400 }
401}
402
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,
409 irq_hw_number_t hw)
410{
411 get_irq_desc(virq)->status |= IRQ_LEVEL;
412 set_irq_chip(virq, &m82xx_pci_ic);
413 return 0;
414}
415
416static void pci_host_unmap(struct irq_host *h, unsigned int virq)
417{
418 /* remove chip and handler */
419 set_irq_chip(virq, NULL);
420}
421
422static struct irq_host_ops pci_pic_host_ops = {
423 .match = pci_pic_host_match,
424 .map = pci_pic_host_map,
425 .unmap = pci_host_unmap,
426};
427
428void m82xx_pci_init_irq(void)
429{
430 int irq;
431 cpm2_map_t *immap;
432 struct device_node *np;
433 struct resource r;
434 const u32 *regs;
435 unsigned int size;
436 const u32 *irq_map;
437 int i;
438 unsigned int irq_max, irq_min;
439
440 if ((np = of_find_node_by_type(NULL, "soc")) == NULL) {
441 printk(KERN_INFO "No SOC node in device tree\n");
442 return;
443 }
444 memset(&r, 0, sizeof(r));
445 if (of_address_to_resource(np, 0, &r)) {
446 printk(KERN_INFO "No SOC reg property in device tree\n");
447 return;
448 }
449 immap = ioremap(r.start, sizeof(*immap));
450 of_node_put(np);
451
452 /* install the demultiplexer for the PCI cascade interrupt */
453 np = of_find_node_by_type(NULL, "pci");
454 if (!np) {
455 printk(KERN_INFO "No pci node on device tree\n");
456 iounmap(immap);
457 return;
458 }
459 irq_map = of_get_property(np, "interrupt-map", &size);
460 if ((!irq_map) || (size <= 7)) {
461 printk(KERN_INFO "No interrupt-map property of pci node\n");
462 iounmap(immap);
463 return;
464 }
465 size /= sizeof(irq_map[0]);
466 for (i = 0, irq_max = 0, irq_min = 512; i < size; i += 7, irq_map += 7) {
467 if (irq_map[5] < irq_min)
468 irq_min = irq_map[5];
469 if (irq_map[5] > irq_max)
470 irq_max = irq_map[5];
471 }
472 pci_int_base = irq_min;
473 irq = irq_of_parse_and_map(np, 0);
474 set_irq_chained_handler(irq, m82xx_pci_irq_demux);
475 of_node_put(np);
476 np = of_find_node_by_type(NULL, "pci-pic");
477 if (!np) {
478 printk(KERN_INFO "No pci pic node on device tree\n");
479 iounmap(immap);
480 return;
481 }
482 pci_pic_node = of_node_get(np);
483 /* PCI interrupt controller registers: status and mask */
484 regs = of_get_property(np, "reg", &size);
485 if ((!regs) || (size <= 2)) {
486 printk(KERN_INFO "No reg property in pci pic node\n");
487 iounmap(immap);
488 return;
489 }
490 pci_regs.pci_int_stat_reg =
491 ioremap(regs[0], sizeof(*pci_regs.pci_int_stat_reg));
492 pci_regs.pci_int_mask_reg =
493 ioremap(regs[1], sizeof(*pci_regs.pci_int_mask_reg));
494 of_node_put(np);
495 /* configure chip select for PCI interrupt controller */
496 immap->im_memctl.memc_br3 = regs[0] | 0x00001801;
497 immap->im_memctl.memc_or3 = 0xffff8010;
498 /* make PCI IRQ level sensitive */
499 immap->im_intctl.ic_siexr &= ~(1 << (14 - (irq - SIU_INT_IRQ1)));
500
501 /* mask all PCI interrupts */
502 *pci_regs.pci_int_mask_reg |= 0xfff00000;
503 iounmap(immap);
504 pci_pic_host =
505 irq_alloc_host(IRQ_HOST_MAP_LINEAR, irq_max - irq_min + 1,
506 &pci_pic_host_ops, irq_max + 1);
507 return;
508}
509
510static int m82xx_pci_exclude_device(struct pci_controller *hose,
511 u_char bus, u_char devfn)
512{
513 if (bus == 0 && PCI_SLOT(devfn) == 0)
514 return PCIBIOS_DEVICE_NOT_FOUND;
515 else
516 return PCIBIOS_SUCCESSFUL;
517}
518
519static void __init mpc82xx_add_bridge(struct device_node *np)
520{
521 int len;
522 struct pci_controller *hose;
523 struct resource r;
524 const int *bus_range;
525 const uint *ptr;
526
527 memset(&r, 0, sizeof(r));
528 if (of_address_to_resource(np, 0, &r)) {
529 printk(KERN_INFO "No PCI reg property in device tree\n");
530 return;
531 }
532 if (!(ptr = of_get_property(np, "clock-frequency", NULL))) {
533 printk(KERN_INFO "No clock-frequency property in PCI node");
534 return;
535 }
536 pci_clk_frq = *ptr;
537 of_node_put(np);
538 bus_range = of_get_property(np, "bus-range", &len);
539 if (bus_range == NULL || len < 2 * sizeof(int)) {
540 printk(KERN_WARNING "Can't get bus-range for %s, assume"
541 " bus 0\n", np->full_name);
542 }
543
544 pci_assign_all_buses = 1;
545
546 hose = pcibios_alloc_controller(np);
547
548 if (!hose)
549 return;
550
551 hose->first_busno = bus_range ? bus_range[0] : 0;
552 hose->last_busno = bus_range ? bus_range[1] : 0xff;
553
554 setup_indirect_pci(hose,
555 r.start + offsetof(pci_cpm2_t, pci_cfg_addr),
556 r.start + offsetof(pci_cpm2_t, pci_cfg_data),
557 0);
558
559 pci_process_bridge_OF_ranges(hose, np, 1);
560}
561#endif
562
563/*
564 * Setup the architecture
565 */
566static void __init mpc82xx_ads_setup_arch(void)
567{
568#ifdef CONFIG_PCI
569 struct device_node *np;
570#endif
571
572 if (ppc_md.progress)
573 ppc_md.progress("mpc82xx_ads_setup_arch()", 0);
574 cpm2_reset();
575
576 /* Map I/O region to a 256MB BAT */
577
578 m82xx_board_setup();
579
580#ifdef CONFIG_PCI
581 ppc_md.pci_exclude_device = m82xx_pci_exclude_device;
582 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
583 mpc82xx_add_bridge(np);
584
585 of_node_put(np);
586#endif
587
588#ifdef CONFIG_ROOT_NFS
589 ROOT_DEV = Root_NFS;
590#else
591 ROOT_DEV = Root_HDA1;
592#endif
593
594 if (ppc_md.progress)
595 ppc_md.progress("mpc82xx_ads_setup_arch(), finish", 0);
596}
597
598/*
599 * Called very early, device-tree isn't unflattened
600 */
601static int __init mpc82xx_ads_probe(void)
602{
603 /* We always match for now, eventually we should look at
604 * the flat dev tree to ensure this is the board we are
605 * supposed to run on
606 */
607 return 1;
608}
609
610#define RMR_CSRE 0x00000001
611static void m82xx_restart(char *cmd)
612{
613 __volatile__ unsigned char dummy;
614
615 local_irq_disable();
616 ((cpm2_map_t *) cpm2_immr)->im_clkrst.car_rmr |= RMR_CSRE;
617
618 /* Clear the ME,EE,IR & DR bits in MSR to cause checkstop */
619 mtmsr(mfmsr() & ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR));
620 dummy = ((cpm2_map_t *) cpm2_immr)->im_clkrst.res[0];
621 printk("Restart failed\n");
622 while (1) ;
623}
624
625static void m82xx_halt(void)
626{
627 local_irq_disable();
628 while (1) ;
629}
630
631define_machine(mpc82xx_ads)
632{
633 .name = "MPC82xx ADS",
634 .probe = mpc82xx_ads_probe,
635 .setup_arch = mpc82xx_ads_setup_arch,
636 .init_IRQ = mpc82xx_ads_pic_init,
637 .show_cpuinfo = mpc82xx_ads_show_cpuinfo,
638 .get_irq = cpm2_get_irq,
639 .calibrate_decr = m82xx_calibrate_decr,
640 .restart = m82xx_restart,.halt = m82xx_halt,
641};
diff --git a/arch/powerpc/platforms/82xx/pq2.c b/arch/powerpc/platforms/82xx/pq2.c
new file mode 100644
index 000000000000..a497cbaa1ac5
--- /dev/null
+++ b/arch/powerpc/platforms/82xx/pq2.c
@@ -0,0 +1,82 @@
1/*
2 * Common PowerQUICC II code.
3 *
4 * Author: Scott Wood <scottwood@freescale.com>
5 * Copyright (c) 2007 Freescale Semiconductor
6 *
7 * Based on code by Vitaly Bordug <vbordug@ru.mvista.com>
8 * pq2_restart fix by Wade Farnsworth <wfarnsworth@mvista.com>
9 * Copyright (c) 2006 MontaVista Software, Inc.
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
17#include <asm/cpm2.h>
18#include <asm/io.h>
19#include <asm/pci-bridge.h>
20#include <asm/system.h>
21
22#include <platforms/82xx/pq2.h>
23
24#define RMR_CSRE 0x00000001
25
26void pq2_restart(char *cmd)
27{
28 local_irq_disable();
29 setbits32(&cpm2_immr->im_clkrst.car_rmr, RMR_CSRE);
30
31 /* Clear the ME,EE,IR & DR bits in MSR to cause checkstop */
32 mtmsr(mfmsr() & ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR));
33 in_8(&cpm2_immr->im_clkrst.res[0]);
34
35 panic("Restart failed\n");
36}
37
38#ifdef CONFIG_PCI
39static int pq2_pci_exclude_device(struct pci_controller *hose,
40 u_char bus, u8 devfn)
41{
42 if (bus == 0 && PCI_SLOT(devfn) == 0)
43 return PCIBIOS_DEVICE_NOT_FOUND;
44 else
45 return PCIBIOS_SUCCESSFUL;
46}
47
48static void __init pq2_pci_add_bridge(struct device_node *np)
49{
50 struct pci_controller *hose;
51 struct resource r;
52
53 if (of_address_to_resource(np, 0, &r) || r.end - r.start < 0x10b)
54 goto err;
55
56 pci_assign_all_buses = 1;
57
58 hose = pcibios_alloc_controller(np);
59 if (!hose)
60 return;
61
62 hose->arch_data = np;
63
64 setup_indirect_pci(hose, r.start + 0x100, r.start + 0x104, 0);
65 pci_process_bridge_OF_ranges(hose, np, 1);
66
67 return;
68
69err:
70 printk(KERN_ERR "No valid PCI reg property in device tree\n");
71}
72
73void __init pq2_init_pci(void)
74{
75 struct device_node *np = NULL;
76
77 ppc_md.pci_exclude_device = pq2_pci_exclude_device;
78
79 while ((np = of_find_compatible_node(np, NULL, "fsl,pq2-pci")))
80 pq2_pci_add_bridge(np);
81}
82#endif
diff --git a/arch/powerpc/platforms/82xx/pq2.h b/arch/powerpc/platforms/82xx/pq2.h
new file mode 100644
index 000000000000..a41f84ae2325
--- /dev/null
+++ b/arch/powerpc/platforms/82xx/pq2.h
@@ -0,0 +1,20 @@
1#ifndef _PQ2_H
2#define _PQ2_H
3
4void pq2_restart(char *cmd);
5
6#ifdef CONFIG_PCI
7int pq2ads_pci_init_irq(void);
8void pq2_init_pci(void);
9#else
10static inline int pq2ads_pci_init_irq(void)
11{
12 return 0;
13}
14
15static inline void pq2_init_pci(void)
16{
17}
18#endif
19
20#endif
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
new file mode 100644
index 000000000000..a8013816125c
--- /dev/null
+++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
@@ -0,0 +1,195 @@
1/*
2 * PQ2 ADS-style PCI interrupt controller
3 *
4 * Copyright 2007 Freescale Semiconductor, Inc.
5 * Author: Scott Wood <scottwood@freescale.com>
6 *
7 * Loosely based on mpc82xx ADS support by Vitaly Bordug <vbordug@ru.mvista.com>
8 * Copyright (c) 2006 MontaVista Software, 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 <linux/init.h>
16#include <linux/spinlock.h>
17#include <linux/irq.h>
18#include <linux/types.h>
19#include <linux/bootmem.h>
20
21#include <asm/io.h>
22#include <asm/prom.h>
23#include <asm/cpm2.h>
24
25#include "pq2.h"
26
27static DEFINE_SPINLOCK(pci_pic_lock);
28
29struct pq2ads_pci_pic {
30 struct device_node *node;
31 struct irq_host *host;
32
33 struct {
34 u32 stat;
35 u32 mask;
36 } __iomem *regs;
37};
38
39#define NUM_IRQS 32
40
41static void pq2ads_pci_mask_irq(unsigned int virq)
42{
43 struct pq2ads_pci_pic *priv = get_irq_chip_data(virq);
44 int irq = NUM_IRQS - virq_to_hw(virq) - 1;
45
46 if (irq != -1) {
47 unsigned long flags;
48 spin_lock_irqsave(&pci_pic_lock, flags);
49
50 setbits32(&priv->regs->mask, 1 << irq);
51 mb();
52
53 spin_unlock_irqrestore(&pci_pic_lock, flags);
54 }
55}
56
57static void pq2ads_pci_unmask_irq(unsigned int virq)
58{
59 struct pq2ads_pci_pic *priv = get_irq_chip_data(virq);
60 int irq = NUM_IRQS - virq_to_hw(virq) - 1;
61
62 if (irq != -1) {
63 unsigned long flags;
64
65 spin_lock_irqsave(&pci_pic_lock, flags);
66 clrbits32(&priv->regs->mask, 1 << irq);
67 spin_unlock_irqrestore(&pci_pic_lock, flags);
68 }
69}
70
71static struct irq_chip pq2ads_pci_ic = {
72 .typename = "PQ2 ADS PCI",
73 .name = "PQ2 ADS PCI",
74 .end = pq2ads_pci_unmask_irq,
75 .mask = pq2ads_pci_mask_irq,
76 .mask_ack = pq2ads_pci_mask_irq,
77 .ack = pq2ads_pci_mask_irq,
78 .unmask = pq2ads_pci_unmask_irq,
79 .enable = pq2ads_pci_unmask_irq,
80 .disable = pq2ads_pci_mask_irq
81};
82
83static void pq2ads_pci_irq_demux(unsigned int irq, struct irq_desc *desc)
84{
85 struct pq2ads_pci_pic *priv = desc->handler_data;
86 u32 stat, mask, pend;
87 int bit;
88
89 for (;;) {
90 stat = in_be32(&priv->regs->stat);
91 mask = in_be32(&priv->regs->mask);
92
93 pend = stat & ~mask;
94
95 if (!pend)
96 break;
97
98 for (bit = 0; pend != 0; ++bit, pend <<= 1) {
99 if (pend & 0x80000000) {
100 int virq = irq_linear_revmap(priv->host, bit);
101 generic_handle_irq(virq);
102 }
103 }
104 }
105}
106
107static int pci_pic_host_map(struct irq_host *h, unsigned int virq,
108 irq_hw_number_t hw)
109{
110 get_irq_desc(virq)->status |= IRQ_LEVEL;
111 set_irq_chip_data(virq, h->host_data);
112 set_irq_chip(virq, &pq2ads_pci_ic);
113 return 0;
114}
115
116static void pci_host_unmap(struct irq_host *h, unsigned int virq)
117{
118 /* remove chip and handler */
119 set_irq_chip_data(virq, NULL);
120 set_irq_chip(virq, NULL);
121}
122
123static struct irq_host_ops pci_pic_host_ops = {
124 .map = pci_pic_host_map,
125 .unmap = pci_host_unmap,
126};
127
128int __init pq2ads_pci_init_irq(void)
129{
130 struct pq2ads_pci_pic *priv;
131 struct irq_host *host;
132 struct device_node *np;
133 int ret = -ENODEV;
134 int irq;
135
136 np = of_find_compatible_node(NULL, NULL, "fsl,pq2ads-pci-pic");
137 if (!np) {
138 printk(KERN_ERR "No pci pic node in device tree.\n");
139 of_node_put(np);
140 goto out;
141 }
142
143 irq = irq_of_parse_and_map(np, 0);
144 if (irq == NO_IRQ) {
145 printk(KERN_ERR "No interrupt in pci pic node.\n");
146 of_node_put(np);
147 goto out;
148 }
149
150 priv = alloc_bootmem(sizeof(struct pq2ads_pci_pic));
151 if (!priv) {
152 of_node_put(np);
153 ret = -ENOMEM;
154 goto out_unmap_irq;
155 }
156
157 /* PCI interrupt controller registers: status and mask */
158 priv->regs = of_iomap(np, 0);
159 if (!priv->regs) {
160 printk(KERN_ERR "Cannot map PCI PIC registers.\n");
161 goto out_free_bootmem;
162 }
163
164 /* mask all PCI interrupts */
165 out_be32(&priv->regs->mask, ~0);
166 mb();
167
168 host = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, NUM_IRQS,
169 &pci_pic_host_ops, NUM_IRQS);
170 if (!host) {
171 ret = -ENOMEM;
172 goto out_unmap_regs;
173 }
174
175 host->host_data = priv;
176
177 priv->host = host;
178 host->host_data = priv;
179 set_irq_data(irq, priv);
180 set_irq_chained_handler(irq, pq2ads_pci_irq_demux);
181
182 of_node_put(np);
183 return 0;
184
185out_unmap_regs:
186 iounmap(priv->regs);
187out_free_bootmem:
188 free_bootmem((unsigned long)priv,
189 sizeof(sizeof(struct pq2ads_pci_pic)));
190 of_node_put(np);
191out_unmap_irq:
192 irq_dispose_mapping(irq);
193out:
194 return ret;
195}
diff --git a/arch/powerpc/platforms/82xx/pq2ads.h b/arch/powerpc/platforms/82xx/pq2ads.h
index 5b5cca6c8c88..984db42cc8e7 100644
--- a/arch/powerpc/platforms/82xx/pq2ads.h
+++ b/arch/powerpc/platforms/82xx/pq2ads.h
@@ -23,11 +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
28/* For our show_cpuinfo hooks. */
29#define CPUINFO_VENDOR "Freescale Semiconductor"
30#define CPUINFO_MACHINE "PQ2 ADS PowerPC"
31 26
32/* Backword-compatibility stuff for the drivers */ 27/* Backword-compatibility stuff for the drivers */
33#define CPM_MAP_ADDR ((uint)0xf0000000) 28#define CPM_MAP_ADDR ((uint)0xf0000000)
@@ -58,9 +53,5 @@
58#define SIU_INT_SCC3 ((uint)0x2a+CPM_IRQ_OFFSET) 53#define SIU_INT_SCC3 ((uint)0x2a+CPM_IRQ_OFFSET)
59#define SIU_INT_SCC4 ((uint)0x2b+CPM_IRQ_OFFSET) 54#define SIU_INT_SCC4 ((uint)0x2b+CPM_IRQ_OFFSET)
60 55
61void m82xx_pci_init_irq(void);
62void mpc82xx_ads_show_cpuinfo(struct seq_file*);
63void m82xx_calibrate_decr(void);
64
65#endif /* __MACH_ADS8260_DEFS */ 56#endif /* __MACH_ADS8260_DEFS */
66#endif /* __KERNEL__ */ 57#endif /* __KERNEL__ */
diff --git a/arch/powerpc/platforms/82xx/pq2fads.c b/arch/powerpc/platforms/82xx/pq2fads.c
new file mode 100644
index 000000000000..4f457a9c79ae
--- /dev/null
+++ b/arch/powerpc/platforms/82xx/pq2fads.c
@@ -0,0 +1,198 @@
1/*
2 * PQ2FADS board support
3 *
4 * Copyright 2007 Freescale Semiconductor, Inc.
5 * Author: Scott Wood <scottwood@freescale.com>
6 *
7 * Loosely based on mp82xx ADS support by Vitaly Bordug <vbordug@ru.mvista.com>
8 * Copyright (c) 2006 MontaVista Software, 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 <linux/init.h>
16#include <linux/interrupt.h>
17#include <linux/fsl_devices.h>
18
19#include <asm/io.h>
20#include <asm/cpm2.h>
21#include <asm/udbg.h>
22#include <asm/machdep.h>
23#include <asm/of_platform.h>
24#include <asm/time.h>
25
26#include <sysdev/fsl_soc.h>
27#include <sysdev/cpm2_pic.h>
28
29#include "pq2ads.h"
30#include "pq2.h"
31
32static void __init pq2fads_pic_init(void)
33{
34 struct device_node *np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
35 if (!np) {
36 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
37 return;
38 }
39
40 cpm2_pic_init(np);
41 of_node_put(np);
42
43 /* Initialize stuff for the 82xx CPLD IC and install demux */
44 pq2ads_pci_init_irq();
45}
46
47struct cpm_pin {
48 int port, pin, flags;
49};
50
51static struct cpm_pin pq2fads_pins[] = {
52 /* SCC1 */
53 {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
54 {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
55
56 /* SCC2 */
57 {3, 27, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
58 {3, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
59
60 /* FCC2 */
61 {1, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
62 {1, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
63 {1, 20, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
64 {1, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
65 {1, 22, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
66 {1, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
67 {1, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
68 {1, 25, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
69 {1, 26, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
70 {1, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
71 {1, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
72 {1, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
73 {1, 30, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
74 {1, 31, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
75 {2, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
76 {2, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
77
78 /* FCC3 */
79 {1, 4, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
80 {1, 5, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
81 {1, 6, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
82 {1, 7, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
83 {1, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
84 {1, 9, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
85 {1, 10, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
86 {1, 11, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
87 {1, 12, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
88 {1, 13, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
89 {1, 14, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
90 {1, 15, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
91 {1, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
92 {1, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
93 {2, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
94 {2, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
95};
96
97static void __init init_ioports(void)
98{
99 int i;
100
101 for (i = 0; i < ARRAY_SIZE(pq2fads_pins); i++) {
102 struct cpm_pin *pin = &pq2fads_pins[i];
103 cpm2_set_pin(pin->port, pin->pin, pin->flags);
104 }
105
106 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX);
107 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX);
108 cpm2_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_RX);
109 cpm2_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_TX);
110 cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX);
111 cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX);
112 cpm2_clk_setup(CPM_CLK_FCC3, CPM_CLK15, CPM_CLK_RX);
113 cpm2_clk_setup(CPM_CLK_FCC3, CPM_CLK16, CPM_CLK_TX);
114}
115
116static void __init pq2fads_setup_arch(void)
117{
118 struct device_node *np;
119 __be32 __iomem *bcsr;
120
121 if (ppc_md.progress)
122 ppc_md.progress("pq2fads_setup_arch()", 0);
123
124 cpm2_reset();
125
126 np = of_find_compatible_node(NULL, NULL, "fsl,pq2fads-bcsr");
127 if (!np) {
128 printk(KERN_ERR "No fsl,pq2fads-bcsr in device tree\n");
129 return;
130 }
131
132 bcsr = of_iomap(np, 0);
133 if (!bcsr) {
134 printk(KERN_ERR "Cannot map BCSR registers\n");
135 return;
136 }
137
138 of_node_put(np);
139
140 /* Enable the serial and ethernet ports */
141
142 clrbits32(&bcsr[1], BCSR1_RS232_EN1 | BCSR1_RS232_EN2 | BCSR1_FETHIEN);
143 setbits32(&bcsr[1], BCSR1_FETH_RST);
144
145 clrbits32(&bcsr[3], BCSR3_FETHIEN2);
146 setbits32(&bcsr[3], BCSR3_FETH2_RST);
147
148 iounmap(bcsr);
149
150 init_ioports();
151
152 /* Enable external IRQs */
153 clrbits32(&cpm2_immr->im_siu_conf.siu_82xx.sc_siumcr, 0x0c000000);
154
155 pq2_init_pci();
156
157 if (ppc_md.progress)
158 ppc_md.progress("pq2fads_setup_arch(), finish", 0);
159}
160
161/*
162 * Called very early, device-tree isn't unflattened
163 */
164static int __init pq2fads_probe(void)
165{
166 unsigned long root = of_get_flat_dt_root();
167 return of_flat_dt_is_compatible(root, "fsl,pq2fads");
168}
169
170static struct of_device_id __initdata of_bus_ids[] = {
171 { .name = "soc", },
172 { .name = "cpm", },
173 { .name = "localbus", },
174 {},
175};
176
177static int __init declare_of_platform_devices(void)
178{
179 if (!machine_is(pq2fads))
180 return 0;
181
182 /* Publish the QE devices */
183 of_platform_bus_probe(NULL, of_bus_ids, NULL);
184 return 0;
185}
186device_initcall(declare_of_platform_devices);
187
188define_machine(pq2fads)
189{
190 .name = "Freescale PQ2FADS",
191 .probe = pq2fads_probe,
192 .setup_arch = pq2fads_setup_arch,
193 .init_IRQ = pq2fads_pic_init,
194 .get_irq = cpm2_get_irq,
195 .calibrate_decr = generic_calibrate_decr,
196 .restart = pq2_restart,
197 .progress = udbg_progress,
198};
diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
index 3edfe170a03b..33766b8f2594 100644
--- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
@@ -43,10 +43,8 @@ static void __init mpc8313_rdb_setup_arch(void)
43 ppc_md.progress("mpc8313_rdb_setup_arch()", 0); 43 ppc_md.progress("mpc8313_rdb_setup_arch()", 0);
44 44
45#ifdef CONFIG_PCI 45#ifdef CONFIG_PCI
46 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 46 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
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..972fa8528a8c 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>
@@ -74,9 +73,8 @@ static void __init mpc832x_sys_setup_arch(void)
74 } 73 }
75 74
76#ifdef CONFIG_PCI 75#ifdef CONFIG_PCI
77 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 76 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
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
@@ -142,7 +140,7 @@ static void __init mpc832x_sys_init_IRQ(void)
142 if (!np) 140 if (!np)
143 return; 141 return;
144 142
145 qe_ic_init(np, 0); 143 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
146 of_node_put(np); 144 of_node_put(np);
147#endif /* CONFIG_QUICC_ENGINE */ 145#endif /* CONFIG_QUICC_ENGINE */
148} 146}
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 090906170a41..fbca336aa0ae 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
@@ -47,10 +93,8 @@ static void __init mpc832x_rdb_setup_arch(void)
47 ppc_md.progress("mpc832x_rdb_setup_arch()", 0); 93 ppc_md.progress("mpc832x_rdb_setup_arch()", 0);
48 94
49#ifdef CONFIG_PCI 95#ifdef CONFIG_PCI
50 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 96 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
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
@@ -107,7 +151,7 @@ void __init mpc832x_rdb_init_IRQ(void)
107 if (!np) 151 if (!np)
108 return; 152 return;
109 153
110 qe_ic_init(np, 0); 154 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
111 of_node_put(np); 155 of_node_put(np);
112#endif /* CONFIG_QUICC_ENGINE */ 156#endif /* CONFIG_QUICC_ENGINE */
113} 157}
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index 47ba5446f63c..aa768199432d 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>
@@ -53,10 +52,8 @@ static void __init mpc834x_itx_setup_arch(void)
53 ppc_md.progress("mpc834x_itx_setup_arch()", 0); 52 ppc_md.progress("mpc834x_itx_setup_arch()", 0);
54 53
55#ifdef CONFIG_PCI 54#ifdef CONFIG_PCI
56 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 55 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
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..00aed7c2269e 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>
@@ -84,10 +83,8 @@ static void __init mpc834x_mds_setup_arch(void)
84 ppc_md.progress("mpc834x_mds_setup_arch()", 0); 83 ppc_md.progress("mpc834x_mds_setup_arch()", 0);
85 84
86#ifdef CONFIG_PCI 85#ifdef CONFIG_PCI
87 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 86 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
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..0f3855c95ff5 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>
@@ -80,9 +79,8 @@ static void __init mpc836x_mds_setup_arch(void)
80 } 79 }
81 80
82#ifdef CONFIG_PCI 81#ifdef CONFIG_PCI
83 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 82 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
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
@@ -149,7 +147,7 @@ static void __init mpc836x_mds_init_IRQ(void)
149 if (!np) 147 if (!np)
150 return; 148 return;
151 149
152 qe_ic_init(np, 0); 150 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
153 of_node_put(np); 151 of_node_put(np);
154#endif /* CONFIG_QUICC_ENGINE */ 152#endif /* CONFIG_QUICC_ENGINE */
155} 153}
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..7748a3a426db 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -12,6 +12,7 @@ config MPC8540_ADS
12config MPC8560_ADS 12config MPC8560_ADS
13 bool "Freescale MPC8560 ADS" 13 bool "Freescale MPC8560 ADS"
14 select DEFAULT_UIMAGE 14 select DEFAULT_UIMAGE
15 select PPC_CPM_NEW_BINDING
15 help 16 help
16 This option enables support for the MPC 8560 ADS board 17 This option enables support for the MPC 8560 ADS board
17 18
@@ -25,17 +26,17 @@ config MPC85xx_CDS
25config MPC85xx_MDS 26config MPC85xx_MDS
26 bool "Freescale MPC85xx MDS" 27 bool "Freescale MPC85xx MDS"
27 select DEFAULT_UIMAGE 28 select DEFAULT_UIMAGE
28# select QUICC_ENGINE 29 select QUICC_ENGINE
29 help 30 help
30 This option enables support for the MPC85xx MDS board 31 This option enables support for the MPC85xx MDS board
31 32
32config MPC8544_DS 33config MPC85xx_DS
33 bool "Freescale MPC8544 DS" 34 bool "Freescale MPC85xx DS"
34 select PPC_I8259 35 select PPC_I8259
35 select DEFAULT_UIMAGE 36 select DEFAULT_UIMAGE
36 select FSL_ULI1575 37 select FSL_ULI1575
37 help 38 help
38 This option enables support for the MPC8544 DS board 39 This option enables support for the MPC85xx DS (MPC8544 DS) board
39 40
40endchoice 41endchoice
41 42
@@ -58,4 +59,4 @@ config MPC85xx
58 select FSL_PCI if PCI 59 select FSL_PCI if PCI
59 select SERIAL_8250_SHARE_IRQ if SERIAL_8250 60 select SERIAL_8250_SHARE_IRQ if SERIAL_8250
60 default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \ 61 default y if MPC8540_ADS || MPC85xx_CDS || MPC8560_ADS \
61 || MPC85xx_MDS || MPC8544_DS 62 || MPC85xx_MDS || MPC85xx_DS
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index d70f2d0f9d36..5eca92023ec8 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -1,9 +1,8 @@
1# 1#
2# Makefile for the PowerPC 85xx linux kernel. 2# Makefile for the PowerPC 85xx linux kernel.
3# 3#
4obj-$(CONFIG_PPC_85xx) += misc.o
5obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o 4obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
6obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o 5obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
7obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o 6obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
8obj-$(CONFIG_MPC8544_DS) += mpc8544_ds.o 7obj-$(CONFIG_MPC85xx_DS) += mpc85xx_ds.o
9obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o 8obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o
diff --git a/arch/powerpc/platforms/85xx/misc.c b/arch/powerpc/platforms/85xx/misc.c
deleted file mode 100644
index 4fe376e9c3b6..000000000000
--- a/arch/powerpc/platforms/85xx/misc.c
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * MPC85xx generic code.
3 *
4 * Maintained by Kumar Gala (see MAINTAINERS for contact information)
5 *
6 * Copyright 2005 Freescale Semiconductor Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 */
13#include <linux/irq.h>
14#include <linux/module.h>
15#include <asm/irq.h>
16#include <asm/io.h>
17#include <asm/prom.h>
18#include <sysdev/fsl_soc.h>
19
20static __be32 __iomem *rstcr;
21
22extern void abort(void);
23
24static int __init mpc85xx_rstcr(void)
25{
26 struct device_node *np;
27 np = of_find_node_by_name(NULL, "global-utilities");
28 if ((np && of_get_property(np, "fsl,has-rstcr", NULL))) {
29 const u32 *prop = of_get_property(np, "reg", NULL);
30 if (prop) {
31 /* map reset control register
32 * 0xE00B0 is offset of reset control register
33 */
34 rstcr = ioremap(get_immrbase() + *prop + 0xB0, 0xff);
35 if (!rstcr)
36 printk (KERN_EMERG "Error: reset control "
37 "register not mapped!\n");
38 }
39 } else
40 printk (KERN_INFO "rstcr compatible register does not exist!\n");
41 if (np)
42 of_node_put(np);
43 return 0;
44}
45
46arch_initcall(mpc85xx_rstcr);
47
48void mpc85xx_restart(char *cmd)
49{
50 local_irq_disable();
51 if (rstcr)
52 /* set reset control register */
53 out_be32(rstcr, 0x2); /* HRESET_REQ */
54 abort();
55}
diff --git a/arch/powerpc/platforms/85xx/mpc8540_ads.h b/arch/powerpc/platforms/85xx/mpc8540_ads.h
deleted file mode 100644
index da82f4c0fdac..000000000000
--- a/arch/powerpc/platforms/85xx/mpc8540_ads.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * arch/powerpc/platforms/85xx/mpc8540_ads.h
3 *
4 * MPC8540ADS board definitions
5 *
6 * Maintainer: Kumar Gala <kumar.gala@freescale.com>
7 *
8 * Copyright 2004 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 as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16
17#ifndef __MACH_MPC8540ADS_H__
18#define __MACH_MPC8540ADS_H__
19
20#include <linux/initrd.h>
21
22#define BOARD_CCSRBAR ((uint)0xe0000000)
23#define BCSR_ADDR ((uint)0xf8000000)
24#define BCSR_SIZE ((uint)(32 * 1024))
25
26/* PCI interrupt controller */
27#define PIRQA MPC85xx_IRQ_EXT1
28#define PIRQB MPC85xx_IRQ_EXT2
29#define PIRQC MPC85xx_IRQ_EXT3
30#define PIRQD MPC85xx_IRQ_EXT4
31
32/* Offset of CPM register space */
33#define CPM_MAP_ADDR (CCSRBAR + MPC85xx_CPM_OFFSET)
34
35#endif /* __MACH_MPC8540ADS_H__ */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h b/arch/powerpc/platforms/85xx/mpc85xx.h
deleted file mode 100644
index 5b34deef12b5..000000000000
--- a/arch/powerpc/platforms/85xx/mpc85xx.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * arch/powerpc/platforms/85xx/mpc85xx.h
3 *
4 * MPC85xx soc definitions/function decls
5 *
6 * Maintainer: Kumar Gala <kumar.gala@freescale.com>
7 *
8 * Copyright 2005 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 as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16
17extern void mpc85xx_restart(char *);
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index 40a828675c7b..bccdc25f83a2 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -17,26 +17,22 @@
17#include <linux/kdev_t.h> 17#include <linux/kdev_t.h>
18#include <linux/delay.h> 18#include <linux/delay.h>
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <linux/of_platform.h>
20 21
21#include <asm/system.h> 22#include <asm/system.h>
22#include <asm/time.h> 23#include <asm/time.h>
23#include <asm/machdep.h> 24#include <asm/machdep.h>
24#include <asm/pci-bridge.h> 25#include <asm/pci-bridge.h>
25#include <asm/mpc85xx.h>
26#include <asm/prom.h>
27#include <asm/mpic.h> 26#include <asm/mpic.h>
28#include <mm/mmu_decl.h> 27#include <mm/mmu_decl.h>
29#include <asm/udbg.h> 28#include <asm/udbg.h>
30 29
31#include <sysdev/fsl_soc.h> 30#include <sysdev/fsl_soc.h>
32#include <sysdev/fsl_pci.h> 31#include <sysdev/fsl_pci.h>
33#include "mpc85xx.h"
34 32
35#ifdef CONFIG_CPM2 33#ifdef CONFIG_CPM2
36#include <linux/fs_enet_pd.h>
37#include <asm/cpm2.h> 34#include <asm/cpm2.h>
38#include <sysdev/cpm2_pic.h> 35#include <sysdev/cpm2_pic.h>
39#include <asm/fs_pd.h>
40#endif 36#endif
41 37
42#ifdef CONFIG_PCI 38#ifdef CONFIG_PCI
@@ -96,10 +92,10 @@ static void __init mpc85xx_ads_pic_init(void)
96 92
97#ifdef CONFIG_CPM2 93#ifdef CONFIG_CPM2
98 /* Setup CPM2 PIC */ 94 /* Setup CPM2 PIC */
99 np = of_find_node_by_type(NULL, "cpm-pic"); 95 np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
100 if (np == NULL) { 96 if (np == NULL) {
101 printk(KERN_ERR "PIC init: can not find cpm-pic node\n"); 97 printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
102 return; 98 return;
103 } 99 }
104 irq = irq_of_parse_and_map(np, 0); 100 irq = irq_of_parse_and_map(np, 0);
105 101
@@ -112,87 +108,80 @@ static void __init mpc85xx_ads_pic_init(void)
112 * Setup the architecture 108 * Setup the architecture
113 */ 109 */
114#ifdef CONFIG_CPM2 110#ifdef CONFIG_CPM2
115void init_fcc_ioports(struct fs_platform_info *fpi) 111struct cpm_pin {
112 int port, pin, flags;
113};
114
115static struct cpm_pin mpc8560_ads_pins[] = {
116 /* SCC1 */
117 {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
118 {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
119 {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
120
121 /* SCC2 */
122 {3, 26, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
123 {3, 27, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
124 {3, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
125
126 /* FCC2 */
127 {1, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
128 {1, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
129 {1, 20, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
130 {1, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
131 {1, 22, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
132 {1, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
133 {1, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
134 {1, 25, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
135 {1, 26, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
136 {1, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
137 {1, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
138 {1, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
139 {1, 30, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
140 {1, 31, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
141 {2, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* CLK14 */
142 {2, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* CLK13 */
143
144 /* FCC3 */
145 {1, 4, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
146 {1, 5, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
147 {1, 6, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
148 {1, 7, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
149 {1, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
150 {1, 9, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
151 {1, 10, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
152 {1, 11, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
153 {1, 12, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
154 {1, 13, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
155 {1, 14, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
156 {1, 15, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
157 {1, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
158 {1, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
159 {2, 16, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* CLK16 */
160 {2, 17, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* CLK15 */
161};
162
163static void __init init_ioports(void)
116{ 164{
117 struct io_port *io = cpm2_map(im_ioport); 165 int i;
118 int fcc_no = fs_get_fcc_index(fpi->fs_no); 166
119 int target; 167 for (i = 0; i < ARRAY_SIZE(mpc8560_ads_pins); i++) {
120 u32 tempval; 168 struct cpm_pin *pin = &mpc8560_ads_pins[i];
121 169 cpm2_set_pin(pin->port, pin->pin, pin->flags);
122 switch(fcc_no) {
123 case 1:
124 tempval = in_be32(&io->iop_pdirb);
125 tempval &= ~PB2_DIRB0;
126 tempval |= PB2_DIRB1;
127 out_be32(&io->iop_pdirb, tempval);
128
129 tempval = in_be32(&io->iop_psorb);
130 tempval &= ~PB2_PSORB0;
131 tempval |= PB2_PSORB1;
132 out_be32(&io->iop_psorb, tempval);
133
134 tempval = in_be32(&io->iop_pparb);
135 tempval |= (PB2_DIRB0 | PB2_DIRB1);
136 out_be32(&io->iop_pparb, tempval);
137
138 target = CPM_CLK_FCC2;
139 break;
140 case 2:
141 tempval = in_be32(&io->iop_pdirb);
142 tempval &= ~PB3_DIRB0;
143 tempval |= PB3_DIRB1;
144 out_be32(&io->iop_pdirb, tempval);
145
146 tempval = in_be32(&io->iop_psorb);
147 tempval &= ~PB3_PSORB0;
148 tempval |= PB3_PSORB1;
149 out_be32(&io->iop_psorb, tempval);
150
151 tempval = in_be32(&io->iop_pparb);
152 tempval |= (PB3_DIRB0 | PB3_DIRB1);
153 out_be32(&io->iop_pparb, tempval);
154
155 tempval = in_be32(&io->iop_pdirc);
156 tempval |= PC3_DIRC1;
157 out_be32(&io->iop_pdirc, tempval);
158
159 tempval = in_be32(&io->iop_pparc);
160 tempval |= PC3_DIRC1;
161 out_be32(&io->iop_pparc, tempval);
162
163 target = CPM_CLK_FCC3;
164 break;
165 default:
166 printk(KERN_ERR "init_fcc_ioports: invalid FCC number\n");
167 return;
168 } 170 }
169 171
170 /* Port C has clocks...... */ 172 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX);
171 tempval = in_be32(&io->iop_psorc); 173 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX);
172 tempval &= ~(PC_CLK(fpi->clk_rx - 8) | PC_CLK(fpi->clk_tx - 8)); 174 cpm2_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_RX);
173 out_be32(&io->iop_psorc, tempval); 175 cpm2_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_TX);
174 176 cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX);
175 tempval = in_be32(&io->iop_pdirc); 177 cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX);
176 tempval &= ~(PC_CLK(fpi->clk_rx - 8) | PC_CLK(fpi->clk_tx - 8)); 178 cpm2_clk_setup(CPM_CLK_FCC3, CPM_CLK15, CPM_CLK_RX);
177 out_be32(&io->iop_pdirc, tempval); 179 cpm2_clk_setup(CPM_CLK_FCC3, CPM_CLK16, CPM_CLK_TX);
178 tempval = in_be32(&io->iop_pparc);
179 tempval |= (PC_CLK(fpi->clk_rx - 8) | PC_CLK(fpi->clk_tx - 8));
180 out_be32(&io->iop_pparc, tempval);
181
182 cpm2_unmap(io);
183
184 /* Configure Serial Interface clock routing.
185 * First, clear FCC bits to zero,
186 * then set the ones we want.
187 */
188 cpm2_clk_setup(target, fpi->clk_rx, CPM_CLK_RX);
189 cpm2_clk_setup(target, fpi->clk_tx, CPM_CLK_TX);
190} 180}
191#endif 181#endif
192 182
193static void __init mpc85xx_ads_setup_arch(void) 183static void __init mpc85xx_ads_setup_arch(void)
194{ 184{
195 struct device_node *cpu;
196#ifdef CONFIG_PCI 185#ifdef CONFIG_PCI
197 struct device_node *np; 186 struct device_node *np;
198#endif 187#endif
@@ -200,25 +189,15 @@ static void __init mpc85xx_ads_setup_arch(void)
200 if (ppc_md.progress) 189 if (ppc_md.progress)
201 ppc_md.progress("mpc85xx_ads_setup_arch()", 0); 190 ppc_md.progress("mpc85xx_ads_setup_arch()", 0);
202 191
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 192#ifdef CONFIG_CPM2
216 cpm2_reset(); 193 cpm2_reset();
194 init_ioports();
217#endif 195#endif
218 196
219#ifdef CONFIG_PCI 197#ifdef CONFIG_PCI
220 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 198 for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
221 fsl_add_bridge(np, 1); 199 fsl_add_bridge(np, 1);
200
222 ppc_md.pci_exclude_device = mpc85xx_exclude_device; 201 ppc_md.pci_exclude_device = mpc85xx_exclude_device;
223#endif 202#endif
224} 203}
@@ -244,6 +223,24 @@ static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
244 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024)); 223 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
245} 224}
246 225
226static struct of_device_id __initdata of_bus_ids[] = {
227 { .name = "soc", },
228 { .type = "soc", },
229 { .name = "cpm", },
230 { .name = "localbus", },
231 {},
232};
233
234static int __init declare_of_platform_devices(void)
235{
236 if (!machine_is(mpc85xx_ads))
237 return 0;
238
239 of_platform_bus_probe(NULL, of_bus_ids, NULL);
240 return 0;
241}
242device_initcall(declare_of_platform_devices);
243
247/* 244/*
248 * Called very early, device-tree isn't unflattened 245 * Called very early, device-tree isn't unflattened
249 */ 246 */
@@ -261,7 +258,7 @@ define_machine(mpc85xx_ads) {
261 .init_IRQ = mpc85xx_ads_pic_init, 258 .init_IRQ = mpc85xx_ads_pic_init,
262 .show_cpuinfo = mpc85xx_ads_show_cpuinfo, 259 .show_cpuinfo = mpc85xx_ads_show_cpuinfo,
263 .get_irq = mpic_get_irq, 260 .get_irq = mpic_get_irq,
264 .restart = mpc85xx_restart, 261 .restart = fsl_rstcr_restart,
265 .calibrate_decr = generic_calibrate_decr, 262 .calibrate_decr = generic_calibrate_decr,
266 .progress = udbg_progress, 263 .progress = udbg_progress,
267}; 264};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.h b/arch/powerpc/platforms/85xx/mpc85xx_ads.h
deleted file mode 100644
index 46c3532992aa..000000000000
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.h
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * MPC85xx ADS board definitions
3 *
4 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
5 *
6 * Copyright 2004 Freescale Semiconductor Inc.
7 *
8 * 2006 (c) MontaVista Software, Inc.
9 * Vitaly Bordug <vbordug@ru.mvista.com>
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 */
17
18#ifndef __MACH_MPC85XXADS_H
19#define __MACH_MPC85XXADS_H
20
21#include <linux/initrd.h>
22#include <sysdev/fsl_soc.h>
23
24#define BCSR_ADDR ((uint)0xf8000000)
25#define BCSR_SIZE ((uint)(32 * 1024))
26
27#ifdef CONFIG_CPM2
28
29#define MPC85xx_CPM_OFFSET (0x80000)
30
31#define CPM_MAP_ADDR (get_immrbase() + MPC85xx_CPM_OFFSET)
32#define CPM_IRQ_OFFSET 60
33
34#define SIU_INT_SMC1 ((uint)0x04+CPM_IRQ_OFFSET)
35#define SIU_INT_SMC2 ((uint)0x05+CPM_IRQ_OFFSET)
36#define SIU_INT_SCC1 ((uint)0x28+CPM_IRQ_OFFSET)
37#define SIU_INT_SCC2 ((uint)0x29+CPM_IRQ_OFFSET)
38#define SIU_INT_SCC3 ((uint)0x2a+CPM_IRQ_OFFSET)
39#define SIU_INT_SCC4 ((uint)0x2b+CPM_IRQ_OFFSET)
40
41/* FCC1 Clock Source Configuration. These can be
42 * redefined in the board specific file.
43 * Can only choose from CLK9-12 */
44#define F1_RXCLK 12
45#define F1_TXCLK 11
46
47/* FCC2 Clock Source Configuration. These can be
48 * redefined in the board specific file.
49 * Can only choose from CLK13-16 */
50#define F2_RXCLK 13
51#define F2_TXCLK 14
52
53/* FCC3 Clock Source Configuration. These can be
54 * redefined in the board specific file.
55 * Can only choose from CLK13-16 */
56#define F3_RXCLK 15
57#define F3_TXCLK 16
58
59#endif /* CONFIG_CPM2 */
60#endif /* __MACH_MPC85XXADS_H */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 2d4cb7847604..4d063eec6210 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -35,9 +35,7 @@
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>
41#include <asm/irq.h> 39#include <asm/irq.h>
42#include <mm/mmu_decl.h> 40#include <mm/mmu_decl.h>
43#include <asm/prom.h> 41#include <asm/prom.h>
@@ -47,7 +45,15 @@
47 45
48#include <sysdev/fsl_soc.h> 46#include <sysdev/fsl_soc.h>
49#include <sysdev/fsl_pci.h> 47#include <sysdev/fsl_pci.h>
50#include "mpc85xx.h" 48
49/* CADMUS info */
50/* xxx - galak, move into device tree */
51#define CADMUS_BASE (0xf8004000)
52#define CADMUS_SIZE (256)
53#define CM_VER (0)
54#define CM_CSR (1)
55#define CM_RST (2)
56
51 57
52static int cds_pci_slot = 2; 58static int cds_pci_slot = 2;
53static volatile u8 *cadmus; 59static volatile u8 *cadmus;
@@ -97,7 +103,7 @@ static void mpc85xx_cds_restart(char *cmd)
97 * If we can't find the VIA chip (maybe the P2P bridge is disabled) 103 * If we can't find the VIA chip (maybe the P2P bridge is disabled)
98 * or the VIA chip reset didn't work, just use the default reset. 104 * or the VIA chip reset didn't work, just use the default reset.
99 */ 105 */
100 mpc85xx_restart(NULL); 106 fsl_rstcr_restart(NULL);
101} 107}
102 108
103static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev) 109static void __init mpc85xx_cds_pci_irq_fixup(struct pci_dev *dev)
@@ -266,7 +272,6 @@ device_initcall(mpc85xx_cds_8259_attach);
266 */ 272 */
267static void __init mpc85xx_cds_setup_arch(void) 273static void __init mpc85xx_cds_setup_arch(void)
268{ 274{
269 struct device_node *cpu;
270#ifdef CONFIG_PCI 275#ifdef CONFIG_PCI
271 struct device_node *np; 276 struct device_node *np;
272#endif 277#endif
@@ -274,18 +279,6 @@ static void __init mpc85xx_cds_setup_arch(void)
274 if (ppc_md.progress) 279 if (ppc_md.progress)
275 ppc_md.progress("mpc85xx_cds_setup_arch()", 0); 280 ppc_md.progress("mpc85xx_cds_setup_arch()", 0);
276 281
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); 282 cadmus = ioremap(CADMUS_BASE, CADMUS_SIZE);
290 cds_pci_slot = ((cadmus[CM_CSR] >> 6) & 0x3) + 1; 283 cds_pci_slot = ((cadmus[CM_CSR] >> 6) & 0x3) + 1;
291 284
@@ -297,14 +290,18 @@ static void __init mpc85xx_cds_setup_arch(void)
297 } 290 }
298 291
299#ifdef CONFIG_PCI 292#ifdef CONFIG_PCI
300 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) { 293 for_each_node_by_type(np, "pci") {
301 struct resource rsrc; 294 if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
302 of_address_to_resource(np, 0, &rsrc); 295 of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
303 if ((rsrc.start & 0xfffff) == 0x8000) 296 struct resource rsrc;
304 fsl_add_bridge(np, 1); 297 of_address_to_resource(np, 0, &rsrc);
305 else 298 if ((rsrc.start & 0xfffff) == 0x8000)
306 fsl_add_bridge(np, 0); 299 fsl_add_bridge(np, 1);
300 else
301 fsl_add_bridge(np, 0);
302 }
307 } 303 }
304
308 ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup; 305 ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
309 ppc_md.pci_exclude_device = mpc85xx_exclude_device; 306 ppc_md.pci_exclude_device = mpc85xx_exclude_device;
310#endif 307#endif
@@ -353,7 +350,7 @@ define_machine(mpc85xx_cds) {
353 .restart = mpc85xx_cds_restart, 350 .restart = mpc85xx_cds_restart,
354 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 351 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
355#else 352#else
356 .restart = mpc85xx_restart, 353 .restart = fsl_rstcr_restart,
357#endif 354#endif
358 .calibrate_decr = generic_calibrate_decr, 355 .calibrate_decr = generic_calibrate_decr,
359 .progress = udbg_progress, 356 .progress = udbg_progress,
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.h b/arch/powerpc/platforms/85xx/mpc85xx_cds.h
deleted file mode 100644
index b251c9feb3dc..000000000000
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * arch/powerpc/platforms/85xx/mpc85xx_cds.h
3 *
4 * MPC85xx CDS board definitions
5 *
6 * Maintainer: Kumar Gala <galak@kernel.crashing.org>
7 *
8 * Copyright 2004 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 as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 *
15 */
16
17#ifndef __MACH_MPC85XX_CDS_H__
18#define __MACH_MPC85XX_CDS_H__
19
20/* CADMUS info */
21#define CADMUS_BASE (0xf8004000)
22#define CADMUS_SIZE (256)
23#define CM_VER (0)
24#define CM_CSR (1)
25#define CM_RST (2)
26
27/* CDS NVRAM/RTC */
28#define CDS_RTC_ADDR (0xf8000000)
29#define CDS_RTC_SIZE (8 * 1024)
30
31/* PCI interrupt controller */
32#define PIRQ0A MPC85xx_IRQ_EXT0
33#define PIRQ0B MPC85xx_IRQ_EXT1
34#define PIRQ0C MPC85xx_IRQ_EXT2
35#define PIRQ0D MPC85xx_IRQ_EXT3
36#define PIRQ1A MPC85xx_IRQ_EXT11
37
38#define NR_8259_INTS 16
39#define CPM_IRQ_OFFSET NR_8259_INTS
40
41#define MPC85xx_OPENPIC_IRQ_OFFSET 80
42
43#endif /* __MACH_MPC85XX_CDS_H__ */
diff --git a/arch/powerpc/platforms/85xx/mpc8544_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index 48983bc56d46..59c121a97ac7 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>
@@ -24,7 +24,6 @@
24#include <asm/time.h> 24#include <asm/time.h>
25#include <asm/machdep.h> 25#include <asm/machdep.h>
26#include <asm/pci-bridge.h> 26#include <asm/pci-bridge.h>
27#include <asm/mpc85xx.h>
28#include <mm/mmu_decl.h> 27#include <mm/mmu_decl.h>
29#include <asm/prom.h> 28#include <asm/prom.h>
30#include <asm/udbg.h> 29#include <asm/udbg.h>
@@ -33,7 +32,6 @@
33 32
34#include <sysdev/fsl_soc.h> 33#include <sysdev/fsl_soc.h>
35#include <sysdev/fsl_pci.h> 34#include <sysdev/fsl_pci.h>
36#include "mpc85xx.h"
37 35
38#undef DEBUG 36#undef DEBUG
39 37
@@ -44,7 +42,7 @@
44#endif 42#endif
45 43
46#ifdef CONFIG_PPC_I8259 44#ifdef CONFIG_PPC_I8259
47static void mpc8544_8259_cascade(unsigned int irq, struct irq_desc *desc) 45static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc)
48{ 46{
49 unsigned int cascade_irq = i8259_irq(); 47 unsigned int cascade_irq = i8259_irq();
50 48
@@ -55,7 +53,7 @@ static void mpc8544_8259_cascade(unsigned int irq, struct irq_desc *desc)
55} 53}
56#endif /* CONFIG_PPC_I8259 */ 54#endif /* CONFIG_PPC_I8259 */
57 55
58void __init mpc8544_ds_pic_init(void) 56void __init mpc85xx_ds_pic_init(void)
59{ 57{
60 struct mpic *mpic; 58 struct mpic *mpic;
61 struct resource r; 59 struct resource r;
@@ -104,16 +102,17 @@ void __init mpc8544_ds_pic_init(void)
104 return; 102 return;
105 } 103 }
106 104
107 DBG("mpc8544ds: cascade mapped to irq %d\n", cascade_irq); 105 DBG("mpc85xxds: cascade mapped to irq %d\n", cascade_irq);
108 106
109 i8259_init(cascade_node, 0); 107 i8259_init(cascade_node, 0);
110 of_node_put(cascade_node); 108 of_node_put(cascade_node);
111 109
112 set_irq_chained_handler(cascade_irq, mpc8544_8259_cascade); 110 set_irq_chained_handler(cascade_irq, mpc85xx_8259_cascade);
113#endif /* CONFIG_PPC_I8259 */ 111#endif /* CONFIG_PPC_I8259 */
114} 112}
115 113
116#ifdef CONFIG_PCI 114#ifdef CONFIG_PCI
115static int primary_phb_addr;
117extern int uses_fsl_uli_m1575; 116extern int uses_fsl_uli_m1575;
118extern int uli_exclude_device(struct pci_controller *hose, 117extern int uli_exclude_device(struct pci_controller *hose,
119 u_char bus, u_char devfn); 118 u_char bus, u_char devfn);
@@ -121,13 +120,13 @@ extern int uli_exclude_device(struct pci_controller *hose,
121static int mpc85xx_exclude_device(struct pci_controller *hose, 120static int mpc85xx_exclude_device(struct pci_controller *hose,
122 u_char bus, u_char devfn) 121 u_char bus, u_char devfn)
123{ 122{
124 struct device_node* node; 123 struct device_node* node;
125 struct resource rsrc; 124 struct resource rsrc;
126 125
127 node = (struct device_node *)hose->arch_data; 126 node = (struct device_node *)hose->arch_data;
128 of_address_to_resource(node, 0, &rsrc); 127 of_address_to_resource(node, 0, &rsrc);
129 128
130 if ((rsrc.start & 0xfffff) == 0xb000) { 129 if ((rsrc.start & 0xfffff) == primary_phb_addr) {
131 return uli_exclude_device(hose, bus, devfn); 130 return uli_exclude_device(hose, bus, devfn);
132 } 131 }
133 132
@@ -138,29 +137,33 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
138/* 137/*
139 * Setup the architecture 138 * Setup the architecture
140 */ 139 */
141static void __init mpc8544_ds_setup_arch(void) 140static void __init mpc85xx_ds_setup_arch(void)
142{ 141{
143#ifdef CONFIG_PCI 142#ifdef CONFIG_PCI
144 struct device_node *np; 143 struct device_node *np;
145#endif 144#endif
146 145
147 if (ppc_md.progress) 146 if (ppc_md.progress)
148 ppc_md.progress("mpc8544_ds_setup_arch()", 0); 147 ppc_md.progress("mpc85xx_ds_setup_arch()", 0);
149 148
150#ifdef CONFIG_PCI 149#ifdef CONFIG_PCI
151 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) { 150 for_each_node_by_type(np, "pci") {
152 struct resource rsrc; 151 if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
153 of_address_to_resource(np, 0, &rsrc); 152 of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
154 if ((rsrc.start & 0xfffff) == 0xb000) 153 struct resource rsrc;
155 fsl_add_bridge(np, 1); 154 of_address_to_resource(np, 0, &rsrc);
156 else 155 if ((rsrc.start & 0xfffff) == primary_phb_addr)
157 fsl_add_bridge(np, 0); 156 fsl_add_bridge(np, 1);
157 else
158 fsl_add_bridge(np, 0);
159 }
158 } 160 }
161
159 uses_fsl_uli_m1575 = 1; 162 uses_fsl_uli_m1575 = 1;
160 ppc_md.pci_exclude_device = mpc85xx_exclude_device; 163 ppc_md.pci_exclude_device = mpc85xx_exclude_device;
161#endif 164#endif
162 165
163 printk("MPC8544 DS board from Freescale Semiconductor\n"); 166 printk("MPC85xx DS board from Freescale Semiconductor\n");
164} 167}
165 168
166/* 169/*
@@ -170,19 +173,57 @@ static int __init mpc8544_ds_probe(void)
170{ 173{
171 unsigned long root = of_get_flat_dt_root(); 174 unsigned long root = of_get_flat_dt_root();
172 175
173 return of_flat_dt_is_compatible(root, "MPC8544DS"); 176 if (of_flat_dt_is_compatible(root, "MPC8544DS")) {
177#ifdef CONFIG_PCI
178 primary_phb_addr = 0xb000;
179#endif
180 return 1;
181 } else {
182 return 0;
183 }
184}
185
186/*
187 * Called very early, device-tree isn't unflattened
188 */
189static int __init mpc8572_ds_probe(void)
190{
191 unsigned long root = of_get_flat_dt_root();
192
193 if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS")) {
194#ifdef CONFIG_PCI
195 primary_phb_addr = 0x8000;
196#endif
197 return 1;
198 } else {
199 return 0;
200 }
174} 201}
175 202
176define_machine(mpc8544_ds) { 203define_machine(mpc8544_ds) {
177 .name = "MPC8544 DS", 204 .name = "MPC8544 DS",
178 .probe = mpc8544_ds_probe, 205 .probe = mpc8544_ds_probe,
179 .setup_arch = mpc8544_ds_setup_arch, 206 .setup_arch = mpc85xx_ds_setup_arch,
180 .init_IRQ = mpc8544_ds_pic_init, 207 .init_IRQ = mpc85xx_ds_pic_init,
208#ifdef CONFIG_PCI
209 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
210#endif
211 .get_irq = mpic_get_irq,
212 .restart = fsl_rstcr_restart,
213 .calibrate_decr = generic_calibrate_decr,
214 .progress = udbg_progress,
215};
216
217define_machine(mpc8572_ds) {
218 .name = "MPC8572 DS",
219 .probe = mpc8572_ds_probe,
220 .setup_arch = mpc85xx_ds_setup_arch,
221 .init_IRQ = mpc85xx_ds_pic_init,
181#ifdef CONFIG_PCI 222#ifdef CONFIG_PCI
182 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 223 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
183#endif 224#endif
184 .get_irq = mpic_get_irq, 225 .get_irq = mpic_get_irq,
185 .restart = mpc85xx_restart, 226 .restart = fsl_rstcr_restart,
186 .calibrate_decr = generic_calibrate_decr, 227 .calibrate_decr = generic_calibrate_decr,
187 .progress = udbg_progress, 228 .progress = udbg_progress,
188}; 229};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 7ca7e676f1c4..61b3eedf41b9 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -38,9 +38,7 @@
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>
44#include <asm/irq.h> 42#include <asm/irq.h>
45#include <mm/mmu_decl.h> 43#include <mm/mmu_decl.h>
46#include <asm/prom.h> 44#include <asm/prom.h>
@@ -51,8 +49,6 @@
51#include <asm/qe_ic.h> 49#include <asm/qe_ic.h>
52#include <asm/mpic.h> 50#include <asm/mpic.h>
53 51
54#include "mpc85xx.h"
55
56#undef DEBUG 52#undef DEBUG
57#ifdef DEBUG 53#ifdef DEBUG
58#define DBG(fmt...) udbg_printf(fmt) 54#define DBG(fmt...) udbg_printf(fmt)
@@ -73,17 +69,6 @@ static void __init mpc85xx_mds_setup_arch(void)
73 if (ppc_md.progress) 69 if (ppc_md.progress)
74 ppc_md.progress("mpc85xx_mds_setup_arch()", 0); 70 ppc_md.progress("mpc85xx_mds_setup_arch()", 0);
75 71
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 */ 72 /* Map BCSR area */
88 np = of_find_node_by_name(NULL, "bcsr"); 73 np = of_find_node_by_name(NULL, "bcsr");
89 if (np != NULL) { 74 if (np != NULL) {
@@ -95,9 +80,17 @@ static void __init mpc85xx_mds_setup_arch(void)
95 } 80 }
96 81
97#ifdef CONFIG_PCI 82#ifdef CONFIG_PCI
98 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 83 for_each_node_by_type(np, "pci") {
99 fsl_add_bridge(np, 1); 84 if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
100 of_node_put(np); 85 of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
86 struct resource rsrc;
87 of_address_to_resource(np, 0, &rsrc);
88 if ((rsrc.start & 0xfffff) == 0x8000)
89 fsl_add_bridge(np, 1);
90 else
91 fsl_add_bridge(np, 0);
92 }
93 }
101#endif 94#endif
102 95
103#ifdef CONFIG_QUICC_ENGINE 96#ifdef CONFIG_QUICC_ENGINE
@@ -119,18 +112,22 @@ static void __init mpc85xx_mds_setup_arch(void)
119 } 112 }
120 113
121 if (bcsr_regs) { 114 if (bcsr_regs) {
122 u8 bcsr_phy; 115#define BCSR_UCC1_GETH_EN (0x1 << 7)
116#define BCSR_UCC2_GETH_EN (0x1 << 7)
117#define BCSR_UCC1_MODE_MSK (0x3 << 4)
118#define BCSR_UCC2_MODE_MSK (0x3 << 0)
123 119
124 /* Reset the Ethernet PHY */ 120 /* Turn off UCC1 & UCC2 */
125 bcsr_phy = in_be8(&bcsr_regs[9]); 121 clrbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
126 bcsr_phy &= ~0x20; 122 clrbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
127 out_be8(&bcsr_regs[9], bcsr_phy);
128 123
129 udelay(1000); 124 /* Mode is RGMII, all bits clear */
125 clrbits8(&bcsr_regs[11], BCSR_UCC1_MODE_MSK |
126 BCSR_UCC2_MODE_MSK);
130 127
131 bcsr_phy = in_be8(&bcsr_regs[9]); 128 /* Turn UCC1 & UCC2 on */
132 bcsr_phy |= 0x20; 129 setbits8(&bcsr_regs[8], BCSR_UCC1_GETH_EN);
133 out_be8(&bcsr_regs[9], bcsr_phy); 130 setbits8(&bcsr_regs[9], BCSR_UCC2_GETH_EN);
134 131
135 iounmap(bcsr_regs); 132 iounmap(bcsr_regs);
136 } 133 }
@@ -186,7 +183,7 @@ static void __init mpc85xx_mds_pic_init(void)
186 if (!np) 183 if (!np)
187 return; 184 return;
188 185
189 qe_ic_init(np, 0); 186 qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL);
190 of_node_put(np); 187 of_node_put(np);
191#endif /* CONFIG_QUICC_ENGINE */ 188#endif /* CONFIG_QUICC_ENGINE */
192} 189}
@@ -204,7 +201,7 @@ define_machine(mpc85xx_mds) {
204 .setup_arch = mpc85xx_mds_setup_arch, 201 .setup_arch = mpc85xx_mds_setup_arch,
205 .init_IRQ = mpc85xx_mds_pic_init, 202 .init_IRQ = mpc85xx_mds_pic_init,
206 .get_irq = mpic_get_irq, 203 .get_irq = mpic_get_irq,
207 .restart = mpc85xx_restart, 204 .restart = fsl_rstcr_restart,
208 .calibrate_decr = generic_calibrate_decr, 205 .calibrate_decr = generic_calibrate_decr,
209 .progress = udbg_progress, 206 .progress = udbg_progress,
210#ifdef CONFIG_PCI 207#ifdef CONFIG_PCI
diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
index 685b2fbbbe00..21d113536b86 100644
--- a/arch/powerpc/platforms/86xx/Kconfig
+++ b/arch/powerpc/platforms/86xx/Kconfig
@@ -11,6 +11,12 @@ config MPC8641_HPCN
11 help 11 help
12 This option enables support for the MPC8641 HPCN board. 12 This option enables support for the MPC8641 HPCN board.
13 13
14config MPC8610_HPCD
15 bool "Freescale MPC8610 HPCD"
16 select DEFAULT_UIMAGE
17 help
18 This option enables support for the MPC8610 HPCD board.
19
14endchoice 20endchoice
15 21
16config MPC8641 22config MPC8641
@@ -19,3 +25,10 @@ config MPC8641
19 select PPC_UDBG_16550 25 select PPC_UDBG_16550
20 select MPIC 26 select MPIC
21 default y if MPC8641_HPCN 27 default y if MPC8641_HPCN
28
29config MPC8610
30 bool
31 select FSL_PCI if PCI
32 select PPC_UDBG_16550
33 select MPIC
34 default y if MPC8610_HPCD
diff --git a/arch/powerpc/platforms/86xx/Makefile b/arch/powerpc/platforms/86xx/Makefile
index 3376c7767f2d..c96706327eaa 100644
--- a/arch/powerpc/platforms/86xx/Makefile
+++ b/arch/powerpc/platforms/86xx/Makefile
@@ -4,3 +4,4 @@
4 4
5obj-$(CONFIG_SMP) += mpc86xx_smp.o 5obj-$(CONFIG_SMP) += mpc86xx_smp.o
6obj-$(CONFIG_MPC8641_HPCN) += mpc86xx_hpcn.o 6obj-$(CONFIG_MPC8641_HPCN) += mpc86xx_hpcn.o
7obj-$(CONFIG_MPC8610_HPCD) += mpc8610_hpcd.o
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
new file mode 100644
index 000000000000..6390895e5e92
--- /dev/null
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -0,0 +1,216 @@
1/*
2 * MPC8610 HPCD board specific routines
3 *
4 * Initial author: Xianghua Xiao <x.xiao@freescale.com>
5 * Recode: Jason Jin <jason.jin@freescale.com>
6 *
7 * Rewrite the interrupt routing. remove the 8259PIC support,
8 * All the integrated device in ULI use sideband interrupt.
9 *
10 * Copyright 2007 Freescale Semiconductor Inc.
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 */
17
18#include <linux/stddef.h>
19#include <linux/kernel.h>
20#include <linux/pci.h>
21#include <linux/kdev_t.h>
22#include <linux/delay.h>
23#include <linux/seq_file.h>
24#include <linux/of.h>
25
26#include <asm/system.h>
27#include <asm/time.h>
28#include <asm/machdep.h>
29#include <asm/pci-bridge.h>
30#include <asm/mpc86xx.h>
31#include <asm/prom.h>
32#include <mm/mmu_decl.h>
33#include <asm/udbg.h>
34
35#include <asm/mpic.h>
36
37#include <sysdev/fsl_pci.h>
38#include <sysdev/fsl_soc.h>
39
40void __init
41mpc86xx_hpcd_init_irq(void)
42{
43 struct mpic *mpic1;
44 struct device_node *np;
45 struct resource res;
46
47 /* Determine PIC address. */
48 np = of_find_node_by_type(NULL, "open-pic");
49 if (np == NULL)
50 return;
51 of_address_to_resource(np, 0, &res);
52
53 /* Alloc mpic structure and per isu has 16 INT entries. */
54 mpic1 = mpic_alloc(np, res.start,
55 MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
56 0, 256, " MPIC ");
57 BUG_ON(mpic1 == NULL);
58
59 mpic_init(mpic1);
60}
61
62#ifdef CONFIG_PCI
63static void __devinit quirk_uli1575(struct pci_dev *dev)
64{
65 u32 temp32;
66
67 /* Disable INTx */
68 pci_read_config_dword(dev, 0x48, &temp32);
69 pci_write_config_dword(dev, 0x48, (temp32 | 1<<26));
70
71 /* Enable sideband interrupt */
72 pci_read_config_dword(dev, 0x90, &temp32);
73 pci_write_config_dword(dev, 0x90, (temp32 | 1<<22));
74}
75
76static void __devinit quirk_uli5288(struct pci_dev *dev)
77{
78 unsigned char c;
79 unsigned short temp;
80
81 /* Interrupt Disable, Needed when SATA disabled */
82 pci_read_config_word(dev, PCI_COMMAND, &temp);
83 temp |= 1<<10;
84 pci_write_config_word(dev, PCI_COMMAND, temp);
85
86 pci_read_config_byte(dev, 0x83, &c);
87 c |= 0x80;
88 pci_write_config_byte(dev, 0x83, c);
89
90 pci_write_config_byte(dev, PCI_CLASS_PROG, 0x01);
91 pci_write_config_byte(dev, PCI_CLASS_DEVICE, 0x06);
92
93 pci_read_config_byte(dev, 0x83, &c);
94 c &= 0x7f;
95 pci_write_config_byte(dev, 0x83, c);
96}
97
98/*
99 * Since 8259PIC was disabled on the board, the IDE device can not
100 * use the legacy IRQ, we need to let the IDE device work under
101 * native mode and use the interrupt line like other PCI devices.
102 * IRQ14 is a sideband interrupt from IDE device to CPU and we use this
103 * as the interrupt for IDE device.
104 */
105static void __devinit quirk_uli5229(struct pci_dev *dev)
106{
107 unsigned char c;
108
109 pci_read_config_byte(dev, 0x4b, &c);
110 c |= 0x10;
111 pci_write_config_byte(dev, 0x4b, c);
112}
113
114/*
115 * SATA interrupt pin bug fix
116 * There's a chip bug for 5288, The interrupt pin should be 2,
117 * not the read only value 1, So it use INTB#, not INTA# which
118 * actually used by the IDE device 5229.
119 * As of this bug, during the PCI initialization, 5288 read the
120 * irq of IDE device from the device tree, this function fix this
121 * bug by re-assigning a correct irq to 5288.
122 *
123 */
124static void __devinit final_uli5288(struct pci_dev *dev)
125{
126 struct pci_controller *hose = pci_bus_to_host(dev->bus);
127 struct device_node *hosenode = hose ? hose->arch_data : NULL;
128 struct of_irq oirq;
129 int virq, pin = 2;
130 u32 laddr[3];
131
132 if (!hosenode)
133 return;
134
135 laddr[0] = (hose->first_busno << 16) | (PCI_DEVFN(31, 0) << 8);
136 laddr[1] = laddr[2] = 0;
137 of_irq_map_raw(hosenode, &pin, 1, laddr, &oirq);
138 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
139 oirq.size);
140 dev->irq = virq;
141}
142
143DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, quirk_uli1575);
144DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
145DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
146DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, 0x5288, final_uli5288);
147#endif /* CONFIG_PCI */
148
149static void __init
150mpc86xx_hpcd_setup_arch(void)
151{
152#ifdef CONFIG_PCI
153 struct device_node *np;
154#endif
155 if (ppc_md.progress)
156 ppc_md.progress("mpc86xx_hpcd_setup_arch()", 0);
157
158#ifdef CONFIG_PCI
159 for_each_node_by_type(np, "pci") {
160 if (of_device_is_compatible(np, "fsl,mpc8610-pci")
161 || of_device_is_compatible(np, "fsl,mpc8641-pcie")) {
162 struct resource rsrc;
163 of_address_to_resource(np, 0, &rsrc);
164 if ((rsrc.start & 0xfffff) == 0xa000)
165 fsl_add_bridge(np, 1);
166 else
167 fsl_add_bridge(np, 0);
168 }
169 }
170#endif
171
172 printk("MPC86xx HPCD board from Freescale Semiconductor\n");
173}
174
175/*
176 * Called very early, device-tree isn't unflattened
177 */
178static int __init mpc86xx_hpcd_probe(void)
179{
180 unsigned long root = of_get_flat_dt_root();
181
182 if (of_flat_dt_is_compatible(root, "fsl,MPC8610HPCD"))
183 return 1; /* Looks good */
184
185 return 0;
186}
187
188long __init
189mpc86xx_time_init(void)
190{
191 unsigned int temp;
192
193 /* Set the time base to zero */
194 mtspr(SPRN_TBWL, 0);
195 mtspr(SPRN_TBWU, 0);
196
197 temp = mfspr(SPRN_HID0);
198 temp |= HID0_TBEN;
199 mtspr(SPRN_HID0, temp);
200 asm volatile("isync");
201
202 return 0;
203}
204
205define_machine(mpc86xx_hpcd) {
206 .name = "MPC86xx HPCD",
207 .probe = mpc86xx_hpcd_probe,
208 .setup_arch = mpc86xx_hpcd_setup_arch,
209 .init_IRQ = mpc86xx_hpcd_init_irq,
210 .get_irq = mpic_get_irq,
211 .restart = fsl_rstcr_restart,
212 .time_init = mpc86xx_time_init,
213 .calibrate_decr = generic_calibrate_decr,
214 .progress = udbg_progress,
215 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
216};
diff --git a/arch/powerpc/platforms/86xx/mpc8641_hpcn.h b/arch/powerpc/platforms/86xx/mpc8641_hpcn.h
deleted file mode 100644
index 41e554c4af94..000000000000
--- a/arch/powerpc/platforms/86xx/mpc8641_hpcn.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * MPC8641 HPCN board definitions
3 *
4 * Copyright 2006 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 * Author: Xianghua Xiao <x.xiao@freescale.com>
12 */
13
14#ifndef __MPC8641_HPCN_H__
15#define __MPC8641_HPCN_H__
16
17#include <linux/init.h>
18
19#define MPC86XX_RSTCR_OFFSET (0xe00b0) /* Reset Control Register */
20
21#endif /* __MPC8641_HPCN_H__ */
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 47aafa76c933..32a531aebcb7 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -35,7 +35,6 @@
35#include <sysdev/fsl_soc.h> 35#include <sysdev/fsl_soc.h>
36 36
37#include "mpc86xx.h" 37#include "mpc86xx.h"
38#include "mpc8641_hpcn.h"
39 38
40#undef DEBUG 39#undef DEBUG
41 40
@@ -132,25 +131,15 @@ static int mpc86xx_exclude_device(struct pci_controller *hose,
132static void __init 131static void __init
133mpc86xx_hpcn_setup_arch(void) 132mpc86xx_hpcn_setup_arch(void)
134{ 133{
134#ifdef CONFIG_PCI
135 struct device_node *np; 135 struct device_node *np;
136#endif
136 137
137 if (ppc_md.progress) 138 if (ppc_md.progress)
138 ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0); 139 ppc_md.progress("mpc86xx_hpcn_setup_arch()", 0);
139 140
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 141#ifdef CONFIG_PCI
153 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) { 142 for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie") {
154 struct resource rsrc; 143 struct resource rsrc;
155 of_address_to_resource(np, 0, &rsrc); 144 of_address_to_resource(np, 0, &rsrc);
156 if ((rsrc.start & 0xfffff) == 0x8000) 145 if ((rsrc.start & 0xfffff) == 0x8000)
@@ -158,6 +147,7 @@ mpc86xx_hpcn_setup_arch(void)
158 else 147 else
159 fsl_add_bridge(np, 0); 148 fsl_add_bridge(np, 0);
160 } 149 }
150
161 uses_fsl_uli_m1575 = 1; 151 uses_fsl_uli_m1575 = 1;
162 ppc_md.pci_exclude_device = mpc86xx_exclude_device; 152 ppc_md.pci_exclude_device = mpc86xx_exclude_device;
163 153
@@ -205,23 +195,6 @@ static int __init mpc86xx_hpcn_probe(void)
205 return 0; 195 return 0;
206} 196}
207 197
208
209void
210mpc86xx_restart(char *cmd)
211{
212 void __iomem *rstcr;
213
214 rstcr = ioremap(get_immrbase() + MPC86XX_RSTCR_OFFSET, 0x100);
215
216 local_irq_disable();
217
218 /* Assert reset request to Reset Control Register */
219 out_be32(rstcr, 0x2);
220
221 /* not reached */
222}
223
224
225long __init 198long __init
226mpc86xx_time_init(void) 199mpc86xx_time_init(void)
227{ 200{
@@ -246,7 +219,7 @@ define_machine(mpc86xx_hpcn) {
246 .init_IRQ = mpc86xx_hpcn_init_irq, 219 .init_IRQ = mpc86xx_hpcn_init_irq,
247 .show_cpuinfo = mpc86xx_hpcn_show_cpuinfo, 220 .show_cpuinfo = mpc86xx_hpcn_show_cpuinfo,
248 .get_irq = mpic_get_irq, 221 .get_irq = mpic_get_irq,
249 .restart = mpc86xx_restart, 222 .restart = fsl_rstcr_restart,
250 .time_init = mpc86xx_time_init, 223 .time_init = mpc86xx_time_init,
251 .calibrate_decr = generic_calibrate_decr, 224 .calibrate_decr = generic_calibrate_decr,
252 .progress = udbg_progress, 225 .progress = udbg_progress,
diff --git a/arch/powerpc/platforms/8xx/Kconfig b/arch/powerpc/platforms/8xx/Kconfig
index 39bb8c5ebe70..bd28655043a0 100644
--- a/arch/powerpc/platforms/8xx/Kconfig
+++ b/arch/powerpc/platforms/8xx/Kconfig
@@ -3,6 +3,7 @@ config FADS
3 3
4config CPM1 4config CPM1
5 bool 5 bool
6 select CPM
6 7
7choice 8choice
8 prompt "8xx Machine Type" 9 prompt "8xx Machine Type"
@@ -25,12 +26,23 @@ config MPC86XADS
25config MPC885ADS 26config MPC885ADS
26 bool "MPC885ADS" 27 bool "MPC885ADS"
27 select CPM1 28 select CPM1
29 select PPC_CPM_NEW_BINDING
28 help 30 help
29 Freescale Semiconductor MPC885 Application Development System (ADS). 31 Freescale Semiconductor MPC885 Application Development System (ADS).
30 Also known as DUET. 32 Also known as DUET.
31 The MPC885ADS is meant to serve as a platform for s/w and h/w 33 The MPC885ADS is meant to serve as a platform for s/w and h/w
32 development around the MPC885 processor family. 34 development around the MPC885 processor family.
33 35
36config PPC_EP88XC
37 bool "Embedded Planet EP88xC (a.k.a. CWH-PPC-885XN-VE)"
38 select CPM1
39 select PPC_CPM_NEW_BINDING
40 help
41 This enables support for the Embedded Planet EP88xC board.
42
43 This board is also resold by Freescale as the QUICCStart
44 MPC885 Evaluation System and/or the CWH-PPC-885XN-VE.
45
34endchoice 46endchoice
35 47
36menu "Freescale Ethernet driver platform-specific options" 48menu "Freescale Ethernet driver platform-specific options"
@@ -99,6 +111,22 @@ config 8xx_CPU6
99 111
100 If in doubt, say N here. 112 If in doubt, say N here.
101 113
114config 8xx_CPU15
115 bool "CPU15 Silicon Errata"
116 default y
117 help
118 This enables a workaround for erratum CPU15 on MPC8xx chips.
119 This bug can cause incorrect code execution under certain
120 circumstances. This workaround adds some overhead (a TLB miss
121 every time execution crosses a page boundary), and you may wish
122 to disable it if you have worked around the bug in the compiler
123 (by not placing conditional branches or branches to LR or CTR
124 in the last word of a page, with a target of the last cache
125 line in the next page), or if you have used some other
126 workaround.
127
128 If in doubt, say Y here.
129
102choice 130choice
103 prompt "Microcode patch selection" 131 prompt "Microcode patch selection"
104 default NO_UCODE_PATCH 132 default NO_UCODE_PATCH
diff --git a/arch/powerpc/platforms/8xx/Makefile b/arch/powerpc/platforms/8xx/Makefile
index 5e2dae3afd2f..8b7098018b59 100644
--- a/arch/powerpc/platforms/8xx/Makefile
+++ b/arch/powerpc/platforms/8xx/Makefile
@@ -4,3 +4,4 @@
4obj-$(CONFIG_PPC_8xx) += m8xx_setup.o 4obj-$(CONFIG_PPC_8xx) += m8xx_setup.o
5obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o 5obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o
6obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o 6obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o
7obj-$(CONFIG_PPC_EP88XC) += ep88xc.o
diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c
new file mode 100644
index 000000000000..c518b6cc5fab
--- /dev/null
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -0,0 +1,176 @@
1/*
2 * Platform setup for the Embedded Planet EP88xC board
3 *
4 * Author: Scott Wood <scottwood@freescale.com>
5 * Copyright 2007 Freescale Semiconductor, Inc.
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12#include <linux/init.h>
13#include <linux/of_platform.h>
14
15#include <asm/machdep.h>
16#include <asm/io.h>
17#include <asm/udbg.h>
18#include <asm/commproc.h>
19
20#include <sysdev/commproc.h>
21
22struct cpm_pin {
23 int port, pin, flags;
24};
25
26static struct cpm_pin ep88xc_pins[] = {
27 /* SMC1 */
28 {1, 24, CPM_PIN_INPUT}, /* RX */
29 {1, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
30
31 /* SCC2 */
32 {0, 12, CPM_PIN_INPUT}, /* TX */
33 {0, 13, CPM_PIN_INPUT}, /* RX */
34 {2, 8, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO}, /* CD */
35 {2, 9, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO}, /* CTS */
36 {2, 14, CPM_PIN_INPUT}, /* RTS */
37
38 /* MII1 */
39 {0, 0, CPM_PIN_INPUT},
40 {0, 1, CPM_PIN_INPUT},
41 {0, 2, CPM_PIN_INPUT},
42 {0, 3, CPM_PIN_INPUT},
43 {0, 4, CPM_PIN_OUTPUT},
44 {0, 10, CPM_PIN_OUTPUT},
45 {0, 11, CPM_PIN_OUTPUT},
46 {1, 19, CPM_PIN_INPUT},
47 {1, 31, CPM_PIN_INPUT},
48 {2, 12, CPM_PIN_INPUT},
49 {2, 13, CPM_PIN_INPUT},
50 {3, 8, CPM_PIN_INPUT},
51 {4, 30, CPM_PIN_OUTPUT},
52 {4, 31, CPM_PIN_OUTPUT},
53
54 /* MII2 */
55 {4, 14, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
56 {4, 15, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
57 {4, 16, CPM_PIN_OUTPUT},
58 {4, 17, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
59 {4, 18, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
60 {4, 19, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
61 {4, 20, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
62 {4, 21, CPM_PIN_OUTPUT},
63 {4, 22, CPM_PIN_OUTPUT},
64 {4, 23, CPM_PIN_OUTPUT},
65 {4, 24, CPM_PIN_OUTPUT},
66 {4, 25, CPM_PIN_OUTPUT},
67 {4, 26, CPM_PIN_OUTPUT},
68 {4, 27, CPM_PIN_OUTPUT},
69 {4, 28, CPM_PIN_OUTPUT},
70 {4, 29, CPM_PIN_OUTPUT},
71
72 /* USB */
73 {0, 6, CPM_PIN_INPUT}, /* CLK2 */
74 {0, 14, CPM_PIN_INPUT}, /* USBOE */
75 {0, 15, CPM_PIN_INPUT}, /* USBRXD */
76 {2, 6, CPM_PIN_OUTPUT}, /* USBTXN */
77 {2, 7, CPM_PIN_OUTPUT}, /* USBTXP */
78 {2, 10, CPM_PIN_INPUT}, /* USBRXN */
79 {2, 11, CPM_PIN_INPUT}, /* USBRXP */
80
81 /* Misc */
82 {1, 26, CPM_PIN_INPUT}, /* BRGO2 */
83 {1, 27, CPM_PIN_INPUT}, /* BRGO1 */
84};
85
86static void __init init_ioports(void)
87{
88 int i;
89
90 for (i = 0; i < ARRAY_SIZE(ep88xc_pins); i++) {
91 struct cpm_pin *pin = &ep88xc_pins[i];
92 cpm1_set_pin(pin->port, pin->pin, pin->flags);
93 }
94
95 cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
96 cpm1_clk_setup(CPM_CLK_SCC1, CPM_CLK2, CPM_CLK_TX); /* USB */
97 cpm1_clk_setup(CPM_CLK_SCC1, CPM_CLK2, CPM_CLK_RX);
98 cpm1_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_TX);
99 cpm1_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_RX);
100}
101
102static u8 __iomem *ep88xc_bcsr;
103
104#define BCSR7_SCC2_ENABLE 0x10
105
106#define BCSR8_PHY1_ENABLE 0x80
107#define BCSR8_PHY1_POWER 0x40
108#define BCSR8_PHY2_ENABLE 0x20
109#define BCSR8_PHY2_POWER 0x10
110
111#define BCSR9_USB_ENABLE 0x80
112#define BCSR9_USB_POWER 0x40
113#define BCSR9_USB_HOST 0x20
114#define BCSR9_USB_FULL_SPEED_TARGET 0x10
115
116static void __init ep88xc_setup_arch(void)
117{
118 struct device_node *np;
119
120 cpm_reset();
121 init_ioports();
122
123 np = of_find_compatible_node(NULL, NULL, "fsl,ep88xc-bcsr");
124 if (!np) {
125 printk(KERN_CRIT "Could not find fsl,ep88xc-bcsr node\n");
126 return;
127 }
128
129 ep88xc_bcsr = of_iomap(np, 0);
130 of_node_put(np);
131
132 if (!ep88xc_bcsr) {
133 printk(KERN_CRIT "Could not remap BCSR\n");
134 return;
135 }
136
137 setbits8(&ep88xc_bcsr[7], BCSR7_SCC2_ENABLE);
138 setbits8(&ep88xc_bcsr[8], BCSR8_PHY1_ENABLE | BCSR8_PHY1_POWER |
139 BCSR8_PHY2_ENABLE | BCSR8_PHY2_POWER);
140}
141
142static int __init ep88xc_probe(void)
143{
144 unsigned long root = of_get_flat_dt_root();
145 return of_flat_dt_is_compatible(root, "fsl,ep88xc");
146}
147
148static struct of_device_id __initdata of_bus_ids[] = {
149 { .name = "soc", },
150 { .name = "cpm", },
151 { .name = "localbus", },
152 {},
153};
154
155static int __init declare_of_platform_devices(void)
156{
157 /* Publish the QE devices */
158 if (machine_is(ep88xc))
159 of_platform_bus_probe(NULL, of_bus_ids, NULL);
160
161 return 0;
162}
163device_initcall(declare_of_platform_devices);
164
165define_machine(ep88xc) {
166 .name = "Embedded Planet EP88xC",
167 .probe = ep88xc_probe,
168 .setup_arch = ep88xc_setup_arch,
169 .init_IRQ = m8xx_pic_init,
170 .get_irq = mpc8xx_get_irq,
171 .restart = mpc8xx_restart,
172 .calibrate_decr = mpc8xx_calibrate_decr,
173 .set_rtc_time = mpc8xx_set_rtc_time,
174 .get_rtc_time = mpc8xx_get_rtc_time,
175 .progress = udbg_progress,
176};
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c
index f1693550c70c..d35eda80e9e6 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -10,57 +10,33 @@
10 * bootup setup stuff.. 10 * bootup setup stuff..
11 */ 11 */
12 12
13#include <linux/errno.h>
14#include <linux/sched.h>
15#include <linux/kernel.h> 13#include <linux/kernel.h>
16#include <linux/mm.h>
17#include <linux/stddef.h>
18#include <linux/unistd.h>
19#include <linux/ptrace.h>
20#include <linux/slab.h> 14#include <linux/slab.h>
21#include <linux/user.h>
22#include <linux/a.out.h>
23#include <linux/tty.h>
24#include <linux/major.h>
25#include <linux/interrupt.h> 15#include <linux/interrupt.h>
26#include <linux/reboot.h>
27#include <linux/init.h> 16#include <linux/init.h>
28#include <linux/initrd.h>
29#include <linux/ioport.h>
30#include <linux/bootmem.h>
31#include <linux/seq_file.h>
32#include <linux/root_dev.h>
33#include <linux/time.h> 17#include <linux/time.h>
34#include <linux/rtc.h> 18#include <linux/rtc.h>
35#include <linux/fsl_devices.h>
36 19
37#include <asm/mmu.h>
38#include <asm/reg.h>
39#include <asm/residual.h>
40#include <asm/io.h> 20#include <asm/io.h>
41#include <asm/pgtable.h>
42#include <asm/mpc8xx.h> 21#include <asm/mpc8xx.h>
43#include <asm/8xx_immap.h> 22#include <asm/8xx_immap.h>
44#include <asm/machdep.h>
45#include <asm/bootinfo.h>
46#include <asm/time.h>
47#include <asm/prom.h> 23#include <asm/prom.h>
48#include <asm/fs_pd.h> 24#include <asm/fs_pd.h>
49#include <mm/mmu_decl.h> 25#include <mm/mmu_decl.h>
50 26
51#include "sysdev/mpc8xx_pic.h" 27#include <sysdev/mpc8xx_pic.h>
28#include <sysdev/commproc.h>
52 29
53#ifdef CONFIG_PCMCIA_M8XX 30#ifdef CONFIG_PCMCIA_M8XX
54struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops; 31struct mpc8xx_pcmcia_ops m8xx_pcmcia_ops;
55#endif 32#endif
56 33
57void m8xx_calibrate_decr(void); 34void m8xx_calibrate_decr(void);
58extern void m8xx_wdt_handler_install(bd_t *bp);
59extern int cpm_pic_init(void); 35extern int cpm_pic_init(void);
60extern int cpm_get_irq(void); 36extern int cpm_get_irq(void);
61 37
62/* A place holder for time base interrupts, if they are ever enabled. */ 38/* A place holder for time base interrupts, if they are ever enabled. */
63irqreturn_t timebase_interrupt(int irq, void * dev) 39static irqreturn_t timebase_interrupt(int irq, void *dev)
64{ 40{
65 printk ("timebase_interrupt()\n"); 41 printk ("timebase_interrupt()\n");
66 42
@@ -77,7 +53,7 @@ static struct irqaction tbint_irqaction = {
77void __init __attribute__ ((weak)) 53void __init __attribute__ ((weak))
78init_internal_rtc(void) 54init_internal_rtc(void)
79{ 55{
80 sit8xx_t *sys_tmr = (sit8xx_t *) immr_map(im_sit); 56 sit8xx_t __iomem *sys_tmr = immr_map(im_sit);
81 57
82 /* Disable the RTC one second and alarm interrupts. */ 58 /* Disable the RTC one second and alarm interrupts. */
83 clrbits16(&sys_tmr->sit_rtcsc, (RTCSC_SIE | RTCSC_ALE)); 59 clrbits16(&sys_tmr->sit_rtcsc, (RTCSC_SIE | RTCSC_ALE));
@@ -89,24 +65,24 @@ init_internal_rtc(void)
89 65
90static int __init get_freq(char *name, unsigned long *val) 66static int __init get_freq(char *name, unsigned long *val)
91{ 67{
92 struct device_node *cpu; 68 struct device_node *cpu;
93 const unsigned int *fp; 69 const unsigned int *fp;
94 int found = 0; 70 int found = 0;
95 71
96 /* The cpu node should have timebase and clock frequency properties */ 72 /* The cpu node should have timebase and clock frequency properties */
97 cpu = of_find_node_by_type(NULL, "cpu"); 73 cpu = of_find_node_by_type(NULL, "cpu");
98 74
99 if (cpu) { 75 if (cpu) {
100 fp = of_get_property(cpu, name, NULL); 76 fp = of_get_property(cpu, name, NULL);
101 if (fp) { 77 if (fp) {
102 found = 1; 78 found = 1;
103 *val = *fp; 79 *val = *fp;
104 } 80 }
105 81
106 of_node_put(cpu); 82 of_node_put(cpu);
107 } 83 }
108 84
109 return found; 85 return found;
110} 86}
111 87
112/* The decrementer counts at the system (internal) clock frequency divided by 88/* The decrementer counts at the system (internal) clock frequency divided by
@@ -116,13 +92,13 @@ static int __init get_freq(char *name, unsigned long *val)
116void __init mpc8xx_calibrate_decr(void) 92void __init mpc8xx_calibrate_decr(void)
117{ 93{
118 struct device_node *cpu; 94 struct device_node *cpu;
119 cark8xx_t *clk_r1; 95 cark8xx_t __iomem *clk_r1;
120 car8xx_t *clk_r2; 96 car8xx_t __iomem *clk_r2;
121 sitk8xx_t *sys_tmr1; 97 sitk8xx_t __iomem *sys_tmr1;
122 sit8xx_t *sys_tmr2; 98 sit8xx_t __iomem *sys_tmr2;
123 int irq, virq; 99 int irq, virq;
124 100
125 clk_r1 = (cark8xx_t *) immr_map(im_clkrstk); 101 clk_r1 = immr_map(im_clkrstk);
126 102
127 /* Unlock the SCCR. */ 103 /* Unlock the SCCR. */
128 out_be32(&clk_r1->cark_sccrk, ~KAPWR_KEY); 104 out_be32(&clk_r1->cark_sccrk, ~KAPWR_KEY);
@@ -130,24 +106,24 @@ void __init mpc8xx_calibrate_decr(void)
130 immr_unmap(clk_r1); 106 immr_unmap(clk_r1);
131 107
132 /* Force all 8xx processors to use divide by 16 processor clock. */ 108 /* Force all 8xx processors to use divide by 16 processor clock. */
133 clk_r2 = (car8xx_t *) immr_map(im_clkrst); 109 clk_r2 = immr_map(im_clkrst);
134 setbits32(&clk_r2->car_sccr, 0x02000000); 110 setbits32(&clk_r2->car_sccr, 0x02000000);
135 immr_unmap(clk_r2); 111 immr_unmap(clk_r2);
136 112
137 /* Processor frequency is MHz. 113 /* Processor frequency is MHz.
138 */ 114 */
139 ppc_tb_freq = 50000000; 115 ppc_tb_freq = 50000000;
140 if (!get_freq("bus-frequency", &ppc_tb_freq)) { 116 if (!get_freq("bus-frequency", &ppc_tb_freq)) {
141 printk(KERN_ERR "WARNING: Estimating decrementer frequency " 117 printk(KERN_ERR "WARNING: Estimating decrementer frequency "
142 "(not found)\n"); 118 "(not found)\n");
143 } 119 }
144 ppc_tb_freq /= 16; 120 ppc_tb_freq /= 16;
145 ppc_proc_freq = 50000000; 121 ppc_proc_freq = 50000000;
146 if (!get_freq("clock-frequency", &ppc_proc_freq)) 122 if (!get_freq("clock-frequency", &ppc_proc_freq))
147 printk(KERN_ERR "WARNING: Estimating processor frequency" 123 printk(KERN_ERR "WARNING: Estimating processor frequency"
148 "(not found)\n"); 124 "(not found)\n");
149 125
150 printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq); 126 printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq);
151 127
152 /* Perform some more timer/timebase initialization. This used 128 /* Perform some more timer/timebase initialization. This used
153 * to be done elsewhere, but other changes caused it to get 129 * to be done elsewhere, but other changes caused it to get
@@ -164,7 +140,7 @@ void __init mpc8xx_calibrate_decr(void)
164 * we guarantee the registers are locked, then we unlock them 140 * we guarantee the registers are locked, then we unlock them
165 * for our use. 141 * for our use.
166 */ 142 */
167 sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk); 143 sys_tmr1 = immr_map(im_sitk);
168 out_be32(&sys_tmr1->sitk_tbscrk, ~KAPWR_KEY); 144 out_be32(&sys_tmr1->sitk_tbscrk, ~KAPWR_KEY);
169 out_be32(&sys_tmr1->sitk_rtcsck, ~KAPWR_KEY); 145 out_be32(&sys_tmr1->sitk_rtcsck, ~KAPWR_KEY);
170 out_be32(&sys_tmr1->sitk_tbk, ~KAPWR_KEY); 146 out_be32(&sys_tmr1->sitk_tbk, ~KAPWR_KEY);
@@ -180,24 +156,17 @@ void __init mpc8xx_calibrate_decr(void)
180 * we have to enable the timebase). The decrementer interrupt 156 * we have to enable the timebase). The decrementer interrupt
181 * is wired into the vector table, nothing to do here for that. 157 * is wired into the vector table, nothing to do here for that.
182 */ 158 */
183 cpu = of_find_node_by_type(NULL, "cpu"); 159 cpu = of_find_node_by_type(NULL, "cpu");
184 virq= irq_of_parse_and_map(cpu, 0); 160 virq= irq_of_parse_and_map(cpu, 0);
185 irq = irq_map[virq].hwirq; 161 irq = irq_map[virq].hwirq;
186 162
187 sys_tmr2 = (sit8xx_t *) immr_map(im_sit); 163 sys_tmr2 = immr_map(im_sit);
188 out_be16(&sys_tmr2->sit_tbscr, ((1 << (7 - (irq/2))) << 8) | 164 out_be16(&sys_tmr2->sit_tbscr, ((1 << (7 - (irq/2))) << 8) |
189 (TBSCR_TBF | TBSCR_TBE)); 165 (TBSCR_TBF | TBSCR_TBE));
190 immr_unmap(sys_tmr2); 166 immr_unmap(sys_tmr2);
191 167
192 if (setup_irq(virq, &tbint_irqaction)) 168 if (setup_irq(virq, &tbint_irqaction))
193 panic("Could not allocate timer IRQ!"); 169 panic("Could not allocate timer IRQ!");
194
195#ifdef CONFIG_8xx_WDT
196 /* Install watchdog timer handler early because it might be
197 * already enabled by the bootloader
198 */
199 m8xx_wdt_handler_install(binfo);
200#endif
201} 170}
202 171
203/* The RTC on the MPC8xx is an internal register. 172/* The RTC on the MPC8xx is an internal register.
@@ -207,14 +176,14 @@ void __init mpc8xx_calibrate_decr(void)
207 176
208int mpc8xx_set_rtc_time(struct rtc_time *tm) 177int mpc8xx_set_rtc_time(struct rtc_time *tm)
209{ 178{
210 sitk8xx_t *sys_tmr1; 179 sitk8xx_t __iomem *sys_tmr1;
211 sit8xx_t *sys_tmr2; 180 sit8xx_t __iomem *sys_tmr2;
212 int time; 181 int time;
213 182
214 sys_tmr1 = (sitk8xx_t *) immr_map(im_sitk); 183 sys_tmr1 = immr_map(im_sitk);
215 sys_tmr2 = (sit8xx_t *) immr_map(im_sit); 184 sys_tmr2 = immr_map(im_sit);
216 time = mktime(tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, 185 time = mktime(tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
217 tm->tm_hour, tm->tm_min, tm->tm_sec); 186 tm->tm_hour, tm->tm_min, tm->tm_sec);
218 187
219 out_be32(&sys_tmr1->sitk_rtck, KAPWR_KEY); 188 out_be32(&sys_tmr1->sitk_rtck, KAPWR_KEY);
220 out_be32(&sys_tmr2->sit_rtc, time); 189 out_be32(&sys_tmr2->sit_rtc, time);
@@ -228,21 +197,20 @@ int mpc8xx_set_rtc_time(struct rtc_time *tm)
228void mpc8xx_get_rtc_time(struct rtc_time *tm) 197void mpc8xx_get_rtc_time(struct rtc_time *tm)
229{ 198{
230 unsigned long data; 199 unsigned long data;
231 sit8xx_t *sys_tmr = (sit8xx_t *) immr_map(im_sit); 200 sit8xx_t __iomem *sys_tmr = immr_map(im_sit);
232 201
233 /* Get time from the RTC. */ 202 /* Get time from the RTC. */
234 data = in_be32(&sys_tmr->sit_rtc); 203 data = in_be32(&sys_tmr->sit_rtc);
235 to_tm(data, tm); 204 to_tm(data, tm);
236 tm->tm_year -= 1900; 205 tm->tm_year -= 1900;
237 tm->tm_mon -= 1; 206 tm->tm_mon -= 1;
238 immr_unmap(sys_tmr); 207 immr_unmap(sys_tmr);
239 return; 208 return;
240} 209}
241 210
242void mpc8xx_restart(char *cmd) 211void mpc8xx_restart(char *cmd)
243{ 212{
244 __volatile__ unsigned char dummy; 213 car8xx_t __iomem *clk_r = immr_map(im_clkrst);
245 car8xx_t * clk_r = (car8xx_t *) immr_map(im_clkrst);
246 214
247 215
248 local_irq_disable(); 216 local_irq_disable();
@@ -252,26 +220,8 @@ void mpc8xx_restart(char *cmd)
252 */ 220 */
253 mtmsr(mfmsr() & ~0x1000); 221 mtmsr(mfmsr() & ~0x1000);
254 222
255 dummy = in_8(&clk_r->res[0]); 223 in_8(&clk_r->res[0]);
256 printk("Restart failed\n"); 224 panic("Restart failed\n");
257 while(1);
258}
259
260void mpc8xx_show_cpuinfo(struct seq_file *m)
261{
262 struct device_node *root;
263 uint memsize = total_memory;
264 const char *model = "";
265
266 seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
267
268 root = of_find_node_by_path("/");
269 if (root)
270 model = of_get_property(root, "model", NULL);
271 seq_printf(m, "Machine\t\t: %s\n", model);
272 of_node_put(root);
273
274 seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
275} 225}
276 226
277static void cpm_cascade(unsigned int irq, struct irq_desc *desc) 227static void cpm_cascade(unsigned int irq, struct irq_desc *desc)
@@ -298,7 +248,7 @@ void __init m8xx_pic_init(void)
298 int irq; 248 int irq;
299 249
300 if (mpc8xx_pic_init()) { 250 if (mpc8xx_pic_init()) {
301 printk(KERN_ERR "Failed interrupt 8xx controller initialization\n"); 251 printk(KERN_ERR "Failed interrupt 8xx controller initialization\n");
302 return; 252 return;
303 } 253 }
304 254
diff --git a/arch/powerpc/platforms/8xx/mpc86xads.h b/arch/powerpc/platforms/8xx/mpc86xads.h
index 59bad2f9ae51..cffa194ccf1f 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 */
@@ -30,9 +29,6 @@
30#define CFG_PHYDEV_ADDR ((uint)0xff0a0000) 29#define CFG_PHYDEV_ADDR ((uint)0xff0a0000)
31#define BCSR5 ((uint)(CFG_PHYDEV_ADDR + 0x300)) 30#define BCSR5 ((uint)(CFG_PHYDEV_ADDR + 0x300))
32 31
33#define IMAP_ADDR (get_immrbase())
34#define IMAP_SIZE ((uint)(64 * 1024))
35
36#define MPC8xx_CPM_OFFSET (0x9c0) 32#define MPC8xx_CPM_OFFSET (0x9c0)
37#define CPM_MAP_ADDR (get_immrbase() + MPC8xx_CPM_OFFSET) 33#define CPM_MAP_ADDR (get_immrbase() + MPC8xx_CPM_OFFSET)
38#define CPM_IRQ_OFFSET 16 // for compability with cpm_uart driver 34#define CPM_IRQ_OFFSET 16 // for compability with cpm_uart driver
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index cf0e7bc8c2e7..49012835f453 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -31,21 +31,13 @@
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>
38#include <asm/fs_pd.h> 37#include <asm/fs_pd.h>
39#include <asm/prom.h> 38#include <asm/prom.h>
40 39
41extern void cpm_reset(void); 40#include <sysdev/commproc.h>
42extern void mpc8xx_show_cpuinfo(struct seq_file*);
43extern void mpc8xx_restart(char *cmd);
44extern void mpc8xx_calibrate_decr(void);
45extern int mpc8xx_set_rtc_time(struct rtc_time *tm);
46extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
47extern void m8xx_pic_init(void);
48extern unsigned int mpc8xx_get_irq(void);
49 41
50static void init_smc1_uart_ioports(struct fs_uart_platform_info* fpi); 42static void init_smc1_uart_ioports(struct fs_uart_platform_info* fpi);
51static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi); 43static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi);
@@ -254,20 +246,6 @@ int platform_device_skip(const char *model, int id)
254 246
255static void __init mpc86xads_setup_arch(void) 247static void __init mpc86xads_setup_arch(void)
256{ 248{
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(); 249 cpm_reset();
272 250
273 mpc86xads_board_setup(); 251 mpc86xads_board_setup();
@@ -292,7 +270,6 @@ define_machine(mpc86x_ads) {
292 .probe = mpc86xads_probe, 270 .probe = mpc86xads_probe,
293 .setup_arch = mpc86xads_setup_arch, 271 .setup_arch = mpc86xads_setup_arch,
294 .init_IRQ = m8xx_pic_init, 272 .init_IRQ = m8xx_pic_init,
295 .show_cpuinfo = mpc8xx_show_cpuinfo,
296 .get_irq = mpc8xx_get_irq, 273 .get_irq = mpc8xx_get_irq,
297 .restart = mpc8xx_restart, 274 .restart = mpc8xx_restart,
298 .calibrate_decr = mpc8xx_calibrate_decr, 275 .calibrate_decr = mpc8xx_calibrate_decr,
diff --git a/arch/powerpc/platforms/8xx/mpc885ads.h b/arch/powerpc/platforms/8xx/mpc885ads.h
index 7c31aec284c2..a5076668bad6 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads.h
+++ b/arch/powerpc/platforms/8xx/mpc885ads.h
@@ -15,31 +15,12 @@
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 */
22#define BCSR_ADDR ((uint)0xff080000)
23#define BCSR_SIZE ((uint)32)
24#define BCSR0 ((uint)(BCSR_ADDR + 0x00))
25#define BCSR1 ((uint)(BCSR_ADDR + 0x04))
26#define BCSR2 ((uint)(BCSR_ADDR + 0x08))
27#define BCSR3 ((uint)(BCSR_ADDR + 0x0c))
28#define BCSR4 ((uint)(BCSR_ADDR + 0x10))
29
30#define CFG_PHYDEV_ADDR ((uint)0xff0a0000)
31#define BCSR5 ((uint)(CFG_PHYDEV_ADDR + 0x300))
32
33#define IMAP_ADDR (get_immrbase())
34#define IMAP_SIZE ((uint)(64 * 1024))
35
36#define MPC8xx_CPM_OFFSET (0x9c0) 20#define MPC8xx_CPM_OFFSET (0x9c0)
37#define CPM_MAP_ADDR (get_immrbase() + MPC8xx_CPM_OFFSET) 21#define CPM_MAP_ADDR (get_immrbase() + MPC8xx_CPM_OFFSET)
38#define CPM_IRQ_OFFSET 16 // for compability with cpm_uart driver 22#define CPM_IRQ_OFFSET 16 // for compability with cpm_uart driver
39 23
40#define PCMCIA_MEM_ADDR ((uint)0xff020000)
41#define PCMCIA_MEM_SIZE ((uint)(64 * 1024))
42
43/* Bits of interest in the BCSRs. 24/* Bits of interest in the BCSRs.
44 */ 25 */
45#define BCSR1_ETHEN ((uint)0x20000000) 26#define BCSR1_ETHEN ((uint)0x20000000)
@@ -68,28 +49,5 @@
68#define BCSR5_MII1_EN 0x02 49#define BCSR5_MII1_EN 0x02
69#define BCSR5_MII1_RST 0x01 50#define BCSR5_MII1_RST 0x01
70 51
71/* Interrupt level assignments */
72#define PHY_INTERRUPT SIU_IRQ7 /* PHY link change interrupt */
73#define SIU_INT_FEC1 SIU_LEVEL1 /* FEC1 interrupt */
74#define SIU_INT_FEC2 SIU_LEVEL3 /* FEC2 interrupt */
75#define FEC_INTERRUPT SIU_INT_FEC1 /* FEC interrupt */
76
77/* We don't use the 8259 */
78#define NR_8259_INTS 0
79
80/* CPM Ethernet through SCC3 */
81#define PA_ENET_RXD ((ushort)0x0040)
82#define PA_ENET_TXD ((ushort)0x0080)
83#define PE_ENET_TCLK ((uint)0x00004000)
84#define PE_ENET_RCLK ((uint)0x00008000)
85#define PE_ENET_TENA ((uint)0x00000010)
86#define PC_ENET_CLSN ((ushort)0x0400)
87#define PC_ENET_RENA ((ushort)0x0800)
88
89/* Control bits in the SICR to route TCLK (CLK5) and RCLK (CLK6) to
90 * SCC3. Also, make sure GR3 (bit 8) and SC3 (bit 9) are zero */
91#define SICR_ENET_MASK ((uint)0x00ff0000)
92#define SICR_ENET_CLKRT ((uint)0x002c0000)
93
94#endif /* __ASM_MPC885ADS_H__ */ 52#endif /* __ASM_MPC885ADS_H__ */
95#endif /* __KERNEL__ */ 53#endif /* __KERNEL__ */
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 5a808d611ae3..2cf1b6a75173 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -1,11 +1,13 @@
1/*arch/powerpc/platforms/8xx/mpc885ads_setup.c 1/*
2 *
3 * Platform setup for the Freescale mpc885ads board 2 * Platform setup for the Freescale mpc885ads board
4 * 3 *
5 * Vitaly Bordug <vbordug@ru.mvista.com> 4 * Vitaly Bordug <vbordug@ru.mvista.com>
6 * 5 *
7 * Copyright 2005 MontaVista Software Inc. 6 * Copyright 2005 MontaVista Software Inc.
8 * 7 *
8 * Heavily modified by Scott Wood <scottwood@freescale.com>
9 * Copyright 2007 Freescale Semiconductor, Inc.
10 *
9 * This file is licensed under the terms of the GNU General Public License 11 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of any 12 * version 2. This program is licensed "as is" without any warranty of any
11 * kind, whether express or implied. 13 * kind, whether express or implied.
@@ -18,12 +20,12 @@
18#include <linux/ioport.h> 20#include <linux/ioport.h>
19#include <linux/device.h> 21#include <linux/device.h>
20#include <linux/delay.h> 22#include <linux/delay.h>
21#include <linux/root_dev.h>
22 23
23#include <linux/fs_enet_pd.h> 24#include <linux/fs_enet_pd.h>
24#include <linux/fs_uart_pd.h> 25#include <linux/fs_uart_pd.h>
25#include <linux/fsl_devices.h> 26#include <linux/fsl_devices.h>
26#include <linux/mii.h> 27#include <linux/mii.h>
28#include <linux/of_platform.h>
27 29
28#include <asm/delay.h> 30#include <asm/delay.h>
29#include <asm/io.h> 31#include <asm/io.h>
@@ -32,46 +34,28 @@
32#include <asm/processor.h> 34#include <asm/processor.h>
33#include <asm/system.h> 35#include <asm/system.h>
34#include <asm/time.h> 36#include <asm/time.h>
35#include <asm/ppcboot.h>
36#include <asm/mpc8xx.h> 37#include <asm/mpc8xx.h>
37#include <asm/8xx_immap.h> 38#include <asm/8xx_immap.h>
38#include <asm/commproc.h> 39#include <asm/commproc.h>
39#include <asm/fs_pd.h> 40#include <asm/fs_pd.h>
40#include <asm/prom.h> 41#include <asm/udbg.h>
41 42
42extern void cpm_reset(void); 43#include <sysdev/commproc.h>
43extern void mpc8xx_show_cpuinfo(struct seq_file *);
44extern void mpc8xx_restart(char *cmd);
45extern void mpc8xx_calibrate_decr(void);
46extern int mpc8xx_set_rtc_time(struct rtc_time *tm);
47extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
48extern void m8xx_pic_init(void);
49extern unsigned int mpc8xx_get_irq(void);
50 44
51static void init_smc1_uart_ioports(struct fs_uart_platform_info *fpi); 45static u32 __iomem *bcsr, *bcsr5;
52static void init_smc2_uart_ioports(struct fs_uart_platform_info *fpi);
53static void init_scc3_ioports(struct fs_platform_info *ptr);
54 46
55#ifdef CONFIG_PCMCIA_M8XX 47#ifdef CONFIG_PCMCIA_M8XX
56static void pcmcia_hw_setup(int slot, int enable) 48static void pcmcia_hw_setup(int slot, int enable)
57{ 49{
58 unsigned *bcsr_io;
59
60 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
61 if (enable) 50 if (enable)
62 clrbits32(bcsr_io, BCSR1_PCCEN); 51 clrbits32(&bcsr[1], BCSR1_PCCEN);
63 else 52 else
64 setbits32(bcsr_io, BCSR1_PCCEN); 53 setbits32(&bcsr[1], BCSR1_PCCEN);
65
66 iounmap(bcsr_io);
67} 54}
68 55
69static int pcmcia_set_voltage(int slot, int vcc, int vpp) 56static int pcmcia_set_voltage(int slot, int vcc, int vpp)
70{ 57{
71 u32 reg = 0; 58 u32 reg = 0;
72 unsigned *bcsr_io;
73
74 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
75 59
76 switch (vcc) { 60 switch (vcc) {
77 case 0: 61 case 0:
@@ -106,344 +90,196 @@ static int pcmcia_set_voltage(int slot, int vcc, int vpp)
106 } 90 }
107 91
108 /* first, turn off all power */ 92 /* first, turn off all power */
109 clrbits32(bcsr_io, 0x00610000); 93 clrbits32(&bcsr[1], 0x00610000);
110 94
111 /* enable new powersettings */ 95 /* enable new powersettings */
112 setbits32(bcsr_io, reg); 96 setbits32(&bcsr[1], reg);
113 97
114 iounmap(bcsr_io);
115 return 0; 98 return 0;
116} 99}
117#endif 100#endif
118 101
119void __init mpc885ads_board_setup(void) 102struct cpm_pin {
120{ 103 int port, pin, flags;
121 cpm8xx_t *cp; 104};
122 unsigned int *bcsr_io;
123 u8 tmpval8;
124
125#ifdef CONFIG_FS_ENET
126 iop8xx_t *io_port;
127#endif
128
129 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
130 cp = (cpm8xx_t *) immr_map(im_cpm);
131
132 if (bcsr_io == NULL) {
133 printk(KERN_CRIT "Could not remap BCSR\n");
134 return;
135 }
136#ifdef CONFIG_SERIAL_CPM_SMC1
137 clrbits32(bcsr_io, BCSR1_RS232EN_1);
138 clrbits32(&cp->cp_simode, 0xe0000000 >> 17); /* brg1 */
139 tmpval8 = in_8(&(cp->cp_smc[0].smc_smcm)) | (SMCM_RX | SMCM_TX);
140 out_8(&(cp->cp_smc[0].smc_smcm), tmpval8);
141 clrbits16(&cp->cp_smc[0].smc_smcmr, SMCMR_REN | SMCMR_TEN); /* brg1 */
142#else
143 setbits32(bcsr_io, BCSR1_RS232EN_1);
144 out_be16(&cp->cp_smc[0].smc_smcmr, 0);
145 out_8(&cp->cp_smc[0].smc_smce, 0);
146#endif
147
148#ifdef CONFIG_SERIAL_CPM_SMC2
149 clrbits32(bcsr_io, BCSR1_RS232EN_2);
150 clrbits32(&cp->cp_simode, 0xe0000000 >> 1);
151 setbits32(&cp->cp_simode, 0x20000000 >> 1); /* brg2 */
152 tmpval8 = in_8(&(cp->cp_smc[1].smc_smcm)) | (SMCM_RX | SMCM_TX);
153 out_8(&(cp->cp_smc[1].smc_smcm), tmpval8);
154 clrbits16(&cp->cp_smc[1].smc_smcmr, SMCMR_REN | SMCMR_TEN);
155 105
156 init_smc2_uart_ioports(0); 106static struct cpm_pin mpc885ads_pins[] = {
157#else 107 /* SMC1 */
158 setbits32(bcsr_io, BCSR1_RS232EN_2); 108 {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
159 out_be16(&cp->cp_smc[1].smc_smcmr, 0); 109 {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
160 out_8(&cp->cp_smc[1].smc_smce, 0);
161#endif
162 immr_unmap(cp);
163 iounmap(bcsr_io);
164
165#ifdef CONFIG_FS_ENET
166 /* use MDC for MII (common) */
167 io_port = (iop8xx_t *) immr_map(im_ioport);
168 setbits16(&io_port->iop_pdpar, 0x0080);
169 clrbits16(&io_port->iop_pddir, 0x0080);
170
171 bcsr_io = ioremap(BCSR5, sizeof(unsigned long));
172 clrbits32(bcsr_io, BCSR5_MII1_EN);
173 clrbits32(bcsr_io, BCSR5_MII1_RST);
174#ifndef CONFIG_FC_ENET_HAS_SCC
175 clrbits32(bcsr_io, BCSR5_MII2_EN);
176 clrbits32(bcsr_io, BCSR5_MII2_RST);
177 110
111 /* SMC2 */
112#ifndef CONFIG_MPC8xx_SECOND_ETH_FEC2
113 {CPM_PORTE, 21, CPM_PIN_INPUT}, /* RX */
114 {CPM_PORTE, 20, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
178#endif 115#endif
179 iounmap(bcsr_io);
180 immr_unmap(io_port);
181 116
117 /* SCC3 */
118 {CPM_PORTA, 9, CPM_PIN_INPUT}, /* RX */
119 {CPM_PORTA, 8, CPM_PIN_INPUT}, /* TX */
120 {CPM_PORTC, 4, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO}, /* RENA */
121 {CPM_PORTC, 5, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO}, /* CLSN */
122 {CPM_PORTE, 27, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TENA */
123 {CPM_PORTE, 17, CPM_PIN_INPUT}, /* CLK5 */
124 {CPM_PORTE, 16, CPM_PIN_INPUT}, /* CLK6 */
125
126 /* MII1 */
127 {CPM_PORTA, 0, CPM_PIN_INPUT},
128 {CPM_PORTA, 1, CPM_PIN_INPUT},
129 {CPM_PORTA, 2, CPM_PIN_INPUT},
130 {CPM_PORTA, 3, CPM_PIN_INPUT},
131 {CPM_PORTA, 4, CPM_PIN_OUTPUT},
132 {CPM_PORTA, 10, CPM_PIN_OUTPUT},
133 {CPM_PORTA, 11, CPM_PIN_OUTPUT},
134 {CPM_PORTB, 19, CPM_PIN_INPUT},
135 {CPM_PORTB, 31, CPM_PIN_INPUT},
136 {CPM_PORTC, 12, CPM_PIN_INPUT},
137 {CPM_PORTC, 13, CPM_PIN_INPUT},
138 {CPM_PORTE, 30, CPM_PIN_OUTPUT},
139 {CPM_PORTE, 31, CPM_PIN_OUTPUT},
140
141 /* MII2 */
142#ifdef CONFIG_MPC8xx_SECOND_ETH_FEC2
143 {CPM_PORTE, 14, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
144 {CPM_PORTE, 15, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
145 {CPM_PORTE, 16, CPM_PIN_OUTPUT},
146 {CPM_PORTE, 17, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
147 {CPM_PORTE, 18, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
148 {CPM_PORTE, 19, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
149 {CPM_PORTE, 20, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
150 {CPM_PORTE, 21, CPM_PIN_OUTPUT},
151 {CPM_PORTE, 22, CPM_PIN_OUTPUT},
152 {CPM_PORTE, 23, CPM_PIN_OUTPUT},
153 {CPM_PORTE, 24, CPM_PIN_OUTPUT},
154 {CPM_PORTE, 25, CPM_PIN_OUTPUT},
155 {CPM_PORTE, 26, CPM_PIN_OUTPUT},
156 {CPM_PORTE, 27, CPM_PIN_OUTPUT},
157 {CPM_PORTE, 28, CPM_PIN_OUTPUT},
158 {CPM_PORTE, 29, CPM_PIN_OUTPUT},
182#endif 159#endif
160};
183 161
184#ifdef CONFIG_PCMCIA_M8XX 162static void __init init_ioports(void)
185 /*Set up board specific hook-ups */
186 m8xx_pcmcia_ops.hw_ctrl = pcmcia_hw_setup;
187 m8xx_pcmcia_ops.voltage_set = pcmcia_set_voltage;
188#endif
189}
190
191static void init_fec1_ioports(struct fs_platform_info *ptr)
192{ 163{
193 cpm8xx_t *cp = (cpm8xx_t *) immr_map(im_cpm); 164 int i;
194 iop8xx_t *io_port = (iop8xx_t *) immr_map(im_ioport);
195
196 /* configure FEC1 pins */
197 setbits16(&io_port->iop_papar, 0xf830);
198 setbits16(&io_port->iop_padir, 0x0830);
199 clrbits16(&io_port->iop_padir, 0xf000);
200 165
201 setbits32(&cp->cp_pbpar, 0x00001001); 166 for (i = 0; i < ARRAY_SIZE(mpc885ads_pins); i++) {
202 clrbits32(&cp->cp_pbdir, 0x00001001); 167 struct cpm_pin *pin = &mpc885ads_pins[i];
203 168 cpm1_set_pin(pin->port, pin->pin, pin->flags);
204 setbits16(&io_port->iop_pcpar, 0x000c); 169 }
205 clrbits16(&io_port->iop_pcdir, 0x000c);
206 170
207 setbits32(&cp->cp_pepar, 0x00000003); 171 cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
208 setbits32(&cp->cp_pedir, 0x00000003); 172 cpm1_clk_setup(CPM_CLK_SMC2, CPM_BRG2, CPM_CLK_RTX);
209 clrbits32(&cp->cp_peso, 0x00000003); 173 cpm1_clk_setup(CPM_CLK_SCC3, CPM_CLK5, CPM_CLK_TX);
210 clrbits32(&cp->cp_cptr, 0x00000100); 174 cpm1_clk_setup(CPM_CLK_SCC3, CPM_CLK6, CPM_CLK_RX);
211 175
212 immr_unmap(io_port); 176 /* Set FEC1 and FEC2 to MII mode */
213 immr_unmap(cp); 177 clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180);
214} 178}
215 179
216static void init_fec2_ioports(struct fs_platform_info *ptr) 180static void __init mpc885ads_setup_arch(void)
217{ 181{
218 cpm8xx_t *cp = (cpm8xx_t *) immr_map(im_cpm); 182 struct device_node *np;
219 iop8xx_t *io_port = (iop8xx_t *) immr_map(im_ioport);
220
221 /* configure FEC2 pins */
222 setbits32(&cp->cp_pepar, 0x0003fffc);
223 setbits32(&cp->cp_pedir, 0x0003fffc);
224 clrbits32(&cp->cp_peso, 0x000087fc);
225 setbits32(&cp->cp_peso, 0x00037800);
226 clrbits32(&cp->cp_cptr, 0x00000080);
227
228 immr_unmap(io_port);
229 immr_unmap(cp);
230}
231 183
232void init_fec_ioports(struct fs_platform_info *fpi) 184 cpm_reset();
233{ 185 init_ioports();
234 int fec_no = fs_get_fec_index(fpi->fs_no);
235 186
236 switch (fec_no) { 187 np = of_find_compatible_node(NULL, NULL, "fsl,mpc885ads-bcsr");
237 case 0: 188 if (!np) {
238 init_fec1_ioports(fpi); 189 printk(KERN_CRIT "Could not find fsl,mpc885ads-bcsr node\n");
239 break;
240 case 1:
241 init_fec2_ioports(fpi);
242 break;
243 default:
244 printk(KERN_ERR "init_fec_ioports: invalid FEC number\n");
245 return; 190 return;
246 } 191 }
247}
248
249static void init_scc3_ioports(struct fs_platform_info *fpi)
250{
251 unsigned *bcsr_io;
252 iop8xx_t *io_port;
253 cpm8xx_t *cp;
254 192
255 bcsr_io = ioremap(BCSR_ADDR, BCSR_SIZE); 193 bcsr = of_iomap(np, 0);
256 io_port = (iop8xx_t *) immr_map(im_ioport); 194 bcsr5 = of_iomap(np, 1);
257 cp = (cpm8xx_t *) immr_map(im_cpm); 195 of_node_put(np);
258 196
259 if (bcsr_io == NULL) { 197 if (!bcsr || !bcsr5) {
260 printk(KERN_CRIT "Could not remap BCSR\n"); 198 printk(KERN_CRIT "Could not remap BCSR\n");
261 return; 199 return;
262 } 200 }
263 201
264 /* Enable the PHY. 202 clrbits32(&bcsr[1], BCSR1_RS232EN_1);
265 */ 203#ifdef CONFIG_MPC8xx_SECOND_ETH_FEC2
266 clrbits32(bcsr_io + 4, BCSR4_ETH10_RST); 204 setbits32(&bcsr[1], BCSR1_RS232EN_2);
267 udelay(1000); 205#else
268 setbits32(bcsr_io + 4, BCSR4_ETH10_RST); 206 clrbits32(&bcsr[1], BCSR1_RS232EN_2);
269 /* Configure port A pins for Txd and Rxd. 207#endif
270 */
271 setbits16(&io_port->iop_papar, PA_ENET_RXD | PA_ENET_TXD);
272 clrbits16(&io_port->iop_padir, PA_ENET_RXD | PA_ENET_TXD);
273 208
274 /* Configure port C pins to enable CLSN and RENA. 209 clrbits32(bcsr5, BCSR5_MII1_EN);
275 */ 210 setbits32(bcsr5, BCSR5_MII1_RST);
276 clrbits16(&io_port->iop_pcpar, PC_ENET_CLSN | PC_ENET_RENA); 211 udelay(1000);
277 clrbits16(&io_port->iop_pcdir, PC_ENET_CLSN | PC_ENET_RENA); 212 clrbits32(bcsr5, BCSR5_MII1_RST);
278 setbits16(&io_port->iop_pcso, PC_ENET_CLSN | PC_ENET_RENA);
279 213
280 /* Configure port E for TCLK and RCLK. 214#ifdef CONFIG_MPC8xx_SECOND_ETH_FEC2
281 */ 215 clrbits32(bcsr5, BCSR5_MII2_EN);
282 setbits32(&cp->cp_pepar, PE_ENET_TCLK | PE_ENET_RCLK); 216 setbits32(bcsr5, BCSR5_MII2_RST);
283 clrbits32(&cp->cp_pepar, PE_ENET_TENA); 217 udelay(1000);
284 clrbits32(&cp->cp_pedir, PE_ENET_TCLK | PE_ENET_RCLK | PE_ENET_TENA); 218 clrbits32(bcsr5, BCSR5_MII2_RST);
285 clrbits32(&cp->cp_peso, PE_ENET_TCLK | PE_ENET_RCLK); 219#else
286 setbits32(&cp->cp_peso, PE_ENET_TENA); 220 setbits32(bcsr5, BCSR5_MII2_EN);
287 221#endif
288 /* Configure Serial Interface clock routing.
289 * First, clear all SCC bits to zero, then set the ones we want.
290 */
291 clrbits32(&cp->cp_sicr, SICR_ENET_MASK);
292 setbits32(&cp->cp_sicr, SICR_ENET_CLKRT);
293 222
294 /* Disable Rx and Tx. SMC1 sshould be stopped if SCC3 eternet are used. 223#ifdef CONFIG_MPC8xx_SECOND_ETH_SCC3
295 */ 224 clrbits32(&bcsr[4], BCSR4_ETH10_RST);
296 clrbits16(&cp->cp_smc[0].smc_smcmr, SMCMR_REN | SMCMR_TEN); 225 udelay(1000);
297 /* On the MPC885ADS SCC ethernet PHY is initialized in the full duplex mode 226 setbits32(&bcsr[4], BCSR4_ETH10_RST);
298 * by H/W setting after reset. SCC ethernet controller support only half duplex.
299 * This discrepancy of modes causes a lot of carrier lost errors.
300 */
301 227
302 /* In the original SCC enet driver the following code is placed at 228 setbits32(&bcsr[1], BCSR1_ETHEN);
303 the end of the initialization */
304 setbits32(&cp->cp_pepar, PE_ENET_TENA);
305 clrbits32(&cp->cp_pedir, PE_ENET_TENA);
306 setbits32(&cp->cp_peso, PE_ENET_TENA);
307 229
308 setbits32(bcsr_io + 4, BCSR1_ETHEN); 230 np = of_find_node_by_path("/soc@ff000000/cpm@9c0/serial@a80");
309 iounmap(bcsr_io); 231#else
310 immr_unmap(io_port); 232 np = of_find_node_by_path("/soc@ff000000/cpm@9c0/ethernet@a40");
311 immr_unmap(cp); 233#endif
312}
313 234
314void init_scc_ioports(struct fs_platform_info *fpi) 235 /* The SCC3 enet registers overlap the SMC1 registers, so
315{ 236 * one of the two must be removed from the device tree.
316 int scc_no = fs_get_scc_index(fpi->fs_no); 237 */
317 238
318 switch (scc_no) { 239 if (np) {
319 case 2: 240 of_detach_node(np);
320 init_scc3_ioports(fpi); 241 of_node_put(np);
321 break;
322 default:
323 printk(KERN_ERR "init_scc_ioports: invalid SCC number\n");
324 return;
325 } 242 }
326}
327 243
328static void init_smc1_uart_ioports(struct fs_uart_platform_info *ptr) 244#ifdef CONFIG_PCMCIA_M8XX
329{ 245 /* Set up board specific hook-ups.*/
330 unsigned *bcsr_io; 246 m8xx_pcmcia_ops.hw_ctrl = pcmcia_hw_setup;
331 cpm8xx_t *cp; 247 m8xx_pcmcia_ops.voltage_set = pcmcia_set_voltage;
332 248#endif
333 cp = (cpm8xx_t *) immr_map(im_cpm);
334 setbits32(&cp->cp_pepar, 0x000000c0);
335 clrbits32(&cp->cp_pedir, 0x000000c0);
336 clrbits32(&cp->cp_peso, 0x00000040);
337 setbits32(&cp->cp_peso, 0x00000080);
338 immr_unmap(cp);
339
340 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
341
342 if (bcsr_io == NULL) {
343 printk(KERN_CRIT "Could not remap BCSR1\n");
344 return;
345 }
346 clrbits32(bcsr_io, BCSR1_RS232EN_1);
347 iounmap(bcsr_io);
348} 249}
349 250
350static void init_smc2_uart_ioports(struct fs_uart_platform_info *fpi) 251static int __init mpc885ads_probe(void)
351{ 252{
352 unsigned *bcsr_io; 253 unsigned long root = of_get_flat_dt_root();
353 cpm8xx_t *cp; 254 return of_flat_dt_is_compatible(root, "fsl,mpc885ads");
354
355 cp = (cpm8xx_t *) immr_map(im_cpm);
356 setbits32(&cp->cp_pepar, 0x00000c00);
357 clrbits32(&cp->cp_pedir, 0x00000c00);
358 clrbits32(&cp->cp_peso, 0x00000400);
359 setbits32(&cp->cp_peso, 0x00000800);
360 immr_unmap(cp);
361
362 bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
363
364 if (bcsr_io == NULL) {
365 printk(KERN_CRIT "Could not remap BCSR1\n");
366 return;
367 }
368 clrbits32(bcsr_io, BCSR1_RS232EN_2);
369 iounmap(bcsr_io);
370} 255}
371 256
372void init_smc_ioports(struct fs_uart_platform_info *data) 257static struct of_device_id __initdata of_bus_ids[] = {
373{ 258 { .name = "soc", },
374 int smc_no = fs_uart_id_fsid2smc(data->fs_no); 259 { .name = "cpm", },
260 { .name = "localbus", },
261 {},
262};
375 263
376 switch (smc_no) { 264static int __init declare_of_platform_devices(void)
377 case 0:
378 init_smc1_uart_ioports(data);
379 data->brg = data->clk_rx;
380 break;
381 case 1:
382 init_smc2_uart_ioports(data);
383 data->brg = data->clk_rx;
384 break;
385 default:
386 printk(KERN_ERR "init_scc_ioports: invalid SCC number\n");
387 return;
388 }
389}
390
391int platform_device_skip(const char *model, int id)
392{ 265{
393#ifdef CONFIG_MPC8xx_SECOND_ETH_SCC3 266 /* Publish the QE devices */
394 const char *dev = "FEC"; 267 if (machine_is(mpc885_ads))
395 int n = 2; 268 of_platform_bus_probe(NULL, of_bus_ids, NULL);
396#else
397 const char *dev = "SCC";
398 int n = 3;
399#endif
400
401 if (!strcmp(model, dev) && n == id)
402 return 1;
403 269
404 return 0; 270 return 0;
405} 271}
406 272device_initcall(declare_of_platform_devices);
407static void __init mpc885ads_setup_arch(void) 273
408{ 274define_machine(mpc885_ads) {
409 struct device_node *cpu; 275 .name = "Freescale MPC885 ADS",
410 276 .probe = mpc885ads_probe,
411 cpu = of_find_node_by_type(NULL, "cpu"); 277 .setup_arch = mpc885ads_setup_arch,
412 if (cpu != 0) { 278 .init_IRQ = m8xx_pic_init,
413 const unsigned int *fp; 279 .get_irq = mpc8xx_get_irq,
414 280 .restart = mpc8xx_restart,
415 fp = of_get_property(cpu, "clock-frequency", NULL); 281 .calibrate_decr = mpc8xx_calibrate_decr,
416 if (fp != 0) 282 .set_rtc_time = mpc8xx_set_rtc_time,
417 loops_per_jiffy = *fp / HZ; 283 .get_rtc_time = mpc8xx_get_rtc_time,
418 else 284 .progress = udbg_progress,
419 loops_per_jiffy = 50000000 / HZ; 285};
420 of_node_put(cpu);
421 }
422
423 cpm_reset();
424
425 mpc885ads_board_setup();
426
427 ROOT_DEV = Root_NFS;
428}
429
430static int __init mpc885ads_probe(void)
431{
432 char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
433 "model", NULL);
434 if (model == NULL)
435 return 0;
436 if (strcmp(model, "MPC885ADS"))
437 return 0;
438
439 return 1;
440}
441
442define_machine(mpc885_ads)
443{
444.name = "MPC885 ADS",.probe = mpc885ads_probe,.setup_arch =
445 mpc885ads_setup_arch,.init_IRQ =
446 m8xx_pic_init,.show_cpuinfo = mpc8xx_show_cpuinfo,.get_irq =
447 mpc8xx_get_irq,.restart = mpc8xx_restart,.calibrate_decr =
448 mpc8xx_calibrate_decr,.set_rtc_time =
449 mpc8xx_set_rtc_time,.get_rtc_time = mpc8xx_get_rtc_time,};
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 19d4628edf79..cc6013ffc29a 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
@@ -266,12 +273,24 @@ config QUICC_ENGINE
266config CPM2 273config CPM2
267 bool 274 bool
268 default n 275 default n
276 select CPM
269 help 277 help
270 The CPM2 (Communications Processor Module) is a coprocessor on 278 The CPM2 (Communications Processor Module) is a coprocessor on
271 embedded CPUs made by Freescale. Selecting this option means that 279 embedded CPUs made by Freescale. Selecting this option means that
272 you wish to build a kernel for a machine with a CPM2 coprocessor 280 you wish to build a kernel for a machine with a CPM2 coprocessor
273 on it (826x, 827x, 8560). 281 on it (826x, 827x, 8560).
274 282
283config PPC_CPM_NEW_BINDING
284 bool
285 depends on CPM1 || CPM2
286 help
287 Select this if your board has been converted to use the new
288 device tree bindings for CPM, and no longer needs the
289 ioport callbacks or the platform device glue code.
290
291 The fs_enet and cpm_uart drivers will be built as
292 of_platform devices.
293
275config AXON_RAM 294config AXON_RAM
276 tristate "Axon DDR2 memory device driver" 295 tristate "Axon DDR2 memory device driver"
277 depends on PPC_IBM_CELL_BLADE 296 depends on PPC_IBM_CELL_BLADE
@@ -291,4 +310,7 @@ config FSL_ULI1575
291 Freescale reference boards. The boards all use the ULI in pretty 310 Freescale reference boards. The boards all use the ULI in pretty
292 much the same way. 311 much the same way.
293 312
313config CPM
314 bool
315
294endmenu 316endmenu
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/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c
index 0b6e8ee85ab1..901236fa0f07 100644
--- a/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -24,7 +24,7 @@
24#include <asm/machdep.h> 24#include <asm/machdep.h>
25#include <asm/of_platform.h> 25#include <asm/of_platform.h>
26#include <asm/prom.h> 26#include <asm/prom.h>
27#include "cbe_regs.h" 27#include <asm/cell-regs.h>
28#include "cbe_cpufreq.h" 28#include "cbe_cpufreq.h"
29 29
30static DEFINE_MUTEX(cbe_switch_mutex); 30static DEFINE_MUTEX(cbe_switch_mutex);
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c b/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
index 163263b3e1cd..70fa7aef5edd 100644
--- a/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
@@ -28,8 +28,8 @@
28#include <linux/time.h> 28#include <linux/time.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/hw_irq.h> 30#include <asm/hw_irq.h>
31#include <asm/cell-regs.h>
31 32
32#include "cbe_regs.h"
33#include "cbe_cpufreq.h" 33#include "cbe_cpufreq.h"
34 34
35/* to write to MIC register */ 35/* to write to MIC register */
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c b/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
index fc6f38982ff4..6a2c1b0a9a94 100644
--- a/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
@@ -27,12 +27,12 @@
27#include <asm/processor.h> 27#include <asm/processor.h>
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <asm/pmi.h> 29#include <asm/pmi.h>
30#include <asm/cell-regs.h>
30 31
31#ifdef DEBUG 32#ifdef DEBUG
32#include <asm/time.h> 33#include <asm/time.h>
33#endif 34#endif
34 35
35#include "cbe_regs.h"
36#include "cbe_cpufreq.h" 36#include "cbe_cpufreq.h"
37 37
38static u8 pmi_slow_mode_limit[MAX_CBE]; 38static u8 pmi_slow_mode_limit[MAX_CBE];
diff --git a/arch/powerpc/platforms/cell/cbe_regs.c b/arch/powerpc/platforms/cell/cbe_regs.c
index c8f7f0007422..16a9b07e7b0c 100644
--- a/arch/powerpc/platforms/cell/cbe_regs.c
+++ b/arch/powerpc/platforms/cell/cbe_regs.c
@@ -16,8 +16,7 @@
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <asm/of_device.h> 17#include <asm/of_device.h>
18#include <asm/of_platform.h> 18#include <asm/of_platform.h>
19 19#include <asm/cell-regs.h>
20#include "cbe_regs.h"
21 20
22/* 21/*
23 * Current implementation uses "cpu" nodes. We build our own mapping 22 * Current implementation uses "cpu" nodes. We build our own mapping
diff --git a/arch/powerpc/platforms/cell/cbe_regs.h b/arch/powerpc/platforms/cell/cbe_regs.h
deleted file mode 100644
index b24025f2ac7a..000000000000
--- a/arch/powerpc/platforms/cell/cbe_regs.h
+++ /dev/null
@@ -1,271 +0,0 @@
1/*
2 * cbe_regs.h
3 *
4 * This file is intended to hold the various register definitions for CBE
5 * on-chip system devices (memory controller, IO controller, etc...)
6 *
7 * (C) Copyright IBM Corporation 2001,2006
8 *
9 * Authors: Maximino Aguilar (maguilar@us.ibm.com)
10 * David J. Erb (djerb@us.ibm.com)
11 *
12 * (c) 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
13 */
14
15#ifndef CBE_REGS_H
16#define CBE_REGS_H
17
18#include <asm/cell-pmu.h>
19
20/*
21 *
22 * Some HID register definitions
23 *
24 */
25
26/* CBE specific HID0 bits */
27#define HID0_CBE_THERM_WAKEUP 0x0000020000000000ul
28#define HID0_CBE_SYSERR_WAKEUP 0x0000008000000000ul
29#define HID0_CBE_THERM_INT_EN 0x0000000400000000ul
30#define HID0_CBE_SYSERR_INT_EN 0x0000000200000000ul
31
32#define MAX_CBE 2
33
34/*
35 *
36 * Pervasive unit register definitions
37 *
38 */
39
40union spe_reg {
41 u64 val;
42 u8 spe[8];
43};
44
45union ppe_spe_reg {
46 u64 val;
47 struct {
48 u32 ppe;
49 u32 spe;
50 };
51};
52
53
54struct cbe_pmd_regs {
55 /* Debug Bus Control */
56 u64 pad_0x0000; /* 0x0000 */
57
58 u64 group_control; /* 0x0008 */
59
60 u8 pad_0x0010_0x00a8 [0x00a8 - 0x0010]; /* 0x0010 */
61
62 u64 debug_bus_control; /* 0x00a8 */
63
64 u8 pad_0x00b0_0x0100 [0x0100 - 0x00b0]; /* 0x00b0 */
65
66 u64 trace_aux_data; /* 0x0100 */
67 u64 trace_buffer_0_63; /* 0x0108 */
68 u64 trace_buffer_64_127; /* 0x0110 */
69 u64 trace_address; /* 0x0118 */
70 u64 ext_tr_timer; /* 0x0120 */
71
72 u8 pad_0x0128_0x0400 [0x0400 - 0x0128]; /* 0x0128 */
73
74 /* Performance Monitor */
75 u64 pm_status; /* 0x0400 */
76 u64 pm_control; /* 0x0408 */
77 u64 pm_interval; /* 0x0410 */
78 u64 pm_ctr[4]; /* 0x0418 */
79 u64 pm_start_stop; /* 0x0438 */
80 u64 pm07_control[8]; /* 0x0440 */
81
82 u8 pad_0x0480_0x0800 [0x0800 - 0x0480]; /* 0x0480 */
83
84 /* Thermal Sensor Registers */
85 union spe_reg ts_ctsr1; /* 0x0800 */
86 u64 ts_ctsr2; /* 0x0808 */
87 union spe_reg ts_mtsr1; /* 0x0810 */
88 u64 ts_mtsr2; /* 0x0818 */
89 union spe_reg ts_itr1; /* 0x0820 */
90 u64 ts_itr2; /* 0x0828 */
91 u64 ts_gitr; /* 0x0830 */
92 u64 ts_isr; /* 0x0838 */
93 u64 ts_imr; /* 0x0840 */
94 union spe_reg tm_cr1; /* 0x0848 */
95 u64 tm_cr2; /* 0x0850 */
96 u64 tm_simr; /* 0x0858 */
97 union ppe_spe_reg tm_tpr; /* 0x0860 */
98 union spe_reg tm_str1; /* 0x0868 */
99 u64 tm_str2; /* 0x0870 */
100 union ppe_spe_reg tm_tsr; /* 0x0878 */
101
102 /* Power Management */
103 u64 pmcr; /* 0x0880 */
104#define CBE_PMD_PAUSE_ZERO_CONTROL 0x10000
105 u64 pmsr; /* 0x0888 */
106
107 /* Time Base Register */
108 u64 tbr; /* 0x0890 */
109
110 u8 pad_0x0898_0x0c00 [0x0c00 - 0x0898]; /* 0x0898 */
111
112 /* Fault Isolation Registers */
113 u64 checkstop_fir; /* 0x0c00 */
114 u64 recoverable_fir; /* 0x0c08 */
115 u64 spec_att_mchk_fir; /* 0x0c10 */
116 u32 fir_mode_reg; /* 0x0c18 */
117 u8 pad_0x0c1c_0x0c20 [4]; /* 0x0c1c */
118#define CBE_PMD_FIR_MODE_M8 0x00800
119 u64 fir_enable_mask; /* 0x0c20 */
120
121 u8 pad_0x0c28_0x0ca8 [0x0ca8 - 0x0c28]; /* 0x0c28 */
122 u64 ras_esc_0; /* 0x0ca8 */
123 u8 pad_0x0cb0_0x1000 [0x1000 - 0x0cb0]; /* 0x0cb0 */
124};
125
126extern struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np);
127extern struct cbe_pmd_regs __iomem *cbe_get_cpu_pmd_regs(int cpu);
128
129/*
130 * PMU shadow registers
131 *
132 * Many of the registers in the performance monitoring unit are write-only,
133 * so we need to save a copy of what we write to those registers.
134 *
135 * The actual data counters are read/write. However, writing to the counters
136 * only takes effect if the PMU is enabled. Otherwise the value is stored in
137 * a hardware latch until the next time the PMU is enabled. So we save a copy
138 * of the counter values if we need to read them back while the PMU is
139 * disabled. The counter_value_in_latch field is a bitmap indicating which
140 * counters currently have a value waiting to be written.
141 */
142
143struct cbe_pmd_shadow_regs {
144 u32 group_control;
145 u32 debug_bus_control;
146 u32 trace_address;
147 u32 ext_tr_timer;
148 u32 pm_status;
149 u32 pm_control;
150 u32 pm_interval;
151 u32 pm_start_stop;
152 u32 pm07_control[NR_CTRS];
153
154 u32 pm_ctr[NR_PHYS_CTRS];
155 u32 counter_value_in_latch;
156};
157
158extern struct cbe_pmd_shadow_regs *cbe_get_pmd_shadow_regs(struct device_node *np);
159extern struct cbe_pmd_shadow_regs *cbe_get_cpu_pmd_shadow_regs(int cpu);
160
161/*
162 *
163 * IIC unit register definitions
164 *
165 */
166
167struct cbe_iic_pending_bits {
168 u32 data;
169 u8 flags;
170 u8 class;
171 u8 source;
172 u8 prio;
173};
174
175#define CBE_IIC_IRQ_VALID 0x80
176#define CBE_IIC_IRQ_IPI 0x40
177
178struct cbe_iic_thread_regs {
179 struct cbe_iic_pending_bits pending;
180 struct cbe_iic_pending_bits pending_destr;
181 u64 generate;
182 u64 prio;
183};
184
185struct cbe_iic_regs {
186 u8 pad_0x0000_0x0400[0x0400 - 0x0000]; /* 0x0000 */
187
188 /* IIC interrupt registers */
189 struct cbe_iic_thread_regs thread[2]; /* 0x0400 */
190
191 u64 iic_ir; /* 0x0440 */
192#define CBE_IIC_IR_PRIO(x) (((x) & 0xf) << 12)
193#define CBE_IIC_IR_DEST_NODE(x) (((x) & 0xf) << 4)
194#define CBE_IIC_IR_DEST_UNIT(x) ((x) & 0xf)
195#define CBE_IIC_IR_IOC_0 0x0
196#define CBE_IIC_IR_IOC_1S 0xb
197#define CBE_IIC_IR_PT_0 0xe
198#define CBE_IIC_IR_PT_1 0xf
199
200 u64 iic_is; /* 0x0448 */
201#define CBE_IIC_IS_PMI 0x2
202
203 u8 pad_0x0450_0x0500[0x0500 - 0x0450]; /* 0x0450 */
204
205 /* IOC FIR */
206 u64 ioc_fir_reset; /* 0x0500 */
207 u64 ioc_fir_set; /* 0x0508 */
208 u64 ioc_checkstop_enable; /* 0x0510 */
209 u64 ioc_fir_error_mask; /* 0x0518 */
210 u64 ioc_syserr_enable; /* 0x0520 */
211 u64 ioc_fir; /* 0x0528 */
212
213 u8 pad_0x0530_0x1000[0x1000 - 0x0530]; /* 0x0530 */
214};
215
216extern struct cbe_iic_regs __iomem *cbe_get_iic_regs(struct device_node *np);
217extern struct cbe_iic_regs __iomem *cbe_get_cpu_iic_regs(int cpu);
218
219
220struct cbe_mic_tm_regs {
221 u8 pad_0x0000_0x0040[0x0040 - 0x0000]; /* 0x0000 */
222
223 u64 mic_ctl_cnfg2; /* 0x0040 */
224#define CBE_MIC_ENABLE_AUX_TRC 0x8000000000000000LL
225#define CBE_MIC_DISABLE_PWR_SAV_2 0x0200000000000000LL
226#define CBE_MIC_DISABLE_AUX_TRC_WRAP 0x0100000000000000LL
227#define CBE_MIC_ENABLE_AUX_TRC_INT 0x0080000000000000LL
228
229 u64 pad_0x0048; /* 0x0048 */
230
231 u64 mic_aux_trc_base; /* 0x0050 */
232 u64 mic_aux_trc_max_addr; /* 0x0058 */
233 u64 mic_aux_trc_cur_addr; /* 0x0060 */
234 u64 mic_aux_trc_grf_addr; /* 0x0068 */
235 u64 mic_aux_trc_grf_data; /* 0x0070 */
236
237 u64 pad_0x0078; /* 0x0078 */
238
239 u64 mic_ctl_cnfg_0; /* 0x0080 */
240#define CBE_MIC_DISABLE_PWR_SAV_0 0x8000000000000000LL
241
242 u64 pad_0x0088; /* 0x0088 */
243
244 u64 slow_fast_timer_0; /* 0x0090 */
245 u64 slow_next_timer_0; /* 0x0098 */
246
247 u8 pad_0x00a0_0x01c0[0x01c0 - 0x0a0]; /* 0x00a0 */
248
249 u64 mic_ctl_cnfg_1; /* 0x01c0 */
250#define CBE_MIC_DISABLE_PWR_SAV_1 0x8000000000000000LL
251 u64 pad_0x01c8; /* 0x01c8 */
252
253 u64 slow_fast_timer_1; /* 0x01d0 */
254 u64 slow_next_timer_1; /* 0x01d8 */
255
256 u8 pad_0x01e0_0x1000[0x1000 - 0x01e0]; /* 0x01e0 */
257};
258
259extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np);
260extern struct cbe_mic_tm_regs __iomem *cbe_get_cpu_mic_tm_regs(int cpu);
261
262/* some utility functions to deal with SMT */
263extern u32 cbe_get_hw_thread_id(int cpu);
264extern u32 cbe_cpu_to_node(int cpu);
265extern u32 cbe_node_to_cpu(int node);
266
267/* Init this module early */
268extern void cbe_regs_init(void);
269
270
271#endif /* CBE_REGS_H */
diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c
index fb5eda48467d..4852bf312d83 100644
--- a/arch/powerpc/platforms/cell/cbe_thermal.c
+++ b/arch/powerpc/platforms/cell/cbe_thermal.c
@@ -52,8 +52,8 @@
52#include <asm/spu.h> 52#include <asm/spu.h>
53#include <asm/io.h> 53#include <asm/io.h>
54#include <asm/prom.h> 54#include <asm/prom.h>
55#include <asm/cell-regs.h>
55 56
56#include "cbe_regs.h"
57#include "spu_priv1_mmio.h" 57#include "spu_priv1_mmio.h"
58 58
59#define TEMP_MIN 65 59#define TEMP_MIN 65
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 47264e722029..151fd8b82d63 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -41,9 +41,9 @@
41#include <asm/prom.h> 41#include <asm/prom.h>
42#include <asm/ptrace.h> 42#include <asm/ptrace.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/cell-regs.h>
44 45
45#include "interrupt.h" 46#include "interrupt.h"
46#include "cbe_regs.h"
47 47
48struct iic { 48struct iic {
49 struct cbe_iic_thread_regs __iomem *regs; 49 struct cbe_iic_thread_regs __iomem *regs;
@@ -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/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 760caa76841a..faabc3fdc130 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -34,8 +34,8 @@
34#include <asm/udbg.h> 34#include <asm/udbg.h>
35#include <asm/of_platform.h> 35#include <asm/of_platform.h>
36#include <asm/lmb.h> 36#include <asm/lmb.h>
37#include <asm/cell-regs.h>
37 38
38#include "cbe_regs.h"
39#include "interrupt.h" 39#include "interrupt.h"
40 40
41/* Define CELL_IOMMU_REAL_UNMAP to actually unmap non-used pages 41/* Define CELL_IOMMU_REAL_UNMAP to actually unmap non-used pages
diff --git a/arch/powerpc/platforms/cell/pervasive.c b/arch/powerpc/platforms/cell/pervasive.c
index 4ede22d363fa..0304589c0a80 100644
--- a/arch/powerpc/platforms/cell/pervasive.c
+++ b/arch/powerpc/platforms/cell/pervasive.c
@@ -34,9 +34,9 @@
34#include <asm/prom.h> 34#include <asm/prom.h>
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/reg.h> 36#include <asm/reg.h>
37#include <asm/cell-regs.h>
37 38
38#include "pervasive.h" 39#include "pervasive.h"
39#include "cbe_regs.h"
40 40
41static int sysreset_hack; 41static int sysreset_hack;
42 42
diff --git a/arch/powerpc/platforms/cell/pmu.c b/arch/powerpc/platforms/cell/pmu.c
index 66ca4b5a1dbc..1ed303678887 100644
--- a/arch/powerpc/platforms/cell/pmu.c
+++ b/arch/powerpc/platforms/cell/pmu.c
@@ -30,8 +30,8 @@
30#include <asm/pmc.h> 30#include <asm/pmc.h>
31#include <asm/reg.h> 31#include <asm/reg.h>
32#include <asm/spu.h> 32#include <asm/spu.h>
33#include <asm/cell-regs.h>
33 34
34#include "cbe_regs.h"
35#include "interrupt.h" 35#include "interrupt.h"
36 36
37/* 37/*
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c
index 3961a085b432..b2494ebcdbe9 100644
--- a/arch/powerpc/platforms/cell/ras.c
+++ b/arch/powerpc/platforms/cell/ras.c
@@ -10,9 +10,9 @@
10#include <asm/prom.h> 10#include <asm/prom.h>
11#include <asm/machdep.h> 11#include <asm/machdep.h>
12#include <asm/rtas.h> 12#include <asm/rtas.h>
13#include <asm/cell-regs.h>
13 14
14#include "ras.h" 15#include "ras.h"
15#include "cbe_regs.h"
16 16
17 17
18static void dump_fir(int cpu) 18static void dump_fir(int cpu)
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index db6654272e13..98e7ef8e6fc6 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -52,9 +52,9 @@
52#include <asm/udbg.h> 52#include <asm/udbg.h>
53#include <asm/mpic.h> 53#include <asm/mpic.h>
54#include <asm/of_platform.h> 54#include <asm/of_platform.h>
55#include <asm/cell-regs.h>
55 56
56#include "interrupt.h" 57#include "interrupt.h"
57#include "cbe_regs.h"
58#include "pervasive.h" 58#include "pervasive.h"
59#include "ras.h" 59#include "ras.h"
60 60
@@ -83,12 +83,22 @@ static void cell_progress(char *s, unsigned short hex)
83 83
84static int __init cell_publish_devices(void) 84static int __init cell_publish_devices(void)
85{ 85{
86 int node;
87
86 if (!machine_is(cell)) 88 if (!machine_is(cell))
87 return 0; 89 return 0;
88 90
89 /* Publish OF platform devices for southbridge IOs */ 91 /* Publish OF platform devices for southbridge IOs */
90 of_platform_bus_probe(NULL, NULL, NULL); 92 of_platform_bus_probe(NULL, NULL, NULL);
91 93
94 /* There is no device for the MIC memory controller, thus we create
95 * a platform device for it to attach the EDAC driver to.
96 */
97 for_each_online_node(node) {
98 if (cbe_get_cpu_mic_tm_regs(cbe_node_to_cpu(node)) == NULL)
99 continue;
100 platform_device_register_simple("cbe-mic", node, NULL, 0);
101 }
92 return 0; 102 return 0;
93} 103}
94device_initcall(cell_publish_devices); 104device_initcall(cell_publish_devices);
@@ -161,11 +171,6 @@ static void __init cell_setup_arch(void)
161 /* init to some ~sane value until calibrate_delay() runs */ 171 /* init to some ~sane value until calibrate_delay() runs */
162 loops_per_jiffy = 50000000; 172 loops_per_jiffy = 50000000;
163 173
164 if (ROOT_DEV == 0) {
165 printk("No ramdisk, default root is /dev/hda2\n");
166 ROOT_DEV = Root_HDA2;
167 }
168
169 /* Find and initialize PCI host bridges */ 174 /* Find and initialize PCI host bridges */
170 init_pci_config_tokens(); 175 init_pci_config_tokens();
171 find_and_init_phbs(); 176 find_and_init_phbs();
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..c83c3e3f5178 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -168,7 +168,7 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
168#else 168#else
169 psize = mm->context.user_psize; 169 psize = mm->context.user_psize;
170#endif 170#endif
171 vsid = (get_vsid(mm->context.id, ea) << SLB_VSID_SHIFT) | 171 vsid = (get_vsid(mm->context.id, ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
172 SLB_VSID_USER; 172 SLB_VSID_USER;
173 break; 173 break;
174 case VMALLOC_REGION_ID: 174 case VMALLOC_REGION_ID:
@@ -176,12 +176,12 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
176 psize = mmu_vmalloc_psize; 176 psize = mmu_vmalloc_psize;
177 else 177 else
178 psize = mmu_io_psize; 178 psize = mmu_io_psize;
179 vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | 179 vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
180 SLB_VSID_KERNEL; 180 SLB_VSID_KERNEL;
181 break; 181 break;
182 case KERNEL_REGION_ID: 182 case KERNEL_REGION_ID:
183 psize = mmu_linear_psize; 183 psize = mmu_linear_psize;
184 vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | 184 vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
185 SLB_VSID_KERNEL; 185 SLB_VSID_KERNEL;
186 break; 186 break;
187 default: 187 default:
@@ -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..3d64c81cc6e2 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -699,7 +699,7 @@ static inline void get_kernel_slb(u64 ea, u64 slb[2])
699 llp = mmu_psize_defs[mmu_linear_psize].sllp; 699 llp = mmu_psize_defs[mmu_linear_psize].sllp;
700 else 700 else
701 llp = mmu_psize_defs[mmu_virtual_psize].sllp; 701 llp = mmu_psize_defs[mmu_virtual_psize].sllp;
702 slb[0] = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | 702 slb[0] = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
703 SLB_VSID_KERNEL | llp; 703 SLB_VSID_KERNEL | llp;
704 slb[1] = (ea & ESID_MASK) | SLB_ESID_V; 704 slb[1] = (ea & ESID_MASK) | SLB_ESID_V;
705} 705}
@@ -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..fbf27c74ebda 100644
--- a/arch/powerpc/platforms/celleb/htab.c
+++ b/arch/powerpc/platforms/celleb/htab.c
@@ -90,7 +90,7 @@ static inline unsigned int beat_read_mask(unsigned hpte_group)
90static long beat_lpar_hpte_insert(unsigned long hpte_group, 90static long beat_lpar_hpte_insert(unsigned long hpte_group,
91 unsigned long va, unsigned long pa, 91 unsigned long va, unsigned long pa,
92 unsigned long rflags, unsigned long vflags, 92 unsigned long rflags, unsigned long vflags,
93 int psize) 93 int psize, int ssize)
94{ 94{
95 unsigned long lpar_rc; 95 unsigned long lpar_rc;
96 unsigned long slot; 96 unsigned long slot;
@@ -105,7 +105,8 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group,
105 "rflags=%lx, vflags=%lx, psize=%d)\n", 105 "rflags=%lx, vflags=%lx, psize=%d)\n",
106 hpte_group, va, pa, rflags, vflags, psize); 106 hpte_group, va, pa, rflags, vflags, psize);
107 107
108 hpte_v = hpte_encode_v(va, psize) | vflags | HPTE_V_VALID; 108 hpte_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M) |
109 vflags | HPTE_V_VALID;
109 hpte_r = hpte_encode_r(pa, psize) | rflags; 110 hpte_r = hpte_encode_r(pa, psize) | rflags;
110 111
111 if (!(vflags & HPTE_V_BOLTED)) 112 if (!(vflags & HPTE_V_BOLTED))
@@ -184,12 +185,12 @@ static void beat_lpar_hptab_clear(void)
184static long beat_lpar_hpte_updatepp(unsigned long slot, 185static long beat_lpar_hpte_updatepp(unsigned long slot,
185 unsigned long newpp, 186 unsigned long newpp,
186 unsigned long va, 187 unsigned long va,
187 int psize, int local) 188 int psize, int ssize, int local)
188{ 189{
189 unsigned long lpar_rc; 190 unsigned long lpar_rc;
190 unsigned long dummy0, dummy1, want_v; 191 unsigned long dummy0, dummy1, want_v;
191 192
192 want_v = hpte_encode_v(va, psize); 193 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
193 194
194 DBG_LOW(" update: " 195 DBG_LOW(" update: "
195 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ", 196 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ",
@@ -225,8 +226,8 @@ static long beat_lpar_hpte_find(unsigned long va, int psize)
225 long slot; 226 long slot;
226 unsigned long want_v, hpte_v; 227 unsigned long want_v, hpte_v;
227 228
228 hash = hpt_hash(va, mmu_psize_defs[psize].shift); 229 hash = hpt_hash(va, mmu_psize_defs[psize].shift, MMU_SEGSIZE_256M);
229 want_v = hpte_encode_v(va, psize); 230 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
230 231
231 for (j = 0; j < 2; j++) { 232 for (j = 0; j < 2; j++) {
232 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 233 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
@@ -251,11 +252,11 @@ static long beat_lpar_hpte_find(unsigned long va, int psize)
251 252
252static void beat_lpar_hpte_updateboltedpp(unsigned long newpp, 253static void beat_lpar_hpte_updateboltedpp(unsigned long newpp,
253 unsigned long ea, 254 unsigned long ea,
254 int psize) 255 int psize, int ssize)
255{ 256{
256 unsigned long lpar_rc, slot, vsid, va, dummy0, dummy1; 257 unsigned long lpar_rc, slot, vsid, va, dummy0, dummy1;
257 258
258 vsid = get_kernel_vsid(ea); 259 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M);
259 va = (vsid << 28) | (ea & 0x0fffffff); 260 va = (vsid << 28) | (ea & 0x0fffffff);
260 261
261 spin_lock(&beat_htab_lock); 262 spin_lock(&beat_htab_lock);
@@ -270,7 +271,7 @@ static void beat_lpar_hpte_updateboltedpp(unsigned long newpp,
270} 271}
271 272
272static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long va, 273static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
273 int psize, int local) 274 int psize, int ssize, int local)
274{ 275{
275 unsigned long want_v; 276 unsigned long want_v;
276 unsigned long lpar_rc; 277 unsigned long lpar_rc;
@@ -279,7 +280,7 @@ static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
279 280
280 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n", 281 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
281 slot, va, psize, local); 282 slot, va, psize, local);
282 want_v = hpte_encode_v(va, psize); 283 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
283 284
284 spin_lock_irqsave(&beat_htab_lock, flags); 285 spin_lock_irqsave(&beat_htab_lock, flags);
285 dummy1 = beat_lpar_hpte_getword0(slot); 286 dummy1 = beat_lpar_hpte_getword0(slot);
@@ -306,3 +307,134 @@ void __init hpte_init_beat(void)
306 ppc_md.hpte_remove = beat_lpar_hpte_remove; 307 ppc_md.hpte_remove = beat_lpar_hpte_remove;
307 ppc_md.hpte_clear_all = beat_lpar_hptab_clear; 308 ppc_md.hpte_clear_all = beat_lpar_hptab_clear;
308} 309}
310
311static long beat_lpar_hpte_insert_v3(unsigned long hpte_group,
312 unsigned long va, unsigned long pa,
313 unsigned long rflags, unsigned long vflags,
314 int psize, int ssize)
315{
316 unsigned long lpar_rc;
317 unsigned long slot;
318 unsigned long hpte_v, hpte_r;
319
320 /* same as iseries */
321 if (vflags & HPTE_V_SECONDARY)
322 return -1;
323
324 if (!(vflags & HPTE_V_BOLTED))
325 DBG_LOW("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
326 "rflags=%lx, vflags=%lx, psize=%d)\n",
327 hpte_group, va, pa, rflags, vflags, psize);
328
329 hpte_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M) |
330 vflags | HPTE_V_VALID;
331 hpte_r = hpte_encode_r(pa, psize) | rflags;
332
333 if (!(vflags & HPTE_V_BOLTED))
334 DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
335
336 if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
337 hpte_r &= ~_PAGE_COHERENT;
338
339 /* insert into not-volted entry */
340 lpar_rc = beat_insert_htab_entry3(0, hpte_group, hpte_v, hpte_r,
341 HPTE_V_BOLTED, 0, &slot);
342 /*
343 * Since we try and ioremap PHBs we don't own, the pte insert
344 * will fail. However we must catch the failure in hash_page
345 * or we will loop forever, so return -2 in this case.
346 */
347 if (unlikely(lpar_rc != 0)) {
348 if (!(vflags & HPTE_V_BOLTED))
349 DBG_LOW(" lpar err %lx\n", lpar_rc);
350 return -2;
351 }
352 if (!(vflags & HPTE_V_BOLTED))
353 DBG_LOW(" -> slot: %lx\n", slot);
354
355 /* We have to pass down the secondary bucket bit here as well */
356 return (slot ^ hpte_group) & 15;
357}
358
359/*
360 * NOTE: for updatepp ops we are fortunate that the linux "newpp" bits and
361 * the low 3 bits of flags happen to line up. So no transform is needed.
362 * We can probably optimize here and assume the high bits of newpp are
363 * already zero. For now I am paranoid.
364 */
365static long beat_lpar_hpte_updatepp_v3(unsigned long slot,
366 unsigned long newpp,
367 unsigned long va,
368 int psize, int ssize, int local)
369{
370 unsigned long lpar_rc;
371 unsigned long want_v;
372 unsigned long pss;
373
374 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
375 pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc;
376
377 DBG_LOW(" update: "
378 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ",
379 want_v & HPTE_V_AVPN, slot, psize, newpp);
380
381 lpar_rc = beat_update_htab_permission3(0, slot, want_v, pss, 7, newpp);
382
383 if (lpar_rc == 0xfffffff7) {
384 DBG_LOW("not found !\n");
385 return -1;
386 }
387
388 DBG_LOW("ok\n");
389
390 BUG_ON(lpar_rc != 0);
391
392 return 0;
393}
394
395static void beat_lpar_hpte_invalidate_v3(unsigned long slot, unsigned long va,
396 int psize, int ssize, int local)
397{
398 unsigned long want_v;
399 unsigned long lpar_rc;
400 unsigned long pss;
401
402 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
403 slot, va, psize, local);
404 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
405 pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc;
406
407 lpar_rc = beat_invalidate_htab_entry3(0, slot, want_v, pss);
408
409 /* E_busy can be valid output: page may be already replaced */
410 BUG_ON(lpar_rc != 0 && lpar_rc != 0xfffffff7);
411}
412
413static int64_t _beat_lpar_hptab_clear_v3(void)
414{
415 return beat_clear_htab3(0);
416}
417
418static void beat_lpar_hptab_clear_v3(void)
419{
420 _beat_lpar_hptab_clear_v3();
421}
422
423void __init hpte_init_beat_v3(void)
424{
425 if (_beat_lpar_hptab_clear_v3() == 0) {
426 ppc_md.hpte_invalidate = beat_lpar_hpte_invalidate_v3;
427 ppc_md.hpte_updatepp = beat_lpar_hpte_updatepp_v3;
428 ppc_md.hpte_updateboltedpp = beat_lpar_hpte_updateboltedpp;
429 ppc_md.hpte_insert = beat_lpar_hpte_insert_v3;
430 ppc_md.hpte_remove = beat_lpar_hpte_remove;
431 ppc_md.hpte_clear_all = beat_lpar_hptab_clear_v3;
432 } else {
433 ppc_md.hpte_invalidate = beat_lpar_hpte_invalidate;
434 ppc_md.hpte_updatepp = beat_lpar_hpte_updatepp;
435 ppc_md.hpte_updateboltedpp = beat_lpar_hpte_updateboltedpp;
436 ppc_md.hpte_insert = beat_lpar_hpte_insert;
437 ppc_md.hpte_remove = beat_lpar_hpte_remove;
438 ppc_md.hpte_clear_all = beat_lpar_hptab_clear;
439 }
440}
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..1769d755eff3 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;
@@ -101,21 +101,11 @@ static void __init celleb_setup_arch(void)
101 /* init to some ~sane value until calibrate_delay() runs */ 101 /* init to some ~sane value until calibrate_delay() runs */
102 loops_per_jiffy = 50000000; 102 loops_per_jiffy = 50000000;
103 103
104 if (ROOT_DEV == 0) {
105 printk("No ramdisk, default root is /dev/hda2\n");
106 ROOT_DEV = Root_HDA2;
107 }
108
109#ifdef CONFIG_DUMMY_CONSOLE 104#ifdef CONFIG_DUMMY_CONSOLE
110 conswitchp = &dummy_con; 105 conswitchp = &dummy_con;
111#endif 106#endif
112} 107}
113 108
114static void beat_power_save(void)
115{
116 beat_pause(0);
117}
118
119static int __init celleb_probe(void) 109static int __init celleb_probe(void)
120{ 110{
121 unsigned long root = of_get_flat_dt_root(); 111 unsigned long root = of_get_flat_dt_root();
@@ -124,18 +114,11 @@ static int __init celleb_probe(void)
124 return 0; 114 return 0;
125 115
126 powerpc_firmware_features |= FW_FEATURE_CELLEB_POSSIBLE; 116 powerpc_firmware_features |= FW_FEATURE_CELLEB_POSSIBLE;
127 hpte_init_beat(); 117 hpte_init_beat_v3();
128 return 1; 118 return 1;
129} 119}
130 120
131#ifdef CONFIG_KEXEC 121static 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", }, 122 { .type = "scc", },
140 { .type = "ioif", }, /* old style */ 123 { .type = "ioif", }, /* old style */
141 {}, 124 {},
@@ -149,6 +132,8 @@ static int __init celleb_publish_devices(void)
149 /* Publish OF platform devices for southbridge IOs */ 132 /* Publish OF platform devices for southbridge IOs */
150 of_platform_bus_probe(NULL, celleb_bus_ids, NULL); 133 of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
151 134
135 celleb_pci_workaround_init();
136
152 return 0; 137 return 0;
153} 138}
154device_initcall(celleb_publish_devices); 139device_initcall(celleb_publish_devices);
@@ -175,7 +160,7 @@ define_machine(celleb) {
175 .pci_probe_mode = celleb_pci_probe_mode, 160 .pci_probe_mode = celleb_pci_probe_mode,
176 .pci_setup_phb = celleb_setup_phb, 161 .pci_setup_phb = celleb_setup_phb,
177#ifdef CONFIG_KEXEC 162#ifdef CONFIG_KEXEC
178 .kexec_cpu_down = celleb_kexec_cpu_down, 163 .kexec_cpu_down = beat_kexec_cpu_down,
179 .machine_kexec = default_machine_kexec, 164 .machine_kexec = default_machine_kexec,
180 .machine_kexec_prepare = default_machine_kexec_prepare, 165 .machine_kexec_prepare = default_machine_kexec_prepare,
181 .machine_crash_shutdown = default_machine_crash_shutdown, 166 .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..59306261f5b2 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
@@ -291,16 +290,6 @@ void __init chrp_setup_arch(void)
291 ppc_md.set_rtc_time = rtas_set_rtc_time; 290 ppc_md.set_rtc_time = rtas_set_rtc_time;
292 } 291 }
293 292
294#ifdef CONFIG_BLK_DEV_INITRD
295 /* this is fine for chrp */
296 initrd_below_start_ok = 1;
297
298 if (initrd_start)
299 ROOT_DEV = Root_RAM0;
300 else
301#endif
302 ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */
303
304 /* On pegasos, enable the L2 cache if not already done by OF */ 293 /* On pegasos, enable the L2 cache if not already done by OF */
305 pegasos_set_l2cr(); 294 pegasos_set_l2cr();
306 295
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..8924095a7928 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,15 +18,18 @@ 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
25 select WANT_DEVICE_TREE
23 help 26 help
24 Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga) 27 Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
25 platform 28 platform
26 29
27config PPC_HOLLY 30config PPC_HOLLY
28 bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)" 31 bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)"
32 depends on EMBEDDED6xx
29 select TSI108_BRIDGE 33 select TSI108_BRIDGE
30 select PPC_UDBG_16550 34 select PPC_UDBG_16550
31 select WANT_DEVICE_TREE 35 select WANT_DEVICE_TREE
@@ -35,12 +39,12 @@ config PPC_HOLLY
35 39
36config PPC_PRPMC2800 40config PPC_PRPMC2800
37 bool "Motorola-PrPMC2800" 41 bool "Motorola-PrPMC2800"
42 depends on EMBEDDED6xx
38 select MV64X60 43 select MV64X60
39 select NOT_COHERENT_CACHE 44 select NOT_COHERENT_CACHE
40 select WANT_DEVICE_TREE 45 select WANT_DEVICE_TREE
41 help 46 help
42 This option enables support for the Motorola PrPMC2800 board 47 This option enables support for the Motorola PrPMC2800 board
43endchoice
44 48
45config TSI108_BRIDGE 49config TSI108_BRIDGE
46 bool 50 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..eb5d74e26fe9 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",
@@ -91,7 +91,7 @@ static void __init linkstation_setup_arch(void)
91#endif 91#endif
92 92
93 /* Lookup PCI host bridges */ 93 /* Lookup PCI host bridges */
94 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 94 for_each_compatible_node(np, "pci", "mpc10x-pci")
95 linkstation_add_bridge(np); 95 linkstation_add_bridge(np);
96 96
97 printk(KERN_INFO "BUFFALO Network Attached Storage Series\n"); 97 printk(KERN_INFO "BUFFALO Network Attached Storage Series\n");
@@ -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..a2c04b9d42b1 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>
@@ -75,7 +74,7 @@ static void __init mpc7448_hpc2_setup_arch(void)
75 74
76 /* setup PCI host bridge */ 75 /* setup PCI host bridge */
77#ifdef CONFIG_PCI 76#ifdef CONFIG_PCI
78 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 77 for_each_compatible_node(np, "pci", "tsi108-pci")
79 tsi108_setup_pci(np, MPC7448HPC2_PCI_CFG_PHYS, 0); 78 tsi108_setup_pci(np, MPC7448HPC2_PCI_CFG_PHYS, 0);
80 79
81 ppc_md.pci_exclude_device = mpc7448_hpc2_exclude_device; 80 ppc_md.pci_exclude_device = mpc7448_hpc2_exclude_device;
@@ -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..a65f1b44abf8 100644
--- a/arch/powerpc/platforms/iseries/Makefile
+++ b/arch/powerpc/platforms/iseries/Makefile
@@ -2,11 +2,12 @@ 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
8obj-$(CONFIG_SMP) += smp.o 9obj-$(CONFIG_SMP) += smp.o
9obj-$(CONFIG_VIOPATH) += viopath.o 10obj-$(CONFIG_VIOPATH) += viopath.o vio.o
10obj-$(CONFIG_MODULES) += ksyms.o 11obj-$(CONFIG_MODULES) += ksyms.o
11 12
12quiet_cmd_dt_strings = DT_STR $@ 13quiet_cmd_dt_strings = DT_STR $@
diff --git a/arch/powerpc/platforms/iseries/dt.c b/arch/powerpc/platforms/iseries/dt.c
index 9e8a334a518a..4543c4bc3a56 100644
--- a/arch/powerpc/platforms/iseries/dt.c
+++ b/arch/powerpc/platforms/iseries/dt.c
@@ -72,8 +72,6 @@ static char __initdata device_type_cpu[] = "cpu";
72static char __initdata device_type_memory[] = "memory"; 72static char __initdata device_type_memory[] = "memory";
73static char __initdata device_type_serial[] = "serial"; 73static char __initdata device_type_serial[] = "serial";
74static char __initdata device_type_network[] = "network"; 74static char __initdata device_type_network[] = "network";
75static char __initdata device_type_block[] = "block";
76static char __initdata device_type_byte[] = "byte";
77static char __initdata device_type_pci[] = "pci"; 75static char __initdata device_type_pci[] = "pci";
78static char __initdata device_type_vdevice[] = "vdevice"; 76static char __initdata device_type_vdevice[] = "vdevice";
79static char __initdata device_type_vscsi[] = "vscsi"; 77static char __initdata device_type_vscsi[] = "vscsi";
@@ -375,21 +373,6 @@ static void __init dt_vdevices(struct iseries_flat_dt *dt)
375 373
376 dt_end_node(dt); 374 dt_end_node(dt);
377 } 375 }
378 reg += HVMAXARCHITECTEDVIRTUALLANS;
379
380 for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++)
381 dt_do_vdevice(dt, "viodasd", reg, i, device_type_block,
382 "IBM,iSeries-viodasd", 1);
383 reg += HVMAXARCHITECTEDVIRTUALDISKS;
384
385 for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++)
386 dt_do_vdevice(dt, "viocd", reg, i, device_type_block,
387 "IBM,iSeries-viocd", 1);
388 reg += HVMAXARCHITECTEDVIRTUALCDROMS;
389
390 for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++)
391 dt_do_vdevice(dt, "viotape", reg, i, device_type_byte,
392 "IBM,iSeries-viotape", 1);
393 376
394 dt_end_node(dt); 377 dt_end_node(dt);
395} 378}
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/htab.c b/arch/powerpc/platforms/iseries/htab.c
index b4e2c7a038e1..15a7097e5dd7 100644
--- a/arch/powerpc/platforms/iseries/htab.c
+++ b/arch/powerpc/platforms/iseries/htab.c
@@ -86,7 +86,8 @@ long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
86 } 86 }
87 87
88 88
89 lhpte.v = hpte_encode_v(va, MMU_PAGE_4K) | vflags | HPTE_V_VALID; 89 lhpte.v = hpte_encode_v(va, MMU_PAGE_4K, MMU_SEGSIZE_256M) |
90 vflags | HPTE_V_VALID;
90 lhpte.r = hpte_encode_r(phys_to_abs(pa), MMU_PAGE_4K) | rflags; 91 lhpte.r = hpte_encode_r(phys_to_abs(pa), MMU_PAGE_4K) | rflags;
91 92
92 /* Now fill in the actual HPTE */ 93 /* Now fill in the actual HPTE */
@@ -142,7 +143,7 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
142 * bits 61..63 : PP2,PP1,PP0 143 * bits 61..63 : PP2,PP1,PP0
143 */ 144 */
144static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp, 145static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
145 unsigned long va, int psize, int local) 146 unsigned long va, int psize, int ssize, int local)
146{ 147{
147 struct hash_pte hpte; 148 struct hash_pte hpte;
148 unsigned long want_v; 149 unsigned long want_v;
@@ -150,7 +151,7 @@ static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
150 iSeries_hlock(slot); 151 iSeries_hlock(slot);
151 152
152 HvCallHpt_get(&hpte, slot); 153 HvCallHpt_get(&hpte, slot);
153 want_v = hpte_encode_v(va, MMU_PAGE_4K); 154 want_v = hpte_encode_v(va, MMU_PAGE_4K, MMU_SEGSIZE_256M);
154 155
155 if (HPTE_V_COMPARE(hpte.v, want_v) && (hpte.v & HPTE_V_VALID)) { 156 if (HPTE_V_COMPARE(hpte.v, want_v) && (hpte.v & HPTE_V_VALID)) {
156 /* 157 /*
@@ -205,14 +206,14 @@ static long iSeries_hpte_find(unsigned long vpn)
205 * No need to lock here because we should be the only user. 206 * No need to lock here because we should be the only user.
206 */ 207 */
207static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea, 208static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
208 int psize) 209 int psize, int ssize)
209{ 210{
210 unsigned long vsid,va,vpn; 211 unsigned long vsid,va,vpn;
211 long slot; 212 long slot;
212 213
213 BUG_ON(psize != MMU_PAGE_4K); 214 BUG_ON(psize != MMU_PAGE_4K);
214 215
215 vsid = get_kernel_vsid(ea); 216 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M);
216 va = (vsid << 28) | (ea & 0x0fffffff); 217 va = (vsid << 28) | (ea & 0x0fffffff);
217 vpn = va >> HW_PAGE_SHIFT; 218 vpn = va >> HW_PAGE_SHIFT;
218 slot = iSeries_hpte_find(vpn); 219 slot = iSeries_hpte_find(vpn);
@@ -222,7 +223,7 @@ static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
222} 223}
223 224
224static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va, 225static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
225 int psize, int local) 226 int psize, int ssize, int local)
226{ 227{
227 unsigned long hpte_v; 228 unsigned long hpte_v;
228 unsigned long avpn = va >> 23; 229 unsigned long avpn = va >> 23;
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index 3b6a9666c2c0..49e9c664ea89 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -28,14 +28,17 @@
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <linux/list.h> 29#include <linux/list.h>
30#include <linux/pci.h> 30#include <linux/pci.h>
31#include <linux/module.h>
31 32
32#include <asm/iommu.h> 33#include <asm/iommu.h>
34#include <asm/vio.h>
33#include <asm/tce.h> 35#include <asm/tce.h>
34#include <asm/machdep.h> 36#include <asm/machdep.h>
35#include <asm/abs_addr.h> 37#include <asm/abs_addr.h>
36#include <asm/prom.h> 38#include <asm/prom.h>
37#include <asm/pci-bridge.h> 39#include <asm/pci-bridge.h>
38#include <asm/iseries/hv_call_xm.h> 40#include <asm/iseries/hv_call_xm.h>
41#include <asm/iseries/hv_call_event.h>
39#include <asm/iseries/iommu.h> 42#include <asm/iseries/iommu.h>
40 43
41static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages, 44static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
@@ -189,6 +192,55 @@ void iommu_devnode_init_iSeries(struct pci_dev *pdev, struct device_node *dn)
189} 192}
190#endif 193#endif
191 194
195static struct iommu_table veth_iommu_table;
196static struct iommu_table vio_iommu_table;
197
198void *iseries_hv_alloc(size_t size, dma_addr_t *dma_handle, gfp_t flag)
199{
200 return iommu_alloc_coherent(&vio_iommu_table, size, dma_handle,
201 DMA_32BIT_MASK, flag, -1);
202}
203EXPORT_SYMBOL_GPL(iseries_hv_alloc);
204
205void iseries_hv_free(size_t size, void *vaddr, dma_addr_t dma_handle)
206{
207 iommu_free_coherent(&vio_iommu_table, size, vaddr, dma_handle);
208}
209EXPORT_SYMBOL_GPL(iseries_hv_free);
210
211dma_addr_t iseries_hv_map(void *vaddr, size_t size,
212 enum dma_data_direction direction)
213{
214 return iommu_map_single(&vio_iommu_table, vaddr, size,
215 DMA_32BIT_MASK, direction);
216}
217
218void iseries_hv_unmap(dma_addr_t dma_handle, size_t size,
219 enum dma_data_direction direction)
220{
221 iommu_unmap_single(&vio_iommu_table, dma_handle, size, direction);
222}
223
224void __init iommu_vio_init(void)
225{
226 iommu_table_getparms_iSeries(255, 0, 0xff, &veth_iommu_table);
227 veth_iommu_table.it_size /= 2;
228 vio_iommu_table = veth_iommu_table;
229 vio_iommu_table.it_offset += veth_iommu_table.it_size;
230
231 if (!iommu_init_table(&veth_iommu_table, -1))
232 printk("Virtual Bus VETH TCE table failed.\n");
233 if (!iommu_init_table(&vio_iommu_table, -1))
234 printk("Virtual Bus VIO TCE table failed.\n");
235}
236
237struct iommu_table *vio_build_iommu_table_iseries(struct vio_dev *dev)
238{
239 if (strcmp(dev->type, "network") == 0)
240 return &veth_iommu_table;
241 return &vio_iommu_table;
242}
243
192void iommu_init_early_iSeries(void) 244void iommu_init_early_iSeries(void)
193{ 245{
194 ppc_md.tce_build = tce_build_iSeries; 246 ppc_md.tce_build = tce_build_iSeries;
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/mf.c b/arch/powerpc/platforms/iseries/mf.c
index b1187d95e3b2..c0f2433bc16e 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -39,9 +39,9 @@
39#include <asm/paca.h> 39#include <asm/paca.h>
40#include <asm/abs_addr.h> 40#include <asm/abs_addr.h>
41#include <asm/firmware.h> 41#include <asm/firmware.h>
42#include <asm/iseries/vio.h>
43#include <asm/iseries/mf.h> 42#include <asm/iseries/mf.h>
44#include <asm/iseries/hv_lp_config.h> 43#include <asm/iseries/hv_lp_config.h>
44#include <asm/iseries/hv_lp_event.h>
45#include <asm/iseries/it_lp_queue.h> 45#include <asm/iseries/it_lp_queue.h>
46 46
47#include "setup.h" 47#include "setup.h"
@@ -870,8 +870,7 @@ static int proc_mf_dump_cmdline(char *page, char **start, off_t off,
870 if ((off + count) > 256) 870 if ((off + count) > 256)
871 count = 256 - off; 871 count = 256 - off;
872 872
873 dma_addr = dma_map_single(iSeries_vio_dev, page, off + count, 873 dma_addr = iseries_hv_map(page, off + count, DMA_FROM_DEVICE);
874 DMA_FROM_DEVICE);
875 if (dma_mapping_error(dma_addr)) 874 if (dma_mapping_error(dma_addr))
876 return -ENOMEM; 875 return -ENOMEM;
877 memset(page, 0, off + count); 876 memset(page, 0, off + count);
@@ -883,8 +882,7 @@ static int proc_mf_dump_cmdline(char *page, char **start, off_t off,
883 vsp_cmd.sub_data.kern.length = off + count; 882 vsp_cmd.sub_data.kern.length = off + count;
884 mb(); 883 mb();
885 rc = signal_vsp_instruction(&vsp_cmd); 884 rc = signal_vsp_instruction(&vsp_cmd);
886 dma_unmap_single(iSeries_vio_dev, dma_addr, off + count, 885 iseries_hv_unmap(dma_addr, off + count, DMA_FROM_DEVICE);
887 DMA_FROM_DEVICE);
888 if (rc) 886 if (rc)
889 return rc; 887 return rc;
890 if (vsp_cmd.result_code != 0) 888 if (vsp_cmd.result_code != 0)
@@ -919,8 +917,7 @@ static int mf_getVmlinuxChunk(char *buffer, int *size, int offset, u64 side)
919 int len = *size; 917 int len = *size;
920 dma_addr_t dma_addr; 918 dma_addr_t dma_addr;
921 919
922 dma_addr = dma_map_single(iSeries_vio_dev, buffer, len, 920 dma_addr = iseries_hv_map(buffer, len, DMA_FROM_DEVICE);
923 DMA_FROM_DEVICE);
924 memset(buffer, 0, len); 921 memset(buffer, 0, len);
925 memset(&vsp_cmd, 0, sizeof(vsp_cmd)); 922 memset(&vsp_cmd, 0, sizeof(vsp_cmd));
926 vsp_cmd.cmd = 32; 923 vsp_cmd.cmd = 32;
@@ -938,7 +935,7 @@ static int mf_getVmlinuxChunk(char *buffer, int *size, int offset, u64 side)
938 rc = -ENOMEM; 935 rc = -ENOMEM;
939 } 936 }
940 937
941 dma_unmap_single(iSeries_vio_dev, dma_addr, len, DMA_FROM_DEVICE); 938 iseries_hv_unmap(dma_addr, len, DMA_FROM_DEVICE);
942 939
943 return rc; 940 return rc;
944} 941}
@@ -1149,8 +1146,7 @@ static int proc_mf_change_cmdline(struct file *file, const char __user *buffer,
1149 goto out; 1146 goto out;
1150 1147
1151 dma_addr = 0; 1148 dma_addr = 0;
1152 page = dma_alloc_coherent(iSeries_vio_dev, count, &dma_addr, 1149 page = iseries_hv_alloc(count, &dma_addr, GFP_ATOMIC);
1153 GFP_ATOMIC);
1154 ret = -ENOMEM; 1150 ret = -ENOMEM;
1155 if (page == NULL) 1151 if (page == NULL)
1156 goto out; 1152 goto out;
@@ -1170,7 +1166,7 @@ static int proc_mf_change_cmdline(struct file *file, const char __user *buffer,
1170 ret = count; 1166 ret = count;
1171 1167
1172out_free: 1168out_free:
1173 dma_free_coherent(iSeries_vio_dev, count, page, dma_addr); 1169 iseries_hv_free(count, page, dma_addr);
1174out: 1170out:
1175 return ret; 1171 return ret;
1176} 1172}
@@ -1190,8 +1186,7 @@ static ssize_t proc_mf_change_vmlinux(struct file *file,
1190 goto out; 1186 goto out;
1191 1187
1192 dma_addr = 0; 1188 dma_addr = 0;
1193 page = dma_alloc_coherent(iSeries_vio_dev, count, &dma_addr, 1189 page = iseries_hv_alloc(count, &dma_addr, GFP_ATOMIC);
1194 GFP_ATOMIC);
1195 rc = -ENOMEM; 1190 rc = -ENOMEM;
1196 if (page == NULL) { 1191 if (page == NULL) {
1197 printk(KERN_ERR "mf.c: couldn't allocate memory to set vmlinux chunk\n"); 1192 printk(KERN_ERR "mf.c: couldn't allocate memory to set vmlinux chunk\n");
@@ -1219,7 +1214,7 @@ static ssize_t proc_mf_change_vmlinux(struct file *file,
1219 *ppos += count; 1214 *ppos += count;
1220 rc = count; 1215 rc = count;
1221out_free: 1216out_free:
1222 dma_free_coherent(iSeries_vio_dev, count, page, dma_addr); 1217 iseries_hv_free(count, page, dma_addr);
1223out: 1218out:
1224 return rc; 1219 return rc;
1225} 1220}
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 13a8b1908ded..37ae07ee54a9 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -26,6 +26,8 @@
26#include <linux/major.h> 26#include <linux/major.h>
27#include <linux/root_dev.h> 27#include <linux/root_dev.h>
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/hrtimer.h>
30#include <linux/tick.h>
29 31
30#include <asm/processor.h> 32#include <asm/processor.h>
31#include <asm/machdep.h> 33#include <asm/machdep.h>
@@ -41,7 +43,6 @@
41#include <asm/time.h> 43#include <asm/time.h>
42#include <asm/paca.h> 44#include <asm/paca.h>
43#include <asm/cache.h> 45#include <asm/cache.h>
44#include <asm/sections.h>
45#include <asm/abs_addr.h> 46#include <asm/abs_addr.h>
46#include <asm/iseries/hv_lp_config.h> 47#include <asm/iseries/hv_lp_config.h>
47#include <asm/iseries/hv_call_event.h> 48#include <asm/iseries/hv_call_event.h>
@@ -562,6 +563,7 @@ static void yield_shared_processor(void)
562static void iseries_shared_idle(void) 563static void iseries_shared_idle(void)
563{ 564{
564 while (1) { 565 while (1) {
566 tick_nohz_stop_sched_tick();
565 while (!need_resched() && !hvlpevent_is_pending()) { 567 while (!need_resched() && !hvlpevent_is_pending()) {
566 local_irq_disable(); 568 local_irq_disable();
567 ppc64_runlatch_off(); 569 ppc64_runlatch_off();
@@ -575,6 +577,7 @@ static void iseries_shared_idle(void)
575 } 577 }
576 578
577 ppc64_runlatch_on(); 579 ppc64_runlatch_on();
580 tick_nohz_restart_sched_tick();
578 581
579 if (hvlpevent_is_pending()) 582 if (hvlpevent_is_pending())
580 process_iSeries_events(); 583 process_iSeries_events();
@@ -590,6 +593,7 @@ static void iseries_dedicated_idle(void)
590 set_thread_flag(TIF_POLLING_NRFLAG); 593 set_thread_flag(TIF_POLLING_NRFLAG);
591 594
592 while (1) { 595 while (1) {
596 tick_nohz_stop_sched_tick();
593 if (!need_resched()) { 597 if (!need_resched()) {
594 while (!need_resched()) { 598 while (!need_resched()) {
595 ppc64_runlatch_off(); 599 ppc64_runlatch_off();
@@ -606,6 +610,7 @@ static void iseries_dedicated_idle(void)
606 } 610 }
607 611
608 ppc64_runlatch_on(); 612 ppc64_runlatch_on();
613 tick_nohz_restart_sched_tick();
609 preempt_enable_no_resched(); 614 preempt_enable_no_resched();
610 schedule(); 615 schedule();
611 preempt_disable(); 616 preempt_disable();
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
new file mode 100644
index 000000000000..910b00b4703e
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/vio.c
@@ -0,0 +1,553 @@
1/*
2 * Legacy iSeries specific vio initialisation
3 * that needs to be built in (not a module).
4 *
5 * © Copyright 2007 IBM Corporation
6 * Author: Stephen Rothwell
7 * Some parts collected from various other files
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#include <linux/of.h>
24#include <linux/init.h>
25#include <linux/gfp.h>
26#include <linux/completion.h>
27#include <linux/proc_fs.h>
28#include <linux/module.h>
29
30#include <asm/firmware.h>
31#include <asm/vio.h>
32#include <asm/iseries/vio.h>
33#include <asm/iseries/iommu.h>
34#include <asm/iseries/hv_types.h>
35#include <asm/iseries/hv_lp_event.h>
36
37#define FIRST_VTY 0
38#define NUM_VTYS 1
39#define FIRST_VSCSI (FIRST_VTY + NUM_VTYS)
40#define NUM_VSCSIS 1
41#define FIRST_VLAN (FIRST_VSCSI + NUM_VSCSIS)
42#define NUM_VLANS HVMAXARCHITECTEDVIRTUALLANS
43#define FIRST_VIODASD (FIRST_VLAN + NUM_VLANS)
44#define NUM_VIODASDS HVMAXARCHITECTEDVIRTUALDISKS
45#define FIRST_VIOCD (FIRST_VIODASD + NUM_VIODASDS)
46#define NUM_VIOCDS HVMAXARCHITECTEDVIRTUALCDROMS
47#define FIRST_VIOTAPE (FIRST_VIOCD + NUM_VIOCDS)
48#define NUM_VIOTAPES HVMAXARCHITECTEDVIRTUALTAPES
49
50struct vio_waitevent {
51 struct completion com;
52 int rc;
53 u16 sub_result;
54};
55
56struct vio_resource {
57 char rsrcname[10];
58 char type[4];
59 char model[3];
60};
61
62static struct property *new_property(const char *name, int length,
63 const void *value)
64{
65 struct property *np = kzalloc(sizeof(*np) + strlen(name) + 1 + length,
66 GFP_KERNEL);
67
68 if (!np)
69 return NULL;
70 np->name = (char *)(np + 1);
71 np->value = np->name + strlen(name) + 1;
72 strcpy(np->name, name);
73 memcpy(np->value, value, length);
74 np->length = length;
75 return np;
76}
77
78static void __init free_property(struct property *np)
79{
80 kfree(np);
81}
82
83static struct device_node *new_node(const char *path,
84 struct device_node *parent)
85{
86 struct device_node *np = kzalloc(sizeof(*np), GFP_KERNEL);
87
88 if (!np)
89 return NULL;
90 np->full_name = kmalloc(strlen(path) + 1, GFP_KERNEL);
91 if (!np->full_name) {
92 kfree(np);
93 return NULL;
94 }
95 strcpy(np->full_name, path);
96 of_node_set_flag(np, OF_DYNAMIC);
97 kref_init(&np->kref);
98 np->parent = of_node_get(parent);
99 return np;
100}
101
102static void free_node(struct device_node *np)
103{
104 struct property *next;
105 struct property *prop;
106
107 next = np->properties;
108 while (next) {
109 prop = next;
110 next = prop->next;
111 free_property(prop);
112 }
113 of_node_put(np->parent);
114 kfree(np->full_name);
115 kfree(np);
116}
117
118static int add_string_property(struct device_node *np, const char *name,
119 const char *value)
120{
121 struct property *nprop = new_property(name, strlen(value) + 1, value);
122
123 if (!nprop)
124 return 0;
125 prom_add_property(np, nprop);
126 return 1;
127}
128
129static int add_raw_property(struct device_node *np, const char *name,
130 int length, const void *value)
131{
132 struct property *nprop = new_property(name, length, value);
133
134 if (!nprop)
135 return 0;
136 prom_add_property(np, nprop);
137 return 1;
138}
139
140static struct device_node *do_device_node(struct device_node *parent,
141 const char *name, u32 reg, u32 unit, const char *type,
142 const char *compat, struct vio_resource *res)
143{
144 struct device_node *np;
145 char path[32];
146
147 snprintf(path, sizeof(path), "/vdevice/%s@%08x", name, reg);
148 np = new_node(path, parent);
149 if (!np)
150 return NULL;
151 if (!add_string_property(np, "name", name) ||
152 !add_string_property(np, "device_type", type) ||
153 !add_string_property(np, "compatible", compat) ||
154 !add_raw_property(np, "reg", sizeof(reg), &reg) ||
155 !add_raw_property(np, "linux,unit_address",
156 sizeof(unit), &unit)) {
157 goto node_free;
158 }
159 if (res) {
160 if (!add_raw_property(np, "linux,vio_rsrcname",
161 sizeof(res->rsrcname), res->rsrcname) ||
162 !add_raw_property(np, "linux,vio_type",
163 sizeof(res->type), res->type) ||
164 !add_raw_property(np, "linux,vio_model",
165 sizeof(res->model), res->model))
166 goto node_free;
167 }
168 np->name = of_get_property(np, "name", NULL);
169 np->type = of_get_property(np, "device_type", NULL);
170 of_attach_node(np);
171#ifdef CONFIG_PROC_DEVICETREE
172 if (parent->pde) {
173 struct proc_dir_entry *ent;
174
175 ent = proc_mkdir(strrchr(np->full_name, '/') + 1, parent->pde);
176 if (ent)
177 proc_device_tree_add_node(np, ent);
178 }
179#endif
180 return np;
181
182 node_free:
183 free_node(np);
184 return NULL;
185}
186
187/*
188 * This is here so that we can dynamically add viodasd
189 * devices without exposing all the above infrastructure.
190 */
191struct vio_dev *vio_create_viodasd(u32 unit)
192{
193 struct device_node *vio_root;
194 struct device_node *np;
195 struct vio_dev *vdev = NULL;
196
197 vio_root = of_find_node_by_path("/vdevice");
198 if (!vio_root)
199 return NULL;
200 np = do_device_node(vio_root, "viodasd", FIRST_VIODASD + unit, unit,
201 "block", "IBM,iSeries-viodasd", NULL);
202 of_node_put(vio_root);
203 if (np) {
204 vdev = vio_register_device_node(np);
205 if (!vdev)
206 free_node(np);
207 }
208 return vdev;
209}
210EXPORT_SYMBOL_GPL(vio_create_viodasd);
211
212static void __init handle_block_event(struct HvLpEvent *event)
213{
214 struct vioblocklpevent *bevent = (struct vioblocklpevent *)event;
215 struct vio_waitevent *pwe;
216
217 if (event == NULL)
218 /* Notification that a partition went away! */
219 return;
220 /* First, we should NEVER get an int here...only acks */
221 if (hvlpevent_is_int(event)) {
222 printk(KERN_WARNING "handle_viod_request: "
223 "Yikes! got an int in viodasd event handler!\n");
224 if (hvlpevent_need_ack(event)) {
225 event->xRc = HvLpEvent_Rc_InvalidSubtype;
226 HvCallEvent_ackLpEvent(event);
227 }
228 return;
229 }
230
231 switch (event->xSubtype & VIOMINOR_SUBTYPE_MASK) {
232 case vioblockopen:
233 /*
234 * Handle a response to an open request. We get all the
235 * disk information in the response, so update it. The
236 * correlation token contains a pointer to a waitevent
237 * structure that has a completion in it. update the
238 * return code in the waitevent structure and post the
239 * completion to wake up the guy who sent the request
240 */
241 pwe = (struct vio_waitevent *)event->xCorrelationToken;
242 pwe->rc = event->xRc;
243 pwe->sub_result = bevent->sub_result;
244 complete(&pwe->com);
245 break;
246 case vioblockclose:
247 break;
248 default:
249 printk(KERN_WARNING "handle_viod_request: unexpected subtype!");
250 if (hvlpevent_need_ack(event)) {
251 event->xRc = HvLpEvent_Rc_InvalidSubtype;
252 HvCallEvent_ackLpEvent(event);
253 }
254 }
255}
256
257static void __init probe_disk(struct device_node *vio_root, u32 unit)
258{
259 HvLpEvent_Rc hvrc;
260 struct vio_waitevent we;
261 u16 flags = 0;
262
263retry:
264 init_completion(&we.com);
265
266 /* Send the open event to OS/400 */
267 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
268 HvLpEvent_Type_VirtualIo,
269 viomajorsubtype_blockio | vioblockopen,
270 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
271 viopath_sourceinst(viopath_hostLp),
272 viopath_targetinst(viopath_hostLp),
273 (u64)(unsigned long)&we, VIOVERSION << 16,
274 ((u64)unit << 48) | ((u64)flags<< 32),
275 0, 0, 0);
276 if (hvrc != 0) {
277 printk(KERN_WARNING "probe_disk: bad rc on HV open %d\n",
278 (int)hvrc);
279 return;
280 }
281
282 wait_for_completion(&we.com);
283
284 if (we.rc != 0) {
285 if (flags != 0)
286 return;
287 /* try again with read only flag set */
288 flags = vioblockflags_ro;
289 goto retry;
290 }
291
292 /* Send the close event to OS/400. We DON'T expect a response */
293 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
294 HvLpEvent_Type_VirtualIo,
295 viomajorsubtype_blockio | vioblockclose,
296 HvLpEvent_AckInd_NoAck, HvLpEvent_AckType_ImmediateAck,
297 viopath_sourceinst(viopath_hostLp),
298 viopath_targetinst(viopath_hostLp),
299 0, VIOVERSION << 16,
300 ((u64)unit << 48) | ((u64)flags << 32),
301 0, 0, 0);
302 if (hvrc != 0) {
303 printk(KERN_WARNING "probe_disk: "
304 "bad rc sending event to OS/400 %d\n", (int)hvrc);
305 return;
306 }
307
308 do_device_node(vio_root, "viodasd", FIRST_VIODASD + unit, unit,
309 "block", "IBM,iSeries-viodasd", NULL);
310}
311
312static void __init get_viodasd_info(struct device_node *vio_root)
313{
314 int rc;
315 u32 unit;
316
317 rc = viopath_open(viopath_hostLp, viomajorsubtype_blockio, 2);
318 if (rc) {
319 printk(KERN_WARNING "get_viodasd_info: "
320 "error opening path to host partition %d\n",
321 viopath_hostLp);
322 return;
323 }
324
325 /* Initialize our request handler */
326 vio_setHandler(viomajorsubtype_blockio, handle_block_event);
327
328 for (unit = 0; unit < HVMAXARCHITECTEDVIRTUALDISKS; unit++)
329 probe_disk(vio_root, unit);
330
331 vio_clearHandler(viomajorsubtype_blockio);
332 viopath_close(viopath_hostLp, viomajorsubtype_blockio, 2);
333}
334
335static void __init handle_cd_event(struct HvLpEvent *event)
336{
337 struct viocdlpevent *bevent;
338 struct vio_waitevent *pwe;
339
340 if (!event)
341 /* Notification that a partition went away! */
342 return;
343
344 /* First, we should NEVER get an int here...only acks */
345 if (hvlpevent_is_int(event)) {
346 printk(KERN_WARNING "handle_cd_event: got an unexpected int\n");
347 if (hvlpevent_need_ack(event)) {
348 event->xRc = HvLpEvent_Rc_InvalidSubtype;
349 HvCallEvent_ackLpEvent(event);
350 }
351 return;
352 }
353
354 bevent = (struct viocdlpevent *)event;
355
356 switch (event->xSubtype & VIOMINOR_SUBTYPE_MASK) {
357 case viocdgetinfo:
358 pwe = (struct vio_waitevent *)event->xCorrelationToken;
359 pwe->rc = event->xRc;
360 pwe->sub_result = bevent->sub_result;
361 complete(&pwe->com);
362 break;
363
364 default:
365 printk(KERN_WARNING "handle_cd_event: "
366 "message with unexpected subtype %0x04X!\n",
367 event->xSubtype & VIOMINOR_SUBTYPE_MASK);
368 if (hvlpevent_need_ack(event)) {
369 event->xRc = HvLpEvent_Rc_InvalidSubtype;
370 HvCallEvent_ackLpEvent(event);
371 }
372 }
373}
374
375static void __init get_viocd_info(struct device_node *vio_root)
376{
377 HvLpEvent_Rc hvrc;
378 u32 unit;
379 struct vio_waitevent we;
380 struct vio_resource *unitinfo;
381 dma_addr_t unitinfo_dmaaddr;
382 int ret;
383
384 ret = viopath_open(viopath_hostLp, viomajorsubtype_cdio, 2);
385 if (ret) {
386 printk(KERN_WARNING
387 "get_viocd_info: error opening path to host partition %d\n",
388 viopath_hostLp);
389 return;
390 }
391
392 /* Initialize our request handler */
393 vio_setHandler(viomajorsubtype_cdio, handle_cd_event);
394
395 unitinfo = iseries_hv_alloc(
396 sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS,
397 &unitinfo_dmaaddr, GFP_ATOMIC);
398 if (!unitinfo) {
399 printk(KERN_WARNING
400 "get_viocd_info: error allocating unitinfo\n");
401 goto clear_handler;
402 }
403
404 memset(unitinfo, 0, sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS);
405
406 init_completion(&we.com);
407
408 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
409 HvLpEvent_Type_VirtualIo,
410 viomajorsubtype_cdio | viocdgetinfo,
411 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
412 viopath_sourceinst(viopath_hostLp),
413 viopath_targetinst(viopath_hostLp),
414 (u64)&we, VIOVERSION << 16, unitinfo_dmaaddr, 0,
415 sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS, 0);
416 if (hvrc != HvLpEvent_Rc_Good) {
417 printk(KERN_WARNING
418 "get_viocd_info: cdrom error sending event. rc %d\n",
419 (int)hvrc);
420 goto hv_free;
421 }
422
423 wait_for_completion(&we.com);
424
425 if (we.rc) {
426 printk(KERN_WARNING "get_viocd_info: bad rc %d:0x%04X\n",
427 we.rc, we.sub_result);
428 goto hv_free;
429 }
430
431 for (unit = 0; (unit < HVMAXARCHITECTEDVIRTUALCDROMS) &&
432 unitinfo[unit].rsrcname[0]; unit++) {
433 if (!do_device_node(vio_root, "viocd", FIRST_VIOCD + unit, unit,
434 "block", "IBM,iSeries-viocd", &unitinfo[unit]))
435 break;
436 }
437
438 hv_free:
439 iseries_hv_free(sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS,
440 unitinfo, unitinfo_dmaaddr);
441 clear_handler:
442 vio_clearHandler(viomajorsubtype_cdio);
443 viopath_close(viopath_hostLp, viomajorsubtype_cdio, 2);
444}
445
446/* Handle interrupt events for tape */
447static void __init handle_tape_event(struct HvLpEvent *event)
448{
449 struct vio_waitevent *we;
450 struct viotapelpevent *tevent = (struct viotapelpevent *)event;
451
452 if (event == NULL)
453 /* Notification that a partition went away! */
454 return;
455
456 we = (struct vio_waitevent *)event->xCorrelationToken;
457 switch (event->xSubtype & VIOMINOR_SUBTYPE_MASK) {
458 case viotapegetinfo:
459 we->rc = tevent->sub_type_result;
460 complete(&we->com);
461 break;
462 default:
463 printk(KERN_WARNING "handle_tape_event: weird ack\n");
464 }
465}
466
467static void __init get_viotape_info(struct device_node *vio_root)
468{
469 HvLpEvent_Rc hvrc;
470 u32 unit;
471 struct vio_resource *unitinfo;
472 dma_addr_t unitinfo_dmaaddr;
473 size_t len = sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALTAPES;
474 struct vio_waitevent we;
475 int ret;
476
477 ret = viopath_open(viopath_hostLp, viomajorsubtype_tape, 2);
478 if (ret) {
479 printk(KERN_WARNING "get_viotape_info: "
480 "error on viopath_open to hostlp %d\n", ret);
481 return;
482 }
483
484 vio_setHandler(viomajorsubtype_tape, handle_tape_event);
485
486 unitinfo = iseries_hv_alloc(len, &unitinfo_dmaaddr, GFP_ATOMIC);
487 if (!unitinfo)
488 goto clear_handler;
489
490 memset(unitinfo, 0, len);
491
492 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
493 HvLpEvent_Type_VirtualIo,
494 viomajorsubtype_tape | viotapegetinfo,
495 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
496 viopath_sourceinst(viopath_hostLp),
497 viopath_targetinst(viopath_hostLp),
498 (u64)(unsigned long)&we, VIOVERSION << 16,
499 unitinfo_dmaaddr, len, 0, 0);
500 if (hvrc != HvLpEvent_Rc_Good) {
501 printk(KERN_WARNING "get_viotape_info: hv error on op %d\n",
502 (int)hvrc);
503 goto hv_free;
504 }
505
506 wait_for_completion(&we.com);
507
508 for (unit = 0; (unit < HVMAXARCHITECTEDVIRTUALTAPES) &&
509 unitinfo[unit].rsrcname[0]; unit++) {
510 if (!do_device_node(vio_root, "viotape", FIRST_VIOTAPE + unit,
511 unit, "byte", "IBM,iSeries-viotape",
512 &unitinfo[unit]))
513 break;
514 }
515
516 hv_free:
517 iseries_hv_free(len, unitinfo, unitinfo_dmaaddr);
518 clear_handler:
519 vio_clearHandler(viomajorsubtype_tape);
520 viopath_close(viopath_hostLp, viomajorsubtype_tape, 2);
521}
522
523static int __init iseries_vio_init(void)
524{
525 struct device_node *vio_root;
526
527 if (!firmware_has_feature(FW_FEATURE_ISERIES))
528 return -ENODEV;
529
530 iommu_vio_init();
531
532 vio_root = of_find_node_by_path("/vdevice");
533 if (!vio_root)
534 return -ENODEV;
535
536 if (viopath_hostLp == HvLpIndexInvalid) {
537 vio_set_hostlp();
538 /* If we don't have a host, bail out */
539 if (viopath_hostLp == HvLpIndexInvalid)
540 goto put_node;
541 }
542
543 get_viodasd_info(vio_root);
544 get_viocd_info(vio_root);
545 get_viotape_info(vio_root);
546
547 return 0;
548
549 put_node:
550 of_node_put(vio_root);
551 return -ENODEV;
552}
553arch_initcall(iseries_vio_init);
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 6a0060a5f2ec..df23331eb25c 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -124,8 +124,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
124 if (!buf) 124 if (!buf)
125 return 0; 125 return 0;
126 126
127 handle = dma_map_single(iSeries_vio_dev, buf, HW_PAGE_SIZE, 127 handle = iseries_hv_map(buf, HW_PAGE_SIZE, DMA_FROM_DEVICE);
128 DMA_FROM_DEVICE);
129 128
130 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp, 129 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
131 HvLpEvent_Type_VirtualIo, 130 HvLpEvent_Type_VirtualIo,
@@ -146,8 +145,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
146 buf[HW_PAGE_SIZE-1] = '\0'; 145 buf[HW_PAGE_SIZE-1] = '\0';
147 seq_printf(m, "%s", buf); 146 seq_printf(m, "%s", buf);
148 147
149 dma_unmap_single(iSeries_vio_dev, handle, HW_PAGE_SIZE, 148 iseries_hv_unmap(handle, HW_PAGE_SIZE, DMA_FROM_DEVICE);
150 DMA_FROM_DEVICE);
151 kfree(buf); 149 kfree(buf);
152 150
153 seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap); 151 seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap);
@@ -596,7 +594,7 @@ int viopath_close(HvLpIndex remoteLp, int subtype, int numReq)
596 numOpen += viopathStatus[remoteLp].users[i]; 594 numOpen += viopathStatus[remoteLp].users[i];
597 595
598 if ((viopathStatus[remoteLp].isOpen) && (numOpen == 0)) { 596 if ((viopathStatus[remoteLp].isOpen) && (numOpen == 0)) {
599 printk(VIOPATH_KERN_INFO "closing connection to partition %d", 597 printk(VIOPATH_KERN_INFO "closing connection to partition %d\n",
600 remoteLp); 598 remoteLp);
601 599
602 HvCallEvent_closeLpEventPath(remoteLp, 600 HvCallEvent_closeLpEventPath(remoteLp,
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 e95261ef6f98..735e1536cbfc 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/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c
index c91a33593bb8..dae9f658122e 100644
--- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
+++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
@@ -320,10 +320,12 @@ static struct of_device_id gpio_mdio_match[] =
320 320
321static struct of_platform_driver gpio_mdio_driver = 321static struct of_platform_driver gpio_mdio_driver =
322{ 322{
323 .name = "gpio-mdio-bitbang",
324 .match_table = gpio_mdio_match, 323 .match_table = gpio_mdio_match,
325 .probe = gpio_mdio_probe, 324 .probe = gpio_mdio_probe,
326 .remove = gpio_mdio_remove, 325 .remove = gpio_mdio_remove,
326 .driver = {
327 .name = "gpio-mdio-bitbang",
328 },
327}; 329};
328 330
329int gpio_mdio_init(void) 331int gpio_mdio_init(void)
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 a1111b5c6cb4..9916a0f3e431 100644
--- a/arch/powerpc/platforms/pasemi/iommu.c
+++ b/arch/powerpc/platforms/pasemi/iommu.c
@@ -192,7 +192,7 @@ static void pci_dma_dev_setup_pasemi(struct pci_dev *dev)
192static void pci_dma_bus_setup_null(struct pci_bus *b) { } 192static void pci_dma_bus_setup_null(struct pci_bus *b) { }
193static void pci_dma_dev_setup_null(struct pci_dev *d) { } 193static void pci_dma_dev_setup_null(struct pci_dev *d) { }
194 194
195int iob_init(struct device_node *dn) 195int __init iob_init(struct device_node *dn)
196{ 196{
197 unsigned long tmp; 197 unsigned long tmp;
198 u32 regword; 198 u32 regword;
@@ -238,7 +238,7 @@ int iob_init(struct device_node *dn)
238 238
239 239
240/* These are called very early. */ 240/* These are called very early. */
241void iommu_init_early_pasemi(void) 241void __init iommu_init_early_pasemi(void)
242{ 242{
243 int iommu_off; 243 int iommu_off;
244 244
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/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 7ccb9236e8b4..02c533096627 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -387,69 +387,13 @@ static void __init pmac_setup_arch(void)
387#endif /* CONFIG_ADB */ 387#endif /* CONFIG_ADB */
388} 388}
389 389
390char *bootpath;
391char *bootdevice;
392void *boot_host;
393int boot_target;
394int boot_part;
395static dev_t boot_dev;
396
397#ifdef CONFIG_SCSI 390#ifdef CONFIG_SCSI
398void note_scsi_host(struct device_node *node, void *host) 391void note_scsi_host(struct device_node *node, void *host)
399{ 392{
400 int l;
401 char *p;
402
403 l = strlen(node->full_name);
404 if (bootpath != NULL && bootdevice != NULL
405 && strncmp(node->full_name, bootdevice, l) == 0
406 && (bootdevice[l] == '/' || bootdevice[l] == 0)) {
407 boot_host = host;
408 /*
409 * There's a bug in OF 1.0.5. (Why am I not surprised.)
410 * If you pass a path like scsi/sd@1:0 to canon, it returns
411 * something like /bandit@F2000000/gc@10/53c94@10000/sd@0,0
412 * That is, the scsi target number doesn't get preserved.
413 * So we pick the target number out of bootpath and use that.
414 */
415 p = strstr(bootpath, "/sd@");
416 if (p != NULL) {
417 p += 4;
418 boot_target = simple_strtoul(p, NULL, 10);
419 p = strchr(p, ':');
420 if (p != NULL)
421 boot_part = simple_strtoul(p + 1, NULL, 10);
422 }
423 }
424} 393}
425EXPORT_SYMBOL(note_scsi_host); 394EXPORT_SYMBOL(note_scsi_host);
426#endif 395#endif
427 396
428#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
429static dev_t __init find_ide_boot(void)
430{
431 char *p;
432 int n;
433 dev_t __init pmac_find_ide_boot(char *bootdevice, int n);
434
435 if (bootdevice == NULL)
436 return 0;
437 p = strrchr(bootdevice, '/');
438 if (p == NULL)
439 return 0;
440 n = p - bootdevice;
441
442 return pmac_find_ide_boot(bootdevice, n);
443}
444#endif /* CONFIG_BLK_DEV_IDE && CONFIG_BLK_DEV_IDE_PMAC */
445
446static void __init find_boot_device(void)
447{
448#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
449 boot_dev = find_ide_boot();
450#endif
451}
452
453static int initializing = 1; 397static int initializing = 1;
454 398
455static int pmac_late_init(void) 399static int pmac_late_init(void)
@@ -466,10 +410,14 @@ static int pmac_late_init(void)
466 410
467late_initcall(pmac_late_init); 411late_initcall(pmac_late_init);
468 412
469/* can't be __init - can be called whenever a disk is first accessed */ 413/*
470void note_bootable_part(dev_t dev, int part, int goodness) 414 * This is __init_refok because we check for "initializing" before
415 * touching any of the __init sensitive things and "initializing"
416 * will be false after __init time. This can't be __init because it
417 * can be called whenever a disk is first accessed.
418 */
419void __init_refok note_bootable_part(dev_t dev, int part, int goodness)
471{ 420{
472 static int found_boot = 0;
473 char *p; 421 char *p;
474 422
475 if (!initializing) 423 if (!initializing)
@@ -481,15 +429,8 @@ void note_bootable_part(dev_t dev, int part, int goodness)
481 if (p != NULL && (p == boot_command_line || p[-1] == ' ')) 429 if (p != NULL && (p == boot_command_line || p[-1] == ' '))
482 return; 430 return;
483 431
484 if (!found_boot) { 432 ROOT_DEV = dev + part;
485 find_boot_device(); 433 current_root_goodness = goodness;
486 found_boot = 1;
487 }
488 if (!boot_dev || dev == boot_dev) {
489 ROOT_DEV = dev + part;
490 boot_dev = 0;
491 current_root_goodness = goodness;
492 }
493} 434}
494 435
495#ifdef CONFIG_ADB_CUDA 436#ifdef CONFIG_ADB_CUDA
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/htab.c b/arch/powerpc/platforms/ps3/htab.c
index 5d2e176a1b18..7382f195c4f8 100644
--- a/arch/powerpc/platforms/ps3/htab.c
+++ b/arch/powerpc/platforms/ps3/htab.c
@@ -60,7 +60,8 @@ static void _debug_dump_hpte(unsigned long pa, unsigned long va,
60} 60}
61 61
62static long ps3_hpte_insert(unsigned long hpte_group, unsigned long va, 62static long ps3_hpte_insert(unsigned long hpte_group, unsigned long va,
63 unsigned long pa, unsigned long rflags, unsigned long vflags, int psize) 63 unsigned long pa, unsigned long rflags, unsigned long vflags,
64 int psize, int ssize)
64{ 65{
65 unsigned long slot; 66 unsigned long slot;
66 struct hash_pte lhpte; 67 struct hash_pte lhpte;
@@ -72,7 +73,8 @@ static long ps3_hpte_insert(unsigned long hpte_group, unsigned long va,
72 73
73 vflags &= ~HPTE_V_SECONDARY; /* this bit is ignored */ 74 vflags &= ~HPTE_V_SECONDARY; /* this bit is ignored */
74 75
75 lhpte.v = hpte_encode_v(va, psize) | vflags | HPTE_V_VALID; 76 lhpte.v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M) |
77 vflags | HPTE_V_VALID;
76 lhpte.r = hpte_encode_r(ps3_mm_phys_to_lpar(pa), psize) | rflags; 78 lhpte.r = hpte_encode_r(ps3_mm_phys_to_lpar(pa), psize) | rflags;
77 79
78 p_pteg = hpte_group / HPTES_PER_GROUP; 80 p_pteg = hpte_group / HPTES_PER_GROUP;
@@ -167,14 +169,14 @@ static long ps3_hpte_remove(unsigned long hpte_group)
167} 169}
168 170
169static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp, 171static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp,
170 unsigned long va, int psize, int local) 172 unsigned long va, int psize, int ssize, int local)
171{ 173{
172 unsigned long flags; 174 unsigned long flags;
173 unsigned long result; 175 unsigned long result;
174 unsigned long pteg, bit; 176 unsigned long pteg, bit;
175 unsigned long hpte_v, want_v; 177 unsigned long hpte_v, want_v;
176 178
177 want_v = hpte_encode_v(va, psize); 179 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
178 180
179 spin_lock_irqsave(&ps3_bolttab_lock, flags); 181 spin_lock_irqsave(&ps3_bolttab_lock, flags);
180 182
@@ -205,13 +207,13 @@ static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp,
205} 207}
206 208
207static void ps3_hpte_updateboltedpp(unsigned long newpp, unsigned long ea, 209static void ps3_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
208 int psize) 210 int psize, int ssize)
209{ 211{
210 panic("ps3_hpte_updateboltedpp() not implemented"); 212 panic("ps3_hpte_updateboltedpp() not implemented");
211} 213}
212 214
213static void ps3_hpte_invalidate(unsigned long slot, unsigned long va, 215static void ps3_hpte_invalidate(unsigned long slot, unsigned long va,
214 int psize, int local) 216 int psize, int ssize, int local)
215{ 217{
216 unsigned long flags; 218 unsigned long flags;
217 unsigned long result; 219 unsigned long result;
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/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
index b70e474014f0..766685ab26f8 100644
--- a/arch/powerpc/platforms/ps3/os-area.c
+++ b/arch/powerpc/platforms/ps3/os-area.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * PS3 'Other OS' area data. 2 * PS3 flash memory os area.
3 * 3 *
4 * Copyright (C) 2006 Sony Computer Entertainment Inc. 4 * Copyright (C) 2006 Sony Computer Entertainment Inc.
5 * Copyright 2006 Sony Corp. 5 * Copyright 2006 Sony Corp.
@@ -20,6 +20,9 @@
20 20
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/workqueue.h>
24#include <linux/fs.h>
25#include <linux/syscalls.h>
23 26
24#include <asm/lmb.h> 27#include <asm/lmb.h>
25 28
@@ -29,7 +32,7 @@ enum {
29 OS_AREA_SEGMENT_SIZE = 0X200, 32 OS_AREA_SEGMENT_SIZE = 0X200,
30}; 33};
31 34
32enum { 35enum os_area_ldr_format {
33 HEADER_LDR_FORMAT_RAW = 0, 36 HEADER_LDR_FORMAT_RAW = 0,
34 HEADER_LDR_FORMAT_GZIP = 1, 37 HEADER_LDR_FORMAT_GZIP = 1,
35}; 38};
@@ -38,7 +41,7 @@ enum {
38 * struct os_area_header - os area header segment. 41 * struct os_area_header - os area header segment.
39 * @magic_num: Always 'cell_ext_os_area'. 42 * @magic_num: Always 'cell_ext_os_area'.
40 * @hdr_version: Header format version number. 43 * @hdr_version: Header format version number.
41 * @os_area_offset: Starting segment number of os image area. 44 * @db_area_offset: Starting segment number of other os database area.
42 * @ldr_area_offset: Starting segment number of bootloader image area. 45 * @ldr_area_offset: Starting segment number of bootloader image area.
43 * @ldr_format: HEADER_LDR_FORMAT flag. 46 * @ldr_format: HEADER_LDR_FORMAT flag.
44 * @ldr_size: Size of bootloader image in bytes. 47 * @ldr_size: Size of bootloader image in bytes.
@@ -50,9 +53,9 @@ enum {
50 */ 53 */
51 54
52struct os_area_header { 55struct os_area_header {
53 s8 magic_num[16]; 56 u8 magic_num[16];
54 u32 hdr_version; 57 u32 hdr_version;
55 u32 os_area_offset; 58 u32 db_area_offset;
56 u32 ldr_area_offset; 59 u32 ldr_area_offset;
57 u32 _reserved_1; 60 u32 _reserved_1;
58 u32 ldr_format; 61 u32 ldr_format;
@@ -60,12 +63,12 @@ struct os_area_header {
60 u32 _reserved_2[6]; 63 u32 _reserved_2[6];
61}; 64};
62 65
63enum { 66enum os_area_boot_flag {
64 PARAM_BOOT_FLAG_GAME_OS = 0, 67 PARAM_BOOT_FLAG_GAME_OS = 0,
65 PARAM_BOOT_FLAG_OTHER_OS = 1, 68 PARAM_BOOT_FLAG_OTHER_OS = 1,
66}; 69};
67 70
68enum { 71enum os_area_ctrl_button {
69 PARAM_CTRL_BUTTON_O_IS_YES = 0, 72 PARAM_CTRL_BUTTON_O_IS_YES = 0,
70 PARAM_CTRL_BUTTON_X_IS_YES = 1, 73 PARAM_CTRL_BUTTON_X_IS_YES = 1,
71}; 74};
@@ -84,6 +87,9 @@ enum {
84 * @dns_primary: User preference of static primary dns server. 87 * @dns_primary: User preference of static primary dns server.
85 * @dns_secondary: User preference of static secondary dns server. 88 * @dns_secondary: User preference of static secondary dns server.
86 * 89 *
90 * The ps3 rtc maintains a read-only value that approximates seconds since
91 * 2000-01-01 00:00:00 UTC.
92 *
87 * User preference of zero for static_ip_addr means use dhcp. 93 * User preference of zero for static_ip_addr means use dhcp.
88 */ 94 */
89 95
@@ -108,45 +114,172 @@ struct os_area_params {
108 u8 _reserved_5[8]; 114 u8 _reserved_5[8];
109}; 115};
110 116
117enum {
118 OS_AREA_DB_MAGIC_NUM = 0x2d64622dU,
119};
120
111/** 121/**
112 * struct saved_params - Static working copies of data from the 'Other OS' area. 122 * struct os_area_db - Shared flash memory database.
123 * @magic_num: Always '-db-' = 0x2d64622d.
124 * @version: os_area_db format version number.
125 * @index_64: byte offset of the database id index for 64 bit variables.
126 * @count_64: number of usable 64 bit index entries
127 * @index_32: byte offset of the database id index for 32 bit variables.
128 * @count_32: number of usable 32 bit index entries
129 * @index_16: byte offset of the database id index for 16 bit variables.
130 * @count_16: number of usable 16 bit index entries
113 * 131 *
114 * For the convinience of the guest, the HV makes a copy of the 'Other OS' area 132 * Flash rom storage for exclusive use by guests running in the other os lpar.
115 * in flash to a high address in the boot memory region and then puts that RAM 133 * The current system configuration allocates 1K (two segments) for other os
116 * address and the byte count into the repository for retreval by the guest. 134 * use.
117 * We copy the data we want into a static variable and allow the memory setup 135 */
118 * by the HV to be claimed by the lmb manager. 136
137struct os_area_db {
138 u32 magic_num;
139 u16 version;
140 u16 _reserved_1;
141 u16 index_64;
142 u16 count_64;
143 u16 index_32;
144 u16 count_32;
145 u16 index_16;
146 u16 count_16;
147 u32 _reserved_2;
148 u8 _db_data[1000];
149};
150
151/**
152 * enum os_area_db_owner - Data owners.
153 */
154
155enum os_area_db_owner {
156 OS_AREA_DB_OWNER_ANY = -1,
157 OS_AREA_DB_OWNER_NONE = 0,
158 OS_AREA_DB_OWNER_PROTOTYPE = 1,
159 OS_AREA_DB_OWNER_LINUX = 2,
160 OS_AREA_DB_OWNER_PETITBOOT = 3,
161 OS_AREA_DB_OWNER_MAX = 32,
162};
163
164enum os_area_db_key {
165 OS_AREA_DB_KEY_ANY = -1,
166 OS_AREA_DB_KEY_NONE = 0,
167 OS_AREA_DB_KEY_RTC_DIFF = 1,
168 OS_AREA_DB_KEY_VIDEO_MODE = 2,
169 OS_AREA_DB_KEY_MAX = 8,
170};
171
172struct os_area_db_id {
173 int owner;
174 int key;
175};
176
177static const struct os_area_db_id os_area_db_id_empty = {
178 .owner = OS_AREA_DB_OWNER_NONE,
179 .key = OS_AREA_DB_KEY_NONE
180};
181
182static const struct os_area_db_id os_area_db_id_any = {
183 .owner = OS_AREA_DB_OWNER_ANY,
184 .key = OS_AREA_DB_KEY_ANY
185};
186
187static const struct os_area_db_id os_area_db_id_rtc_diff = {
188 .owner = OS_AREA_DB_OWNER_LINUX,
189 .key = OS_AREA_DB_KEY_RTC_DIFF
190};
191
192static const struct os_area_db_id os_area_db_id_video_mode = {
193 .owner = OS_AREA_DB_OWNER_LINUX,
194 .key = OS_AREA_DB_KEY_VIDEO_MODE
195};
196
197#define SECONDS_FROM_1970_TO_2000 946684800LL
198
199/**
200 * struct saved_params - Static working copies of data from the PS3 'os area'.
201 *
202 * The order of preference we use for the rtc_diff source:
203 * 1) The database value.
204 * 2) The game os value.
205 * 3) The number of seconds from 1970 to 2000.
119 */ 206 */
120 207
121struct saved_params { 208struct saved_params {
122 /* param 0 */ 209 unsigned int valid;
123 s64 rtc_diff; 210 s64 rtc_diff;
124 unsigned int av_multi_out; 211 unsigned int av_multi_out;
125 unsigned int ctrl_button;
126 /* param 1 */
127 u8 static_ip_addr[4];
128 u8 network_mask[4];
129 u8 default_gateway[4];
130 /* param 2 */
131 u8 dns_primary[4];
132 u8 dns_secondary[4];
133} static saved_params; 212} static saved_params;
134 213
214static struct property property_rtc_diff = {
215 .name = "linux,rtc_diff",
216 .length = sizeof(saved_params.rtc_diff),
217 .value = &saved_params.rtc_diff,
218};
219
220static struct property property_av_multi_out = {
221 .name = "linux,av_multi_out",
222 .length = sizeof(saved_params.av_multi_out),
223 .value = &saved_params.av_multi_out,
224};
225
226/**
227 * os_area_set_property - Add or overwrite a saved_params value to the device tree.
228 *
229 * Overwrites an existing property.
230 */
231
232static void os_area_set_property(struct device_node *node,
233 struct property *prop)
234{
235 int result;
236 struct property *tmp = of_find_property(node, prop->name, NULL);
237
238 if (tmp) {
239 pr_debug("%s:%d found %s\n", __func__, __LINE__, prop->name);
240 prom_remove_property(node, tmp);
241 }
242
243 result = prom_add_property(node, prop);
244
245 if (result)
246 pr_debug("%s:%d prom_set_property failed\n", __func__,
247 __LINE__);
248}
249
250/**
251 * os_area_get_property - Get a saved_params value from the device tree.
252 *
253 */
254
255static void __init os_area_get_property(struct device_node *node,
256 struct property *prop)
257{
258 const struct property *tmp = of_find_property(node, prop->name, NULL);
259
260 if (tmp) {
261 BUG_ON(prop->length != tmp->length);
262 memcpy(prop->value, tmp->value, prop->length);
263 } else
264 pr_debug("%s:%d not found %s\n", __func__, __LINE__,
265 prop->name);
266}
267
135#define dump_header(_a) _dump_header(_a, __func__, __LINE__) 268#define dump_header(_a) _dump_header(_a, __func__, __LINE__)
136static void _dump_header(const struct os_area_header *h, const char *func, 269static void _dump_header(const struct os_area_header *h, const char *func,
137 int line) 270 int line)
138{ 271{
139 pr_debug("%s:%d: h.magic_num: '%s'\n", func, line, 272 pr_debug("%s:%d: h.magic_num: '%s'\n", func, line,
140 h->magic_num); 273 h->magic_num);
141 pr_debug("%s:%d: h.hdr_version: %u\n", func, line, 274 pr_debug("%s:%d: h.hdr_version: %u\n", func, line,
142 h->hdr_version); 275 h->hdr_version);
143 pr_debug("%s:%d: h.os_area_offset: %u\n", func, line, 276 pr_debug("%s:%d: h.db_area_offset: %u\n", func, line,
144 h->os_area_offset); 277 h->db_area_offset);
145 pr_debug("%s:%d: h.ldr_area_offset: %u\n", func, line, 278 pr_debug("%s:%d: h.ldr_area_offset: %u\n", func, line,
146 h->ldr_area_offset); 279 h->ldr_area_offset);
147 pr_debug("%s:%d: h.ldr_format: %u\n", func, line, 280 pr_debug("%s:%d: h.ldr_format: %u\n", func, line,
148 h->ldr_format); 281 h->ldr_format);
149 pr_debug("%s:%d: h.ldr_size: %xh\n", func, line, 282 pr_debug("%s:%d: h.ldr_size: %xh\n", func, line,
150 h->ldr_size); 283 h->ldr_size);
151} 284}
152 285
@@ -176,7 +309,7 @@ static void _dump_params(const struct os_area_params *p, const char *func,
176 p->dns_secondary[2], p->dns_secondary[3]); 309 p->dns_secondary[2], p->dns_secondary[3]);
177} 310}
178 311
179static int __init verify_header(const struct os_area_header *header) 312static int verify_header(const struct os_area_header *header)
180{ 313{
181 if (memcmp(header->magic_num, "cell_ext_os_area", 16)) { 314 if (memcmp(header->magic_num, "cell_ext_os_area", 16)) {
182 pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); 315 pr_debug("%s:%d magic_num failed\n", __func__, __LINE__);
@@ -188,7 +321,7 @@ static int __init verify_header(const struct os_area_header *header)
188 return -1; 321 return -1;
189 } 322 }
190 323
191 if (header->os_area_offset > header->ldr_area_offset) { 324 if (header->db_area_offset > header->ldr_area_offset) {
192 pr_debug("%s:%d offsets failed\n", __func__, __LINE__); 325 pr_debug("%s:%d offsets failed\n", __func__, __LINE__);
193 return -1; 326 return -1;
194 } 327 }
@@ -196,58 +329,477 @@ static int __init verify_header(const struct os_area_header *header)
196 return 0; 329 return 0;
197} 330}
198 331
199int __init ps3_os_area_init(void) 332static int db_verify(const struct os_area_db *db)
333{
334 if (db->magic_num != OS_AREA_DB_MAGIC_NUM) {
335 pr_debug("%s:%d magic_num failed\n", __func__, __LINE__);
336 return -1;
337 }
338
339 if (db->version != 1) {
340 pr_debug("%s:%d version failed\n", __func__, __LINE__);
341 return -1;
342 }
343
344 return 0;
345}
346
347struct db_index {
348 uint8_t owner:5;
349 uint8_t key:3;
350};
351
352struct db_iterator {
353 const struct os_area_db *db;
354 struct os_area_db_id match_id;
355 struct db_index *idx;
356 struct db_index *last_idx;
357 union {
358 uint64_t *value_64;
359 uint32_t *value_32;
360 uint16_t *value_16;
361 };
362};
363
364static unsigned int db_align_up(unsigned int val, unsigned int size)
365{
366 return (val + (size - 1)) & (~(size - 1));
367}
368
369/**
370 * db_for_each_64 - Iterator for 64 bit entries.
371 *
372 * A NULL value for id can be used to match all entries.
373 * OS_AREA_DB_OWNER_ANY and OS_AREA_DB_KEY_ANY can be used to match all.
374 */
375
376static int db_for_each_64(const struct os_area_db *db,
377 const struct os_area_db_id *match_id, struct db_iterator *i)
378{
379next:
380 if (!i->db) {
381 i->db = db;
382 i->match_id = match_id ? *match_id : os_area_db_id_any;
383 i->idx = (void *)db + db->index_64;
384 i->last_idx = i->idx + db->count_64;
385 i->value_64 = (void *)db + db->index_64
386 + db_align_up(db->count_64, 8);
387 } else {
388 i->idx++;
389 i->value_64++;
390 }
391
392 if (i->idx >= i->last_idx) {
393 pr_debug("%s:%d: reached end\n", __func__, __LINE__);
394 return 0;
395 }
396
397 if (i->match_id.owner != OS_AREA_DB_OWNER_ANY
398 && i->match_id.owner != (int)i->idx->owner)
399 goto next;
400 if (i->match_id.key != OS_AREA_DB_KEY_ANY
401 && i->match_id.key != (int)i->idx->key)
402 goto next;
403
404 return 1;
405}
406
407static int db_delete_64(struct os_area_db *db, const struct os_area_db_id *id)
408{
409 struct db_iterator i;
410
411 for (i.db = NULL; db_for_each_64(db, id, &i); ) {
412
413 pr_debug("%s:%d: got (%d:%d) %llxh\n", __func__, __LINE__,
414 i.idx->owner, i.idx->key,
415 (unsigned long long)*i.value_64);
416
417 i.idx->owner = 0;
418 i.idx->key = 0;
419 *i.value_64 = 0;
420 }
421 return 0;
422}
423
424static int db_set_64(struct os_area_db *db, const struct os_area_db_id *id,
425 uint64_t value)
426{
427 struct db_iterator i;
428
429 pr_debug("%s:%d: (%d:%d) <= %llxh\n", __func__, __LINE__,
430 id->owner, id->key, (unsigned long long)value);
431
432 if (!id->owner || id->owner == OS_AREA_DB_OWNER_ANY
433 || id->key == OS_AREA_DB_KEY_ANY) {
434 pr_debug("%s:%d: bad id: (%d:%d)\n", __func__,
435 __LINE__, id->owner, id->key);
436 return -1;
437 }
438
439 db_delete_64(db, id);
440
441 i.db = NULL;
442 if (db_for_each_64(db, &os_area_db_id_empty, &i)) {
443
444 pr_debug("%s:%d: got (%d:%d) %llxh\n", __func__, __LINE__,
445 i.idx->owner, i.idx->key,
446 (unsigned long long)*i.value_64);
447
448 i.idx->owner = id->owner;
449 i.idx->key = id->key;
450 *i.value_64 = value;
451
452 pr_debug("%s:%d: set (%d:%d) <= %llxh\n", __func__, __LINE__,
453 i.idx->owner, i.idx->key,
454 (unsigned long long)*i.value_64);
455 return 0;
456 }
457 pr_debug("%s:%d: database full.\n",
458 __func__, __LINE__);
459 return -1;
460}
461
462static int db_get_64(const struct os_area_db *db,
463 const struct os_area_db_id *id, uint64_t *value)
464{
465 struct db_iterator i;
466
467 i.db = NULL;
468 if (db_for_each_64(db, id, &i)) {
469 *value = *i.value_64;
470 pr_debug("%s:%d: found %lld\n", __func__, __LINE__,
471 (long long int)*i.value_64);
472 return 0;
473 }
474 pr_debug("%s:%d: not found\n", __func__, __LINE__);
475 return -1;
476}
477
478static int db_get_rtc_diff(const struct os_area_db *db, int64_t *rtc_diff)
479{
480 return db_get_64(db, &os_area_db_id_rtc_diff, (uint64_t*)rtc_diff);
481}
482
483#define dump_db(a) _dump_db(a, __func__, __LINE__)
484static void _dump_db(const struct os_area_db *db, const char *func,
485 int line)
486{
487 pr_debug("%s:%d: db.magic_num: '%s'\n", func, line,
488 (const char*)&db->magic_num);
489 pr_debug("%s:%d: db.version: %u\n", func, line,
490 db->version);
491 pr_debug("%s:%d: db.index_64: %u\n", func, line,
492 db->index_64);
493 pr_debug("%s:%d: db.count_64: %u\n", func, line,
494 db->count_64);
495 pr_debug("%s:%d: db.index_32: %u\n", func, line,
496 db->index_32);
497 pr_debug("%s:%d: db.count_32: %u\n", func, line,
498 db->count_32);
499 pr_debug("%s:%d: db.index_16: %u\n", func, line,
500 db->index_16);
501 pr_debug("%s:%d: db.count_16: %u\n", func, line,
502 db->count_16);
503}
504
505static void os_area_db_init(struct os_area_db *db)
506{
507 enum {
508 HEADER_SIZE = offsetof(struct os_area_db, _db_data),
509 INDEX_64_COUNT = 64,
510 VALUES_64_COUNT = 57,
511 INDEX_32_COUNT = 64,
512 VALUES_32_COUNT = 57,
513 INDEX_16_COUNT = 64,
514 VALUES_16_COUNT = 57,
515 };
516
517 memset(db, 0, sizeof(struct os_area_db));
518
519 db->magic_num = OS_AREA_DB_MAGIC_NUM;
520 db->version = 1;
521 db->index_64 = HEADER_SIZE;
522 db->count_64 = VALUES_64_COUNT;
523 db->index_32 = HEADER_SIZE
524 + INDEX_64_COUNT * sizeof(struct db_index)
525 + VALUES_64_COUNT * sizeof(u64);
526 db->count_32 = VALUES_32_COUNT;
527 db->index_16 = HEADER_SIZE
528 + INDEX_64_COUNT * sizeof(struct db_index)
529 + VALUES_64_COUNT * sizeof(u64)
530 + INDEX_32_COUNT * sizeof(struct db_index)
531 + VALUES_32_COUNT * sizeof(u32);
532 db->count_16 = VALUES_16_COUNT;
533
534 /* Rules to check db layout. */
535
536 BUILD_BUG_ON(sizeof(struct db_index) != 1);
537 BUILD_BUG_ON(sizeof(struct os_area_db) != 2 * OS_AREA_SEGMENT_SIZE);
538 BUILD_BUG_ON(INDEX_64_COUNT & 0x7);
539 BUILD_BUG_ON(VALUES_64_COUNT > INDEX_64_COUNT);
540 BUILD_BUG_ON(INDEX_32_COUNT & 0x7);
541 BUILD_BUG_ON(VALUES_32_COUNT > INDEX_32_COUNT);
542 BUILD_BUG_ON(INDEX_16_COUNT & 0x7);
543 BUILD_BUG_ON(VALUES_16_COUNT > INDEX_16_COUNT);
544 BUILD_BUG_ON(HEADER_SIZE
545 + INDEX_64_COUNT * sizeof(struct db_index)
546 + VALUES_64_COUNT * sizeof(u64)
547 + INDEX_32_COUNT * sizeof(struct db_index)
548 + VALUES_32_COUNT * sizeof(u32)
549 + INDEX_16_COUNT * sizeof(struct db_index)
550 + VALUES_16_COUNT * sizeof(u16)
551 > sizeof(struct os_area_db));
552}
553
554/**
555 * update_flash_db - Helper for os_area_queue_work_handler.
556 *
557 */
558
559static void update_flash_db(void)
560{
561 int result;
562 int file;
563 off_t offset;
564 ssize_t count;
565 static const unsigned int buf_len = 8 * OS_AREA_SEGMENT_SIZE;
566 const struct os_area_header *header;
567 struct os_area_db* db;
568
569 /* Read in header and db from flash. */
570
571 file = sys_open("/dev/ps3flash", O_RDWR, 0);
572
573 if (file < 0) {
574 pr_debug("%s:%d sys_open failed\n", __func__, __LINE__);
575 goto fail_open;
576 }
577
578 header = kmalloc(buf_len, GFP_KERNEL);
579
580 if (!header) {
581 pr_debug("%s:%d kmalloc failed\n", __func__, __LINE__);
582 goto fail_malloc;
583 }
584
585 offset = sys_lseek(file, 0, SEEK_SET);
586
587 if (offset != 0) {
588 pr_debug("%s:%d sys_lseek failed\n", __func__, __LINE__);
589 goto fail_header_seek;
590 }
591
592 count = sys_read(file, (char __user *)header, buf_len);
593
594 result = count < OS_AREA_SEGMENT_SIZE || verify_header(header)
595 || count < header->db_area_offset * OS_AREA_SEGMENT_SIZE;
596
597 if (result) {
598 pr_debug("%s:%d verify_header failed\n", __func__, __LINE__);
599 dump_header(header);
600 goto fail_header;
601 }
602
603 /* Now got a good db offset and some maybe good db data. */
604
605 db = (void*)header + header->db_area_offset * OS_AREA_SEGMENT_SIZE;
606
607 result = db_verify(db);
608
609 if (result) {
610 printk(KERN_NOTICE "%s:%d: Verify of flash database failed, "
611 "formatting.\n", __func__, __LINE__);
612 dump_db(db);
613 os_area_db_init(db);
614 }
615
616 /* Now got good db data. */
617
618 db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff);
619
620 offset = sys_lseek(file, header->db_area_offset * OS_AREA_SEGMENT_SIZE,
621 SEEK_SET);
622
623 if (offset != header->db_area_offset * OS_AREA_SEGMENT_SIZE) {
624 pr_debug("%s:%d sys_lseek failed\n", __func__, __LINE__);
625 goto fail_db_seek;
626 }
627
628 count = sys_write(file, (const char __user *)db,
629 sizeof(struct os_area_db));
630
631 if (count < sizeof(struct os_area_db)) {
632 pr_debug("%s:%d sys_write failed\n", __func__, __LINE__);
633 }
634
635fail_db_seek:
636fail_header:
637fail_header_seek:
638 kfree(header);
639fail_malloc:
640 sys_close(file);
641fail_open:
642 return;
643}
644
645/**
646 * os_area_queue_work_handler - Asynchronous write handler.
647 *
648 * An asynchronous write for flash memory and the device tree. Do not
649 * call directly, use os_area_queue_work().
650 */
651
652static void os_area_queue_work_handler(struct work_struct *work)
653{
654 struct device_node *node;
655
656 pr_debug(" -> %s:%d\n", __func__, __LINE__);
657
658 node = of_find_node_by_path("/");
659
660 if (node) {
661 os_area_set_property(node, &property_rtc_diff);
662 of_node_put(node);
663 } else
664 pr_debug("%s:%d of_find_node_by_path failed\n",
665 __func__, __LINE__);
666
667#if defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE)
668 update_flash_db();
669#else
670 printk(KERN_WARNING "%s:%d: No flash rom driver configured.\n",
671 __func__, __LINE__);
672#endif
673 pr_debug(" <- %s:%d\n", __func__, __LINE__);
674}
675
676static void os_area_queue_work(void)
677{
678 static DECLARE_WORK(q, os_area_queue_work_handler);
679
680 wmb();
681 schedule_work(&q);
682}
683
684/**
685 * ps3_os_area_save_params - Copy data from os area mirror to @saved_params.
686 *
687 * For the convenience of the guest the HV makes a copy of the os area in
688 * flash to a high address in the boot memory region and then puts that RAM
689 * address and the byte count into the repository for retrieval by the guest.
690 * We copy the data we want into a static variable and allow the memory setup
691 * by the HV to be claimed by the lmb manager.
692 *
693 * The os area mirror will not be available to a second stage kernel, and
694 * the header verify will fail. In this case, the saved_params values will
695 * be set from flash memory or the passed in device tree in ps3_os_area_init().
696 */
697
698void __init ps3_os_area_save_params(void)
200{ 699{
201 int result; 700 int result;
202 u64 lpar_addr; 701 u64 lpar_addr;
203 unsigned int size; 702 unsigned int size;
204 struct os_area_header *header; 703 struct os_area_header *header;
205 struct os_area_params *params; 704 struct os_area_params *params;
705 struct os_area_db *db;
706
707 pr_debug(" -> %s:%d\n", __func__, __LINE__);
206 708
207 result = ps3_repository_read_boot_dat_info(&lpar_addr, &size); 709 result = ps3_repository_read_boot_dat_info(&lpar_addr, &size);
208 710
209 if (result) { 711 if (result) {
210 pr_debug("%s:%d ps3_repository_read_boot_dat_info failed\n", 712 pr_debug("%s:%d ps3_repository_read_boot_dat_info failed\n",
211 __func__, __LINE__); 713 __func__, __LINE__);
212 return result; 714 return;
213 } 715 }
214 716
215 header = (struct os_area_header *)__va(lpar_addr); 717 header = (struct os_area_header *)__va(lpar_addr);
216 params = (struct os_area_params *)__va(lpar_addr + OS_AREA_SEGMENT_SIZE); 718 params = (struct os_area_params *)__va(lpar_addr
719 + OS_AREA_SEGMENT_SIZE);
217 720
218 result = verify_header(header); 721 result = verify_header(header);
219 722
220 if (result) { 723 if (result) {
724 /* Second stage kernels exit here. */
221 pr_debug("%s:%d verify_header failed\n", __func__, __LINE__); 725 pr_debug("%s:%d verify_header failed\n", __func__, __LINE__);
222 dump_header(header); 726 dump_header(header);
223 return -EIO; 727 return;
224 } 728 }
225 729
730 db = (struct os_area_db *)__va(lpar_addr
731 + header->db_area_offset * OS_AREA_SEGMENT_SIZE);
732
226 dump_header(header); 733 dump_header(header);
227 dump_params(params); 734 dump_params(params);
735 dump_db(db);
228 736
229 saved_params.rtc_diff = params->rtc_diff; 737 result = db_verify(db) || db_get_rtc_diff(db, &saved_params.rtc_diff);
738 if (result)
739 saved_params.rtc_diff = params->rtc_diff ? params->rtc_diff
740 : SECONDS_FROM_1970_TO_2000;
230 saved_params.av_multi_out = params->av_multi_out; 741 saved_params.av_multi_out = params->av_multi_out;
231 saved_params.ctrl_button = params->ctrl_button; 742 saved_params.valid = 1;
232 memcpy(saved_params.static_ip_addr, params->static_ip_addr, 4); 743
233 memcpy(saved_params.network_mask, params->network_mask, 4); 744 memset(header, 0, sizeof(*header));
234 memcpy(saved_params.default_gateway, params->default_gateway, 4);
235 memcpy(saved_params.dns_secondary, params->dns_secondary, 4);
236 745
237 return result; 746 pr_debug(" <- %s:%d\n", __func__, __LINE__);
238} 747}
239 748
240/** 749/**
241 * ps3_os_area_rtc_diff - Returns the ps3 rtc diff value. 750 * ps3_os_area_init - Setup os area device tree properties as needed.
751 */
752
753void __init ps3_os_area_init(void)
754{
755 struct device_node *node;
756
757 pr_debug(" -> %s:%d\n", __func__, __LINE__);
758
759 node = of_find_node_by_path("/");
760
761 if (!saved_params.valid && node) {
762 /* Second stage kernels should have a dt entry. */
763 os_area_get_property(node, &property_rtc_diff);
764 os_area_get_property(node, &property_av_multi_out);
765 }
766
767 if(!saved_params.rtc_diff)
768 saved_params.rtc_diff = SECONDS_FROM_1970_TO_2000;
769
770 if (node) {
771 os_area_set_property(node, &property_rtc_diff);
772 os_area_set_property(node, &property_av_multi_out);
773 of_node_put(node);
774 } else
775 pr_debug("%s:%d of_find_node_by_path failed\n",
776 __func__, __LINE__);
777
778 pr_debug(" <- %s:%d\n", __func__, __LINE__);
779}
780
781/**
782 * ps3_os_area_get_rtc_diff - Returns the rtc diff value.
783 */
784
785u64 ps3_os_area_get_rtc_diff(void)
786{
787 return saved_params.rtc_diff;
788}
789
790/**
791 * ps3_os_area_set_rtc_diff - Set the rtc diff value.
242 * 792 *
243 * The ps3 rtc maintains a value that approximates seconds since 793 * An asynchronous write is needed to support writing updates from
244 * 2000-01-01 00:00:00 UTC. Returns the exact number of seconds from 1970 to 794 * the timer interrupt context.
245 * 2000 when saved_params.rtc_diff has not been properly set up.
246 */ 795 */
247 796
248u64 ps3_os_area_rtc_diff(void) 797void ps3_os_area_set_rtc_diff(u64 rtc_diff)
249{ 798{
250 return saved_params.rtc_diff ? saved_params.rtc_diff : 946684800UL; 799 if (saved_params.rtc_diff != rtc_diff) {
800 saved_params.rtc_diff = rtc_diff;
801 os_area_queue_work();
802 }
251} 803}
252 804
253/** 805/**
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h
index 2eb8f92704b4..01f0c9506e11 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
@@ -58,8 +62,10 @@ int ps3_set_rtc_time(struct rtc_time *time);
58 62
59/* os area */ 63/* os area */
60 64
61int __init ps3_os_area_init(void); 65void __init ps3_os_area_save_params(void);
62u64 ps3_os_area_rtc_diff(void); 66void __init ps3_os_area_init(void);
67u64 ps3_os_area_get_rtc_diff(void);
68void ps3_os_area_set_rtc_diff(u64 rtc_diff);
63 69
64/* spu */ 70/* spu */
65 71
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index 609945dbe394..5c2cbb08eb52 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -206,6 +206,7 @@ static void __init ps3_setup_arch(void)
206 prealloc_ps3flash_bounce_buffer(); 206 prealloc_ps3flash_bounce_buffer();
207 207
208 ppc_md.power_save = ps3_power_save; 208 ppc_md.power_save = ps3_power_save;
209 ps3_os_area_init();
209 210
210 DBG(" <- %s:%d\n", __func__, __LINE__); 211 DBG(" <- %s:%d\n", __func__, __LINE__);
211} 212}
@@ -228,7 +229,7 @@ static int __init ps3_probe(void)
228 229
229 powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE; 230 powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE;
230 231
231 ps3_os_area_init(); 232 ps3_os_area_save_params();
232 ps3_mm_init(); 233 ps3_mm_init();
233 ps3_mm_vas_create(&htab_size); 234 ps3_mm_vas_create(&htab_size);
234 ps3_hpte_init(htab_size); 235 ps3_hpte_init(htab_size);
diff --git a/arch/powerpc/platforms/ps3/time.c b/arch/powerpc/platforms/ps3/time.c
index 802a9ccacb5e..d0daf7d6d3b2 100644
--- a/arch/powerpc/platforms/ps3/time.c
+++ b/arch/powerpc/platforms/ps3/time.c
@@ -50,12 +50,6 @@ static void __maybe_unused _dump_time(int time, const char *func,
50 _dump_tm(&tm, func, line); 50 _dump_tm(&tm, func, line);
51} 51}
52 52
53/**
54 * rtc_shift - Difference in seconds between 1970 and the ps3 rtc value.
55 */
56
57static s64 rtc_shift;
58
59void __init ps3_calibrate_decr(void) 53void __init ps3_calibrate_decr(void)
60{ 54{
61 int result; 55 int result;
@@ -66,8 +60,6 @@ void __init ps3_calibrate_decr(void)
66 60
67 ppc_tb_freq = tmp; 61 ppc_tb_freq = tmp;
68 ppc_proc_freq = ppc_tb_freq * 40; 62 ppc_proc_freq = ppc_tb_freq * 40;
69
70 rtc_shift = ps3_os_area_rtc_diff();
71} 63}
72 64
73static u64 read_rtc(void) 65static u64 read_rtc(void)
@@ -87,18 +79,18 @@ int ps3_set_rtc_time(struct rtc_time *tm)
87 u64 now = mktime(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, 79 u64 now = mktime(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
88 tm->tm_hour, tm->tm_min, tm->tm_sec); 80 tm->tm_hour, tm->tm_min, tm->tm_sec);
89 81
90 rtc_shift = now - read_rtc(); 82 ps3_os_area_set_rtc_diff(now - read_rtc());
91 return 0; 83 return 0;
92} 84}
93 85
94void ps3_get_rtc_time(struct rtc_time *tm) 86void ps3_get_rtc_time(struct rtc_time *tm)
95{ 87{
96 to_tm(read_rtc() + rtc_shift, tm); 88 to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm);
97 tm->tm_year -= 1900; 89 tm->tm_year -= 1900;
98 tm->tm_mon -= 1; 90 tm->tm_mon -= 1;
99} 91}
100 92
101unsigned long __init ps3_get_boot_time(void) 93unsigned long __init ps3_get_boot_time(void)
102{ 94{
103 return read_rtc() + rtc_shift; 95 return read_rtc() + ps3_os_area_get_rtc_diff();
104} 96}
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/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 9711eb0d5496..fc48b96c81bf 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -252,6 +252,20 @@ static struct notifier_block pseries_smp_nb = {
252 252
253static int __init pseries_cpu_hotplug_init(void) 253static int __init pseries_cpu_hotplug_init(void)
254{ 254{
255 struct device_node *np;
256 const char *typep;
257
258 for_each_node_by_name(np, "interrupt-controller") {
259 typep = of_get_property(np, "compatible", NULL);
260 if (strstr(typep, "open-pic")) {
261 of_node_put(np);
262
263 printk(KERN_INFO "CPU Hotplug not supported on "
264 "systems using MPIC\n");
265 return 0;
266 }
267 }
268
255 rtas_stop_self_args.token = rtas_token("stop-self"); 269 rtas_stop_self_args.token = rtas_token("stop-self");
256 qcss_tok = rtas_token("query-cpu-stopped-state"); 270 qcss_tok = rtas_token("query-cpu-stopped-state");
257 271
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 8cc6eeeaae2f..9a455d46379d 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>
@@ -285,7 +284,7 @@ void vpa_init(int cpu)
285static long pSeries_lpar_hpte_insert(unsigned long hpte_group, 284static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
286 unsigned long va, unsigned long pa, 285 unsigned long va, unsigned long pa,
287 unsigned long rflags, unsigned long vflags, 286 unsigned long rflags, unsigned long vflags,
288 int psize) 287 int psize, int ssize)
289{ 288{
290 unsigned long lpar_rc; 289 unsigned long lpar_rc;
291 unsigned long flags; 290 unsigned long flags;
@@ -297,7 +296,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
297 "rflags=%lx, vflags=%lx, psize=%d)\n", 296 "rflags=%lx, vflags=%lx, psize=%d)\n",
298 hpte_group, va, pa, rflags, vflags, psize); 297 hpte_group, va, pa, rflags, vflags, psize);
299 298
300 hpte_v = hpte_encode_v(va, psize) | vflags | HPTE_V_VALID; 299 hpte_v = hpte_encode_v(va, psize, ssize) | vflags | HPTE_V_VALID;
301 hpte_r = hpte_encode_r(pa, psize) | rflags; 300 hpte_r = hpte_encode_r(pa, psize) | rflags;
302 301
303 if (!(vflags & HPTE_V_BOLTED)) 302 if (!(vflags & HPTE_V_BOLTED))
@@ -393,6 +392,22 @@ static void pSeries_lpar_hptab_clear(void)
393} 392}
394 393
395/* 394/*
395 * This computes the AVPN and B fields of the first dword of a HPTE,
396 * for use when we want to match an existing PTE. The bottom 7 bits
397 * of the returned value are zero.
398 */
399static inline unsigned long hpte_encode_avpn(unsigned long va, int psize,
400 int ssize)
401{
402 unsigned long v;
403
404 v = (va >> 23) & ~(mmu_psize_defs[psize].avpnm);
405 v <<= HPTE_V_AVPN_SHIFT;
406 v |= ((unsigned long) ssize) << HPTE_V_SSIZE_SHIFT;
407 return v;
408}
409
410/*
396 * NOTE: for updatepp ops we are fortunate that the linux "newpp" bits and 411 * NOTE: for updatepp ops we are fortunate that the linux "newpp" bits and
397 * the low 3 bits of flags happen to line up. So no transform is needed. 412 * the low 3 bits of flags happen to line up. So no transform is needed.
398 * We can probably optimize here and assume the high bits of newpp are 413 * We can probably optimize here and assume the high bits of newpp are
@@ -401,18 +416,18 @@ static void pSeries_lpar_hptab_clear(void)
401static long pSeries_lpar_hpte_updatepp(unsigned long slot, 416static long pSeries_lpar_hpte_updatepp(unsigned long slot,
402 unsigned long newpp, 417 unsigned long newpp,
403 unsigned long va, 418 unsigned long va,
404 int psize, int local) 419 int psize, int ssize, int local)
405{ 420{
406 unsigned long lpar_rc; 421 unsigned long lpar_rc;
407 unsigned long flags = (newpp & 7) | H_AVPN; 422 unsigned long flags = (newpp & 7) | H_AVPN;
408 unsigned long want_v; 423 unsigned long want_v;
409 424
410 want_v = hpte_encode_v(va, psize); 425 want_v = hpte_encode_avpn(va, psize, ssize);
411 426
412 DBG_LOW(" update: avpnv=%016lx, hash=%016lx, f=%x, psize: %d ... ", 427 DBG_LOW(" update: avpnv=%016lx, hash=%016lx, f=%x, psize: %d ... ",
413 want_v & HPTE_V_AVPN, slot, flags, psize); 428 want_v, slot, flags, psize);
414 429
415 lpar_rc = plpar_pte_protect(flags, slot, want_v & HPTE_V_AVPN); 430 lpar_rc = plpar_pte_protect(flags, slot, want_v);
416 431
417 if (lpar_rc == H_NOT_FOUND) { 432 if (lpar_rc == H_NOT_FOUND) {
418 DBG_LOW("not found !\n"); 433 DBG_LOW("not found !\n");
@@ -445,32 +460,25 @@ static unsigned long pSeries_lpar_hpte_getword0(unsigned long slot)
445 return dword0; 460 return dword0;
446} 461}
447 462
448static long pSeries_lpar_hpte_find(unsigned long va, int psize) 463static long pSeries_lpar_hpte_find(unsigned long va, int psize, int ssize)
449{ 464{
450 unsigned long hash; 465 unsigned long hash;
451 unsigned long i, j; 466 unsigned long i;
452 long slot; 467 long slot;
453 unsigned long want_v, hpte_v; 468 unsigned long want_v, hpte_v;
454 469
455 hash = hpt_hash(va, mmu_psize_defs[psize].shift); 470 hash = hpt_hash(va, mmu_psize_defs[psize].shift, ssize);
456 want_v = hpte_encode_v(va, psize); 471 want_v = hpte_encode_avpn(va, psize, ssize);
457 472
458 for (j = 0; j < 2; j++) { 473 /* Bolted entries are always in the primary group */
459 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 474 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
460 for (i = 0; i < HPTES_PER_GROUP; i++) { 475 for (i = 0; i < HPTES_PER_GROUP; i++) {
461 hpte_v = pSeries_lpar_hpte_getword0(slot); 476 hpte_v = pSeries_lpar_hpte_getword0(slot);
462 477
463 if (HPTE_V_COMPARE(hpte_v, want_v) 478 if (HPTE_V_COMPARE(hpte_v, want_v) && (hpte_v & HPTE_V_VALID))
464 && (hpte_v & HPTE_V_VALID) 479 /* HPTE matches */
465 && (!!(hpte_v & HPTE_V_SECONDARY) == j)) { 480 return slot;
466 /* HPTE matches */ 481 ++slot;
467 if (j)
468 slot = -slot;
469 return slot;
470 }
471 ++slot;
472 }
473 hash = ~hash;
474 } 482 }
475 483
476 return -1; 484 return -1;
@@ -478,14 +486,14 @@ static long pSeries_lpar_hpte_find(unsigned long va, int psize)
478 486
479static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp, 487static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
480 unsigned long ea, 488 unsigned long ea,
481 int psize) 489 int psize, int ssize)
482{ 490{
483 unsigned long lpar_rc, slot, vsid, va, flags; 491 unsigned long lpar_rc, slot, vsid, va, flags;
484 492
485 vsid = get_kernel_vsid(ea); 493 vsid = get_kernel_vsid(ea, ssize);
486 va = (vsid << 28) | (ea & 0x0fffffff); 494 va = hpt_va(ea, vsid, ssize);
487 495
488 slot = pSeries_lpar_hpte_find(va, psize); 496 slot = pSeries_lpar_hpte_find(va, psize, ssize);
489 BUG_ON(slot == -1); 497 BUG_ON(slot == -1);
490 498
491 flags = newpp & 7; 499 flags = newpp & 7;
@@ -495,7 +503,7 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
495} 503}
496 504
497static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va, 505static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
498 int psize, int local) 506 int psize, int ssize, int local)
499{ 507{
500 unsigned long want_v; 508 unsigned long want_v;
501 unsigned long lpar_rc; 509 unsigned long lpar_rc;
@@ -504,9 +512,8 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
504 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d", 512 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d",
505 slot, va, psize, local); 513 slot, va, psize, local);
506 514
507 want_v = hpte_encode_v(va, psize); 515 want_v = hpte_encode_avpn(va, psize, ssize);
508 lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v & HPTE_V_AVPN, 516 lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v, &dummy1, &dummy2);
509 &dummy1, &dummy2);
510 if (lpar_rc == H_NOT_FOUND) 517 if (lpar_rc == H_NOT_FOUND)
511 return; 518 return;
512 519
@@ -534,18 +541,19 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
534 unsigned long va; 541 unsigned long va;
535 unsigned long hash, index, shift, hidx, slot; 542 unsigned long hash, index, shift, hidx, slot;
536 real_pte_t pte; 543 real_pte_t pte;
537 int psize; 544 int psize, ssize;
538 545
539 if (lock_tlbie) 546 if (lock_tlbie)
540 spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags); 547 spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags);
541 548
542 psize = batch->psize; 549 psize = batch->psize;
550 ssize = batch->ssize;
543 pix = 0; 551 pix = 0;
544 for (i = 0; i < number; i++) { 552 for (i = 0; i < number; i++) {
545 va = batch->vaddr[i]; 553 va = batch->vaddr[i];
546 pte = batch->pte[i]; 554 pte = batch->pte[i];
547 pte_iterate_hashed_subpages(pte, psize, va, index, shift) { 555 pte_iterate_hashed_subpages(pte, psize, va, index, shift) {
548 hash = hpt_hash(va, shift); 556 hash = hpt_hash(va, shift, ssize);
549 hidx = __rpte_to_hidx(pte, index); 557 hidx = __rpte_to_hidx(pte, index);
550 if (hidx & _PTEIDX_SECONDARY) 558 if (hidx & _PTEIDX_SECONDARY)
551 hash = ~hash; 559 hash = ~hash;
@@ -553,11 +561,11 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
553 slot += hidx & _PTEIDX_GROUP_IX; 561 slot += hidx & _PTEIDX_GROUP_IX;
554 if (!firmware_has_feature(FW_FEATURE_BULK_REMOVE)) { 562 if (!firmware_has_feature(FW_FEATURE_BULK_REMOVE)) {
555 pSeries_lpar_hpte_invalidate(slot, va, psize, 563 pSeries_lpar_hpte_invalidate(slot, va, psize,
556 local); 564 ssize, local);
557 } else { 565 } else {
558 param[pix] = HBR_REQUEST | HBR_AVPN | slot; 566 param[pix] = HBR_REQUEST | HBR_AVPN | slot;
559 param[pix+1] = hpte_encode_v(va, psize) & 567 param[pix+1] = hpte_encode_avpn(va, psize,
560 HPTE_V_AVPN; 568 ssize);
561 pix += 2; 569 pix += 2;
562 if (pix == 8) { 570 if (pix == 8) {
563 rc = plpar_hcall9(H_BULK_REMOVE, param, 571 rc = plpar_hcall9(H_BULK_REMOVE, param,
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/setup.c b/arch/powerpc/platforms/pseries/setup.c
index f0b7146a110f..fdb9b1c8f977 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -257,11 +257,6 @@ static void __init pSeries_setup_arch(void)
257 /* init to some ~sane value until calibrate_delay() runs */ 257 /* init to some ~sane value until calibrate_delay() runs */
258 loops_per_jiffy = 50000000; 258 loops_per_jiffy = 50000000;
259 259
260 if (ROOT_DEV == 0) {
261 printk("No ramdisk, default root is /dev/sda2\n");
262 ROOT_DEV = Root_SDA2;
263 }
264
265 fwnmi_init(); 260 fwnmi_init();
266 261
267 /* Find and initialize PCI host bridges */ 262 /* Find and initialize PCI host bridges */
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..1a6f5641ebc8 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -6,7 +6,6 @@ mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o
6obj-$(CONFIG_MPIC) += mpic.o $(mpic-msi-obj-y) 6obj-$(CONFIG_MPIC) += mpic.o $(mpic-msi-obj-y)
7 7
8obj-$(CONFIG_PPC_MPC106) += grackle.o 8obj-$(CONFIG_PPC_MPC106) += grackle.o
9obj-$(CONFIG_PPC_DCR) += dcr.o
10obj-$(CONFIG_PPC_DCR_NATIVE) += dcr-low.o 9obj-$(CONFIG_PPC_DCR_NATIVE) += dcr-low.o
11obj-$(CONFIG_PPC_PMI) += pmi.o 10obj-$(CONFIG_PPC_PMI) += pmi.o
12obj-$(CONFIG_U3_DART) += dart_iommu.o 11obj-$(CONFIG_U3_DART) += dart_iommu.o
@@ -16,25 +15,24 @@ obj-$(CONFIG_FSL_PCI) += fsl_pci.o
16obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o 15obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o
17obj-$(CONFIG_QUICC_ENGINE) += qe_lib/ 16obj-$(CONFIG_QUICC_ENGINE) += qe_lib/
18mv64x60-$(CONFIG_PCI) += mv64x60_pci.o 17mv64x60-$(CONFIG_PCI) += mv64x60_pci.o
19obj-$(CONFIG_MV64X60) += $(mv64x60-y) mv64x60_pic.o mv64x60_dev.o 18obj-$(CONFIG_MV64X60) += $(mv64x60-y) mv64x60_pic.o mv64x60_dev.o \
19 mv64x60_udbg.o
20obj-$(CONFIG_RTC_DRV_CMOS) += rtc_cmos_setup.o 20obj-$(CONFIG_RTC_DRV_CMOS) += rtc_cmos_setup.o
21obj-$(CONFIG_AXON_RAM) += axonram.o 21obj-$(CONFIG_AXON_RAM) += axonram.o
22 22
23# contains only the suspend handler for time
24ifeq ($(CONFIG_RTC_CLASS),)
25obj-$(CONFIG_PM) += timer.o
26endif
27
28ifeq ($(CONFIG_PPC_MERGE),y) 23ifeq ($(CONFIG_PPC_MERGE),y)
29obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o 24obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
30obj-$(CONFIG_PPC_I8259) += i8259.o 25obj-$(CONFIG_PPC_I8259) += i8259.o
31obj-$(CONFIG_PPC_83xx) += ipic.o 26obj-$(CONFIG_PPC_83xx) += ipic.o
32obj-$(CONFIG_4xx) += uic.o 27obj-$(CONFIG_4xx) += uic.o
28obj-$(CONFIG_XILINX_VIRTEX) += xilinx_intc.o
33endif 29endif
34 30
35# Temporary hack until we have migrated to asm-powerpc 31# Temporary hack until we have migrated to asm-powerpc
36ifeq ($(ARCH),powerpc) 32ifeq ($(ARCH),powerpc)
33obj-$(CONFIG_CPM) += cpm_common.o
37obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o 34obj-$(CONFIG_CPM2) += cpm2_common.o cpm2_pic.o
35obj-$(CONFIG_PPC_DCR) += dcr.o
38obj-$(CONFIG_8xx) += mpc8xx_pic.o commproc.o 36obj-$(CONFIG_8xx) += mpc8xx_pic.o commproc.o
39obj-$(CONFIG_UCODE_PATCH) += micropatch.o 37obj-$(CONFIG_UCODE_PATCH) += micropatch.o
40endif 38endif
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index ab037a3a40db..4d3ba63bba79 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -324,11 +324,13 @@ static struct of_device_id axon_ram_device_id[] = {
324}; 324};
325 325
326static struct of_platform_driver axon_ram_driver = { 326static struct of_platform_driver axon_ram_driver = {
327 .owner = THIS_MODULE,
328 .name = AXON_RAM_MODULE_NAME,
329 .match_table = axon_ram_device_id, 327 .match_table = axon_ram_device_id,
330 .probe = axon_ram_probe, 328 .probe = axon_ram_probe,
331 .remove = axon_ram_remove 329 .remove = axon_ram_remove,
330 .driver = {
331 .owner = THIS_MODULE,
332 .name = AXON_RAM_MODULE_NAME,
333 },
332}; 334};
333 335
334/** 336/**
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index dd5417aec1b4..f6a63780bbde 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -39,18 +39,21 @@
39#include <asm/tlbflush.h> 39#include <asm/tlbflush.h>
40#include <asm/rheap.h> 40#include <asm/rheap.h>
41#include <asm/prom.h> 41#include <asm/prom.h>
42#include <asm/cpm.h>
42 43
43#include <asm/fs_pd.h> 44#include <asm/fs_pd.h>
44 45
45#define CPM_MAP_SIZE (0x4000) 46#define CPM_MAP_SIZE (0x4000)
46 47
48#ifndef CONFIG_PPC_CPM_NEW_BINDING
47static void m8xx_cpm_dpinit(void); 49static void m8xx_cpm_dpinit(void);
48static uint host_buffer; /* One page of host buffer */ 50#endif
49static uint host_end; /* end + 1 */ 51static uint host_buffer; /* One page of host buffer */
50cpm8xx_t *cpmp; /* Pointer to comm processor space */ 52static uint host_end; /* end + 1 */
51cpic8xx_t *cpic_reg; 53cpm8xx_t __iomem *cpmp; /* Pointer to comm processor space */
54immap_t __iomem *mpc8xx_immr;
55static cpic8xx_t __iomem *cpic_reg;
52 56
53static struct device_node *cpm_pic_node;
54static struct irq_host *cpm_pic_host; 57static struct irq_host *cpm_pic_host;
55 58
56static void cpm_mask_irq(unsigned int irq) 59static void cpm_mask_irq(unsigned int irq)
@@ -95,11 +98,6 @@ int cpm_get_irq(void)
95 return irq_linear_revmap(cpm_pic_host, cpm_vec); 98 return irq_linear_revmap(cpm_pic_host, cpm_vec);
96} 99}
97 100
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, 101static int cpm_pic_host_map(struct irq_host *h, unsigned int virq,
104 irq_hw_number_t hw) 102 irq_hw_number_t hw)
105{ 103{
@@ -115,7 +113,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 113 * and return. This is a no-op function so we don't need any special
116 * tests in the interrupt handler. 114 * tests in the interrupt handler.
117 */ 115 */
118static irqreturn_t cpm_error_interrupt(int irq, void *dev) 116static irqreturn_t cpm_error_interrupt(int irq, void *dev)
119{ 117{
120 return IRQ_HANDLED; 118 return IRQ_HANDLED;
121} 119}
@@ -127,7 +125,6 @@ static struct irqaction cpm_error_irqaction = {
127}; 125};
128 126
129static struct irq_host_ops cpm_pic_host_ops = { 127static struct irq_host_ops cpm_pic_host_ops = {
130 .match = cpm_pic_host_match,
131 .map = cpm_pic_host_map, 128 .map = cpm_pic_host_map,
132}; 129};
133 130
@@ -140,16 +137,19 @@ unsigned int cpm_pic_init(void)
140 137
141 pr_debug("cpm_pic_init\n"); 138 pr_debug("cpm_pic_init\n");
142 139
143 np = of_find_compatible_node(NULL, "cpm-pic", "CPM"); 140 np = of_find_compatible_node(NULL, NULL, "fsl,cpm1-pic");
141 if (np == NULL)
142 np = of_find_compatible_node(NULL, "cpm-pic", "CPM");
144 if (np == NULL) { 143 if (np == NULL) {
145 printk(KERN_ERR "CPM PIC init: can not find cpm-pic node\n"); 144 printk(KERN_ERR "CPM PIC init: can not find cpm-pic node\n");
146 return sirq; 145 return sirq;
147 } 146 }
147
148 ret = of_address_to_resource(np, 0, &res); 148 ret = of_address_to_resource(np, 0, &res);
149 if (ret) 149 if (ret)
150 goto end; 150 goto end;
151 151
152 cpic_reg = (void *)ioremap(res.start, res.end - res.start + 1); 152 cpic_reg = ioremap(res.start, res.end - res.start + 1);
153 if (cpic_reg == NULL) 153 if (cpic_reg == NULL)
154 goto end; 154 goto end;
155 155
@@ -165,23 +165,24 @@ unsigned int cpm_pic_init(void)
165 165
166 out_be32(&cpic_reg->cpic_cimr, 0); 166 out_be32(&cpic_reg->cpic_cimr, 0);
167 167
168 cpm_pic_node = of_node_get(np); 168 cpm_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR,
169 169 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) { 170 if (cpm_pic_host == NULL) {
172 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n"); 171 printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
173 sirq = NO_IRQ; 172 sirq = NO_IRQ;
174 goto end; 173 goto end;
175 } 174 }
176 of_node_put(np);
177 175
178 /* Install our own error handler. */ 176 /* Install our own error handler. */
179 np = of_find_node_by_type(NULL, "cpm"); 177 np = of_find_compatible_node(NULL, NULL, "fsl,cpm1");
178 if (np == NULL)
179 np = of_find_node_by_type(NULL, "cpm");
180 if (np == NULL) { 180 if (np == NULL) {
181 printk(KERN_ERR "CPM PIC init: can not find cpm node\n"); 181 printk(KERN_ERR "CPM PIC init: can not find cpm node\n");
182 goto end; 182 goto end;
183 } 183 }
184 eirq= irq_of_parse_and_map(np, 0); 184
185 eirq = irq_of_parse_and_map(np, 0);
185 if (eirq == NO_IRQ) 186 if (eirq == NO_IRQ)
186 goto end; 187 goto end;
187 188
@@ -195,23 +196,30 @@ end:
195 return sirq; 196 return sirq;
196} 197}
197 198
198void cpm_reset(void) 199void __init cpm_reset(void)
199{ 200{
200 cpm8xx_t *commproc; 201 sysconf8xx_t __iomem *siu_conf;
201 sysconf8xx_t *siu_conf;
202 202
203 commproc = (cpm8xx_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE); 203 mpc8xx_immr = ioremap(get_immrbase(), 0x4000);
204 if (!mpc8xx_immr) {
205 printk(KERN_CRIT "Could not map IMMR\n");
206 return;
207 }
204 208
205#ifdef CONFIG_UCODE_PATCH 209 cpmp = &mpc8xx_immr->im_cpm;
210
211#ifndef CONFIG_PPC_EARLY_DEBUG_CPM
206 /* Perform a reset. 212 /* Perform a reset.
207 */ 213 */
208 out_be16(&commproc->cp_cpcr, CPM_CR_RST | CPM_CR_FLG); 214 out_be16(&cpmp->cp_cpcr, CPM_CR_RST | CPM_CR_FLG);
209 215
210 /* Wait for it. 216 /* Wait for it.
211 */ 217 */
212 while (in_be16(&commproc->cp_cpcr) & CPM_CR_FLG); 218 while (in_be16(&cpmp->cp_cpcr) & CPM_CR_FLG);
219#endif
213 220
214 cpm_load_patch(commproc); 221#ifdef CONFIG_UCODE_PATCH
222 cpm_load_patch(cpmp);
215#endif 223#endif
216 224
217 /* Set SDMA Bus Request priority 5. 225 /* Set SDMA Bus Request priority 5.
@@ -220,16 +228,16 @@ void cpm_reset(void)
220 * manual recommends it. 228 * manual recommends it.
221 * Bit 25, FAM can also be set to use FEC aggressive mode (860T). 229 * Bit 25, FAM can also be set to use FEC aggressive mode (860T).
222 */ 230 */
223 siu_conf = (sysconf8xx_t*)immr_map(im_siu_conf); 231 siu_conf = immr_map(im_siu_conf);
224 out_be32(&siu_conf->sc_sdcr, 1); 232 out_be32(&siu_conf->sc_sdcr, 1);
225 immr_unmap(siu_conf); 233 immr_unmap(siu_conf);
226 234
235#ifdef CONFIG_PPC_CPM_NEW_BINDING
236 cpm_muram_init();
237#else
227 /* Reclaim the DP memory for our use. */ 238 /* Reclaim the DP memory for our use. */
228 m8xx_cpm_dpinit(); 239 m8xx_cpm_dpinit();
229 240#endif
230 /* Tell everyone where the comm processor resides.
231 */
232 cpmp = commproc;
233} 241}
234 242
235/* We used to do this earlier, but have to postpone as long as possible 243/* We used to do this earlier, but have to postpone as long as possible
@@ -279,22 +287,23 @@ m8xx_cpm_hostalloc(uint size)
279void 287void
280cpm_setbrg(uint brg, uint rate) 288cpm_setbrg(uint brg, uint rate)
281{ 289{
282 volatile uint *bp; 290 u32 __iomem *bp;
283 291
284 /* This is good enough to get SMCs running..... 292 /* This is good enough to get SMCs running.....
285 */ 293 */
286 bp = (uint *)&cpmp->cp_brgc1; 294 bp = &cpmp->cp_brgc1;
287 bp += brg; 295 bp += brg;
288 /* The BRG has a 12-bit counter. For really slow baud rates (or 296 /* The BRG has a 12-bit counter. For really slow baud rates (or
289 * really fast processors), we may have to further divide by 16. 297 * really fast processors), we may have to further divide by 16.
290 */ 298 */
291 if (((BRG_UART_CLK / rate) - 1) < 4096) 299 if (((BRG_UART_CLK / rate) - 1) < 4096)
292 *bp = (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN; 300 out_be32(bp, (((BRG_UART_CLK / rate) - 1) << 1) | CPM_BRG_EN);
293 else 301 else
294 *bp = (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) | 302 out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
295 CPM_BRG_EN | CPM_BRG_DIV16; 303 CPM_BRG_EN | CPM_BRG_DIV16);
296} 304}
297 305
306#ifndef CONFIG_PPC_CPM_NEW_BINDING
298/* 307/*
299 * dpalloc / dpfree bits. 308 * dpalloc / dpfree bits.
300 */ 309 */
@@ -307,15 +316,15 @@ static rh_block_t cpm_boot_dpmem_rh_block[16];
307static rh_info_t cpm_dpmem_info; 316static rh_info_t cpm_dpmem_info;
308 317
309#define CPM_DPMEM_ALIGNMENT 8 318#define CPM_DPMEM_ALIGNMENT 8
310static u8* dpram_vbase; 319static u8 __iomem *dpram_vbase;
311static uint dpram_pbase; 320static phys_addr_t dpram_pbase;
312 321
313void m8xx_cpm_dpinit(void) 322static void m8xx_cpm_dpinit(void)
314{ 323{
315 spin_lock_init(&cpm_dpmem_lock); 324 spin_lock_init(&cpm_dpmem_lock);
316 325
317 dpram_vbase = immr_map_size(im_cpm.cp_dpmem, CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE); 326 dpram_vbase = cpmp->cp_dpmem;
318 dpram_pbase = (uint)&((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem; 327 dpram_pbase = get_immrbase() + offsetof(immap_t, im_cpm.cp_dpmem);
319 328
320 /* Initialize the info header */ 329 /* Initialize the info header */
321 rh_init(&cpm_dpmem_info, CPM_DPMEM_ALIGNMENT, 330 rh_init(&cpm_dpmem_info, CPM_DPMEM_ALIGNMENT,
@@ -391,8 +400,210 @@ void *cpm_dpram_addr(unsigned long offset)
391} 400}
392EXPORT_SYMBOL(cpm_dpram_addr); 401EXPORT_SYMBOL(cpm_dpram_addr);
393 402
394uint cpm_dpram_phys(u8* addr) 403uint cpm_dpram_phys(u8 *addr)
395{ 404{
396 return (dpram_pbase + (uint)(addr - dpram_vbase)); 405 return (dpram_pbase + (uint)(addr - dpram_vbase));
397} 406}
398EXPORT_SYMBOL(cpm_dpram_phys); 407EXPORT_SYMBOL(cpm_dpram_phys);
408#endif /* !CONFIG_PPC_CPM_NEW_BINDING */
409
410struct cpm_ioport16 {
411 __be16 dir, par, sor, dat, intr;
412 __be16 res[3];
413};
414
415struct cpm_ioport32 {
416 __be32 dir, par, sor;
417};
418
419static void cpm1_set_pin32(int port, int pin, int flags)
420{
421 struct cpm_ioport32 __iomem *iop;
422 pin = 1 << (31 - pin);
423
424 if (port == CPM_PORTB)
425 iop = (struct cpm_ioport32 __iomem *)
426 &mpc8xx_immr->im_cpm.cp_pbdir;
427 else
428 iop = (struct cpm_ioport32 __iomem *)
429 &mpc8xx_immr->im_cpm.cp_pedir;
430
431 if (flags & CPM_PIN_OUTPUT)
432 setbits32(&iop->dir, pin);
433 else
434 clrbits32(&iop->dir, pin);
435
436 if (!(flags & CPM_PIN_GPIO))
437 setbits32(&iop->par, pin);
438 else
439 clrbits32(&iop->par, pin);
440
441 if (port == CPM_PORTE) {
442 if (flags & CPM_PIN_SECONDARY)
443 setbits32(&iop->sor, pin);
444 else
445 clrbits32(&iop->sor, pin);
446
447 if (flags & CPM_PIN_OPENDRAIN)
448 setbits32(&mpc8xx_immr->im_cpm.cp_peodr, pin);
449 else
450 clrbits32(&mpc8xx_immr->im_cpm.cp_peodr, pin);
451 }
452}
453
454static void cpm1_set_pin16(int port, int pin, int flags)
455{
456 struct cpm_ioport16 __iomem *iop =
457 (struct cpm_ioport16 __iomem *)&mpc8xx_immr->im_ioport;
458
459 pin = 1 << (15 - pin);
460
461 if (port != 0)
462 iop += port - 1;
463
464 if (flags & CPM_PIN_OUTPUT)
465 setbits16(&iop->dir, pin);
466 else
467 clrbits16(&iop->dir, pin);
468
469 if (!(flags & CPM_PIN_GPIO))
470 setbits16(&iop->par, pin);
471 else
472 clrbits16(&iop->par, pin);
473
474 if (port == CPM_PORTC) {
475 if (flags & CPM_PIN_SECONDARY)
476 setbits16(&iop->sor, pin);
477 else
478 clrbits16(&iop->sor, pin);
479 }
480}
481
482void cpm1_set_pin(enum cpm_port port, int pin, int flags)
483{
484 if (port == CPM_PORTB || port == CPM_PORTE)
485 cpm1_set_pin32(port, pin, flags);
486 else
487 cpm1_set_pin16(port, pin, flags);
488}
489
490int cpm1_clk_setup(enum cpm_clk_target target, int clock, int mode)
491{
492 int shift;
493 int i, bits = 0;
494 u32 __iomem *reg;
495 u32 mask = 7;
496
497 u8 clk_map[][3] = {
498 {CPM_CLK_SCC1, CPM_BRG1, 0},
499 {CPM_CLK_SCC1, CPM_BRG2, 1},
500 {CPM_CLK_SCC1, CPM_BRG3, 2},
501 {CPM_CLK_SCC1, CPM_BRG4, 3},
502 {CPM_CLK_SCC1, CPM_CLK1, 4},
503 {CPM_CLK_SCC1, CPM_CLK2, 5},
504 {CPM_CLK_SCC1, CPM_CLK3, 6},
505 {CPM_CLK_SCC1, CPM_CLK4, 7},
506
507 {CPM_CLK_SCC2, CPM_BRG1, 0},
508 {CPM_CLK_SCC2, CPM_BRG2, 1},
509 {CPM_CLK_SCC2, CPM_BRG3, 2},
510 {CPM_CLK_SCC2, CPM_BRG4, 3},
511 {CPM_CLK_SCC2, CPM_CLK1, 4},
512 {CPM_CLK_SCC2, CPM_CLK2, 5},
513 {CPM_CLK_SCC2, CPM_CLK3, 6},
514 {CPM_CLK_SCC2, CPM_CLK4, 7},
515
516 {CPM_CLK_SCC3, CPM_BRG1, 0},
517 {CPM_CLK_SCC3, CPM_BRG2, 1},
518 {CPM_CLK_SCC3, CPM_BRG3, 2},
519 {CPM_CLK_SCC3, CPM_BRG4, 3},
520 {CPM_CLK_SCC3, CPM_CLK5, 4},
521 {CPM_CLK_SCC3, CPM_CLK6, 5},
522 {CPM_CLK_SCC3, CPM_CLK7, 6},
523 {CPM_CLK_SCC3, CPM_CLK8, 7},
524
525 {CPM_CLK_SCC4, CPM_BRG1, 0},
526 {CPM_CLK_SCC4, CPM_BRG2, 1},
527 {CPM_CLK_SCC4, CPM_BRG3, 2},
528 {CPM_CLK_SCC4, CPM_BRG4, 3},
529 {CPM_CLK_SCC4, CPM_CLK5, 4},
530 {CPM_CLK_SCC4, CPM_CLK6, 5},
531 {CPM_CLK_SCC4, CPM_CLK7, 6},
532 {CPM_CLK_SCC4, CPM_CLK8, 7},
533
534 {CPM_CLK_SMC1, CPM_BRG1, 0},
535 {CPM_CLK_SMC1, CPM_BRG2, 1},
536 {CPM_CLK_SMC1, CPM_BRG3, 2},
537 {CPM_CLK_SMC1, CPM_BRG4, 3},
538 {CPM_CLK_SMC1, CPM_CLK1, 4},
539 {CPM_CLK_SMC1, CPM_CLK2, 5},
540 {CPM_CLK_SMC1, CPM_CLK3, 6},
541 {CPM_CLK_SMC1, CPM_CLK4, 7},
542
543 {CPM_CLK_SMC2, CPM_BRG1, 0},
544 {CPM_CLK_SMC2, CPM_BRG2, 1},
545 {CPM_CLK_SMC2, CPM_BRG3, 2},
546 {CPM_CLK_SMC2, CPM_BRG4, 3},
547 {CPM_CLK_SMC2, CPM_CLK5, 4},
548 {CPM_CLK_SMC2, CPM_CLK6, 5},
549 {CPM_CLK_SMC2, CPM_CLK7, 6},
550 {CPM_CLK_SMC2, CPM_CLK8, 7},
551 };
552
553 switch (target) {
554 case CPM_CLK_SCC1:
555 reg = &mpc8xx_immr->im_cpm.cp_sicr;
556 shift = 0;
557 break;
558
559 case CPM_CLK_SCC2:
560 reg = &mpc8xx_immr->im_cpm.cp_sicr;
561 shift = 8;
562 break;
563
564 case CPM_CLK_SCC3:
565 reg = &mpc8xx_immr->im_cpm.cp_sicr;
566 shift = 16;
567 break;
568
569 case CPM_CLK_SCC4:
570 reg = &mpc8xx_immr->im_cpm.cp_sicr;
571 shift = 24;
572 break;
573
574 case CPM_CLK_SMC1:
575 reg = &mpc8xx_immr->im_cpm.cp_simode;
576 shift = 12;
577 break;
578
579 case CPM_CLK_SMC2:
580 reg = &mpc8xx_immr->im_cpm.cp_simode;
581 shift = 28;
582 break;
583
584 default:
585 printk(KERN_ERR "cpm1_clock_setup: invalid clock target\n");
586 return -EINVAL;
587 }
588
589 if (reg == &mpc8xx_immr->im_cpm.cp_sicr && mode == CPM_CLK_RX)
590 shift += 3;
591
592 for (i = 0; i < ARRAY_SIZE(clk_map); i++) {
593 if (clk_map[i][0] == target && clk_map[i][1] == clock) {
594 bits = clk_map[i][2];
595 break;
596 }
597 }
598
599 if (i == ARRAY_SIZE(clk_map)) {
600 printk(KERN_ERR "cpm1_clock_setup: invalid clock combination\n");
601 return -EINVAL;
602 }
603
604 bits <<= shift;
605 mask <<= shift;
606 out_be32(reg, (in_be32(reg) & ~mask) | bits);
607
608 return 0;
609}
diff --git a/arch/powerpc/sysdev/commproc.h b/arch/powerpc/sysdev/commproc.h
new file mode 100644
index 000000000000..9155ba467274
--- /dev/null
+++ b/arch/powerpc/sysdev/commproc.h
@@ -0,0 +1,12 @@
1#ifndef _POWERPC_SYSDEV_COMMPROC_H
2#define _POWERPC_SYSDEV_COMMPROC_H
3
4extern void cpm_reset(void);
5extern void mpc8xx_restart(char *cmd);
6extern void mpc8xx_calibrate_decr(void);
7extern int mpc8xx_set_rtc_time(struct rtc_time *tm);
8extern void mpc8xx_get_rtc_time(struct rtc_time *tm);
9extern void m8xx_pic_init(void);
10extern unsigned int mpc8xx_get_irq(void);
11
12#endif
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index c827715a5090..859362fecb7c 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -33,6 +33,8 @@
33#include <linux/mm.h> 33#include <linux/mm.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/of.h>
37
36#include <asm/io.h> 38#include <asm/io.h>
37#include <asm/irq.h> 39#include <asm/irq.h>
38#include <asm/mpc8260.h> 40#include <asm/mpc8260.h>
@@ -44,14 +46,16 @@
44 46
45#include <sysdev/fsl_soc.h> 47#include <sysdev/fsl_soc.h>
46 48
49#ifndef CONFIG_PPC_CPM_NEW_BINDING
47static void cpm2_dpinit(void); 50static void cpm2_dpinit(void);
48cpm_cpm2_t *cpmp; /* Pointer to comm processor space */ 51#endif
52
53cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */
49 54
50/* We allocate this here because it is used almost exclusively for 55/* We allocate this here because it is used almost exclusively for
51 * the communication processor devices. 56 * the communication processor devices.
52 */ 57 */
53cpm2_map_t *cpm2_immr; 58cpm2_map_t __iomem *cpm2_immr;
54intctl_cpm2_t *cpm2_intctl;
55 59
56#define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount 60#define CPM_MAP_SIZE (0x40000) /* 256k - the PQ3 reserve this amount
57 of space for CPM as it is larger 61 of space for CPM as it is larger
@@ -60,12 +64,19 @@ intctl_cpm2_t *cpm2_intctl;
60void 64void
61cpm2_reset(void) 65cpm2_reset(void)
62{ 66{
63 cpm2_immr = (cpm2_map_t *)ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE); 67#ifdef CONFIG_PPC_85xx
64 cpm2_intctl = cpm2_map(im_intctl); 68 cpm2_immr = ioremap(CPM_MAP_ADDR, CPM_MAP_SIZE);
69#else
70 cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE);
71#endif
65 72
66 /* Reclaim the DP memory for our use. 73 /* Reclaim the DP memory for our use.
67 */ 74 */
75#ifdef CONFIG_PPC_CPM_NEW_BINDING
76 cpm_muram_init();
77#else
68 cpm2_dpinit(); 78 cpm2_dpinit();
79#endif
69 80
70 /* Tell everyone where the comm processor resides. 81 /* Tell everyone where the comm processor resides.
71 */ 82 */
@@ -91,7 +102,7 @@ cpm2_reset(void)
91void 102void
92cpm_setbrg(uint brg, uint rate) 103cpm_setbrg(uint brg, uint rate)
93{ 104{
94 volatile uint *bp; 105 u32 __iomem *bp;
95 106
96 /* This is good enough to get SMCs running..... 107 /* This is good enough to get SMCs running.....
97 */ 108 */
@@ -113,7 +124,8 @@ cpm_setbrg(uint brg, uint rate)
113void 124void
114cpm2_fastbrg(uint brg, uint rate, int div16) 125cpm2_fastbrg(uint brg, uint rate, int div16)
115{ 126{
116 volatile uint *bp; 127 u32 __iomem *bp;
128 u32 val;
117 129
118 if (brg < 4) { 130 if (brg < 4) {
119 bp = cpm2_map_size(im_brgc1, 16); 131 bp = cpm2_map_size(im_brgc1, 16);
@@ -123,10 +135,11 @@ cpm2_fastbrg(uint brg, uint rate, int div16)
123 brg -= 4; 135 brg -= 4;
124 } 136 }
125 bp += brg; 137 bp += brg;
126 *bp = ((BRG_INT_CLK / rate) << 1) | CPM_BRG_EN; 138 val = ((BRG_INT_CLK / rate) << 1) | CPM_BRG_EN;
127 if (div16) 139 if (div16)
128 *bp |= CPM_BRG_DIV16; 140 val |= CPM_BRG_DIV16;
129 141
142 out_be32(bp, val);
130 cpm2_unmap(bp); 143 cpm2_unmap(bp);
131} 144}
132 145
@@ -135,10 +148,11 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode)
135 int ret = 0; 148 int ret = 0;
136 int shift; 149 int shift;
137 int i, bits = 0; 150 int i, bits = 0;
138 cpmux_t *im_cpmux; 151 cpmux_t __iomem *im_cpmux;
139 u32 *reg; 152 u32 __iomem *reg;
140 u32 mask = 7; 153 u32 mask = 7;
141 u8 clk_map [24][3] = { 154
155 u8 clk_map[][3] = {
142 {CPM_CLK_FCC1, CPM_BRG5, 0}, 156 {CPM_CLK_FCC1, CPM_BRG5, 0},
143 {CPM_CLK_FCC1, CPM_BRG6, 1}, 157 {CPM_CLK_FCC1, CPM_BRG6, 1},
144 {CPM_CLK_FCC1, CPM_BRG7, 2}, 158 {CPM_CLK_FCC1, CPM_BRG7, 2},
@@ -162,8 +176,40 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode)
162 {CPM_CLK_FCC3, CPM_CLK13, 4}, 176 {CPM_CLK_FCC3, CPM_CLK13, 4},
163 {CPM_CLK_FCC3, CPM_CLK14, 5}, 177 {CPM_CLK_FCC3, CPM_CLK14, 5},
164 {CPM_CLK_FCC3, CPM_CLK15, 6}, 178 {CPM_CLK_FCC3, CPM_CLK15, 6},
165 {CPM_CLK_FCC3, CPM_CLK16, 7} 179 {CPM_CLK_FCC3, CPM_CLK16, 7},
166 }; 180 {CPM_CLK_SCC1, CPM_BRG1, 0},
181 {CPM_CLK_SCC1, CPM_BRG2, 1},
182 {CPM_CLK_SCC1, CPM_BRG3, 2},
183 {CPM_CLK_SCC1, CPM_BRG4, 3},
184 {CPM_CLK_SCC1, CPM_CLK11, 4},
185 {CPM_CLK_SCC1, CPM_CLK12, 5},
186 {CPM_CLK_SCC1, CPM_CLK3, 6},
187 {CPM_CLK_SCC1, CPM_CLK4, 7},
188 {CPM_CLK_SCC2, CPM_BRG1, 0},
189 {CPM_CLK_SCC2, CPM_BRG2, 1},
190 {CPM_CLK_SCC2, CPM_BRG3, 2},
191 {CPM_CLK_SCC2, CPM_BRG4, 3},
192 {CPM_CLK_SCC2, CPM_CLK11, 4},
193 {CPM_CLK_SCC2, CPM_CLK12, 5},
194 {CPM_CLK_SCC2, CPM_CLK3, 6},
195 {CPM_CLK_SCC2, CPM_CLK4, 7},
196 {CPM_CLK_SCC3, CPM_BRG1, 0},
197 {CPM_CLK_SCC3, CPM_BRG2, 1},
198 {CPM_CLK_SCC3, CPM_BRG3, 2},
199 {CPM_CLK_SCC3, CPM_BRG4, 3},
200 {CPM_CLK_SCC3, CPM_CLK5, 4},
201 {CPM_CLK_SCC3, CPM_CLK6, 5},
202 {CPM_CLK_SCC3, CPM_CLK7, 6},
203 {CPM_CLK_SCC3, CPM_CLK8, 7},
204 {CPM_CLK_SCC4, CPM_BRG1, 0},
205 {CPM_CLK_SCC4, CPM_BRG2, 1},
206 {CPM_CLK_SCC4, CPM_BRG3, 2},
207 {CPM_CLK_SCC4, CPM_BRG4, 3},
208 {CPM_CLK_SCC4, CPM_CLK5, 4},
209 {CPM_CLK_SCC4, CPM_CLK6, 5},
210 {CPM_CLK_SCC4, CPM_CLK7, 6},
211 {CPM_CLK_SCC4, CPM_CLK8, 7},
212 };
167 213
168 im_cpmux = cpm2_map(im_cpmux); 214 im_cpmux = cpm2_map(im_cpmux);
169 215
@@ -201,25 +247,83 @@ int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode)
201 } 247 }
202 248
203 if (mode == CPM_CLK_RX) 249 if (mode == CPM_CLK_RX)
204 shift +=3; 250 shift += 3;
205 251
206 for (i=0; i<24; i++) { 252 for (i = 0; i < ARRAY_SIZE(clk_map); i++) {
207 if (clk_map[i][0] == target && clk_map[i][1] == clock) { 253 if (clk_map[i][0] == target && clk_map[i][1] == clock) {
208 bits = clk_map[i][2]; 254 bits = clk_map[i][2];
209 break; 255 break;
210 } 256 }
211 } 257 }
212 if (i == sizeof(clk_map)/3) 258 if (i == ARRAY_SIZE(clk_map))
213 ret = -EINVAL; 259 ret = -EINVAL;
214 260
215 bits <<= shift; 261 bits <<= shift;
216 mask <<= shift; 262 mask <<= shift;
263
217 out_be32(reg, (in_be32(reg) & ~mask) | bits); 264 out_be32(reg, (in_be32(reg) & ~mask) | bits);
218 265
219 cpm2_unmap(im_cpmux); 266 cpm2_unmap(im_cpmux);
220 return ret; 267 return ret;
221} 268}
222 269
270int cpm2_smc_clk_setup(enum cpm_clk_target target, int clock)
271{
272 int ret = 0;
273 int shift;
274 int i, bits = 0;
275 cpmux_t __iomem *im_cpmux;
276 u8 __iomem *reg;
277 u8 mask = 3;
278
279 u8 clk_map[][3] = {
280 {CPM_CLK_SMC1, CPM_BRG1, 0},
281 {CPM_CLK_SMC1, CPM_BRG7, 1},
282 {CPM_CLK_SMC1, CPM_CLK7, 2},
283 {CPM_CLK_SMC1, CPM_CLK9, 3},
284 {CPM_CLK_SMC2, CPM_BRG2, 0},
285 {CPM_CLK_SMC2, CPM_BRG8, 1},
286 {CPM_CLK_SMC2, CPM_CLK4, 2},
287 {CPM_CLK_SMC2, CPM_CLK15, 3},
288 };
289
290 im_cpmux = cpm2_map(im_cpmux);
291
292 switch (target) {
293 case CPM_CLK_SMC1:
294 reg = &im_cpmux->cmx_smr;
295 mask = 3;
296 shift = 4;
297 break;
298 case CPM_CLK_SMC2:
299 reg = &im_cpmux->cmx_smr;
300 mask = 3;
301 shift = 0;
302 break;
303 default:
304 printk(KERN_ERR "cpm2_smc_clock_setup: invalid clock target\n");
305 return -EINVAL;
306 }
307
308 for (i = 0; i < ARRAY_SIZE(clk_map); i++) {
309 if (clk_map[i][0] == target && clk_map[i][1] == clock) {
310 bits = clk_map[i][2];
311 break;
312 }
313 }
314 if (i == ARRAY_SIZE(clk_map))
315 ret = -EINVAL;
316
317 bits <<= shift;
318 mask <<= shift;
319
320 out_8(reg, (in_8(reg) & ~mask) | bits);
321
322 cpm2_unmap(im_cpmux);
323 return ret;
324}
325
326#ifndef CONFIG_PPC_CPM_NEW_BINDING
223/* 327/*
224 * dpalloc / dpfree bits. 328 * dpalloc / dpfree bits.
225 */ 329 */
@@ -228,20 +332,20 @@ static spinlock_t cpm_dpmem_lock;
228 * until the memory subsystem goes up... */ 332 * until the memory subsystem goes up... */
229static rh_block_t cpm_boot_dpmem_rh_block[16]; 333static rh_block_t cpm_boot_dpmem_rh_block[16];
230static rh_info_t cpm_dpmem_info; 334static rh_info_t cpm_dpmem_info;
231static u8* im_dprambase; 335static u8 __iomem *im_dprambase;
232 336
233static void cpm2_dpinit(void) 337static void cpm2_dpinit(void)
234{ 338{
235 spin_lock_init(&cpm_dpmem_lock); 339 spin_lock_init(&cpm_dpmem_lock);
236 340
237 im_dprambase = ioremap(CPM_MAP_ADDR, CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE);
238
239 /* initialize the info header */ 341 /* initialize the info header */
240 rh_init(&cpm_dpmem_info, 1, 342 rh_init(&cpm_dpmem_info, 1,
241 sizeof(cpm_boot_dpmem_rh_block) / 343 sizeof(cpm_boot_dpmem_rh_block) /
242 sizeof(cpm_boot_dpmem_rh_block[0]), 344 sizeof(cpm_boot_dpmem_rh_block[0]),
243 cpm_boot_dpmem_rh_block); 345 cpm_boot_dpmem_rh_block);
244 346
347 im_dprambase = cpm2_immr;
348
245 /* Attach the usable dpmem area */ 349 /* Attach the usable dpmem area */
246 /* XXX: This is actually crap. CPM_DATAONLY_BASE and 350 /* XXX: This is actually crap. CPM_DATAONLY_BASE and
247 * CPM_DATAONLY_SIZE is only a subset of the available dpram. It 351 * CPM_DATAONLY_SIZE is only a subset of the available dpram. It
@@ -306,3 +410,37 @@ void *cpm_dpram_addr(unsigned long offset)
306 return (void *)(im_dprambase + offset); 410 return (void *)(im_dprambase + offset);
307} 411}
308EXPORT_SYMBOL(cpm_dpram_addr); 412EXPORT_SYMBOL(cpm_dpram_addr);
413#endif /* !CONFIG_PPC_CPM_NEW_BINDING */
414
415struct cpm2_ioports {
416 u32 dir, par, sor, odr, dat;
417 u32 res[3];
418};
419
420void cpm2_set_pin(int port, int pin, int flags)
421{
422 struct cpm2_ioports __iomem *iop =
423 (struct cpm2_ioports __iomem *)&cpm2_immr->im_ioport;
424
425 pin = 1 << (31 - pin);
426
427 if (flags & CPM_PIN_OUTPUT)
428 setbits32(&iop[port].dir, pin);
429 else
430 clrbits32(&iop[port].dir, pin);
431
432 if (!(flags & CPM_PIN_GPIO))
433 setbits32(&iop[port].par, pin);
434 else
435 clrbits32(&iop[port].par, pin);
436
437 if (flags & CPM_PIN_SECONDARY)
438 setbits32(&iop[port].sor, pin);
439 else
440 clrbits32(&iop[port].sor, pin);
441
442 if (flags & CPM_PIN_OPENDRAIN)
443 setbits32(&iop[port].odr, pin);
444 else
445 clrbits32(&iop[port].odr, pin);
446}
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
index eabfe06fe05c..5fe65b2f8f3a 100644
--- a/arch/powerpc/sysdev/cpm2_pic.c
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -48,9 +48,8 @@
48#define CPM2_IRQ_PORTC15 48 48#define CPM2_IRQ_PORTC15 48
49#define CPM2_IRQ_PORTC0 63 49#define CPM2_IRQ_PORTC0 63
50 50
51static intctl_cpm2_t *cpm2_intctl; 51static intctl_cpm2_t __iomem *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/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
new file mode 100644
index 000000000000..66c8ad4cfce6
--- /dev/null
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -0,0 +1,205 @@
1/*
2 * Common CPM code
3 *
4 * Author: Scott Wood <scottwood@freescale.com>
5 *
6 * Copyright 2007 Freescale Semiconductor, Inc.
7 *
8 * Some parts derived from commproc.c/cpm2_common.c, which is:
9 * Copyright (c) 1997 Dan error_act (dmalek@jlc.net)
10 * Copyright (c) 1999-2001 Dan Malek <dan@embeddedalley.com>
11 * Copyright (c) 2000 MontaVista Software, Inc (source@mvista.com)
12 * 2006 (c) MontaVista Software, Inc.
13 * Vitaly Bordug <vbordug@ru.mvista.com>
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of version 2 of the GNU General Public License as
17 * published by the Free Software Foundation.
18 */
19
20#include <linux/init.h>
21#include <linux/of_device.h>
22
23#include <asm/udbg.h>
24#include <asm/io.h>
25#include <asm/system.h>
26#include <asm/rheap.h>
27#include <asm/cpm.h>
28
29#include <mm/mmu_decl.h>
30
31#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
32static u32 __iomem *cpm_udbg_txdesc =
33 (u32 __iomem __force *)CONFIG_PPC_EARLY_DEBUG_CPM_ADDR;
34
35static void udbg_putc_cpm(char c)
36{
37 u8 __iomem *txbuf = (u8 __iomem __force *)in_be32(&cpm_udbg_txdesc[1]);
38
39 if (c == '\n')
40 udbg_putc('\r');
41
42 while (in_be32(&cpm_udbg_txdesc[0]) & 0x80000000)
43 ;
44
45 out_8(txbuf, c);
46 out_be32(&cpm_udbg_txdesc[0], 0xa0000001);
47}
48
49void __init udbg_init_cpm(void)
50{
51 if (cpm_udbg_txdesc) {
52#ifdef CONFIG_CPM2
53 setbat(1, 0xf0000000, 0xf0000000, 1024*1024, _PAGE_IO);
54#endif
55 udbg_putc = udbg_putc_cpm;
56 udbg_putc('X');
57 }
58}
59#endif
60
61#ifdef CONFIG_PPC_CPM_NEW_BINDING
62static spinlock_t cpm_muram_lock;
63static rh_block_t cpm_boot_muram_rh_block[16];
64static rh_info_t cpm_muram_info;
65static u8 __iomem *muram_vbase;
66static phys_addr_t muram_pbase;
67
68/* Max address size we deal with */
69#define OF_MAX_ADDR_CELLS 4
70
71int __init cpm_muram_init(void)
72{
73 struct device_node *np;
74 struct resource r;
75 u32 zero[OF_MAX_ADDR_CELLS] = {};
76 resource_size_t max = 0;
77 int i = 0;
78 int ret = 0;
79
80 printk("cpm_muram_init\n");
81
82 spin_lock_init(&cpm_muram_lock);
83 /* initialize the info header */
84 rh_init(&cpm_muram_info, 1,
85 sizeof(cpm_boot_muram_rh_block) /
86 sizeof(cpm_boot_muram_rh_block[0]),
87 cpm_boot_muram_rh_block);
88
89 np = of_find_compatible_node(NULL, NULL, "fsl,cpm-muram-data");
90 if (!np) {
91 printk(KERN_ERR "Cannot find CPM muram data node");
92 ret = -ENODEV;
93 goto out;
94 }
95
96 muram_pbase = of_translate_address(np, zero);
97 if (muram_pbase == (phys_addr_t)OF_BAD_ADDR) {
98 printk(KERN_ERR "Cannot translate zero through CPM muram node");
99 ret = -ENODEV;
100 goto out;
101 }
102
103 while (of_address_to_resource(np, i++, &r) == 0) {
104 if (r.end > max)
105 max = r.end;
106
107 rh_attach_region(&cpm_muram_info, r.start - muram_pbase,
108 r.end - r.start + 1);
109 }
110
111 muram_vbase = ioremap(muram_pbase, max - muram_pbase + 1);
112 if (!muram_vbase) {
113 printk(KERN_ERR "Cannot map CPM muram");
114 ret = -ENOMEM;
115 }
116
117out:
118 of_node_put(np);
119 return ret;
120}
121
122/**
123 * cpm_muram_alloc - allocate the requested size worth of multi-user ram
124 * @size: number of bytes to allocate
125 * @align: requested alignment, in bytes
126 *
127 * This function returns an offset into the muram area.
128 * Use cpm_dpram_addr() to get the virtual address of the area.
129 * Use cpm_muram_free() to free the allocation.
130 */
131unsigned long cpm_muram_alloc(unsigned long size, unsigned long align)
132{
133 unsigned long start;
134 unsigned long flags;
135
136 spin_lock_irqsave(&cpm_muram_lock, flags);
137 cpm_muram_info.alignment = align;
138 start = rh_alloc(&cpm_muram_info, size, "commproc");
139 spin_unlock_irqrestore(&cpm_muram_lock, flags);
140
141 return start;
142}
143EXPORT_SYMBOL(cpm_muram_alloc);
144
145/**
146 * cpm_muram_free - free a chunk of multi-user ram
147 * @offset: The beginning of the chunk as returned by cpm_muram_alloc().
148 */
149int cpm_muram_free(unsigned long offset)
150{
151 int ret;
152 unsigned long flags;
153
154 spin_lock_irqsave(&cpm_muram_lock, flags);
155 ret = rh_free(&cpm_muram_info, offset);
156 spin_unlock_irqrestore(&cpm_muram_lock, flags);
157
158 return ret;
159}
160EXPORT_SYMBOL(cpm_muram_free);
161
162/**
163 * cpm_muram_alloc_fixed - reserve a specific region of multi-user ram
164 * @offset: the offset into the muram area to reserve
165 * @size: the number of bytes to reserve
166 *
167 * This function returns "start" on success, -ENOMEM on failure.
168 * Use cpm_dpram_addr() to get the virtual address of the area.
169 * Use cpm_muram_free() to free the allocation.
170 */
171unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size)
172{
173 unsigned long start;
174 unsigned long flags;
175
176 spin_lock_irqsave(&cpm_muram_lock, flags);
177 cpm_muram_info.alignment = 1;
178 start = rh_alloc_fixed(&cpm_muram_info, offset, size, "commproc");
179 spin_unlock_irqrestore(&cpm_muram_lock, flags);
180
181 return start;
182}
183EXPORT_SYMBOL(cpm_muram_alloc_fixed);
184
185/**
186 * cpm_muram_addr - turn a muram offset into a virtual address
187 * @offset: muram offset to convert
188 */
189void __iomem *cpm_muram_addr(unsigned long offset)
190{
191 return muram_vbase + offset;
192}
193EXPORT_SYMBOL(cpm_muram_addr);
194
195/**
196 * cpm_muram_phys - turn a muram virtual address into a DMA address
197 * @offset: virtual address from cpm_muram_addr() to convert
198 */
199dma_addr_t cpm_muram_dma(void __iomem *addr)
200{
201 return muram_pbase + ((u8 __iomem *)addr - muram_vbase);
202}
203EXPORT_SYMBOL(cpm_muram_dma);
204
205#endif /* CONFIG_PPC_CPM_NEW_BINDING */
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..af090c93be10 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -160,8 +160,8 @@ static void __init quirk_fsl_pcie_transparent(struct pci_dev *dev)
160 160
161int __init fsl_pcie_check_link(struct pci_controller *hose) 161int __init fsl_pcie_check_link(struct pci_controller *hose)
162{ 162{
163 u16 val; 163 u32 val;
164 early_read_config_word(hose, 0, 0, PCIE_LTSSM, &val); 164 early_read_config_dword(hose, 0, 0, PCIE_LTSSM, &val);
165 if (val < PCIE_LTSSM_L0) 165 if (val < PCIE_LTSSM_L0)
166 return 1; 166 return 1;
167 return 0; 167 return 0;
@@ -255,5 +255,8 @@ 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);
262DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_transparent);
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 1cf29c9d4408..3ace7474809e 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}
@@ -72,20 +73,31 @@ static u32 brgfreq = -1;
72u32 get_brgfreq(void) 73u32 get_brgfreq(void)
73{ 74{
74 struct device_node *node; 75 struct device_node *node;
76 const unsigned int *prop;
77 int size;
75 78
76 if (brgfreq != -1) 79 if (brgfreq != -1)
77 return brgfreq; 80 return brgfreq;
78 81
79 node = of_find_node_by_type(NULL, "cpm"); 82 node = of_find_compatible_node(NULL, NULL, "fsl,cpm-brg");
80 if (node) { 83 if (node) {
81 unsigned int size; 84 prop = of_get_property(node, "clock-frequency", &size);
82 const unsigned int *prop = of_get_property(node, 85 if (prop && size == 4)
83 "brg-frequency", &size); 86 brgfreq = *prop;
84 87
85 if (prop) 88 of_node_put(node);
89 return brgfreq;
90 }
91
92 /* Legacy device binding -- will go away when no users are left. */
93 node = of_find_node_by_type(NULL, "cpm");
94 if (node) {
95 prop = of_get_property(node, "brg-frequency", &size);
96 if (prop && size == 4)
86 brgfreq = *prop; 97 brgfreq = *prop;
98
87 of_node_put(node); 99 of_node_put(node);
88 }; 100 }
89 101
90 return brgfreq; 102 return brgfreq;
91} 103}
@@ -103,14 +115,14 @@ u32 get_baudrate(void)
103 115
104 node = of_find_node_by_type(NULL, "serial"); 116 node = of_find_node_by_type(NULL, "serial");
105 if (node) { 117 if (node) {
106 unsigned int size; 118 int size;
107 const unsigned int *prop = of_get_property(node, 119 const unsigned int *prop = of_get_property(node,
108 "current-speed", &size); 120 "current-speed", &size);
109 121
110 if (prop) 122 if (prop)
111 fs_baudrate = *prop; 123 fs_baudrate = *prop;
112 of_node_put(node); 124 of_node_put(node);
113 }; 125 }
114 126
115 return fs_baudrate; 127 return fs_baudrate;
116} 128}
@@ -319,34 +331,46 @@ static struct i2c_driver_device i2c_devices[] __initdata = {
319 {"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",}, 331 {"ricoh,rs5c372b", "rtc-rs5c372", "rs5c372b",},
320 {"ricoh,rv5c386", "rtc-rs5c372", "rv5c386",}, 332 {"ricoh,rv5c386", "rtc-rs5c372", "rv5c386",},
321 {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",}, 333 {"ricoh,rv5c387a", "rtc-rs5c372", "rv5c387a",},
334 {"dallas,ds1307", "rtc-ds1307", "ds1307",},
335 {"dallas,ds1337", "rtc-ds1307", "ds1337",},
336 {"dallas,ds1338", "rtc-ds1307", "ds1338",},
337 {"dallas,ds1339", "rtc-ds1307", "ds1339",},
338 {"dallas,ds1340", "rtc-ds1307", "ds1340",},
339 {"stm,m41t00", "rtc-ds1307", "m41t00"},
340 {"dallas,ds1374", "rtc-ds1374", "rtc-ds1374",},
322}; 341};
323 342
324static int __init of_find_i2c_driver(struct device_node *node, struct i2c_board_info *info) 343static int __init of_find_i2c_driver(struct device_node *node,
344 struct i2c_board_info *info)
325{ 345{
326 int i; 346 int i;
327 347
328 for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) { 348 for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
329 if (!of_device_is_compatible(node, i2c_devices[i].of_device)) 349 if (!of_device_is_compatible(node, i2c_devices[i].of_device))
330 continue; 350 continue;
331 strncpy(info->driver_name, i2c_devices[i].i2c_driver, KOBJ_NAME_LEN); 351 if (strlcpy(info->driver_name, i2c_devices[i].i2c_driver,
332 strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE); 352 KOBJ_NAME_LEN) >= KOBJ_NAME_LEN ||
353 strlcpy(info->type, i2c_devices[i].i2c_type,
354 I2C_NAME_SIZE) >= I2C_NAME_SIZE)
355 return -ENOMEM;
333 return 0; 356 return 0;
334 } 357 }
335 return -ENODEV; 358 return -ENODEV;
336} 359}
337 360
338static void __init of_register_i2c_devices(struct device_node *adap_node, int bus_num) 361static void __init of_register_i2c_devices(struct device_node *adap_node,
362 int bus_num)
339{ 363{
340 struct device_node *node = NULL; 364 struct device_node *node = NULL;
341 365
342 while ((node = of_get_next_child(adap_node, node))) { 366 while ((node = of_get_next_child(adap_node, node))) {
343 struct i2c_board_info info; 367 struct i2c_board_info info = {};
344 const u32 *addr; 368 const u32 *addr;
345 int len; 369 int len;
346 370
347 addr = of_get_property(node, "reg", &len); 371 addr = of_get_property(node, "reg", &len);
348 if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) { 372 if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) {
349 printk(KERN_WARNING "fsl_ioc.c: invalid i2c device entry\n"); 373 printk(KERN_WARNING "fsl_soc.c: invalid i2c device entry\n");
350 continue; 374 continue;
351 } 375 }
352 376
@@ -357,7 +381,6 @@ static void __init of_register_i2c_devices(struct device_node *adap_node, int bu
357 if (of_find_i2c_driver(node, &info) < 0) 381 if (of_find_i2c_driver(node, &info) < 0)
358 continue; 382 continue;
359 383
360 info.platform_data = NULL;
361 info.addr = *addr; 384 info.addr = *addr;
362 385
363 i2c_register_board_info(bus_num, &info, 1); 386 i2c_register_board_info(bus_num, &info, 1);
@@ -648,6 +671,7 @@ err:
648 671
649arch_initcall(fsl_usb_of_init); 672arch_initcall(fsl_usb_of_init);
650 673
674#ifndef CONFIG_PPC_CPM_NEW_BINDING
651#ifdef CONFIG_CPM2 675#ifdef CONFIG_CPM2
652 676
653extern void init_scc_ioports(struct fs_uart_platform_info*); 677extern void init_scc_ioports(struct fs_uart_platform_info*);
@@ -1187,3 +1211,132 @@ err:
1187arch_initcall(cpm_smc_uart_of_init); 1211arch_initcall(cpm_smc_uart_of_init);
1188 1212
1189#endif /* CONFIG_8xx */ 1213#endif /* CONFIG_8xx */
1214#endif /* CONFIG_PPC_CPM_NEW_BINDING */
1215
1216int __init fsl_spi_init(struct spi_board_info *board_infos,
1217 unsigned int num_board_infos,
1218 void (*activate_cs)(u8 cs, u8 polarity),
1219 void (*deactivate_cs)(u8 cs, u8 polarity))
1220{
1221 struct device_node *np;
1222 unsigned int i;
1223 const u32 *sysclk;
1224
1225 /* SPI controller is either clocked from QE or SoC clock */
1226 np = of_find_node_by_type(NULL, "qe");
1227 if (!np)
1228 np = of_find_node_by_type(NULL, "soc");
1229
1230 if (!np)
1231 return -ENODEV;
1232
1233 sysclk = of_get_property(np, "bus-frequency", NULL);
1234 if (!sysclk)
1235 return -ENODEV;
1236
1237 for (np = NULL, i = 1;
1238 (np = of_find_compatible_node(np, "spi", "fsl_spi")) != NULL;
1239 i++) {
1240 int ret = 0;
1241 unsigned int j;
1242 const void *prop;
1243 struct resource res[2];
1244 struct platform_device *pdev;
1245 struct fsl_spi_platform_data pdata = {
1246 .activate_cs = activate_cs,
1247 .deactivate_cs = deactivate_cs,
1248 };
1249
1250 memset(res, 0, sizeof(res));
1251
1252 pdata.sysclk = *sysclk;
1253
1254 prop = of_get_property(np, "reg", NULL);
1255 if (!prop)
1256 goto err;
1257 pdata.bus_num = *(u32 *)prop;
1258
1259 prop = of_get_property(np, "mode", NULL);
1260 if (prop && !strcmp(prop, "cpu-qe"))
1261 pdata.qe_mode = 1;
1262
1263 for (j = 0; j < num_board_infos; j++) {
1264 if (board_infos[j].bus_num == pdata.bus_num)
1265 pdata.max_chipselect++;
1266 }
1267
1268 if (!pdata.max_chipselect)
1269 goto err;
1270
1271 ret = of_address_to_resource(np, 0, &res[0]);
1272 if (ret)
1273 goto err;
1274
1275 ret = of_irq_to_resource(np, 0, &res[1]);
1276 if (ret == NO_IRQ)
1277 goto err;
1278
1279 pdev = platform_device_alloc("mpc83xx_spi", i);
1280 if (!pdev)
1281 goto err;
1282
1283 ret = platform_device_add_data(pdev, &pdata, sizeof(pdata));
1284 if (ret)
1285 goto unreg;
1286
1287 ret = platform_device_add_resources(pdev, res,
1288 ARRAY_SIZE(res));
1289 if (ret)
1290 goto unreg;
1291
1292 ret = platform_device_register(pdev);
1293 if (ret)
1294 goto unreg;
1295
1296 continue;
1297unreg:
1298 platform_device_del(pdev);
1299err:
1300 continue;
1301 }
1302
1303 return spi_register_board_info(board_infos, num_board_infos);
1304}
1305
1306#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx)
1307static __be32 __iomem *rstcr;
1308
1309static int __init setup_rstcr(void)
1310{
1311 struct device_node *np;
1312 np = of_find_node_by_name(NULL, "global-utilities");
1313 if ((np && of_get_property(np, "fsl,has-rstcr", NULL))) {
1314 const u32 *prop = of_get_property(np, "reg", NULL);
1315 if (prop) {
1316 /* map reset control register
1317 * 0xE00B0 is offset of reset control register
1318 */
1319 rstcr = ioremap(get_immrbase() + *prop + 0xB0, 0xff);
1320 if (!rstcr)
1321 printk (KERN_EMERG "Error: reset control "
1322 "register not mapped!\n");
1323 }
1324 } else
1325 printk (KERN_INFO "rstcr compatible register does not exist!\n");
1326 if (np)
1327 of_node_put(np);
1328 return 0;
1329}
1330
1331arch_initcall(setup_rstcr);
1332
1333void fsl_rstcr_restart(char *cmd)
1334{
1335 local_irq_disable();
1336 if (rstcr)
1337 /* set reset control register */
1338 out_be32(rstcr, 0x2); /* HRESET_REQ */
1339
1340 while (1) ;
1341}
1342#endif
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h
index 04e145b5fc32..63e7db30a4cd 100644
--- a/arch/powerpc/sysdev/fsl_soc.h
+++ b/arch/powerpc/sysdev/fsl_soc.h
@@ -8,5 +8,13 @@ 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
18extern void fsl_rstcr_restart(char *cmd);
11#endif 19#endif
12#endif 20#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..cfbd2aae93e8 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -144,14 +144,16 @@ 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
152setup_indirect_pci(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data, u32 flags) 152setup_indirect_pci(struct pci_controller* hose,
153 resource_size_t cfg_addr,
154 resource_size_t cfg_data, u32 flags)
153{ 155{
154 unsigned long base = cfg_addr & PAGE_MASK; 156 resource_size_t base = cfg_addr & PAGE_MASK;
155 void __iomem *mbase; 157 void __iomem *mbase;
156 158
157 mbase = ioremap(base, PAGE_SIZE); 159 mbase = ioremap(base, PAGE_SIZE);
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..7aa4ff5f5ec8 100644
--- a/arch/powerpc/sysdev/mpc8xx_pic.c
+++ b/arch/powerpc/sysdev/mpc8xx_pic.c
@@ -19,11 +19,10 @@
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];
26static sysconf8xx_t *siu_reg; 25static sysconf8xx_t __iomem *siu_reg;
27 26
28int cpm_get_irq(struct pt_regs *regs); 27int cpm_get_irq(struct pt_regs *regs);
29 28
@@ -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};
@@ -166,32 +159,33 @@ static struct irq_host_ops mpc8xx_pic_host_ops = {
166int mpc8xx_pic_init(void) 159int mpc8xx_pic_init(void)
167{ 160{
168 struct resource res; 161 struct resource res;
169 struct device_node *np = NULL; 162 struct device_node *np;
170 int ret; 163 int ret;
171 164
172 np = of_find_node_by_type(np, "mpc8xx-pic"); 165 np = of_find_compatible_node(NULL, NULL, "fsl,pq1-pic");
173 166 if (np == NULL)
167 np = of_find_node_by_type(NULL, "mpc8xx-pic");
174 if (np == NULL) { 168 if (np == NULL) {
175 printk(KERN_ERR "Could not find open-pic node\n"); 169 printk(KERN_ERR "Could not find fsl,pq1-pic node\n");
176 return -ENOMEM; 170 return -ENOMEM;
177 } 171 }
178 172
179 mpc8xx_pic_node = of_node_get(np);
180
181 ret = of_address_to_resource(np, 0, &res); 173 ret = of_address_to_resource(np, 0, &res);
182 of_node_put(np);
183 if (ret) 174 if (ret)
184 return ret; 175 goto out;
185 176
186 siu_reg = (void *)ioremap(res.start, res.end - res.start + 1); 177 siu_reg = ioremap(res.start, res.end - res.start + 1);
187 if (siu_reg == NULL) 178 if (siu_reg == NULL)
188 return -EINVAL; 179 return -EINVAL;
189 180
190 mpc8xx_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 64, &mpc8xx_pic_host_ops, 64); 181 mpc8xx_pic_host = irq_alloc_host(of_node_get(np), IRQ_HOST_MAP_LINEAR,
182 64, &mpc8xx_pic_host_ops, 64);
191 if (mpc8xx_pic_host == NULL) { 183 if (mpc8xx_pic_host == NULL) {
192 printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n"); 184 printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
193 ret = -ENOMEM; 185 ret = -ENOMEM;
194 } 186 }
195 187
188out:
189 of_node_put(np);
196 return ret; 190 return ret;
197} 191}
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/pmi.c b/arch/powerpc/sysdev/pmi.c
index 2f91b55b7754..20edd1e94eff 100644
--- a/arch/powerpc/sysdev/pmi.c
+++ b/arch/powerpc/sysdev/pmi.c
@@ -205,10 +205,12 @@ static int pmi_of_remove(struct of_device *dev)
205} 205}
206 206
207static struct of_platform_driver pmi_of_platform_driver = { 207static struct of_platform_driver pmi_of_platform_driver = {
208 .name = "pmi",
209 .match_table = pmi_match, 208 .match_table = pmi_match,
210 .probe = pmi_of_probe, 209 .probe = pmi_of_probe,
211 .remove = pmi_of_remove 210 .remove = pmi_of_remove,
211 .driver = {
212 .name = "pmi",
213 },
212}; 214};
213 215
214static int __init pmi_module_init(void) 216static int __init pmi_module_init(void)
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 90f87408b5d5..3d57d3835b04 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -141,7 +141,7 @@ EXPORT_SYMBOL(qe_issue_cmd);
141 * 16 BRGs, which can be connected to the QE channels or output 141 * 16 BRGs, which can be connected to the QE channels or output
142 * as clocks. The BRGs are in two different block of internal 142 * as clocks. The BRGs are in two different block of internal
143 * memory mapped space. 143 * memory mapped space.
144 * The baud rate clock is the system clock divided by something. 144 * The BRG clock is the QE clock divided by 2.
145 * It was set up long ago during the initial boot phase and is 145 * It was set up long ago during the initial boot phase and is
146 * is given to us. 146 * is given to us.
147 * Baud rate clocks are zero-based in the driver code (as that maps 147 * Baud rate clocks are zero-based in the driver code (as that maps
@@ -165,28 +165,38 @@ unsigned int get_brg_clk(void)
165 return brg_clk; 165 return brg_clk;
166} 166}
167 167
168/* This function is used by UARTS, or anything else that uses a 16x 168/* Program the BRG to the given sampling rate and multiplier
169 * oversampled clock. 169 *
170 * @brg: the BRG, 1-16
171 * @rate: the desired sampling rate
172 * @multiplier: corresponds to the value programmed in GUMR_L[RDCR] or
173 * GUMR_L[TDCR]. E.g., if this BRG is the RX clock, and GUMR_L[RDCR]=01,
174 * then 'multiplier' should be 8.
175 *
176 * Also note that the value programmed into the BRGC register must be even.
170 */ 177 */
171void qe_setbrg(u32 brg, u32 rate) 178void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier)
172{ 179{
173 volatile u32 *bp;
174 u32 divisor, tempval; 180 u32 divisor, tempval;
175 int div16 = 0; 181 u32 div16 = 0;
176 182
177 bp = &qe_immr->brg.brgc[brg]; 183 divisor = get_brg_clk() / (rate * multiplier);
178 184
179 divisor = (get_brg_clk() / rate);
180 if (divisor > QE_BRGC_DIVISOR_MAX + 1) { 185 if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
181 div16 = 1; 186 div16 = QE_BRGC_DIV16;
182 divisor /= 16; 187 divisor /= 16;
183 } 188 }
184 189
185 tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) | QE_BRGC_ENABLE; 190 /* Errata QE_General4, which affects some MPC832x and MPC836x SOCs, says
186 if (div16) 191 that the BRG divisor must be even if you're not using divide-by-16
187 tempval |= QE_BRGC_DIV16; 192 mode. */
193 if (!div16 && (divisor & 1))
194 divisor++;
195
196 tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
197 QE_BRGC_ENABLE | div16;
188 198
189 out_be32(bp, tempval); 199 out_be32(&qe_immr->brg.brgc[brg - 1], tempval);
190} 200}
191 201
192/* Initialize SNUMs (thread serial numbers) according to 202/* Initialize SNUMs (thread serial numbers) according to
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 4d1dcb45963d..e1c0fd6dbc1a 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,
@@ -323,25 +321,9 @@ unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic)
323 return irq_linear_revmap(qe_ic->irqhost, irq); 321 return irq_linear_revmap(qe_ic->irqhost, irq);
324} 322}
325 323
326void qe_ic_cascade_low(unsigned int irq, struct irq_desc *desc) 324void __init qe_ic_init(struct device_node *node, unsigned int flags,
327{ 325 void (*low_handler)(unsigned int irq, struct irq_desc *desc),
328 struct qe_ic *qe_ic = desc->handler_data; 326 void (*high_handler)(unsigned int irq, struct irq_desc *desc))
329 unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
330
331 if (cascade_irq != NO_IRQ)
332 generic_handle_irq(cascade_irq);
333}
334
335void qe_ic_cascade_high(unsigned int irq, struct irq_desc *desc)
336{
337 struct qe_ic *qe_ic = desc->handler_data;
338 unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
339
340 if (cascade_irq != NO_IRQ)
341 generic_handle_irq(cascade_irq);
342}
343
344void __init qe_ic_init(struct device_node *node, unsigned int flags)
345{ 327{
346 struct qe_ic *qe_ic; 328 struct qe_ic *qe_ic;
347 struct resource res; 329 struct resource res;
@@ -352,9 +334,8 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags)
352 return; 334 return;
353 335
354 memset(qe_ic, 0, sizeof(struct qe_ic)); 336 memset(qe_ic, 0, sizeof(struct qe_ic));
355 qe_ic->of_node = of_node_get(node);
356 337
357 qe_ic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 338 qe_ic->irqhost = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR,
358 NR_QE_IC_INTS, &qe_ic_host_ops, 0); 339 NR_QE_IC_INTS, &qe_ic_host_ops, 0);
359 if (qe_ic->irqhost == NULL) { 340 if (qe_ic->irqhost == NULL) {
360 of_node_put(node); 341 of_node_put(node);
@@ -402,14 +383,13 @@ void __init qe_ic_init(struct device_node *node, unsigned int flags)
402 qe_ic_write(qe_ic->regs, QEIC_CICR, temp); 383 qe_ic_write(qe_ic->regs, QEIC_CICR, temp);
403 384
404 set_irq_data(qe_ic->virq_low, qe_ic); 385 set_irq_data(qe_ic->virq_low, qe_ic);
405 set_irq_chained_handler(qe_ic->virq_low, qe_ic_cascade_low); 386 set_irq_chained_handler(qe_ic->virq_low, low_handler);
406 387
407 if (qe_ic->virq_high != NO_IRQ) { 388 if (qe_ic->virq_high != NO_IRQ &&
389 qe_ic->virq_high != qe_ic->virq_low) {
408 set_irq_data(qe_ic->virq_high, qe_ic); 390 set_irq_data(qe_ic->virq_high, qe_ic);
409 set_irq_chained_handler(qe_ic->virq_high, qe_ic_cascade_high); 391 set_irq_chained_handler(qe_ic->virq_high, high_handler);
410 } 392 }
411
412 printk("QEIC (%d IRQ sources) at %p\n", NR_QE_IC_INTS, qe_ic->regs);
413} 393}
414 394
415void qe_ic_set_highest_priority(unsigned int virq, int high) 395void qe_ic_set_highest_priority(unsigned int virq, int high)
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/qe_lib/qe_io.c b/arch/powerpc/sysdev/qe_lib/qe_io.c
index e32b45bf9ff5..e53ea4d374a0 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_io.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_io.c
@@ -36,6 +36,9 @@ struct port_regs {
36 __be32 cpdir2; /* Direction register */ 36 __be32 cpdir2; /* Direction register */
37 __be32 cppar1; /* Pin assignment register */ 37 __be32 cppar1; /* Pin assignment register */
38 __be32 cppar2; /* Pin assignment register */ 38 __be32 cppar2; /* Pin assignment register */
39#ifdef CONFIG_PPC_85xx
40 u8 pad[8];
41#endif
39}; 42};
40 43
41static struct port_regs *par_io = NULL; 44static struct port_regs *par_io = NULL;
@@ -195,29 +198,22 @@ EXPORT_SYMBOL(par_io_of_config);
195#ifdef DEBUG 198#ifdef DEBUG
196static void dump_par_io(void) 199static void dump_par_io(void)
197{ 200{
198 int i; 201 unsigned int i;
199 202
200 printk(KERN_INFO "PAR IO registars:\n"); 203 printk(KERN_INFO "%s: par_io=%p\n", __FUNCTION__, par_io);
201 printk(KERN_INFO "Base address: 0x%08x\n", (u32) par_io);
202 for (i = 0; i < num_par_io_ports; i++) { 204 for (i = 0; i < num_par_io_ports; i++) {
203 printk(KERN_INFO "cpodr[%d] : addr - 0x%08x, val - 0x%08x\n", 205 printk(KERN_INFO " cpodr[%u]=%08x\n", i,
204 i, (u32) & par_io[i].cpodr, 206 in_be32(&par_io[i].cpodr));
205 in_be32(&par_io[i].cpodr)); 207 printk(KERN_INFO " cpdata[%u]=%08x\n", i,
206 printk(KERN_INFO "cpdata[%d]: addr - 0x%08x, val - 0x%08x\n", 208 in_be32(&par_io[i].cpdata));
207 i, (u32) & par_io[i].cpdata, 209 printk(KERN_INFO " cpdir1[%u]=%08x\n", i,
208 in_be32(&par_io[i].cpdata)); 210 in_be32(&par_io[i].cpdir1));
209 printk(KERN_INFO "cpdir1[%d]: addr - 0x%08x, val - 0x%08x\n", 211 printk(KERN_INFO " cpdir2[%u]=%08x\n", i,
210 i, (u32) & par_io[i].cpdir1, 212 in_be32(&par_io[i].cpdir2));
211 in_be32(&par_io[i].cpdir1)); 213 printk(KERN_INFO " cppar1[%u]=%08x\n", i,
212 printk(KERN_INFO "cpdir2[%d]: addr - 0x%08x, val - 0x%08x\n", 214 in_be32(&par_io[i].cppar1));
213 i, (u32) & par_io[i].cpdir2, 215 printk(KERN_INFO " cppar2[%u]=%08x\n", i,
214 in_be32(&par_io[i].cpdir2)); 216 in_be32(&par_io[i].cppar2));
215 printk(KERN_INFO "cppar1[%d]: addr - 0x%08x, val - 0x%08x\n",
216 i, (u32) & par_io[i].cppar1,
217 in_be32(&par_io[i].cppar1));
218 printk(KERN_INFO "cppar2[%d]: addr - 0x%08x, val - 0x%08x\n",
219 i, (u32) & par_io[i].cppar2,
220 in_be32(&par_io[i].cppar2));
221 } 217 }
222 218
223} 219}
diff --git a/arch/powerpc/sysdev/qe_lib/ucc.c b/arch/powerpc/sysdev/qe_lib/ucc.c
index f970e5415ac0..0e348d9af8a6 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc.c
@@ -28,228 +28,188 @@
28 28
29static DEFINE_SPINLOCK(ucc_lock); 29static DEFINE_SPINLOCK(ucc_lock);
30 30
31int ucc_set_qe_mux_mii_mng(int ucc_num) 31int ucc_set_qe_mux_mii_mng(unsigned int ucc_num)
32{ 32{
33 unsigned long flags; 33 unsigned long flags;
34 34
35 if (ucc_num > UCC_MAX_NUM - 1)
36 return -EINVAL;
37
35 spin_lock_irqsave(&ucc_lock, flags); 38 spin_lock_irqsave(&ucc_lock, flags);
36 out_be32(&qe_immr->qmx.cmxgcr, 39 clrsetbits_be32(&qe_immr->qmx.cmxgcr, QE_CMXGCR_MII_ENET_MNG,
37 ((in_be32(&qe_immr->qmx.cmxgcr) & 40 ucc_num << QE_CMXGCR_MII_ENET_MNG_SHIFT);
38 ~QE_CMXGCR_MII_ENET_MNG) |
39 (ucc_num << QE_CMXGCR_MII_ENET_MNG_SHIFT)));
40 spin_unlock_irqrestore(&ucc_lock, flags); 41 spin_unlock_irqrestore(&ucc_lock, flags);
41 42
42 return 0; 43 return 0;
43} 44}
44EXPORT_SYMBOL(ucc_set_qe_mux_mii_mng); 45EXPORT_SYMBOL(ucc_set_qe_mux_mii_mng);
45 46
46int ucc_set_type(int ucc_num, struct ucc_common *regs, 47/* Configure the UCC to either Slow or Fast.
47 enum ucc_speed_type speed) 48 *
48{ 49 * A given UCC can be figured to support either "slow" devices (e.g. UART)
49 u8 guemr = 0; 50 * or "fast" devices (e.g. Ethernet).
50 51 *
51 /* check if the UCC number is in range. */ 52 * 'ucc_num' is the UCC number, from 0 - 7.
52 if ((ucc_num > UCC_MAX_NUM - 1) || (ucc_num < 0)) 53 *
53 return -EINVAL; 54 * This function also sets the UCC_GUEMR_SET_RESERVED3 bit because that bit
54 55 * must always be set to 1.
55 guemr = regs->guemr; 56 */
56 guemr &= ~(UCC_GUEMR_MODE_MASK_RX | UCC_GUEMR_MODE_MASK_TX); 57int ucc_set_type(unsigned int ucc_num, enum ucc_speed_type speed)
57 switch (speed) {
58 case UCC_SPEED_TYPE_SLOW:
59 guemr |= (UCC_GUEMR_MODE_SLOW_RX | UCC_GUEMR_MODE_SLOW_TX);
60 break;
61 case UCC_SPEED_TYPE_FAST:
62 guemr |= (UCC_GUEMR_MODE_FAST_RX | UCC_GUEMR_MODE_FAST_TX);
63 break;
64 default:
65 return -EINVAL;
66 }
67 regs->guemr = guemr;
68
69 return 0;
70}
71
72int ucc_init_guemr(struct ucc_common *regs)
73{ 58{
74 u8 guemr = 0; 59 u8 __iomem *guemr;
75
76 if (!regs)
77 return -EINVAL;
78
79 /* Set bit 3 (which is reserved in the GUEMR register) to 1 */
80 guemr = UCC_GUEMR_SET_RESERVED3;
81
82 regs->guemr = guemr;
83
84 return 0;
85}
86 60
87static void get_cmxucr_reg(int ucc_num, volatile u32 ** p_cmxucr, u8 * reg_num, 61 /* The GUEMR register is at the same location for both slow and fast
88 u8 * shift) 62 devices, so we just use uccX.slow.guemr. */
89{
90 switch (ucc_num) { 63 switch (ucc_num) {
91 case 0: *p_cmxucr = &(qe_immr->qmx.cmxucr1); 64 case 0: guemr = &qe_immr->ucc1.slow.guemr;
92 *reg_num = 1;
93 *shift = 16;
94 break; 65 break;
95 case 2: *p_cmxucr = &(qe_immr->qmx.cmxucr1); 66 case 1: guemr = &qe_immr->ucc2.slow.guemr;
96 *reg_num = 1;
97 *shift = 0;
98 break; 67 break;
99 case 4: *p_cmxucr = &(qe_immr->qmx.cmxucr2); 68 case 2: guemr = &qe_immr->ucc3.slow.guemr;
100 *reg_num = 2;
101 *shift = 16;
102 break; 69 break;
103 case 6: *p_cmxucr = &(qe_immr->qmx.cmxucr2); 70 case 3: guemr = &qe_immr->ucc4.slow.guemr;
104 *reg_num = 2;
105 *shift = 0;
106 break; 71 break;
107 case 1: *p_cmxucr = &(qe_immr->qmx.cmxucr3); 72 case 4: guemr = &qe_immr->ucc5.slow.guemr;
108 *reg_num = 3;
109 *shift = 16;
110 break; 73 break;
111 case 3: *p_cmxucr = &(qe_immr->qmx.cmxucr3); 74 case 5: guemr = &qe_immr->ucc6.slow.guemr;
112 *reg_num = 3;
113 *shift = 0;
114 break; 75 break;
115 case 5: *p_cmxucr = &(qe_immr->qmx.cmxucr4); 76 case 6: guemr = &qe_immr->ucc7.slow.guemr;
116 *reg_num = 4;
117 *shift = 16;
118 break; 77 break;
119 case 7: *p_cmxucr = &(qe_immr->qmx.cmxucr4); 78 case 7: guemr = &qe_immr->ucc8.slow.guemr;
120 *reg_num = 4;
121 *shift = 0;
122 break; 79 break;
123 default: 80 default:
124 break; 81 return -EINVAL;
125 } 82 }
83
84 clrsetbits_8(guemr, UCC_GUEMR_MODE_MASK,
85 UCC_GUEMR_SET_RESERVED3 | speed);
86
87 return 0;
88}
89
90static void get_cmxucr_reg(unsigned int ucc_num, __be32 **cmxucr,
91 unsigned int *reg_num, unsigned int *shift)
92{
93 unsigned int cmx = ((ucc_num & 1) << 1) + (ucc_num > 3);
94
95 *reg_num = cmx + 1;
96 *cmxucr = &qe_immr->qmx.cmxucr[cmx];
97 *shift = 16 - 8 * (ucc_num & 2);
126} 98}
127 99
128int ucc_mux_set_grant_tsa_bkpt(int ucc_num, int set, u32 mask) 100int ucc_mux_set_grant_tsa_bkpt(unsigned int ucc_num, int set, u32 mask)
129{ 101{
130 volatile u32 *p_cmxucr; 102 __be32 *cmxucr;
131 u8 reg_num; 103 unsigned int reg_num;
132 u8 shift; 104 unsigned int shift;
133 105
134 /* check if the UCC number is in range. */ 106 /* check if the UCC number is in range. */
135 if ((ucc_num > UCC_MAX_NUM - 1) || (ucc_num < 0)) 107 if (ucc_num > UCC_MAX_NUM - 1)
136 return -EINVAL; 108 return -EINVAL;
137 109
138 get_cmxucr_reg(ucc_num, &p_cmxucr, &reg_num, &shift); 110 get_cmxucr_reg(ucc_num, &cmxucr, &reg_num, &shift);
139 111
140 if (set) 112 if (set)
141 out_be32(p_cmxucr, in_be32(p_cmxucr) | (mask << shift)); 113 setbits32(cmxucr, mask << shift);
142 else 114 else
143 out_be32(p_cmxucr, in_be32(p_cmxucr) & ~(mask << shift)); 115 clrbits32(cmxucr, mask << shift);
144 116
145 return 0; 117 return 0;
146} 118}
147 119
148int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode) 120int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock,
121 enum comm_dir mode)
149{ 122{
150 volatile u32 *p_cmxucr; 123 __be32 *cmxucr;
151 u8 reg_num; 124 unsigned int reg_num;
152 u8 shift; 125 unsigned int shift;
153 u32 clock_bits; 126 u32 clock_bits = 0;
154 u32 clock_mask;
155 int source = -1;
156 127
157 /* check if the UCC number is in range. */ 128 /* check if the UCC number is in range. */
158 if ((ucc_num > UCC_MAX_NUM - 1) || (ucc_num < 0)) 129 if (ucc_num > UCC_MAX_NUM - 1)
159 return -EINVAL; 130 return -EINVAL;
160 131
161 if (!((mode == COMM_DIR_RX) || (mode == COMM_DIR_TX))) { 132 /* The communications direction must be RX or TX */
162 printk(KERN_ERR 133 if (!((mode == COMM_DIR_RX) || (mode == COMM_DIR_TX)))
163 "ucc_set_qe_mux_rxtx: bad comm mode type passed.");
164 return -EINVAL; 134 return -EINVAL;
165 }
166 135
167 get_cmxucr_reg(ucc_num, &p_cmxucr, &reg_num, &shift); 136 get_cmxucr_reg(ucc_num, &cmxucr, &reg_num, &shift);
168 137
169 switch (reg_num) { 138 switch (reg_num) {
170 case 1: 139 case 1:
171 switch (clock) { 140 switch (clock) {
172 case QE_BRG1: source = 1; break; 141 case QE_BRG1: clock_bits = 1; break;
173 case QE_BRG2: source = 2; break; 142 case QE_BRG2: clock_bits = 2; break;
174 case QE_BRG7: source = 3; break; 143 case QE_BRG7: clock_bits = 3; break;
175 case QE_BRG8: source = 4; break; 144 case QE_BRG8: clock_bits = 4; break;
176 case QE_CLK9: source = 5; break; 145 case QE_CLK9: clock_bits = 5; break;
177 case QE_CLK10: source = 6; break; 146 case QE_CLK10: clock_bits = 6; break;
178 case QE_CLK11: source = 7; break; 147 case QE_CLK11: clock_bits = 7; break;
179 case QE_CLK12: source = 8; break; 148 case QE_CLK12: clock_bits = 8; break;
180 case QE_CLK15: source = 9; break; 149 case QE_CLK15: clock_bits = 9; break;
181 case QE_CLK16: source = 10; break; 150 case QE_CLK16: clock_bits = 10; break;
182 default: source = -1; break; 151 default: break;
183 } 152 }
184 break; 153 break;
185 case 2: 154 case 2:
186 switch (clock) { 155 switch (clock) {
187 case QE_BRG5: source = 1; break; 156 case QE_BRG5: clock_bits = 1; break;
188 case QE_BRG6: source = 2; break; 157 case QE_BRG6: clock_bits = 2; break;
189 case QE_BRG7: source = 3; break; 158 case QE_BRG7: clock_bits = 3; break;
190 case QE_BRG8: source = 4; break; 159 case QE_BRG8: clock_bits = 4; break;
191 case QE_CLK13: source = 5; break; 160 case QE_CLK13: clock_bits = 5; break;
192 case QE_CLK14: source = 6; break; 161 case QE_CLK14: clock_bits = 6; break;
193 case QE_CLK19: source = 7; break; 162 case QE_CLK19: clock_bits = 7; break;
194 case QE_CLK20: source = 8; break; 163 case QE_CLK20: clock_bits = 8; break;
195 case QE_CLK15: source = 9; break; 164 case QE_CLK15: clock_bits = 9; break;
196 case QE_CLK16: source = 10; break; 165 case QE_CLK16: clock_bits = 10; break;
197 default: source = -1; break; 166 default: break;
198 } 167 }
199 break; 168 break;
200 case 3: 169 case 3:
201 switch (clock) { 170 switch (clock) {
202 case QE_BRG9: source = 1; break; 171 case QE_BRG9: clock_bits = 1; break;
203 case QE_BRG10: source = 2; break; 172 case QE_BRG10: clock_bits = 2; break;
204 case QE_BRG15: source = 3; break; 173 case QE_BRG15: clock_bits = 3; break;
205 case QE_BRG16: source = 4; break; 174 case QE_BRG16: clock_bits = 4; break;
206 case QE_CLK3: source = 5; break; 175 case QE_CLK3: clock_bits = 5; break;
207 case QE_CLK4: source = 6; break; 176 case QE_CLK4: clock_bits = 6; break;
208 case QE_CLK17: source = 7; break; 177 case QE_CLK17: clock_bits = 7; break;
209 case QE_CLK18: source = 8; break; 178 case QE_CLK18: clock_bits = 8; break;
210 case QE_CLK7: source = 9; break; 179 case QE_CLK7: clock_bits = 9; break;
211 case QE_CLK8: source = 10; break; 180 case QE_CLK8: clock_bits = 10; break;
212 case QE_CLK16: source = 11; break; 181 case QE_CLK16: clock_bits = 11; break;
213 default: source = -1; break; 182 default: break;
214 } 183 }
215 break; 184 break;
216 case 4: 185 case 4:
217 switch (clock) { 186 switch (clock) {
218 case QE_BRG13: source = 1; break; 187 case QE_BRG13: clock_bits = 1; break;
219 case QE_BRG14: source = 2; break; 188 case QE_BRG14: clock_bits = 2; break;
220 case QE_BRG15: source = 3; break; 189 case QE_BRG15: clock_bits = 3; break;
221 case QE_BRG16: source = 4; break; 190 case QE_BRG16: clock_bits = 4; break;
222 case QE_CLK5: source = 5; break; 191 case QE_CLK5: clock_bits = 5; break;
223 case QE_CLK6: source = 6; break; 192 case QE_CLK6: clock_bits = 6; break;
224 case QE_CLK21: source = 7; break; 193 case QE_CLK21: clock_bits = 7; break;
225 case QE_CLK22: source = 8; break; 194 case QE_CLK22: clock_bits = 8; break;
226 case QE_CLK7: source = 9; break; 195 case QE_CLK7: clock_bits = 9; break;
227 case QE_CLK8: source = 10; break; 196 case QE_CLK8: clock_bits = 10; break;
228 case QE_CLK16: source = 11; break; 197 case QE_CLK16: clock_bits = 11; break;
229 default: source = -1; break; 198 default: break;
230 } 199 }
231 break; 200 break;
232 default: 201 default: break;
233 source = -1;
234 break;
235 } 202 }
236 203
237 if (source == -1) { 204 /* Check for invalid combination of clock and UCC number */
238 printk(KERN_ERR 205 if (!clock_bits)
239 "ucc_set_qe_mux_rxtx: Bad combination of clock and UCC.");
240 return -ENOENT; 206 return -ENOENT;
241 }
242 207
243 clock_bits = (u32) source; 208 if (mode == COMM_DIR_RX)
244 clock_mask = QE_CMXUCR_TX_CLK_SRC_MASK; 209 shift += 4;
245 if (mode == COMM_DIR_RX) {
246 clock_bits <<= 4; /* Rx field is 4 bits to left of Tx field */
247 clock_mask <<= 4; /* Rx field is 4 bits to left of Tx field */
248 }
249 clock_bits <<= shift;
250 clock_mask <<= shift;
251 210
252 out_be32(p_cmxucr, (in_be32(p_cmxucr) & ~clock_mask) | clock_bits); 211 clrsetbits_be32(cmxucr, QE_CMXUCR_TX_CLK_SRC_MASK << shift,
212 clock_bits << shift);
253 213
254 return 0; 214 return 0;
255} 215}
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
index 3df202e8d332..3223acbc39e5 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c
@@ -30,46 +30,45 @@
30 30
31void ucc_fast_dump_regs(struct ucc_fast_private * uccf) 31void ucc_fast_dump_regs(struct ucc_fast_private * uccf)
32{ 32{
33 printk(KERN_INFO "UCC%d Fast registers:", uccf->uf_info->ucc_num); 33 printk(KERN_INFO "UCC%u Fast registers:\n", uccf->uf_info->ucc_num);
34 printk(KERN_INFO "Base address: 0x%08x", (u32) uccf->uf_regs); 34 printk(KERN_INFO "Base address: 0x%p\n", uccf->uf_regs);
35 35
36 printk(KERN_INFO "gumr : addr - 0x%08x, val - 0x%08x", 36 printk(KERN_INFO "gumr : addr=0x%p, val=0x%08x\n",
37 (u32) & uccf->uf_regs->gumr, in_be32(&uccf->uf_regs->gumr)); 37 &uccf->uf_regs->gumr, in_be32(&uccf->uf_regs->gumr));
38 printk(KERN_INFO "upsmr : addr - 0x%08x, val - 0x%08x", 38 printk(KERN_INFO "upsmr : addr=0x%p, val=0x%08x\n",
39 (u32) & uccf->uf_regs->upsmr, in_be32(&uccf->uf_regs->upsmr)); 39 &uccf->uf_regs->upsmr, in_be32(&uccf->uf_regs->upsmr));
40 printk(KERN_INFO "utodr : addr - 0x%08x, val - 0x%04x", 40 printk(KERN_INFO "utodr : addr=0x%p, val=0x%04x\n",
41 (u32) & uccf->uf_regs->utodr, in_be16(&uccf->uf_regs->utodr)); 41 &uccf->uf_regs->utodr, in_be16(&uccf->uf_regs->utodr));
42 printk(KERN_INFO "udsr : addr - 0x%08x, val - 0x%04x", 42 printk(KERN_INFO "udsr : addr=0x%p, val=0x%04x\n",
43 (u32) & uccf->uf_regs->udsr, in_be16(&uccf->uf_regs->udsr)); 43 &uccf->uf_regs->udsr, in_be16(&uccf->uf_regs->udsr));
44 printk(KERN_INFO "ucce : addr - 0x%08x, val - 0x%08x", 44 printk(KERN_INFO "ucce : addr=0x%p, val=0x%08x\n",
45 (u32) & uccf->uf_regs->ucce, in_be32(&uccf->uf_regs->ucce)); 45 &uccf->uf_regs->ucce, in_be32(&uccf->uf_regs->ucce));
46 printk(KERN_INFO "uccm : addr - 0x%08x, val - 0x%08x", 46 printk(KERN_INFO "uccm : addr=0x%p, val=0x%08x\n",
47 (u32) & uccf->uf_regs->uccm, in_be32(&uccf->uf_regs->uccm)); 47 &uccf->uf_regs->uccm, in_be32(&uccf->uf_regs->uccm));
48 printk(KERN_INFO "uccs : addr - 0x%08x, val - 0x%02x", 48 printk(KERN_INFO "uccs : addr=0x%p, val=0x%02x\n",
49 (u32) & uccf->uf_regs->uccs, uccf->uf_regs->uccs); 49 &uccf->uf_regs->uccs, uccf->uf_regs->uccs);
50 printk(KERN_INFO "urfb : addr - 0x%08x, val - 0x%08x", 50 printk(KERN_INFO "urfb : addr=0x%p, val=0x%08x\n",
51 (u32) & uccf->uf_regs->urfb, in_be32(&uccf->uf_regs->urfb)); 51 &uccf->uf_regs->urfb, in_be32(&uccf->uf_regs->urfb));
52 printk(KERN_INFO "urfs : addr - 0x%08x, val - 0x%04x", 52 printk(KERN_INFO "urfs : addr=0x%p, val=0x%04x\n",
53 (u32) & uccf->uf_regs->urfs, in_be16(&uccf->uf_regs->urfs)); 53 &uccf->uf_regs->urfs, in_be16(&uccf->uf_regs->urfs));
54 printk(KERN_INFO "urfet : addr - 0x%08x, val - 0x%04x", 54 printk(KERN_INFO "urfet : addr=0x%p, val=0x%04x\n",
55 (u32) & uccf->uf_regs->urfet, in_be16(&uccf->uf_regs->urfet)); 55 &uccf->uf_regs->urfet, in_be16(&uccf->uf_regs->urfet));
56 printk(KERN_INFO "urfset: addr - 0x%08x, val - 0x%04x", 56 printk(KERN_INFO "urfset: addr=0x%p, val=0x%04x\n",
57 (u32) & uccf->uf_regs->urfset, 57 &uccf->uf_regs->urfset, in_be16(&uccf->uf_regs->urfset));
58 in_be16(&uccf->uf_regs->urfset)); 58 printk(KERN_INFO "utfb : addr=0x%p, val=0x%08x\n",
59 printk(KERN_INFO "utfb : addr - 0x%08x, val - 0x%08x", 59 &uccf->uf_regs->utfb, in_be32(&uccf->uf_regs->utfb));
60 (u32) & uccf->uf_regs->utfb, in_be32(&uccf->uf_regs->utfb)); 60 printk(KERN_INFO "utfs : addr=0x%p, val=0x%04x\n",
61 printk(KERN_INFO "utfs : addr - 0x%08x, val - 0x%04x", 61 &uccf->uf_regs->utfs, in_be16(&uccf->uf_regs->utfs));
62 (u32) & uccf->uf_regs->utfs, in_be16(&uccf->uf_regs->utfs)); 62 printk(KERN_INFO "utfet : addr=0x%p, val=0x%04x\n",
63 printk(KERN_INFO "utfet : addr - 0x%08x, val - 0x%04x", 63 &uccf->uf_regs->utfet, in_be16(&uccf->uf_regs->utfet));
64 (u32) & uccf->uf_regs->utfet, in_be16(&uccf->uf_regs->utfet)); 64 printk(KERN_INFO "utftt : addr=0x%p, val=0x%04x\n",
65 printk(KERN_INFO "utftt : addr - 0x%08x, val - 0x%04x", 65 &uccf->uf_regs->utftt, in_be16(&uccf->uf_regs->utftt));
66 (u32) & uccf->uf_regs->utftt, in_be16(&uccf->uf_regs->utftt)); 66 printk(KERN_INFO "utpt : addr=0x%p, val=0x%04x\n",
67 printk(KERN_INFO "utpt : addr - 0x%08x, val - 0x%04x", 67 &uccf->uf_regs->utpt, in_be16(&uccf->uf_regs->utpt));
68 (u32) & uccf->uf_regs->utpt, in_be16(&uccf->uf_regs->utpt)); 68 printk(KERN_INFO "urtry : addr=0x%p, val=0x%08x\n",
69 printk(KERN_INFO "urtry : addr - 0x%08x, val - 0x%08x", 69 &uccf->uf_regs->urtry, in_be32(&uccf->uf_regs->urtry));
70 (u32) & uccf->uf_regs->urtry, in_be32(&uccf->uf_regs->urtry)); 70 printk(KERN_INFO "guemr : addr=0x%p, val=0x%02x\n",
71 printk(KERN_INFO "guemr : addr - 0x%08x, val - 0x%02x", 71 &uccf->uf_regs->guemr, uccf->uf_regs->guemr);
72 (u32) & uccf->uf_regs->guemr, uccf->uf_regs->guemr);
73} 72}
74EXPORT_SYMBOL(ucc_fast_dump_regs); 73EXPORT_SYMBOL(ucc_fast_dump_regs);
75 74
@@ -149,55 +148,57 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
149 148
150 /* check if the UCC port number is in range. */ 149 /* check if the UCC port number is in range. */
151 if ((uf_info->ucc_num < 0) || (uf_info->ucc_num > UCC_MAX_NUM - 1)) { 150 if ((uf_info->ucc_num < 0) || (uf_info->ucc_num > UCC_MAX_NUM - 1)) {
152 printk(KERN_ERR "%s: illegal UCC number", __FUNCTION__); 151 printk(KERN_ERR "%s: illegal UCC number\n", __FUNCTION__);
153 return -EINVAL; 152 return -EINVAL;
154 } 153 }
155 154
156 /* Check that 'max_rx_buf_length' is properly aligned (4). */ 155 /* Check that 'max_rx_buf_length' is properly aligned (4). */
157 if (uf_info->max_rx_buf_length & (UCC_FAST_MRBLR_ALIGNMENT - 1)) { 156 if (uf_info->max_rx_buf_length & (UCC_FAST_MRBLR_ALIGNMENT - 1)) {
158 printk(KERN_ERR "%s: max_rx_buf_length not aligned", __FUNCTION__); 157 printk(KERN_ERR "%s: max_rx_buf_length not aligned\n",
158 __FUNCTION__);
159 return -EINVAL; 159 return -EINVAL;
160 } 160 }
161 161
162 /* Validate Virtual Fifo register values */ 162 /* Validate Virtual Fifo register values */
163 if (uf_info->urfs < UCC_FAST_URFS_MIN_VAL) { 163 if (uf_info->urfs < UCC_FAST_URFS_MIN_VAL) {
164 printk(KERN_ERR "%s: urfs is too small", __FUNCTION__); 164 printk(KERN_ERR "%s: urfs is too small\n", __FUNCTION__);
165 return -EINVAL; 165 return -EINVAL;
166 } 166 }
167 167
168 if (uf_info->urfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) { 168 if (uf_info->urfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
169 printk(KERN_ERR "%s: urfs is not aligned", __FUNCTION__); 169 printk(KERN_ERR "%s: urfs is not aligned\n", __FUNCTION__);
170 return -EINVAL; 170 return -EINVAL;
171 } 171 }
172 172
173 if (uf_info->urfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) { 173 if (uf_info->urfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
174 printk(KERN_ERR "%s: urfet is not aligned.", __FUNCTION__); 174 printk(KERN_ERR "%s: urfet is not aligned.\n", __FUNCTION__);
175 return -EINVAL; 175 return -EINVAL;
176 } 176 }
177 177
178 if (uf_info->urfset & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) { 178 if (uf_info->urfset & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
179 printk(KERN_ERR "%s: urfset is not aligned", __FUNCTION__); 179 printk(KERN_ERR "%s: urfset is not aligned\n", __FUNCTION__);
180 return -EINVAL; 180 return -EINVAL;
181 } 181 }
182 182
183 if (uf_info->utfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) { 183 if (uf_info->utfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
184 printk(KERN_ERR "%s: utfs is not aligned", __FUNCTION__); 184 printk(KERN_ERR "%s: utfs is not aligned\n", __FUNCTION__);
185 return -EINVAL; 185 return -EINVAL;
186 } 186 }
187 187
188 if (uf_info->utfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) { 188 if (uf_info->utfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
189 printk(KERN_ERR "%s: utfet is not aligned", __FUNCTION__); 189 printk(KERN_ERR "%s: utfet is not aligned\n", __FUNCTION__);
190 return -EINVAL; 190 return -EINVAL;
191 } 191 }
192 192
193 if (uf_info->utftt & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) { 193 if (uf_info->utftt & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
194 printk(KERN_ERR "%s: utftt is not aligned", __FUNCTION__); 194 printk(KERN_ERR "%s: utftt is not aligned\n", __FUNCTION__);
195 return -EINVAL; 195 return -EINVAL;
196 } 196 }
197 197
198 uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL); 198 uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL);
199 if (!uccf) { 199 if (!uccf) {
200 printk(KERN_ERR "%s: Cannot allocate private data", __FUNCTION__); 200 printk(KERN_ERR "%s: Cannot allocate private data\n",
201 __FUNCTION__);
201 return -ENOMEM; 202 return -ENOMEM;
202 } 203 }
203 204
@@ -206,7 +207,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
206 /* Set the PHY base address */ 207 /* Set the PHY base address */
207 uccf->uf_regs = ioremap(uf_info->regs, sizeof(struct ucc_fast)); 208 uccf->uf_regs = ioremap(uf_info->regs, sizeof(struct ucc_fast));
208 if (uccf->uf_regs == NULL) { 209 if (uccf->uf_regs == NULL) {
209 printk(KERN_ERR "%s: Cannot map UCC registers", __FUNCTION__); 210 printk(KERN_ERR "%s: Cannot map UCC registers\n", __FUNCTION__);
210 return -ENOMEM; 211 return -ENOMEM;
211 } 212 }
212 213
@@ -226,18 +227,10 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
226 uccf->rx_discarded = 0; 227 uccf->rx_discarded = 0;
227#endif /* STATISTICS */ 228#endif /* STATISTICS */
228 229
229 /* Init Guemr register */
230 if ((ret = ucc_init_guemr((struct ucc_common *) (uf_regs)))) {
231 printk(KERN_ERR "%s: cannot init GUEMR", __FUNCTION__);
232 ucc_fast_free(uccf);
233 return ret;
234 }
235
236 /* Set UCC to fast type */ 230 /* Set UCC to fast type */
237 if ((ret = ucc_set_type(uf_info->ucc_num, 231 ret = ucc_set_type(uf_info->ucc_num, UCC_SPEED_TYPE_FAST);
238 (struct ucc_common *) (uf_regs), 232 if (ret) {
239 UCC_SPEED_TYPE_FAST))) { 233 printk(KERN_ERR "%s: cannot set UCC type\n", __FUNCTION__);
240 printk(KERN_ERR "%s: cannot set UCC type", __FUNCTION__);
241 ucc_fast_free(uccf); 234 ucc_fast_free(uccf);
242 return ret; 235 return ret;
243 } 236 }
@@ -276,7 +269,8 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
276 uccf->ucc_fast_tx_virtual_fifo_base_offset = 269 uccf->ucc_fast_tx_virtual_fifo_base_offset =
277 qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT); 270 qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
278 if (IS_ERR_VALUE(uccf->ucc_fast_tx_virtual_fifo_base_offset)) { 271 if (IS_ERR_VALUE(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
279 printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO", __FUNCTION__); 272 printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO\n",
273 __FUNCTION__);
280 uccf->ucc_fast_tx_virtual_fifo_base_offset = 0; 274 uccf->ucc_fast_tx_virtual_fifo_base_offset = 0;
281 ucc_fast_free(uccf); 275 ucc_fast_free(uccf);
282 return -ENOMEM; 276 return -ENOMEM;
@@ -288,7 +282,8 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
288 UCC_FAST_RECEIVE_VIRTUAL_FIFO_SIZE_FUDGE_FACTOR, 282 UCC_FAST_RECEIVE_VIRTUAL_FIFO_SIZE_FUDGE_FACTOR,
289 UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT); 283 UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
290 if (IS_ERR_VALUE(uccf->ucc_fast_rx_virtual_fifo_base_offset)) { 284 if (IS_ERR_VALUE(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
291 printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO", __FUNCTION__); 285 printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO\n",
286 __FUNCTION__);
292 uccf->ucc_fast_rx_virtual_fifo_base_offset = 0; 287 uccf->ucc_fast_rx_virtual_fifo_base_offset = 0;
293 ucc_fast_free(uccf); 288 ucc_fast_free(uccf);
294 return -ENOMEM; 289 return -ENOMEM;
@@ -318,7 +313,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
318 if ((uf_info->rx_clock != QE_CLK_NONE) && 313 if ((uf_info->rx_clock != QE_CLK_NONE) &&
319 ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->rx_clock, 314 ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->rx_clock,
320 COMM_DIR_RX)) { 315 COMM_DIR_RX)) {
321 printk(KERN_ERR "%s: illegal value for RX clock", 316 printk(KERN_ERR "%s: illegal value for RX clock\n",
322 __FUNCTION__); 317 __FUNCTION__);
323 ucc_fast_free(uccf); 318 ucc_fast_free(uccf);
324 return -EINVAL; 319 return -EINVAL;
@@ -327,7 +322,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
327 if ((uf_info->tx_clock != QE_CLK_NONE) && 322 if ((uf_info->tx_clock != QE_CLK_NONE) &&
328 ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->tx_clock, 323 ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->tx_clock,
329 COMM_DIR_TX)) { 324 COMM_DIR_TX)) {
330 printk(KERN_ERR "%s: illegal value for TX clock", 325 printk(KERN_ERR "%s: illegal value for TX clock\n",
331 __FUNCTION__); 326 __FUNCTION__);
332 ucc_fast_free(uccf); 327 ucc_fast_free(uccf);
333 return -EINVAL; 328 return -EINVAL;
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
index 1f65c26ce63f..0174b3aeef8f 100644
--- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
+++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
@@ -115,11 +115,15 @@ void ucc_slow_disable(struct ucc_slow_private * uccs, enum comm_dir mode)
115 out_be32(&us_regs->gumr_l, gumr_l); 115 out_be32(&us_regs->gumr_l, gumr_l);
116} 116}
117 117
118/* Initialize the UCC for Slow operations
119 *
120 * The caller should initialize the following us_info
121 */
118int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** uccs_ret) 122int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** uccs_ret)
119{ 123{
120 struct ucc_slow_private *uccs; 124 struct ucc_slow_private *uccs;
121 u32 i; 125 u32 i;
122 struct ucc_slow *us_regs; 126 struct ucc_slow __iomem *us_regs;
123 u32 gumr; 127 u32 gumr;
124 struct qe_bd *bd; 128 struct qe_bd *bd;
125 u32 id; 129 u32 id;
@@ -131,7 +135,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
131 135
132 /* check if the UCC port number is in range. */ 136 /* check if the UCC port number is in range. */
133 if ((us_info->ucc_num < 0) || (us_info->ucc_num > UCC_MAX_NUM - 1)) { 137 if ((us_info->ucc_num < 0) || (us_info->ucc_num > UCC_MAX_NUM - 1)) {
134 printk(KERN_ERR "%s: illegal UCC number", __FUNCTION__); 138 printk(KERN_ERR "%s: illegal UCC number\n", __FUNCTION__);
135 return -EINVAL; 139 return -EINVAL;
136 } 140 }
137 141
@@ -143,13 +147,14 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
143 */ 147 */
144 if ((!us_info->rfw) && 148 if ((!us_info->rfw) &&
145 (us_info->max_rx_buf_length & (UCC_SLOW_MRBLR_ALIGNMENT - 1))) { 149 (us_info->max_rx_buf_length & (UCC_SLOW_MRBLR_ALIGNMENT - 1))) {
146 printk(KERN_ERR "max_rx_buf_length not aligned."); 150 printk(KERN_ERR "max_rx_buf_length not aligned.\n");
147 return -EINVAL; 151 return -EINVAL;
148 } 152 }
149 153
150 uccs = kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL); 154 uccs = kzalloc(sizeof(struct ucc_slow_private), GFP_KERNEL);
151 if (!uccs) { 155 if (!uccs) {
152 printk(KERN_ERR "%s: Cannot allocate private data", __FUNCTION__); 156 printk(KERN_ERR "%s: Cannot allocate private data\n",
157 __FUNCTION__);
153 return -ENOMEM; 158 return -ENOMEM;
154 } 159 }
155 160
@@ -158,7 +163,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
158 /* Set the PHY base address */ 163 /* Set the PHY base address */
159 uccs->us_regs = ioremap(us_info->regs, sizeof(struct ucc_slow)); 164 uccs->us_regs = ioremap(us_info->regs, sizeof(struct ucc_slow));
160 if (uccs->us_regs == NULL) { 165 if (uccs->us_regs == NULL) {
161 printk(KERN_ERR "%s: Cannot map UCC registers", __FUNCTION__); 166 printk(KERN_ERR "%s: Cannot map UCC registers\n", __FUNCTION__);
162 return -ENOMEM; 167 return -ENOMEM;
163 } 168 }
164 169
@@ -182,22 +187,14 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
182 return -ENOMEM; 187 return -ENOMEM;
183 } 188 }
184 id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num); 189 id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
185 qe_issue_cmd(QE_ASSIGN_PAGE_TO_DEVICE, id, QE_CR_PROTOCOL_UNSPECIFIED, 190 qe_issue_cmd(QE_ASSIGN_PAGE_TO_DEVICE, id, us_info->protocol,
186 uccs->us_pram_offset); 191 uccs->us_pram_offset);
187 192
188 uccs->us_pram = qe_muram_addr(uccs->us_pram_offset); 193 uccs->us_pram = qe_muram_addr(uccs->us_pram_offset);
189 194
190 /* Init Guemr register */
191 if ((ret = ucc_init_guemr((struct ucc_common *) us_regs))) {
192 printk(KERN_ERR "%s: cannot init GUEMR", __FUNCTION__);
193 ucc_slow_free(uccs);
194 return ret;
195 }
196
197 /* Set UCC to slow type */ 195 /* Set UCC to slow type */
198 if ((ret = ucc_set_type(us_info->ucc_num, 196 ret = ucc_set_type(us_info->ucc_num, UCC_SPEED_TYPE_SLOW);
199 (struct ucc_common *) us_regs, 197 if (ret) {
200 UCC_SPEED_TYPE_SLOW))) {
201 printk(KERN_ERR "%s: cannot set UCC type", __FUNCTION__); 198 printk(KERN_ERR "%s: cannot set UCC type", __FUNCTION__);
202 ucc_slow_free(uccs); 199 ucc_slow_free(uccs);
203 return ret; 200 return ret;
@@ -212,7 +209,8 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
212 qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd), 209 qe_muram_alloc(us_info->rx_bd_ring_len * sizeof(struct qe_bd),
213 QE_ALIGNMENT_OF_BD); 210 QE_ALIGNMENT_OF_BD);
214 if (IS_ERR_VALUE(uccs->rx_base_offset)) { 211 if (IS_ERR_VALUE(uccs->rx_base_offset)) {
215 printk(KERN_ERR "%s: cannot allocate RX BDs", __FUNCTION__); 212 printk(KERN_ERR "%s: cannot allocate %u RX BDs\n", __FUNCTION__,
213 us_info->rx_bd_ring_len);
216 uccs->rx_base_offset = 0; 214 uccs->rx_base_offset = 0;
217 ucc_slow_free(uccs); 215 ucc_slow_free(uccs);
218 return -ENOMEM; 216 return -ENOMEM;
@@ -292,12 +290,12 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
292 290
293 /* if the data is in cachable memory, the 'global' */ 291 /* if the data is in cachable memory, the 'global' */
294 /* in the function code should be set. */ 292 /* in the function code should be set. */
295 uccs->us_pram->tfcr = uccs->us_pram->rfcr = 293 uccs->us_pram->tbmr = UCC_BMR_BO_BE;
296 us_info->data_mem_part | QE_BMR_BYTE_ORDER_BO_MOT; 294 uccs->us_pram->rbmr = UCC_BMR_BO_BE;
297 295
298 /* rbase, tbase are offsets from MURAM base */ 296 /* rbase, tbase are offsets from MURAM base */
299 out_be16(&uccs->us_pram->rbase, uccs->us_pram_offset); 297 out_be16(&uccs->us_pram->rbase, uccs->rx_base_offset);
300 out_be16(&uccs->us_pram->tbase, uccs->us_pram_offset); 298 out_be16(&uccs->us_pram->tbase, uccs->tx_base_offset);
301 299
302 /* Mux clocking */ 300 /* Mux clocking */
303 /* Grant Support */ 301 /* Grant Support */
@@ -311,7 +309,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
311 /* Rx clock routing */ 309 /* Rx clock routing */
312 if (ucc_set_qe_mux_rxtx(us_info->ucc_num, us_info->rx_clock, 310 if (ucc_set_qe_mux_rxtx(us_info->ucc_num, us_info->rx_clock,
313 COMM_DIR_RX)) { 311 COMM_DIR_RX)) {
314 printk(KERN_ERR "%s: illegal value for RX clock", 312 printk(KERN_ERR "%s: illegal value for RX clock\n",
315 __FUNCTION__); 313 __FUNCTION__);
316 ucc_slow_free(uccs); 314 ucc_slow_free(uccs);
317 return -EINVAL; 315 return -EINVAL;
@@ -319,7 +317,7 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
319 /* Tx clock routing */ 317 /* Tx clock routing */
320 if (ucc_set_qe_mux_rxtx(us_info->ucc_num, us_info->tx_clock, 318 if (ucc_set_qe_mux_rxtx(us_info->ucc_num, us_info->tx_clock,
321 COMM_DIR_TX)) { 319 COMM_DIR_TX)) {
322 printk(KERN_ERR "%s: illegal value for TX clock", 320 printk(KERN_ERR "%s: illegal value for TX clock\n",
323 __FUNCTION__); 321 __FUNCTION__);
324 ucc_slow_free(uccs); 322 ucc_slow_free(uccs);
325 return -EINVAL; 323 return -EINVAL;
@@ -343,8 +341,8 @@ int ucc_slow_init(struct ucc_slow_info * us_info, struct ucc_slow_private ** ucc
343 command = QE_INIT_TX; 341 command = QE_INIT_TX;
344 else 342 else
345 command = QE_INIT_RX; /* We know at least one is TRUE */ 343 command = QE_INIT_RX; /* We know at least one is TRUE */
346 id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num); 344
347 qe_issue_cmd(command, id, QE_CR_PROTOCOL_UNSPECIFIED, 0); 345 qe_issue_cmd(command, id, us_info->protocol, 0);
348 346
349 *uccs_ret = uccs; 347 *uccs_ret = uccs;
350 return 0; 348 return 0;
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/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c
new file mode 100644
index 000000000000..c2f17cc43dfa
--- /dev/null
+++ b/arch/powerpc/sysdev/xilinx_intc.c
@@ -0,0 +1,151 @@
1/*
2 * Interrupt controller driver for Xilinx Virtex FPGAs
3 *
4 * Copyright (C) 2007 Secret Lab Technologies Ltd.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 *
10 */
11
12/*
13 * This is a driver for the interrupt controller typically found in
14 * Xilinx Virtex FPGA designs.
15 *
16 * The interrupt sense levels are hard coded into the FPGA design with
17 * typically a 1:1 relationship between irq lines and devices (no shared
18 * irq lines). Therefore, this driver does not attempt to handle edge
19 * and level interrupts differently.
20 */
21#undef DEBUG
22
23#include <linux/kernel.h>
24#include <linux/irq.h>
25#include <linux/of.h>
26#include <asm/io.h>
27#include <asm/processor.h>
28#include <asm/irq.h>
29
30/*
31 * INTC Registers
32 */
33#define XINTC_ISR 0 /* Interrupt Status */
34#define XINTC_IPR 4 /* Interrupt Pending */
35#define XINTC_IER 8 /* Interrupt Enable */
36#define XINTC_IAR 12 /* Interrupt Acknowledge */
37#define XINTC_SIE 16 /* Set Interrupt Enable bits */
38#define XINTC_CIE 20 /* Clear Interrupt Enable bits */
39#define XINTC_IVR 24 /* Interrupt Vector */
40#define XINTC_MER 28 /* Master Enable */
41
42static struct irq_host *master_irqhost;
43
44/*
45 * IRQ Chip operations
46 */
47static void xilinx_intc_mask(unsigned int virq)
48{
49 int irq = virq_to_hw(virq);
50 void * regs = get_irq_chip_data(virq);
51 pr_debug("mask: %d\n", irq);
52 out_be32(regs + XINTC_CIE, 1 << irq);
53}
54
55static void xilinx_intc_unmask(unsigned int virq)
56{
57 int irq = virq_to_hw(virq);
58 void * regs = get_irq_chip_data(virq);
59 pr_debug("unmask: %d\n", irq);
60 out_be32(regs + XINTC_SIE, 1 << irq);
61}
62
63static void xilinx_intc_ack(unsigned int virq)
64{
65 int irq = virq_to_hw(virq);
66 void * regs = get_irq_chip_data(virq);
67 pr_debug("ack: %d\n", irq);
68 out_be32(regs + XINTC_IAR, 1 << irq);
69}
70
71static struct irq_chip xilinx_intc_irqchip = {
72 .typename = "Xilinx INTC",
73 .mask = xilinx_intc_mask,
74 .unmask = xilinx_intc_unmask,
75 .ack = xilinx_intc_ack,
76};
77
78/*
79 * IRQ Host operations
80 */
81static int xilinx_intc_map(struct irq_host *h, unsigned int virq,
82 irq_hw_number_t irq)
83{
84 set_irq_chip_data(virq, h->host_data);
85 set_irq_chip_and_handler(virq, &xilinx_intc_irqchip, handle_level_irq);
86 set_irq_type(virq, IRQ_TYPE_NONE);
87 return 0;
88}
89
90static struct irq_host_ops xilinx_intc_ops = {
91 .map = xilinx_intc_map,
92};
93
94struct irq_host * __init
95xilinx_intc_init(struct device_node *np)
96{
97 struct irq_host * irq;
98 struct resource res;
99 void * regs;
100 int rc;
101
102 /* Find and map the intc registers */
103 rc = of_address_to_resource(np, 0, &res);
104 if (rc) {
105 printk(KERN_ERR __FILE__ ": of_address_to_resource() failed\n");
106 return NULL;
107 }
108 regs = ioremap(res.start, 32);
109
110 printk(KERN_INFO "Xilinx intc at 0x%08X mapped to 0x%p\n",
111 res.start, regs);
112
113 /* Setup interrupt controller */
114 out_be32(regs + XINTC_IER, 0); /* disable all irqs */
115 out_be32(regs + XINTC_IAR, ~(u32) 0); /* Acknowledge pending irqs */
116 out_be32(regs + XINTC_MER, 0x3UL); /* Turn on the Master Enable. */
117
118 /* Allocate and initialize an irq_host structure. */
119 irq = irq_alloc_host(np, IRQ_HOST_MAP_LINEAR, 32, &xilinx_intc_ops, -1);
120 if (!irq)
121 panic(__FILE__ ": Cannot allocate IRQ host\n");
122 irq->host_data = regs;
123 return irq;
124}
125
126int xilinx_intc_get_irq(void)
127{
128 void * regs = master_irqhost->host_data;
129 pr_debug("get_irq:\n");
130 return irq_linear_revmap(master_irqhost, in_be32(regs + XINTC_IVR));
131}
132
133void __init xilinx_intc_init_tree(void)
134{
135 struct device_node *np;
136
137 /* find top level interrupt controller */
138 for_each_compatible_node(np, NULL, "xilinx,intc") {
139 if (!of_get_property(np, "interrupts", NULL))
140 break;
141 }
142
143 /* xilinx interrupt controller needs to be top level */
144 BUG_ON(!np);
145
146 master_irqhost = xilinx_intc_init(np);
147 BUG_ON(!master_irqhost);
148
149 irq_set_default_host(master_irqhost);
150 of_node_put(np);
151}