aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/powerpc/booting-without-of.txt336
-rw-r--r--MAINTAINERS29
-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_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
-rw-r--r--arch/ppc/.gitignore2
-rw-r--r--arch/ppc/8xx_io/enet.c1
-rw-r--r--arch/ppc/Kconfig154
-rw-r--r--arch/ppc/Makefile1
-rw-r--r--arch/ppc/amiga/Makefile8
-rw-r--r--arch/ppc/amiga/amiga_ksyms.c1
-rw-r--r--arch/ppc/amiga/amiints.c322
-rw-r--r--arch/ppc/amiga/amisound.c1
-rw-r--r--arch/ppc/amiga/bootinfo.c78
-rw-r--r--arch/ppc/amiga/chipram.c1
-rw-r--r--arch/ppc/amiga/cia.c176
-rw-r--r--arch/ppc/amiga/config.c953
-rw-r--r--arch/ppc/amiga/ints.c158
-rw-r--r--arch/ppc/amiga/pcmcia.c1
-rw-r--r--arch/ppc/amiga/time.c57
-rw-r--r--arch/ppc/boot/simple/embed_config.c8
-rw-r--r--arch/ppc/boot/simple/misc-embedded.c4
-rw-r--r--arch/ppc/boot/simple/uartlite_tty.c8
-rw-r--r--arch/ppc/configs/apus_defconfig920
-rw-r--r--arch/ppc/kernel/head.S117
-rw-r--r--arch/ppc/kernel/head_44x.S10
-rw-r--r--arch/ppc/kernel/ppc_ksyms.c3
-rw-r--r--arch/ppc/kernel/setup.c1
-rw-r--r--arch/ppc/kernel/vmlinux.lds.S2
-rw-r--r--arch/ppc/mm/pgtable.c38
-rw-r--r--arch/ppc/platforms/Makefile4
-rw-r--r--arch/ppc/platforms/apus_pci.c207
-rw-r--r--arch/ppc/platforms/apus_pci.h34
-rw-r--r--arch/ppc/platforms/apus_setup.c798
-rw-r--r--arch/ppc/platforms/ev64360.c3
-rw-r--r--arch/ppc/platforms/katana.c3
-rw-r--r--arch/ppc/syslib/ocp.c2
-rw-r--r--arch/ppc/syslib/virtex_devices.h8
-rw-r--r--drivers/block/viodasd.c77
-rw-r--r--drivers/cdrom/viocd.c128
-rw-r--r--drivers/char/hvc_beat.c4
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c6
-rw-r--r--drivers/char/viotape.c125
-rw-r--r--drivers/macintosh/adb-iop.c1
-rw-r--r--drivers/macintosh/adbhid.c21
-rw-r--r--drivers/macintosh/ans-lcd.c3
-rw-r--r--drivers/macintosh/ans-lcd.h (renamed from include/asm-ppc/ans-lcd.h)0
-rw-r--r--drivers/macintosh/therm_adt746x.c5
-rw-r--r--drivers/macintosh/via-pmu.c2
-rw-r--r--drivers/macintosh/windfarm_smu_sat.c2
-rw-r--r--drivers/misc/hdpuftrs/hdpu_cpustate.c107
-rw-r--r--drivers/misc/hdpuftrs/hdpu_nexus.c88
-rw-r--r--drivers/mtd/maps/Kconfig2
-rw-r--r--drivers/mtd/maps/physmap_of.c349
-rw-r--r--drivers/net/ucc_geth.c2
-rw-r--r--drivers/net/ucc_geth.h1
-rw-r--r--drivers/net/ucc_geth_mii.c1
-rw-r--r--drivers/serial/Kconfig25
-rw-r--r--drivers/serial/cpm_uart/cpm_uart.h48
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_core.c539
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm1.c18
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm1.h16
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm2.c24
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm2.h16
-rw-r--r--drivers/serial/mpc52xx_uart.c2
-rw-r--r--drivers/serial/pmac_zilog.c22
-rw-r--r--drivers/serial/uartlite.c286
-rw-r--r--drivers/video/platinumfb.c48
-rw-r--r--drivers/video/xilinxfb.c353
-rw-r--r--fs/binfmt_elf.c14
-rw-r--r--include/asm-powerpc/8xx_immap.h564
-rw-r--r--include/asm-powerpc/atomic.h34
-rw-r--r--include/asm-powerpc/cell-regs.h (renamed from arch/powerpc/platforms/cell/cbe_regs.h)48
-rw-r--r--include/asm-powerpc/clk_interface.h20
-rw-r--r--include/asm-powerpc/commproc.h755
-rw-r--r--include/asm-powerpc/cpm.h14
-rw-r--r--include/asm-powerpc/cpm2.h1274
-rw-r--r--include/asm-powerpc/cputable.h40
-rw-r--r--include/asm-powerpc/dcr-mmio.h6
-rw-r--r--include/asm-powerpc/dcr-native.h6
-rw-r--r--include/asm-powerpc/dma-mapping.h24
-rw-r--r--include/asm-powerpc/elf.h9
-rw-r--r--include/asm-powerpc/exception.h311
-rw-r--r--include/asm-powerpc/fs_pd.h40
-rw-r--r--include/asm-powerpc/highmem.h135
-rw-r--r--include/asm-powerpc/hydra.h102
-rw-r--r--include/asm-powerpc/ide.h2
-rw-r--r--include/asm-powerpc/immap_86xx.h219
-rw-r--r--include/asm-powerpc/immap_cpm2.h650
-rw-r--r--include/asm-powerpc/immap_qe.h35
-rw-r--r--include/asm-powerpc/io.h28
-rw-r--r--include/asm-powerpc/irq.h8
-rw-r--r--include/asm-powerpc/iseries/hv_call_event.h10
-rw-r--r--include/asm-powerpc/iseries/iommu.h4
-rw-r--r--include/asm-powerpc/iseries/lpar_map.h3
-rw-r--r--include/asm-powerpc/iseries/vio.h116
-rw-r--r--include/asm-powerpc/kgdb.h57
-rw-r--r--include/asm-powerpc/lmb.h6
-rw-r--r--include/asm-powerpc/machdep.h10
-rw-r--r--include/asm-powerpc/mmu-40x.h65
-rw-r--r--include/asm-powerpc/mmu-hash64.h141
-rw-r--r--include/asm-powerpc/mmu.h3
-rw-r--r--include/asm-powerpc/mpc52xx.h12
-rw-r--r--include/asm-powerpc/mpc52xx_psc.h191
-rw-r--r--include/asm-powerpc/mpc85xx.h45
-rw-r--r--include/asm-powerpc/mpic.h13
-rw-r--r--include/asm-powerpc/nvram.h6
-rw-r--r--include/asm-powerpc/paca.h11
-rw-r--r--include/asm-powerpc/page_64.h17
-rw-r--r--include/asm-powerpc/pci-bridge.h3
-rw-r--r--include/asm-powerpc/percpu.h2
-rw-r--r--include/asm-powerpc/pgtable-4k.h2
-rw-r--r--include/asm-powerpc/pgtable-64k.h2
-rw-r--r--include/asm-powerpc/ppc_asm.h18
-rw-r--r--include/asm-powerpc/processor.h4
-rw-r--r--include/asm-powerpc/prom.h3
-rw-r--r--include/asm-powerpc/ps3.h9
-rw-r--r--include/asm-powerpc/qe.h246
-rw-r--r--include/asm-powerpc/qe_ic.h68
-rw-r--r--include/asm-powerpc/reg.h52
-rw-r--r--include/asm-powerpc/rwsem.h4
-rw-r--r--include/asm-powerpc/smp.h2
-rw-r--r--include/asm-powerpc/spu.h28
-rw-r--r--include/asm-powerpc/system.h3
-rw-r--r--include/asm-powerpc/time.h3
-rw-r--r--include/asm-powerpc/tlb.h2
-rw-r--r--include/asm-powerpc/tlbflush.h3
-rw-r--r--include/asm-powerpc/types.h2
-rw-r--r--include/asm-powerpc/ucc.h40
-rw-r--r--include/asm-powerpc/ucc_slow.h9
-rw-r--r--include/asm-powerpc/udbg.h1
-rw-r--r--include/asm-powerpc/vio.h6
-rw-r--r--include/asm-powerpc/xilinx_intc.h20
-rw-r--r--include/asm-ppc/amigahw.h16
-rw-r--r--include/asm-ppc/amigaints.h133
-rw-r--r--include/asm-ppc/amigappc.h85
-rw-r--r--include/asm-ppc/bootinfo.h5
-rw-r--r--include/asm-ppc/io.h51
-rw-r--r--include/asm-ppc/machdep.h4
-rw-r--r--include/asm-ppc/ocp.h2
-rw-r--r--include/asm-ppc/page.h44
-rw-r--r--include/asm-ppc/pgtable.h8
-rw-r--r--include/asm-ppc/prom.h1
-rw-r--r--include/linux/elf.h14
-rw-r--r--include/linux/of.h1
-rw-r--r--include/linux/pci_ids.h3
-rw-r--r--include/linux/xilinxfb.h30
-rw-r--r--kernel/sysctl.c2
-rw-r--r--lib/Kconfig.debug2
529 files changed, 31125 insertions, 13476 deletions
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 838fd323e797..a96e85397eb7 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -50,7 +50,7 @@ Table of Contents
50 g) Freescale SOC SEC Security Engines 50 g) Freescale SOC SEC Security Engines
51 h) Board Control and Status (BCSR) 51 h) Board Control and Status (BCSR)
52 i) Freescale QUICC Engine module (QE) 52 i) Freescale QUICC Engine module (QE)
53 j) Flash chip nodes 53 j) CFI or JEDEC memory-mapped NOR flash
54 k) Global Utilities Block 54 k) Global Utilities Block
55 55
56 VII - Specifying interrupt information for devices 56 VII - Specifying interrupt information for devices
@@ -1510,7 +1510,10 @@ platforms are moved over to use the flattened-device-tree model.
1510 1510
1511 i) Freescale QUICC Engine module (QE) 1511 i) Freescale QUICC Engine module (QE)
1512 This represents qe module that is installed on PowerQUICC II Pro. 1512 This represents qe module that is installed on PowerQUICC II Pro.
1513 Hopefully it will merge backward compatibility with CPM/CPM2. 1513
1514 NOTE: This is an interim binding; it should be updated to fit
1515 in with the CPM binding later in this document.
1516
1514 Basically, it is a bus of devices, that could act more or less 1517 Basically, it is a bus of devices, that could act more or less
1515 as a complete entity (UCC, USB etc ). All of them should be siblings on 1518 as a complete entity (UCC, USB etc ). All of them should be siblings on
1516 the "root" qe node, using the common properties from there. 1519 the "root" qe node, using the common properties from there.
@@ -1548,7 +1551,7 @@ platforms are moved over to use the flattened-device-tree model.
1548 Required properties: 1551 Required properties:
1549 - device_type : should be "spi". 1552 - device_type : should be "spi".
1550 - compatible : should be "fsl_spi". 1553 - compatible : should be "fsl_spi".
1551 - mode : the SPI operation mode, it can be "cpu" or "qe". 1554 - mode : the SPI operation mode, it can be "cpu" or "cpu-qe".
1552 - reg : Offset and length of the register set for the device 1555 - reg : Offset and length of the register set for the device
1553 - interrupts : <a b> where a is the interrupt number and b is a 1556 - interrupts : <a b> where a is the interrupt number and b is a
1554 field that represents an encoding of the sense and level 1557 field that represents an encoding of the sense and level
@@ -1757,45 +1760,69 @@ platforms are moved over to use the flattened-device-tree model.
1757 }; 1760 };
1758 }; 1761 };
1759 1762
1760 j) Flash chip nodes 1763 j) CFI or JEDEC memory-mapped NOR flash
1761 1764
1762 Flash chips (Memory Technology Devices) are often used for solid state 1765 Flash chips (Memory Technology Devices) are often used for solid state
1763 file systems on embedded devices. 1766 file systems on embedded devices.
1764 1767
1765 Required properties: 1768 - compatible : should contain the specific model of flash chip(s)
1766 1769 used, if known, followed by either "cfi-flash" or "jedec-flash"
1767 - device_type : has to be "rom" 1770 - reg : Address range of the flash chip
1768 - compatible : Should specify what this flash device is compatible with. 1771 - bank-width : Width (in bytes) of the flash bank. Equal to the
1769 Currently, this is most likely to be "direct-mapped" (which 1772 device width times the number of interleaved chips.
1770 corresponds to the MTD physmap mapping driver). 1773 - device-width : (optional) Width of a single flash chip. If
1771 - reg : Offset and length of the register set (or memory mapping) for 1774 omitted, assumed to be equal to 'bank-width'.
1772 the device. 1775 - #address-cells, #size-cells : Must be present if the flash has
1773 - bank-width : Width of the flash data bus in bytes. Required 1776 sub-nodes representing partitions (see below). In this case
1774 for the NOR flashes (compatible == "direct-mapped" and others) ONLY. 1777 both #address-cells and #size-cells must be equal to 1.
1775 1778
1776 Recommended properties : 1779 For JEDEC compatible devices, the following additional properties
1777 1780 are defined:
1778 - partitions : Several pairs of 32-bit values where the first value is 1781
1779 partition's offset from the start of the device and the second one is 1782 - vendor-id : Contains the flash chip's vendor id (1 byte).
1780 partition size in bytes with LSB used to signify a read only 1783 - device-id : Contains the flash chip's device id (1 byte).
1781 partition (so, the partition size should always be an even number). 1784
1782 - partition-names : The list of concatenated zero terminated strings 1785 In addition to the information on the flash bank itself, the
1783 representing the partition names. 1786 device tree may optionally contain additional information
1784 - probe-type : The type of probe which should be done for the chip 1787 describing partitions of the flash address space. This can be
1785 (JEDEC vs CFI actually). Valid ONLY for NOR flashes. 1788 used on platforms which have strong conventions about which
1789 portions of the flash are used for what purposes, but which don't
1790 use an on-flash partition table such as RedBoot.
1791
1792 Each partition is represented as a sub-node of the flash device.
1793 Each node's name represents the name of the corresponding
1794 partition of the flash device.
1795
1796 Flash partitions
1797 - reg : The partition's offset and size within the flash bank.
1798 - label : (optional) The label / name for this flash partition.
1799 If omitted, the label is taken from the node name (excluding
1800 the unit address).
1801 - read-only : (optional) This parameter, if present, is a hint to
1802 Linux that this flash partition should only be mounted
1803 read-only. This is usually used for flash partitions
1804 containing early-boot firmware images or data which should not
1805 be clobbered.
1786 1806
1787 Example: 1807 Example:
1788 1808
1789 flash@ff000000 { 1809 flash@ff000000 {
1790 device_type = "rom"; 1810 compatible = "amd,am29lv128ml", "cfi-flash";
1791 compatible = "direct-mapped"; 1811 reg = <ff000000 01000000>;
1792 probe-type = "CFI"; 1812 bank-width = <4>;
1793 reg = <ff000000 01000000>; 1813 device-width = <1>;
1794 bank-width = <4>; 1814 #address-cells = <1>;
1795 partitions = <00000000 00f80000 1815 #size-cells = <1>;
1796 00f80000 00080001>; 1816 fs@0 {
1797 partition-names = "fs\0firmware"; 1817 label = "fs";
1798 }; 1818 reg = <0 f80000>;
1819 };
1820 firmware@f80000 {
1821 label ="firmware";
1822 reg = <f80000 80000>;
1823 read-only;
1824 };
1825 };
1799 1826
1800 k) Global Utilities Block 1827 k) Global Utilities Block
1801 1828
@@ -1824,8 +1851,243 @@ platforms are moved over to use the flattened-device-tree model.
1824 fsl,has-rstcr; 1851 fsl,has-rstcr;
1825 }; 1852 };
1826 1853
1854 l) Freescale Communications Processor Module
1855
1856 NOTE: This is an interim binding, and will likely change slightly,
1857 as more devices are supported. The QE bindings especially are
1858 incomplete.
1859
1860 i) Root CPM node
1861
1862 Properties:
1863 - compatible : "fsl,cpm1", "fsl,cpm2", or "fsl,qe".
1864 - reg : A 48-byte region beginning with CPCR.
1865
1866 Example:
1867 cpm@119c0 {
1868 #address-cells = <1>;
1869 #size-cells = <1>;
1870 #interrupt-cells = <2>;
1871 compatible = "fsl,mpc8272-cpm", "fsl,cpm2";
1872 reg = <119c0 30>;
1873 }
1874
1875 ii) Properties common to mulitple CPM/QE devices
1876
1877 - fsl,cpm-command : This value is ORed with the opcode and command flag
1878 to specify the device on which a CPM command operates.
1879
1880 - fsl,cpm-brg : Indicates which baud rate generator the device
1881 is associated with. If absent, an unused BRG
1882 should be dynamically allocated. If zero, the
1883 device uses an external clock rather than a BRG.
1884
1885 - reg : Unless otherwise specified, the first resource represents the
1886 scc/fcc/ucc registers, and the second represents the device's
1887 parameter RAM region (if it has one).
1888
1889 iii) Serial
1890
1891 Currently defined compatibles:
1892 - fsl,cpm1-smc-uart
1893 - fsl,cpm2-smc-uart
1894 - fsl,cpm1-scc-uart
1895 - fsl,cpm2-scc-uart
1896 - fsl,qe-uart
1897
1898 Example:
1899
1900 serial@11a00 {
1901 device_type = "serial";
1902 compatible = "fsl,mpc8272-scc-uart",
1903 "fsl,cpm2-scc-uart";
1904 reg = <11a00 20 8000 100>;
1905 interrupts = <28 8>;
1906 interrupt-parent = <&PIC>;
1907 fsl,cpm-brg = <1>;
1908 fsl,cpm-command = <00800000>;
1909 };
1910
1911 iii) Network
1912
1913 Currently defined compatibles:
1914 - fsl,cpm1-scc-enet
1915 - fsl,cpm2-scc-enet
1916 - fsl,cpm1-fec-enet
1917 - fsl,cpm2-fcc-enet (third resource is GFEMR)
1918 - fsl,qe-enet
1919
1920 Example:
1921
1922 ethernet@11300 {
1923 device_type = "network";
1924 compatible = "fsl,mpc8272-fcc-enet",
1925 "fsl,cpm2-fcc-enet";
1926 reg = <11300 20 8400 100 11390 1>;
1927 local-mac-address = [ 00 00 00 00 00 00 ];
1928 interrupts = <20 8>;
1929 interrupt-parent = <&PIC>;
1930 phy-handle = <&PHY0>;
1931 linux,network-index = <0>;
1932 fsl,cpm-command = <12000300>;
1933 };
1934
1935 iv) MDIO
1936
1937 Currently defined compatibles:
1938 fsl,pq1-fec-mdio (reg is same as first resource of FEC device)
1939 fsl,cpm2-mdio-bitbang (reg is port C registers)
1940
1941 Properties for fsl,cpm2-mdio-bitbang:
1942 fsl,mdio-pin : pin of port C controlling mdio data
1943 fsl,mdc-pin : pin of port C controlling mdio clock
1944
1945 Example:
1946
1947 mdio@10d40 {
1948 device_type = "mdio";
1949 compatible = "fsl,mpc8272ads-mdio-bitbang",
1950 "fsl,mpc8272-mdio-bitbang",
1951 "fsl,cpm2-mdio-bitbang";
1952 reg = <10d40 14>;
1953 #address-cells = <1>;
1954 #size-cells = <0>;
1955 fsl,mdio-pin = <12>;
1956 fsl,mdc-pin = <13>;
1957 };
1958
1959 v) Baud Rate Generators
1960
1961 Currently defined compatibles:
1962 fsl,cpm-brg
1963 fsl,cpm1-brg
1964 fsl,cpm2-brg
1965
1966 Properties:
1967 - reg : There may be an arbitrary number of reg resources; BRG
1968 numbers are assigned to these in order.
1969 - clock-frequency : Specifies the base frequency driving
1970 the BRG.
1971
1972 Example:
1973
1974 brg@119f0 {
1975 compatible = "fsl,mpc8272-brg",
1976 "fsl,cpm2-brg",
1977 "fsl,cpm-brg";
1978 reg = <119f0 10 115f0 10>;
1979 clock-frequency = <d#25000000>;
1980 };
1981
1982 vi) Interrupt Controllers
1983
1984 Currently defined compatibles:
1985 - fsl,cpm1-pic
1986 - only one interrupt cell
1987 - fsl,pq1-pic
1988 - fsl,cpm2-pic
1989 - second interrupt cell is level/sense:
1990 - 2 is falling edge
1991 - 8 is active low
1992
1993 Example:
1994
1995 interrupt-controller@10c00 {
1996 #interrupt-cells = <2>;
1997 interrupt-controller;
1998 reg = <10c00 80>;
1999 compatible = "mpc8272-pic", "fsl,cpm2-pic";
2000 };
2001
2002 vii) USB (Universal Serial Bus Controller)
2003
2004 Properties:
2005 - compatible : "fsl,cpm1-usb", "fsl,cpm2-usb", "fsl,qe-usb"
2006
2007 Example:
2008 usb@11bc0 {
2009 #address-cells = <1>;
2010 #size-cells = <0>;
2011 compatible = "fsl,cpm2-usb";
2012 reg = <11b60 18 8b00 100>;
2013 interrupts = <b 8>;
2014 interrupt-parent = <&PIC>;
2015 fsl,cpm-command = <2e600000>;
2016 };
2017
2018 viii) Multi-User RAM (MURAM)
2019
2020 The multi-user/dual-ported RAM is expressed as a bus under the CPM node.
2021
2022 Ranges must be set up subject to the following restrictions:
2023
2024 - Children's reg nodes must be offsets from the start of all muram, even
2025 if the user-data area does not begin at zero.
2026 - If multiple range entries are used, the difference between the parent
2027 address and the child address must be the same in all, so that a single
2028 mapping can cover them all while maintaining the ability to determine
2029 CPM-side offsets with pointer subtraction. It is recommended that
2030 multiple range entries not be used.
2031 - A child address of zero must be translatable, even if no reg resources
2032 contain it.
2033
2034 A child "data" node must exist, compatible with "fsl,cpm-muram-data", to
2035 indicate the portion of muram that is usable by the OS for arbitrary
2036 purposes. The data node may have an arbitrary number of reg resources,
2037 all of which contribute to the allocatable muram pool.
2038
2039 Example, based on mpc8272:
2040
2041 muram@0 {
2042 #address-cells = <1>;
2043 #size-cells = <1>;
2044 ranges = <0 0 10000>;
2045
2046 data@0 {
2047 compatible = "fsl,cpm-muram-data";
2048 reg = <0 2000 9800 800>;
2049 };
2050 };
2051
2052 m) Chipselect/Local Bus
2053
2054 Properties:
2055 - name : Should be localbus
2056 - #address-cells : Should be either two or three. The first cell is the
2057 chipselect number, and the remaining cells are the
2058 offset into the chipselect.
2059 - #size-cells : Either one or two, depending on how large each chipselect
2060 can be.
2061 - ranges : Each range corresponds to a single chipselect, and cover
2062 the entire access window as configured.
2063
2064 Example:
2065 localbus@f0010100 {
2066 compatible = "fsl,mpc8272ads-localbus",
2067 "fsl,mpc8272-localbus",
2068 "fsl,pq2-localbus";
2069 #address-cells = <2>;
2070 #size-cells = <1>;
2071 reg = <f0010100 40>;
2072
2073 ranges = <0 0 fe000000 02000000
2074 1 0 f4500000 00008000>;
2075
2076 flash@0,0 {
2077 compatible = "jedec-flash";
2078 reg = <0 0 2000000>;
2079 bank-width = <4>;
2080 device-width = <1>;
2081 };
2082
2083 board-control@1,0 {
2084 reg = <1 0 20>;
2085 compatible = "fsl,mpc8272ads-bcsr";
2086 };
2087 };
2088
1827 2089
1828 h) 4xx/Axon EMAC ethernet nodes 2090 n) 4xx/Axon EMAC ethernet nodes
1829 2091
1830 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also 2092 The EMAC ethernet controller in IBM and AMCC 4xx chips, and also
1831 the Axon bridge. To operate this needs to interact with a ths 2093 the Axon bridge. To operate this needs to interact with a ths
diff --git a/MAINTAINERS b/MAINTAINERS
index 8a1360045c2d..c4eca56ed5bf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1535,7 +1535,7 @@ P: Pantelis Antoniou
1535M: pantelis.antoniou@gmail.com 1535M: pantelis.antoniou@gmail.com
1536P: Vitaly Bordug 1536P: Vitaly Bordug
1537M: vbordug@ru.mvista.com 1537M: vbordug@ru.mvista.com
1538L: linuxppc-embedded@ozlabs.org 1538L: linuxppc-dev@ozlabs.org
1539L: netdev@vger.kernel.org 1539L: netdev@vger.kernel.org
1540S: Maintained 1540S: Maintained
1541 1541
@@ -1543,14 +1543,14 @@ FREESCALE HIGHSPEED USB DEVICE DRIVER
1543P: Li Yang 1543P: Li Yang
1544M: leoli@freescale.com 1544M: leoli@freescale.com
1545L: linux-usb-devel@lists.sourceforge.net 1545L: linux-usb-devel@lists.sourceforge.net
1546L: linuxppc-embedded@ozlabs.org 1546L: linuxppc-dev@ozlabs.org
1547S: Maintained 1547S: Maintained
1548 1548
1549FREESCALE QUICC ENGINE UCC ETHERNET DRIVER 1549FREESCALE QUICC ENGINE UCC ETHERNET DRIVER
1550P: Li Yang 1550P: Li Yang
1551M: leoli@freescale.com 1551M: leoli@freescale.com
1552L: netdev@vger.kernel.org 1552L: netdev@vger.kernel.org
1553L: linuxppc-embedded@ozlabs.org 1553L: linuxppc-dev@ozlabs.org
1554S: Maintained 1554S: Maintained
1555 1555
1556FILE LOCKING (flock() and fcntl()/lockf()) 1556FILE LOCKING (flock() and fcntl()/lockf())
@@ -2297,38 +2297,49 @@ S: Maintained
2297LINUX FOR POWERPC EMBEDDED MPC52XX 2297LINUX FOR POWERPC EMBEDDED MPC52XX
2298P: Sylvain Munaut 2298P: Sylvain Munaut
2299M: tnt@246tNt.com 2299M: tnt@246tNt.com
2300P: Grant Likely
2301M: grant.likely@secretlab.ca
2300W: http://www.246tNt.com/mpc52xx/ 2302W: http://www.246tNt.com/mpc52xx/
2301W: http://www.penguinppc.org/ 2303W: http://www.penguinppc.org/
2302L: linuxppc-dev@ozlabs.org 2304L: linuxppc-dev@ozlabs.org
2303L: linuxppc-embedded@ozlabs.org
2304S: Maintained 2305S: Maintained
2305 2306
2306LINUX FOR POWERPC EMBEDDED PPC4XX 2307LINUX FOR POWERPC EMBEDDED PPC4XX
2308P: Josh Boyer
2309M: jwboyer@linux.vnet.ibm.com
2307P: Matt Porter 2310P: Matt Porter
2308M: mporter@kernel.crashing.org 2311M: mporter@kernel.crashing.org
2309W: http://www.penguinppc.org/ 2312W: http://www.penguinppc.org/
2310L: linuxppc-embedded@ozlabs.org 2313L: linuxppc-dev@ozlabs.org
2314T: git kernel.org:/pub/scm/linux/kernel/git/jwboyer/powerpc.git
2315S: Maintained
2316
2317LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
2318P: Grant Likely
2319M: grant.likely@secretlab.ca
2320W: http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex
2321L: linuxppc-dev@ozlabs.org
2311S: Maintained 2322S: Maintained
2312 2323
2313LINUX FOR POWERPC BOOT CODE 2324LINUX FOR POWERPC BOOT CODE
2314P: Tom Rini 2325P: Tom Rini
2315M: trini@kernel.crashing.org 2326M: trini@kernel.crashing.org
2316W: http://www.penguinppc.org/ 2327W: http://www.penguinppc.org/
2317L: linuxppc-embedded@ozlabs.org 2328L: linuxppc-dev@ozlabs.org
2318S: Maintained 2329S: Maintained
2319 2330
2320LINUX FOR POWERPC EMBEDDED PPC8XX 2331LINUX FOR POWERPC EMBEDDED PPC8XX
2321P: Marcelo Tosatti 2332P: Marcelo Tosatti
2322M: marcelo@kvack.org 2333M: marcelo@kvack.org
2323W: http://www.penguinppc.org/ 2334W: http://www.penguinppc.org/
2324L: linuxppc-embedded@ozlabs.org 2335L: linuxppc-dev@ozlabs.org
2325S: Maintained 2336S: Maintained
2326 2337
2327LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX 2338LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX
2328P: Kumar Gala 2339P: Kumar Gala
2329M: galak@kernel.crashing.org 2340M: galak@kernel.crashing.org
2330W: http://www.penguinppc.org/ 2341W: http://www.penguinppc.org/
2331L: linuxppc-embedded@ozlabs.org 2342L: linuxppc-dev@ozlabs.org
2332S: Maintained 2343S: Maintained
2333 2344
2334LINUX FOR POWERPC PA SEMI PWRFICIENT 2345LINUX FOR POWERPC PA SEMI PWRFICIENT
@@ -2990,7 +3001,7 @@ POWERPC 4xx EMAC DRIVER
2990P: Eugene Surovegin 3001P: Eugene Surovegin
2991M: ebs@ebshome.net 3002M: ebs@ebshome.net
2992W: http://kernel.ebshome.net/emac/ 3003W: http://kernel.ebshome.net/emac/
2993L: linuxppc-embedded@ozlabs.org 3004L: linuxppc-dev@ozlabs.org
2994L: netdev@vger.kernel.org 3005L: netdev@vger.kernel.org
2995S: Maintained 3006S: Maintained
2996 3007
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_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}
diff --git a/arch/ppc/.gitignore b/arch/ppc/.gitignore
index a1a869c8c840..1e79a0ae4473 100644
--- a/arch/ppc/.gitignore
+++ b/arch/ppc/.gitignore
@@ -1 +1 @@
include /include
diff --git a/arch/ppc/8xx_io/enet.c b/arch/ppc/8xx_io/enet.c
index 703d47eee436..eace3bc118d2 100644
--- a/arch/ppc/8xx_io/enet.c
+++ b/arch/ppc/8xx_io/enet.c
@@ -44,6 +44,7 @@
44#include <asm/mpc8xx.h> 44#include <asm/mpc8xx.h>
45#include <asm/uaccess.h> 45#include <asm/uaccess.h>
46#include <asm/commproc.h> 46#include <asm/commproc.h>
47#include <asm/cacheflush.h>
47 48
48/* 49/*
49 * Theory of Operation 50 * Theory of Operation
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 6bdeeb70b157..20dce4681259 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -4,6 +4,10 @@
4 4
5mainmenu "Linux/PowerPC Kernel Configuration" 5mainmenu "Linux/PowerPC Kernel Configuration"
6 6
7config WORD_SIZE
8 int
9 default 32
10
7config MMU 11config MMU
8 bool 12 bool
9 default y 13 default y
@@ -573,24 +577,9 @@ choice
573 577
574 Select PReP if configuring for a PReP machine. 578 Select PReP if configuring for a PReP machine.
575 579
576 Select Gemini if configuring for a Synergy Microsystems' Gemini
577 series Single Board Computer. More information is available at:
578 <http://www.synergymicro.com/PressRel/97_10_15.html>.
579
580 Select APUS if configuring for a PowerUP Amiga. More information is
581 available at: <http://linux-apus.sourceforge.net/>.
582
583config PPC_PREP 580config PPC_PREP
584 bool "PReP" 581 bool "PReP"
585 582
586config APUS
587 bool "Amiga-APUS"
588 depends on BROKEN
589 help
590 Select APUS if configuring for a PowerUP Amiga.
591 More information is available at:
592 <http://linux-apus.sourceforge.net/>.
593
594config KATANA 583config KATANA
595 bool "Artesyn-Katana" 584 bool "Artesyn-Katana"
596 help 585 help
@@ -1027,133 +1016,7 @@ config CMDLINE
1027 some command-line options at build time by entering them here. In 1016 some command-line options at build time by entering them here. In
1028 most cases you will need to specify the root device here. 1017 most cases you will need to specify the root device here.
1029 1018
1030config AMIGA 1019if BROKEN
1031 bool
1032 depends on APUS
1033 default y
1034 help
1035 This option enables support for the Amiga series of computers.
1036
1037config ZORRO
1038 bool
1039 depends on APUS
1040 default y
1041 help
1042 This enables support for the Zorro bus in the Amiga. If you have
1043 expansion cards in your Amiga that conform to the Amiga
1044 AutoConfig(tm) specification, say Y, otherwise N. Note that even
1045 expansion cards that do not fit in the Zorro slots but fit in e.g.
1046 the CPU slot may fall in this category, so you have to say Y to let
1047 Linux use these.
1048
1049config ABSTRACT_CONSOLE
1050 bool
1051 depends on APUS
1052 default y
1053
1054config APUS_FAST_EXCEPT
1055 bool
1056 depends on APUS
1057 default y
1058
1059config AMIGA_PCMCIA
1060 bool "Amiga 1200/600 PCMCIA support"
1061 depends on APUS && EXPERIMENTAL
1062 help
1063 Include support in the kernel for pcmcia on Amiga 1200 and Amiga
1064 600. If you intend to use pcmcia cards say Y; otherwise say N.
1065
1066config AMIGA_BUILTIN_SERIAL
1067 tristate "Amiga builtin serial support"
1068 depends on APUS
1069 help
1070 If you want to use your Amiga's built-in serial port in Linux,
1071 answer Y.
1072
1073 To compile this driver as a module, choose M here.
1074
1075config GVPIOEXT
1076 tristate "GVP IO-Extender support"
1077 depends on APUS
1078 help
1079 If you want to use a GVP IO-Extender serial card in Linux, say Y.
1080 Otherwise, say N.
1081
1082config GVPIOEXT_LP
1083 tristate "GVP IO-Extender parallel printer support"
1084 depends on GVPIOEXT
1085 help
1086 Say Y to enable driving a printer from the parallel port on your
1087 GVP IO-Extender card, N otherwise.
1088
1089config GVPIOEXT_PLIP
1090 tristate "GVP IO-Extender PLIP support"
1091 depends on GVPIOEXT
1092 help
1093 Say Y to enable doing IP over the parallel port on your GVP
1094 IO-Extender card, N otherwise.
1095
1096config MULTIFACE_III_TTY
1097 tristate "Multiface Card III serial support"
1098 depends on APUS
1099 help
1100 If you want to use a Multiface III card's serial port in Linux,
1101 answer Y.
1102
1103 To compile this driver as a module, choose M here.
1104
1105config A2232
1106 tristate "Commodore A2232 serial support (EXPERIMENTAL)"
1107 depends on EXPERIMENTAL && APUS
1108 ---help---
1109 This option supports the 2232 7-port serial card shipped with the
1110 Amiga 2000 and other Zorro-bus machines, dating from 1989. At
1111 a max of 19,200 bps, the ports are served by a 6551 ACIA UART chip
1112 each, plus a 8520 CIA, and a master 6502 CPU and buffer as well. The
1113 ports were connected with 8 pin DIN connectors on the card bracket,
1114 for which 8 pin to DB25 adapters were supplied. The card also had
1115 jumpers internally to toggle various pinning configurations.
1116
1117 This driver can be built as a module; but then "generic_serial"
1118 will also be built as a module. This has to be loaded before
1119 "ser_a2232". If you want to do this, answer M here.
1120
1121config WHIPPET_SERIAL
1122 tristate "Hisoft Whippet PCMCIA serial support"
1123 depends on AMIGA_PCMCIA
1124 help
1125 HiSoft has a web page at <http://www.hisoft.co.uk/>, but there
1126 is no listing for the Whippet in their Amiga section.
1127
1128config APNE
1129 tristate "PCMCIA NE2000 support"
1130 depends on AMIGA_PCMCIA
1131 help
1132 If you have a PCMCIA NE2000 compatible adapter, say Y. Otherwise,
1133 say N.
1134
1135 To compile this driver as a module, choose M here: the
1136 module will be called apne.
1137
1138config SERIAL_CONSOLE
1139 bool "Support for serial port console"
1140 depends on APUS && (AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y)
1141
1142config HEARTBEAT
1143 bool "Use power LED as a heartbeat"
1144 depends on APUS
1145 help
1146 Use the power-on LED on your machine as a load meter. The exact
1147 behavior is platform-dependent, but normally the flash frequency is
1148 a hyperbolic function of the 5-minute load average.
1149
1150config PROC_HARDWARE
1151 bool "/proc/hardware support"
1152 depends on APUS
1153
1154source "drivers/zorro/Kconfig"
1155
1156if !44x || BROKEN
1157source kernel/power/Kconfig 1020source kernel/power/Kconfig
1158endif 1021endif
1159 1022
@@ -1227,8 +1090,7 @@ config MCA
1227 1090
1228config PCI 1091config PCI
1229 bool "PCI support" if 40x || CPM2 || 83xx || 85xx || PPC_MPC52xx 1092 bool "PCI support" if 40x || CPM2 || 83xx || 85xx || PPC_MPC52xx
1230 default y if !40x && !CPM2 && !8xx && !APUS && !83xx && !85xx 1093 default y if !40x && !CPM2 && !8xx && !83xx && !85xx
1231 default PCI_PERMEDIA if !4xx && !CPM2 && !8xx && APUS
1232 default PCI_QSPAN if !4xx && !CPM2 && 8xx 1094 default PCI_QSPAN if !4xx && !CPM2 && 8xx
1233 help 1095 help
1234 Find out whether your system includes a PCI bus. PCI is the name of 1096 Find out whether your system includes a PCI bus. PCI is the name of
@@ -1284,10 +1146,6 @@ config 8260_PCI9_IDMA4
1284 1146
1285endchoice 1147endchoice
1286 1148
1287config PCI_PERMEDIA
1288 bool "PCI for Permedia2"
1289 depends on !4xx && !8xx && APUS
1290
1291source "drivers/pci/Kconfig" 1149source "drivers/pci/Kconfig"
1292 1150
1293source "drivers/pcmcia/Kconfig" 1151source "drivers/pcmcia/Kconfig"
diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile
index 0db66dcf0723..eee6264e8a04 100644
--- a/arch/ppc/Makefile
+++ b/arch/ppc/Makefile
@@ -69,7 +69,6 @@ core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/
69core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/ 69core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/
70core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/ 70core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/
71core-$(CONFIG_XMON) += arch/ppc/xmon/ 71core-$(CONFIG_XMON) += arch/ppc/xmon/
72core-$(CONFIG_APUS) += arch/ppc/amiga/
73drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/ 72drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
74drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/ 73drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
75drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/ 74drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
diff --git a/arch/ppc/amiga/Makefile b/arch/ppc/amiga/Makefile
deleted file mode 100644
index 59fec0a3ac8e..000000000000
--- a/arch/ppc/amiga/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
1#
2# Makefile for Linux arch/m68k/amiga source directory
3#
4
5obj-y := config.o amiints.o cia.o time.o bootinfo.o amisound.o \
6 chipram.o amiga_ksyms.o
7
8obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o
diff --git a/arch/ppc/amiga/amiga_ksyms.c b/arch/ppc/amiga/amiga_ksyms.c
deleted file mode 100644
index ec74e5b7a1ce..000000000000
--- a/arch/ppc/amiga/amiga_ksyms.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/amiga_ksyms.c"
diff --git a/arch/ppc/amiga/amiints.c b/arch/ppc/amiga/amiints.c
deleted file mode 100644
index 265fcd3c6ab2..000000000000
--- a/arch/ppc/amiga/amiints.c
+++ /dev/null
@@ -1,322 +0,0 @@
1/*
2 * Amiga Linux interrupt handling code
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive
6 * for more details.
7 *
8 * 11/07/96: rewritten interrupt handling, irq lists are exists now only for
9 * this sources where it makes sense (VERTB/PORTS/EXTER) and you must
10 * be careful that dev_id for this sources is unique since this the
11 * only possibility to distinguish between different handlers for
12 * free_irq. irq lists also have different irq flags:
13 * - IRQ_FLG_FAST: handler is inserted at top of list (after other
14 * fast handlers)
15 * - IRQ_FLG_SLOW: handler is inserted at bottom of list and before
16 * they're executed irq level is set to the previous
17 * one, but handlers don't need to be reentrant, if
18 * reentrance occurred, slow handlers will be just
19 * called again.
20 * The whole interrupt handling for CIAs is moved to cia.c
21 * /Roman Zippel
22 *
23 * 07/08/99: rewamp of the interrupt handling - we now have two types of
24 * interrupts, normal and fast handlers, fast handlers being
25 * marked with SA_INTERRUPT and runs with all other interrupts
26 * disabled. Normal interrupts disable their own source but
27 * run with all other interrupt sources enabled.
28 * PORTS and EXTER interrupts are always shared even if the
29 * drivers do not explicitly mark this when calling
30 * request_irq which they really should do.
31 * This is similar to the way interrupts are handled on all
32 * other architectures and makes a ton of sense besides
33 * having the advantage of making it easier to share
34 * drivers.
35 * /Jes
36 */
37
38#include <linux/types.h>
39#include <linux/kernel.h>
40#include <linux/sched.h>
41#include <linux/interrupt.h>
42#include <linux/irq.h>
43#include <linux/kernel_stat.h>
44#include <linux/init.h>
45
46#include <asm/system.h>
47#include <asm/irq.h>
48#include <asm/traps.h>
49#include <asm/amigahw.h>
50#include <asm/amigaints.h>
51#include <asm/amipcmcia.h>
52
53#ifdef CONFIG_APUS
54#include <asm/amigappc.h>
55#endif
56
57extern void cia_init_IRQ(struct ciabase *base);
58
59unsigned short ami_intena_vals[AMI_STD_IRQS] = {
60 IF_VERTB, IF_COPER, IF_AUD0, IF_AUD1, IF_AUD2, IF_AUD3, IF_BLIT,
61 IF_DSKSYN, IF_DSKBLK, IF_RBF, IF_TBE, IF_SOFT, IF_PORTS, IF_EXTER
62};
63static const unsigned char ami_servers[AMI_STD_IRQS] = {
64 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1
65};
66
67static short ami_ablecount[AMI_IRQS];
68
69static void ami_badint(int irq, void *dev_id, struct pt_regs *fp)
70{
71/* num_spurious += 1;*/
72}
73
74/*
75 * void amiga_init_IRQ(void)
76 *
77 * Parameters: None
78 *
79 * Returns: Nothing
80 *
81 * This function should be called during kernel startup to initialize
82 * the amiga IRQ handling routines.
83 */
84
85__init
86void amiga_init_IRQ(void)
87{
88 int i;
89
90 for (i = 0; i < AMI_IRQS; i++)
91 ami_ablecount[i] = 0;
92
93 /* turn off PCMCIA interrupts */
94 if (AMIGAHW_PRESENT(PCMCIA))
95 gayle.inten = GAYLE_IRQ_IDE;
96
97 /* turn off all interrupts... */
98 amiga_custom.intena = 0x7fff;
99 amiga_custom.intreq = 0x7fff;
100
101#ifdef CONFIG_APUS
102 /* Clear any inter-CPU interrupt requests. Circumvents bug in
103 Blizzard IPL emulation HW (or so it appears). */
104 APUS_WRITE(APUS_INT_LVL, INTLVL_SETRESET | INTLVL_MASK);
105
106 /* Init IPL emulation. */
107 APUS_WRITE(APUS_REG_INT, REGINT_INTMASTER | REGINT_ENABLEIPL);
108 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT);
109 APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_IPLMASK);
110#endif
111 /* ... and enable the master interrupt bit */
112 amiga_custom.intena = IF_SETCLR | IF_INTEN;
113
114 cia_init_IRQ(&ciaa_base);
115 cia_init_IRQ(&ciab_base);
116}
117
118/*
119 * Enable/disable a particular machine specific interrupt source.
120 * Note that this may affect other interrupts in case of a shared interrupt.
121 * This function should only be called for a _very_ short time to change some
122 * internal data, that may not be changed by the interrupt at the same time.
123 * ami_(enable|disable)_irq calls may also be nested.
124 */
125
126void amiga_enable_irq(unsigned int irq)
127{
128 if (irq >= AMI_IRQS) {
129 printk("%s: Unknown IRQ %d\n", __FUNCTION__, irq);
130 return;
131 }
132
133 ami_ablecount[irq]--;
134 if (ami_ablecount[irq]<0)
135 ami_ablecount[irq]=0;
136 else if (ami_ablecount[irq])
137 return;
138
139 /* No action for auto-vector interrupts */
140 if (irq >= IRQ_AMIGA_AUTO){
141 printk("%s: Trying to enable auto-vector IRQ %i\n",
142 __FUNCTION__, irq - IRQ_AMIGA_AUTO);
143 return;
144 }
145
146 if (irq >= IRQ_AMIGA_CIAA) {
147 cia_set_irq(irq, 0);
148 cia_able_irq(irq, 1);
149 return;
150 }
151
152 /* enable the interrupt */
153 amiga_custom.intena = IF_SETCLR | ami_intena_vals[irq];
154}
155
156void amiga_disable_irq(unsigned int irq)
157{
158 if (irq >= AMI_IRQS) {
159 printk("%s: Unknown IRQ %d\n", __FUNCTION__, irq);
160 return;
161 }
162
163 if (ami_ablecount[irq]++)
164 return;
165
166 /* No action for auto-vector interrupts */
167 if (irq >= IRQ_AMIGA_AUTO) {
168 printk("%s: Trying to disable auto-vector IRQ %i\n",
169 __FUNCTION__, irq - IRQ_AMIGA_AUTO);
170 return;
171 }
172
173 if (irq >= IRQ_AMIGA_CIAA) {
174 cia_able_irq(irq, 0);
175 return;
176 }
177
178 /* disable the interrupt */
179 amiga_custom.intena = ami_intena_vals[irq];
180}
181
182inline void amiga_do_irq(int irq, struct pt_regs *fp)
183{
184 irq_desc_t *desc = irq_desc + irq;
185 struct irqaction *action = desc->action;
186
187 kstat_cpu(0).irqs[irq]++;
188 action->handler(irq, action->dev_id, fp);
189}
190
191void amiga_do_irq_list(int irq, struct pt_regs *fp)
192{
193 irq_desc_t *desc = irq_desc + irq;
194 struct irqaction *action;
195
196 kstat_cpu(0).irqs[irq]++;
197
198 amiga_custom.intreq = ami_intena_vals[irq];
199
200 for (action = desc->action; action; action = action->next)
201 action->handler(irq, action->dev_id, fp);
202}
203
204/*
205 * The builtin Amiga hardware interrupt handlers.
206 */
207
208static void ami_int1(int irq, void *dev_id, struct pt_regs *fp)
209{
210 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
211
212 /* if serial transmit buffer empty, interrupt */
213 if (ints & IF_TBE) {
214 amiga_custom.intreq = IF_TBE;
215 amiga_do_irq(IRQ_AMIGA_TBE, fp);
216 }
217
218 /* if floppy disk transfer complete, interrupt */
219 if (ints & IF_DSKBLK) {
220 amiga_custom.intreq = IF_DSKBLK;
221 amiga_do_irq(IRQ_AMIGA_DSKBLK, fp);
222 }
223
224 /* if software interrupt set, interrupt */
225 if (ints & IF_SOFT) {
226 amiga_custom.intreq = IF_SOFT;
227 amiga_do_irq(IRQ_AMIGA_SOFT, fp);
228 }
229}
230
231static void ami_int3(int irq, void *dev_id, struct pt_regs *fp)
232{
233 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
234
235 /* if a blitter interrupt */
236 if (ints & IF_BLIT) {
237 amiga_custom.intreq = IF_BLIT;
238 amiga_do_irq(IRQ_AMIGA_BLIT, fp);
239 }
240
241 /* if a copper interrupt */
242 if (ints & IF_COPER) {
243 amiga_custom.intreq = IF_COPER;
244 amiga_do_irq(IRQ_AMIGA_COPPER, fp);
245 }
246
247 /* if a vertical blank interrupt */
248 if (ints & IF_VERTB)
249 amiga_do_irq_list(IRQ_AMIGA_VERTB, fp);
250}
251
252static void ami_int4(int irq, void *dev_id, struct pt_regs *fp)
253{
254 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
255
256 /* if audio 0 interrupt */
257 if (ints & IF_AUD0) {
258 amiga_custom.intreq = IF_AUD0;
259 amiga_do_irq(IRQ_AMIGA_AUD0, fp);
260 }
261
262 /* if audio 1 interrupt */
263 if (ints & IF_AUD1) {
264 amiga_custom.intreq = IF_AUD1;
265 amiga_do_irq(IRQ_AMIGA_AUD1, fp);
266 }
267
268 /* if audio 2 interrupt */
269 if (ints & IF_AUD2) {
270 amiga_custom.intreq = IF_AUD2;
271 amiga_do_irq(IRQ_AMIGA_AUD2, fp);
272 }
273
274 /* if audio 3 interrupt */
275 if (ints & IF_AUD3) {
276 amiga_custom.intreq = IF_AUD3;
277 amiga_do_irq(IRQ_AMIGA_AUD3, fp);
278 }
279}
280
281static void ami_int5(int irq, void *dev_id, struct pt_regs *fp)
282{
283 unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar;
284
285 /* if serial receive buffer full interrupt */
286 if (ints & IF_RBF) {
287 /* acknowledge of IF_RBF must be done by the serial interrupt */
288 amiga_do_irq(IRQ_AMIGA_RBF, fp);
289 }
290
291 /* if a disk sync interrupt */
292 if (ints & IF_DSKSYN) {
293 amiga_custom.intreq = IF_DSKSYN;
294 amiga_do_irq(IRQ_AMIGA_DSKSYN, fp);
295 }
296}
297
298static void ami_int7(int irq, void *dev_id, struct pt_regs *fp)
299{
300 panic ("level 7 interrupt received\n");
301}
302
303#ifdef CONFIG_APUS
304/* The PPC irq handling links all handlers requested on the same vector
305 and executes them in a loop. Having ami_badint at the end of the chain
306 is a bad idea. */
307struct irqaction amiga_sys_irqaction[AUTO_IRQS] = {
308 { .handler = ami_badint, .name = "spurious int" },
309 { .handler = ami_int1, .name = "int1 handler" },
310 { 0, /* CIAA */ },
311 { .handler = ami_int3, .name = "int3 handler" },
312 { .handler = ami_int4, .name = "int4 handler" },
313 { .handler = ami_int5, .name = "int5 handler" },
314 { 0, /* CIAB */ },
315 { .handler = ami_int7, .name = "int7 handler" },
316};
317#else
318void (*amiga_default_handler[SYS_IRQS])(int, void *, struct pt_regs *) = {
319 ami_badint, ami_int1, ami_badint, ami_int3,
320 ami_int4, ami_int5, ami_badint, ami_int7
321};
322#endif
diff --git a/arch/ppc/amiga/amisound.c b/arch/ppc/amiga/amisound.c
deleted file mode 100644
index 2b86cbef79f6..000000000000
--- a/arch/ppc/amiga/amisound.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/amisound.c"
diff --git a/arch/ppc/amiga/bootinfo.c b/arch/ppc/amiga/bootinfo.c
deleted file mode 100644
index efd869a3ed9b..000000000000
--- a/arch/ppc/amiga/bootinfo.c
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 * Extracted from arch/m68k/kernel/setup.c.
3 * Should be properly generalized and put somewhere else.
4 * Jesper
5 */
6
7#include <linux/types.h>
8#include <linux/kernel.h>
9#include <linux/string.h>
10#include <linux/init.h>
11
12#include <asm/setup.h>
13#include <asm/bootinfo.h>
14
15extern char cmd_line[CL_SIZE];
16
17extern int num_memory;
18extern int m68k_realnum_memory;
19extern struct mem_info memory[NUM_MEMINFO];
20extern struct mem_info m68k_memory[NUM_MEMINFO];
21extern struct mem_info ramdisk;
22
23extern int amiga_parse_bootinfo(const struct bi_record *);
24extern int atari_parse_bootinfo(const struct bi_record *);
25extern int mac_parse_bootinfo(const struct bi_record *);
26
27void __init parse_bootinfo(const struct bi_record *record)
28{
29 while (record->tag != BI_LAST) {
30 int unknown = 0;
31 const u_long *data = record->data;
32 switch (record->tag) {
33 case BI_MACHTYPE:
34 case BI_CPUTYPE:
35 case BI_FPUTYPE:
36 case BI_MMUTYPE:
37 /* Already set up by head.S */
38 break;
39
40 case BI_MEMCHUNK:
41 if (num_memory < NUM_MEMINFO) {
42 memory[num_memory].addr = data[0];
43 memory[num_memory].size = data[1];
44 num_memory++;
45
46 /* FIXME: duplicate for m68k drivers. */
47 m68k_memory[m68k_realnum_memory].addr = data[0];
48 m68k_memory[m68k_realnum_memory].size = data[1];
49 m68k_realnum_memory++;
50 } else
51 printk("parse_bootinfo: too many memory chunks\n");
52 break;
53
54 case BI_RAMDISK:
55 ramdisk.addr = data[0];
56 ramdisk.size = data[1];
57 break;
58
59 case BI_COMMAND_LINE:
60 strlcpy(cmd_line, (const char *)data, sizeof(cmd_line));
61 break;
62
63 default:
64 if (MACH_IS_AMIGA)
65 unknown = amiga_parse_bootinfo(record);
66 else if (MACH_IS_ATARI)
67 unknown = atari_parse_bootinfo(record);
68 else if (MACH_IS_MAC)
69 unknown = mac_parse_bootinfo(record);
70 else
71 unknown = 1;
72 }
73 if (unknown)
74 printk("parse_bootinfo: unknown tag 0x%04x ignored\n",
75 record->tag);
76 record = (struct bi_record *)((u_long)record+record->size);
77 }
78}
diff --git a/arch/ppc/amiga/chipram.c b/arch/ppc/amiga/chipram.c
deleted file mode 100644
index e6ab3c6b223c..000000000000
--- a/arch/ppc/amiga/chipram.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/chipram.c"
diff --git a/arch/ppc/amiga/cia.c b/arch/ppc/amiga/cia.c
deleted file mode 100644
index 9558f2f40e64..000000000000
--- a/arch/ppc/amiga/cia.c
+++ /dev/null
@@ -1,176 +0,0 @@
1/*
2 * Copyright (C) 1996 Roman Zippel
3 *
4 * The concept of some functions bases on the original Amiga OS function
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/types.h>
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/kernel_stat.h>
17#include <linux/init.h>
18
19#include <asm/irq.h>
20#include <asm/amigahw.h>
21#include <asm/amigaints.h>
22
23struct ciabase {
24 volatile struct CIA *cia;
25 u_char icr_mask, icr_data;
26 u_short int_mask;
27 int handler_irq, cia_irq, server_irq;
28 char *name;
29} ciaa_base = {
30 &ciaa, 0, 0, IF_PORTS,
31 IRQ_AMIGA_AUTO_2, IRQ_AMIGA_CIAA,
32 IRQ_AMIGA_PORTS,
33 "CIAA handler"
34}, ciab_base = {
35 &ciab, 0, 0, IF_EXTER,
36 IRQ_AMIGA_AUTO_6, IRQ_AMIGA_CIAB,
37 IRQ_AMIGA_EXTER,
38 "CIAB handler"
39};
40
41#define CIA_SET_BASE_ADJUST_IRQ(base, irq) \
42do { \
43 if (irq >= IRQ_AMIGA_CIAB) { \
44 base = &ciab_base; \
45 irq -= IRQ_AMIGA_CIAB; \
46 } else { \
47 base = &ciaa_base; \
48 irq -= IRQ_AMIGA_CIAA; \
49 } \
50} while (0)
51
52/*
53 * Cause or clear CIA interrupts, return old interrupt status.
54 */
55
56static unsigned char cia_set_irq_private(struct ciabase *base,
57 unsigned char mask)
58{
59 u_char old;
60
61 old = (base->icr_data |= base->cia->icr);
62 if (mask & CIA_ICR_SETCLR)
63 base->icr_data |= mask;
64 else
65 base->icr_data &= ~mask;
66 if (base->icr_data & base->icr_mask)
67 amiga_custom.intreq = IF_SETCLR | base->int_mask;
68 return old & base->icr_mask;
69}
70
71unsigned char cia_set_irq(unsigned int irq, int set)
72{
73 struct ciabase *base;
74 unsigned char mask;
75
76 if (irq >= IRQ_AMIGA_CIAB)
77 mask = (1 << (irq - IRQ_AMIGA_CIAB));
78 else
79 mask = (1 << (irq - IRQ_AMIGA_CIAA));
80 mask |= (set) ? CIA_ICR_SETCLR : 0;
81
82 CIA_SET_BASE_ADJUST_IRQ(base, irq);
83
84 return cia_set_irq_private(base, mask);
85}
86
87unsigned char cia_get_irq_mask(unsigned int irq)
88{
89 struct ciabase *base;
90
91 CIA_SET_BASE_ADJUST_IRQ(base, irq);
92
93 return base->cia->icr;
94}
95
96/*
97 * Enable or disable CIA interrupts, return old interrupt mask.
98 */
99
100static unsigned char cia_able_irq_private(struct ciabase *base,
101 unsigned char mask)
102{
103 u_char old;
104
105 old = base->icr_mask;
106 base->icr_data |= base->cia->icr;
107 base->cia->icr = mask;
108 if (mask & CIA_ICR_SETCLR)
109 base->icr_mask |= mask;
110 else
111 base->icr_mask &= ~mask;
112 base->icr_mask &= CIA_ICR_ALL;
113
114 if (base->icr_data & base->icr_mask)
115 amiga_custom.intreq = IF_SETCLR | base->int_mask;
116 return old;
117}
118
119unsigned char cia_able_irq(unsigned int irq, int enable)
120{
121 struct ciabase *base;
122 unsigned char mask;
123
124 if (irq >= IRQ_AMIGA_CIAB)
125 mask = (1 << (irq - IRQ_AMIGA_CIAB));
126 else
127 mask = (1 << (irq - IRQ_AMIGA_CIAA));
128 mask |= (enable) ? CIA_ICR_SETCLR : 0;
129
130 CIA_SET_BASE_ADJUST_IRQ(base, irq);
131
132 return cia_able_irq_private(base, mask);
133}
134
135static void cia_handler(int irq, void *dev_id, struct pt_regs *fp)
136{
137 struct ciabase *base = (struct ciabase *)dev_id;
138 irq_desc_t *desc;
139 struct irqaction *action;
140 int i;
141 unsigned char ints;
142
143 irq = base->cia_irq;
144 desc = irq_desc + irq;
145 ints = cia_set_irq_private(base, CIA_ICR_ALL);
146 amiga_custom.intreq = base->int_mask;
147 for (i = 0; i < CIA_IRQS; i++, irq++) {
148 if (ints & 1) {
149 kstat_cpu(0).irqs[irq]++;
150 action = desc->action;
151 action->handler(irq, action->dev_id, fp);
152 }
153 ints >>= 1;
154 desc++;
155 }
156 amiga_do_irq_list(base->server_irq, fp);
157}
158
159void __init cia_init_IRQ(struct ciabase *base)
160{
161 extern struct irqaction amiga_sys_irqaction[AUTO_IRQS];
162 struct irqaction *action;
163
164 /* clear any pending interrupt and turn off all interrupts */
165 cia_set_irq_private(base, CIA_ICR_ALL);
166 cia_able_irq_private(base, CIA_ICR_ALL);
167
168 /* install CIA handler */
169 action = &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO];
170 action->handler = cia_handler;
171 action->dev_id = base;
172 action->name = base->name;
173 setup_irq(base->handler_irq, &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO]);
174
175 amiga_custom.intena = IF_SETCLR | base->int_mask;
176}
diff --git a/arch/ppc/amiga/config.c b/arch/ppc/amiga/config.c
deleted file mode 100644
index bc50ed11957d..000000000000
--- a/arch/ppc/amiga/config.c
+++ /dev/null
@@ -1,953 +0,0 @@
1#define m68k_debug_device debug_device
2
3/*
4 * Copyright (C) 1993 Hamish Macdonald
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file COPYING in the main directory of this archive
8 * for more details.
9 */
10
11/*
12 * Miscellaneous Amiga stuff
13 */
14
15#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/mm.h>
18#include <linux/kd.h>
19#include <linux/tty.h>
20#include <linux/console.h>
21#include <linux/init.h>
22#ifdef CONFIG_ZORRO
23#include <linux/zorro.h>
24#endif
25
26#include <asm/bootinfo.h>
27#include <asm/setup.h>
28#include <asm/system.h>
29#include <asm/pgtable.h>
30#include <asm/amigahw.h>
31#include <asm/amigaints.h>
32#include <asm/irq.h>
33#include <asm/machdep.h>
34#include <asm/io.h>
35
36unsigned long powerup_PCI_present;
37unsigned long powerup_BPPCPLUS_present;
38unsigned long amiga_model;
39unsigned long amiga_eclock;
40unsigned long amiga_masterclock;
41unsigned long amiga_colorclock;
42unsigned long amiga_chipset;
43unsigned char amiga_vblank;
44unsigned char amiga_psfreq;
45struct amiga_hw_present amiga_hw_present;
46
47static char s_a500[] __initdata = "A500";
48static char s_a500p[] __initdata = "A500+";
49static char s_a600[] __initdata = "A600";
50static char s_a1000[] __initdata = "A1000";
51static char s_a1200[] __initdata = "A1200";
52static char s_a2000[] __initdata = "A2000";
53static char s_a2500[] __initdata = "A2500";
54static char s_a3000[] __initdata = "A3000";
55static char s_a3000t[] __initdata = "A3000T";
56static char s_a3000p[] __initdata = "A3000+";
57static char s_a4000[] __initdata = "A4000";
58static char s_a4000t[] __initdata = "A4000T";
59static char s_cdtv[] __initdata = "CDTV";
60static char s_cd32[] __initdata = "CD32";
61static char s_draco[] __initdata = "Draco";
62static char *amiga_models[] __initdata = {
63 s_a500, s_a500p, s_a600, s_a1000, s_a1200, s_a2000, s_a2500, s_a3000,
64 s_a3000t, s_a3000p, s_a4000, s_a4000t, s_cdtv, s_cd32, s_draco,
65};
66
67static char amiga_model_name[13] = "Amiga ";
68
69extern char m68k_debug_device[];
70
71static void amiga_sched_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
72/* amiga specific irq functions */
73extern void amiga_init_IRQ (void);
74extern void (*amiga_default_handler[]) (int, void *, struct pt_regs *);
75extern int amiga_request_irq (unsigned int irq,
76 void (*handler)(int, void *, struct pt_regs *),
77 unsigned long flags, const char *devname,
78 void *dev_id);
79extern void amiga_free_irq (unsigned int irq, void *dev_id);
80extern void amiga_enable_irq (unsigned int);
81extern void amiga_disable_irq (unsigned int);
82static void amiga_get_model(char *model);
83static int amiga_get_hardware_list(char *buffer);
84/* amiga specific timer functions */
85static unsigned long amiga_gettimeoffset (void);
86static void a3000_gettod (int *, int *, int *, int *, int *, int *);
87static void a2000_gettod (int *, int *, int *, int *, int *, int *);
88static int amiga_hwclk (int, struct hwclk_time *);
89static int amiga_set_clock_mmss (unsigned long);
90static void amiga_reset (void);
91extern void amiga_init_sound(void);
92static void amiga_savekmsg_init(void);
93static void amiga_mem_console_write(struct console *co, const char *b,
94 unsigned int count);
95void amiga_serial_console_write(struct console *co, const char *s,
96 unsigned int count);
97static void amiga_debug_init(void);
98#ifdef CONFIG_HEARTBEAT
99static void amiga_heartbeat(int on);
100#endif
101
102static struct console amiga_console_driver = {
103 .name = "debug",
104 .flags = CON_PRINTBUFFER,
105 .index = -1,
106};
107
108
109 /*
110 * Motherboard Resources present in all Amiga models
111 */
112
113static struct {
114 struct resource _ciab, _ciaa, _custom, _kickstart;
115} mb_resources = {
116// { "Ranger Memory", 0x00c00000, 0x00c7ffff },
117 ._ciab = { "CIA B", 0x00bfd000, 0x00bfdfff },
118 ._ciaa = { "CIA A", 0x00bfe000, 0x00bfefff },
119 ._custom = { "Custom I/O", 0x00dff000, 0x00dfffff },
120 ._kickstart = { "Kickstart ROM", 0x00f80000, 0x00ffffff }
121};
122
123static struct resource rtc_resource = {
124 NULL, 0x00dc0000, 0x00dcffff
125};
126
127static struct resource ram_resource[NUM_MEMINFO];
128
129
130 /*
131 * Parse an Amiga-specific record in the bootinfo
132 */
133
134int amiga_parse_bootinfo(const struct bi_record *record)
135{
136 int unknown = 0;
137 const unsigned long *data = record->data;
138
139 switch (record->tag) {
140 case BI_AMIGA_MODEL:
141 {
142 unsigned long d = *data;
143
144 powerup_PCI_present = d & 0x100;
145 amiga_model = d & 0xff;
146 }
147 break;
148
149 case BI_AMIGA_ECLOCK:
150 amiga_eclock = *data;
151 break;
152
153 case BI_AMIGA_CHIPSET:
154 amiga_chipset = *data;
155 break;
156
157 case BI_AMIGA_CHIP_SIZE:
158 amiga_chip_size = *(const int *)data;
159 break;
160
161 case BI_AMIGA_VBLANK:
162 amiga_vblank = *(const unsigned char *)data;
163 break;
164
165 case BI_AMIGA_PSFREQ:
166 amiga_psfreq = *(const unsigned char *)data;
167 break;
168
169 case BI_AMIGA_AUTOCON:
170#ifdef CONFIG_ZORRO
171 if (zorro_num_autocon < ZORRO_NUM_AUTO) {
172 const struct ConfigDev *cd = (struct ConfigDev *)data;
173 struct zorro_dev *dev = &zorro_autocon[zorro_num_autocon++];
174 dev->rom = cd->cd_Rom;
175 dev->slotaddr = cd->cd_SlotAddr;
176 dev->slotsize = cd->cd_SlotSize;
177 dev->resource.start = (unsigned long)cd->cd_BoardAddr;
178 dev->resource.end = dev->resource.start+cd->cd_BoardSize-1;
179 } else
180 printk("amiga_parse_bootinfo: too many AutoConfig devices\n");
181#endif /* CONFIG_ZORRO */
182 break;
183
184 case BI_AMIGA_SERPER:
185 /* serial port period: ignored here */
186 break;
187
188 case BI_AMIGA_PUP_BRIDGE:
189 powerup_PCI_present = *(const unsigned short *)data;
190 break;
191
192 case BI_AMIGA_BPPC_SCSI:
193 powerup_BPPCPLUS_present = *(const unsigned short *)data;
194 break;
195
196 default:
197 unknown = 1;
198 }
199 return(unknown);
200}
201
202 /*
203 * Identify builtin hardware
204 */
205
206static void __init amiga_identify(void)
207{
208 /* Fill in some default values, if necessary */
209 if (amiga_eclock == 0)
210 amiga_eclock = 709379;
211
212 memset(&amiga_hw_present, 0, sizeof(amiga_hw_present));
213
214 printk("Amiga hardware found: ");
215 if (amiga_model >= AMI_500 && amiga_model <= AMI_DRACO) {
216 printk("[%s] ", amiga_models[amiga_model-AMI_500]);
217 strcat(amiga_model_name, amiga_models[amiga_model-AMI_500]);
218 }
219
220 switch(amiga_model) {
221 case AMI_UNKNOWN:
222 goto Generic;
223
224 case AMI_600:
225 case AMI_1200:
226 AMIGAHW_SET(A1200_IDE);
227 AMIGAHW_SET(PCMCIA);
228 case AMI_500:
229 case AMI_500PLUS:
230 case AMI_1000:
231 case AMI_2000:
232 case AMI_2500:
233 AMIGAHW_SET(A2000_CLK); /* Is this correct for all models? */
234 goto Generic;
235
236 case AMI_3000:
237 case AMI_3000T:
238 AMIGAHW_SET(AMBER_FF);
239 AMIGAHW_SET(MAGIC_REKICK);
240 /* fall through */
241 case AMI_3000PLUS:
242 AMIGAHW_SET(A3000_SCSI);
243 AMIGAHW_SET(A3000_CLK);
244 AMIGAHW_SET(ZORRO3);
245 goto Generic;
246
247 case AMI_4000T:
248 AMIGAHW_SET(A4000_SCSI);
249 /* fall through */
250 case AMI_4000:
251 AMIGAHW_SET(A4000_IDE);
252 AMIGAHW_SET(A3000_CLK);
253 AMIGAHW_SET(ZORRO3);
254 goto Generic;
255
256 case AMI_CDTV:
257 case AMI_CD32:
258 AMIGAHW_SET(CD_ROM);
259 AMIGAHW_SET(A2000_CLK); /* Is this correct? */
260 goto Generic;
261
262 Generic:
263 AMIGAHW_SET(AMI_VIDEO);
264 AMIGAHW_SET(AMI_BLITTER);
265 AMIGAHW_SET(AMI_AUDIO);
266 AMIGAHW_SET(AMI_FLOPPY);
267 AMIGAHW_SET(AMI_KEYBOARD);
268 AMIGAHW_SET(AMI_MOUSE);
269 AMIGAHW_SET(AMI_SERIAL);
270 AMIGAHW_SET(AMI_PARALLEL);
271 AMIGAHW_SET(CHIP_RAM);
272 AMIGAHW_SET(PAULA);
273
274 switch(amiga_chipset) {
275 case CS_OCS:
276 case CS_ECS:
277 case CS_AGA:
278 switch (amiga_custom.deniseid & 0xf) {
279 case 0x0c:
280 AMIGAHW_SET(DENISE_HR);
281 break;
282 case 0x08:
283 AMIGAHW_SET(LISA);
284 break;
285 }
286 break;
287 default:
288 AMIGAHW_SET(DENISE);
289 break;
290 }
291 switch ((amiga_custom.vposr>>8) & 0x7f) {
292 case 0x00:
293 AMIGAHW_SET(AGNUS_PAL);
294 break;
295 case 0x10:
296 AMIGAHW_SET(AGNUS_NTSC);
297 break;
298 case 0x20:
299 case 0x21:
300 AMIGAHW_SET(AGNUS_HR_PAL);
301 break;
302 case 0x30:
303 case 0x31:
304 AMIGAHW_SET(AGNUS_HR_NTSC);
305 break;
306 case 0x22:
307 case 0x23:
308 AMIGAHW_SET(ALICE_PAL);
309 break;
310 case 0x32:
311 case 0x33:
312 AMIGAHW_SET(ALICE_NTSC);
313 break;
314 }
315 AMIGAHW_SET(ZORRO);
316 break;
317
318 case AMI_DRACO:
319 panic("No support for Draco yet");
320
321 default:
322 panic("Unknown Amiga Model");
323 }
324
325#define AMIGAHW_ANNOUNCE(name, str) \
326 if (AMIGAHW_PRESENT(name)) \
327 printk(str)
328
329 AMIGAHW_ANNOUNCE(AMI_VIDEO, "VIDEO ");
330 AMIGAHW_ANNOUNCE(AMI_BLITTER, "BLITTER ");
331 AMIGAHW_ANNOUNCE(AMBER_FF, "AMBER_FF ");
332 AMIGAHW_ANNOUNCE(AMI_AUDIO, "AUDIO ");
333 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "FLOPPY ");
334 AMIGAHW_ANNOUNCE(A3000_SCSI, "A3000_SCSI ");
335 AMIGAHW_ANNOUNCE(A4000_SCSI, "A4000_SCSI ");
336 AMIGAHW_ANNOUNCE(A1200_IDE, "A1200_IDE ");
337 AMIGAHW_ANNOUNCE(A4000_IDE, "A4000_IDE ");
338 AMIGAHW_ANNOUNCE(CD_ROM, "CD_ROM ");
339 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "KEYBOARD ");
340 AMIGAHW_ANNOUNCE(AMI_MOUSE, "MOUSE ");
341 AMIGAHW_ANNOUNCE(AMI_SERIAL, "SERIAL ");
342 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "PARALLEL ");
343 AMIGAHW_ANNOUNCE(A2000_CLK, "A2000_CLK ");
344 AMIGAHW_ANNOUNCE(A3000_CLK, "A3000_CLK ");
345 AMIGAHW_ANNOUNCE(CHIP_RAM, "CHIP_RAM ");
346 AMIGAHW_ANNOUNCE(PAULA, "PAULA ");
347 AMIGAHW_ANNOUNCE(DENISE, "DENISE ");
348 AMIGAHW_ANNOUNCE(DENISE_HR, "DENISE_HR ");
349 AMIGAHW_ANNOUNCE(LISA, "LISA ");
350 AMIGAHW_ANNOUNCE(AGNUS_PAL, "AGNUS_PAL ");
351 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "AGNUS_NTSC ");
352 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "AGNUS_HR_PAL ");
353 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "AGNUS_HR_NTSC ");
354 AMIGAHW_ANNOUNCE(ALICE_PAL, "ALICE_PAL ");
355 AMIGAHW_ANNOUNCE(ALICE_NTSC, "ALICE_NTSC ");
356 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "MAGIC_REKICK ");
357 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA ");
358 if (AMIGAHW_PRESENT(ZORRO))
359 printk("ZORRO%s ", AMIGAHW_PRESENT(ZORRO3) ? "3" : "");
360 printk("\n");
361
362#undef AMIGAHW_ANNOUNCE
363}
364
365 /*
366 * Setup the Amiga configuration info
367 */
368
369void __init config_amiga(void)
370{
371 int i;
372
373 amiga_debug_init();
374 amiga_identify();
375
376 /* Some APUS boxes may have PCI memory, but ... */
377 iomem_resource.name = "Memory";
378 for (i = 0; i < 4; i++)
379 request_resource(&iomem_resource, &((struct resource *)&mb_resources)[i]);
380
381 mach_sched_init = amiga_sched_init;
382 mach_init_IRQ = amiga_init_IRQ;
383#ifndef CONFIG_APUS
384 mach_default_handler = &amiga_default_handler;
385 mach_request_irq = amiga_request_irq;
386 mach_free_irq = amiga_free_irq;
387 enable_irq = amiga_enable_irq;
388 disable_irq = amiga_disable_irq;
389#endif
390 mach_get_model = amiga_get_model;
391 mach_get_hardware_list = amiga_get_hardware_list;
392 mach_gettimeoffset = amiga_gettimeoffset;
393 if (AMIGAHW_PRESENT(A3000_CLK)){
394 mach_gettod = a3000_gettod;
395 rtc_resource.name = "A3000 RTC";
396 request_resource(&iomem_resource, &rtc_resource);
397 }
398 else{ /* if (AMIGAHW_PRESENT(A2000_CLK)) */
399 mach_gettod = a2000_gettod;
400 rtc_resource.name = "A2000 RTC";
401 request_resource(&iomem_resource, &rtc_resource);
402 }
403
404 mach_max_dma_address = 0xffffffff; /*
405 * default MAX_DMA=0xffffffff
406 * on all machines. If we don't
407 * do so, the SCSI code will not
408 * be able to allocate any mem
409 * for transfers, unless we are
410 * dealing with a Z2 mem only
411 * system. /Jes
412 */
413
414 mach_hwclk = amiga_hwclk;
415 mach_set_clock_mmss = amiga_set_clock_mmss;
416 mach_reset = amiga_reset;
417#ifdef CONFIG_HEARTBEAT
418 mach_heartbeat = amiga_heartbeat;
419#endif
420
421 /* Fill in the clock values (based on the 700 kHz E-Clock) */
422 amiga_masterclock = 40*amiga_eclock; /* 28 MHz */
423 amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */
424
425 /* clear all DMA bits */
426 amiga_custom.dmacon = DMAF_ALL;
427 /* ensure that the DMA master bit is set */
428 amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER;
429
430 /* request all RAM */
431 for (i = 0; i < m68k_num_memory; i++) {
432 ram_resource[i].name =
433 (m68k_memory[i].addr >= 0x01000000) ? "32-bit Fast RAM" :
434 (m68k_memory[i].addr < 0x00c00000) ? "16-bit Fast RAM" :
435 "16-bit Slow RAM";
436 ram_resource[i].start = m68k_memory[i].addr;
437 ram_resource[i].end = m68k_memory[i].addr+m68k_memory[i].size-1;
438 request_resource(&iomem_resource, &ram_resource[i]);
439 }
440
441 /* initialize chipram allocator */
442 amiga_chip_init ();
443
444 /* debugging using chipram */
445 if (!strcmp( m68k_debug_device, "mem" )){
446 if (!AMIGAHW_PRESENT(CHIP_RAM))
447 printk("Warning: no chipram present for debugging\n");
448 else {
449 amiga_savekmsg_init();
450 amiga_console_driver.write = amiga_mem_console_write;
451 register_console(&amiga_console_driver);
452 }
453 }
454
455 /* our beloved beeper */
456 if (AMIGAHW_PRESENT(AMI_AUDIO))
457 amiga_init_sound();
458
459 /*
460 * if it is an A3000, set the magic bit that forces
461 * a hard rekick
462 */
463 if (AMIGAHW_PRESENT(MAGIC_REKICK))
464 *(unsigned char *)ZTWO_VADDR(0xde0002) |= 0x80;
465}
466
467static unsigned short jiffy_ticks;
468
469static void __init amiga_sched_init(irqreturn_t (*timer_routine)(int, void *,
470 struct pt_regs *))
471{
472 static struct resource sched_res = {
473 "timer", 0x00bfd400, 0x00bfd5ff,
474 };
475 jiffy_ticks = (amiga_eclock+HZ/2)/HZ;
476
477 if (request_resource(&mb_resources._ciab, &sched_res))
478 printk("Cannot allocate ciab.ta{lo,hi}\n");
479 ciab.cra &= 0xC0; /* turn off timer A, continuous mode, from Eclk */
480 ciab.talo = jiffy_ticks % 256;
481 ciab.tahi = jiffy_ticks / 256;
482
483 /* install interrupt service routine for CIAB Timer A
484 *
485 * Please don't change this to use ciaa, as it interferes with the
486 * SCSI code. We'll have to take a look at this later
487 */
488 request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL);
489 /* start timer */
490 ciab.cra |= 0x11;
491}
492
493#define TICK_SIZE 10000
494
495extern unsigned char cia_get_irq_mask(unsigned int irq);
496
497/* This is always executed with interrupts disabled. */
498static unsigned long amiga_gettimeoffset (void)
499{
500 unsigned short hi, lo, hi2;
501 unsigned long ticks, offset = 0;
502
503 /* read CIA B timer A current value */
504 hi = ciab.tahi;
505 lo = ciab.talo;
506 hi2 = ciab.tahi;
507
508 if (hi != hi2) {
509 lo = ciab.talo;
510 hi = hi2;
511 }
512
513 ticks = hi << 8 | lo;
514
515 if (ticks > jiffy_ticks / 2)
516 /* check for pending interrupt */
517 if (cia_get_irq_mask(IRQ_AMIGA_CIAB) & CIA_ICR_TA)
518 offset = 10000;
519
520 ticks = jiffy_ticks - ticks;
521 ticks = (10000 * ticks) / jiffy_ticks;
522
523 return ticks + offset;
524}
525
526static void a3000_gettod (int *yearp, int *monp, int *dayp,
527 int *hourp, int *minp, int *secp)
528{
529 volatile struct tod3000 *tod = TOD_3000;
530
531 tod->cntrl1 = TOD3000_CNTRL1_HOLD;
532
533 *secp = tod->second1 * 10 + tod->second2;
534 *minp = tod->minute1 * 10 + tod->minute2;
535 *hourp = tod->hour1 * 10 + tod->hour2;
536 *dayp = tod->day1 * 10 + tod->day2;
537 *monp = tod->month1 * 10 + tod->month2;
538 *yearp = tod->year1 * 10 + tod->year2;
539
540 tod->cntrl1 = TOD3000_CNTRL1_FREE;
541}
542
543static void a2000_gettod (int *yearp, int *monp, int *dayp,
544 int *hourp, int *minp, int *secp)
545{
546 volatile struct tod2000 *tod = TOD_2000;
547
548 tod->cntrl1 = TOD2000_CNTRL1_HOLD;
549
550 while (tod->cntrl1 & TOD2000_CNTRL1_BUSY)
551 ;
552
553 *secp = tod->second1 * 10 + tod->second2;
554 *minp = tod->minute1 * 10 + tod->minute2;
555 *hourp = (tod->hour1 & 3) * 10 + tod->hour2;
556 *dayp = tod->day1 * 10 + tod->day2;
557 *monp = tod->month1 * 10 + tod->month2;
558 *yearp = tod->year1 * 10 + tod->year2;
559
560 if (!(tod->cntrl3 & TOD2000_CNTRL3_24HMODE)){
561 if (!(tod->hour1 & TOD2000_HOUR1_PM) && *hourp == 12)
562 *hourp = 0;
563 else if ((tod->hour1 & TOD2000_HOUR1_PM) && *hourp != 12)
564 *hourp += 12;
565 }
566
567 tod->cntrl1 &= ~TOD2000_CNTRL1_HOLD;
568}
569
570static int amiga_hwclk(int op, struct hwclk_time *t)
571{
572 if (AMIGAHW_PRESENT(A3000_CLK)) {
573 volatile struct tod3000 *tod = TOD_3000;
574
575 tod->cntrl1 = TOD3000_CNTRL1_HOLD;
576
577 if (!op) { /* read */
578 t->sec = tod->second1 * 10 + tod->second2;
579 t->min = tod->minute1 * 10 + tod->minute2;
580 t->hour = tod->hour1 * 10 + tod->hour2;
581 t->day = tod->day1 * 10 + tod->day2;
582 t->wday = tod->weekday;
583 t->mon = tod->month1 * 10 + tod->month2 - 1;
584 t->year = tod->year1 * 10 + tod->year2;
585 if (t->year <= 69)
586 t->year += 100;
587 } else {
588 tod->second1 = t->sec / 10;
589 tod->second2 = t->sec % 10;
590 tod->minute1 = t->min / 10;
591 tod->minute2 = t->min % 10;
592 tod->hour1 = t->hour / 10;
593 tod->hour2 = t->hour % 10;
594 tod->day1 = t->day / 10;
595 tod->day2 = t->day % 10;
596 if (t->wday != -1)
597 tod->weekday = t->wday;
598 tod->month1 = (t->mon + 1) / 10;
599 tod->month2 = (t->mon + 1) % 10;
600 if (t->year >= 100)
601 t->year -= 100;
602 tod->year1 = t->year / 10;
603 tod->year2 = t->year % 10;
604 }
605
606 tod->cntrl1 = TOD3000_CNTRL1_FREE;
607 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
608 volatile struct tod2000 *tod = TOD_2000;
609
610 tod->cntrl1 = TOD2000_CNTRL1_HOLD;
611
612 while (tod->cntrl1 & TOD2000_CNTRL1_BUSY)
613 ;
614
615 if (!op) { /* read */
616 t->sec = tod->second1 * 10 + tod->second2;
617 t->min = tod->minute1 * 10 + tod->minute2;
618 t->hour = (tod->hour1 & 3) * 10 + tod->hour2;
619 t->day = tod->day1 * 10 + tod->day2;
620 t->wday = tod->weekday;
621 t->mon = tod->month1 * 10 + tod->month2 - 1;
622 t->year = tod->year1 * 10 + tod->year2;
623 if (t->year <= 69)
624 t->year += 100;
625
626 if (!(tod->cntrl3 & TOD2000_CNTRL3_24HMODE)){
627 if (!(tod->hour1 & TOD2000_HOUR1_PM) && t->hour == 12)
628 t->hour = 0;
629 else if ((tod->hour1 & TOD2000_HOUR1_PM) && t->hour != 12)
630 t->hour += 12;
631 }
632 } else {
633 tod->second1 = t->sec / 10;
634 tod->second2 = t->sec % 10;
635 tod->minute1 = t->min / 10;
636 tod->minute2 = t->min % 10;
637 if (tod->cntrl3 & TOD2000_CNTRL3_24HMODE)
638 tod->hour1 = t->hour / 10;
639 else if (t->hour >= 12)
640 tod->hour1 = TOD2000_HOUR1_PM +
641 (t->hour - 12) / 10;
642 else
643 tod->hour1 = t->hour / 10;
644 tod->hour2 = t->hour % 10;
645 tod->day1 = t->day / 10;
646 tod->day2 = t->day % 10;
647 if (t->wday != -1)
648 tod->weekday = t->wday;
649 tod->month1 = (t->mon + 1) / 10;
650 tod->month2 = (t->mon + 1) % 10;
651 if (t->year >= 100)
652 t->year -= 100;
653 tod->year1 = t->year / 10;
654 tod->year2 = t->year % 10;
655 }
656
657 tod->cntrl1 &= ~TOD2000_CNTRL1_HOLD;
658 }
659
660 return 0;
661}
662
663static int amiga_set_clock_mmss (unsigned long nowtime)
664{
665 short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
666
667 if (AMIGAHW_PRESENT(A3000_CLK)) {
668 volatile struct tod3000 *tod = TOD_3000;
669
670 tod->cntrl1 = TOD3000_CNTRL1_HOLD;
671
672 tod->second1 = real_seconds / 10;
673 tod->second2 = real_seconds % 10;
674 tod->minute1 = real_minutes / 10;
675 tod->minute2 = real_minutes % 10;
676
677 tod->cntrl1 = TOD3000_CNTRL1_FREE;
678 } else /* if (AMIGAHW_PRESENT(A2000_CLK)) */ {
679 volatile struct tod2000 *tod = TOD_2000;
680
681 tod->cntrl1 = TOD2000_CNTRL1_HOLD;
682
683 while (tod->cntrl1 & TOD2000_CNTRL1_BUSY)
684 ;
685
686 tod->second1 = real_seconds / 10;
687 tod->second2 = real_seconds % 10;
688 tod->minute1 = real_minutes / 10;
689 tod->minute2 = real_minutes % 10;
690
691 tod->cntrl1 &= ~TOD2000_CNTRL1_HOLD;
692 }
693
694 return 0;
695}
696
697static NORET_TYPE void amiga_reset( void )
698 ATTRIB_NORET;
699
700static void amiga_reset (void)
701{
702 for (;;);
703}
704
705
706 /*
707 * Debugging
708 */
709
710#define SAVEKMSG_MAXMEM 128*1024
711
712#define SAVEKMSG_MAGIC1 0x53415645 /* 'SAVE' */
713#define SAVEKMSG_MAGIC2 0x4B4D5347 /* 'KMSG' */
714
715struct savekmsg {
716 unsigned long magic1; /* SAVEKMSG_MAGIC1 */
717 unsigned long magic2; /* SAVEKMSG_MAGIC2 */
718 unsigned long magicptr; /* address of magic1 */
719 unsigned long size;
720 char data[0];
721};
722
723static struct savekmsg *savekmsg = NULL;
724
725static void amiga_mem_console_write(struct console *co, const char *s,
726 unsigned int count)
727{
728 if (savekmsg->size+count <= SAVEKMSG_MAXMEM-sizeof(struct savekmsg)) {
729 memcpy(savekmsg->data+savekmsg->size, s, count);
730 savekmsg->size += count;
731 }
732}
733
734static void amiga_savekmsg_init(void)
735{
736 static struct resource debug_res = { "Debug" };
737
738 savekmsg = amiga_chip_alloc_res(SAVEKMSG_MAXMEM, &debug_res);
739 savekmsg->magic1 = SAVEKMSG_MAGIC1;
740 savekmsg->magic2 = SAVEKMSG_MAGIC2;
741 savekmsg->magicptr = virt_to_phys(savekmsg);
742 savekmsg->size = 0;
743}
744
745static void amiga_serial_putc(char c)
746{
747 amiga_custom.serdat = (unsigned char)c | 0x100;
748 mb();
749 while (!(amiga_custom.serdatr & 0x2000))
750 ;
751}
752
753void amiga_serial_console_write(struct console *co, const char *s,
754 unsigned int count)
755{
756#if 0 /* def CONFIG_KGDB */
757 /* FIXME:APUS GDB doesn't seem to like O-packages before it is
758 properly connected with the target. */
759 __gdb_output_string (s, count);
760#else
761 while (count--) {
762 if (*s == '\n')
763 amiga_serial_putc('\r');
764 amiga_serial_putc(*s++);
765 }
766#endif
767}
768
769#ifdef CONFIG_SERIAL_CONSOLE
770void amiga_serial_puts(const char *s)
771{
772 amiga_serial_console_write(NULL, s, strlen(s));
773}
774
775int amiga_serial_console_wait_key(struct console *co)
776{
777 int ch;
778
779 while (!(amiga_custom.intreqr & IF_RBF))
780 barrier();
781 ch = amiga_custom.serdatr & 0xff;
782 /* clear the interrupt, so that another character can be read */
783 amiga_custom.intreq = IF_RBF;
784 return ch;
785}
786
787void amiga_serial_gets(struct console *co, char *s, int len)
788{
789 int ch, cnt = 0;
790
791 while (1) {
792 ch = amiga_serial_console_wait_key(co);
793
794 /* Check for backspace. */
795 if (ch == 8 || ch == 127) {
796 if (cnt == 0) {
797 amiga_serial_putc('\007');
798 continue;
799 }
800 cnt--;
801 amiga_serial_puts("\010 \010");
802 continue;
803 }
804
805 /* Check for enter. */
806 if (ch == 10 || ch == 13)
807 break;
808
809 /* See if line is too long. */
810 if (cnt >= len + 1) {
811 amiga_serial_putc(7);
812 cnt--;
813 continue;
814 }
815
816 /* Store and echo character. */
817 s[cnt++] = ch;
818 amiga_serial_putc(ch);
819 }
820 /* Print enter. */
821 amiga_serial_puts("\r\n");
822 s[cnt] = 0;
823}
824#endif
825
826static void __init amiga_debug_init(void)
827{
828 if (!strcmp( m68k_debug_device, "ser" )) {
829 /* no initialization required (?) */
830 amiga_console_driver.write = amiga_serial_console_write;
831 register_console(&amiga_console_driver);
832 }
833}
834
835#ifdef CONFIG_HEARTBEAT
836static void amiga_heartbeat(int on)
837{
838 if (on)
839 ciaa.pra &= ~2;
840 else
841 ciaa.pra |= 2;
842}
843#endif
844
845 /*
846 * Amiga specific parts of /proc
847 */
848
849static void amiga_get_model(char *model)
850{
851 strcpy(model, amiga_model_name);
852}
853
854
855static int amiga_get_hardware_list(char *buffer)
856{
857 int len = 0;
858
859 if (AMIGAHW_PRESENT(CHIP_RAM))
860 len += sprintf(buffer+len, "Chip RAM:\t%ldK\n", amiga_chip_size>>10);
861 len += sprintf(buffer+len, "PS Freq:\t%dHz\nEClock Freq:\t%ldHz\n",
862 amiga_psfreq, amiga_eclock);
863 if (AMIGAHW_PRESENT(AMI_VIDEO)) {
864 char *type;
865 switch(amiga_chipset) {
866 case CS_OCS:
867 type = "OCS";
868 break;
869 case CS_ECS:
870 type = "ECS";
871 break;
872 case CS_AGA:
873 type = "AGA";
874 break;
875 default:
876 type = "Old or Unknown";
877 break;
878 }
879 len += sprintf(buffer+len, "Graphics:\t%s\n", type);
880 }
881
882#define AMIGAHW_ANNOUNCE(name, str) \
883 if (AMIGAHW_PRESENT(name)) \
884 len += sprintf (buffer+len, "\t%s\n", str)
885
886 len += sprintf (buffer + len, "Detected hardware:\n");
887
888 AMIGAHW_ANNOUNCE(AMI_VIDEO, "Amiga Video");
889 AMIGAHW_ANNOUNCE(AMI_BLITTER, "Blitter");
890 AMIGAHW_ANNOUNCE(AMBER_FF, "Amber Flicker Fixer");
891 AMIGAHW_ANNOUNCE(AMI_AUDIO, "Amiga Audio");
892 AMIGAHW_ANNOUNCE(AMI_FLOPPY, "Floppy Controller");
893 AMIGAHW_ANNOUNCE(A3000_SCSI, "SCSI Controller WD33C93 (A3000 style)");
894 AMIGAHW_ANNOUNCE(A4000_SCSI, "SCSI Controller NCR53C710 (A4000T style)");
895 AMIGAHW_ANNOUNCE(A1200_IDE, "IDE Interface (A1200 style)");
896 AMIGAHW_ANNOUNCE(A4000_IDE, "IDE Interface (A4000 style)");
897 AMIGAHW_ANNOUNCE(CD_ROM, "Internal CD ROM drive");
898 AMIGAHW_ANNOUNCE(AMI_KEYBOARD, "Keyboard");
899 AMIGAHW_ANNOUNCE(AMI_MOUSE, "Mouse Port");
900 AMIGAHW_ANNOUNCE(AMI_SERIAL, "Serial Port");
901 AMIGAHW_ANNOUNCE(AMI_PARALLEL, "Parallel Port");
902 AMIGAHW_ANNOUNCE(A2000_CLK, "Hardware Clock (A2000 style)");
903 AMIGAHW_ANNOUNCE(A3000_CLK, "Hardware Clock (A3000 style)");
904 AMIGAHW_ANNOUNCE(CHIP_RAM, "Chip RAM");
905 AMIGAHW_ANNOUNCE(PAULA, "Paula 8364");
906 AMIGAHW_ANNOUNCE(DENISE, "Denise 8362");
907 AMIGAHW_ANNOUNCE(DENISE_HR, "Denise 8373");
908 AMIGAHW_ANNOUNCE(LISA, "Lisa 8375");
909 AMIGAHW_ANNOUNCE(AGNUS_PAL, "Normal/Fat PAL Agnus 8367/8371");
910 AMIGAHW_ANNOUNCE(AGNUS_NTSC, "Normal/Fat NTSC Agnus 8361/8370");
911 AMIGAHW_ANNOUNCE(AGNUS_HR_PAL, "Fat Hires PAL Agnus 8372");
912 AMIGAHW_ANNOUNCE(AGNUS_HR_NTSC, "Fat Hires NTSC Agnus 8372");
913 AMIGAHW_ANNOUNCE(ALICE_PAL, "PAL Alice 8374");
914 AMIGAHW_ANNOUNCE(ALICE_NTSC, "NTSC Alice 8374");
915 AMIGAHW_ANNOUNCE(MAGIC_REKICK, "Magic Hard Rekick");
916 AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA Slot");
917 if (AMIGAHW_PRESENT(ZORRO))
918 len += sprintf(buffer+len, "\tZorro II%s AutoConfig: %d Expansion "
919 "Device%s\n",
920 AMIGAHW_PRESENT(ZORRO3) ? "I" : "",
921 zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s");
922
923#undef AMIGAHW_ANNOUNCE
924
925 return(len);
926}
927
928#ifdef CONFIG_APUS
929int get_hardware_list(char *buffer)
930{
931 extern int get_cpuinfo(char *buffer);
932 int len = 0;
933 char model[80];
934 u_long mem;
935 int i;
936
937 if (mach_get_model)
938 mach_get_model(model);
939 else
940 strcpy(model, "Unknown PowerPC");
941
942 len += sprintf(buffer+len, "Model:\t\t%s\n", model);
943 len += get_cpuinfo(buffer+len);
944 for (mem = 0, i = 0; i < m68k_realnum_memory; i++)
945 mem += m68k_memory[i].size;
946 len += sprintf(buffer+len, "System Memory:\t%ldK\n", mem>>10);
947
948 if (mach_get_hardware_list)
949 len += mach_get_hardware_list(buffer+len);
950
951 return(len);
952}
953#endif
diff --git a/arch/ppc/amiga/ints.c b/arch/ppc/amiga/ints.c
deleted file mode 100644
index 083a17462190..000000000000
--- a/arch/ppc/amiga/ints.c
+++ /dev/null
@@ -1,158 +0,0 @@
1/*
2 * Linux/m68k general interrupt handling code from arch/m68k/kernel/ints.c
3 * Needed to drive the m68k emulating IRQ hardware on the PowerUp boards.
4 */
5
6#include <linux/types.h>
7#include <linux/sched.h>
8#include <linux/kernel_stat.h>
9#include <linux/errno.h>
10#include <linux/init.h>
11#include <linux/seq_file.h>
12
13#include <asm/setup.h>
14#include <asm/system.h>
15#include <asm/irq.h>
16#include <asm/traps.h>
17#include <asm/page.h>
18#include <asm/machdep.h>
19
20/* table for system interrupt handlers */
21static irq_handler_t irq_list[SYS_IRQS];
22
23static const char *default_names[SYS_IRQS] = {
24 "spurious int", "int1 handler", "int2 handler", "int3 handler",
25 "int4 handler", "int5 handler", "int6 handler", "int7 handler"
26};
27
28/* The number of spurious interrupts */
29volatile unsigned int num_spurious;
30
31#define NUM_IRQ_NODES 100
32static irq_node_t nodes[NUM_IRQ_NODES];
33
34
35/*
36 * void init_IRQ(void)
37 *
38 * Parameters: None
39 *
40 * Returns: Nothing
41 *
42 * This function should be called during kernel startup to initialize
43 * the IRQ handling routines.
44 */
45
46__init
47void m68k_init_IRQ(void)
48{
49 int i;
50
51 for (i = 0; i < SYS_IRQS; i++) {
52 if (mach_default_handler)
53 irq_list[i].handler = (*mach_default_handler)[i];
54 irq_list[i].flags = 0;
55 irq_list[i].dev_id = NULL;
56 irq_list[i].devname = default_names[i];
57 }
58
59 for (i = 0; i < NUM_IRQ_NODES; i++)
60 nodes[i].handler = NULL;
61
62 mach_init_IRQ ();
63}
64
65irq_node_t *new_irq_node(void)
66{
67 irq_node_t *node;
68 short i;
69
70 for (node = nodes, i = NUM_IRQ_NODES-1; i >= 0; node++, i--)
71 if (!node->handler)
72 return node;
73
74 printk ("new_irq_node: out of nodes\n");
75 return NULL;
76}
77
78int sys_request_irq(unsigned int irq,
79 void (*handler)(int, void *, struct pt_regs *),
80 unsigned long flags, const char *devname, void *dev_id)
81{
82 if (irq < IRQ1 || irq > IRQ7) {
83 printk("%s: Incorrect IRQ %d from %s\n",
84 __FUNCTION__, irq, devname);
85 return -ENXIO;
86 }
87
88#if 0
89 if (!(irq_list[irq].flags & IRQ_FLG_STD)) {
90 if (irq_list[irq].flags & IRQ_FLG_LOCK) {
91 printk("%s: IRQ %d from %s is not replaceable\n",
92 __FUNCTION__, irq, irq_list[irq].devname);
93 return -EBUSY;
94 }
95 if (!(flags & IRQ_FLG_REPLACE)) {
96 printk("%s: %s can't replace IRQ %d from %s\n",
97 __FUNCTION__, devname, irq, irq_list[irq].devname);
98 return -EBUSY;
99 }
100 }
101#endif
102
103 irq_list[irq].handler = handler;
104 irq_list[irq].flags = flags;
105 irq_list[irq].dev_id = dev_id;
106 irq_list[irq].devname = devname;
107 return 0;
108}
109
110void sys_free_irq(unsigned int irq, void *dev_id)
111{
112 if (irq < IRQ1 || irq > IRQ7) {
113 printk("%s: Incorrect IRQ %d\n", __FUNCTION__, irq);
114 return;
115 }
116
117 if (irq_list[irq].dev_id != dev_id)
118 printk("%s: Removing probably wrong IRQ %d from %s\n",
119 __FUNCTION__, irq, irq_list[irq].devname);
120
121 irq_list[irq].handler = (*mach_default_handler)[irq];
122 irq_list[irq].flags = 0;
123 irq_list[irq].dev_id = NULL;
124 irq_list[irq].devname = default_names[irq];
125}
126
127asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
128{
129 if (vec >= VEC_INT1 && vec <= VEC_INT7 && !MACH_IS_BVME6000) {
130 vec -= VEC_SPUR;
131 kstat_cpu(0).irqs[vec]++;
132 irq_list[vec].handler(vec, irq_list[vec].dev_id, fp);
133 } else {
134 if (mach_process_int)
135 mach_process_int(vec, fp);
136 else
137 panic("Can't process interrupt vector %ld\n", vec);
138 return;
139 }
140}
141
142int m68k_get_irq_list(struct seq_file *p, void *v)
143{
144 int i;
145
146 /* autovector interrupts */
147 if (mach_default_handler) {
148 for (i = 0; i < SYS_IRQS; i++) {
149 seq_printf(p, "auto %2d: %10u ", i,
150 i ? kstat_cpu(0).irqs[i] : num_spurious);
151 seq_puts(p, " ");
152 seq_printf(p, "%s\n", irq_list[i].devname);
153 }
154 }
155
156 mach_get_irq_list(p, v);
157 return 0;
158}
diff --git a/arch/ppc/amiga/pcmcia.c b/arch/ppc/amiga/pcmcia.c
deleted file mode 100644
index 5d29dc65093c..000000000000
--- a/arch/ppc/amiga/pcmcia.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../m68k/amiga/pcmcia.c"
diff --git a/arch/ppc/amiga/time.c b/arch/ppc/amiga/time.c
deleted file mode 100644
index 8c880c0ca380..000000000000
--- a/arch/ppc/amiga/time.c
+++ /dev/null
@@ -1,57 +0,0 @@
1#include <linux/errno.h>
2#include <linux/sched.h>
3#include <linux/kernel.h>
4#include <linux/param.h>
5#include <linux/string.h>
6#include <linux/mm.h>
7
8#include <asm/machdep.h>
9#include <asm/io.h>
10
11#include <linux/timex.h>
12
13unsigned long m68k_get_rtc_time(void)
14{
15 unsigned int year, mon, day, hour, min, sec;
16
17 extern void arch_gettod(int *year, int *mon, int *day, int *hour,
18 int *min, int *sec);
19
20 arch_gettod (&year, &mon, &day, &hour, &min, &sec);
21
22 if ((year += 1900) < 1970)
23 year += 100;
24
25 return mktime(year, mon, day, hour, min, sec);
26}
27
28int m68k_set_rtc_time(unsigned long nowtime)
29{
30 if (mach_set_clock_mmss)
31 return mach_set_clock_mmss (nowtime);
32 return -1;
33}
34
35void apus_heartbeat (void)
36{
37#ifdef CONFIG_HEARTBEAT
38 static unsigned cnt = 0, period = 0, dist = 0;
39
40 if (cnt == 0 || cnt == dist)
41 mach_heartbeat( 1 );
42 else if (cnt == 7 || cnt == dist+7)
43 mach_heartbeat( 0 );
44
45 if (++cnt > period) {
46 cnt = 0;
47 /* The hyperbolic function below modifies the heartbeat period
48 * length in dependency of the current (5min) load. It goes
49 * through the points f(0)=126, f(1)=86, f(5)=51,
50 * f(inf)->30. */
51 period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
52 dist = period / 4;
53 }
54#endif
55 /* should be made smarter */
56 ppc_md.heartbeat_count = 1;
57}
diff --git a/arch/ppc/boot/simple/embed_config.c b/arch/ppc/boot/simple/embed_config.c
index 840bff2a45fb..3b46792d7b8b 100644
--- a/arch/ppc/boot/simple/embed_config.c
+++ b/arch/ppc/boot/simple/embed_config.c
@@ -752,7 +752,9 @@ embed_config(bd_t ** bdp)
752 static const unsigned long congruence_classes = 256; 752 static const unsigned long congruence_classes = 256;
753 unsigned long addr; 753 unsigned long addr;
754 unsigned long dccr; 754 unsigned long dccr;
755 uint8_t* cp;
755 bd_t *bd; 756 bd_t *bd;
757 int i;
756 758
757 /* 759 /*
758 * Invalidate the data cache if the data cache is turned off. 760 * Invalidate the data cache if the data cache is turned off.
@@ -778,6 +780,12 @@ embed_config(bd_t ** bdp)
778 bd->bi_intfreq = XPAR_CORE_CLOCK_FREQ_HZ; 780 bd->bi_intfreq = XPAR_CORE_CLOCK_FREQ_HZ;
779 bd->bi_busfreq = XPAR_PLB_CLOCK_FREQ_HZ; 781 bd->bi_busfreq = XPAR_PLB_CLOCK_FREQ_HZ;
780 bd->bi_pci_busfreq = XPAR_PCI_0_CLOCK_FREQ_HZ; 782 bd->bi_pci_busfreq = XPAR_PCI_0_CLOCK_FREQ_HZ;
783
784 /* Copy the default ethernet address */
785 cp = (u_char *)def_enet_addr;
786 for (i=0; i<6; i++)
787 bd->bi_enetaddr[i] = *cp++;
788
781 timebase_period_ns = 1000000000 / bd->bi_tbfreq; 789 timebase_period_ns = 1000000000 / bd->bi_tbfreq;
782 /* see bi_tbfreq definition in arch/ppc/platforms/4xx/xilinx_ml300.h */ 790 /* see bi_tbfreq definition in arch/ppc/platforms/4xx/xilinx_ml300.h */
783} 791}
diff --git a/arch/ppc/boot/simple/misc-embedded.c b/arch/ppc/boot/simple/misc-embedded.c
index 8a08ad397ed5..d5a00eb0e4eb 100644
--- a/arch/ppc/boot/simple/misc-embedded.c
+++ b/arch/ppc/boot/simple/misc-embedded.c
@@ -89,7 +89,9 @@ load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *b
89 * initialize the serial console port. 89 * initialize the serial console port.
90 */ 90 */
91 embed_config(&bp); 91 embed_config(&bp);
92#if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) 92#if defined(CONFIG_SERIAL_CPM_CONSOLE) || \
93 defined(CONFIG_SERIAL_8250_CONSOLE) || \
94 defined(CONFIG_SERIAL_UARTLITE_CONSOLE)
93 com_port = serial_init(0, bp); 95 com_port = serial_init(0, bp);
94#endif 96#endif
95 97
diff --git a/arch/ppc/boot/simple/uartlite_tty.c b/arch/ppc/boot/simple/uartlite_tty.c
index 0eae1eab38d4..ca1743e3e912 100644
--- a/arch/ppc/boot/simple/uartlite_tty.c
+++ b/arch/ppc/boot/simple/uartlite_tty.c
@@ -16,6 +16,14 @@
16 16
17#define UARTLITE_BASEADDR ((void*)(XPAR_UARTLITE_0_BASEADDR)) 17#define UARTLITE_BASEADDR ((void*)(XPAR_UARTLITE_0_BASEADDR))
18 18
19unsigned long
20serial_init(int chan, void *ignored)
21{
22 /* Clear the RX FIFO */
23 out_be32(UARTLITE_BASEADDR + 0x0C, 0x2);
24 return 0;
25}
26
19void 27void
20serial_putc(unsigned long com_port, unsigned char c) 28serial_putc(unsigned long com_port, unsigned char c)
21{ 29{
diff --git a/arch/ppc/configs/apus_defconfig b/arch/ppc/configs/apus_defconfig
deleted file mode 100644
index e2245252d31f..000000000000
--- a/arch/ppc/configs/apus_defconfig
+++ /dev/null
@@ -1,920 +0,0 @@
1#
2# Automatically generated make config: don't edit
3#
4CONFIG_MMU=y
5CONFIG_RWSEM_XCHGADD_ALGORITHM=y
6CONFIG_HAVE_DEC_LOCK=y
7
8#
9# Code maturity level options
10#
11CONFIG_EXPERIMENTAL=y
12
13#
14# General setup
15#
16CONFIG_SWAP=y
17CONFIG_SYSVIPC=y
18# CONFIG_BSD_PROCESS_ACCT is not set
19CONFIG_SYSCTL=y
20CONFIG_LOG_BUF_SHIFT=14
21# CONFIG_EMBEDDED is not set
22CONFIG_FUTEX=y
23CONFIG_EPOLL=y
24
25#
26# Loadable module support
27#
28CONFIG_MODULES=y
29CONFIG_MODULE_UNLOAD=y
30CONFIG_MODULE_FORCE_UNLOAD=y
31CONFIG_OBSOLETE_MODPARM=y
32# CONFIG_MODVERSIONS is not set
33CONFIG_KMOD=y
34
35#
36# Platform support
37#
38CONFIG_PPC=y
39CONFIG_PPC32=y
40CONFIG_6xx=y
41# CONFIG_40x is not set
42# CONFIG_POWER3 is not set
43# CONFIG_8xx is not set
44
45#
46# IBM 4xx options
47#
48# CONFIG_8260 is not set
49CONFIG_GENERIC_ISA_DMA=y
50CONFIG_PPC_STD_MMU=y
51CONFIG_SERIAL_CONSOLE=y
52# CONFIG_PPC_MULTIPLATFORM is not set
53CONFIG_APUS=y
54# CONFIG_WILLOW_2 is not set
55# CONFIG_PCORE is not set
56# CONFIG_POWERPMC250 is not set
57# CONFIG_EV64260 is not set
58# CONFIG_SPRUCE is not set
59# CONFIG_LOPEC is not set
60# CONFIG_MCPN765 is not set
61# CONFIG_MVME5100 is not set
62# CONFIG_PPLUS is not set
63# CONFIG_PRPMC750 is not set
64# CONFIG_PRPMC800 is not set
65# CONFIG_SANDPOINT is not set
66# CONFIG_ADIR is not set
67# CONFIG_K2 is not set
68# CONFIG_PAL4 is not set
69# CONFIG_GEMINI is not set
70# CONFIG_SMP is not set
71# CONFIG_PREEMPT is not set
72# CONFIG_ALTIVEC is not set
73# CONFIG_TAU is not set
74# CONFIG_CPU_FREQ is not set
75
76#
77# General setup
78#
79# CONFIG_HIGHMEM is not set
80CONFIG_PCI=y
81CONFIG_PCI_DOMAINS=y
82CONFIG_PCI_PERMEDIA=y
83CONFIG_KCORE_ELF=y
84CONFIG_BINFMT_ELF=y
85CONFIG_KERNEL_ELF=y
86CONFIG_BINFMT_MISC=m
87CONFIG_PCI_LEGACY_PROC=y
88CONFIG_PCI_NAMES=y
89# CONFIG_HOTPLUG is not set
90
91#
92# Parallel port support
93#
94CONFIG_PARPORT=m
95# CONFIG_PARPORT_PC is not set
96CONFIG_PARPORT_AMIGA=m
97# CONFIG_PARPORT_MFC3 is not set
98# CONFIG_PARPORT_OTHER is not set
99# CONFIG_PARPORT_1284 is not set
100CONFIG_PPC601_SYNC_FIX=y
101# CONFIG_CMDLINE_BOOL is not set
102CONFIG_AMIGA=y
103CONFIG_ZORRO=y
104CONFIG_ABSTRACT_CONSOLE=y
105CONFIG_APUS_FAST_EXCEPT=y
106CONFIG_AMIGA_PCMCIA=y
107CONFIG_AMIGA_BUILTIN_SERIAL=y
108CONFIG_GVPIOEXT=y
109CONFIG_GVPIOEXT_LP=m
110CONFIG_GVPIOEXT_PLIP=m
111CONFIG_MULTIFACE_III_TTY=y
112CONFIG_A2232=y
113CONFIG_WHIPPET_SERIAL=y
114CONFIG_APNE=y
115CONFIG_HEARTBEAT=y
116CONFIG_PROC_HARDWARE=y
117CONFIG_ZORRO_NAMES=y
118
119#
120# Advanced setup
121#
122# CONFIG_ADVANCED_OPTIONS is not set
123
124#
125# Default settings for advanced configuration options are used
126#
127CONFIG_HIGHMEM_START=0xfe000000
128CONFIG_LOWMEM_SIZE=0x30000000
129CONFIG_KERNEL_START=0xc0000000
130CONFIG_TASK_SIZE=0x80000000
131CONFIG_BOOT_LOAD=0x00800000
132
133#
134# Memory Technology Devices (MTD)
135#
136# CONFIG_MTD is not set
137
138#
139# Plug and Play support
140#
141# CONFIG_PNP is not set
142
143#
144# Block devices
145#
146# CONFIG_BLK_DEV_FD is not set
147CONFIG_AMIGA_FLOPPY=y
148CONFIG_AMIGA_Z2RAM=m
149# CONFIG_PARIDE is not set
150# CONFIG_BLK_CPQ_DA is not set
151# CONFIG_BLK_CPQ_CISS_DA is not set
152# CONFIG_BLK_DEV_DAC960 is not set
153# CONFIG_BLK_DEV_UMEM is not set
154CONFIG_BLK_DEV_LOOP=y
155CONFIG_BLK_DEV_NBD=m
156CONFIG_BLK_DEV_RAM=y
157CONFIG_BLK_DEV_RAM_SIZE=4096
158CONFIG_BLK_DEV_INITRD=y
159
160#
161# Multi-device support (RAID and LVM)
162#
163CONFIG_MD=y
164CONFIG_BLK_DEV_MD=m
165CONFIG_MD_LINEAR=m
166CONFIG_MD_RAID0=m
167CONFIG_MD_RAID1=m
168CONFIG_MD_RAID5=m
169# CONFIG_MD_MULTIPATH is not set
170CONFIG_BLK_DEV_DM=m
171
172#
173# ATA/IDE/MFM/RLL support
174#
175CONFIG_IDE=y
176
177#
178# IDE, ATA and ATAPI Block devices
179#
180CONFIG_BLK_DEV_IDE=y
181
182#
183# Please see Documentation/ide.txt for help/info on IDE drives
184#
185# CONFIG_BLK_DEV_HD is not set
186CONFIG_BLK_DEV_IDEDISK=y
187# CONFIG_IDEDISK_MULTI_MODE is not set
188# CONFIG_IDEDISK_STROKE is not set
189CONFIG_BLK_DEV_IDECD=y
190CONFIG_BLK_DEV_IDEFLOPPY=y
191CONFIG_BLK_DEV_IDESCSI=m
192# CONFIG_IDE_TASK_IOCTL is not set
193
194#
195# IDE chipset support/bugfixes
196#
197# CONFIG_BLK_DEV_IDEPCI is not set
198CONFIG_BLK_DEV_GAYLE=y
199CONFIG_BLK_DEV_IDEDOUBLER=y
200CONFIG_BLK_DEV_BUDDHA=y
201
202#
203# SCSI support
204#
205CONFIG_SCSI=y
206
207#
208# SCSI support type (disk, tape, CD-ROM)
209#
210CONFIG_BLK_DEV_SD=y
211CONFIG_CHR_DEV_ST=m
212CONFIG_CHR_DEV_OSST=m
213CONFIG_BLK_DEV_SR=y
214CONFIG_BLK_DEV_SR_VENDOR=y
215CONFIG_CHR_DEV_SG=m
216
217#
218# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
219#
220# CONFIG_SCSI_MULTI_LUN is not set
221# CONFIG_SCSI_REPORT_LUNS is not set
222CONFIG_SCSI_CONSTANTS=y
223CONFIG_SCSI_LOGGING=y
224
225#
226# SCSI low-level drivers
227#
228# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
229# CONFIG_SCSI_ACARD is not set
230# CONFIG_SCSI_AACRAID is not set
231# CONFIG_SCSI_AIC7XXX is not set
232# CONFIG_SCSI_AIC7XXX_OLD is not set
233# CONFIG_SCSI_AIC79XX is not set
234# CONFIG_SCSI_DPT_I2O is not set
235# CONFIG_SCSI_ADVANSYS is not set
236# CONFIG_SCSI_IN2000 is not set
237# CONFIG_SCSI_AM53C974 is not set
238# CONFIG_SCSI_MEGARAID is not set
239# CONFIG_SCSI_BUSLOGIC is not set
240# CONFIG_SCSI_CPQFCTS is not set
241# CONFIG_SCSI_DMX3191D is not set
242# CONFIG_SCSI_EATA is not set
243# CONFIG_SCSI_EATA_PIO is not set
244# CONFIG_SCSI_FUTURE_DOMAIN is not set
245# CONFIG_SCSI_GDTH is not set
246# CONFIG_SCSI_GENERIC_NCR5380 is not set
247# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
248# CONFIG_SCSI_INITIO is not set
249# CONFIG_SCSI_INIA100 is not set
250# CONFIG_SCSI_PPA is not set
251# CONFIG_SCSI_IMM is not set
252# CONFIG_SCSI_NCR53C7xx is not set
253# CONFIG_SCSI_SYM53C8XX_2 is not set
254# CONFIG_SCSI_NCR53C8XX is not set
255# CONFIG_SCSI_SYM53C8XX is not set
256# CONFIG_SCSI_PCI2000 is not set
257# CONFIG_SCSI_PCI2220I is not set
258# CONFIG_SCSI_QLOGIC_ISP is not set
259# CONFIG_SCSI_QLOGIC_FC is not set
260# CONFIG_SCSI_QLOGIC_1280 is not set
261# CONFIG_SCSI_DC395x is not set
262# CONFIG_SCSI_DC390T is not set
263# CONFIG_SCSI_U14_34F is not set
264# CONFIG_SCSI_NSP32 is not set
265# CONFIG_SCSI_DEBUG is not set
266CONFIG_A3000_SCSI=y
267CONFIG_A4000T_SCSI=y
268CONFIG_A2091_SCSI=y
269CONFIG_GVP11_SCSI=y
270CONFIG_CYBERSTORM_SCSI=y
271CONFIG_CYBERSTORMII_SCSI=y
272CONFIG_BLZ2060_SCSI=y
273CONFIG_BLZ1230_SCSI=y
274CONFIG_FASTLANE_SCSI=y
275CONFIG_A4091_SCSI=y
276CONFIG_WARPENGINE_SCSI=y
277CONFIG_BLZ603EPLUS_SCSI=y
278CONFIG_OKTAGON_SCSI=y
279
280#
281# Fusion MPT device support
282#
283# CONFIG_FUSION is not set
284
285#
286# IEEE 1394 (FireWire) support (EXPERIMENTAL)
287#
288# CONFIG_IEEE1394 is not set
289
290#
291# I2O device support
292#
293# CONFIG_I2O is not set
294
295#
296# Networking support
297#
298CONFIG_NET=y
299
300#
301# Networking options
302#
303CONFIG_PACKET=m
304CONFIG_PACKET_MMAP=y
305CONFIG_NETLINK_DEV=m
306CONFIG_NETFILTER=y
307# CONFIG_NETFILTER_DEBUG is not set
308CONFIG_UNIX=y
309# CONFIG_NET_KEY is not set
310CONFIG_INET=y
311# CONFIG_IP_MULTICAST is not set
312# CONFIG_IP_ADVANCED_ROUTER is not set
313# CONFIG_IP_PNP is not set
314# CONFIG_NET_IPIP is not set
315# CONFIG_NET_IPGRE is not set
316# CONFIG_ARPD is not set
317# CONFIG_INET_ECN is not set
318CONFIG_SYN_COOKIES=y
319# CONFIG_INET_AH is not set
320# CONFIG_INET_ESP is not set
321# CONFIG_INET_IPCOMP is not set
322
323#
324# IP: Netfilter Configuration
325#
326CONFIG_IP_NF_CONNTRACK=m
327CONFIG_IP_NF_FTP=m
328CONFIG_IP_NF_IRC=m
329CONFIG_IP_NF_TFTP=m
330CONFIG_IP_NF_AMANDA=m
331CONFIG_IP_NF_QUEUE=m
332CONFIG_IP_NF_IPTABLES=m
333CONFIG_IP_NF_MATCH_LIMIT=m
334CONFIG_IP_NF_MATCH_MAC=m
335# CONFIG_IP_NF_MATCH_PKTTYPE is not set
336CONFIG_IP_NF_MATCH_MARK=m
337CONFIG_IP_NF_MATCH_MULTIPORT=m
338CONFIG_IP_NF_MATCH_TOS=m
339# CONFIG_IP_NF_MATCH_ECN is not set
340# CONFIG_IP_NF_MATCH_DSCP is not set
341# CONFIG_IP_NF_MATCH_AH_ESP is not set
342CONFIG_IP_NF_MATCH_LENGTH=m
343CONFIG_IP_NF_MATCH_TTL=m
344CONFIG_IP_NF_MATCH_TCPMSS=m
345CONFIG_IP_NF_MATCH_HELPER=m
346CONFIG_IP_NF_MATCH_STATE=m
347CONFIG_IP_NF_MATCH_CONNTRACK=m
348CONFIG_IP_NF_MATCH_UNCLEAN=m
349CONFIG_IP_NF_MATCH_OWNER=m
350CONFIG_IP_NF_FILTER=m
351CONFIG_IP_NF_TARGET_REJECT=m
352CONFIG_IP_NF_TARGET_MIRROR=m
353CONFIG_IP_NF_NAT=m
354CONFIG_IP_NF_NAT_NEEDED=y
355CONFIG_IP_NF_TARGET_MASQUERADE=m
356CONFIG_IP_NF_TARGET_REDIRECT=m
357CONFIG_IP_NF_NAT_SNMP_BASIC=m
358CONFIG_IP_NF_NAT_IRC=m
359CONFIG_IP_NF_NAT_FTP=m
360CONFIG_IP_NF_NAT_TFTP=m
361CONFIG_IP_NF_NAT_AMANDA=m
362CONFIG_IP_NF_MANGLE=m
363CONFIG_IP_NF_TARGET_TOS=m
364CONFIG_IP_NF_TARGET_ECN=m
365CONFIG_IP_NF_TARGET_DSCP=m
366CONFIG_IP_NF_TARGET_MARK=m
367CONFIG_IP_NF_TARGET_LOG=m
368CONFIG_IP_NF_TARGET_ULOG=m
369CONFIG_IP_NF_TARGET_TCPMSS=m
370CONFIG_IP_NF_ARPTABLES=m
371CONFIG_IP_NF_ARPFILTER=m
372CONFIG_IP_NF_COMPAT_IPCHAINS=m
373# CONFIG_IP_NF_COMPAT_IPFWADM is not set
374# CONFIG_IPV6 is not set
375# CONFIG_XFRM_USER is not set
376
377#
378# SCTP Configuration (EXPERIMENTAL)
379#
380CONFIG_IPV6_SCTP__=y
381# CONFIG_IP_SCTP is not set
382# CONFIG_ATM is not set
383# CONFIG_VLAN_8021Q is not set
384# CONFIG_LLC is not set
385# CONFIG_DECNET is not set
386# CONFIG_BRIDGE is not set
387# CONFIG_X25 is not set
388# CONFIG_LAPB is not set
389# CONFIG_NET_DIVERT is not set
390# CONFIG_ECONET is not set
391# CONFIG_WAN_ROUTER is not set
392# CONFIG_NET_HW_FLOWCONTROL is not set
393
394#
395# QoS and/or fair queueing
396#
397# CONFIG_NET_SCHED is not set
398
399#
400# Network testing
401#
402# CONFIG_NET_PKTGEN is not set
403CONFIG_NETDEVICES=y
404
405#
406# ARCnet devices
407#
408# CONFIG_ARCNET is not set
409CONFIG_DUMMY=m
410# CONFIG_BONDING is not set
411# CONFIG_EQUALIZER is not set
412CONFIG_TUN=m
413# CONFIG_ETHERTAP is not set
414
415#
416# Ethernet (10 or 100Mbit)
417#
418CONFIG_NET_ETHERNET=y
419# CONFIG_MII is not set
420# CONFIG_OAKNET is not set
421CONFIG_ARIADNE=y
422# CONFIG_ZORRO8390 is not set
423CONFIG_A2065=y
424CONFIG_HYDRA=y
425# CONFIG_HAPPYMEAL is not set
426# CONFIG_SUNGEM is not set
427# CONFIG_NET_VENDOR_3COM is not set
428
429#
430# Tulip family network device support
431#
432# CONFIG_NET_TULIP is not set
433# CONFIG_HP100 is not set
434# CONFIG_NET_PCI is not set
435
436#
437# Ethernet (1000 Mbit)
438#
439# CONFIG_ACENIC is not set
440# CONFIG_DL2K is not set
441# CONFIG_E1000 is not set
442# CONFIG_NS83820 is not set
443# CONFIG_HAMACHI is not set
444# CONFIG_YELLOWFIN is not set
445# CONFIG_R8169 is not set
446# CONFIG_SK98LIN is not set
447# CONFIG_TIGON3 is not set
448
449#
450# Ethernet (10000 Mbit)
451#
452# CONFIG_IXGB is not set
453# CONFIG_FDDI is not set
454# CONFIG_HIPPI is not set
455CONFIG_PLIP=m
456CONFIG_PPP=y
457CONFIG_PPP_MULTILINK=y
458CONFIG_PPP_FILTER=y
459CONFIG_PPP_ASYNC=y
460CONFIG_PPP_SYNC_TTY=y
461CONFIG_PPP_DEFLATE=y
462CONFIG_PPP_BSDCOMP=y
463CONFIG_PPPOE=y
464CONFIG_SLIP=y
465CONFIG_SLIP_COMPRESSED=y
466CONFIG_SLIP_SMART=y
467CONFIG_SLIP_MODE_SLIP6=y
468
469#
470# Wireless LAN (non-hamradio)
471#
472# CONFIG_NET_RADIO is not set
473
474#
475# Token Ring devices (depends on LLC=y)
476#
477# CONFIG_NET_FC is not set
478# CONFIG_RCPCI is not set
479# CONFIG_SHAPER is not set
480
481#
482# Wan interfaces
483#
484# CONFIG_WAN is not set
485
486#
487# Amateur Radio support
488#
489# CONFIG_HAMRADIO is not set
490
491#
492# IrDA (infrared) support
493#
494# CONFIG_IRDA is not set
495
496#
497# ISDN subsystem
498#
499# CONFIG_ISDN_BOOL is not set
500
501#
502# Graphics support
503#
504CONFIG_FB=y
505# CONFIG_FB_CIRRUS is not set
506CONFIG_FB_PM2=y
507# CONFIG_FB_PM2_FIFO_DISCONNECT is not set
508# CONFIG_FB_PM2_PCI is not set
509CONFIG_FB_PM2_CVPPC=y
510CONFIG_FB_CYBER2000=y
511CONFIG_FB_AMIGA=y
512CONFIG_FB_AMIGA_OCS=y
513CONFIG_FB_AMIGA_ECS=y
514CONFIG_FB_AMIGA_AGA=y
515CONFIG_FB_CYBER=y
516CONFIG_FB_VIRGE=y
517CONFIG_FB_RETINAZ3=y
518CONFIG_FB_FM2=y
519# CONFIG_FB_CT65550 is not set
520# CONFIG_FB_IMSTT is not set
521# CONFIG_FB_S3TRIO is not set
522# CONFIG_FB_VGA16 is not set
523# CONFIG_FB_RIVA is not set
524# CONFIG_FB_MATROX is not set
525# CONFIG_FB_RADEON is not set
526# CONFIG_FB_ATY128 is not set
527# CONFIG_FB_ATY is not set
528# CONFIG_FB_SIS is not set
529# CONFIG_FB_NEOMAGIC is not set
530# CONFIG_FB_3DFX is not set
531# CONFIG_FB_VOODOO1 is not set
532# CONFIG_FB_TRIDENT is not set
533# CONFIG_FB_PM3 is not set
534# CONFIG_FB_VIRTUAL is not set
535
536#
537# Logo configuration
538#
539CONFIG_LOGO=y
540CONFIG_LOGO_LINUX_MONO=y
541CONFIG_LOGO_LINUX_VGA16=y
542CONFIG_LOGO_LINUX_CLUT224=y
543
544#
545# Old CD-ROM drivers (not SCSI, not IDE)
546#
547# CONFIG_CD_NO_IDESCSI is not set
548
549#
550# Input device support
551#
552CONFIG_INPUT=m
553
554#
555# Userland interfaces
556#
557CONFIG_INPUT_MOUSEDEV=m
558CONFIG_INPUT_MOUSEDEV_PSAUX=y
559CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
560CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
561CONFIG_INPUT_JOYDEV=m
562# CONFIG_INPUT_TSDEV is not set
563CONFIG_INPUT_EVDEV=m
564CONFIG_INPUT_EVBUG=m
565
566#
567# Input I/O drivers
568#
569# CONFIG_GAMEPORT is not set
570CONFIG_SOUND_GAMEPORT=y
571CONFIG_SERIO=y
572# CONFIG_SERIO_I8042 is not set
573CONFIG_SERIO_SERPORT=y
574# CONFIG_SERIO_CT82C710 is not set
575# CONFIG_SERIO_PARKBD is not set
576
577#
578# Input Device Drivers
579#
580CONFIG_INPUT_KEYBOARD=y
581CONFIG_KEYBOARD_ATKBD=m
582# CONFIG_KEYBOARD_SUNKBD is not set
583# CONFIG_KEYBOARD_XTKBD is not set
584# CONFIG_KEYBOARD_NEWTON is not set
585CONFIG_KEYBOARD_AMIGA=m
586CONFIG_INPUT_MOUSE=y
587CONFIG_MOUSE_PS2=m
588CONFIG_MOUSE_SERIAL=m
589CONFIG_MOUSE_AMIGA=m
590# CONFIG_INPUT_JOYSTICK is not set
591# CONFIG_INPUT_TOUCHSCREEN is not set
592CONFIG_INPUT_MISC=y
593# CONFIG_INPUT_PCSPKR is not set
594CONFIG_INPUT_UINPUT=m
595
596#
597# Macintosh device drivers
598#
599
600#
601# Character devices
602#
603# CONFIG_SERIAL_NONSTANDARD is not set
604
605#
606# Serial drivers
607#
608# CONFIG_SERIAL_8250 is not set
609
610#
611# Non-8250 serial port support
612#
613CONFIG_UNIX98_PTYS=y
614CONFIG_UNIX98_PTY_COUNT=256
615CONFIG_PRINTER=m
616# CONFIG_LP_CONSOLE is not set
617# CONFIG_PPDEV is not set
618# CONFIG_TIPAR is not set
619
620#
621# I2C support
622#
623# CONFIG_I2C is not set
624
625#
626# I2C Hardware Sensors Mainboard support
627#
628
629#
630# I2C Hardware Sensors Chip support
631#
632# CONFIG_I2C_SENSOR is not set
633
634#
635# Mice
636#
637CONFIG_BUSMOUSE=y
638# CONFIG_QIC02_TAPE is not set
639
640#
641# IPMI
642#
643# CONFIG_IPMI_HANDLER is not set
644
645#
646# Watchdog Cards
647#
648# CONFIG_WATCHDOG is not set
649# CONFIG_NVRAM is not set
650CONFIG_GEN_RTC=y
651# CONFIG_GEN_RTC_X is not set
652# CONFIG_DTLK is not set
653# CONFIG_R3964 is not set
654# CONFIG_APPLICOM is not set
655
656#
657# Ftape, the floppy tape device driver
658#
659# CONFIG_FTAPE is not set
660# CONFIG_AGP is not set
661# CONFIG_DRM is not set
662# CONFIG_RAW_DRIVER is not set
663# CONFIG_HANGCHECK_TIMER is not set
664
665#
666# Multimedia devices
667#
668# CONFIG_VIDEO_DEV is not set
669
670#
671# Digital Video Broadcasting Devices
672#
673# CONFIG_DVB is not set
674
675#
676# File systems
677#
678CONFIG_EXT2_FS=y
679# CONFIG_EXT2_FS_XATTR is not set
680CONFIG_EXT3_FS=y
681CONFIG_EXT3_FS_XATTR=y
682# CONFIG_EXT3_FS_POSIX_ACL is not set
683# CONFIG_EXT3_FS_SECURITY is not set
684CONFIG_JBD=y
685# CONFIG_JBD_DEBUG is not set
686CONFIG_FS_MBCACHE=y
687# CONFIG_REISERFS_FS is not set
688# CONFIG_JFS_FS is not set
689# CONFIG_XFS_FS is not set
690CONFIG_MINIX_FS=y
691CONFIG_ROMFS_FS=y
692# CONFIG_QUOTA is not set
693CONFIG_AUTOFS_FS=m
694CONFIG_AUTOFS4_FS=m
695
696#
697# CD-ROM/DVD Filesystems
698#
699CONFIG_ISO9660_FS=y
700CONFIG_JOLIET=y
701# CONFIG_ZISOFS is not set
702# CONFIG_UDF_FS is not set
703
704#
705# DOS/FAT/NT Filesystems
706#
707CONFIG_FAT_FS=y
708CONFIG_MSDOS_FS=y
709CONFIG_VFAT_FS=y
710# CONFIG_NTFS_FS is not set
711
712#
713# Pseudo filesystems
714#
715CONFIG_PROC_FS=y
716# CONFIG_DEVFS_FS is not set
717CONFIG_DEVPTS_FS=y
718# CONFIG_DEVPTS_FS_XATTR is not set
719CONFIG_TMPFS=y
720CONFIG_RAMFS=y
721
722#
723# Miscellaneous filesystems
724#
725# CONFIG_ADFS_FS is not set
726CONFIG_AFFS_FS=y
727CONFIG_HFS_FS=y
728# CONFIG_BEFS_FS is not set
729# CONFIG_BFS_FS is not set
730# CONFIG_EFS_FS is not set
731CONFIG_CRAMFS=y
732# CONFIG_VXFS_FS is not set
733# CONFIG_HPFS_FS is not set
734# CONFIG_QNX4FS_FS is not set
735# CONFIG_SYSV_FS is not set
736# CONFIG_UFS_FS is not set
737
738#
739# Network File Systems
740#
741CONFIG_NFS_FS=y
742CONFIG_NFS_V3=y
743# CONFIG_NFS_V4 is not set
744CONFIG_NFSD=m
745CONFIG_NFSD_V3=y
746# CONFIG_NFSD_V4 is not set
747# CONFIG_NFSD_TCP is not set
748CONFIG_LOCKD=y
749CONFIG_LOCKD_V4=y
750CONFIG_EXPORTFS=m
751CONFIG_SUNRPC=y
752# CONFIG_SUNRPC_GSS is not set
753CONFIG_SMB_FS=m
754# CONFIG_SMB_NLS_DEFAULT is not set
755# CONFIG_CIFS is not set
756# CONFIG_NCP_FS is not set
757CONFIG_CODA_FS=m
758# CONFIG_INTERMEZZO_FS is not set
759# CONFIG_AFS_FS is not set
760
761#
762# Partition Types
763#
764CONFIG_PARTITION_ADVANCED=y
765# CONFIG_ACORN_PARTITION is not set
766# CONFIG_OSF_PARTITION is not set
767CONFIG_AMIGA_PARTITION=y
768CONFIG_ATARI_PARTITION=y
769# CONFIG_MAC_PARTITION is not set
770CONFIG_MSDOS_PARTITION=y
771CONFIG_BSD_DISKLABEL=y
772# CONFIG_MINIX_SUBPARTITION is not set
773CONFIG_SOLARIS_X86_PARTITION=y
774CONFIG_UNIXWARE_DISKLABEL=y
775# CONFIG_LDM_PARTITION is not set
776# CONFIG_NEC98_PARTITION is not set
777# CONFIG_SGI_PARTITION is not set
778# CONFIG_ULTRIX_PARTITION is not set
779# CONFIG_SUN_PARTITION is not set
780# CONFIG_EFI_PARTITION is not set
781CONFIG_SMB_NLS=y
782CONFIG_NLS=y
783
784#
785# Native Language Support
786#
787CONFIG_NLS_DEFAULT="iso8859-1"
788CONFIG_NLS_CODEPAGE_437=m
789CONFIG_NLS_CODEPAGE_737=m
790CONFIG_NLS_CODEPAGE_775=m
791CONFIG_NLS_CODEPAGE_850=m
792CONFIG_NLS_CODEPAGE_852=m
793CONFIG_NLS_CODEPAGE_855=m
794CONFIG_NLS_CODEPAGE_857=m
795CONFIG_NLS_CODEPAGE_860=m
796CONFIG_NLS_CODEPAGE_861=m
797CONFIG_NLS_CODEPAGE_862=m
798CONFIG_NLS_CODEPAGE_863=m
799CONFIG_NLS_CODEPAGE_864=m
800CONFIG_NLS_CODEPAGE_865=m
801CONFIG_NLS_CODEPAGE_866=m
802CONFIG_NLS_CODEPAGE_869=m
803CONFIG_NLS_CODEPAGE_936=m
804CONFIG_NLS_CODEPAGE_950=m
805CONFIG_NLS_CODEPAGE_932=m
806CONFIG_NLS_CODEPAGE_949=m
807CONFIG_NLS_CODEPAGE_874=m
808CONFIG_NLS_ISO8859_8=m
809# CONFIG_NLS_CODEPAGE_1250 is not set
810CONFIG_NLS_CODEPAGE_1251=m
811CONFIG_NLS_ISO8859_1=m
812CONFIG_NLS_ISO8859_2=m
813CONFIG_NLS_ISO8859_3=m
814CONFIG_NLS_ISO8859_4=m
815CONFIG_NLS_ISO8859_5=m
816CONFIG_NLS_ISO8859_6=m
817CONFIG_NLS_ISO8859_7=m
818CONFIG_NLS_ISO8859_9=m
819CONFIG_NLS_ISO8859_13=m
820CONFIG_NLS_ISO8859_14=m
821CONFIG_NLS_ISO8859_15=m
822CONFIG_NLS_KOI8_R=m
823CONFIG_NLS_KOI8_U=m
824CONFIG_NLS_UTF8=m
825
826#
827# Sound
828#
829CONFIG_SOUND=y
830CONFIG_DMASOUND_PAULA=m
831CONFIG_DMASOUND=m
832
833#
834# Advanced Linux Sound Architecture
835#
836# CONFIG_SND is not set
837
838#
839# Open Sound System
840#
841CONFIG_SOUND_PRIME=m
842# CONFIG_SOUND_BT878 is not set
843# CONFIG_SOUND_CMPCI is not set
844# CONFIG_SOUND_EMU10K1 is not set
845# CONFIG_SOUND_FUSION is not set
846# CONFIG_SOUND_CS4281 is not set
847# CONFIG_SOUND_ES1370 is not set
848# CONFIG_SOUND_ES1371 is not set
849# CONFIG_SOUND_ESSSOLO1 is not set
850# CONFIG_SOUND_MAESTRO is not set
851# CONFIG_SOUND_MAESTRO3 is not set
852# CONFIG_SOUND_ICH is not set
853# CONFIG_SOUND_RME96XX is not set
854# CONFIG_SOUND_SONICVIBES is not set
855# CONFIG_SOUND_TRIDENT is not set
856# CONFIG_SOUND_MSNDCLAS is not set
857# CONFIG_SOUND_MSNDPIN is not set
858# CONFIG_SOUND_VIA82CXXX is not set
859CONFIG_SOUND_OSS=m
860CONFIG_SOUND_TRACEINIT=y
861CONFIG_SOUND_DMAP=y
862# CONFIG_SOUND_AD1816 is not set
863# CONFIG_SOUND_SGALAXY is not set
864# CONFIG_SOUND_ADLIB is not set
865# CONFIG_SOUND_ACI_MIXER is not set
866# CONFIG_SOUND_CS4232 is not set
867# CONFIG_SOUND_SSCAPE is not set
868# CONFIG_SOUND_GUS is not set
869CONFIG_SOUND_VMIDI=m
870# CONFIG_SOUND_TRIX is not set
871# CONFIG_SOUND_MSS is not set
872# CONFIG_SOUND_MPU401 is not set
873# CONFIG_SOUND_NM256 is not set
874# CONFIG_SOUND_MAD16 is not set
875# CONFIG_SOUND_PAS is not set
876# CONFIG_SOUND_PSS is not set
877# CONFIG_SOUND_SB is not set
878# CONFIG_SOUND_AWE32_SYNTH is not set
879# CONFIG_SOUND_WAVEFRONT is not set
880# CONFIG_SOUND_MAUI is not set
881# CONFIG_SOUND_YM3812 is not set
882# CONFIG_SOUND_OPL3SA1 is not set
883# CONFIG_SOUND_OPL3SA2 is not set
884# CONFIG_SOUND_YMFPCI is not set
885# CONFIG_SOUND_UART6850 is not set
886# CONFIG_SOUND_AEDSP16 is not set
887
888#
889# USB support
890#
891# CONFIG_USB is not set
892# CONFIG_USB_GADGET is not set
893
894#
895# Bluetooth support
896#
897# CONFIG_BT is not set
898
899#
900# Library routines
901#
902# CONFIG_CRC32 is not set
903CONFIG_ZLIB_INFLATE=y
904CONFIG_ZLIB_DEFLATE=y
905
906#
907# Kernel hacking
908#
909# CONFIG_DEBUG_KERNEL is not set
910# CONFIG_KALLSYMS is not set
911
912#
913# Security options
914#
915# CONFIG_SECURITY is not set
916
917#
918# Cryptographic options
919#
920# CONFIG_CRYPTO is not set
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index c7cb9d5f24a3..1b0ec7202dd5 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -32,10 +32,6 @@
32#include <asm/ppc_asm.h> 32#include <asm/ppc_asm.h>
33#include <asm/asm-offsets.h> 33#include <asm/asm-offsets.h>
34 34
35#ifdef CONFIG_APUS
36#include <asm/amigappc.h>
37#endif
38
39/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */ 35/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
40#define LOAD_BAT(n, reg, RA, RB) \ 36#define LOAD_BAT(n, reg, RA, RB) \
41 /* see the comment for clear_bats() -- Cort */ \ 37 /* see the comment for clear_bats() -- Cort */ \
@@ -128,14 +124,6 @@ __start:
128 */ 124 */
129 bl early_init 125 bl early_init
130 126
131#ifdef CONFIG_APUS
132/* On APUS the __va/__pa constants need to be set to the correct
133 * values before continuing.
134 */
135 mr r4,r30
136 bl fix_mem_constants
137#endif /* CONFIG_APUS */
138
139/* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains 127/* Switch MMU off, clear BATs and flush TLB. At this point, r3 contains
140 * the physical address we are running at, returned by early_init() 128 * the physical address we are running at, returned by early_init()
141 */ 129 */
@@ -145,7 +133,7 @@ __after_mmu_off:
145 bl flush_tlbs 133 bl flush_tlbs
146 134
147 bl initial_bats 135 bl initial_bats
148#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 136#ifdef CONFIG_BOOTX_TEXT
149 bl setup_disp_bat 137 bl setup_disp_bat
150#endif 138#endif
151 139
@@ -161,7 +149,6 @@ __after_mmu_off:
161#endif /* CONFIG_6xx */ 149#endif /* CONFIG_6xx */
162 150
163 151
164#ifndef CONFIG_APUS
165/* 152/*
166 * We need to run with _start at physical address 0. 153 * We need to run with _start at physical address 0.
167 * If the MMU is already turned on, we copy stuff to KERNELBASE, 154 * If the MMU is already turned on, we copy stuff to KERNELBASE,
@@ -172,7 +159,7 @@ __after_mmu_off:
172 addis r4,r3,KERNELBASE@h /* current address of _start */ 159 addis r4,r3,KERNELBASE@h /* current address of _start */
173 cmpwi 0,r4,0 /* are we already running at 0? */ 160 cmpwi 0,r4,0 /* are we already running at 0? */
174 bne relocate_kernel 161 bne relocate_kernel
175#endif /* CONFIG_APUS */ 162
176/* 163/*
177 * we now have the 1st 16M of ram mapped with the bats. 164 * we now have the 1st 16M of ram mapped with the bats.
178 * prep needs the mmu to be turned on here, but pmac already has it on. 165 * prep needs the mmu to be turned on here, but pmac already has it on.
@@ -812,85 +799,6 @@ copy_and_flush:
812 addi r6,r6,4 799 addi r6,r6,4
813 blr 800 blr
814 801
815#ifdef CONFIG_APUS
816/*
817 * On APUS the physical base address of the kernel is not known at compile
818 * time, which means the __pa/__va constants used are incorrect. In the
819 * __init section is recorded the virtual addresses of instructions using
820 * these constants, so all that has to be done is fix these before
821 * continuing the kernel boot.
822 *
823 * r4 = The physical address of the kernel base.
824 */
825fix_mem_constants:
826 mr r10,r4
827 addis r10,r10,-KERNELBASE@h /* virt_to_phys constant */
828 neg r11,r10 /* phys_to_virt constant */
829
830 lis r12,__vtop_table_begin@h
831 ori r12,r12,__vtop_table_begin@l
832 add r12,r12,r10 /* table begin phys address */
833 lis r13,__vtop_table_end@h
834 ori r13,r13,__vtop_table_end@l
835 add r13,r13,r10 /* table end phys address */
836 subi r12,r12,4
837 subi r13,r13,4
8381: lwzu r14,4(r12) /* virt address of instruction */
839 add r14,r14,r10 /* phys address of instruction */
840 lwz r15,0(r14) /* instruction, now insert top */
841 rlwimi r15,r10,16,16,31 /* half of vp const in low half */
842 stw r15,0(r14) /* of instruction and restore. */
843 dcbst r0,r14 /* write it to memory */
844 sync
845 icbi r0,r14 /* flush the icache line */
846 cmpw r12,r13
847 bne 1b
848 sync /* additional sync needed on g4 */
849 isync
850
851/*
852 * Map the memory where the exception handlers will
853 * be copied to when hash constants have been patched.
854 */
855#ifdef CONFIG_APUS_FAST_EXCEPT
856 lis r8,0xfff0
857#else
858 lis r8,0
859#endif
860 ori r8,r8,0x2 /* 128KB, supervisor */
861 mtspr SPRN_DBAT3U,r8
862 mtspr SPRN_DBAT3L,r8
863
864 lis r12,__ptov_table_begin@h
865 ori r12,r12,__ptov_table_begin@l
866 add r12,r12,r10 /* table begin phys address */
867 lis r13,__ptov_table_end@h
868 ori r13,r13,__ptov_table_end@l
869 add r13,r13,r10 /* table end phys address */
870 subi r12,r12,4
871 subi r13,r13,4
8721: lwzu r14,4(r12) /* virt address of instruction */
873 add r14,r14,r10 /* phys address of instruction */
874 lwz r15,0(r14) /* instruction, now insert top */
875 rlwimi r15,r11,16,16,31 /* half of pv const in low half*/
876 stw r15,0(r14) /* of instruction and restore. */
877 dcbst r0,r14 /* write it to memory */
878 sync
879 icbi r0,r14 /* flush the icache line */
880 cmpw r12,r13
881 bne 1b
882
883 sync /* additional sync needed on g4 */
884 isync /* No speculative loading until now */
885 blr
886
887/***********************************************************************
888 * Please note that on APUS the exception handlers are located at the
889 * physical address 0xfff0000. For this reason, the exception handlers
890 * cannot use relative branches to access the code below.
891 ***********************************************************************/
892#endif /* CONFIG_APUS */
893
894#ifdef CONFIG_SMP 802#ifdef CONFIG_SMP
895 .globl __secondary_start_pmac_0 803 .globl __secondary_start_pmac_0
896__secondary_start_pmac_0: 804__secondary_start_pmac_0:
@@ -1043,19 +951,6 @@ start_here:
1043 bl machine_init 951 bl machine_init
1044 bl MMU_init 952 bl MMU_init
1045 953
1046#ifdef CONFIG_APUS
1047 /* Copy exception code to exception vector base on APUS. */
1048 lis r4,KERNELBASE@h
1049#ifdef CONFIG_APUS_FAST_EXCEPT
1050 lis r3,0xfff0 /* Copy to 0xfff00000 */
1051#else
1052 lis r3,0 /* Copy to 0x00000000 */
1053#endif
1054 li r5,0x4000 /* # bytes of memory to copy */
1055 li r6,0
1056 bl copy_and_flush /* copy the first 0x4000 bytes */
1057#endif /* CONFIG_APUS */
1058
1059/* 954/*
1060 * Go back to running unmapped so we can load up new values 955 * Go back to running unmapped so we can load up new values
1061 * for SDR1 (hash table pointer) and the segment registers 956 * for SDR1 (hash table pointer) and the segment registers
@@ -1232,11 +1127,7 @@ initial_bats:
1232#else 1127#else
1233 ori r8,r8,2 /* R/W access */ 1128 ori r8,r8,2 /* R/W access */
1234#endif /* CONFIG_SMP */ 1129#endif /* CONFIG_SMP */
1235#ifdef CONFIG_APUS
1236 ori r11,r11,BL_8M<<2|0x2 /* set up 8MB BAT registers for 604 */
1237#else
1238 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */ 1130 ori r11,r11,BL_256M<<2|0x2 /* set up BAT registers for 604 */
1239#endif /* CONFIG_APUS */
1240 1131
1241 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */ 1132 mtspr SPRN_DBAT0L,r8 /* N.B. 6xx (not 601) have valid */
1242 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */ 1133 mtspr SPRN_DBAT0U,r11 /* bit in upper BAT register */
@@ -1245,7 +1136,7 @@ initial_bats:
1245 isync 1136 isync
1246 blr 1137 blr
1247 1138
1248#if !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) 1139#ifdef CONFIG_BOOTX_TEXT
1249setup_disp_bat: 1140setup_disp_bat:
1250 /* 1141 /*
1251 * setup the display bat prepared for us in prom.c 1142 * setup the display bat prepared for us in prom.c
@@ -1268,7 +1159,7 @@ setup_disp_bat:
1268 mtspr SPRN_IBAT3U,r11 1159 mtspr SPRN_IBAT3U,r11
1269 blr 1160 blr
1270 1161
1271#endif /* !defined(CONFIG_APUS) && defined(CONFIG_BOOTX_TEXT) */ 1162#endif /* defined(CONFIG_BOOTX_TEXT) */
1272 1163
1273#ifdef CONFIG_8260 1164#ifdef CONFIG_8260
1274/* Jump into the system reset for the rom. 1165/* Jump into the system reset for the rom.
diff --git a/arch/ppc/kernel/head_44x.S b/arch/ppc/kernel/head_44x.S
index 7e44de5a26db..75bbc937ed73 100644
--- a/arch/ppc/kernel/head_44x.S
+++ b/arch/ppc/kernel/head_44x.S
@@ -227,16 +227,6 @@ skpinv: addi r4,r4,1 /* Increment */
227 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ 227 lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */
228 mtspr SPRN_IVPR,r4 228 mtspr SPRN_IVPR,r4
229 229
230#ifdef CONFIG_440EP
231 /* Clear DAPUIB flag in CCR0 (enable APU between CPU and FPU) */
232 mfspr r2,SPRN_CCR0
233 lis r3,0xffef
234 ori r3,r3,0xffff
235 and r2,r2,r3
236 mtspr SPRN_CCR0,r2
237 isync
238#endif
239
240 /* 230 /*
241 * This is where the main kernel code starts. 231 * This is where the main kernel code starts.
242 */ 232 */
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 63f0a987139b..22494ec123ea 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -60,8 +60,6 @@ long long __ashrdi3(long long, int);
60long long __ashldi3(long long, int); 60long long __ashldi3(long long, int);
61long long __lshrdi3(long long, int); 61long long __lshrdi3(long long, int);
62 62
63extern unsigned long mm_ptov (unsigned long paddr);
64
65EXPORT_SYMBOL(clear_pages); 63EXPORT_SYMBOL(clear_pages);
66EXPORT_SYMBOL(clear_user_page); 64EXPORT_SYMBOL(clear_user_page);
67EXPORT_SYMBOL(transfer_to_handler); 65EXPORT_SYMBOL(transfer_to_handler);
@@ -118,7 +116,6 @@ EXPORT_SYMBOL(_outsw_ns);
118EXPORT_SYMBOL(_insl_ns); 116EXPORT_SYMBOL(_insl_ns);
119EXPORT_SYMBOL(_outsl_ns); 117EXPORT_SYMBOL(_outsl_ns);
120EXPORT_SYMBOL(iopa); 118EXPORT_SYMBOL(iopa);
121EXPORT_SYMBOL(mm_ptov);
122EXPORT_SYMBOL(ioremap); 119EXPORT_SYMBOL(ioremap);
123#ifdef CONFIG_44x 120#ifdef CONFIG_44x
124EXPORT_SYMBOL(ioremap64); 121EXPORT_SYMBOL(ioremap64);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index 967c1ef59a6b..aac88c2f3db9 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -25,7 +25,6 @@
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/bootinfo.h> 26#include <asm/bootinfo.h>
27#include <asm/setup.h> 27#include <asm/setup.h>
28#include <asm/amigappc.h>
29#include <asm/smp.h> 28#include <asm/smp.h>
30#include <asm/elf.h> 29#include <asm/elf.h>
31#include <asm/cputable.h> 30#include <asm/cputable.h>
diff --git a/arch/ppc/kernel/vmlinux.lds.S b/arch/ppc/kernel/vmlinux.lds.S
index c0aac3ff9e91..98c1212674f6 100644
--- a/arch/ppc/kernel/vmlinux.lds.S
+++ b/arch/ppc/kernel/vmlinux.lds.S
@@ -91,6 +91,8 @@ SECTIONS
91 . = ALIGN(8192); 91 . = ALIGN(8192);
92 .data.init_task : { *(.data.init_task) } 92 .data.init_task : { *(.data.init_task) }
93 93
94 NOTES
95
94 . = ALIGN(4096); 96 . = ALIGN(4096);
95 __init_begin = .; 97 __init_begin = .;
96 .init.text : { 98 .init.text : {
diff --git a/arch/ppc/mm/pgtable.c b/arch/ppc/mm/pgtable.c
index 35ebb6395ae3..1f51e6c94507 100644
--- a/arch/ppc/mm/pgtable.c
+++ b/arch/ppc/mm/pgtable.c
@@ -426,41 +426,3 @@ unsigned long iopa(unsigned long addr)
426 return(pa); 426 return(pa);
427} 427}
428 428
429/* This is will find the virtual address for a physical one....
430 * Swiped from APUS, could be dangerous :-).
431 * This is only a placeholder until I really find a way to make this
432 * work. -- Dan
433 */
434unsigned long
435mm_ptov (unsigned long paddr)
436{
437 unsigned long ret;
438#if 0
439 if (paddr < 16*1024*1024)
440 ret = ZTWO_VADDR(paddr);
441 else {
442 int i;
443
444 for (i = 0; i < kmap_chunk_count;){
445 unsigned long phys = kmap_chunks[i++];
446 unsigned long size = kmap_chunks[i++];
447 unsigned long virt = kmap_chunks[i++];
448 if (paddr >= phys
449 && paddr < (phys + size)){
450 ret = virt + paddr - phys;
451 goto exit;
452 }
453 }
454
455 ret = (unsigned long) __va(paddr);
456 }
457exit:
458#ifdef DEBUGPV
459 printk ("PTOV(%lx)=%lx\n", paddr, ret);
460#endif
461#else
462 ret = (unsigned long)paddr + KERNELBASE;
463#endif
464 return ret;
465}
466
diff --git a/arch/ppc/platforms/Makefile b/arch/ppc/platforms/Makefile
index e17fad470621..40f53fbe6d35 100644
--- a/arch/ppc/platforms/Makefile
+++ b/arch/ppc/platforms/Makefile
@@ -2,10 +2,6 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-$(CONFIG_APUS) += apus_setup.o
6ifeq ($(CONFIG_APUS),y)
7obj-$(CONFIG_PCI) += apus_pci.o
8endif
9obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o 5obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o
10obj-$(CONFIG_PREP_RESIDUAL) += residual.o 6obj-$(CONFIG_PREP_RESIDUAL) += residual.o
11obj-$(CONFIG_PQ2ADS) += pq2ads.o 7obj-$(CONFIG_PQ2ADS) += pq2ads.o
diff --git a/arch/ppc/platforms/apus_pci.c b/arch/ppc/platforms/apus_pci.c
deleted file mode 100644
index dc165f0c8908..000000000000
--- a/arch/ppc/platforms/apus_pci.c
+++ /dev/null
@@ -1,207 +0,0 @@
1/*
2 * Copyright (C) Michel Dänzer <michdaen@iiic.ethz.ch>
3 *
4 * APUS PCI routines.
5 *
6 * Currently, only B/CVisionPPC cards (Permedia2) are supported.
7 *
8 * Thanks to Geert Uytterhoeven for the idea:
9 * Read values from given config space(s) for the first devices, -1 otherwise
10 *
11 */
12
13#ifdef CONFIG_AMIGA
14
15#include <linux/kernel.h>
16#include <linux/pci.h>
17#include <linux/delay.h>
18#include <linux/string.h>
19#include <linux/init.h>
20
21#include <asm/io.h>
22#include <asm/pci-bridge.h>
23#include <asm/machdep.h>
24
25#include "apus_pci.h"
26
27
28/* These definitions are mostly adapted from pm2fb.c */
29
30#undef APUS_PCI_MASTER_DEBUG
31#ifdef APUS_PCI_MASTER_DEBUG
32#define DPRINTK(a,b...) printk(KERN_DEBUG "apus_pci: %s: " a, __FUNCTION__ , ## b)
33#else
34#define DPRINTK(a,b...)
35#endif
36
37/*
38 * The _DEFINITIVE_ memory mapping/unmapping functions.
39 * This is due to the fact that they're changing soooo often...
40 */
41#define DEFW() wmb()
42#define DEFR() rmb()
43#define DEFRW() mb()
44
45#define DEVNO(d) ((d)>>3)
46#define FNNO(d) ((d)&7)
47
48
49extern unsigned long powerup_PCI_present;
50
51static struct pci_controller *apus_hose;
52
53
54void *pci_io_base(unsigned int bus)
55{
56 return 0;
57}
58
59
60int
61apus_pcibios_read_config(struct pci_bus *bus, int devfn, int offset,
62 int len, u32 *val)
63{
64 int fnno = FNNO(devfn);
65 int devno = DEVNO(devfn);
66 volatile unsigned char *cfg_data;
67
68 if (bus->number > 0 || devno != 1) {
69 *val = ~0;
70 return PCIBIOS_DEVICE_NOT_FOUND;
71 }
72 /* base address + function offset + offset ^ endianness conversion */
73 /* XXX the fnno<<5 bit seems wacky -- paulus */
74 cfg_data = apus_hose->cfg_data + (fnno<<5) + (offset ^ (len - 1));
75 switch (len) {
76 case 1:
77 *val = readb(cfg_data);
78 break;
79 case 2:
80 *val = readw(cfg_data);
81 break;
82 default:
83 *val = readl(cfg_data);
84 break;
85 }
86
87 DPRINTK("read b: 0x%x, d: 0x%x, f: 0x%x, o: 0x%x, l: %d, v: 0x%x\n",
88 bus->number, devfn>>3, devfn&7, offset, len, *val);
89 return PCIBIOS_SUCCESSFUL;
90}
91
92int
93apus_pcibios_write_config(struct pci_bus *bus, int devfn, int offset,
94 int len, u32 *val)
95{
96 int fnno = FNNO(devfn);
97 int devno = DEVNO(devfn);
98 volatile unsigned char *cfg_data;
99
100 if (bus->number > 0 || devno != 1) {
101 return PCIBIOS_DEVICE_NOT_FOUND;
102 }
103 /* base address + function offset + offset ^ endianness conversion */
104 /* XXX the fnno<<5 bit seems wacky -- paulus */
105 cfg_data = apus_hose->cfg_data + (fnno<<5) + (offset ^ (len - 1));
106 switch (len) {
107 case 1:
108 writeb(val, cfg_data); DEFW();
109 break;
110 case 2:
111 writew(val, cfg_data); DEFW();
112 break;
113 default:
114 writel(val, cfg_data); DEFW();
115 break;
116 }
117
118 DPRINTK("write b: 0x%x, d: 0x%x, f: 0x%x, o: 0x%x, l: %d, v: 0x%x\n",
119 bus->number, devfn>>3, devfn&7, offset, len, val);
120 return PCIBIOS_SUCCESSFUL;
121}
122
123static struct pci_ops apus_pci_ops = {
124 apus_pcibios_read_config,
125 apus_pcibios_write_config
126};
127
128static struct resource pci_mem = { "B/CVisionPPC PCI mem", CVPPC_FB_APERTURE_ONE, CVPPC_PCI_CONFIG, IORESOURCE_MEM };
129
130void __init
131apus_pcibios_fixup(void)
132{
133/* struct pci_dev *dev = pci_find_slot(0, 1<<3);
134 unsigned int reg, val, offset;*/
135
136 /* FIXME: interrupt? */
137 /*dev->interrupt = xxx;*/
138
139 request_resource(&iomem_resource, &pci_mem);
140 printk("%s: PCI mem resource requested\n", __FUNCTION__);
141}
142
143static void __init apus_pcibios_fixup_bus(struct pci_bus *bus)
144{
145 bus->resource[1] = &pci_mem;
146}
147
148
149/*
150 * This is from pm2fb.c again
151 *
152 * Check if PCI (B/CVisionPPC) is available, initialize it and set up
153 * the pcibios_* pointers
154 */
155
156
157void __init
158apus_setup_pci_ptrs(void)
159{
160 if (!powerup_PCI_present) {
161 DPRINTK("no PCI bridge detected\n");
162 return;
163 }
164 DPRINTK("Phase5 B/CVisionPPC PCI bridge detected.\n");
165
166 apus_hose = pcibios_alloc_controller();
167 if (!apus_hose) {
168 printk("apus_pci: Can't allocate PCI controller structure\n");
169 return;
170 }
171
172 if (!(apus_hose->cfg_data = ioremap(CVPPC_PCI_CONFIG, 256))) {
173 printk("apus_pci: unable to map PCI config region\n");
174 return;
175 }
176
177 if (!(apus_hose->cfg_addr = ioremap(CSPPC_PCI_BRIDGE, 256))) {
178 printk("apus_pci: unable to map PCI bridge\n");
179 return;
180 }
181
182 writel(CSPPCF_BRIDGE_BIG_ENDIAN, apus_hose->cfg_addr + CSPPC_BRIDGE_ENDIAN);
183 DEFW();
184
185 writel(CVPPC_REGS_REGION, apus_hose->cfg_data+ PCI_BASE_ADDRESS_0);
186 DEFW();
187 writel(CVPPC_FB_APERTURE_ONE, apus_hose->cfg_data + PCI_BASE_ADDRESS_1);
188 DEFW();
189 writel(CVPPC_FB_APERTURE_TWO, apus_hose->cfg_data + PCI_BASE_ADDRESS_2);
190 DEFW();
191 writel(CVPPC_ROM_ADDRESS, apus_hose->cfg_data + PCI_ROM_ADDRESS);
192 DEFW();
193
194 writel(0xef000000 | PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
195 PCI_COMMAND_MASTER, apus_hose->cfg_data + PCI_COMMAND);
196 DEFW();
197
198 apus_hose->first_busno = 0;
199 apus_hose->last_busno = 0;
200 apus_hose->ops = &apus_pci_ops;
201 ppc_md.pcibios_fixup = apus_pcibios_fixup;
202 ppc_md.pcibios_fixup_bus = apus_pcibios_fixup_bus;
203
204 return;
205}
206
207#endif /* CONFIG_AMIGA */
diff --git a/arch/ppc/platforms/apus_pci.h b/arch/ppc/platforms/apus_pci.h
deleted file mode 100644
index f15974ae0189..000000000000
--- a/arch/ppc/platforms/apus_pci.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * Phase5 CybervisionPPC (TVP4020) definitions for the Permedia2 framebuffer
3 * driver.
4 *
5 * Copyright (c) 1998-1999 Ilario Nardinocchi (nardinoc@CS.UniBO.IT)
6 * --------------------------------------------------------------------------
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file README.legal in the main directory of this archive
9 * for more details.
10 */
11
12#ifndef APUS_PCI_H
13#define APUS_PCI_H
14
15
16#define CSPPC_PCI_BRIDGE 0xfffe0000
17#define CSPPC_BRIDGE_ENDIAN 0x0000
18#define CSPPC_BRIDGE_INT 0x0010
19
20#define CVPPC_PCI_CONFIG 0xfffc0000
21#define CVPPC_ROM_ADDRESS 0xe2000001
22#define CVPPC_REGS_REGION 0xef000000
23#define CVPPC_FB_APERTURE_ONE 0xe0000000
24#define CVPPC_FB_APERTURE_TWO 0xe1000000
25#define CVPPC_FB_SIZE 0x00800000
26
27/* CVPPC_BRIDGE_ENDIAN */
28#define CSPPCF_BRIDGE_BIG_ENDIAN 0x02
29
30/* CVPPC_BRIDGE_INT */
31#define CSPPCF_BRIDGE_ACTIVE_INT2 0x01
32
33
34#endif /* APUS_PCI_H */
diff --git a/arch/ppc/platforms/apus_setup.c b/arch/ppc/platforms/apus_setup.c
deleted file mode 100644
index 063274d2c503..000000000000
--- a/arch/ppc/platforms/apus_setup.c
+++ /dev/null
@@ -1,798 +0,0 @@
1/*
2 * Copyright (C) 1998, 1999 Jesper Skov
3 *
4 * Basically what is needed to replace functionality found in
5 * arch/m68k allowing Amiga drivers to work under APUS.
6 * Bits of code and/or ideas from arch/m68k and arch/ppc files.
7 *
8 * TODO:
9 * This file needs a *really* good cleanup. Restructure and optimize.
10 * Make sure it can be compiled for non-APUS configs. Begin to move
11 * Amiga specific stuff into mach/amiga.
12 */
13
14#include <linux/kernel.h>
15#include <linux/sched.h>
16#include <linux/init.h>
17#include <linux/initrd.h>
18#include <linux/seq_file.h>
19
20/* Needs INITSERIAL call in head.S! */
21#undef APUS_DEBUG
22
23#include <asm/bootinfo.h>
24#include <asm/setup.h>
25#include <asm/amigahw.h>
26#include <asm/amigaints.h>
27#include <asm/amigappc.h>
28#include <asm/pgtable.h>
29#include <asm/dma.h>
30#include <asm/machdep.h>
31#include <asm/time.h>
32
33unsigned long m68k_machtype;
34char debug_device[6] = "";
35
36extern void amiga_init_IRQ(void);
37
38extern void apus_setup_pci_ptrs(void);
39
40void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)) __initdata = NULL;
41/* machine dependent irq functions */
42void (*mach_init_IRQ) (void) __initdata = NULL;
43void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
44void (*mach_get_model) (char *model) = NULL;
45int (*mach_get_hardware_list) (char *buffer) = NULL;
46int (*mach_get_irq_list) (struct seq_file *, void *) = NULL;
47void (*mach_process_int) (int, struct pt_regs *) = NULL;
48/* machine dependent timer functions */
49unsigned long (*mach_gettimeoffset) (void);
50void (*mach_gettod) (int*, int*, int*, int*, int*, int*);
51int (*mach_hwclk) (int, struct hwclk_time*) = NULL;
52int (*mach_set_clock_mmss) (unsigned long) = NULL;
53void (*mach_reset)( void );
54long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
55#ifdef CONFIG_HEARTBEAT
56void (*mach_heartbeat) (int) = NULL;
57extern void apus_heartbeat (void);
58#endif
59
60extern unsigned long amiga_model;
61extern unsigned decrementer_count;/* count value for 1e6/HZ microseconds */
62extern unsigned count_period_num; /* 1 decrementer count equals */
63extern unsigned count_period_den; /* count_period_num / count_period_den us */
64
65int num_memory = 0;
66struct mem_info memory[NUM_MEMINFO];/* memory description */
67/* FIXME: Duplicate memory data to avoid conflicts with m68k shared code. */
68int m68k_realnum_memory = 0;
69struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */
70
71struct mem_info ramdisk;
72
73extern void config_amiga(void);
74
75static int __60nsram = 0;
76
77/* for cpuinfo */
78static int __bus_speed = 0;
79static int __speed_test_failed = 0;
80
81/********************************************** COMPILE PROTECTION */
82/* Provide some stubs that links to Amiga specific functions.
83 * This allows CONFIG_APUS to be removed from generic PPC files while
84 * preventing link errors for other PPC targets.
85 */
86unsigned long apus_get_rtc_time(void)
87{
88#ifdef CONFIG_APUS
89 extern unsigned long m68k_get_rtc_time(void);
90
91 return m68k_get_rtc_time ();
92#else
93 return 0;
94#endif
95}
96
97int apus_set_rtc_time(unsigned long nowtime)
98{
99#ifdef CONFIG_APUS
100 extern int m68k_set_rtc_time(unsigned long nowtime);
101
102 return m68k_set_rtc_time (nowtime);
103#else
104 return 0;
105#endif
106}
107
108/*********************************************************** SETUP */
109/* From arch/m68k/kernel/setup.c. */
110void __init apus_setup_arch(void)
111{
112#ifdef CONFIG_APUS
113 extern char cmd_line[];
114 int i;
115 char *p, *q;
116
117 /* Let m68k-shared code know it should do the Amiga thing. */
118 m68k_machtype = MACH_AMIGA;
119
120 /* Parse the command line for arch-specific options.
121 * For the m68k, this is currently only "debug=xxx" to enable printing
122 * certain kernel messages to some machine-specific device. */
123 for( p = cmd_line; p && *p; ) {
124 i = 0;
125 if (!strncmp( p, "debug=", 6 )) {
126 strlcpy( debug_device, p+6, sizeof(debug_device) );
127 if ((q = strchr( debug_device, ' ' ))) *q = 0;
128 i = 1;
129 } else if (!strncmp( p, "60nsram", 7 )) {
130 APUS_WRITE (APUS_REG_WAITSTATE,
131 REGWAITSTATE_SETRESET
132 |REGWAITSTATE_PPCR
133 |REGWAITSTATE_PPCW);
134 __60nsram = 1;
135 i = 1;
136 }
137
138 if (i) {
139 /* option processed, delete it */
140 if ((q = strchr( p, ' ' )))
141 strcpy( p, q+1 );
142 else
143 *p = 0;
144 } else {
145 if ((p = strchr( p, ' ' ))) ++p;
146 }
147 }
148
149 config_amiga();
150
151#if 0 /* Enable for logging - also include logging.o in Makefile rule */
152 {
153#define LOG_SIZE 4096
154 void* base;
155
156 /* Throw away some memory - the P5 firmare stomps on top
157 * of CHIP memory during bootup.
158 */
159 amiga_chip_alloc(0x1000);
160
161 base = amiga_chip_alloc(LOG_SIZE+sizeof(klog_data_t));
162 LOG_INIT(base, base+sizeof(klog_data_t), LOG_SIZE);
163 }
164#endif
165#endif
166}
167
168int
169apus_show_cpuinfo(struct seq_file *m)
170{
171 extern int __map_without_bats;
172 extern unsigned long powerup_PCI_present;
173
174 seq_printf(m, "machine\t\t: Amiga\n");
175 seq_printf(m, "bus speed\t: %d%s", __bus_speed,
176 (__speed_test_failed) ? " [failed]\n" : "\n");
177 seq_printf(m, "using BATs\t: %s\n",
178 (__map_without_bats) ? "No" : "Yes");
179 seq_printf(m, "ram speed\t: %dns\n", (__60nsram) ? 60 : 70);
180 seq_printf(m, "PCI bridge\t: %s\n",
181 (powerup_PCI_present) ? "Yes" : "No");
182 return 0;
183}
184
185static void get_current_tb(unsigned long long *time)
186{
187 __asm __volatile ("1:mftbu 4 \n\t"
188 " mftb 5 \n\t"
189 " mftbu 6 \n\t"
190 " cmpw 4,6 \n\t"
191 " bne 1b \n\t"
192 " stw 4,0(%0)\n\t"
193 " stw 5,4(%0)\n\t"
194 :
195 : "r" (time)
196 : "r4", "r5", "r6");
197}
198
199
200void apus_calibrate_decr(void)
201{
202#ifdef CONFIG_APUS
203 unsigned long freq;
204
205 /* This algorithm for determining the bus speed was
206 contributed by Ralph Schmidt. */
207 unsigned long long start, stop;
208 int bus_speed;
209 int speed_test_failed = 0;
210
211 {
212 unsigned long loop = amiga_eclock / 10;
213
214 get_current_tb (&start);
215 while (loop--) {
216 unsigned char tmp;
217
218 tmp = ciaa.pra;
219 }
220 get_current_tb (&stop);
221 }
222
223 bus_speed = (((unsigned long)(stop-start))*10*4) / 1000000;
224 if (AMI_1200 == amiga_model)
225 bus_speed /= 2;
226
227 if ((bus_speed >= 47) && (bus_speed < 53)) {
228 bus_speed = 50;
229 freq = 12500000;
230 } else if ((bus_speed >= 57) && (bus_speed < 63)) {
231 bus_speed = 60;
232 freq = 15000000;
233 } else if ((bus_speed >= 63) && (bus_speed < 69)) {
234 bus_speed = 67;
235 freq = 16666667;
236 } else {
237 printk ("APUS: Unable to determine bus speed (%d). "
238 "Defaulting to 50MHz", bus_speed);
239 bus_speed = 50;
240 freq = 12500000;
241 speed_test_failed = 1;
242 }
243
244 /* Ease diagnostics... */
245 {
246 extern int __map_without_bats;
247 extern unsigned long powerup_PCI_present;
248
249 printk ("APUS: BATs=%d, BUS=%dMHz",
250 (__map_without_bats) ? 0 : 1,
251 bus_speed);
252 if (speed_test_failed)
253 printk ("[FAILED - please report]");
254
255 printk (", RAM=%dns, PCI bridge=%d\n",
256 (__60nsram) ? 60 : 70,
257 (powerup_PCI_present) ? 1 : 0);
258
259 /* print a bit more if asked politely... */
260 if (!(ciaa.pra & 0x40)){
261 extern unsigned int bat_addrs[4][3];
262 int b;
263 for (b = 0; b < 4; ++b) {
264 printk ("APUS: BAT%d ", b);
265 printk ("%08x-%08x -> %08x\n",
266 bat_addrs[b][0],
267 bat_addrs[b][1],
268 bat_addrs[b][2]);
269 }
270 }
271
272 }
273
274 printk("time_init: decrementer frequency = %lu.%.6lu MHz\n",
275 freq/1000000, freq%1000000);
276 tb_ticks_per_jiffy = freq / HZ;
277 tb_to_us = mulhwu_scale_factor(freq, 1000000);
278
279 __bus_speed = bus_speed;
280 __speed_test_failed = speed_test_failed;
281#endif
282}
283
284void arch_gettod(int *year, int *mon, int *day, int *hour,
285 int *min, int *sec)
286{
287#ifdef CONFIG_APUS
288 if (mach_gettod)
289 mach_gettod(year, mon, day, hour, min, sec);
290 else
291 *year = *mon = *day = *hour = *min = *sec = 0;
292#endif
293}
294
295/* for "kbd-reset" cmdline param */
296__init
297void kbd_reset_setup(char *str, int *ints)
298{
299}
300
301/*********************************************************** MEMORY */
302#define KMAP_MAX 32
303unsigned long kmap_chunks[KMAP_MAX*3];
304int kmap_chunk_count = 0;
305
306/* From pgtable.h */
307static __inline__ pte_t *my_find_pte(struct mm_struct *mm,unsigned long va)
308{
309 pgd_t *dir = 0;
310 pmd_t *pmd = 0;
311 pte_t *pte = 0;
312
313 va &= PAGE_MASK;
314
315 dir = pgd_offset( mm, va );
316 if (dir)
317 {
318 pmd = pmd_offset(dir, va & PAGE_MASK);
319 if (pmd && pmd_present(*pmd))
320 {
321 pte = pte_offset(pmd, va);
322 }
323 }
324 return pte;
325}
326
327
328/* Again simulating an m68k/mm/kmap.c function. */
329void kernel_set_cachemode( unsigned long address, unsigned long size,
330 unsigned int cmode )
331{
332 unsigned long mask, flags;
333
334 switch (cmode)
335 {
336 case IOMAP_FULL_CACHING:
337 mask = ~(_PAGE_NO_CACHE | _PAGE_GUARDED);
338 flags = 0;
339 break;
340 case IOMAP_NOCACHE_SER:
341 mask = ~0;
342 flags = (_PAGE_NO_CACHE | _PAGE_GUARDED);
343 break;
344 default:
345 panic ("kernel_set_cachemode() doesn't support mode %d\n",
346 cmode);
347 break;
348 }
349
350 size /= PAGE_SIZE;
351 address &= PAGE_MASK;
352 while (size--)
353 {
354 pte_t *pte;
355
356 pte = my_find_pte(&init_mm, address);
357 if ( !pte )
358 {
359 printk("pte NULL in kernel_set_cachemode()\n");
360 return;
361 }
362
363 pte_val (*pte) &= mask;
364 pte_val (*pte) |= flags;
365 flush_tlb_page(find_vma(&init_mm,address),address);
366
367 address += PAGE_SIZE;
368 }
369}
370
371unsigned long mm_ptov (unsigned long paddr)
372{
373 unsigned long ret;
374 if (paddr < 16*1024*1024)
375 ret = ZTWO_VADDR(paddr);
376 else {
377 int i;
378
379 for (i = 0; i < kmap_chunk_count;){
380 unsigned long phys = kmap_chunks[i++];
381 unsigned long size = kmap_chunks[i++];
382 unsigned long virt = kmap_chunks[i++];
383 if (paddr >= phys
384 && paddr < (phys + size)){
385 ret = virt + paddr - phys;
386 goto exit;
387 }
388 }
389
390 ret = (unsigned long) __va(paddr);
391 }
392exit:
393#ifdef DEBUGPV
394 printk ("PTOV(%lx)=%lx\n", paddr, ret);
395#endif
396 return ret;
397}
398
399int mm_end_of_chunk (unsigned long addr, int len)
400{
401 if (memory[0].addr + memory[0].size == addr + len)
402 return 1;
403 return 0;
404}
405
406/*********************************************************** CACHE */
407
408#define L1_CACHE_BYTES 32
409#define MAX_CACHE_SIZE 8192
410void cache_push(__u32 addr, int length)
411{
412 addr = mm_ptov(addr);
413
414 if (MAX_CACHE_SIZE < length)
415 length = MAX_CACHE_SIZE;
416
417 while(length > 0){
418 __asm ("dcbf 0,%0\n\t"
419 : : "r" (addr));
420 addr += L1_CACHE_BYTES;
421 length -= L1_CACHE_BYTES;
422 }
423 /* Also flush trailing block */
424 __asm ("dcbf 0,%0\n\t"
425 "sync \n\t"
426 : : "r" (addr));
427}
428
429void cache_clear(__u32 addr, int length)
430{
431 if (MAX_CACHE_SIZE < length)
432 length = MAX_CACHE_SIZE;
433
434 addr = mm_ptov(addr);
435
436 __asm ("dcbf 0,%0\n\t"
437 "sync \n\t"
438 "icbi 0,%0 \n\t"
439 "isync \n\t"
440 : : "r" (addr));
441
442 addr += L1_CACHE_BYTES;
443 length -= L1_CACHE_BYTES;
444
445 while(length > 0){
446 __asm ("dcbf 0,%0\n\t"
447 "sync \n\t"
448 "icbi 0,%0 \n\t"
449 "isync \n\t"
450 : : "r" (addr));
451 addr += L1_CACHE_BYTES;
452 length -= L1_CACHE_BYTES;
453 }
454
455 __asm ("dcbf 0,%0\n\t"
456 "sync \n\t"
457 "icbi 0,%0 \n\t"
458 "isync \n\t"
459 : : "r" (addr));
460}
461
462/****************************************************** from setup.c */
463void
464apus_restart(char *cmd)
465{
466 local_irq_disable();
467
468 APUS_WRITE(APUS_REG_LOCK,
469 REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK2);
470 APUS_WRITE(APUS_REG_LOCK,
471 REGLOCK_BLACKMAGICK1|REGLOCK_BLACKMAGICK3);
472 APUS_WRITE(APUS_REG_LOCK,
473 REGLOCK_BLACKMAGICK2|REGLOCK_BLACKMAGICK3);
474 APUS_WRITE(APUS_REG_SHADOW, REGSHADOW_SELFRESET);
475 APUS_WRITE(APUS_REG_RESET, REGRESET_AMIGARESET);
476 for(;;);
477}
478
479void
480apus_power_off(void)
481{
482 for (;;);
483}
484
485void
486apus_halt(void)
487{
488 apus_restart(NULL);
489}
490
491/****************************************************** IRQ stuff */
492
493static unsigned char last_ipl[8];
494
495int apus_get_irq(void)
496{
497 unsigned char ipl_emu, mask;
498 unsigned int level;
499
500 APUS_READ(APUS_IPL_EMU, ipl_emu);
501 level = (ipl_emu >> 3) & IPLEMU_IPLMASK;
502 mask = IPLEMU_SETRESET|IPLEMU_DISABLEINT|level;
503 level ^= 7;
504
505 /* Save previous IPL value */
506 if (last_ipl[level])
507 return -2;
508 last_ipl[level] = ipl_emu;
509
510 /* Set to current IPL value */
511 APUS_WRITE(APUS_IPL_EMU, mask);
512 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT|level);
513
514
515#ifdef __INTERRUPT_DEBUG
516 printk("<%d:%d>", level, ~ipl_emu & IPLEMU_IPLMASK);
517#endif
518 return level + IRQ_AMIGA_AUTO;
519}
520
521void apus_end_irq(unsigned int irq)
522{
523 unsigned char ipl_emu;
524 unsigned int level = irq - IRQ_AMIGA_AUTO;
525#ifdef __INTERRUPT_DEBUG
526 printk("{%d}", ~last_ipl[level] & IPLEMU_IPLMASK);
527#endif
528 /* Restore IPL to the previous value */
529 ipl_emu = last_ipl[level] & IPLEMU_IPLMASK;
530 APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET|IPLEMU_DISABLEINT|ipl_emu);
531 last_ipl[level] = 0;
532 ipl_emu ^= 7;
533 APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT|ipl_emu);
534}
535
536/****************************************************** debugging */
537
538/* some serial hardware definitions */
539#define SDR_OVRUN (1<<15)
540#define SDR_RBF (1<<14)
541#define SDR_TBE (1<<13)
542#define SDR_TSRE (1<<12)
543
544#define AC_SETCLR (1<<15)
545#define AC_UARTBRK (1<<11)
546
547#define SER_DTR (1<<7)
548#define SER_RTS (1<<6)
549#define SER_DCD (1<<5)
550#define SER_CTS (1<<4)
551#define SER_DSR (1<<3)
552
553static __inline__ void ser_RTSon(void)
554{
555 ciab.pra &= ~SER_RTS; /* active low */
556}
557
558int __debug_ser_out( unsigned char c )
559{
560 amiga_custom.serdat = c | 0x100;
561 mb();
562 while (!(amiga_custom.serdatr & 0x2000))
563 barrier();
564 return 1;
565}
566
567unsigned char __debug_ser_in( void )
568{
569 unsigned char c;
570
571 /* XXX: is that ok?? derived from amiga_ser.c... */
572 while( !(amiga_custom.intreqr & IF_RBF) )
573 barrier();
574 c = amiga_custom.serdatr;
575 /* clear the interrupt, so that another character can be read */
576 amiga_custom.intreq = IF_RBF;
577 return c;
578}
579
580int __debug_serinit( void )
581{
582 unsigned long flags;
583
584 local_irq_save(flags);
585
586 /* turn off Rx and Tx interrupts */
587 amiga_custom.intena = IF_RBF | IF_TBE;
588
589 /* clear any pending interrupt */
590 amiga_custom.intreq = IF_RBF | IF_TBE;
591
592 local_irq_restore(flags);
593
594 /*
595 * set the appropriate directions for the modem control flags,
596 * and clear RTS and DTR
597 */
598 ciab.ddra |= (SER_DTR | SER_RTS); /* outputs */
599 ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
600
601#ifdef CONFIG_KGDB
602 /* turn Rx interrupts on for GDB */
603 amiga_custom.intena = IF_SETCLR | IF_RBF;
604 ser_RTSon();
605#endif
606
607 return 0;
608}
609
610void __debug_print_hex(unsigned long x)
611{
612 int i;
613 char hexchars[] = "0123456789ABCDEF";
614
615 for (i = 0; i < 8; i++) {
616 __debug_ser_out(hexchars[(x >> 28) & 15]);
617 x <<= 4;
618 }
619 __debug_ser_out('\n');
620 __debug_ser_out('\r');
621}
622
623void __debug_print_string(char* s)
624{
625 unsigned char c;
626 while((c = *s++))
627 __debug_ser_out(c);
628 __debug_ser_out('\n');
629 __debug_ser_out('\r');
630}
631
632static void apus_progress(char *s, unsigned short value)
633{
634 __debug_print_string(s);
635}
636
637/****************************************************** init */
638
639/* The number of spurious interrupts */
640volatile unsigned int num_spurious;
641
642extern struct irqaction amiga_sys_irqaction[AUTO_IRQS];
643
644
645extern void amiga_enable_irq(unsigned int irq);
646extern void amiga_disable_irq(unsigned int irq);
647
648struct hw_interrupt_type amiga_sys_irqctrl = {
649 .typename = "Amiga IPL",
650 .end = apus_end_irq,
651};
652
653struct hw_interrupt_type amiga_irqctrl = {
654 .typename = "Amiga ",
655 .enable = amiga_enable_irq,
656 .disable = amiga_disable_irq,
657};
658
659#define HARDWARE_MAPPED_SIZE (512*1024)
660unsigned long __init apus_find_end_of_memory(void)
661{
662 int shadow = 0;
663 unsigned long total;
664
665 /* The memory size reported by ADOS excludes the 512KB
666 reserved for PPC exception registers and possibly 512KB
667 containing a shadow of the ADOS ROM. */
668 {
669 unsigned long size = memory[0].size;
670
671 /* If 2MB aligned, size was probably user
672 specified. We can't tell anything about shadowing
673 in this case so skip shadow assignment. */
674 if (0 != (size & 0x1fffff)){
675 /* Align to 512KB to ensure correct handling
676 of both memfile and system specified
677 sizes. */
678 size = ((size+0x0007ffff) & 0xfff80000);
679 /* If memory is 1MB aligned, assume
680 shadowing. */
681 shadow = !(size & 0x80000);
682 }
683
684 /* Add the chunk that ADOS does not see. by aligning
685 the size to the nearest 2MB limit upwards. */
686 memory[0].size = ((size+0x001fffff) & 0xffe00000);
687 }
688
689 ppc_memstart = memory[0].addr;
690 ppc_memoffset = PAGE_OFFSET - PPC_MEMSTART;
691 total = memory[0].size;
692
693 /* Remove the memory chunks that are controlled by special
694 Phase5 hardware. */
695
696 /* Remove the upper 512KB if it contains a shadow of
697 the ADOS ROM. FIXME: It might be possible to
698 disable this shadow HW. Check the booter
699 (ppc_boot.c) */
700 if (shadow)
701 total -= HARDWARE_MAPPED_SIZE;
702
703 /* Remove the upper 512KB where the PPC exception
704 vectors are mapped. */
705 total -= HARDWARE_MAPPED_SIZE;
706
707 /* Linux/APUS only handles one block of memory -- the one on
708 the PowerUP board. Other system memory is horrible slow in
709 comparison. The user can use other memory for swapping
710 using the z2ram device. */
711 return total;
712}
713
714static void __init
715apus_map_io(void)
716{
717 /* Map PPC exception vectors. */
718 io_block_mapping(0xfff00000, 0xfff00000, 0x00020000, _PAGE_KERNEL);
719 /* Map chip and ZorroII memory */
720 io_block_mapping(zTwoBase, 0x00000000, 0x01000000, _PAGE_IO);
721}
722
723__init
724void apus_init_IRQ(void)
725{
726 struct irqaction *action;
727 int i;
728
729#ifdef CONFIG_PCI
730 apus_setup_pci_ptrs();
731#endif
732
733 for ( i = 0 ; i < AMI_IRQS; i++ ) {
734 irq_desc[i].status = IRQ_LEVEL;
735 if (i < IRQ_AMIGA_AUTO) {
736 irq_desc[i].chip = &amiga_irqctrl;
737 } else {
738 irq_desc[i].chip = &amiga_sys_irqctrl;
739 action = &amiga_sys_irqaction[i-IRQ_AMIGA_AUTO];
740 if (action->name)
741 setup_irq(i, action);
742 }
743 }
744
745 amiga_init_IRQ();
746
747}
748
749__init
750void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
751 unsigned long r6, unsigned long r7)
752{
753 extern int parse_bootinfo(const struct bi_record *);
754 extern char _end[];
755
756 /* Parse bootinfo. The bootinfo is located right after
757 the kernel bss */
758 parse_bootinfo((const struct bi_record *)&_end);
759#ifdef CONFIG_BLK_DEV_INITRD
760 /* Take care of initrd if we have one. Use data from
761 bootinfo to avoid the need to initialize PPC
762 registers when kernel is booted via a PPC reset. */
763 if ( ramdisk.addr ) {
764 initrd_start = (unsigned long) __va(ramdisk.addr);
765 initrd_end = (unsigned long)
766 __va(ramdisk.size + ramdisk.addr);
767 }
768#endif /* CONFIG_BLK_DEV_INITRD */
769
770 ISA_DMA_THRESHOLD = 0x00ffffff;
771
772 ppc_md.setup_arch = apus_setup_arch;
773 ppc_md.show_cpuinfo = apus_show_cpuinfo;
774 ppc_md.init_IRQ = apus_init_IRQ;
775 ppc_md.get_irq = apus_get_irq;
776
777#ifdef CONFIG_HEARTBEAT
778 ppc_md.heartbeat = apus_heartbeat;
779 ppc_md.heartbeat_count = 1;
780#endif
781#ifdef APUS_DEBUG
782 __debug_serinit();
783 ppc_md.progress = apus_progress;
784#endif
785 ppc_md.init = NULL;
786
787 ppc_md.restart = apus_restart;
788 ppc_md.power_off = apus_power_off;
789 ppc_md.halt = apus_halt;
790
791 ppc_md.time_init = NULL;
792 ppc_md.set_rtc_time = apus_set_rtc_time;
793 ppc_md.get_rtc_time = apus_get_rtc_time;
794 ppc_md.calibrate_decr = apus_calibrate_decr;
795
796 ppc_md.find_end_of_memory = apus_find_end_of_memory;
797 ppc_md.setup_io_mappings = apus_map_io;
798}
diff --git a/arch/ppc/platforms/ev64360.c b/arch/ppc/platforms/ev64360.c
index f8baf05f16ce..6765676a5c6b 100644
--- a/arch/ppc/platforms/ev64360.c
+++ b/arch/ppc/platforms/ev64360.c
@@ -23,9 +23,6 @@
23#include <linux/mtd/physmap.h> 23#include <linux/mtd/physmap.h>
24#include <linux/mv643xx.h> 24#include <linux/mv643xx.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#ifdef CONFIG_BOOTIMG
27#include <linux/bootimg.h>
28#endif
29#include <asm/page.h> 26#include <asm/page.h>
30#include <asm/time.h> 27#include <asm/time.h>
31#include <asm/smp.h> 28#include <asm/smp.h>
diff --git a/arch/ppc/platforms/katana.c b/arch/ppc/platforms/katana.c
index c289e9f1b251..52f63e6f0856 100644
--- a/arch/ppc/platforms/katana.c
+++ b/arch/ppc/platforms/katana.c
@@ -27,9 +27,6 @@
27#include <linux/mtd/physmap.h> 27#include <linux/mtd/physmap.h>
28#include <linux/mv643xx.h> 28#include <linux/mv643xx.h>
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30#ifdef CONFIG_BOOTIMG
31#include <linux/bootimg.h>
32#endif
33#include <asm/io.h> 30#include <asm/io.h>
34#include <asm/unistd.h> 31#include <asm/unistd.h>
35#include <asm/page.h> 32#include <asm/page.h>
diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c
index 491fe9a57229..3f5be2c5ce99 100644
--- a/arch/ppc/syslib/ocp.c
+++ b/arch/ppc/syslib/ocp.c
@@ -44,11 +44,11 @@
44#include <linux/pm.h> 44#include <linux/pm.h>
45#include <linux/bootmem.h> 45#include <linux/bootmem.h>
46#include <linux/device.h> 46#include <linux/device.h>
47#include <linux/rwsem.h>
47 48
48#include <asm/io.h> 49#include <asm/io.h>
49#include <asm/ocp.h> 50#include <asm/ocp.h>
50#include <asm/errno.h> 51#include <asm/errno.h>
51#include <asm/rwsem.h>
52#include <asm/semaphore.h> 52#include <asm/semaphore.h>
53 53
54//#define DBG(x) printk x 54//#define DBG(x) printk x
diff --git a/arch/ppc/syslib/virtex_devices.h b/arch/ppc/syslib/virtex_devices.h
index 9f38d92ae536..6ebd9b4b8f1c 100644
--- a/arch/ppc/syslib/virtex_devices.h
+++ b/arch/ppc/syslib/virtex_devices.h
@@ -12,13 +12,7 @@
12#define __ASM_VIRTEX_DEVICES_H__ 12#define __ASM_VIRTEX_DEVICES_H__
13 13
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15 15#include <linux/xilinxfb.h>
16/* ML300/403 reference design framebuffer driver platform data struct */
17struct xilinxfb_platform_data {
18 u32 rotate_screen;
19 u32 screen_height_mm;
20 u32 screen_width_mm;
21};
22 16
23void __init virtex_early_serial_map(void); 17void __init virtex_early_serial_map(void);
24 18
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index af3969a9c963..e824b672e05a 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -74,53 +74,9 @@ enum {
74static DEFINE_SPINLOCK(viodasd_spinlock); 74static DEFINE_SPINLOCK(viodasd_spinlock);
75 75
76#define VIOMAXREQ 16 76#define VIOMAXREQ 16
77#define VIOMAXBLOCKDMA 12
78 77
79#define DEVICE_NO(cell) ((struct viodasd_device *)(cell) - &viodasd_devices[0]) 78#define DEVICE_NO(cell) ((struct viodasd_device *)(cell) - &viodasd_devices[0])
80 79
81struct open_data {
82 u64 disk_size;
83 u16 max_disk;
84 u16 cylinders;
85 u16 tracks;
86 u16 sectors;
87 u16 bytes_per_sector;
88};
89
90struct rw_data {
91 u64 offset;
92 struct {
93 u32 token;
94 u32 reserved;
95 u64 len;
96 } dma_info[VIOMAXBLOCKDMA];
97};
98
99struct vioblocklpevent {
100 struct HvLpEvent event;
101 u32 reserved;
102 u16 version;
103 u16 sub_result;
104 u16 disk;
105 u16 flags;
106 union {
107 struct open_data open_data;
108 struct rw_data rw_data;
109 u64 changed;
110 } u;
111};
112
113#define vioblockflags_ro 0x0001
114
115enum vioblocksubtype {
116 vioblockopen = 0x0001,
117 vioblockclose = 0x0002,
118 vioblockread = 0x0003,
119 vioblockwrite = 0x0004,
120 vioblockflush = 0x0005,
121 vioblockcheck = 0x0007
122};
123
124struct viodasd_waitevent { 80struct viodasd_waitevent {
125 struct completion com; 81 struct completion com;
126 int rc; 82 int rc;
@@ -429,7 +385,7 @@ static void do_viodasd_request(struct request_queue *q)
429 * Probe a single disk and fill in the viodasd_device structure 385 * Probe a single disk and fill in the viodasd_device structure
430 * for it. 386 * for it.
431 */ 387 */
432static void probe_disk(struct viodasd_device *d) 388static int probe_disk(struct viodasd_device *d)
433{ 389{
434 HvLpEvent_Rc hvrc; 390 HvLpEvent_Rc hvrc;
435 struct viodasd_waitevent we; 391 struct viodasd_waitevent we;
@@ -453,14 +409,14 @@ retry:
453 0, 0, 0); 409 0, 0, 0);
454 if (hvrc != 0) { 410 if (hvrc != 0) {
455 printk(VIOD_KERN_WARNING "bad rc on HV open %d\n", (int)hvrc); 411 printk(VIOD_KERN_WARNING "bad rc on HV open %d\n", (int)hvrc);
456 return; 412 return 0;
457 } 413 }
458 414
459 wait_for_completion(&we.com); 415 wait_for_completion(&we.com);
460 416
461 if (we.rc != 0) { 417 if (we.rc != 0) {
462 if (flags != 0) 418 if (flags != 0)
463 return; 419 return 0;
464 /* try again with read only flag set */ 420 /* try again with read only flag set */
465 flags = vioblockflags_ro; 421 flags = vioblockflags_ro;
466 goto retry; 422 goto retry;
@@ -490,15 +446,32 @@ retry:
490 if (hvrc != 0) { 446 if (hvrc != 0) {
491 printk(VIOD_KERN_WARNING 447 printk(VIOD_KERN_WARNING
492 "bad rc sending event to OS/400 %d\n", (int)hvrc); 448 "bad rc sending event to OS/400 %d\n", (int)hvrc);
493 return; 449 return 0;
494 } 450 }
451
452 if (d->dev == NULL) {
453 /* this is when we reprobe for new disks */
454 if (vio_create_viodasd(dev_no) == NULL) {
455 printk(VIOD_KERN_WARNING
456 "cannot allocate virtual device for disk %d\n",
457 dev_no);
458 return 0;
459 }
460 /*
461 * The vio_create_viodasd will have recursed into this
462 * routine with d->dev set to the new vio device and
463 * will finish the setup of the disk below.
464 */
465 return 1;
466 }
467
495 /* create the request queue for the disk */ 468 /* create the request queue for the disk */
496 spin_lock_init(&d->q_lock); 469 spin_lock_init(&d->q_lock);
497 q = blk_init_queue(do_viodasd_request, &d->q_lock); 470 q = blk_init_queue(do_viodasd_request, &d->q_lock);
498 if (q == NULL) { 471 if (q == NULL) {
499 printk(VIOD_KERN_WARNING "cannot allocate queue for disk %d\n", 472 printk(VIOD_KERN_WARNING "cannot allocate queue for disk %d\n",
500 dev_no); 473 dev_no);
501 return; 474 return 0;
502 } 475 }
503 g = alloc_disk(1 << PARTITION_SHIFT); 476 g = alloc_disk(1 << PARTITION_SHIFT);
504 if (g == NULL) { 477 if (g == NULL) {
@@ -506,7 +479,7 @@ retry:
506 "cannot allocate disk structure for disk %d\n", 479 "cannot allocate disk structure for disk %d\n",
507 dev_no); 480 dev_no);
508 blk_cleanup_queue(q); 481 blk_cleanup_queue(q);
509 return; 482 return 0;
510 } 483 }
511 484
512 d->disk = g; 485 d->disk = g;
@@ -538,6 +511,7 @@ retry:
538 511
539 /* register us in the global list */ 512 /* register us in the global list */
540 add_disk(g); 513 add_disk(g);
514 return 1;
541} 515}
542 516
543/* returns the total number of scatterlist elements converted */ 517/* returns the total number of scatterlist elements converted */
@@ -718,8 +692,7 @@ static int viodasd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
718 struct viodasd_device *d = &viodasd_devices[vdev->unit_address]; 692 struct viodasd_device *d = &viodasd_devices[vdev->unit_address];
719 693
720 d->dev = &vdev->dev; 694 d->dev = &vdev->dev;
721 probe_disk(d); 695 if (!probe_disk(d))
722 if (d->disk == NULL)
723 return -ENODEV; 696 return -ENODEV;
724 return 0; 697 return 0;
725} 698}
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index e51550db1575..880b5dce3a62 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -56,30 +56,6 @@
56#define VIOCD_KERN_WARNING KERN_WARNING "viocd: " 56#define VIOCD_KERN_WARNING KERN_WARNING "viocd: "
57#define VIOCD_KERN_INFO KERN_INFO "viocd: " 57#define VIOCD_KERN_INFO KERN_INFO "viocd: "
58 58
59struct viocdlpevent {
60 struct HvLpEvent event;
61 u32 reserved;
62 u16 version;
63 u16 sub_result;
64 u16 disk;
65 u16 flags;
66 u32 token;
67 u64 offset; /* On open, max number of disks */
68 u64 len; /* On open, size of the disk */
69 u32 block_size; /* Only set on open */
70 u32 media_size; /* Only set on open */
71};
72
73enum viocdsubtype {
74 viocdopen = 0x0001,
75 viocdclose = 0x0002,
76 viocdread = 0x0003,
77 viocdwrite = 0x0004,
78 viocdlockdoor = 0x0005,
79 viocdgetinfo = 0x0006,
80 viocdcheck = 0x0007
81};
82
83/* 59/*
84 * Should probably make this a module parameter....sigh 60 * Should probably make this a module parameter....sigh
85 */ 61 */
@@ -131,22 +107,13 @@ static struct capability_entry capability_table[] __initdata = {
131/* These are our internal structures for keeping track of devices */ 107/* These are our internal structures for keeping track of devices */
132static int viocd_numdev; 108static int viocd_numdev;
133 109
134struct cdrom_info {
135 char rsrcname[10];
136 char type[4];
137 char model[3];
138};
139/*
140 * This needs to be allocated since it is passed to the
141 * Hypervisor and we may be a module.
142 */
143static struct cdrom_info *viocd_unitinfo;
144static dma_addr_t unitinfo_dmaaddr;
145
146struct disk_info { 110struct disk_info {
147 struct gendisk *viocd_disk; 111 struct gendisk *viocd_disk;
148 struct cdrom_device_info viocd_info; 112 struct cdrom_device_info viocd_info;
149 struct device *dev; 113 struct device *dev;
114 const char *rsrcname;
115 const char *type;
116 const char *model;
150}; 117};
151static struct disk_info viocd_diskinfo[VIOCD_MAX_CD]; 118static struct disk_info viocd_diskinfo[VIOCD_MAX_CD];
152 119
@@ -164,9 +131,9 @@ static int proc_viocd_show(struct seq_file *m, void *v)
164 for (i = 0; i < viocd_numdev; i++) { 131 for (i = 0; i < viocd_numdev; i++) {
165 seq_printf(m, "viocd device %d is iSeries resource %10.10s" 132 seq_printf(m, "viocd device %d is iSeries resource %10.10s"
166 "type %4.4s, model %3.3s\n", 133 "type %4.4s, model %3.3s\n",
167 i, viocd_unitinfo[i].rsrcname, 134 i, viocd_diskinfo[i].rsrcname,
168 viocd_unitinfo[i].type, 135 viocd_diskinfo[i].type,
169 viocd_unitinfo[i].model); 136 viocd_diskinfo[i].model);
170 } 137 }
171 return 0; 138 return 0;
172} 139}
@@ -216,61 +183,6 @@ struct block_device_operations viocd_fops = {
216 .media_changed = viocd_blk_media_changed, 183 .media_changed = viocd_blk_media_changed,
217}; 184};
218 185
219/* Get info on CD devices from OS/400 */
220static void __init get_viocd_info(void)
221{
222 HvLpEvent_Rc hvrc;
223 int i;
224 struct viocd_waitevent we;
225
226 viocd_unitinfo = dma_alloc_coherent(iSeries_vio_dev,
227 sizeof(*viocd_unitinfo) * VIOCD_MAX_CD,
228 &unitinfo_dmaaddr, GFP_ATOMIC);
229 if (viocd_unitinfo == NULL) {
230 printk(VIOCD_KERN_WARNING "error allocating unitinfo\n");
231 return;
232 }
233
234 memset(viocd_unitinfo, 0, sizeof(*viocd_unitinfo) * VIOCD_MAX_CD);
235
236 init_completion(&we.com);
237
238 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
239 HvLpEvent_Type_VirtualIo,
240 viomajorsubtype_cdio | viocdgetinfo,
241 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
242 viopath_sourceinst(viopath_hostLp),
243 viopath_targetinst(viopath_hostLp),
244 (u64)&we, VIOVERSION << 16, unitinfo_dmaaddr, 0,
245 sizeof(*viocd_unitinfo) * VIOCD_MAX_CD, 0);
246 if (hvrc != HvLpEvent_Rc_Good) {
247 printk(VIOCD_KERN_WARNING "cdrom error sending event. rc %d\n",
248 (int)hvrc);
249 goto error_ret;
250 }
251
252 wait_for_completion(&we.com);
253
254 if (we.rc) {
255 const struct vio_error_entry *err =
256 vio_lookup_rc(viocd_err_table, we.sub_result);
257 printk(VIOCD_KERN_WARNING "bad rc %d:0x%04X on getinfo: %s\n",
258 we.rc, we.sub_result, err->msg);
259 goto error_ret;
260 }
261
262 for (i = 0; (i < VIOCD_MAX_CD) && viocd_unitinfo[i].rsrcname[0]; i++)
263 viocd_numdev++;
264
265error_ret:
266 if (viocd_numdev == 0) {
267 dma_free_coherent(iSeries_vio_dev,
268 sizeof(*viocd_unitinfo) * VIOCD_MAX_CD,
269 viocd_unitinfo, unitinfo_dmaaddr);
270 viocd_unitinfo = NULL;
271 }
272}
273
274static int viocd_open(struct cdrom_device_info *cdi, int purpose) 186static int viocd_open(struct cdrom_device_info *cdi, int purpose)
275{ 187{
276 struct disk_info *diskinfo = cdi->handle; 188 struct disk_info *diskinfo = cdi->handle;
@@ -581,7 +493,6 @@ static void vio_handle_cd_event(struct HvLpEvent *event)
581 bevent->block_size / 512); 493 bevent->block_size / 512);
582 } 494 }
583 /* FALLTHROUGH !! */ 495 /* FALLTHROUGH !! */
584 case viocdgetinfo:
585 case viocdlockdoor: 496 case viocdlockdoor:
586 pwe = (struct viocd_waitevent *)event->xCorrelationToken; 497 pwe = (struct viocd_waitevent *)event->xCorrelationToken;
587return_complete: 498return_complete:
@@ -665,22 +576,30 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
665 int deviceno; 576 int deviceno;
666 struct disk_info *d; 577 struct disk_info *d;
667 struct cdrom_device_info *c; 578 struct cdrom_device_info *c;
668 struct cdrom_info *ci;
669 struct request_queue *q; 579 struct request_queue *q;
580 struct device_node *node = vdev->dev.archdata.of_node;
670 581
671 deviceno = vdev->unit_address; 582 deviceno = vdev->unit_address;
672 if (deviceno >= viocd_numdev) 583 if (deviceno > VIOCD_MAX_CD)
673 return -ENODEV; 584 return -ENODEV;
585 if (!node)
586 return -ENODEV;
587
588 if (deviceno >= viocd_numdev)
589 viocd_numdev = deviceno + 1;
674 590
675 d = &viocd_diskinfo[deviceno]; 591 d = &viocd_diskinfo[deviceno];
592 d->rsrcname = of_get_property(node, "linux,vio_rsrcname", NULL);
593 d->type = of_get_property(node, "linux,vio_type", NULL);
594 d->model = of_get_property(node, "linux,vio_model", NULL);
595
676 c = &d->viocd_info; 596 c = &d->viocd_info;
677 ci = &viocd_unitinfo[deviceno];
678 597
679 c->ops = &viocd_dops; 598 c->ops = &viocd_dops;
680 c->speed = 4; 599 c->speed = 4;
681 c->capacity = 1; 600 c->capacity = 1;
682 c->handle = d; 601 c->handle = d;
683 c->mask = ~find_capability(ci->type); 602 c->mask = ~find_capability(d->type);
684 sprintf(c->name, VIOCD_DEVICE "%c", 'a' + deviceno); 603 sprintf(c->name, VIOCD_DEVICE "%c", 'a' + deviceno);
685 604
686 if (register_cdrom(c) != 0) { 605 if (register_cdrom(c) != 0) {
@@ -690,7 +609,7 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
690 } 609 }
691 printk(VIOCD_KERN_INFO "cd %s is iSeries resource %10.10s " 610 printk(VIOCD_KERN_INFO "cd %s is iSeries resource %10.10s "
692 "type %4.4s, model %3.3s\n", 611 "type %4.4s, model %3.3s\n",
693 c->name, ci->rsrcname, ci->type, ci->model); 612 c->name, d->rsrcname, d->type, d->model);
694 q = blk_init_queue(do_viocd_request, &viocd_reqlock); 613 q = blk_init_queue(do_viocd_request, &viocd_reqlock);
695 if (q == NULL) { 614 if (q == NULL) {
696 printk(VIOCD_KERN_WARNING "Cannot allocate queue for %s!\n", 615 printk(VIOCD_KERN_WARNING "Cannot allocate queue for %s!\n",
@@ -799,8 +718,6 @@ static int __init viocd_init(void)
799 /* Initialize our request handler */ 718 /* Initialize our request handler */
800 vio_setHandler(viomajorsubtype_cdio, vio_handle_cd_event); 719 vio_setHandler(viomajorsubtype_cdio, vio_handle_cd_event);
801 720
802 get_viocd_info();
803
804 spin_lock_init(&viocd_reqlock); 721 spin_lock_init(&viocd_reqlock);
805 722
806 ret = vio_register_driver(&viocd_driver); 723 ret = vio_register_driver(&viocd_driver);
@@ -816,9 +733,6 @@ static int __init viocd_init(void)
816 return 0; 733 return 0;
817 734
818out_free_info: 735out_free_info:
819 dma_free_coherent(iSeries_vio_dev,
820 sizeof(*viocd_unitinfo) * VIOCD_MAX_CD,
821 viocd_unitinfo, unitinfo_dmaaddr);
822 vio_clearHandler(viomajorsubtype_cdio); 736 vio_clearHandler(viomajorsubtype_cdio);
823 viopath_close(viopath_hostLp, viomajorsubtype_cdio, MAX_CD_REQ + 2); 737 viopath_close(viopath_hostLp, viomajorsubtype_cdio, MAX_CD_REQ + 2);
824out_unregister: 738out_unregister:
@@ -830,10 +744,6 @@ static void __exit viocd_exit(void)
830{ 744{
831 remove_proc_entry("iSeries/viocd", NULL); 745 remove_proc_entry("iSeries/viocd", NULL);
832 vio_unregister_driver(&viocd_driver); 746 vio_unregister_driver(&viocd_driver);
833 if (viocd_unitinfo != NULL)
834 dma_free_coherent(iSeries_vio_dev,
835 sizeof(*viocd_unitinfo) * VIOCD_MAX_CD,
836 viocd_unitinfo, unitinfo_dmaaddr);
837 viopath_close(viopath_hostLp, viomajorsubtype_cdio, MAX_CD_REQ + 2); 747 viopath_close(viopath_hostLp, viomajorsubtype_cdio, MAX_CD_REQ + 2);
838 vio_clearHandler(viomajorsubtype_cdio); 748 vio_clearHandler(viomajorsubtype_cdio);
839 unregister_blkdev(VIOCD_MAJOR, VIOCD_DEVICE); 749 unregister_blkdev(VIOCD_MAJOR, VIOCD_DEVICE);
diff --git a/drivers/char/hvc_beat.c b/drivers/char/hvc_beat.c
index 6f019f19be71..e74bb949c289 100644
--- a/drivers/char/hvc_beat.c
+++ b/drivers/char/hvc_beat.c
@@ -97,7 +97,7 @@ static int hvc_beat_config(char *p)
97 return 0; 97 return 0;
98} 98}
99 99
100static int hvc_beat_console_init(void) 100static int __init hvc_beat_console_init(void)
101{ 101{
102 if (hvc_beat_useit && machine_is_compatible("Beat")) { 102 if (hvc_beat_useit && machine_is_compatible("Beat")) {
103 hvc_instantiate(0, 0, &hvc_beat_get_put_ops); 103 hvc_instantiate(0, 0, &hvc_beat_get_put_ops);
@@ -106,7 +106,7 @@ static int hvc_beat_console_init(void)
106} 106}
107 107
108/* temp */ 108/* temp */
109static int hvc_beat_init(void) 109static int __init hvc_beat_init(void)
110{ 110{
111 struct hvc_struct *hp; 111 struct hvc_struct *hp;
112 112
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 7901d5f218ec..a2894d425153 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2253,19 +2253,19 @@ static int __devinit ipmi_of_probe(struct of_device *dev,
2253 return ret; 2253 return ret;
2254 } 2254 }
2255 2255
2256 regsize = get_property(np, "reg-size", &proplen); 2256 regsize = of_get_property(np, "reg-size", &proplen);
2257 if (regsize && proplen != 4) { 2257 if (regsize && proplen != 4) {
2258 dev_warn(&dev->dev, PFX "invalid regsize from OF\n"); 2258 dev_warn(&dev->dev, PFX "invalid regsize from OF\n");
2259 return -EINVAL; 2259 return -EINVAL;
2260 } 2260 }
2261 2261
2262 regspacing = get_property(np, "reg-spacing", &proplen); 2262 regspacing = of_get_property(np, "reg-spacing", &proplen);
2263 if (regspacing && proplen != 4) { 2263 if (regspacing && proplen != 4) {
2264 dev_warn(&dev->dev, PFX "invalid regspacing from OF\n"); 2264 dev_warn(&dev->dev, PFX "invalid regspacing from OF\n");
2265 return -EINVAL; 2265 return -EINVAL;
2266 } 2266 }
2267 2267
2268 regshift = get_property(np, "reg-shift", &proplen); 2268 regshift = of_get_property(np, "reg-shift", &proplen);
2269 if (regshift && proplen != 4) { 2269 if (regshift && proplen != 4) {
2270 dev_warn(&dev->dev, PFX "invalid regshift from OF\n"); 2270 dev_warn(&dev->dev, PFX "invalid regshift from OF\n");
2271 return -EINVAL; 2271 return -EINVAL;
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index e12275df6ea2..f1d60f0cef8f 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -92,47 +92,6 @@ struct viot_devinfo_struct {
92#define VIOTAPOP_SETPART 14 92#define VIOTAPOP_SETPART 14
93#define VIOTAPOP_UNLOAD 15 93#define VIOTAPOP_UNLOAD 15
94 94
95struct viotapelpevent {
96 struct HvLpEvent event;
97 u32 reserved;
98 u16 version;
99 u16 sub_type_result;
100 u16 tape;
101 u16 flags;
102 u32 token;
103 u64 len;
104 union {
105 struct {
106 u32 tape_op;
107 u32 count;
108 } op;
109 struct {
110 u32 type;
111 u32 resid;
112 u32 dsreg;
113 u32 gstat;
114 u32 erreg;
115 u32 file_no;
116 u32 block_no;
117 } get_status;
118 struct {
119 u32 block_no;
120 } get_pos;
121 } u;
122};
123
124enum viotapesubtype {
125 viotapeopen = 0x0001,
126 viotapeclose = 0x0002,
127 viotaperead = 0x0003,
128 viotapewrite = 0x0004,
129 viotapegetinfo = 0x0005,
130 viotapeop = 0x0006,
131 viotapegetpos = 0x0007,
132 viotapesetpos = 0x0008,
133 viotapegetstatus = 0x0009
134};
135
136enum viotaperc { 95enum viotaperc {
137 viotape_InvalidRange = 0x0601, 96 viotape_InvalidRange = 0x0601,
138 viotape_InvalidToken = 0x0602, 97 viotape_InvalidToken = 0x0602,
@@ -223,14 +182,11 @@ static const struct vio_error_entry viotape_err_table[] = {
223#define VIOT_WRITING 2 182#define VIOT_WRITING 2
224 183
225/* Our info on the tapes */ 184/* Our info on the tapes */
226struct tape_descr { 185static struct {
227 char rsrcname[10]; 186 const char *rsrcname;
228 char type[4]; 187 const char *type;
229 char model[3]; 188 const char *model;
230}; 189} viotape_unitinfo[VIOTAPE_MAX_TAPE];
231
232static struct tape_descr *viotape_unitinfo;
233static dma_addr_t viotape_unitinfo_token;
234 190
235static struct mtget viomtget[VIOTAPE_MAX_TAPE]; 191static struct mtget viomtget[VIOTAPE_MAX_TAPE];
236 192
@@ -381,53 +337,6 @@ int tape_rc_to_errno(int tape_rc, char *operation, int tapeno)
381 return -err->errno; 337 return -err->errno;
382} 338}
383 339
384/* Get info on all tapes from OS/400 */
385static int get_viotape_info(void)
386{
387 HvLpEvent_Rc hvrc;
388 int i;
389 size_t len = sizeof(*viotape_unitinfo) * VIOTAPE_MAX_TAPE;
390 struct op_struct *op = get_op_struct();
391
392 if (op == NULL)
393 return -ENOMEM;
394
395 viotape_unitinfo = dma_alloc_coherent(iSeries_vio_dev, len,
396 &viotape_unitinfo_token, GFP_ATOMIC);
397 if (viotape_unitinfo == NULL) {
398 free_op_struct(op);
399 return -ENOMEM;
400 }
401
402 memset(viotape_unitinfo, 0, len);
403
404 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
405 HvLpEvent_Type_VirtualIo,
406 viomajorsubtype_tape | viotapegetinfo,
407 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
408 viopath_sourceinst(viopath_hostLp),
409 viopath_targetinst(viopath_hostLp),
410 (u64) (unsigned long) op, VIOVERSION << 16,
411 viotape_unitinfo_token, len, 0, 0);
412 if (hvrc != HvLpEvent_Rc_Good) {
413 printk(VIOTAPE_KERN_WARN "hv error on op %d\n",
414 (int)hvrc);
415 free_op_struct(op);
416 return -EIO;
417 }
418
419 wait_for_completion(&op->com);
420
421 free_op_struct(op);
422
423 for (i = 0;
424 ((i < VIOTAPE_MAX_TAPE) && (viotape_unitinfo[i].rsrcname[0]));
425 i++)
426 viotape_numdev++;
427 return 0;
428}
429
430
431/* Write */ 340/* Write */
432static ssize_t viotap_write(struct file *file, const char *buf, 341static ssize_t viotap_write(struct file *file, const char *buf,
433 size_t count, loff_t * ppos) 342 size_t count, loff_t * ppos)
@@ -899,7 +808,6 @@ static void vioHandleTapeEvent(struct HvLpEvent *event)
899 tapeminor = event->xSubtype & VIOMINOR_SUBTYPE_MASK; 808 tapeminor = event->xSubtype & VIOMINOR_SUBTYPE_MASK;
900 op = (struct op_struct *)event->xCorrelationToken; 809 op = (struct op_struct *)event->xCorrelationToken;
901 switch (tapeminor) { 810 switch (tapeminor) {
902 case viotapegetinfo:
903 case viotapeopen: 811 case viotapeopen:
904 case viotapeclose: 812 case viotapeclose:
905 op->rc = tevent->sub_type_result; 813 op->rc = tevent->sub_type_result;
@@ -942,11 +850,23 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
942{ 850{
943 int i = vdev->unit_address; 851 int i = vdev->unit_address;
944 int j; 852 int j;
853 struct device_node *node = vdev->dev.archdata.of_node;
945 854
946 if (i >= viotape_numdev) 855 if (i > VIOTAPE_MAX_TAPE)
856 return -ENODEV;
857 if (!node)
947 return -ENODEV; 858 return -ENODEV;
948 859
860 if (i >= viotape_numdev)
861 viotape_numdev = i + 1;
862
949 tape_device[i] = &vdev->dev; 863 tape_device[i] = &vdev->dev;
864 viotape_unitinfo[i].rsrcname = of_get_property(node,
865 "linux,vio_rsrcname", NULL);
866 viotape_unitinfo[i].type = of_get_property(node, "linux,vio_type",
867 NULL);
868 viotape_unitinfo[i].model = of_get_property(node, "linux,vio_model",
869 NULL);
950 870
951 state[i].cur_part = 0; 871 state[i].cur_part = 0;
952 for (j = 0; j < MAX_PARTITIONS; ++j) 872 for (j = 0; j < MAX_PARTITIONS; ++j)
@@ -1044,11 +964,6 @@ int __init viotap_init(void)
1044 goto unreg_chrdev; 964 goto unreg_chrdev;
1045 } 965 }
1046 966
1047 if ((ret = get_viotape_info()) < 0) {
1048 printk(VIOTAPE_KERN_WARN "Unable to obtain virtual device information");
1049 goto unreg_class;
1050 }
1051
1052 ret = vio_register_driver(&viotape_driver); 967 ret = vio_register_driver(&viotape_driver);
1053 if (ret) 968 if (ret)
1054 goto unreg_class; 969 goto unreg_class;
@@ -1102,10 +1017,6 @@ static void __exit viotap_exit(void)
1102 vio_unregister_driver(&viotape_driver); 1017 vio_unregister_driver(&viotape_driver);
1103 class_destroy(tape_class); 1018 class_destroy(tape_class);
1104 unregister_chrdev(VIOTAPE_MAJOR, "viotape"); 1019 unregister_chrdev(VIOTAPE_MAJOR, "viotape");
1105 if (viotape_unitinfo)
1106 dma_free_coherent(iSeries_vio_dev,
1107 sizeof(viotape_unitinfo[0]) * VIOTAPE_MAX_TAPE,
1108 viotape_unitinfo, viotape_unitinfo_token);
1109 viopath_close(viopath_hostLp, viomajorsubtype_tape, VIOTAPE_MAXREQ + 2); 1020 viopath_close(viopath_hostLp, viomajorsubtype_tape, VIOTAPE_MAXREQ + 2);
1110 vio_clearHandler(viomajorsubtype_tape); 1021 vio_clearHandler(viomajorsubtype_tape);
1111 clear_op_struct_pool(); 1022 clear_op_struct_pool();
diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c
index 17ef5d3c01b4..444696625171 100644
--- a/drivers/macintosh/adb-iop.c
+++ b/drivers/macintosh/adb-iop.c
@@ -19,7 +19,6 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/proc_fs.h> 20#include <linux/proc_fs.h>
21 21
22#include <asm/bootinfo.h>
23#include <asm/macintosh.h> 22#include <asm/macintosh.h>
24#include <asm/macints.h> 23#include <asm/macints.h>
25#include <asm/mac_iop.h> 24#include <asm/mac_iop.h>
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index b46817f699f1..48d17bf6c927 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -70,7 +70,7 @@ static struct notifier_block adbhid_adb_notifier = {
70#define ADB_KEY_POWER_OLD 0x7e 70#define ADB_KEY_POWER_OLD 0x7e
71#define ADB_KEY_POWER 0x7f 71#define ADB_KEY_POWER 0x7f
72 72
73u8 adb_to_linux_keycodes[128] = { 73u16 adb_to_linux_keycodes[128] = {
74 /* 0x00 */ KEY_A, /* 30 */ 74 /* 0x00 */ KEY_A, /* 30 */
75 /* 0x01 */ KEY_S, /* 31 */ 75 /* 0x01 */ KEY_S, /* 31 */
76 /* 0x02 */ KEY_D, /* 32 */ 76 /* 0x02 */ KEY_D, /* 32 */
@@ -134,7 +134,7 @@ u8 adb_to_linux_keycodes[128] = {
134 /* 0x3c */ KEY_RIGHT, /* 106 */ 134 /* 0x3c */ KEY_RIGHT, /* 106 */
135 /* 0x3d */ KEY_DOWN, /* 108 */ 135 /* 0x3d */ KEY_DOWN, /* 108 */
136 /* 0x3e */ KEY_UP, /* 103 */ 136 /* 0x3e */ KEY_UP, /* 103 */
137 /* 0x3f */ 0, 137 /* 0x3f */ KEY_FN, /* 0x1d0 */
138 /* 0x40 */ 0, 138 /* 0x40 */ 0,
139 /* 0x41 */ KEY_KPDOT, /* 83 */ 139 /* 0x41 */ KEY_KPDOT, /* 83 */
140 /* 0x42 */ 0, 140 /* 0x42 */ 0,
@@ -208,7 +208,7 @@ struct adbhid {
208 int original_handler_id; 208 int original_handler_id;
209 int current_handler_id; 209 int current_handler_id;
210 int mouse_kind; 210 int mouse_kind;
211 unsigned char *keycode; 211 u16 *keycode;
212 char name[64]; 212 char name[64];
213 char phys[32]; 213 char phys[32];
214 int flags; 214 int flags;
@@ -275,7 +275,7 @@ static void
275adbhid_input_keycode(int id, int keycode, int repeat) 275adbhid_input_keycode(int id, int keycode, int repeat)
276{ 276{
277 struct adbhid *ahid = adbhid[id]; 277 struct adbhid *ahid = adbhid[id];
278 int up_flag; 278 int up_flag, key;
279 279
280 up_flag = (keycode & 0x80); 280 up_flag = (keycode & 0x80);
281 keycode &= 0x7f; 281 keycode &= 0x7f;
@@ -321,8 +321,7 @@ adbhid_input_keycode(int id, int keycode, int repeat)
321 } 321 }
322 } else 322 } else
323 ahid->flags |= FLAG_FN_KEY_PRESSED; 323 ahid->flags |= FLAG_FN_KEY_PRESSED;
324 /* Swallow the key press */ 324 break;
325 return;
326 case ADB_KEY_DEL: 325 case ADB_KEY_DEL:
327 /* Emulate Fn+delete = forward delete */ 326 /* Emulate Fn+delete = forward delete */
328 if (ahid->flags & FLAG_FN_KEY_PRESSED) { 327 if (ahid->flags & FLAG_FN_KEY_PRESSED) {
@@ -336,9 +335,9 @@ adbhid_input_keycode(int id, int keycode, int repeat)
336#endif /* CONFIG_PPC_PMAC */ 335#endif /* CONFIG_PPC_PMAC */
337 } 336 }
338 337
339 if (adbhid[id]->keycode[keycode]) { 338 key = adbhid[id]->keycode[keycode];
340 input_report_key(adbhid[id]->input, 339 if (key) {
341 adbhid[id]->keycode[keycode], !up_flag); 340 input_report_key(adbhid[id]->input, key, !up_flag);
342 input_sync(adbhid[id]->input); 341 input_sync(adbhid[id]->input);
343 } else 342 } else
344 printk(KERN_INFO "Unhandled ADB key (scancode %#02x) %s.\n", keycode, 343 printk(KERN_INFO "Unhandled ADB key (scancode %#02x) %s.\n", keycode,
@@ -757,8 +756,8 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
757 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); 756 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP);
758 input_dev->ledbit[0] = BIT(LED_SCROLLL) | BIT(LED_CAPSL) | BIT(LED_NUML); 757 input_dev->ledbit[0] = BIT(LED_SCROLLL) | BIT(LED_CAPSL) | BIT(LED_NUML);
759 input_dev->event = adbhid_kbd_event; 758 input_dev->event = adbhid_kbd_event;
760 input_dev->keycodemax = 127; 759 input_dev->keycodemax = KEY_FN;
761 input_dev->keycodesize = 1; 760 input_dev->keycodesize = sizeof(hid->keycode[0]);
762 break; 761 break;
763 762
764 case ADB_MOUSE: 763 case ADB_MOUSE:
diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c
index e54c4d9f6365..73c50bc02095 100644
--- a/drivers/macintosh/ans-lcd.c
+++ b/drivers/macintosh/ans-lcd.c
@@ -14,9 +14,10 @@
14#include <asm/uaccess.h> 14#include <asm/uaccess.h>
15#include <asm/sections.h> 15#include <asm/sections.h>
16#include <asm/prom.h> 16#include <asm/prom.h>
17#include <asm/ans-lcd.h>
18#include <asm/io.h> 17#include <asm/io.h>
19 18
19#include "ans-lcd.h"
20
20#define ANSLCD_ADDR 0xf301c000 21#define ANSLCD_ADDR 0xf301c000
21#define ANSLCD_CTRL_IX 0x00 22#define ANSLCD_CTRL_IX 0x00
22#define ANSLCD_DATA_IX 0x10 23#define ANSLCD_DATA_IX 0x10
diff --git a/include/asm-ppc/ans-lcd.h b/drivers/macintosh/ans-lcd.h
index d795b9fd2db6..d795b9fd2db6 100644
--- a/include/asm-ppc/ans-lcd.h
+++ b/drivers/macintosh/ans-lcd.h
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index f25685b9b7cf..276945d51513 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -379,13 +379,10 @@ static int attach_one_thermostat(struct i2c_adapter *adapter, int addr,
379 if (thermostat) 379 if (thermostat)
380 return 0; 380 return 0;
381 381
382 th = (struct thermostat *) 382 th = kzalloc(sizeof(struct thermostat), GFP_KERNEL);
383 kmalloc(sizeof(struct thermostat), GFP_KERNEL);
384
385 if (!th) 383 if (!th)
386 return -ENOMEM; 384 return -ENOMEM;
387 385
388 memset(th, 0, sizeof(*th));
389 th->clt.addr = addr; 386 th->clt.addr = addr;
390 th->clt.adapter = adapter; 387 th->clt.adapter = adapter;
391 th->clt.driver = &thermostat_driver; 388 th->clt.driver = &thermostat_driver;
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 04f3973e3874..f7c509b7a8ea 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -410,7 +410,7 @@ static int __init via_pmu_start(void)
410 410
411 irq = irq_of_parse_and_map(vias, 0); 411 irq = irq_of_parse_and_map(vias, 0);
412 if (irq == NO_IRQ) { 412 if (irq == NO_IRQ) {
413 printk(KERN_ERR "via-pmu: can't map interruptn"); 413 printk(KERN_ERR "via-pmu: can't map interrupt\n");
414 return -ENODEV; 414 return -ENODEV;
415 } 415 }
416 if (request_irq(irq, via_pmu_interrupt, 0, "VIA-PMU", (void *)0)) { 416 if (request_irq(irq, via_pmu_interrupt, 0, "VIA-PMU", (void *)0)) {
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c
index 351982bcec1b..f449d775cdf4 100644
--- a/drivers/macintosh/windfarm_smu_sat.c
+++ b/drivers/macintosh/windfarm_smu_sat.c
@@ -380,10 +380,12 @@ static int __init sat_sensors_init(void)
380 return i2c_add_driver(&wf_sat_driver); 380 return i2c_add_driver(&wf_sat_driver);
381} 381}
382 382
383#if 0 /* uncomment when module_exit() below is uncommented */
383static void __exit sat_sensors_exit(void) 384static void __exit sat_sensors_exit(void)
384{ 385{
385 i2c_del_driver(&wf_sat_driver); 386 i2c_del_driver(&wf_sat_driver);
386} 387}
388#endif
387 389
388module_init(sat_sensors_init); 390module_init(sat_sensors_init);
389/*module_exit(sat_sensors_exit); Uncomment when cleanup is implemented */ 391/*module_exit(sat_sensors_exit); Uncomment when cleanup is implemented */
diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c
index 276ba3c5143f..aa8ce7abe922 100644
--- a/drivers/misc/hdpuftrs/hdpu_cpustate.c
+++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c
@@ -19,16 +19,41 @@
19#include <linux/spinlock.h> 19#include <linux/spinlock.h>
20#include <linux/miscdevice.h> 20#include <linux/miscdevice.h>
21#include <linux/proc_fs.h> 21#include <linux/proc_fs.h>
22#include <linux/hdpu_features.h>
22#include <linux/platform_device.h> 23#include <linux/platform_device.h>
23#include <asm/uaccess.h> 24#include <asm/uaccess.h>
24#include <linux/hdpu_features.h> 25#include <linux/seq_file.h>
26#include <asm/io.h>
25 27
26#define SKY_CPUSTATE_VERSION "1.1" 28#define SKY_CPUSTATE_VERSION "1.1"
27 29
28static int hdpu_cpustate_probe(struct platform_device *pdev); 30static int hdpu_cpustate_probe(struct platform_device *pdev);
29static int hdpu_cpustate_remove(struct platform_device *pdev); 31static int hdpu_cpustate_remove(struct platform_device *pdev);
30 32
31struct cpustate_t cpustate; 33static unsigned char cpustate_get_state(void);
34static int cpustate_proc_open(struct inode *inode, struct file *file);
35static int cpustate_proc_read(struct seq_file *seq, void *offset);
36
37static struct cpustate_t cpustate;
38
39static const struct file_operations proc_cpustate = {
40 .open = cpustate_proc_open,
41 .read = seq_read,
42 .llseek = seq_lseek,
43 .release = single_release,
44 .owner = THIS_MODULE,
45};
46
47static int cpustate_proc_open(struct inode *inode, struct file *file)
48{
49 return single_open(file, cpustate_proc_read, NULL);
50}
51
52static int cpustate_proc_read(struct seq_file *seq, void *offset)
53{
54 seq_printf(seq, "CPU State: %04x\n", cpustate_get_state());
55 return 0;
56}
32 57
33static int cpustate_get_ref(int excl) 58static int cpustate_get_ref(int excl)
34{ 59{
@@ -66,13 +91,13 @@ static int cpustate_free_ref(void)
66 return 0; 91 return 0;
67} 92}
68 93
69unsigned char cpustate_get_state(void) 94static unsigned char cpustate_get_state(void)
70{ 95{
71 96
72 return cpustate.cached_val; 97 return cpustate.cached_val;
73} 98}
74 99
75void cpustate_set_state(unsigned char new_state) 100static void cpustate_set_state(unsigned char new_state)
76{ 101{
77 unsigned int state = (new_state << 21); 102 unsigned int state = (new_state << 21);
78 103
@@ -134,29 +159,6 @@ static int cpustate_release(struct inode *inode, struct file *file)
134 return cpustate_free_ref(); 159 return cpustate_free_ref();
135} 160}
136 161
137/*
138 * Info exported via "/proc/sky_cpustate".
139 */
140static int cpustate_read_proc(char *page, char **start, off_t off,
141 int count, int *eof, void *data)
142{
143 char *p = page;
144 int len = 0;
145
146 p += sprintf(p, "CPU State: %04x\n", cpustate_get_state());
147 len = p - page;
148
149 if (len <= off + count)
150 *eof = 1;
151 *start = page + off;
152 len -= off;
153 if (len > count)
154 len = count;
155 if (len < 0)
156 len = 0;
157 return len;
158}
159
160static struct platform_driver hdpu_cpustate_driver = { 162static struct platform_driver hdpu_cpustate_driver = {
161 .probe = hdpu_cpustate_probe, 163 .probe = hdpu_cpustate_probe,
162 .remove = hdpu_cpustate_remove, 164 .remove = hdpu_cpustate_remove,
@@ -169,22 +171,18 @@ static struct platform_driver hdpu_cpustate_driver = {
169 * The various file operations we support. 171 * The various file operations we support.
170 */ 172 */
171static const struct file_operations cpustate_fops = { 173static const struct file_operations cpustate_fops = {
172 owner:THIS_MODULE, 174 .owner = THIS_MODULE,
173 open:cpustate_open, 175 .open = cpustate_open,
174 release:cpustate_release, 176 .release = cpustate_release,
175 read:cpustate_read, 177 .read = cpustate_read,
176 write:cpustate_write, 178 .write = cpustate_write,
177 fasync:NULL, 179 .llseek = no_llseek,
178 poll:NULL,
179 ioctl:NULL,
180 llseek:no_llseek,
181
182}; 180};
183 181
184static struct miscdevice cpustate_dev = { 182static struct miscdevice cpustate_dev = {
185 MISC_DYNAMIC_MINOR, 183 .minor = MISC_DYNAMIC_MINOR,
186 "sky_cpustate", 184 .name = "sky_cpustate",
187 &cpustate_fops 185 .fops = &cpustate_fops,
188}; 186};
189 187
190static int hdpu_cpustate_probe(struct platform_device *pdev) 188static int hdpu_cpustate_probe(struct platform_device *pdev)
@@ -194,23 +192,31 @@ static int hdpu_cpustate_probe(struct platform_device *pdev)
194 int ret; 192 int ret;
195 193
196 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 194 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
195 if (!res) {
196 printk(KERN_ERR "sky_cpustate: "
197 "Invalid memory resource.\n");
198 return -EINVAL;
199 }
197 cpustate.set_addr = (unsigned long *)res->start; 200 cpustate.set_addr = (unsigned long *)res->start;
198 cpustate.clr_addr = (unsigned long *)res->end - 1; 201 cpustate.clr_addr = (unsigned long *)res->end - 1;
199 202
200 ret = misc_register(&cpustate_dev); 203 ret = misc_register(&cpustate_dev);
201 if (ret) { 204 if (ret) {
202 printk(KERN_WARNING "sky_cpustate: Unable to register misc " 205 printk(KERN_WARNING "sky_cpustate: "
203 "device.\n"); 206 "Unable to register misc device.\n");
204 cpustate.set_addr = NULL; 207 cpustate.set_addr = NULL;
205 cpustate.clr_addr = NULL; 208 cpustate.clr_addr = NULL;
206 return ret; 209 return ret;
207 } 210 }
208 211
209 proc_de = create_proc_read_entry("sky_cpustate", 0, 0, 212 proc_de = create_proc_entry("sky_cpustate", 0666, &proc_root);
210 cpustate_read_proc, NULL); 213 if (!proc_de) {
211 if (proc_de == NULL) 214 printk(KERN_WARNING "sky_cpustate: "
212 printk(KERN_WARNING "sky_cpustate: Unable to create proc " 215 "Unable to create proc entry\n");
213 "dir entry\n"); 216 } else {
217 proc_de->proc_fops = &proc_cpustate;
218 proc_de->owner = THIS_MODULE;
219 }
214 220
215 printk(KERN_INFO "Sky CPU State Driver v" SKY_CPUSTATE_VERSION "\n"); 221 printk(KERN_INFO "Sky CPU State Driver v" SKY_CPUSTATE_VERSION "\n");
216 return 0; 222 return 0;
@@ -218,21 +224,18 @@ static int hdpu_cpustate_probe(struct platform_device *pdev)
218 224
219static int hdpu_cpustate_remove(struct platform_device *pdev) 225static int hdpu_cpustate_remove(struct platform_device *pdev)
220{ 226{
221
222 cpustate.set_addr = NULL; 227 cpustate.set_addr = NULL;
223 cpustate.clr_addr = NULL; 228 cpustate.clr_addr = NULL;
224 229
225 remove_proc_entry("sky_cpustate", NULL); 230 remove_proc_entry("sky_cpustate", NULL);
226 misc_deregister(&cpustate_dev); 231 misc_deregister(&cpustate_dev);
227 return 0;
228 232
233 return 0;
229} 234}
230 235
231static int __init cpustate_init(void) 236static int __init cpustate_init(void)
232{ 237{
233 int rc; 238 return platform_driver_register(&hdpu_cpustate_driver);
234 rc = platform_driver_register(&hdpu_cpustate_driver);
235 return rc;
236} 239}
237 240
238static void __exit cpustate_exit(void) 241static void __exit cpustate_exit(void)
diff --git a/drivers/misc/hdpuftrs/hdpu_nexus.c b/drivers/misc/hdpuftrs/hdpu_nexus.c
index 60c8b26f0678..2887b2147980 100644
--- a/drivers/misc/hdpuftrs/hdpu_nexus.c
+++ b/drivers/misc/hdpuftrs/hdpu_nexus.c
@@ -18,17 +18,38 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/proc_fs.h> 19#include <linux/proc_fs.h>
20#include <linux/hdpu_features.h> 20#include <linux/hdpu_features.h>
21
22#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/seq_file.h>
23#include <asm/io.h>
23 24
24static int hdpu_nexus_probe(struct platform_device *pdev); 25static int hdpu_nexus_probe(struct platform_device *pdev);
25static int hdpu_nexus_remove(struct platform_device *pdev); 26static int hdpu_nexus_remove(struct platform_device *pdev);
27static int hdpu_slot_id_open(struct inode *inode, struct file *file);
28static int hdpu_slot_id_read(struct seq_file *seq, void *offset);
29static int hdpu_chassis_id_open(struct inode *inode, struct file *file);
30static int hdpu_chassis_id_read(struct seq_file *seq, void *offset);
26 31
27static struct proc_dir_entry *hdpu_slot_id; 32static struct proc_dir_entry *hdpu_slot_id;
28static struct proc_dir_entry *hdpu_chassis_id; 33static struct proc_dir_entry *hdpu_chassis_id;
29static int slot_id = -1; 34static int slot_id = -1;
30static int chassis_id = -1; 35static int chassis_id = -1;
31 36
37static const struct file_operations proc_slot_id = {
38 .open = hdpu_slot_id_open,
39 .read = seq_read,
40 .llseek = seq_lseek,
41 .release = single_release,
42 .owner = THIS_MODULE,
43};
44
45static const struct file_operations proc_chassis_id = {
46 .open = hdpu_chassis_id_open,
47 .read = seq_read,
48 .llseek = seq_lseek,
49 .release = single_release,
50 .owner = THIS_MODULE,
51};
52
32static struct platform_driver hdpu_nexus_driver = { 53static struct platform_driver hdpu_nexus_driver = {
33 .probe = hdpu_nexus_probe, 54 .probe = hdpu_nexus_probe,
34 .remove = hdpu_nexus_remove, 55 .remove = hdpu_nexus_remove,
@@ -37,43 +58,67 @@ static struct platform_driver hdpu_nexus_driver = {
37 }, 58 },
38}; 59};
39 60
40int hdpu_slot_id_read(char *buffer, char **buffer_location, off_t offset, 61static int hdpu_slot_id_open(struct inode *inode, struct file *file)
41 int buffer_length, int *zero, void *ptr)
42{ 62{
63 return single_open(file, hdpu_slot_id_read, NULL);
64}
43 65
44 if (offset > 0) 66static int hdpu_slot_id_read(struct seq_file *seq, void *offset)
45 return 0; 67{
46 return sprintf(buffer, "%d\n", slot_id); 68 seq_printf(seq, "%d\n", slot_id);
69 return 0;
47} 70}
48 71
49int hdpu_chassis_id_read(char *buffer, char **buffer_location, off_t offset, 72static int hdpu_chassis_id_open(struct inode *inode, struct file *file)
50 int buffer_length, int *zero, void *ptr)
51{ 73{
74 return single_open(file, hdpu_chassis_id_read, NULL);
75}
52 76
53 if (offset > 0) 77static int hdpu_chassis_id_read(struct seq_file *seq, void *offset)
54 return 0; 78{
55 return sprintf(buffer, "%d\n", chassis_id); 79 seq_printf(seq, "%d\n", chassis_id);
80 return 0;
56} 81}
57 82
58static int hdpu_nexus_probe(struct platform_device *pdev) 83static int hdpu_nexus_probe(struct platform_device *pdev)
59{ 84{
60 struct resource *res; 85 struct resource *res;
86 int *nexus_id_addr;
61 87
62 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 88 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
63 int *nexus_id_addr; 89 if (!res) {
64 nexus_id_addr = 90 printk(KERN_ERR "sky_nexus: "
65 ioremap(res->start, (unsigned long)(res->end - res->start)); 91 "Invalid memory resource.\n");
92 return -EINVAL;
93 }
94 nexus_id_addr = ioremap(res->start,
95 (unsigned long)(res->end - res->start));
66 if (nexus_id_addr) { 96 if (nexus_id_addr) {
67 slot_id = (*nexus_id_addr >> 8) & 0x1f; 97 slot_id = (*nexus_id_addr >> 8) & 0x1f;
68 chassis_id = *nexus_id_addr & 0xff; 98 chassis_id = *nexus_id_addr & 0xff;
69 iounmap(nexus_id_addr); 99 iounmap(nexus_id_addr);
70 } else 100 } else {
71 printk("Could not map slot id\n"); 101 printk(KERN_ERR "sky_nexus: Could not map slot id\n");
102 }
103
72 hdpu_slot_id = create_proc_entry("sky_slot_id", 0666, &proc_root); 104 hdpu_slot_id = create_proc_entry("sky_slot_id", 0666, &proc_root);
73 hdpu_slot_id->read_proc = hdpu_slot_id_read; 105 if (!hdpu_slot_id) {
106 printk(KERN_WARNING "sky_nexus: "
107 "Unable to create proc dir entry: sky_slot_id\n");
108 } else {
109 hdpu_slot_id->proc_fops = &proc_slot_id;
110 hdpu_slot_id->owner = THIS_MODULE;
111 }
74 112
75 hdpu_chassis_id = create_proc_entry("sky_chassis_id", 0666, &proc_root); 113 hdpu_chassis_id = create_proc_entry("sky_chassis_id", 0666, &proc_root);
76 hdpu_chassis_id->read_proc = hdpu_chassis_id_read; 114 if (!hdpu_chassis_id) {
115 printk(KERN_WARNING "sky_nexus: "
116 "Unable to create proc dir entry: sky_chassis_id\n");
117 } else {
118 hdpu_chassis_id->proc_fops = &proc_chassis_id;
119 hdpu_chassis_id->owner = THIS_MODULE;
120 }
121
77 return 0; 122 return 0;
78} 123}
79 124
@@ -81,18 +126,19 @@ static int hdpu_nexus_remove(struct platform_device *pdev)
81{ 126{
82 slot_id = -1; 127 slot_id = -1;
83 chassis_id = -1; 128 chassis_id = -1;
129
84 remove_proc_entry("sky_slot_id", &proc_root); 130 remove_proc_entry("sky_slot_id", &proc_root);
85 remove_proc_entry("sky_chassis_id", &proc_root); 131 remove_proc_entry("sky_chassis_id", &proc_root);
132
86 hdpu_slot_id = 0; 133 hdpu_slot_id = 0;
87 hdpu_chassis_id = 0; 134 hdpu_chassis_id = 0;
135
88 return 0; 136 return 0;
89} 137}
90 138
91static int __init nexus_init(void) 139static int __init nexus_init(void)
92{ 140{
93 int rc; 141 return platform_driver_register(&hdpu_nexus_driver);
94 rc = platform_driver_register(&hdpu_nexus_driver);
95 return rc;
96} 142}
97 143
98static void __exit nexus_exit(void) 144static void __exit nexus_exit(void)
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig
index cc6c73442435..6cd132c75187 100644
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -362,7 +362,7 @@ config MTD_WALNUT
362 362
363config MTD_EBONY 363config MTD_EBONY
364 tristate "Flash devices mapped on IBM 440GP Ebony" 364 tristate "Flash devices mapped on IBM 440GP Ebony"
365 depends on MTD_JEDECPROBE && EBONY 365 depends on MTD_JEDECPROBE && EBONY && !PPC_MERGE
366 help 366 help
367 This enables access routines for the flash chips on the IBM 440GP 367 This enables access routines for the flash chips on the IBM 440GP
368 Ebony board. If you have one of these boards and would like to 368 Ebony board. If you have one of these boards and would like to
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index bbb42c35b69b..cf75a566442e 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -1,9 +1,12 @@
1/* 1/*
2 * Normal mappings of chips in physical memory for OF devices 2 * Flash mappings described by the OF (or flattened) device tree
3 * 3 *
4 * Copyright (C) 2006 MontaVista Software Inc. 4 * Copyright (C) 2006 MontaVista Software Inc.
5 * Author: Vitaly Wool <vwool@ru.mvista.com> 5 * Author: Vitaly Wool <vwool@ru.mvista.com>
6 * 6 *
7 * Revised to handle newer style flash binding by:
8 * Copyright (C) 2007 David Gibson, IBM Corporation.
9 *
7 * This program is free software; you can redistribute it and/or modify it 10 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the 11 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your 12 * Free Software Foundation; either version 2 of the License, or (at your
@@ -12,102 +15,157 @@
12 15
13#include <linux/module.h> 16#include <linux/module.h>
14#include <linux/types.h> 17#include <linux/types.h>
15#include <linux/kernel.h>
16#include <linux/init.h> 18#include <linux/init.h>
17#include <linux/slab.h>
18#include <linux/device.h> 19#include <linux/device.h>
19#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
20#include <linux/mtd/map.h> 21#include <linux/mtd/map.h>
21#include <linux/mtd/partitions.h> 22#include <linux/mtd/partitions.h>
22#include <linux/mtd/physmap.h> 23#include <linux/of.h>
23#include <asm/io.h> 24#include <linux/of_platform.h>
24#include <asm/prom.h>
25#include <asm/of_device.h>
26#include <asm/of_platform.h>
27 25
28struct physmap_flash_info { 26struct of_flash {
29 struct mtd_info *mtd; 27 struct mtd_info *mtd;
30 struct map_info map; 28 struct map_info map;
31 struct resource *res; 29 struct resource *res;
32#ifdef CONFIG_MTD_PARTITIONS 30#ifdef CONFIG_MTD_PARTITIONS
33 int nr_parts;
34 struct mtd_partition *parts; 31 struct mtd_partition *parts;
35#endif 32#endif
36}; 33};
37 34
38static const char *rom_probe_types[] = { "cfi_probe", "jedec_probe", "map_rom", NULL };
39#ifdef CONFIG_MTD_PARTITIONS 35#ifdef CONFIG_MTD_PARTITIONS
40static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; 36#define OF_FLASH_PARTS(info) ((info)->parts)
41#endif
42 37
43#ifdef CONFIG_MTD_PARTITIONS 38static int parse_obsolete_partitions(struct of_device *dev,
44static int parse_flash_partitions(struct device_node *node, 39 struct of_flash *info,
45 struct mtd_partition **parts) 40 struct device_node *dp)
46{ 41{
47 int i, plen, retval = -ENOMEM; 42 int i, plen, nr_parts;
48 const u32 *part; 43 const struct {
49 const char *name; 44 u32 offset, len;
50 45 } *part;
51 part = of_get_property(node, "partitions", &plen); 46 const char *names;
52 if (part == NULL) 47
53 goto err; 48 part = of_get_property(dp, "partitions", &plen);
54 49 if (!part)
55 retval = plen / (2 * sizeof(u32)); 50 return 0; /* No partitions found */
56 *parts = kzalloc(retval * sizeof(struct mtd_partition), GFP_KERNEL); 51
57 if (*parts == NULL) { 52 dev_warn(&dev->dev, "Device tree uses obsolete partition map binding\n");
58 printk(KERN_ERR "Can't allocate the flash partition data!\n"); 53
59 goto err; 54 nr_parts = plen / sizeof(part[0]);
60 } 55
56 info->parts = kzalloc(nr_parts * sizeof(*info->parts), GFP_KERNEL);
57 if (!info->parts)
58 return -ENOMEM;
61 59
62 name = of_get_property(node, "partition-names", &plen); 60 names = of_get_property(dp, "partition-names", &plen);
63 61
64 for (i = 0; i < retval; i++) { 62 for (i = 0; i < nr_parts; i++) {
65 (*parts)[i].offset = *part++; 63 info->parts[i].offset = part->offset;
66 (*parts)[i].size = *part & ~1; 64 info->parts[i].size = part->len & ~1;
67 if (*part++ & 1) /* bit 0 set signifies read only partition */ 65 if (part->len & 1) /* bit 0 set signifies read only partition */
68 (*parts)[i].mask_flags = MTD_WRITEABLE; 66 info->parts[i].mask_flags = MTD_WRITEABLE;
69 67
70 if (name != NULL && plen > 0) { 68 if (names && (plen > 0)) {
71 int len = strlen(name) + 1; 69 int len = strlen(names) + 1;
72 70
73 (*parts)[i].name = (char *)name; 71 info->parts[i].name = (char *)names;
74 plen -= len; 72 plen -= len;
75 name += len; 73 names += len;
76 } else 74 } else {
77 (*parts)[i].name = "unnamed"; 75 info->parts[i].name = "unnamed";
76 }
77
78 part++;
78 } 79 }
79err: 80
80 return retval; 81 return nr_parts;
81} 82}
82#endif
83 83
84static int of_physmap_remove(struct of_device *dev) 84static int __devinit parse_partitions(struct of_flash *info,
85 struct of_device *dev)
86{
87 const char *partname;
88 static const char *part_probe_types[]
89 = { "cmdlinepart", "RedBoot", NULL };
90 struct device_node *dp = dev->node, *pp;
91 int nr_parts, i;
92
93 /* First look for RedBoot table or partitions on the command
94 * line, these take precedence over device tree information */
95 nr_parts = parse_mtd_partitions(info->mtd, part_probe_types,
96 &info->parts, 0);
97 if (nr_parts > 0) {
98 add_mtd_partitions(info->mtd, info->parts, nr_parts);
99 return 0;
100 }
101
102 /* First count the subnodes */
103 nr_parts = 0;
104 for (pp = dp->child; pp; pp = pp->sibling)
105 nr_parts++;
106
107 if (nr_parts == 0)
108 return parse_obsolete_partitions(dev, info, dp);
109
110 info->parts = kzalloc(nr_parts * sizeof(*info->parts),
111 GFP_KERNEL);
112 if (!info->parts)
113 return -ENOMEM;
114
115 for (pp = dp->child, i = 0; pp; pp = pp->sibling, i++) {
116 const u32 *reg;
117 int len;
118
119 reg = of_get_property(pp, "reg", &len);
120 if (!reg || (len != 2*sizeof(u32))) {
121 dev_err(&dev->dev, "Invalid 'reg' on %s\n",
122 dp->full_name);
123 kfree(info->parts);
124 info->parts = NULL;
125 return -EINVAL;
126 }
127 info->parts[i].offset = reg[0];
128 info->parts[i].size = reg[1];
129
130 partname = of_get_property(pp, "label", &len);
131 if (!partname)
132 partname = of_get_property(pp, "name", &len);
133 info->parts[i].name = (char *)partname;
134
135 if (of_get_property(pp, "read-only", &len))
136 info->parts[i].mask_flags = MTD_WRITEABLE;
137 }
138
139 return nr_parts;
140}
141#else /* MTD_PARTITIONS */
142#define OF_FLASH_PARTS(info) (0)
143#define parse_partitions(info, dev) (0)
144#endif /* MTD_PARTITIONS */
145
146static int of_flash_remove(struct of_device *dev)
85{ 147{
86 struct physmap_flash_info *info; 148 struct of_flash *info;
87 149
88 info = dev_get_drvdata(&dev->dev); 150 info = dev_get_drvdata(&dev->dev);
89 if (info == NULL) 151 if (!info)
90 return 0; 152 return 0;
91 dev_set_drvdata(&dev->dev, NULL); 153 dev_set_drvdata(&dev->dev, NULL);
92 154
93 if (info->mtd != NULL) { 155 if (info->mtd) {
94#ifdef CONFIG_MTD_PARTITIONS 156 if (OF_FLASH_PARTS(info)) {
95 if (info->nr_parts) {
96 del_mtd_partitions(info->mtd); 157 del_mtd_partitions(info->mtd);
97 kfree(info->parts); 158 kfree(OF_FLASH_PARTS(info));
98 } else { 159 } else {
99 del_mtd_device(info->mtd); 160 del_mtd_device(info->mtd);
100 } 161 }
101#else
102 del_mtd_device(info->mtd);
103#endif
104 map_destroy(info->mtd); 162 map_destroy(info->mtd);
105 } 163 }
106 164
107 if (info->map.virt != NULL) 165 if (info->map.virt)
108 iounmap(info->map.virt); 166 iounmap(info->map.virt);
109 167
110 if (info->res != NULL) { 168 if (info->res) {
111 release_resource(info->res); 169 release_resource(info->res);
112 kfree(info->res); 170 kfree(info->res);
113 } 171 }
@@ -115,48 +173,79 @@ static int of_physmap_remove(struct of_device *dev)
115 return 0; 173 return 0;
116} 174}
117 175
118static int __devinit of_physmap_probe(struct of_device *dev, const struct of_device_id *match) 176/* Helper function to handle probing of the obsolete "direct-mapped"
177 * compatible binding, which has an extra "probe-type" property
178 * describing the type of flash probe necessary. */
179static struct mtd_info * __devinit obsolete_probe(struct of_device *dev,
180 struct map_info *map)
119{ 181{
120 struct device_node *dp = dev->node; 182 struct device_node *dp = dev->node;
121 struct resource res;
122 struct physmap_flash_info *info;
123 const char **probe_type;
124 const char *of_probe; 183 const char *of_probe;
184 struct mtd_info *mtd;
185 static const char *rom_probe_types[]
186 = { "cfi_probe", "jedec_probe", "map_rom"};
187 int i;
188
189 dev_warn(&dev->dev, "Device tree uses obsolete \"direct-mapped\" "
190 "flash binding\n");
191
192 of_probe = of_get_property(dp, "probe-type", NULL);
193 if (!of_probe) {
194 for (i = 0; i < ARRAY_SIZE(rom_probe_types); i++) {
195 mtd = do_map_probe(rom_probe_types[i], map);
196 if (mtd)
197 return mtd;
198 }
199 return NULL;
200 } else if (strcmp(of_probe, "CFI") == 0) {
201 return do_map_probe("cfi_probe", map);
202 } else if (strcmp(of_probe, "JEDEC") == 0) {
203 return do_map_probe("jedec_probe", map);
204 } else {
205 if (strcmp(of_probe, "ROM") != 0)
206 dev_warn(&dev->dev, "obsolete_probe: don't know probe "
207 "type '%s', mapping as rom\n", of_probe);
208 return do_map_probe("mtd_rom", map);
209 }
210}
211
212static int __devinit of_flash_probe(struct of_device *dev,
213 const struct of_device_id *match)
214{
215 struct device_node *dp = dev->node;
216 struct resource res;
217 struct of_flash *info;
218 const char *probe_type = match->data;
125 const u32 *width; 219 const u32 *width;
126 int err; 220 int err;
127 221
128 222 err = -ENXIO;
129 if (of_address_to_resource(dp, 0, &res)) { 223 if (of_address_to_resource(dp, 0, &res)) {
130 dev_err(&dev->dev, "Can't get the flash mapping!\n"); 224 dev_err(&dev->dev, "Can't get IO address from device tree\n");
131 err = -EINVAL;
132 goto err_out; 225 goto err_out;
133 } 226 }
134 227
135 dev_dbg(&dev->dev, "physmap flash device: %.8llx at %.8llx\n", 228 dev_dbg(&dev->dev, "of_flash device: %.8llx-%.8llx\n",
136 (unsigned long long)res.end - res.start + 1, 229 (unsigned long long)res.start, (unsigned long long)res.end);
137 (unsigned long long)res.start);
138 230
139 info = kzalloc(sizeof(struct physmap_flash_info), GFP_KERNEL); 231 err = -ENOMEM;
140 if (info == NULL) { 232 info = kzalloc(sizeof(*info), GFP_KERNEL);
141 err = -ENOMEM; 233 if (!info)
142 goto err_out; 234 goto err_out;
143 }
144 memset(info, 0, sizeof(*info)); 235 memset(info, 0, sizeof(*info));
145 236
146 dev_set_drvdata(&dev->dev, info); 237 dev_set_drvdata(&dev->dev, info);
147 238
239 err = -EBUSY;
148 info->res = request_mem_region(res.start, res.end - res.start + 1, 240 info->res = request_mem_region(res.start, res.end - res.start + 1,
149 dev->dev.bus_id); 241 dev->dev.bus_id);
150 if (info->res == NULL) { 242 if (!info->res)
151 dev_err(&dev->dev, "Could not reserve memory region\n");
152 err = -ENOMEM;
153 goto err_out; 243 goto err_out;
154 }
155 244
245 err = -ENXIO;
156 width = of_get_property(dp, "bank-width", NULL); 246 width = of_get_property(dp, "bank-width", NULL);
157 if (width == NULL) { 247 if (!width) {
158 dev_err(&dev->dev, "Can't get the flash bank width!\n"); 248 dev_err(&dev->dev, "Can't get bank width from device tree\n");
159 err = -EINVAL;
160 goto err_out; 249 goto err_out;
161 } 250 }
162 251
@@ -165,91 +254,87 @@ static int __devinit of_physmap_probe(struct of_device *dev, const struct of_dev
165 info->map.size = res.end - res.start + 1; 254 info->map.size = res.end - res.start + 1;
166 info->map.bankwidth = *width; 255 info->map.bankwidth = *width;
167 256
257 err = -ENOMEM;
168 info->map.virt = ioremap(info->map.phys, info->map.size); 258 info->map.virt = ioremap(info->map.phys, info->map.size);
169 if (info->map.virt == NULL) { 259 if (!info->map.virt) {
170 dev_err(&dev->dev, "Failed to ioremap flash region\n"); 260 dev_err(&dev->dev, "Failed to ioremap() flash region\n");
171 err = EIO;
172 goto err_out; 261 goto err_out;
173 } 262 }
174 263
175 simple_map_init(&info->map); 264 simple_map_init(&info->map);
176 265
177 of_probe = of_get_property(dp, "probe-type", NULL); 266 if (probe_type)
178 if (of_probe == NULL) { 267 info->mtd = do_map_probe(probe_type, &info->map);
179 probe_type = rom_probe_types; 268 else
180 for (; info->mtd == NULL && *probe_type != NULL; probe_type++) 269 info->mtd = obsolete_probe(dev, &info->map);
181 info->mtd = do_map_probe(*probe_type, &info->map); 270
182 } else if (!strcmp(of_probe, "CFI")) 271 err = -ENXIO;
183 info->mtd = do_map_probe("cfi_probe", &info->map); 272 if (!info->mtd) {
184 else if (!strcmp(of_probe, "JEDEC")) 273 dev_err(&dev->dev, "do_map_probe() failed\n");
185 info->mtd = do_map_probe("jedec_probe", &info->map);
186 else {
187 if (strcmp(of_probe, "ROM"))
188 dev_dbg(&dev->dev, "map_probe: don't know probe type "
189 "'%s', mapping as rom\n", of_probe);
190 info->mtd = do_map_probe("mtd_rom", &info->map);
191 }
192 if (info->mtd == NULL) {
193 dev_err(&dev->dev, "map_probe failed\n");
194 err = -ENXIO;
195 goto err_out; 274 goto err_out;
196 } 275 }
197 info->mtd->owner = THIS_MODULE; 276 info->mtd->owner = THIS_MODULE;
198 277
199#ifdef CONFIG_MTD_PARTITIONS 278 err = parse_partitions(info, dev);
200 err = parse_mtd_partitions(info->mtd, part_probe_types, &info->parts, 0); 279 if (err < 0)
201 if (err > 0) { 280 goto err_out;
202 add_mtd_partitions(info->mtd, info->parts, err); 281
203 } else if ((err = parse_flash_partitions(dp, &info->parts)) > 0) { 282 if (err > 0)
204 dev_info(&dev->dev, "Using OF partition information\n"); 283 add_mtd_partitions(info->mtd, OF_FLASH_PARTS(info), err);
205 add_mtd_partitions(info->mtd, info->parts, err); 284 else
206 info->nr_parts = err; 285 add_mtd_device(info->mtd);
207 } else
208#endif
209 286
210 add_mtd_device(info->mtd);
211 return 0; 287 return 0;
212 288
213err_out: 289err_out:
214 of_physmap_remove(dev); 290 of_flash_remove(dev);
215 return err; 291 return err;
216
217 return 0;
218
219
220} 292}
221 293
222static struct of_device_id of_physmap_match[] = { 294static struct of_device_id of_flash_match[] = {
295 {
296 .compatible = "cfi-flash",
297 .data = (void *)"cfi_probe",
298 },
299 {
300 /* FIXME: JEDEC chips can't be safely and reliably
301 * probed, although the mtd code gets it right in
302 * practice most of the time. We should use the
303 * vendor and device ids specified by the binding to
304 * bypass the heuristic probe code, but the mtd layer
305 * provides, at present, no interface for doing so
306 * :(. */
307 .compatible = "jedec-flash",
308 .data = (void *)"jedec_probe",
309 },
223 { 310 {
224 .type = "rom", 311 .type = "rom",
225 .compatible = "direct-mapped" 312 .compatible = "direct-mapped"
226 }, 313 },
227 { }, 314 { },
228}; 315};
316MODULE_DEVICE_TABLE(of, of_flash_match);
229 317
230MODULE_DEVICE_TABLE(of, of_physmap_match); 318static struct of_platform_driver of_flash_driver = {
231 319 .name = "of-flash",
232 320 .match_table = of_flash_match,
233static struct of_platform_driver of_physmap_flash_driver = { 321 .probe = of_flash_probe,
234 .name = "physmap-flash", 322 .remove = of_flash_remove,
235 .match_table = of_physmap_match,
236 .probe = of_physmap_probe,
237 .remove = of_physmap_remove,
238}; 323};
239 324
240static int __init of_physmap_init(void) 325static int __init of_flash_init(void)
241{ 326{
242 return of_register_platform_driver(&of_physmap_flash_driver); 327 return of_register_platform_driver(&of_flash_driver);
243} 328}
244 329
245static void __exit of_physmap_exit(void) 330static void __exit of_flash_exit(void)
246{ 331{
247 of_unregister_platform_driver(&of_physmap_flash_driver); 332 of_unregister_platform_driver(&of_flash_driver);
248} 333}
249 334
250module_init(of_physmap_init); 335module_init(of_flash_init);
251module_exit(of_physmap_exit); 336module_exit(of_flash_exit);
252 337
253MODULE_LICENSE("GPL"); 338MODULE_LICENSE("GPL");
254MODULE_AUTHOR("Vitaly Wool <vwool@ru.mvista.com>"); 339MODULE_AUTHOR("Vitaly Wool <vwool@ru.mvista.com>");
255MODULE_DESCRIPTION("Configurable MTD map driver for OF"); 340MODULE_DESCRIPTION("Device tree based MTD map driver");
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 9667dac383f0..d00e7d41f6a5 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -2919,7 +2919,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
2919 test = in_be16(&ugeth->p_tx_glbl_pram->temoder); 2919 test = in_be16(&ugeth->p_tx_glbl_pram->temoder);
2920 2920
2921 /* Function code register value to be used later */ 2921 /* Function code register value to be used later */
2922 function_code = QE_BMR_BYTE_ORDER_BO_MOT | UCC_FAST_FUNCTION_CODE_GBL; 2922 function_code = UCC_BMR_BO_BE | UCC_BMR_GBL;
2923 /* Required for QE */ 2923 /* Required for QE */
2924 2924
2925 /* function code register */ 2925 /* function code register */
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h
index aaeb94877987..4fb95b3af948 100644
--- a/drivers/net/ucc_geth.h
+++ b/drivers/net/ucc_geth.h
@@ -44,6 +44,7 @@
44 44
45struct ucc_geth { 45struct ucc_geth {
46 struct ucc_fast uccf; 46 struct ucc_fast uccf;
47 u8 res0[0x100 - sizeof(struct ucc_fast)];
47 48
48 u32 maccfg1; /* mac configuration reg. 1 */ 49 u32 maccfg1; /* mac configuration reg. 1 */
49 u32 maccfg2; /* mac configuration reg. 2 */ 50 u32 maccfg2; /* mac configuration reg. 2 */
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
index 6c257b88ce51..df884f0ad8e5 100644
--- a/drivers/net/ucc_geth_mii.c
+++ b/drivers/net/ucc_geth_mii.c
@@ -32,7 +32,6 @@
32#include <linux/mm.h> 32#include <linux/mm.h>
33#include <linux/module.h> 33#include <linux/module.h>
34#include <linux/platform_device.h> 34#include <linux/platform_device.h>
35#include <asm/ocp.h>
36#include <linux/crc32.h> 35#include <linux/crc32.h>
37#include <linux/mii.h> 36#include <linux/mii.h>
38#include <linux/phy.h> 37#include <linux/phy.h>
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 81b52b7cca21..d6ae38e55d01 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -986,6 +986,31 @@ config SERIAL_PMACZILOG
986 PowerMac machines. 986 PowerMac machines.
987 Say Y or M if you want to be able to these serial ports. 987 Say Y or M if you want to be able to these serial ports.
988 988
989config SERIAL_PMACZILOG_TTYS
990 bool "Use ttySn device nodes for Zilog z85c30"
991 depends on SERIAL_PMACZILOG
992 help
993 The pmac_zilog driver for the z85C30 chip on many powermacs
994 historically used the device numbers for /dev/ttySn. The
995 8250 serial port driver also uses these numbers, which means
996 the two drivers being unable to coexist; you could not use
997 both z85C30 and 8250 type ports at the same time.
998
999 If this option is not selected, the pmac_zilog driver will
1000 use the device numbers allocated for /dev/ttyPZn. This allows
1001 the pmac_zilog and 8250 drivers to co-exist, but may cause
1002 existing userspace setups to break. Programs that need to
1003 access the built-in serial ports on powermacs will need to
1004 be reconfigured to use /dev/ttyPZn instead of /dev/ttySn.
1005
1006 If you enable this option, any z85c30 ports in the system will
1007 be registered as ttyS0 onwards as in the past, and you will be
1008 unable to use the 8250 module for PCMCIA or other 16C550-style
1009 UARTs.
1010
1011 Say N unless you need the z85c30 ports on your powermac
1012 to appear as /dev/ttySn.
1013
989config SERIAL_PMACZILOG_CONSOLE 1014config SERIAL_PMACZILOG_CONSOLE
990 bool "Console on PowerMac z85c30 serial port" 1015 bool "Console on PowerMac z85c30 serial port"
991 depends on SERIAL_PMACZILOG=y 1016 depends on SERIAL_PMACZILOG=y
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h
index a8f894c78194..32b9737759c4 100644
--- a/drivers/serial/cpm_uart/cpm_uart.h
+++ b/drivers/serial/cpm_uart/cpm_uart.h
@@ -56,21 +56,21 @@ struct uart_cpm_port {
56 u16 rx_fifosize; 56 u16 rx_fifosize;
57 u16 tx_nrfifos; 57 u16 tx_nrfifos;
58 u16 tx_fifosize; 58 u16 tx_fifosize;
59 smc_t *smcp; 59 smc_t __iomem *smcp;
60 smc_uart_t *smcup; 60 smc_uart_t __iomem *smcup;
61 scc_t *sccp; 61 scc_t __iomem *sccp;
62 scc_uart_t *sccup; 62 scc_uart_t __iomem *sccup;
63 volatile cbd_t *rx_bd_base; 63 cbd_t __iomem *rx_bd_base;
64 volatile cbd_t *rx_cur; 64 cbd_t __iomem *rx_cur;
65 volatile cbd_t *tx_bd_base; 65 cbd_t __iomem *tx_bd_base;
66 volatile cbd_t *tx_cur; 66 cbd_t __iomem *tx_cur;
67 unsigned char *tx_buf; 67 unsigned char *tx_buf;
68 unsigned char *rx_buf; 68 unsigned char *rx_buf;
69 u32 flags; 69 u32 flags;
70 void (*set_lineif)(struct uart_cpm_port *); 70 void (*set_lineif)(struct uart_cpm_port *);
71 u8 brg; 71 u8 brg;
72 uint dp_addr; 72 uint dp_addr;
73 void *mem_addr; 73 void *mem_addr;
74 dma_addr_t dma_addr; 74 dma_addr_t dma_addr;
75 u32 mem_size; 75 u32 mem_size;
76 /* helpers */ 76 /* helpers */
@@ -80,14 +80,18 @@ struct uart_cpm_port {
80 int is_portb; 80 int is_portb;
81 /* wait on close if needed */ 81 /* wait on close if needed */
82 int wait_closing; 82 int wait_closing;
83 /* value to combine with opcode to form cpm command */
84 u32 command;
83}; 85};
84 86
87#ifndef CONFIG_PPC_CPM_NEW_BINDING
85extern int cpm_uart_port_map[UART_NR]; 88extern int cpm_uart_port_map[UART_NR];
89#endif
86extern int cpm_uart_nr; 90extern int cpm_uart_nr;
87extern struct uart_cpm_port cpm_uart_ports[UART_NR]; 91extern struct uart_cpm_port cpm_uart_ports[UART_NR];
88 92
89/* these are located in their respective files */ 93/* these are located in their respective files */
90void cpm_line_cr_cmd(int line, int cmd); 94void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd);
91int cpm_uart_init_portdesc(void); 95int cpm_uart_init_portdesc(void);
92int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con); 96int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con);
93void cpm_uart_freebuf(struct uart_cpm_port *pinfo); 97void cpm_uart_freebuf(struct uart_cpm_port *pinfo);
@@ -102,34 +106,36 @@ void scc4_lineif(struct uart_cpm_port *pinfo);
102/* 106/*
103 virtual to phys transtalion 107 virtual to phys transtalion
104*/ 108*/
105static inline unsigned long cpu2cpm_addr(void* addr, struct uart_cpm_port *pinfo) 109static inline unsigned long cpu2cpm_addr(void *addr,
110 struct uart_cpm_port *pinfo)
106{ 111{
107 int offset; 112 int offset;
108 u32 val = (u32)addr; 113 u32 val = (u32)addr;
114 u32 mem = (u32)pinfo->mem_addr;
109 /* sane check */ 115 /* sane check */
110 if (likely((val >= (u32)pinfo->mem_addr)) && 116 if (likely(val >= mem && val < mem + pinfo->mem_size)) {
111 (val<((u32)pinfo->mem_addr + pinfo->mem_size))) { 117 offset = val - mem;
112 offset = val - (u32)pinfo->mem_addr; 118 return pinfo->dma_addr + offset;
113 return pinfo->dma_addr+offset;
114 } 119 }
115 /* something nasty happened */ 120 /* something nasty happened */
116 BUG(); 121 BUG();
117 return 0; 122 return 0;
118} 123}
119 124
120static inline void *cpm2cpu_addr(unsigned long addr, struct uart_cpm_port *pinfo) 125static inline void *cpm2cpu_addr(unsigned long addr,
126 struct uart_cpm_port *pinfo)
121{ 127{
122 int offset; 128 int offset;
123 u32 val = addr; 129 u32 val = addr;
130 u32 dma = (u32)pinfo->dma_addr;
124 /* sane check */ 131 /* sane check */
125 if (likely((val >= pinfo->dma_addr) && 132 if (likely(val >= dma && val < dma + pinfo->mem_size)) {
126 (val<(pinfo->dma_addr + pinfo->mem_size)))) { 133 offset = val - dma;
127 offset = val - (u32)pinfo->dma_addr; 134 return pinfo->mem_addr + offset;
128 return (void*)(pinfo->mem_addr+offset);
129 } 135 }
130 /* something nasty happened */ 136 /* something nasty happened */
131 BUG(); 137 BUG();
132 return 0; 138 return NULL;
133} 139}
134 140
135 141
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index cefde58dbad2..b5e4478de0e3 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -10,7 +10,7 @@
10 * Maintainer: Kumar Gala (galak@kernel.crashing.org) (CPM2) 10 * Maintainer: Kumar Gala (galak@kernel.crashing.org) (CPM2)
11 * Pantelis Antoniou (panto@intracom.gr) (CPM1) 11 * Pantelis Antoniou (panto@intracom.gr) (CPM1)
12 * 12 *
13 * Copyright (C) 2004 Freescale Semiconductor, Inc. 13 * Copyright (C) 2004, 2007 Freescale Semiconductor, Inc.
14 * (C) 2004 Intracom, S.A. 14 * (C) 2004 Intracom, S.A.
15 * (C) 2005-2006 MontaVista Software, Inc. 15 * (C) 2005-2006 MontaVista Software, Inc.
16 * Vitaly Bordug <vbordug@ru.mvista.com> 16 * Vitaly Bordug <vbordug@ru.mvista.com>
@@ -47,6 +47,11 @@
47#include <asm/irq.h> 47#include <asm/irq.h>
48#include <asm/delay.h> 48#include <asm/delay.h>
49#include <asm/fs_pd.h> 49#include <asm/fs_pd.h>
50#include <asm/udbg.h>
51
52#ifdef CONFIG_PPC_CPM_NEW_BINDING
53#include <linux/of_platform.h>
54#endif
50 55
51#if defined(CONFIG_SERIAL_CPM_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 56#if defined(CONFIG_SERIAL_CPM_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
52#define SUPPORT_SYSRQ 57#define SUPPORT_SYSRQ
@@ -57,12 +62,6 @@
57 62
58#include "cpm_uart.h" 63#include "cpm_uart.h"
59 64
60/***********************************************************************/
61
62/* Track which ports are configured as uarts */
63int cpm_uart_port_map[UART_NR];
64/* How many ports did we config as uarts */
65int cpm_uart_nr = 0;
66 65
67/**************************************************************/ 66/**************************************************************/
68 67
@@ -73,6 +72,11 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo);
73 72
74/**************************************************************/ 73/**************************************************************/
75 74
75#ifndef CONFIG_PPC_CPM_NEW_BINDING
76/* Track which ports are configured as uarts */
77int cpm_uart_port_map[UART_NR];
78/* How many ports did we config as uarts */
79int cpm_uart_nr;
76 80
77/* Place-holder for board-specific stuff */ 81/* Place-holder for board-specific stuff */
78struct platform_device* __attribute__ ((weak)) __init 82struct platform_device* __attribute__ ((weak)) __init
@@ -119,6 +123,7 @@ static int cpm_uart_id2nr(int id)
119 /* not found or invalid argument */ 123 /* not found or invalid argument */
120 return -1; 124 return -1;
121} 125}
126#endif
122 127
123/* 128/*
124 * Check, if transmit buffers are processed 129 * Check, if transmit buffers are processed
@@ -126,14 +131,14 @@ static int cpm_uart_id2nr(int id)
126static unsigned int cpm_uart_tx_empty(struct uart_port *port) 131static unsigned int cpm_uart_tx_empty(struct uart_port *port)
127{ 132{
128 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 133 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
129 volatile cbd_t *bdp = pinfo->tx_bd_base; 134 cbd_t __iomem *bdp = pinfo->tx_bd_base;
130 int ret = 0; 135 int ret = 0;
131 136
132 while (1) { 137 while (1) {
133 if (bdp->cbd_sc & BD_SC_READY) 138 if (in_be16(&bdp->cbd_sc) & BD_SC_READY)
134 break; 139 break;
135 140
136 if (bdp->cbd_sc & BD_SC_WRAP) { 141 if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP) {
137 ret = TIOCSER_TEMT; 142 ret = TIOCSER_TEMT;
138 break; 143 break;
139 } 144 }
@@ -162,15 +167,15 @@ static unsigned int cpm_uart_get_mctrl(struct uart_port *port)
162static void cpm_uart_stop_tx(struct uart_port *port) 167static void cpm_uart_stop_tx(struct uart_port *port)
163{ 168{
164 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 169 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
165 volatile smc_t *smcp = pinfo->smcp; 170 smc_t __iomem *smcp = pinfo->smcp;
166 volatile scc_t *sccp = pinfo->sccp; 171 scc_t __iomem *sccp = pinfo->sccp;
167 172
168 pr_debug("CPM uart[%d]:stop tx\n", port->line); 173 pr_debug("CPM uart[%d]:stop tx\n", port->line);
169 174
170 if (IS_SMC(pinfo)) 175 if (IS_SMC(pinfo))
171 smcp->smc_smcm &= ~SMCM_TX; 176 clrbits8(&smcp->smc_smcm, SMCM_TX);
172 else 177 else
173 sccp->scc_sccm &= ~UART_SCCM_TX; 178 clrbits16(&sccp->scc_sccm, UART_SCCM_TX);
174} 179}
175 180
176/* 181/*
@@ -179,24 +184,24 @@ static void cpm_uart_stop_tx(struct uart_port *port)
179static void cpm_uart_start_tx(struct uart_port *port) 184static void cpm_uart_start_tx(struct uart_port *port)
180{ 185{
181 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 186 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
182 volatile smc_t *smcp = pinfo->smcp; 187 smc_t __iomem *smcp = pinfo->smcp;
183 volatile scc_t *sccp = pinfo->sccp; 188 scc_t __iomem *sccp = pinfo->sccp;
184 189
185 pr_debug("CPM uart[%d]:start tx\n", port->line); 190 pr_debug("CPM uart[%d]:start tx\n", port->line);
186 191
187 if (IS_SMC(pinfo)) { 192 if (IS_SMC(pinfo)) {
188 if (smcp->smc_smcm & SMCM_TX) 193 if (in_8(&smcp->smc_smcm) & SMCM_TX)
189 return; 194 return;
190 } else { 195 } else {
191 if (sccp->scc_sccm & UART_SCCM_TX) 196 if (in_be16(&sccp->scc_sccm) & UART_SCCM_TX)
192 return; 197 return;
193 } 198 }
194 199
195 if (cpm_uart_tx_pump(port) != 0) { 200 if (cpm_uart_tx_pump(port) != 0) {
196 if (IS_SMC(pinfo)) { 201 if (IS_SMC(pinfo)) {
197 smcp->smc_smcm |= SMCM_TX; 202 setbits8(&smcp->smc_smcm, SMCM_TX);
198 } else { 203 } else {
199 sccp->scc_sccm |= UART_SCCM_TX; 204 setbits16(&sccp->scc_sccm, UART_SCCM_TX);
200 } 205 }
201 } 206 }
202} 207}
@@ -207,15 +212,15 @@ static void cpm_uart_start_tx(struct uart_port *port)
207static void cpm_uart_stop_rx(struct uart_port *port) 212static void cpm_uart_stop_rx(struct uart_port *port)
208{ 213{
209 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 214 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
210 volatile smc_t *smcp = pinfo->smcp; 215 smc_t __iomem *smcp = pinfo->smcp;
211 volatile scc_t *sccp = pinfo->sccp; 216 scc_t __iomem *sccp = pinfo->sccp;
212 217
213 pr_debug("CPM uart[%d]:stop rx\n", port->line); 218 pr_debug("CPM uart[%d]:stop rx\n", port->line);
214 219
215 if (IS_SMC(pinfo)) 220 if (IS_SMC(pinfo))
216 smcp->smc_smcm &= ~SMCM_RX; 221 clrbits8(&smcp->smc_smcm, SMCM_RX);
217 else 222 else
218 sccp->scc_sccm &= ~UART_SCCM_RX; 223 clrbits16(&sccp->scc_sccm, UART_SCCM_RX);
219} 224}
220 225
221/* 226/*
@@ -232,15 +237,14 @@ static void cpm_uart_enable_ms(struct uart_port *port)
232static void cpm_uart_break_ctl(struct uart_port *port, int break_state) 237static void cpm_uart_break_ctl(struct uart_port *port, int break_state)
233{ 238{
234 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 239 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
235 int line = pinfo - cpm_uart_ports;
236 240
237 pr_debug("CPM uart[%d]:break ctrl, break_state: %d\n", port->line, 241 pr_debug("CPM uart[%d]:break ctrl, break_state: %d\n", port->line,
238 break_state); 242 break_state);
239 243
240 if (break_state) 244 if (break_state)
241 cpm_line_cr_cmd(line, CPM_CR_STOP_TX); 245 cpm_line_cr_cmd(pinfo, CPM_CR_STOP_TX);
242 else 246 else
243 cpm_line_cr_cmd(line, CPM_CR_RESTART_TX); 247 cpm_line_cr_cmd(pinfo, CPM_CR_RESTART_TX);
244} 248}
245 249
246/* 250/*
@@ -259,10 +263,11 @@ static void cpm_uart_int_tx(struct uart_port *port)
259static void cpm_uart_int_rx(struct uart_port *port) 263static void cpm_uart_int_rx(struct uart_port *port)
260{ 264{
261 int i; 265 int i;
262 unsigned char ch, *cp; 266 unsigned char ch;
267 u8 *cp;
263 struct tty_struct *tty = port->info->tty; 268 struct tty_struct *tty = port->info->tty;
264 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 269 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
265 volatile cbd_t *bdp; 270 cbd_t __iomem *bdp;
266 u16 status; 271 u16 status;
267 unsigned int flg; 272 unsigned int flg;
268 273
@@ -274,13 +279,13 @@ static void cpm_uart_int_rx(struct uart_port *port)
274 bdp = pinfo->rx_cur; 279 bdp = pinfo->rx_cur;
275 for (;;) { 280 for (;;) {
276 /* get status */ 281 /* get status */
277 status = bdp->cbd_sc; 282 status = in_be16(&bdp->cbd_sc);
278 /* If this one is empty, return happy */ 283 /* If this one is empty, return happy */
279 if (status & BD_SC_EMPTY) 284 if (status & BD_SC_EMPTY)
280 break; 285 break;
281 286
282 /* get number of characters, and check spce in flip-buffer */ 287 /* get number of characters, and check spce in flip-buffer */
283 i = bdp->cbd_datlen; 288 i = in_be16(&bdp->cbd_datlen);
284 289
285 /* If we have not enough room in tty flip buffer, then we try 290 /* If we have not enough room in tty flip buffer, then we try
286 * later, which will be the next rx-interrupt or a timeout 291 * later, which will be the next rx-interrupt or a timeout
@@ -291,7 +296,7 @@ static void cpm_uart_int_rx(struct uart_port *port)
291 } 296 }
292 297
293 /* get pointer */ 298 /* get pointer */
294 cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo); 299 cp = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), pinfo);
295 300
296 /* loop through the buffer */ 301 /* loop through the buffer */
297 while (i-- > 0) { 302 while (i-- > 0) {
@@ -311,10 +316,11 @@ static void cpm_uart_int_rx(struct uart_port *port)
311 } /* End while (i--) */ 316 } /* End while (i--) */
312 317
313 /* This BD is ready to be used again. Clear status. get next */ 318 /* This BD is ready to be used again. Clear status. get next */
314 bdp->cbd_sc &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV | BD_SC_ID); 319 clrbits16(&bdp->cbd_sc, BD_SC_BR | BD_SC_FR | BD_SC_PR |
315 bdp->cbd_sc |= BD_SC_EMPTY; 320 BD_SC_OV | BD_SC_ID);
321 setbits16(&bdp->cbd_sc, BD_SC_EMPTY);
316 322
317 if (bdp->cbd_sc & BD_SC_WRAP) 323 if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP)
318 bdp = pinfo->rx_bd_base; 324 bdp = pinfo->rx_bd_base;
319 else 325 else
320 bdp++; 326 bdp++;
@@ -322,7 +328,7 @@ static void cpm_uart_int_rx(struct uart_port *port)
322 } /* End for (;;) */ 328 } /* End for (;;) */
323 329
324 /* Write back buffer pointer */ 330 /* Write back buffer pointer */
325 pinfo->rx_cur = (volatile cbd_t *) bdp; 331 pinfo->rx_cur = bdp;
326 332
327 /* activate BH processing */ 333 /* activate BH processing */
328 tty_flip_buffer_push(tty); 334 tty_flip_buffer_push(tty);
@@ -376,14 +382,14 @@ static irqreturn_t cpm_uart_int(int irq, void *data)
376 u8 events; 382 u8 events;
377 struct uart_port *port = (struct uart_port *)data; 383 struct uart_port *port = (struct uart_port *)data;
378 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 384 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
379 volatile smc_t *smcp = pinfo->smcp; 385 smc_t __iomem *smcp = pinfo->smcp;
380 volatile scc_t *sccp = pinfo->sccp; 386 scc_t __iomem *sccp = pinfo->sccp;
381 387
382 pr_debug("CPM uart[%d]:IRQ\n", port->line); 388 pr_debug("CPM uart[%d]:IRQ\n", port->line);
383 389
384 if (IS_SMC(pinfo)) { 390 if (IS_SMC(pinfo)) {
385 events = smcp->smc_smce; 391 events = in_8(&smcp->smc_smce);
386 smcp->smc_smce = events; 392 out_8(&smcp->smc_smce, events);
387 if (events & SMCM_BRKE) 393 if (events & SMCM_BRKE)
388 uart_handle_break(port); 394 uart_handle_break(port);
389 if (events & SMCM_RX) 395 if (events & SMCM_RX)
@@ -391,8 +397,8 @@ static irqreturn_t cpm_uart_int(int irq, void *data)
391 if (events & SMCM_TX) 397 if (events & SMCM_TX)
392 cpm_uart_int_tx(port); 398 cpm_uart_int_tx(port);
393 } else { 399 } else {
394 events = sccp->scc_scce; 400 events = in_be16(&sccp->scc_scce);
395 sccp->scc_scce = events; 401 out_be16(&sccp->scc_scce, events);
396 if (events & UART_SCCM_BRKE) 402 if (events & UART_SCCM_BRKE)
397 uart_handle_break(port); 403 uart_handle_break(port);
398 if (events & UART_SCCM_RX) 404 if (events & UART_SCCM_RX)
@@ -407,7 +413,6 @@ static int cpm_uart_startup(struct uart_port *port)
407{ 413{
408 int retval; 414 int retval;
409 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 415 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
410 int line = pinfo - cpm_uart_ports;
411 416
412 pr_debug("CPM uart[%d]:startup\n", port->line); 417 pr_debug("CPM uart[%d]:startup\n", port->line);
413 418
@@ -418,15 +423,15 @@ static int cpm_uart_startup(struct uart_port *port)
418 423
419 /* Startup rx-int */ 424 /* Startup rx-int */
420 if (IS_SMC(pinfo)) { 425 if (IS_SMC(pinfo)) {
421 pinfo->smcp->smc_smcm |= SMCM_RX; 426 setbits8(&pinfo->smcp->smc_smcm, SMCM_RX);
422 pinfo->smcp->smc_smcmr |= (SMCMR_REN | SMCMR_TEN); 427 setbits16(&pinfo->smcp->smc_smcmr, (SMCMR_REN | SMCMR_TEN));
423 } else { 428 } else {
424 pinfo->sccp->scc_sccm |= UART_SCCM_RX; 429 setbits16(&pinfo->sccp->scc_sccm, UART_SCCM_RX);
425 pinfo->sccp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT); 430 setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));
426 } 431 }
427 432
428 if (!(pinfo->flags & FLAG_CONSOLE)) 433 if (!(pinfo->flags & FLAG_CONSOLE))
429 cpm_line_cr_cmd(line,CPM_CR_INIT_TRX); 434 cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
430 return 0; 435 return 0;
431} 436}
432 437
@@ -442,7 +447,6 @@ inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo)
442static void cpm_uart_shutdown(struct uart_port *port) 447static void cpm_uart_shutdown(struct uart_port *port)
443{ 448{
444 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 449 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
445 int line = pinfo - cpm_uart_ports;
446 450
447 pr_debug("CPM uart[%d]:shutdown\n", port->line); 451 pr_debug("CPM uart[%d]:shutdown\n", port->line);
448 452
@@ -462,20 +466,20 @@ static void cpm_uart_shutdown(struct uart_port *port)
462 466
463 /* Stop uarts */ 467 /* Stop uarts */
464 if (IS_SMC(pinfo)) { 468 if (IS_SMC(pinfo)) {
465 volatile smc_t *smcp = pinfo->smcp; 469 smc_t __iomem *smcp = pinfo->smcp;
466 smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); 470 clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);
467 smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX); 471 clrbits8(&smcp->smc_smcm, SMCM_RX | SMCM_TX);
468 } else { 472 } else {
469 volatile scc_t *sccp = pinfo->sccp; 473 scc_t __iomem *sccp = pinfo->sccp;
470 sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT); 474 clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
471 sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX); 475 clrbits16(&sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
472 } 476 }
473 477
474 /* Shut them really down and reinit buffer descriptors */ 478 /* Shut them really down and reinit buffer descriptors */
475 if (IS_SMC(pinfo)) 479 if (IS_SMC(pinfo))
476 cpm_line_cr_cmd(line, CPM_CR_STOP_TX); 480 cpm_line_cr_cmd(pinfo, CPM_CR_STOP_TX);
477 else 481 else
478 cpm_line_cr_cmd(line, CPM_CR_GRA_STOP_TX); 482 cpm_line_cr_cmd(pinfo, CPM_CR_GRA_STOP_TX);
479 483
480 cpm_uart_initbd(pinfo); 484 cpm_uart_initbd(pinfo);
481 } 485 }
@@ -490,8 +494,8 @@ static void cpm_uart_set_termios(struct uart_port *port,
490 u16 cval, scval, prev_mode; 494 u16 cval, scval, prev_mode;
491 int bits, sbits; 495 int bits, sbits;
492 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 496 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
493 volatile smc_t *smcp = pinfo->smcp; 497 smc_t __iomem *smcp = pinfo->smcp;
494 volatile scc_t *sccp = pinfo->sccp; 498 scc_t __iomem *sccp = pinfo->sccp;
495 499
496 pr_debug("CPM uart[%d]:set_termios\n", port->line); 500 pr_debug("CPM uart[%d]:set_termios\n", port->line);
497 501
@@ -586,16 +590,15 @@ static void cpm_uart_set_termios(struct uart_port *port,
586 * enables, because we want to put them back if they were 590 * enables, because we want to put them back if they were
587 * present. 591 * present.
588 */ 592 */
589 prev_mode = smcp->smc_smcmr; 593 prev_mode = in_be16(&smcp->smc_smcmr);
590 smcp->smc_smcmr = smcr_mk_clen(bits) | cval | SMCMR_SM_UART; 594 out_be16(&smcp->smc_smcmr, smcr_mk_clen(bits) | cval | SMCMR_SM_UART);
591 smcp->smc_smcmr |= (prev_mode & (SMCMR_REN | SMCMR_TEN)); 595 setbits16(&smcp->smc_smcmr, (prev_mode & (SMCMR_REN | SMCMR_TEN)));
592 } else { 596 } else {
593 sccp->scc_psmr = (sbits << 12) | scval; 597 out_be16(&sccp->scc_psmr, (sbits << 12) | scval);
594 } 598 }
595 599
596 cpm_set_brg(pinfo->brg - 1, baud); 600 cpm_set_brg(pinfo->brg - 1, baud);
597 spin_unlock_irqrestore(&port->lock, flags); 601 spin_unlock_irqrestore(&port->lock, flags);
598
599} 602}
600 603
601static const char *cpm_uart_type(struct uart_port *port) 604static const char *cpm_uart_type(struct uart_port *port)
@@ -629,8 +632,8 @@ static int cpm_uart_verify_port(struct uart_port *port,
629 */ 632 */
630static int cpm_uart_tx_pump(struct uart_port *port) 633static int cpm_uart_tx_pump(struct uart_port *port)
631{ 634{
632 volatile cbd_t *bdp; 635 cbd_t __iomem *bdp;
633 unsigned char *p; 636 u8 *p;
634 int count; 637 int count;
635 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port; 638 struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
636 struct circ_buf *xmit = &port->info->xmit; 639 struct circ_buf *xmit = &port->info->xmit;
@@ -640,13 +643,14 @@ static int cpm_uart_tx_pump(struct uart_port *port)
640 /* Pick next descriptor and fill from buffer */ 643 /* Pick next descriptor and fill from buffer */
641 bdp = pinfo->tx_cur; 644 bdp = pinfo->tx_cur;
642 645
643 p = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo); 646 p = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), pinfo);
644 647
645 *p++ = port->x_char; 648 *p++ = port->x_char;
646 bdp->cbd_datlen = 1; 649
647 bdp->cbd_sc |= BD_SC_READY; 650 out_be16(&bdp->cbd_datlen, 1);
651 setbits16(&bdp->cbd_sc, BD_SC_READY);
648 /* Get next BD. */ 652 /* Get next BD. */
649 if (bdp->cbd_sc & BD_SC_WRAP) 653 if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP)
650 bdp = pinfo->tx_bd_base; 654 bdp = pinfo->tx_bd_base;
651 else 655 else
652 bdp++; 656 bdp++;
@@ -665,9 +669,10 @@ static int cpm_uart_tx_pump(struct uart_port *port)
665 /* Pick next descriptor and fill from buffer */ 669 /* Pick next descriptor and fill from buffer */
666 bdp = pinfo->tx_cur; 670 bdp = pinfo->tx_cur;
667 671
668 while (!(bdp->cbd_sc & BD_SC_READY) && (xmit->tail != xmit->head)) { 672 while (!(in_be16(&bdp->cbd_sc) & BD_SC_READY) &&
673 xmit->tail != xmit->head) {
669 count = 0; 674 count = 0;
670 p = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo); 675 p = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), pinfo);
671 while (count < pinfo->tx_fifosize) { 676 while (count < pinfo->tx_fifosize) {
672 *p++ = xmit->buf[xmit->tail]; 677 *p++ = xmit->buf[xmit->tail];
673 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 678 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
@@ -676,11 +681,10 @@ static int cpm_uart_tx_pump(struct uart_port *port)
676 if (xmit->head == xmit->tail) 681 if (xmit->head == xmit->tail)
677 break; 682 break;
678 } 683 }
679 bdp->cbd_datlen = count; 684 out_be16(&bdp->cbd_datlen, count);
680 bdp->cbd_sc |= BD_SC_READY; 685 setbits16(&bdp->cbd_sc, BD_SC_READY);
681 eieio();
682 /* Get next BD. */ 686 /* Get next BD. */
683 if (bdp->cbd_sc & BD_SC_WRAP) 687 if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP)
684 bdp = pinfo->tx_bd_base; 688 bdp = pinfo->tx_bd_base;
685 else 689 else
686 bdp++; 690 bdp++;
@@ -705,7 +709,7 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo)
705{ 709{
706 int i; 710 int i;
707 u8 *mem_addr; 711 u8 *mem_addr;
708 volatile cbd_t *bdp; 712 cbd_t __iomem *bdp;
709 713
710 pr_debug("CPM uart[%d]:initbd\n", pinfo->port.line); 714 pr_debug("CPM uart[%d]:initbd\n", pinfo->port.line);
711 715
@@ -716,13 +720,13 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo)
716 mem_addr = pinfo->mem_addr; 720 mem_addr = pinfo->mem_addr;
717 bdp = pinfo->rx_cur = pinfo->rx_bd_base; 721 bdp = pinfo->rx_cur = pinfo->rx_bd_base;
718 for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) { 722 for (i = 0; i < (pinfo->rx_nrfifos - 1); i++, bdp++) {
719 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo); 723 out_be32(&bdp->cbd_bufaddr, cpu2cpm_addr(mem_addr, pinfo));
720 bdp->cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT; 724 out_be16(&bdp->cbd_sc, BD_SC_EMPTY | BD_SC_INTRPT);
721 mem_addr += pinfo->rx_fifosize; 725 mem_addr += pinfo->rx_fifosize;
722 } 726 }
723 727
724 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo); 728 out_be32(&bdp->cbd_bufaddr, cpu2cpm_addr(mem_addr, pinfo));
725 bdp->cbd_sc = BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT; 729 out_be16(&bdp->cbd_sc, BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT);
726 730
727 /* Set the physical address of the host memory 731 /* Set the physical address of the host memory
728 * buffers in the buffer descriptors, and the 732 * buffers in the buffer descriptors, and the
@@ -731,20 +735,19 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo)
731 mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); 735 mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
732 bdp = pinfo->tx_cur = pinfo->tx_bd_base; 736 bdp = pinfo->tx_cur = pinfo->tx_bd_base;
733 for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) { 737 for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) {
734 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo); 738 out_be32(&bdp->cbd_bufaddr, cpu2cpm_addr(mem_addr, pinfo));
735 bdp->cbd_sc = BD_SC_INTRPT; 739 out_be16(&bdp->cbd_sc, BD_SC_INTRPT);
736 mem_addr += pinfo->tx_fifosize; 740 mem_addr += pinfo->tx_fifosize;
737 } 741 }
738 742
739 bdp->cbd_bufaddr = cpu2cpm_addr(mem_addr, pinfo); 743 out_be32(&bdp->cbd_bufaddr, cpu2cpm_addr(mem_addr, pinfo));
740 bdp->cbd_sc = BD_SC_WRAP | BD_SC_INTRPT; 744 out_be16(&bdp->cbd_sc, BD_SC_WRAP | BD_SC_INTRPT);
741} 745}
742 746
743static void cpm_uart_init_scc(struct uart_cpm_port *pinfo) 747static void cpm_uart_init_scc(struct uart_cpm_port *pinfo)
744{ 748{
745 int line = pinfo - cpm_uart_ports; 749 scc_t __iomem *scp;
746 volatile scc_t *scp; 750 scc_uart_t __iomem *sup;
747 volatile scc_uart_t *sup;
748 751
749 pr_debug("CPM uart[%d]:init_scc\n", pinfo->port.line); 752 pr_debug("CPM uart[%d]:init_scc\n", pinfo->port.line);
750 753
@@ -752,8 +755,10 @@ static void cpm_uart_init_scc(struct uart_cpm_port *pinfo)
752 sup = pinfo->sccup; 755 sup = pinfo->sccup;
753 756
754 /* Store address */ 757 /* Store address */
755 pinfo->sccup->scc_genscc.scc_rbase = (unsigned char *)pinfo->rx_bd_base - DPRAM_BASE; 758 out_be16(&pinfo->sccup->scc_genscc.scc_rbase,
756 pinfo->sccup->scc_genscc.scc_tbase = (unsigned char *)pinfo->tx_bd_base - DPRAM_BASE; 759 (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);
760 out_be16(&pinfo->sccup->scc_genscc.scc_tbase,
761 (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
757 762
758 /* Set up the uart parameters in the 763 /* Set up the uart parameters in the
759 * parameter ram. 764 * parameter ram.
@@ -761,51 +766,50 @@ static void cpm_uart_init_scc(struct uart_cpm_port *pinfo)
761 766
762 cpm_set_scc_fcr(sup); 767 cpm_set_scc_fcr(sup);
763 768
764 sup->scc_genscc.scc_mrblr = pinfo->rx_fifosize; 769 out_be16(&sup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);
765 sup->scc_maxidl = pinfo->rx_fifosize; 770 out_be16(&sup->scc_maxidl, pinfo->rx_fifosize);
766 sup->scc_brkcr = 1; 771 out_be16(&sup->scc_brkcr, 1);
767 sup->scc_parec = 0; 772 out_be16(&sup->scc_parec, 0);
768 sup->scc_frmec = 0; 773 out_be16(&sup->scc_frmec, 0);
769 sup->scc_nosec = 0; 774 out_be16(&sup->scc_nosec, 0);
770 sup->scc_brkec = 0; 775 out_be16(&sup->scc_brkec, 0);
771 sup->scc_uaddr1 = 0; 776 out_be16(&sup->scc_uaddr1, 0);
772 sup->scc_uaddr2 = 0; 777 out_be16(&sup->scc_uaddr2, 0);
773 sup->scc_toseq = 0; 778 out_be16(&sup->scc_toseq, 0);
774 sup->scc_char1 = 0x8000; 779 out_be16(&sup->scc_char1, 0x8000);
775 sup->scc_char2 = 0x8000; 780 out_be16(&sup->scc_char2, 0x8000);
776 sup->scc_char3 = 0x8000; 781 out_be16(&sup->scc_char3, 0x8000);
777 sup->scc_char4 = 0x8000; 782 out_be16(&sup->scc_char4, 0x8000);
778 sup->scc_char5 = 0x8000; 783 out_be16(&sup->scc_char5, 0x8000);
779 sup->scc_char6 = 0x8000; 784 out_be16(&sup->scc_char6, 0x8000);
780 sup->scc_char7 = 0x8000; 785 out_be16(&sup->scc_char7, 0x8000);
781 sup->scc_char8 = 0x8000; 786 out_be16(&sup->scc_char8, 0x8000);
782 sup->scc_rccm = 0xc0ff; 787 out_be16(&sup->scc_rccm, 0xc0ff);
783 788
784 /* Send the CPM an initialize command. 789 /* Send the CPM an initialize command.
785 */ 790 */
786 cpm_line_cr_cmd(line, CPM_CR_INIT_TRX); 791 cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
787 792
788 /* Set UART mode, 8 bit, no parity, one stop. 793 /* Set UART mode, 8 bit, no parity, one stop.
789 * Enable receive and transmit. 794 * Enable receive and transmit.
790 */ 795 */
791 scp->scc_gsmrh = 0; 796 out_be32(&scp->scc_gsmrh, 0);
792 scp->scc_gsmrl = 797 out_be32(&scp->scc_gsmrl,
793 (SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16); 798 SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);
794 799
795 /* Enable rx interrupts and clear all pending events. */ 800 /* Enable rx interrupts and clear all pending events. */
796 scp->scc_sccm = 0; 801 out_be16(&scp->scc_sccm, 0);
797 scp->scc_scce = 0xffff; 802 out_be16(&scp->scc_scce, 0xffff);
798 scp->scc_dsr = 0x7e7e; 803 out_be16(&scp->scc_dsr, 0x7e7e);
799 scp->scc_psmr = 0x3000; 804 out_be16(&scp->scc_psmr, 0x3000);
800 805
801 scp->scc_gsmrl |= (SCC_GSMRL_ENR | SCC_GSMRL_ENT); 806 setbits32(&scp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
802} 807}
803 808
804static void cpm_uart_init_smc(struct uart_cpm_port *pinfo) 809static void cpm_uart_init_smc(struct uart_cpm_port *pinfo)
805{ 810{
806 int line = pinfo - cpm_uart_ports; 811 smc_t __iomem *sp;
807 volatile smc_t *sp; 812 smc_uart_t __iomem *up;
808 volatile smc_uart_t *up;
809 813
810 pr_debug("CPM uart[%d]:init_smc\n", pinfo->port.line); 814 pr_debug("CPM uart[%d]:init_smc\n", pinfo->port.line);
811 815
@@ -813,19 +817,21 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo)
813 up = pinfo->smcup; 817 up = pinfo->smcup;
814 818
815 /* Store address */ 819 /* Store address */
816 pinfo->smcup->smc_rbase = (u_char *)pinfo->rx_bd_base - DPRAM_BASE; 820 out_be16(&pinfo->smcup->smc_rbase,
817 pinfo->smcup->smc_tbase = (u_char *)pinfo->tx_bd_base - DPRAM_BASE; 821 (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);
822 out_be16(&pinfo->smcup->smc_tbase,
823 (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
818 824
819/* 825/*
820 * In case SMC1 is being relocated... 826 * In case SMC1 is being relocated...
821 */ 827 */
822#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH) 828#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
823 up->smc_rbptr = pinfo->smcup->smc_rbase; 829 out_be16(&up->smc_rbptr, in_be16(&pinfo->smcup->smc_rbase));
824 up->smc_tbptr = pinfo->smcup->smc_tbase; 830 out_be16(&up->smc_tbptr, in_be16(&pinfo->smcup->smc_tbase));
825 up->smc_rstate = 0; 831 out_be32(&up->smc_rstate, 0);
826 up->smc_tstate = 0; 832 out_be32(&up->smc_tstate, 0);
827 up->smc_brkcr = 1; /* number of break chars */ 833 out_be16(&up->smc_brkcr, 1); /* number of break chars */
828 up->smc_brkec = 0; 834 out_be16(&up->smc_brkec, 0);
829#endif 835#endif
830 836
831 /* Set up the uart parameters in the 837 /* Set up the uart parameters in the
@@ -834,24 +840,24 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo)
834 cpm_set_smc_fcr(up); 840 cpm_set_smc_fcr(up);
835 841
836 /* Using idle charater time requires some additional tuning. */ 842 /* Using idle charater time requires some additional tuning. */
837 up->smc_mrblr = pinfo->rx_fifosize; 843 out_be16(&up->smc_mrblr, pinfo->rx_fifosize);
838 up->smc_maxidl = pinfo->rx_fifosize; 844 out_be16(&up->smc_maxidl, pinfo->rx_fifosize);
839 up->smc_brklen = 0; 845 out_be16(&up->smc_brklen, 0);
840 up->smc_brkec = 0; 846 out_be16(&up->smc_brkec, 0);
841 up->smc_brkcr = 1; 847 out_be16(&up->smc_brkcr, 1);
842 848
843 cpm_line_cr_cmd(line, CPM_CR_INIT_TRX); 849 cpm_line_cr_cmd(pinfo, CPM_CR_INIT_TRX);
844 850
845 /* Set UART mode, 8 bit, no parity, one stop. 851 /* Set UART mode, 8 bit, no parity, one stop.
846 * Enable receive and transmit. 852 * Enable receive and transmit.
847 */ 853 */
848 sp->smc_smcmr = smcr_mk_clen(9) | SMCMR_SM_UART; 854 out_be16(&sp->smc_smcmr, smcr_mk_clen(9) | SMCMR_SM_UART);
849 855
850 /* Enable only rx interrupts clear all pending events. */ 856 /* Enable only rx interrupts clear all pending events. */
851 sp->smc_smcm = 0; 857 out_8(&sp->smc_smcm, 0);
852 sp->smc_smce = 0xff; 858 out_8(&sp->smc_smce, 0xff);
853 859
854 sp->smc_smcmr |= (SMCMR_REN | SMCMR_TEN); 860 setbits16(&sp->smc_smcmr, SMCMR_REN | SMCMR_TEN);
855} 861}
856 862
857/* 863/*
@@ -869,11 +875,11 @@ static int cpm_uart_request_port(struct uart_port *port)
869 return 0; 875 return 0;
870 876
871 if (IS_SMC(pinfo)) { 877 if (IS_SMC(pinfo)) {
872 pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX); 878 clrbits8(&pinfo->smcp->smc_smcm, SMCM_RX | SMCM_TX);
873 pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); 879 clrbits16(&pinfo->smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);
874 } else { 880 } else {
875 pinfo->sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX); 881 clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
876 pinfo->sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT); 882 clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
877 } 883 }
878 884
879 ret = cpm_uart_allocbuf(pinfo, 0); 885 ret = cpm_uart_allocbuf(pinfo, 0);
@@ -929,6 +935,86 @@ static struct uart_ops cpm_uart_pops = {
929 .verify_port = cpm_uart_verify_port, 935 .verify_port = cpm_uart_verify_port,
930}; 936};
931 937
938#ifdef CONFIG_PPC_CPM_NEW_BINDING
939struct uart_cpm_port cpm_uart_ports[UART_NR];
940
941static int cpm_uart_init_port(struct device_node *np,
942 struct uart_cpm_port *pinfo)
943{
944 const u32 *data;
945 void __iomem *mem, *pram;
946 int len;
947 int ret;
948
949 data = of_get_property(np, "fsl,cpm-brg", &len);
950 if (!data || len != 4) {
951 printk(KERN_ERR "CPM UART %s has no/invalid "
952 "fsl,cpm-brg property.\n", np->name);
953 return -EINVAL;
954 }
955 pinfo->brg = *data;
956
957 data = of_get_property(np, "fsl,cpm-command", &len);
958 if (!data || len != 4) {
959 printk(KERN_ERR "CPM UART %s has no/invalid "
960 "fsl,cpm-command property.\n", np->name);
961 return -EINVAL;
962 }
963 pinfo->command = *data;
964
965 mem = of_iomap(np, 0);
966 if (!mem)
967 return -ENOMEM;
968
969 pram = of_iomap(np, 1);
970 if (!pram) {
971 ret = -ENOMEM;
972 goto out_mem;
973 }
974
975 if (of_device_is_compatible(np, "fsl,cpm1-scc-uart") ||
976 of_device_is_compatible(np, "fsl,cpm2-scc-uart")) {
977 pinfo->sccp = mem;
978 pinfo->sccup = pram;
979 } else if (of_device_is_compatible(np, "fsl,cpm1-smc-uart") ||
980 of_device_is_compatible(np, "fsl,cpm2-smc-uart")) {
981 pinfo->flags |= FLAG_SMC;
982 pinfo->smcp = mem;
983 pinfo->smcup = pram;
984 } else {
985 ret = -ENODEV;
986 goto out_pram;
987 }
988
989 pinfo->tx_nrfifos = TX_NUM_FIFO;
990 pinfo->tx_fifosize = TX_BUF_SIZE;
991 pinfo->rx_nrfifos = RX_NUM_FIFO;
992 pinfo->rx_fifosize = RX_BUF_SIZE;
993
994 pinfo->port.uartclk = ppc_proc_freq;
995 pinfo->port.mapbase = (unsigned long)mem;
996 pinfo->port.type = PORT_CPM;
997 pinfo->port.ops = &cpm_uart_pops,
998 pinfo->port.iotype = UPIO_MEM;
999 spin_lock_init(&pinfo->port.lock);
1000
1001 pinfo->port.irq = of_irq_to_resource(np, 0, NULL);
1002 if (pinfo->port.irq == NO_IRQ) {
1003 ret = -EINVAL;
1004 goto out_pram;
1005 }
1006
1007 return cpm_uart_request_port(&pinfo->port);
1008
1009out_pram:
1010 iounmap(pram);
1011out_mem:
1012 iounmap(mem);
1013 return ret;
1014}
1015
1016#else
1017
932struct uart_cpm_port cpm_uart_ports[UART_NR] = { 1018struct uart_cpm_port cpm_uart_ports[UART_NR] = {
933 [UART_SMC1] = { 1019 [UART_SMC1] = {
934 .port = { 1020 .port = {
@@ -1072,6 +1158,7 @@ int cpm_uart_drv_get_platform_data(struct platform_device *pdev, int is_con)
1072 1158
1073 return 0; 1159 return 0;
1074} 1160}
1161#endif
1075 1162
1076#ifdef CONFIG_SERIAL_CPM_CONSOLE 1163#ifdef CONFIG_SERIAL_CPM_CONSOLE
1077/* 1164/*
@@ -1083,11 +1170,15 @@ int cpm_uart_drv_get_platform_data(struct platform_device *pdev, int is_con)
1083static void cpm_uart_console_write(struct console *co, const char *s, 1170static void cpm_uart_console_write(struct console *co, const char *s,
1084 u_int count) 1171 u_int count)
1085{ 1172{
1173#ifdef CONFIG_PPC_CPM_NEW_BINDING
1174 struct uart_cpm_port *pinfo = &cpm_uart_ports[co->index];
1175#else
1086 struct uart_cpm_port *pinfo = 1176 struct uart_cpm_port *pinfo =
1087 &cpm_uart_ports[cpm_uart_port_map[co->index]]; 1177 &cpm_uart_ports[cpm_uart_port_map[co->index]];
1178#endif
1088 unsigned int i; 1179 unsigned int i;
1089 volatile cbd_t *bdp, *bdbase; 1180 cbd_t __iomem *bdp, *bdbase;
1090 volatile unsigned char *cp; 1181 unsigned char *cp;
1091 1182
1092 /* Get the address of the host memory buffer. 1183 /* Get the address of the host memory buffer.
1093 */ 1184 */
@@ -1105,37 +1196,36 @@ static void cpm_uart_console_write(struct console *co, const char *s,
1105 * Ready indicates output is ready, and xmt is doing 1196 * Ready indicates output is ready, and xmt is doing
1106 * that, not that it is ready for us to send. 1197 * that, not that it is ready for us to send.
1107 */ 1198 */
1108 while ((bdp->cbd_sc & BD_SC_READY) != 0) 1199 while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0)
1109 ; 1200 ;
1110 1201
1111 /* Send the character out. 1202 /* Send the character out.
1112 * If the buffer address is in the CPM DPRAM, don't 1203 * If the buffer address is in the CPM DPRAM, don't
1113 * convert it. 1204 * convert it.
1114 */ 1205 */
1115 cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo); 1206 cp = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), pinfo);
1116
1117 *cp = *s; 1207 *cp = *s;
1118 1208
1119 bdp->cbd_datlen = 1; 1209 out_be16(&bdp->cbd_datlen, 1);
1120 bdp->cbd_sc |= BD_SC_READY; 1210 setbits16(&bdp->cbd_sc, BD_SC_READY);
1121 1211
1122 if (bdp->cbd_sc & BD_SC_WRAP) 1212 if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP)
1123 bdp = bdbase; 1213 bdp = bdbase;
1124 else 1214 else
1125 bdp++; 1215 bdp++;
1126 1216
1127 /* if a LF, also do CR... */ 1217 /* if a LF, also do CR... */
1128 if (*s == 10) { 1218 if (*s == 10) {
1129 while ((bdp->cbd_sc & BD_SC_READY) != 0) 1219 while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0)
1130 ; 1220 ;
1131 1221
1132 cp = cpm2cpu_addr(bdp->cbd_bufaddr, pinfo); 1222 cp = cpm2cpu_addr(in_be32(&bdp->cbd_bufaddr), pinfo);
1133
1134 *cp = 13; 1223 *cp = 13;
1135 bdp->cbd_datlen = 1;
1136 bdp->cbd_sc |= BD_SC_READY;
1137 1224
1138 if (bdp->cbd_sc & BD_SC_WRAP) 1225 out_be16(&bdp->cbd_datlen, 1);
1226 setbits16(&bdp->cbd_sc, BD_SC_READY);
1227
1228 if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP)
1139 bdp = bdbase; 1229 bdp = bdbase;
1140 else 1230 else
1141 bdp++; 1231 bdp++;
@@ -1146,22 +1236,56 @@ static void cpm_uart_console_write(struct console *co, const char *s,
1146 * Finally, Wait for transmitter & holding register to empty 1236 * Finally, Wait for transmitter & holding register to empty
1147 * and restore the IER 1237 * and restore the IER
1148 */ 1238 */
1149 while ((bdp->cbd_sc & BD_SC_READY) != 0) 1239 while ((in_be16(&bdp->cbd_sc) & BD_SC_READY) != 0)
1150 ; 1240 ;
1151 1241
1152 pinfo->tx_cur = (volatile cbd_t *) bdp; 1242 pinfo->tx_cur = bdp;
1153} 1243}
1154 1244
1155 1245
1156static int __init cpm_uart_console_setup(struct console *co, char *options) 1246static int __init cpm_uart_console_setup(struct console *co, char *options)
1157{ 1247{
1158 struct uart_port *port;
1159 struct uart_cpm_port *pinfo;
1160 int baud = 38400; 1248 int baud = 38400;
1161 int bits = 8; 1249 int bits = 8;
1162 int parity = 'n'; 1250 int parity = 'n';
1163 int flow = 'n'; 1251 int flow = 'n';
1164 int ret; 1252 int ret;
1253 struct uart_cpm_port *pinfo;
1254 struct uart_port *port;
1255
1256#ifdef CONFIG_PPC_CPM_NEW_BINDING
1257 struct device_node *np = NULL;
1258 int i = 0;
1259
1260 if (co->index >= UART_NR) {
1261 printk(KERN_ERR "cpm_uart: console index %d too high\n",
1262 co->index);
1263 return -ENODEV;
1264 }
1265
1266 do {
1267 np = of_find_node_by_type(np, "serial");
1268 if (!np)
1269 return -ENODEV;
1270
1271 if (!of_device_is_compatible(np, "fsl,cpm1-smc-uart") &&
1272 !of_device_is_compatible(np, "fsl,cpm1-scc-uart") &&
1273 !of_device_is_compatible(np, "fsl,cpm2-smc-uart") &&
1274 !of_device_is_compatible(np, "fsl,cpm2-scc-uart"))
1275 i--;
1276 } while (i++ != co->index);
1277
1278 pinfo = &cpm_uart_ports[co->index];
1279
1280 pinfo->flags |= FLAG_CONSOLE;
1281 port = &pinfo->port;
1282
1283 ret = cpm_uart_init_port(np, pinfo);
1284 of_node_put(np);
1285 if (ret)
1286 return ret;
1287
1288#else
1165 1289
1166 struct fs_uart_platform_info *pdata; 1290 struct fs_uart_platform_info *pdata;
1167 struct platform_device* pdev = early_uart_get_pdev(co->index); 1291 struct platform_device* pdev = early_uart_get_pdev(co->index);
@@ -1188,6 +1312,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options)
1188 } 1312 }
1189 1313
1190 pinfo->flags |= FLAG_CONSOLE; 1314 pinfo->flags |= FLAG_CONSOLE;
1315#endif
1191 1316
1192 if (options) { 1317 if (options) {
1193 uart_parse_options(options, &baud, &parity, &bits, &flow); 1318 uart_parse_options(options, &baud, &parity, &bits, &flow);
@@ -1196,12 +1321,18 @@ static int __init cpm_uart_console_setup(struct console *co, char *options)
1196 baud = 9600; 1321 baud = 9600;
1197 } 1322 }
1198 1323
1324#ifdef CONFIG_PPC_EARLY_DEBUG_CPM
1325 udbg_putc = NULL;
1326#endif
1327
1328 cpm_line_cr_cmd(pinfo, CPM_CR_STOP_TX);
1329
1199 if (IS_SMC(pinfo)) { 1330 if (IS_SMC(pinfo)) {
1200 pinfo->smcp->smc_smcm &= ~(SMCM_RX | SMCM_TX); 1331 clrbits8(&pinfo->smcp->smc_smcm, SMCM_RX | SMCM_TX);
1201 pinfo->smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); 1332 clrbits16(&pinfo->smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);
1202 } else { 1333 } else {
1203 pinfo->sccp->scc_sccm &= ~(UART_SCCM_TX | UART_SCCM_RX); 1334 clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
1204 pinfo->sccp->scc_gsmrl &= ~(SCC_GSMRL_ENR | SCC_GSMRL_ENT); 1335 clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
1205 } 1336 }
1206 1337
1207 ret = cpm_uart_allocbuf(pinfo, 1); 1338 ret = cpm_uart_allocbuf(pinfo, 1);
@@ -1217,6 +1348,7 @@ static int __init cpm_uart_console_setup(struct console *co, char *options)
1217 cpm_uart_init_scc(pinfo); 1348 cpm_uart_init_scc(pinfo);
1218 1349
1219 uart_set_options(port, co, baud, parity, bits, flow); 1350 uart_set_options(port, co, baud, parity, bits, flow);
1351 cpm_line_cr_cmd(pinfo, CPM_CR_RESTART_TX);
1220 1352
1221 return 0; 1353 return 0;
1222} 1354}
@@ -1232,7 +1364,7 @@ static struct console cpm_scc_uart_console = {
1232 .data = &cpm_reg, 1364 .data = &cpm_reg,
1233}; 1365};
1234 1366
1235int __init cpm_uart_console_init(void) 1367static int __init cpm_uart_console_init(void)
1236{ 1368{
1237 register_console(&cpm_scc_uart_console); 1369 register_console(&cpm_scc_uart_console);
1238 return 0; 1370 return 0;
@@ -1252,7 +1384,81 @@ static struct uart_driver cpm_reg = {
1252 .major = SERIAL_CPM_MAJOR, 1384 .major = SERIAL_CPM_MAJOR,
1253 .minor = SERIAL_CPM_MINOR, 1385 .minor = SERIAL_CPM_MINOR,
1254 .cons = CPM_UART_CONSOLE, 1386 .cons = CPM_UART_CONSOLE,
1387 .nr = UART_NR,
1255}; 1388};
1389
1390#ifdef CONFIG_PPC_CPM_NEW_BINDING
1391static int probe_index;
1392
1393static int __devinit cpm_uart_probe(struct of_device *ofdev,
1394 const struct of_device_id *match)
1395{
1396 int index = probe_index++;
1397 struct uart_cpm_port *pinfo = &cpm_uart_ports[index];
1398 int ret;
1399
1400 pinfo->port.line = index;
1401
1402 if (index >= UART_NR)
1403 return -ENODEV;
1404
1405 dev_set_drvdata(&ofdev->dev, pinfo);
1406
1407 ret = cpm_uart_init_port(ofdev->node, pinfo);
1408 if (ret)
1409 return ret;
1410
1411 return uart_add_one_port(&cpm_reg, &pinfo->port);
1412}
1413
1414static int __devexit cpm_uart_remove(struct of_device *ofdev)
1415{
1416 struct uart_cpm_port *pinfo = dev_get_drvdata(&ofdev->dev);
1417 return uart_remove_one_port(&cpm_reg, &pinfo->port);
1418}
1419
1420static struct of_device_id cpm_uart_match[] = {
1421 {
1422 .compatible = "fsl,cpm1-smc-uart",
1423 },
1424 {
1425 .compatible = "fsl,cpm1-scc-uart",
1426 },
1427 {
1428 .compatible = "fsl,cpm2-smc-uart",
1429 },
1430 {
1431 .compatible = "fsl,cpm2-scc-uart",
1432 },
1433 {}
1434};
1435
1436static struct of_platform_driver cpm_uart_driver = {
1437 .name = "cpm_uart",
1438 .match_table = cpm_uart_match,
1439 .probe = cpm_uart_probe,
1440 .remove = cpm_uart_remove,
1441 };
1442
1443static int __init cpm_uart_init(void)
1444{
1445 int ret = uart_register_driver(&cpm_reg);
1446 if (ret)
1447 return ret;
1448
1449 ret = of_register_platform_driver(&cpm_uart_driver);
1450 if (ret)
1451 uart_unregister_driver(&cpm_reg);
1452
1453 return ret;
1454}
1455
1456static void __exit cpm_uart_exit(void)
1457{
1458 of_unregister_platform_driver(&cpm_uart_driver);
1459 uart_unregister_driver(&cpm_reg);
1460}
1461#else
1256static int cpm_uart_drv_probe(struct device *dev) 1462static int cpm_uart_drv_probe(struct device *dev)
1257{ 1463{
1258 struct platform_device *pdev = to_platform_device(dev); 1464 struct platform_device *pdev = to_platform_device(dev);
@@ -1380,6 +1586,7 @@ static void __exit cpm_uart_exit(void)
1380 driver_unregister(&cpm_smc_uart_driver); 1586 driver_unregister(&cpm_smc_uart_driver);
1381 uart_unregister_driver(&cpm_reg); 1587 uart_unregister_driver(&cpm_reg);
1382} 1588}
1589#endif
1383 1590
1384module_init(cpm_uart_init); 1591module_init(cpm_uart_init);
1385module_exit(cpm_uart_exit); 1592module_exit(cpm_uart_exit);
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 8c6324ed0202..52fb044bb79a 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -49,9 +49,20 @@
49 49
50/**************************************************************/ 50/**************************************************************/
51 51
52void cpm_line_cr_cmd(int line, int cmd) 52#ifdef CONFIG_PPC_CPM_NEW_BINDING
53void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
54{
55 u16 __iomem *cpcr = &cpmp->cp_cpcr;
56
57 out_be16(cpcr, port->command | (cmd << 8) | CPM_CR_FLG);
58 while (in_be16(cpcr) & CPM_CR_FLG)
59 ;
60}
61#else
62void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
53{ 63{
54 ushort val; 64 ushort val;
65 int line = port - cpm_uart_ports;
55 volatile cpm8xx_t *cp = cpmp; 66 volatile cpm8xx_t *cp = cpmp;
56 67
57 switch (line) { 68 switch (line) {
@@ -114,6 +125,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo)
114 /* XXX SCC4: insert port configuration here */ 125 /* XXX SCC4: insert port configuration here */
115 pinfo->brg = 4; 126 pinfo->brg = 4;
116} 127}
128#endif
117 129
118/* 130/*
119 * Allocate DP-Ram and memory buffers. We need to allocate a transmit and 131 * Allocate DP-Ram and memory buffers. We need to allocate a transmit and
@@ -167,7 +179,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
167 pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos 179 pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos
168 * pinfo->rx_fifosize); 180 * pinfo->rx_fifosize);
169 181
170 pinfo->rx_bd_base = (volatile cbd_t *)dp_mem; 182 pinfo->rx_bd_base = (cbd_t __iomem __force *)dp_mem;
171 pinfo->tx_bd_base = pinfo->rx_bd_base + pinfo->rx_nrfifos; 183 pinfo->tx_bd_base = pinfo->rx_bd_base + pinfo->rx_nrfifos;
172 184
173 return 0; 185 return 0;
@@ -184,6 +196,7 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
184 cpm_dpfree(pinfo->dp_addr); 196 cpm_dpfree(pinfo->dp_addr);
185} 197}
186 198
199#ifndef CONFIG_PPC_CPM_NEW_BINDING
187/* Setup any dynamic params in the uart desc */ 200/* Setup any dynamic params in the uart desc */
188int cpm_uart_init_portdesc(void) 201int cpm_uart_init_portdesc(void)
189{ 202{
@@ -279,3 +292,4 @@ int cpm_uart_init_portdesc(void)
279#endif 292#endif
280 return 0; 293 return 0;
281} 294}
295#endif
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.h b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
index 2a6477834c3e..9b5465fb0bbb 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.h
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.h
@@ -13,30 +13,32 @@
13#include <asm/commproc.h> 13#include <asm/commproc.h>
14 14
15/* defines for IRQs */ 15/* defines for IRQs */
16#ifndef CONFIG_PPC_CPM_NEW_BINDING
16#define SMC1_IRQ (CPM_IRQ_OFFSET + CPMVEC_SMC1) 17#define SMC1_IRQ (CPM_IRQ_OFFSET + CPMVEC_SMC1)
17#define SMC2_IRQ (CPM_IRQ_OFFSET + CPMVEC_SMC2) 18#define SMC2_IRQ (CPM_IRQ_OFFSET + CPMVEC_SMC2)
18#define SCC1_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC1) 19#define SCC1_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC1)
19#define SCC2_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC2) 20#define SCC2_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC2)
20#define SCC3_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC3) 21#define SCC3_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC3)
21#define SCC4_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC4) 22#define SCC4_IRQ (CPM_IRQ_OFFSET + CPMVEC_SCC4)
23#endif
22 24
23static inline void cpm_set_brg(int brg, int baud) 25static inline void cpm_set_brg(int brg, int baud)
24{ 26{
25 cpm_setbrg(brg, baud); 27 cpm_setbrg(brg, baud);
26} 28}
27 29
28static inline void cpm_set_scc_fcr(volatile scc_uart_t * sup) 30static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)
29{ 31{
30 sup->scc_genscc.scc_rfcr = SMC_EB; 32 out_8(&sup->scc_genscc.scc_rfcr, SMC_EB);
31 sup->scc_genscc.scc_tfcr = SMC_EB; 33 out_8(&sup->scc_genscc.scc_tfcr, SMC_EB);
32} 34}
33 35
34static inline void cpm_set_smc_fcr(volatile smc_uart_t * up) 36static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)
35{ 37{
36 up->smc_rfcr = SMC_EB; 38 out_8(&up->smc_rfcr, SMC_EB);
37 up->smc_tfcr = SMC_EB; 39 out_8(&up->smc_tfcr, SMC_EB);
38} 40}
39 41
40#define DPRAM_BASE ((unsigned char *)cpm_dpram_addr(0)) 42#define DPRAM_BASE ((u8 __iomem __force *)cpm_dpram_addr(0))
41 43
42#endif 44#endif
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index 7b61d805ebe9..882dbc17d590 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -49,9 +49,22 @@
49 49
50/**************************************************************/ 50/**************************************************************/
51 51
52void cpm_line_cr_cmd(int line, int cmd) 52#ifdef CONFIG_PPC_CPM_NEW_BINDING
53void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
54{
55 cpm_cpm2_t __iomem *cp = cpm2_map(im_cpm);
56
57 out_be32(&cp->cp_cpcr, port->command | cmd | CPM_CR_FLG);
58 while (in_be32(&cp->cp_cpcr) & CPM_CR_FLG)
59 ;
60
61 cpm2_unmap(cp);
62}
63#else
64void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
53{ 65{
54 ulong val; 66 ulong val;
67 int line = port - cpm_uart_ports;
55 volatile cpm_cpm2_t *cp = cpm2_map(im_cpm); 68 volatile cpm_cpm2_t *cp = cpm2_map(im_cpm);
56 69
57 70
@@ -211,6 +224,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo)
211 cpm2_unmap(cpmux); 224 cpm2_unmap(cpmux);
212 cpm2_unmap(io); 225 cpm2_unmap(io);
213} 226}
227#endif
214 228
215/* 229/*
216 * Allocate DP-Ram and memory buffers. We need to allocate a transmit and 230 * Allocate DP-Ram and memory buffers. We need to allocate a transmit and
@@ -221,7 +235,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo)
221int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) 235int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
222{ 236{
223 int dpmemsz, memsz; 237 int dpmemsz, memsz;
224 u8 *dp_mem; 238 u8 __iomem *dp_mem;
225 unsigned long dp_offset; 239 unsigned long dp_offset;
226 u8 *mem_addr; 240 u8 *mem_addr;
227 dma_addr_t dma_addr = 0; 241 dma_addr_t dma_addr = 0;
@@ -264,7 +278,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
264 pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos 278 pinfo->tx_buf = pinfo->rx_buf + L1_CACHE_ALIGN(pinfo->rx_nrfifos
265 * pinfo->rx_fifosize); 279 * pinfo->rx_fifosize);
266 280
267 pinfo->rx_bd_base = (volatile cbd_t *)dp_mem; 281 pinfo->rx_bd_base = (cbd_t __iomem *)dp_mem;
268 pinfo->tx_bd_base = pinfo->rx_bd_base + pinfo->rx_nrfifos; 282 pinfo->tx_bd_base = pinfo->rx_bd_base + pinfo->rx_nrfifos;
269 283
270 return 0; 284 return 0;
@@ -275,12 +289,13 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
275 dma_free_coherent(NULL, L1_CACHE_ALIGN(pinfo->rx_nrfifos * 289 dma_free_coherent(NULL, L1_CACHE_ALIGN(pinfo->rx_nrfifos *
276 pinfo->rx_fifosize) + 290 pinfo->rx_fifosize) +
277 L1_CACHE_ALIGN(pinfo->tx_nrfifos * 291 L1_CACHE_ALIGN(pinfo->tx_nrfifos *
278 pinfo->tx_fifosize), pinfo->mem_addr, 292 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,
279 pinfo->dma_addr); 293 pinfo->dma_addr);
280 294
281 cpm_dpfree(pinfo->dp_addr); 295 cpm_dpfree(pinfo->dp_addr);
282} 296}
283 297
298#ifndef CONFIG_PPC_CPM_NEW_BINDING
284/* Setup any dynamic params in the uart desc */ 299/* Setup any dynamic params in the uart desc */
285int cpm_uart_init_portdesc(void) 300int cpm_uart_init_portdesc(void)
286{ 301{
@@ -386,3 +401,4 @@ int cpm_uart_init_portdesc(void)
386 401
387 return 0; 402 return 0;
388} 403}
404#endif
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.h b/drivers/serial/cpm_uart/cpm_uart_cpm2.h
index 1b3219f56c81..40006a7dce46 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.h
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.h
@@ -13,30 +13,32 @@
13#include <asm/cpm2.h> 13#include <asm/cpm2.h>
14 14
15/* defines for IRQs */ 15/* defines for IRQs */
16#ifndef CONFIG_PPC_CPM_NEW_BINDING
16#define SMC1_IRQ SIU_INT_SMC1 17#define SMC1_IRQ SIU_INT_SMC1
17#define SMC2_IRQ SIU_INT_SMC2 18#define SMC2_IRQ SIU_INT_SMC2
18#define SCC1_IRQ SIU_INT_SCC1 19#define SCC1_IRQ SIU_INT_SCC1
19#define SCC2_IRQ SIU_INT_SCC2 20#define SCC2_IRQ SIU_INT_SCC2
20#define SCC3_IRQ SIU_INT_SCC3 21#define SCC3_IRQ SIU_INT_SCC3
21#define SCC4_IRQ SIU_INT_SCC4 22#define SCC4_IRQ SIU_INT_SCC4
23#endif
22 24
23static inline void cpm_set_brg(int brg, int baud) 25static inline void cpm_set_brg(int brg, int baud)
24{ 26{
25 cpm_setbrg(brg, baud); 27 cpm_setbrg(brg, baud);
26} 28}
27 29
28static inline void cpm_set_scc_fcr(volatile scc_uart_t * sup) 30static inline void cpm_set_scc_fcr(scc_uart_t __iomem *sup)
29{ 31{
30 sup->scc_genscc.scc_rfcr = CPMFCR_GBL | CPMFCR_EB; 32 out_8(&sup->scc_genscc.scc_rfcr, CPMFCR_GBL | CPMFCR_EB);
31 sup->scc_genscc.scc_tfcr = CPMFCR_GBL | CPMFCR_EB; 33 out_8(&sup->scc_genscc.scc_tfcr, CPMFCR_GBL | CPMFCR_EB);
32} 34}
33 35
34static inline void cpm_set_smc_fcr(volatile smc_uart_t * up) 36static inline void cpm_set_smc_fcr(smc_uart_t __iomem *up)
35{ 37{
36 up->smc_rfcr = CPMFCR_GBL | CPMFCR_EB; 38 out_8(&up->smc_rfcr, CPMFCR_GBL | CPMFCR_EB);
37 up->smc_tfcr = CPMFCR_GBL | CPMFCR_EB; 39 out_8(&up->smc_tfcr, CPMFCR_GBL | CPMFCR_EB);
38} 40}
39 41
40#define DPRAM_BASE ((unsigned char *)cpm_dpram_addr(0)) 42#define DPRAM_BASE ((u8 __iomem __force *)cpm_dpram_addr(0))
41 43
42#endif 44#endif
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 35f8b86cc78f..035cca028199 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -1051,7 +1051,7 @@ mpc52xx_uart_of_assign(struct device_node *np, int idx)
1051 /* If the slot is already occupied, then swap slots */ 1051 /* If the slot is already occupied, then swap slots */
1052 if (mpc52xx_uart_nodes[idx] && (free_idx != -1)) 1052 if (mpc52xx_uart_nodes[idx] && (free_idx != -1))
1053 mpc52xx_uart_nodes[free_idx] = mpc52xx_uart_nodes[idx]; 1053 mpc52xx_uart_nodes[free_idx] = mpc52xx_uart_nodes[idx];
1054 mpc52xx_uart_nodes[i] = np; 1054 mpc52xx_uart_nodes[idx] = np;
1055} 1055}
1056 1056
1057static void 1057static void
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
index 0fa9f6761763..794bd0f50d73 100644
--- a/drivers/serial/pmac_zilog.c
+++ b/drivers/serial/pmac_zilog.c
@@ -88,6 +88,16 @@ MODULE_LICENSE("GPL");
88 88
89#define PWRDBG(fmt, arg...) printk(KERN_DEBUG fmt , ## arg) 89#define PWRDBG(fmt, arg...) printk(KERN_DEBUG fmt , ## arg)
90 90
91#ifdef CONFIG_SERIAL_PMACZILOG_TTYS
92#define PMACZILOG_MAJOR TTY_MAJOR
93#define PMACZILOG_MINOR 64
94#define PMACZILOG_NAME "ttyS"
95#else
96#define PMACZILOG_MAJOR 204
97#define PMACZILOG_MINOR 192
98#define PMACZILOG_NAME "ttyPZ"
99#endif
100
91 101
92/* 102/*
93 * For the sake of early serial console, we can do a pre-probe 103 * For the sake of early serial console, we can do a pre-probe
@@ -99,9 +109,10 @@ static DEFINE_MUTEX(pmz_irq_mutex);
99 109
100static struct uart_driver pmz_uart_reg = { 110static struct uart_driver pmz_uart_reg = {
101 .owner = THIS_MODULE, 111 .owner = THIS_MODULE,
102 .driver_name = "ttyS", 112 .driver_name = PMACZILOG_NAME,
103 .dev_name = "ttyS", 113 .dev_name = PMACZILOG_NAME,
104 .major = TTY_MAJOR, 114 .major = PMACZILOG_MAJOR,
115 .minor = PMACZILOG_MINOR,
105}; 116};
106 117
107 118
@@ -1587,7 +1598,7 @@ static int pmz_suspend(struct macio_dev *mdev, pm_message_t pm_state)
1587 if (pm_state.event == mdev->ofdev.dev.power.power_state.event) 1598 if (pm_state.event == mdev->ofdev.dev.power.power_state.event)
1588 return 0; 1599 return 0;
1589 1600
1590 pmz_debug("suspend, switching to state %d\n", pm_state); 1601 pmz_debug("suspend, switching to state %d\n", pm_state.event);
1591 1602
1592 state = pmz_uart_reg.state + uap->port.line; 1603 state = pmz_uart_reg.state + uap->port.line;
1593 1604
@@ -1778,7 +1789,7 @@ static void pmz_console_write(struct console *con, const char *s, unsigned int c
1778static int __init pmz_console_setup(struct console *co, char *options); 1789static int __init pmz_console_setup(struct console *co, char *options);
1779 1790
1780static struct console pmz_console = { 1791static struct console pmz_console = {
1781 .name = "ttyS", 1792 .name = PMACZILOG_NAME,
1782 .write = pmz_console_write, 1793 .write = pmz_console_write,
1783 .device = uart_console_device, 1794 .device = uart_console_device,
1784 .setup = pmz_console_setup, 1795 .setup = pmz_console_setup,
@@ -1802,7 +1813,6 @@ static int __init pmz_register(void)
1802 1813
1803 pmz_uart_reg.nr = pmz_ports_count; 1814 pmz_uart_reg.nr = pmz_ports_count;
1804 pmz_uart_reg.cons = PMACZILOG_CONSOLE; 1815 pmz_uart_reg.cons = PMACZILOG_CONSOLE;
1805 pmz_uart_reg.minor = 64;
1806 1816
1807 /* 1817 /*
1808 * Register this driver with the serial core 1818 * Register this driver with the serial core
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index f5051cf1a0c8..dfef83f14960 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -1,7 +1,8 @@
1/* 1/*
2 * uartlite.c: Serial driver for Xilinx uartlite serial controller 2 * uartlite.c: Serial driver for Xilinx uartlite serial controller
3 * 3 *
4 * Peter Korsgaard <jacmet@sunsite.dk> 4 * Copyright (C) 2006 Peter Korsgaard <jacmet@sunsite.dk>
5 * Copyright (C) 2007 Secret Lab Technologies Ltd.
5 * 6 *
6 * This file is licensed under the terms of the GNU General Public License 7 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any 8 * version 2. This program is licensed "as is" without any warranty of any
@@ -17,14 +18,23 @@
17#include <linux/delay.h> 18#include <linux/delay.h>
18#include <linux/interrupt.h> 19#include <linux/interrupt.h>
19#include <asm/io.h> 20#include <asm/io.h>
21#if defined(CONFIG_OF)
22#include <linux/of_device.h>
23#include <linux/of_platform.h>
24#endif
20 25
26#define ULITE_NAME "ttyUL"
21#define ULITE_MAJOR 204 27#define ULITE_MAJOR 204
22#define ULITE_MINOR 187 28#define ULITE_MINOR 187
23#define ULITE_NR_UARTS 4 29#define ULITE_NR_UARTS 4
24 30
25/* For register details see datasheet: 31/* ---------------------------------------------------------------------
26 http://www.xilinx.com/bvdocs/ipcenter/data_sheet/opb_uartlite.pdf 32 * Register definitions
27*/ 33 *
34 * For register details see datasheet:
35 * http://www.xilinx.com/bvdocs/ipcenter/data_sheet/opb_uartlite.pdf
36 */
37
28#define ULITE_RX 0x00 38#define ULITE_RX 0x00
29#define ULITE_TX 0x04 39#define ULITE_TX 0x04
30#define ULITE_STATUS 0x08 40#define ULITE_STATUS 0x08
@@ -46,7 +56,11 @@
46#define ULITE_CONTROL_IE 0x10 56#define ULITE_CONTROL_IE 0x10
47 57
48 58
49static struct uart_port ports[ULITE_NR_UARTS]; 59static struct uart_port ulite_ports[ULITE_NR_UARTS];
60
61/* ---------------------------------------------------------------------
62 * Core UART driver operations
63 */
50 64
51static int ulite_receive(struct uart_port *port, int stat) 65static int ulite_receive(struct uart_port *port, int stat)
52{ 66{
@@ -307,6 +321,10 @@ static struct uart_ops ulite_ops = {
307 .verify_port = ulite_verify_port 321 .verify_port = ulite_verify_port
308}; 322};
309 323
324/* ---------------------------------------------------------------------
325 * Console driver operations
326 */
327
310#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE 328#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
311static void ulite_console_wait_tx(struct uart_port *port) 329static void ulite_console_wait_tx(struct uart_port *port)
312{ 330{
@@ -329,7 +347,7 @@ static void ulite_console_putchar(struct uart_port *port, int ch)
329static void ulite_console_write(struct console *co, const char *s, 347static void ulite_console_write(struct console *co, const char *s,
330 unsigned int count) 348 unsigned int count)
331{ 349{
332 struct uart_port *port = &ports[co->index]; 350 struct uart_port *port = &ulite_ports[co->index];
333 unsigned long flags; 351 unsigned long flags;
334 unsigned int ier; 352 unsigned int ier;
335 int locked = 1; 353 int locked = 1;
@@ -355,6 +373,31 @@ static void ulite_console_write(struct console *co, const char *s,
355 spin_unlock_irqrestore(&port->lock, flags); 373 spin_unlock_irqrestore(&port->lock, flags);
356} 374}
357 375
376#if defined(CONFIG_OF)
377static inline void __init ulite_console_of_find_device(int id)
378{
379 struct device_node *np;
380 struct resource res;
381 const unsigned int *of_id;
382 int rc;
383
384 for_each_compatible_node(np, NULL, "xilinx,uartlite") {
385 of_id = of_get_property(np, "port-number", NULL);
386 if ((!of_id) || (*of_id != id))
387 continue;
388
389 rc = of_address_to_resource(np, 0, &res);
390 if (rc)
391 continue;
392
393 ulite_ports[id].mapbase = res.start;
394 return;
395 }
396}
397#else /* CONFIG_OF */
398static inline void __init ulite_console_of_find_device(int id) { /* do nothing */ }
399#endif /* CONFIG_OF */
400
358static int __init ulite_console_setup(struct console *co, char *options) 401static int __init ulite_console_setup(struct console *co, char *options)
359{ 402{
360 struct uart_port *port; 403 struct uart_port *port;
@@ -366,11 +409,23 @@ static int __init ulite_console_setup(struct console *co, char *options)
366 if (co->index < 0 || co->index >= ULITE_NR_UARTS) 409 if (co->index < 0 || co->index >= ULITE_NR_UARTS)
367 return -EINVAL; 410 return -EINVAL;
368 411
369 port = &ports[co->index]; 412 port = &ulite_ports[co->index];
370 413
371 /* not initialized yet? */ 414 /* Check if it is an OF device */
372 if (!port->membase) 415 if (!port->mapbase)
416 ulite_console_of_find_device(co->index);
417
418 /* Do we have a device now? */
419 if (!port->mapbase) {
420 pr_debug("console on ttyUL%i not present\n", co->index);
373 return -ENODEV; 421 return -ENODEV;
422 }
423
424 /* not initialized yet? */
425 if (!port->membase) {
426 if (ulite_request_port(port))
427 return -ENODEV;
428 }
374 429
375 if (options) 430 if (options)
376 uart_parse_options(options, &baud, &parity, &bits, &flow); 431 uart_parse_options(options, &baud, &parity, &bits, &flow);
@@ -381,7 +436,7 @@ static int __init ulite_console_setup(struct console *co, char *options)
381static struct uart_driver ulite_uart_driver; 436static struct uart_driver ulite_uart_driver;
382 437
383static struct console ulite_console = { 438static struct console ulite_console = {
384 .name = "ttyUL", 439 .name = ULITE_NAME,
385 .write = ulite_console_write, 440 .write = ulite_console_write,
386 .device = uart_console_device, 441 .device = uart_console_device,
387 .setup = ulite_console_setup, 442 .setup = ulite_console_setup,
@@ -403,7 +458,7 @@ console_initcall(ulite_console_init);
403static struct uart_driver ulite_uart_driver = { 458static struct uart_driver ulite_uart_driver = {
404 .owner = THIS_MODULE, 459 .owner = THIS_MODULE,
405 .driver_name = "uartlite", 460 .driver_name = "uartlite",
406 .dev_name = "ttyUL", 461 .dev_name = ULITE_NAME,
407 .major = ULITE_MAJOR, 462 .major = ULITE_MAJOR,
408 .minor = ULITE_MINOR, 463 .minor = ULITE_MINOR,
409 .nr = ULITE_NR_UARTS, 464 .nr = ULITE_NR_UARTS,
@@ -412,59 +467,111 @@ static struct uart_driver ulite_uart_driver = {
412#endif 467#endif
413}; 468};
414 469
415static int __devinit ulite_probe(struct platform_device *pdev) 470/* ---------------------------------------------------------------------
471 * Port assignment functions (mapping devices to uart_port structures)
472 */
473
474/** ulite_assign: register a uartlite device with the driver
475 *
476 * @dev: pointer to device structure
477 * @id: requested id number. Pass -1 for automatic port assignment
478 * @base: base address of uartlite registers
479 * @irq: irq number for uartlite
480 *
481 * Returns: 0 on success, <0 otherwise
482 */
483static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq)
416{ 484{
417 struct resource *res, *res2;
418 struct uart_port *port; 485 struct uart_port *port;
486 int rc;
419 487
420 if (pdev->id < 0 || pdev->id >= ULITE_NR_UARTS) 488 /* if id = -1; then scan for a free id and use that */
489 if (id < 0) {
490 for (id = 0; id < ULITE_NR_UARTS; id++)
491 if (ulite_ports[id].mapbase == 0)
492 break;
493 }
494 if (id < 0 || id >= ULITE_NR_UARTS) {
495 dev_err(dev, "%s%i too large\n", ULITE_NAME, id);
421 return -EINVAL; 496 return -EINVAL;
497 }
422 498
423 if (ports[pdev->id].membase) 499 if ((ulite_ports[id].mapbase) && (ulite_ports[id].mapbase != base)) {
500 dev_err(dev, "cannot assign to %s%i; it is already in use\n",
501 ULITE_NAME, id);
424 return -EBUSY; 502 return -EBUSY;
503 }
425 504
426 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 505 port = &ulite_ports[id];
427 if (!res)
428 return -ENODEV;
429 506
430 res2 = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 507 spin_lock_init(&port->lock);
431 if (!res2) 508 port->fifosize = 16;
432 return -ENODEV; 509 port->regshift = 2;
510 port->iotype = UPIO_MEM;
511 port->iobase = 1; /* mark port in use */
512 port->mapbase = base;
513 port->membase = NULL;
514 port->ops = &ulite_ops;
515 port->irq = irq;
516 port->flags = UPF_BOOT_AUTOCONF;
517 port->dev = dev;
518 port->type = PORT_UNKNOWN;
519 port->line = id;
520
521 dev_set_drvdata(dev, port);
522
523 /* Register the port */
524 rc = uart_add_one_port(&ulite_uart_driver, port);
525 if (rc) {
526 dev_err(dev, "uart_add_one_port() failed; err=%i\n", rc);
527 port->mapbase = 0;
528 dev_set_drvdata(dev, NULL);
529 return rc;
530 }
433 531
434 port = &ports[pdev->id]; 532 return 0;
533}
435 534
436 port->fifosize = 16; 535/** ulite_release: register a uartlite device with the driver
437 port->regshift = 2; 536 *
438 port->iotype = UPIO_MEM; 537 * @dev: pointer to device structure
439 port->iobase = 1; /* mark port in use */ 538 */
440 port->mapbase = res->start; 539static int __devinit ulite_release(struct device *dev)
441 port->membase = NULL; 540{
442 port->ops = &ulite_ops; 541 struct uart_port *port = dev_get_drvdata(dev);
443 port->irq = res2->start; 542 int rc = 0;
444 port->flags = UPF_BOOT_AUTOCONF;
445 port->dev = &pdev->dev;
446 port->type = PORT_UNKNOWN;
447 port->line = pdev->id;
448 543
449 uart_add_one_port(&ulite_uart_driver, port); 544 if (port) {
450 platform_set_drvdata(pdev, port); 545 rc = uart_remove_one_port(&ulite_uart_driver, port);
546 dev_set_drvdata(dev, NULL);
547 port->mapbase = 0;
548 }
451 549
452 return 0; 550 return rc;
453} 551}
454 552
455static int ulite_remove(struct platform_device *pdev) 553/* ---------------------------------------------------------------------
554 * Platform bus binding
555 */
556
557static int __devinit ulite_probe(struct platform_device *pdev)
456{ 558{
457 struct uart_port *port = platform_get_drvdata(pdev); 559 struct resource *res, *res2;
458 560
459 platform_set_drvdata(pdev, NULL); 561 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
562 if (!res)
563 return -ENODEV;
460 564
461 if (port) 565 res2 = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
462 uart_remove_one_port(&ulite_uart_driver, port); 566 if (!res2)
567 return -ENODEV;
463 568
464 /* mark port as free */ 569 return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start);
465 port->membase = NULL; 570}
466 571
467 return 0; 572static int ulite_remove(struct platform_device *pdev)
573{
574 return ulite_release(&pdev->dev);
468} 575}
469 576
470static struct platform_driver ulite_platform_driver = { 577static struct platform_driver ulite_platform_driver = {
@@ -476,24 +583,109 @@ static struct platform_driver ulite_platform_driver = {
476 }, 583 },
477}; 584};
478 585
586/* ---------------------------------------------------------------------
587 * OF bus bindings
588 */
589#if defined(CONFIG_OF)
590static int __devinit
591ulite_of_probe(struct of_device *op, const struct of_device_id *match)
592{
593 struct resource res;
594 const unsigned int *id;
595 int irq, rc;
596
597 dev_dbg(&op->dev, "%s(%p, %p)\n", __FUNCTION__, op, match);
598
599 rc = of_address_to_resource(op->node, 0, &res);
600 if (rc) {
601 dev_err(&op->dev, "invalid address\n");
602 return rc;
603 }
604
605 irq = irq_of_parse_and_map(op->node, 0);
606
607 id = of_get_property(op->node, "port-number", NULL);
608
609 return ulite_assign(&op->dev, id ? *id : -1, res.start+3, irq);
610}
611
612static int __devexit ulite_of_remove(struct of_device *op)
613{
614 return ulite_release(&op->dev);
615}
616
617/* Match table for of_platform binding */
618static struct of_device_id __devinit ulite_of_match[] = {
619 { .type = "serial", .compatible = "xilinx,uartlite", },
620 {},
621};
622MODULE_DEVICE_TABLE(of, ulite_of_match);
623
624static struct of_platform_driver ulite_of_driver = {
625 .owner = THIS_MODULE,
626 .name = "uartlite",
627 .match_table = ulite_of_match,
628 .probe = ulite_of_probe,
629 .remove = __devexit_p(ulite_of_remove),
630 .driver = {
631 .name = "uartlite",
632 },
633};
634
635/* Registration helpers to keep the number of #ifdefs to a minimum */
636static inline int __init ulite_of_register(void)
637{
638 pr_debug("uartlite: calling of_register_platform_driver()\n");
639 return of_register_platform_driver(&ulite_of_driver);
640}
641
642static inline void __exit ulite_of_unregister(void)
643{
644 of_unregister_platform_driver(&ulite_of_driver);
645}
646#else /* CONFIG_OF */
647/* CONFIG_OF not enabled; do nothing helpers */
648static inline int __init ulite_of_register(void) { return 0; }
649static inline void __exit ulite_of_unregister(void) { }
650#endif /* CONFIG_OF */
651
652/* ---------------------------------------------------------------------
653 * Module setup/teardown
654 */
655
479int __init ulite_init(void) 656int __init ulite_init(void)
480{ 657{
481 int ret; 658 int ret;
482 659
660 pr_debug("uartlite: calling uart_register_driver()\n");
483 ret = uart_register_driver(&ulite_uart_driver); 661 ret = uart_register_driver(&ulite_uart_driver);
484 if (ret) 662 if (ret)
485 return ret; 663 goto err_uart;
486 664
665 ret = ulite_of_register();
666 if (ret)
667 goto err_of;
668
669 pr_debug("uartlite: calling platform_driver_register()\n");
487 ret = platform_driver_register(&ulite_platform_driver); 670 ret = platform_driver_register(&ulite_platform_driver);
488 if (ret) 671 if (ret)
489 uart_unregister_driver(&ulite_uart_driver); 672 goto err_plat;
490 673
674 return 0;
675
676err_plat:
677 ulite_of_unregister();
678err_of:
679 uart_unregister_driver(&ulite_uart_driver);
680err_uart:
681 printk(KERN_ERR "registering uartlite driver failed: err=%i", ret);
491 return ret; 682 return ret;
492} 683}
493 684
494void __exit ulite_exit(void) 685void __exit ulite_exit(void)
495{ 686{
496 platform_driver_unregister(&ulite_platform_driver); 687 platform_driver_unregister(&ulite_platform_driver);
688 ulite_of_unregister();
497 uart_unregister_driver(&ulite_uart_driver); 689 uart_unregister_driver(&ulite_uart_driver);
498} 690}
499 691
diff --git a/drivers/video/platinumfb.c b/drivers/video/platinumfb.c
index 8503e733a172..cbe71a5338d0 100644
--- a/drivers/video/platinumfb.c
+++ b/drivers/video/platinumfb.c
@@ -17,6 +17,8 @@
17 * more details. 17 * more details.
18 */ 18 */
19 19
20#undef DEBUG
21
20#include <linux/module.h> 22#include <linux/module.h>
21#include <linux/kernel.h> 23#include <linux/kernel.h>
22#include <linux/errno.h> 24#include <linux/errno.h>
@@ -535,33 +537,35 @@ static int __devinit platinumfb_probe(struct of_device* odev,
535 volatile __u8 *fbuffer; 537 volatile __u8 *fbuffer;
536 int bank0, bank1, bank2, bank3, rc; 538 int bank0, bank1, bank2, bank3, rc;
537 539
538 printk(KERN_INFO "platinumfb: Found Apple Platinum video hardware\n"); 540 dev_info(&odev->dev, "Found Apple Platinum video hardware\n");
539 541
540 info = framebuffer_alloc(sizeof(*pinfo), &odev->dev); 542 info = framebuffer_alloc(sizeof(*pinfo), &odev->dev);
541 if (info == NULL) 543 if (info == NULL) {
544 dev_err(&odev->dev, "Failed to allocate fbdev !\n");
542 return -ENOMEM; 545 return -ENOMEM;
546 }
543 pinfo = info->par; 547 pinfo = info->par;
544 548
545 if (of_address_to_resource(dp, 0, &pinfo->rsrc_reg) || 549 if (of_address_to_resource(dp, 0, &pinfo->rsrc_reg) ||
546 of_address_to_resource(dp, 1, &pinfo->rsrc_fb)) { 550 of_address_to_resource(dp, 1, &pinfo->rsrc_fb)) {
547 printk(KERN_ERR "platinumfb: Can't get resources\n"); 551 dev_err(&odev->dev, "Can't get resources\n");
548 framebuffer_release(info);
549 return -ENXIO;
550 }
551 if (!request_mem_region(pinfo->rsrc_reg.start,
552 pinfo->rsrc_reg.start -
553 pinfo->rsrc_reg.end + 1,
554 "platinumfb registers")) {
555 framebuffer_release(info); 552 framebuffer_release(info);
556 return -ENXIO; 553 return -ENXIO;
557 } 554 }
555 dev_dbg(&odev->dev, " registers : 0x%llx...0x%llx\n",
556 (unsigned long long)pinfo->rsrc_reg.start,
557 (unsigned long long)pinfo->rsrc_reg.end);
558 dev_dbg(&odev->dev, " framebuffer: 0x%llx...0x%llx\n",
559 (unsigned long long)pinfo->rsrc_fb.start,
560 (unsigned long long)pinfo->rsrc_fb.end);
561
562 /* Do not try to request register space, they overlap with the
563 * northbridge and that can fail. Only request framebuffer
564 */
558 if (!request_mem_region(pinfo->rsrc_fb.start, 565 if (!request_mem_region(pinfo->rsrc_fb.start,
559 pinfo->rsrc_fb.start 566 pinfo->rsrc_fb.end - pinfo->rsrc_fb.start + 1,
560 - pinfo->rsrc_fb.end + 1,
561 "platinumfb framebuffer")) { 567 "platinumfb framebuffer")) {
562 release_mem_region(pinfo->rsrc_reg.start, 568 printk(KERN_ERR "platinumfb: Can't request framebuffer !\n");
563 pinfo->rsrc_reg.end -
564 pinfo->rsrc_reg.start + 1);
565 framebuffer_release(info); 569 framebuffer_release(info);
566 return -ENXIO; 570 return -ENXIO;
567 } 571 }
@@ -600,7 +604,8 @@ static int __devinit platinumfb_probe(struct of_device* odev,
600 bank2 = fbuffer[0x200000] == 0x56; 604 bank2 = fbuffer[0x200000] == 0x56;
601 bank3 = fbuffer[0x300000] == 0x78; 605 bank3 = fbuffer[0x300000] == 0x78;
602 pinfo->total_vram = (bank0 + bank1 + bank2 + bank3) * 0x100000; 606 pinfo->total_vram = (bank0 + bank1 + bank2 + bank3) * 0x100000;
603 printk(KERN_INFO "platinumfb: Total VRAM = %dMB (%d%d%d%d)\n", (int) (pinfo->total_vram / 1024 / 1024), 607 printk(KERN_INFO "platinumfb: Total VRAM = %dMB (%d%d%d%d)\n",
608 (unsigned int) (pinfo->total_vram / 1024 / 1024),
604 bank3, bank2, bank1, bank0); 609 bank3, bank2, bank1, bank0);
605 610
606 /* 611 /*
@@ -644,16 +649,15 @@ static int __devexit platinumfb_remove(struct of_device* odev)
644 unregister_framebuffer (info); 649 unregister_framebuffer (info);
645 650
646 /* Unmap frame buffer and registers */ 651 /* Unmap frame buffer and registers */
652 iounmap(pinfo->frame_buffer);
653 iounmap(pinfo->platinum_regs);
654 iounmap(pinfo->cmap_regs);
655
647 release_mem_region(pinfo->rsrc_fb.start, 656 release_mem_region(pinfo->rsrc_fb.start,
648 pinfo->rsrc_fb.end - 657 pinfo->rsrc_fb.end -
649 pinfo->rsrc_fb.start + 1); 658 pinfo->rsrc_fb.start + 1);
650 release_mem_region(pinfo->rsrc_reg.start, 659
651 pinfo->rsrc_reg.end -
652 pinfo->rsrc_reg.start + 1);
653 iounmap(pinfo->frame_buffer);
654 iounmap(pinfo->platinum_regs);
655 release_mem_region(pinfo->cmap_regs_phys, 0x1000); 660 release_mem_region(pinfo->cmap_regs_phys, 0x1000);
656 iounmap(pinfo->cmap_regs);
657 661
658 framebuffer_release(info); 662 framebuffer_release(info);
659 663
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index 6ef9733a18d4..6ef99b2d13ca 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -6,9 +6,12 @@
6 * Author: MontaVista Software, Inc. 6 * Author: MontaVista Software, Inc.
7 * source@mvista.com 7 * source@mvista.com
8 * 8 *
9 * 2002-2007 (c) MontaVista Software, Inc. This file is licensed under the 9 * 2002-2007 (c) MontaVista Software, Inc.
10 * terms of the GNU General Public License version 2. This program is licensed 10 * 2007 (c) Secret Lab Technologies, Ltd.
11 * "as is" without any warranty of any kind, whether express or implied. 11 *
12 * This file is licensed under the terms of the GNU General Public License
13 * version 2. This program is licensed "as is" without any warranty of any
14 * kind, whether express or implied.
12 */ 15 */
13 16
14/* 17/*
@@ -18,6 +21,7 @@
18 * Geert Uytterhoeven. 21 * Geert Uytterhoeven.
19 */ 22 */
20 23
24#include <linux/device.h>
21#include <linux/module.h> 25#include <linux/module.h>
22#include <linux/kernel.h> 26#include <linux/kernel.h>
23#include <linux/version.h> 27#include <linux/version.h>
@@ -28,9 +32,12 @@
28#include <linux/init.h> 32#include <linux/init.h>
29#include <linux/dma-mapping.h> 33#include <linux/dma-mapping.h>
30#include <linux/platform_device.h> 34#include <linux/platform_device.h>
31 35#if defined(CONFIG_OF)
36#include <linux/of_device.h>
37#include <linux/of_platform.h>
38#endif
32#include <asm/io.h> 39#include <asm/io.h>
33#include <syslib/virtex_devices.h> 40#include <linux/xilinxfb.h>
34 41
35#define DRIVER_NAME "xilinxfb" 42#define DRIVER_NAME "xilinxfb"
36#define DRIVER_DESCRIPTION "Xilinx TFT LCD frame buffer driver" 43#define DRIVER_DESCRIPTION "Xilinx TFT LCD frame buffer driver"
@@ -63,12 +70,6 @@
63 */ 70 */
64#define BYTES_PER_PIXEL 4 71#define BYTES_PER_PIXEL 4
65#define BITS_PER_PIXEL (BYTES_PER_PIXEL * 8) 72#define BITS_PER_PIXEL (BYTES_PER_PIXEL * 8)
66#define XRES 640
67#define YRES 480
68#define XRES_VIRTUAL 1024
69#define YRES_VIRTUAL YRES
70#define LINE_LENGTH (XRES_VIRTUAL * BYTES_PER_PIXEL)
71#define FB_SIZE (YRES_VIRTUAL * LINE_LENGTH)
72 73
73#define RED_SHIFT 16 74#define RED_SHIFT 16
74#define GREEN_SHIFT 8 75#define GREEN_SHIFT 8
@@ -77,23 +78,26 @@
77#define PALETTE_ENTRIES_NO 16 /* passed to fb_alloc_cmap() */ 78#define PALETTE_ENTRIES_NO 16 /* passed to fb_alloc_cmap() */
78 79
79/* 80/*
81 * Default xilinxfb configuration
82 */
83static struct xilinxfb_platform_data xilinx_fb_default_pdata = {
84 .xres = 640,
85 .yres = 480,
86 .xvirt = 1024,
87 .yvirt = 480;
88};
89
90/*
80 * Here are the default fb_fix_screeninfo and fb_var_screeninfo structures 91 * Here are the default fb_fix_screeninfo and fb_var_screeninfo structures
81 */ 92 */
82static struct fb_fix_screeninfo xilinx_fb_fix = { 93static struct fb_fix_screeninfo xilinx_fb_fix = {
83 .id = "Xilinx", 94 .id = "Xilinx",
84 .type = FB_TYPE_PACKED_PIXELS, 95 .type = FB_TYPE_PACKED_PIXELS,
85 .visual = FB_VISUAL_TRUECOLOR, 96 .visual = FB_VISUAL_TRUECOLOR,
86 .smem_len = FB_SIZE,
87 .line_length = LINE_LENGTH,
88 .accel = FB_ACCEL_NONE 97 .accel = FB_ACCEL_NONE
89}; 98};
90 99
91static struct fb_var_screeninfo xilinx_fb_var = { 100static struct fb_var_screeninfo xilinx_fb_var = {
92 .xres = XRES,
93 .yres = YRES,
94 .xres_virtual = XRES_VIRTUAL,
95 .yres_virtual = YRES_VIRTUAL,
96
97 .bits_per_pixel = BITS_PER_PIXEL, 101 .bits_per_pixel = BITS_PER_PIXEL,
98 102
99 .red = { RED_SHIFT, 8, 0 }, 103 .red = { RED_SHIFT, 8, 0 },
@@ -111,8 +115,9 @@ struct xilinxfb_drvdata {
111 u32 regs_phys; /* phys. address of the control registers */ 115 u32 regs_phys; /* phys. address of the control registers */
112 u32 __iomem *regs; /* virt. address of the control registers */ 116 u32 __iomem *regs; /* virt. address of the control registers */
113 117
114 unsigned char __iomem *fb_virt; /* virt. address of the frame buffer */ 118 void *fb_virt; /* virt. address of the frame buffer */
115 dma_addr_t fb_phys; /* phys. address of the frame buffer */ 119 dma_addr_t fb_phys; /* phys. address of the frame buffer */
120 int fb_alloced; /* Flag, was the fb memory alloced? */
116 121
117 u32 reg_ctrl_default; 122 u32 reg_ctrl_default;
118 123
@@ -195,130 +200,136 @@ static struct fb_ops xilinxfb_ops =
195 .fb_imageblit = cfb_imageblit, 200 .fb_imageblit = cfb_imageblit,
196}; 201};
197 202
198/* === The device driver === */ 203/* ---------------------------------------------------------------------
204 * Bus independent setup/teardown
205 */
199 206
200static int 207static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
201xilinxfb_drv_probe(struct device *dev) 208 struct xilinxfb_platform_data *pdata)
202{ 209{
203 struct platform_device *pdev;
204 struct xilinxfb_platform_data *pdata;
205 struct xilinxfb_drvdata *drvdata; 210 struct xilinxfb_drvdata *drvdata;
206 struct resource *regs_res; 211 int rc;
207 int retval; 212 int fbsize = pdata->xvirt * pdata->yvirt * BYTES_PER_PIXEL;
208
209 if (!dev)
210 return -EINVAL;
211
212 pdev = to_platform_device(dev);
213 pdata = pdev->dev.platform_data;
214 213
214 /* Allocate the driver data region */
215 drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); 215 drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
216 if (!drvdata) { 216 if (!drvdata) {
217 printk(KERN_ERR "Couldn't allocate device private record\n"); 217 dev_err(dev, "Couldn't allocate device private record\n");
218 return -ENOMEM; 218 return -ENOMEM;
219 } 219 }
220 dev_set_drvdata(dev, drvdata); 220 dev_set_drvdata(dev, drvdata);
221 221
222 /* Map the control registers in */ 222 /* Map the control registers in */
223 regs_res = platform_get_resource(pdev, IORESOURCE_IO, 0); 223 if (!request_mem_region(physaddr, 8, DRIVER_NAME)) {
224 if (!regs_res || (regs_res->end - regs_res->start + 1 < 8)) { 224 dev_err(dev, "Couldn't lock memory region at 0x%08lX\n",
225 printk(KERN_ERR "Couldn't get registers resource\n"); 225 physaddr);
226 retval = -EFAULT; 226 rc = -ENODEV;
227 goto failed1; 227 goto err_region;
228 } 228 }
229 229 drvdata->regs_phys = physaddr;
230 if (!request_mem_region(regs_res->start, 8, DRIVER_NAME)) { 230 drvdata->regs = ioremap(physaddr, 8);
231 printk(KERN_ERR 231 if (!drvdata->regs) {
232 "Couldn't lock memory region at 0x%08X\n", 232 dev_err(dev, "Couldn't lock memory region at 0x%08lX\n",
233 regs_res->start); 233 physaddr);
234 retval = -EBUSY; 234 rc = -ENODEV;
235 goto failed1; 235 goto err_map;
236 } 236 }
237 drvdata->regs = (u32 __iomem*) ioremap(regs_res->start, 8);
238 drvdata->regs_phys = regs_res->start;
239 237
240 /* Allocate the framebuffer memory */ 238 /* Allocate the framebuffer memory */
241 drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(FB_SIZE), 239 if (pdata->fb_phys) {
242 &drvdata->fb_phys, GFP_KERNEL); 240 drvdata->fb_phys = pdata->fb_phys;
241 drvdata->fb_virt = ioremap(pdata->fb_phys, fbsize);
242 } else {
243 drvdata->fb_alloced = 1;
244 drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize),
245 &drvdata->fb_phys, GFP_KERNEL);
246 }
247
243 if (!drvdata->fb_virt) { 248 if (!drvdata->fb_virt) {
244 printk(KERN_ERR "Could not allocate frame buffer memory\n"); 249 dev_err(dev, "Could not allocate frame buffer memory\n");
245 retval = -ENOMEM; 250 rc = -ENOMEM;
246 goto failed2; 251 goto err_fbmem;
247 } 252 }
248 253
249 /* Clear (turn to black) the framebuffer */ 254 /* Clear (turn to black) the framebuffer */
250 memset_io((void *) drvdata->fb_virt, 0, FB_SIZE); 255 memset_io((void __iomem *)drvdata->fb_virt, 0, fbsize);
251 256
252 /* Tell the hardware where the frame buffer is */ 257 /* Tell the hardware where the frame buffer is */
253 xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys); 258 xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
254 259
255 /* Turn on the display */ 260 /* Turn on the display */
256 drvdata->reg_ctrl_default = REG_CTRL_ENABLE; 261 drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
257 if (pdata && pdata->rotate_screen) 262 if (pdata->rotate_screen)
258 drvdata->reg_ctrl_default |= REG_CTRL_ROTATE; 263 drvdata->reg_ctrl_default |= REG_CTRL_ROTATE;
259 xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default); 264 xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
260 265
261 /* Fill struct fb_info */ 266 /* Fill struct fb_info */
262 drvdata->info.device = dev; 267 drvdata->info.device = dev;
263 drvdata->info.screen_base = drvdata->fb_virt; 268 drvdata->info.screen_base = (void __iomem *)drvdata->fb_virt;
264 drvdata->info.fbops = &xilinxfb_ops; 269 drvdata->info.fbops = &xilinxfb_ops;
265 drvdata->info.fix = xilinx_fb_fix; 270 drvdata->info.fix = xilinx_fb_fix;
266 drvdata->info.fix.smem_start = drvdata->fb_phys; 271 drvdata->info.fix.smem_start = drvdata->fb_phys;
267 drvdata->info.pseudo_palette = drvdata->pseudo_palette; 272 drvdata->info.fix.smem_len = fbsize;
268 273 drvdata->info.fix.line_length = pdata->xvirt * BYTES_PER_PIXEL;
269 if (fb_alloc_cmap(&drvdata->info.cmap, PALETTE_ENTRIES_NO, 0) < 0) {
270 printk(KERN_ERR "Fail to allocate colormap (%d entries)\n",
271 PALETTE_ENTRIES_NO);
272 retval = -EFAULT;
273 goto failed3;
274 }
275 274
275 drvdata->info.pseudo_palette = drvdata->pseudo_palette;
276 drvdata->info.flags = FBINFO_DEFAULT; 276 drvdata->info.flags = FBINFO_DEFAULT;
277 if (pdata) {
278 xilinx_fb_var.height = pdata->screen_height_mm;
279 xilinx_fb_var.width = pdata->screen_width_mm;
280 }
281 drvdata->info.var = xilinx_fb_var; 277 drvdata->info.var = xilinx_fb_var;
278 drvdata->info.var.height = pdata->screen_height_mm;
279 drvdata->info.var.width = pdata->screen_width_mm;
280 drvdata->info.var.xres = pdata->xres;
281 drvdata->info.var.yres = pdata->yres;
282 drvdata->info.var.xres_virtual = pdata->xvirt;
283 drvdata->info.var.yres_virtual = pdata->yvirt;
284
285 /* Allocate a colour map */
286 rc = fb_alloc_cmap(&drvdata->info.cmap, PALETTE_ENTRIES_NO, 0);
287 if (rc) {
288 dev_err(dev, "Fail to allocate colormap (%d entries)\n",
289 PALETTE_ENTRIES_NO);
290 goto err_cmap;
291 }
282 292
283 /* Register new frame buffer */ 293 /* Register new frame buffer */
284 if (register_framebuffer(&drvdata->info) < 0) { 294 rc = register_framebuffer(&drvdata->info);
285 printk(KERN_ERR "Could not register frame buffer\n"); 295 if (rc) {
286 retval = -EINVAL; 296 dev_err(dev, "Could not register frame buffer\n");
287 goto failed4; 297 goto err_regfb;
288 } 298 }
289 299
300 /* Put a banner in the log (for DEBUG) */
301 dev_dbg(dev, "regs: phys=%lx, virt=%p\n", physaddr, drvdata->regs);
302 dev_dbg(dev, "fb: phys=%p, virt=%p, size=%x\n",
303 (void*)drvdata->fb_phys, drvdata->fb_virt, fbsize);
304
290 return 0; /* success */ 305 return 0; /* success */
291 306
292failed4: 307err_regfb:
293 fb_dealloc_cmap(&drvdata->info.cmap); 308 fb_dealloc_cmap(&drvdata->info.cmap);
294 309
295failed3: 310err_cmap:
296 dma_free_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt, 311 if (drvdata->fb_alloced)
297 drvdata->fb_phys); 312 dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt,
298 313 drvdata->fb_phys);
299 /* Turn off the display */ 314 /* Turn off the display */
300 xilinx_fb_out_be32(drvdata, REG_CTRL, 0); 315 xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
316
317err_fbmem:
301 iounmap(drvdata->regs); 318 iounmap(drvdata->regs);
302 319
303failed2: 320err_map:
304 release_mem_region(regs_res->start, 8); 321 release_mem_region(physaddr, 8);
305 322
306failed1: 323err_region:
307 kfree(drvdata); 324 kfree(drvdata);
308 dev_set_drvdata(dev, NULL); 325 dev_set_drvdata(dev, NULL);
309 326
310 return retval; 327 return rc;
311} 328}
312 329
313static int 330static int xilinxfb_release(struct device *dev)
314xilinxfb_drv_remove(struct device *dev)
315{ 331{
316 struct xilinxfb_drvdata *drvdata; 332 struct xilinxfb_drvdata *drvdata = dev_get_drvdata(dev);
317
318 if (!dev)
319 return -ENODEV;
320
321 drvdata = (struct xilinxfb_drvdata *) dev_get_drvdata(dev);
322 333
323#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO) 334#if !defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_LOGO)
324 xilinx_fb_blank(VESA_POWERDOWN, &drvdata->info); 335 xilinx_fb_blank(VESA_POWERDOWN, &drvdata->info);
@@ -328,8 +339,9 @@ xilinxfb_drv_remove(struct device *dev)
328 339
329 fb_dealloc_cmap(&drvdata->info.cmap); 340 fb_dealloc_cmap(&drvdata->info.cmap);
330 341
331 dma_free_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt, 342 if (drvdata->fb_alloced)
332 drvdata->fb_phys); 343 dma_free_coherent(dev, PAGE_ALIGN(drvdata->info.fix.smem_len),
344 drvdata->fb_virt, drvdata->fb_phys);
333 345
334 /* Turn off the display */ 346 /* Turn off the display */
335 xilinx_fb_out_be32(drvdata, REG_CTRL, 0); 347 xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
@@ -343,29 +355,168 @@ xilinxfb_drv_remove(struct device *dev)
343 return 0; 355 return 0;
344} 356}
345 357
358/* ---------------------------------------------------------------------
359 * Platform bus binding
360 */
361
362static int
363xilinxfb_platform_probe(struct platform_device *pdev)
364{
365 struct xilinxfb_platform_data *pdata;
366 struct resource *res;
346 367
347static struct device_driver xilinxfb_driver = { 368 /* Find the registers address */
348 .name = DRIVER_NAME, 369 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
349 .bus = &platform_bus_type, 370 if (!res) {
371 dev_err(&pdev->dev, "Couldn't get registers resource\n");
372 return -ENODEV;
373 }
350 374
351 .probe = xilinxfb_drv_probe, 375 /* If a pdata structure is provided, then extract the parameters */
352 .remove = xilinxfb_drv_remove 376 pdata = &xilinx_fb_default_pdata;
377 if (pdev->dev.platform_data) {
378 pdata = pdev->dev.platform_data;
379 if (!pdata->xres)
380 pdata->xres = xilinx_fb_default_pdata.xres;
381 if (!pdata->yres)
382 pdata->yres = xilinx_fb_default_pdata.yres;
383 if (!pdata->xvirt)
384 pdata->xvirt = xilinx_fb_default_pdata.xvirt;
385 if (!pdata->yvirt)
386 pdata->yvirt = xilinx_fb_default_pdata.yvirt;
387 }
388
389 return xilinxfb_assign(&pdev->dev, res->start, pdata);
390}
391
392static int
393xilinxfb_platform_remove(struct platform_device *pdev)
394{
395 return xilinxfb_release(&pdev->dev);
396}
397
398
399static struct platform_driver xilinxfb_platform_driver = {
400 .probe = xilinxfb_platform_probe,
401 .remove = xilinxfb_platform_remove,
402 .driver = {
403 .owner = THIS_MODULE,
404 .name = DRIVER_NAME,
405 },
406};
407
408/* ---------------------------------------------------------------------
409 * OF bus binding
410 */
411
412#if defined(CONFIG_OF)
413static int __devinit
414xilinxfb_of_probe(struct of_device *op, const struct of_device_id *match)
415{
416 struct resource res;
417 const u32 *prop;
418 struct xilinxfb_platform_data pdata;
419 int size, rc;
420
421 /* Copy with the default pdata (not a ptr reference!) */
422 pdata = xilinx_fb_default_pdata;
423
424 dev_dbg(&op->dev, "xilinxfb_of_probe(%p, %p)\n", op, match);
425
426 rc = of_address_to_resource(op->node, 0, &res);
427 if (rc) {
428 dev_err(&op->dev, "invalid address\n");
429 return rc;
430 }
431
432 prop = of_get_property(op->node, "phys-size", &size);
433 if ((prop) && (size >= sizeof(u32)*2)) {
434 pdata.screen_width_mm = prop[0];
435 pdata.screen_height_mm = prop[1];
436 }
437
438 prop = of_get_property(op->node, "resolution", &size);
439 if ((prop) && (size >= sizeof(u32)*2)) {
440 pdata.xres = prop[0];
441 pdata.yres = prop[1];
442 }
443
444 prop = of_get_property(op->node, "virtual-resolution", &size);
445 if ((prop) && (size >= sizeof(u32)*2)) {
446 pdata.xvirt = prop[0];
447 pdata.yvirt = prop[1];
448 }
449
450 if (of_find_property(op->node, "rotate-display", NULL))
451 pdata.rotate_screen = 1;
452
453 return xilinxfb_assign(&op->dev, res.start, &pdata);
454}
455
456static int __devexit xilinxfb_of_remove(struct of_device *op)
457{
458 return xilinxfb_release(&op->dev);
459}
460
461/* Match table for of_platform binding */
462static struct of_device_id __devinit xilinxfb_of_match[] = {
463 { .compatible = "xilinx,ml300-fb", },
464 {},
353}; 465};
466MODULE_DEVICE_TABLE(of, xilinxfb_of_match);
467
468static struct of_platform_driver xilinxfb_of_driver = {
469 .owner = THIS_MODULE,
470 .name = DRIVER_NAME,
471 .match_table = xilinxfb_of_match,
472 .probe = xilinxfb_of_probe,
473 .remove = __devexit_p(xilinxfb_of_remove),
474 .driver = {
475 .name = DRIVER_NAME,
476 },
477};
478
479/* Registration helpers to keep the number of #ifdefs to a minimum */
480static inline int __init xilinxfb_of_register(void)
481{
482 pr_debug("xilinxfb: calling of_register_platform_driver()\n");
483 return of_register_platform_driver(&xilinxfb_of_driver);
484}
485
486static inline void __exit xilinxfb_of_unregister(void)
487{
488 of_unregister_platform_driver(&xilinxfb_of_driver);
489}
490#else /* CONFIG_OF */
491/* CONFIG_OF not enabled; do nothing helpers */
492static inline int __init xilinxfb_of_register(void) { return 0; }
493static inline void __exit xilinxfb_of_unregister(void) { }
494#endif /* CONFIG_OF */
495
496/* ---------------------------------------------------------------------
497 * Module setup and teardown
498 */
354 499
355static int __init 500static int __init
356xilinxfb_init(void) 501xilinxfb_init(void)
357{ 502{
358 /* 503 int rc;
359 * No kernel boot options used, 504 rc = xilinxfb_of_register();
360 * so we just need to register the driver 505 if (rc)
361 */ 506 return rc;
362 return driver_register(&xilinxfb_driver); 507
508 rc = platform_driver_register(&xilinxfb_platform_driver);
509 if (rc)
510 xilinxfb_of_unregister();
511
512 return rc;
363} 513}
364 514
365static void __exit 515static void __exit
366xilinxfb_cleanup(void) 516xilinxfb_cleanup(void)
367{ 517{
368 driver_unregister(&xilinxfb_driver); 518 platform_driver_unregister(&xilinxfb_platform_driver);
519 xilinxfb_of_unregister();
369} 520}
370 521
371module_init(xilinxfb_init); 522module_init(xilinxfb_init);
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 4482a0673b15..b1013f34085d 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1514,9 +1514,6 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
1514 int thread_status_size = 0; 1514 int thread_status_size = 0;
1515 elf_addr_t *auxv; 1515 elf_addr_t *auxv;
1516 unsigned long mm_flags; 1516 unsigned long mm_flags;
1517#ifdef ELF_CORE_WRITE_EXTRA_NOTES
1518 int extra_notes_size;
1519#endif
1520 1517
1521 /* 1518 /*
1522 * We no longer stop all VM operations. 1519 * We no longer stop all VM operations.
@@ -1645,10 +1642,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
1645 1642
1646 sz += thread_status_size; 1643 sz += thread_status_size;
1647 1644
1648#ifdef ELF_CORE_WRITE_EXTRA_NOTES 1645 sz += elf_coredump_extra_notes_size();
1649 extra_notes_size = ELF_CORE_EXTRA_NOTES_SIZE;
1650 sz += extra_notes_size;
1651#endif
1652 1646
1653 fill_elf_note_phdr(&phdr, sz, offset); 1647 fill_elf_note_phdr(&phdr, sz, offset);
1654 offset += sz; 1648 offset += sz;
@@ -1698,10 +1692,8 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
1698 if (!writenote(notes + i, file, &foffset)) 1692 if (!writenote(notes + i, file, &foffset))
1699 goto end_coredump; 1693 goto end_coredump;
1700 1694
1701#ifdef ELF_CORE_WRITE_EXTRA_NOTES 1695 if (elf_coredump_extra_notes_write(file, &foffset))
1702 ELF_CORE_WRITE_EXTRA_NOTES; 1696 goto end_coredump;
1703 foffset += extra_notes_size;
1704#endif
1705 1697
1706 /* write out the thread status notes section */ 1698 /* write out the thread status notes section */
1707 list_for_each(t, &thread_list) { 1699 list_for_each(t, &thread_list) {
diff --git a/include/asm-powerpc/8xx_immap.h b/include/asm-powerpc/8xx_immap.h
new file mode 100644
index 000000000000..1311cefdfd30
--- /dev/null
+++ b/include/asm-powerpc/8xx_immap.h
@@ -0,0 +1,564 @@
1/*
2 * MPC8xx Internal Memory Map
3 * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
4 *
5 * The I/O on the MPC860 is comprised of blocks of special registers
6 * and the dual port ram for the Communication Processor Module.
7 * Within this space are functional units such as the SIU, memory
8 * controller, system timers, and other control functions. It is
9 * a combination that I found difficult to separate into logical
10 * functional files.....but anyone else is welcome to try. -- Dan
11 */
12#ifdef __KERNEL__
13#ifndef __IMMAP_8XX__
14#define __IMMAP_8XX__
15
16/* System configuration registers.
17*/
18typedef struct sys_conf {
19 uint sc_siumcr;
20 uint sc_sypcr;
21 uint sc_swt;
22 char res1[2];
23 ushort sc_swsr;
24 uint sc_sipend;
25 uint sc_simask;
26 uint sc_siel;
27 uint sc_sivec;
28 uint sc_tesr;
29 char res2[0xc];
30 uint sc_sdcr;
31 char res3[0x4c];
32} sysconf8xx_t;
33
34/* PCMCIA configuration registers.
35*/
36typedef struct pcmcia_conf {
37 uint pcmc_pbr0;
38 uint pcmc_por0;
39 uint pcmc_pbr1;
40 uint pcmc_por1;
41 uint pcmc_pbr2;
42 uint pcmc_por2;
43 uint pcmc_pbr3;
44 uint pcmc_por3;
45 uint pcmc_pbr4;
46 uint pcmc_por4;
47 uint pcmc_pbr5;
48 uint pcmc_por5;
49 uint pcmc_pbr6;
50 uint pcmc_por6;
51 uint pcmc_pbr7;
52 uint pcmc_por7;
53 char res1[0x20];
54 uint pcmc_pgcra;
55 uint pcmc_pgcrb;
56 uint pcmc_pscr;
57 char res2[4];
58 uint pcmc_pipr;
59 char res3[4];
60 uint pcmc_per;
61 char res4[4];
62} pcmconf8xx_t;
63
64/* Memory controller registers.
65*/
66typedef struct mem_ctlr {
67 uint memc_br0;
68 uint memc_or0;
69 uint memc_br1;
70 uint memc_or1;
71 uint memc_br2;
72 uint memc_or2;
73 uint memc_br3;
74 uint memc_or3;
75 uint memc_br4;
76 uint memc_or4;
77 uint memc_br5;
78 uint memc_or5;
79 uint memc_br6;
80 uint memc_or6;
81 uint memc_br7;
82 uint memc_or7;
83 char res1[0x24];
84 uint memc_mar;
85 uint memc_mcr;
86 char res2[4];
87 uint memc_mamr;
88 uint memc_mbmr;
89 ushort memc_mstat;
90 ushort memc_mptpr;
91 uint memc_mdr;
92 char res3[0x80];
93} memctl8xx_t;
94
95/*-----------------------------------------------------------------------
96 * BR - Memory Controler: Base Register 16-9
97 */
98#define BR_BA_MSK 0xffff8000 /* Base Address Mask */
99#define BR_AT_MSK 0x00007000 /* Address Type Mask */
100#define BR_PS_MSK 0x00000c00 /* Port Size Mask */
101#define BR_PS_32 0x00000000 /* 32 bit port size */
102#define BR_PS_16 0x00000800 /* 16 bit port size */
103#define BR_PS_8 0x00000400 /* 8 bit port size */
104#define BR_PARE 0x00000200 /* Parity Enable */
105#define BR_WP 0x00000100 /* Write Protect */
106#define BR_MS_MSK 0x000000c0 /* Machine Select Mask */
107#define BR_MS_GPCM 0x00000000 /* G.P.C.M. Machine Select */
108#define BR_MS_UPMA 0x00000080 /* U.P.M.A Machine Select */
109#define BR_MS_UPMB 0x000000c0 /* U.P.M.B Machine Select */
110#define BR_V 0x00000001 /* Bank Valid */
111
112/*-----------------------------------------------------------------------
113 * OR - Memory Controler: Option Register 16-11
114 */
115#define OR_AM_MSK 0xffff8000 /* Address Mask Mask */
116#define OR_ATM_MSK 0x00007000 /* Address Type Mask Mask */
117#define OR_CSNT_SAM 0x00000800 /* Chip Select Negation Time/ Start */
118 /* Address Multiplex */
119#define OR_ACS_MSK 0x00000600 /* Address to Chip Select Setup mask */
120#define OR_ACS_DIV1 0x00000000 /* CS is output at the same time */
121#define OR_ACS_DIV4 0x00000400 /* CS is output 1/4 a clock later */
122#define OR_ACS_DIV2 0x00000600 /* CS is output 1/2 a clock later */
123#define OR_G5LA 0x00000400 /* Output #GPL5 on #GPL_A5 */
124#define OR_G5LS 0x00000200 /* Drive #GPL high on falling edge of...*/
125#define OR_BI 0x00000100 /* Burst inhibit */
126#define OR_SCY_MSK 0x000000f0 /* Cycle Lenght in Clocks */
127#define OR_SCY_0_CLK 0x00000000 /* 0 clock cycles wait states */
128#define OR_SCY_1_CLK 0x00000010 /* 1 clock cycles wait states */
129#define OR_SCY_2_CLK 0x00000020 /* 2 clock cycles wait states */
130#define OR_SCY_3_CLK 0x00000030 /* 3 clock cycles wait states */
131#define OR_SCY_4_CLK 0x00000040 /* 4 clock cycles wait states */
132#define OR_SCY_5_CLK 0x00000050 /* 5 clock cycles wait states */
133#define OR_SCY_6_CLK 0x00000060 /* 6 clock cycles wait states */
134#define OR_SCY_7_CLK 0x00000070 /* 7 clock cycles wait states */
135#define OR_SCY_8_CLK 0x00000080 /* 8 clock cycles wait states */
136#define OR_SCY_9_CLK 0x00000090 /* 9 clock cycles wait states */
137#define OR_SCY_10_CLK 0x000000a0 /* 10 clock cycles wait states */
138#define OR_SCY_11_CLK 0x000000b0 /* 11 clock cycles wait states */
139#define OR_SCY_12_CLK 0x000000c0 /* 12 clock cycles wait states */
140#define OR_SCY_13_CLK 0x000000d0 /* 13 clock cycles wait states */
141#define OR_SCY_14_CLK 0x000000e0 /* 14 clock cycles wait states */
142#define OR_SCY_15_CLK 0x000000f0 /* 15 clock cycles wait states */
143#define OR_SETA 0x00000008 /* External Transfer Acknowledge */
144#define OR_TRLX 0x00000004 /* Timing Relaxed */
145#define OR_EHTR 0x00000002 /* Extended Hold Time on Read */
146
147/* System Integration Timers.
148*/
149typedef struct sys_int_timers {
150 ushort sit_tbscr;
151 char res0[0x02];
152 uint sit_tbreff0;
153 uint sit_tbreff1;
154 char res1[0x14];
155 ushort sit_rtcsc;
156 char res2[0x02];
157 uint sit_rtc;
158 uint sit_rtsec;
159 uint sit_rtcal;
160 char res3[0x10];
161 ushort sit_piscr;
162 char res4[2];
163 uint sit_pitc;
164 uint sit_pitr;
165 char res5[0x34];
166} sit8xx_t;
167
168#define TBSCR_TBIRQ_MASK ((ushort)0xff00)
169#define TBSCR_REFA ((ushort)0x0080)
170#define TBSCR_REFB ((ushort)0x0040)
171#define TBSCR_REFAE ((ushort)0x0008)
172#define TBSCR_REFBE ((ushort)0x0004)
173#define TBSCR_TBF ((ushort)0x0002)
174#define TBSCR_TBE ((ushort)0x0001)
175
176#define RTCSC_RTCIRQ_MASK ((ushort)0xff00)
177#define RTCSC_SEC ((ushort)0x0080)
178#define RTCSC_ALR ((ushort)0x0040)
179#define RTCSC_38K ((ushort)0x0010)
180#define RTCSC_SIE ((ushort)0x0008)
181#define RTCSC_ALE ((ushort)0x0004)
182#define RTCSC_RTF ((ushort)0x0002)
183#define RTCSC_RTE ((ushort)0x0001)
184
185#define PISCR_PIRQ_MASK ((ushort)0xff00)
186#define PISCR_PS ((ushort)0x0080)
187#define PISCR_PIE ((ushort)0x0004)
188#define PISCR_PTF ((ushort)0x0002)
189#define PISCR_PTE ((ushort)0x0001)
190
191/* Clocks and Reset.
192*/
193typedef struct clk_and_reset {
194 uint car_sccr;
195 uint car_plprcr;
196 uint car_rsr;
197 char res[0x74]; /* Reserved area */
198} car8xx_t;
199
200/* System Integration Timers keys.
201*/
202typedef struct sitk {
203 uint sitk_tbscrk;
204 uint sitk_tbreff0k;
205 uint sitk_tbreff1k;
206 uint sitk_tbk;
207 char res1[0x10];
208 uint sitk_rtcsck;
209 uint sitk_rtck;
210 uint sitk_rtseck;
211 uint sitk_rtcalk;
212 char res2[0x10];
213 uint sitk_piscrk;
214 uint sitk_pitck;
215 char res3[0x38];
216} sitk8xx_t;
217
218/* Clocks and reset keys.
219*/
220typedef struct cark {
221 uint cark_sccrk;
222 uint cark_plprcrk;
223 uint cark_rsrk;
224 char res[0x474];
225} cark8xx_t;
226
227/* The key to unlock registers maintained by keep-alive power.
228*/
229#define KAPWR_KEY ((unsigned int)0x55ccaa33)
230
231/* Video interface. MPC823 Only.
232*/
233typedef struct vid823 {
234 ushort vid_vccr;
235 ushort res1;
236 u_char vid_vsr;
237 u_char res2;
238 u_char vid_vcmr;
239 u_char res3;
240 uint vid_vbcb;
241 uint res4;
242 uint vid_vfcr0;
243 uint vid_vfaa0;
244 uint vid_vfba0;
245 uint vid_vfcr1;
246 uint vid_vfaa1;
247 uint vid_vfba1;
248 u_char res5[0x18];
249} vid823_t;
250
251/* LCD interface. 823 Only.
252*/
253typedef struct lcd {
254 uint lcd_lccr;
255 uint lcd_lchcr;
256 uint lcd_lcvcr;
257 char res1[4];
258 uint lcd_lcfaa;
259 uint lcd_lcfba;
260 char lcd_lcsr;
261 char res2[0x7];
262} lcd823_t;
263
264/* I2C
265*/
266typedef struct i2c {
267 u_char i2c_i2mod;
268 char res1[3];
269 u_char i2c_i2add;
270 char res2[3];
271 u_char i2c_i2brg;
272 char res3[3];
273 u_char i2c_i2com;
274 char res4[3];
275 u_char i2c_i2cer;
276 char res5[3];
277 u_char i2c_i2cmr;
278 char res6[0x8b];
279} i2c8xx_t;
280
281/* DMA control/status registers.
282*/
283typedef struct sdma_csr {
284 char res1[4];
285 uint sdma_sdar;
286 u_char sdma_sdsr;
287 char res3[3];
288 u_char sdma_sdmr;
289 char res4[3];
290 u_char sdma_idsr1;
291 char res5[3];
292 u_char sdma_idmr1;
293 char res6[3];
294 u_char sdma_idsr2;
295 char res7[3];
296 u_char sdma_idmr2;
297 char res8[0x13];
298} sdma8xx_t;
299
300/* Communication Processor Module Interrupt Controller.
301*/
302typedef struct cpm_ic {
303 ushort cpic_civr;
304 char res[0xe];
305 uint cpic_cicr;
306 uint cpic_cipr;
307 uint cpic_cimr;
308 uint cpic_cisr;
309} cpic8xx_t;
310
311/* Input/Output Port control/status registers.
312*/
313typedef struct io_port {
314 ushort iop_padir;
315 ushort iop_papar;
316 ushort iop_paodr;
317 ushort iop_padat;
318 char res1[8];
319 ushort iop_pcdir;
320 ushort iop_pcpar;
321 ushort iop_pcso;
322 ushort iop_pcdat;
323 ushort iop_pcint;
324 char res2[6];
325 ushort iop_pddir;
326 ushort iop_pdpar;
327 char res3[2];
328 ushort iop_pddat;
329 uint utmode;
330 char res4[4];
331} iop8xx_t;
332
333/* Communication Processor Module Timers
334*/
335typedef struct cpm_timers {
336 ushort cpmt_tgcr;
337 char res1[0xe];
338 ushort cpmt_tmr1;
339 ushort cpmt_tmr2;
340 ushort cpmt_trr1;
341 ushort cpmt_trr2;
342 ushort cpmt_tcr1;
343 ushort cpmt_tcr2;
344 ushort cpmt_tcn1;
345 ushort cpmt_tcn2;
346 ushort cpmt_tmr3;
347 ushort cpmt_tmr4;
348 ushort cpmt_trr3;
349 ushort cpmt_trr4;
350 ushort cpmt_tcr3;
351 ushort cpmt_tcr4;
352 ushort cpmt_tcn3;
353 ushort cpmt_tcn4;
354 ushort cpmt_ter1;
355 ushort cpmt_ter2;
356 ushort cpmt_ter3;
357 ushort cpmt_ter4;
358 char res2[8];
359} cpmtimer8xx_t;
360
361/* Finally, the Communication Processor stuff.....
362*/
363typedef struct scc { /* Serial communication channels */
364 uint scc_gsmrl;
365 uint scc_gsmrh;
366 ushort scc_psmr;
367 char res1[2];
368 ushort scc_todr;
369 ushort scc_dsr;
370 ushort scc_scce;
371 char res2[2];
372 ushort scc_sccm;
373 char res3;
374 u_char scc_sccs;
375 char res4[8];
376} scc_t;
377
378typedef struct smc { /* Serial management channels */
379 char res1[2];
380 ushort smc_smcmr;
381 char res2[2];
382 u_char smc_smce;
383 char res3[3];
384 u_char smc_smcm;
385 char res4[5];
386} smc_t;
387
388/* MPC860T Fast Ethernet Controller. It isn't part of the CPM, but
389 * it fits within the address space.
390 */
391
392typedef struct fec {
393 uint fec_addr_low; /* lower 32 bits of station address */
394 ushort fec_addr_high; /* upper 16 bits of station address */
395 ushort res1; /* reserved */
396 uint fec_hash_table_high; /* upper 32-bits of hash table */
397 uint fec_hash_table_low; /* lower 32-bits of hash table */
398 uint fec_r_des_start; /* beginning of Rx descriptor ring */
399 uint fec_x_des_start; /* beginning of Tx descriptor ring */
400 uint fec_r_buff_size; /* Rx buffer size */
401 uint res2[9]; /* reserved */
402 uint fec_ecntrl; /* ethernet control register */
403 uint fec_ievent; /* interrupt event register */
404 uint fec_imask; /* interrupt mask register */
405 uint fec_ivec; /* interrupt level and vector status */
406 uint fec_r_des_active; /* Rx ring updated flag */
407 uint fec_x_des_active; /* Tx ring updated flag */
408 uint res3[10]; /* reserved */
409 uint fec_mii_data; /* MII data register */
410 uint fec_mii_speed; /* MII speed control register */
411 uint res4[17]; /* reserved */
412 uint fec_r_bound; /* end of RAM (read-only) */
413 uint fec_r_fstart; /* Rx FIFO start address */
414 uint res5[6]; /* reserved */
415 uint fec_x_fstart; /* Tx FIFO start address */
416 uint res6[17]; /* reserved */
417 uint fec_fun_code; /* fec SDMA function code */
418 uint res7[3]; /* reserved */
419 uint fec_r_cntrl; /* Rx control register */
420 uint fec_r_hash; /* Rx hash register */
421 uint res8[14]; /* reserved */
422 uint fec_x_cntrl; /* Tx control register */
423 uint res9[0x1e]; /* reserved */
424} fec_t;
425
426/* The FEC and LCD color map share the same address space....
427 * I guess we will never see an 823T :-).
428 */
429union fec_lcd {
430 fec_t fl_un_fec;
431 u_char fl_un_cmap[0x200];
432};
433
434typedef struct comm_proc {
435 /* General control and status registers.
436 */
437 ushort cp_cpcr;
438 u_char res1[2];
439 ushort cp_rccr;
440 u_char res2;
441 u_char cp_rmds;
442 u_char res3[4];
443 ushort cp_cpmcr1;
444 ushort cp_cpmcr2;
445 ushort cp_cpmcr3;
446 ushort cp_cpmcr4;
447 u_char res4[2];
448 ushort cp_rter;
449 u_char res5[2];
450 ushort cp_rtmr;
451 u_char res6[0x14];
452
453 /* Baud rate generators.
454 */
455 uint cp_brgc1;
456 uint cp_brgc2;
457 uint cp_brgc3;
458 uint cp_brgc4;
459
460 /* Serial Communication Channels.
461 */
462 scc_t cp_scc[4];
463
464 /* Serial Management Channels.
465 */
466 smc_t cp_smc[2];
467
468 /* Serial Peripheral Interface.
469 */
470 ushort cp_spmode;
471 u_char res7[4];
472 u_char cp_spie;
473 u_char res8[3];
474 u_char cp_spim;
475 u_char res9[2];
476 u_char cp_spcom;
477 u_char res10[2];
478
479 /* Parallel Interface Port.
480 */
481 u_char res11[2];
482 ushort cp_pipc;
483 u_char res12[2];
484 ushort cp_ptpr;
485 uint cp_pbdir;
486 uint cp_pbpar;
487 u_char res13[2];
488 ushort cp_pbodr;
489 uint cp_pbdat;
490
491 /* Port E - MPC87x/88x only.
492 */
493 uint cp_pedir;
494 uint cp_pepar;
495 uint cp_peso;
496 uint cp_peodr;
497 uint cp_pedat;
498
499 /* Communications Processor Timing Register -
500 Contains RMII Timing for the FECs on MPC87x/88x only.
501 */
502 uint cp_cptr;
503
504 /* Serial Interface and Time Slot Assignment.
505 */
506 uint cp_simode;
507 u_char cp_sigmr;
508 u_char res15;
509 u_char cp_sistr;
510 u_char cp_sicmr;
511 u_char res16[4];
512 uint cp_sicr;
513 uint cp_sirp;
514 u_char res17[0xc];
515
516 /* 256 bytes of MPC823 video controller RAM array.
517 */
518 u_char cp_vcram[0x100];
519 u_char cp_siram[0x200];
520
521 /* The fast ethernet controller is not really part of the CPM,
522 * but it resides in the address space.
523 * The LCD color map is also here.
524 */
525 union fec_lcd fl_un;
526#define cp_fec fl_un.fl_un_fec
527#define lcd_cmap fl_un.fl_un_cmap
528 char res18[0xE00];
529
530 /* The DUET family has a second FEC here */
531 fec_t cp_fec2;
532#define cp_fec1 cp_fec /* consistency macro */
533
534 /* Dual Ported RAM follows.
535 * There are many different formats for this memory area
536 * depending upon the devices used and options chosen.
537 * Some processors don't have all of it populated.
538 */
539 u_char cp_dpmem[0x1C00]; /* BD / Data / ucode */
540 u_char cp_dparam[0x400]; /* Parameter RAM */
541} cpm8xx_t;
542
543/* Internal memory map.
544*/
545typedef struct immap {
546 sysconf8xx_t im_siu_conf; /* SIU Configuration */
547 pcmconf8xx_t im_pcmcia; /* PCMCIA Configuration */
548 memctl8xx_t im_memctl; /* Memory Controller */
549 sit8xx_t im_sit; /* System integration timers */
550 car8xx_t im_clkrst; /* Clocks and reset */
551 sitk8xx_t im_sitk; /* Sys int timer keys */
552 cark8xx_t im_clkrstk; /* Clocks and reset keys */
553 vid823_t im_vid; /* Video (823 only) */
554 lcd823_t im_lcd; /* LCD (823 only) */
555 i2c8xx_t im_i2c; /* I2C control/status */
556 sdma8xx_t im_sdma; /* SDMA control/status */
557 cpic8xx_t im_cpic; /* CPM Interrupt Controller */
558 iop8xx_t im_ioport; /* IO Port control/status */
559 cpmtimer8xx_t im_cpmtimer; /* CPM timers */
560 cpm8xx_t im_cpm; /* Communication processor */
561} immap_t;
562
563#endif /* __IMMAP_8XX__ */
564#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h
index c44810b9d322..f3fc733758f5 100644
--- a/include/asm-powerpc/atomic.h
+++ b/include/asm-powerpc/atomic.h
@@ -5,7 +5,7 @@
5 * PowerPC atomic operations 5 * PowerPC atomic operations
6 */ 6 */
7 7
8typedef struct { volatile int counter; } atomic_t; 8typedef struct { int counter; } atomic_t;
9 9
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11#include <linux/compiler.h> 11#include <linux/compiler.h>
@@ -15,8 +15,19 @@ typedef struct { volatile int counter; } atomic_t;
15 15
16#define ATOMIC_INIT(i) { (i) } 16#define ATOMIC_INIT(i) { (i) }
17 17
18#define atomic_read(v) ((v)->counter) 18static __inline__ int atomic_read(const atomic_t *v)
19#define atomic_set(v,i) (((v)->counter) = (i)) 19{
20 int t;
21
22 __asm__ __volatile__("lwz%U1%X1 %0,%1" : "=r"(t) : "m"(v->counter));
23
24 return t;
25}
26
27static __inline__ void atomic_set(atomic_t *v, int i)
28{
29 __asm__ __volatile__("stw%U0%X0 %1,%0" : "=m"(v->counter) : "r"(i));
30}
20 31
21static __inline__ void atomic_add(int a, atomic_t *v) 32static __inline__ void atomic_add(int a, atomic_t *v)
22{ 33{
@@ -240,12 +251,23 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
240 251
241#ifdef __powerpc64__ 252#ifdef __powerpc64__
242 253
243typedef struct { volatile long counter; } atomic64_t; 254typedef struct { long counter; } atomic64_t;
244 255
245#define ATOMIC64_INIT(i) { (i) } 256#define ATOMIC64_INIT(i) { (i) }
246 257
247#define atomic64_read(v) ((v)->counter) 258static __inline__ long atomic64_read(const atomic64_t *v)
248#define atomic64_set(v,i) (((v)->counter) = (i)) 259{
260 long t;
261
262 __asm__ __volatile__("ld%U1%X1 %0,%1" : "=r"(t) : "m"(v->counter));
263
264 return t;
265}
266
267static __inline__ void atomic64_set(atomic64_t *v, long i)
268{
269 __asm__ __volatile__("std%U0%X0 %1,%0" : "=m"(v->counter) : "r"(i));
270}
249 271
250static __inline__ void atomic64_add(long a, atomic64_t *v) 272static __inline__ void atomic64_add(long a, atomic64_t *v)
251{ 273{
diff --git a/arch/powerpc/platforms/cell/cbe_regs.h b/include/asm-powerpc/cell-regs.h
index b24025f2ac7a..fd6fd00434ef 100644
--- a/arch/powerpc/platforms/cell/cbe_regs.h
+++ b/include/asm-powerpc/cell-regs.h
@@ -244,16 +244,60 @@ struct cbe_mic_tm_regs {
244 u64 slow_fast_timer_0; /* 0x0090 */ 244 u64 slow_fast_timer_0; /* 0x0090 */
245 u64 slow_next_timer_0; /* 0x0098 */ 245 u64 slow_next_timer_0; /* 0x0098 */
246 246
247 u8 pad_0x00a0_0x01c0[0x01c0 - 0x0a0]; /* 0x00a0 */ 247 u8 pad_0x00a0_0x00f8[0x00f8 - 0x00a0]; /* 0x00a0 */
248 u64 mic_df_ecc_address_0; /* 0x00f8 */
249
250 u8 pad_0x0100_0x01b8[0x01b8 - 0x0100]; /* 0x0100 */
251 u64 mic_df_ecc_address_1; /* 0x01b8 */
248 252
249 u64 mic_ctl_cnfg_1; /* 0x01c0 */ 253 u64 mic_ctl_cnfg_1; /* 0x01c0 */
250#define CBE_MIC_DISABLE_PWR_SAV_1 0x8000000000000000LL 254#define CBE_MIC_DISABLE_PWR_SAV_1 0x8000000000000000LL
255
251 u64 pad_0x01c8; /* 0x01c8 */ 256 u64 pad_0x01c8; /* 0x01c8 */
252 257
253 u64 slow_fast_timer_1; /* 0x01d0 */ 258 u64 slow_fast_timer_1; /* 0x01d0 */
254 u64 slow_next_timer_1; /* 0x01d8 */ 259 u64 slow_next_timer_1; /* 0x01d8 */
255 260
256 u8 pad_0x01e0_0x1000[0x1000 - 0x01e0]; /* 0x01e0 */ 261 u8 pad_0x01e0_0x0208[0x0208 - 0x01e0]; /* 0x01e0 */
262 u64 mic_exc; /* 0x0208 */
263#define CBE_MIC_EXC_BLOCK_SCRUB 0x0800000000000000ULL
264#define CBE_MIC_EXC_FAST_SCRUB 0x0100000000000000ULL
265
266 u64 mic_mnt_cfg; /* 0x0210 */
267#define CBE_MIC_MNT_CFG_CHAN_0_POP 0x0002000000000000ULL
268#define CBE_MIC_MNT_CFG_CHAN_1_POP 0x0004000000000000ULL
269
270 u64 mic_df_config; /* 0x0218 */
271#define CBE_MIC_ECC_DISABLE_0 0x4000000000000000ULL
272#define CBE_MIC_ECC_REP_SINGLE_0 0x2000000000000000ULL
273#define CBE_MIC_ECC_DISABLE_1 0x0080000000000000ULL
274#define CBE_MIC_ECC_REP_SINGLE_1 0x0040000000000000ULL
275
276 u8 pad_0x0220_0x0230[0x0230 - 0x0220]; /* 0x0220 */
277 u64 mic_fir; /* 0x0230 */
278#define CBE_MIC_FIR_ECC_SINGLE_0_ERR 0x0200000000000000ULL
279#define CBE_MIC_FIR_ECC_MULTI_0_ERR 0x0100000000000000ULL
280#define CBE_MIC_FIR_ECC_SINGLE_1_ERR 0x0080000000000000ULL
281#define CBE_MIC_FIR_ECC_MULTI_1_ERR 0x0040000000000000ULL
282#define CBE_MIC_FIR_ECC_ERR_MASK 0xffff000000000000ULL
283#define CBE_MIC_FIR_ECC_SINGLE_0_CTE 0x0000020000000000ULL
284#define CBE_MIC_FIR_ECC_MULTI_0_CTE 0x0000010000000000ULL
285#define CBE_MIC_FIR_ECC_SINGLE_1_CTE 0x0000008000000000ULL
286#define CBE_MIC_FIR_ECC_MULTI_1_CTE 0x0000004000000000ULL
287#define CBE_MIC_FIR_ECC_CTE_MASK 0x0000ffff00000000ULL
288#define CBE_MIC_FIR_ECC_SINGLE_0_RESET 0x0000000002000000ULL
289#define CBE_MIC_FIR_ECC_MULTI_0_RESET 0x0000000001000000ULL
290#define CBE_MIC_FIR_ECC_SINGLE_1_RESET 0x0000000000800000ULL
291#define CBE_MIC_FIR_ECC_MULTI_1_RESET 0x0000000000400000ULL
292#define CBE_MIC_FIR_ECC_RESET_MASK 0x00000000ffff0000ULL
293#define CBE_MIC_FIR_ECC_SINGLE_0_SET 0x0000000000000200ULL
294#define CBE_MIC_FIR_ECC_MULTI_0_SET 0x0000000000000100ULL
295#define CBE_MIC_FIR_ECC_SINGLE_1_SET 0x0000000000000080ULL
296#define CBE_MIC_FIR_ECC_MULTI_1_SET 0x0000000000000040ULL
297#define CBE_MIC_FIR_ECC_SET_MASK 0x000000000000ffffULL
298 u64 mic_fir_debug; /* 0x0238 */
299
300 u8 pad_0x0240_0x1000[0x1000 - 0x0240]; /* 0x0240 */
257}; 301};
258 302
259extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np); 303extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np);
diff --git a/include/asm-powerpc/clk_interface.h b/include/asm-powerpc/clk_interface.h
new file mode 100644
index 000000000000..ab1882c1e176
--- /dev/null
+++ b/include/asm-powerpc/clk_interface.h
@@ -0,0 +1,20 @@
1#ifndef __ASM_POWERPC_CLK_INTERFACE_H
2#define __ASM_POWERPC_CLK_INTERFACE_H
3
4#include <linux/clk.h>
5
6struct clk_interface {
7 struct clk* (*clk_get) (struct device *dev, const char *id);
8 int (*clk_enable) (struct clk *clk);
9 void (*clk_disable) (struct clk *clk);
10 unsigned long (*clk_get_rate) (struct clk *clk);
11 void (*clk_put) (struct clk *clk);
12 long (*clk_round_rate) (struct clk *clk, unsigned long rate);
13 int (*clk_set_rate) (struct clk *clk, unsigned long rate);
14 int (*clk_set_parent) (struct clk *clk, struct clk *parent);
15 struct clk* (*clk_get_parent) (struct clk *clk);
16};
17
18extern struct clk_interface clk_functions;
19
20#endif /* __ASM_POWERPC_CLK_INTERFACE_H */
diff --git a/include/asm-powerpc/commproc.h b/include/asm-powerpc/commproc.h
new file mode 100644
index 000000000000..0307c84a5c1d
--- /dev/null
+++ b/include/asm-powerpc/commproc.h
@@ -0,0 +1,755 @@
1/*
2 * MPC8xx Communication Processor Module.
3 * Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
4 *
5 * This file contains structures and information for the communication
6 * processor channels. Some CPM control and status is available
7 * throught the MPC8xx internal memory map. See immap.h for details.
8 * This file only contains what I need for the moment, not the total
9 * CPM capabilities. I (or someone else) will add definitions as they
10 * are needed. -- Dan
11 *
12 * On the MBX board, EPPC-Bug loads CPM microcode into the first 512
13 * bytes of the DP RAM and relocates the I2C parameter area to the
14 * IDMA1 space. The remaining DP RAM is available for buffer descriptors
15 * or other use.
16 */
17#ifndef __CPM_8XX__
18#define __CPM_8XX__
19
20#include <asm/8xx_immap.h>
21#include <asm/ptrace.h>
22#include <asm/cpm.h>
23
24/* CPM Command register.
25*/
26#define CPM_CR_RST ((ushort)0x8000)
27#define CPM_CR_OPCODE ((ushort)0x0f00)
28#define CPM_CR_CHAN ((ushort)0x00f0)
29#define CPM_CR_FLG ((ushort)0x0001)
30
31/* Some commands (there are more...later)
32*/
33#define CPM_CR_INIT_TRX ((ushort)0x0000)
34#define CPM_CR_INIT_RX ((ushort)0x0001)
35#define CPM_CR_INIT_TX ((ushort)0x0002)
36#define CPM_CR_HUNT_MODE ((ushort)0x0003)
37#define CPM_CR_STOP_TX ((ushort)0x0004)
38#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
39#define CPM_CR_RESTART_TX ((ushort)0x0006)
40#define CPM_CR_CLOSE_RX_BD ((ushort)0x0007)
41#define CPM_CR_SET_GADDR ((ushort)0x0008)
42#define CPM_CR_SET_TIMER CPM_CR_SET_GADDR
43
44/* Channel numbers.
45*/
46#define CPM_CR_CH_SCC1 ((ushort)0x0000)
47#define CPM_CR_CH_I2C ((ushort)0x0001) /* I2C and IDMA1 */
48#define CPM_CR_CH_SCC2 ((ushort)0x0004)
49#define CPM_CR_CH_SPI ((ushort)0x0005) /* SPI / IDMA2 / Timers */
50#define CPM_CR_CH_TIMER CPM_CR_CH_SPI
51#define CPM_CR_CH_SCC3 ((ushort)0x0008)
52#define CPM_CR_CH_SMC1 ((ushort)0x0009) /* SMC1 / DSP1 */
53#define CPM_CR_CH_SCC4 ((ushort)0x000c)
54#define CPM_CR_CH_SMC2 ((ushort)0x000d) /* SMC2 / DSP2 */
55
56#define mk_cr_cmd(CH, CMD) ((CMD << 8) | (CH << 4))
57
58#ifndef CONFIG_PPC_CPM_NEW_BINDING
59/* The dual ported RAM is multi-functional. Some areas can be (and are
60 * being) used for microcode. There is an area that can only be used
61 * as data ram for buffer descriptors, which is all we use right now.
62 * Currently the first 512 and last 256 bytes are used for microcode.
63 */
64#define CPM_DATAONLY_BASE ((uint)0x0800)
65#define CPM_DATAONLY_SIZE ((uint)0x0700)
66#define CPM_DP_NOSPACE ((uint)0x7fffffff)
67#endif
68
69/* Export the base address of the communication processor registers
70 * and dual port ram.
71 */
72extern cpm8xx_t __iomem *cpmp; /* Pointer to comm processor */
73
74#ifdef CONFIG_PPC_CPM_NEW_BINDING
75#define cpm_dpalloc cpm_muram_alloc
76#define cpm_dpfree cpm_muram_free
77#define cpm_dpram_addr cpm_muram_addr
78#define cpm_dpram_phys cpm_muram_dma
79#else
80extern unsigned long cpm_dpalloc(uint size, uint align);
81extern int cpm_dpfree(unsigned long offset);
82extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
83extern void cpm_dpdump(void);
84extern void *cpm_dpram_addr(unsigned long offset);
85extern uint cpm_dpram_phys(u8* addr);
86#endif
87
88extern void cpm_setbrg(uint brg, uint rate);
89
90extern uint m8xx_cpm_hostalloc(uint size);
91extern int m8xx_cpm_hostfree(uint start);
92extern void m8xx_cpm_hostdump(void);
93
94extern void cpm_load_patch(volatile immap_t *immr);
95
96/* Buffer descriptors used by many of the CPM protocols.
97*/
98typedef struct cpm_buf_desc {
99 ushort cbd_sc; /* Status and Control */
100 ushort cbd_datlen; /* Data length in buffer */
101 uint cbd_bufaddr; /* Buffer address in host memory */
102} cbd_t;
103
104#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */
105#define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
106#define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */
107#define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
108#define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame */
109#define BD_SC_TC ((ushort)0x0400) /* Transmit CRC */
110#define BD_SC_CM ((ushort)0x0200) /* Continous mode */
111#define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */
112#define BD_SC_P ((ushort)0x0100) /* xmt preamble */
113#define BD_SC_BR ((ushort)0x0020) /* Break received */
114#define BD_SC_FR ((ushort)0x0010) /* Framing error */
115#define BD_SC_PR ((ushort)0x0008) /* Parity error */
116#define BD_SC_NAK ((ushort)0x0004) /* NAK - did not respond */
117#define BD_SC_OV ((ushort)0x0002) /* Overrun */
118#define BD_SC_UN ((ushort)0x0002) /* Underrun */
119#define BD_SC_CD ((ushort)0x0001) /* ?? */
120#define BD_SC_CL ((ushort)0x0001) /* Collision */
121
122/* Parameter RAM offsets.
123*/
124#define PROFF_SCC1 ((uint)0x0000)
125#define PROFF_IIC ((uint)0x0080)
126#define PROFF_SCC2 ((uint)0x0100)
127#define PROFF_SPI ((uint)0x0180)
128#define PROFF_SCC3 ((uint)0x0200)
129#define PROFF_SMC1 ((uint)0x0280)
130#define PROFF_SCC4 ((uint)0x0300)
131#define PROFF_SMC2 ((uint)0x0380)
132
133/* Define enough so I can at least use the serial port as a UART.
134 * The MBX uses SMC1 as the host serial port.
135 */
136typedef struct smc_uart {
137 ushort smc_rbase; /* Rx Buffer descriptor base address */
138 ushort smc_tbase; /* Tx Buffer descriptor base address */
139 u_char smc_rfcr; /* Rx function code */
140 u_char smc_tfcr; /* Tx function code */
141 ushort smc_mrblr; /* Max receive buffer length */
142 uint smc_rstate; /* Internal */
143 uint smc_idp; /* Internal */
144 ushort smc_rbptr; /* Internal */
145 ushort smc_ibc; /* Internal */
146 uint smc_rxtmp; /* Internal */
147 uint smc_tstate; /* Internal */
148 uint smc_tdp; /* Internal */
149 ushort smc_tbptr; /* Internal */
150 ushort smc_tbc; /* Internal */
151 uint smc_txtmp; /* Internal */
152 ushort smc_maxidl; /* Maximum idle characters */
153 ushort smc_tmpidl; /* Temporary idle counter */
154 ushort smc_brklen; /* Last received break length */
155 ushort smc_brkec; /* rcv'd break condition counter */
156 ushort smc_brkcr; /* xmt break count register */
157 ushort smc_rmask; /* Temporary bit mask */
158 char res1[8]; /* Reserved */
159 ushort smc_rpbase; /* Relocation pointer */
160} smc_uart_t;
161
162/* Function code bits.
163*/
164#define SMC_EB ((u_char)0x10) /* Set big endian byte order */
165
166/* SMC uart mode register.
167*/
168#define SMCMR_REN ((ushort)0x0001)
169#define SMCMR_TEN ((ushort)0x0002)
170#define SMCMR_DM ((ushort)0x000c)
171#define SMCMR_SM_GCI ((ushort)0x0000)
172#define SMCMR_SM_UART ((ushort)0x0020)
173#define SMCMR_SM_TRANS ((ushort)0x0030)
174#define SMCMR_SM_MASK ((ushort)0x0030)
175#define SMCMR_PM_EVEN ((ushort)0x0100) /* Even parity, else odd */
176#define SMCMR_REVD SMCMR_PM_EVEN
177#define SMCMR_PEN ((ushort)0x0200) /* Parity enable */
178#define SMCMR_BS SMCMR_PEN
179#define SMCMR_SL ((ushort)0x0400) /* Two stops, else one */
180#define SMCR_CLEN_MASK ((ushort)0x7800) /* Character length */
181#define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
182
183/* SMC2 as Centronics parallel printer. It is half duplex, in that
184 * it can only receive or transmit. The parameter ram values for
185 * each direction are either unique or properly overlap, so we can
186 * include them in one structure.
187 */
188typedef struct smc_centronics {
189 ushort scent_rbase;
190 ushort scent_tbase;
191 u_char scent_cfcr;
192 u_char scent_smask;
193 ushort scent_mrblr;
194 uint scent_rstate;
195 uint scent_r_ptr;
196 ushort scent_rbptr;
197 ushort scent_r_cnt;
198 uint scent_rtemp;
199 uint scent_tstate;
200 uint scent_t_ptr;
201 ushort scent_tbptr;
202 ushort scent_t_cnt;
203 uint scent_ttemp;
204 ushort scent_max_sl;
205 ushort scent_sl_cnt;
206 ushort scent_character1;
207 ushort scent_character2;
208 ushort scent_character3;
209 ushort scent_character4;
210 ushort scent_character5;
211 ushort scent_character6;
212 ushort scent_character7;
213 ushort scent_character8;
214 ushort scent_rccm;
215 ushort scent_rccr;
216} smc_cent_t;
217
218/* Centronics Status Mask Register.
219*/
220#define SMC_CENT_F ((u_char)0x08)
221#define SMC_CENT_PE ((u_char)0x04)
222#define SMC_CENT_S ((u_char)0x02)
223
224/* SMC Event and Mask register.
225*/
226#define SMCM_BRKE ((unsigned char)0x40) /* When in UART Mode */
227#define SMCM_BRK ((unsigned char)0x10) /* When in UART Mode */
228#define SMCM_TXE ((unsigned char)0x10) /* When in Transparent Mode */
229#define SMCM_BSY ((unsigned char)0x04)
230#define SMCM_TX ((unsigned char)0x02)
231#define SMCM_RX ((unsigned char)0x01)
232
233/* Baud rate generators.
234*/
235#define CPM_BRG_RST ((uint)0x00020000)
236#define CPM_BRG_EN ((uint)0x00010000)
237#define CPM_BRG_EXTC_INT ((uint)0x00000000)
238#define CPM_BRG_EXTC_CLK2 ((uint)0x00004000)
239#define CPM_BRG_EXTC_CLK6 ((uint)0x00008000)
240#define CPM_BRG_ATB ((uint)0x00002000)
241#define CPM_BRG_CD_MASK ((uint)0x00001ffe)
242#define CPM_BRG_DIV16 ((uint)0x00000001)
243
244/* SI Clock Route Register
245*/
246#define SICR_RCLK_SCC1_BRG1 ((uint)0x00000000)
247#define SICR_TCLK_SCC1_BRG1 ((uint)0x00000000)
248#define SICR_RCLK_SCC2_BRG2 ((uint)0x00000800)
249#define SICR_TCLK_SCC2_BRG2 ((uint)0x00000100)
250#define SICR_RCLK_SCC3_BRG3 ((uint)0x00100000)
251#define SICR_TCLK_SCC3_BRG3 ((uint)0x00020000)
252#define SICR_RCLK_SCC4_BRG4 ((uint)0x18000000)
253#define SICR_TCLK_SCC4_BRG4 ((uint)0x03000000)
254
255/* SCCs.
256*/
257#define SCC_GSMRH_IRP ((uint)0x00040000)
258#define SCC_GSMRH_GDE ((uint)0x00010000)
259#define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
260#define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
261#define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
262#define SCC_GSMRH_REVD ((uint)0x00002000)
263#define SCC_GSMRH_TRX ((uint)0x00001000)
264#define SCC_GSMRH_TTX ((uint)0x00000800)
265#define SCC_GSMRH_CDP ((uint)0x00000400)
266#define SCC_GSMRH_CTSP ((uint)0x00000200)
267#define SCC_GSMRH_CDS ((uint)0x00000100)
268#define SCC_GSMRH_CTSS ((uint)0x00000080)
269#define SCC_GSMRH_TFL ((uint)0x00000040)
270#define SCC_GSMRH_RFW ((uint)0x00000020)
271#define SCC_GSMRH_TXSY ((uint)0x00000010)
272#define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
273#define SCC_GSMRH_SYNL8 ((uint)0x00000008)
274#define SCC_GSMRH_SYNL4 ((uint)0x00000004)
275#define SCC_GSMRH_RTSM ((uint)0x00000002)
276#define SCC_GSMRH_RSYN ((uint)0x00000001)
277
278#define SCC_GSMRL_SIR ((uint)0x80000000) /* SCC2 only */
279#define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
280#define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
281#define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
282#define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
283#define SCC_GSMRL_TCI ((uint)0x10000000)
284#define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
285#define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
286#define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
287#define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
288#define SCC_GSMRL_RINV ((uint)0x02000000)
289#define SCC_GSMRL_TINV ((uint)0x01000000)
290#define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
291#define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
292#define SCC_GSMRL_TPL_48 ((uint)0x00800000)
293#define SCC_GSMRL_TPL_32 ((uint)0x00600000)
294#define SCC_GSMRL_TPL_16 ((uint)0x00400000)
295#define SCC_GSMRL_TPL_8 ((uint)0x00200000)
296#define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
297#define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
298#define SCC_GSMRL_TPP_01 ((uint)0x00100000)
299#define SCC_GSMRL_TPP_10 ((uint)0x00080000)
300#define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
301#define SCC_GSMRL_TEND ((uint)0x00040000)
302#define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
303#define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
304#define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
305#define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
306#define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
307#define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
308#define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
309#define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
310#define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
311#define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
312#define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
313#define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
314#define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
315#define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
316#define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
317#define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
318#define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
319#define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
320#define SCC_GSMRL_DIAG_LE ((uint)0x000000c0) /* Loop and echo */
321#define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
322#define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
323#define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
324#define SCC_GSMRL_ENR ((uint)0x00000020)
325#define SCC_GSMRL_ENT ((uint)0x00000010)
326#define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
327#define SCC_GSMRL_MODE_QMC ((uint)0x0000000a)
328#define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
329#define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
330#define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
331#define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
332#define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
333#define SCC_GSMRL_MODE_UART ((uint)0x00000004)
334#define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
335#define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
336#define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
337
338#define SCC_TODR_TOD ((ushort)0x8000)
339
340/* SCC Event and Mask register.
341*/
342#define SCCM_TXE ((unsigned char)0x10)
343#define SCCM_BSY ((unsigned char)0x04)
344#define SCCM_TX ((unsigned char)0x02)
345#define SCCM_RX ((unsigned char)0x01)
346
347typedef struct scc_param {
348 ushort scc_rbase; /* Rx Buffer descriptor base address */
349 ushort scc_tbase; /* Tx Buffer descriptor base address */
350 u_char scc_rfcr; /* Rx function code */
351 u_char scc_tfcr; /* Tx function code */
352 ushort scc_mrblr; /* Max receive buffer length */
353 uint scc_rstate; /* Internal */
354 uint scc_idp; /* Internal */
355 ushort scc_rbptr; /* Internal */
356 ushort scc_ibc; /* Internal */
357 uint scc_rxtmp; /* Internal */
358 uint scc_tstate; /* Internal */
359 uint scc_tdp; /* Internal */
360 ushort scc_tbptr; /* Internal */
361 ushort scc_tbc; /* Internal */
362 uint scc_txtmp; /* Internal */
363 uint scc_rcrc; /* Internal */
364 uint scc_tcrc; /* Internal */
365} sccp_t;
366
367/* Function code bits.
368*/
369#define SCC_EB ((u_char)0x10) /* Set big endian byte order */
370
371/* CPM Ethernet through SCCx.
372 */
373typedef struct scc_enet {
374 sccp_t sen_genscc;
375 uint sen_cpres; /* Preset CRC */
376 uint sen_cmask; /* Constant mask for CRC */
377 uint sen_crcec; /* CRC Error counter */
378 uint sen_alec; /* alignment error counter */
379 uint sen_disfc; /* discard frame counter */
380 ushort sen_pads; /* Tx short frame pad character */
381 ushort sen_retlim; /* Retry limit threshold */
382 ushort sen_retcnt; /* Retry limit counter */
383 ushort sen_maxflr; /* maximum frame length register */
384 ushort sen_minflr; /* minimum frame length register */
385 ushort sen_maxd1; /* maximum DMA1 length */
386 ushort sen_maxd2; /* maximum DMA2 length */
387 ushort sen_maxd; /* Rx max DMA */
388 ushort sen_dmacnt; /* Rx DMA counter */
389 ushort sen_maxb; /* Max BD byte count */
390 ushort sen_gaddr1; /* Group address filter */
391 ushort sen_gaddr2;
392 ushort sen_gaddr3;
393 ushort sen_gaddr4;
394 uint sen_tbuf0data0; /* Save area 0 - current frame */
395 uint sen_tbuf0data1; /* Save area 1 - current frame */
396 uint sen_tbuf0rba; /* Internal */
397 uint sen_tbuf0crc; /* Internal */
398 ushort sen_tbuf0bcnt; /* Internal */
399 ushort sen_paddrh; /* physical address (MSB) */
400 ushort sen_paddrm;
401 ushort sen_paddrl; /* physical address (LSB) */
402 ushort sen_pper; /* persistence */
403 ushort sen_rfbdptr; /* Rx first BD pointer */
404 ushort sen_tfbdptr; /* Tx first BD pointer */
405 ushort sen_tlbdptr; /* Tx last BD pointer */
406 uint sen_tbuf1data0; /* Save area 0 - current frame */
407 uint sen_tbuf1data1; /* Save area 1 - current frame */
408 uint sen_tbuf1rba; /* Internal */
409 uint sen_tbuf1crc; /* Internal */
410 ushort sen_tbuf1bcnt; /* Internal */
411 ushort sen_txlen; /* Tx Frame length counter */
412 ushort sen_iaddr1; /* Individual address filter */
413 ushort sen_iaddr2;
414 ushort sen_iaddr3;
415 ushort sen_iaddr4;
416 ushort sen_boffcnt; /* Backoff counter */
417
418 /* NOTE: Some versions of the manual have the following items
419 * incorrectly documented. Below is the proper order.
420 */
421 ushort sen_taddrh; /* temp address (MSB) */
422 ushort sen_taddrm;
423 ushort sen_taddrl; /* temp address (LSB) */
424} scc_enet_t;
425
426/* SCC Event register as used by Ethernet.
427*/
428#define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
429#define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */
430#define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */
431#define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */
432#define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
433#define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
434
435/* SCC Mode Register (PMSR) as used by Ethernet.
436*/
437#define SCC_PSMR_HBC ((ushort)0x8000) /* Enable heartbeat */
438#define SCC_PSMR_FC ((ushort)0x4000) /* Force collision */
439#define SCC_PSMR_RSH ((ushort)0x2000) /* Receive short frames */
440#define SCC_PSMR_IAM ((ushort)0x1000) /* Check individual hash */
441#define SCC_PSMR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
442#define SCC_PSMR_PRO ((ushort)0x0200) /* Promiscuous mode */
443#define SCC_PSMR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
444#define SCC_PSMR_SBT ((ushort)0x0080) /* Special backoff timer */
445#define SCC_PSMR_LPB ((ushort)0x0040) /* Set Loopback mode */
446#define SCC_PSMR_SIP ((ushort)0x0020) /* Sample Input Pins */
447#define SCC_PSMR_LCW ((ushort)0x0010) /* Late collision window */
448#define SCC_PSMR_NIB22 ((ushort)0x000a) /* Start frame search */
449#define SCC_PSMR_FDE ((ushort)0x0001) /* Full duplex enable */
450
451/* Buffer descriptor control/status used by Ethernet receive.
452*/
453#define BD_ENET_RX_EMPTY ((ushort)0x8000)
454#define BD_ENET_RX_WRAP ((ushort)0x2000)
455#define BD_ENET_RX_INTR ((ushort)0x1000)
456#define BD_ENET_RX_LAST ((ushort)0x0800)
457#define BD_ENET_RX_FIRST ((ushort)0x0400)
458#define BD_ENET_RX_MISS ((ushort)0x0100)
459#define BD_ENET_RX_LG ((ushort)0x0020)
460#define BD_ENET_RX_NO ((ushort)0x0010)
461#define BD_ENET_RX_SH ((ushort)0x0008)
462#define BD_ENET_RX_CR ((ushort)0x0004)
463#define BD_ENET_RX_OV ((ushort)0x0002)
464#define BD_ENET_RX_CL ((ushort)0x0001)
465#define BD_ENET_RX_BC ((ushort)0x0080) /* DA is Broadcast */
466#define BD_ENET_RX_MC ((ushort)0x0040) /* DA is Multicast */
467#define BD_ENET_RX_STATS ((ushort)0x013f) /* All status bits */
468
469/* Buffer descriptor control/status used by Ethernet transmit.
470*/
471#define BD_ENET_TX_READY ((ushort)0x8000)
472#define BD_ENET_TX_PAD ((ushort)0x4000)
473#define BD_ENET_TX_WRAP ((ushort)0x2000)
474#define BD_ENET_TX_INTR ((ushort)0x1000)
475#define BD_ENET_TX_LAST ((ushort)0x0800)
476#define BD_ENET_TX_TC ((ushort)0x0400)
477#define BD_ENET_TX_DEF ((ushort)0x0200)
478#define BD_ENET_TX_HB ((ushort)0x0100)
479#define BD_ENET_TX_LC ((ushort)0x0080)
480#define BD_ENET_TX_RL ((ushort)0x0040)
481#define BD_ENET_TX_RCMASK ((ushort)0x003c)
482#define BD_ENET_TX_UN ((ushort)0x0002)
483#define BD_ENET_TX_CSL ((ushort)0x0001)
484#define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
485
486/* SCC as UART
487*/
488typedef struct scc_uart {
489 sccp_t scc_genscc;
490 char res1[8]; /* Reserved */
491 ushort scc_maxidl; /* Maximum idle chars */
492 ushort scc_idlc; /* temp idle counter */
493 ushort scc_brkcr; /* Break count register */
494 ushort scc_parec; /* receive parity error counter */
495 ushort scc_frmec; /* receive framing error counter */
496 ushort scc_nosec; /* receive noise counter */
497 ushort scc_brkec; /* receive break condition counter */
498 ushort scc_brkln; /* last received break length */
499 ushort scc_uaddr1; /* UART address character 1 */
500 ushort scc_uaddr2; /* UART address character 2 */
501 ushort scc_rtemp; /* Temp storage */
502 ushort scc_toseq; /* Transmit out of sequence char */
503 ushort scc_char1; /* control character 1 */
504 ushort scc_char2; /* control character 2 */
505 ushort scc_char3; /* control character 3 */
506 ushort scc_char4; /* control character 4 */
507 ushort scc_char5; /* control character 5 */
508 ushort scc_char6; /* control character 6 */
509 ushort scc_char7; /* control character 7 */
510 ushort scc_char8; /* control character 8 */
511 ushort scc_rccm; /* receive control character mask */
512 ushort scc_rccr; /* receive control character register */
513 ushort scc_rlbc; /* receive last break character */
514} scc_uart_t;
515
516/* SCC Event and Mask registers when it is used as a UART.
517*/
518#define UART_SCCM_GLR ((ushort)0x1000)
519#define UART_SCCM_GLT ((ushort)0x0800)
520#define UART_SCCM_AB ((ushort)0x0200)
521#define UART_SCCM_IDL ((ushort)0x0100)
522#define UART_SCCM_GRA ((ushort)0x0080)
523#define UART_SCCM_BRKE ((ushort)0x0040)
524#define UART_SCCM_BRKS ((ushort)0x0020)
525#define UART_SCCM_CCR ((ushort)0x0008)
526#define UART_SCCM_BSY ((ushort)0x0004)
527#define UART_SCCM_TX ((ushort)0x0002)
528#define UART_SCCM_RX ((ushort)0x0001)
529
530/* The SCC PMSR when used as a UART.
531*/
532#define SCU_PSMR_FLC ((ushort)0x8000)
533#define SCU_PSMR_SL ((ushort)0x4000)
534#define SCU_PSMR_CL ((ushort)0x3000)
535#define SCU_PSMR_UM ((ushort)0x0c00)
536#define SCU_PSMR_FRZ ((ushort)0x0200)
537#define SCU_PSMR_RZS ((ushort)0x0100)
538#define SCU_PSMR_SYN ((ushort)0x0080)
539#define SCU_PSMR_DRT ((ushort)0x0040)
540#define SCU_PSMR_PEN ((ushort)0x0010)
541#define SCU_PSMR_RPM ((ushort)0x000c)
542#define SCU_PSMR_REVP ((ushort)0x0008)
543#define SCU_PSMR_TPM ((ushort)0x0003)
544#define SCU_PSMR_TEVP ((ushort)0x0002)
545
546/* CPM Transparent mode SCC.
547 */
548typedef struct scc_trans {
549 sccp_t st_genscc;
550 uint st_cpres; /* Preset CRC */
551 uint st_cmask; /* Constant mask for CRC */
552} scc_trans_t;
553
554#define BD_SCC_TX_LAST ((ushort)0x0800)
555
556/* IIC parameter RAM.
557*/
558typedef struct iic {
559 ushort iic_rbase; /* Rx Buffer descriptor base address */
560 ushort iic_tbase; /* Tx Buffer descriptor base address */
561 u_char iic_rfcr; /* Rx function code */
562 u_char iic_tfcr; /* Tx function code */
563 ushort iic_mrblr; /* Max receive buffer length */
564 uint iic_rstate; /* Internal */
565 uint iic_rdp; /* Internal */
566 ushort iic_rbptr; /* Internal */
567 ushort iic_rbc; /* Internal */
568 uint iic_rxtmp; /* Internal */
569 uint iic_tstate; /* Internal */
570 uint iic_tdp; /* Internal */
571 ushort iic_tbptr; /* Internal */
572 ushort iic_tbc; /* Internal */
573 uint iic_txtmp; /* Internal */
574 char res1[4]; /* Reserved */
575 ushort iic_rpbase; /* Relocation pointer */
576 char res2[2]; /* Reserved */
577} iic_t;
578
579#define BD_IIC_START ((ushort)0x0400)
580
581/* SPI parameter RAM.
582*/
583typedef struct spi {
584 ushort spi_rbase; /* Rx Buffer descriptor base address */
585 ushort spi_tbase; /* Tx Buffer descriptor base address */
586 u_char spi_rfcr; /* Rx function code */
587 u_char spi_tfcr; /* Tx function code */
588 ushort spi_mrblr; /* Max receive buffer length */
589 uint spi_rstate; /* Internal */
590 uint spi_rdp; /* Internal */
591 ushort spi_rbptr; /* Internal */
592 ushort spi_rbc; /* Internal */
593 uint spi_rxtmp; /* Internal */
594 uint spi_tstate; /* Internal */
595 uint spi_tdp; /* Internal */
596 ushort spi_tbptr; /* Internal */
597 ushort spi_tbc; /* Internal */
598 uint spi_txtmp; /* Internal */
599 uint spi_res;
600 ushort spi_rpbase; /* Relocation pointer */
601 ushort spi_res2;
602} spi_t;
603
604/* SPI Mode register.
605*/
606#define SPMODE_LOOP ((ushort)0x4000) /* Loopback */
607#define SPMODE_CI ((ushort)0x2000) /* Clock Invert */
608#define SPMODE_CP ((ushort)0x1000) /* Clock Phase */
609#define SPMODE_DIV16 ((ushort)0x0800) /* BRG/16 mode */
610#define SPMODE_REV ((ushort)0x0400) /* Reversed Data */
611#define SPMODE_MSTR ((ushort)0x0200) /* SPI Master */
612#define SPMODE_EN ((ushort)0x0100) /* Enable */
613#define SPMODE_LENMSK ((ushort)0x00f0) /* character length */
614#define SPMODE_LEN4 ((ushort)0x0030) /* 4 bits per char */
615#define SPMODE_LEN8 ((ushort)0x0070) /* 8 bits per char */
616#define SPMODE_LEN16 ((ushort)0x00f0) /* 16 bits per char */
617#define SPMODE_PMMSK ((ushort)0x000f) /* prescale modulus */
618
619/* SPIE fields */
620#define SPIE_MME 0x20
621#define SPIE_TXE 0x10
622#define SPIE_BSY 0x04
623#define SPIE_TXB 0x02
624#define SPIE_RXB 0x01
625
626/*
627 * RISC Controller Configuration Register definitons
628 */
629#define RCCR_TIME 0x8000 /* RISC Timer Enable */
630#define RCCR_TIMEP(t) (((t) & 0x3F)<<8) /* RISC Timer Period */
631#define RCCR_TIME_MASK 0x00FF /* not RISC Timer related bits */
632
633/* RISC Timer Parameter RAM offset */
634#define PROFF_RTMR ((uint)0x01B0)
635
636typedef struct risc_timer_pram {
637 unsigned short tm_base; /* RISC Timer Table Base Address */
638 unsigned short tm_ptr; /* RISC Timer Table Pointer (internal) */
639 unsigned short r_tmr; /* RISC Timer Mode Register */
640 unsigned short r_tmv; /* RISC Timer Valid Register */
641 unsigned long tm_cmd; /* RISC Timer Command Register */
642 unsigned long tm_cnt; /* RISC Timer Internal Count */
643} rt_pram_t;
644
645/* Bits in RISC Timer Command Register */
646#define TM_CMD_VALID 0x80000000 /* Valid - Enables the timer */
647#define TM_CMD_RESTART 0x40000000 /* Restart - for automatic restart */
648#define TM_CMD_PWM 0x20000000 /* Run in Pulse Width Modulation Mode */
649#define TM_CMD_NUM(n) (((n)&0xF)<<16) /* Timer Number */
650#define TM_CMD_PERIOD(p) ((p)&0xFFFF) /* Timer Period */
651
652/* CPM interrupts. There are nearly 32 interrupts generated by CPM
653 * channels or devices. All of these are presented to the PPC core
654 * as a single interrupt. The CPM interrupt handler dispatches its
655 * own handlers, in a similar fashion to the PPC core handler. We
656 * use the table as defined in the manuals (i.e. no special high
657 * priority and SCC1 == SCCa, etc...).
658 */
659#define CPMVEC_NR 32
660#define CPMVEC_PIO_PC15 ((ushort)0x1f)
661#define CPMVEC_SCC1 ((ushort)0x1e)
662#define CPMVEC_SCC2 ((ushort)0x1d)
663#define CPMVEC_SCC3 ((ushort)0x1c)
664#define CPMVEC_SCC4 ((ushort)0x1b)
665#define CPMVEC_PIO_PC14 ((ushort)0x1a)
666#define CPMVEC_TIMER1 ((ushort)0x19)
667#define CPMVEC_PIO_PC13 ((ushort)0x18)
668#define CPMVEC_PIO_PC12 ((ushort)0x17)
669#define CPMVEC_SDMA_CB_ERR ((ushort)0x16)
670#define CPMVEC_IDMA1 ((ushort)0x15)
671#define CPMVEC_IDMA2 ((ushort)0x14)
672#define CPMVEC_TIMER2 ((ushort)0x12)
673#define CPMVEC_RISCTIMER ((ushort)0x11)
674#define CPMVEC_I2C ((ushort)0x10)
675#define CPMVEC_PIO_PC11 ((ushort)0x0f)
676#define CPMVEC_PIO_PC10 ((ushort)0x0e)
677#define CPMVEC_TIMER3 ((ushort)0x0c)
678#define CPMVEC_PIO_PC9 ((ushort)0x0b)
679#define CPMVEC_PIO_PC8 ((ushort)0x0a)
680#define CPMVEC_PIO_PC7 ((ushort)0x09)
681#define CPMVEC_TIMER4 ((ushort)0x07)
682#define CPMVEC_PIO_PC6 ((ushort)0x06)
683#define CPMVEC_SPI ((ushort)0x05)
684#define CPMVEC_SMC1 ((ushort)0x04)
685#define CPMVEC_SMC2 ((ushort)0x03)
686#define CPMVEC_PIO_PC5 ((ushort)0x02)
687#define CPMVEC_PIO_PC4 ((ushort)0x01)
688#define CPMVEC_ERROR ((ushort)0x00)
689
690/* CPM interrupt configuration vector.
691*/
692#define CICR_SCD_SCC4 ((uint)0x00c00000) /* SCC4 @ SCCd */
693#define CICR_SCC_SCC3 ((uint)0x00200000) /* SCC3 @ SCCc */
694#define CICR_SCB_SCC2 ((uint)0x00040000) /* SCC2 @ SCCb */
695#define CICR_SCA_SCC1 ((uint)0x00000000) /* SCC1 @ SCCa */
696#define CICR_IRL_MASK ((uint)0x0000e000) /* Core interrrupt */
697#define CICR_HP_MASK ((uint)0x00001f00) /* Hi-pri int. */
698#define CICR_IEN ((uint)0x00000080) /* Int. enable */
699#define CICR_SPS ((uint)0x00000001) /* SCC Spread */
700
701extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id);
702extern void cpm_free_handler(int vec);
703
704#define IMAP_ADDR (get_immrbase())
705
706#define CPM_PIN_INPUT 0
707#define CPM_PIN_OUTPUT 1
708#define CPM_PIN_PRIMARY 0
709#define CPM_PIN_SECONDARY 2
710#define CPM_PIN_GPIO 4
711#define CPM_PIN_OPENDRAIN 8
712
713enum cpm_port {
714 CPM_PORTA,
715 CPM_PORTB,
716 CPM_PORTC,
717 CPM_PORTD,
718 CPM_PORTE,
719};
720
721void cpm1_set_pin(enum cpm_port port, int pin, int flags);
722
723enum cpm_clk_dir {
724 CPM_CLK_RX,
725 CPM_CLK_TX,
726 CPM_CLK_RTX
727};
728
729enum cpm_clk_target {
730 CPM_CLK_SCC1,
731 CPM_CLK_SCC2,
732 CPM_CLK_SCC3,
733 CPM_CLK_SCC4,
734 CPM_CLK_SMC1,
735 CPM_CLK_SMC2,
736};
737
738enum cpm_clk {
739 CPM_BRG1, /* Baud Rate Generator 1 */
740 CPM_BRG2, /* Baud Rate Generator 2 */
741 CPM_BRG3, /* Baud Rate Generator 3 */
742 CPM_BRG4, /* Baud Rate Generator 4 */
743 CPM_CLK1, /* Clock 1 */
744 CPM_CLK2, /* Clock 2 */
745 CPM_CLK3, /* Clock 3 */
746 CPM_CLK4, /* Clock 4 */
747 CPM_CLK5, /* Clock 5 */
748 CPM_CLK6, /* Clock 6 */
749 CPM_CLK7, /* Clock 7 */
750 CPM_CLK8, /* Clock 8 */
751};
752
753int cpm1_clk_setup(enum cpm_clk_target target, int clock, int mode);
754
755#endif /* __CPM_8XX__ */
diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h
new file mode 100644
index 000000000000..48df9f330e76
--- /dev/null
+++ b/include/asm-powerpc/cpm.h
@@ -0,0 +1,14 @@
1#ifndef __CPM_H
2#define __CPM_H
3
4#include <linux/compiler.h>
5#include <linux/types.h>
6
7int cpm_muram_init(void);
8unsigned long cpm_muram_alloc(unsigned long size, unsigned long align);
9int cpm_muram_free(unsigned long offset);
10unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
11void __iomem *cpm_muram_addr(unsigned long offset);
12dma_addr_t cpm_muram_dma(void __iomem *addr);
13
14#endif
diff --git a/include/asm-powerpc/cpm2.h b/include/asm-powerpc/cpm2.h
new file mode 100644
index 000000000000..f1112c15ef96
--- /dev/null
+++ b/include/asm-powerpc/cpm2.h
@@ -0,0 +1,1274 @@
1/*
2 * Communication Processor Module v2.
3 *
4 * This file contains structures and information for the communication
5 * processor channels found in the dual port RAM or parameter RAM.
6 * All CPM control and status is available through the CPM2 internal
7 * memory map. See immap_cpm2.h for details.
8 */
9#ifdef __KERNEL__
10#ifndef __CPM2__
11#define __CPM2__
12
13#include <asm/immap_cpm2.h>
14#include <asm/cpm.h>
15
16#ifdef CONFIG_PPC_85xx
17#define CPM_MAP_ADDR (get_immrbase() + 0x80000)
18#endif
19
20/* CPM Command register.
21*/
22#define CPM_CR_RST ((uint)0x80000000)
23#define CPM_CR_PAGE ((uint)0x7c000000)
24#define CPM_CR_SBLOCK ((uint)0x03e00000)
25#define CPM_CR_FLG ((uint)0x00010000)
26#define CPM_CR_MCN ((uint)0x00003fc0)
27#define CPM_CR_OPCODE ((uint)0x0000000f)
28
29/* Device sub-block and page codes.
30*/
31#define CPM_CR_SCC1_SBLOCK (0x04)
32#define CPM_CR_SCC2_SBLOCK (0x05)
33#define CPM_CR_SCC3_SBLOCK (0x06)
34#define CPM_CR_SCC4_SBLOCK (0x07)
35#define CPM_CR_SMC1_SBLOCK (0x08)
36#define CPM_CR_SMC2_SBLOCK (0x09)
37#define CPM_CR_SPI_SBLOCK (0x0a)
38#define CPM_CR_I2C_SBLOCK (0x0b)
39#define CPM_CR_TIMER_SBLOCK (0x0f)
40#define CPM_CR_RAND_SBLOCK (0x0e)
41#define CPM_CR_FCC1_SBLOCK (0x10)
42#define CPM_CR_FCC2_SBLOCK (0x11)
43#define CPM_CR_FCC3_SBLOCK (0x12)
44#define CPM_CR_IDMA1_SBLOCK (0x14)
45#define CPM_CR_IDMA2_SBLOCK (0x15)
46#define CPM_CR_IDMA3_SBLOCK (0x16)
47#define CPM_CR_IDMA4_SBLOCK (0x17)
48#define CPM_CR_MCC1_SBLOCK (0x1c)
49
50#define CPM_CR_FCC_SBLOCK(x) (x + 0x10)
51
52#define CPM_CR_SCC1_PAGE (0x00)
53#define CPM_CR_SCC2_PAGE (0x01)
54#define CPM_CR_SCC3_PAGE (0x02)
55#define CPM_CR_SCC4_PAGE (0x03)
56#define CPM_CR_SMC1_PAGE (0x07)
57#define CPM_CR_SMC2_PAGE (0x08)
58#define CPM_CR_SPI_PAGE (0x09)
59#define CPM_CR_I2C_PAGE (0x0a)
60#define CPM_CR_TIMER_PAGE (0x0a)
61#define CPM_CR_RAND_PAGE (0x0a)
62#define CPM_CR_FCC1_PAGE (0x04)
63#define CPM_CR_FCC2_PAGE (0x05)
64#define CPM_CR_FCC3_PAGE (0x06)
65#define CPM_CR_IDMA1_PAGE (0x07)
66#define CPM_CR_IDMA2_PAGE (0x08)
67#define CPM_CR_IDMA3_PAGE (0x09)
68#define CPM_CR_IDMA4_PAGE (0x0a)
69#define CPM_CR_MCC1_PAGE (0x07)
70#define CPM_CR_MCC2_PAGE (0x08)
71
72#define CPM_CR_FCC_PAGE(x) (x + 0x04)
73
74/* Some opcodes (there are more...later)
75*/
76#define CPM_CR_INIT_TRX ((ushort)0x0000)
77#define CPM_CR_INIT_RX ((ushort)0x0001)
78#define CPM_CR_INIT_TX ((ushort)0x0002)
79#define CPM_CR_HUNT_MODE ((ushort)0x0003)
80#define CPM_CR_STOP_TX ((ushort)0x0004)
81#define CPM_CR_GRA_STOP_TX ((ushort)0x0005)
82#define CPM_CR_RESTART_TX ((ushort)0x0006)
83#define CPM_CR_SET_GADDR ((ushort)0x0008)
84#define CPM_CR_START_IDMA ((ushort)0x0009)
85#define CPM_CR_STOP_IDMA ((ushort)0x000b)
86
87#define mk_cr_cmd(PG, SBC, MCN, OP) \
88 ((PG << 26) | (SBC << 21) | (MCN << 6) | OP)
89
90#ifndef CONFIG_PPC_CPM_NEW_BINDING
91/* Dual Port RAM addresses. The first 16K is available for almost
92 * any CPM use, so we put the BDs there. The first 128 bytes are
93 * used for SMC1 and SMC2 parameter RAM, so we start allocating
94 * BDs above that. All of this must change when we start
95 * downloading RAM microcode.
96 */
97#define CPM_DATAONLY_BASE ((uint)128)
98#define CPM_DP_NOSPACE ((uint)0x7fffffff)
99#if defined(CONFIG_8272) || defined(CONFIG_MPC8555)
100#define CPM_DATAONLY_SIZE ((uint)(8 * 1024) - CPM_DATAONLY_BASE)
101#define CPM_FCC_SPECIAL_BASE ((uint)0x00009000)
102#else
103#define CPM_DATAONLY_SIZE ((uint)(16 * 1024) - CPM_DATAONLY_BASE)
104#define CPM_FCC_SPECIAL_BASE ((uint)0x0000b000)
105#endif
106#endif
107
108/* The number of pages of host memory we allocate for CPM. This is
109 * done early in kernel initialization to get physically contiguous
110 * pages.
111 */
112#define NUM_CPM_HOST_PAGES 2
113
114/* Export the base address of the communication processor registers
115 * and dual port ram.
116 */
117extern cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor */
118
119#ifdef CONFIG_PPC_CPM_NEW_BINDING
120#define cpm_dpalloc cpm_muram_alloc
121#define cpm_dpfree cpm_muram_free
122#define cpm_dpram_addr cpm_muram_addr
123#else
124extern unsigned long cpm_dpalloc(uint size, uint align);
125extern int cpm_dpfree(unsigned long offset);
126extern unsigned long cpm_dpalloc_fixed(unsigned long offset, uint size, uint align);
127extern void cpm_dpdump(void);
128extern void *cpm_dpram_addr(unsigned long offset);
129#endif
130
131extern void cpm_setbrg(uint brg, uint rate);
132extern void cpm2_fastbrg(uint brg, uint rate, int div16);
133extern void cpm2_reset(void);
134
135
136/* Buffer descriptors used by many of the CPM protocols.
137*/
138typedef struct cpm_buf_desc {
139 ushort cbd_sc; /* Status and Control */
140 ushort cbd_datlen; /* Data length in buffer */
141 uint cbd_bufaddr; /* Buffer address in host memory */
142} cbd_t;
143
144#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */
145#define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
146#define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */
147#define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
148#define BD_SC_LAST ((ushort)0x0800) /* Last buffer in frame */
149#define BD_SC_CM ((ushort)0x0200) /* Continous mode */
150#define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */
151#define BD_SC_P ((ushort)0x0100) /* xmt preamble */
152#define BD_SC_BR ((ushort)0x0020) /* Break received */
153#define BD_SC_FR ((ushort)0x0010) /* Framing error */
154#define BD_SC_PR ((ushort)0x0008) /* Parity error */
155#define BD_SC_OV ((ushort)0x0002) /* Overrun */
156#define BD_SC_CD ((ushort)0x0001) /* ?? */
157
158/* Function code bits, usually generic to devices.
159*/
160#define CPMFCR_GBL ((u_char)0x20) /* Set memory snooping */
161#define CPMFCR_EB ((u_char)0x10) /* Set big endian byte order */
162#define CPMFCR_TC2 ((u_char)0x04) /* Transfer code 2 value */
163#define CPMFCR_DTB ((u_char)0x02) /* Use local bus for data when set */
164#define CPMFCR_BDB ((u_char)0x01) /* Use local bus for BD when set */
165
166/* Parameter RAM offsets from the base.
167*/
168#define PROFF_SCC1 ((uint)0x8000)
169#define PROFF_SCC2 ((uint)0x8100)
170#define PROFF_SCC3 ((uint)0x8200)
171#define PROFF_SCC4 ((uint)0x8300)
172#define PROFF_FCC1 ((uint)0x8400)
173#define PROFF_FCC2 ((uint)0x8500)
174#define PROFF_FCC3 ((uint)0x8600)
175#define PROFF_MCC1 ((uint)0x8700)
176#define PROFF_SMC1_BASE ((uint)0x87fc)
177#define PROFF_IDMA1_BASE ((uint)0x87fe)
178#define PROFF_MCC2 ((uint)0x8800)
179#define PROFF_SMC2_BASE ((uint)0x88fc)
180#define PROFF_IDMA2_BASE ((uint)0x88fe)
181#define PROFF_SPI_BASE ((uint)0x89fc)
182#define PROFF_IDMA3_BASE ((uint)0x89fe)
183#define PROFF_TIMERS ((uint)0x8ae0)
184#define PROFF_REVNUM ((uint)0x8af0)
185#define PROFF_RAND ((uint)0x8af8)
186#define PROFF_I2C_BASE ((uint)0x8afc)
187#define PROFF_IDMA4_BASE ((uint)0x8afe)
188
189#define PROFF_SCC_SIZE ((uint)0x100)
190#define PROFF_FCC_SIZE ((uint)0x100)
191#define PROFF_SMC_SIZE ((uint)64)
192
193/* The SMCs are relocated to any of the first eight DPRAM pages.
194 * We will fix these at the first locations of DPRAM, until we
195 * get some microcode patches :-).
196 * The parameter ram space for the SMCs is fifty-some bytes, and
197 * they are required to start on a 64 byte boundary.
198 */
199#define PROFF_SMC1 (0)
200#define PROFF_SMC2 (64)
201
202
203/* Define enough so I can at least use the serial port as a UART.
204 */
205typedef struct smc_uart {
206 ushort smc_rbase; /* Rx Buffer descriptor base address */
207 ushort smc_tbase; /* Tx Buffer descriptor base address */
208 u_char smc_rfcr; /* Rx function code */
209 u_char smc_tfcr; /* Tx function code */
210 ushort smc_mrblr; /* Max receive buffer length */
211 uint smc_rstate; /* Internal */
212 uint smc_idp; /* Internal */
213 ushort smc_rbptr; /* Internal */
214 ushort smc_ibc; /* Internal */
215 uint smc_rxtmp; /* Internal */
216 uint smc_tstate; /* Internal */
217 uint smc_tdp; /* Internal */
218 ushort smc_tbptr; /* Internal */
219 ushort smc_tbc; /* Internal */
220 uint smc_txtmp; /* Internal */
221 ushort smc_maxidl; /* Maximum idle characters */
222 ushort smc_tmpidl; /* Temporary idle counter */
223 ushort smc_brklen; /* Last received break length */
224 ushort smc_brkec; /* rcv'd break condition counter */
225 ushort smc_brkcr; /* xmt break count register */
226 ushort smc_rmask; /* Temporary bit mask */
227 uint smc_stmp; /* SDMA Temp */
228} smc_uart_t;
229
230/* SMC uart mode register (Internal memory map).
231*/
232#define SMCMR_REN ((ushort)0x0001)
233#define SMCMR_TEN ((ushort)0x0002)
234#define SMCMR_DM ((ushort)0x000c)
235#define SMCMR_SM_GCI ((ushort)0x0000)
236#define SMCMR_SM_UART ((ushort)0x0020)
237#define SMCMR_SM_TRANS ((ushort)0x0030)
238#define SMCMR_SM_MASK ((ushort)0x0030)
239#define SMCMR_PM_EVEN ((ushort)0x0100) /* Even parity, else odd */
240#define SMCMR_REVD SMCMR_PM_EVEN
241#define SMCMR_PEN ((ushort)0x0200) /* Parity enable */
242#define SMCMR_BS SMCMR_PEN
243#define SMCMR_SL ((ushort)0x0400) /* Two stops, else one */
244#define SMCR_CLEN_MASK ((ushort)0x7800) /* Character length */
245#define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
246
247/* SMC Event and Mask register.
248*/
249#define SMCM_BRKE ((unsigned char)0x40) /* When in UART Mode */
250#define SMCM_BRK ((unsigned char)0x10) /* When in UART Mode */
251#define SMCM_TXE ((unsigned char)0x10)
252#define SMCM_BSY ((unsigned char)0x04)
253#define SMCM_TX ((unsigned char)0x02)
254#define SMCM_RX ((unsigned char)0x01)
255
256/* Baud rate generators.
257*/
258#define CPM_BRG_RST ((uint)0x00020000)
259#define CPM_BRG_EN ((uint)0x00010000)
260#define CPM_BRG_EXTC_INT ((uint)0x00000000)
261#define CPM_BRG_EXTC_CLK3_9 ((uint)0x00004000)
262#define CPM_BRG_EXTC_CLK5_15 ((uint)0x00008000)
263#define CPM_BRG_ATB ((uint)0x00002000)
264#define CPM_BRG_CD_MASK ((uint)0x00001ffe)
265#define CPM_BRG_DIV16 ((uint)0x00000001)
266
267/* SCCs.
268*/
269#define SCC_GSMRH_IRP ((uint)0x00040000)
270#define SCC_GSMRH_GDE ((uint)0x00010000)
271#define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
272#define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
273#define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
274#define SCC_GSMRH_REVD ((uint)0x00002000)
275#define SCC_GSMRH_TRX ((uint)0x00001000)
276#define SCC_GSMRH_TTX ((uint)0x00000800)
277#define SCC_GSMRH_CDP ((uint)0x00000400)
278#define SCC_GSMRH_CTSP ((uint)0x00000200)
279#define SCC_GSMRH_CDS ((uint)0x00000100)
280#define SCC_GSMRH_CTSS ((uint)0x00000080)
281#define SCC_GSMRH_TFL ((uint)0x00000040)
282#define SCC_GSMRH_RFW ((uint)0x00000020)
283#define SCC_GSMRH_TXSY ((uint)0x00000010)
284#define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
285#define SCC_GSMRH_SYNL8 ((uint)0x00000008)
286#define SCC_GSMRH_SYNL4 ((uint)0x00000004)
287#define SCC_GSMRH_RTSM ((uint)0x00000002)
288#define SCC_GSMRH_RSYN ((uint)0x00000001)
289
290#define SCC_GSMRL_SIR ((uint)0x80000000) /* SCC2 only */
291#define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
292#define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
293#define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
294#define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
295#define SCC_GSMRL_TCI ((uint)0x10000000)
296#define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
297#define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
298#define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
299#define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
300#define SCC_GSMRL_RINV ((uint)0x02000000)
301#define SCC_GSMRL_TINV ((uint)0x01000000)
302#define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
303#define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
304#define SCC_GSMRL_TPL_48 ((uint)0x00800000)
305#define SCC_GSMRL_TPL_32 ((uint)0x00600000)
306#define SCC_GSMRL_TPL_16 ((uint)0x00400000)
307#define SCC_GSMRL_TPL_8 ((uint)0x00200000)
308#define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
309#define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
310#define SCC_GSMRL_TPP_01 ((uint)0x00100000)
311#define SCC_GSMRL_TPP_10 ((uint)0x00080000)
312#define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
313#define SCC_GSMRL_TEND ((uint)0x00040000)
314#define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
315#define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
316#define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
317#define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
318#define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
319#define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
320#define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
321#define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
322#define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
323#define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
324#define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
325#define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
326#define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
327#define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
328#define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
329#define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
330#define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
331#define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
332#define SCC_GSMRL_DIAG_LE ((uint)0x000000c0) /* Loop and echo */
333#define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
334#define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
335#define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
336#define SCC_GSMRL_ENR ((uint)0x00000020)
337#define SCC_GSMRL_ENT ((uint)0x00000010)
338#define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
339#define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
340#define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
341#define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
342#define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
343#define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
344#define SCC_GSMRL_MODE_UART ((uint)0x00000004)
345#define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
346#define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
347#define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
348
349#define SCC_TODR_TOD ((ushort)0x8000)
350
351/* SCC Event and Mask register.
352*/
353#define SCCM_TXE ((unsigned char)0x10)
354#define SCCM_BSY ((unsigned char)0x04)
355#define SCCM_TX ((unsigned char)0x02)
356#define SCCM_RX ((unsigned char)0x01)
357
358typedef struct scc_param {
359 ushort scc_rbase; /* Rx Buffer descriptor base address */
360 ushort scc_tbase; /* Tx Buffer descriptor base address */
361 u_char scc_rfcr; /* Rx function code */
362 u_char scc_tfcr; /* Tx function code */
363 ushort scc_mrblr; /* Max receive buffer length */
364 uint scc_rstate; /* Internal */
365 uint scc_idp; /* Internal */
366 ushort scc_rbptr; /* Internal */
367 ushort scc_ibc; /* Internal */
368 uint scc_rxtmp; /* Internal */
369 uint scc_tstate; /* Internal */
370 uint scc_tdp; /* Internal */
371 ushort scc_tbptr; /* Internal */
372 ushort scc_tbc; /* Internal */
373 uint scc_txtmp; /* Internal */
374 uint scc_rcrc; /* Internal */
375 uint scc_tcrc; /* Internal */
376} sccp_t;
377
378/* CPM Ethernet through SCC1.
379 */
380typedef struct scc_enet {
381 sccp_t sen_genscc;
382 uint sen_cpres; /* Preset CRC */
383 uint sen_cmask; /* Constant mask for CRC */
384 uint sen_crcec; /* CRC Error counter */
385 uint sen_alec; /* alignment error counter */
386 uint sen_disfc; /* discard frame counter */
387 ushort sen_pads; /* Tx short frame pad character */
388 ushort sen_retlim; /* Retry limit threshold */
389 ushort sen_retcnt; /* Retry limit counter */
390 ushort sen_maxflr; /* maximum frame length register */
391 ushort sen_minflr; /* minimum frame length register */
392 ushort sen_maxd1; /* maximum DMA1 length */
393 ushort sen_maxd2; /* maximum DMA2 length */
394 ushort sen_maxd; /* Rx max DMA */
395 ushort sen_dmacnt; /* Rx DMA counter */
396 ushort sen_maxb; /* Max BD byte count */
397 ushort sen_gaddr1; /* Group address filter */
398 ushort sen_gaddr2;
399 ushort sen_gaddr3;
400 ushort sen_gaddr4;
401 uint sen_tbuf0data0; /* Save area 0 - current frame */
402 uint sen_tbuf0data1; /* Save area 1 - current frame */
403 uint sen_tbuf0rba; /* Internal */
404 uint sen_tbuf0crc; /* Internal */
405 ushort sen_tbuf0bcnt; /* Internal */
406 ushort sen_paddrh; /* physical address (MSB) */
407 ushort sen_paddrm;
408 ushort sen_paddrl; /* physical address (LSB) */
409 ushort sen_pper; /* persistence */
410 ushort sen_rfbdptr; /* Rx first BD pointer */
411 ushort sen_tfbdptr; /* Tx first BD pointer */
412 ushort sen_tlbdptr; /* Tx last BD pointer */
413 uint sen_tbuf1data0; /* Save area 0 - current frame */
414 uint sen_tbuf1data1; /* Save area 1 - current frame */
415 uint sen_tbuf1rba; /* Internal */
416 uint sen_tbuf1crc; /* Internal */
417 ushort sen_tbuf1bcnt; /* Internal */
418 ushort sen_txlen; /* Tx Frame length counter */
419 ushort sen_iaddr1; /* Individual address filter */
420 ushort sen_iaddr2;
421 ushort sen_iaddr3;
422 ushort sen_iaddr4;
423 ushort sen_boffcnt; /* Backoff counter */
424
425 /* NOTE: Some versions of the manual have the following items
426 * incorrectly documented. Below is the proper order.
427 */
428 ushort sen_taddrh; /* temp address (MSB) */
429 ushort sen_taddrm;
430 ushort sen_taddrl; /* temp address (LSB) */
431} scc_enet_t;
432
433
434/* SCC Event register as used by Ethernet.
435*/
436#define SCCE_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
437#define SCCE_ENET_TXE ((ushort)0x0010) /* Transmit Error */
438#define SCCE_ENET_RXF ((ushort)0x0008) /* Full frame received */
439#define SCCE_ENET_BSY ((ushort)0x0004) /* All incoming buffers full */
440#define SCCE_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
441#define SCCE_ENET_RXB ((ushort)0x0001) /* A buffer was received */
442
443/* SCC Mode Register (PSMR) as used by Ethernet.
444*/
445#define SCC_PSMR_HBC ((ushort)0x8000) /* Enable heartbeat */
446#define SCC_PSMR_FC ((ushort)0x4000) /* Force collision */
447#define SCC_PSMR_RSH ((ushort)0x2000) /* Receive short frames */
448#define SCC_PSMR_IAM ((ushort)0x1000) /* Check individual hash */
449#define SCC_PSMR_ENCRC ((ushort)0x0800) /* Ethernet CRC mode */
450#define SCC_PSMR_PRO ((ushort)0x0200) /* Promiscuous mode */
451#define SCC_PSMR_BRO ((ushort)0x0100) /* Catch broadcast pkts */
452#define SCC_PSMR_SBT ((ushort)0x0080) /* Special backoff timer */
453#define SCC_PSMR_LPB ((ushort)0x0040) /* Set Loopback mode */
454#define SCC_PSMR_SIP ((ushort)0x0020) /* Sample Input Pins */
455#define SCC_PSMR_LCW ((ushort)0x0010) /* Late collision window */
456#define SCC_PSMR_NIB22 ((ushort)0x000a) /* Start frame search */
457#define SCC_PSMR_FDE ((ushort)0x0001) /* Full duplex enable */
458
459/* Buffer descriptor control/status used by Ethernet receive.
460 * Common to SCC and FCC.
461 */
462#define BD_ENET_RX_EMPTY ((ushort)0x8000)
463#define BD_ENET_RX_WRAP ((ushort)0x2000)
464#define BD_ENET_RX_INTR ((ushort)0x1000)
465#define BD_ENET_RX_LAST ((ushort)0x0800)
466#define BD_ENET_RX_FIRST ((ushort)0x0400)
467#define BD_ENET_RX_MISS ((ushort)0x0100)
468#define BD_ENET_RX_BC ((ushort)0x0080) /* FCC Only */
469#define BD_ENET_RX_MC ((ushort)0x0040) /* FCC Only */
470#define BD_ENET_RX_LG ((ushort)0x0020)
471#define BD_ENET_RX_NO ((ushort)0x0010)
472#define BD_ENET_RX_SH ((ushort)0x0008)
473#define BD_ENET_RX_CR ((ushort)0x0004)
474#define BD_ENET_RX_OV ((ushort)0x0002)
475#define BD_ENET_RX_CL ((ushort)0x0001)
476#define BD_ENET_RX_STATS ((ushort)0x01ff) /* All status bits */
477
478/* Buffer descriptor control/status used by Ethernet transmit.
479 * Common to SCC and FCC.
480 */
481#define BD_ENET_TX_READY ((ushort)0x8000)
482#define BD_ENET_TX_PAD ((ushort)0x4000)
483#define BD_ENET_TX_WRAP ((ushort)0x2000)
484#define BD_ENET_TX_INTR ((ushort)0x1000)
485#define BD_ENET_TX_LAST ((ushort)0x0800)
486#define BD_ENET_TX_TC ((ushort)0x0400)
487#define BD_ENET_TX_DEF ((ushort)0x0200)
488#define BD_ENET_TX_HB ((ushort)0x0100)
489#define BD_ENET_TX_LC ((ushort)0x0080)
490#define BD_ENET_TX_RL ((ushort)0x0040)
491#define BD_ENET_TX_RCMASK ((ushort)0x003c)
492#define BD_ENET_TX_UN ((ushort)0x0002)
493#define BD_ENET_TX_CSL ((ushort)0x0001)
494#define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
495
496/* SCC as UART
497*/
498typedef struct scc_uart {
499 sccp_t scc_genscc;
500 uint scc_res1; /* Reserved */
501 uint scc_res2; /* Reserved */
502 ushort scc_maxidl; /* Maximum idle chars */
503 ushort scc_idlc; /* temp idle counter */
504 ushort scc_brkcr; /* Break count register */
505 ushort scc_parec; /* receive parity error counter */
506 ushort scc_frmec; /* receive framing error counter */
507 ushort scc_nosec; /* receive noise counter */
508 ushort scc_brkec; /* receive break condition counter */
509 ushort scc_brkln; /* last received break length */
510 ushort scc_uaddr1; /* UART address character 1 */
511 ushort scc_uaddr2; /* UART address character 2 */
512 ushort scc_rtemp; /* Temp storage */
513 ushort scc_toseq; /* Transmit out of sequence char */
514 ushort scc_char1; /* control character 1 */
515 ushort scc_char2; /* control character 2 */
516 ushort scc_char3; /* control character 3 */
517 ushort scc_char4; /* control character 4 */
518 ushort scc_char5; /* control character 5 */
519 ushort scc_char6; /* control character 6 */
520 ushort scc_char7; /* control character 7 */
521 ushort scc_char8; /* control character 8 */
522 ushort scc_rccm; /* receive control character mask */
523 ushort scc_rccr; /* receive control character register */
524 ushort scc_rlbc; /* receive last break character */
525} scc_uart_t;
526
527/* SCC Event and Mask registers when it is used as a UART.
528*/
529#define UART_SCCM_GLR ((ushort)0x1000)
530#define UART_SCCM_GLT ((ushort)0x0800)
531#define UART_SCCM_AB ((ushort)0x0200)
532#define UART_SCCM_IDL ((ushort)0x0100)
533#define UART_SCCM_GRA ((ushort)0x0080)
534#define UART_SCCM_BRKE ((ushort)0x0040)
535#define UART_SCCM_BRKS ((ushort)0x0020)
536#define UART_SCCM_CCR ((ushort)0x0008)
537#define UART_SCCM_BSY ((ushort)0x0004)
538#define UART_SCCM_TX ((ushort)0x0002)
539#define UART_SCCM_RX ((ushort)0x0001)
540
541/* The SCC PSMR when used as a UART.
542*/
543#define SCU_PSMR_FLC ((ushort)0x8000)
544#define SCU_PSMR_SL ((ushort)0x4000)
545#define SCU_PSMR_CL ((ushort)0x3000)
546#define SCU_PSMR_UM ((ushort)0x0c00)
547#define SCU_PSMR_FRZ ((ushort)0x0200)
548#define SCU_PSMR_RZS ((ushort)0x0100)
549#define SCU_PSMR_SYN ((ushort)0x0080)
550#define SCU_PSMR_DRT ((ushort)0x0040)
551#define SCU_PSMR_PEN ((ushort)0x0010)
552#define SCU_PSMR_RPM ((ushort)0x000c)
553#define SCU_PSMR_REVP ((ushort)0x0008)
554#define SCU_PSMR_TPM ((ushort)0x0003)
555#define SCU_PSMR_TEVP ((ushort)0x0002)
556
557/* CPM Transparent mode SCC.
558 */
559typedef struct scc_trans {
560 sccp_t st_genscc;
561 uint st_cpres; /* Preset CRC */
562 uint st_cmask; /* Constant mask for CRC */
563} scc_trans_t;
564
565#define BD_SCC_TX_LAST ((ushort)0x0800)
566
567/* How about some FCCs.....
568*/
569#define FCC_GFMR_DIAG_NORM ((uint)0x00000000)
570#define FCC_GFMR_DIAG_LE ((uint)0x40000000)
571#define FCC_GFMR_DIAG_AE ((uint)0x80000000)
572#define FCC_GFMR_DIAG_ALE ((uint)0xc0000000)
573#define FCC_GFMR_TCI ((uint)0x20000000)
574#define FCC_GFMR_TRX ((uint)0x10000000)
575#define FCC_GFMR_TTX ((uint)0x08000000)
576#define FCC_GFMR_TTX ((uint)0x08000000)
577#define FCC_GFMR_CDP ((uint)0x04000000)
578#define FCC_GFMR_CTSP ((uint)0x02000000)
579#define FCC_GFMR_CDS ((uint)0x01000000)
580#define FCC_GFMR_CTSS ((uint)0x00800000)
581#define FCC_GFMR_SYNL_NONE ((uint)0x00000000)
582#define FCC_GFMR_SYNL_AUTO ((uint)0x00004000)
583#define FCC_GFMR_SYNL_8 ((uint)0x00008000)
584#define FCC_GFMR_SYNL_16 ((uint)0x0000c000)
585#define FCC_GFMR_RTSM ((uint)0x00002000)
586#define FCC_GFMR_RENC_NRZ ((uint)0x00000000)
587#define FCC_GFMR_RENC_NRZI ((uint)0x00000800)
588#define FCC_GFMR_REVD ((uint)0x00000400)
589#define FCC_GFMR_TENC_NRZ ((uint)0x00000000)
590#define FCC_GFMR_TENC_NRZI ((uint)0x00000100)
591#define FCC_GFMR_TCRC_16 ((uint)0x00000000)
592#define FCC_GFMR_TCRC_32 ((uint)0x00000080)
593#define FCC_GFMR_ENR ((uint)0x00000020)
594#define FCC_GFMR_ENT ((uint)0x00000010)
595#define FCC_GFMR_MODE_ENET ((uint)0x0000000c)
596#define FCC_GFMR_MODE_ATM ((uint)0x0000000a)
597#define FCC_GFMR_MODE_HDLC ((uint)0x00000000)
598
599/* Generic FCC parameter ram.
600*/
601typedef struct fcc_param {
602 ushort fcc_riptr; /* Rx Internal temp pointer */
603 ushort fcc_tiptr; /* Tx Internal temp pointer */
604 ushort fcc_res1;
605 ushort fcc_mrblr; /* Max receive buffer length, mod 32 bytes */
606 uint fcc_rstate; /* Upper byte is Func code, must be set */
607 uint fcc_rbase; /* Receive BD base */
608 ushort fcc_rbdstat; /* RxBD status */
609 ushort fcc_rbdlen; /* RxBD down counter */
610 uint fcc_rdptr; /* RxBD internal data pointer */
611 uint fcc_tstate; /* Upper byte is Func code, must be set */
612 uint fcc_tbase; /* Transmit BD base */
613 ushort fcc_tbdstat; /* TxBD status */
614 ushort fcc_tbdlen; /* TxBD down counter */
615 uint fcc_tdptr; /* TxBD internal data pointer */
616 uint fcc_rbptr; /* Rx BD Internal buf pointer */
617 uint fcc_tbptr; /* Tx BD Internal buf pointer */
618 uint fcc_rcrc; /* Rx temp CRC */
619 uint fcc_res2;
620 uint fcc_tcrc; /* Tx temp CRC */
621} fccp_t;
622
623
624/* Ethernet controller through FCC.
625*/
626typedef struct fcc_enet {
627 fccp_t fen_genfcc;
628 uint fen_statbuf; /* Internal status buffer */
629 uint fen_camptr; /* CAM address */
630 uint fen_cmask; /* Constant mask for CRC */
631 uint fen_cpres; /* Preset CRC */
632 uint fen_crcec; /* CRC Error counter */
633 uint fen_alec; /* alignment error counter */
634 uint fen_disfc; /* discard frame counter */
635 ushort fen_retlim; /* Retry limit */
636 ushort fen_retcnt; /* Retry counter */
637 ushort fen_pper; /* Persistence */
638 ushort fen_boffcnt; /* backoff counter */
639 uint fen_gaddrh; /* Group address filter, high 32-bits */
640 uint fen_gaddrl; /* Group address filter, low 32-bits */
641 ushort fen_tfcstat; /* out of sequence TxBD */
642 ushort fen_tfclen;
643 uint fen_tfcptr;
644 ushort fen_mflr; /* Maximum frame length (1518) */
645 ushort fen_paddrh; /* MAC address */
646 ushort fen_paddrm;
647 ushort fen_paddrl;
648 ushort fen_ibdcount; /* Internal BD counter */
649 ushort fen_ibdstart; /* Internal BD start pointer */
650 ushort fen_ibdend; /* Internal BD end pointer */
651 ushort fen_txlen; /* Internal Tx frame length counter */
652 uint fen_ibdbase[8]; /* Internal use */
653 uint fen_iaddrh; /* Individual address filter */
654 uint fen_iaddrl;
655 ushort fen_minflr; /* Minimum frame length (64) */
656 ushort fen_taddrh; /* Filter transfer MAC address */
657 ushort fen_taddrm;
658 ushort fen_taddrl;
659 ushort fen_padptr; /* Pointer to pad byte buffer */
660 ushort fen_cftype; /* control frame type */
661 ushort fen_cfrange; /* control frame range */
662 ushort fen_maxb; /* maximum BD count */
663 ushort fen_maxd1; /* Max DMA1 length (1520) */
664 ushort fen_maxd2; /* Max DMA2 length (1520) */
665 ushort fen_maxd; /* internal max DMA count */
666 ushort fen_dmacnt; /* internal DMA counter */
667 uint fen_octc; /* Total octect counter */
668 uint fen_colc; /* Total collision counter */
669 uint fen_broc; /* Total broadcast packet counter */
670 uint fen_mulc; /* Total multicast packet count */
671 uint fen_uspc; /* Total packets < 64 bytes */
672 uint fen_frgc; /* Total packets < 64 bytes with errors */
673 uint fen_ospc; /* Total packets > 1518 */
674 uint fen_jbrc; /* Total packets > 1518 with errors */
675 uint fen_p64c; /* Total packets == 64 bytes */
676 uint fen_p65c; /* Total packets 64 < bytes <= 127 */
677 uint fen_p128c; /* Total packets 127 < bytes <= 255 */
678 uint fen_p256c; /* Total packets 256 < bytes <= 511 */
679 uint fen_p512c; /* Total packets 512 < bytes <= 1023 */
680 uint fen_p1024c; /* Total packets 1024 < bytes <= 1518 */
681 uint fen_cambuf; /* Internal CAM buffer poiner */
682 ushort fen_rfthr; /* Received frames threshold */
683 ushort fen_rfcnt; /* Received frames count */
684} fcc_enet_t;
685
686/* FCC Event/Mask register as used by Ethernet.
687*/
688#define FCC_ENET_GRA ((ushort)0x0080) /* Graceful stop complete */
689#define FCC_ENET_RXC ((ushort)0x0040) /* Control Frame Received */
690#define FCC_ENET_TXC ((ushort)0x0020) /* Out of seq. Tx sent */
691#define FCC_ENET_TXE ((ushort)0x0010) /* Transmit Error */
692#define FCC_ENET_RXF ((ushort)0x0008) /* Full frame received */
693#define FCC_ENET_BSY ((ushort)0x0004) /* Busy. Rx Frame dropped */
694#define FCC_ENET_TXB ((ushort)0x0002) /* A buffer was transmitted */
695#define FCC_ENET_RXB ((ushort)0x0001) /* A buffer was received */
696
697/* FCC Mode Register (FPSMR) as used by Ethernet.
698*/
699#define FCC_PSMR_HBC ((uint)0x80000000) /* Enable heartbeat */
700#define FCC_PSMR_FC ((uint)0x40000000) /* Force Collision */
701#define FCC_PSMR_SBT ((uint)0x20000000) /* Stop backoff timer */
702#define FCC_PSMR_LPB ((uint)0x10000000) /* Local protect. 1 = FDX */
703#define FCC_PSMR_LCW ((uint)0x08000000) /* Late collision select */
704#define FCC_PSMR_FDE ((uint)0x04000000) /* Full Duplex Enable */
705#define FCC_PSMR_MON ((uint)0x02000000) /* RMON Enable */
706#define FCC_PSMR_PRO ((uint)0x00400000) /* Promiscuous Enable */
707#define FCC_PSMR_FCE ((uint)0x00200000) /* Flow Control Enable */
708#define FCC_PSMR_RSH ((uint)0x00100000) /* Receive Short Frames */
709#define FCC_PSMR_CAM ((uint)0x00000400) /* CAM enable */
710#define FCC_PSMR_BRO ((uint)0x00000200) /* Broadcast pkt discard */
711#define FCC_PSMR_ENCRC ((uint)0x00000080) /* Use 32-bit CRC */
712
713/* IIC parameter RAM.
714*/
715typedef struct iic {
716 ushort iic_rbase; /* Rx Buffer descriptor base address */
717 ushort iic_tbase; /* Tx Buffer descriptor base address */
718 u_char iic_rfcr; /* Rx function code */
719 u_char iic_tfcr; /* Tx function code */
720 ushort iic_mrblr; /* Max receive buffer length */
721 uint iic_rstate; /* Internal */
722 uint iic_rdp; /* Internal */
723 ushort iic_rbptr; /* Internal */
724 ushort iic_rbc; /* Internal */
725 uint iic_rxtmp; /* Internal */
726 uint iic_tstate; /* Internal */
727 uint iic_tdp; /* Internal */
728 ushort iic_tbptr; /* Internal */
729 ushort iic_tbc; /* Internal */
730 uint iic_txtmp; /* Internal */
731} iic_t;
732
733/* SPI parameter RAM.
734*/
735typedef struct spi {
736 ushort spi_rbase; /* Rx Buffer descriptor base address */
737 ushort spi_tbase; /* Tx Buffer descriptor base address */
738 u_char spi_rfcr; /* Rx function code */
739 u_char spi_tfcr; /* Tx function code */
740 ushort spi_mrblr; /* Max receive buffer length */
741 uint spi_rstate; /* Internal */
742 uint spi_rdp; /* Internal */
743 ushort spi_rbptr; /* Internal */
744 ushort spi_rbc; /* Internal */
745 uint spi_rxtmp; /* Internal */
746 uint spi_tstate; /* Internal */
747 uint spi_tdp; /* Internal */
748 ushort spi_tbptr; /* Internal */
749 ushort spi_tbc; /* Internal */
750 uint spi_txtmp; /* Internal */
751 uint spi_res; /* Tx temp. */
752 uint spi_res1[4]; /* SDMA temp. */
753} spi_t;
754
755/* SPI Mode register.
756*/
757#define SPMODE_LOOP ((ushort)0x4000) /* Loopback */
758#define SPMODE_CI ((ushort)0x2000) /* Clock Invert */
759#define SPMODE_CP ((ushort)0x1000) /* Clock Phase */
760#define SPMODE_DIV16 ((ushort)0x0800) /* BRG/16 mode */
761#define SPMODE_REV ((ushort)0x0400) /* Reversed Data */
762#define SPMODE_MSTR ((ushort)0x0200) /* SPI Master */
763#define SPMODE_EN ((ushort)0x0100) /* Enable */
764#define SPMODE_LENMSK ((ushort)0x00f0) /* character length */
765#define SPMODE_PMMSK ((ushort)0x000f) /* prescale modulus */
766
767#define SPMODE_LEN(x) ((((x)-1)&0xF)<<4)
768#define SPMODE_PM(x) ((x) &0xF)
769
770#define SPI_EB ((u_char)0x10) /* big endian byte order */
771
772#define BD_IIC_START ((ushort)0x0400)
773
774/* IDMA parameter RAM
775*/
776typedef struct idma {
777 ushort ibase; /* IDMA buffer descriptor table base address */
778 ushort dcm; /* DMA channel mode */
779 ushort ibdptr; /* IDMA current buffer descriptor pointer */
780 ushort dpr_buf; /* IDMA transfer buffer base address */
781 ushort buf_inv; /* internal buffer inventory */
782 ushort ss_max; /* steady-state maximum transfer size */
783 ushort dpr_in_ptr; /* write pointer inside the internal buffer */
784 ushort sts; /* source transfer size */
785 ushort dpr_out_ptr; /* read pointer inside the internal buffer */
786 ushort seob; /* source end of burst */
787 ushort deob; /* destination end of burst */
788 ushort dts; /* destination transfer size */
789 ushort ret_add; /* return address when working in ERM=1 mode */
790 ushort res0; /* reserved */
791 uint bd_cnt; /* internal byte count */
792 uint s_ptr; /* source internal data pointer */
793 uint d_ptr; /* destination internal data pointer */
794 uint istate; /* internal state */
795 u_char res1[20]; /* pad to 64-byte length */
796} idma_t;
797
798/* DMA channel mode bit fields
799*/
800#define IDMA_DCM_FB ((ushort)0x8000) /* fly-by mode */
801#define IDMA_DCM_LP ((ushort)0x4000) /* low priority */
802#define IDMA_DCM_TC2 ((ushort)0x0400) /* value driven on TC[2] */
803#define IDMA_DCM_DMA_WRAP_MASK ((ushort)0x01c0) /* mask for DMA wrap */
804#define IDMA_DCM_DMA_WRAP_64 ((ushort)0x0000) /* 64-byte DMA xfer buffer */
805#define IDMA_DCM_DMA_WRAP_128 ((ushort)0x0040) /* 128-byte DMA xfer buffer */
806#define IDMA_DCM_DMA_WRAP_256 ((ushort)0x0080) /* 256-byte DMA xfer buffer */
807#define IDMA_DCM_DMA_WRAP_512 ((ushort)0x00c0) /* 512-byte DMA xfer buffer */
808#define IDMA_DCM_DMA_WRAP_1024 ((ushort)0x0100) /* 1024-byte DMA xfer buffer */
809#define IDMA_DCM_DMA_WRAP_2048 ((ushort)0x0140) /* 2048-byte DMA xfer buffer */
810#define IDMA_DCM_SINC ((ushort)0x0020) /* source inc addr */
811#define IDMA_DCM_DINC ((ushort)0x0010) /* destination inc addr */
812#define IDMA_DCM_ERM ((ushort)0x0008) /* external request mode */
813#define IDMA_DCM_DT ((ushort)0x0004) /* DONE treatment */
814#define IDMA_DCM_SD_MASK ((ushort)0x0003) /* mask for SD bit field */
815#define IDMA_DCM_SD_MEM2MEM ((ushort)0x0000) /* memory-to-memory xfer */
816#define IDMA_DCM_SD_PER2MEM ((ushort)0x0002) /* peripheral-to-memory xfer */
817#define IDMA_DCM_SD_MEM2PER ((ushort)0x0001) /* memory-to-peripheral xfer */
818
819/* IDMA Buffer Descriptors
820*/
821typedef struct idma_bd {
822 uint flags;
823 uint len; /* data length */
824 uint src; /* source data buffer pointer */
825 uint dst; /* destination data buffer pointer */
826} idma_bd_t;
827
828/* IDMA buffer descriptor flag bit fields
829*/
830#define IDMA_BD_V ((uint)0x80000000) /* valid */
831#define IDMA_BD_W ((uint)0x20000000) /* wrap */
832#define IDMA_BD_I ((uint)0x10000000) /* interrupt */
833#define IDMA_BD_L ((uint)0x08000000) /* last */
834#define IDMA_BD_CM ((uint)0x02000000) /* continuous mode */
835#define IDMA_BD_SDN ((uint)0x00400000) /* source done */
836#define IDMA_BD_DDN ((uint)0x00200000) /* destination done */
837#define IDMA_BD_DGBL ((uint)0x00100000) /* destination global */
838#define IDMA_BD_DBO_LE ((uint)0x00040000) /* little-end dest byte order */
839#define IDMA_BD_DBO_BE ((uint)0x00080000) /* big-end dest byte order */
840#define IDMA_BD_DDTB ((uint)0x00010000) /* destination data bus */
841#define IDMA_BD_SGBL ((uint)0x00002000) /* source global */
842#define IDMA_BD_SBO_LE ((uint)0x00000800) /* little-end src byte order */
843#define IDMA_BD_SBO_BE ((uint)0x00001000) /* big-end src byte order */
844#define IDMA_BD_SDTB ((uint)0x00000200) /* source data bus */
845
846/* per-channel IDMA registers
847*/
848typedef struct im_idma {
849 u_char idsr; /* IDMAn event status register */
850 u_char res0[3];
851 u_char idmr; /* IDMAn event mask register */
852 u_char res1[3];
853} im_idma_t;
854
855/* IDMA event register bit fields
856*/
857#define IDMA_EVENT_SC ((unsigned char)0x08) /* stop completed */
858#define IDMA_EVENT_OB ((unsigned char)0x04) /* out of buffers */
859#define IDMA_EVENT_EDN ((unsigned char)0x02) /* external DONE asserted */
860#define IDMA_EVENT_BC ((unsigned char)0x01) /* buffer descriptor complete */
861
862/* RISC Controller Configuration Register (RCCR) bit fields
863*/
864#define RCCR_TIME ((uint)0x80000000) /* timer enable */
865#define RCCR_TIMEP_MASK ((uint)0x3f000000) /* mask for timer period bit field */
866#define RCCR_DR0M ((uint)0x00800000) /* IDMA0 request mode */
867#define RCCR_DR1M ((uint)0x00400000) /* IDMA1 request mode */
868#define RCCR_DR2M ((uint)0x00000080) /* IDMA2 request mode */
869#define RCCR_DR3M ((uint)0x00000040) /* IDMA3 request mode */
870#define RCCR_DR0QP_MASK ((uint)0x00300000) /* mask for IDMA0 req priority */
871#define RCCR_DR0QP_HIGH ((uint)0x00000000) /* IDMA0 has high req priority */
872#define RCCR_DR0QP_MED ((uint)0x00100000) /* IDMA0 has medium req priority */
873#define RCCR_DR0QP_LOW ((uint)0x00200000) /* IDMA0 has low req priority */
874#define RCCR_DR1QP_MASK ((uint)0x00030000) /* mask for IDMA1 req priority */
875#define RCCR_DR1QP_HIGH ((uint)0x00000000) /* IDMA1 has high req priority */
876#define RCCR_DR1QP_MED ((uint)0x00010000) /* IDMA1 has medium req priority */
877#define RCCR_DR1QP_LOW ((uint)0x00020000) /* IDMA1 has low req priority */
878#define RCCR_DR2QP_MASK ((uint)0x00000030) /* mask for IDMA2 req priority */
879#define RCCR_DR2QP_HIGH ((uint)0x00000000) /* IDMA2 has high req priority */
880#define RCCR_DR2QP_MED ((uint)0x00000010) /* IDMA2 has medium req priority */
881#define RCCR_DR2QP_LOW ((uint)0x00000020) /* IDMA2 has low req priority */
882#define RCCR_DR3QP_MASK ((uint)0x00000003) /* mask for IDMA3 req priority */
883#define RCCR_DR3QP_HIGH ((uint)0x00000000) /* IDMA3 has high req priority */
884#define RCCR_DR3QP_MED ((uint)0x00000001) /* IDMA3 has medium req priority */
885#define RCCR_DR3QP_LOW ((uint)0x00000002) /* IDMA3 has low req priority */
886#define RCCR_EIE ((uint)0x00080000) /* external interrupt enable */
887#define RCCR_SCD ((uint)0x00040000) /* scheduler configuration */
888#define RCCR_ERAM_MASK ((uint)0x0000e000) /* mask for enable RAM microcode */
889#define RCCR_ERAM_0KB ((uint)0x00000000) /* use 0KB of dpram for microcode */
890#define RCCR_ERAM_2KB ((uint)0x00002000) /* use 2KB of dpram for microcode */
891#define RCCR_ERAM_4KB ((uint)0x00004000) /* use 4KB of dpram for microcode */
892#define RCCR_ERAM_6KB ((uint)0x00006000) /* use 6KB of dpram for microcode */
893#define RCCR_ERAM_8KB ((uint)0x00008000) /* use 8KB of dpram for microcode */
894#define RCCR_ERAM_10KB ((uint)0x0000a000) /* use 10KB of dpram for microcode */
895#define RCCR_ERAM_12KB ((uint)0x0000c000) /* use 12KB of dpram for microcode */
896#define RCCR_EDM0 ((uint)0x00000800) /* DREQ0 edge detect mode */
897#define RCCR_EDM1 ((uint)0x00000400) /* DREQ1 edge detect mode */
898#define RCCR_EDM2 ((uint)0x00000200) /* DREQ2 edge detect mode */
899#define RCCR_EDM3 ((uint)0x00000100) /* DREQ3 edge detect mode */
900#define RCCR_DEM01 ((uint)0x00000008) /* DONE0/DONE1 edge detect mode */
901#define RCCR_DEM23 ((uint)0x00000004) /* DONE2/DONE3 edge detect mode */
902
903/*-----------------------------------------------------------------------
904 * CMXFCR - CMX FCC Clock Route Register
905 */
906#define CMXFCR_FC1 0x40000000 /* FCC1 connection */
907#define CMXFCR_RF1CS_MSK 0x38000000 /* Receive FCC1 Clock Source Mask */
908#define CMXFCR_TF1CS_MSK 0x07000000 /* Transmit FCC1 Clock Source Mask */
909#define CMXFCR_FC2 0x00400000 /* FCC2 connection */
910#define CMXFCR_RF2CS_MSK 0x00380000 /* Receive FCC2 Clock Source Mask */
911#define CMXFCR_TF2CS_MSK 0x00070000 /* Transmit FCC2 Clock Source Mask */
912#define CMXFCR_FC3 0x00004000 /* FCC3 connection */
913#define CMXFCR_RF3CS_MSK 0x00003800 /* Receive FCC3 Clock Source Mask */
914#define CMXFCR_TF3CS_MSK 0x00000700 /* Transmit FCC3 Clock Source Mask */
915
916#define CMXFCR_RF1CS_BRG5 0x00000000 /* Receive FCC1 Clock Source is BRG5 */
917#define CMXFCR_RF1CS_BRG6 0x08000000 /* Receive FCC1 Clock Source is BRG6 */
918#define CMXFCR_RF1CS_BRG7 0x10000000 /* Receive FCC1 Clock Source is BRG7 */
919#define CMXFCR_RF1CS_BRG8 0x18000000 /* Receive FCC1 Clock Source is BRG8 */
920#define CMXFCR_RF1CS_CLK9 0x20000000 /* Receive FCC1 Clock Source is CLK9 */
921#define CMXFCR_RF1CS_CLK10 0x28000000 /* Receive FCC1 Clock Source is CLK10 */
922#define CMXFCR_RF1CS_CLK11 0x30000000 /* Receive FCC1 Clock Source is CLK11 */
923#define CMXFCR_RF1CS_CLK12 0x38000000 /* Receive FCC1 Clock Source is CLK12 */
924
925#define CMXFCR_TF1CS_BRG5 0x00000000 /* Transmit FCC1 Clock Source is BRG5 */
926#define CMXFCR_TF1CS_BRG6 0x01000000 /* Transmit FCC1 Clock Source is BRG6 */
927#define CMXFCR_TF1CS_BRG7 0x02000000 /* Transmit FCC1 Clock Source is BRG7 */
928#define CMXFCR_TF1CS_BRG8 0x03000000 /* Transmit FCC1 Clock Source is BRG8 */
929#define CMXFCR_TF1CS_CLK9 0x04000000 /* Transmit FCC1 Clock Source is CLK9 */
930#define CMXFCR_TF1CS_CLK10 0x05000000 /* Transmit FCC1 Clock Source is CLK10 */
931#define CMXFCR_TF1CS_CLK11 0x06000000 /* Transmit FCC1 Clock Source is CLK11 */
932#define CMXFCR_TF1CS_CLK12 0x07000000 /* Transmit FCC1 Clock Source is CLK12 */
933
934#define CMXFCR_RF2CS_BRG5 0x00000000 /* Receive FCC2 Clock Source is BRG5 */
935#define CMXFCR_RF2CS_BRG6 0x00080000 /* Receive FCC2 Clock Source is BRG6 */
936#define CMXFCR_RF2CS_BRG7 0x00100000 /* Receive FCC2 Clock Source is BRG7 */
937#define CMXFCR_RF2CS_BRG8 0x00180000 /* Receive FCC2 Clock Source is BRG8 */
938#define CMXFCR_RF2CS_CLK13 0x00200000 /* Receive FCC2 Clock Source is CLK13 */
939#define CMXFCR_RF2CS_CLK14 0x00280000 /* Receive FCC2 Clock Source is CLK14 */
940#define CMXFCR_RF2CS_CLK15 0x00300000 /* Receive FCC2 Clock Source is CLK15 */
941#define CMXFCR_RF2CS_CLK16 0x00380000 /* Receive FCC2 Clock Source is CLK16 */
942
943#define CMXFCR_TF2CS_BRG5 0x00000000 /* Transmit FCC2 Clock Source is BRG5 */
944#define CMXFCR_TF2CS_BRG6 0x00010000 /* Transmit FCC2 Clock Source is BRG6 */
945#define CMXFCR_TF2CS_BRG7 0x00020000 /* Transmit FCC2 Clock Source is BRG7 */
946#define CMXFCR_TF2CS_BRG8 0x00030000 /* Transmit FCC2 Clock Source is BRG8 */
947#define CMXFCR_TF2CS_CLK13 0x00040000 /* Transmit FCC2 Clock Source is CLK13 */
948#define CMXFCR_TF2CS_CLK14 0x00050000 /* Transmit FCC2 Clock Source is CLK14 */
949#define CMXFCR_TF2CS_CLK15 0x00060000 /* Transmit FCC2 Clock Source is CLK15 */
950#define CMXFCR_TF2CS_CLK16 0x00070000 /* Transmit FCC2 Clock Source is CLK16 */
951
952#define CMXFCR_RF3CS_BRG5 0x00000000 /* Receive FCC3 Clock Source is BRG5 */
953#define CMXFCR_RF3CS_BRG6 0x00000800 /* Receive FCC3 Clock Source is BRG6 */
954#define CMXFCR_RF3CS_BRG7 0x00001000 /* Receive FCC3 Clock Source is BRG7 */
955#define CMXFCR_RF3CS_BRG8 0x00001800 /* Receive FCC3 Clock Source is BRG8 */
956#define CMXFCR_RF3CS_CLK13 0x00002000 /* Receive FCC3 Clock Source is CLK13 */
957#define CMXFCR_RF3CS_CLK14 0x00002800 /* Receive FCC3 Clock Source is CLK14 */
958#define CMXFCR_RF3CS_CLK15 0x00003000 /* Receive FCC3 Clock Source is CLK15 */
959#define CMXFCR_RF3CS_CLK16 0x00003800 /* Receive FCC3 Clock Source is CLK16 */
960
961#define CMXFCR_TF3CS_BRG5 0x00000000 /* Transmit FCC3 Clock Source is BRG5 */
962#define CMXFCR_TF3CS_BRG6 0x00000100 /* Transmit FCC3 Clock Source is BRG6 */
963#define CMXFCR_TF3CS_BRG7 0x00000200 /* Transmit FCC3 Clock Source is BRG7 */
964#define CMXFCR_TF3CS_BRG8 0x00000300 /* Transmit FCC3 Clock Source is BRG8 */
965#define CMXFCR_TF3CS_CLK13 0x00000400 /* Transmit FCC3 Clock Source is CLK13 */
966#define CMXFCR_TF3CS_CLK14 0x00000500 /* Transmit FCC3 Clock Source is CLK14 */
967#define CMXFCR_TF3CS_CLK15 0x00000600 /* Transmit FCC3 Clock Source is CLK15 */
968#define CMXFCR_TF3CS_CLK16 0x00000700 /* Transmit FCC3 Clock Source is CLK16 */
969
970/*-----------------------------------------------------------------------
971 * CMXSCR - CMX SCC Clock Route Register
972 */
973#define CMXSCR_GR1 0x80000000 /* Grant Support of SCC1 */
974#define CMXSCR_SC1 0x40000000 /* SCC1 connection */
975#define CMXSCR_RS1CS_MSK 0x38000000 /* Receive SCC1 Clock Source Mask */
976#define CMXSCR_TS1CS_MSK 0x07000000 /* Transmit SCC1 Clock Source Mask */
977#define CMXSCR_GR2 0x00800000 /* Grant Support of SCC2 */
978#define CMXSCR_SC2 0x00400000 /* SCC2 connection */
979#define CMXSCR_RS2CS_MSK 0x00380000 /* Receive SCC2 Clock Source Mask */
980#define CMXSCR_TS2CS_MSK 0x00070000 /* Transmit SCC2 Clock Source Mask */
981#define CMXSCR_GR3 0x00008000 /* Grant Support of SCC3 */
982#define CMXSCR_SC3 0x00004000 /* SCC3 connection */
983#define CMXSCR_RS3CS_MSK 0x00003800 /* Receive SCC3 Clock Source Mask */
984#define CMXSCR_TS3CS_MSK 0x00000700 /* Transmit SCC3 Clock Source Mask */
985#define CMXSCR_GR4 0x00000080 /* Grant Support of SCC4 */
986#define CMXSCR_SC4 0x00000040 /* SCC4 connection */
987#define CMXSCR_RS4CS_MSK 0x00000038 /* Receive SCC4 Clock Source Mask */
988#define CMXSCR_TS4CS_MSK 0x00000007 /* Transmit SCC4 Clock Source Mask */
989
990#define CMXSCR_RS1CS_BRG1 0x00000000 /* SCC1 Rx Clock Source is BRG1 */
991#define CMXSCR_RS1CS_BRG2 0x08000000 /* SCC1 Rx Clock Source is BRG2 */
992#define CMXSCR_RS1CS_BRG3 0x10000000 /* SCC1 Rx Clock Source is BRG3 */
993#define CMXSCR_RS1CS_BRG4 0x18000000 /* SCC1 Rx Clock Source is BRG4 */
994#define CMXSCR_RS1CS_CLK11 0x20000000 /* SCC1 Rx Clock Source is CLK11 */
995#define CMXSCR_RS1CS_CLK12 0x28000000 /* SCC1 Rx Clock Source is CLK12 */
996#define CMXSCR_RS1CS_CLK3 0x30000000 /* SCC1 Rx Clock Source is CLK3 */
997#define CMXSCR_RS1CS_CLK4 0x38000000 /* SCC1 Rx Clock Source is CLK4 */
998
999#define CMXSCR_TS1CS_BRG1 0x00000000 /* SCC1 Tx Clock Source is BRG1 */
1000#define CMXSCR_TS1CS_BRG2 0x01000000 /* SCC1 Tx Clock Source is BRG2 */
1001#define CMXSCR_TS1CS_BRG3 0x02000000 /* SCC1 Tx Clock Source is BRG3 */
1002#define CMXSCR_TS1CS_BRG4 0x03000000 /* SCC1 Tx Clock Source is BRG4 */
1003#define CMXSCR_TS1CS_CLK11 0x04000000 /* SCC1 Tx Clock Source is CLK11 */
1004#define CMXSCR_TS1CS_CLK12 0x05000000 /* SCC1 Tx Clock Source is CLK12 */
1005#define CMXSCR_TS1CS_CLK3 0x06000000 /* SCC1 Tx Clock Source is CLK3 */
1006#define CMXSCR_TS1CS_CLK4 0x07000000 /* SCC1 Tx Clock Source is CLK4 */
1007
1008#define CMXSCR_RS2CS_BRG1 0x00000000 /* SCC2 Rx Clock Source is BRG1 */
1009#define CMXSCR_RS2CS_BRG2 0x00080000 /* SCC2 Rx Clock Source is BRG2 */
1010#define CMXSCR_RS2CS_BRG3 0x00100000 /* SCC2 Rx Clock Source is BRG3 */
1011#define CMXSCR_RS2CS_BRG4 0x00180000 /* SCC2 Rx Clock Source is BRG4 */
1012#define CMXSCR_RS2CS_CLK11 0x00200000 /* SCC2 Rx Clock Source is CLK11 */
1013#define CMXSCR_RS2CS_CLK12 0x00280000 /* SCC2 Rx Clock Source is CLK12 */
1014#define CMXSCR_RS2CS_CLK3 0x00300000 /* SCC2 Rx Clock Source is CLK3 */
1015#define CMXSCR_RS2CS_CLK4 0x00380000 /* SCC2 Rx Clock Source is CLK4 */
1016
1017#define CMXSCR_TS2CS_BRG1 0x00000000 /* SCC2 Tx Clock Source is BRG1 */
1018#define CMXSCR_TS2CS_BRG2 0x00010000 /* SCC2 Tx Clock Source is BRG2 */
1019#define CMXSCR_TS2CS_BRG3 0x00020000 /* SCC2 Tx Clock Source is BRG3 */
1020#define CMXSCR_TS2CS_BRG4 0x00030000 /* SCC2 Tx Clock Source is BRG4 */
1021#define CMXSCR_TS2CS_CLK11 0x00040000 /* SCC2 Tx Clock Source is CLK11 */
1022#define CMXSCR_TS2CS_CLK12 0x00050000 /* SCC2 Tx Clock Source is CLK12 */
1023#define CMXSCR_TS2CS_CLK3 0x00060000 /* SCC2 Tx Clock Source is CLK3 */
1024#define CMXSCR_TS2CS_CLK4 0x00070000 /* SCC2 Tx Clock Source is CLK4 */
1025
1026#define CMXSCR_RS3CS_BRG1 0x00000000 /* SCC3 Rx Clock Source is BRG1 */
1027#define CMXSCR_RS3CS_BRG2 0x00000800 /* SCC3 Rx Clock Source is BRG2 */
1028#define CMXSCR_RS3CS_BRG3 0x00001000 /* SCC3 Rx Clock Source is BRG3 */
1029#define CMXSCR_RS3CS_BRG4 0x00001800 /* SCC3 Rx Clock Source is BRG4 */
1030#define CMXSCR_RS3CS_CLK5 0x00002000 /* SCC3 Rx Clock Source is CLK5 */
1031#define CMXSCR_RS3CS_CLK6 0x00002800 /* SCC3 Rx Clock Source is CLK6 */
1032#define CMXSCR_RS3CS_CLK7 0x00003000 /* SCC3 Rx Clock Source is CLK7 */
1033#define CMXSCR_RS3CS_CLK8 0x00003800 /* SCC3 Rx Clock Source is CLK8 */
1034
1035#define CMXSCR_TS3CS_BRG1 0x00000000 /* SCC3 Tx Clock Source is BRG1 */
1036#define CMXSCR_TS3CS_BRG2 0x00000100 /* SCC3 Tx Clock Source is BRG2 */
1037#define CMXSCR_TS3CS_BRG3 0x00000200 /* SCC3 Tx Clock Source is BRG3 */
1038#define CMXSCR_TS3CS_BRG4 0x00000300 /* SCC3 Tx Clock Source is BRG4 */
1039#define CMXSCR_TS3CS_CLK5 0x00000400 /* SCC3 Tx Clock Source is CLK5 */
1040#define CMXSCR_TS3CS_CLK6 0x00000500 /* SCC3 Tx Clock Source is CLK6 */
1041#define CMXSCR_TS3CS_CLK7 0x00000600 /* SCC3 Tx Clock Source is CLK7 */
1042#define CMXSCR_TS3CS_CLK8 0x00000700 /* SCC3 Tx Clock Source is CLK8 */
1043
1044#define CMXSCR_RS4CS_BRG1 0x00000000 /* SCC4 Rx Clock Source is BRG1 */
1045#define CMXSCR_RS4CS_BRG2 0x00000008 /* SCC4 Rx Clock Source is BRG2 */
1046#define CMXSCR_RS4CS_BRG3 0x00000010 /* SCC4 Rx Clock Source is BRG3 */
1047#define CMXSCR_RS4CS_BRG4 0x00000018 /* SCC4 Rx Clock Source is BRG4 */
1048#define CMXSCR_RS4CS_CLK5 0x00000020 /* SCC4 Rx Clock Source is CLK5 */
1049#define CMXSCR_RS4CS_CLK6 0x00000028 /* SCC4 Rx Clock Source is CLK6 */
1050#define CMXSCR_RS4CS_CLK7 0x00000030 /* SCC4 Rx Clock Source is CLK7 */
1051#define CMXSCR_RS4CS_CLK8 0x00000038 /* SCC4 Rx Clock Source is CLK8 */
1052
1053#define CMXSCR_TS4CS_BRG1 0x00000000 /* SCC4 Tx Clock Source is BRG1 */
1054#define CMXSCR_TS4CS_BRG2 0x00000001 /* SCC4 Tx Clock Source is BRG2 */
1055#define CMXSCR_TS4CS_BRG3 0x00000002 /* SCC4 Tx Clock Source is BRG3 */
1056#define CMXSCR_TS4CS_BRG4 0x00000003 /* SCC4 Tx Clock Source is BRG4 */
1057#define CMXSCR_TS4CS_CLK5 0x00000004 /* SCC4 Tx Clock Source is CLK5 */
1058#define CMXSCR_TS4CS_CLK6 0x00000005 /* SCC4 Tx Clock Source is CLK6 */
1059#define CMXSCR_TS4CS_CLK7 0x00000006 /* SCC4 Tx Clock Source is CLK7 */
1060#define CMXSCR_TS4CS_CLK8 0x00000007 /* SCC4 Tx Clock Source is CLK8 */
1061
1062/*-----------------------------------------------------------------------
1063 * SIUMCR - SIU Module Configuration Register 4-31
1064 */
1065#define SIUMCR_BBD 0x80000000 /* Bus Busy Disable */
1066#define SIUMCR_ESE 0x40000000 /* External Snoop Enable */
1067#define SIUMCR_PBSE 0x20000000 /* Parity Byte Select Enable */
1068#define SIUMCR_CDIS 0x10000000 /* Core Disable */
1069#define SIUMCR_DPPC00 0x00000000 /* Data Parity Pins Configuration*/
1070#define SIUMCR_DPPC01 0x04000000 /* - " - */
1071#define SIUMCR_DPPC10 0x08000000 /* - " - */
1072#define SIUMCR_DPPC11 0x0c000000 /* - " - */
1073#define SIUMCR_L2CPC00 0x00000000 /* L2 Cache Pins Configuration */
1074#define SIUMCR_L2CPC01 0x01000000 /* - " - */
1075#define SIUMCR_L2CPC10 0x02000000 /* - " - */
1076#define SIUMCR_L2CPC11 0x03000000 /* - " - */
1077#define SIUMCR_LBPC00 0x00000000 /* Local Bus Pins Configuration */
1078#define SIUMCR_LBPC01 0x00400000 /* - " - */
1079#define SIUMCR_LBPC10 0x00800000 /* - " - */
1080#define SIUMCR_LBPC11 0x00c00000 /* - " - */
1081#define SIUMCR_APPC00 0x00000000 /* Address Parity Pins Configuration*/
1082#define SIUMCR_APPC01 0x00100000 /* - " - */
1083#define SIUMCR_APPC10 0x00200000 /* - " - */
1084#define SIUMCR_APPC11 0x00300000 /* - " - */
1085#define SIUMCR_CS10PC00 0x00000000 /* CS10 Pin Configuration */
1086#define SIUMCR_CS10PC01 0x00040000 /* - " - */
1087#define SIUMCR_CS10PC10 0x00080000 /* - " - */
1088#define SIUMCR_CS10PC11 0x000c0000 /* - " - */
1089#define SIUMCR_BCTLC00 0x00000000 /* Buffer Control Configuration */
1090#define SIUMCR_BCTLC01 0x00010000 /* - " - */
1091#define SIUMCR_BCTLC10 0x00020000 /* - " - */
1092#define SIUMCR_BCTLC11 0x00030000 /* - " - */
1093#define SIUMCR_MMR00 0x00000000 /* Mask Masters Requests */
1094#define SIUMCR_MMR01 0x00004000 /* - " - */
1095#define SIUMCR_MMR10 0x00008000 /* - " - */
1096#define SIUMCR_MMR11 0x0000c000 /* - " - */
1097#define SIUMCR_LPBSE 0x00002000 /* LocalBus Parity Byte Select Enable*/
1098
1099/*-----------------------------------------------------------------------
1100 * SCCR - System Clock Control Register 9-8
1101*/
1102#define SCCR_PCI_MODE 0x00000100 /* PCI Mode */
1103#define SCCR_PCI_MODCK 0x00000080 /* Value of PCI_MODCK pin */
1104#define SCCR_PCIDF_MSK 0x00000078 /* PCI division factor */
1105#define SCCR_PCIDF_SHIFT 3
1106
1107#ifndef CPM_IMMR_OFFSET
1108#define CPM_IMMR_OFFSET 0x101a8
1109#endif
1110
1111#define FCC_PSMR_RMII ((uint)0x00020000) /* Use RMII interface */
1112
1113/* FCC iop & clock configuration. BSP code is responsible to define Fx_RXCLK & Fx_TXCLK
1114 * in order to use clock-computing stuff below for the FCC x
1115 */
1116
1117/* Automatically generates register configurations */
1118#define PC_CLK(x) ((uint)(1<<(x-1))) /* FCC CLK I/O ports */
1119
1120#define CMXFCR_RF1CS(x) ((uint)((x-5)<<27)) /* FCC1 Receive Clock Source */
1121#define CMXFCR_TF1CS(x) ((uint)((x-5)<<24)) /* FCC1 Transmit Clock Source */
1122#define CMXFCR_RF2CS(x) ((uint)((x-9)<<19)) /* FCC2 Receive Clock Source */
1123#define CMXFCR_TF2CS(x) ((uint)((x-9)<<16)) /* FCC2 Transmit Clock Source */
1124#define CMXFCR_RF3CS(x) ((uint)((x-9)<<11)) /* FCC3 Receive Clock Source */
1125#define CMXFCR_TF3CS(x) ((uint)((x-9)<<8)) /* FCC3 Transmit Clock Source */
1126
1127#define PC_F1RXCLK PC_CLK(F1_RXCLK)
1128#define PC_F1TXCLK PC_CLK(F1_TXCLK)
1129#define CMX1_CLK_ROUTE (CMXFCR_RF1CS(F1_RXCLK) | CMXFCR_TF1CS(F1_TXCLK))
1130#define CMX1_CLK_MASK ((uint)0xff000000)
1131
1132#define PC_F2RXCLK PC_CLK(F2_RXCLK)
1133#define PC_F2TXCLK PC_CLK(F2_TXCLK)
1134#define CMX2_CLK_ROUTE (CMXFCR_RF2CS(F2_RXCLK) | CMXFCR_TF2CS(F2_TXCLK))
1135#define CMX2_CLK_MASK ((uint)0x00ff0000)
1136
1137#define PC_F3RXCLK PC_CLK(F3_RXCLK)
1138#define PC_F3TXCLK PC_CLK(F3_TXCLK)
1139#define CMX3_CLK_ROUTE (CMXFCR_RF3CS(F3_RXCLK) | CMXFCR_TF3CS(F3_TXCLK))
1140#define CMX3_CLK_MASK ((uint)0x0000ff00)
1141
1142#define CPMUX_CLK_MASK (CMX3_CLK_MASK | CMX2_CLK_MASK)
1143#define CPMUX_CLK_ROUTE (CMX3_CLK_ROUTE | CMX2_CLK_ROUTE)
1144
1145#define CLK_TRX (PC_F3TXCLK | PC_F3RXCLK | PC_F2TXCLK | PC_F2RXCLK)
1146
1147/* I/O Pin assignment for FCC1. I don't yet know the best way to do this,
1148 * but there is little variation among the choices.
1149 */
1150#define PA1_COL 0x00000001U
1151#define PA1_CRS 0x00000002U
1152#define PA1_TXER 0x00000004U
1153#define PA1_TXEN 0x00000008U
1154#define PA1_RXDV 0x00000010U
1155#define PA1_RXER 0x00000020U
1156#define PA1_TXDAT 0x00003c00U
1157#define PA1_RXDAT 0x0003c000U
1158#define PA1_PSORA0 (PA1_RXDAT | PA1_TXDAT)
1159#define PA1_PSORA1 (PA1_COL | PA1_CRS | PA1_TXER | PA1_TXEN | \
1160 PA1_RXDV | PA1_RXER)
1161#define PA1_DIRA0 (PA1_RXDAT | PA1_CRS | PA1_COL | PA1_RXER | PA1_RXDV)
1162#define PA1_DIRA1 (PA1_TXDAT | PA1_TXEN | PA1_TXER)
1163
1164
1165/* I/O Pin assignment for FCC2. I don't yet know the best way to do this,
1166 * but there is little variation among the choices.
1167 */
1168#define PB2_TXER 0x00000001U
1169#define PB2_RXDV 0x00000002U
1170#define PB2_TXEN 0x00000004U
1171#define PB2_RXER 0x00000008U
1172#define PB2_COL 0x00000010U
1173#define PB2_CRS 0x00000020U
1174#define PB2_TXDAT 0x000003c0U
1175#define PB2_RXDAT 0x00003c00U
1176#define PB2_PSORB0 (PB2_RXDAT | PB2_TXDAT | PB2_CRS | PB2_COL | \
1177 PB2_RXER | PB2_RXDV | PB2_TXER)
1178#define PB2_PSORB1 (PB2_TXEN)
1179#define PB2_DIRB0 (PB2_RXDAT | PB2_CRS | PB2_COL | PB2_RXER | PB2_RXDV)
1180#define PB2_DIRB1 (PB2_TXDAT | PB2_TXEN | PB2_TXER)
1181
1182
1183/* I/O Pin assignment for FCC3. I don't yet know the best way to do this,
1184 * but there is little variation among the choices.
1185 */
1186#define PB3_RXDV 0x00004000U
1187#define PB3_RXER 0x00008000U
1188#define PB3_TXER 0x00010000U
1189#define PB3_TXEN 0x00020000U
1190#define PB3_COL 0x00040000U
1191#define PB3_CRS 0x00080000U
1192#define PB3_TXDAT 0x0f000000U
1193#define PC3_TXDAT 0x00000010U
1194#define PB3_RXDAT 0x00f00000U
1195#define PB3_PSORB0 (PB3_RXDAT | PB3_TXDAT | PB3_CRS | PB3_COL | \
1196 PB3_RXER | PB3_RXDV | PB3_TXER | PB3_TXEN)
1197#define PB3_PSORB1 0
1198#define PB3_DIRB0 (PB3_RXDAT | PB3_CRS | PB3_COL | PB3_RXER | PB3_RXDV)
1199#define PB3_DIRB1 (PB3_TXDAT | PB3_TXEN | PB3_TXER)
1200#define PC3_DIRC1 (PC3_TXDAT)
1201
1202/* Handy macro to specify mem for FCCs*/
1203#define FCC_MEM_OFFSET(x) (CPM_FCC_SPECIAL_BASE + (x*128))
1204#define FCC1_MEM_OFFSET FCC_MEM_OFFSET(0)
1205#define FCC2_MEM_OFFSET FCC_MEM_OFFSET(1)
1206#define FCC3_MEM_OFFSET FCC_MEM_OFFSET(2)
1207
1208/* Clocks and GRG's */
1209
1210enum cpm_clk_dir {
1211 CPM_CLK_RX,
1212 CPM_CLK_TX,
1213 CPM_CLK_RTX
1214};
1215
1216enum cpm_clk_target {
1217 CPM_CLK_SCC1,
1218 CPM_CLK_SCC2,
1219 CPM_CLK_SCC3,
1220 CPM_CLK_SCC4,
1221 CPM_CLK_FCC1,
1222 CPM_CLK_FCC2,
1223 CPM_CLK_FCC3,
1224 CPM_CLK_SMC1,
1225 CPM_CLK_SMC2,
1226};
1227
1228enum cpm_clk {
1229 CPM_CLK_NONE = 0,
1230 CPM_BRG1, /* Baud Rate Generator 1 */
1231 CPM_BRG2, /* Baud Rate Generator 2 */
1232 CPM_BRG3, /* Baud Rate Generator 3 */
1233 CPM_BRG4, /* Baud Rate Generator 4 */
1234 CPM_BRG5, /* Baud Rate Generator 5 */
1235 CPM_BRG6, /* Baud Rate Generator 6 */
1236 CPM_BRG7, /* Baud Rate Generator 7 */
1237 CPM_BRG8, /* Baud Rate Generator 8 */
1238 CPM_CLK1, /* Clock 1 */
1239 CPM_CLK2, /* Clock 2 */
1240 CPM_CLK3, /* Clock 3 */
1241 CPM_CLK4, /* Clock 4 */
1242 CPM_CLK5, /* Clock 5 */
1243 CPM_CLK6, /* Clock 6 */
1244 CPM_CLK7, /* Clock 7 */
1245 CPM_CLK8, /* Clock 8 */
1246 CPM_CLK9, /* Clock 9 */
1247 CPM_CLK10, /* Clock 10 */
1248 CPM_CLK11, /* Clock 11 */
1249 CPM_CLK12, /* Clock 12 */
1250 CPM_CLK13, /* Clock 13 */
1251 CPM_CLK14, /* Clock 14 */
1252 CPM_CLK15, /* Clock 15 */
1253 CPM_CLK16, /* Clock 16 */
1254 CPM_CLK17, /* Clock 17 */
1255 CPM_CLK18, /* Clock 18 */
1256 CPM_CLK19, /* Clock 19 */
1257 CPM_CLK20, /* Clock 20 */
1258 CPM_CLK_DUMMY
1259};
1260
1261extern int cpm2_clk_setup(enum cpm_clk_target target, int clock, int mode);
1262extern int cpm2_smc_clk_setup(enum cpm_clk_target target, int clock);
1263
1264#define CPM_PIN_INPUT 0
1265#define CPM_PIN_OUTPUT 1
1266#define CPM_PIN_PRIMARY 0
1267#define CPM_PIN_SECONDARY 2
1268#define CPM_PIN_GPIO 4
1269#define CPM_PIN_OPENDRAIN 8
1270
1271void cpm2_set_pin(int port, int pin, int flags);
1272
1273#endif /* __CPM2__ */
1274#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 3dc8e2dfca84..ae093ef68363 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -57,6 +57,7 @@ enum powerpc_pmc_type {
57 PPC_PMC_PA6T = 2, 57 PPC_PMC_PA6T = 2,
58}; 58};
59 59
60/* NOTE WELL: Update identify_cpu() if fields are added or removed! */
60struct cpu_spec { 61struct cpu_spec {
61 /* CPU is matched via (PVR & pvr_mask) == pvr_value */ 62 /* CPU is matched via (PVR & pvr_mask) == pvr_value */
62 unsigned int pvr_mask; 63 unsigned int pvr_mask;
@@ -136,6 +137,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
136#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000) 137#define CPU_FTR_REAL_LE ASM_CONST(0x0000000000400000)
137#define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x0000000000800000) 138#define CPU_FTR_FPU_UNAVAILABLE ASM_CONST(0x0000000000800000)
138#define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x0000000001000000) 139#define CPU_FTR_UNIFIED_ID_CACHE ASM_CONST(0x0000000001000000)
140#define CPU_FTR_SPE ASM_CONST(0x0000000002000000)
139 141
140/* 142/*
141 * Add the 64-bit processor unique features in the top half of the word; 143 * Add the 64-bit processor unique features in the top half of the word;
@@ -162,6 +164,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
162#define CPU_FTR_CELL_TB_BUG LONG_ASM_CONST(0x0000800000000000) 164#define CPU_FTR_CELL_TB_BUG LONG_ASM_CONST(0x0000800000000000)
163#define CPU_FTR_SPURR LONG_ASM_CONST(0x0001000000000000) 165#define CPU_FTR_SPURR LONG_ASM_CONST(0x0001000000000000)
164#define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000) 166#define CPU_FTR_DSCR LONG_ASM_CONST(0x0002000000000000)
167#define CPU_FTR_1T_SEGMENT LONG_ASM_CONST(0x0004000000000000)
165 168
166#ifndef __ASSEMBLY__ 169#ifndef __ASSEMBLY__
167 170
@@ -180,12 +183,27 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
180#define PPC_FEATURE_HAS_ALTIVEC_COMP 0 183#define PPC_FEATURE_HAS_ALTIVEC_COMP 0
181#endif 184#endif
182 185
183/* We need to mark all pages as being coherent if we're SMP or we 186/* We only set the spe features if the kernel was compiled with spe
184 * have a 74[45]x and an MPC107 host bridge. Also 83xx requires 187 * support
185 * it for PCI "streaming/prefetch" to work properly. 188 */
189#ifdef CONFIG_SPE
190#define CPU_FTR_SPE_COMP CPU_FTR_SPE
191#define PPC_FEATURE_HAS_SPE_COMP PPC_FEATURE_HAS_SPE
192#define PPC_FEATURE_HAS_EFP_SINGLE_COMP PPC_FEATURE_HAS_EFP_SINGLE
193#define PPC_FEATURE_HAS_EFP_DOUBLE_COMP PPC_FEATURE_HAS_EFP_DOUBLE
194#else
195#define CPU_FTR_SPE_COMP 0
196#define PPC_FEATURE_HAS_SPE_COMP 0
197#define PPC_FEATURE_HAS_EFP_SINGLE_COMP 0
198#define PPC_FEATURE_HAS_EFP_DOUBLE_COMP 0
199#endif
200
201/* We need to mark all pages as being coherent if we're SMP or we have a
202 * 74[45]x and an MPC107 host bridge. Also 83xx and PowerQUICC II
203 * require it for PCI "streaming/prefetch" to work properly.
186 */ 204 */
187#if defined(CONFIG_SMP) || defined(CONFIG_MPC10X_BRIDGE) \ 205#if defined(CONFIG_SMP) || defined(CONFIG_MPC10X_BRIDGE) \
188 || defined(CONFIG_PPC_83xx) 206 || defined(CONFIG_PPC_83xx) || defined(CONFIG_8260)
189#define CPU_FTR_COMMON CPU_FTR_NEED_COHERENT 207#define CPU_FTR_COMMON CPU_FTR_NEED_COHERENT
190#else 208#else
191#define CPU_FTR_COMMON 0 209#define CPU_FTR_COMMON 0
@@ -297,7 +315,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
297 CPU_FTR_PPC_LE) 315 CPU_FTR_PPC_LE)
298#define CPU_FTRS_82XX (CPU_FTR_COMMON | \ 316#define CPU_FTRS_82XX (CPU_FTR_COMMON | \
299 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB) 317 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB)
300#define CPU_FTRS_G2_LE (CPU_FTR_MAYBE_CAN_DOZE | \ 318#define CPU_FTRS_G2_LE (CPU_FTR_COMMON | CPU_FTR_MAYBE_CAN_DOZE | \
301 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS) 319 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS)
302#define CPU_FTRS_E300 (CPU_FTR_MAYBE_CAN_DOZE | \ 320#define CPU_FTRS_E300 (CPU_FTR_MAYBE_CAN_DOZE | \
303 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \ 321 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \
@@ -310,10 +328,12 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
310#define CPU_FTRS_8XX (CPU_FTR_USE_TB) 328#define CPU_FTRS_8XX (CPU_FTR_USE_TB)
311#define CPU_FTRS_40X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) 329#define CPU_FTRS_40X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN)
312#define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) 330#define CPU_FTRS_44X (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN)
313#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \ 331#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \
314 CPU_FTR_COHERENT_ICACHE | CPU_FTR_UNIFIED_ID_CACHE) 332 CPU_FTR_NODSISRALIGN | CPU_FTR_COHERENT_ICACHE | \
315#define CPU_FTRS_E500 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN) 333 CPU_FTR_UNIFIED_ID_CACHE)
316#define CPU_FTRS_E500_2 (CPU_FTR_USE_TB | \ 334#define CPU_FTRS_E500 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \
335 CPU_FTR_NODSISRALIGN)
336#define CPU_FTRS_E500_2 (CPU_FTR_USE_TB | CPU_FTR_SPE_COMP | \
317 CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN) 337 CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN)
318#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) 338#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
319 339
@@ -355,7 +375,7 @@ extern void do_feature_fixups(unsigned long value, void *fixup_start,
355#define CPU_FTRS_POSSIBLE \ 375#define CPU_FTRS_POSSIBLE \
356 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ 376 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \
357 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ 377 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \
358 CPU_FTRS_CELL | CPU_FTRS_PA6T) 378 CPU_FTRS_CELL | CPU_FTRS_PA6T | CPU_FTR_1T_SEGMENT)
359#else 379#else
360enum { 380enum {
361 CPU_FTRS_POSSIBLE = 381 CPU_FTRS_POSSIBLE =
diff --git a/include/asm-powerpc/dcr-mmio.h b/include/asm-powerpc/dcr-mmio.h
index 5dbfca8dde36..6b82c3ba495a 100644
--- a/include/asm-powerpc/dcr-mmio.h
+++ b/include/asm-powerpc/dcr-mmio.h
@@ -23,7 +23,11 @@
23 23
24#include <asm/io.h> 24#include <asm/io.h>
25 25
26typedef struct { void __iomem *token; unsigned int stride; } dcr_host_t; 26typedef struct {
27 void __iomem *token;
28 unsigned int stride;
29 unsigned int base;
30} dcr_host_t;
27 31
28#define DCR_MAP_OK(host) ((host).token != NULL) 32#define DCR_MAP_OK(host) ((host).token != NULL)
29 33
diff --git a/include/asm-powerpc/dcr-native.h b/include/asm-powerpc/dcr-native.h
index 05af081222f6..f41058c0f6cb 100644
--- a/include/asm-powerpc/dcr-native.h
+++ b/include/asm-powerpc/dcr-native.h
@@ -22,11 +22,13 @@
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
24 24
25typedef struct {} dcr_host_t; 25typedef struct {
26 unsigned int base;
27} dcr_host_t;
26 28
27#define DCR_MAP_OK(host) (1) 29#define DCR_MAP_OK(host) (1)
28 30
29#define dcr_map(dev, dcr_n, dcr_c) ((dcr_host_t){}) 31#define dcr_map(dev, dcr_n, dcr_c) ((dcr_host_t){ .base = (dcr_n) })
30#define dcr_unmap(host, dcr_n, dcr_c) do {} while (0) 32#define dcr_unmap(host, dcr_n, dcr_c) do {} while (0)
31#define dcr_read(host, dcr_n) mfdcr(dcr_n) 33#define dcr_read(host, dcr_n) mfdcr(dcr_n)
32#define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value) 34#define dcr_write(host, dcr_n, value) mtdcr(dcr_n, value)
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h
index 744d6bb24116..d05891608f74 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -249,8 +249,12 @@ dma_map_single(struct device *dev, void *ptr, size_t size,
249 return virt_to_bus(ptr); 249 return virt_to_bus(ptr);
250} 250}
251 251
252/* We do nothing. */ 252static inline void dma_unmap_single(struct device *dev, dma_addr_t dma_addr,
253#define dma_unmap_single(dev, addr, size, dir) ((void)0) 253 size_t size,
254 enum dma_data_direction direction)
255{
256 /* We do nothing. */
257}
254 258
255static inline dma_addr_t 259static inline dma_addr_t
256dma_map_page(struct device *dev, struct page *page, 260dma_map_page(struct device *dev, struct page *page,
@@ -264,8 +268,12 @@ dma_map_page(struct device *dev, struct page *page,
264 return page_to_bus(page) + offset; 268 return page_to_bus(page) + offset;
265} 269}
266 270
267/* We do nothing. */ 271static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
268#define dma_unmap_page(dev, handle, size, dir) ((void)0) 272 size_t size,
273 enum dma_data_direction direction)
274{
275 /* We do nothing. */
276}
269 277
270static inline int 278static inline int
271dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 279dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
@@ -284,8 +292,12 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
284 return nents; 292 return nents;
285} 293}
286 294
287/* We don't do anything here. */ 295static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
288#define dma_unmap_sg(dev, sg, nents, dir) ((void)0) 296 int nhwentries,
297 enum dma_data_direction direction)
298{
299 /* We don't do anything here. */
300}
289 301
290#endif /* CONFIG_PPC64 */ 302#endif /* CONFIG_PPC64 */
291 303
diff --git a/include/asm-powerpc/elf.h b/include/asm-powerpc/elf.h
index de507995c7b1..e42820d6d25b 100644
--- a/include/asm-powerpc/elf.h
+++ b/include/asm-powerpc/elf.h
@@ -413,13 +413,8 @@ do { \
413/* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */ 413/* Notes used in ET_CORE. Note name is "SPU/<fd>/<filename>". */
414#define NT_SPU 1 414#define NT_SPU 1
415 415
416extern int arch_notes_size(void);
417extern void arch_write_notes(struct file *file);
418
419#define ELF_CORE_EXTRA_NOTES_SIZE arch_notes_size()
420#define ELF_CORE_WRITE_EXTRA_NOTES arch_write_notes(file)
421
422#define ARCH_HAVE_EXTRA_ELF_NOTES 416#define ARCH_HAVE_EXTRA_ELF_NOTES
423#endif /* CONFIG_PPC_CELL */ 417
418#endif /* CONFIG_SPU_BASE */
424 419
425#endif /* _ASM_POWERPC_ELF_H */ 420#endif /* _ASM_POWERPC_ELF_H */
diff --git a/include/asm-powerpc/exception.h b/include/asm-powerpc/exception.h
new file mode 100644
index 000000000000..39abdb02fdef
--- /dev/null
+++ b/include/asm-powerpc/exception.h
@@ -0,0 +1,311 @@
1#ifndef _ASM_POWERPC_EXCEPTION_H
2#define _ASM_POWERPC_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/*
28 * The following macros define the code that appears as
29 * the prologue to each of the exception handlers. They
30 * are split into two parts to allow a single kernel binary
31 * to be used for pSeries and iSeries.
32 *
33 * We make as much of the exception code common between native
34 * exception handlers (including pSeries LPAR) and iSeries LPAR
35 * implementations as possible.
36 */
37
38#define EX_R9 0
39#define EX_R10 8
40#define EX_R11 16
41#define EX_R12 24
42#define EX_R13 32
43#define EX_SRR0 40
44#define EX_DAR 48
45#define EX_DSISR 56
46#define EX_CCR 60
47#define EX_R3 64
48#define EX_LR 72
49
50/*
51 * We're short on space and time in the exception prolog, so we can't
52 * use the normal SET_REG_IMMEDIATE macro. Normally we just need the
53 * low halfword of the address, but for Kdump we need the whole low
54 * word.
55 */
56#ifdef CONFIG_CRASH_DUMP
57#define LOAD_HANDLER(reg, label) \
58 oris reg,reg,(label)@h; /* virt addr of handler ... */ \
59 ori reg,reg,(label)@l; /* .. and the rest */
60#else
61#define LOAD_HANDLER(reg, label) \
62 ori reg,reg,(label)@l; /* virt addr of handler ... */
63#endif
64
65#define EXCEPTION_PROLOG_1(area) \
66 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
67 std r9,area+EX_R9(r13); /* save r9 - r12 */ \
68 std r10,area+EX_R10(r13); \
69 std r11,area+EX_R11(r13); \
70 std r12,area+EX_R12(r13); \
71 mfspr r9,SPRN_SPRG1; \
72 std r9,area+EX_R13(r13); \
73 mfcr r9
74
75/*
76 * Equal to EXCEPTION_PROLOG_PSERIES, except that it forces 64bit mode.
77 * The firmware calls the registered system_reset_fwnmi and
78 * machine_check_fwnmi handlers in 32bit mode if the cpu happens to run
79 * a 32bit application at the time of the event.
80 * This firmware bug is present on POWER4 and JS20.
81 */
82#define EXCEPTION_PROLOG_PSERIES_FORCE_64BIT(area, label) \
83 EXCEPTION_PROLOG_1(area); \
84 clrrdi r12,r13,32; /* get high part of &label */ \
85 mfmsr r10; \
86 /* force 64bit mode */ \
87 li r11,5; /* MSR_SF_LG|MSR_ISF_LG */ \
88 rldimi r10,r11,61,0; /* insert into top 3 bits */ \
89 /* done 64bit mode */ \
90 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
91 LOAD_HANDLER(r12,label) \
92 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
93 mtspr SPRN_SRR0,r12; \
94 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
95 mtspr SPRN_SRR1,r10; \
96 rfid; \
97 b . /* prevent speculative execution */
98
99#define EXCEPTION_PROLOG_PSERIES(area, label) \
100 EXCEPTION_PROLOG_1(area); \
101 clrrdi r12,r13,32; /* get high part of &label */ \
102 mfmsr r10; \
103 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
104 LOAD_HANDLER(r12,label) \
105 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
106 mtspr SPRN_SRR0,r12; \
107 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
108 mtspr SPRN_SRR1,r10; \
109 rfid; \
110 b . /* prevent speculative execution */
111
112/*
113 * The common exception prolog is used for all except a few exceptions
114 * such as a segment miss on a kernel address. We have to be prepared
115 * to take another exception from the point where we first touch the
116 * kernel stack onwards.
117 *
118 * On entry r13 points to the paca, r9-r13 are saved in the paca,
119 * r9 contains the saved CR, r11 and r12 contain the saved SRR0 and
120 * SRR1, and relocation is on.
121 */
122#define EXCEPTION_PROLOG_COMMON(n, area) \
123 andi. r10,r12,MSR_PR; /* See if coming from user */ \
124 mr r10,r1; /* Save r1 */ \
125 subi r1,r1,INT_FRAME_SIZE; /* alloc frame on kernel stack */ \
126 beq- 1f; \
127 ld r1,PACAKSAVE(r13); /* kernel stack to use */ \
1281: cmpdi cr1,r1,0; /* check if r1 is in userspace */ \
129 bge- cr1,2f; /* abort if it is */ \
130 b 3f; \
1312: li r1,(n); /* will be reloaded later */ \
132 sth r1,PACA_TRAP_SAVE(r13); \
133 b bad_stack; \
1343: std r9,_CCR(r1); /* save CR in stackframe */ \
135 std r11,_NIP(r1); /* save SRR0 in stackframe */ \
136 std r12,_MSR(r1); /* save SRR1 in stackframe */ \
137 std r10,0(r1); /* make stack chain pointer */ \
138 std r0,GPR0(r1); /* save r0 in stackframe */ \
139 std r10,GPR1(r1); /* save r1 in stackframe */ \
140 ACCOUNT_CPU_USER_ENTRY(r9, r10); \
141 std r2,GPR2(r1); /* save r2 in stackframe */ \
142 SAVE_4GPRS(3, r1); /* save r3 - r6 in stackframe */ \
143 SAVE_2GPRS(7, r1); /* save r7, r8 in stackframe */ \
144 ld r9,area+EX_R9(r13); /* move r9, r10 to stackframe */ \
145 ld r10,area+EX_R10(r13); \
146 std r9,GPR9(r1); \
147 std r10,GPR10(r1); \
148 ld r9,area+EX_R11(r13); /* move r11 - r13 to stackframe */ \
149 ld r10,area+EX_R12(r13); \
150 ld r11,area+EX_R13(r13); \
151 std r9,GPR11(r1); \
152 std r10,GPR12(r1); \
153 std r11,GPR13(r1); \
154 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \
155 mflr r9; /* save LR in stackframe */ \
156 std r9,_LINK(r1); \
157 mfctr r10; /* save CTR in stackframe */ \
158 std r10,_CTR(r1); \
159 lbz r10,PACASOFTIRQEN(r13); \
160 mfspr r11,SPRN_XER; /* save XER in stackframe */ \
161 std r10,SOFTE(r1); \
162 std r11,_XER(r1); \
163 li r9,(n)+1; \
164 std r9,_TRAP(r1); /* set trap number */ \
165 li r10,0; \
166 ld r11,exception_marker@toc(r2); \
167 std r10,RESULT(r1); /* clear regs->result */ \
168 std r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */
169
170/*
171 * Exception vectors.
172 */
173#define STD_EXCEPTION_PSERIES(n, label) \
174 . = n; \
175 .globl label##_pSeries; \
176label##_pSeries: \
177 HMT_MEDIUM; \
178 mtspr SPRN_SPRG1,r13; /* save r13 */ \
179 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
180
181#define HSTD_EXCEPTION_PSERIES(n, label) \
182 . = n; \
183 .globl label##_pSeries; \
184label##_pSeries: \
185 HMT_MEDIUM; \
186 mtspr SPRN_SPRG1,r20; /* save r20 */ \
187 mfspr r20,SPRN_HSRR0; /* copy HSRR0 to SRR0 */ \
188 mtspr SPRN_SRR0,r20; \
189 mfspr r20,SPRN_HSRR1; /* copy HSRR0 to SRR0 */ \
190 mtspr SPRN_SRR1,r20; \
191 mfspr r20,SPRN_SPRG1; /* restore r20 */ \
192 mtspr SPRN_SPRG1,r13; /* save r13 */ \
193 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
194
195
196#define MASKABLE_EXCEPTION_PSERIES(n, label) \
197 . = n; \
198 .globl label##_pSeries; \
199label##_pSeries: \
200 HMT_MEDIUM; \
201 mtspr SPRN_SPRG1,r13; /* save r13 */ \
202 mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \
203 std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \
204 std r10,PACA_EXGEN+EX_R10(r13); \
205 lbz r10,PACASOFTIRQEN(r13); \
206 mfcr r9; \
207 cmpwi r10,0; \
208 beq masked_interrupt; \
209 mfspr r10,SPRN_SPRG1; \
210 std r10,PACA_EXGEN+EX_R13(r13); \
211 std r11,PACA_EXGEN+EX_R11(r13); \
212 std r12,PACA_EXGEN+EX_R12(r13); \
213 clrrdi r12,r13,32; /* get high part of &label */ \
214 mfmsr r10; \
215 mfspr r11,SPRN_SRR0; /* save SRR0 */ \
216 LOAD_HANDLER(r12,label##_common) \
217 ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \
218 mtspr SPRN_SRR0,r12; \
219 mfspr r12,SPRN_SRR1; /* and SRR1 */ \
220 mtspr SPRN_SRR1,r10; \
221 rfid; \
222 b . /* prevent speculative execution */
223
224#ifdef CONFIG_PPC_ISERIES
225#define DISABLE_INTS \
226 li r11,0; \
227 stb r11,PACASOFTIRQEN(r13); \
228BEGIN_FW_FTR_SECTION; \
229 stb r11,PACAHARDIRQEN(r13); \
230END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \
231BEGIN_FW_FTR_SECTION; \
232 mfmsr r10; \
233 ori r10,r10,MSR_EE; \
234 mtmsrd r10,1; \
235END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
236
237#else
238#define DISABLE_INTS \
239 li r11,0; \
240 stb r11,PACASOFTIRQEN(r13); \
241 stb r11,PACAHARDIRQEN(r13)
242
243#endif /* CONFIG_PPC_ISERIES */
244
245#define ENABLE_INTS \
246 ld r12,_MSR(r1); \
247 mfmsr r11; \
248 rlwimi r11,r12,0,MSR_EE; \
249 mtmsrd r11,1
250
251#define STD_EXCEPTION_COMMON(trap, label, hdlr) \
252 .align 7; \
253 .globl label##_common; \
254label##_common: \
255 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
256 DISABLE_INTS; \
257 bl .save_nvgprs; \
258 addi r3,r1,STACK_FRAME_OVERHEAD; \
259 bl hdlr; \
260 b .ret_from_except
261
262/*
263 * Like STD_EXCEPTION_COMMON, but for exceptions that can occur
264 * in the idle task and therefore need the special idle handling.
265 */
266#define STD_EXCEPTION_COMMON_IDLE(trap, label, hdlr) \
267 .align 7; \
268 .globl label##_common; \
269label##_common: \
270 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
271 FINISH_NAP; \
272 DISABLE_INTS; \
273 bl .save_nvgprs; \
274 addi r3,r1,STACK_FRAME_OVERHEAD; \
275 bl hdlr; \
276 b .ret_from_except
277
278#define STD_EXCEPTION_COMMON_LITE(trap, label, hdlr) \
279 .align 7; \
280 .globl label##_common; \
281label##_common: \
282 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
283 FINISH_NAP; \
284 DISABLE_INTS; \
285BEGIN_FTR_SECTION \
286 bl .ppc64_runlatch_on; \
287END_FTR_SECTION_IFSET(CPU_FTR_CTRL) \
288 addi r3,r1,STACK_FRAME_OVERHEAD; \
289 bl hdlr; \
290 b .ret_from_except_lite
291
292/*
293 * When the idle code in power4_idle puts the CPU into NAP mode,
294 * it has to do so in a loop, and relies on the external interrupt
295 * and decrementer interrupt entry code to get it out of the loop.
296 * It sets the _TLF_NAPPING bit in current_thread_info()->local_flags
297 * to signal that it is in the loop and needs help to get out.
298 */
299#ifdef CONFIG_PPC_970_NAP
300#define FINISH_NAP \
301BEGIN_FTR_SECTION \
302 clrrdi r11,r1,THREAD_SHIFT; \
303 ld r9,TI_LOCAL_FLAGS(r11); \
304 andi. r10,r9,_TLF_NAPPING; \
305 bnel power4_fixup_nap; \
306END_FTR_SECTION_IFSET(CPU_FTR_CAN_NAP)
307#else
308#define FINISH_NAP
309#endif
310
311#endif /* _ASM_POWERPC_EXCEPTION_H */
diff --git a/include/asm-powerpc/fs_pd.h b/include/asm-powerpc/fs_pd.h
index c624915b757e..9361cd5342cc 100644
--- a/include/asm-powerpc/fs_pd.h
+++ b/include/asm-powerpc/fs_pd.h
@@ -19,48 +19,22 @@
19 19
20#if defined(CONFIG_8260) 20#if defined(CONFIG_8260)
21#include <asm/mpc8260.h> 21#include <asm/mpc8260.h>
22#elif defined(CONFIG_85xx)
23#include <asm/mpc85xx.h>
24#endif 22#endif
25 23
26#define cpm2_map(member) \ 24#define cpm2_map(member) (&cpm2_immr->member)
27({ \ 25#define cpm2_map_size(member, size) (&cpm2_immr->member)
28 u32 offset = offsetof(cpm2_map_t, member); \ 26#define cpm2_unmap(addr) do {} while(0)
29 void *addr = ioremap (CPM_MAP_ADDR + offset, \
30 sizeof( ((cpm2_map_t*)0)->member)); \
31 addr; \
32})
33
34#define cpm2_map_size(member, size) \
35({ \
36 u32 offset = offsetof(cpm2_map_t, member); \
37 void *addr = ioremap (CPM_MAP_ADDR + offset, size); \
38 addr; \
39})
40
41#define cpm2_unmap(addr) iounmap(addr)
42#endif 27#endif
43 28
44#ifdef CONFIG_8xx 29#ifdef CONFIG_8xx
45#include <asm/8xx_immap.h> 30#include <asm/8xx_immap.h>
46#include <asm/mpc8xx.h> 31#include <asm/mpc8xx.h>
47 32
48#define immr_map(member) \ 33extern immap_t __iomem *mpc8xx_immr;
49({ \
50 u32 offset = offsetof(immap_t, member); \
51 void *addr = ioremap (IMAP_ADDR + offset, \
52 sizeof( ((immap_t*)0)->member)); \
53 addr; \
54})
55
56#define immr_map_size(member, size) \
57({ \
58 u32 offset = offsetof(immap_t, member); \
59 void *addr = ioremap (IMAP_ADDR + offset, size); \
60 addr; \
61})
62 34
63#define immr_unmap(addr) iounmap(addr) 35#define immr_map(member) (&mpc8xx_immr->member)
36#define immr_map_size(member, size) (&mpc8xx_immr->member)
37#define immr_unmap(addr) do {} while (0)
64#endif 38#endif
65 39
66static inline int uart_baudrate(void) 40static inline int uart_baudrate(void)
diff --git a/include/asm-powerpc/highmem.h b/include/asm-powerpc/highmem.h
new file mode 100644
index 000000000000..f7b21ee302b4
--- /dev/null
+++ b/include/asm-powerpc/highmem.h
@@ -0,0 +1,135 @@
1/*
2 * highmem.h: virtual kernel memory mappings for high memory
3 *
4 * PowerPC version, stolen from the i386 version.
5 *
6 * Used in CONFIG_HIGHMEM systems for memory pages which
7 * are not addressable by direct kernel virtual addresses.
8 *
9 * Copyright (C) 1999 Gerhard Wichert, Siemens AG
10 * Gerhard.Wichert@pdb.siemens.de
11 *
12 *
13 * Redesigned the x86 32-bit VM architecture to deal with
14 * up to 16 Terrabyte physical memory. With current x86 CPUs
15 * we now support up to 64 Gigabytes physical RAM.
16 *
17 * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com>
18 */
19
20#ifndef _ASM_HIGHMEM_H
21#define _ASM_HIGHMEM_H
22
23#ifdef __KERNEL__
24
25#include <linux/init.h>
26#include <linux/interrupt.h>
27#include <asm/kmap_types.h>
28#include <asm/tlbflush.h>
29#include <asm/page.h>
30
31/* undef for production */
32#define HIGHMEM_DEBUG 1
33
34extern pte_t *kmap_pte;
35extern pgprot_t kmap_prot;
36extern pte_t *pkmap_page_table;
37
38/*
39 * Right now we initialize only a single pte table. It can be extended
40 * easily, subsequent pte tables have to be allocated in one physical
41 * chunk of RAM.
42 */
43#define PKMAP_BASE CONFIG_HIGHMEM_START
44#define LAST_PKMAP (1 << PTE_SHIFT)
45#define LAST_PKMAP_MASK (LAST_PKMAP-1)
46#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
47#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
48
49#define KMAP_FIX_BEGIN (PKMAP_BASE + 0x00400000UL)
50
51extern void *kmap_high(struct page *page);
52extern void kunmap_high(struct page *page);
53
54static inline void *kmap(struct page *page)
55{
56 might_sleep();
57 if (!PageHighMem(page))
58 return page_address(page);
59 return kmap_high(page);
60}
61
62static inline void kunmap(struct page *page)
63{
64 BUG_ON(in_interrupt());
65 if (!PageHighMem(page))
66 return;
67 kunmap_high(page);
68}
69
70/*
71 * The use of kmap_atomic/kunmap_atomic is discouraged - kmap/kunmap
72 * gives a more generic (and caching) interface. But kmap_atomic can
73 * be used in IRQ contexts, so in some (very limited) cases we need
74 * it.
75 */
76static inline void *kmap_atomic(struct page *page, enum km_type type)
77{
78 unsigned int idx;
79 unsigned long vaddr;
80
81 /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */
82 pagefault_disable();
83 if (!PageHighMem(page))
84 return page_address(page);
85
86 idx = type + KM_TYPE_NR*smp_processor_id();
87 vaddr = KMAP_FIX_BEGIN + idx * PAGE_SIZE;
88#ifdef HIGHMEM_DEBUG
89 BUG_ON(!pte_none(*(kmap_pte+idx)));
90#endif
91 set_pte_at(&init_mm, vaddr, kmap_pte+idx, mk_pte(page, kmap_prot));
92 flush_tlb_page(NULL, vaddr);
93
94 return (void*) vaddr;
95}
96
97static inline void kunmap_atomic(void *kvaddr, enum km_type type)
98{
99#ifdef HIGHMEM_DEBUG
100 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
101 unsigned int idx = type + KM_TYPE_NR*smp_processor_id();
102
103 if (vaddr < KMAP_FIX_BEGIN) { // FIXME
104 pagefault_enable();
105 return;
106 }
107
108 BUG_ON(vaddr != KMAP_FIX_BEGIN + idx * PAGE_SIZE);
109
110 /*
111 * force other mappings to Oops if they'll try to access
112 * this pte without first remap it
113 */
114 pte_clear(&init_mm, vaddr, kmap_pte+idx);
115 flush_tlb_page(NULL, vaddr);
116#endif
117 pagefault_enable();
118}
119
120static inline struct page *kmap_atomic_to_page(void *ptr)
121{
122 unsigned long idx, vaddr = (unsigned long) ptr;
123
124 if (vaddr < KMAP_FIX_BEGIN)
125 return virt_to_page(ptr);
126
127 idx = (vaddr - KMAP_FIX_BEGIN) >> PAGE_SHIFT;
128 return pte_page(kmap_pte[idx]);
129}
130
131#define flush_cache_kmaps() flush_cache_all()
132
133#endif /* __KERNEL__ */
134
135#endif /* _ASM_HIGHMEM_H */
diff --git a/include/asm-powerpc/hydra.h b/include/asm-powerpc/hydra.h
new file mode 100644
index 000000000000..1ad4eed07fbe
--- /dev/null
+++ b/include/asm-powerpc/hydra.h
@@ -0,0 +1,102 @@
1/*
2 * include/asm-ppc/hydra.h -- Mac I/O `Hydra' definitions
3 *
4 * Copyright (C) 1997 Geert Uytterhoeven
5 *
6 * This file is based on the following documentation:
7 *
8 * Macintosh Technology in the Common Hardware Reference Platform
9 * Apple Computer, Inc.
10 *
11 * © Copyright 1995 Apple Computer, Inc. All rights reserved.
12 *
13 * It's available online from http://chrp.apple.com/MacTech.pdf.
14 * You can obtain paper copies of this book from computer bookstores or by
15 * writing Morgan Kaufmann Publishers, Inc., 340 Pine Street, Sixth Floor, San
16 * Francisco, CA 94104. Reference ISBN 1-55860-393-X.
17 *
18 * This file is subject to the terms and conditions of the GNU General Public
19 * License. See the file COPYING in the main directory of this archive
20 * for more details.
21 */
22
23#ifndef _ASMPPC_HYDRA_H
24#define _ASMPPC_HYDRA_H
25
26#ifdef __KERNEL__
27
28struct Hydra {
29 /* DBDMA Controller Register Space */
30 char Pad1[0x30];
31 u_int CachePD;
32 u_int IDs;
33 u_int Feature_Control;
34 char Pad2[0x7fc4];
35 /* DBDMA Channel Register Space */
36 char SCSI_DMA[0x100];
37 char Pad3[0x300];
38 char SCCA_Tx_DMA[0x100];
39 char SCCA_Rx_DMA[0x100];
40 char SCCB_Tx_DMA[0x100];
41 char SCCB_Rx_DMA[0x100];
42 char Pad4[0x7800];
43 /* Device Register Space */
44 char SCSI[0x1000];
45 char ADB[0x1000];
46 char SCC_Legacy[0x1000];
47 char SCC[0x1000];
48 char Pad9[0x2000];
49 char VIA[0x2000];
50 char Pad10[0x28000];
51 char OpenPIC[0x40000];
52};
53
54extern volatile struct Hydra __iomem *Hydra;
55
56
57 /*
58 * Feature Control Register
59 */
60
61#define HYDRA_FC_SCC_CELL_EN 0x00000001 /* Enable SCC Clock */
62#define HYDRA_FC_SCSI_CELL_EN 0x00000002 /* Enable SCSI Clock */
63#define HYDRA_FC_SCCA_ENABLE 0x00000004 /* Enable SCC A Lines */
64#define HYDRA_FC_SCCB_ENABLE 0x00000008 /* Enable SCC B Lines */
65#define HYDRA_FC_ARB_BYPASS 0x00000010 /* Bypass Internal Arbiter */
66#define HYDRA_FC_RESET_SCC 0x00000020 /* Reset SCC */
67#define HYDRA_FC_MPIC_ENABLE 0x00000040 /* Enable OpenPIC */
68#define HYDRA_FC_SLOW_SCC_PCLK 0x00000080 /* 1=15.6672, 0=25 MHz */
69#define HYDRA_FC_MPIC_IS_MASTER 0x00000100 /* OpenPIC Master Mode */
70
71
72 /*
73 * OpenPIC Interrupt Sources
74 */
75
76#define HYDRA_INT_SIO 0
77#define HYDRA_INT_SCSI_DMA 1
78#define HYDRA_INT_SCCA_TX_DMA 2
79#define HYDRA_INT_SCCA_RX_DMA 3
80#define HYDRA_INT_SCCB_TX_DMA 4
81#define HYDRA_INT_SCCB_RX_DMA 5
82#define HYDRA_INT_SCSI 6
83#define HYDRA_INT_SCCA 7
84#define HYDRA_INT_SCCB 8
85#define HYDRA_INT_VIA 9
86#define HYDRA_INT_ADB 10
87#define HYDRA_INT_ADB_NMI 11
88#define HYDRA_INT_EXT1 12 /* PCI IRQW */
89#define HYDRA_INT_EXT2 13 /* PCI IRQX */
90#define HYDRA_INT_EXT3 14 /* PCI IRQY */
91#define HYDRA_INT_EXT4 15 /* PCI IRQZ */
92#define HYDRA_INT_EXT5 16 /* IDE Primay/Secondary */
93#define HYDRA_INT_EXT6 17 /* IDE Secondary */
94#define HYDRA_INT_EXT7 18 /* Power Off Request */
95#define HYDRA_INT_SPARE 19
96
97extern int hydra_init(void);
98extern void macio_adb_init(void);
99
100#endif /* __KERNEL__ */
101
102#endif /* _ASMPPC_HYDRA_H */
diff --git a/include/asm-powerpc/ide.h b/include/asm-powerpc/ide.h
index 0f66f0f82c32..1644e44c8757 100644
--- a/include/asm-powerpc/ide.h
+++ b/include/asm-powerpc/ide.h
@@ -67,7 +67,7 @@ static __inline__ unsigned long ide_default_io_base(int index)
67#define ide_init_default_irq(base) ide_default_irq(base) 67#define ide_init_default_irq(base) ide_default_irq(base)
68#endif 68#endif
69 69
70#if (defined CONFIG_APUS || defined CONFIG_BLK_DEV_MPC8xx_IDE ) 70#ifdef CONFIG_BLK_DEV_MPC8xx_IDE
71#define IDE_ARCH_ACK_INTR 1 71#define IDE_ARCH_ACK_INTR 1
72#define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1) 72#define ide_ack_intr(hwif) (hwif->hw.ack_intr ? hwif->hw.ack_intr(hwif) : 1)
73#endif 73#endif
diff --git a/include/asm-powerpc/immap_86xx.h b/include/asm-powerpc/immap_86xx.h
index 59b9e07b8e99..0ad4e653d464 100644
--- a/include/asm-powerpc/immap_86xx.h
+++ b/include/asm-powerpc/immap_86xx.h
@@ -1,124 +1,135 @@
1/* 1/**
2 * MPC86xx Internal Memory Map 2 * MPC86xx Internal Memory Map
3 * 3 *
4 * Author: Jeff Brown 4 * Authors: Jeff Brown
5 * Timur Tabi <timur@freescale.com>
5 * 6 *
6 * Copyright 2004 Freescale Semiconductor, Inc 7 * Copyright 2004,2007 Freescale Semiconductor, Inc
7 * 8 *
8 * This program is free software; you can redistribute it and/or modify it 9 * 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 * 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 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version. 12 * option) any later version.
12 * 13 *
14 * This header file defines structures for various 86xx SOC devices that are
15 * used by multiple source files.
13 */ 16 */
14 17
15#ifndef __ASM_POWERPC_IMMAP_86XX_H__ 18#ifndef __ASM_POWERPC_IMMAP_86XX_H__
16#define __ASM_POWERPC_IMMAP_86XX_H__ 19#define __ASM_POWERPC_IMMAP_86XX_H__
17#ifdef __KERNEL__ 20#ifdef __KERNEL__
18 21
19/* Eventually this should define all the IO block registers in 86xx */ 22/* Global Utility Registers */
23struct ccsr_guts {
24 __be32 porpllsr; /* 0x.0000 - POR PLL Ratio Status Register */
25 __be32 porbmsr; /* 0x.0004 - POR Boot Mode Status Register */
26 __be32 porimpscr; /* 0x.0008 - POR I/O Impedance Status and Control Register */
27 __be32 pordevsr; /* 0x.000c - POR I/O Device Status Register */
28 __be32 pordbgmsr; /* 0x.0010 - POR Debug Mode Status Register */
29 u8 res1[0x20 - 0x14];
30 __be32 porcir; /* 0x.0020 - POR Configuration Information Register */
31 u8 res2[0x30 - 0x24];
32 __be32 gpiocr; /* 0x.0030 - GPIO Control Register */
33 u8 res3[0x40 - 0x34];
34 __be32 gpoutdr; /* 0x.0040 - General-Purpose Output Data Register */
35 u8 res4[0x50 - 0x44];
36 __be32 gpindr; /* 0x.0050 - General-Purpose Input Data Register */
37 u8 res5[0x60 - 0x54];
38 __be32 pmuxcr; /* 0x.0060 - Alternate Function Signal Multiplex Control */
39 u8 res6[0x70 - 0x64];
40 __be32 devdisr; /* 0x.0070 - Device Disable Control */
41 __be32 devdisr2; /* 0x.0074 - Device Disable Control 2 */
42 u8 res7[0x80 - 0x78];
43 __be32 powmgtcsr; /* 0x.0080 - Power Management Status and Control Register */
44 u8 res8[0x90 - 0x84];
45 __be32 mcpsumr; /* 0x.0090 - Machine Check Summary Register */
46 __be32 rstrscr; /* 0x.0094 - Reset Request Status and Control Register */
47 u8 res9[0xA0 - 0x98];
48 __be32 pvr; /* 0x.00a0 - Processor Version Register */
49 __be32 svr; /* 0x.00a4 - System Version Register */
50 u8 res10[0xB0 - 0xA8];
51 __be32 rstcr; /* 0x.00b0 - Reset Control Register */
52 u8 res11[0xC0 - 0xB4];
53 __be32 elbcvselcr; /* 0x.00c0 - eLBC Voltage Select Ctrl Reg */
54 u8 res12[0x800 - 0xC4];
55 __be32 clkdvdr; /* 0x.0800 - Clock Divide Register */
56 u8 res13[0x900 - 0x804];
57 __be32 ircr; /* 0x.0900 - Infrared Control Register */
58 u8 res14[0x908 - 0x904];
59 __be32 dmacr; /* 0x.0908 - DMA Control Register */
60 u8 res15[0x914 - 0x90C];
61 __be32 elbccr; /* 0x.0914 - eLBC Control Register */
62 u8 res16[0xB20 - 0x918];
63 __be32 ddr1clkdr; /* 0x.0b20 - DDR1 Clock Disable Register */
64 __be32 ddr2clkdr; /* 0x.0b24 - DDR2 Clock Disable Register */
65 __be32 ddrclkdr; /* 0x.0b28 - DDR Clock Disable Register */
66 u8 res17[0xE00 - 0xB2C];
67 __be32 clkocr; /* 0x.0e00 - Clock Out Select Register */
68 u8 res18[0xE10 - 0xE04];
69 __be32 ddrdllcr; /* 0x.0e10 - DDR DLL Control Register */
70 u8 res19[0xE20 - 0xE14];
71 __be32 lbcdllcr; /* 0x.0e20 - LBC DLL Control Register */
72 u8 res20[0xF04 - 0xE24];
73 __be32 srds1cr0; /* 0x.0f04 - SerDes1 Control Register 0 */
74 __be32 srds1cr1; /* 0x.0f08 - SerDes1 Control Register 0 */
75 u8 res21[0xF40 - 0xF0C];
76 __be32 srds2cr0; /* 0x.0f40 - SerDes1 Control Register 0 */
77 __be32 srds2cr1; /* 0x.0f44 - SerDes1 Control Register 0 */
78} __attribute__ ((packed));
20 79
21/* PCI Registers */ 80#define CCSR_GUTS_DMACR_DEV_SSI 0 /* DMA controller/channel set to SSI */
22typedef struct ccsr_pci { 81#define CCSR_GUTS_DMACR_DEV_IR 1 /* DMA controller/channel set to IR */
23 uint cfg_addr; /* 0x.000 - PCI Configuration Address Register */
24 uint cfg_data; /* 0x.004 - PCI Configuration Data Register */
25 uint int_ack; /* 0x.008 - PCI Interrupt Acknowledge Register */
26 char res1[3060];
27 uint potar0; /* 0x.c00 - PCI Outbound Transaction Address Register 0 */
28 uint potear0; /* 0x.c04 - PCI Outbound Translation Extended Address Register 0 */
29 uint powbar0; /* 0x.c08 - PCI Outbound Window Base Address Register 0 */
30 char res2[4];
31 uint powar0; /* 0x.c10 - PCI Outbound Window Attributes Register 0 */
32 char res3[12];
33 uint potar1; /* 0x.c20 - PCI Outbound Transaction Address Register 1 */
34 uint potear1; /* 0x.c24 - PCI Outbound Translation Extended Address Register 1 */
35 uint powbar1; /* 0x.c28 - PCI Outbound Window Base Address Register 1 */
36 char res4[4];
37 uint powar1; /* 0x.c30 - PCI Outbound Window Attributes Register 1 */
38 char res5[12];
39 uint potar2; /* 0x.c40 - PCI Outbound Transaction Address Register 2 */
40 uint potear2; /* 0x.c44 - PCI Outbound Translation Extended Address Register 2 */
41 uint powbar2; /* 0x.c48 - PCI Outbound Window Base Address Register 2 */
42 char res6[4];
43 uint powar2; /* 0x.c50 - PCI Outbound Window Attributes Register 2 */
44 char res7[12];
45 uint potar3; /* 0x.c60 - PCI Outbound Transaction Address Register 3 */
46 uint potear3; /* 0x.c64 - PCI Outbound Translation Extended Address Register 3 */
47 uint powbar3; /* 0x.c68 - PCI Outbound Window Base Address Register 3 */
48 char res8[4];
49 uint powar3; /* 0x.c70 - PCI Outbound Window Attributes Register 3 */
50 char res9[12];
51 uint potar4; /* 0x.c80 - PCI Outbound Transaction Address Register 4 */
52 uint potear4; /* 0x.c84 - PCI Outbound Translation Extended Address Register 4 */
53 uint powbar4; /* 0x.c88 - PCI Outbound Window Base Address Register 4 */
54 char res10[4];
55 uint powar4; /* 0x.c90 - PCI Outbound Window Attributes Register 4 */
56 char res11[268];
57 uint pitar3; /* 0x.da0 - PCI Inbound Translation Address Register 3 */
58 char res12[4];
59 uint piwbar3; /* 0x.da8 - PCI Inbound Window Base Address Register 3 */
60 uint piwbear3; /* 0x.dac - PCI Inbound Window Base Extended Address Register 3 */
61 uint piwar3; /* 0x.db0 - PCI Inbound Window Attributes Register 3 */
62 char res13[12];
63 uint pitar2; /* 0x.dc0 - PCI Inbound Translation Address Register 2 */
64 char res14[4];
65 uint piwbar2; /* 0x.dc8 - PCI Inbound Window Base Address Register 2 */
66 uint piwbear2; /* 0x.dcc - PCI Inbound Window Base Extended Address Register 2 */
67 uint piwar2; /* 0x.dd0 - PCI Inbound Window Attributes Register 2 */
68 char res15[12];
69 uint pitar1; /* 0x.de0 - PCI Inbound Translation Address Register 1 */
70 char res16[4];
71 uint piwbar1; /* 0x.de8 - PCI Inbound Window Base Address Register 1 */
72 char res17[4];
73 uint piwar1; /* 0x.df0 - PCI Inbound Window Attributes Register 1 */
74 char res18[12];
75 uint err_dr; /* 0x.e00 - PCI Error Detect Register */
76 uint err_cap_dr; /* 0x.e04 - PCI Error Capture Disable Register */
77 uint err_en; /* 0x.e08 - PCI Error Enable Register */
78 uint err_attrib; /* 0x.e0c - PCI Error Attributes Capture Register */
79 uint err_addr; /* 0x.e10 - PCI Error Address Capture Register */
80 uint err_ext_addr; /* 0x.e14 - PCI Error Extended Address Capture Register */
81 uint err_dl; /* 0x.e18 - PCI Error Data Low Capture Register */
82 uint err_dh; /* 0x.e1c - PCI Error Data High Capture Register */
83 uint gas_timr; /* 0x.e20 - PCI Gasket Timer Register */
84 uint pci_timr; /* 0x.e24 - PCI Timer Register */
85 char res19[472];
86} ccsr_pci_t;
87 82
88/* Global Utility Registers */ 83/*
89typedef struct ccsr_guts { 84 * Set the DMACR register in the GUTS
90 uint porpllsr; /* 0x.0000 - POR PLL Ratio Status Register */ 85 *
91 uint porbmsr; /* 0x.0004 - POR Boot Mode Status Register */ 86 * The DMACR register determines the source of initiated transfers for each
92 uint porimpscr; /* 0x.0008 - POR I/O Impedance Status and Control Register */ 87 * channel on each DMA controller. Rather than have a bunch of repetitive
93 uint pordevsr; /* 0x.000c - POR I/O Device Status Register */ 88 * macros for the bit patterns, we just have a function that calculates
94 uint pordbgmsr; /* 0x.0010 - POR Debug Mode Status Register */ 89 * them.
95 char res1[12]; 90 *
96 uint gpporcr; /* 0x.0020 - General-Purpose POR Configuration Register */ 91 * guts: Pointer to GUTS structure
97 char res2[12]; 92 * co: The DMA controller (1 or 2)
98 uint gpiocr; /* 0x.0030 - GPIO Control Register */ 93 * ch: The channel on the DMA controller (0, 1, 2, or 3)
99 char res3[12]; 94 * device: The device to set as the source (CCSR_GUTS_DMACR_DEV_xx)
100 uint gpoutdr; /* 0x.0040 - General-Purpose Output Data Register */ 95 */
101 char res4[12]; 96static inline void guts_set_dmacr(struct ccsr_guts __iomem *guts,
102 uint gpindr; /* 0x.0050 - General-Purpose Input Data Register */ 97 unsigned int co, unsigned int ch, unsigned int device)
103 char res5[12]; 98{
104 uint pmuxcr; /* 0x.0060 - Alternate Function Signal Multiplex Control */ 99 unsigned int shift = 16 + (8 * (2 - co) + 2 * (3 - ch));
105 char res6[12]; 100
106 uint devdisr; /* 0x.0070 - Device Disable Control */ 101 clrsetbits_be32(&guts->dmacr, 3 << shift, device << shift);
107 char res7[12]; 102}
108 uint powmgtcsr; /* 0x.0080 - Power Management Status and Control Register */ 103
109 char res8[12]; 104#define CCSR_GUTS_PMUXCR_LDPSEL 0x00010000
110 uint mcpsumr; /* 0x.0090 - Machine Check Summary Register */ 105#define CCSR_GUTS_PMUXCR_SSI1_MASK 0x0000C000 /* Bitmask for SSI1 */
111 char res9[12]; 106#define CCSR_GUTS_PMUXCR_SSI1_LA 0x00000000 /* Latched address */
112 uint pvr; /* 0x.00a0 - Processor Version Register */ 107#define CCSR_GUTS_PMUXCR_SSI1_HI 0x00004000 /* High impedance */
113 uint svr; /* 0x.00a4 - System Version Register */ 108#define CCSR_GUTS_PMUXCR_SSI1_SSI 0x00008000 /* Used for SSI1 */
114 char res10[3416]; 109#define CCSR_GUTS_PMUXCR_SSI2_MASK 0x00003000 /* Bitmask for SSI2 */
115 uint clkocr; /* 0x.0e00 - Clock Out Select Register */ 110#define CCSR_GUTS_PMUXCR_SSI2_LA 0x00000000 /* Latched address */
116 char res11[12]; 111#define CCSR_GUTS_PMUXCR_SSI2_HI 0x00001000 /* High impedance */
117 uint ddrdllcr; /* 0x.0e10 - DDR DLL Control Register */ 112#define CCSR_GUTS_PMUXCR_SSI2_SSI 0x00002000 /* Used for SSI2 */
118 char res12[12]; 113#define CCSR_GUTS_PMUXCR_LA_22_25_LA 0x00000000 /* Latched Address */
119 uint lbcdllcr; /* 0x.0e20 - LBC DLL Control Register */ 114#define CCSR_GUTS_PMUXCR_LA_22_25_HI 0x00000400 /* High impedance */
120 char res13[61916]; 115#define CCSR_GUTS_PMUXCR_DBGDRV 0x00000200 /* Signals not driven */
121} ccsr_guts_t; 116#define CCSR_GUTS_PMUXCR_DMA2_0 0x00000008
117#define CCSR_GUTS_PMUXCR_DMA2_3 0x00000004
118#define CCSR_GUTS_PMUXCR_DMA1_0 0x00000002
119#define CCSR_GUTS_PMUXCR_DMA1_3 0x00000001
120
121#define CCSR_GUTS_CLKDVDR_PXCKEN 0x80000000
122#define CCSR_GUTS_CLKDVDR_SSICKEN 0x20000000
123#define CCSR_GUTS_CLKDVDR_PXCKINV 0x10000000
124#define CCSR_GUTS_CLKDVDR_PXCKDLY_SHIFT 25
125#define CCSR_GUTS_CLKDVDR_PXCKDLY_MASK 0x06000000
126#define CCSR_GUTS_CLKDVDR_PXCKDLY(x) \
127 (((x) & 3) << CCSR_GUTS_CLKDVDR_PXCKDLY_SHIFT)
128#define CCSR_GUTS_CLKDVDR_PXCLK_SHIFT 16
129#define CCSR_GUTS_CLKDVDR_PXCLK_MASK 0x001F0000
130#define CCSR_GUTS_CLKDVDR_PXCLK(x) (((x) & 31) << CCSR_GUTS_CLKDVDR_PXCLK_SHIFT)
131#define CCSR_GUTS_CLKDVDR_SSICLK_MASK 0x000000FF
132#define CCSR_GUTS_CLKDVDR_SSICLK(x) ((x) & CCSR_GUTS_CLKDVDR_SSICLK_MASK)
122 133
123#endif /* __ASM_POWERPC_IMMAP_86XX_H__ */ 134#endif /* __ASM_POWERPC_IMMAP_86XX_H__ */
124#endif /* __KERNEL__ */ 135#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/immap_cpm2.h b/include/asm-powerpc/immap_cpm2.h
new file mode 100644
index 000000000000..4080bab0468c
--- /dev/null
+++ b/include/asm-powerpc/immap_cpm2.h
@@ -0,0 +1,650 @@
1/*
2 * CPM2 Internal Memory Map
3 * Copyright (c) 1999 Dan Malek (dmalek@jlc.net)
4 *
5 * The Internal Memory Map for devices with CPM2 on them. This
6 * is the superset of all CPM2 devices (8260, 8266, 8280, 8272,
7 * 8560).
8 */
9#ifdef __KERNEL__
10#ifndef __IMMAP_CPM2__
11#define __IMMAP_CPM2__
12
13#include <linux/types.h>
14
15/* System configuration registers.
16*/
17typedef struct sys_82xx_conf {
18 u32 sc_siumcr;
19 u32 sc_sypcr;
20 u8 res1[6];
21 u16 sc_swsr;
22 u8 res2[20];
23 u32 sc_bcr;
24 u8 sc_ppc_acr;
25 u8 res3[3];
26 u32 sc_ppc_alrh;
27 u32 sc_ppc_alrl;
28 u8 sc_lcl_acr;
29 u8 res4[3];
30 u32 sc_lcl_alrh;
31 u32 sc_lcl_alrl;
32 u32 sc_tescr1;
33 u32 sc_tescr2;
34 u32 sc_ltescr1;
35 u32 sc_ltescr2;
36 u32 sc_pdtea;
37 u8 sc_pdtem;
38 u8 res5[3];
39 u32 sc_ldtea;
40 u8 sc_ldtem;
41 u8 res6[163];
42} sysconf_82xx_cpm2_t;
43
44typedef struct sys_85xx_conf {
45 u32 sc_cear;
46 u16 sc_ceer;
47 u16 sc_cemr;
48 u8 res1[70];
49 u32 sc_smaer;
50 u8 res2[4];
51 u32 sc_smevr;
52 u32 sc_smctr;
53 u32 sc_lmaer;
54 u8 res3[4];
55 u32 sc_lmevr;
56 u32 sc_lmctr;
57 u8 res4[144];
58} sysconf_85xx_cpm2_t;
59
60typedef union sys_conf {
61 sysconf_82xx_cpm2_t siu_82xx;
62 sysconf_85xx_cpm2_t siu_85xx;
63} sysconf_cpm2_t;
64
65
66
67/* Memory controller registers.
68*/
69typedef struct mem_ctlr {
70 u32 memc_br0;
71 u32 memc_or0;
72 u32 memc_br1;
73 u32 memc_or1;
74 u32 memc_br2;
75 u32 memc_or2;
76 u32 memc_br3;
77 u32 memc_or3;
78 u32 memc_br4;
79 u32 memc_or4;
80 u32 memc_br5;
81 u32 memc_or5;
82 u32 memc_br6;
83 u32 memc_or6;
84 u32 memc_br7;
85 u32 memc_or7;
86 u32 memc_br8;
87 u32 memc_or8;
88 u32 memc_br9;
89 u32 memc_or9;
90 u32 memc_br10;
91 u32 memc_or10;
92 u32 memc_br11;
93 u32 memc_or11;
94 u8 res1[8];
95 u32 memc_mar;
96 u8 res2[4];
97 u32 memc_mamr;
98 u32 memc_mbmr;
99 u32 memc_mcmr;
100 u8 res3[8];
101 u16 memc_mptpr;
102 u8 res4[2];
103 u32 memc_mdr;
104 u8 res5[4];
105 u32 memc_psdmr;
106 u32 memc_lsdmr;
107 u8 memc_purt;
108 u8 res6[3];
109 u8 memc_psrt;
110 u8 res7[3];
111 u8 memc_lurt;
112 u8 res8[3];
113 u8 memc_lsrt;
114 u8 res9[3];
115 u32 memc_immr;
116 u32 memc_pcibr0;
117 u32 memc_pcibr1;
118 u8 res10[16];
119 u32 memc_pcimsk0;
120 u32 memc_pcimsk1;
121 u8 res11[52];
122} memctl_cpm2_t;
123
124/* System Integration Timers.
125*/
126typedef struct sys_int_timers {
127 u8 res1[32];
128 u16 sit_tmcntsc;
129 u8 res2[2];
130 u32 sit_tmcnt;
131 u8 res3[4];
132 u32 sit_tmcntal;
133 u8 res4[16];
134 u16 sit_piscr;
135 u8 res5[2];
136 u32 sit_pitc;
137 u32 sit_pitr;
138 u8 res6[94];
139 u8 res7[390];
140} sit_cpm2_t;
141
142#define PISCR_PIRQ_MASK ((u16)0xff00)
143#define PISCR_PS ((u16)0x0080)
144#define PISCR_PIE ((u16)0x0004)
145#define PISCR_PTF ((u16)0x0002)
146#define PISCR_PTE ((u16)0x0001)
147
148/* PCI Controller.
149*/
150typedef struct pci_ctlr {
151 u32 pci_omisr;
152 u32 pci_omimr;
153 u8 res1[8];
154 u32 pci_ifqpr;
155 u32 pci_ofqpr;
156 u8 res2[8];
157 u32 pci_imr0;
158 u32 pci_imr1;
159 u32 pci_omr0;
160 u32 pci_omr1;
161 u32 pci_odr;
162 u8 res3[4];
163 u32 pci_idr;
164 u8 res4[20];
165 u32 pci_imisr;
166 u32 pci_imimr;
167 u8 res5[24];
168 u32 pci_ifhpr;
169 u8 res6[4];
170 u32 pci_iftpr;
171 u8 res7[4];
172 u32 pci_iphpr;
173 u8 res8[4];
174 u32 pci_iptpr;
175 u8 res9[4];
176 u32 pci_ofhpr;
177 u8 res10[4];
178 u32 pci_oftpr;
179 u8 res11[4];
180 u32 pci_ophpr;
181 u8 res12[4];
182 u32 pci_optpr;
183 u8 res13[8];
184 u32 pci_mucr;
185 u8 res14[8];
186 u32 pci_qbar;
187 u8 res15[12];
188 u32 pci_dmamr0;
189 u32 pci_dmasr0;
190 u32 pci_dmacdar0;
191 u8 res16[4];
192 u32 pci_dmasar0;
193 u8 res17[4];
194 u32 pci_dmadar0;
195 u8 res18[4];
196 u32 pci_dmabcr0;
197 u32 pci_dmandar0;
198 u8 res19[86];
199 u32 pci_dmamr1;
200 u32 pci_dmasr1;
201 u32 pci_dmacdar1;
202 u8 res20[4];
203 u32 pci_dmasar1;
204 u8 res21[4];
205 u32 pci_dmadar1;
206 u8 res22[4];
207 u32 pci_dmabcr1;
208 u32 pci_dmandar1;
209 u8 res23[88];
210 u32 pci_dmamr2;
211 u32 pci_dmasr2;
212 u32 pci_dmacdar2;
213 u8 res24[4];
214 u32 pci_dmasar2;
215 u8 res25[4];
216 u32 pci_dmadar2;
217 u8 res26[4];
218 u32 pci_dmabcr2;
219 u32 pci_dmandar2;
220 u8 res27[88];
221 u32 pci_dmamr3;
222 u32 pci_dmasr3;
223 u32 pci_dmacdar3;
224 u8 res28[4];
225 u32 pci_dmasar3;
226 u8 res29[4];
227 u32 pci_dmadar3;
228 u8 res30[4];
229 u32 pci_dmabcr3;
230 u32 pci_dmandar3;
231 u8 res31[344];
232 u32 pci_potar0;
233 u8 res32[4];
234 u32 pci_pobar0;
235 u8 res33[4];
236 u32 pci_pocmr0;
237 u8 res34[4];
238 u32 pci_potar1;
239 u8 res35[4];
240 u32 pci_pobar1;
241 u8 res36[4];
242 u32 pci_pocmr1;
243 u8 res37[4];
244 u32 pci_potar2;
245 u8 res38[4];
246 u32 pci_pobar2;
247 u8 res39[4];
248 u32 pci_pocmr2;
249 u8 res40[50];
250 u32 pci_ptcr;
251 u32 pci_gpcr;
252 u32 pci_gcr;
253 u32 pci_esr;
254 u32 pci_emr;
255 u32 pci_ecr;
256 u32 pci_eacr;
257 u8 res41[4];
258 u32 pci_edcr;
259 u8 res42[4];
260 u32 pci_eccr;
261 u8 res43[44];
262 u32 pci_pitar1;
263 u8 res44[4];
264 u32 pci_pibar1;
265 u8 res45[4];
266 u32 pci_picmr1;
267 u8 res46[4];
268 u32 pci_pitar0;
269 u8 res47[4];
270 u32 pci_pibar0;
271 u8 res48[4];
272 u32 pci_picmr0;
273 u8 res49[4];
274 u32 pci_cfg_addr;
275 u32 pci_cfg_data;
276 u32 pci_int_ack;
277 u8 res50[756];
278} pci_cpm2_t;
279
280/* Interrupt Controller.
281*/
282typedef struct interrupt_controller {
283 u16 ic_sicr;
284 u8 res1[2];
285 u32 ic_sivec;
286 u32 ic_sipnrh;
287 u32 ic_sipnrl;
288 u32 ic_siprr;
289 u32 ic_scprrh;
290 u32 ic_scprrl;
291 u32 ic_simrh;
292 u32 ic_simrl;
293 u32 ic_siexr;
294 u8 res2[88];
295} intctl_cpm2_t;
296
297/* Clocks and Reset.
298*/
299typedef struct clk_and_reset {
300 u32 car_sccr;
301 u8 res1[4];
302 u32 car_scmr;
303 u8 res2[4];
304 u32 car_rsr;
305 u32 car_rmr;
306 u8 res[104];
307} car_cpm2_t;
308
309/* Input/Output Port control/status registers.
310 * Names consistent with processor manual, although they are different
311 * from the original 8xx names.......
312 */
313typedef struct io_port {
314 u32 iop_pdira;
315 u32 iop_ppara;
316 u32 iop_psora;
317 u32 iop_podra;
318 u32 iop_pdata;
319 u8 res1[12];
320 u32 iop_pdirb;
321 u32 iop_pparb;
322 u32 iop_psorb;
323 u32 iop_podrb;
324 u32 iop_pdatb;
325 u8 res2[12];
326 u32 iop_pdirc;
327 u32 iop_pparc;
328 u32 iop_psorc;
329 u32 iop_podrc;
330 u32 iop_pdatc;
331 u8 res3[12];
332 u32 iop_pdird;
333 u32 iop_ppard;
334 u32 iop_psord;
335 u32 iop_podrd;
336 u32 iop_pdatd;
337 u8 res4[12];
338} iop_cpm2_t;
339
340/* Communication Processor Module Timers
341*/
342typedef struct cpm_timers {
343 u8 cpmt_tgcr1;
344 u8 res1[3];
345 u8 cpmt_tgcr2;
346 u8 res2[11];
347 u16 cpmt_tmr1;
348 u16 cpmt_tmr2;
349 u16 cpmt_trr1;
350 u16 cpmt_trr2;
351 u16 cpmt_tcr1;
352 u16 cpmt_tcr2;
353 u16 cpmt_tcn1;
354 u16 cpmt_tcn2;
355 u16 cpmt_tmr3;
356 u16 cpmt_tmr4;
357 u16 cpmt_trr3;
358 u16 cpmt_trr4;
359 u16 cpmt_tcr3;
360 u16 cpmt_tcr4;
361 u16 cpmt_tcn3;
362 u16 cpmt_tcn4;
363 u16 cpmt_ter1;
364 u16 cpmt_ter2;
365 u16 cpmt_ter3;
366 u16 cpmt_ter4;
367 u8 res3[584];
368} cpmtimer_cpm2_t;
369
370/* DMA control/status registers.
371*/
372typedef struct sdma_csr {
373 u8 res0[24];
374 u8 sdma_sdsr;
375 u8 res1[3];
376 u8 sdma_sdmr;
377 u8 res2[3];
378 u8 sdma_idsr1;
379 u8 res3[3];
380 u8 sdma_idmr1;
381 u8 res4[3];
382 u8 sdma_idsr2;
383 u8 res5[3];
384 u8 sdma_idmr2;
385 u8 res6[3];
386 u8 sdma_idsr3;
387 u8 res7[3];
388 u8 sdma_idmr3;
389 u8 res8[3];
390 u8 sdma_idsr4;
391 u8 res9[3];
392 u8 sdma_idmr4;
393 u8 res10[707];
394} sdma_cpm2_t;
395
396/* Fast controllers
397*/
398typedef struct fcc {
399 u32 fcc_gfmr;
400 u32 fcc_fpsmr;
401 u16 fcc_ftodr;
402 u8 res1[2];
403 u16 fcc_fdsr;
404 u8 res2[2];
405 u16 fcc_fcce;
406 u8 res3[2];
407 u16 fcc_fccm;
408 u8 res4[2];
409 u8 fcc_fccs;
410 u8 res5[3];
411 u8 fcc_ftirr_phy[4];
412} fcc_t;
413
414/* Fast controllers continued
415 */
416typedef struct fcc_c {
417 u32 fcc_firper;
418 u32 fcc_firer;
419 u32 fcc_firsr_hi;
420 u32 fcc_firsr_lo;
421 u8 fcc_gfemr;
422 u8 res1[15];
423} fcc_c_t;
424
425/* TC Layer
426 */
427typedef struct tclayer {
428 u16 tc_tcmode;
429 u16 tc_cdsmr;
430 u16 tc_tcer;
431 u16 tc_rcc;
432 u16 tc_tcmr;
433 u16 tc_fcc;
434 u16 tc_ccc;
435 u16 tc_icc;
436 u16 tc_tcc;
437 u16 tc_ecc;
438 u8 res1[12];
439} tclayer_t;
440
441
442/* I2C
443*/
444typedef struct i2c {
445 u8 i2c_i2mod;
446 u8 res1[3];
447 u8 i2c_i2add;
448 u8 res2[3];
449 u8 i2c_i2brg;
450 u8 res3[3];
451 u8 i2c_i2com;
452 u8 res4[3];
453 u8 i2c_i2cer;
454 u8 res5[3];
455 u8 i2c_i2cmr;
456 u8 res6[331];
457} i2c_cpm2_t;
458
459typedef struct scc { /* Serial communication channels */
460 u32 scc_gsmrl;
461 u32 scc_gsmrh;
462 u16 scc_psmr;
463 u8 res1[2];
464 u16 scc_todr;
465 u16 scc_dsr;
466 u16 scc_scce;
467 u8 res2[2];
468 u16 scc_sccm;
469 u8 res3;
470 u8 scc_sccs;
471 u8 res4[8];
472} scc_t;
473
474typedef struct smc { /* Serial management channels */
475 u8 res1[2];
476 u16 smc_smcmr;
477 u8 res2[2];
478 u8 smc_smce;
479 u8 res3[3];
480 u8 smc_smcm;
481 u8 res4[5];
482} smc_t;
483
484/* Serial Peripheral Interface.
485*/
486typedef struct spi_ctrl {
487 u16 spi_spmode;
488 u8 res1[4];
489 u8 spi_spie;
490 u8 res2[3];
491 u8 spi_spim;
492 u8 res3[2];
493 u8 spi_spcom;
494 u8 res4[82];
495} spictl_cpm2_t;
496
497/* CPM Mux.
498*/
499typedef struct cpmux {
500 u8 cmx_si1cr;
501 u8 res1;
502 u8 cmx_si2cr;
503 u8 res2;
504 u32 cmx_fcr;
505 u32 cmx_scr;
506 u8 cmx_smr;
507 u8 res3;
508 u16 cmx_uar;
509 u8 res4[16];
510} cpmux_t;
511
512/* SIRAM control
513*/
514typedef struct siram {
515 u16 si_amr;
516 u16 si_bmr;
517 u16 si_cmr;
518 u16 si_dmr;
519 u8 si_gmr;
520 u8 res1;
521 u8 si_cmdr;
522 u8 res2;
523 u8 si_str;
524 u8 res3;
525 u16 si_rsr;
526} siramctl_t;
527
528typedef struct mcc {
529 u16 mcc_mcce;
530 u8 res1[2];
531 u16 mcc_mccm;
532 u8 res2[2];
533 u8 mcc_mccf;
534 u8 res3[7];
535} mcc_t;
536
537typedef struct comm_proc {
538 u32 cp_cpcr;
539 u32 cp_rccr;
540 u8 res1[14];
541 u16 cp_rter;
542 u8 res2[2];
543 u16 cp_rtmr;
544 u16 cp_rtscr;
545 u8 res3[2];
546 u32 cp_rtsr;
547 u8 res4[12];
548} cpm_cpm2_t;
549
550/* USB Controller.
551*/
552typedef struct usb_ctlr {
553 u8 usb_usmod;
554 u8 usb_usadr;
555 u8 usb_uscom;
556 u8 res1[1];
557 u16 usb_usep1;
558 u16 usb_usep2;
559 u16 usb_usep3;
560 u16 usb_usep4;
561 u8 res2[4];
562 u16 usb_usber;
563 u8 res3[2];
564 u16 usb_usbmr;
565 u8 usb_usbs;
566 u8 res4[7];
567} usb_cpm2_t;
568
569/* ...and the whole thing wrapped up....
570*/
571
572typedef struct immap {
573 /* Some references are into the unique and known dpram spaces,
574 * others are from the generic base.
575 */
576#define im_dprambase im_dpram1
577 u8 im_dpram1[16*1024];
578 u8 res1[16*1024];
579 u8 im_dpram2[4*1024];
580 u8 res2[8*1024];
581 u8 im_dpram3[4*1024];
582 u8 res3[16*1024];
583
584 sysconf_cpm2_t im_siu_conf; /* SIU Configuration */
585 memctl_cpm2_t im_memctl; /* Memory Controller */
586 sit_cpm2_t im_sit; /* System Integration Timers */
587 pci_cpm2_t im_pci; /* PCI Controller */
588 intctl_cpm2_t im_intctl; /* Interrupt Controller */
589 car_cpm2_t im_clkrst; /* Clocks and reset */
590 iop_cpm2_t im_ioport; /* IO Port control/status */
591 cpmtimer_cpm2_t im_cpmtimer; /* CPM timers */
592 sdma_cpm2_t im_sdma; /* SDMA control/status */
593
594 fcc_t im_fcc[3]; /* Three FCCs */
595 u8 res4z[32];
596 fcc_c_t im_fcc_c[3]; /* Continued FCCs */
597
598 u8 res4[32];
599
600 tclayer_t im_tclayer[8]; /* Eight TCLayers */
601 u16 tc_tcgsr;
602 u16 tc_tcger;
603
604 /* First set of baud rate generators.
605 */
606 u8 res[236];
607 u32 im_brgc5;
608 u32 im_brgc6;
609 u32 im_brgc7;
610 u32 im_brgc8;
611
612 u8 res5[608];
613
614 i2c_cpm2_t im_i2c; /* I2C control/status */
615 cpm_cpm2_t im_cpm; /* Communication processor */
616
617 /* Second set of baud rate generators.
618 */
619 u32 im_brgc1;
620 u32 im_brgc2;
621 u32 im_brgc3;
622 u32 im_brgc4;
623
624 scc_t im_scc[4]; /* Four SCCs */
625 smc_t im_smc[2]; /* Couple of SMCs */
626 spictl_cpm2_t im_spi; /* A SPI */
627 cpmux_t im_cpmux; /* CPM clock route mux */
628 siramctl_t im_siramctl1; /* First SI RAM Control */
629 mcc_t im_mcc1; /* First MCC */
630 siramctl_t im_siramctl2; /* Second SI RAM Control */
631 mcc_t im_mcc2; /* Second MCC */
632 usb_cpm2_t im_usb; /* USB Controller */
633
634 u8 res6[1153];
635
636 u16 im_si1txram[256];
637 u8 res7[512];
638 u16 im_si1rxram[256];
639 u8 res8[512];
640 u16 im_si2txram[256];
641 u8 res9[512];
642 u16 im_si2rxram[256];
643 u8 res10[512];
644 u8 res11[4096];
645} cpm2_map_t;
646
647extern cpm2_map_t __iomem *cpm2_immr;
648
649#endif /* __IMMAP_CPM2__ */
650#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/immap_qe.h b/include/asm-powerpc/immap_qe.h
index 1020b7fc0129..aba9806b31c9 100644
--- a/include/asm-powerpc/immap_qe.h
+++ b/include/asm-powerpc/immap_qe.h
@@ -86,8 +86,9 @@ struct cp_qe {
86 __be16 ceexe4; /* QE external request 4 event register */ 86 __be16 ceexe4; /* QE external request 4 event register */
87 u8 res11[0x2]; 87 u8 res11[0x2];
88 __be16 ceexm4; /* QE external request 4 mask register */ 88 __be16 ceexm4; /* QE external request 4 mask register */
89 u8 res12[0x2]; 89 u8 res12[0x3A];
90 u8 res13[0x280]; 90 __be32 ceurnr; /* QE microcode revision number register */
91 u8 res13[0x244];
91} __attribute__ ((packed)); 92} __attribute__ ((packed));
92 93
93/* QE Multiplexer */ 94/* QE Multiplexer */
@@ -96,10 +97,7 @@ struct qe_mux {
96 __be32 cmxsi1cr_l; /* CMX SI1 clock route low register */ 97 __be32 cmxsi1cr_l; /* CMX SI1 clock route low register */
97 __be32 cmxsi1cr_h; /* CMX SI1 clock route high register */ 98 __be32 cmxsi1cr_h; /* CMX SI1 clock route high register */
98 __be32 cmxsi1syr; /* CMX SI1 SYNC route register */ 99 __be32 cmxsi1syr; /* CMX SI1 SYNC route register */
99 __be32 cmxucr1; /* CMX UCC1, UCC3 clock route register */ 100 __be32 cmxucr[4]; /* CMX UCCx clock route registers */
100 __be32 cmxucr2; /* CMX UCC5, UCC7 clock route register */
101 __be32 cmxucr3; /* CMX UCC2, UCC4 clock route register */
102 __be32 cmxucr4; /* CMX UCC6, UCC8 clock route register */
103 __be32 cmxupcr; /* CMX UPC clock route register */ 101 __be32 cmxupcr; /* CMX UPC clock route register */
104 u8 res0[0x1C]; 102 u8 res0[0x1C];
105} __attribute__ ((packed)); 103} __attribute__ ((packed));
@@ -260,7 +258,6 @@ struct ucc_slow {
260 __be16 utpt; 258 __be16 utpt;
261 u8 res4[0x52]; 259 u8 res4[0x52];
262 u8 guemr; /* UCC general extended mode register */ 260 u8 guemr; /* UCC general extended mode register */
263 u8 res5[0x200 - 0x091];
264} __attribute__ ((packed)); 261} __attribute__ ((packed));
265 262
266/* QE UCC Fast */ 263/* QE UCC Fast */
@@ -293,21 +290,13 @@ struct ucc_fast {
293 __be32 urtry; /* UCC retry counter register */ 290 __be32 urtry; /* UCC retry counter register */
294 u8 res8[0x4C]; 291 u8 res8[0x4C];
295 u8 guemr; /* UCC general extended mode register */ 292 u8 guemr; /* UCC general extended mode register */
296 u8 res9[0x100 - 0x091];
297} __attribute__ ((packed));
298
299/* QE UCC */
300struct ucc_common {
301 u8 res1[0x90];
302 u8 guemr;
303 u8 res2[0x200 - 0x091];
304} __attribute__ ((packed)); 293} __attribute__ ((packed));
305 294
306struct ucc { 295struct ucc {
307 union { 296 union {
308 struct ucc_slow slow; 297 struct ucc_slow slow;
309 struct ucc_fast fast; 298 struct ucc_fast fast;
310 struct ucc_common common; 299 u8 res[0x200]; /* UCC blocks are 512 bytes each */
311 }; 300 };
312} __attribute__ ((packed)); 301} __attribute__ ((packed));
313 302
@@ -406,7 +395,7 @@ struct dbg {
406 395
407/* RISC Special Registers (Trap and Breakpoint) */ 396/* RISC Special Registers (Trap and Breakpoint) */
408struct rsp { 397struct rsp {
409 u8 fixme[0x100]; 398 u32 reg[0x40]; /* 64 32-bit registers */
410} __attribute__ ((packed)); 399} __attribute__ ((packed));
411 400
412struct qe_immap { 401struct qe_immap {
@@ -435,11 +424,13 @@ struct qe_immap {
435 u8 res13[0x600]; 424 u8 res13[0x600];
436 struct upc upc2; /* MultiPHY UTOPIA POS Ctrlr 2*/ 425 struct upc upc2; /* MultiPHY UTOPIA POS Ctrlr 2*/
437 struct sdma sdma; /* SDMA */ 426 struct sdma sdma; /* SDMA */
438 struct dbg dbg; /* Debug Space */ 427 struct dbg dbg; /* 0x104080 - 0x1040FF
439 struct rsp rsp[0x2]; /* RISC Special Registers 428 Debug Space */
429 struct rsp rsp[0x2]; /* 0x104100 - 0x1042FF
430 RISC Special Registers
440 (Trap and Breakpoint) */ 431 (Trap and Breakpoint) */
441 u8 res14[0x300]; 432 u8 res14[0x300]; /* 0x104300 - 0x1045FF */
442 u8 res15[0x3A00]; 433 u8 res15[0x3A00]; /* 0x104600 - 0x107FFF */
443 u8 res16[0x8000]; /* 0x108000 - 0x110000 */ 434 u8 res16[0x8000]; /* 0x108000 - 0x110000 */
444 u8 muram[0xC000]; /* 0x110000 - 0x11C000 435 u8 muram[0xC000]; /* 0x110000 - 0x11C000
445 Multi-user RAM */ 436 Multi-user RAM */
@@ -450,7 +441,7 @@ struct qe_immap {
450extern struct qe_immap *qe_immr; 441extern struct qe_immap *qe_immr;
451extern phys_addr_t get_qe_base(void); 442extern phys_addr_t get_qe_base(void);
452 443
453static inline unsigned long immrbar_virt_to_phys(volatile void * address) 444static inline unsigned long immrbar_virt_to_phys(void *address)
454{ 445{
455 if ( ((u32)address >= (u32)qe_immr) && 446 if ( ((u32)address >= (u32)qe_immr) &&
456 ((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) ) 447 ((u32)address < ((u32)qe_immr + QE_IMMAP_SIZE)) )
diff --git a/include/asm-powerpc/io.h b/include/asm-powerpc/io.h
index bb8d965f96c6..affba7052fb6 100644
--- a/include/asm-powerpc/io.h
+++ b/include/asm-powerpc/io.h
@@ -86,7 +86,7 @@ extern unsigned long pci_dram_offset;
86 */ 86 */
87 87
88#ifdef CONFIG_PPC64 88#ifdef CONFIG_PPC64
89#define IO_SET_SYNC_FLAG() do { get_paca()->io_sync = 1; } while(0) 89#define IO_SET_SYNC_FLAG() do { local_paca->io_sync = 1; } while(0)
90#else 90#else
91#define IO_SET_SYNC_FLAG() 91#define IO_SET_SYNC_FLAG()
92#endif 92#endif
@@ -734,6 +734,32 @@ static inline void * bus_to_virt(unsigned long address)
734#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) | (_v)) 734#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) | (_v))
735#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v)) 735#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v))
736 736
737#define setbits8(_addr, _v) out_8((_addr), in_8(_addr) | (_v))
738#define clrbits8(_addr, _v) out_8((_addr), in_8(_addr) & ~(_v))
739
740/* Clear and set bits in one shot. These macros can be used to clear and
741 * set multiple bits in a register using a single read-modify-write. These
742 * macros can also be used to set a multiple-bit bit pattern using a mask,
743 * by specifying the mask in the 'clear' parameter and the new bit pattern
744 * in the 'set' parameter.
745 */
746
747#define clrsetbits(type, addr, clear, set) \
748 out_##type((addr), (in_##type(addr) & ~(clear)) | (set))
749
750#ifdef __powerpc64__
751#define clrsetbits_be64(addr, clear, set) clrsetbits(be64, addr, clear, set)
752#define clrsetbits_le64(addr, clear, set) clrsetbits(le64, addr, clear, set)
753#endif
754
755#define clrsetbits_be32(addr, clear, set) clrsetbits(be32, addr, clear, set)
756#define clrsetbits_le32(addr, clear, set) clrsetbits(le32, addr, clear, set)
757
758#define clrsetbits_be16(addr, clear, set) clrsetbits(be16, addr, clear, set)
759#define clrsetbits_le16(addr, clear, set) clrsetbits(le32, addr, clear, set)
760
761#define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set)
762
737#endif /* __KERNEL__ */ 763#endif /* __KERNEL__ */
738 764
739#endif /* _ASM_POWERPC_IO_H */ 765#endif /* _ASM_POWERPC_IO_H */
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index 0485c53db2b5..1392db456523 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -124,6 +124,9 @@ struct irq_host {
124 struct irq_host_ops *ops; 124 struct irq_host_ops *ops;
125 void *host_data; 125 void *host_data;
126 irq_hw_number_t inval_irq; 126 irq_hw_number_t inval_irq;
127
128 /* Optional device node pointer */
129 struct device_node *of_node;
127}; 130};
128 131
129/* The main irq map itself is an array of NR_IRQ entries containing the 132/* The main irq map itself is an array of NR_IRQ entries containing the
@@ -142,7 +145,7 @@ extern irq_hw_number_t virq_to_hw(unsigned int virq);
142 145
143/** 146/**
144 * irq_alloc_host - Allocate a new irq_host data structure 147 * irq_alloc_host - Allocate a new irq_host data structure
145 * @node: device-tree node of the interrupt controller 148 * @of_node: optional device-tree node of the interrupt controller
146 * @revmap_type: type of reverse mapping to use 149 * @revmap_type: type of reverse mapping to use
147 * @revmap_arg: for IRQ_HOST_MAP_LINEAR linear only: size of the map 150 * @revmap_arg: for IRQ_HOST_MAP_LINEAR linear only: size of the map
148 * @ops: map/unmap host callbacks 151 * @ops: map/unmap host callbacks
@@ -156,7 +159,8 @@ extern irq_hw_number_t virq_to_hw(unsigned int virq);
156 * later during boot automatically (the reverse mapping will use the slow path 159 * later during boot automatically (the reverse mapping will use the slow path
157 * until that happens). 160 * until that happens).
158 */ 161 */
159extern struct irq_host *irq_alloc_host(unsigned int revmap_type, 162extern struct irq_host *irq_alloc_host(struct device_node *of_node,
163 unsigned int revmap_type,
160 unsigned int revmap_arg, 164 unsigned int revmap_arg,
161 struct irq_host_ops *ops, 165 struct irq_host_ops *ops,
162 irq_hw_number_t inval_irq); 166 irq_hw_number_t inval_irq);
diff --git a/include/asm-powerpc/iseries/hv_call_event.h b/include/asm-powerpc/iseries/hv_call_event.h
index 4cec4762076d..cc029d388e11 100644
--- a/include/asm-powerpc/iseries/hv_call_event.h
+++ b/include/asm-powerpc/iseries/hv_call_event.h
@@ -21,6 +21,9 @@
21#ifndef _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H 21#ifndef _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H
22#define _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H 22#define _ASM_POWERPC_ISERIES_HV_CALL_EVENT_H
23 23
24#include <linux/types.h>
25#include <linux/dma-mapping.h>
26
24#include <asm/iseries/hv_call_sc.h> 27#include <asm/iseries/hv_call_sc.h>
25#include <asm/iseries/hv_types.h> 28#include <asm/iseries/hv_types.h>
26#include <asm/abs_addr.h> 29#include <asm/abs_addr.h>
@@ -113,6 +116,13 @@ static inline HvLpEvent_Rc HvCallEvent_signalLpEventFast(HvLpIndex targetLp,
113 eventData3, eventData4, eventData5); 116 eventData3, eventData4, eventData5);
114} 117}
115 118
119extern void *iseries_hv_alloc(size_t size, dma_addr_t *dma_handle, gfp_t flag);
120extern void iseries_hv_free(size_t size, void *vaddr, dma_addr_t dma_handle);
121extern dma_addr_t iseries_hv_map(void *vaddr, size_t size,
122 enum dma_data_direction direction);
123extern void iseries_hv_unmap(dma_addr_t dma_handle, size_t size,
124 enum dma_data_direction direction);
125
116static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event) 126static inline HvLpEvent_Rc HvCallEvent_ackLpEvent(struct HvLpEvent *event)
117{ 127{
118 return HvCall1(HvCallEventAckLpEvent, virt_to_abs(event)); 128 return HvCall1(HvCallEventAckLpEvent, virt_to_abs(event));
diff --git a/include/asm-powerpc/iseries/iommu.h b/include/asm-powerpc/iseries/iommu.h
index 6e323a13ac30..c59ee7e4bed1 100644
--- a/include/asm-powerpc/iseries/iommu.h
+++ b/include/asm-powerpc/iseries/iommu.h
@@ -22,6 +22,7 @@
22 */ 22 */
23 23
24struct pci_dev; 24struct pci_dev;
25struct vio_dev;
25struct device_node; 26struct device_node;
26struct iommu_table; 27struct iommu_table;
27 28
@@ -34,4 +35,7 @@ extern void iommu_table_getparms_iSeries(unsigned long busno,
34 unsigned char slotno, unsigned char virtbus, 35 unsigned char slotno, unsigned char virtbus,
35 struct iommu_table *tbl); 36 struct iommu_table *tbl);
36 37
38extern struct iommu_table *vio_build_iommu_table_iseries(struct vio_dev *dev);
39extern void iommu_vio_init(void);
40
37#endif /* _ASM_POWERPC_ISERIES_IOMMU_H */ 41#endif /* _ASM_POWERPC_ISERIES_IOMMU_H */
diff --git a/include/asm-powerpc/iseries/lpar_map.h b/include/asm-powerpc/iseries/lpar_map.h
index 2ec384d66abb..5e9f3e128ee2 100644
--- a/include/asm-powerpc/iseries/lpar_map.h
+++ b/include/asm-powerpc/iseries/lpar_map.h
@@ -22,6 +22,8 @@
22 22
23#include <asm/types.h> 23#include <asm/types.h>
24 24
25#endif
26
25/* 27/*
26 * The iSeries hypervisor will set up mapping for one or more 28 * The iSeries hypervisor will set up mapping for one or more
27 * ESID/VSID pairs (in SLB/segment registers) and will set up 29 * ESID/VSID pairs (in SLB/segment registers) and will set up
@@ -56,6 +58,7 @@
56/* Hypervisor initially maps 32MB of the load area */ 58/* Hypervisor initially maps 32MB of the load area */
57#define HvPagesToMap 8192 59#define HvPagesToMap 8192
58 60
61#ifndef __ASSEMBLY__
59struct LparMap { 62struct LparMap {
60 u64 xNumberEsids; // Number of ESID/VSID pairs 63 u64 xNumberEsids; // Number of ESID/VSID pairs
61 u64 xNumberRanges; // Number of VA ranges to map 64 u64 xNumberRanges; // Number of VA ranges to map
diff --git a/include/asm-powerpc/iseries/vio.h b/include/asm-powerpc/iseries/vio.h
index 7a95d296abd1..f9ac0d00b951 100644
--- a/include/asm-powerpc/iseries/vio.h
+++ b/include/asm-powerpc/iseries/vio.h
@@ -51,6 +51,116 @@
51 */ 51 */
52#define VIO_MAX_SUBTYPES 8 52#define VIO_MAX_SUBTYPES 8
53 53
54#define VIOMAXBLOCKDMA 12
55
56struct open_data {
57 u64 disk_size;
58 u16 max_disk;
59 u16 cylinders;
60 u16 tracks;
61 u16 sectors;
62 u16 bytes_per_sector;
63};
64
65struct rw_data {
66 u64 offset;
67 struct {
68 u32 token;
69 u32 reserved;
70 u64 len;
71 } dma_info[VIOMAXBLOCKDMA];
72};
73
74struct vioblocklpevent {
75 struct HvLpEvent event;
76 u32 reserved;
77 u16 version;
78 u16 sub_result;
79 u16 disk;
80 u16 flags;
81 union {
82 struct open_data open_data;
83 struct rw_data rw_data;
84 u64 changed;
85 } u;
86};
87
88#define vioblockflags_ro 0x0001
89
90enum vioblocksubtype {
91 vioblockopen = 0x0001,
92 vioblockclose = 0x0002,
93 vioblockread = 0x0003,
94 vioblockwrite = 0x0004,
95 vioblockflush = 0x0005,
96 vioblockcheck = 0x0007
97};
98
99struct viocdlpevent {
100 struct HvLpEvent event;
101 u32 reserved;
102 u16 version;
103 u16 sub_result;
104 u16 disk;
105 u16 flags;
106 u32 token;
107 u64 offset; /* On open, max number of disks */
108 u64 len; /* On open, size of the disk */
109 u32 block_size; /* Only set on open */
110 u32 media_size; /* Only set on open */
111};
112
113enum viocdsubtype {
114 viocdopen = 0x0001,
115 viocdclose = 0x0002,
116 viocdread = 0x0003,
117 viocdwrite = 0x0004,
118 viocdlockdoor = 0x0005,
119 viocdgetinfo = 0x0006,
120 viocdcheck = 0x0007
121};
122
123struct viotapelpevent {
124 struct HvLpEvent event;
125 u32 reserved;
126 u16 version;
127 u16 sub_type_result;
128 u16 tape;
129 u16 flags;
130 u32 token;
131 u64 len;
132 union {
133 struct {
134 u32 tape_op;
135 u32 count;
136 } op;
137 struct {
138 u32 type;
139 u32 resid;
140 u32 dsreg;
141 u32 gstat;
142 u32 erreg;
143 u32 file_no;
144 u32 block_no;
145 } get_status;
146 struct {
147 u32 block_no;
148 } get_pos;
149 } u;
150};
151
152enum viotapesubtype {
153 viotapeopen = 0x0001,
154 viotapeclose = 0x0002,
155 viotaperead = 0x0003,
156 viotapewrite = 0x0004,
157 viotapegetinfo = 0x0005,
158 viotapeop = 0x0006,
159 viotapegetpos = 0x0007,
160 viotapesetpos = 0x0008,
161 viotapegetstatus = 0x0009
162};
163
54/* 164/*
55 * Each subtype can register a handler to process their events. 165 * Each subtype can register a handler to process their events.
56 * The handler must have this interface. 166 * The handler must have this interface.
@@ -68,6 +178,8 @@ extern void vio_set_hostlp(void);
68extern void *vio_get_event_buffer(int subtype); 178extern void *vio_get_event_buffer(int subtype);
69extern void vio_free_event_buffer(int subtype, void *buffer); 179extern void vio_free_event_buffer(int subtype, void *buffer);
70 180
181extern struct vio_dev *vio_create_viodasd(u32 unit);
182
71extern HvLpIndex viopath_hostLp; 183extern HvLpIndex viopath_hostLp;
72extern HvLpIndex viopath_ourLp; 184extern HvLpIndex viopath_ourLp;
73 185
@@ -150,8 +262,4 @@ enum viochar_rc {
150 viochar_rc_ebusy = 1 262 viochar_rc_ebusy = 1
151}; 263};
152 264
153struct device;
154
155extern struct device *iSeries_vio_dev;
156
157#endif /* _ASM_POWERPC_ISERIES_VIO_H */ 265#endif /* _ASM_POWERPC_ISERIES_VIO_H */
diff --git a/include/asm-powerpc/kgdb.h b/include/asm-powerpc/kgdb.h
new file mode 100644
index 000000000000..b617dac82969
--- /dev/null
+++ b/include/asm-powerpc/kgdb.h
@@ -0,0 +1,57 @@
1/*
2 * kgdb.h: Defines and declarations for serial line source level
3 * remote debugging of the Linux kernel using gdb.
4 *
5 * PPC Mods (C) 1998 Michael Tesch (tesch@cs.wisc.edu)
6 *
7 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
8 */
9#ifdef __KERNEL__
10#ifndef _PPC_KGDB_H
11#define _PPC_KGDB_H
12
13#ifndef __ASSEMBLY__
14
15/* Things specific to the gen550 backend. */
16struct uart_port;
17
18extern void gen550_progress(char *, unsigned short);
19extern void gen550_kgdb_map_scc(void);
20extern void gen550_init(int, struct uart_port *);
21
22/* Things specific to the pmac backend. */
23extern void zs_kgdb_hook(int tty_num);
24
25/* To init the kgdb engine. (called by serial hook)*/
26extern void set_debug_traps(void);
27
28/* To enter the debugger explicitly. */
29extern void breakpoint(void);
30
31/* For taking exceptions
32 * these are defined in traps.c
33 */
34extern int (*debugger)(struct pt_regs *regs);
35extern int (*debugger_bpt)(struct pt_regs *regs);
36extern int (*debugger_sstep)(struct pt_regs *regs);
37extern int (*debugger_iabr_match)(struct pt_regs *regs);
38extern int (*debugger_dabr_match)(struct pt_regs *regs);
39extern void (*debugger_fault_handler)(struct pt_regs *regs);
40
41/* What we bring to the party */
42int kgdb_bpt(struct pt_regs *regs);
43int kgdb_sstep(struct pt_regs *regs);
44void kgdb(struct pt_regs *regs);
45int kgdb_iabr_match(struct pt_regs *regs);
46int kgdb_dabr_match(struct pt_regs *regs);
47
48/*
49 * external low-level support routines (ie macserial.c)
50 */
51extern void kgdb_interruptible(int); /* control interrupts from serial */
52extern void putDebugChar(char); /* write a single character */
53extern char getDebugChar(void); /* read and return a single char */
54
55#endif /* !(__ASSEMBLY__) */
56#endif /* !(_PPC_KGDB_H) */
57#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/lmb.h b/include/asm-powerpc/lmb.h
index 0c5880f70225..b5f9f4c9c294 100644
--- a/include/asm-powerpc/lmb.h
+++ b/include/asm-powerpc/lmb.h
@@ -1,5 +1,5 @@
1#ifndef _PPC64_LMB_H 1#ifndef _ASM_POWERPC_LMB_H
2#define _PPC64_LMB_H 2#define _ASM_POWERPC_LMB_H
3#ifdef __KERNEL__ 3#ifdef __KERNEL__
4 4
5/* 5/*
@@ -77,4 +77,4 @@ lmb_end_pfn(struct lmb_region *type, unsigned long region_nr)
77} 77}
78 78
79#endif /* __KERNEL__ */ 79#endif /* __KERNEL__ */
80#endif /* _PPC64_LMB_H */ 80#endif /* _ASM_POWERPC_LMB_H */
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 71c6e7eb2a26..6968f4300dca 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -51,22 +51,22 @@ struct machdep_calls {
51#ifdef CONFIG_PPC64 51#ifdef CONFIG_PPC64
52 void (*hpte_invalidate)(unsigned long slot, 52 void (*hpte_invalidate)(unsigned long slot,
53 unsigned long va, 53 unsigned long va,
54 int psize, 54 int psize, int ssize,
55 int local); 55 int local);
56 long (*hpte_updatepp)(unsigned long slot, 56 long (*hpte_updatepp)(unsigned long slot,
57 unsigned long newpp, 57 unsigned long newpp,
58 unsigned long va, 58 unsigned long va,
59 int pize, 59 int psize, int ssize,
60 int local); 60 int local);
61 void (*hpte_updateboltedpp)(unsigned long newpp, 61 void (*hpte_updateboltedpp)(unsigned long newpp,
62 unsigned long ea, 62 unsigned long ea,
63 int psize); 63 int psize, int ssize);
64 long (*hpte_insert)(unsigned long hpte_group, 64 long (*hpte_insert)(unsigned long hpte_group,
65 unsigned long va, 65 unsigned long va,
66 unsigned long prpn, 66 unsigned long prpn,
67 unsigned long rflags, 67 unsigned long rflags,
68 unsigned long vflags, 68 unsigned long vflags,
69 int psize); 69 int psize, int ssize);
70 long (*hpte_remove)(unsigned long hpte_group); 70 long (*hpte_remove)(unsigned long hpte_group);
71 void (*flush_hash_range)(unsigned long number, int local); 71 void (*flush_hash_range)(unsigned long number, int local);
72 72
@@ -99,7 +99,7 @@ struct machdep_calls {
99#endif /* CONFIG_PPC64 */ 99#endif /* CONFIG_PPC64 */
100 100
101 int (*probe)(void); 101 int (*probe)(void);
102 void (*setup_arch)(void); 102 void (*setup_arch)(void); /* Optional, may be NULL */
103 void (*init_early)(void); 103 void (*init_early)(void);
104 /* Optional, may be NULL. */ 104 /* Optional, may be NULL. */
105 void (*show_cpuinfo)(struct seq_file *m); 105 void (*show_cpuinfo)(struct seq_file *m);
diff --git a/include/asm-powerpc/mmu-40x.h b/include/asm-powerpc/mmu-40x.h
new file mode 100644
index 000000000000..7d37f77043ac
--- /dev/null
+++ b/include/asm-powerpc/mmu-40x.h
@@ -0,0 +1,65 @@
1#ifndef _ASM_POWERPC_MMU_40X_H_
2#define _ASM_POWERPC_MMU_40X_H_
3
4/*
5 * PPC40x support
6 */
7
8#define PPC40X_TLB_SIZE 64
9
10/*
11 * TLB entries are defined by a "high" tag portion and a "low" data
12 * portion. On all architectures, the data portion is 32-bits.
13 *
14 * TLB entries are managed entirely under software control by reading,
15 * writing, and searchoing using the 4xx-specific tlbre, tlbwr, and tlbsx
16 * instructions.
17 */
18
19#define TLB_LO 1
20#define TLB_HI 0
21
22#define TLB_DATA TLB_LO
23#define TLB_TAG TLB_HI
24
25/* Tag portion */
26
27#define TLB_EPN_MASK 0xFFFFFC00 /* Effective Page Number */
28#define TLB_PAGESZ_MASK 0x00000380
29#define TLB_PAGESZ(x) (((x) & 0x7) << 7)
30#define PAGESZ_1K 0
31#define PAGESZ_4K 1
32#define PAGESZ_16K 2
33#define PAGESZ_64K 3
34#define PAGESZ_256K 4
35#define PAGESZ_1M 5
36#define PAGESZ_4M 6
37#define PAGESZ_16M 7
38#define TLB_VALID 0x00000040 /* Entry is valid */
39
40/* Data portion */
41
42#define TLB_RPN_MASK 0xFFFFFC00 /* Real Page Number */
43#define TLB_PERM_MASK 0x00000300
44#define TLB_EX 0x00000200 /* Instruction execution allowed */
45#define TLB_WR 0x00000100 /* Writes permitted */
46#define TLB_ZSEL_MASK 0x000000F0
47#define TLB_ZSEL(x) (((x) & 0xF) << 4)
48#define TLB_ATTR_MASK 0x0000000F
49#define TLB_W 0x00000008 /* Caching is write-through */
50#define TLB_I 0x00000004 /* Caching is inhibited */
51#define TLB_M 0x00000002 /* Memory is coherent */
52#define TLB_G 0x00000001 /* Memory is guarded from prefetch */
53
54#ifndef __ASSEMBLY__
55
56typedef unsigned long phys_addr_t;
57
58typedef struct {
59 unsigned long id;
60 unsigned long vdso_base;
61} mm_context_t;
62
63#endif /* !__ASSEMBLY__ */
64
65#endif /* _ASM_POWERPC_MMU_40X_H_ */
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h
index 3112ad14ad95..82328dec2b52 100644
--- a/include/asm-powerpc/mmu-hash64.h
+++ b/include/asm-powerpc/mmu-hash64.h
@@ -47,6 +47,8 @@ extern char initial_stab[];
47 47
48/* Bits in the SLB VSID word */ 48/* Bits in the SLB VSID word */
49#define SLB_VSID_SHIFT 12 49#define SLB_VSID_SHIFT 12
50#define SLB_VSID_SHIFT_1T 24
51#define SLB_VSID_SSIZE_SHIFT 62
50#define SLB_VSID_B ASM_CONST(0xc000000000000000) 52#define SLB_VSID_B ASM_CONST(0xc000000000000000)
51#define SLB_VSID_B_256M ASM_CONST(0x0000000000000000) 53#define SLB_VSID_B_256M ASM_CONST(0x0000000000000000)
52#define SLB_VSID_B_1T ASM_CONST(0x4000000000000000) 54#define SLB_VSID_B_1T ASM_CONST(0x4000000000000000)
@@ -66,6 +68,7 @@ extern char initial_stab[];
66#define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS|SLB_VSID_C) 68#define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS|SLB_VSID_C)
67 69
68#define SLBIE_C (0x08000000) 70#define SLBIE_C (0x08000000)
71#define SLBIE_SSIZE_SHIFT 25
69 72
70/* 73/*
71 * Hash table 74 * Hash table
@@ -77,7 +80,7 @@ extern char initial_stab[];
77#define HPTE_V_AVPN_SHIFT 7 80#define HPTE_V_AVPN_SHIFT 7
78#define HPTE_V_AVPN ASM_CONST(0x3fffffffffffff80) 81#define HPTE_V_AVPN ASM_CONST(0x3fffffffffffff80)
79#define HPTE_V_AVPN_VAL(x) (((x) & HPTE_V_AVPN) >> HPTE_V_AVPN_SHIFT) 82#define HPTE_V_AVPN_VAL(x) (((x) & HPTE_V_AVPN) >> HPTE_V_AVPN_SHIFT)
80#define HPTE_V_COMPARE(x,y) (!(((x) ^ (y)) & HPTE_V_AVPN)) 83#define HPTE_V_COMPARE(x,y) (!(((x) ^ (y)) & 0xffffffffffffff80))
81#define HPTE_V_BOLTED ASM_CONST(0x0000000000000010) 84#define HPTE_V_BOLTED ASM_CONST(0x0000000000000010)
82#define HPTE_V_LOCK ASM_CONST(0x0000000000000008) 85#define HPTE_V_LOCK ASM_CONST(0x0000000000000008)
83#define HPTE_V_LARGE ASM_CONST(0x0000000000000004) 86#define HPTE_V_LARGE ASM_CONST(0x0000000000000004)
@@ -164,16 +167,19 @@ struct mmu_psize_def
164#define MMU_SEGSIZE_256M 0 167#define MMU_SEGSIZE_256M 0
165#define MMU_SEGSIZE_1T 1 168#define MMU_SEGSIZE_1T 1
166 169
170
167#ifndef __ASSEMBLY__ 171#ifndef __ASSEMBLY__
168 172
169/* 173/*
170 * The current system page sizes 174 * The current system page and segment sizes
171 */ 175 */
172extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]; 176extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
173extern int mmu_linear_psize; 177extern int mmu_linear_psize;
174extern int mmu_virtual_psize; 178extern int mmu_virtual_psize;
175extern int mmu_vmalloc_psize; 179extern int mmu_vmalloc_psize;
176extern int mmu_io_psize; 180extern int mmu_io_psize;
181extern int mmu_kernel_ssize;
182extern int mmu_highuser_ssize;
177 183
178/* 184/*
179 * If the processor supports 64k normal pages but not 64k cache 185 * If the processor supports 64k normal pages but not 64k cache
@@ -195,13 +201,15 @@ extern int mmu_huge_psize;
195 * This function sets the AVPN and L fields of the HPTE appropriately 201 * This function sets the AVPN and L fields of the HPTE appropriately
196 * for the page size 202 * for the page size
197 */ 203 */
198static inline unsigned long hpte_encode_v(unsigned long va, int psize) 204static inline unsigned long hpte_encode_v(unsigned long va, int psize,
205 int ssize)
199{ 206{
200 unsigned long v = 207 unsigned long v;
201 v = (va >> 23) & ~(mmu_psize_defs[psize].avpnm); 208 v = (va >> 23) & ~(mmu_psize_defs[psize].avpnm);
202 v <<= HPTE_V_AVPN_SHIFT; 209 v <<= HPTE_V_AVPN_SHIFT;
203 if (psize != MMU_PAGE_4K) 210 if (psize != MMU_PAGE_4K)
204 v |= HPTE_V_LARGE; 211 v |= HPTE_V_LARGE;
212 v |= ((unsigned long) ssize) << HPTE_V_SSIZE_SHIFT;
205 return v; 213 return v;
206} 214}
207 215
@@ -226,20 +234,40 @@ static inline unsigned long hpte_encode_r(unsigned long pa, int psize)
226} 234}
227 235
228/* 236/*
229 * This hashes a virtual address for a 256Mb segment only for now 237 * Build a VA given VSID, EA and segment size
230 */ 238 */
239static inline unsigned long hpt_va(unsigned long ea, unsigned long vsid,
240 int ssize)
241{
242 if (ssize == MMU_SEGSIZE_256M)
243 return (vsid << 28) | (ea & 0xfffffffUL);
244 return (vsid << 40) | (ea & 0xffffffffffUL);
245}
231 246
232static inline unsigned long hpt_hash(unsigned long va, unsigned int shift) 247/*
248 * This hashes a virtual address
249 */
250
251static inline unsigned long hpt_hash(unsigned long va, unsigned int shift,
252 int ssize)
233{ 253{
234 return ((va >> 28) & 0x7fffffffffUL) ^ ((va & 0x0fffffffUL) >> shift); 254 unsigned long hash, vsid;
255
256 if (ssize == MMU_SEGSIZE_256M) {
257 hash = (va >> 28) ^ ((va & 0x0fffffffUL) >> shift);
258 } else {
259 vsid = va >> 40;
260 hash = vsid ^ (vsid << 25) ^ ((va & 0xffffffffffUL) >> shift);
261 }
262 return hash & 0x7fffffffffUL;
235} 263}
236 264
237extern int __hash_page_4K(unsigned long ea, unsigned long access, 265extern int __hash_page_4K(unsigned long ea, unsigned long access,
238 unsigned long vsid, pte_t *ptep, unsigned long trap, 266 unsigned long vsid, pte_t *ptep, unsigned long trap,
239 unsigned int local); 267 unsigned int local, int ssize);
240extern int __hash_page_64K(unsigned long ea, unsigned long access, 268extern int __hash_page_64K(unsigned long ea, unsigned long access,
241 unsigned long vsid, pte_t *ptep, unsigned long trap, 269 unsigned long vsid, pte_t *ptep, unsigned long trap,
242 unsigned int local); 270 unsigned int local, int ssize);
243struct mm_struct; 271struct mm_struct;
244extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap); 272extern int hash_page(unsigned long ea, unsigned long access, unsigned long trap);
245extern int hash_huge_page(struct mm_struct *mm, unsigned long access, 273extern int hash_huge_page(struct mm_struct *mm, unsigned long access,
@@ -248,7 +276,7 @@ extern int hash_huge_page(struct mm_struct *mm, unsigned long access,
248 276
249extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend, 277extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
250 unsigned long pstart, unsigned long mode, 278 unsigned long pstart, unsigned long mode,
251 int psize); 279 int psize, int ssize);
252 280
253extern void htab_initialize(void); 281extern void htab_initialize(void);
254extern void htab_initialize_secondary(void); 282extern void htab_initialize_secondary(void);
@@ -256,6 +284,7 @@ extern void hpte_init_native(void);
256extern void hpte_init_lpar(void); 284extern void hpte_init_lpar(void);
257extern void hpte_init_iSeries(void); 285extern void hpte_init_iSeries(void);
258extern void hpte_init_beat(void); 286extern void hpte_init_beat(void);
287extern void hpte_init_beat_v3(void);
259 288
260extern void stabs_alloc(void); 289extern void stabs_alloc(void);
261extern void slb_initialize(void); 290extern void slb_initialize(void);
@@ -316,12 +345,17 @@ extern void slb_vmalloc_update(void);
316 * which are used by the iSeries firmware. 345 * which are used by the iSeries firmware.
317 */ 346 */
318 347
319#define VSID_MULTIPLIER ASM_CONST(200730139) /* 28-bit prime */ 348#define VSID_MULTIPLIER_256M ASM_CONST(200730139) /* 28-bit prime */
320#define VSID_BITS 36 349#define VSID_BITS_256M 36
321#define VSID_MODULUS ((1UL<<VSID_BITS)-1) 350#define VSID_MODULUS_256M ((1UL<<VSID_BITS_256M)-1)
322 351
323#define CONTEXT_BITS 19 352#define VSID_MULTIPLIER_1T ASM_CONST(12538073) /* 24-bit prime */
324#define USER_ESID_BITS 16 353#define VSID_BITS_1T 24
354#define VSID_MODULUS_1T ((1UL<<VSID_BITS_1T)-1)
355
356#define CONTEXT_BITS 19
357#define USER_ESID_BITS 16
358#define USER_ESID_BITS_1T 4
325 359
326#define USER_VSID_RANGE (1UL << (USER_ESID_BITS + SID_SHIFT)) 360#define USER_VSID_RANGE (1UL << (USER_ESID_BITS + SID_SHIFT))
327 361
@@ -335,17 +369,17 @@ extern void slb_vmalloc_update(void);
335 * rx = scratch register (clobbered) 369 * rx = scratch register (clobbered)
336 * 370 *
337 * - rt and rx must be different registers 371 * - rt and rx must be different registers
338 * - The answer will end up in the low 36 bits of rt. The higher 372 * - The answer will end up in the low VSID_BITS bits of rt. The higher
339 * bits may contain other garbage, so you may need to mask the 373 * bits may contain other garbage, so you may need to mask the
340 * result. 374 * result.
341 */ 375 */
342#define ASM_VSID_SCRAMBLE(rt, rx) \ 376#define ASM_VSID_SCRAMBLE(rt, rx, size) \
343 lis rx,VSID_MULTIPLIER@h; \ 377 lis rx,VSID_MULTIPLIER_##size@h; \
344 ori rx,rx,VSID_MULTIPLIER@l; \ 378 ori rx,rx,VSID_MULTIPLIER_##size@l; \
345 mulld rt,rt,rx; /* rt = rt * MULTIPLIER */ \ 379 mulld rt,rt,rx; /* rt = rt * MULTIPLIER */ \
346 \ 380 \
347 srdi rx,rt,VSID_BITS; \ 381 srdi rx,rt,VSID_BITS_##size; \
348 clrldi rt,rt,(64-VSID_BITS); \ 382 clrldi rt,rt,(64-VSID_BITS_##size); \
349 add rt,rt,rx; /* add high and low bits */ \ 383 add rt,rt,rx; /* add high and low bits */ \
350 /* Now, r3 == VSID (mod 2^36-1), and lies between 0 and \ 384 /* Now, r3 == VSID (mod 2^36-1), and lies between 0 and \
351 * 2^36-1+2^28-1. That in particular means that if r3 >= \ 385 * 2^36-1+2^28-1. That in particular means that if r3 >= \
@@ -354,7 +388,7 @@ extern void slb_vmalloc_update(void);
354 * doesn't, the answer is the low 36 bits of r3+1. So in all \ 388 * doesn't, the answer is the low 36 bits of r3+1. So in all \
355 * cases the answer is the low 36 bits of (r3 + ((r3+1) >> 36))*/\ 389 * cases the answer is the low 36 bits of (r3 + ((r3+1) >> 36))*/\
356 addi rx,rt,1; \ 390 addi rx,rt,1; \
357 srdi rx,rx,VSID_BITS; /* extract 2^36 bit */ \ 391 srdi rx,rx,VSID_BITS_##size; /* extract 2^VSID_BITS bit */ \
358 add rt,rt,rx 392 add rt,rt,rx
359 393
360 394
@@ -376,37 +410,60 @@ typedef struct {
376} mm_context_t; 410} mm_context_t;
377 411
378 412
379static inline unsigned long vsid_scramble(unsigned long protovsid)
380{
381#if 0 413#if 0
382 /* The code below is equivalent to this function for arguments 414/*
383 * < 2^VSID_BITS, which is all this should ever be called 415 * The code below is equivalent to this function for arguments
384 * with. However gcc is not clever enough to compute the 416 * < 2^VSID_BITS, which is all this should ever be called
385 * modulus (2^n-1) without a second multiply. */ 417 * with. However gcc is not clever enough to compute the
386 return ((protovsid * VSID_MULTIPLIER) % VSID_MODULUS); 418 * modulus (2^n-1) without a second multiply.
387#else /* 1 */ 419 */
388 unsigned long x; 420#define vsid_scrample(protovsid, size) \
421 ((((protovsid) * VSID_MULTIPLIER_##size) % VSID_MODULUS_##size))
389 422
390 x = protovsid * VSID_MULTIPLIER; 423#else /* 1 */
391 x = (x >> VSID_BITS) + (x & VSID_MODULUS); 424#define vsid_scramble(protovsid, size) \
392 return (x + ((x+1) >> VSID_BITS)) & VSID_MODULUS; 425 ({ \
426 unsigned long x; \
427 x = (protovsid) * VSID_MULTIPLIER_##size; \
428 x = (x >> VSID_BITS_##size) + (x & VSID_MODULUS_##size); \
429 (x + ((x+1) >> VSID_BITS_##size)) & VSID_MODULUS_##size; \
430 })
393#endif /* 1 */ 431#endif /* 1 */
394}
395 432
396/* This is only valid for addresses >= KERNELBASE */ 433/* This is only valid for addresses >= KERNELBASE */
397static inline unsigned long get_kernel_vsid(unsigned long ea) 434static inline unsigned long get_kernel_vsid(unsigned long ea, int ssize)
398{ 435{
399 return vsid_scramble(ea >> SID_SHIFT); 436 if (ssize == MMU_SEGSIZE_256M)
437 return vsid_scramble(ea >> SID_SHIFT, 256M);
438 return vsid_scramble(ea >> SID_SHIFT_1T, 1T);
400} 439}
401 440
402/* This is only valid for user addresses (which are below 2^41) */ 441/* Returns the segment size indicator for a user address */
403static inline unsigned long get_vsid(unsigned long context, unsigned long ea) 442static inline int user_segment_size(unsigned long addr)
404{ 443{
405 return vsid_scramble((context << USER_ESID_BITS) 444 /* Use 1T segments if possible for addresses >= 1T */
406 | (ea >> SID_SHIFT)); 445 if (addr >= (1UL << SID_SHIFT_1T))
446 return mmu_highuser_ssize;
447 return MMU_SEGSIZE_256M;
407} 448}
408 449
409#define VSID_SCRAMBLE(pvsid) (((pvsid) * VSID_MULTIPLIER) % VSID_MODULUS) 450/* This is only valid for user addresses (which are below 2^44) */
451static inline unsigned long get_vsid(unsigned long context, unsigned long ea,
452 int ssize)
453{
454 if (ssize == MMU_SEGSIZE_256M)
455 return vsid_scramble((context << USER_ESID_BITS)
456 | (ea >> SID_SHIFT), 256M);
457 return vsid_scramble((context << USER_ESID_BITS_1T)
458 | (ea >> SID_SHIFT_1T), 1T);
459}
460
461/*
462 * This is only used on legacy iSeries in lparmap.c,
463 * hence the 256MB segment assumption.
464 */
465#define VSID_SCRAMBLE(pvsid) (((pvsid) * VSID_MULTIPLIER_256M) % \
466 VSID_MODULUS_256M)
410#define KERNEL_VSID(ea) VSID_SCRAMBLE(GET_ESID(ea)) 467#define KERNEL_VSID(ea) VSID_SCRAMBLE(GET_ESID(ea))
411 468
412/* Physical address used by some IO functions */ 469/* Physical address used by some IO functions */
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h
index d44d211e7588..4c0e1b4f975c 100644
--- a/include/asm-powerpc/mmu.h
+++ b/include/asm-powerpc/mmu.h
@@ -8,6 +8,9 @@
8#elif defined(CONFIG_PPC_STD_MMU) 8#elif defined(CONFIG_PPC_STD_MMU)
9/* 32-bit classic hash table MMU */ 9/* 32-bit classic hash table MMU */
10# include <asm/mmu-hash32.h> 10# include <asm/mmu-hash32.h>
11#elif defined(CONFIG_40x)
12/* 40x-style software loaded TLB */
13# include <asm/mmu-40x.h>
11#elif defined(CONFIG_44x) 14#elif defined(CONFIG_44x)
12/* 44x-style software loaded TLB */ 15/* 44x-style software loaded TLB */
13# include <asm/mmu-44x.h> 16# include <asm/mmu-44x.h>
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index c4631f6dd4f9..24751df791ac 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -243,7 +243,7 @@ struct mpc52xx_cdm {
243 243
244extern void __iomem * mpc52xx_find_and_map(const char *); 244extern void __iomem * mpc52xx_find_and_map(const char *);
245extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node); 245extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node);
246extern void mpc52xx_setup_cpu(void); 246extern void mpc5200_setup_xlb_arbiter(void);
247extern void mpc52xx_declare_of_platform_devices(void); 247extern void mpc52xx_declare_of_platform_devices(void);
248 248
249extern void mpc52xx_init_irq(void); 249extern void mpc52xx_init_irq(void);
@@ -262,6 +262,16 @@ struct mpc52xx_suspend {
262extern struct mpc52xx_suspend mpc52xx_suspend; 262extern struct mpc52xx_suspend mpc52xx_suspend;
263extern int __init mpc52xx_pm_init(void); 263extern int __init mpc52xx_pm_init(void);
264extern int mpc52xx_set_wakeup_gpio(u8 pin, u8 level); 264extern int mpc52xx_set_wakeup_gpio(u8 pin, u8 level);
265
266#ifdef CONFIG_PPC_LITE5200
267extern int __init lite5200_pm_init(void);
268
269/* lite5200 calls mpc5200 suspend functions, so here they are */
270extern int mpc52xx_pm_prepare(suspend_state_t);
271extern int mpc52xx_pm_enter(suspend_state_t);
272extern int mpc52xx_pm_finish(suspend_state_t);
273extern char saved_sram[0x4000]; /* reuse buffer from mpc52xx suspend */
274#endif
265#endif /* CONFIG_PM */ 275#endif /* CONFIG_PM */
266 276
267#endif /* __ASM_POWERPC_MPC52xx_H__ */ 277#endif /* __ASM_POWERPC_MPC52xx_H__ */
diff --git a/include/asm-powerpc/mpc52xx_psc.h b/include/asm-powerpc/mpc52xx_psc.h
new file mode 100644
index 000000000000..26690d2b32f5
--- /dev/null
+++ b/include/asm-powerpc/mpc52xx_psc.h
@@ -0,0 +1,191 @@
1/*
2 * include/asm-ppc/mpc52xx_psc.h
3 *
4 * Definitions of consts/structs to drive the Freescale MPC52xx OnChip
5 * PSCs. Theses are shared between multiple drivers since a PSC can be
6 * UART, AC97, IR, I2S, ... So this header is in asm-ppc.
7 *
8 *
9 * Maintainer : Sylvain Munaut <tnt@246tNt.com>
10 *
11 * Based/Extracted from some header of the 2.4 originally written by
12 * Dale Farnsworth <dfarnsworth@mvista.com>
13 *
14 * Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
15 * Copyright (C) 2003 MontaVista, Software, Inc.
16 *
17 * This file is licensed under the terms of the GNU General Public License
18 * version 2. This program is licensed "as is" without any warranty of any
19 * kind, whether express or implied.
20 */
21
22#ifndef __ASM_MPC52xx_PSC_H__
23#define __ASM_MPC52xx_PSC_H__
24
25#include <asm/types.h>
26
27/* Max number of PSCs */
28#define MPC52xx_PSC_MAXNUM 6
29
30/* Programmable Serial Controller (PSC) status register bits */
31#define MPC52xx_PSC_SR_CDE 0x0080
32#define MPC52xx_PSC_SR_RXRDY 0x0100
33#define MPC52xx_PSC_SR_RXFULL 0x0200
34#define MPC52xx_PSC_SR_TXRDY 0x0400
35#define MPC52xx_PSC_SR_TXEMP 0x0800
36#define MPC52xx_PSC_SR_OE 0x1000
37#define MPC52xx_PSC_SR_PE 0x2000
38#define MPC52xx_PSC_SR_FE 0x4000
39#define MPC52xx_PSC_SR_RB 0x8000
40
41/* PSC Command values */
42#define MPC52xx_PSC_RX_ENABLE 0x0001
43#define MPC52xx_PSC_RX_DISABLE 0x0002
44#define MPC52xx_PSC_TX_ENABLE 0x0004
45#define MPC52xx_PSC_TX_DISABLE 0x0008
46#define MPC52xx_PSC_SEL_MODE_REG_1 0x0010
47#define MPC52xx_PSC_RST_RX 0x0020
48#define MPC52xx_PSC_RST_TX 0x0030
49#define MPC52xx_PSC_RST_ERR_STAT 0x0040
50#define MPC52xx_PSC_RST_BRK_CHG_INT 0x0050
51#define MPC52xx_PSC_START_BRK 0x0060
52#define MPC52xx_PSC_STOP_BRK 0x0070
53
54/* PSC TxRx FIFO status bits */
55#define MPC52xx_PSC_RXTX_FIFO_ERR 0x0040
56#define MPC52xx_PSC_RXTX_FIFO_UF 0x0020
57#define MPC52xx_PSC_RXTX_FIFO_OF 0x0010
58#define MPC52xx_PSC_RXTX_FIFO_FR 0x0008
59#define MPC52xx_PSC_RXTX_FIFO_FULL 0x0004
60#define MPC52xx_PSC_RXTX_FIFO_ALARM 0x0002
61#define MPC52xx_PSC_RXTX_FIFO_EMPTY 0x0001
62
63/* PSC interrupt mask bits */
64#define MPC52xx_PSC_IMR_TXRDY 0x0100
65#define MPC52xx_PSC_IMR_RXRDY 0x0200
66#define MPC52xx_PSC_IMR_DB 0x0400
67#define MPC52xx_PSC_IMR_IPC 0x8000
68
69/* PSC input port change bit */
70#define MPC52xx_PSC_CTS 0x01
71#define MPC52xx_PSC_DCD 0x02
72#define MPC52xx_PSC_D_CTS 0x10
73#define MPC52xx_PSC_D_DCD 0x20
74
75/* PSC mode fields */
76#define MPC52xx_PSC_MODE_5_BITS 0x00
77#define MPC52xx_PSC_MODE_6_BITS 0x01
78#define MPC52xx_PSC_MODE_7_BITS 0x02
79#define MPC52xx_PSC_MODE_8_BITS 0x03
80#define MPC52xx_PSC_MODE_BITS_MASK 0x03
81#define MPC52xx_PSC_MODE_PAREVEN 0x00
82#define MPC52xx_PSC_MODE_PARODD 0x04
83#define MPC52xx_PSC_MODE_PARFORCE 0x08
84#define MPC52xx_PSC_MODE_PARNONE 0x10
85#define MPC52xx_PSC_MODE_ERR 0x20
86#define MPC52xx_PSC_MODE_FFULL 0x40
87#define MPC52xx_PSC_MODE_RXRTS 0x80
88
89#define MPC52xx_PSC_MODE_ONE_STOP_5_BITS 0x00
90#define MPC52xx_PSC_MODE_ONE_STOP 0x07
91#define MPC52xx_PSC_MODE_TWO_STOP 0x0f
92
93#define MPC52xx_PSC_RFNUM_MASK 0x01ff
94
95
96/* Structure of the hardware registers */
97struct mpc52xx_psc {
98 u8 mode; /* PSC + 0x00 */
99 u8 reserved0[3];
100 union { /* PSC + 0x04 */
101 u16 status;
102 u16 clock_select;
103 } sr_csr;
104#define mpc52xx_psc_status sr_csr.status
105#define mpc52xx_psc_clock_select sr_csr.clock_select
106 u16 reserved1;
107 u8 command; /* PSC + 0x08 */
108 u8 reserved2[3];
109 union { /* PSC + 0x0c */
110 u8 buffer_8;
111 u16 buffer_16;
112 u32 buffer_32;
113 } buffer;
114#define mpc52xx_psc_buffer_8 buffer.buffer_8
115#define mpc52xx_psc_buffer_16 buffer.buffer_16
116#define mpc52xx_psc_buffer_32 buffer.buffer_32
117 union { /* PSC + 0x10 */
118 u8 ipcr;
119 u8 acr;
120 } ipcr_acr;
121#define mpc52xx_psc_ipcr ipcr_acr.ipcr
122#define mpc52xx_psc_acr ipcr_acr.acr
123 u8 reserved3[3];
124 union { /* PSC + 0x14 */
125 u16 isr;
126 u16 imr;
127 } isr_imr;
128#define mpc52xx_psc_isr isr_imr.isr
129#define mpc52xx_psc_imr isr_imr.imr
130 u16 reserved4;
131 u8 ctur; /* PSC + 0x18 */
132 u8 reserved5[3];
133 u8 ctlr; /* PSC + 0x1c */
134 u8 reserved6[3];
135 u16 ccr; /* PSC + 0x20 */
136 u8 reserved7[14];
137 u8 ivr; /* PSC + 0x30 */
138 u8 reserved8[3];
139 u8 ip; /* PSC + 0x34 */
140 u8 reserved9[3];
141 u8 op1; /* PSC + 0x38 */
142 u8 reserved10[3];
143 u8 op0; /* PSC + 0x3c */
144 u8 reserved11[3];
145 u32 sicr; /* PSC + 0x40 */
146 u8 ircr1; /* PSC + 0x44 */
147 u8 reserved13[3];
148 u8 ircr2; /* PSC + 0x44 */
149 u8 reserved14[3];
150 u8 irsdr; /* PSC + 0x4c */
151 u8 reserved15[3];
152 u8 irmdr; /* PSC + 0x50 */
153 u8 reserved16[3];
154 u8 irfdr; /* PSC + 0x54 */
155 u8 reserved17[3];
156 u16 rfnum; /* PSC + 0x58 */
157 u16 reserved18;
158 u16 tfnum; /* PSC + 0x5c */
159 u16 reserved19;
160 u32 rfdata; /* PSC + 0x60 */
161 u16 rfstat; /* PSC + 0x64 */
162 u16 reserved20;
163 u8 rfcntl; /* PSC + 0x68 */
164 u8 reserved21[5];
165 u16 rfalarm; /* PSC + 0x6e */
166 u16 reserved22;
167 u16 rfrptr; /* PSC + 0x72 */
168 u16 reserved23;
169 u16 rfwptr; /* PSC + 0x76 */
170 u16 reserved24;
171 u16 rflrfptr; /* PSC + 0x7a */
172 u16 reserved25;
173 u16 rflwfptr; /* PSC + 0x7e */
174 u32 tfdata; /* PSC + 0x80 */
175 u16 tfstat; /* PSC + 0x84 */
176 u16 reserved26;
177 u8 tfcntl; /* PSC + 0x88 */
178 u8 reserved27[5];
179 u16 tfalarm; /* PSC + 0x8e */
180 u16 reserved28;
181 u16 tfrptr; /* PSC + 0x92 */
182 u16 reserved29;
183 u16 tfwptr; /* PSC + 0x96 */
184 u16 reserved30;
185 u16 tflrfptr; /* PSC + 0x9a */
186 u16 reserved31;
187 u16 tflwfptr; /* PSC + 0x9e */
188};
189
190
191#endif /* __ASM_MPC52xx_PSC_H__ */
diff --git a/include/asm-powerpc/mpc85xx.h b/include/asm-powerpc/mpc85xx.h
deleted file mode 100644
index 54142997a584..000000000000
--- a/include/asm-powerpc/mpc85xx.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * include/asm-powerpc/mpc85xx.h
3 *
4 * MPC85xx 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#ifdef __KERNEL__
17#ifndef __ASM_MPC85xx_H__
18#define __ASM_MPC85xx_H__
19
20#include <asm/mmu.h>
21
22#ifdef CONFIG_85xx
23
24#if defined(CONFIG_MPC8540_ADS) || defined(CONFIG_MPC8560_ADS)
25#include <platforms/85xx/mpc85xx_ads.h>
26#endif
27#if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
28#include <platforms/85xx/mpc8555_cds.h>
29#endif
30#ifdef CONFIG_MPC85xx_CDS
31#include <platforms/85xx/mpc85xx_cds.h>
32#endif
33
34/* Let modules/drivers get at CCSRBAR */
35extern phys_addr_t get_ccsrbar(void);
36
37#ifdef MODULE
38#define CCSRBAR get_ccsrbar()
39#else
40#define CCSRBAR BOARD_CCSRBAR
41#endif
42
43#endif /* CONFIG_85xx */
44#endif /* __ASM_MPC85xx_H__ */
45#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h
index 262db6b8da73..ae84dde3bc7f 100644
--- a/include/asm-powerpc/mpic.h
+++ b/include/asm-powerpc/mpic.h
@@ -224,8 +224,6 @@ struct mpic_reg_bank {
224 u32 __iomem *base; 224 u32 __iomem *base;
225#ifdef CONFIG_PPC_DCR 225#ifdef CONFIG_PPC_DCR
226 dcr_host_t dhost; 226 dcr_host_t dhost;
227 unsigned int dbase;
228 unsigned int doff;
229#endif /* CONFIG_PPC_DCR */ 227#endif /* CONFIG_PPC_DCR */
230}; 228};
231 229
@@ -240,9 +238,6 @@ struct mpic_irq_save {
240/* The instance data of a given MPIC */ 238/* The instance data of a given MPIC */
241struct mpic 239struct mpic
242{ 240{
243 /* The device node of the interrupt controller */
244 struct device_node *of_node;
245
246 /* The remapper for this MPIC */ 241 /* The remapper for this MPIC */
247 struct irq_host *irqhost; 242 struct irq_host *irqhost;
248 243
@@ -292,10 +287,6 @@ struct mpic
292 struct mpic_reg_bank cpuregs[MPIC_MAX_CPUS]; 287 struct mpic_reg_bank cpuregs[MPIC_MAX_CPUS];
293 struct mpic_reg_bank isus[MPIC_MAX_ISU]; 288 struct mpic_reg_bank isus[MPIC_MAX_ISU];
294 289
295#ifdef CONFIG_PPC_DCR
296 unsigned int dcr_base;
297#endif
298
299 /* Protected sources */ 290 /* Protected sources */
300 unsigned long *protected; 291 unsigned long *protected;
301 292
@@ -309,6 +300,10 @@ struct mpic
309 unsigned long *hwirq_bitmap; 300 unsigned long *hwirq_bitmap;
310#endif 301#endif
311 302
303#ifdef CONFIG_MPIC_BROKEN_REGREAD
304 u32 isu_reg0_shadow[MPIC_MAX_IRQ_SOURCES];
305#endif
306
312 /* link */ 307 /* link */
313 struct mpic *next; 308 struct mpic *next;
314 309
diff --git a/include/asm-powerpc/nvram.h b/include/asm-powerpc/nvram.h
index f3563e11e260..9877982508bf 100644
--- a/include/asm-powerpc/nvram.h
+++ b/include/asm-powerpc/nvram.h
@@ -63,8 +63,10 @@ struct nvram_partition {
63}; 63};
64 64
65 65
66extern int nvram_write_error_log(char * buff, int length, unsigned int err_type); 66extern int nvram_write_error_log(char * buff, int length,
67extern int nvram_read_error_log(char * buff, int length, unsigned int * err_type); 67 unsigned int err_type, unsigned int err_seq);
68extern int nvram_read_error_log(char * buff, int length,
69 unsigned int * err_type, unsigned int *err_seq);
68extern int nvram_clear_error_log(void); 70extern int nvram_clear_error_log(void);
69extern struct nvram_partition *nvram_find_partition(int sig, const char *name); 71extern struct nvram_partition *nvram_find_partition(int sig, const char *name);
70 72
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index c6a5b1735666..fcd7b428ed0b 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -21,7 +21,18 @@
21#include <asm/mmu.h> 21#include <asm/mmu.h>
22 22
23register struct paca_struct *local_paca asm("r13"); 23register struct paca_struct *local_paca asm("r13");
24
25#if defined(CONFIG_DEBUG_PREEMPT) && defined(CONFIG_SMP)
26extern unsigned int debug_smp_processor_id(void); /* from linux/smp.h */
27/*
28 * Add standard checks that preemption cannot occur when using get_paca():
29 * otherwise the paca_struct it points to may be the wrong one just after.
30 */
31#define get_paca() ((void) debug_smp_processor_id(), local_paca)
32#else
24#define get_paca() local_paca 33#define get_paca() local_paca
34#endif
35
25#define get_lppaca() (get_paca()->lppaca_ptr) 36#define get_lppaca() (get_paca()->lppaca_ptr)
26#define get_slb_shadow() (get_paca()->slb_shadow_ptr) 37#define get_slb_shadow() (get_paca()->slb_shadow_ptr)
27 38
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h
index 3448a3d4bc64..4ee82c61e4d7 100644
--- a/include/asm-powerpc/page_64.h
+++ b/include/asm-powerpc/page_64.h
@@ -26,12 +26,18 @@
26 */ 26 */
27#define PAGE_FACTOR (PAGE_SHIFT - HW_PAGE_SHIFT) 27#define PAGE_FACTOR (PAGE_SHIFT - HW_PAGE_SHIFT)
28 28
29/* Segment size */ 29/* Segment size; normal 256M segments */
30#define SID_SHIFT 28 30#define SID_SHIFT 28
31#define SID_MASK 0xfffffffffUL 31#define SID_MASK ASM_CONST(0xfffffffff)
32#define ESID_MASK 0xfffffffff0000000UL 32#define ESID_MASK 0xfffffffff0000000UL
33#define GET_ESID(x) (((x) >> SID_SHIFT) & SID_MASK) 33#define GET_ESID(x) (((x) >> SID_SHIFT) & SID_MASK)
34 34
35/* 1T segments */
36#define SID_SHIFT_1T 40
37#define SID_MASK_1T 0xffffffUL
38#define ESID_MASK_1T 0xffffff0000000000UL
39#define GET_ESID_1T(x) (((x) >> SID_SHIFT_1T) & SID_MASK_1T)
40
35#ifndef __ASSEMBLY__ 41#ifndef __ASSEMBLY__
36#include <asm/cache.h> 42#include <asm/cache.h>
37 43
@@ -121,6 +127,7 @@ extern unsigned int get_slice_psize(struct mm_struct *mm,
121 127
122extern void slice_init_context(struct mm_struct *mm, unsigned int psize); 128extern void slice_init_context(struct mm_struct *mm, unsigned int psize);
123extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize); 129extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize);
130#define slice_mm_new_context(mm) ((mm)->context.id == 0)
124 131
125#define ARCH_HAS_HUGEPAGE_ONLY_RANGE 132#define ARCH_HAS_HUGEPAGE_ONLY_RANGE
126extern int is_hugepage_only_range(struct mm_struct *m, 133extern int is_hugepage_only_range(struct mm_struct *m,
@@ -130,6 +137,12 @@ extern int is_hugepage_only_range(struct mm_struct *m,
130#endif /* __ASSEMBLY__ */ 137#endif /* __ASSEMBLY__ */
131#else 138#else
132#define slice_init() 139#define slice_init()
140#define slice_set_user_psize(mm, psize) \
141do { \
142 (mm)->context.user_psize = (psize); \
143 (mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \
144} while (0)
145#define slice_mm_new_context(mm) 1
133#endif /* CONFIG_PPC_MM_SLICES */ 146#endif /* CONFIG_PPC_MM_SLICES */
134 147
135#ifdef CONFIG_HUGETLB_PAGE 148#ifdef CONFIG_HUGETLB_PAGE
diff --git a/include/asm-powerpc/pci-bridge.h b/include/asm-powerpc/pci-bridge.h
index e909769b6410..dc318458b5fe 100644
--- a/include/asm-powerpc/pci-bridge.h
+++ b/include/asm-powerpc/pci-bridge.h
@@ -98,7 +98,8 @@ extern int early_find_capability(struct pci_controller *hose, int bus,
98 int dev_fn, int cap); 98 int dev_fn, int cap);
99 99
100extern void setup_indirect_pci(struct pci_controller* hose, 100extern void setup_indirect_pci(struct pci_controller* hose,
101 u32 cfg_addr, u32 cfg_data, u32 flags); 101 resource_size_t cfg_addr,
102 resource_size_t cfg_data, u32 flags);
102extern void setup_grackle(struct pci_controller *hose); 103extern void setup_grackle(struct pci_controller *hose);
103extern void __init update_bridge_resource(struct pci_dev *dev, 104extern void __init update_bridge_resource(struct pci_dev *dev,
104 struct resource *res); 105 struct resource *res);
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h
index 73dc8ba4010d..6b229626d3ff 100644
--- a/include/asm-powerpc/percpu.h
+++ b/include/asm-powerpc/percpu.h
@@ -28,7 +28,7 @@
28/* var is in discarded region: offset to particular copy we want */ 28/* var is in discarded region: offset to particular copy we want */
29#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) 29#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
30#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) 30#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset()))
31#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __my_cpu_offset())) 31#define __raw_get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, local_paca->data_offset))
32 32
33/* A macro to avoid #include hell... */ 33/* A macro to avoid #include hell... */
34#define percpu_modcopy(pcpudst, src, size) \ 34#define percpu_modcopy(pcpudst, src, size) \
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h
index add5481fd7c7..818e2abc81e2 100644
--- a/include/asm-powerpc/pgtable-4k.h
+++ b/include/asm-powerpc/pgtable-4k.h
@@ -10,10 +10,12 @@
10#define PUD_INDEX_SIZE 7 10#define PUD_INDEX_SIZE 7
11#define PGD_INDEX_SIZE 9 11#define PGD_INDEX_SIZE 9
12 12
13#ifndef __ASSEMBLY__
13#define PTE_TABLE_SIZE (sizeof(pte_t) << PTE_INDEX_SIZE) 14#define PTE_TABLE_SIZE (sizeof(pte_t) << PTE_INDEX_SIZE)
14#define PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE) 15#define PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE)
15#define PUD_TABLE_SIZE (sizeof(pud_t) << PUD_INDEX_SIZE) 16#define PUD_TABLE_SIZE (sizeof(pud_t) << PUD_INDEX_SIZE)
16#define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE) 17#define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE)
18#endif /* __ASSEMBLY__ */
17 19
18#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE) 20#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE)
19#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE) 21#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
diff --git a/include/asm-powerpc/pgtable-64k.h b/include/asm-powerpc/pgtable-64k.h
index 33ae9018fe72..bd54b772fbc6 100644
--- a/include/asm-powerpc/pgtable-64k.h
+++ b/include/asm-powerpc/pgtable-64k.h
@@ -9,9 +9,11 @@
9#define PUD_INDEX_SIZE 0 9#define PUD_INDEX_SIZE 0
10#define PGD_INDEX_SIZE 4 10#define PGD_INDEX_SIZE 4
11 11
12#ifndef __ASSEMBLY__
12#define PTE_TABLE_SIZE (sizeof(real_pte_t) << PTE_INDEX_SIZE) 13#define PTE_TABLE_SIZE (sizeof(real_pte_t) << PTE_INDEX_SIZE)
13#define PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE) 14#define PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE)
14#define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE) 15#define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE)
16#endif /* __ASSEMBLY__ */
15 17
16#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE) 18#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE)
17#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE) 19#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index 65325721446d..2dbd4e7884fa 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -155,6 +155,20 @@ name: \
155 .type GLUE(.,name),@function; \ 155 .type GLUE(.,name),@function; \
156GLUE(.,name): 156GLUE(.,name):
157 157
158#define _INIT_GLOBAL(name) \
159 .section ".text.init.refok"; \
160 .align 2 ; \
161 .globl name; \
162 .globl GLUE(.,name); \
163 .section ".opd","aw"; \
164name: \
165 .quad GLUE(.,name); \
166 .quad .TOC.@tocbase; \
167 .quad 0; \
168 .previous; \
169 .type GLUE(.,name),@function; \
170GLUE(.,name):
171
158#define _KPROBE(name) \ 172#define _KPROBE(name) \
159 .section ".kprobes.text","a"; \ 173 .section ".kprobes.text","a"; \
160 .align 2 ; \ 174 .align 2 ; \
@@ -195,6 +209,10 @@ GLUE(.,name):
195 209
196#else /* 32-bit */ 210#else /* 32-bit */
197 211
212#define _ENTRY(n) \
213 .globl n; \
214n:
215
198#define _GLOBAL(n) \ 216#define _GLOBAL(n) \
199 .text; \ 217 .text; \
200 .stabs __stringify(n:F-1),N_FUN,0,0,n;\ 218 .stabs __stringify(n:F-1),N_FUN,0,0,n;\
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index e28b10805159..dba7c948189d 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -145,9 +145,9 @@ struct thread_struct {
145 unsigned long dabr; /* Data address breakpoint register */ 145 unsigned long dabr; /* Data address breakpoint register */
146#ifdef CONFIG_ALTIVEC 146#ifdef CONFIG_ALTIVEC
147 /* Complete AltiVec register set */ 147 /* Complete AltiVec register set */
148 vector128 vr[32] __attribute((aligned(16))); 148 vector128 vr[32] __attribute__((aligned(16)));
149 /* AltiVec status */ 149 /* AltiVec status */
150 vector128 vscr __attribute((aligned(16))); 150 vector128 vscr __attribute__((aligned(16)));
151 unsigned long vrsave; 151 unsigned long vrsave;
152 int used_vr; /* set if process has used altivec */ 152 int used_vr; /* set if process has used altivec */
153#endif /* CONFIG_ALTIVEC */ 153#endif /* CONFIG_ALTIVEC */
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 672083787a1d..925e2d384bb3 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -24,7 +24,7 @@
24#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 24#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
25#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 25#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1
26 26
27#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l)) 27#define of_compat_cmp(s1, s2, l) strcasecmp((s1), (s2))
28#define of_prop_cmp(s1, s2) strcmp((s1), (s2)) 28#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
29#define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) 29#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))
30 30
@@ -145,7 +145,6 @@ extern void of_detach_node(struct device_node *);
145extern void finish_device_tree(void); 145extern void finish_device_tree(void);
146extern void unflatten_device_tree(void); 146extern void unflatten_device_tree(void);
147extern void early_init_devtree(void *); 147extern void early_init_devtree(void *);
148#define device_is_compatible(d, c) of_device_is_compatible((d), (c))
149extern int machine_is_compatible(const char *compat); 148extern int machine_is_compatible(const char *compat);
150extern void print_properties(struct device_node *node); 149extern void print_properties(struct device_node *node);
151extern int prom_n_intr_cells(struct device_node* np); 150extern int prom_n_intr_cells(struct device_node* np);
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index a6f3f5ee7ca7..f577a16c6728 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -229,6 +229,9 @@ enum lv1_result {
229 LV1_INVALID_CLASS_ID = -21, 229 LV1_INVALID_CLASS_ID = -21,
230 LV1_CONSTRAINT_NOT_SATISFIED = -22, 230 LV1_CONSTRAINT_NOT_SATISFIED = -22,
231 LV1_ALIGNMENT_ERROR = -23, 231 LV1_ALIGNMENT_ERROR = -23,
232 LV1_HARDWARE_ERROR = -24,
233 LV1_INVALID_DATA_FORMAT = -25,
234 LV1_INVALID_OPERATION = -26,
232 LV1_INTERNAL_ERROR = -32768, 235 LV1_INTERNAL_ERROR = -32768,
233}; 236};
234 237
@@ -284,6 +287,12 @@ static inline const char* ps3_result(int result)
284 return "LV1_CONSTRAINT_NOT_SATISFIED (-22)"; 287 return "LV1_CONSTRAINT_NOT_SATISFIED (-22)";
285 case LV1_ALIGNMENT_ERROR: 288 case LV1_ALIGNMENT_ERROR:
286 return "LV1_ALIGNMENT_ERROR (-23)"; 289 return "LV1_ALIGNMENT_ERROR (-23)";
290 case LV1_HARDWARE_ERROR:
291 return "LV1_HARDWARE_ERROR (-24)";
292 case LV1_INVALID_DATA_FORMAT:
293 return "LV1_INVALID_DATA_FORMAT (-25)";
294 case LV1_INVALID_OPERATION:
295 return "LV1_INVALID_OPERATION (-26)";
287 case LV1_INTERNAL_ERROR: 296 case LV1_INTERNAL_ERROR:
288 return "LV1_INTERNAL_ERROR (-32768)"; 297 return "LV1_INTERNAL_ERROR (-32768)";
289 default: 298 default:
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index 9d304b1f1608..0dabe46a29d2 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -32,10 +32,13 @@
32extern void qe_reset(void); 32extern void qe_reset(void);
33extern int par_io_init(struct device_node *np); 33extern int par_io_init(struct device_node *np);
34extern int par_io_of_config(struct device_node *np); 34extern int par_io_of_config(struct device_node *np);
35extern int par_io_config_pin(u8 port, u8 pin, int dir, int open_drain,
36 int assignment, int has_irq);
37extern int par_io_data_set(u8 port, u8 pin, u8 val);
35 38
36/* QE internal API */ 39/* QE internal API */
37int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input); 40int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
38void qe_setbrg(u32 brg, u32 rate); 41void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier);
39int qe_get_snum(void); 42int qe_get_snum(void);
40void qe_put_snum(u8 snum); 43void qe_put_snum(u8 snum);
41unsigned long qe_muram_alloc(int size, int align); 44unsigned long qe_muram_alloc(int size, int align);
@@ -46,14 +49,28 @@ void *qe_muram_addr(unsigned long offset);
46 49
47/* Buffer descriptors */ 50/* Buffer descriptors */
48struct qe_bd { 51struct qe_bd {
49 u16 status; 52 __be16 status;
50 u16 length; 53 __be16 length;
51 u32 buf; 54 __be32 buf;
52} __attribute__ ((packed)); 55} __attribute__ ((packed));
53 56
54#define BD_STATUS_MASK 0xffff0000 57#define BD_STATUS_MASK 0xffff0000
55#define BD_LENGTH_MASK 0x0000ffff 58#define BD_LENGTH_MASK 0x0000ffff
56 59
60#define BD_SC_EMPTY 0x8000 /* Receive is empty */
61#define BD_SC_READY 0x8000 /* Transmit is ready */
62#define BD_SC_WRAP 0x2000 /* Last buffer descriptor */
63#define BD_SC_INTRPT 0x1000 /* Interrupt on change */
64#define BD_SC_LAST 0x0800 /* Last buffer in frame */
65#define BD_SC_CM 0x0200 /* Continous mode */
66#define BD_SC_ID 0x0100 /* Rec'd too many idles */
67#define BD_SC_P 0x0100 /* xmt preamble */
68#define BD_SC_BR 0x0020 /* Break received */
69#define BD_SC_FR 0x0010 /* Framing error */
70#define BD_SC_PR 0x0008 /* Parity error */
71#define BD_SC_OV 0x0002 /* Overrun */
72#define BD_SC_CD 0x0001 /* ?? */
73
57/* Alignment */ 74/* Alignment */
58#define QE_INTR_TABLE_ALIGN 16 /* ??? */ 75#define QE_INTR_TABLE_ALIGN 16 /* ??? */
59#define QE_ALIGNMENT_OF_BD 8 76#define QE_ALIGNMENT_OF_BD 8
@@ -266,15 +283,12 @@ enum qe_clock {
266/* QE CECR Protocol - For non-MCC, specifies mode for QE CECR command */ 283/* QE CECR Protocol - For non-MCC, specifies mode for QE CECR command */
267#define QE_CR_PROTOCOL_UNSPECIFIED 0x00 /* For all other protocols */ 284#define QE_CR_PROTOCOL_UNSPECIFIED 0x00 /* For all other protocols */
268#define QE_CR_PROTOCOL_HDLC_TRANSPARENT 0x00 285#define QE_CR_PROTOCOL_HDLC_TRANSPARENT 0x00
286#define QE_CR_PROTOCOL_QMC 0x02
287#define QE_CR_PROTOCOL_UART 0x04
269#define QE_CR_PROTOCOL_ATM_POS 0x0A 288#define QE_CR_PROTOCOL_ATM_POS 0x0A
270#define QE_CR_PROTOCOL_ETHERNET 0x0C 289#define QE_CR_PROTOCOL_ETHERNET 0x0C
271#define QE_CR_PROTOCOL_L2_SWITCH 0x0D 290#define QE_CR_PROTOCOL_L2_SWITCH 0x0D
272 291
273/* BMR byte order */
274#define QE_BMR_BYTE_ORDER_BO_PPC 0x08 /* powerpc little endian */
275#define QE_BMR_BYTE_ORDER_BO_MOT 0x10 /* motorola big endian */
276#define QE_BMR_BYTE_ORDER_BO_MAX 0x18
277
278/* BRG configuration register */ 292/* BRG configuration register */
279#define QE_BRGC_ENABLE 0x00010000 293#define QE_BRGC_ENABLE 0x00010000
280#define QE_BRGC_DIVISOR_SHIFT 1 294#define QE_BRGC_DIVISOR_SHIFT 1
@@ -321,41 +335,41 @@ enum qe_clock {
321#define UPGCR_ADDR 0x10000000 /* Master MPHY Addr multiplexing */ 335#define UPGCR_ADDR 0x10000000 /* Master MPHY Addr multiplexing */
322#define UPGCR_DIAG 0x01000000 /* Diagnostic mode */ 336#define UPGCR_DIAG 0x01000000 /* Diagnostic mode */
323 337
324/* UCC */ 338/* UCC GUEMR register */
325#define UCC_GUEMR_MODE_MASK_RX 0x02 339#define UCC_GUEMR_MODE_MASK_RX 0x02
326#define UCC_GUEMR_MODE_MASK_TX 0x01
327#define UCC_GUEMR_MODE_FAST_RX 0x02 340#define UCC_GUEMR_MODE_FAST_RX 0x02
328#define UCC_GUEMR_MODE_FAST_TX 0x01
329#define UCC_GUEMR_MODE_SLOW_RX 0x00 341#define UCC_GUEMR_MODE_SLOW_RX 0x00
342#define UCC_GUEMR_MODE_MASK_TX 0x01
343#define UCC_GUEMR_MODE_FAST_TX 0x01
330#define UCC_GUEMR_MODE_SLOW_TX 0x00 344#define UCC_GUEMR_MODE_SLOW_TX 0x00
345#define UCC_GUEMR_MODE_MASK (UCC_GUEMR_MODE_MASK_RX | UCC_GUEMR_MODE_MASK_TX)
331#define UCC_GUEMR_SET_RESERVED3 0x10 /* Bit 3 in the guemr is reserved but 346#define UCC_GUEMR_SET_RESERVED3 0x10 /* Bit 3 in the guemr is reserved but
332 must be set 1 */ 347 must be set 1 */
333 348
334/* structure representing UCC SLOW parameter RAM */ 349/* structure representing UCC SLOW parameter RAM */
335struct ucc_slow_pram { 350struct ucc_slow_pram {
336 u16 rbase; /* RX BD base address */ 351 __be16 rbase; /* RX BD base address */
337 u16 tbase; /* TX BD base address */ 352 __be16 tbase; /* TX BD base address */
338 u8 rfcr; /* Rx function code */ 353 u8 rbmr; /* RX bus mode register (same as CPM's RFCR) */
339 u8 tfcr; /* Tx function code */ 354 u8 tbmr; /* TX bus mode register (same as CPM's TFCR) */
340 u16 mrblr; /* Rx buffer length */ 355 __be16 mrblr; /* Rx buffer length */
341 u32 rstate; /* Rx internal state */ 356 __be32 rstate; /* Rx internal state */
342 u32 rptr; /* Rx internal data pointer */ 357 __be32 rptr; /* Rx internal data pointer */
343 u16 rbptr; /* rb BD Pointer */ 358 __be16 rbptr; /* rb BD Pointer */
344 u16 rcount; /* Rx internal byte count */ 359 __be16 rcount; /* Rx internal byte count */
345 u32 rtemp; /* Rx temp */ 360 __be32 rtemp; /* Rx temp */
346 u32 tstate; /* Tx internal state */ 361 __be32 tstate; /* Tx internal state */
347 u32 tptr; /* Tx internal data pointer */ 362 __be32 tptr; /* Tx internal data pointer */
348 u16 tbptr; /* Tx BD pointer */ 363 __be16 tbptr; /* Tx BD pointer */
349 u16 tcount; /* Tx byte count */ 364 __be16 tcount; /* Tx byte count */
350 u32 ttemp; /* Tx temp */ 365 __be32 ttemp; /* Tx temp */
351 u32 rcrc; /* temp receive CRC */ 366 __be32 rcrc; /* temp receive CRC */
352 u32 tcrc; /* temp transmit CRC */ 367 __be32 tcrc; /* temp transmit CRC */
353} __attribute__ ((packed)); 368} __attribute__ ((packed));
354 369
355/* General UCC SLOW Mode Register (GUMRH & GUMRL) */ 370/* General UCC SLOW Mode Register (GUMRH & GUMRL) */
356#define UCC_SLOW_GUMR_H_CRC16 0x00004000 371#define UCC_SLOW_GUMR_H_SAM_QMC 0x00000000
357#define UCC_SLOW_GUMR_H_CRC16CCITT 0x00000000 372#define UCC_SLOW_GUMR_H_SAM_SATM 0x00008000
358#define UCC_SLOW_GUMR_H_CRC32CCITT 0x00008000
359#define UCC_SLOW_GUMR_H_REVD 0x00002000 373#define UCC_SLOW_GUMR_H_REVD 0x00002000
360#define UCC_SLOW_GUMR_H_TRX 0x00001000 374#define UCC_SLOW_GUMR_H_TRX 0x00001000
361#define UCC_SLOW_GUMR_H_TTX 0x00000800 375#define UCC_SLOW_GUMR_H_TTX 0x00000800
@@ -375,9 +389,33 @@ struct ucc_slow_pram {
375#define UCC_SLOW_GUMR_L_TCI 0x10000000 389#define UCC_SLOW_GUMR_L_TCI 0x10000000
376#define UCC_SLOW_GUMR_L_RINV 0x02000000 390#define UCC_SLOW_GUMR_L_RINV 0x02000000
377#define UCC_SLOW_GUMR_L_TINV 0x01000000 391#define UCC_SLOW_GUMR_L_TINV 0x01000000
378#define UCC_SLOW_GUMR_L_TEND 0x00020000 392#define UCC_SLOW_GUMR_L_TEND 0x00040000
393#define UCC_SLOW_GUMR_L_TDCR_MASK 0x00030000
394#define UCC_SLOW_GUMR_L_TDCR_32 0x00030000
395#define UCC_SLOW_GUMR_L_TDCR_16 0x00020000
396#define UCC_SLOW_GUMR_L_TDCR_8 0x00010000
397#define UCC_SLOW_GUMR_L_TDCR_1 0x00000000
398#define UCC_SLOW_GUMR_L_RDCR_MASK 0x0000c000
399#define UCC_SLOW_GUMR_L_RDCR_32 0x0000c000
400#define UCC_SLOW_GUMR_L_RDCR_16 0x00008000
401#define UCC_SLOW_GUMR_L_RDCR_8 0x00004000
402#define UCC_SLOW_GUMR_L_RDCR_1 0x00000000
403#define UCC_SLOW_GUMR_L_RENC_NRZI 0x00000800
404#define UCC_SLOW_GUMR_L_RENC_NRZ 0x00000000
405#define UCC_SLOW_GUMR_L_TENC_NRZI 0x00000100
406#define UCC_SLOW_GUMR_L_TENC_NRZ 0x00000000
407#define UCC_SLOW_GUMR_L_DIAG_MASK 0x000000c0
408#define UCC_SLOW_GUMR_L_DIAG_LE 0x000000c0
409#define UCC_SLOW_GUMR_L_DIAG_ECHO 0x00000080
410#define UCC_SLOW_GUMR_L_DIAG_LOOP 0x00000040
411#define UCC_SLOW_GUMR_L_DIAG_NORM 0x00000000
379#define UCC_SLOW_GUMR_L_ENR 0x00000020 412#define UCC_SLOW_GUMR_L_ENR 0x00000020
380#define UCC_SLOW_GUMR_L_ENT 0x00000010 413#define UCC_SLOW_GUMR_L_ENT 0x00000010
414#define UCC_SLOW_GUMR_L_MODE_MASK 0x0000000F
415#define UCC_SLOW_GUMR_L_MODE_BISYNC 0x00000008
416#define UCC_SLOW_GUMR_L_MODE_AHDLC 0x00000006
417#define UCC_SLOW_GUMR_L_MODE_UART 0x00000004
418#define UCC_SLOW_GUMR_L_MODE_QMC 0x00000002
381 419
382/* General UCC FAST Mode Register */ 420/* General UCC FAST Mode Register */
383#define UCC_FAST_GUMR_TCI 0x20000000 421#define UCC_FAST_GUMR_TCI 0x20000000
@@ -394,53 +432,111 @@ struct ucc_slow_pram {
394#define UCC_FAST_GUMR_ENR 0x00000020 432#define UCC_FAST_GUMR_ENR 0x00000020
395#define UCC_FAST_GUMR_ENT 0x00000010 433#define UCC_FAST_GUMR_ENT 0x00000010
396 434
397/* Slow UCC Event Register (UCCE) */ 435/* UART Slow UCC Event Register (UCCE) */
398#define UCC_SLOW_UCCE_GLR 0x1000 436#define UCC_UART_UCCE_AB 0x0200
399#define UCC_SLOW_UCCE_GLT 0x0800 437#define UCC_UART_UCCE_IDLE 0x0100
400#define UCC_SLOW_UCCE_DCC 0x0400 438#define UCC_UART_UCCE_GRA 0x0080
401#define UCC_SLOW_UCCE_FLG 0x0200 439#define UCC_UART_UCCE_BRKE 0x0040
402#define UCC_SLOW_UCCE_AB 0x0200 440#define UCC_UART_UCCE_BRKS 0x0020
403#define UCC_SLOW_UCCE_IDLE 0x0100 441#define UCC_UART_UCCE_CCR 0x0008
404#define UCC_SLOW_UCCE_GRA 0x0080 442#define UCC_UART_UCCE_BSY 0x0004
405#define UCC_SLOW_UCCE_TXE 0x0010 443#define UCC_UART_UCCE_TX 0x0002
406#define UCC_SLOW_UCCE_RXF 0x0008 444#define UCC_UART_UCCE_RX 0x0001
407#define UCC_SLOW_UCCE_CCR 0x0008 445
408#define UCC_SLOW_UCCE_RCH 0x0008 446/* HDLC Slow UCC Event Register (UCCE) */
409#define UCC_SLOW_UCCE_BSY 0x0004 447#define UCC_HDLC_UCCE_GLR 0x1000
410#define UCC_SLOW_UCCE_TXB 0x0002 448#define UCC_HDLC_UCCE_GLT 0x0800
411#define UCC_SLOW_UCCE_TX 0x0002 449#define UCC_HDLC_UCCE_IDLE 0x0100
412#define UCC_SLOW_UCCE_RX 0x0001 450#define UCC_HDLC_UCCE_BRKE 0x0040
413#define UCC_SLOW_UCCE_GOV 0x0001 451#define UCC_HDLC_UCCE_BRKS 0x0020
414#define UCC_SLOW_UCCE_GUN 0x0002 452#define UCC_HDLC_UCCE_TXE 0x0010
415#define UCC_SLOW_UCCE_GINT 0x0004 453#define UCC_HDLC_UCCE_RXF 0x0008
416#define UCC_SLOW_UCCE_IQOV 0x0008 454#define UCC_HDLC_UCCE_BSY 0x0004
417 455#define UCC_HDLC_UCCE_TXB 0x0002
418#define UCC_SLOW_UCCE_HDLC_SET (UCC_SLOW_UCCE_TXE | UCC_SLOW_UCCE_BSY | \ 456#define UCC_HDLC_UCCE_RXB 0x0001
419 UCC_SLOW_UCCE_GRA | UCC_SLOW_UCCE_TXB | UCC_SLOW_UCCE_RXF | \ 457
420 UCC_SLOW_UCCE_DCC | UCC_SLOW_UCCE_GLT | UCC_SLOW_UCCE_GLR) 458/* BISYNC Slow UCC Event Register (UCCE) */
421#define UCC_SLOW_UCCE_ENET_SET (UCC_SLOW_UCCE_TXE | UCC_SLOW_UCCE_BSY | \ 459#define UCC_BISYNC_UCCE_GRA 0x0080
422 UCC_SLOW_UCCE_GRA | UCC_SLOW_UCCE_TXB | UCC_SLOW_UCCE_RXF) 460#define UCC_BISYNC_UCCE_TXE 0x0010
423#define UCC_SLOW_UCCE_TRANS_SET (UCC_SLOW_UCCE_TXE | UCC_SLOW_UCCE_BSY | \ 461#define UCC_BISYNC_UCCE_RCH 0x0008
424 UCC_SLOW_UCCE_GRA | UCC_SLOW_UCCE_TX | UCC_SLOW_UCCE_RX | \ 462#define UCC_BISYNC_UCCE_BSY 0x0004
425 UCC_SLOW_UCCE_DCC | UCC_SLOW_UCCE_GLT | UCC_SLOW_UCCE_GLR) 463#define UCC_BISYNC_UCCE_TXB 0x0002
426#define UCC_SLOW_UCCE_UART_SET (UCC_SLOW_UCCE_BSY | UCC_SLOW_UCCE_GRA | \ 464#define UCC_BISYNC_UCCE_RXB 0x0001
427 UCC_SLOW_UCCE_TXB | UCC_SLOW_UCCE_TX | UCC_SLOW_UCCE_RX | \ 465
428 UCC_SLOW_UCCE_GLT | UCC_SLOW_UCCE_GLR) 466/* Gigabit Ethernet Fast UCC Event Register (UCCE) */
429#define UCC_SLOW_UCCE_QMC_SET (UCC_SLOW_UCCE_IQOV | UCC_SLOW_UCCE_GINT | \ 467#define UCC_GETH_UCCE_MPD 0x80000000
430 UCC_SLOW_UCCE_GUN | UCC_SLOW_UCCE_GOV) 468#define UCC_GETH_UCCE_SCAR 0x40000000
431 469#define UCC_GETH_UCCE_GRA 0x20000000
432#define UCC_SLOW_UCCE_OTHER (UCC_SLOW_UCCE_TXE | UCC_SLOW_UCCE_BSY | \ 470#define UCC_GETH_UCCE_CBPR 0x10000000
433 UCC_SLOW_UCCE_GRA | UCC_SLOW_UCCE_DCC | UCC_SLOW_UCCE_GLT | \ 471#define UCC_GETH_UCCE_BSY 0x08000000
434 UCC_SLOW_UCCE_GLR) 472#define UCC_GETH_UCCE_RXC 0x04000000
435 473#define UCC_GETH_UCCE_TXC 0x02000000
436#define UCC_SLOW_INTR_TX UCC_SLOW_UCCE_TXB 474#define UCC_GETH_UCCE_TXE 0x01000000
437#define UCC_SLOW_INTR_RX (UCC_SLOW_UCCE_RXF | UCC_SLOW_UCCE_RX) 475#define UCC_GETH_UCCE_TXB7 0x00800000
438#define UCC_SLOW_INTR (UCC_SLOW_INTR_TX | UCC_SLOW_INTR_RX) 476#define UCC_GETH_UCCE_TXB6 0x00400000
477#define UCC_GETH_UCCE_TXB5 0x00200000
478#define UCC_GETH_UCCE_TXB4 0x00100000
479#define UCC_GETH_UCCE_TXB3 0x00080000
480#define UCC_GETH_UCCE_TXB2 0x00040000
481#define UCC_GETH_UCCE_TXB1 0x00020000
482#define UCC_GETH_UCCE_TXB0 0x00010000
483#define UCC_GETH_UCCE_RXB7 0x00008000
484#define UCC_GETH_UCCE_RXB6 0x00004000
485#define UCC_GETH_UCCE_RXB5 0x00002000
486#define UCC_GETH_UCCE_RXB4 0x00001000
487#define UCC_GETH_UCCE_RXB3 0x00000800
488#define UCC_GETH_UCCE_RXB2 0x00000400
489#define UCC_GETH_UCCE_RXB1 0x00000200
490#define UCC_GETH_UCCE_RXB0 0x00000100
491#define UCC_GETH_UCCE_RXF7 0x00000080
492#define UCC_GETH_UCCE_RXF6 0x00000040
493#define UCC_GETH_UCCE_RXF5 0x00000020
494#define UCC_GETH_UCCE_RXF4 0x00000010
495#define UCC_GETH_UCCE_RXF3 0x00000008
496#define UCC_GETH_UCCE_RXF2 0x00000004
497#define UCC_GETH_UCCE_RXF1 0x00000002
498#define UCC_GETH_UCCE_RXF0 0x00000001
499
500/* UPSMR, when used as a UART */
501#define UCC_UART_UPSMR_FLC 0x8000
502#define UCC_UART_UPSMR_SL 0x4000
503#define UCC_UART_UPSMR_CL_MASK 0x3000
504#define UCC_UART_UPSMR_CL_8 0x3000
505#define UCC_UART_UPSMR_CL_7 0x2000
506#define UCC_UART_UPSMR_CL_6 0x1000
507#define UCC_UART_UPSMR_CL_5 0x0000
508#define UCC_UART_UPSMR_UM_MASK 0x0c00
509#define UCC_UART_UPSMR_UM_NORMAL 0x0000
510#define UCC_UART_UPSMR_UM_MAN_MULTI 0x0400
511#define UCC_UART_UPSMR_UM_AUTO_MULTI 0x0c00
512#define UCC_UART_UPSMR_FRZ 0x0200
513#define UCC_UART_UPSMR_RZS 0x0100
514#define UCC_UART_UPSMR_SYN 0x0080
515#define UCC_UART_UPSMR_DRT 0x0040
516#define UCC_UART_UPSMR_PEN 0x0010
517#define UCC_UART_UPSMR_RPM_MASK 0x000c
518#define UCC_UART_UPSMR_RPM_ODD 0x0000
519#define UCC_UART_UPSMR_RPM_LOW 0x0004
520#define UCC_UART_UPSMR_RPM_EVEN 0x0008
521#define UCC_UART_UPSMR_RPM_HIGH 0x000C
522#define UCC_UART_UPSMR_TPM_MASK 0x0003
523#define UCC_UART_UPSMR_TPM_ODD 0x0000
524#define UCC_UART_UPSMR_TPM_LOW 0x0001
525#define UCC_UART_UPSMR_TPM_EVEN 0x0002
526#define UCC_UART_UPSMR_TPM_HIGH 0x0003
439 527
440/* UCC Transmit On Demand Register (UTODR) */ 528/* UCC Transmit On Demand Register (UTODR) */
441#define UCC_SLOW_TOD 0x8000 529#define UCC_SLOW_TOD 0x8000
442#define UCC_FAST_TOD 0x8000 530#define UCC_FAST_TOD 0x8000
443 531
532/* UCC Bus Mode Register masks */
533/* Not to be confused with the Bundle Mode Register */
534#define UCC_BMR_GBL 0x20
535#define UCC_BMR_BO_BE 0x10
536#define UCC_BMR_CETM 0x04
537#define UCC_BMR_DTB 0x02
538#define UCC_BMR_BDB 0x01
539
444/* Function code masks */ 540/* Function code masks */
445#define FC_GBL 0x20 541#define FC_GBL 0x20
446#define FC_DTB_LCL 0x02 542#define FC_DTB_LCL 0x02
diff --git a/include/asm-powerpc/qe_ic.h b/include/asm-powerpc/qe_ic.h
index e386fb7e44b0..a779b2c9eaf1 100644
--- a/include/asm-powerpc/qe_ic.h
+++ b/include/asm-powerpc/qe_ic.h
@@ -56,9 +56,75 @@ enum qe_ic_grp_id {
56 QE_IC_GRP_RISCB /* QE interrupt controller RISC group B */ 56 QE_IC_GRP_RISCB /* QE interrupt controller RISC group B */
57}; 57};
58 58
59void qe_ic_init(struct device_node *node, unsigned int flags); 59void qe_ic_init(struct device_node *node, unsigned int flags,
60 void (*low_handler)(unsigned int irq, struct irq_desc *desc),
61 void (*high_handler)(unsigned int irq, struct irq_desc *desc));
60void qe_ic_set_highest_priority(unsigned int virq, int high); 62void qe_ic_set_highest_priority(unsigned int virq, int high);
61int qe_ic_set_priority(unsigned int virq, unsigned int priority); 63int qe_ic_set_priority(unsigned int virq, unsigned int priority);
62int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high); 64int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high);
63 65
66struct qe_ic;
67unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic);
68unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic);
69
70static inline void qe_ic_cascade_low_ipic(unsigned int irq,
71 struct irq_desc *desc)
72{
73 struct qe_ic *qe_ic = desc->handler_data;
74 unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
75
76 if (cascade_irq != NO_IRQ)
77 generic_handle_irq(cascade_irq);
78}
79
80static inline void qe_ic_cascade_high_ipic(unsigned int irq,
81 struct irq_desc *desc)
82{
83 struct qe_ic *qe_ic = desc->handler_data;
84 unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
85
86 if (cascade_irq != NO_IRQ)
87 generic_handle_irq(cascade_irq);
88}
89
90static inline void qe_ic_cascade_low_mpic(unsigned int irq,
91 struct irq_desc *desc)
92{
93 struct qe_ic *qe_ic = desc->handler_data;
94 unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic);
95
96 if (cascade_irq != NO_IRQ)
97 generic_handle_irq(cascade_irq);
98
99 desc->chip->eoi(irq);
100}
101
102static inline void qe_ic_cascade_high_mpic(unsigned int irq,
103 struct irq_desc *desc)
104{
105 struct qe_ic *qe_ic = desc->handler_data;
106 unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic);
107
108 if (cascade_irq != NO_IRQ)
109 generic_handle_irq(cascade_irq);
110
111 desc->chip->eoi(irq);
112}
113
114static inline void qe_ic_cascade_muxed_mpic(unsigned int irq,
115 struct irq_desc *desc)
116{
117 struct qe_ic *qe_ic = desc->handler_data;
118 unsigned int cascade_irq;
119
120 cascade_irq = qe_ic_get_high_irq(qe_ic);
121 if (cascade_irq == NO_IRQ)
122 cascade_irq = qe_ic_get_low_irq(qe_ic);
123
124 if (cascade_irq != NO_IRQ)
125 generic_handle_irq(cascade_irq);
126
127 desc->chip->eoi(irq);
128}
129
64#endif /* _ASM_POWERPC_QE_IC_H */ 130#endif /* _ASM_POWERPC_QE_IC_H */
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h
index 281011e953ec..e775ff1ca413 100644
--- a/include/asm-powerpc/reg.h
+++ b/include/asm-powerpc/reg.h
@@ -102,12 +102,8 @@
102#else /* 32-bit */ 102#else /* 32-bit */
103/* Default MSR for kernel mode. */ 103/* Default MSR for kernel mode. */
104#ifndef MSR_KERNEL /* reg_booke.h also defines this */ 104#ifndef MSR_KERNEL /* reg_booke.h also defines this */
105#ifdef CONFIG_APUS_FAST_EXCEPT
106#define MSR_KERNEL (MSR_ME|MSR_IP|MSR_RI|MSR_IR|MSR_DR)
107#else
108#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR) 105#define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR)
109#endif 106#endif
110#endif
111 107
112#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) 108#define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE)
113#endif 109#endif
@@ -518,21 +514,47 @@
518#define PA6T_MMCR1_ES4 0x0000000000ff0000UL 514#define PA6T_MMCR1_ES4 0x0000000000ff0000UL
519#define PA6T_MMCR1_ES5 0x00000000ff000000UL 515#define PA6T_MMCR1_ES5 0x00000000ff000000UL
520 516
521#define SPRN_PA6T_SIAR 780 517#define SPRN_PA6T_UPMC0 771 /* User PerfMon Counter 0 */
522#define SPRN_PA6T_UPMC0 771 518#define SPRN_PA6T_UPMC1 772 /* ... */
523#define SPRN_PA6T_UPMC1 772
524#define SPRN_PA6T_UPMC2 773 519#define SPRN_PA6T_UPMC2 773
525#define SPRN_PA6T_UPMC3 774 520#define SPRN_PA6T_UPMC3 774
526#define SPRN_PA6T_UPMC4 775 521#define SPRN_PA6T_UPMC4 775
527#define SPRN_PA6T_UPMC5 776 522#define SPRN_PA6T_UPMC5 776
528#define SPRN_PA6T_UMMCR0 779 523#define SPRN_PA6T_UMMCR0 779 /* User Monitor Mode Control Register 0 */
529#define SPRN_PA6T_UMMCR1 782 524#define SPRN_PA6T_SIAR 780 /* Sampled Instruction Address */
530#define SPRN_PA6T_PMC0 787 525#define SPRN_PA6T_UMMCR1 782 /* User Monitor Mode Control Register 1 */
531#define SPRN_PA6T_PMC1 788 526#define SPRN_PA6T_SIER 785 /* Sampled Instruction Event Register */
532#define SPRN_PA6T_PMC2 789 527#define SPRN_PA6T_PMC0 787
533#define SPRN_PA6T_PMC3 790 528#define SPRN_PA6T_PMC1 788
534#define SPRN_PA6T_PMC4 791 529#define SPRN_PA6T_PMC2 789
535#define SPRN_PA6T_PMC5 792 530#define SPRN_PA6T_PMC3 790
531#define SPRN_PA6T_PMC4 791
532#define SPRN_PA6T_PMC5 792
533#define SPRN_PA6T_TSR0 793 /* Timestamp Register 0 */
534#define SPRN_PA6T_TSR1 794 /* Timestamp Register 1 */
535#define SPRN_PA6T_TSR2 799 /* Timestamp Register 2 */
536#define SPRN_PA6T_TSR3 784 /* Timestamp Register 3 */
537
538#define SPRN_PA6T_IER 981 /* Icache Error Register */
539#define SPRN_PA6T_DER 982 /* Dcache Error Register */
540#define SPRN_PA6T_BER 862 /* BIU Error Address Register */
541#define SPRN_PA6T_MER 849 /* MMU Error Register */
542
543#define SPRN_PA6T_IMA0 880 /* Instruction Match Array 0 */
544#define SPRN_PA6T_IMA1 881 /* ... */
545#define SPRN_PA6T_IMA2 882
546#define SPRN_PA6T_IMA3 883
547#define SPRN_PA6T_IMA4 884
548#define SPRN_PA6T_IMA5 885
549#define SPRN_PA6T_IMA6 886
550#define SPRN_PA6T_IMA7 887
551#define SPRN_PA6T_IMA8 888
552#define SPRN_PA6T_IMA9 889
553#define SPRN_PA6T_BTCR 978 /* Breakpoint and Tagging Control Register */
554#define SPRN_PA6T_IMAAT 979 /* Instruction Match Array Action Table */
555#define SPRN_PA6T_PCCR 1019 /* Power Counter Control Register */
556#define SPRN_PA6T_RPCCR 1021 /* Retire PC Trace Control Register */
557
536 558
537#else /* 32-bit */ 559#else /* 32-bit */
538#define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */ 560#define SPRN_MMCR0 952 /* Monitor Mode Control Register 0 */
diff --git a/include/asm-powerpc/rwsem.h b/include/asm-powerpc/rwsem.h
index e929145e1e46..cefc14728cc5 100644
--- a/include/asm-powerpc/rwsem.h
+++ b/include/asm-powerpc/rwsem.h
@@ -1,6 +1,10 @@
1#ifndef _ASM_POWERPC_RWSEM_H 1#ifndef _ASM_POWERPC_RWSEM_H
2#define _ASM_POWERPC_RWSEM_H 2#define _ASM_POWERPC_RWSEM_H
3 3
4#ifndef _LINUX_RWSEM_H
5#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
6#endif
7
4#ifdef __KERNEL__ 8#ifdef __KERNEL__
5 9
6/* 10/*
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h
index d037f50580e2..19102bfc14ca 100644
--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -45,7 +45,7 @@ void generic_mach_cpu_die(void);
45#endif 45#endif
46 46
47#ifdef CONFIG_PPC64 47#ifdef CONFIG_PPC64
48#define raw_smp_processor_id() (get_paca()->paca_index) 48#define raw_smp_processor_id() (local_paca->paca_index)
49#define hard_smp_processor_id() (get_paca()->hw_cpu_id) 49#define hard_smp_processor_id() (get_paca()->hw_cpu_id)
50#else 50#else
51/* 32-bit */ 51/* 32-bit */
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index 5bde3980bf49..b1accce77bb5 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -238,19 +238,14 @@ extern long spu_sys_callback(struct spu_syscall_block *s);
238 238
239/* syscalls implemented in spufs */ 239/* syscalls implemented in spufs */
240struct file; 240struct file;
241extern struct spufs_calls { 241struct spufs_calls {
242 asmlinkage long (*create_thread)(const char __user *name, 242 long (*create_thread)(const char __user *name,
243 unsigned int flags, mode_t mode, 243 unsigned int flags, mode_t mode,
244 struct file *neighbor); 244 struct file *neighbor);
245 asmlinkage long (*spu_run)(struct file *filp, __u32 __user *unpc, 245 long (*spu_run)(struct file *filp, __u32 __user *unpc,
246 __u32 __user *ustatus); 246 __u32 __user *ustatus);
247 struct module *owner; 247 int (*coredump_extra_notes_size)(void);
248} spufs_calls; 248 int (*coredump_extra_notes_write)(struct file *file, loff_t *foffset);
249
250/* coredump calls implemented in spufs */
251struct spu_coredump_calls {
252 asmlinkage int (*arch_notes_size)(void);
253 asmlinkage void (*arch_write_notes)(struct file *file);
254 struct module *owner; 249 struct module *owner;
255}; 250};
256 251
@@ -274,21 +269,8 @@ struct spu_coredump_calls {
274#define SPU_CREATE_FLAG_ALL 0x003f /* mask of all valid flags */ 269#define SPU_CREATE_FLAG_ALL 0x003f /* mask of all valid flags */
275 270
276 271
277#ifdef CONFIG_SPU_FS_MODULE
278int register_spu_syscalls(struct spufs_calls *calls); 272int register_spu_syscalls(struct spufs_calls *calls);
279void unregister_spu_syscalls(struct spufs_calls *calls); 273void unregister_spu_syscalls(struct spufs_calls *calls);
280#else
281static inline int register_spu_syscalls(struct spufs_calls *calls)
282{
283 return 0;
284}
285static inline void unregister_spu_syscalls(struct spufs_calls *calls)
286{
287}
288#endif /* MODULE */
289
290int register_arch_coredump_calls(struct spu_coredump_calls *calls);
291void unregister_arch_coredump_calls(struct spu_coredump_calls *calls);
292 274
293int spu_add_sysdev_attr(struct sysdev_attribute *attr); 275int spu_add_sysdev_attr(struct sysdev_attribute *attr);
294void spu_remove_sysdev_attr(struct sysdev_attribute *attr); 276void spu_remove_sysdev_attr(struct sysdev_attribute *attr);
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 41520b7a7b76..d10e99bf5001 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -189,6 +189,9 @@ extern int mem_init_done; /* set on boot once kmalloc can be called */
189extern unsigned long memory_limit; 189extern unsigned long memory_limit;
190extern unsigned long klimit; 190extern unsigned long klimit;
191 191
192extern void *alloc_maybe_bootmem(size_t size, gfp_t mask);
193extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask);
194
192extern int powersave_nap; /* set if nap mode can be used in idle loop */ 195extern int powersave_nap; /* set if nap mode can be used in idle loop */
193 196
194/* 197/*
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index c104c15c6625..f05895522f7f 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -179,7 +179,7 @@ static inline unsigned int get_dec(void)
179static inline void set_dec(int val) 179static inline void set_dec(int val)
180{ 180{
181#if defined(CONFIG_40x) 181#if defined(CONFIG_40x)
182 return; /* Have to let it auto-reload */ 182 mtspr(SPRN_PIT, val);
183#elif defined(CONFIG_8xx_CPU6) 183#elif defined(CONFIG_8xx_CPU6)
184 set_dec_cpu6(val); 184 set_dec_cpu6(val);
185#else 185#else
@@ -245,6 +245,7 @@ extern void snapshot_timebases(void);
245#define snapshot_timebases() do { } while (0) 245#define snapshot_timebases() do { } while (0)
246#endif 246#endif
247 247
248extern void secondary_cpu_time_init(void);
248extern void iSeries_time_init_early(void); 249extern void iSeries_time_init_early(void);
249 250
250#endif /* __KERNEL__ */ 251#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/tlb.h b/include/asm-powerpc/tlb.h
index 66714042e438..e20ff7541f36 100644
--- a/include/asm-powerpc/tlb.h
+++ b/include/asm-powerpc/tlb.h
@@ -23,6 +23,8 @@
23#include <asm/mmu.h> 23#include <asm/mmu.h>
24#endif 24#endif
25 25
26#include <linux/pagemap.h>
27
26struct mmu_gather; 28struct mmu_gather;
27 29
28#define tlb_start_vma(tlb, vma) do { } while (0) 30#define tlb_start_vma(tlb, vma) do { } while (0)
diff --git a/include/asm-powerpc/tlbflush.h b/include/asm-powerpc/tlbflush.h
index 99a0439baa50..a022f806bb21 100644
--- a/include/asm-powerpc/tlbflush.h
+++ b/include/asm-powerpc/tlbflush.h
@@ -97,6 +97,7 @@ struct ppc64_tlb_batch {
97 real_pte_t pte[PPC64_TLB_BATCH_NR]; 97 real_pte_t pte[PPC64_TLB_BATCH_NR];
98 unsigned long vaddr[PPC64_TLB_BATCH_NR]; 98 unsigned long vaddr[PPC64_TLB_BATCH_NR];
99 unsigned int psize; 99 unsigned int psize;
100 int ssize;
100}; 101};
101DECLARE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); 102DECLARE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch);
102 103
@@ -127,7 +128,7 @@ static inline void arch_leave_lazy_mmu_mode(void)
127 128
128 129
129extern void flush_hash_page(unsigned long va, real_pte_t pte, int psize, 130extern void flush_hash_page(unsigned long va, real_pte_t pte, int psize,
130 int local); 131 int ssize, int local);
131extern void flush_hash_range(unsigned long number, int local); 132extern void flush_hash_range(unsigned long number, int local);
132 133
133 134
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index 3b363757a2bb..a584341c87e3 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -48,7 +48,7 @@ typedef unsigned long long __u64;
48 48
49typedef struct { 49typedef struct {
50 __u32 u[4]; 50 __u32 u[4];
51} __attribute((aligned(16))) __vector128; 51} __attribute__((aligned(16))) __vector128;
52 52
53#endif /* __ASSEMBLY__ */ 53#endif /* __ASSEMBLY__ */
54 54
diff --git a/include/asm-powerpc/ucc.h b/include/asm-powerpc/ucc.h
index afe3076bdc03..46b09ba6bead 100644
--- a/include/asm-powerpc/ucc.h
+++ b/include/asm-powerpc/ucc.h
@@ -25,58 +25,38 @@
25/* Slow or fast type for UCCs. 25/* Slow or fast type for UCCs.
26*/ 26*/
27enum ucc_speed_type { 27enum ucc_speed_type {
28 UCC_SPEED_TYPE_FAST, UCC_SPEED_TYPE_SLOW 28 UCC_SPEED_TYPE_FAST = UCC_GUEMR_MODE_FAST_RX | UCC_GUEMR_MODE_FAST_TX,
29}; 29 UCC_SPEED_TYPE_SLOW = UCC_GUEMR_MODE_SLOW_RX | UCC_GUEMR_MODE_SLOW_TX
30
31/* Initial UCCs Parameter RAM address relative to: MEM_MAP_BASE (IMMR).
32*/
33enum ucc_pram_initial_offset {
34 UCC_PRAM_OFFSET_UCC1 = 0x8400,
35 UCC_PRAM_OFFSET_UCC2 = 0x8500,
36 UCC_PRAM_OFFSET_UCC3 = 0x8600,
37 UCC_PRAM_OFFSET_UCC4 = 0x9000,
38 UCC_PRAM_OFFSET_UCC5 = 0x8000,
39 UCC_PRAM_OFFSET_UCC6 = 0x8100,
40 UCC_PRAM_OFFSET_UCC7 = 0x8200,
41 UCC_PRAM_OFFSET_UCC8 = 0x8300
42}; 30};
43 31
44/* ucc_set_type 32/* ucc_set_type
45 * Sets UCC to slow or fast mode. 33 * Sets UCC to slow or fast mode.
46 * 34 *
47 * ucc_num - (In) number of UCC (0-7). 35 * ucc_num - (In) number of UCC (0-7).
48 * regs - (In) pointer to registers base for the UCC.
49 * speed - (In) slow or fast mode for UCC. 36 * speed - (In) slow or fast mode for UCC.
50 */ 37 */
51int ucc_set_type(int ucc_num, struct ucc_common *regs, 38int ucc_set_type(unsigned int ucc_num, enum ucc_speed_type speed);
52 enum ucc_speed_type speed);
53
54/* ucc_init_guemr
55 * Init the Guemr register.
56 *
57 * regs - (In) pointer to registers base for the UCC.
58 */
59int ucc_init_guemr(struct ucc_common *regs);
60 39
61int ucc_set_qe_mux_mii_mng(int ucc_num); 40int ucc_set_qe_mux_mii_mng(unsigned int ucc_num);
62 41
63int ucc_set_qe_mux_rxtx(int ucc_num, enum qe_clock clock, enum comm_dir mode); 42int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock,
43 enum comm_dir mode);
64 44
65int ucc_mux_set_grant_tsa_bkpt(int ucc_num, int set, u32 mask); 45int ucc_mux_set_grant_tsa_bkpt(unsigned int ucc_num, int set, u32 mask);
66 46
67/* QE MUX clock routing for UCC 47/* QE MUX clock routing for UCC
68*/ 48*/
69static inline int ucc_set_qe_mux_grant(int ucc_num, int set) 49static inline int ucc_set_qe_mux_grant(unsigned int ucc_num, int set)
70{ 50{
71 return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_GRANT); 51 return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_GRANT);
72} 52}
73 53
74static inline int ucc_set_qe_mux_tsa(int ucc_num, int set) 54static inline int ucc_set_qe_mux_tsa(unsigned int ucc_num, int set)
75{ 55{
76 return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_TSA); 56 return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_TSA);
77} 57}
78 58
79static inline int ucc_set_qe_mux_bkpt(int ucc_num, int set) 59static inline int ucc_set_qe_mux_bkpt(unsigned int ucc_num, int set)
80{ 60{
81 return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_BKPT); 61 return ucc_mux_set_grant_tsa_bkpt(ucc_num, set, QE_CMXUCR_BKPT);
82} 62}
diff --git a/include/asm-powerpc/ucc_slow.h b/include/asm-powerpc/ucc_slow.h
index fdaac9d762bb..0980e6ad335b 100644
--- a/include/asm-powerpc/ucc_slow.h
+++ b/include/asm-powerpc/ucc_slow.h
@@ -148,9 +148,10 @@ enum ucc_slow_diag_mode {
148 148
149struct ucc_slow_info { 149struct ucc_slow_info {
150 int ucc_num; 150 int ucc_num;
151 int protocol; /* QE_CR_PROTOCOL_xxx */
151 enum qe_clock rx_clock; 152 enum qe_clock rx_clock;
152 enum qe_clock tx_clock; 153 enum qe_clock tx_clock;
153 u32 regs; 154 phys_addr_t regs;
154 int irq; 155 int irq;
155 u16 uccm_mask; 156 u16 uccm_mask;
156 int data_mem_part; 157 int data_mem_part;
@@ -186,7 +187,7 @@ struct ucc_slow_info {
186 187
187struct ucc_slow_private { 188struct ucc_slow_private {
188 struct ucc_slow_info *us_info; 189 struct ucc_slow_info *us_info;
189 struct ucc_slow *us_regs; /* a pointer to memory map of UCC regs */ 190 struct ucc_slow __iomem *us_regs; /* Ptr to memory map of UCC regs */
190 struct ucc_slow_pram *us_pram; /* a pointer to the parameter RAM */ 191 struct ucc_slow_pram *us_pram; /* a pointer to the parameter RAM */
191 u32 us_pram_offset; 192 u32 us_pram_offset;
192 int enabled_tx; /* Whether channel is enabled for Tx (ENT) */ 193 int enabled_tx; /* Whether channel is enabled for Tx (ENT) */
@@ -277,12 +278,12 @@ void ucc_slow_graceful_stop_tx(struct ucc_slow_private * uccs);
277 */ 278 */
278void ucc_slow_stop_tx(struct ucc_slow_private * uccs); 279void ucc_slow_stop_tx(struct ucc_slow_private * uccs);
279 280
280/* ucc_slow_restart_x 281/* ucc_slow_restart_tx
281 * Restarts transmitting on a specified slow UCC. 282 * Restarts transmitting on a specified slow UCC.
282 * 283 *
283 * uccs - (In) pointer to the slow UCC structure. 284 * uccs - (In) pointer to the slow UCC structure.
284 */ 285 */
285void ucc_slow_restart_x(struct ucc_slow_private * uccs); 286void ucc_slow_restart_tx(struct ucc_slow_private *uccs);
286 287
287u32 ucc_slow_get_qe_cr_subblock(int uccs_num); 288u32 ucc_slow_get_qe_cr_subblock(int uccs_num);
288 289
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h
index ce9d82fb7b68..a9e0b0ebcb0f 100644
--- a/include/asm-powerpc/udbg.h
+++ b/include/asm-powerpc/udbg.h
@@ -48,6 +48,7 @@ extern void __init udbg_init_rtas_console(void);
48extern void __init udbg_init_debug_beat(void); 48extern void __init udbg_init_debug_beat(void);
49extern void __init udbg_init_btext(void); 49extern void __init udbg_init_btext(void);
50extern void __init udbg_init_44x_as1(void); 50extern void __init udbg_init_44x_as1(void);
51extern void __init udbg_init_cpm(void);
51 52
52#endif /* __KERNEL__ */ 53#endif /* __KERNEL__ */
53#endif /* _ASM_POWERPC_UDBG_H */ 54#endif /* _ASM_POWERPC_UDBG_H */
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h
index 3a0975e2adad..9204c15839c5 100644
--- a/include/asm-powerpc/vio.h
+++ b/include/asm-powerpc/vio.h
@@ -53,18 +53,12 @@ struct vio_dev {
53}; 53};
54 54
55struct vio_driver { 55struct vio_driver {
56 struct list_head node;
57 const struct vio_device_id *id_table; 56 const struct vio_device_id *id_table;
58 int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); 57 int (*probe)(struct vio_dev *dev, const struct vio_device_id *id);
59 int (*remove)(struct vio_dev *dev); 58 int (*remove)(struct vio_dev *dev);
60 void (*shutdown)(struct vio_dev *dev);
61 unsigned long driver_data;
62 struct device_driver driver; 59 struct device_driver driver;
63}; 60};
64 61
65extern struct dma_mapping_ops vio_dma_ops;
66extern struct bus_type vio_bus_type;
67
68extern int vio_register_driver(struct vio_driver *drv); 62extern int vio_register_driver(struct vio_driver *drv);
69extern void vio_unregister_driver(struct vio_driver *drv); 63extern void vio_unregister_driver(struct vio_driver *drv);
70 64
diff --git a/include/asm-powerpc/xilinx_intc.h b/include/asm-powerpc/xilinx_intc.h
new file mode 100644
index 000000000000..343612f8fece
--- /dev/null
+++ b/include/asm-powerpc/xilinx_intc.h
@@ -0,0 +1,20 @@
1/*
2 * Xilinx intc external definitions
3 *
4 * Copyright 2007 Secret Lab Technologies Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11#ifndef _ASM_POWERPC_XILINX_INTC_H
12#define _ASM_POWERPC_XILINX_INTC_H
13
14#ifdef __KERNEL__
15
16extern void __init xilinx_intc_init_tree(void);
17extern unsigned int xilinx_intc_get_irq(void);
18
19#endif /* __KERNEL__ */
20#endif /* _ASM_POWERPC_XILINX_INTC_H */
diff --git a/include/asm-ppc/amigahw.h b/include/asm-ppc/amigahw.h
deleted file mode 100644
index 90fd1274d727..000000000000
--- a/include/asm-ppc/amigahw.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifdef __KERNEL__
2#ifndef __ASMPPC_AMIGAHW_H
3#define __ASMPPC_AMIGAHW_H
4
5#include <asm-m68k/amigahw.h>
6
7#undef CHIP_PHYSADDR
8#ifdef CONFIG_APUS_FAST_EXCEPT
9#define CHIP_PHYSADDR (0x000000)
10#else
11#define CHIP_PHYSADDR (0x004000)
12#endif
13
14
15#endif /* __ASMPPC_AMIGAHW_H */
16#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/amigaints.h b/include/asm-ppc/amigaints.h
deleted file mode 100644
index aa3ff6349e81..000000000000
--- a/include/asm-ppc/amigaints.h
+++ /dev/null
@@ -1,133 +0,0 @@
1/*
2** amigaints.h -- Amiga Linux interrupt handling structs and prototypes
3**
4** Copyright 1992 by Greg Harp
5**
6** This file is subject to the terms and conditions of the GNU General Public
7** License. See the file COPYING in the main directory of this archive
8** for more details.
9**
10** Created 10/2/92 by Greg Harp
11*/
12
13#ifdef __KERNEL__
14#ifndef _ASMm68k_AMIGAINTS_H_
15#define _ASMm68k_AMIGAINTS_H_
16
17/*
18** Amiga Interrupt sources.
19**
20*/
21
22#define AUTO_IRQS (8)
23#define AMI_STD_IRQS (14)
24#define CIA_IRQS (5)
25#define AMI_IRQS (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */
26
27/* vertical blanking interrupt */
28#define IRQ_AMIGA_VERTB 0
29
30/* copper interrupt */
31#define IRQ_AMIGA_COPPER 1
32
33/* Audio interrupts */
34#define IRQ_AMIGA_AUD0 2
35#define IRQ_AMIGA_AUD1 3
36#define IRQ_AMIGA_AUD2 4
37#define IRQ_AMIGA_AUD3 5
38
39/* Blitter done interrupt */
40#define IRQ_AMIGA_BLIT 6
41
42/* floppy disk interrupts */
43#define IRQ_AMIGA_DSKSYN 7
44#define IRQ_AMIGA_DSKBLK 8
45
46/* builtin serial port interrupts */
47#define IRQ_AMIGA_RBF 9
48#define IRQ_AMIGA_TBE 10
49
50/* software interrupts */
51#define IRQ_AMIGA_SOFT 11
52
53/* interrupts from external hardware */
54#define IRQ_AMIGA_PORTS 12
55#define IRQ_AMIGA_EXTER 13
56
57/* CIA interrupt sources */
58#define IRQ_AMIGA_CIAA 14
59#define IRQ_AMIGA_CIAA_TA 14
60#define IRQ_AMIGA_CIAA_TB 15
61#define IRQ_AMIGA_CIAA_ALRM 16
62#define IRQ_AMIGA_CIAA_SP 17
63#define IRQ_AMIGA_CIAA_FLG 18
64#define IRQ_AMIGA_CIAB 19
65#define IRQ_AMIGA_CIAB_TA 19
66#define IRQ_AMIGA_CIAB_TB 20
67#define IRQ_AMIGA_CIAB_ALRM 21
68#define IRQ_AMIGA_CIAB_SP 22
69#define IRQ_AMIGA_CIAB_FLG 23
70
71/* auto-vector interrupts */
72#define IRQ_AMIGA_AUTO 24
73#define IRQ_AMIGA_AUTO_0 24 /* This is just a dummy */
74#define IRQ_AMIGA_AUTO_1 25
75#define IRQ_AMIGA_AUTO_2 26
76#define IRQ_AMIGA_AUTO_3 27
77#define IRQ_AMIGA_AUTO_4 28
78#define IRQ_AMIGA_AUTO_5 29
79#define IRQ_AMIGA_AUTO_6 30
80#define IRQ_AMIGA_AUTO_7 31
81
82#define IRQ_FLOPPY IRQ_AMIGA_DSKBLK
83
84/* INTREQR masks */
85#define IRQ1_MASK 0x0007 /* INTREQR mask for IRQ 1 */
86#define IRQ2_MASK 0x0008 /* INTREQR mask for IRQ 2 */
87#define IRQ3_MASK 0x0070 /* INTREQR mask for IRQ 3 */
88#define IRQ4_MASK 0x0780 /* INTREQR mask for IRQ 4 */
89#define IRQ5_MASK 0x1800 /* INTREQR mask for IRQ 5 */
90#define IRQ6_MASK 0x2000 /* INTREQR mask for IRQ 6 */
91#define IRQ7_MASK 0x4000 /* INTREQR mask for IRQ 7 */
92
93#define IF_SETCLR 0x8000 /* set/clr bit */
94#define IF_INTEN 0x4000 /* master interrupt bit in INT* registers */
95#define IF_EXTER 0x2000 /* external level 6 and CIA B interrupt */
96#define IF_DSKSYN 0x1000 /* disk sync interrupt */
97#define IF_RBF 0x0800 /* serial receive buffer full interrupt */
98#define IF_AUD3 0x0400 /* audio channel 3 done interrupt */
99#define IF_AUD2 0x0200 /* audio channel 2 done interrupt */
100#define IF_AUD1 0x0100 /* audio channel 1 done interrupt */
101#define IF_AUD0 0x0080 /* audio channel 0 done interrupt */
102#define IF_BLIT 0x0040 /* blitter done interrupt */
103#define IF_VERTB 0x0020 /* vertical blanking interrupt */
104#define IF_COPER 0x0010 /* copper interrupt */
105#define IF_PORTS 0x0008 /* external level 2 and CIA A interrupt */
106#define IF_SOFT 0x0004 /* software initiated interrupt */
107#define IF_DSKBLK 0x0002 /* diskblock DMA finished */
108#define IF_TBE 0x0001 /* serial transmit buffer empty interrupt */
109
110extern void amiga_do_irq(int irq, struct pt_regs *fp);
111extern void amiga_do_irq_list(int irq, struct pt_regs *fp);
112
113/* CIA interrupt control register bits */
114
115#define CIA_ICR_TA 0x01
116#define CIA_ICR_TB 0x02
117#define CIA_ICR_ALRM 0x04
118#define CIA_ICR_SP 0x08
119#define CIA_ICR_FLG 0x10
120#define CIA_ICR_ALL 0x1f
121#define CIA_ICR_SETCLR 0x80
122
123/* to access the interrupt control registers of CIA's use only
124** these functions, they behave exactly like the amiga os routines
125*/
126
127extern struct ciabase ciaa_base, ciab_base;
128
129extern unsigned char cia_set_irq(unsigned int irq, int set);
130extern unsigned char cia_able_irq(unsigned int irq, int enable);
131
132#endif /* asm-m68k/amigaints.h */
133#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/amigappc.h b/include/asm-ppc/amigappc.h
deleted file mode 100644
index 35114ce5135f..000000000000
--- a/include/asm-ppc/amigappc.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2** asm-ppc/amigappc.h -- This header defines some values and pointers for
3** the Phase 5 PowerUp card.
4**
5** Copyright 1997, 1998 by Phase5, Germany.
6**
7** This file is subject to the terms and conditions of the GNU General Public
8** License. See the file COPYING in the main directory of this archive
9** for more details.
10**
11** Created: 7/22/97 by Jesper Skov
12*/
13
14#ifdef __KERNEL__
15#ifndef _M68K_AMIGAPPC_H
16#define _M68K_AMIGAPPC_H
17
18#ifndef __ASSEMBLY__
19
20/* #include <asm/system.h> */
21#define mb() __asm__ __volatile__ ("sync" : : : "memory")
22
23#define APUS_WRITE(_a_, _v_) \
24do { \
25 (*((volatile unsigned char *)(_a_)) = (_v_)); \
26 mb(); \
27} while (0)
28
29#define APUS_READ(_a_, _v_) \
30do { \
31 (_v_) = (*((volatile unsigned char *)(_a_))); \
32 mb(); \
33} while (0)
34#endif /* ndef __ASSEMBLY__ */
35
36/* Maybe add a [#ifdef WANT_ZTWOBASE] condition to amigahw.h? */
37#define zTwoBase (0x80000000)
38
39#define APUS_IPL_BASE (zTwoBase + 0x00f60000)
40#define APUS_REG_RESET (APUS_IPL_BASE + 0x00)
41#define APUS_REG_WAITSTATE (APUS_IPL_BASE + 0x10)
42#define APUS_REG_SHADOW (APUS_IPL_BASE + 0x18)
43#define APUS_REG_LOCK (APUS_IPL_BASE + 0x20)
44#define APUS_REG_INT (APUS_IPL_BASE + 0x28)
45#define APUS_IPL_EMU (APUS_IPL_BASE + 0x30)
46#define APUS_INT_LVL (APUS_IPL_BASE + 0x38)
47
48#define REGSHADOW_SETRESET (0x80)
49#define REGSHADOW_SELFRESET (0x40)
50
51#define REGLOCK_SETRESET (0x80)
52#define REGLOCK_BLACKMAGICK1 (0x40)
53#define REGLOCK_BLACKMAGICK2 (0x20)
54#define REGLOCK_BLACKMAGICK3 (0x10)
55
56#define REGWAITSTATE_SETRESET (0x80)
57#define REGWAITSTATE_PPCW (0x08)
58#define REGWAITSTATE_PPCR (0x04)
59
60#define REGRESET_SETRESET (0x80)
61#define REGRESET_PPCRESET (0x10)
62#define REGRESET_M68KRESET (0x08)
63#define REGRESET_AMIGARESET (0x04)
64#define REGRESET_AUXRESET (0x02)
65#define REGRESET_SCSIRESET (0x01)
66
67#define REGINT_SETRESET (0x80)
68#define REGINT_ENABLEIPL (0x02)
69#define REGINT_INTMASTER (0x01)
70
71#define IPLEMU_SETRESET (0x80)
72#define IPLEMU_DISABLEINT (0x40)
73#define IPLEMU_IPL2 (0x20)
74#define IPLEMU_IPL1 (0x10)
75#define IPLEMU_IPL0 (0x08)
76#define IPLEMU_PPCIPL2 (0x04)
77#define IPLEMU_PPCIPL1 (0x02)
78#define IPLEMU_PPCIPL0 (0x01)
79#define IPLEMU_IPLMASK (IPLEMU_PPCIPL2|IPLEMU_PPCIPL1|IPLEMU_PPCIPL0)
80
81#define INTLVL_SETRESET (0x80)
82#define INTLVL_MASK (0x7f)
83
84#endif /* _M68k_AMIGAPPC_H */
85#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/bootinfo.h b/include/asm-ppc/bootinfo.h
index 2ace4a74f263..f6ed77aee328 100644
--- a/include/asm-ppc/bootinfo.h
+++ b/include/asm-ppc/bootinfo.h
@@ -11,10 +11,6 @@
11 11
12#include <asm/page.h> 12#include <asm/page.h>
13 13
14#if defined(CONFIG_APUS) && !defined(__BOOTER__)
15#include <asm-m68k/bootinfo.h>
16#else
17
18struct bi_record { 14struct bi_record {
19 unsigned long tag; /* tag ID */ 15 unsigned long tag; /* tag ID */
20 unsigned long size; /* size of record (in bytes) */ 16 unsigned long size; /* size of record (in bytes) */
@@ -44,7 +40,6 @@ bootinfo_addr(unsigned long offset)
44 return (struct bi_record *)_ALIGN((offset) + (1 << 20) - 1, 40 return (struct bi_record *)_ALIGN((offset) + (1 << 20) - 1,
45 (1 << 20)); 41 (1 << 20));
46} 42}
47#endif /* CONFIG_APUS */
48 43
49 44
50#endif /* _PPC_BOOTINFO_H */ 45#endif /* _PPC_BOOTINFO_H */
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 95d590423cf2..8f58231a8bc6 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -30,7 +30,7 @@
30#include <asm/mpc8xx.h> 30#include <asm/mpc8xx.h>
31#elif defined(CONFIG_8260) 31#elif defined(CONFIG_8260)
32#include <asm/mpc8260.h> 32#include <asm/mpc8260.h>
33#elif defined(CONFIG_APUS) || !defined(CONFIG_PCI) 33#elif !defined(CONFIG_PCI)
34#define _IO_BASE 0 34#define _IO_BASE 0
35#define _ISA_MEM_BASE 0 35#define _ISA_MEM_BASE 0
36#define PCI_DRAM_OFFSET 0 36#define PCI_DRAM_OFFSET 0
@@ -145,24 +145,7 @@ static inline void writeb(__u8 b, volatile void __iomem *addr)
145} 145}
146#endif 146#endif
147 147
148#if defined(CONFIG_APUS) 148#if defined (CONFIG_8260_PCI9)
149static inline __u16 readw(const volatile void __iomem *addr)
150{
151 return *(__force volatile __u16 *)(addr);
152}
153static inline __u32 readl(const volatile void __iomem *addr)
154{
155 return *(__force volatile __u32 *)(addr);
156}
157static inline void writew(__u16 b, volatile void __iomem *addr)
158{
159 *(__force volatile __u16 *)(addr) = b;
160}
161static inline void writel(__u32 b, volatile void __iomem *addr)
162{
163 *(__force volatile __u32 *)(addr) = b;
164}
165#elif defined (CONFIG_8260_PCI9)
166/* Use macros if PCI9 workaround enabled */ 149/* Use macros if PCI9 workaround enabled */
167#define readw(addr) in_le16((volatile u16 *)(addr)) 150#define readw(addr) in_le16((volatile u16 *)(addr))
168#define readl(addr) in_le32((volatile u32 *)(addr)) 151#define readl(addr) in_le32((volatile u32 *)(addr))
@@ -185,7 +168,7 @@ static inline void writel(__u32 b, volatile void __iomem *addr)
185{ 168{
186 out_le32(addr, b); 169 out_le32(addr, b);
187} 170}
188#endif /* CONFIG_APUS */ 171#endif /* CONFIG_8260_PCI9 */
189 172
190#define readb_relaxed(addr) readb(addr) 173#define readb_relaxed(addr) readb(addr)
191#define readw_relaxed(addr) readw(addr) 174#define readw_relaxed(addr) readw(addr)
@@ -300,13 +283,7 @@ extern __inline__ void name(unsigned int val, unsigned int port) \
300} 283}
301 284
302__do_out_asm(outb, "stbx") 285__do_out_asm(outb, "stbx")
303#ifdef CONFIG_APUS 286#if defined (CONFIG_8260_PCI9)
304__do_in_asm(inb, "lbzx")
305__do_in_asm(inw, "lhz%U1%X1")
306__do_in_asm(inl, "lwz%U1%X1")
307__do_out_asm(outl,"stw%U0%X0")
308__do_out_asm(outw, "sth%U0%X0")
309#elif defined (CONFIG_8260_PCI9)
310/* in asm cannot be defined if PCI9 workaround is used */ 287/* in asm cannot be defined if PCI9 workaround is used */
311#define inb(port) in_8((port)+___IO_BASE) 288#define inb(port) in_8((port)+___IO_BASE)
312#define inw(port) in_le16((port)+___IO_BASE) 289#define inw(port) in_le16((port)+___IO_BASE)
@@ -371,7 +348,6 @@ extern void __iomem *ioremap64(unsigned long long address, unsigned long size);
371#define ioremap_nocache(addr, size) ioremap((addr), (size)) 348#define ioremap_nocache(addr, size) ioremap((addr), (size))
372extern void iounmap(volatile void __iomem *addr); 349extern void iounmap(volatile void __iomem *addr);
373extern unsigned long iopa(unsigned long addr); 350extern unsigned long iopa(unsigned long addr);
374extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
375extern void io_block_mapping(unsigned long virt, phys_addr_t phys, 351extern void io_block_mapping(unsigned long virt, phys_addr_t phys,
376 unsigned int size, int flags); 352 unsigned int size, int flags);
377 353
@@ -384,24 +360,16 @@ extern void io_block_mapping(unsigned long virt, phys_addr_t phys,
384 */ 360 */
385extern inline unsigned long virt_to_bus(volatile void * address) 361extern inline unsigned long virt_to_bus(volatile void * address)
386{ 362{
387#ifndef CONFIG_APUS
388 if (address == (void *)0) 363 if (address == (void *)0)
389 return 0; 364 return 0;
390 return (unsigned long)address - KERNELBASE + PCI_DRAM_OFFSET; 365 return (unsigned long)address - KERNELBASE + PCI_DRAM_OFFSET;
391#else
392 return iopa ((unsigned long) address);
393#endif
394} 366}
395 367
396extern inline void * bus_to_virt(unsigned long address) 368extern inline void * bus_to_virt(unsigned long address)
397{ 369{
398#ifndef CONFIG_APUS
399 if (address == 0) 370 if (address == 0)
400 return NULL; 371 return NULL;
401 return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE); 372 return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE);
402#else
403 return (void*) mm_ptov (address);
404#endif
405} 373}
406 374
407/* 375/*
@@ -410,20 +378,12 @@ extern inline void * bus_to_virt(unsigned long address)
410 */ 378 */
411extern inline unsigned long virt_to_phys(volatile void * address) 379extern inline unsigned long virt_to_phys(volatile void * address)
412{ 380{
413#ifndef CONFIG_APUS
414 return (unsigned long) address - KERNELBASE; 381 return (unsigned long) address - KERNELBASE;
415#else
416 return iopa ((unsigned long) address);
417#endif
418} 382}
419 383
420extern inline void * phys_to_virt(unsigned long address) 384extern inline void * phys_to_virt(unsigned long address)
421{ 385{
422#ifndef CONFIG_APUS
423 return (void *) (address + KERNELBASE); 386 return (void *) (address + KERNELBASE);
424#else
425 return (void*) mm_ptov (address);
426#endif
427} 387}
428 388
429/* 389/*
@@ -553,4 +513,7 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
553#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) | (_v)) 513#define setbits16(_addr, _v) out_be16((_addr), in_be16(_addr) | (_v))
554#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v)) 514#define clrbits16(_addr, _v) out_be16((_addr), in_be16(_addr) & ~(_v))
555 515
516#define setbits8(_addr, _v) out_8((_addr), in_8(_addr) | (_v))
517#define clrbits8(_addr, _v) out_8((_addr), in_8(_addr) & ~(_v))
518
556#endif /* __KERNEL__ */ 519#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h
index 293a444a1d77..a20b499b0186 100644
--- a/include/asm-ppc/machdep.h
+++ b/include/asm-ppc/machdep.h
@@ -8,10 +8,6 @@
8#include <asm/setup.h> 8#include <asm/setup.h>
9#include <asm/page.h> 9#include <asm/page.h>
10 10
11#ifdef CONFIG_APUS
12#include <asm-m68k/machdep.h>
13#endif
14
15struct pt_regs; 11struct pt_regs;
16struct pci_bus; 12struct pci_bus;
17struct pci_dev; 13struct pci_dev;
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
index 16dbc7d17450..1379a4f76de3 100644
--- a/include/asm-ppc/ocp.h
+++ b/include/asm-ppc/ocp.h
@@ -27,10 +27,10 @@
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/list.h> 28#include <linux/list.h>
29#include <linux/device.h> 29#include <linux/device.h>
30#include <linux/rwsem.h>
30 31
31#include <asm/mmu.h> 32#include <asm/mmu.h>
32#include <asm/ocp_ids.h> 33#include <asm/ocp_ids.h>
33#include <asm/rwsem.h>
34#include <asm/semaphore.h> 34#include <asm/semaphore.h>
35 35
36#ifdef CONFIG_PPC_OCP 36#ifdef CONFIG_PPC_OCP
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h
index fe95c8258cf9..ad4c5a1bc9d6 100644
--- a/include/asm-ppc/page.h
+++ b/include/asm-ppc/page.h
@@ -97,62 +97,22 @@ extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
97extern void copy_user_page(void *to, void *from, unsigned long vaddr, 97extern void copy_user_page(void *to, void *from, unsigned long vaddr,
98 struct page *pg); 98 struct page *pg);
99 99
100#ifndef CONFIG_APUS
101#define PPC_MEMSTART 0 100#define PPC_MEMSTART 0
102#define PPC_PGSTART 0
103#define PPC_MEMOFFSET PAGE_OFFSET 101#define PPC_MEMOFFSET PAGE_OFFSET
104#else
105extern unsigned long ppc_memstart;
106extern unsigned long ppc_pgstart;
107extern unsigned long ppc_memoffset;
108#define PPC_MEMSTART ppc_memstart
109#define PPC_PGSTART ppc_pgstart
110#define PPC_MEMOFFSET ppc_memoffset
111#endif
112 102
113#if defined(CONFIG_APUS) && !defined(MODULE)
114/* map phys->virtual and virtual->phys for RAM pages */
115static inline unsigned long ___pa(unsigned long v)
116{
117 unsigned long p;
118 asm volatile ("1: addis %0, %1, %2;"
119 ".section \".vtop_fixup\",\"aw\";"
120 ".align 1;"
121 ".long 1b;"
122 ".previous;"
123 : "=r" (p)
124 : "b" (v), "K" (((-PAGE_OFFSET) >> 16) & 0xffff));
125
126 return p;
127}
128static inline void* ___va(unsigned long p)
129{
130 unsigned long v;
131 asm volatile ("1: addis %0, %1, %2;"
132 ".section \".ptov_fixup\",\"aw\";"
133 ".align 1;"
134 ".long 1b;"
135 ".previous;"
136 : "=r" (v)
137 : "b" (p), "K" (((PAGE_OFFSET) >> 16) & 0xffff));
138
139 return (void*) v;
140}
141#else
142#define ___pa(vaddr) ((vaddr)-PPC_MEMOFFSET) 103#define ___pa(vaddr) ((vaddr)-PPC_MEMOFFSET)
143#define ___va(paddr) ((paddr)+PPC_MEMOFFSET) 104#define ___va(paddr) ((paddr)+PPC_MEMOFFSET)
144#endif
145 105
146extern int page_is_ram(unsigned long pfn); 106extern int page_is_ram(unsigned long pfn);
147 107
148#define __pa(x) ___pa((unsigned long)(x)) 108#define __pa(x) ___pa((unsigned long)(x))
149#define __va(x) ((void *)(___va((unsigned long)(x)))) 109#define __va(x) ((void *)(___va((unsigned long)(x))))
150 110
151#define ARCH_PFN_OFFSET (PPC_PGSTART) 111#define ARCH_PFN_OFFSET 0
152#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 112#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
153#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT) 113#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
154 114
155#define pfn_valid(pfn) (((pfn) - PPC_PGSTART) < max_mapnr) 115#define pfn_valid(pfn) ((pfn) < max_mapnr)
156#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 116#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
157 117
158/* Pure 2^n version of get_order */ 118/* Pure 2^n version of get_order */
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index c159315d2c8f..063ad91cbbcc 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -765,14 +765,6 @@ extern void paging_init(void);
765#define pte_to_pgoff(pte) (pte_val(pte) >> 3) 765#define pte_to_pgoff(pte) (pte_val(pte) >> 3)
766#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE }) 766#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })
767 767
768/* CONFIG_APUS */
769/* For virtual address to physical address conversion */
770extern void cache_clear(__u32 addr, int length);
771extern void cache_push(__u32 addr, int length);
772extern int mm_end_of_chunk (unsigned long addr, int len);
773extern unsigned long iopa(unsigned long addr);
774extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
775
776/* Values for nocacheflag and cmode */ 768/* Values for nocacheflag and cmode */
777/* These are not used by the APUS kernel_map, but prevents 769/* These are not used by the APUS kernel_map, but prevents
778 compilation errors. */ 770 compilation errors. */
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h
index 901f7fa8b2d7..71f4c996fe75 100644
--- a/include/asm-ppc/prom.h
+++ b/include/asm-ppc/prom.h
@@ -35,7 +35,6 @@ extern unsigned long sub_reloc_offset(unsigned long);
35#define machine_is_compatible(x) 0 35#define machine_is_compatible(x) 0
36#define of_find_compatible_node(f, t, c) NULL 36#define of_find_compatible_node(f, t, c) NULL
37#define of_get_property(p, n, l) NULL 37#define of_get_property(p, n, l) NULL
38#define get_property(a, b, c) of_get_property((a), (b), (c))
39 38
40#endif /* _PPC_PROM_H */ 39#endif /* _PPC_PROM_H */
41#endif /* __KERNEL__ */ 40#endif /* __KERNEL__ */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 8b17ffe222c4..d2da84acf45d 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -389,12 +389,14 @@ extern Elf64_Dyn _DYNAMIC [];
389 389
390#endif 390#endif
391 391
392/* Optional callbacks to write extra ELF notes. */
392#ifndef ARCH_HAVE_EXTRA_ELF_NOTES 393#ifndef ARCH_HAVE_EXTRA_ELF_NOTES
393static inline int arch_notes_size(void) { return 0; } 394static inline int elf_coredump_extra_notes_size(void) { return 0; }
394static inline void arch_write_notes(struct file *file) { } 395static inline int elf_coredump_extra_notes_write(struct file *file,
395 396 loff_t *foffset) { return 0; }
396#define ELF_CORE_EXTRA_NOTES_SIZE arch_notes_size() 397#else
397#define ELF_CORE_WRITE_EXTRA_NOTES arch_write_notes(file) 398extern int elf_coredump_extra_notes_size(void);
398#endif /* ARCH_HAVE_EXTRA_ELF_NOTES */ 399extern int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset);
400#endif
399 401
400#endif /* _LINUX_ELF_H */ 402#endif /* _LINUX_ELF_H */
diff --git a/include/linux/of.h b/include/linux/of.h
index 47734ffd9745..6df80e985914 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -54,7 +54,6 @@ extern int of_device_is_compatible(const struct device_node *device,
54extern const void *of_get_property(const struct device_node *node, 54extern const void *of_get_property(const struct device_node *node,
55 const char *name, 55 const char *name,
56 int *lenp); 56 int *lenp);
57#define get_property(a, b, c) of_get_property((a), (b), (c))
58extern int of_n_addr_cells(struct device_node *np); 57extern int of_n_addr_cells(struct device_node *np);
59extern int of_n_size_cells(struct device_node *np); 58extern int of_n_size_cells(struct device_node *np);
60 59
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 8acae4eeaa76..3948708c42ca 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2113,8 +2113,11 @@
2113#define PCI_DEVICE_ID_MPC8533 0x0031 2113#define PCI_DEVICE_ID_MPC8533 0x0031
2114#define PCI_DEVICE_ID_MPC8544E 0x0032 2114#define PCI_DEVICE_ID_MPC8544E 0x0032
2115#define PCI_DEVICE_ID_MPC8544 0x0033 2115#define PCI_DEVICE_ID_MPC8544 0x0033
2116#define PCI_DEVICE_ID_MPC8572E 0x0040
2117#define PCI_DEVICE_ID_MPC8572 0x0041
2116#define PCI_DEVICE_ID_MPC8641 0x7010 2118#define PCI_DEVICE_ID_MPC8641 0x7010
2117#define PCI_DEVICE_ID_MPC8641D 0x7011 2119#define PCI_DEVICE_ID_MPC8641D 0x7011
2120#define PCI_DEVICE_ID_MPC8610 0x7018
2118 2121
2119#define PCI_VENDOR_ID_PASEMI 0x1959 2122#define PCI_VENDOR_ID_PASEMI 0x1959
2120 2123
diff --git a/include/linux/xilinxfb.h b/include/linux/xilinxfb.h
new file mode 100644
index 000000000000..f2463f559fb9
--- /dev/null
+++ b/include/linux/xilinxfb.h
@@ -0,0 +1,30 @@
1/*
2 * Platform device data for Xilinx Framebuffer device
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#ifndef __XILINXFB_H__
12#define __XILINXFB_H__
13
14#include <linux/types.h>
15
16/* ML300/403 reference design framebuffer driver platform data struct */
17struct xilinxfb_platform_data {
18 u32 rotate_screen; /* Flag to rotate display 180 degrees */
19 u32 screen_height_mm; /* Physical dimentions of screen in mm */
20 u32 screen_width_mm;
21 u32 xres, yres; /* resolution of screen in pixels */
22 u32 xvirt, yvirt; /* resolution of memory buffer */
23
24 /* Physical address of framebuffer memory; If non-zero, driver
25 * will use provided memory address instead of allocating one from
26 * the consistent pool. */
27 u32 fb_phys;
28};
29
30#endif /* __XILINXFB_H__ */
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 53a456ebf6d5..c7314f952647 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1221,7 +1221,7 @@ static ctl_table fs_table[] = {
1221}; 1221};
1222 1222
1223static ctl_table debug_table[] = { 1223static ctl_table debug_table[] = {
1224#ifdef CONFIG_X86 1224#if defined(CONFIG_X86) || defined(CONFIG_PPC)
1225 { 1225 {
1226 .ctl_name = CTL_UNNUMBERED, 1226 .ctl_name = CTL_UNNUMBERED,
1227 .procname = "exception-trace", 1227 .procname = "exception-trace",
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index cdc9b099e620..396c38b3cb69 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -167,7 +167,7 @@ config SLUB_DEBUG_ON
167 167
168config DEBUG_PREEMPT 168config DEBUG_PREEMPT
169 bool "Debug preemptible kernel" 169 bool "Debug preemptible kernel"
170 depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT 170 depends on DEBUG_KERNEL && PREEMPT && (TRACE_IRQFLAGS_SUPPORT || PPC64)
171 default y 171 default y
172 help 172 help
173 If you say Y here then the kernel will use a debug variant of the 173 If you say Y here then the kernel will use a debug variant of the