aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/mx1ads.c2
-rw-r--r--arch/arm/mach-pxa/corgi.c18
-rw-r--r--arch/arm/mach-pxa/spitz.c18
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c18
-rw-r--r--arch/avr32/boards/atngw100/flash.c5
-rw-r--r--arch/avr32/boards/atngw100/setup.c14
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c1
-rw-r--r--arch/avr32/boards/atstk1000/flash.c5
-rw-r--r--arch/avr32/kernel/Makefile5
-rw-r--r--arch/avr32/kernel/entry-avr32b.S26
-rw-r--r--arch/avr32/kernel/setup.c2
-rw-r--r--arch/avr32/kernel/vmlinux.lds.S (renamed from arch/avr32/kernel/vmlinux.lds.c)9
-rw-r--r--arch/avr32/mach-at32ap/at32ap7000.c74
-rw-r--r--arch/avr32/mach-at32ap/clock.c116
-rw-r--r--arch/avr32/mach-at32ap/hsmc.c129
-rw-r--r--arch/avr32/mach-at32ap/pio.c4
-rw-r--r--arch/avr32/mach-at32ap/pm.h8
-rw-r--r--arch/avr32/mm/init.c12
-rw-r--r--arch/blackfin/Kconfig365
-rw-r--r--arch/blackfin/configs/BF533-EZKIT_defconfig243
-rw-r--r--arch/blackfin/configs/BF533-STAMP_defconfig280
-rw-r--r--arch/blackfin/configs/BF537-STAMP_defconfig296
-rw-r--r--arch/blackfin/configs/BF548-EZKIT_defconfig480
-rw-r--r--arch/blackfin/configs/BF561-EZKIT_defconfig223
-rw-r--r--arch/blackfin/configs/PNAV-10_defconfig296
-rw-r--r--arch/blackfin/kernel/Makefile5
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c81
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c549
-rw-r--r--arch/blackfin/kernel/bfin_ksyms.c1
-rw-r--r--arch/blackfin/kernel/cacheinit.c5
-rw-r--r--arch/blackfin/kernel/cplbinit.c7
-rw-r--r--arch/blackfin/kernel/early_printk.c214
-rw-r--r--arch/blackfin/kernel/irqchip.c12
-rw-r--r--arch/blackfin/kernel/process.c28
-rw-r--r--arch/blackfin/kernel/ptrace.c24
-rw-r--r--arch/blackfin/kernel/reboot.c78
-rw-r--r--arch/blackfin/kernel/setup.c90
-rw-r--r--arch/blackfin/kernel/traps.c110
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S48
-rw-r--r--arch/blackfin/lib/memcmp.S2
-rw-r--r--arch/blackfin/lib/memcpy.S2
-rw-r--r--arch/blackfin/lib/memmove.S4
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c81
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c91
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c119
-rw-r--r--arch/blackfin/mach-bf533/head.S344
-rw-r--r--arch/blackfin/mach-bf537/Kconfig27
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537.c87
-rw-r--r--arch/blackfin/mach-bf537/boards/generic_board.c397
-rw-r--r--arch/blackfin/mach-bf537/boards/pnav10.c53
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c142
-rw-r--r--arch/blackfin/mach-bf537/head.S128
-rw-r--r--arch/blackfin/mach-bf548/Kconfig11
-rw-r--r--arch/blackfin/mach-bf548/Makefile2
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c477
-rw-r--r--arch/blackfin/mach-bf548/gpio.c323
-rw-r--r--arch/blackfin/mach-bf548/head.S156
-rw-r--r--arch/blackfin/mach-bf561/boards/cm_bf561.c84
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c82
-rw-r--r--arch/blackfin/mach-bf561/head.S102
-rw-r--r--arch/blackfin/mach-common/Makefile2
-rw-r--r--arch/blackfin/mach-common/arch_checks.c60
-rw-r--r--arch/blackfin/mach-common/cache.S8
-rw-r--r--arch/blackfin/mach-common/cacheinit.S14
-rw-r--r--arch/blackfin/mach-common/cplbhdlr.S8
-rw-r--r--arch/blackfin/mach-common/cplbmgr.S56
-rw-r--r--arch/blackfin/mach-common/dpmc.S54
-rw-r--r--arch/blackfin/mach-common/entry.S268
-rw-r--r--arch/blackfin/mach-common/interrupt.S56
-rw-r--r--arch/blackfin/mach-common/ints-priority-dc.c13
-rw-r--r--arch/blackfin/mach-common/ints-priority-sc.c17
-rw-r--r--arch/blackfin/mach-common/lock.S24
-rw-r--r--arch/blackfin/mm/init.c2
-rw-r--r--arch/blackfin/oprofile/op_blackfin.h8
-rw-r--r--arch/i386/Kconfig18
-rw-r--r--arch/i386/Makefile72
-rw-r--r--arch/i386/kernel/Makefile88
-rw-r--r--arch/i386/kernel/early_printk.c2
-rw-r--r--arch/i386/kernel/quirks.c49
-rw-r--r--arch/i386/kernel/tsc_sync.c1
-rw-r--r--arch/i386/lib/Makefile11
-rw-r--r--arch/i386/mach-generic/Makefile7
-rw-r--r--arch/i386/mm/Makefile10
-rw-r--r--arch/ia64/hp/sim/simeth.c3
-rw-r--r--arch/ia64/ia32/audit.c2
-rw-r--r--arch/mips/Kconfig99
-rw-r--r--arch/mips/Makefile48
-rw-r--r--arch/mips/au1000/common/dbdma.c6
-rw-r--r--arch/mips/au1000/common/dbg_io.c2
-rw-r--r--arch/mips/au1000/common/irq.c15
-rw-r--r--arch/mips/au1000/common/pci.c1
-rw-r--r--arch/mips/au1000/common/power.c2
-rw-r--r--arch/mips/au1000/common/reset.c2
-rw-r--r--arch/mips/au1000/common/setup.c2
-rw-r--r--arch/mips/au1000/common/time.c46
-rw-r--r--arch/mips/au1000/db1x00/board_setup.c2
-rw-r--r--arch/mips/au1000/db1x00/init.c8
-rw-r--r--arch/mips/au1000/mtx-1/board_setup.c6
-rw-r--r--arch/mips/au1000/mtx-1/init.c1
-rw-r--r--arch/mips/au1000/pb1000/board_setup.c8
-rw-r--r--arch/mips/au1000/pb1000/init.c1
-rw-r--r--arch/mips/au1000/pb1100/board_setup.c6
-rw-r--r--arch/mips/au1000/pb1100/init.c1
-rw-r--r--arch/mips/au1000/pb1200/board_setup.c8
-rw-r--r--arch/mips/au1000/pb1200/init.c1
-rw-r--r--arch/mips/au1000/pb1200/irqmap.c2
-rw-r--r--arch/mips/au1000/pb1500/board_setup.c8
-rw-r--r--arch/mips/au1000/pb1500/init.c1
-rw-r--r--arch/mips/au1000/pb1550/board_setup.c2
-rw-r--r--arch/mips/au1000/pb1550/init.c1
-rw-r--r--arch/mips/au1000/xxs1500/board_setup.c2
-rw-r--r--arch/mips/au1000/xxs1500/init.c1
-rw-r--r--arch/mips/basler/excite/excite_prom.c1
-rw-r--r--arch/mips/basler/excite/excite_setup.c17
-rw-r--r--arch/mips/bcm47xx/Makefile6
-rw-r--r--arch/mips/bcm47xx/gpio.c79
-rw-r--r--arch/mips/bcm47xx/irq.c55
-rw-r--r--arch/mips/bcm47xx/prom.c158
-rw-r--r--arch/mips/bcm47xx/serial.c52
-rw-r--r--arch/mips/bcm47xx/setup.c123
-rw-r--r--arch/mips/bcm47xx/time.c55
-rw-r--r--arch/mips/bcm47xx/wgt634u.c64
-rw-r--r--arch/mips/boot/addinitrd.c60
-rw-r--r--arch/mips/boot/elf2ecoff.c2
-rw-r--r--arch/mips/cobalt/Makefile2
-rw-r--r--arch/mips/cobalt/console.c9
-rw-r--r--arch/mips/cobalt/irq.c116
-rw-r--r--arch/mips/cobalt/led.c62
-rw-r--r--arch/mips/cobalt/reset.c39
-rw-r--r--arch/mips/cobalt/rtc.c5
-rw-r--r--arch/mips/cobalt/serial.c7
-rw-r--r--arch/mips/cobalt/setup.c20
-rw-r--r--arch/mips/configs/bigsur_defconfig3
-rw-r--r--arch/mips/configs/cobalt_defconfig23
-rw-r--r--arch/mips/configs/lasat_defconfig828
-rw-r--r--arch/mips/configs/mtx1_defconfig3115
-rw-r--r--arch/mips/configs/sb1250-swarm_defconfig3
-rw-r--r--arch/mips/dec/ecc-berr.c2
-rw-r--r--arch/mips/dec/kn02xa-berr.c2
-rw-r--r--arch/mips/dec/prom/identify.c3
-rw-r--r--arch/mips/dec/prom/init.c8
-rw-r--r--arch/mips/dec/setup.c4
-rw-r--r--arch/mips/dec/time.c13
-rw-r--r--arch/mips/emma2rh/common/prom.c2
-rw-r--r--arch/mips/emma2rh/markeins/setup.c4
-rw-r--r--arch/mips/fw/arc/Makefile (renamed from arch/mips/arc/Makefile)0
-rw-r--r--arch/mips/fw/arc/arc_con.c (renamed from arch/mips/arc/arc_con.c)0
-rw-r--r--arch/mips/fw/arc/cmdline.c (renamed from arch/mips/arc/cmdline.c)0
-rw-r--r--arch/mips/fw/arc/env.c (renamed from arch/mips/arc/env.c)2
-rw-r--r--arch/mips/fw/arc/file.c (renamed from arch/mips/arc/file.c)2
-rw-r--r--arch/mips/fw/arc/identify.c (renamed from arch/mips/arc/identify.c)82
-rw-r--r--arch/mips/fw/arc/init.c (renamed from arch/mips/arc/init.c)0
-rw-r--r--arch/mips/fw/arc/memory.c (renamed from arch/mips/arc/memory.c)6
-rw-r--r--arch/mips/fw/arc/misc.c (renamed from arch/mips/arc/misc.c)2
-rw-r--r--arch/mips/fw/arc/promlib.c (renamed from arch/mips/arc/promlib.c)0
-rw-r--r--arch/mips/fw/arc/salone.c (renamed from arch/mips/arc/salone.c)0
-rw-r--r--arch/mips/fw/arc/time.c (renamed from arch/mips/arc/time.c)2
-rw-r--r--arch/mips/fw/arc/tree.c (renamed from arch/mips/arc/tree.c)2
-rw-r--r--arch/mips/fw/cfe/Makefile5
-rw-r--r--arch/mips/fw/cfe/cfe_api.c (renamed from arch/mips/sibyte/cfe/cfe_api.c)2
-rw-r--r--arch/mips/fw/cfe/cfe_api_int.h (renamed from arch/mips/sibyte/cfe/cfe_api_int.h)0
-rw-r--r--arch/mips/gt64120/wrppmc/Makefile2
-rw-r--r--arch/mips/gt64120/wrppmc/irq.c23
-rw-r--r--arch/mips/gt64120/wrppmc/pci.c3
-rw-r--r--arch/mips/gt64120/wrppmc/reset.c10
-rw-r--r--arch/mips/gt64120/wrppmc/serial.c80
-rw-r--r--arch/mips/gt64120/wrppmc/setup.c39
-rw-r--r--arch/mips/gt64120/wrppmc/time.c13
-rw-r--r--arch/mips/jazz/Makefile2
-rw-r--r--arch/mips/jazz/irq.c142
-rw-r--r--arch/mips/jazz/jazz-platform.c60
-rw-r--r--arch/mips/jazz/jazzdma.c47
-rw-r--r--arch/mips/jazz/reset.c4
-rw-r--r--arch/mips/jazz/setup.c134
-rw-r--r--arch/mips/jmr3927/rbhma3100/init.c1
-rw-r--r--arch/mips/jmr3927/rbhma3100/irq.c8
-rw-r--r--arch/mips/jmr3927/rbhma3100/setup.c4
-rw-r--r--arch/mips/kernel/Makefile2
-rw-r--r--arch/mips/kernel/binfmt_elfo32.c2
-rw-r--r--arch/mips/kernel/cpu-bugs64.c2
-rw-r--r--arch/mips/kernel/cpu-probe.c129
-rw-r--r--arch/mips/kernel/gdb-stub.c26
-rw-r--r--arch/mips/kernel/i8253.c213
-rw-r--r--arch/mips/kernel/i8259.c37
-rw-r--r--arch/mips/kernel/irixelf.c40
-rw-r--r--arch/mips/kernel/irixinv.c42
-rw-r--r--arch/mips/kernel/irixioctl.c2
-rw-r--r--arch/mips/kernel/irixsig.c8
-rw-r--r--arch/mips/kernel/irq-gt641xx.c131
-rw-r--r--arch/mips/kernel/irq-msc01.c4
-rw-r--r--arch/mips/kernel/irq.c4
-rw-r--r--arch/mips/kernel/kspd.c12
-rw-r--r--arch/mips/kernel/linux32.c24
-rw-r--r--arch/mips/kernel/mips-mt.c2
-rw-r--r--arch/mips/kernel/proc.c73
-rw-r--r--arch/mips/kernel/process.c11
-rw-r--r--arch/mips/kernel/ptrace.c50
-rw-r--r--arch/mips/kernel/ptrace32.c16
-rw-r--r--arch/mips/kernel/setup.c2
-rw-r--r--arch/mips/kernel/signal.c4
-rw-r--r--arch/mips/kernel/signal32.c44
-rw-r--r--arch/mips/kernel/signal_n32.c4
-rw-r--r--arch/mips/kernel/smp-mt.c2
-rw-r--r--arch/mips/kernel/smp.c123
-rw-r--r--arch/mips/kernel/smtc.c146
-rw-r--r--arch/mips/kernel/syscall.c60
-rw-r--r--arch/mips/kernel/sysirix.c22
-rw-r--r--arch/mips/kernel/time.c416
-rw-r--r--arch/mips/kernel/traps.c45
-rw-r--r--arch/mips/kernel/unaligned.c2
-rw-r--r--arch/mips/kernel/vmlinux.lds.S339
-rw-r--r--arch/mips/kernel/vpe.c47
-rw-r--r--arch/mips/lasat/Kconfig15
-rw-r--r--arch/mips/lasat/Makefile16
-rw-r--r--arch/mips/lasat/at93c.c149
-rw-r--r--arch/mips/lasat/at93c.h18
-rw-r--r--arch/mips/lasat/ds1603.c183
-rw-r--r--arch/mips/lasat/ds1603.h31
-rw-r--r--arch/mips/lasat/image/Makefile54
-rw-r--r--arch/mips/lasat/image/head.S31
-rw-r--r--arch/mips/lasat/image/romscript.normal23
-rw-r--r--arch/mips/lasat/interrupt.c130
-rw-r--r--arch/mips/lasat/lasat_board.c280
-rw-r--r--arch/mips/lasat/lasat_models.h67
-rw-r--r--arch/mips/lasat/picvue.c244
-rw-r--r--arch/mips/lasat/picvue.h48
-rw-r--r--arch/mips/lasat/picvue_proc.c191
-rw-r--r--arch/mips/lasat/prom.c126
-rw-r--r--arch/mips/lasat/prom.h7
-rw-r--r--arch/mips/lasat/reset.c61
-rw-r--r--arch/mips/lasat/serial.c94
-rw-r--r--arch/mips/lasat/setup.c154
-rw-r--r--arch/mips/lasat/sysctl.c456
-rw-r--r--arch/mips/lasat/sysctl.h24
-rw-r--r--arch/mips/lemote/lm2e/Makefile1
-rw-r--r--arch/mips/lemote/lm2e/prom.c1
-rw-r--r--arch/mips/lemote/lm2e/setup.c7
-rw-r--r--arch/mips/lib/ucmpdi2.c2
-rw-r--r--arch/mips/math-emu/cp1emu.c32
-rw-r--r--arch/mips/math-emu/dp_mul.c2
-rw-r--r--arch/mips/math-emu/ieee754.c12
-rw-r--r--arch/mips/math-emu/ieee754dp.h12
-rw-r--r--arch/mips/math-emu/ieee754int.h30
-rw-r--r--arch/mips/math-emu/ieee754sp.h12
-rw-r--r--arch/mips/mips-boards/atlas/atlas_gdb.c2
-rw-r--r--arch/mips/mips-boards/atlas/atlas_int.c22
-rw-r--r--arch/mips/mips-boards/atlas/atlas_setup.c7
-rw-r--r--arch/mips/mips-boards/generic/init.c12
-rw-r--r--arch/mips/mips-boards/generic/memory.c4
-rw-r--r--arch/mips/mips-boards/generic/pci.c2
-rw-r--r--arch/mips/mips-boards/generic/time.c149
-rw-r--r--arch/mips/mips-boards/malta/malta_int.c36
-rw-r--r--arch/mips/mips-boards/malta/malta_setup.c16
-rw-r--r--arch/mips/mips-boards/malta/malta_smtc.c50
-rw-r--r--arch/mips/mips-boards/sead/sead_int.c2
-rw-r--r--arch/mips/mips-boards/sead/sead_setup.c5
-rw-r--r--arch/mips/mipssim/sim_int.c2
-rw-r--r--arch/mips/mipssim/sim_mem.c4
-rw-r--r--arch/mips/mipssim/sim_setup.c2
-rw-r--r--arch/mips/mipssim/sim_time.c76
-rw-r--r--arch/mips/mm/Makefile2
-rw-r--r--arch/mips/mm/c-r3k.c12
-rw-r--r--arch/mips/mm/c-r4k.c116
-rw-r--r--arch/mips/mm/c-sb1.c535
-rw-r--r--arch/mips/mm/c-tx39.c6
-rw-r--r--arch/mips/mm/cache.c9
-rw-r--r--arch/mips/mm/cerr-sb1.c24
-rw-r--r--arch/mips/mm/dma-default.c4
-rw-r--r--arch/mips/mm/pg-r4k.c22
-rw-r--r--arch/mips/mm/pg-sb1.c12
-rw-r--r--arch/mips/mm/pgtable.c8
-rw-r--r--arch/mips/mm/sc-mips.c2
-rw-r--r--arch/mips/mm/tlb-r4k.c2
-rw-r--r--arch/mips/mm/tlb-r8k.c2
-rw-r--r--arch/mips/mm/tlbex.c210
-rw-r--r--arch/mips/oprofile/common.c2
-rw-r--r--arch/mips/oprofile/op_model_mipsxx.c6
-rw-r--r--arch/mips/oprofile/op_model_rm9000.c2
-rw-r--r--arch/mips/pci/Makefile2
-rw-r--r--arch/mips/pci/fixup-atlas.c6
-rw-r--r--arch/mips/pci/fixup-cobalt.c40
-rw-r--r--arch/mips/pci/ops-au1000.c2
-rw-r--r--arch/mips/pci/ops-mace.c21
-rw-r--r--arch/mips/pci/ops-nile4.c147
-rw-r--r--arch/mips/pci/ops-sni.c22
-rw-r--r--arch/mips/pci/pci-bcm1480.c6
-rw-r--r--arch/mips/pci/pci-bcm1480ht.c4
-rw-r--r--arch/mips/pci/pci-lasat.c91
-rw-r--r--arch/mips/pci/pci-sb1250.c4
-rw-r--r--arch/mips/pci/pci-vr41xx.c2
-rw-r--r--arch/mips/philips/pnx8550/common/proc.c36
-rw-r--r--arch/mips/philips/pnx8550/common/setup.c3
-rw-r--r--arch/mips/philips/pnx8550/common/time.c7
-rw-r--r--arch/mips/philips/pnx8550/jbs/init.c1
-rw-r--r--arch/mips/philips/pnx8550/stb810/prom_init.c1
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_hwbutton.c2
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_serial.c8
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_setup.c18
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_time.c3
-rw-r--r--arch/mips/pmc-sierra/msp71xx/msp_usb.c8
-rw-r--r--arch/mips/pmc-sierra/yosemite/ht.c2
-rw-r--r--arch/mips/pmc-sierra/yosemite/prom.c1
-rw-r--r--arch/mips/pmc-sierra/yosemite/setup.c26
-rw-r--r--arch/mips/qemu/q-firmware.c2
-rw-r--r--arch/mips/qemu/q-irq.c4
-rw-r--r--arch/mips/qemu/q-setup.c10
-rw-r--r--arch/mips/sgi-ip22/ip22-eisa.c2
-rw-r--r--arch/mips/sgi-ip22/ip22-int.c7
-rw-r--r--arch/mips/sgi-ip22/ip22-setup.c2
-rw-r--r--arch/mips/sgi-ip22/ip22-time.c35
-rw-r--r--arch/mips/sgi-ip27/ip27-berr.c2
-rw-r--r--arch/mips/sgi-ip27/ip27-init.c6
-rw-r--r--arch/mips/sgi-ip27/ip27-smp.c4
-rw-r--r--arch/mips/sgi-ip27/ip27-timer.c38
-rw-r--r--arch/mips/sgi-ip32/crime.c6
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c44
-rw-r--r--arch/mips/sgi-ip32/ip32-memory.c4
-rw-r--r--arch/mips/sgi-ip32/ip32-setup.c12
-rw-r--r--arch/mips/sibyte/Kconfig13
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c21
-rw-r--r--arch/mips/sibyte/bcm1480/setup.c78
-rw-r--r--arch/mips/sibyte/bcm1480/time.c118
-rw-r--r--arch/mips/sibyte/cfe/Makefile2
-rw-r--r--arch/mips/sibyte/cfe/cfe_api.h185
-rw-r--r--arch/mips/sibyte/cfe/cfe_error.h85
-rw-r--r--arch/mips/sibyte/cfe/console.c6
-rw-r--r--arch/mips/sibyte/cfe/setup.c7
-rw-r--r--arch/mips/sibyte/cfe/smp.c4
-rw-r--r--arch/mips/sibyte/common/Makefile1
-rw-r--r--arch/mips/sibyte/common/sb_tbprof.c4
-rw-r--r--arch/mips/sibyte/sb1250/irq.c58
-rw-r--r--arch/mips/sibyte/sb1250/prom.c3
-rw-r--r--arch/mips/sibyte/sb1250/setup.c74
-rw-r--r--arch/mips/sibyte/sb1250/time.c198
-rw-r--r--arch/mips/sibyte/swarm/dbg_io.c4
-rw-r--r--arch/mips/sibyte/swarm/rtc_m41t81.c3
-rw-r--r--arch/mips/sibyte/swarm/rtc_xicor1241.c3
-rw-r--r--arch/mips/sibyte/swarm/setup.c56
-rw-r--r--arch/mips/sni/a20r.c6
-rw-r--r--arch/mips/sni/pcimt.c5
-rw-r--r--arch/mips/sni/pcit.c27
-rw-r--r--arch/mips/sni/reset.c2
-rw-r--r--arch/mips/sni/rm200.c11
-rw-r--r--arch/mips/sni/setup.c8
-rw-r--r--arch/mips/sni/sniprom.c8
-rw-r--r--arch/mips/sni/time.c27
-rw-r--r--arch/mips/tx4927/common/tx4927_dbgio.c1
-rw-r--r--arch/mips/tx4927/common/tx4927_prom.c12
-rw-r--r--arch/mips/tx4927/common/tx4927_setup.c20
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c33
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c2
-rw-r--r--arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c36
-rw-r--r--arch/mips/tx4938/common/setup.c9
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/prom.c1
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/setup.c7
-rw-r--r--arch/mips/vr41xx/common/bcu.c8
-rw-r--r--arch/mips/vr41xx/common/cmu.c16
-rw-r--r--arch/mips/vr41xx/common/giu.c2
-rw-r--r--arch/mips/vr41xx/common/icu.c76
-rw-r--r--arch/mips/vr41xx/common/init.c8
-rw-r--r--arch/mips/vr41xx/common/pmu.c40
-rw-r--r--arch/mips/vr41xx/common/rtc.c2
-rw-r--r--arch/mips/vr41xx/common/siu.c2
-rw-r--r--arch/mips/vr41xx/nec-cmbvr4133/init.c6
-rw-r--r--arch/mips/vr41xx/nec-cmbvr4133/m1535plus.c6
-rw-r--r--arch/mips/vr41xx/nec-cmbvr4133/setup.c1
-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.c98
-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/Kconfig33
-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/Kconfig4
-rw-r--r--arch/powerpc/platforms/cell/Makefile4
-rw-r--r--arch/powerpc/platforms/cell/axon_msi.c35
-rw-r--r--arch/powerpc/platforms/cell/cbe_cpufreq.c2
-rw-r--r--arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c2
-rw-r--r--arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c2
-rw-r--r--arch/powerpc/platforms/cell/cbe_regs.c3
-rw-r--r--arch/powerpc/platforms/cell/cbe_regs.h271
-rw-r--r--arch/powerpc/platforms/cell/cbe_thermal.c2
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c4
-rw-r--r--arch/powerpc/platforms/cell/iommu.c2
-rw-r--r--arch/powerpc/platforms/cell/pervasive.c2
-rw-r--r--arch/powerpc/platforms/cell/pmu.c2
-rw-r--r--arch/powerpc/platforms/cell/ras.c2
-rw-r--r--arch/powerpc/platforms/cell/setup.c17
-rw-r--r--arch/powerpc/platforms/cell/spider-pic.c22
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c8
-rw-r--r--arch/powerpc/platforms/cell/spu_callbacks.c4
-rw-r--r--arch/powerpc/platforms/cell/spu_coredump.c79
-rw-r--r--arch/powerpc/platforms/cell/spu_manage.c4
-rw-r--r--arch/powerpc/platforms/cell/spu_syscalls.c142
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c236
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c251
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c15
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c49
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h7
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c31
-rw-r--r--arch/powerpc/platforms/cell/spufs/syscalls.c48
-rw-r--r--arch/powerpc/platforms/celleb/Kconfig1
-rw-r--r--arch/powerpc/platforms/celleb/Makefile5
-rw-r--r--arch/powerpc/platforms/celleb/beat.c106
-rw-r--r--arch/powerpc/platforms/celleb/beat.h2
-rw-r--r--arch/powerpc/platforms/celleb/beat_syscall.h4
-rw-r--r--arch/powerpc/platforms/celleb/beat_wrapper.h68
-rw-r--r--arch/powerpc/platforms/celleb/htab.c152
-rw-r--r--arch/powerpc/platforms/celleb/interrupt.c9
-rw-r--r--arch/powerpc/platforms/celleb/io-workarounds.c279
-rw-r--r--arch/powerpc/platforms/celleb/pci.c98
-rw-r--r--arch/powerpc/platforms/celleb/pci.h9
-rw-r--r--arch/powerpc/platforms/celleb/scc.h2
-rw-r--r--arch/powerpc/platforms/celleb/scc_epci.c88
-rw-r--r--arch/powerpc/platforms/celleb/scc_sio.c56
-rw-r--r--arch/powerpc/platforms/celleb/setup.c27
-rw-r--r--arch/powerpc/platforms/chrp/gg2.h61
-rw-r--r--arch/powerpc/platforms/chrp/pci.c39
-rw-r--r--arch/powerpc/platforms/chrp/setup.c13
-rw-r--r--arch/powerpc/platforms/chrp/smp.c2
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig12
-rw-r--r--arch/powerpc/platforms/embedded6xx/holly.c14
-rw-r--r--arch/powerpc/platforms/embedded6xx/linkstation.c8
-rw-r--r--arch/powerpc/platforms/embedded6xx/ls_uart.c18
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc10x.h180
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c5
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h21
-rw-r--r--arch/powerpc/platforms/embedded6xx/prpmc2800.c8
-rw-r--r--arch/powerpc/platforms/iseries/Makefile3
-rw-r--r--arch/powerpc/platforms/iseries/dt.c17
-rw-r--r--arch/powerpc/platforms/iseries/exception.S251
-rw-r--r--arch/powerpc/platforms/iseries/exception.h58
-rw-r--r--arch/powerpc/platforms/iseries/htab.c13
-rw-r--r--arch/powerpc/platforms/iseries/iommu.c52
-rw-r--r--arch/powerpc/platforms/iseries/irq.c10
-rw-r--r--arch/powerpc/platforms/iseries/it_lp_naca.h2
-rw-r--r--arch/powerpc/platforms/iseries/mf.c23
-rw-r--r--arch/powerpc/platforms/iseries/setup.c7
-rw-r--r--arch/powerpc/platforms/iseries/vio.c553
-rw-r--r--arch/powerpc/platforms/iseries/viopath.c8
-rw-r--r--arch/powerpc/platforms/maple/pci.c21
-rw-r--r--arch/powerpc/platforms/pasemi/Kconfig11
-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.c19
-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.c12
-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--arch/s390/appldata/appldata_base.c59
-rw-r--r--arch/s390/appldata/appldata_net_sum.c3
-rw-r--r--arch/s390/crypto/aes_s390.c2
-rw-r--r--arch/s390/crypto/sha1_s390.c16
-rw-r--r--arch/s390/crypto/sha256_s390.c22
-rw-r--r--arch/s390/kernel/audit.c7
-rw-r--r--arch/s390/kernel/audit.h15
-rw-r--r--arch/s390/kernel/compat_audit.c1
-rw-r--r--arch/s390/kernel/cpcmd.c100
-rw-r--r--arch/s390/kernel/dis.c5
-rw-r--r--arch/s390/kernel/ipl.c4
-rw-r--r--arch/s390/kernel/irq.c1
-rw-r--r--arch/s390/kernel/vmlinux.lds.S234
-rw-r--r--arch/s390/mm/fault.c2
-rw-r--r--arch/sh/kernel/irq.c1
-rw-r--r--arch/sparc64/kernel/pci_common.c4
-rw-r--r--arch/sparc64/kernel/prom.c3
-rw-r--r--arch/sparc64/kernel/smp.c2
-rw-r--r--arch/sparc64/kernel/vio.c29
-rw-r--r--arch/sparc64/lib/NGmemcpy.S8
-rw-r--r--arch/sparc64/solaris/ioctl.c3
-rw-r--r--arch/um/sys-i386/sys_call_table.S2
-rw-r--r--arch/um/sys-x86_64/syscall_table.c4
-rw-r--r--arch/x86/boot/.gitignore (renamed from arch/i386/boot/.gitignore)0
-rw-r--r--arch/x86/boot/Makefile (renamed from arch/i386/boot/Makefile)2
-rw-r--r--arch/x86/boot/a20.c (renamed from arch/i386/boot/a20.c)0
-rw-r--r--arch/x86/boot/apm.c (renamed from arch/i386/boot/apm.c)0
-rw-r--r--arch/x86/boot/bitops.h (renamed from arch/i386/boot/bitops.h)0
-rw-r--r--arch/x86/boot/boot.h (renamed from arch/i386/boot/boot.h)0
-rw-r--r--arch/x86/boot/cmdline.c (renamed from arch/i386/boot/cmdline.c)0
-rw-r--r--arch/x86/boot/code16gcc.h (renamed from arch/i386/boot/code16gcc.h)0
-rw-r--r--arch/x86/boot/compressed/.gitignore (renamed from arch/i386/boot/compressed/.gitignore)0
-rw-r--r--arch/x86/boot/compressed/Makefile5
-rw-r--r--arch/x86/boot/compressed/Makefile_32 (renamed from arch/i386/boot/compressed/Makefile)8
-rw-r--r--arch/x86/boot/compressed/Makefile_64 (renamed from arch/x86_64/boot/compressed/Makefile)8
-rw-r--r--arch/x86/boot/compressed/head_32.S (renamed from arch/i386/boot/compressed/head.S)0
-rw-r--r--arch/x86/boot/compressed/head_64.S (renamed from arch/x86_64/boot/compressed/head.S)2
-rw-r--r--arch/x86/boot/compressed/misc_32.c (renamed from arch/i386/boot/compressed/misc.c)0
-rw-r--r--arch/x86/boot/compressed/misc_64.c (renamed from arch/x86_64/boot/compressed/misc.c)0
-rw-r--r--arch/x86/boot/compressed/relocs.c (renamed from arch/i386/boot/compressed/relocs.c)0
-rw-r--r--arch/x86/boot/compressed/vmlinux_32.lds (renamed from arch/i386/boot/compressed/vmlinux.lds)0
-rw-r--r--arch/x86/boot/compressed/vmlinux_32.scr (renamed from arch/i386/boot/compressed/vmlinux.scr)0
-rw-r--r--arch/x86/boot/compressed/vmlinux_64.lds (renamed from arch/x86_64/boot/compressed/vmlinux.lds)0
-rw-r--r--arch/x86/boot/compressed/vmlinux_64.scr (renamed from arch/x86_64/boot/compressed/vmlinux.scr)0
-rw-r--r--arch/x86/boot/copy.S (renamed from arch/i386/boot/copy.S)0
-rw-r--r--arch/x86/boot/cpu.c (renamed from arch/i386/boot/cpu.c)0
-rw-r--r--arch/x86/boot/cpucheck.c (renamed from arch/i386/boot/cpucheck.c)0
-rw-r--r--arch/x86/boot/edd.c (renamed from arch/i386/boot/edd.c)0
-rw-r--r--arch/x86/boot/header.S (renamed from arch/i386/boot/header.S)0
-rw-r--r--arch/x86/boot/install.sh (renamed from arch/i386/boot/install.sh)0
-rw-r--r--arch/x86/boot/main.c (renamed from arch/i386/boot/main.c)0
-rw-r--r--arch/x86/boot/mca.c (renamed from arch/i386/boot/mca.c)0
-rw-r--r--arch/x86/boot/memory.c (renamed from arch/i386/boot/memory.c)0
-rw-r--r--arch/x86/boot/mtools.conf.in (renamed from arch/i386/boot/mtools.conf.in)0
-rw-r--r--arch/x86/boot/pm.c (renamed from arch/i386/boot/pm.c)0
-rw-r--r--arch/x86/boot/pmjump.S (renamed from arch/i386/boot/pmjump.S)0
-rw-r--r--arch/x86/boot/printf.c (renamed from arch/i386/boot/printf.c)0
-rw-r--r--arch/x86/boot/setup.ld (renamed from arch/i386/boot/setup.ld)0
-rw-r--r--arch/x86/boot/string.c (renamed from arch/i386/boot/string.c)0
-rw-r--r--arch/x86/boot/tools/.gitignore (renamed from arch/i386/boot/tools/.gitignore)0
-rw-r--r--arch/x86/boot/tools/build.c (renamed from arch/i386/boot/tools/build.c)0
-rw-r--r--arch/x86/boot/tty.c (renamed from arch/i386/boot/tty.c)0
-rw-r--r--arch/x86/boot/version.c (renamed from arch/i386/boot/version.c)0
-rw-r--r--arch/x86/boot/vesa.h (renamed from arch/i386/boot/vesa.h)0
-rw-r--r--arch/x86/boot/video-bios.c (renamed from arch/i386/boot/video-bios.c)0
-rw-r--r--arch/x86/boot/video-vesa.c (renamed from arch/i386/boot/video-vesa.c)0
-rw-r--r--arch/x86/boot/video-vga.c (renamed from arch/i386/boot/video-vga.c)0
-rw-r--r--arch/x86/boot/video.c (renamed from arch/i386/boot/video.c)0
-rw-r--r--arch/x86/boot/video.h (renamed from arch/i386/boot/video.h)0
-rw-r--r--arch/x86/boot/voyager.c (renamed from arch/i386/boot/voyager.c)0
-rw-r--r--arch/x86/crypto/Makefile5
-rw-r--r--arch/x86/crypto/Makefile_32 (renamed from arch/i386/crypto/Makefile)6
-rw-r--r--arch/x86/crypto/Makefile_64 (renamed from arch/x86_64/crypto/Makefile)6
-rw-r--r--arch/x86/crypto/aes-i586-asm_32.S (renamed from arch/i386/crypto/aes-i586-asm.S)0
-rw-r--r--arch/x86/crypto/aes-x86_64-asm_64.S (renamed from arch/x86_64/crypto/aes-x86_64-asm.S)0
-rw-r--r--arch/x86/crypto/aes_32.c (renamed from arch/i386/crypto/aes.c)0
-rw-r--r--arch/x86/crypto/aes_64.c (renamed from arch/x86_64/crypto/aes.c)0
-rw-r--r--arch/x86/crypto/twofish-i586-asm_32.S (renamed from arch/i386/crypto/twofish-i586-asm.S)0
-rw-r--r--arch/x86/crypto/twofish-x86_64-asm_64.S (renamed from arch/x86_64/crypto/twofish-x86_64-asm.S)0
-rw-r--r--arch/x86/crypto/twofish_32.c (renamed from arch/i386/crypto/twofish.c)0
-rw-r--r--arch/x86/crypto/twofish_64.c (renamed from arch/x86_64/crypto/twofish.c)0
-rw-r--r--arch/x86/ia32/Makefile (renamed from arch/x86_64/ia32/Makefile)0
-rw-r--r--arch/x86/ia32/audit.c (renamed from arch/x86_64/ia32/audit.c)2
-rw-r--r--arch/x86/ia32/fpu32.c (renamed from arch/x86_64/ia32/fpu32.c)0
-rw-r--r--arch/x86/ia32/ia32_aout.c (renamed from arch/x86_64/ia32/ia32_aout.c)0
-rw-r--r--arch/x86/ia32/ia32_binfmt.c (renamed from arch/x86_64/ia32/ia32_binfmt.c)0
-rw-r--r--arch/x86/ia32/ia32_signal.c (renamed from arch/x86_64/ia32/ia32_signal.c)0
-rw-r--r--arch/x86/ia32/ia32entry.S (renamed from arch/x86_64/ia32/ia32entry.S)0
-rw-r--r--arch/x86/ia32/ipc32.c (renamed from arch/x86_64/ia32/ipc32.c)2
-rw-r--r--arch/x86/ia32/mmap32.c (renamed from arch/x86_64/ia32/mmap32.c)0
-rw-r--r--arch/x86/ia32/ptrace32.c (renamed from arch/x86_64/ia32/ptrace32.c)0
-rw-r--r--arch/x86/ia32/sys_ia32.c (renamed from arch/x86_64/ia32/sys_ia32.c)0
-rw-r--r--arch/x86/ia32/syscall32.c (renamed from arch/x86_64/ia32/syscall32.c)0
-rw-r--r--arch/x86/ia32/syscall32_syscall.S (renamed from arch/x86_64/ia32/syscall32_syscall.S)4
-rw-r--r--arch/x86/ia32/tls32.c (renamed from arch/x86_64/ia32/tls32.c)0
-rw-r--r--arch/x86/ia32/vsyscall-sigreturn.S (renamed from arch/x86_64/ia32/vsyscall-sigreturn.S)2
-rw-r--r--arch/x86/ia32/vsyscall-syscall.S (renamed from arch/x86_64/ia32/vsyscall-syscall.S)0
-rw-r--r--arch/x86/ia32/vsyscall-sysenter.S (renamed from arch/x86_64/ia32/vsyscall-sysenter.S)0
-rw-r--r--arch/x86/ia32/vsyscall.lds (renamed from arch/x86_64/ia32/vsyscall.lds)0
-rw-r--r--arch/x86/kernel/.gitignore (renamed from arch/i386/kernel/.gitignore)0
-rw-r--r--arch/x86/kernel/Makefile5
-rw-r--r--arch/x86/kernel/Makefile_3286
-rw-r--r--arch/x86/kernel/Makefile_6454
-rw-r--r--arch/x86/kernel/acpi/Makefile5
-rw-r--r--arch/x86/kernel/acpi/Makefile_32 (renamed from arch/i386/kernel/acpi/Makefile)4
-rw-r--r--arch/x86/kernel/acpi/Makefile_647
-rw-r--r--arch/x86/kernel/acpi/boot.c (renamed from arch/i386/kernel/acpi/boot.c)8
-rw-r--r--arch/x86/kernel/acpi/cstate.c (renamed from arch/i386/kernel/acpi/cstate.c)0
-rw-r--r--arch/x86/kernel/acpi/earlyquirk_32.c (renamed from arch/i386/kernel/acpi/earlyquirk.c)0
-rw-r--r--arch/x86/kernel/acpi/processor.c (renamed from arch/i386/kernel/acpi/processor.c)0
-rw-r--r--arch/x86/kernel/acpi/sleep_32.c (renamed from arch/i386/kernel/acpi/sleep.c)2
-rw-r--r--arch/x86/kernel/acpi/sleep_64.c (renamed from arch/x86_64/kernel/acpi/sleep.c)0
-rw-r--r--arch/x86/kernel/acpi/wakeup_32.S (renamed from arch/i386/kernel/acpi/wakeup.S)0
-rw-r--r--arch/x86/kernel/acpi/wakeup_64.S (renamed from arch/x86_64/kernel/acpi/wakeup.S)2
-rw-r--r--arch/x86/kernel/alternative.c (renamed from arch/i386/kernel/alternative.c)0
-rw-r--r--arch/x86/kernel/aperture_64.c (renamed from arch/x86_64/kernel/aperture.c)0
-rw-r--r--arch/x86/kernel/apic_32.c (renamed from arch/i386/kernel/apic.c)0
-rw-r--r--arch/x86/kernel/apic_64.c (renamed from arch/x86_64/kernel/apic.c)356
-rw-r--r--arch/x86/kernel/apm_32.c (renamed from arch/i386/kernel/apm.c)18
-rw-r--r--arch/x86/kernel/asm-offsets.c5
-rw-r--r--arch/x86/kernel/asm-offsets_32.c (renamed from arch/i386/kernel/asm-offsets.c)2
-rw-r--r--arch/x86/kernel/asm-offsets_64.c (renamed from arch/x86_64/kernel/asm-offsets.c)0
-rw-r--r--arch/x86/kernel/audit_64.c (renamed from arch/x86_64/kernel/audit.c)0
-rw-r--r--arch/x86/kernel/bootflag.c (renamed from arch/i386/kernel/bootflag.c)0
-rw-r--r--arch/x86/kernel/bugs_64.c (renamed from arch/x86_64/kernel/bugs.c)0
-rw-r--r--arch/x86/kernel/cpu/Makefile (renamed from arch/i386/kernel/cpu/Makefile)0
-rw-r--r--arch/x86/kernel/cpu/addon_cpuid_features.c (renamed from arch/i386/kernel/cpu/addon_cpuid_features.c)0
-rw-r--r--arch/x86/kernel/cpu/amd.c (renamed from arch/i386/kernel/cpu/amd.c)0
-rw-r--r--arch/x86/kernel/cpu/bugs.c (renamed from arch/i386/kernel/cpu/bugs.c)0
-rw-r--r--arch/x86/kernel/cpu/centaur.c (renamed from arch/i386/kernel/cpu/centaur.c)0
-rw-r--r--arch/x86/kernel/cpu/common.c (renamed from arch/i386/kernel/cpu/common.c)0
-rw-r--r--arch/x86/kernel/cpu/cpu.h (renamed from arch/i386/kernel/cpu/cpu.h)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/Kconfig (renamed from arch/i386/kernel/cpu/cpufreq/Kconfig)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/Makefile (renamed from arch/i386/kernel/cpu/cpufreq/Makefile)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c (renamed from arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c)4
-rw-r--r--arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c (renamed from arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/e_powersaver.c (renamed from arch/i386/kernel/cpu/cpufreq/e_powersaver.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/elanfreq.c (renamed from arch/i386/kernel/cpu/cpufreq/elanfreq.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/gx-suspmod.c (renamed from arch/i386/kernel/cpu/cpufreq/gx-suspmod.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longhaul.c (renamed from arch/i386/kernel/cpu/cpufreq/longhaul.c)60
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longhaul.h (renamed from arch/i386/kernel/cpu/cpufreq/longhaul.h)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longrun.c (renamed from arch/i386/kernel/cpu/cpufreq/longrun.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/p4-clockmod.c (renamed from arch/i386/kernel/cpu/cpufreq/p4-clockmod.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k6.c (renamed from arch/i386/kernel/cpu/cpufreq/powernow-k6.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k7.c (renamed from arch/i386/kernel/cpu/cpufreq/powernow-k7.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k7.h (renamed from arch/i386/kernel/cpu/cpufreq/powernow-k7.h)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c (renamed from arch/i386/kernel/cpu/cpufreq/powernow-k8.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.h (renamed from arch/i386/kernel/cpu/cpufreq/powernow-k8.h)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/sc520_freq.c (renamed from arch/i386/kernel/cpu/cpufreq/sc520_freq.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c (renamed from arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-ich.c (renamed from arch/i386/kernel/cpu/cpufreq/speedstep-ich.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-lib.c (renamed from arch/i386/kernel/cpu/cpufreq/speedstep-lib.c)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-lib.h (renamed from arch/i386/kernel/cpu/cpufreq/speedstep-lib.h)0
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-smi.c (renamed from arch/i386/kernel/cpu/cpufreq/speedstep-smi.c)0
-rw-r--r--arch/x86/kernel/cpu/cyrix.c (renamed from arch/i386/kernel/cpu/cyrix.c)0
-rw-r--r--arch/x86/kernel/cpu/intel.c (renamed from arch/i386/kernel/cpu/intel.c)0
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c (renamed from arch/i386/kernel/cpu/intel_cacheinfo.c)0
-rw-r--r--arch/x86/kernel/cpu/mcheck/Makefile (renamed from arch/i386/kernel/cpu/mcheck/Makefile)0
-rw-r--r--arch/x86/kernel/cpu/mcheck/k7.c (renamed from arch/i386/kernel/cpu/mcheck/k7.c)0
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c (renamed from arch/i386/kernel/cpu/mcheck/mce.c)0
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.h (renamed from arch/i386/kernel/cpu/mcheck/mce.h)0
-rw-r--r--arch/x86/kernel/cpu/mcheck/non-fatal.c (renamed from arch/i386/kernel/cpu/mcheck/non-fatal.c)0
-rw-r--r--arch/x86/kernel/cpu/mcheck/p4.c (renamed from arch/i386/kernel/cpu/mcheck/p4.c)0
-rw-r--r--arch/x86/kernel/cpu/mcheck/p5.c (renamed from arch/i386/kernel/cpu/mcheck/p5.c)0
-rw-r--r--arch/x86/kernel/cpu/mcheck/p6.c (renamed from arch/i386/kernel/cpu/mcheck/p6.c)0
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c (renamed from arch/i386/kernel/cpu/mcheck/therm_throt.c)0
-rw-r--r--arch/x86/kernel/cpu/mcheck/winchip.c (renamed from arch/i386/kernel/cpu/mcheck/winchip.c)0
-rw-r--r--arch/x86/kernel/cpu/mtrr/Makefile (renamed from arch/i386/kernel/cpu/mtrr/Makefile)0
-rw-r--r--arch/x86/kernel/cpu/mtrr/amd.c (renamed from arch/i386/kernel/cpu/mtrr/amd.c)0
-rw-r--r--arch/x86/kernel/cpu/mtrr/centaur.c (renamed from arch/i386/kernel/cpu/mtrr/centaur.c)0
-rw-r--r--arch/x86/kernel/cpu/mtrr/cyrix.c (renamed from arch/i386/kernel/cpu/mtrr/cyrix.c)0
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c (renamed from arch/i386/kernel/cpu/mtrr/generic.c)0
-rw-r--r--arch/x86/kernel/cpu/mtrr/if.c (renamed from arch/i386/kernel/cpu/mtrr/if.c)0
-rw-r--r--arch/x86/kernel/cpu/mtrr/main.c (renamed from arch/i386/kernel/cpu/mtrr/main.c)0
-rw-r--r--arch/x86/kernel/cpu/mtrr/mtrr.h (renamed from arch/i386/kernel/cpu/mtrr/mtrr.h)0
-rw-r--r--arch/x86/kernel/cpu/mtrr/state.c (renamed from arch/i386/kernel/cpu/mtrr/state.c)2
-rw-r--r--arch/x86/kernel/cpu/nexgen.c (renamed from arch/i386/kernel/cpu/nexgen.c)0
-rw-r--r--arch/x86/kernel/cpu/perfctr-watchdog.c (renamed from arch/i386/kernel/cpu/perfctr-watchdog.c)0
-rw-r--r--arch/x86/kernel/cpu/proc.c (renamed from arch/i386/kernel/cpu/proc.c)0
-rw-r--r--arch/x86/kernel/cpu/transmeta.c (renamed from arch/i386/kernel/cpu/transmeta.c)0
-rw-r--r--arch/x86/kernel/cpu/umc.c (renamed from arch/i386/kernel/cpu/umc.c)0
-rw-r--r--arch/x86/kernel/cpufreq/Kconfig (renamed from arch/x86_64/kernel/cpufreq/Kconfig)0
-rw-r--r--arch/x86/kernel/cpuid.c (renamed from arch/i386/kernel/cpuid.c)0
-rw-r--r--arch/x86/kernel/crash_32.c (renamed from arch/i386/kernel/crash.c)0
-rw-r--r--arch/x86/kernel/crash_64.c (renamed from arch/x86_64/kernel/crash.c)0
-rw-r--r--arch/x86/kernel/crash_dump_32.c (renamed from arch/i386/kernel/crash_dump.c)0
-rw-r--r--arch/x86/kernel/crash_dump_64.c (renamed from arch/x86_64/kernel/crash_dump.c)0
-rw-r--r--arch/x86/kernel/doublefault_32.c (renamed from arch/i386/kernel/doublefault.c)0
-rw-r--r--arch/x86/kernel/e820_32.c (renamed from arch/i386/kernel/e820.c)0
-rw-r--r--arch/x86/kernel/e820_64.c (renamed from arch/x86_64/kernel/e820.c)0
-rw-r--r--arch/x86/kernel/early-quirks_64.c (renamed from arch/x86_64/kernel/early-quirks.c)0
-rw-r--r--arch/x86/kernel/early_printk.c (renamed from arch/x86_64/kernel/early_printk.c)0
-rw-r--r--arch/x86/kernel/efi_32.c (renamed from arch/i386/kernel/efi.c)0
-rw-r--r--arch/x86/kernel/efi_stub_32.S (renamed from arch/i386/kernel/efi_stub.S)0
-rw-r--r--arch/x86/kernel/entry_32.S (renamed from arch/i386/kernel/entry.S)2
-rw-r--r--arch/x86/kernel/entry_64.S (renamed from arch/x86_64/kernel/entry.S)0
-rw-r--r--arch/x86/kernel/genapic_64.c (renamed from arch/x86_64/kernel/genapic.c)0
-rw-r--r--arch/x86/kernel/genapic_flat_64.c (renamed from arch/x86_64/kernel/genapic_flat.c)0
-rw-r--r--arch/x86/kernel/geode_32.c (renamed from arch/i386/kernel/geode.c)4
-rw-r--r--arch/x86/kernel/head64.c (renamed from arch/x86_64/kernel/head64.c)0
-rw-r--r--arch/x86/kernel/head_32.S (renamed from arch/i386/kernel/head.S)2
-rw-r--r--arch/x86/kernel/head_64.S (renamed from arch/x86_64/kernel/head.S)0
-rw-r--r--arch/x86/kernel/hpet.c (renamed from arch/i386/kernel/hpet.c)250
-rw-r--r--arch/x86/kernel/i386_ksyms_32.c (renamed from arch/i386/kernel/i386_ksyms.c)0
-rw-r--r--arch/x86/kernel/i387_32.c (renamed from arch/i386/kernel/i387.c)0
-rw-r--r--arch/x86/kernel/i387_64.c (renamed from arch/x86_64/kernel/i387.c)0
-rw-r--r--arch/x86/kernel/i8237.c (renamed from arch/i386/kernel/i8237.c)0
-rw-r--r--arch/x86/kernel/i8253.c (renamed from arch/i386/kernel/i8253.c)4
-rw-r--r--arch/x86/kernel/i8259_32.c (renamed from arch/i386/kernel/i8259.c)1
-rw-r--r--arch/x86/kernel/i8259_64.c (renamed from arch/x86_64/kernel/i8259.c)46
-rw-r--r--arch/x86/kernel/init_task_32.c (renamed from arch/i386/kernel/init_task.c)0
-rw-r--r--arch/x86/kernel/init_task_64.c (renamed from arch/x86_64/kernel/init_task.c)0
-rw-r--r--arch/x86/kernel/io_apic_32.c (renamed from arch/i386/kernel/io_apic.c)0
-rw-r--r--arch/x86/kernel/io_apic_64.c (renamed from arch/x86_64/kernel/io_apic.c)0
-rw-r--r--arch/x86/kernel/ioport_32.c (renamed from arch/i386/kernel/ioport.c)0
-rw-r--r--arch/x86/kernel/ioport_64.c (renamed from arch/x86_64/kernel/ioport.c)0
-rw-r--r--arch/x86/kernel/irq_32.c (renamed from arch/i386/kernel/irq.c)2
-rw-r--r--arch/x86/kernel/irq_64.c (renamed from arch/x86_64/kernel/irq.c)1
-rw-r--r--arch/x86/kernel/k8.c (renamed from arch/x86_64/kernel/k8.c)0
-rw-r--r--arch/x86/kernel/kprobes_32.c (renamed from arch/i386/kernel/kprobes.c)0
-rw-r--r--arch/x86/kernel/kprobes_64.c (renamed from arch/x86_64/kernel/kprobes.c)0
-rw-r--r--arch/x86/kernel/ldt_32.c (renamed from arch/i386/kernel/ldt.c)0
-rw-r--r--arch/x86/kernel/ldt_64.c (renamed from arch/x86_64/kernel/ldt.c)0
-rw-r--r--arch/x86/kernel/machine_kexec_32.c (renamed from arch/i386/kernel/machine_kexec.c)0
-rw-r--r--arch/x86/kernel/machine_kexec_64.c (renamed from arch/x86_64/kernel/machine_kexec.c)0
-rw-r--r--arch/x86/kernel/mca_32.c (renamed from arch/i386/kernel/mca.c)0
-rw-r--r--arch/x86/kernel/mce_64.c (renamed from arch/x86_64/kernel/mce.c)0
-rw-r--r--arch/x86/kernel/mce_amd_64.c (renamed from arch/x86_64/kernel/mce_amd.c)0
-rw-r--r--arch/x86/kernel/mce_intel_64.c (renamed from arch/x86_64/kernel/mce_intel.c)0
-rw-r--r--arch/x86/kernel/mfgpt_32.c362
-rw-r--r--arch/x86/kernel/microcode.c (renamed from arch/i386/kernel/microcode.c)0
-rw-r--r--arch/x86/kernel/module_32.c (renamed from arch/i386/kernel/module.c)0
-rw-r--r--arch/x86/kernel/module_64.c (renamed from arch/x86_64/kernel/module.c)0
-rw-r--r--arch/x86/kernel/mpparse_32.c (renamed from arch/i386/kernel/mpparse.c)0
-rw-r--r--arch/x86/kernel/mpparse_64.c (renamed from arch/x86_64/kernel/mpparse.c)0
-rw-r--r--arch/x86/kernel/msr.c (renamed from arch/i386/kernel/msr.c)0
-rw-r--r--arch/x86/kernel/nmi_32.c (renamed from arch/i386/kernel/nmi.c)3
-rw-r--r--arch/x86/kernel/nmi_64.c (renamed from arch/x86_64/kernel/nmi.c)2
-rw-r--r--arch/x86/kernel/numaq_32.c (renamed from arch/i386/kernel/numaq.c)0
-rw-r--r--arch/x86/kernel/paravirt_32.c (renamed from arch/i386/kernel/paravirt.c)0
-rw-r--r--arch/x86/kernel/pci-calgary_64.c (renamed from arch/x86_64/kernel/pci-calgary.c)0
-rw-r--r--arch/x86/kernel/pci-dma_32.c (renamed from arch/i386/kernel/pci-dma.c)0
-rw-r--r--arch/x86/kernel/pci-dma_64.c (renamed from arch/x86_64/kernel/pci-dma.c)0
-rw-r--r--arch/x86/kernel/pci-gart_64.c (renamed from arch/x86_64/kernel/pci-gart.c)0
-rw-r--r--arch/x86/kernel/pci-nommu_64.c (renamed from arch/x86_64/kernel/pci-nommu.c)0
-rw-r--r--arch/x86/kernel/pci-swiotlb_64.c (renamed from arch/x86_64/kernel/pci-swiotlb.c)0
-rw-r--r--arch/x86/kernel/pcspeaker.c (renamed from arch/i386/kernel/pcspeaker.c)0
-rw-r--r--arch/x86/kernel/pmtimer_64.c (renamed from arch/x86_64/kernel/pmtimer.c)0
-rw-r--r--arch/x86/kernel/process_32.c (renamed from arch/i386/kernel/process.c)0
-rw-r--r--arch/x86/kernel/process_64.c (renamed from arch/x86_64/kernel/process.c)4
-rw-r--r--arch/x86/kernel/ptrace_32.c (renamed from arch/i386/kernel/ptrace.c)0
-rw-r--r--arch/x86/kernel/ptrace_64.c (renamed from arch/x86_64/kernel/ptrace.c)0
-rw-r--r--arch/x86/kernel/quirks.c254
-rw-r--r--arch/x86/kernel/reboot_32.c (renamed from arch/i386/kernel/reboot.c)2
-rw-r--r--arch/x86/kernel/reboot_64.c (renamed from arch/x86_64/kernel/reboot.c)0
-rw-r--r--arch/x86/kernel/reboot_fixups_32.c (renamed from arch/i386/kernel/reboot_fixups.c)0
-rw-r--r--arch/x86/kernel/relocate_kernel_32.S (renamed from arch/i386/kernel/relocate_kernel.S)0
-rw-r--r--arch/x86/kernel/relocate_kernel_64.S (renamed from arch/x86_64/kernel/relocate_kernel.S)0
-rw-r--r--arch/x86/kernel/scx200_32.c (renamed from arch/i386/kernel/scx200.c)0
-rw-r--r--arch/x86/kernel/setup64.c (renamed from arch/x86_64/kernel/setup64.c)0
-rw-r--r--arch/x86/kernel/setup_32.c (renamed from arch/i386/kernel/setup.c)0
-rw-r--r--arch/x86/kernel/setup_64.c (renamed from arch/x86_64/kernel/setup.c)34
-rw-r--r--arch/x86/kernel/sigframe_32.h (renamed from arch/i386/kernel/sigframe.h)0
-rw-r--r--arch/x86/kernel/signal_32.c (renamed from arch/i386/kernel/signal.c)2
-rw-r--r--arch/x86/kernel/signal_64.c (renamed from arch/x86_64/kernel/signal.c)0
-rw-r--r--arch/x86/kernel/smp_32.c (renamed from arch/i386/kernel/smp.c)0
-rw-r--r--arch/x86/kernel/smp_64.c (renamed from arch/x86_64/kernel/smp.c)0
-rw-r--r--arch/x86/kernel/smpboot_32.c (renamed from arch/i386/kernel/smpboot.c)0
-rw-r--r--arch/x86/kernel/smpboot_64.c (renamed from arch/x86_64/kernel/smpboot.c)4
-rw-r--r--arch/x86/kernel/smpcommon_32.c (renamed from arch/i386/kernel/smpcommon.c)0
-rw-r--r--arch/x86/kernel/srat_32.c (renamed from arch/i386/kernel/srat.c)0
-rw-r--r--arch/x86/kernel/stacktrace.c (renamed from arch/x86_64/kernel/stacktrace.c)0
-rw-r--r--arch/x86/kernel/summit_32.c (renamed from arch/i386/kernel/summit.c)0
-rw-r--r--arch/x86/kernel/suspend_64.c (renamed from arch/x86_64/kernel/suspend.c)0
-rw-r--r--arch/x86/kernel/suspend_asm_64.S (renamed from arch/x86_64/kernel/suspend_asm.S)0
-rw-r--r--arch/x86/kernel/sys_i386_32.c (renamed from arch/i386/kernel/sys_i386.c)0
-rw-r--r--arch/x86/kernel/sys_x86_64.c (renamed from arch/x86_64/kernel/sys_x86_64.c)0
-rw-r--r--arch/x86/kernel/syscall_64.c (renamed from arch/x86_64/kernel/syscall.c)4
-rw-r--r--arch/x86/kernel/syscall_table_32.S (renamed from arch/i386/kernel/syscall_table.S)0
-rw-r--r--arch/x86/kernel/sysenter_32.c (renamed from arch/i386/kernel/sysenter.c)0
-rw-r--r--arch/x86/kernel/tce_64.c (renamed from arch/x86_64/kernel/tce.c)0
-rw-r--r--arch/x86/kernel/time_32.c (renamed from arch/i386/kernel/time.c)3
-rw-r--r--arch/x86/kernel/time_64.c (renamed from arch/x86_64/kernel/time.c)177
-rw-r--r--arch/x86/kernel/topology.c (renamed from arch/i386/kernel/topology.c)0
-rw-r--r--arch/x86/kernel/trampoline_32.S (renamed from arch/i386/kernel/trampoline.S)0
-rw-r--r--arch/x86/kernel/trampoline_64.S (renamed from arch/x86_64/kernel/trampoline.S)2
-rw-r--r--arch/x86/kernel/traps_32.c (renamed from arch/i386/kernel/traps.c)0
-rw-r--r--arch/x86/kernel/traps_64.c (renamed from arch/x86_64/kernel/traps.c)0
-rw-r--r--arch/x86/kernel/tsc_32.c (renamed from arch/i386/kernel/tsc.c)2
-rw-r--r--arch/x86/kernel/tsc_64.c (renamed from arch/x86_64/kernel/tsc.c)93
-rw-r--r--arch/x86/kernel/tsc_sync.c (renamed from arch/x86_64/kernel/tsc_sync.c)0
-rw-r--r--arch/x86/kernel/verify_cpu_64.S (renamed from arch/x86_64/kernel/verify_cpu.S)0
-rw-r--r--arch/x86/kernel/vm86_32.c (renamed from arch/i386/kernel/vm86.c)0
-rw-r--r--arch/x86/kernel/vmi_32.c (renamed from arch/i386/kernel/vmi.c)0
-rw-r--r--arch/x86/kernel/vmiclock_32.c (renamed from arch/i386/kernel/vmiclock.c)0
-rw-r--r--arch/x86/kernel/vmlinux.lds.S5
-rw-r--r--arch/x86/kernel/vmlinux_32.lds.S (renamed from arch/i386/kernel/vmlinux.lds.S)0
-rw-r--r--arch/x86/kernel/vmlinux_64.lds.S (renamed from arch/x86_64/kernel/vmlinux.lds.S)0
-rw-r--r--arch/x86/kernel/vsmp_64.c (renamed from arch/x86_64/kernel/vsmp.c)0
-rw-r--r--arch/x86/kernel/vsyscall-int80_32.S (renamed from arch/i386/kernel/vsyscall-int80.S)2
-rw-r--r--arch/x86/kernel/vsyscall-note_32.S (renamed from arch/i386/kernel/vsyscall-note.S)2
-rw-r--r--arch/x86/kernel/vsyscall-sigreturn_32.S (renamed from arch/i386/kernel/vsyscall-sigreturn.S)0
-rw-r--r--arch/x86/kernel/vsyscall-sysenter_32.S (renamed from arch/i386/kernel/vsyscall-sysenter.S)2
-rw-r--r--arch/x86/kernel/vsyscall_32.S (renamed from arch/i386/kernel/vsyscall.S)4
-rw-r--r--arch/x86/kernel/vsyscall_32.lds.S (renamed from arch/i386/kernel/vsyscall.lds.S)0
-rw-r--r--arch/x86/kernel/vsyscall_64.c (renamed from arch/x86_64/kernel/vsyscall.c)0
-rw-r--r--arch/x86/kernel/x8664_ksyms_64.c (renamed from arch/x86_64/kernel/x8664_ksyms.c)0
-rw-r--r--arch/x86/lib/Makefile5
-rw-r--r--arch/x86/lib/Makefile_3211
-rw-r--r--arch/x86/lib/Makefile_6413
-rw-r--r--arch/x86/lib/bitops_32.c (renamed from arch/i386/lib/bitops.c)0
-rw-r--r--arch/x86/lib/bitops_64.c (renamed from arch/x86_64/lib/bitops.c)0
-rw-r--r--arch/x86/lib/bitstr_64.c (renamed from arch/x86_64/lib/bitstr.c)0
-rw-r--r--arch/x86/lib/checksum_32.S (renamed from arch/i386/lib/checksum.S)0
-rw-r--r--arch/x86/lib/clear_page_64.S (renamed from arch/x86_64/lib/clear_page.S)0
-rw-r--r--arch/x86/lib/copy_page_64.S (renamed from arch/x86_64/lib/copy_page.S)0
-rw-r--r--arch/x86/lib/copy_user_64.S (renamed from arch/x86_64/lib/copy_user.S)0
-rw-r--r--arch/x86/lib/copy_user_nocache_64.S (renamed from arch/x86_64/lib/copy_user_nocache.S)0
-rw-r--r--arch/x86/lib/csum-copy_64.S (renamed from arch/x86_64/lib/csum-copy.S)0
-rw-r--r--arch/x86/lib/csum-partial_64.c (renamed from arch/x86_64/lib/csum-partial.c)0
-rw-r--r--arch/x86/lib/csum-wrappers_64.c (renamed from arch/x86_64/lib/csum-wrappers.c)0
-rw-r--r--arch/x86/lib/delay_32.c (renamed from arch/i386/lib/delay.c)0
-rw-r--r--arch/x86/lib/delay_64.c (renamed from arch/x86_64/lib/delay.c)0
-rw-r--r--arch/x86/lib/getuser_32.S (renamed from arch/i386/lib/getuser.S)0
-rw-r--r--arch/x86/lib/getuser_64.S (renamed from arch/x86_64/lib/getuser.S)0
-rw-r--r--arch/x86/lib/io_64.c (renamed from arch/x86_64/lib/io.c)0
-rw-r--r--arch/x86/lib/iomap_copy_64.S (renamed from arch/x86_64/lib/iomap_copy.S)0
-rw-r--r--arch/x86/lib/memcpy_32.c (renamed from arch/i386/lib/memcpy.c)0
-rw-r--r--arch/x86/lib/memcpy_64.S (renamed from arch/x86_64/lib/memcpy.S)0
-rw-r--r--arch/x86/lib/memmove_64.c (renamed from arch/x86_64/lib/memmove.c)0
-rw-r--r--arch/x86/lib/memset_64.S (renamed from arch/x86_64/lib/memset.S)0
-rw-r--r--arch/x86/lib/mmx_32.c (renamed from arch/i386/lib/mmx.c)0
-rw-r--r--arch/x86/lib/msr-on-cpu.c (renamed from arch/i386/lib/msr-on-cpu.c)0
-rw-r--r--arch/x86/lib/putuser_32.S (renamed from arch/i386/lib/putuser.S)0
-rw-r--r--arch/x86/lib/putuser_64.S (renamed from arch/x86_64/lib/putuser.S)0
-rw-r--r--arch/x86/lib/rwlock_64.S (renamed from arch/x86_64/lib/rwlock.S)0
-rw-r--r--arch/x86/lib/semaphore_32.S (renamed from arch/i386/lib/semaphore.S)0
-rw-r--r--arch/x86/lib/string_32.c (renamed from arch/i386/lib/string.c)0
-rw-r--r--arch/x86/lib/strstr_32.c (renamed from arch/i386/lib/strstr.c)0
-rw-r--r--arch/x86/lib/thunk_64.S (renamed from arch/x86_64/lib/thunk.S)0
-rw-r--r--arch/x86/lib/usercopy_32.c (renamed from arch/i386/lib/usercopy.c)0
-rw-r--r--arch/x86/lib/usercopy_64.c (renamed from arch/x86_64/lib/usercopy.c)0
-rw-r--r--arch/x86/mach-default/Makefile (renamed from arch/i386/mach-default/Makefile)0
-rw-r--r--arch/x86/mach-default/setup.c (renamed from arch/i386/mach-default/setup.c)0
-rw-r--r--arch/x86/mach-es7000/Makefile (renamed from arch/i386/mach-es7000/Makefile)0
-rw-r--r--arch/x86/mach-es7000/es7000.h (renamed from arch/i386/mach-es7000/es7000.h)0
-rw-r--r--arch/x86/mach-es7000/es7000plat.c (renamed from arch/i386/mach-es7000/es7000plat.c)0
-rw-r--r--arch/x86/mach-generic/Makefile8
-rw-r--r--arch/x86/mach-generic/bigsmp.c (renamed from arch/i386/mach-generic/bigsmp.c)4
-rw-r--r--arch/x86/mach-generic/default.c (renamed from arch/i386/mach-generic/default.c)0
-rw-r--r--arch/x86/mach-generic/es7000.c (renamed from arch/i386/mach-generic/es7000.c)0
-rw-r--r--arch/x86/mach-generic/probe.c (renamed from arch/i386/mach-generic/probe.c)0
-rw-r--r--arch/x86/mach-generic/summit.c (renamed from arch/i386/mach-generic/summit.c)0
-rw-r--r--arch/x86/mach-visws/Makefile (renamed from arch/i386/mach-visws/Makefile)0
-rw-r--r--arch/x86/mach-visws/mpparse.c (renamed from arch/i386/mach-visws/mpparse.c)0
-rw-r--r--arch/x86/mach-visws/reboot.c (renamed from arch/i386/mach-visws/reboot.c)0
-rw-r--r--arch/x86/mach-visws/setup.c (renamed from arch/i386/mach-visws/setup.c)0
-rw-r--r--arch/x86/mach-visws/traps.c (renamed from arch/i386/mach-visws/traps.c)0
-rw-r--r--arch/x86/mach-visws/visws_apic.c (renamed from arch/i386/mach-visws/visws_apic.c)0
-rw-r--r--arch/x86/mach-voyager/Makefile (renamed from arch/i386/mach-voyager/Makefile)2
-rw-r--r--arch/x86/mach-voyager/setup.c (renamed from arch/i386/mach-voyager/setup.c)0
-rw-r--r--arch/x86/mach-voyager/voyager_basic.c (renamed from arch/i386/mach-voyager/voyager_basic.c)0
-rw-r--r--arch/x86/mach-voyager/voyager_cat.c (renamed from arch/i386/mach-voyager/voyager_cat.c)0
-rw-r--r--arch/x86/mach-voyager/voyager_smp.c (renamed from arch/i386/mach-voyager/voyager_smp.c)0
-rw-r--r--arch/x86/mach-voyager/voyager_thread.c (renamed from arch/i386/mach-voyager/voyager_thread.c)0
-rw-r--r--arch/x86/math-emu/Makefile (renamed from arch/i386/math-emu/Makefile)0
-rw-r--r--arch/x86/math-emu/README (renamed from arch/i386/math-emu/README)0
-rw-r--r--arch/x86/math-emu/control_w.h (renamed from arch/i386/math-emu/control_w.h)0
-rw-r--r--arch/x86/math-emu/div_Xsig.S (renamed from arch/i386/math-emu/div_Xsig.S)0
-rw-r--r--arch/x86/math-emu/div_small.S (renamed from arch/i386/math-emu/div_small.S)0
-rw-r--r--arch/x86/math-emu/errors.c (renamed from arch/i386/math-emu/errors.c)0
-rw-r--r--arch/x86/math-emu/exception.h (renamed from arch/i386/math-emu/exception.h)0
-rw-r--r--arch/x86/math-emu/fpu_arith.c (renamed from arch/i386/math-emu/fpu_arith.c)0
-rw-r--r--arch/x86/math-emu/fpu_asm.h (renamed from arch/i386/math-emu/fpu_asm.h)0
-rw-r--r--arch/x86/math-emu/fpu_aux.c (renamed from arch/i386/math-emu/fpu_aux.c)0
-rw-r--r--arch/x86/math-emu/fpu_emu.h (renamed from arch/i386/math-emu/fpu_emu.h)0
-rw-r--r--arch/x86/math-emu/fpu_entry.c (renamed from arch/i386/math-emu/fpu_entry.c)0
-rw-r--r--arch/x86/math-emu/fpu_etc.c (renamed from arch/i386/math-emu/fpu_etc.c)0
-rw-r--r--arch/x86/math-emu/fpu_proto.h (renamed from arch/i386/math-emu/fpu_proto.h)0
-rw-r--r--arch/x86/math-emu/fpu_system.h (renamed from arch/i386/math-emu/fpu_system.h)0
-rw-r--r--arch/x86/math-emu/fpu_tags.c (renamed from arch/i386/math-emu/fpu_tags.c)0
-rw-r--r--arch/x86/math-emu/fpu_trig.c (renamed from arch/i386/math-emu/fpu_trig.c)0
-rw-r--r--arch/x86/math-emu/get_address.c (renamed from arch/i386/math-emu/get_address.c)0
-rw-r--r--arch/x86/math-emu/load_store.c (renamed from arch/i386/math-emu/load_store.c)0
-rw-r--r--arch/x86/math-emu/mul_Xsig.S (renamed from arch/i386/math-emu/mul_Xsig.S)0
-rw-r--r--arch/x86/math-emu/poly.h (renamed from arch/i386/math-emu/poly.h)0
-rw-r--r--arch/x86/math-emu/poly_2xm1.c (renamed from arch/i386/math-emu/poly_2xm1.c)0
-rw-r--r--arch/x86/math-emu/poly_atan.c (renamed from arch/i386/math-emu/poly_atan.c)0
-rw-r--r--arch/x86/math-emu/poly_l2.c (renamed from arch/i386/math-emu/poly_l2.c)0
-rw-r--r--arch/x86/math-emu/poly_sin.c (renamed from arch/i386/math-emu/poly_sin.c)0
-rw-r--r--arch/x86/math-emu/poly_tan.c (renamed from arch/i386/math-emu/poly_tan.c)0
-rw-r--r--arch/x86/math-emu/polynom_Xsig.S (renamed from arch/i386/math-emu/polynom_Xsig.S)0
-rw-r--r--arch/x86/math-emu/reg_add_sub.c (renamed from arch/i386/math-emu/reg_add_sub.c)0
-rw-r--r--arch/x86/math-emu/reg_compare.c (renamed from arch/i386/math-emu/reg_compare.c)0
-rw-r--r--arch/x86/math-emu/reg_constant.c (renamed from arch/i386/math-emu/reg_constant.c)0
-rw-r--r--arch/x86/math-emu/reg_constant.h (renamed from arch/i386/math-emu/reg_constant.h)0
-rw-r--r--arch/x86/math-emu/reg_convert.c (renamed from arch/i386/math-emu/reg_convert.c)0
-rw-r--r--arch/x86/math-emu/reg_divide.c (renamed from arch/i386/math-emu/reg_divide.c)0
-rw-r--r--arch/x86/math-emu/reg_ld_str.c (renamed from arch/i386/math-emu/reg_ld_str.c)0
-rw-r--r--arch/x86/math-emu/reg_mul.c (renamed from arch/i386/math-emu/reg_mul.c)0
-rw-r--r--arch/x86/math-emu/reg_norm.S (renamed from arch/i386/math-emu/reg_norm.S)0
-rw-r--r--arch/x86/math-emu/reg_round.S (renamed from arch/i386/math-emu/reg_round.S)0
-rw-r--r--arch/x86/math-emu/reg_u_add.S (renamed from arch/i386/math-emu/reg_u_add.S)0
-rw-r--r--arch/x86/math-emu/reg_u_div.S (renamed from arch/i386/math-emu/reg_u_div.S)0
-rw-r--r--arch/x86/math-emu/reg_u_mul.S (renamed from arch/i386/math-emu/reg_u_mul.S)0
-rw-r--r--arch/x86/math-emu/reg_u_sub.S (renamed from arch/i386/math-emu/reg_u_sub.S)0
-rw-r--r--arch/x86/math-emu/round_Xsig.S (renamed from arch/i386/math-emu/round_Xsig.S)0
-rw-r--r--arch/x86/math-emu/shr_Xsig.S (renamed from arch/i386/math-emu/shr_Xsig.S)0
-rw-r--r--arch/x86/math-emu/status_w.h (renamed from arch/i386/math-emu/status_w.h)0
-rw-r--r--arch/x86/math-emu/version.h (renamed from arch/i386/math-emu/version.h)0
-rw-r--r--arch/x86/math-emu/wm_shrx.S (renamed from arch/i386/math-emu/wm_shrx.S)0
-rw-r--r--arch/x86/math-emu/wm_sqrt.S (renamed from arch/i386/math-emu/wm_sqrt.S)0
-rw-r--r--arch/x86/mm/Makefile5
-rw-r--r--arch/x86/mm/Makefile_3210
-rw-r--r--arch/x86/mm/Makefile_6410
-rw-r--r--arch/x86/mm/boot_ioremap_32.c (renamed from arch/i386/mm/boot_ioremap.c)0
-rw-r--r--arch/x86/mm/discontig_32.c (renamed from arch/i386/mm/discontig.c)0
-rw-r--r--arch/x86/mm/extable_32.c (renamed from arch/i386/mm/extable.c)0
-rw-r--r--arch/x86/mm/extable_64.c (renamed from arch/x86_64/mm/extable.c)0
-rw-r--r--arch/x86/mm/fault_32.c (renamed from arch/i386/mm/fault.c)0
-rw-r--r--arch/x86/mm/fault_64.c (renamed from arch/x86_64/mm/fault.c)0
-rw-r--r--arch/x86/mm/highmem_32.c (renamed from arch/i386/mm/highmem.c)0
-rw-r--r--arch/x86/mm/hugetlbpage.c (renamed from arch/i386/mm/hugetlbpage.c)0
-rw-r--r--arch/x86/mm/init_32.c (renamed from arch/i386/mm/init.c)0
-rw-r--r--arch/x86/mm/init_64.c (renamed from arch/x86_64/mm/init.c)0
-rw-r--r--arch/x86/mm/ioremap_32.c (renamed from arch/i386/mm/ioremap.c)0
-rw-r--r--arch/x86/mm/ioremap_64.c (renamed from arch/x86_64/mm/ioremap.c)0
-rw-r--r--arch/x86/mm/k8topology_64.c (renamed from arch/x86_64/mm/k8topology.c)0
-rw-r--r--arch/x86/mm/mmap_32.c (renamed from arch/i386/mm/mmap.c)0
-rw-r--r--arch/x86/mm/mmap_64.c (renamed from arch/x86_64/mm/mmap.c)0
-rw-r--r--arch/x86/mm/numa_64.c (renamed from arch/x86_64/mm/numa.c)0
-rw-r--r--arch/x86/mm/pageattr_32.c (renamed from arch/i386/mm/pageattr.c)0
-rw-r--r--arch/x86/mm/pageattr_64.c (renamed from arch/x86_64/mm/pageattr.c)0
-rw-r--r--arch/x86/mm/pgtable_32.c (renamed from arch/i386/mm/pgtable.c)0
-rw-r--r--arch/x86/mm/srat_64.c (renamed from arch/x86_64/mm/srat.c)0
-rw-r--r--arch/x86/oprofile/Kconfig (renamed from arch/i386/oprofile/Kconfig)0
-rw-r--r--arch/x86/oprofile/Makefile (renamed from arch/i386/oprofile/Makefile)0
-rw-r--r--arch/x86/oprofile/backtrace.c (renamed from arch/i386/oprofile/backtrace.c)0
-rw-r--r--arch/x86/oprofile/init.c (renamed from arch/i386/oprofile/init.c)0
-rw-r--r--arch/x86/oprofile/nmi_int.c (renamed from arch/i386/oprofile/nmi_int.c)0
-rw-r--r--arch/x86/oprofile/nmi_timer_int.c (renamed from arch/i386/oprofile/nmi_timer_int.c)0
-rw-r--r--arch/x86/oprofile/op_counter.h (renamed from arch/i386/oprofile/op_counter.h)0
-rw-r--r--arch/x86/oprofile/op_model_athlon.c (renamed from arch/i386/oprofile/op_model_athlon.c)0
-rw-r--r--arch/x86/oprofile/op_model_p4.c (renamed from arch/i386/oprofile/op_model_p4.c)0
-rw-r--r--arch/x86/oprofile/op_model_ppro.c (renamed from arch/i386/oprofile/op_model_ppro.c)0
-rw-r--r--arch/x86/oprofile/op_x86_model.h (renamed from arch/i386/oprofile/op_x86_model.h)0
-rw-r--r--arch/x86/pci/Makefile5
-rw-r--r--arch/x86/pci/Makefile_32 (renamed from arch/i386/pci/Makefile)2
-rw-r--r--arch/x86/pci/Makefile_6417
-rw-r--r--arch/x86/pci/acpi.c (renamed from arch/i386/pci/acpi.c)0
-rw-r--r--arch/x86/pci/common.c (renamed from arch/i386/pci/common.c)4
-rw-r--r--arch/x86/pci/direct.c (renamed from arch/i386/pci/direct.c)0
-rw-r--r--arch/x86/pci/early.c (renamed from arch/i386/pci/early.c)0
-rw-r--r--arch/x86/pci/fixup.c (renamed from arch/i386/pci/fixup.c)0
-rw-r--r--arch/x86/pci/i386.c (renamed from arch/i386/pci/i386.c)0
-rw-r--r--arch/x86/pci/init.c (renamed from arch/i386/pci/init.c)0
-rw-r--r--arch/x86/pci/irq.c (renamed from arch/i386/pci/irq.c)4
-rw-r--r--arch/x86/pci/k8-bus_64.c (renamed from arch/x86_64/pci/k8-bus.c)0
-rw-r--r--arch/x86/pci/legacy.c (renamed from arch/i386/pci/legacy.c)0
-rw-r--r--arch/x86/pci/mmconfig-shared.c (renamed from arch/i386/pci/mmconfig-shared.c)0
-rw-r--r--arch/x86/pci/mmconfig_32.c (renamed from arch/i386/pci/mmconfig.c)0
-rw-r--r--arch/x86/pci/mmconfig_64.c (renamed from arch/x86_64/pci/mmconfig.c)0
-rw-r--r--arch/x86/pci/numa.c (renamed from arch/i386/pci/numa.c)0
-rw-r--r--arch/x86/pci/pcbios.c (renamed from arch/i386/pci/pcbios.c)0
-rw-r--r--arch/x86/pci/pci.h (renamed from arch/i386/pci/pci.h)0
-rw-r--r--arch/x86/pci/visws.c (renamed from arch/i386/pci/visws.c)0
-rw-r--r--arch/x86/power/Makefile (renamed from arch/i386/power/Makefile)0
-rw-r--r--arch/x86/power/cpu.c (renamed from arch/i386/power/cpu.c)0
-rw-r--r--arch/x86/power/suspend.c (renamed from arch/i386/power/suspend.c)0
-rw-r--r--arch/x86/power/swsusp.S (renamed from arch/i386/power/swsusp.S)0
-rw-r--r--arch/x86/vdso/.gitignore (renamed from arch/x86_64/vdso/.gitignore)0
-rw-r--r--arch/x86/vdso/Makefile (renamed from arch/x86_64/vdso/Makefile)0
-rw-r--r--arch/x86/vdso/vclock_gettime.c (renamed from arch/x86_64/vdso/vclock_gettime.c)0
-rw-r--r--arch/x86/vdso/vdso-note.S (renamed from arch/x86_64/vdso/vdso-note.S)0
-rw-r--r--arch/x86/vdso/vdso-start.S (renamed from arch/x86_64/vdso/vdso-start.S)0
-rw-r--r--arch/x86/vdso/vdso.S2
-rw-r--r--arch/x86/vdso/vdso.lds.S (renamed from arch/x86_64/vdso/vdso.lds.S)0
-rw-r--r--arch/x86/vdso/vextern.h (renamed from arch/x86_64/vdso/vextern.h)0
-rw-r--r--arch/x86/vdso/vgetcpu.c (renamed from arch/x86_64/vdso/vgetcpu.c)0
-rw-r--r--arch/x86/vdso/vma.c (renamed from arch/x86_64/vdso/vma.c)0
-rw-r--r--arch/x86/vdso/voffset.h (renamed from arch/x86_64/vdso/voffset.h)0
-rw-r--r--arch/x86/vdso/vvar.c (renamed from arch/x86_64/vdso/vvar.c)0
-rw-r--r--arch/x86/video/Makefile (renamed from arch/i386/video/Makefile)0
-rw-r--r--arch/x86/video/fbdev.c (renamed from arch/i386/video/fbdev.c)0
-rw-r--r--arch/x86/xen/Kconfig (renamed from arch/i386/xen/Kconfig)0
-rw-r--r--arch/x86/xen/Makefile (renamed from arch/i386/xen/Makefile)0
-rw-r--r--arch/x86/xen/enlighten.c (renamed from arch/i386/xen/enlighten.c)0
-rw-r--r--arch/x86/xen/events.c (renamed from arch/i386/xen/events.c)0
-rw-r--r--arch/x86/xen/features.c (renamed from arch/i386/xen/features.c)0
-rw-r--r--arch/x86/xen/manage.c (renamed from arch/i386/xen/manage.c)0
-rw-r--r--arch/x86/xen/mmu.c (renamed from arch/i386/xen/mmu.c)0
-rw-r--r--arch/x86/xen/mmu.h (renamed from arch/i386/xen/mmu.h)0
-rw-r--r--arch/x86/xen/multicalls.c (renamed from arch/i386/xen/multicalls.c)0
-rw-r--r--arch/x86/xen/multicalls.h (renamed from arch/i386/xen/multicalls.h)0
-rw-r--r--arch/x86/xen/setup.c (renamed from arch/i386/xen/setup.c)0
-rw-r--r--arch/x86/xen/smp.c (renamed from arch/i386/xen/smp.c)0
-rw-r--r--arch/x86/xen/time.c (renamed from arch/i386/xen/time.c)0
-rw-r--r--arch/x86/xen/vdso.h (renamed from arch/i386/xen/vdso.h)0
-rw-r--r--arch/x86/xen/xen-asm.S (renamed from arch/i386/xen/xen-asm.S)0
-rw-r--r--arch/x86/xen/xen-head.S (renamed from arch/i386/xen/xen-head.S)0
-rw-r--r--arch/x86/xen/xen-ops.h (renamed from arch/i386/xen/xen-ops.h)0
-rw-r--r--arch/x86_64/Kconfig18
-rw-r--r--arch/x86_64/Makefile28
-rw-r--r--arch/x86_64/boot/.gitignore5
-rw-r--r--arch/x86_64/boot/Makefile9
-rw-r--r--arch/x86_64/boot/tools/.gitignore1
-rw-r--r--arch/x86_64/kernel/Makefile63
-rw-r--r--arch/x86_64/kernel/acpi/Makefile9
-rw-r--r--arch/x86_64/kernel/cpufreq/Makefile17
-rw-r--r--arch/x86_64/kernel/hpet.c493
-rw-r--r--arch/x86_64/lib/Makefile13
-rw-r--r--arch/x86_64/lib/msr-on-cpu.c1
-rw-r--r--arch/x86_64/mm/Makefile11
-rw-r--r--arch/x86_64/oprofile/Kconfig17
-rw-r--r--arch/x86_64/oprofile/Makefile19
-rw-r--r--arch/x86_64/pci/Makefile27
-rw-r--r--arch/x86_64/vdso/vdso.S2
1301 files changed, 41101 insertions, 19729 deletions
diff --git a/arch/arm/mach-imx/mx1ads.c b/arch/arm/mach-imx/mx1ads.c
index da893c80d471..a9778c1587ab 100644
--- a/arch/arm/mach-imx/mx1ads.c
+++ b/arch/arm/mach-imx/mx1ads.c
@@ -116,7 +116,7 @@ static struct platform_device *devices[] __initdata = {
116}; 116};
117 117
118#ifdef CONFIG_MMC_IMX 118#ifdef CONFIG_MMC_IMX
119static int mx1ads_mmc_card_present(void) 119static int mx1ads_mmc_card_present(struct device *dev)
120{ 120{
121 /* MMC/SD Card Detect is PB 20 on MX1ADS V1.0.7 */ 121 /* MMC/SD Card Detect is PB 20 on MX1ADS V1.0.7 */
122 return (SSR(1) & (1 << 20) ? 0 : 1); 122 return (SSR(1) & (1 << 20) ? 0 : 1);
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index aab27297b3c6..2363cc64fe07 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -20,6 +20,7 @@
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/mmc/host.h> 21#include <linux/mmc/host.h>
22#include <linux/pm.h> 22#include <linux/pm.h>
23#include <linux/backlight.h>
23 24
24#include <asm/setup.h> 25#include <asm/setup.h>
25#include <asm/memory.h> 26#include <asm/memory.h>
@@ -142,15 +143,28 @@ struct corgissp_machinfo corgi_ssp_machinfo = {
142/* 143/*
143 * Corgi Backlight Device 144 * Corgi Backlight Device
144 */ 145 */
145static struct corgibl_machinfo corgi_bl_machinfo = { 146static void corgi_bl_kick_battery(void)
147{
148 void (*kick_batt)(void);
149
150 kick_batt = symbol_get(sharpsl_battery_kick);
151 if (kick_batt) {
152 kick_batt();
153 symbol_put(sharpsl_battery_kick);
154 }
155}
156
157static struct generic_bl_info corgi_bl_machinfo = {
158 .name = "corgi-bl",
146 .max_intensity = 0x2f, 159 .max_intensity = 0x2f,
147 .default_intensity = 0x1f, 160 .default_intensity = 0x1f,
148 .limit_mask = 0x0b, 161 .limit_mask = 0x0b,
149 .set_bl_intensity = corgi_bl_set_intensity, 162 .set_bl_intensity = corgi_bl_set_intensity,
163 .kick_battery = corgi_bl_kick_battery,
150}; 164};
151 165
152static struct platform_device corgibl_device = { 166static struct platform_device corgibl_device = {
153 .name = "corgi-bl", 167 .name = "generic-bl",
154 .dev = { 168 .dev = {
155 .parent = &corgifb_device.dev, 169 .parent = &corgifb_device.dev,
156 .platform_data = &corgi_bl_machinfo, 170 .platform_data = &corgi_bl_machinfo,
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index bae47e145de8..2d78199d24af 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -21,6 +21,7 @@
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/mmc/host.h> 22#include <linux/mmc/host.h>
23#include <linux/pm.h> 23#include <linux/pm.h>
24#include <linux/backlight.h>
24 25
25#include <asm/setup.h> 26#include <asm/setup.h>
26#include <asm/memory.h> 27#include <asm/memory.h>
@@ -222,14 +223,27 @@ struct corgissp_machinfo spitz_ssp_machinfo = {
222/* 223/*
223 * Spitz Backlight Device 224 * Spitz Backlight Device
224 */ 225 */
225static struct corgibl_machinfo spitz_bl_machinfo = { 226static void spitz_bl_kick_battery(void)
227{
228 void (*kick_batt)(void);
229
230 kick_batt = symbol_get(sharpsl_battery_kick);
231 if (kick_batt) {
232 kick_batt();
233 symbol_put(sharpsl_battery_kick);
234 }
235}
236
237static struct generic_bl_info spitz_bl_machinfo = {
238 .name = "corgi-bl",
226 .default_intensity = 0x1f, 239 .default_intensity = 0x1f,
227 .limit_mask = 0x0b, 240 .limit_mask = 0x0b,
228 .max_intensity = 0x2f, 241 .max_intensity = 0x2f,
242 .kick_battery = spitz_bl_kick_battery,
229}; 243};
230 244
231static struct platform_device spitzbl_device = { 245static struct platform_device spitzbl_device = {
232 .name = "corgi-bl", 246 .name = "generic-bl",
233 .dev = { 247 .dev = {
234 .platform_data = &spitz_bl_machinfo, 248 .platform_data = &spitz_bl_machinfo,
235 }, 249 },
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index 0ba7e9060c7b..c326983f4a8f 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -276,7 +276,21 @@ static unsigned char pm_osiris_ctrl0;
276 276
277static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state) 277static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state)
278{ 278{
279 unsigned int tmp;
280
279 pm_osiris_ctrl0 = __raw_readb(OSIRIS_VA_CTRL0); 281 pm_osiris_ctrl0 = __raw_readb(OSIRIS_VA_CTRL0);
282 tmp = pm_osiris_ctrl0 & ~OSIRIS_CTRL0_NANDSEL;
283
284 /* ensure correct NAND slot is selected on resume */
285 if ((pm_osiris_ctrl0 & OSIRIS_CTRL0_BOOT_INT) == 0)
286 tmp |= 2;
287
288 __raw_writeb(tmp, OSIRIS_VA_CTRL0);
289
290 /* ensure that an nRESET is not generated on resume. */
291 s3c2410_gpio_setpin(S3C2410_GPA21, 1);
292 s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT);
293
280 return 0; 294 return 0;
281} 295}
282 296
@@ -285,6 +299,10 @@ static int osiris_pm_resume(struct sys_device *sd)
285 if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8) 299 if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8)
286 __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1); 300 __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1);
287 301
302 __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0);
303
304 s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT);
305
288 return 0; 306 return 0;
289} 307}
290 308
diff --git a/arch/avr32/boards/atngw100/flash.c b/arch/avr32/boards/atngw100/flash.c
index f9b32a8eab9b..b07ae63aa548 100644
--- a/arch/avr32/boards/atngw100/flash.c
+++ b/arch/avr32/boards/atngw100/flash.c
@@ -15,7 +15,7 @@
15 15
16#include <asm/arch/smc.h> 16#include <asm/arch/smc.h>
17 17
18static struct smc_config flash_config __initdata = { 18static struct smc_timing flash_timing __initdata = {
19 .ncs_read_setup = 0, 19 .ncs_read_setup = 0,
20 .nrd_setup = 40, 20 .nrd_setup = 40,
21 .ncs_write_setup = 0, 21 .ncs_write_setup = 0,
@@ -28,7 +28,9 @@ static struct smc_config flash_config __initdata = {
28 28
29 .read_cycle = 120, 29 .read_cycle = 120,
30 .write_cycle = 120, 30 .write_cycle = 120,
31};
31 32
33static struct smc_config flash_config __initdata = {
32 .bus_width = 2, 34 .bus_width = 2,
33 .nrd_controlled = 1, 35 .nrd_controlled = 1,
34 .nwe_controlled = 1, 36 .nwe_controlled = 1,
@@ -82,6 +84,7 @@ static int __init atngw100_flash_init(void)
82{ 84{
83 int ret; 85 int ret;
84 86
87 smc_set_timing(&flash_config, &flash_timing);
85 ret = smc_set_configuration(0, &flash_config); 88 ret = smc_set_configuration(0, &flash_config);
86 if (ret < 0) { 89 if (ret < 0) {
87 printk(KERN_ERR "atngw100: failed to set NOR flash timing\n"); 90 printk(KERN_ERR "atngw100: failed to set NOR flash timing\n");
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c
index ef801563bbf5..52987c81d668 100644
--- a/arch/avr32/boards/atngw100/setup.c
+++ b/arch/avr32/boards/atngw100/setup.c
@@ -125,8 +125,11 @@ static struct platform_device ngw_gpio_leds = {
125}; 125};
126 126
127static struct i2c_gpio_platform_data i2c_gpio_data = { 127static struct i2c_gpio_platform_data i2c_gpio_data = {
128 .sda_pin = GPIO_PIN_PA(6), 128 .sda_pin = GPIO_PIN_PA(6),
129 .scl_pin = GPIO_PIN_PA(7), 129 .scl_pin = GPIO_PIN_PA(7),
130 .sda_is_open_drain = 1,
131 .scl_is_open_drain = 1,
132 .udelay = 2, /* close to 100 kHz */
130}; 133};
131 134
132static struct platform_device i2c_gpio_device = { 135static struct platform_device i2c_gpio_device = {
@@ -154,6 +157,7 @@ static int __init atngw100_init(void)
154 set_hw_addr(at32_add_device_eth(1, &eth_data[1])); 157 set_hw_addr(at32_add_device_eth(1, &eth_data[1]));
155 158
156 at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); 159 at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
160 at32_add_device_usba(0, NULL);
157 161
158 for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) { 162 for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) {
159 at32_select_gpio(ngw_leds[i].gpio, 163 at32_select_gpio(ngw_leds[i].gpio,
@@ -161,8 +165,10 @@ static int __init atngw100_init(void)
161 } 165 }
162 platform_device_register(&ngw_gpio_leds); 166 platform_device_register(&ngw_gpio_leds);
163 167
164 at32_select_gpio(i2c_gpio_data.sda_pin, 0); 168 at32_select_gpio(i2c_gpio_data.sda_pin,
165 at32_select_gpio(i2c_gpio_data.scl_pin, 0); 169 AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
170 at32_select_gpio(i2c_gpio_data.scl_pin,
171 AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
166 platform_device_register(&i2c_gpio_device); 172 platform_device_register(&i2c_gpio_device);
167 173
168 return 0; 174 return 0;
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c
index c9981b731efa..6b9e466104ad 100644
--- a/arch/avr32/boards/atstk1000/atstk1002.c
+++ b/arch/avr32/boards/atstk1000/atstk1002.c
@@ -241,6 +241,7 @@ static int __init atstk1002_init(void)
241 at32_add_device_lcdc(0, &atstk1000_lcdc_data, 241 at32_add_device_lcdc(0, &atstk1000_lcdc_data,
242 fbmem_start, fbmem_size); 242 fbmem_start, fbmem_size);
243#endif 243#endif
244 at32_add_device_usba(0, NULL);
244#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM 245#ifndef CONFIG_BOARD_ATSTK1002_SW3_CUSTOM
245 at32_add_device_ssc(0, ATMEL_SSC_TX); 246 at32_add_device_ssc(0, ATMEL_SSC_TX);
246#endif 247#endif
diff --git a/arch/avr32/boards/atstk1000/flash.c b/arch/avr32/boards/atstk1000/flash.c
index aac4300cca12..3d0a102ad45e 100644
--- a/arch/avr32/boards/atstk1000/flash.c
+++ b/arch/avr32/boards/atstk1000/flash.c
@@ -15,7 +15,7 @@
15 15
16#include <asm/arch/smc.h> 16#include <asm/arch/smc.h>
17 17
18static struct smc_config flash_config __initdata = { 18static struct smc_timing flash_timing __initdata = {
19 .ncs_read_setup = 0, 19 .ncs_read_setup = 0,
20 .nrd_setup = 40, 20 .nrd_setup = 40,
21 .ncs_write_setup = 0, 21 .ncs_write_setup = 0,
@@ -28,7 +28,9 @@ static struct smc_config flash_config __initdata = {
28 28
29 .read_cycle = 120, 29 .read_cycle = 120,
30 .write_cycle = 120, 30 .write_cycle = 120,
31};
31 32
33static struct smc_config flash_config __initdata = {
32 .bus_width = 2, 34 .bus_width = 2,
33 .nrd_controlled = 1, 35 .nrd_controlled = 1,
34 .nwe_controlled = 1, 36 .nwe_controlled = 1,
@@ -82,6 +84,7 @@ static int __init atstk1000_flash_init(void)
82{ 84{
83 int ret; 85 int ret;
84 86
87 smc_set_timing(&flash_config, &flash_timing);
85 ret = smc_set_configuration(0, &flash_config); 88 ret = smc_set_configuration(0, &flash_config);
86 if (ret < 0) { 89 if (ret < 0) {
87 printk(KERN_ERR "atstk1000: failed to set NOR flash timing\n"); 90 printk(KERN_ERR "atstk1000: failed to set NOR flash timing\n");
diff --git a/arch/avr32/kernel/Makefile b/arch/avr32/kernel/Makefile
index 90e5afff54a2..989fcd1fef7e 100644
--- a/arch/avr32/kernel/Makefile
+++ b/arch/avr32/kernel/Makefile
@@ -11,8 +11,3 @@ obj-y += signal.o sys_avr32.o process.o time.o
11obj-y += init_task.o switch_to.o cpu.o 11obj-y += init_task.o switch_to.o cpu.o
12obj-$(CONFIG_MODULES) += module.o avr32_ksyms.o 12obj-$(CONFIG_MODULES) += module.o avr32_ksyms.o
13obj-$(CONFIG_KPROBES) += kprobes.o 13obj-$(CONFIG_KPROBES) += kprobes.o
14
15USE_STANDARD_AS_RULE := true
16
17%.lds: %.lds.c FORCE
18 $(call if_changed_dep,cpp_lds_S)
diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S
index 42657f1703b2..ccadfd9b438d 100644
--- a/arch/avr32/kernel/entry-avr32b.S
+++ b/arch/avr32/kernel/entry-avr32b.S
@@ -159,11 +159,18 @@ handle_vmalloc_miss:
159 159
160 .section .scall.text,"ax",@progbits 160 .section .scall.text,"ax",@progbits
161system_call: 161system_call:
162#ifdef CONFIG_PREEMPT
163 mask_interrupts
164#endif
162 pushm r12 /* r12_orig */ 165 pushm r12 /* r12_orig */
163 stmts --sp, r0-lr 166 stmts --sp, r0-lr
164 zero_fp 167
165 mfsr r0, SYSREG_RAR_SUP 168 mfsr r0, SYSREG_RAR_SUP
166 mfsr r1, SYSREG_RSR_SUP 169 mfsr r1, SYSREG_RSR_SUP
170#ifdef CONFIG_PREEMPT
171 unmask_interrupts
172#endif
173 zero_fp
167 stm --sp, r0-r1 174 stm --sp, r0-r1
168 175
169 /* check for syscall tracing */ 176 /* check for syscall tracing */
@@ -638,6 +645,13 @@ irq_level\level:
638 stmts --sp,r0-lr 645 stmts --sp,r0-lr
639 mfsr r8, rar_int\level 646 mfsr r8, rar_int\level
640 mfsr r9, rsr_int\level 647 mfsr r9, rsr_int\level
648
649#ifdef CONFIG_PREEMPT
650 sub r11, pc, (. - system_call)
651 cp.w r11, r8
652 breq 4f
653#endif
654
641 pushm r8-r9 655 pushm r8-r9
642 656
643 mov r11, sp 657 mov r11, sp
@@ -668,6 +682,16 @@ irq_level\level:
668 sub sp, -4 /* ignore r12_orig */ 682 sub sp, -4 /* ignore r12_orig */
669 rete 683 rete
670 684
685#ifdef CONFIG_PREEMPT
6864: mask_interrupts
687 mfsr r8, rsr_int\level
688 sbr r8, 16
689 mtsr rsr_int\level, r8
690 ldmts sp++, r0-lr
691 sub sp, -4 /* ignore r12_orig */
692 rete
693#endif
694
6712: get_thread_info r0 6952: get_thread_info r0
672 ld.w r1, r0[TI_flags] 696 ld.w r1, r0[TI_flags]
673 bld r1, TIF_CPU_GOING_TO_SLEEP 697 bld r1, TIF_CPU_GOING_TO_SLEEP
diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c
index d08b0bc6b2bb..4b4c1884e1c5 100644
--- a/arch/avr32/kernel/setup.c
+++ b/arch/avr32/kernel/setup.c
@@ -248,7 +248,7 @@ static int __init early_parse_fbmem(char *p)
248 248
249 fbmem_size = memparse(p, &p); 249 fbmem_size = memparse(p, &p);
250 if (*p == '@') { 250 if (*p == '@') {
251 fbmem_start = memparse(p, &p); 251 fbmem_start = memparse(p + 1, &p);
252 ret = add_reserved_region(fbmem_start, 252 ret = add_reserved_region(fbmem_start,
253 fbmem_start + fbmem_size - 1, 253 fbmem_start + fbmem_size - 1,
254 "Framebuffer"); 254 "Framebuffer");
diff --git a/arch/avr32/kernel/vmlinux.lds.c b/arch/avr32/kernel/vmlinux.lds.S
index db0438f35c00..ce9ac9659883 100644
--- a/arch/avr32/kernel/vmlinux.lds.c
+++ b/arch/avr32/kernel/vmlinux.lds.S
@@ -9,6 +9,8 @@
9 */ 9 */
10#define LOAD_OFFSET 0x00000000 10#define LOAD_OFFSET 0x00000000
11#include <asm-generic/vmlinux.lds.h> 11#include <asm-generic/vmlinux.lds.h>
12#include <asm/cache.h>
13#include <asm/thread_info.h>
12 14
13OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32") 15OUTPUT_FORMAT("elf32-avr32", "elf32-avr32", "elf32-avr32")
14OUTPUT_ARCH(avr32) 16OUTPUT_ARCH(avr32)
@@ -58,11 +60,10 @@ SECTIONS
58 *(.init.ramfs) 60 *(.init.ramfs)
59 __initramfs_end = .; 61 __initramfs_end = .;
60#endif 62#endif
61 . = ALIGN(4096); 63 . = ALIGN(PAGE_SIZE);
62 __init_end = .; 64 __init_end = .;
63 } 65 }
64 66
65 . = ALIGN(8192);
66 .text : AT(ADDR(.text) - LOAD_OFFSET) { 67 .text : AT(ADDR(.text) - LOAD_OFFSET) {
67 _evba = .; 68 _evba = .;
68 _text = .; 69 _text = .;
@@ -96,7 +97,7 @@ SECTIONS
96 97
97 RODATA 98 RODATA
98 99
99 . = ALIGN(8192); 100 . = ALIGN(THREAD_SIZE);
100 101
101 .data : AT(ADDR(.data) - LOAD_OFFSET) { 102 .data : AT(ADDR(.data) - LOAD_OFFSET) {
102 _data = .; 103 _data = .;
@@ -107,7 +108,7 @@ SECTIONS
107 *(.data.init_task) 108 *(.data.init_task)
108 109
109 /* Then, the cacheline aligned data */ 110 /* Then, the cacheline aligned data */
110 . = ALIGN(32); 111 . = ALIGN(L1_CACHE_BYTES);
111 *(.data.cacheline_aligned) 112 *(.data.cacheline_aligned)
112 113
113 /* And the rest... */ 114 /* And the rest... */
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c
index 64cc5583ddfb..f6d154ca4d24 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -25,12 +25,6 @@
25#include "pio.h" 25#include "pio.h"
26#include "pm.h" 26#include "pm.h"
27 27
28/*
29 * We can reduce the code size a bit by using a constant here. Since
30 * this file is completely chip-specific, it's safe to not use
31 * ioremap. Generic drivers should of course never do this.
32 */
33#define AT32_PM_BASE 0xfff00000
34 28
35#define PBMEM(base) \ 29#define PBMEM(base) \
36 { \ 30 { \
@@ -1168,6 +1162,72 @@ at32_add_device_ssc(unsigned int id, unsigned int flags)
1168} 1162}
1169 1163
1170/* -------------------------------------------------------------------- 1164/* --------------------------------------------------------------------
1165 * USB Device Controller
1166 * -------------------------------------------------------------------- */
1167static struct resource usba0_resource[] __initdata = {
1168 {
1169 .start = 0xff300000,
1170 .end = 0xff3fffff,
1171 .flags = IORESOURCE_MEM,
1172 }, {
1173 .start = 0xfff03000,
1174 .end = 0xfff033ff,
1175 .flags = IORESOURCE_MEM,
1176 },
1177 IRQ(31),
1178};
1179static struct clk usba0_pclk = {
1180 .name = "pclk",
1181 .parent = &pbb_clk,
1182 .mode = pbb_clk_mode,
1183 .get_rate = pbb_clk_get_rate,
1184 .index = 12,
1185};
1186static struct clk usba0_hclk = {
1187 .name = "hclk",
1188 .parent = &hsb_clk,
1189 .mode = hsb_clk_mode,
1190 .get_rate = hsb_clk_get_rate,
1191 .index = 6,
1192};
1193
1194struct platform_device *__init
1195at32_add_device_usba(unsigned int id, struct usba_platform_data *data)
1196{
1197 struct platform_device *pdev;
1198
1199 if (id != 0)
1200 return NULL;
1201
1202 pdev = platform_device_alloc("atmel_usba_udc", 0);
1203 if (!pdev)
1204 return NULL;
1205
1206 if (platform_device_add_resources(pdev, usba0_resource,
1207 ARRAY_SIZE(usba0_resource)))
1208 goto out_free_pdev;
1209
1210 if (data) {
1211 if (platform_device_add_data(pdev, data, sizeof(*data)))
1212 goto out_free_pdev;
1213
1214 if (data->vbus_pin != GPIO_PIN_NONE)
1215 at32_select_gpio(data->vbus_pin, 0);
1216 }
1217
1218 usba0_pclk.dev = &pdev->dev;
1219 usba0_hclk.dev = &pdev->dev;
1220
1221 platform_device_add(pdev);
1222
1223 return pdev;
1224
1225out_free_pdev:
1226 platform_device_put(pdev);
1227 return NULL;
1228}
1229
1230/* --------------------------------------------------------------------
1171 * GCLK 1231 * GCLK
1172 * -------------------------------------------------------------------- */ 1232 * -------------------------------------------------------------------- */
1173static struct clk gclk0 = { 1233static struct clk gclk0 = {
@@ -1252,6 +1312,8 @@ struct clk *at32_clock_list[] = {
1252 &ssc0_pclk, 1312 &ssc0_pclk,
1253 &ssc1_pclk, 1313 &ssc1_pclk,
1254 &ssc2_pclk, 1314 &ssc2_pclk,
1315 &usba0_hclk,
1316 &usba0_pclk,
1255 &gclk0, 1317 &gclk0,
1256 &gclk1, 1318 &gclk1,
1257 &gclk2, 1319 &gclk2,
diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c
index 0f8c89c9f832..4642117cc9ab 100644
--- a/arch/avr32/mach-at32ap/clock.c
+++ b/arch/avr32/mach-at32ap/clock.c
@@ -150,3 +150,119 @@ struct clk *clk_get_parent(struct clk *clk)
150 return clk->parent; 150 return clk->parent;
151} 151}
152EXPORT_SYMBOL(clk_get_parent); 152EXPORT_SYMBOL(clk_get_parent);
153
154
155
156#ifdef CONFIG_DEBUG_FS
157
158/* /sys/kernel/debug/at32ap_clk */
159
160#include <linux/io.h>
161#include <linux/debugfs.h>
162#include <linux/seq_file.h>
163#include "pm.h"
164
165
166#define NEST_DELTA 2
167#define NEST_MAX 6
168
169struct clkinf {
170 struct seq_file *s;
171 unsigned nest;
172};
173
174static void
175dump_clock(struct clk *parent, struct clkinf *r)
176{
177 unsigned nest = r->nest;
178 char buf[16 + NEST_MAX];
179 struct clk *clk;
180 unsigned i;
181
182 /* skip clocks coupled to devices that aren't registered */
183 if (parent->dev && !parent->dev->bus_id[0] && !parent->users)
184 return;
185
186 /* <nest spaces> name <pad to end> */
187 memset(buf, ' ', sizeof(buf) - 1);
188 buf[sizeof(buf) - 1] = 0;
189 i = strlen(parent->name);
190 memcpy(buf + nest, parent->name,
191 min(i, (unsigned)(sizeof(buf) - 1 - nest)));
192
193 seq_printf(r->s, "%s%c users=%2d %-3s %9ld Hz",
194 buf, parent->set_parent ? '*' : ' ',
195 parent->users,
196 parent->users ? "on" : "off", /* NOTE: not-paranoid!! */
197 clk_get_rate(parent));
198 if (parent->dev)
199 seq_printf(r->s, ", for %s", parent->dev->bus_id);
200 seq_printf(r->s, "\n");
201
202 /* cost of this scan is small, but not linear... */
203 r->nest = nest + NEST_DELTA;
204 for (i = 3; i < at32_nr_clocks; i++) {
205 clk = at32_clock_list[i];
206 if (clk->parent == parent)
207 dump_clock(clk, r);
208 }
209 r->nest = nest;
210}
211
212static int clk_show(struct seq_file *s, void *unused)
213{
214 struct clkinf r;
215 int i;
216
217 /* show all the power manager registers */
218 seq_printf(s, "MCCTRL = %8x\n", pm_readl(MCCTRL));
219 seq_printf(s, "CKSEL = %8x\n", pm_readl(CKSEL));
220 seq_printf(s, "CPUMASK = %8x\n", pm_readl(CPU_MASK));
221 seq_printf(s, "HSBMASK = %8x\n", pm_readl(HSB_MASK));
222 seq_printf(s, "PBAMASK = %8x\n", pm_readl(PBA_MASK));
223 seq_printf(s, "PBBMASK = %8x\n", pm_readl(PBB_MASK));
224 seq_printf(s, "PLL0 = %8x\n", pm_readl(PLL0));
225 seq_printf(s, "PLL1 = %8x\n", pm_readl(PLL1));
226 seq_printf(s, "IMR = %8x\n", pm_readl(IMR));
227 for (i = 0; i < 8; i++) {
228 if (i == 5)
229 continue;
230 seq_printf(s, "GCCTRL%d = %8x\n", i, pm_readl(GCCTRL(i)));
231 }
232
233 seq_printf(s, "\n");
234
235 /* show clock tree as derived from the three oscillators
236 * we "know" are at the head of the list
237 */
238 r.s = s;
239 r.nest = 0;
240 dump_clock(at32_clock_list[0], &r);
241 dump_clock(at32_clock_list[1], &r);
242 dump_clock(at32_clock_list[2], &r);
243
244 return 0;
245}
246
247static int clk_open(struct inode *inode, struct file *file)
248{
249 return single_open(file, clk_show, NULL);
250}
251
252static const struct file_operations clk_operations = {
253 .open = clk_open,
254 .read = seq_read,
255 .llseek = seq_lseek,
256 .release = single_release,
257};
258
259static int __init clk_debugfs_init(void)
260{
261 (void) debugfs_create_file("at32ap_clk", S_IFREG | S_IRUGO,
262 NULL, NULL, &clk_operations);
263
264 return 0;
265}
266postcore_initcall(clk_debugfs_init);
267
268#endif
diff --git a/arch/avr32/mach-at32ap/hsmc.c b/arch/avr32/mach-at32ap/hsmc.c
index 5e22a750632b..704607fbcc69 100644
--- a/arch/avr32/mach-at32ap/hsmc.c
+++ b/arch/avr32/mach-at32ap/hsmc.c
@@ -29,16 +29,25 @@ struct hsmc {
29 29
30static struct hsmc *hsmc; 30static struct hsmc *hsmc;
31 31
32int smc_set_configuration(int cs, const struct smc_config *config) 32void smc_set_timing(struct smc_config *config,
33 const struct smc_timing *timing)
33{ 34{
35 int recover;
36 int cycle;
37
34 unsigned long mul; 38 unsigned long mul;
35 unsigned long offset;
36 u32 setup, pulse, cycle, mode;
37 39
38 if (!hsmc) 40 /* Reset all SMC timings */
39 return -ENODEV; 41 config->ncs_read_setup = 0;
40 if (cs >= NR_CHIP_SELECTS) 42 config->nrd_setup = 0;
41 return -EINVAL; 43 config->ncs_write_setup = 0;
44 config->nwe_setup = 0;
45 config->ncs_read_pulse = 0;
46 config->nrd_pulse = 0;
47 config->ncs_write_pulse = 0;
48 config->nwe_pulse = 0;
49 config->read_cycle = 0;
50 config->write_cycle = 0;
42 51
43 /* 52 /*
44 * cycles = x / T = x * f 53 * cycles = x / T = x * f
@@ -50,16 +59,102 @@ int smc_set_configuration(int cs, const struct smc_config *config)
50 59
51#define ns2cyc(x) ((((x) * mul) + 65535) >> 16) 60#define ns2cyc(x) ((((x) * mul) + 65535) >> 16)
52 61
53 setup = (HSMC_BF(NWE_SETUP, ns2cyc(config->nwe_setup)) 62 if (timing->ncs_read_setup > 0)
54 | HSMC_BF(NCS_WR_SETUP, ns2cyc(config->ncs_write_setup)) 63 config->ncs_read_setup = ns2cyc(timing->ncs_read_setup);
55 | HSMC_BF(NRD_SETUP, ns2cyc(config->nrd_setup)) 64
56 | HSMC_BF(NCS_RD_SETUP, ns2cyc(config->ncs_read_setup))); 65 if (timing->nrd_setup > 0)
57 pulse = (HSMC_BF(NWE_PULSE, ns2cyc(config->nwe_pulse)) 66 config->nrd_setup = ns2cyc(timing->nrd_setup);
58 | HSMC_BF(NCS_WR_PULSE, ns2cyc(config->ncs_write_pulse)) 67
59 | HSMC_BF(NRD_PULSE, ns2cyc(config->nrd_pulse)) 68 if (timing->ncs_write_setup > 0)
60 | HSMC_BF(NCS_RD_PULSE, ns2cyc(config->ncs_read_pulse))); 69 config->ncs_write_setup = ns2cyc(timing->ncs_write_setup);
61 cycle = (HSMC_BF(NWE_CYCLE, ns2cyc(config->write_cycle)) 70
62 | HSMC_BF(NRD_CYCLE, ns2cyc(config->read_cycle))); 71 if (timing->nwe_setup > 0)
72 config->nwe_setup = ns2cyc(timing->nwe_setup);
73
74 if (timing->ncs_read_pulse > 0)
75 config->ncs_read_pulse = ns2cyc(timing->ncs_read_pulse);
76
77 if (timing->nrd_pulse > 0)
78 config->nrd_pulse = ns2cyc(timing->nrd_pulse);
79
80 if (timing->ncs_write_pulse > 0)
81 config->ncs_write_pulse = ns2cyc(timing->ncs_write_pulse);
82
83 if (timing->nwe_pulse > 0)
84 config->nwe_pulse = ns2cyc(timing->nwe_pulse);
85
86 if (timing->read_cycle > 0)
87 config->read_cycle = ns2cyc(timing->read_cycle);
88
89 if (timing->write_cycle > 0)
90 config->write_cycle = ns2cyc(timing->write_cycle);
91
92 /* Extend read cycle in needed */
93 if (timing->ncs_read_recover > 0)
94 recover = ns2cyc(timing->ncs_read_recover);
95 else
96 recover = 1;
97
98 cycle = config->ncs_read_setup + config->ncs_read_pulse + recover;
99
100 if (config->read_cycle < cycle)
101 config->read_cycle = cycle;
102
103 /* Extend read cycle in needed */
104 if (timing->nrd_recover > 0)
105 recover = ns2cyc(timing->nrd_recover);
106 else
107 recover = 1;
108
109 cycle = config->nrd_setup + config->nrd_pulse + recover;
110
111 if (config->read_cycle < cycle)
112 config->read_cycle = cycle;
113
114 /* Extend write cycle in needed */
115 if (timing->ncs_write_recover > 0)
116 recover = ns2cyc(timing->ncs_write_recover);
117 else
118 recover = 1;
119
120 cycle = config->ncs_write_setup + config->ncs_write_pulse + recover;
121
122 if (config->write_cycle < cycle)
123 config->write_cycle = cycle;
124
125 /* Extend write cycle in needed */
126 if (timing->nwe_recover > 0)
127 recover = ns2cyc(timing->nwe_recover);
128 else
129 recover = 1;
130
131 cycle = config->nwe_setup + config->nwe_pulse + recover;
132
133 if (config->write_cycle < cycle)
134 config->write_cycle = cycle;
135}
136EXPORT_SYMBOL(smc_set_timing);
137
138int smc_set_configuration(int cs, const struct smc_config *config)
139{
140 unsigned long offset;
141 u32 setup, pulse, cycle, mode;
142
143 if (!hsmc)
144 return -ENODEV;
145 if (cs >= NR_CHIP_SELECTS)
146 return -EINVAL;
147
148 setup = (HSMC_BF(NWE_SETUP, config->nwe_setup)
149 | HSMC_BF(NCS_WR_SETUP, config->ncs_write_setup)
150 | HSMC_BF(NRD_SETUP, config->nrd_setup)
151 | HSMC_BF(NCS_RD_SETUP, config->ncs_read_setup));
152 pulse = (HSMC_BF(NWE_PULSE, config->nwe_pulse)
153 | HSMC_BF(NCS_WR_PULSE, config->ncs_write_pulse)
154 | HSMC_BF(NRD_PULSE, config->nrd_pulse)
155 | HSMC_BF(NCS_RD_PULSE, config->ncs_read_pulse));
156 cycle = (HSMC_BF(NWE_CYCLE, config->write_cycle)
157 | HSMC_BF(NRD_CYCLE, config->read_cycle));
63 158
64 switch (config->bus_width) { 159 switch (config->bus_width) {
65 case 1: 160 case 1:
diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c
index 1eb99b814f5b..d61a02da898c 100644
--- a/arch/avr32/mach-at32ap/pio.c
+++ b/arch/avr32/mach-at32ap/pio.c
@@ -110,6 +110,10 @@ void __init at32_select_gpio(unsigned int pin, unsigned long flags)
110 pio_writel(pio, SODR, mask); 110 pio_writel(pio, SODR, mask);
111 else 111 else
112 pio_writel(pio, CODR, mask); 112 pio_writel(pio, CODR, mask);
113 if (flags & AT32_GPIOF_MULTIDRV)
114 pio_writel(pio, MDER, mask);
115 else
116 pio_writel(pio, MDDR, mask);
113 pio_writel(pio, PUDR, mask); 117 pio_writel(pio, PUDR, mask);
114 pio_writel(pio, OER, mask); 118 pio_writel(pio, OER, mask);
115 } else { 119 } else {
diff --git a/arch/avr32/mach-at32ap/pm.h b/arch/avr32/mach-at32ap/pm.h
index a1f8aced0a8c..47efd0d1951f 100644
--- a/arch/avr32/mach-at32ap/pm.h
+++ b/arch/avr32/mach-at32ap/pm.h
@@ -4,6 +4,14 @@
4#ifndef __ARCH_AVR32_MACH_AT32AP_PM_H__ 4#ifndef __ARCH_AVR32_MACH_AT32AP_PM_H__
5#define __ARCH_AVR32_MACH_AT32AP_PM_H__ 5#define __ARCH_AVR32_MACH_AT32AP_PM_H__
6 6
7/*
8 * We can reduce the code size a bit by using a constant here. Since
9 * this file is only used on AVR32 AP CPUs with segmentation enabled,
10 * it's safe to not use ioremap. Generic drivers should of course
11 * never do this.
12 */
13#define AT32_PM_BASE 0xfff00000
14
7/* PM register offsets */ 15/* PM register offsets */
8#define PM_MCCTRL 0x0000 16#define PM_MCCTRL 0x0000
9#define PM_CKSEL 0x0004 17#define PM_CKSEL 0x0004
diff --git a/arch/avr32/mm/init.c b/arch/avr32/mm/init.c
index 82cf70854b90..480760bde63f 100644
--- a/arch/avr32/mm/init.c
+++ b/arch/avr32/mm/init.c
@@ -224,19 +224,9 @@ void free_initmem(void)
224 224
225#ifdef CONFIG_BLK_DEV_INITRD 225#ifdef CONFIG_BLK_DEV_INITRD
226 226
227static int keep_initrd;
228
229void free_initrd_mem(unsigned long start, unsigned long end) 227void free_initrd_mem(unsigned long start, unsigned long end)
230{ 228{
231 if (!keep_initrd) 229 free_area(start, end, "initrd");
232 free_area(start, end, "initrd");
233}
234
235static int __init keepinitrd_setup(char *__unused)
236{
237 keep_initrd = 1;
238 return 1;
239} 230}
240 231
241__setup("keepinitrd", keepinitrd_setup);
242#endif 232#endif
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 017defaa525b..b24f4535ffe0 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -57,7 +57,7 @@ config GENERIC_TIME
57 bool 57 bool
58 default n 58 default n
59 59
60config GENERIC_CALIBRATE_DELAY 60config GENERIC_GPIO
61 bool 61 bool
62 default y 62 default y
63 63
@@ -323,7 +323,7 @@ config CMDLINE
323 to the kernel, you may specify one here. As a minimum, you should specify 323 to the kernel, you may specify one here. As a minimum, you should specify
324 the memory size and the root device (e.g., mem=8M, root=/dev/nfs). 324 the memory size and the root device (e.g., mem=8M, root=/dev/nfs).
325 325
326comment "Board Setup" 326comment "Clock/PLL Setup"
327 327
328config CLKIN_HZ 328config CLKIN_HZ
329 int "Crystal Frequency in Hz" 329 int "Crystal Frequency in Hz"
@@ -335,6 +335,118 @@ config CLKIN_HZ
335 help 335 help
336 The frequency of CLKIN crystal oscillator on the board in Hz. 336 The frequency of CLKIN crystal oscillator on the board in Hz.
337 337
338config BFIN_KERNEL_CLOCK
339 bool "Re-program Clocks while Kernel boots?"
340 default n
341 help
342 This option decides if kernel clocks are re-programed from the
343 bootloader settings. If the clocks are not set, the SDRAM settings
344 are also not changed, and the Bootloader does 100% of the hardware
345 configuration.
346
347config PLL_BYPASS
348 bool "Bypass PLL"
349 depends on BFIN_KERNEL_CLOCK
350 default n
351
352config CLKIN_HALF
353 bool "Half Clock In"
354 depends on BFIN_KERNEL_CLOCK && (! PLL_BYPASS)
355 default n
356 help
357 If this is set the clock will be divided by 2, before it goes to the PLL.
358
359config VCO_MULT
360 int "VCO Multiplier"
361 depends on BFIN_KERNEL_CLOCK && (! PLL_BYPASS)
362 range 1 64
363 default "22" if BFIN533_EZKIT
364 default "45" if BFIN533_STAMP
365 default "20" if BFIN537_STAMP
366 default "22" if BFIN533_BLUETECHNIX_CM
367 default "20" if BFIN537_BLUETECHNIX_CM
368 default "20" if BFIN561_BLUETECHNIX_CM
369 default "20" if BFIN561_EZKIT
370 help
371 This controls the frequency of the on-chip PLL. This can be between 1 and 64.
372 PLL Frequency = (Crystal Frequency) * (this setting)
373
374choice
375 prompt "Core Clock Divider"
376 depends on BFIN_KERNEL_CLOCK
377 default CCLK_DIV_1
378 help
379 This sets the frequency of the core. It can be 1, 2, 4 or 8
380 Core Frequency = (PLL frequency) / (this setting)
381
382config CCLK_DIV_1
383 bool "1"
384
385config CCLK_DIV_2
386 bool "2"
387
388config CCLK_DIV_4
389 bool "4"
390
391config CCLK_DIV_8
392 bool "8"
393endchoice
394
395config SCLK_DIV
396 int "System Clock Divider"
397 depends on BFIN_KERNEL_CLOCK
398 range 1 15
399 default 5 if BFIN533_EZKIT
400 default 5 if BFIN533_STAMP
401 default 4 if BFIN537_STAMP
402 default 5 if BFIN533_BLUETECHNIX_CM
403 default 4 if BFIN537_BLUETECHNIX_CM
404 default 4 if BFIN561_BLUETECHNIX_CM
405 default 5 if BFIN561_EZKIT
406 help
407 This sets the frequency of the system clock (including SDRAM or DDR).
408 This can be between 1 and 15
409 System Clock = (PLL frequency) / (this setting)
410
411#
412# Max & Min Speeds for various Chips
413#
414config MAX_VCO_HZ
415 int
416 default 600000000 if BF522
417 default 600000000 if BF525
418 default 600000000 if BF527
419 default 400000000 if BF531
420 default 400000000 if BF532
421 default 750000000 if BF533
422 default 500000000 if BF534
423 default 400000000 if BF536
424 default 600000000 if BF537
425 default 533000000 if BF538
426 default 533000000 if BF539
427 default 600000000 if BF542
428 default 533000000 if BF544
429 default 533000000 if BF549
430 default 600000000 if BF561
431
432config MIN_VCO_HZ
433 int
434 default 50000000
435
436config MAX_SCLK_HZ
437 int
438 default 133000000
439
440config MIN_SCLK_HZ
441 int
442 default 27000000
443
444comment "Kernel Timer/Scheduler"
445
446source kernel/Kconfig.hz
447
448comment "Memory Setup"
449
338config MEM_SIZE 450config MEM_SIZE
339 int "SDRAM Memory Size in MBytes" 451 int "SDRAM Memory Size in MBytes"
340 default 32 if BFIN533_EZKIT 452 default 32 if BFIN533_EZKIT
@@ -364,15 +476,16 @@ config ENET_FLASH_PIN
364config BOOT_LOAD 476config BOOT_LOAD
365 hex "Kernel load address for booting" 477 hex "Kernel load address for booting"
366 default "0x1000" 478 default "0x1000"
479 range 0x1000 0x20000000
367 help 480 help
368 This option allows you to set the load address of the kernel. 481 This option allows you to set the load address of the kernel.
369 This can be useful if you are on a board which has a small amount 482 This can be useful if you are on a board which has a small amount
370 of memory or you wish to reserve some memory at the beginning of 483 of memory or you wish to reserve some memory at the beginning of
371 the address space. 484 the address space.
372 485
373 Note that you generally want to keep this value at or above 4k 486 Note that you need to keep this value above 4k (0x1000) as this
374 (0x1000) as this will allow the kernel to capture NULL pointer 487 memory region is used to capture NULL pointer references as well
375 references. 488 as some core kernel functions.
376 489
377comment "LED Status Indicators" 490comment "LED Status Indicators"
378 depends on (BFIN533_STAMP || BFIN533_BLUETECHNIX_CM) 491 depends on (BFIN533_STAMP || BFIN533_BLUETECHNIX_CM)
@@ -408,6 +521,52 @@ config BFIN_IDLE_LED_NUM
408 help 521 help
409 Select the LED (marked on the board) for you to blink. 522 Select the LED (marked on the board) for you to blink.
410 523
524choice
525 prompt "Blackfin Exception Scratch Register"
526 default BFIN_SCRATCH_REG_RETN
527 help
528 Select the resource to reserve for the Exception handler:
529 - RETN: Non-Maskable Interrupt (NMI)
530 - RETE: Exception Return (JTAG/ICE)
531 - CYCLES: Performance counter
532
533 If you are unsure, please select "RETN".
534
535config BFIN_SCRATCH_REG_RETN
536 bool "RETN"
537 help
538 Use the RETN register in the Blackfin exception handler
539 as a stack scratch register. This means you cannot
540 safely use NMI on the Blackfin while running Linux, but
541 you can debug the system with a JTAG ICE and use the
542 CYCLES performance registers.
543
544 If you are unsure, please select "RETN".
545
546config BFIN_SCRATCH_REG_RETE
547 bool "RETE"
548 help
549 Use the RETE register in the Blackfin exception handler
550 as a stack scratch register. This means you cannot
551 safely use a JTAG ICE while debugging a Blackfin board,
552 but you can safely use the CYCLES performance registers
553 and the NMI.
554
555 If you are unsure, please select "RETN".
556
557config BFIN_SCRATCH_REG_CYCLES
558 bool "CYCLES"
559 help
560 Use the CYCLES register in the Blackfin exception handler
561 as a stack scratch register. This means you cannot
562 safely use the CYCLES performance registers on a Blackfin
563 board at anytime, but you can debug the system with a JTAG
564 ICE and use the NMI.
565
566 If you are unsure, please select "RETN".
567
568endchoice
569
411# 570#
412# Sorry - but you need to put the hex address here - 571# Sorry - but you need to put the hex address here -
413# 572#
@@ -448,10 +607,6 @@ endmenu
448 607
449menu "Blackfin Kernel Optimizations" 608menu "Blackfin Kernel Optimizations"
450 609
451comment "Timer Tick"
452
453source kernel/Kconfig.hz
454
455comment "Memory Optimizations" 610comment "Memory Optimizations"
456 611
457config I_ENTRY_L1 612config I_ENTRY_L1
@@ -614,22 +769,22 @@ endchoice
614 769
615 770
616comment "Cache Support" 771comment "Cache Support"
617config BLKFIN_CACHE 772config BFIN_ICACHE
618 bool "Enable ICACHE" 773 bool "Enable ICACHE"
619config BLKFIN_DCACHE 774config BFIN_DCACHE
620 bool "Enable DCACHE" 775 bool "Enable DCACHE"
621config BLKFIN_DCACHE_BANKA 776config BFIN_DCACHE_BANKA
622 bool "Enable only 16k BankA DCACHE - BankB is SRAM" 777 bool "Enable only 16k BankA DCACHE - BankB is SRAM"
623 depends on BLKFIN_DCACHE && !BF531 778 depends on BFIN_DCACHE && !BF531
624 default n 779 default n
625config BLKFIN_CACHE_LOCK 780config BFIN_ICACHE_LOCK
626 bool "Enable Cache Locking" 781 bool "Enable Instruction Cache Locking"
627 782
628choice 783choice
629 prompt "Policy" 784 prompt "Policy"
630 depends on BLKFIN_DCACHE 785 depends on BFIN_DCACHE
631 default BLKFIN_WB 786 default BFIN_WB
632config BLKFIN_WB 787config BFIN_WB
633 bool "Write back" 788 bool "Write back"
634 help 789 help
635 Write Back Policy: 790 Write Back Policy:
@@ -646,7 +801,7 @@ config BLKFIN_WB
646 If you are unsure of the options and you want to be safe, 801 If you are unsure of the options and you want to be safe,
647 then go with Write Through. 802 then go with Write Through.
648 803
649config BLKFIN_WT 804config BFIN_WT
650 bool "Write through" 805 bool "Write through"
651 help 806 help
652 Write Back Policy: 807 Write Back Policy:
@@ -672,66 +827,9 @@ config L1_MAX_PIECE
672 Set the max memory pieces for the L1 SRAM allocation algorithm. 827 Set the max memory pieces for the L1 SRAM allocation algorithm.
673 Min value is 16. Max value is 1024. 828 Min value is 16. Max value is 1024.
674 829
675menu "Clock Settings"
676
677
678config BFIN_KERNEL_CLOCK
679 bool "Re-program Clocks while Kernel boots?"
680 default n
681 help
682 This option decides if kernel clocks are re-programed from the
683 bootloader settings. If the clocks are not set, the SDRAM settings
684 are also not changed, and the Bootloader does 100% of the hardware
685 configuration.
686
687config VCO_MULT
688 int "VCO Multiplier"
689 depends on BFIN_KERNEL_CLOCK
690 default "22" if BFIN533_EZKIT
691 default "45" if BFIN533_STAMP
692 default "20" if BFIN537_STAMP
693 default "22" if BFIN533_BLUETECHNIX_CM
694 default "20" if BFIN537_BLUETECHNIX_CM
695 default "20" if BFIN561_BLUETECHNIX_CM
696 default "20" if BFIN561_EZKIT
697
698config CCLK_DIV
699 int "Core Clock Divider"
700 depends on BFIN_KERNEL_CLOCK
701 default 1 if BFIN533_EZKIT
702 default 1 if BFIN533_STAMP
703 default 1 if BFIN537_STAMP
704 default 1 if BFIN533_BLUETECHNIX_CM
705 default 1 if BFIN537_BLUETECHNIX_CM
706 default 1 if BFIN561_BLUETECHNIX_CM
707 default 1 if BFIN561_EZKIT
708
709config SCLK_DIV
710 int "System Clock Divider"
711 depends on BFIN_KERNEL_CLOCK
712 default 5 if BFIN533_EZKIT
713 default 5 if BFIN533_STAMP
714 default 4 if BFIN537_STAMP
715 default 5 if BFIN533_BLUETECHNIX_CM
716 default 4 if BFIN537_BLUETECHNIX_CM
717 default 4 if BFIN561_BLUETECHNIX_CM
718 default 5 if BFIN561_EZKIT
719
720config CLKIN_HALF
721 bool "Half ClockIn"
722 depends on BFIN_KERNEL_CLOCK
723 default n
724
725config PLL_BYPASS
726 bool "Bypass PLL"
727 depends on BFIN_KERNEL_CLOCK
728 default n
729
730endmenu
731
732comment "Asynchonous Memory Configuration" 830comment "Asynchonous Memory Configuration"
733 831
734menu "EBIU_AMBCTL Global Control" 832menu "EBIU_AMGCTL Global Control"
735config C_AMCKEN 833config C_AMCKEN
736 bool "Enable CLKOUT" 834 bool "Enable CLKOUT"
737 default y 835 default y
@@ -941,24 +1039,6 @@ config DEBUG_ICACHE_CHECK
941 also relocates the irq_panic() function to L1 memory, (which is 1039 also relocates the irq_panic() function to L1 memory, (which is
942 un-cached). 1040 un-cached).
943 1041
944config DEBUG_KERNEL_START
945 bool "Debug Kernel Startup"
946 depends on DEBUG_KERNEL
947 help
948 Say Y here to put in an mini-execption handler before the kernel
949 replaces the bootloader exception handler. This will stop kernels
950 from dieing at startup with no visible error messages.
951
952config DEBUG_SERIAL_EARLY_INIT
953 bool "Initialize serial driver early"
954 default n
955 depends on SERIAL_BFIN
956 help
957 Say Y here if you want to get kernel output early when kernel
958 crashes before the normal console initialization. If this option
959 is enable, console output will always go to the ttyBF0, no matter
960 what kernel boot paramters you set.
961
962config DEBUG_HUNT_FOR_ZERO 1042config DEBUG_HUNT_FOR_ZERO
963 bool "Catch NULL pointer reads/writes" 1043 bool "Catch NULL pointer reads/writes"
964 default y 1044 default y
@@ -973,8 +1053,89 @@ config DEBUG_HUNT_FOR_ZERO
973 Enabling this option will take up an extra entry in CPLB table. 1053 Enabling this option will take up an extra entry in CPLB table.
974 Otherwise, there is no extra overhead. 1054 Otherwise, there is no extra overhead.
975 1055
1056config DEBUG_BFIN_HWTRACE_ON
1057 bool "Turn on Blackfin's Hardware Trace"
1058 default y
1059 help
1060 All Blackfins include a Trace Unit which stores a history of the last
1061 16 changes in program flow taken by the program sequencer. The history
1062 allows the user to recreate the program sequencer’s recent path. This
1063 can be handy when an application dies - we print out the execution
1064 path of how it got to the offending instruction.
1065
1066 By turning this off, you may save a tiny amount of power.
1067
1068choice
1069 prompt "Omit loop Tracing"
1070 default DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
1071 depends on DEBUG_BFIN_HWTRACE_ON
1072 help
1073 The trace buffer can be configured to omit recording of changes in
1074 program flow that match either the last entry or one of the last
1075 two entries. Omitting one of these entries from the record prevents
1076 the trace buffer from overflowing because of any sort of loop (for, do
1077 while, etc) in the program.
1078
1079 Because zero-overhead Hardware loops are not recorded in the trace buffer,
1080 this feature can be used to prevent trace overflow from loops that
1081 are nested four deep.
1082
1083config DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
1084 bool "Trace all Loops"
1085 help
1086 The trace buffer records all changes of flow
1087
1088config DEBUG_BFIN_HWTRACE_COMPRESSION_ONE
1089 bool "Compress single-level loops"
1090 help
1091 The trace buffer does not record single loops - helpful if trace
1092 is spinning on a while or do loop.
1093
1094config DEBUG_BFIN_HWTRACE_COMPRESSION_TWO
1095 bool "Compress two-level loops"
1096 help
1097 The trace buffer does not record loops two levels deep. Helpful if
1098 the trace is spinning in a nested loop
1099
1100endchoice
1101
1102config DEBUG_BFIN_HWTRACE_COMPRESSION
1103 int
1104 depends on DEBUG_BFIN_HWTRACE_ON
1105 default 0 if DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
1106 default 1 if DEBUG_BFIN_HWTRACE_COMPRESSION_ONE
1107 default 2 if DEBUG_BFIN_HWTRACE_COMPRESSION_TWO
1108
1109
1110config DEBUG_BFIN_HWTRACE_EXPAND
1111 bool "Expand Trace Buffer greater than 16 entries"
1112 depends on DEBUG_BFIN_HWTRACE_ON
1113 default n
1114 help
1115 By selecting this option, every time the 16 hardware entries in
1116 the Blackfin's HW Trace buffer are full, the kernel will move them
1117 into a software buffer, for dumping when there is an issue. This
1118 has a great impact on performance, (an interrupt every 16 change of
1119 flows) and should normally be turned off, except in those nasty
1120 debugging sessions
1121
1122config DEBUG_BFIN_HWTRACE_EXPAND_LEN
1123 int "Size of Trace buffer (in power of 2k)"
1124 range 0 4
1125 depends on DEBUG_BFIN_HWTRACE_EXPAND
1126 default 1
1127 help
1128 This sets the size of the software buffer that the trace information
1129 is kept in.
1130 0 for (2^0) 1k, or 256 entries,
1131 1 for (2^1) 2k, or 512 entries,
1132 2 for (2^2) 4k, or 1024 entries,
1133 3 for (2^3) 8k, or 2048 entries,
1134 4 for (2^4) 16k, or 4096 entries
1135
976config DEBUG_BFIN_NO_KERN_HWTRACE 1136config DEBUG_BFIN_NO_KERN_HWTRACE
977 bool "Trace user apps (turn off hwtrace in kernel)" 1137 bool "Trace user apps (turn off hwtrace in kernel)"
1138 depends on DEBUG_BFIN_HWTRACE_ON
978 default n 1139 default n
979 help 1140 help
980 Some pieces of the kernel contain a lot of flow changes which can 1141 Some pieces of the kernel contain a lot of flow changes which can
@@ -985,6 +1146,20 @@ config DEBUG_BFIN_NO_KERN_HWTRACE
985 Say Y here to disable hardware tracing in some known "jumpy" pieces 1146 Say Y here to disable hardware tracing in some known "jumpy" pieces
986 of code so that the trace buffer will extend further back. 1147 of code so that the trace buffer will extend further back.
987 1148
1149config EARLY_PRINTK
1150 bool "Early printk"
1151 default n
1152 help
1153 This option enables special console drivers which allow the kernel
1154 to print messages very early in the bootup process.
1155
1156 This is useful for kernel debugging when your machine crashes very
1157 early before the console code is initialized. After enabling this
1158 feature, you must add "earlyprintk=serial,uart0,57600" to the
1159 command line (bootargs). It is safe to say Y here in all cases, as
1160 all of this lives in the init section and is thrown away after the
1161 kernel boots completely.
1162
988config DUAL_CORE_TEST_MODULE 1163config DUAL_CORE_TEST_MODULE
989 tristate "Dual Core Test Module" 1164 tristate "Dual Core Test Module"
990 depends on (BF561) 1165 depends on (BF561)
diff --git a/arch/blackfin/configs/BF533-EZKIT_defconfig b/arch/blackfin/configs/BF533-EZKIT_defconfig
index 1cf1ab28dc66..57f58d5cd47a 100644
--- a/arch/blackfin/configs/BF533-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF533-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21.5 3# Linux kernel version: 2.6.22.6
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -15,8 +15,9 @@ CONFIG_GENERIC_HWEIGHT=y
15CONFIG_GENERIC_HARDIRQS=y 15CONFIG_GENERIC_HARDIRQS=y
16CONFIG_GENERIC_IRQ_PROBE=y 16CONFIG_GENERIC_IRQ_PROBE=y
17# CONFIG_GENERIC_TIME is not set 17# CONFIG_GENERIC_TIME is not set
18CONFIG_GENERIC_CALIBRATE_DELAY=y 18CONFIG_GENERIC_GPIO=y
19CONFIG_FORCE_MAX_ZONEORDER=14 19CONFIG_FORCE_MAX_ZONEORDER=14
20CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_IRQCHIP_DEMUX_GPIO=y 21CONFIG_IRQCHIP_DEMUX_GPIO=y
21CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
22 23
@@ -40,7 +41,9 @@ CONFIG_SYSVIPC_SYSCTL=y
40# CONFIG_TASKSTATS is not set 41# CONFIG_TASKSTATS is not set
41# CONFIG_UTS_NS is not set 42# CONFIG_UTS_NS is not set
42# CONFIG_AUDIT is not set 43# CONFIG_AUDIT is not set
43# CONFIG_IKCONFIG is not set 44CONFIG_IKCONFIG=y
45CONFIG_IKCONFIG_PROC=y
46CONFIG_LOG_BUF_SHIFT=14
44CONFIG_SYSFS_DEPRECATED=y 47CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 48# CONFIG_RELAY is not set
46CONFIG_BLK_DEV_INITRD=y 49CONFIG_BLK_DEV_INITRD=y
@@ -58,15 +61,20 @@ CONFIG_BUG=y
58CONFIG_ELF_CORE=y 61CONFIG_ELF_CORE=y
59CONFIG_BASE_FULL=y 62CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 63CONFIG_FUTEX=y
64CONFIG_ANON_INODES=y
65CONFIG_EPOLL=y
66CONFIG_SIGNALFD=y
67CONFIG_TIMERFD=y
68CONFIG_EVENTFD=y
69CONFIG_VM_EVENT_COUNTERS=y
61CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 70CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
62CONFIG_BUDDY=y
63# CONFIG_NP2 is not set 71# CONFIG_NP2 is not set
64CONFIG_SLAB=y 72CONFIG_SLAB=y
65CONFIG_VM_EVENT_COUNTERS=y 73# CONFIG_SLUB is not set
74# CONFIG_SLOB is not set
66CONFIG_RT_MUTEXES=y 75CONFIG_RT_MUTEXES=y
67CONFIG_TINY_SHMEM=y 76CONFIG_TINY_SHMEM=y
68CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
69# CONFIG_SLOB is not set
70 78
71# 79#
72# Loadable module support 80# Loadable module support
@@ -184,19 +192,17 @@ CONFIG_WDTIMER=13
184# CONFIG_CMDLINE_BOOL is not set 192# CONFIG_CMDLINE_BOOL is not set
185 193
186# 194#
187# Board Setup 195# Clock/PLL Setup
188# 196#
189CONFIG_CLKIN_HZ=27000000 197CONFIG_CLKIN_HZ=27000000
190CONFIG_MEM_SIZE=32 198# CONFIG_BFIN_KERNEL_CLOCK is not set
191CONFIG_MEM_ADD_WIDTH=9 199CONFIG_MAX_VCO_HZ=750000000
192CONFIG_BOOT_LOAD=0x1000 200CONFIG_MIN_VCO_HZ=50000000
193 201CONFIG_MAX_SCLK_HZ=133000000
194# 202CONFIG_MIN_SCLK_HZ=27000000
195# Blackfin Kernel Optimizations
196#
197 203
198# 204#
199# Timer Tick 205# Kernel Timer/Scheduler
200# 206#
201# CONFIG_HZ_100 is not set 207# CONFIG_HZ_100 is not set
202CONFIG_HZ_250=y 208CONFIG_HZ_250=y
@@ -205,6 +211,20 @@ CONFIG_HZ_250=y
205CONFIG_HZ=250 211CONFIG_HZ=250
206 212
207# 213#
214# Memory Setup
215#
216CONFIG_MEM_SIZE=32
217CONFIG_MEM_ADD_WIDTH=9
218CONFIG_BOOT_LOAD=0x1000
219CONFIG_BFIN_SCRATCH_REG_RETN=y
220# CONFIG_BFIN_SCRATCH_REG_RETE is not set
221# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
222
223#
224# Blackfin Kernel Optimizations
225#
226
227#
208# Memory Optimizations 228# Memory Optimizations
209# 229#
210CONFIG_I_ENTRY_L1=y 230CONFIG_I_ENTRY_L1=y
@@ -243,20 +263,15 @@ CONFIG_DMA_UNCACHED_1M=y
243# 263#
244# Cache Support 264# Cache Support
245# 265#
246CONFIG_BLKFIN_CACHE=y 266CONFIG_BFIN_ICACHE=y
247CONFIG_BLKFIN_DCACHE=y 267CONFIG_BFIN_DCACHE=y
248# CONFIG_BLKFIN_DCACHE_BANKA is not set 268# CONFIG_BFIN_DCACHE_BANKA is not set
249# CONFIG_BLKFIN_CACHE_LOCK is not set 269# CONFIG_BFIN_ICACHE_LOCK is not set
250# CONFIG_BLKFIN_WB is not set 270# CONFIG_BFIN_WB is not set
251CONFIG_BLKFIN_WT=y 271CONFIG_BFIN_WT=y
252CONFIG_L1_MAX_PIECE=16 272CONFIG_L1_MAX_PIECE=16
253 273
254# 274#
255# Clock Settings
256#
257# CONFIG_BFIN_KERNEL_CLOCK is not set
258
259#
260# Asynchonous Memory Configuration 275# Asynchonous Memory Configuration
261# 276#
262 277
@@ -277,12 +292,13 @@ CONFIG_C_AMBEN_ALL=y
277CONFIG_BANK_0=0x7BB0 292CONFIG_BANK_0=0x7BB0
278CONFIG_BANK_1=0x7BB0 293CONFIG_BANK_1=0x7BB0
279CONFIG_BANK_2=0x7BB0 294CONFIG_BANK_2=0x7BB0
280CONFIG_BANK_3=0x99B3 295CONFIG_BANK_3=0xAAC3
281 296
282# 297#
283# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 298# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
284# 299#
285# CONFIG_PCI is not set 300# CONFIG_PCI is not set
301# CONFIG_ARCH_SUPPORTS_MSI is not set
286 302
287# 303#
288# PCCARD (PCMCIA/CardBus) support 304# PCCARD (PCMCIA/CardBus) support
@@ -290,10 +306,6 @@ CONFIG_BANK_3=0x99B3
290# CONFIG_PCCARD is not set 306# CONFIG_PCCARD is not set
291 307
292# 308#
293# PCI Hotplug Support
294#
295
296#
297# Executable file formats 309# Executable file formats
298# 310#
299CONFIG_BINFMT_ELF_FDPIC=y 311CONFIG_BINFMT_ELF_FDPIC=y
@@ -327,7 +339,6 @@ CONFIG_NET=y
327# 339#
328# Networking options 340# Networking options
329# 341#
330# CONFIG_NETDEBUG is not set
331CONFIG_PACKET=y 342CONFIG_PACKET=y
332# CONFIG_PACKET_MMAP is not set 343# CONFIG_PACKET_MMAP is not set
333CONFIG_UNIX=y 344CONFIG_UNIX=y
@@ -368,20 +379,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
368# CONFIG_NETLABEL is not set 379# CONFIG_NETLABEL is not set
369# CONFIG_NETWORK_SECMARK is not set 380# CONFIG_NETWORK_SECMARK is not set
370# CONFIG_NETFILTER is not set 381# CONFIG_NETFILTER is not set
371
372#
373# DCCP Configuration (EXPERIMENTAL)
374#
375# CONFIG_IP_DCCP is not set 382# CONFIG_IP_DCCP is not set
376
377#
378# SCTP Configuration (EXPERIMENTAL)
379#
380# CONFIG_IP_SCTP is not set 383# CONFIG_IP_SCTP is not set
381
382#
383# TIPC Configuration (EXPERIMENTAL)
384#
385# CONFIG_TIPC is not set 384# CONFIG_TIPC is not set
386# CONFIG_ATM is not set 385# CONFIG_ATM is not set
387# CONFIG_BRIDGE is not set 386# CONFIG_BRIDGE is not set
@@ -448,7 +447,16 @@ CONFIG_IRTTY_SIR=m
448# FIR device drivers 447# FIR device drivers
449# 448#
450# CONFIG_BT is not set 449# CONFIG_BT is not set
450# CONFIG_AF_RXRPC is not set
451
452#
453# Wireless
454#
455# CONFIG_CFG80211 is not set
456# CONFIG_WIRELESS_EXT is not set
457# CONFIG_MAC80211 is not set
451# CONFIG_IEEE80211 is not set 458# CONFIG_IEEE80211 is not set
459# CONFIG_RFKILL is not set
452 460
453# 461#
454# Device Drivers 462# Device Drivers
@@ -466,10 +474,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
466# Connector - unified userspace <-> kernelspace linker 474# Connector - unified userspace <-> kernelspace linker
467# 475#
468# CONFIG_CONNECTOR is not set 476# CONFIG_CONNECTOR is not set
469
470#
471# Memory Technology Devices (MTD)
472#
473CONFIG_MTD=y 477CONFIG_MTD=y
474# CONFIG_MTD_DEBUG is not set 478# CONFIG_MTD_DEBUG is not set
475# CONFIG_MTD_CONCAT is not set 479# CONFIG_MTD_CONCAT is not set
@@ -513,7 +517,6 @@ CONFIG_MTD_MW320D=m
513CONFIG_MTD_RAM=y 517CONFIG_MTD_RAM=y
514CONFIG_MTD_ROM=m 518CONFIG_MTD_ROM=m
515# CONFIG_MTD_ABSENT is not set 519# CONFIG_MTD_ABSENT is not set
516# CONFIG_MTD_OBSOLETE_CHIPS is not set
517 520
518# 521#
519# Mapping drivers for chip access 522# Mapping drivers for chip access
@@ -550,16 +553,13 @@ CONFIG_BFIN_FLASH_BANK_3=0x7BB0
550# CONFIG_MTD_DOC2000 is not set 553# CONFIG_MTD_DOC2000 is not set
551# CONFIG_MTD_DOC2001 is not set 554# CONFIG_MTD_DOC2001 is not set
552# CONFIG_MTD_DOC2001PLUS is not set 555# CONFIG_MTD_DOC2001PLUS is not set
553
554#
555# NAND Flash Device Drivers
556#
557# CONFIG_MTD_NAND is not set 556# CONFIG_MTD_NAND is not set
557# CONFIG_MTD_ONENAND is not set
558 558
559# 559#
560# OneNAND Flash Device Drivers 560# UBI - Unsorted block images
561# 561#
562# CONFIG_MTD_ONENAND is not set 562# CONFIG_MTD_UBI is not set
563 563
564# 564#
565# Parallel port support 565# Parallel port support
@@ -587,10 +587,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
587# 587#
588# Misc devices 588# Misc devices
589# 589#
590
591#
592# ATA/ATAPI/MFM/RLL support
593#
594# CONFIG_IDE is not set 590# CONFIG_IDE is not set
595 591
596# 592#
@@ -599,10 +595,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
599# CONFIG_RAID_ATTRS is not set 595# CONFIG_RAID_ATTRS is not set
600# CONFIG_SCSI is not set 596# CONFIG_SCSI is not set
601# CONFIG_SCSI_NETLINK is not set 597# CONFIG_SCSI_NETLINK is not set
602
603#
604# Serial ATA (prod) and Parallel ATA (experimental) drivers
605#
606# CONFIG_ATA is not set 598# CONFIG_ATA is not set
607 599
608# 600#
@@ -611,19 +603,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
611# CONFIG_MD is not set 603# CONFIG_MD is not set
612 604
613# 605#
614# Fusion MPT device support
615#
616# CONFIG_FUSION is not set
617
618#
619# IEEE 1394 (FireWire) support
620#
621
622#
623# I2O device support
624#
625
626#
627# Network device support 606# Network device support
628# 607#
629CONFIG_NETDEVICES=y 608CONFIG_NETDEVICES=y
@@ -631,10 +610,6 @@ CONFIG_NETDEVICES=y
631# CONFIG_BONDING is not set 610# CONFIG_BONDING is not set
632# CONFIG_EQUALIZER is not set 611# CONFIG_EQUALIZER is not set
633# CONFIG_TUN is not set 612# CONFIG_TUN is not set
634
635#
636# PHY device support
637#
638# CONFIG_PHYLIB is not set 613# CONFIG_PHYLIB is not set
639 614
640# 615#
@@ -644,27 +619,15 @@ CONFIG_NET_ETHERNET=y
644CONFIG_MII=y 619CONFIG_MII=y
645CONFIG_SMC91X=y 620CONFIG_SMC91X=y
646# CONFIG_SMSC911X is not set 621# CONFIG_SMSC911X is not set
622# CONFIG_DM9000 is not set
623CONFIG_NETDEV_1000=y
624CONFIG_NETDEV_10000=y
647 625
648# 626#
649# Ethernet (1000 Mbit) 627# Wireless LAN
650#
651
652#
653# Ethernet (10000 Mbit)
654#
655
656#
657# Token Ring devices
658#
659
660#
661# Wireless LAN (non-hamradio)
662#
663# CONFIG_NET_RADIO is not set
664
665#
666# Wan interfaces
667# 628#
629# CONFIG_WLAN_PRE80211 is not set
630# CONFIG_WLAN_80211 is not set
668# CONFIG_WAN is not set 631# CONFIG_WAN is not set
669# CONFIG_PPP is not set 632# CONFIG_PPP is not set
670# CONFIG_SLIP is not set 633# CONFIG_SLIP is not set
@@ -688,6 +651,7 @@ CONFIG_SMC91X=y
688# 651#
689CONFIG_INPUT=m 652CONFIG_INPUT=m
690# CONFIG_INPUT_FF_MEMLESS is not set 653# CONFIG_INPUT_FF_MEMLESS is not set
654# CONFIG_INPUT_POLLDEV is not set
691 655
692# 656#
693# Userland interfaces 657# Userland interfaces
@@ -704,6 +668,7 @@ CONFIG_INPUT_EVDEV=m
704# CONFIG_INPUT_KEYBOARD is not set 668# CONFIG_INPUT_KEYBOARD is not set
705# CONFIG_INPUT_MOUSE is not set 669# CONFIG_INPUT_MOUSE is not set
706# CONFIG_INPUT_JOYSTICK is not set 670# CONFIG_INPUT_JOYSTICK is not set
671# CONFIG_INPUT_TABLET is not set
707# CONFIG_INPUT_TOUCHSCREEN is not set 672# CONFIG_INPUT_TOUCHSCREEN is not set
708# CONFIG_INPUT_MISC is not set 673# CONFIG_INPUT_MISC is not set
709 674
@@ -718,7 +683,7 @@ CONFIG_INPUT_EVDEV=m
718# 683#
719# CONFIG_AD9960 is not set 684# CONFIG_AD9960 is not set
720# CONFIG_SPI_ADC_BF533 is not set 685# CONFIG_SPI_ADC_BF533 is not set
721# CONFIG_BF5xx_PFLAGS is not set 686# CONFIG_BFIN_PFLAGS is not set
722# CONFIG_BF5xx_PPIFCD is not set 687# CONFIG_BF5xx_PPIFCD is not set
723# CONFIG_BF5xx_TIMERS is not set 688# CONFIG_BF5xx_TIMERS is not set
724# CONFIG_BF5xx_PPI is not set 689# CONFIG_BF5xx_PPI is not set
@@ -758,10 +723,6 @@ CONFIG_UNIX98_PTYS=y
758# IPMI 723# IPMI
759# 724#
760# CONFIG_IPMI_HANDLER is not set 725# CONFIG_IPMI_HANDLER is not set
761
762#
763# Watchdog Cards
764#
765CONFIG_WATCHDOG=y 726CONFIG_WATCHDOG=y
766# CONFIG_WATCHDOG_NOWAYOUT is not set 727# CONFIG_WATCHDOG_NOWAYOUT is not set
767 728
@@ -773,7 +734,6 @@ CONFIG_BFIN_WDT=y
773CONFIG_HW_RANDOM=y 734CONFIG_HW_RANDOM=y
774# CONFIG_GEN_RTC is not set 735# CONFIG_GEN_RTC is not set
775CONFIG_BLACKFIN_DPMC=y 736CONFIG_BLACKFIN_DPMC=y
776# CONFIG_DTLK is not set
777# CONFIG_R3964 is not set 737# CONFIG_R3964 is not set
778# CONFIG_RAW_DRIVER is not set 738# CONFIG_RAW_DRIVER is not set
779 739
@@ -781,10 +741,6 @@ CONFIG_BLACKFIN_DPMC=y
781# TPM devices 741# TPM devices
782# 742#
783# CONFIG_TCG_TPM is not set 743# CONFIG_TCG_TPM is not set
784
785#
786# I2C support
787#
788# CONFIG_I2C is not set 744# CONFIG_I2C is not set
789 745
790# 746#
@@ -803,22 +759,22 @@ CONFIG_SPI_BFIN=y
803# SPI Protocol Masters 759# SPI Protocol Masters
804# 760#
805# CONFIG_SPI_AT25 is not set 761# CONFIG_SPI_AT25 is not set
762# CONFIG_SPI_SPIDEV is not set
806 763
807# 764#
808# Dallas's 1-wire bus 765# Dallas's 1-wire bus
809# 766#
810# CONFIG_W1 is not set 767# CONFIG_W1 is not set
811
812#
813# Hardware Monitoring support
814#
815CONFIG_HWMON=y 768CONFIG_HWMON=y
816# CONFIG_HWMON_VID is not set 769# CONFIG_HWMON_VID is not set
817# CONFIG_SENSORS_ABITUGURU is not set 770# CONFIG_SENSORS_ABITUGURU is not set
818# CONFIG_SENSORS_F71805F is not set 771# CONFIG_SENSORS_F71805F is not set
819# CONFIG_SENSORS_LM70 is not set 772# CONFIG_SENSORS_LM70 is not set
820# CONFIG_SENSORS_PC87427 is not set 773# CONFIG_SENSORS_PC87427 is not set
774# CONFIG_SENSORS_SMSC47M1 is not set
775# CONFIG_SENSORS_SMSC47B397 is not set
821# CONFIG_SENSORS_VT1211 is not set 776# CONFIG_SENSORS_VT1211 is not set
777# CONFIG_SENSORS_W83627HF is not set
822# CONFIG_HWMON_DEBUG_CHIP is not set 778# CONFIG_HWMON_DEBUG_CHIP is not set
823 779
824# 780#
@@ -830,16 +786,19 @@ CONFIG_HWMON=y
830# Multimedia devices 786# Multimedia devices
831# 787#
832# CONFIG_VIDEO_DEV is not set 788# CONFIG_VIDEO_DEV is not set
789# CONFIG_DVB_CORE is not set
790CONFIG_DAB=y
833 791
834# 792#
835# Digital Video Broadcasting Devices 793# Graphics support
836# 794#
837# CONFIG_DVB is not set 795# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
838 796
839# 797#
840# Graphics support 798# Display device support
841# 799#
842# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 800# CONFIG_DISPLAY_SUPPORT is not set
801# CONFIG_VGASTATE is not set
843# CONFIG_FB is not set 802# CONFIG_FB is not set
844 803
845# 804#
@@ -862,18 +821,17 @@ CONFIG_USB_ARCH_HAS_HCD=y
862# CONFIG_USB is not set 821# CONFIG_USB is not set
863 822
864# 823#
865# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 824# Enable Host or Gadget support to see Inventra options
866# 825#
867 826
868# 827#
869# USB Gadget Support 828# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
870# 829#
871# CONFIG_USB_GADGET is not set
872 830
873# 831#
874# MMC/SD Card support 832# USB Gadget Support
875# 833#
876# CONFIG_SPI_MMC is not set 834# CONFIG_USB_GADGET is not set
877# CONFIG_MMC is not set 835# CONFIG_MMC is not set
878 836
879# 837#
@@ -913,17 +871,29 @@ CONFIG_RTC_INTF_SYSFS=y
913CONFIG_RTC_INTF_PROC=y 871CONFIG_RTC_INTF_PROC=y
914CONFIG_RTC_INTF_DEV=y 872CONFIG_RTC_INTF_DEV=y
915# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set 873# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
874# CONFIG_RTC_DRV_TEST is not set
875
876#
877# I2C RTC drivers
878#
879
880#
881# SPI RTC drivers
882#
883# CONFIG_RTC_DRV_RS5C348 is not set
884# CONFIG_RTC_DRV_MAX6902 is not set
916 885
917# 886#
918# RTC drivers 887# Platform RTC drivers
919# 888#
920# CONFIG_RTC_DRV_DS1553 is not set 889# CONFIG_RTC_DRV_DS1553 is not set
921# CONFIG_RTC_DRV_DS1742 is not set 890# CONFIG_RTC_DRV_DS1742 is not set
922# CONFIG_RTC_DRV_RS5C348 is not set
923# CONFIG_RTC_DRV_M48T86 is not set 891# CONFIG_RTC_DRV_M48T86 is not set
924# CONFIG_RTC_DRV_TEST is not set
925# CONFIG_RTC_DRV_MAX6902 is not set
926# CONFIG_RTC_DRV_V3020 is not set 892# CONFIG_RTC_DRV_V3020 is not set
893
894#
895# on-CPU RTC drivers
896#
927CONFIG_RTC_DRV_BFIN=y 897CONFIG_RTC_DRV_BFIN=y
928 898
929# 899#
@@ -940,14 +910,6 @@ CONFIG_RTC_DRV_BFIN=y
940# 910#
941 911
942# 912#
943# Auxiliary Display support
944#
945
946#
947# Virtualization
948#
949
950#
951# PBX support 913# PBX support
952# 914#
953# CONFIG_PBX is not set 915# CONFIG_PBX is not set
@@ -1047,6 +1009,7 @@ CONFIG_LOCKD=m
1047CONFIG_LOCKD_V4=y 1009CONFIG_LOCKD_V4=y
1048CONFIG_NFS_COMMON=y 1010CONFIG_NFS_COMMON=y
1049CONFIG_SUNRPC=m 1011CONFIG_SUNRPC=m
1012# CONFIG_SUNRPC_BIND34 is not set
1050# CONFIG_RPCSEC_GSS_KRB5 is not set 1013# CONFIG_RPCSEC_GSS_KRB5 is not set
1051# CONFIG_RPCSEC_GSS_SPKM3 is not set 1014# CONFIG_RPCSEC_GSS_SPKM3 is not set
1052CONFIG_SMB_FS=m 1015CONFIG_SMB_FS=m
@@ -1124,14 +1087,20 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1124CONFIG_ENABLE_MUST_CHECK=y 1087CONFIG_ENABLE_MUST_CHECK=y
1125# CONFIG_MAGIC_SYSRQ is not set 1088# CONFIG_MAGIC_SYSRQ is not set
1126# CONFIG_UNUSED_SYMBOLS is not set 1089# CONFIG_UNUSED_SYMBOLS is not set
1127# CONFIG_DEBUG_FS is not set 1090CONFIG_DEBUG_FS=y
1128# CONFIG_HEADERS_CHECK is not set 1091# CONFIG_HEADERS_CHECK is not set
1129# CONFIG_DEBUG_KERNEL is not set 1092# CONFIG_DEBUG_KERNEL is not set
1130CONFIG_LOG_BUF_SHIFT=14
1131# CONFIG_DEBUG_BUGVERBOSE is not set 1093# CONFIG_DEBUG_BUGVERBOSE is not set
1132# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set 1094CONFIG_DEBUG_MMRS=y
1133CONFIG_DEBUG_HUNT_FOR_ZERO=y 1095CONFIG_DEBUG_HUNT_FOR_ZERO=y
1096CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1097CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
1098# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
1099# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1100CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
1101# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1134# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1102# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1103CONFIG_EARLY_PRINTK=y
1135CONFIG_CPLB_INFO=y 1104CONFIG_CPLB_INFO=y
1136CONFIG_ACCESS_CHECK=y 1105CONFIG_ACCESS_CHECK=y
1137 1106
@@ -1154,6 +1123,7 @@ CONFIG_SECURITY_CAPABILITIES=m
1154CONFIG_BITREVERSE=y 1123CONFIG_BITREVERSE=y
1155CONFIG_CRC_CCITT=m 1124CONFIG_CRC_CCITT=m
1156# CONFIG_CRC16 is not set 1125# CONFIG_CRC16 is not set
1126# CONFIG_CRC_ITU_T is not set
1157CONFIG_CRC32=y 1127CONFIG_CRC32=y
1158# CONFIG_LIBCRC32C is not set 1128# CONFIG_LIBCRC32C is not set
1159CONFIG_ZLIB_INFLATE=y 1129CONFIG_ZLIB_INFLATE=y
@@ -1161,3 +1131,4 @@ CONFIG_ZLIB_DEFLATE=m
1161CONFIG_PLIST=y 1131CONFIG_PLIST=y
1162CONFIG_HAS_IOMEM=y 1132CONFIG_HAS_IOMEM=y
1163CONFIG_HAS_IOPORT=y 1133CONFIG_HAS_IOPORT=y
1134CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF533-STAMP_defconfig b/arch/blackfin/configs/BF533-STAMP_defconfig
index 64b7f1b3b2af..306302baff06 100644
--- a/arch/blackfin/configs/BF533-STAMP_defconfig
+++ b/arch/blackfin/configs/BF533-STAMP_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21.5 3# Linux kernel version: 2.6.22.6
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -15,8 +15,9 @@ CONFIG_GENERIC_HWEIGHT=y
15CONFIG_GENERIC_HARDIRQS=y 15CONFIG_GENERIC_HARDIRQS=y
16CONFIG_GENERIC_IRQ_PROBE=y 16CONFIG_GENERIC_IRQ_PROBE=y
17# CONFIG_GENERIC_TIME is not set 17# CONFIG_GENERIC_TIME is not set
18CONFIG_GENERIC_CALIBRATE_DELAY=y 18CONFIG_GENERIC_GPIO=y
19CONFIG_FORCE_MAX_ZONEORDER=14 19CONFIG_FORCE_MAX_ZONEORDER=14
20CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_IRQCHIP_DEMUX_GPIO=y 21CONFIG_IRQCHIP_DEMUX_GPIO=y
21CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
22 23
@@ -40,7 +41,9 @@ CONFIG_SYSVIPC_SYSCTL=y
40# CONFIG_TASKSTATS is not set 41# CONFIG_TASKSTATS is not set
41# CONFIG_UTS_NS is not set 42# CONFIG_UTS_NS is not set
42# CONFIG_AUDIT is not set 43# CONFIG_AUDIT is not set
43# CONFIG_IKCONFIG is not set 44CONFIG_IKCONFIG=y
45CONFIG_IKCONFIG_PROC=y
46CONFIG_LOG_BUF_SHIFT=14
44CONFIG_SYSFS_DEPRECATED=y 47CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 48# CONFIG_RELAY is not set
46CONFIG_BLK_DEV_INITRD=y 49CONFIG_BLK_DEV_INITRD=y
@@ -58,15 +61,20 @@ CONFIG_BUG=y
58CONFIG_ELF_CORE=y 61CONFIG_ELF_CORE=y
59CONFIG_BASE_FULL=y 62CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 63CONFIG_FUTEX=y
64CONFIG_ANON_INODES=y
65CONFIG_EPOLL=y
66CONFIG_SIGNALFD=y
67CONFIG_TIMERFD=y
68CONFIG_EVENTFD=y
69CONFIG_VM_EVENT_COUNTERS=y
61CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 70CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
62CONFIG_BUDDY=y
63# CONFIG_NP2 is not set 71# CONFIG_NP2 is not set
64CONFIG_SLAB=y 72CONFIG_SLAB=y
65CONFIG_VM_EVENT_COUNTERS=y 73# CONFIG_SLUB is not set
74# CONFIG_SLOB is not set
66CONFIG_RT_MUTEXES=y 75CONFIG_RT_MUTEXES=y
67CONFIG_TINY_SHMEM=y 76CONFIG_TINY_SHMEM=y
68CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
69# CONFIG_SLOB is not set
70 78
71# 79#
72# Loadable module support 80# Loadable module support
@@ -185,9 +193,27 @@ CONFIG_WDTIMER=13
185# CONFIG_CMDLINE_BOOL is not set 193# CONFIG_CMDLINE_BOOL is not set
186 194
187# 195#
188# Board Setup 196# Clock/PLL Setup
189# 197#
190CONFIG_CLKIN_HZ=11059200 198CONFIG_CLKIN_HZ=11059200
199# CONFIG_BFIN_KERNEL_CLOCK is not set
200CONFIG_MAX_VCO_HZ=750000000
201CONFIG_MIN_VCO_HZ=50000000
202CONFIG_MAX_SCLK_HZ=133000000
203CONFIG_MIN_SCLK_HZ=27000000
204
205#
206# Kernel Timer/Scheduler
207#
208# CONFIG_HZ_100 is not set
209CONFIG_HZ_250=y
210# CONFIG_HZ_300 is not set
211# CONFIG_HZ_1000 is not set
212CONFIG_HZ=250
213
214#
215# Memory Setup
216#
191CONFIG_MEM_SIZE=128 217CONFIG_MEM_SIZE=128
192CONFIG_MEM_ADD_WIDTH=11 218CONFIG_MEM_ADD_WIDTH=11
193CONFIG_ENET_FLASH_PIN=0 219CONFIG_ENET_FLASH_PIN=0
@@ -198,6 +224,9 @@ CONFIG_BOOT_LOAD=0x1000
198# 224#
199# CONFIG_BFIN_ALIVE_LED is not set 225# CONFIG_BFIN_ALIVE_LED is not set
200# CONFIG_BFIN_IDLE_LED is not set 226# CONFIG_BFIN_IDLE_LED is not set
227CONFIG_BFIN_SCRATCH_REG_RETN=y
228# CONFIG_BFIN_SCRATCH_REG_RETE is not set
229# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
201CONFIG_BFIN_ALIVE_LED_PORT=0xFFC00700 230CONFIG_BFIN_ALIVE_LED_PORT=0xFFC00700
202CONFIG_BFIN_ALIVE_LED_DPORT=0xFFC00730 231CONFIG_BFIN_ALIVE_LED_DPORT=0xFFC00730
203CONFIG_BFIN_IDLE_LED_PORT=0xFFC00700 232CONFIG_BFIN_IDLE_LED_PORT=0xFFC00700
@@ -208,15 +237,6 @@ CONFIG_BFIN_IDLE_LED_DPORT=0xFFC00730
208# 237#
209 238
210# 239#
211# Timer Tick
212#
213# CONFIG_HZ_100 is not set
214CONFIG_HZ_250=y
215# CONFIG_HZ_300 is not set
216# CONFIG_HZ_1000 is not set
217CONFIG_HZ=250
218
219#
220# Memory Optimizations 240# Memory Optimizations
221# 241#
222CONFIG_I_ENTRY_L1=y 242CONFIG_I_ENTRY_L1=y
@@ -255,20 +275,15 @@ CONFIG_DMA_UNCACHED_1M=y
255# 275#
256# Cache Support 276# Cache Support
257# 277#
258CONFIG_BLKFIN_CACHE=y 278CONFIG_BFIN_ICACHE=y
259CONFIG_BLKFIN_DCACHE=y 279CONFIG_BFIN_DCACHE=y
260# CONFIG_BLKFIN_DCACHE_BANKA is not set 280# CONFIG_BFIN_DCACHE_BANKA is not set
261# CONFIG_BLKFIN_CACHE_LOCK is not set 281# CONFIG_BFIN_ICACHE_LOCK is not set
262# CONFIG_BLKFIN_WB is not set 282# CONFIG_BFIN_WB is not set
263CONFIG_BLKFIN_WT=y 283CONFIG_BFIN_WT=y
264CONFIG_L1_MAX_PIECE=16 284CONFIG_L1_MAX_PIECE=16
265 285
266# 286#
267# Clock Settings
268#
269# CONFIG_BFIN_KERNEL_CLOCK is not set
270
271#
272# Asynchonous Memory Configuration 287# Asynchonous Memory Configuration
273# 288#
274 289
@@ -289,12 +304,13 @@ CONFIG_C_AMBEN_ALL=y
289CONFIG_BANK_0=0x7BB0 304CONFIG_BANK_0=0x7BB0
290CONFIG_BANK_1=0x7BB0 305CONFIG_BANK_1=0x7BB0
291CONFIG_BANK_2=0x7BB0 306CONFIG_BANK_2=0x7BB0
292CONFIG_BANK_3=0x99B3 307CONFIG_BANK_3=0xAAC3
293 308
294# 309#
295# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 310# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
296# 311#
297# CONFIG_PCI is not set 312# CONFIG_PCI is not set
313# CONFIG_ARCH_SUPPORTS_MSI is not set
298 314
299# 315#
300# PCCARD (PCMCIA/CardBus) support 316# PCCARD (PCMCIA/CardBus) support
@@ -302,10 +318,6 @@ CONFIG_BANK_3=0x99B3
302# CONFIG_PCCARD is not set 318# CONFIG_PCCARD is not set
303 319
304# 320#
305# PCI Hotplug Support
306#
307
308#
309# Executable file formats 321# Executable file formats
310# 322#
311CONFIG_BINFMT_ELF_FDPIC=y 323CONFIG_BINFMT_ELF_FDPIC=y
@@ -339,7 +351,6 @@ CONFIG_NET=y
339# 351#
340# Networking options 352# Networking options
341# 353#
342# CONFIG_NETDEBUG is not set
343CONFIG_PACKET=y 354CONFIG_PACKET=y
344# CONFIG_PACKET_MMAP is not set 355# CONFIG_PACKET_MMAP is not set
345CONFIG_UNIX=y 356CONFIG_UNIX=y
@@ -380,20 +391,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
380# CONFIG_NETLABEL is not set 391# CONFIG_NETLABEL is not set
381# CONFIG_NETWORK_SECMARK is not set 392# CONFIG_NETWORK_SECMARK is not set
382# CONFIG_NETFILTER is not set 393# CONFIG_NETFILTER is not set
383
384#
385# DCCP Configuration (EXPERIMENTAL)
386#
387# CONFIG_IP_DCCP is not set 394# CONFIG_IP_DCCP is not set
388
389#
390# SCTP Configuration (EXPERIMENTAL)
391#
392# CONFIG_IP_SCTP is not set 395# CONFIG_IP_SCTP is not set
393
394#
395# TIPC Configuration (EXPERIMENTAL)
396#
397# CONFIG_TIPC is not set 396# CONFIG_TIPC is not set
398# CONFIG_ATM is not set 397# CONFIG_ATM is not set
399# CONFIG_BRIDGE is not set 398# CONFIG_BRIDGE is not set
@@ -460,7 +459,16 @@ CONFIG_IRTTY_SIR=m
460# FIR device drivers 459# FIR device drivers
461# 460#
462# CONFIG_BT is not set 461# CONFIG_BT is not set
462# CONFIG_AF_RXRPC is not set
463
464#
465# Wireless
466#
467# CONFIG_CFG80211 is not set
468# CONFIG_WIRELESS_EXT is not set
469# CONFIG_MAC80211 is not set
463# CONFIG_IEEE80211 is not set 470# CONFIG_IEEE80211 is not set
471# CONFIG_RFKILL is not set
464 472
465# 473#
466# Device Drivers 474# Device Drivers
@@ -478,10 +486,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
478# Connector - unified userspace <-> kernelspace linker 486# Connector - unified userspace <-> kernelspace linker
479# 487#
480# CONFIG_CONNECTOR is not set 488# CONFIG_CONNECTOR is not set
481
482#
483# Memory Technology Devices (MTD)
484#
485CONFIG_MTD=y 489CONFIG_MTD=y
486# CONFIG_MTD_DEBUG is not set 490# CONFIG_MTD_DEBUG is not set
487# CONFIG_MTD_CONCAT is not set 491# CONFIG_MTD_CONCAT is not set
@@ -525,7 +529,6 @@ CONFIG_MTD_MW320D=m
525CONFIG_MTD_RAM=y 529CONFIG_MTD_RAM=y
526CONFIG_MTD_ROM=m 530CONFIG_MTD_ROM=m
527# CONFIG_MTD_ABSENT is not set 531# CONFIG_MTD_ABSENT is not set
528# CONFIG_MTD_OBSOLETE_CHIPS is not set
529 532
530# 533#
531# Mapping drivers for chip access 534# Mapping drivers for chip access
@@ -562,16 +565,13 @@ CONFIG_BFIN_FLASH_BANK_3=0x7BB0
562# CONFIG_MTD_DOC2000 is not set 565# CONFIG_MTD_DOC2000 is not set
563# CONFIG_MTD_DOC2001 is not set 566# CONFIG_MTD_DOC2001 is not set
564# CONFIG_MTD_DOC2001PLUS is not set 567# CONFIG_MTD_DOC2001PLUS is not set
565
566#
567# NAND Flash Device Drivers
568#
569# CONFIG_MTD_NAND is not set 568# CONFIG_MTD_NAND is not set
569# CONFIG_MTD_ONENAND is not set
570 570
571# 571#
572# OneNAND Flash Device Drivers 572# UBI - Unsorted block images
573# 573#
574# CONFIG_MTD_ONENAND is not set 574# CONFIG_MTD_UBI is not set
575 575
576# 576#
577# Parallel port support 577# Parallel port support
@@ -599,10 +599,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
599# 599#
600# Misc devices 600# Misc devices
601# 601#
602
603#
604# ATA/ATAPI/MFM/RLL support
605#
606# CONFIG_IDE is not set 602# CONFIG_IDE is not set
607 603
608# 604#
@@ -611,10 +607,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
611# CONFIG_RAID_ATTRS is not set 607# CONFIG_RAID_ATTRS is not set
612# CONFIG_SCSI is not set 608# CONFIG_SCSI is not set
613# CONFIG_SCSI_NETLINK is not set 609# CONFIG_SCSI_NETLINK is not set
614
615#
616# Serial ATA (prod) and Parallel ATA (experimental) drivers
617#
618# CONFIG_ATA is not set 610# CONFIG_ATA is not set
619 611
620# 612#
@@ -623,19 +615,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
623# CONFIG_MD is not set 615# CONFIG_MD is not set
624 616
625# 617#
626# Fusion MPT device support
627#
628# CONFIG_FUSION is not set
629
630#
631# IEEE 1394 (FireWire) support
632#
633
634#
635# I2O device support
636#
637
638#
639# Network device support 618# Network device support
640# 619#
641CONFIG_NETDEVICES=y 620CONFIG_NETDEVICES=y
@@ -643,10 +622,6 @@ CONFIG_NETDEVICES=y
643# CONFIG_BONDING is not set 622# CONFIG_BONDING is not set
644# CONFIG_EQUALIZER is not set 623# CONFIG_EQUALIZER is not set
645# CONFIG_TUN is not set 624# CONFIG_TUN is not set
646
647#
648# PHY device support
649#
650# CONFIG_PHYLIB is not set 625# CONFIG_PHYLIB is not set
651 626
652# 627#
@@ -656,27 +631,15 @@ CONFIG_NET_ETHERNET=y
656CONFIG_MII=y 631CONFIG_MII=y
657CONFIG_SMC91X=y 632CONFIG_SMC91X=y
658# CONFIG_SMSC911X is not set 633# CONFIG_SMSC911X is not set
634# CONFIG_DM9000 is not set
635CONFIG_NETDEV_1000=y
636CONFIG_NETDEV_10000=y
659 637
660# 638#
661# Ethernet (1000 Mbit) 639# Wireless LAN
662#
663
664#
665# Ethernet (10000 Mbit)
666#
667
668#
669# Token Ring devices
670#
671
672#
673# Wireless LAN (non-hamradio)
674#
675# CONFIG_NET_RADIO is not set
676
677#
678# Wan interfaces
679# 640#
641# CONFIG_WLAN_PRE80211 is not set
642# CONFIG_WLAN_80211 is not set
680# CONFIG_WAN is not set 643# CONFIG_WAN is not set
681# CONFIG_PPP is not set 644# CONFIG_PPP is not set
682# CONFIG_SLIP is not set 645# CONFIG_SLIP is not set
@@ -700,6 +663,7 @@ CONFIG_SMC91X=y
700# 663#
701CONFIG_INPUT=y 664CONFIG_INPUT=y
702# CONFIG_INPUT_FF_MEMLESS is not set 665# CONFIG_INPUT_FF_MEMLESS is not set
666# CONFIG_INPUT_POLLDEV is not set
703 667
704# 668#
705# Userland interfaces 669# Userland interfaces
@@ -716,8 +680,14 @@ CONFIG_INPUT_EVDEV=m
716# CONFIG_INPUT_KEYBOARD is not set 680# CONFIG_INPUT_KEYBOARD is not set
717# CONFIG_INPUT_MOUSE is not set 681# CONFIG_INPUT_MOUSE is not set
718# CONFIG_INPUT_JOYSTICK is not set 682# CONFIG_INPUT_JOYSTICK is not set
683# CONFIG_INPUT_TABLET is not set
719# CONFIG_INPUT_TOUCHSCREEN is not set 684# CONFIG_INPUT_TOUCHSCREEN is not set
720CONFIG_INPUT_MISC=y 685CONFIG_INPUT_MISC=y
686# CONFIG_INPUT_ATI_REMOTE is not set
687# CONFIG_INPUT_ATI_REMOTE2 is not set
688# CONFIG_INPUT_KEYSPAN_REMOTE is not set
689# CONFIG_INPUT_POWERMATE is not set
690# CONFIG_INPUT_YEALINK is not set
721# CONFIG_INPUT_UINPUT is not set 691# CONFIG_INPUT_UINPUT is not set
722# CONFIG_BF53X_PFBUTTONS is not set 692# CONFIG_BF53X_PFBUTTONS is not set
723CONFIG_TWI_KEYPAD=m 693CONFIG_TWI_KEYPAD=m
@@ -734,7 +704,7 @@ CONFIG_BFIN_TWIKEYPAD_IRQ_PFX=39
734# 704#
735# CONFIG_AD9960 is not set 705# CONFIG_AD9960 is not set
736# CONFIG_SPI_ADC_BF533 is not set 706# CONFIG_SPI_ADC_BF533 is not set
737# CONFIG_BF5xx_PFLAGS is not set 707# CONFIG_BFIN_PFLAGS is not set
738# CONFIG_BF5xx_PPIFCD is not set 708# CONFIG_BF5xx_PPIFCD is not set
739# CONFIG_BF5xx_TIMERS is not set 709# CONFIG_BF5xx_TIMERS is not set
740# CONFIG_BF5xx_PPI is not set 710# CONFIG_BF5xx_PPI is not set
@@ -777,10 +747,6 @@ CONFIG_UNIX98_PTYS=y
777# IPMI 747# IPMI
778# 748#
779# CONFIG_IPMI_HANDLER is not set 749# CONFIG_IPMI_HANDLER is not set
780
781#
782# Watchdog Cards
783#
784CONFIG_WATCHDOG=y 750CONFIG_WATCHDOG=y
785# CONFIG_WATCHDOG_NOWAYOUT is not set 751# CONFIG_WATCHDOG_NOWAYOUT is not set
786 752
@@ -792,7 +758,6 @@ CONFIG_BFIN_WDT=y
792CONFIG_HW_RANDOM=y 758CONFIG_HW_RANDOM=y
793# CONFIG_GEN_RTC is not set 759# CONFIG_GEN_RTC is not set
794CONFIG_BLACKFIN_DPMC=y 760CONFIG_BLACKFIN_DPMC=y
795# CONFIG_DTLK is not set
796# CONFIG_R3964 is not set 761# CONFIG_R3964 is not set
797# CONFIG_RAW_DRIVER is not set 762# CONFIG_RAW_DRIVER is not set
798 763
@@ -800,11 +765,8 @@ CONFIG_BLACKFIN_DPMC=y
800# TPM devices 765# TPM devices
801# 766#
802# CONFIG_TCG_TPM is not set 767# CONFIG_TCG_TPM is not set
803
804#
805# I2C support
806#
807CONFIG_I2C=m 768CONFIG_I2C=m
769CONFIG_I2C_BOARDINFO=y
808CONFIG_I2C_CHARDEV=m 770CONFIG_I2C_CHARDEV=m
809 771
810# 772#
@@ -818,10 +780,11 @@ CONFIG_I2C_ALGOBIT=m
818# I2C Hardware Bus support 780# I2C Hardware Bus support
819# 781#
820# CONFIG_I2C_BLACKFIN_GPIO is not set 782# CONFIG_I2C_BLACKFIN_GPIO is not set
783# CONFIG_I2C_GPIO is not set
821# CONFIG_I2C_OCORES is not set 784# CONFIG_I2C_OCORES is not set
822# CONFIG_I2C_PARPORT_LIGHT is not set 785# CONFIG_I2C_PARPORT_LIGHT is not set
786# CONFIG_I2C_SIMTEC is not set
823# CONFIG_I2C_STUB is not set 787# CONFIG_I2C_STUB is not set
824# CONFIG_I2C_PCA_ISA is not set
825 788
826# 789#
827# Miscellaneous I2C Chip support 790# Miscellaneous I2C Chip support
@@ -857,18 +820,16 @@ CONFIG_SPI_BFIN=y
857# SPI Protocol Masters 820# SPI Protocol Masters
858# 821#
859# CONFIG_SPI_AT25 is not set 822# CONFIG_SPI_AT25 is not set
823# CONFIG_SPI_SPIDEV is not set
860 824
861# 825#
862# Dallas's 1-wire bus 826# Dallas's 1-wire bus
863# 827#
864# CONFIG_W1 is not set 828# CONFIG_W1 is not set
865
866#
867# Hardware Monitoring support
868#
869CONFIG_HWMON=y 829CONFIG_HWMON=y
870# CONFIG_HWMON_VID is not set 830# CONFIG_HWMON_VID is not set
871# CONFIG_SENSORS_ABITUGURU is not set 831# CONFIG_SENSORS_ABITUGURU is not set
832# CONFIG_SENSORS_AD7418 is not set
872# CONFIG_SENSORS_ADM1021 is not set 833# CONFIG_SENSORS_ADM1021 is not set
873# CONFIG_SENSORS_ADM1025 is not set 834# CONFIG_SENSORS_ADM1025 is not set
874# CONFIG_SENSORS_ADM1026 is not set 835# CONFIG_SENSORS_ADM1026 is not set
@@ -896,6 +857,7 @@ CONFIG_HWMON=y
896# CONFIG_SENSORS_LM90 is not set 857# CONFIG_SENSORS_LM90 is not set
897# CONFIG_SENSORS_LM92 is not set 858# CONFIG_SENSORS_LM92 is not set
898# CONFIG_SENSORS_MAX1619 is not set 859# CONFIG_SENSORS_MAX1619 is not set
860# CONFIG_SENSORS_MAX6650 is not set
899# CONFIG_SENSORS_PC87360 is not set 861# CONFIG_SENSORS_PC87360 is not set
900# CONFIG_SENSORS_PC87427 is not set 862# CONFIG_SENSORS_PC87427 is not set
901# CONFIG_SENSORS_SMSC47M1 is not set 863# CONFIG_SENSORS_SMSC47M1 is not set
@@ -920,22 +882,30 @@ CONFIG_HWMON=y
920# Multimedia devices 882# Multimedia devices
921# 883#
922# CONFIG_VIDEO_DEV is not set 884# CONFIG_VIDEO_DEV is not set
885# CONFIG_DVB_CORE is not set
886CONFIG_DAB=y
923 887
924# 888#
925# Digital Video Broadcasting Devices 889# Graphics support
926# 890#
927# CONFIG_DVB is not set 891# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
928 892
929# 893#
930# Graphics support 894# Display device support
931# 895#
932# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 896# CONFIG_DISPLAY_SUPPORT is not set
897# CONFIG_VGASTATE is not set
933CONFIG_FB=m 898CONFIG_FB=m
934CONFIG_FIRMWARE_EDID=y 899CONFIG_FIRMWARE_EDID=y
935# CONFIG_FB_DDC is not set 900# CONFIG_FB_DDC is not set
936CONFIG_FB_CFB_FILLRECT=m 901CONFIG_FB_CFB_FILLRECT=m
937CONFIG_FB_CFB_COPYAREA=m 902CONFIG_FB_CFB_COPYAREA=m
938CONFIG_FB_CFB_IMAGEBLIT=m 903CONFIG_FB_CFB_IMAGEBLIT=m
904# CONFIG_FB_SYS_FILLRECT is not set
905# CONFIG_FB_SYS_COPYAREA is not set
906# CONFIG_FB_SYS_IMAGEBLIT is not set
907# CONFIG_FB_SYS_FOPS is not set
908CONFIG_FB_DEFERRED_IO=y
939# CONFIG_FB_SVGALIB is not set 909# CONFIG_FB_SVGALIB is not set
940# CONFIG_FB_MACMODES is not set 910# CONFIG_FB_MACMODES is not set
941# CONFIG_FB_BACKLIGHT is not set 911# CONFIG_FB_BACKLIGHT is not set
@@ -957,10 +927,6 @@ CONFIG_ADV7393_1XMEM=y
957# CONFIG_ADV7393_2XMEM is not set 927# CONFIG_ADV7393_2XMEM is not set
958# CONFIG_FB_S1D13XXX is not set 928# CONFIG_FB_S1D13XXX is not set
959# CONFIG_FB_VIRTUAL is not set 929# CONFIG_FB_VIRTUAL is not set
960
961#
962# Logo configuration
963#
964# CONFIG_LOGO is not set 930# CONFIG_LOGO is not set
965 931
966# 932#
@@ -1001,7 +967,6 @@ CONFIG_SND_BLACKFIN_AD1836_TDM=y
1001# CONFIG_SND_BLACKFIN_AD1836_I2S is not set 967# CONFIG_SND_BLACKFIN_AD1836_I2S is not set
1002CONFIG_SND_BLACKFIN_AD1836_MULSUB=y 968CONFIG_SND_BLACKFIN_AD1836_MULSUB=y
1003# CONFIG_SND_BLACKFIN_AD1836_5P1 is not set 969# CONFIG_SND_BLACKFIN_AD1836_5P1 is not set
1004CONFIG_SND_BLACKFIN_AD1981B=m
1005CONFIG_SND_BLACKFIN_SPORT=0 970CONFIG_SND_BLACKFIN_SPORT=0
1006CONFIG_SND_BLACKFIN_SPI_PFBIT=4 971CONFIG_SND_BLACKFIN_SPI_PFBIT=4
1007CONFIG_SND_BFIN_AD73311=m 972CONFIG_SND_BFIN_AD73311=m
@@ -1009,11 +974,16 @@ CONFIG_SND_BFIN_SPORT=0
1009CONFIG_SND_BFIN_AD73311_SE=4 974CONFIG_SND_BFIN_AD73311_SE=4
1010 975
1011# 976#
1012# SoC audio support 977# System on Chip audio support
1013# 978#
1014# CONFIG_SND_SOC is not set 979# CONFIG_SND_SOC is not set
1015 980
1016# 981#
982# SoC Audio for the ADI Blackfin
983#
984# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
985
986#
1017# Open Sound System 987# Open Sound System
1018# 988#
1019# CONFIG_SOUND_PRIME is not set 989# CONFIG_SOUND_PRIME is not set
@@ -1033,18 +1003,17 @@ CONFIG_USB_ARCH_HAS_HCD=y
1033# CONFIG_USB is not set 1003# CONFIG_USB is not set
1034 1004
1035# 1005#
1036# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1006# Enable Host or Gadget support to see Inventra options
1037# 1007#
1038 1008
1039# 1009#
1040# USB Gadget Support 1010# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
1041# 1011#
1042# CONFIG_USB_GADGET is not set
1043 1012
1044# 1013#
1045# MMC/SD Card support 1014# USB Gadget Support
1046# 1015#
1047# CONFIG_SPI_MMC is not set 1016# CONFIG_USB_GADGET is not set
1048# CONFIG_MMC is not set 1017# CONFIG_MMC is not set
1049 1018
1050# 1019#
@@ -1084,44 +1053,50 @@ CONFIG_RTC_INTF_SYSFS=y
1084CONFIG_RTC_INTF_PROC=y 1053CONFIG_RTC_INTF_PROC=y
1085CONFIG_RTC_INTF_DEV=y 1054CONFIG_RTC_INTF_DEV=y
1086# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set 1055# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1056# CONFIG_RTC_DRV_TEST is not set
1087 1057
1088# 1058#
1089# RTC drivers 1059# I2C RTC drivers
1090# 1060#
1091# CONFIG_RTC_DRV_X1205 is not set
1092# CONFIG_RTC_DRV_DS1307 is not set 1061# CONFIG_RTC_DRV_DS1307 is not set
1093# CONFIG_RTC_DRV_DS1553 is not set
1094# CONFIG_RTC_DRV_ISL1208 is not set
1095# CONFIG_RTC_DRV_DS1672 is not set 1062# CONFIG_RTC_DRV_DS1672 is not set
1096# CONFIG_RTC_DRV_DS1742 is not set 1063# CONFIG_RTC_DRV_MAX6900 is not set
1064# CONFIG_RTC_DRV_RS5C372 is not set
1065# CONFIG_RTC_DRV_ISL1208 is not set
1066# CONFIG_RTC_DRV_X1205 is not set
1097# CONFIG_RTC_DRV_PCF8563 is not set 1067# CONFIG_RTC_DRV_PCF8563 is not set
1068# CONFIG_RTC_DRV_PCF8583 is not set
1069
1070#
1071# SPI RTC drivers
1072#
1098# CONFIG_RTC_DRV_RS5C348 is not set 1073# CONFIG_RTC_DRV_RS5C348 is not set
1099# CONFIG_RTC_DRV_RS5C372 is not set
1100# CONFIG_RTC_DRV_M48T86 is not set
1101# CONFIG_RTC_DRV_TEST is not set
1102# CONFIG_RTC_DRV_MAX6902 is not set 1074# CONFIG_RTC_DRV_MAX6902 is not set
1103# CONFIG_RTC_DRV_V3020 is not set
1104CONFIG_RTC_DRV_BFIN=y
1105 1075
1106# 1076#
1107# DMA Engine support 1077# Platform RTC drivers
1108# 1078#
1109# CONFIG_DMA_ENGINE is not set 1079# CONFIG_RTC_DRV_DS1553 is not set
1080# CONFIG_RTC_DRV_DS1742 is not set
1081# CONFIG_RTC_DRV_M48T86 is not set
1082# CONFIG_RTC_DRV_V3020 is not set
1110 1083
1111# 1084#
1112# DMA Clients 1085# on-CPU RTC drivers
1113# 1086#
1087CONFIG_RTC_DRV_BFIN=y
1114 1088
1115# 1089#
1116# DMA Devices 1090# DMA Engine support
1117# 1091#
1092# CONFIG_DMA_ENGINE is not set
1118 1093
1119# 1094#
1120# Auxiliary Display support 1095# DMA Clients
1121# 1096#
1122 1097
1123# 1098#
1124# Virtualization 1099# DMA Devices
1125# 1100#
1126 1101
1127# 1102#
@@ -1224,6 +1199,7 @@ CONFIG_LOCKD=m
1224CONFIG_LOCKD_V4=y 1199CONFIG_LOCKD_V4=y
1225CONFIG_NFS_COMMON=y 1200CONFIG_NFS_COMMON=y
1226CONFIG_SUNRPC=m 1201CONFIG_SUNRPC=m
1202# CONFIG_SUNRPC_BIND34 is not set
1227# CONFIG_RPCSEC_GSS_KRB5 is not set 1203# CONFIG_RPCSEC_GSS_KRB5 is not set
1228# CONFIG_RPCSEC_GSS_SPKM3 is not set 1204# CONFIG_RPCSEC_GSS_SPKM3 is not set
1229CONFIG_SMB_FS=m 1205CONFIG_SMB_FS=m
@@ -1301,14 +1277,20 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1301CONFIG_ENABLE_MUST_CHECK=y 1277CONFIG_ENABLE_MUST_CHECK=y
1302# CONFIG_MAGIC_SYSRQ is not set 1278# CONFIG_MAGIC_SYSRQ is not set
1303# CONFIG_UNUSED_SYMBOLS is not set 1279# CONFIG_UNUSED_SYMBOLS is not set
1304# CONFIG_DEBUG_FS is not set 1280CONFIG_DEBUG_FS=y
1305# CONFIG_HEADERS_CHECK is not set 1281# CONFIG_HEADERS_CHECK is not set
1306# CONFIG_DEBUG_KERNEL is not set 1282# CONFIG_DEBUG_KERNEL is not set
1307CONFIG_LOG_BUF_SHIFT=14
1308# CONFIG_DEBUG_BUGVERBOSE is not set 1283# CONFIG_DEBUG_BUGVERBOSE is not set
1309# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set 1284CONFIG_DEBUG_MMRS=y
1310CONFIG_DEBUG_HUNT_FOR_ZERO=y 1285CONFIG_DEBUG_HUNT_FOR_ZERO=y
1286CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1287CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
1288# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
1289# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1290CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
1291# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1311# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1292# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1293CONFIG_EARLY_PRINTK=y
1312CONFIG_CPLB_INFO=y 1294CONFIG_CPLB_INFO=y
1313CONFIG_ACCESS_CHECK=y 1295CONFIG_ACCESS_CHECK=y
1314 1296
@@ -1331,6 +1313,7 @@ CONFIG_SECURITY_CAPABILITIES=m
1331CONFIG_BITREVERSE=y 1313CONFIG_BITREVERSE=y
1332CONFIG_CRC_CCITT=m 1314CONFIG_CRC_CCITT=m
1333# CONFIG_CRC16 is not set 1315# CONFIG_CRC16 is not set
1316# CONFIG_CRC_ITU_T is not set
1334CONFIG_CRC32=y 1317CONFIG_CRC32=y
1335# CONFIG_LIBCRC32C is not set 1318# CONFIG_LIBCRC32C is not set
1336CONFIG_ZLIB_INFLATE=y 1319CONFIG_ZLIB_INFLATE=y
@@ -1338,3 +1321,4 @@ CONFIG_ZLIB_DEFLATE=m
1338CONFIG_PLIST=y 1321CONFIG_PLIST=y
1339CONFIG_HAS_IOMEM=y 1322CONFIG_HAS_IOMEM=y
1340CONFIG_HAS_IOPORT=y 1323CONFIG_HAS_IOPORT=y
1324CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF537-STAMP_defconfig b/arch/blackfin/configs/BF537-STAMP_defconfig
index ccf09dc09a18..828b604438eb 100644
--- a/arch/blackfin/configs/BF537-STAMP_defconfig
+++ b/arch/blackfin/configs/BF537-STAMP_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21.5 3# Linux kernel version: 2.6.22.6
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -15,8 +15,9 @@ CONFIG_GENERIC_HWEIGHT=y
15CONFIG_GENERIC_HARDIRQS=y 15CONFIG_GENERIC_HARDIRQS=y
16CONFIG_GENERIC_IRQ_PROBE=y 16CONFIG_GENERIC_IRQ_PROBE=y
17# CONFIG_GENERIC_TIME is not set 17# CONFIG_GENERIC_TIME is not set
18CONFIG_GENERIC_CALIBRATE_DELAY=y 18CONFIG_GENERIC_GPIO=y
19CONFIG_FORCE_MAX_ZONEORDER=14 19CONFIG_FORCE_MAX_ZONEORDER=14
20CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_IRQCHIP_DEMUX_GPIO=y 21CONFIG_IRQCHIP_DEMUX_GPIO=y
21CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
22 23
@@ -40,7 +41,9 @@ CONFIG_SYSVIPC_SYSCTL=y
40# CONFIG_TASKSTATS is not set 41# CONFIG_TASKSTATS is not set
41# CONFIG_UTS_NS is not set 42# CONFIG_UTS_NS is not set
42# CONFIG_AUDIT is not set 43# CONFIG_AUDIT is not set
43# CONFIG_IKCONFIG is not set 44CONFIG_IKCONFIG=y
45CONFIG_IKCONFIG_PROC=y
46CONFIG_LOG_BUF_SHIFT=14
44CONFIG_SYSFS_DEPRECATED=y 47CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 48# CONFIG_RELAY is not set
46CONFIG_BLK_DEV_INITRD=y 49CONFIG_BLK_DEV_INITRD=y
@@ -58,15 +61,20 @@ CONFIG_BUG=y
58CONFIG_ELF_CORE=y 61CONFIG_ELF_CORE=y
59CONFIG_BASE_FULL=y 62CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 63CONFIG_FUTEX=y
64CONFIG_ANON_INODES=y
65CONFIG_EPOLL=y
66CONFIG_SIGNALFD=y
67CONFIG_TIMERFD=y
68CONFIG_EVENTFD=y
69CONFIG_VM_EVENT_COUNTERS=y
61CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 70CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
62CONFIG_BUDDY=y
63# CONFIG_NP2 is not set 71# CONFIG_NP2 is not set
64CONFIG_SLAB=y 72CONFIG_SLAB=y
65CONFIG_VM_EVENT_COUNTERS=y 73# CONFIG_SLUB is not set
74# CONFIG_SLOB is not set
66CONFIG_RT_MUTEXES=y 75CONFIG_RT_MUTEXES=y
67CONFIG_TINY_SHMEM=y 76CONFIG_TINY_SHMEM=y
68CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
69# CONFIG_SLOB is not set
70 78
71# 79#
72# Loadable module support 80# Loadable module support
@@ -148,13 +156,6 @@ CONFIG_IRQ_PLL_WAKEUP=7
148# 156#
149 157
150# 158#
151# PORT F/G Selection
152#
153CONFIG_BF537_PORT_F=y
154# CONFIG_BF537_PORT_G is not set
155# CONFIG_BF537_PORT_H is not set
156
157#
158# Interrupt Priority Assignment 159# Interrupt Priority Assignment
159# 160#
160 161
@@ -199,19 +200,17 @@ CONFIG_IRQ_WATCH=13
199# CONFIG_CMDLINE_BOOL is not set 200# CONFIG_CMDLINE_BOOL is not set
200 201
201# 202#
202# Board Setup 203# Clock/PLL Setup
203# 204#
204CONFIG_CLKIN_HZ=25000000 205CONFIG_CLKIN_HZ=25000000
205CONFIG_MEM_SIZE=64 206# CONFIG_BFIN_KERNEL_CLOCK is not set
206CONFIG_MEM_ADD_WIDTH=10 207CONFIG_MAX_VCO_HZ=600000000
207CONFIG_BOOT_LOAD=0x1000 208CONFIG_MIN_VCO_HZ=50000000
208 209CONFIG_MAX_SCLK_HZ=133000000
209# 210CONFIG_MIN_SCLK_HZ=27000000
210# Blackfin Kernel Optimizations
211#
212 211
213# 212#
214# Timer Tick 213# Kernel Timer/Scheduler
215# 214#
216# CONFIG_HZ_100 is not set 215# CONFIG_HZ_100 is not set
217CONFIG_HZ_250=y 216CONFIG_HZ_250=y
@@ -220,6 +219,20 @@ CONFIG_HZ_250=y
220CONFIG_HZ=250 219CONFIG_HZ=250
221 220
222# 221#
222# Memory Setup
223#
224CONFIG_MEM_SIZE=64
225CONFIG_MEM_ADD_WIDTH=10
226CONFIG_BOOT_LOAD=0x1000
227CONFIG_BFIN_SCRATCH_REG_RETN=y
228# CONFIG_BFIN_SCRATCH_REG_RETE is not set
229# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
230
231#
232# Blackfin Kernel Optimizations
233#
234
235#
223# Memory Optimizations 236# Memory Optimizations
224# 237#
225CONFIG_I_ENTRY_L1=y 238CONFIG_I_ENTRY_L1=y
@@ -258,20 +271,15 @@ CONFIG_DMA_UNCACHED_1M=y
258# 271#
259# Cache Support 272# Cache Support
260# 273#
261CONFIG_BLKFIN_CACHE=y 274CONFIG_BFIN_ICACHE=y
262CONFIG_BLKFIN_DCACHE=y 275CONFIG_BFIN_DCACHE=y
263# CONFIG_BLKFIN_DCACHE_BANKA is not set 276# CONFIG_BFIN_DCACHE_BANKA is not set
264# CONFIG_BLKFIN_CACHE_LOCK is not set 277# CONFIG_BFIN_ICACHE_LOCK is not set
265# CONFIG_BLKFIN_WB is not set 278# CONFIG_BFIN_WB is not set
266CONFIG_BLKFIN_WT=y 279CONFIG_BFIN_WT=y
267CONFIG_L1_MAX_PIECE=16 280CONFIG_L1_MAX_PIECE=16
268 281
269# 282#
270# Clock Settings
271#
272# CONFIG_BFIN_KERNEL_CLOCK is not set
273
274#
275# Asynchonous Memory Configuration 283# Asynchonous Memory Configuration
276# 284#
277 285
@@ -298,6 +306,7 @@ CONFIG_BANK_3=0x99B3
298# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 306# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
299# 307#
300# CONFIG_PCI is not set 308# CONFIG_PCI is not set
309# CONFIG_ARCH_SUPPORTS_MSI is not set
301 310
302# 311#
303# PCCARD (PCMCIA/CardBus) support 312# PCCARD (PCMCIA/CardBus) support
@@ -305,10 +314,6 @@ CONFIG_BANK_3=0x99B3
305# CONFIG_PCCARD is not set 314# CONFIG_PCCARD is not set
306 315
307# 316#
308# PCI Hotplug Support
309#
310
311#
312# Executable file formats 317# Executable file formats
313# 318#
314CONFIG_BINFMT_ELF_FDPIC=y 319CONFIG_BINFMT_ELF_FDPIC=y
@@ -342,7 +347,6 @@ CONFIG_NET=y
342# 347#
343# Networking options 348# Networking options
344# 349#
345# CONFIG_NETDEBUG is not set
346CONFIG_PACKET=y 350CONFIG_PACKET=y
347# CONFIG_PACKET_MMAP is not set 351# CONFIG_PACKET_MMAP is not set
348CONFIG_UNIX=y 352CONFIG_UNIX=y
@@ -383,20 +387,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
383# CONFIG_NETLABEL is not set 387# CONFIG_NETLABEL is not set
384# CONFIG_NETWORK_SECMARK is not set 388# CONFIG_NETWORK_SECMARK is not set
385# CONFIG_NETFILTER is not set 389# CONFIG_NETFILTER is not set
386
387#
388# DCCP Configuration (EXPERIMENTAL)
389#
390# CONFIG_IP_DCCP is not set 390# CONFIG_IP_DCCP is not set
391
392#
393# SCTP Configuration (EXPERIMENTAL)
394#
395# CONFIG_IP_SCTP is not set 391# CONFIG_IP_SCTP is not set
396
397#
398# TIPC Configuration (EXPERIMENTAL)
399#
400# CONFIG_TIPC is not set 392# CONFIG_TIPC is not set
401# CONFIG_ATM is not set 393# CONFIG_ATM is not set
402# CONFIG_BRIDGE is not set 394# CONFIG_BRIDGE is not set
@@ -463,7 +455,16 @@ CONFIG_IRTTY_SIR=m
463# FIR device drivers 455# FIR device drivers
464# 456#
465# CONFIG_BT is not set 457# CONFIG_BT is not set
458# CONFIG_AF_RXRPC is not set
459
460#
461# Wireless
462#
463# CONFIG_CFG80211 is not set
464# CONFIG_WIRELESS_EXT is not set
465# CONFIG_MAC80211 is not set
466# CONFIG_IEEE80211 is not set 466# CONFIG_IEEE80211 is not set
467# CONFIG_RFKILL is not set
467 468
468# 469#
469# Device Drivers 470# Device Drivers
@@ -481,10 +482,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
481# Connector - unified userspace <-> kernelspace linker 482# Connector - unified userspace <-> kernelspace linker
482# 483#
483# CONFIG_CONNECTOR is not set 484# CONFIG_CONNECTOR is not set
484
485#
486# Memory Technology Devices (MTD)
487#
488CONFIG_MTD=y 485CONFIG_MTD=y
489# CONFIG_MTD_DEBUG is not set 486# CONFIG_MTD_DEBUG is not set
490# CONFIG_MTD_CONCAT is not set 487# CONFIG_MTD_CONCAT is not set
@@ -528,7 +525,6 @@ CONFIG_MTD_MW320D=m
528CONFIG_MTD_RAM=y 525CONFIG_MTD_RAM=y
529CONFIG_MTD_ROM=m 526CONFIG_MTD_ROM=m
530# CONFIG_MTD_ABSENT is not set 527# CONFIG_MTD_ABSENT is not set
531# CONFIG_MTD_OBSOLETE_CHIPS is not set
532 528
533# 529#
534# Mapping drivers for chip access 530# Mapping drivers for chip access
@@ -565,13 +561,10 @@ CONFIG_BFIN_FLASH_BANK_3=0x7BB0
565# CONFIG_MTD_DOC2000 is not set 561# CONFIG_MTD_DOC2000 is not set
566# CONFIG_MTD_DOC2001 is not set 562# CONFIG_MTD_DOC2001 is not set
567# CONFIG_MTD_DOC2001PLUS is not set 563# CONFIG_MTD_DOC2001PLUS is not set
568
569#
570# NAND Flash Device Drivers
571#
572CONFIG_MTD_NAND=m 564CONFIG_MTD_NAND=m
573# CONFIG_MTD_NAND_VERIFY_WRITE is not set 565# CONFIG_MTD_NAND_VERIFY_WRITE is not set
574# CONFIG_MTD_NAND_ECC_SMC is not set 566# CONFIG_MTD_NAND_ECC_SMC is not set
567# CONFIG_MTD_NAND_MUSEUM_IDS is not set
575CONFIG_MTD_NAND_BFIN=m 568CONFIG_MTD_NAND_BFIN=m
576CONFIG_BFIN_NAND_BASE=0x20212000 569CONFIG_BFIN_NAND_BASE=0x20212000
577CONFIG_BFIN_NAND_CLE=2 570CONFIG_BFIN_NAND_CLE=2
@@ -580,11 +573,13 @@ CONFIG_BFIN_NAND_READY=3
580CONFIG_MTD_NAND_IDS=m 573CONFIG_MTD_NAND_IDS=m
581# CONFIG_MTD_NAND_DISKONCHIP is not set 574# CONFIG_MTD_NAND_DISKONCHIP is not set
582# CONFIG_MTD_NAND_NANDSIM is not set 575# CONFIG_MTD_NAND_NANDSIM is not set
576# CONFIG_MTD_NAND_PLATFORM is not set
577# CONFIG_MTD_ONENAND is not set
583 578
584# 579#
585# OneNAND Flash Device Drivers 580# UBI - Unsorted block images
586# 581#
587# CONFIG_MTD_ONENAND is not set 582# CONFIG_MTD_UBI is not set
588 583
589# 584#
590# Parallel port support 585# Parallel port support
@@ -612,10 +607,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
612# 607#
613# Misc devices 608# Misc devices
614# 609#
615
616#
617# ATA/ATAPI/MFM/RLL support
618#
619# CONFIG_IDE is not set 610# CONFIG_IDE is not set
620 611
621# 612#
@@ -624,10 +615,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
624# CONFIG_RAID_ATTRS is not set 615# CONFIG_RAID_ATTRS is not set
625# CONFIG_SCSI is not set 616# CONFIG_SCSI is not set
626# CONFIG_SCSI_NETLINK is not set 617# CONFIG_SCSI_NETLINK is not set
627
628#
629# Serial ATA (prod) and Parallel ATA (experimental) drivers
630#
631# CONFIG_ATA is not set 618# CONFIG_ATA is not set
632 619
633# 620#
@@ -636,19 +623,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
636# CONFIG_MD is not set 623# CONFIG_MD is not set
637 624
638# 625#
639# Fusion MPT device support
640#
641# CONFIG_FUSION is not set
642
643#
644# IEEE 1394 (FireWire) support
645#
646
647#
648# I2O device support
649#
650
651#
652# Network device support 626# Network device support
653# 627#
654CONFIG_NETDEVICES=y 628CONFIG_NETDEVICES=y
@@ -656,11 +630,20 @@ CONFIG_NETDEVICES=y
656# CONFIG_BONDING is not set 630# CONFIG_BONDING is not set
657# CONFIG_EQUALIZER is not set 631# CONFIG_EQUALIZER is not set
658# CONFIG_TUN is not set 632# CONFIG_TUN is not set
633CONFIG_PHYLIB=y
659 634
660# 635#
661# PHY device support 636# MII PHY device drivers
662# 637#
663# CONFIG_PHYLIB is not set 638# CONFIG_MARVELL_PHY is not set
639# CONFIG_DAVICOM_PHY is not set
640# CONFIG_QSEMI_PHY is not set
641# CONFIG_LXT_PHY is not set
642# CONFIG_CICADA_PHY is not set
643# CONFIG_VITESSE_PHY is not set
644CONFIG_SMSC_PHY=y
645# CONFIG_BROADCOM_PHY is not set
646# CONFIG_FIXED_PHY is not set
664 647
665# 648#
666# Ethernet (10 or 100Mbit) 649# Ethernet (10 or 100Mbit)
@@ -674,27 +657,15 @@ CONFIG_BFIN_TX_DESC_NUM=10
674CONFIG_BFIN_RX_DESC_NUM=20 657CONFIG_BFIN_RX_DESC_NUM=20
675# CONFIG_BFIN_MAC_RMII is not set 658# CONFIG_BFIN_MAC_RMII is not set
676# CONFIG_SMSC911X is not set 659# CONFIG_SMSC911X is not set
660# CONFIG_DM9000 is not set
661CONFIG_NETDEV_1000=y
662CONFIG_NETDEV_10000=y
677 663
678# 664#
679# Ethernet (1000 Mbit) 665# Wireless LAN
680#
681
682#
683# Ethernet (10000 Mbit)
684#
685
686#
687# Token Ring devices
688#
689
690#
691# Wireless LAN (non-hamradio)
692#
693# CONFIG_NET_RADIO is not set
694
695#
696# Wan interfaces
697# 666#
667# CONFIG_WLAN_PRE80211 is not set
668# CONFIG_WLAN_80211 is not set
698# CONFIG_WAN is not set 669# CONFIG_WAN is not set
699# CONFIG_PPP is not set 670# CONFIG_PPP is not set
700# CONFIG_SLIP is not set 671# CONFIG_SLIP is not set
@@ -718,6 +689,7 @@ CONFIG_BFIN_RX_DESC_NUM=20
718# 689#
719CONFIG_INPUT=y 690CONFIG_INPUT=y
720# CONFIG_INPUT_FF_MEMLESS is not set 691# CONFIG_INPUT_FF_MEMLESS is not set
692# CONFIG_INPUT_POLLDEV is not set
721 693
722# 694#
723# Userland interfaces 695# Userland interfaces
@@ -734,8 +706,14 @@ CONFIG_INPUT_EVDEV=m
734# CONFIG_INPUT_KEYBOARD is not set 706# CONFIG_INPUT_KEYBOARD is not set
735# CONFIG_INPUT_MOUSE is not set 707# CONFIG_INPUT_MOUSE is not set
736# CONFIG_INPUT_JOYSTICK is not set 708# CONFIG_INPUT_JOYSTICK is not set
709# CONFIG_INPUT_TABLET is not set
737# CONFIG_INPUT_TOUCHSCREEN is not set 710# CONFIG_INPUT_TOUCHSCREEN is not set
738CONFIG_INPUT_MISC=y 711CONFIG_INPUT_MISC=y
712# CONFIG_INPUT_ATI_REMOTE is not set
713# CONFIG_INPUT_ATI_REMOTE2 is not set
714# CONFIG_INPUT_KEYSPAN_REMOTE is not set
715# CONFIG_INPUT_POWERMATE is not set
716# CONFIG_INPUT_YEALINK is not set
739# CONFIG_INPUT_UINPUT is not set 717# CONFIG_INPUT_UINPUT is not set
740# CONFIG_BF53X_PFBUTTONS is not set 718# CONFIG_BF53X_PFBUTTONS is not set
741CONFIG_TWI_KEYPAD=m 719CONFIG_TWI_KEYPAD=m
@@ -752,7 +730,7 @@ CONFIG_BFIN_TWIKEYPAD_IRQ_PFX=72
752# 730#
753# CONFIG_AD9960 is not set 731# CONFIG_AD9960 is not set
754# CONFIG_SPI_ADC_BF533 is not set 732# CONFIG_SPI_ADC_BF533 is not set
755# CONFIG_BF5xx_PFLAGS is not set 733# CONFIG_BFIN_PFLAGS is not set
756# CONFIG_BF5xx_PPIFCD is not set 734# CONFIG_BF5xx_PPIFCD is not set
757# CONFIG_BF5xx_TIMERS is not set 735# CONFIG_BF5xx_TIMERS is not set
758# CONFIG_BF5xx_PPI is not set 736# CONFIG_BF5xx_PPI is not set
@@ -803,10 +781,6 @@ CONFIG_CAN_BLACKFIN=m
803# IPMI 781# IPMI
804# 782#
805# CONFIG_IPMI_HANDLER is not set 783# CONFIG_IPMI_HANDLER is not set
806
807#
808# Watchdog Cards
809#
810CONFIG_WATCHDOG=y 784CONFIG_WATCHDOG=y
811# CONFIG_WATCHDOG_NOWAYOUT is not set 785# CONFIG_WATCHDOG_NOWAYOUT is not set
812 786
@@ -818,7 +792,6 @@ CONFIG_BFIN_WDT=y
818CONFIG_HW_RANDOM=y 792CONFIG_HW_RANDOM=y
819# CONFIG_GEN_RTC is not set 793# CONFIG_GEN_RTC is not set
820CONFIG_BLACKFIN_DPMC=y 794CONFIG_BLACKFIN_DPMC=y
821# CONFIG_DTLK is not set
822# CONFIG_R3964 is not set 795# CONFIG_R3964 is not set
823# CONFIG_RAW_DRIVER is not set 796# CONFIG_RAW_DRIVER is not set
824 797
@@ -826,11 +799,8 @@ CONFIG_BLACKFIN_DPMC=y
826# TPM devices 799# TPM devices
827# 800#
828# CONFIG_TCG_TPM is not set 801# CONFIG_TCG_TPM is not set
829
830#
831# I2C support
832#
833CONFIG_I2C=m 802CONFIG_I2C=m
803CONFIG_I2C_BOARDINFO=y
834CONFIG_I2C_CHARDEV=m 804CONFIG_I2C_CHARDEV=m
835 805
836# 806#
@@ -846,10 +816,11 @@ CONFIG_I2C_CHARDEV=m
846# CONFIG_I2C_BLACKFIN_GPIO is not set 816# CONFIG_I2C_BLACKFIN_GPIO is not set
847CONFIG_I2C_BLACKFIN_TWI=m 817CONFIG_I2C_BLACKFIN_TWI=m
848CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 818CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50
819# CONFIG_I2C_GPIO is not set
849# CONFIG_I2C_OCORES is not set 820# CONFIG_I2C_OCORES is not set
850# CONFIG_I2C_PARPORT_LIGHT is not set 821# CONFIG_I2C_PARPORT_LIGHT is not set
822# CONFIG_I2C_SIMTEC is not set
851# CONFIG_I2C_STUB is not set 823# CONFIG_I2C_STUB is not set
852# CONFIG_I2C_PCA_ISA is not set
853 824
854# 825#
855# Miscellaneous I2C Chip support 826# Miscellaneous I2C Chip support
@@ -885,18 +856,16 @@ CONFIG_SPI_BFIN=y
885# SPI Protocol Masters 856# SPI Protocol Masters
886# 857#
887# CONFIG_SPI_AT25 is not set 858# CONFIG_SPI_AT25 is not set
859# CONFIG_SPI_SPIDEV is not set
888 860
889# 861#
890# Dallas's 1-wire bus 862# Dallas's 1-wire bus
891# 863#
892# CONFIG_W1 is not set 864# CONFIG_W1 is not set
893
894#
895# Hardware Monitoring support
896#
897CONFIG_HWMON=y 865CONFIG_HWMON=y
898# CONFIG_HWMON_VID is not set 866# CONFIG_HWMON_VID is not set
899# CONFIG_SENSORS_ABITUGURU is not set 867# CONFIG_SENSORS_ABITUGURU is not set
868# CONFIG_SENSORS_AD7418 is not set
900# CONFIG_SENSORS_ADM1021 is not set 869# CONFIG_SENSORS_ADM1021 is not set
901# CONFIG_SENSORS_ADM1025 is not set 870# CONFIG_SENSORS_ADM1025 is not set
902# CONFIG_SENSORS_ADM1026 is not set 871# CONFIG_SENSORS_ADM1026 is not set
@@ -924,6 +893,7 @@ CONFIG_HWMON=y
924# CONFIG_SENSORS_LM90 is not set 893# CONFIG_SENSORS_LM90 is not set
925# CONFIG_SENSORS_LM92 is not set 894# CONFIG_SENSORS_LM92 is not set
926# CONFIG_SENSORS_MAX1619 is not set 895# CONFIG_SENSORS_MAX1619 is not set
896# CONFIG_SENSORS_MAX6650 is not set
927# CONFIG_SENSORS_PC87360 is not set 897# CONFIG_SENSORS_PC87360 is not set
928# CONFIG_SENSORS_PC87427 is not set 898# CONFIG_SENSORS_PC87427 is not set
929# CONFIG_SENSORS_SMSC47M1 is not set 899# CONFIG_SENSORS_SMSC47M1 is not set
@@ -948,11 +918,8 @@ CONFIG_HWMON=y
948# Multimedia devices 918# Multimedia devices
949# 919#
950# CONFIG_VIDEO_DEV is not set 920# CONFIG_VIDEO_DEV is not set
951 921# CONFIG_DVB_CORE is not set
952# 922CONFIG_DAB=y
953# Digital Video Broadcasting Devices
954#
955# CONFIG_DVB is not set
956 923
957# 924#
958# Graphics support 925# Graphics support
@@ -960,12 +927,23 @@ CONFIG_HWMON=y
960CONFIG_BACKLIGHT_LCD_SUPPORT=y 927CONFIG_BACKLIGHT_LCD_SUPPORT=y
961CONFIG_BACKLIGHT_CLASS_DEVICE=m 928CONFIG_BACKLIGHT_CLASS_DEVICE=m
962CONFIG_LCD_CLASS_DEVICE=m 929CONFIG_LCD_CLASS_DEVICE=m
930
931#
932# Display device support
933#
934# CONFIG_DISPLAY_SUPPORT is not set
935# CONFIG_VGASTATE is not set
963CONFIG_FB=m 936CONFIG_FB=m
964CONFIG_FIRMWARE_EDID=y 937CONFIG_FIRMWARE_EDID=y
965# CONFIG_FB_DDC is not set 938# CONFIG_FB_DDC is not set
966CONFIG_FB_CFB_FILLRECT=m 939CONFIG_FB_CFB_FILLRECT=m
967CONFIG_FB_CFB_COPYAREA=m 940CONFIG_FB_CFB_COPYAREA=m
968CONFIG_FB_CFB_IMAGEBLIT=m 941CONFIG_FB_CFB_IMAGEBLIT=m
942# CONFIG_FB_SYS_FILLRECT is not set
943# CONFIG_FB_SYS_COPYAREA is not set
944# CONFIG_FB_SYS_IMAGEBLIT is not set
945# CONFIG_FB_SYS_FOPS is not set
946CONFIG_FB_DEFERRED_IO=y
969# CONFIG_FB_SVGALIB is not set 947# CONFIG_FB_SVGALIB is not set
970# CONFIG_FB_MACMODES is not set 948# CONFIG_FB_MACMODES is not set
971# CONFIG_FB_BACKLIGHT is not set 949# CONFIG_FB_BACKLIGHT is not set
@@ -991,10 +969,6 @@ CONFIG_LQ035_SLAVE_ADDR=0x58
991# CONFIG_FB_BFIN_BGR is not set 969# CONFIG_FB_BFIN_BGR is not set
992# CONFIG_FB_S1D13XXX is not set 970# CONFIG_FB_S1D13XXX is not set
993# CONFIG_FB_VIRTUAL is not set 971# CONFIG_FB_VIRTUAL is not set
994
995#
996# Logo configuration
997#
998# CONFIG_LOGO is not set 972# CONFIG_LOGO is not set
999 973
1000# 974#
@@ -1035,7 +1009,6 @@ CONFIG_SND_BLACKFIN_AD1836_TDM=y
1035# CONFIG_SND_BLACKFIN_AD1836_I2S is not set 1009# CONFIG_SND_BLACKFIN_AD1836_I2S is not set
1036CONFIG_SND_BLACKFIN_AD1836_MULSUB=y 1010CONFIG_SND_BLACKFIN_AD1836_MULSUB=y
1037# CONFIG_SND_BLACKFIN_AD1836_5P1 is not set 1011# CONFIG_SND_BLACKFIN_AD1836_5P1 is not set
1038CONFIG_SND_BLACKFIN_AD1981B=m
1039CONFIG_SND_BLACKFIN_SPORT=0 1012CONFIG_SND_BLACKFIN_SPORT=0
1040CONFIG_SND_BLACKFIN_SPI_PFBIT=4 1013CONFIG_SND_BLACKFIN_SPI_PFBIT=4
1041CONFIG_SND_BFIN_AD73311=m 1014CONFIG_SND_BFIN_AD73311=m
@@ -1043,11 +1016,16 @@ CONFIG_SND_BFIN_SPORT=0
1043CONFIG_SND_BFIN_AD73311_SE=4 1016CONFIG_SND_BFIN_AD73311_SE=4
1044 1017
1045# 1018#
1046# SoC audio support 1019# System on Chip audio support
1047# 1020#
1048# CONFIG_SND_SOC is not set 1021# CONFIG_SND_SOC is not set
1049 1022
1050# 1023#
1024# SoC Audio for the ADI Blackfin
1025#
1026# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
1027
1028#
1051# Open Sound System 1029# Open Sound System
1052# 1030#
1053# CONFIG_SOUND_PRIME is not set 1031# CONFIG_SOUND_PRIME is not set
@@ -1067,18 +1045,17 @@ CONFIG_USB_ARCH_HAS_HCD=y
1067# CONFIG_USB is not set 1045# CONFIG_USB is not set
1068 1046
1069# 1047#
1070# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1048# Enable Host or Gadget support to see Inventra options
1071# 1049#
1072 1050
1073# 1051#
1074# USB Gadget Support 1052# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
1075# 1053#
1076# CONFIG_USB_GADGET is not set
1077 1054
1078# 1055#
1079# MMC/SD Card support 1056# USB Gadget Support
1080# 1057#
1081# CONFIG_SPI_MMC is not set 1058# CONFIG_USB_GADGET is not set
1082# CONFIG_MMC is not set 1059# CONFIG_MMC is not set
1083 1060
1084# 1061#
@@ -1118,44 +1095,50 @@ CONFIG_RTC_INTF_SYSFS=y
1118CONFIG_RTC_INTF_PROC=y 1095CONFIG_RTC_INTF_PROC=y
1119CONFIG_RTC_INTF_DEV=y 1096CONFIG_RTC_INTF_DEV=y
1120# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set 1097# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1098# CONFIG_RTC_DRV_TEST is not set
1121 1099
1122# 1100#
1123# RTC drivers 1101# I2C RTC drivers
1124# 1102#
1125# CONFIG_RTC_DRV_X1205 is not set
1126# CONFIG_RTC_DRV_DS1307 is not set 1103# CONFIG_RTC_DRV_DS1307 is not set
1127# CONFIG_RTC_DRV_DS1553 is not set
1128# CONFIG_RTC_DRV_ISL1208 is not set
1129# CONFIG_RTC_DRV_DS1672 is not set 1104# CONFIG_RTC_DRV_DS1672 is not set
1130# CONFIG_RTC_DRV_DS1742 is not set 1105# CONFIG_RTC_DRV_MAX6900 is not set
1106# CONFIG_RTC_DRV_RS5C372 is not set
1107# CONFIG_RTC_DRV_ISL1208 is not set
1108# CONFIG_RTC_DRV_X1205 is not set
1131# CONFIG_RTC_DRV_PCF8563 is not set 1109# CONFIG_RTC_DRV_PCF8563 is not set
1110# CONFIG_RTC_DRV_PCF8583 is not set
1111
1112#
1113# SPI RTC drivers
1114#
1132# CONFIG_RTC_DRV_RS5C348 is not set 1115# CONFIG_RTC_DRV_RS5C348 is not set
1133# CONFIG_RTC_DRV_RS5C372 is not set
1134# CONFIG_RTC_DRV_M48T86 is not set
1135# CONFIG_RTC_DRV_TEST is not set
1136# CONFIG_RTC_DRV_MAX6902 is not set 1116# CONFIG_RTC_DRV_MAX6902 is not set
1137# CONFIG_RTC_DRV_V3020 is not set
1138CONFIG_RTC_DRV_BFIN=y
1139 1117
1140# 1118#
1141# DMA Engine support 1119# Platform RTC drivers
1142# 1120#
1143# CONFIG_DMA_ENGINE is not set 1121# CONFIG_RTC_DRV_DS1553 is not set
1122# CONFIG_RTC_DRV_DS1742 is not set
1123# CONFIG_RTC_DRV_M48T86 is not set
1124# CONFIG_RTC_DRV_V3020 is not set
1144 1125
1145# 1126#
1146# DMA Clients 1127# on-CPU RTC drivers
1147# 1128#
1129CONFIG_RTC_DRV_BFIN=y
1148 1130
1149# 1131#
1150# DMA Devices 1132# DMA Engine support
1151# 1133#
1134# CONFIG_DMA_ENGINE is not set
1152 1135
1153# 1136#
1154# Auxiliary Display support 1137# DMA Clients
1155# 1138#
1156 1139
1157# 1140#
1158# Virtualization 1141# DMA Devices
1159# 1142#
1160 1143
1161# 1144#
@@ -1258,6 +1241,7 @@ CONFIG_LOCKD=m
1258CONFIG_LOCKD_V4=y 1241CONFIG_LOCKD_V4=y
1259CONFIG_NFS_COMMON=y 1242CONFIG_NFS_COMMON=y
1260CONFIG_SUNRPC=m 1243CONFIG_SUNRPC=m
1244# CONFIG_SUNRPC_BIND34 is not set
1261# CONFIG_RPCSEC_GSS_KRB5 is not set 1245# CONFIG_RPCSEC_GSS_KRB5 is not set
1262# CONFIG_RPCSEC_GSS_SPKM3 is not set 1246# CONFIG_RPCSEC_GSS_SPKM3 is not set
1263CONFIG_SMB_FS=m 1247CONFIG_SMB_FS=m
@@ -1335,14 +1319,20 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1335CONFIG_ENABLE_MUST_CHECK=y 1319CONFIG_ENABLE_MUST_CHECK=y
1336# CONFIG_MAGIC_SYSRQ is not set 1320# CONFIG_MAGIC_SYSRQ is not set
1337# CONFIG_UNUSED_SYMBOLS is not set 1321# CONFIG_UNUSED_SYMBOLS is not set
1338# CONFIG_DEBUG_FS is not set 1322CONFIG_DEBUG_FS=y
1339# CONFIG_HEADERS_CHECK is not set 1323# CONFIG_HEADERS_CHECK is not set
1340# CONFIG_DEBUG_KERNEL is not set 1324# CONFIG_DEBUG_KERNEL is not set
1341CONFIG_LOG_BUF_SHIFT=14
1342# CONFIG_DEBUG_BUGVERBOSE is not set 1325# CONFIG_DEBUG_BUGVERBOSE is not set
1343# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set 1326CONFIG_DEBUG_MMRS=y
1344CONFIG_DEBUG_HUNT_FOR_ZERO=y 1327CONFIG_DEBUG_HUNT_FOR_ZERO=y
1328CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1329CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
1330# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
1331# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1332CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
1333# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1345# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1334# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1335CONFIG_EARLY_PRINTK=y
1346CONFIG_CPLB_INFO=y 1336CONFIG_CPLB_INFO=y
1347CONFIG_ACCESS_CHECK=y 1337CONFIG_ACCESS_CHECK=y
1348 1338
@@ -1365,6 +1355,7 @@ CONFIG_SECURITY_CAPABILITIES=m
1365CONFIG_BITREVERSE=y 1355CONFIG_BITREVERSE=y
1366CONFIG_CRC_CCITT=m 1356CONFIG_CRC_CCITT=m
1367# CONFIG_CRC16 is not set 1357# CONFIG_CRC16 is not set
1358# CONFIG_CRC_ITU_T is not set
1368CONFIG_CRC32=y 1359CONFIG_CRC32=y
1369# CONFIG_LIBCRC32C is not set 1360# CONFIG_LIBCRC32C is not set
1370CONFIG_ZLIB_INFLATE=y 1361CONFIG_ZLIB_INFLATE=y
@@ -1372,3 +1363,4 @@ CONFIG_ZLIB_DEFLATE=m
1372CONFIG_PLIST=y 1363CONFIG_PLIST=y
1373CONFIG_HAS_IOMEM=y 1364CONFIG_HAS_IOMEM=y
1374CONFIG_HAS_IOPORT=y 1365CONFIG_HAS_IOPORT=y
1366CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF548-EZKIT_defconfig b/arch/blackfin/configs/BF548-EZKIT_defconfig
index ac8390fafa9c..e80f3d59c283 100644
--- a/arch/blackfin/configs/BF548-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF548-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21.5 3# Linux kernel version: 2.6.22.6
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -15,8 +15,9 @@ CONFIG_GENERIC_HWEIGHT=y
15CONFIG_GENERIC_HARDIRQS=y 15CONFIG_GENERIC_HARDIRQS=y
16CONFIG_GENERIC_IRQ_PROBE=y 16CONFIG_GENERIC_IRQ_PROBE=y
17# CONFIG_GENERIC_TIME is not set 17# CONFIG_GENERIC_TIME is not set
18CONFIG_GENERIC_CALIBRATE_DELAY=y 18CONFIG_GENERIC_GPIO=y
19CONFIG_FORCE_MAX_ZONEORDER=14 19CONFIG_FORCE_MAX_ZONEORDER=14
20CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_IRQCHIP_DEMUX_GPIO=y 21CONFIG_IRQCHIP_DEMUX_GPIO=y
21CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
22 23
@@ -40,7 +41,9 @@ CONFIG_SYSVIPC_SYSCTL=y
40# CONFIG_TASKSTATS is not set 41# CONFIG_TASKSTATS is not set
41# CONFIG_UTS_NS is not set 42# CONFIG_UTS_NS is not set
42# CONFIG_AUDIT is not set 43# CONFIG_AUDIT is not set
43# CONFIG_IKCONFIG is not set 44CONFIG_IKCONFIG=y
45CONFIG_IKCONFIG_PROC=y
46CONFIG_LOG_BUF_SHIFT=14
44CONFIG_SYSFS_DEPRECATED=y 47CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 48# CONFIG_RELAY is not set
46CONFIG_BLK_DEV_INITRD=y 49CONFIG_BLK_DEV_INITRD=y
@@ -51,7 +54,6 @@ CONFIG_EMBEDDED=y
51CONFIG_UID16=y 54CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 55CONFIG_SYSCTL_SYSCALL=y
53CONFIG_KALLSYMS=y 56CONFIG_KALLSYMS=y
54# CONFIG_KALLSYMS_ALL is not set
55# CONFIG_KALLSYMS_EXTRA_PASS is not set 57# CONFIG_KALLSYMS_EXTRA_PASS is not set
56CONFIG_HOTPLUG=y 58CONFIG_HOTPLUG=y
57CONFIG_PRINTK=y 59CONFIG_PRINTK=y
@@ -59,14 +61,20 @@ CONFIG_BUG=y
59CONFIG_ELF_CORE=y 61CONFIG_ELF_CORE=y
60CONFIG_BASE_FULL=y 62CONFIG_BASE_FULL=y
61CONFIG_FUTEX=y 63CONFIG_FUTEX=y
64CONFIG_ANON_INODES=y
65CONFIG_EPOLL=y
66CONFIG_SIGNALFD=y
67CONFIG_TIMERFD=y
68CONFIG_EVENTFD=y
69CONFIG_VM_EVENT_COUNTERS=y
62CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 70CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
63# CONFIG_NP2 is not set 71# CONFIG_NP2 is not set
64CONFIG_SLAB=y 72CONFIG_SLAB=y
65CONFIG_VM_EVENT_COUNTERS=y 73# CONFIG_SLUB is not set
74# CONFIG_SLOB is not set
66CONFIG_RT_MUTEXES=y 75CONFIG_RT_MUTEXES=y
67CONFIG_TINY_SHMEM=y 76CONFIG_TINY_SHMEM=y
68CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
69# CONFIG_SLOB is not set
70 78
71# 79#
72# Loadable module support 80# Loadable module support
@@ -165,6 +173,7 @@ CONFIG_IRQ_UART1_TX=10
165# 173#
166# BF548 Specific Configuration 174# BF548 Specific Configuration
167# 175#
176# CONFIG_DEB_DMA_URGENT is not set
168 177
169# 178#
170# Interrupt Priority Assignment 179# Interrupt Priority Assignment
@@ -242,24 +251,35 @@ CONFIG_IRQ_PINT2=11
242CONFIG_IRQ_PINT3=11 251CONFIG_IRQ_PINT3=11
243 252
244# 253#
245# Board customizations 254# Pin Interrupt to Port Assignment
246# 255#
247# CONFIG_CMDLINE_BOOL is not set
248 256
249# 257#
250# Board Setup 258# Assignment
251# 259#
252CONFIG_CLKIN_HZ=25000000 260CONFIG_PINTx_REASSIGN=y
253CONFIG_MEM_SIZE=64 261CONFIG_PINT0_ASSIGN=0x00000101
254CONFIG_MEM_ADD_WIDTH=10 262CONFIG_PINT1_ASSIGN=0x01010000
255CONFIG_BOOT_LOAD=0x1000 263CONFIG_PINT2_ASSIGN=0x07000101
264CONFIG_PINT3_ASSIGN=0x02020303
256 265
257# 266#
258# Blackfin Kernel Optimizations 267# Board customizations
259# 268#
269# CONFIG_CMDLINE_BOOL is not set
260 270
261# 271#
262# Timer Tick 272# Clock/PLL Setup
273#
274CONFIG_CLKIN_HZ=25000000
275# CONFIG_BFIN_KERNEL_CLOCK is not set
276CONFIG_MAX_VCO_HZ=533000000
277CONFIG_MIN_VCO_HZ=50000000
278CONFIG_MAX_SCLK_HZ=133000000
279CONFIG_MIN_SCLK_HZ=27000000
280
281#
282# Kernel Timer/Scheduler
263# 283#
264# CONFIG_HZ_100 is not set 284# CONFIG_HZ_100 is not set
265CONFIG_HZ_250=y 285CONFIG_HZ_250=y
@@ -268,6 +288,20 @@ CONFIG_HZ_250=y
268CONFIG_HZ=250 288CONFIG_HZ=250
269 289
270# 290#
291# Memory Setup
292#
293CONFIG_MEM_SIZE=64
294CONFIG_MEM_ADD_WIDTH=10
295CONFIG_BOOT_LOAD=0x1000
296CONFIG_BFIN_SCRATCH_REG_RETN=y
297# CONFIG_BFIN_SCRATCH_REG_RETE is not set
298# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
299
300#
301# Blackfin Kernel Optimizations
302#
303
304#
271# Memory Optimizations 305# Memory Optimizations
272# 306#
273CONFIG_I_ENTRY_L1=y 307CONFIG_I_ENTRY_L1=y
@@ -275,12 +309,12 @@ CONFIG_EXCPT_IRQ_SYSC_L1=y
275CONFIG_DO_IRQ_L1=y 309CONFIG_DO_IRQ_L1=y
276CONFIG_CORE_TIMER_IRQ_L1=y 310CONFIG_CORE_TIMER_IRQ_L1=y
277CONFIG_IDLE_L1=y 311CONFIG_IDLE_L1=y
278CONFIG_SCHEDULE_L1=y 312# CONFIG_SCHEDULE_L1 is not set
279CONFIG_ARITHMETIC_OPS_L1=y 313CONFIG_ARITHMETIC_OPS_L1=y
280CONFIG_ACCESS_OK_L1=y 314CONFIG_ACCESS_OK_L1=y
281CONFIG_MEMSET_L1=y 315# CONFIG_MEMSET_L1 is not set
282CONFIG_MEMCPY_L1=y 316# CONFIG_MEMCPY_L1 is not set
283CONFIG_SYS_BFIN_SPINLOCK_L1=y 317# CONFIG_SYS_BFIN_SPINLOCK_L1 is not set
284# CONFIG_IP_CHECKSUM_L1 is not set 318# CONFIG_IP_CHECKSUM_L1 is not set
285CONFIG_CACHELINE_ALIGNED_L1=y 319CONFIG_CACHELINE_ALIGNED_L1=y
286# CONFIG_SYSCALL_TAB_L1 is not set 320# CONFIG_SYSCALL_TAB_L1 is not set
@@ -306,20 +340,15 @@ CONFIG_DMA_UNCACHED_1M=y
306# 340#
307# Cache Support 341# Cache Support
308# 342#
309CONFIG_BLKFIN_CACHE=y 343CONFIG_BFIN_ICACHE=y
310CONFIG_BLKFIN_DCACHE=y 344CONFIG_BFIN_DCACHE=y
311# CONFIG_BLKFIN_DCACHE_BANKA is not set 345# CONFIG_BFIN_DCACHE_BANKA is not set
312# CONFIG_BLKFIN_CACHE_LOCK is not set 346# CONFIG_BFIN_ICACHE_LOCK is not set
313# CONFIG_BLKFIN_WB is not set 347# CONFIG_BFIN_WB is not set
314CONFIG_BLKFIN_WT=y 348CONFIG_BFIN_WT=y
315CONFIG_L1_MAX_PIECE=16 349CONFIG_L1_MAX_PIECE=16
316 350
317# 351#
318# Clock Settings
319#
320# CONFIG_BFIN_KERNEL_CLOCK is not set
321
322#
323# Asynchonous Memory Configuration 352# Asynchonous Memory Configuration
324# 353#
325 354
@@ -327,7 +356,6 @@ CONFIG_L1_MAX_PIECE=16
327# EBIU_AMBCTL Global Control 356# EBIU_AMBCTL Global Control
328# 357#
329CONFIG_C_AMCKEN=y 358CONFIG_C_AMCKEN=y
330CONFIG_C_CDPRIO=y
331# CONFIG_C_AMBEN is not set 359# CONFIG_C_AMBEN is not set
332# CONFIG_C_AMBEN_B0 is not set 360# CONFIG_C_AMBEN_B0 is not set
333# CONFIG_C_AMBEN_B0_B1 is not set 361# CONFIG_C_AMBEN_B0_B1 is not set
@@ -338,7 +366,7 @@ CONFIG_C_AMBEN_ALL=y
338# EBIU_AMBCTL Control 366# EBIU_AMBCTL Control
339# 367#
340CONFIG_BANK_0=0x7BB0 368CONFIG_BANK_0=0x7BB0
341CONFIG_BANK_1=0x7BB0 369CONFIG_BANK_1=0x5554
342CONFIG_BANK_2=0x7BB0 370CONFIG_BANK_2=0x7BB0
343CONFIG_BANK_3=0x99B3 371CONFIG_BANK_3=0x99B3
344 372
@@ -346,6 +374,7 @@ CONFIG_BANK_3=0x99B3
346# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 374# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
347# 375#
348# CONFIG_PCI is not set 376# CONFIG_PCI is not set
377# CONFIG_ARCH_SUPPORTS_MSI is not set
349 378
350# 379#
351# PCCARD (PCMCIA/CardBus) support 380# PCCARD (PCMCIA/CardBus) support
@@ -353,10 +382,6 @@ CONFIG_BANK_3=0x99B3
353# CONFIG_PCCARD is not set 382# CONFIG_PCCARD is not set
354 383
355# 384#
356# PCI Hotplug Support
357#
358
359#
360# Executable file formats 385# Executable file formats
361# 386#
362CONFIG_BINFMT_ELF_FDPIC=y 387CONFIG_BINFMT_ELF_FDPIC=y
@@ -383,7 +408,6 @@ CONFIG_NET=y
383# 408#
384# Networking options 409# Networking options
385# 410#
386# CONFIG_NETDEBUG is not set
387CONFIG_PACKET=y 411CONFIG_PACKET=y
388# CONFIG_PACKET_MMAP is not set 412# CONFIG_PACKET_MMAP is not set
389CONFIG_UNIX=y 413CONFIG_UNIX=y
@@ -424,20 +448,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
424# CONFIG_NETLABEL is not set 448# CONFIG_NETLABEL is not set
425# CONFIG_NETWORK_SECMARK is not set 449# CONFIG_NETWORK_SECMARK is not set
426# CONFIG_NETFILTER is not set 450# CONFIG_NETFILTER is not set
427
428#
429# DCCP Configuration (EXPERIMENTAL)
430#
431# CONFIG_IP_DCCP is not set 451# CONFIG_IP_DCCP is not set
432
433#
434# SCTP Configuration (EXPERIMENTAL)
435#
436# CONFIG_IP_SCTP is not set 452# CONFIG_IP_SCTP is not set
437
438#
439# TIPC Configuration (EXPERIMENTAL)
440#
441# CONFIG_TIPC is not set 453# CONFIG_TIPC is not set
442# CONFIG_ATM is not set 454# CONFIG_ATM is not set
443# CONFIG_BRIDGE is not set 455# CONFIG_BRIDGE is not set
@@ -463,7 +475,16 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
463# CONFIG_HAMRADIO is not set 475# CONFIG_HAMRADIO is not set
464# CONFIG_IRDA is not set 476# CONFIG_IRDA is not set
465# CONFIG_BT is not set 477# CONFIG_BT is not set
478# CONFIG_AF_RXRPC is not set
479
480#
481# Wireless
482#
483# CONFIG_CFG80211 is not set
484# CONFIG_WIRELESS_EXT is not set
485# CONFIG_MAC80211 is not set
466# CONFIG_IEEE80211 is not set 486# CONFIG_IEEE80211 is not set
487# CONFIG_RFKILL is not set
467 488
468# 489#
469# Device Drivers 490# Device Drivers
@@ -475,29 +496,23 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
475CONFIG_STANDALONE=y 496CONFIG_STANDALONE=y
476CONFIG_PREVENT_FIRMWARE_BUILD=y 497CONFIG_PREVENT_FIRMWARE_BUILD=y
477# CONFIG_FW_LOADER is not set 498# CONFIG_FW_LOADER is not set
478# CONFIG_DEBUG_DRIVER is not set
479# CONFIG_DEBUG_DEVRES is not set
480# CONFIG_SYS_HYPERVISOR is not set 499# CONFIG_SYS_HYPERVISOR is not set
481 500
482# 501#
483# Connector - unified userspace <-> kernelspace linker 502# Connector - unified userspace <-> kernelspace linker
484# 503#
485# CONFIG_CONNECTOR is not set 504# CONFIG_CONNECTOR is not set
486
487#
488# Memory Technology Devices (MTD)
489#
490CONFIG_MTD=y 505CONFIG_MTD=y
491# CONFIG_MTD_DEBUG is not set 506# CONFIG_MTD_DEBUG is not set
492# CONFIG_MTD_CONCAT is not set 507# CONFIG_MTD_CONCAT is not set
493CONFIG_MTD_PARTITIONS=y 508CONFIG_MTD_PARTITIONS=y
494# CONFIG_MTD_REDBOOT_PARTS is not set 509# CONFIG_MTD_REDBOOT_PARTS is not set
495# CONFIG_MTD_CMDLINE_PARTS is not set 510CONFIG_MTD_CMDLINE_PARTS=y
496 511
497# 512#
498# User Modules And Translation Layers 513# User Modules And Translation Layers
499# 514#
500# CONFIG_MTD_CHAR is not set 515CONFIG_MTD_CHAR=y
501CONFIG_MTD_BLKDEVS=y 516CONFIG_MTD_BLKDEVS=y
502CONFIG_MTD_BLOCK=y 517CONFIG_MTD_BLOCK=y
503# CONFIG_FTL is not set 518# CONFIG_FTL is not set
@@ -509,8 +524,10 @@ CONFIG_MTD_BLOCK=y
509# 524#
510# RAM/ROM/Flash chip drivers 525# RAM/ROM/Flash chip drivers
511# 526#
512# CONFIG_MTD_CFI is not set 527CONFIG_MTD_CFI=y
513# CONFIG_MTD_JEDECPROBE is not set 528# CONFIG_MTD_JEDECPROBE is not set
529CONFIG_MTD_GEN_PROBE=y
530# CONFIG_MTD_CFI_ADV_OPTIONS is not set
514CONFIG_MTD_MAP_BANK_WIDTH_1=y 531CONFIG_MTD_MAP_BANK_WIDTH_1=y
515CONFIG_MTD_MAP_BANK_WIDTH_2=y 532CONFIG_MTD_MAP_BANK_WIDTH_2=y
516CONFIG_MTD_MAP_BANK_WIDTH_4=y 533CONFIG_MTD_MAP_BANK_WIDTH_4=y
@@ -521,22 +538,32 @@ CONFIG_MTD_CFI_I1=y
521CONFIG_MTD_CFI_I2=y 538CONFIG_MTD_CFI_I2=y
522# CONFIG_MTD_CFI_I4 is not set 539# CONFIG_MTD_CFI_I4 is not set
523# CONFIG_MTD_CFI_I8 is not set 540# CONFIG_MTD_CFI_I8 is not set
541CONFIG_MTD_CFI_INTELEXT=y
542# CONFIG_MTD_CFI_AMDSTD is not set
543# CONFIG_MTD_CFI_STAA is not set
544# CONFIG_MTD_MW320D is not set
545CONFIG_MTD_CFI_UTIL=y
524CONFIG_MTD_RAM=y 546CONFIG_MTD_RAM=y
525# CONFIG_MTD_ROM is not set 547# CONFIG_MTD_ROM is not set
526# CONFIG_MTD_ABSENT is not set 548# CONFIG_MTD_ABSENT is not set
527# CONFIG_MTD_OBSOLETE_CHIPS is not set
528 549
529# 550#
530# Mapping drivers for chip access 551# Mapping drivers for chip access
531# 552#
532CONFIG_MTD_COMPLEX_MAPPINGS=y 553CONFIG_MTD_COMPLEX_MAPPINGS=y
554CONFIG_MTD_PHYSMAP=y
555CONFIG_MTD_PHYSMAP_START=0x20000000
556CONFIG_MTD_PHYSMAP_LEN=0x400000
557CONFIG_MTD_PHYSMAP_BANKWIDTH=2
533# CONFIG_MTD_BF5xx is not set 558# CONFIG_MTD_BF5xx is not set
534CONFIG_MTD_UCLINUX=y 559# CONFIG_MTD_UCLINUX is not set
535# CONFIG_MTD_PLATRAM is not set 560# CONFIG_MTD_PLATRAM is not set
536 561
537# 562#
538# Self-contained MTD device drivers 563# Self-contained MTD device drivers
539# 564#
565# CONFIG_MTD_DATAFLASH is not set
566# CONFIG_MTD_M25P80 is not set
540# CONFIG_MTD_SLRAM is not set 567# CONFIG_MTD_SLRAM is not set
541# CONFIG_MTD_PHRAM is not set 568# CONFIG_MTD_PHRAM is not set
542# CONFIG_MTD_MTDRAM is not set 569# CONFIG_MTD_MTDRAM is not set
@@ -548,16 +575,23 @@ CONFIG_MTD_UCLINUX=y
548# CONFIG_MTD_DOC2000 is not set 575# CONFIG_MTD_DOC2000 is not set
549# CONFIG_MTD_DOC2001 is not set 576# CONFIG_MTD_DOC2001 is not set
550# CONFIG_MTD_DOC2001PLUS is not set 577# CONFIG_MTD_DOC2001PLUS is not set
578CONFIG_MTD_NAND=y
579# CONFIG_MTD_NAND_VERIFY_WRITE is not set
580# CONFIG_MTD_NAND_ECC_SMC is not set
581# CONFIG_MTD_NAND_MUSEUM_IDS is not set
582# CONFIG_MTD_NAND_BFIN is not set
583CONFIG_MTD_NAND_IDS=y
584CONFIG_MTD_NAND_BF5XX=y
585CONFIG_MTD_NAND_BF5XX_HWECC=y
586# CONFIG_MTD_NAND_DISKONCHIP is not set
587# CONFIG_MTD_NAND_NANDSIM is not set
588# CONFIG_MTD_NAND_PLATFORM is not set
589# CONFIG_MTD_ONENAND is not set
551 590
552# 591#
553# NAND Flash Device Drivers 592# UBI - Unsorted block images
554#
555# CONFIG_MTD_NAND is not set
556
557#
558# OneNAND Flash Device Drivers
559# 593#
560# CONFIG_MTD_ONENAND is not set 594# CONFIG_MTD_UBI is not set
561 595
562# 596#
563# Parallel port support 597# Parallel port support
@@ -585,41 +619,61 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
585# 619#
586# Misc devices 620# Misc devices
587# 621#
588
589#
590# ATA/ATAPI/MFM/RLL support
591#
592# CONFIG_IDE is not set 622# CONFIG_IDE is not set
593 623
594# 624#
595# SCSI device support 625# SCSI device support
596# 626#
597# CONFIG_RAID_ATTRS is not set 627# CONFIG_RAID_ATTRS is not set
598# CONFIG_SCSI is not set 628CONFIG_SCSI=y
629# CONFIG_SCSI_TGT is not set
599# CONFIG_SCSI_NETLINK is not set 630# CONFIG_SCSI_NETLINK is not set
631CONFIG_SCSI_PROC_FS=y
600 632
601# 633#
602# Serial ATA (prod) and Parallel ATA (experimental) drivers 634# SCSI support type (disk, tape, CD-ROM)
603# 635#
604# CONFIG_ATA is not set 636CONFIG_BLK_DEV_SD=y
637# CONFIG_CHR_DEV_ST is not set
638# CONFIG_CHR_DEV_OSST is not set
639CONFIG_BLK_DEV_SR=y
640# CONFIG_BLK_DEV_SR_VENDOR is not set
641# CONFIG_CHR_DEV_SG is not set
642# CONFIG_CHR_DEV_SCH is not set
605 643
606# 644#
607# Multi-device support (RAID and LVM) 645# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
608# 646#
609# CONFIG_MD is not set 647# CONFIG_SCSI_MULTI_LUN is not set
648# CONFIG_SCSI_CONSTANTS is not set
649# CONFIG_SCSI_LOGGING is not set
650# CONFIG_SCSI_SCAN_ASYNC is not set
651CONFIG_SCSI_WAIT_SCAN=m
610 652
611# 653#
612# Fusion MPT device support 654# SCSI Transports
613# 655#
614# CONFIG_FUSION is not set 656# CONFIG_SCSI_SPI_ATTRS is not set
657# CONFIG_SCSI_FC_ATTRS is not set
658# CONFIG_SCSI_ISCSI_ATTRS is not set
659# CONFIG_SCSI_SAS_ATTRS is not set
660# CONFIG_SCSI_SAS_LIBSAS is not set
615 661
616# 662#
617# IEEE 1394 (FireWire) support 663# SCSI low-level drivers
618# 664#
665# CONFIG_ISCSI_TCP is not set
666# CONFIG_SCSI_DEBUG is not set
667CONFIG_ATA=y
668# CONFIG_ATA_NONSTANDARD is not set
669# CONFIG_PATA_PLATFORM is not set
670CONFIG_PATA_BF54X=y
671CONFIG_PATA_BF54X_DMA=y
619 672
620# 673#
621# I2O device support 674# Multi-device support (RAID and LVM)
622# 675#
676# CONFIG_MD is not set
623 677
624# 678#
625# Network device support 679# Network device support
@@ -629,10 +683,6 @@ CONFIG_NETDEVICES=y
629# CONFIG_BONDING is not set 683# CONFIG_BONDING is not set
630# CONFIG_EQUALIZER is not set 684# CONFIG_EQUALIZER is not set
631# CONFIG_TUN is not set 685# CONFIG_TUN is not set
632
633#
634# PHY device support
635#
636# CONFIG_PHYLIB is not set 686# CONFIG_PHYLIB is not set
637 687
638# 688#
@@ -641,28 +691,16 @@ CONFIG_NETDEVICES=y
641CONFIG_NET_ETHERNET=y 691CONFIG_NET_ETHERNET=y
642CONFIG_MII=y 692CONFIG_MII=y
643# CONFIG_SMC91X is not set 693# CONFIG_SMC91X is not set
644# CONFIG_SMSC911X is not set 694CONFIG_SMSC911X=y
645 695# CONFIG_DM9000 is not set
646# 696CONFIG_NETDEV_1000=y
647# Ethernet (1000 Mbit) 697CONFIG_NETDEV_10000=y
648#
649
650#
651# Ethernet (10000 Mbit)
652#
653 698
654# 699#
655# Token Ring devices 700# Wireless LAN
656#
657
658#
659# Wireless LAN (non-hamradio)
660#
661# CONFIG_NET_RADIO is not set
662
663#
664# Wan interfaces
665# 701#
702# CONFIG_WLAN_PRE80211 is not set
703# CONFIG_WLAN_80211 is not set
666# CONFIG_WAN is not set 704# CONFIG_WAN is not set
667# CONFIG_PPP is not set 705# CONFIG_PPP is not set
668# CONFIG_SLIP is not set 706# CONFIG_SLIP is not set
@@ -686,6 +724,7 @@ CONFIG_MII=y
686# 724#
687CONFIG_INPUT=y 725CONFIG_INPUT=y
688# CONFIG_INPUT_FF_MEMLESS is not set 726# CONFIG_INPUT_FF_MEMLESS is not set
727# CONFIG_INPUT_POLLDEV is not set
689 728
690# 729#
691# Userland interfaces 730# Userland interfaces
@@ -702,10 +741,17 @@ CONFIG_INPUT=y
702# CONFIG_INPUT_KEYBOARD is not set 741# CONFIG_INPUT_KEYBOARD is not set
703# CONFIG_INPUT_MOUSE is not set 742# CONFIG_INPUT_MOUSE is not set
704# CONFIG_INPUT_JOYSTICK is not set 743# CONFIG_INPUT_JOYSTICK is not set
744# CONFIG_INPUT_TABLET is not set
705# CONFIG_INPUT_TOUCHSCREEN is not set 745# CONFIG_INPUT_TOUCHSCREEN is not set
706CONFIG_INPUT_MISC=y 746CONFIG_INPUT_MISC=y
747# CONFIG_INPUT_ATI_REMOTE is not set
748# CONFIG_INPUT_ATI_REMOTE2 is not set
749# CONFIG_INPUT_KEYSPAN_REMOTE is not set
750# CONFIG_INPUT_POWERMATE is not set
751# CONFIG_INPUT_YEALINK is not set
707# CONFIG_INPUT_UINPUT is not set 752# CONFIG_INPUT_UINPUT is not set
708# CONFIG_BF53X_PFBUTTONS is not set 753# CONFIG_BF53X_PFBUTTONS is not set
754# CONFIG_TWI_KEYPAD is not set
709 755
710# 756#
711# Hardware I/O ports 757# Hardware I/O ports
@@ -718,12 +764,15 @@ CONFIG_INPUT_MISC=y
718# 764#
719# CONFIG_AD9960 is not set 765# CONFIG_AD9960 is not set
720# CONFIG_SPI_ADC_BF533 is not set 766# CONFIG_SPI_ADC_BF533 is not set
721# CONFIG_BF5xx_PFLAGS is not set 767# CONFIG_BFIN_PFLAGS is not set
722# CONFIG_BF5xx_PPIFCD is not set 768# CONFIG_BF5xx_PPIFCD is not set
723# CONFIG_BF5xx_TIMERS is not set 769# CONFIG_BF5xx_TIMERS is not set
724# CONFIG_BF5xx_PPI is not set 770# CONFIG_BF5xx_PPI is not set
725# CONFIG_BFIN_SPORT is not set 771# CONFIG_BFIN_SPORT is not set
726# CONFIG_BFIN_TIMER_LATENCY is not set 772# CONFIG_BFIN_TIMER_LATENCY is not set
773# CONFIG_TWI_LCD is not set
774# CONFIG_AD5304 is not set
775# CONFIG_BF5xx_TEA5764 is not set
727# CONFIG_BF5xx_FBDMA is not set 776# CONFIG_BF5xx_FBDMA is not set
728# CONFIG_VT is not set 777# CONFIG_VT is not set
729# CONFIG_SERIAL_NONSTANDARD is not set 778# CONFIG_SERIAL_NONSTANDARD is not set
@@ -760,14 +809,9 @@ CONFIG_UNIX98_PTYS=y
760# IPMI 809# IPMI
761# 810#
762# CONFIG_IPMI_HANDLER is not set 811# CONFIG_IPMI_HANDLER is not set
763
764#
765# Watchdog Cards
766#
767# CONFIG_WATCHDOG is not set 812# CONFIG_WATCHDOG is not set
768CONFIG_HW_RANDOM=y 813CONFIG_HW_RANDOM=y
769# CONFIG_GEN_RTC is not set 814# CONFIG_GEN_RTC is not set
770# CONFIG_DTLK is not set
771# CONFIG_R3964 is not set 815# CONFIG_R3964 is not set
772# CONFIG_RAW_DRIVER is not set 816# CONFIG_RAW_DRIVER is not set
773 817
@@ -775,32 +819,114 @@ CONFIG_HW_RANDOM=y
775# TPM devices 819# TPM devices
776# 820#
777# CONFIG_TCG_TPM is not set 821# CONFIG_TCG_TPM is not set
822CONFIG_I2C=y
823CONFIG_I2C_BOARDINFO=y
824CONFIG_I2C_CHARDEV=y
825
826#
827# I2C Algorithms
828#
829# CONFIG_I2C_ALGOBIT is not set
830# CONFIG_I2C_ALGOPCF is not set
831# CONFIG_I2C_ALGOPCA is not set
778 832
779# 833#
780# I2C support 834# I2C Hardware Bus support
781# 835#
782# CONFIG_I2C is not set 836# CONFIG_I2C_BLACKFIN_GPIO is not set
837CONFIG_I2C_BLACKFIN_TWI=y
838CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50
839# CONFIG_I2C_GPIO is not set
840# CONFIG_I2C_OCORES is not set
841# CONFIG_I2C_PARPORT_LIGHT is not set
842# CONFIG_I2C_SIMTEC is not set
843# CONFIG_I2C_STUB is not set
844
845#
846# Miscellaneous I2C Chip support
847#
848# CONFIG_SENSORS_DS1337 is not set
849# CONFIG_SENSORS_DS1374 is not set
850# CONFIG_SENSORS_AD5252 is not set
851# CONFIG_SENSORS_EEPROM is not set
852# CONFIG_SENSORS_PCF8574 is not set
853# CONFIG_SENSORS_PCF8575 is not set
854# CONFIG_SENSORS_PCA9543 is not set
855# CONFIG_SENSORS_PCA9539 is not set
856# CONFIG_SENSORS_PCF8591 is not set
857# CONFIG_SENSORS_MAX6875 is not set
858# CONFIG_I2C_DEBUG_CORE is not set
859# CONFIG_I2C_DEBUG_ALGO is not set
860# CONFIG_I2C_DEBUG_BUS is not set
861# CONFIG_I2C_DEBUG_CHIP is not set
783 862
784# 863#
785# SPI support 864# SPI support
786# 865#
787# CONFIG_SPI is not set 866CONFIG_SPI=y
788# CONFIG_SPI_MASTER is not set 867CONFIG_SPI_MASTER=y
789 868
790# 869#
791# Dallas's 1-wire bus 870# SPI Master Controller Drivers
792# 871#
793# CONFIG_W1 is not set 872CONFIG_SPI_BFIN=y
873# CONFIG_SPI_BITBANG is not set
874
875#
876# SPI Protocol Masters
877#
878# CONFIG_SPI_AT25 is not set
879# CONFIG_SPI_SPIDEV is not set
794 880
795# 881#
796# Hardware Monitoring support 882# Dallas's 1-wire bus
797# 883#
884# CONFIG_W1 is not set
798CONFIG_HWMON=y 885CONFIG_HWMON=y
799# CONFIG_HWMON_VID is not set 886# CONFIG_HWMON_VID is not set
800# CONFIG_SENSORS_ABITUGURU is not set 887# CONFIG_SENSORS_ABITUGURU is not set
888# CONFIG_SENSORS_AD7418 is not set
889# CONFIG_SENSORS_ADM1021 is not set
890# CONFIG_SENSORS_ADM1025 is not set
891# CONFIG_SENSORS_ADM1026 is not set
892# CONFIG_SENSORS_ADM1029 is not set
893# CONFIG_SENSORS_ADM1031 is not set
894# CONFIG_SENSORS_ADM9240 is not set
895# CONFIG_SENSORS_ASB100 is not set
896# CONFIG_SENSORS_ATXP1 is not set
897# CONFIG_SENSORS_DS1621 is not set
801# CONFIG_SENSORS_F71805F is not set 898# CONFIG_SENSORS_F71805F is not set
899# CONFIG_SENSORS_FSCHER is not set
900# CONFIG_SENSORS_FSCPOS is not set
901# CONFIG_SENSORS_GL518SM is not set
902# CONFIG_SENSORS_GL520SM is not set
903# CONFIG_SENSORS_IT87 is not set
904# CONFIG_SENSORS_LM63 is not set
905# CONFIG_SENSORS_LM70 is not set
906# CONFIG_SENSORS_LM75 is not set
907# CONFIG_SENSORS_LM77 is not set
908# CONFIG_SENSORS_LM78 is not set
909# CONFIG_SENSORS_LM80 is not set
910# CONFIG_SENSORS_LM83 is not set
911# CONFIG_SENSORS_LM85 is not set
912# CONFIG_SENSORS_LM87 is not set
913# CONFIG_SENSORS_LM90 is not set
914# CONFIG_SENSORS_LM92 is not set
915# CONFIG_SENSORS_MAX1619 is not set
916# CONFIG_SENSORS_MAX6650 is not set
917# CONFIG_SENSORS_PC87360 is not set
802# CONFIG_SENSORS_PC87427 is not set 918# CONFIG_SENSORS_PC87427 is not set
919# CONFIG_SENSORS_SMSC47M1 is not set
920# CONFIG_SENSORS_SMSC47M192 is not set
921# CONFIG_SENSORS_SMSC47B397 is not set
803# CONFIG_SENSORS_VT1211 is not set 922# CONFIG_SENSORS_VT1211 is not set
923# CONFIG_SENSORS_W83781D is not set
924# CONFIG_SENSORS_W83791D is not set
925# CONFIG_SENSORS_W83792D is not set
926# CONFIG_SENSORS_W83793 is not set
927# CONFIG_SENSORS_W83L785TS is not set
928# CONFIG_SENSORS_W83627HF is not set
929# CONFIG_SENSORS_W83627EHF is not set
804# CONFIG_HWMON_DEBUG_CHIP is not set 930# CONFIG_HWMON_DEBUG_CHIP is not set
805 931
806# 932#
@@ -812,16 +938,19 @@ CONFIG_HWMON=y
812# Multimedia devices 938# Multimedia devices
813# 939#
814# CONFIG_VIDEO_DEV is not set 940# CONFIG_VIDEO_DEV is not set
941# CONFIG_DVB_CORE is not set
942CONFIG_DAB=y
815 943
816# 944#
817# Digital Video Broadcasting Devices 945# Graphics support
818# 946#
819# CONFIG_DVB is not set 947# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
820 948
821# 949#
822# Graphics support 950# Display device support
823# 951#
824# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 952# CONFIG_DISPLAY_SUPPORT is not set
953# CONFIG_VGASTATE is not set
825# CONFIG_FB is not set 954# CONFIG_FB is not set
826 955
827# 956#
@@ -844,6 +973,10 @@ CONFIG_USB_ARCH_HAS_HCD=y
844# CONFIG_USB is not set 973# CONFIG_USB is not set
845 974
846# 975#
976# Enable Host or Gadget support to see Inventra options
977#
978
979#
847# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 980# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
848# 981#
849 982
@@ -851,11 +984,20 @@ CONFIG_USB_ARCH_HAS_HCD=y
851# USB Gadget Support 984# USB Gadget Support
852# 985#
853# CONFIG_USB_GADGET is not set 986# CONFIG_USB_GADGET is not set
987CONFIG_MMC=m
988# CONFIG_MMC_DEBUG is not set
989# CONFIG_MMC_UNSAFE_RESUME is not set
990
991#
992# MMC/SD Card Drivers
993#
994CONFIG_MMC_BLOCK=m
854 995
855# 996#
856# MMC/SD Card support 997# MMC/SD Host Controller Drivers
857# 998#
858# CONFIG_MMC is not set 999CONFIG_SDH_BFIN=m
1000# CONFIG_SPI_MMC is not set
859 1001
860# 1002#
861# LED devices 1003# LED devices
@@ -894,15 +1036,37 @@ CONFIG_RTC_INTF_SYSFS=y
894CONFIG_RTC_INTF_PROC=y 1036CONFIG_RTC_INTF_PROC=y
895CONFIG_RTC_INTF_DEV=y 1037CONFIG_RTC_INTF_DEV=y
896# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set 1038# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1039# CONFIG_RTC_DRV_TEST is not set
897 1040
898# 1041#
899# RTC drivers 1042# I2C RTC drivers
1043#
1044# CONFIG_RTC_DRV_DS1307 is not set
1045# CONFIG_RTC_DRV_DS1672 is not set
1046# CONFIG_RTC_DRV_MAX6900 is not set
1047# CONFIG_RTC_DRV_RS5C372 is not set
1048# CONFIG_RTC_DRV_ISL1208 is not set
1049# CONFIG_RTC_DRV_X1205 is not set
1050# CONFIG_RTC_DRV_PCF8563 is not set
1051# CONFIG_RTC_DRV_PCF8583 is not set
1052
1053#
1054# SPI RTC drivers
1055#
1056# CONFIG_RTC_DRV_RS5C348 is not set
1057# CONFIG_RTC_DRV_MAX6902 is not set
1058
1059#
1060# Platform RTC drivers
900# 1061#
901# CONFIG_RTC_DRV_DS1553 is not set 1062# CONFIG_RTC_DRV_DS1553 is not set
902# CONFIG_RTC_DRV_DS1742 is not set 1063# CONFIG_RTC_DRV_DS1742 is not set
903# CONFIG_RTC_DRV_M48T86 is not set 1064# CONFIG_RTC_DRV_M48T86 is not set
904# CONFIG_RTC_DRV_TEST is not set
905# CONFIG_RTC_DRV_V3020 is not set 1065# CONFIG_RTC_DRV_V3020 is not set
1066
1067#
1068# on-CPU RTC drivers
1069#
906CONFIG_RTC_DRV_BFIN=y 1070CONFIG_RTC_DRV_BFIN=y
907 1071
908# 1072#
@@ -919,14 +1083,6 @@ CONFIG_RTC_DRV_BFIN=y
919# 1083#
920 1084
921# 1085#
922# Auxiliary Display support
923#
924
925#
926# Virtualization
927#
928
929#
930# PBX support 1086# PBX support
931# 1087#
932# CONFIG_PBX is not set 1088# CONFIG_PBX is not set
@@ -991,8 +1147,25 @@ CONFIG_RAMFS=y
991# CONFIG_BEFS_FS is not set 1147# CONFIG_BEFS_FS is not set
992# CONFIG_BFS_FS is not set 1148# CONFIG_BFS_FS is not set
993# CONFIG_EFS_FS is not set 1149# CONFIG_EFS_FS is not set
994# CONFIG_YAFFS_FS is not set 1150CONFIG_YAFFS_FS=m
995# CONFIG_JFFS2_FS is not set 1151CONFIG_YAFFS_YAFFS1=y
1152# CONFIG_YAFFS_DOES_ECC is not set
1153CONFIG_YAFFS_YAFFS2=y
1154CONFIG_YAFFS_AUTO_YAFFS2=y
1155# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1156CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
1157# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1158# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1159CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1160CONFIG_JFFS2_FS=m
1161CONFIG_JFFS2_FS_DEBUG=0
1162CONFIG_JFFS2_FS_WRITEBUFFER=y
1163# CONFIG_JFFS2_SUMMARY is not set
1164# CONFIG_JFFS2_FS_XATTR is not set
1165# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1166CONFIG_JFFS2_ZLIB=y
1167CONFIG_JFFS2_RTIME=y
1168# CONFIG_JFFS2_RUBIN is not set
996# CONFIG_CRAMFS is not set 1169# CONFIG_CRAMFS is not set
997# CONFIG_VXFS_FS is not set 1170# CONFIG_VXFS_FS is not set
998# CONFIG_HPFS_FS is not set 1171# CONFIG_HPFS_FS is not set
@@ -1040,36 +1213,20 @@ CONFIG_MSDOS_PARTITION=y
1040CONFIG_ENABLE_MUST_CHECK=y 1213CONFIG_ENABLE_MUST_CHECK=y
1041CONFIG_MAGIC_SYSRQ=y 1214CONFIG_MAGIC_SYSRQ=y
1042# CONFIG_UNUSED_SYMBOLS is not set 1215# CONFIG_UNUSED_SYMBOLS is not set
1043# CONFIG_DEBUG_FS is not set 1216CONFIG_DEBUG_FS=y
1044# CONFIG_HEADERS_CHECK is not set 1217# CONFIG_HEADERS_CHECK is not set
1045CONFIG_DEBUG_KERNEL=y 1218# CONFIG_DEBUG_KERNEL is not set
1046# CONFIG_DEBUG_SHIRQ is not set
1047CONFIG_LOG_BUF_SHIFT=14
1048CONFIG_DETECT_SOFTLOCKUP=y
1049# CONFIG_SCHEDSTATS is not set
1050# CONFIG_TIMER_STATS is not set
1051# CONFIG_DEBUG_SLAB is not set
1052# CONFIG_DEBUG_RT_MUTEXES is not set
1053# CONFIG_RT_MUTEX_TESTER is not set
1054# CONFIG_DEBUG_SPINLOCK is not set
1055# CONFIG_DEBUG_MUTEXES is not set
1056# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1057# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1058# CONFIG_DEBUG_KOBJECT is not set
1059# CONFIG_DEBUG_BUGVERBOSE is not set 1219# CONFIG_DEBUG_BUGVERBOSE is not set
1060CONFIG_DEBUG_INFO=y 1220CONFIG_DEBUG_MMRS=y
1061# CONFIG_DEBUG_VM is not set
1062# CONFIG_DEBUG_LIST is not set
1063CONFIG_FRAME_POINTER=y
1064CONFIG_FORCED_INLINING=y
1065# CONFIG_RCU_TORTURE_TEST is not set
1066# CONFIG_FAULT_INJECTION is not set
1067CONFIG_DEBUG_HWERR=y
1068# CONFIG_DEBUG_ICACHE_CHECK is not set
1069# CONFIG_DEBUG_KERNEL_START is not set
1070# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set
1071CONFIG_DEBUG_HUNT_FOR_ZERO=y 1221CONFIG_DEBUG_HUNT_FOR_ZERO=y
1222CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1223CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
1224# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
1225# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1226CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
1227# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1072# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1228# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1229CONFIG_EARLY_PRINTK=y
1073CONFIG_CPLB_INFO=y 1230CONFIG_CPLB_INFO=y
1074CONFIG_ACCESS_CHECK=y 1231CONFIG_ACCESS_CHECK=y
1075 1232
@@ -1092,9 +1249,12 @@ CONFIG_SECURITY_CAPABILITIES=y
1092CONFIG_BITREVERSE=y 1249CONFIG_BITREVERSE=y
1093# CONFIG_CRC_CCITT is not set 1250# CONFIG_CRC_CCITT is not set
1094# CONFIG_CRC16 is not set 1251# CONFIG_CRC16 is not set
1252# CONFIG_CRC_ITU_T is not set
1095CONFIG_CRC32=y 1253CONFIG_CRC32=y
1096# CONFIG_LIBCRC32C is not set 1254# CONFIG_LIBCRC32C is not set
1097CONFIG_ZLIB_INFLATE=y 1255CONFIG_ZLIB_INFLATE=y
1256CONFIG_ZLIB_DEFLATE=m
1098CONFIG_PLIST=y 1257CONFIG_PLIST=y
1099CONFIG_HAS_IOMEM=y 1258CONFIG_HAS_IOMEM=y
1100CONFIG_HAS_IOPORT=y 1259CONFIG_HAS_IOPORT=y
1260CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF561-EZKIT_defconfig b/arch/blackfin/configs/BF561-EZKIT_defconfig
index 51c0b6f97798..85e647f87759 100644
--- a/arch/blackfin/configs/BF561-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF561-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21.5 3# Linux kernel version: 2.6.22.6
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -15,8 +15,9 @@ CONFIG_GENERIC_HWEIGHT=y
15CONFIG_GENERIC_HARDIRQS=y 15CONFIG_GENERIC_HARDIRQS=y
16CONFIG_GENERIC_IRQ_PROBE=y 16CONFIG_GENERIC_IRQ_PROBE=y
17# CONFIG_GENERIC_TIME is not set 17# CONFIG_GENERIC_TIME is not set
18CONFIG_GENERIC_CALIBRATE_DELAY=y 18CONFIG_GENERIC_GPIO=y
19CONFIG_FORCE_MAX_ZONEORDER=14 19CONFIG_FORCE_MAX_ZONEORDER=14
20CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_IRQCHIP_DEMUX_GPIO=y 21CONFIG_IRQCHIP_DEMUX_GPIO=y
21CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
22 23
@@ -40,7 +41,9 @@ CONFIG_SYSVIPC_SYSCTL=y
40# CONFIG_TASKSTATS is not set 41# CONFIG_TASKSTATS is not set
41# CONFIG_UTS_NS is not set 42# CONFIG_UTS_NS is not set
42# CONFIG_AUDIT is not set 43# CONFIG_AUDIT is not set
43# CONFIG_IKCONFIG is not set 44CONFIG_IKCONFIG=y
45CONFIG_IKCONFIG_PROC=y
46CONFIG_LOG_BUF_SHIFT=14
44CONFIG_SYSFS_DEPRECATED=y 47CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 48# CONFIG_RELAY is not set
46CONFIG_BLK_DEV_INITRD=y 49CONFIG_BLK_DEV_INITRD=y
@@ -58,15 +61,20 @@ CONFIG_BUG=y
58CONFIG_ELF_CORE=y 61CONFIG_ELF_CORE=y
59CONFIG_BASE_FULL=y 62CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 63CONFIG_FUTEX=y
64CONFIG_ANON_INODES=y
65CONFIG_EPOLL=y
66CONFIG_SIGNALFD=y
67CONFIG_TIMERFD=y
68CONFIG_EVENTFD=y
69CONFIG_VM_EVENT_COUNTERS=y
61CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3 70CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=3
62CONFIG_BUDDY=y
63# CONFIG_NP2 is not set 71# CONFIG_NP2 is not set
64CONFIG_SLAB=y 72CONFIG_SLAB=y
65CONFIG_VM_EVENT_COUNTERS=y 73# CONFIG_SLUB is not set
74# CONFIG_SLOB is not set
66CONFIG_RT_MUTEXES=y 75CONFIG_RT_MUTEXES=y
67CONFIG_TINY_SHMEM=y 76CONFIG_TINY_SHMEM=y
68CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
69# CONFIG_SLOB is not set
70 78
71# 79#
72# Loadable module support 80# Loadable module support
@@ -229,19 +237,17 @@ CONFIG_IRQ_WDTIMER=13
229# CONFIG_CMDLINE_BOOL is not set 237# CONFIG_CMDLINE_BOOL is not set
230 238
231# 239#
232# Board Setup 240# Clock/PLL Setup
233# 241#
234CONFIG_CLKIN_HZ=30000000 242CONFIG_CLKIN_HZ=30000000
235CONFIG_MEM_SIZE=64 243# CONFIG_BFIN_KERNEL_CLOCK is not set
236CONFIG_MEM_ADD_WIDTH=9 244CONFIG_MAX_VCO_HZ=600000000
237CONFIG_BOOT_LOAD=0x1000 245CONFIG_MIN_VCO_HZ=50000000
238 246CONFIG_MAX_SCLK_HZ=133000000
239# 247CONFIG_MIN_SCLK_HZ=27000000
240# Blackfin Kernel Optimizations
241#
242 248
243# 249#
244# Timer Tick 250# Kernel Timer/Scheduler
245# 251#
246# CONFIG_HZ_100 is not set 252# CONFIG_HZ_100 is not set
247CONFIG_HZ_250=y 253CONFIG_HZ_250=y
@@ -250,6 +256,20 @@ CONFIG_HZ_250=y
250CONFIG_HZ=250 256CONFIG_HZ=250
251 257
252# 258#
259# Memory Setup
260#
261CONFIG_MEM_SIZE=64
262CONFIG_MEM_ADD_WIDTH=9
263CONFIG_BOOT_LOAD=0x1000
264CONFIG_BFIN_SCRATCH_REG_RETN=y
265# CONFIG_BFIN_SCRATCH_REG_RETE is not set
266# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
267
268#
269# Blackfin Kernel Optimizations
270#
271
272#
253# Memory Optimizations 273# Memory Optimizations
254# 274#
255CONFIG_I_ENTRY_L1=y 275CONFIG_I_ENTRY_L1=y
@@ -288,20 +308,15 @@ CONFIG_DMA_UNCACHED_1M=y
288# 308#
289# Cache Support 309# Cache Support
290# 310#
291CONFIG_BLKFIN_CACHE=y 311CONFIG_BFIN_ICACHE=y
292CONFIG_BLKFIN_DCACHE=y 312CONFIG_BFIN_DCACHE=y
293# CONFIG_BLKFIN_DCACHE_BANKA is not set 313# CONFIG_BFIN_DCACHE_BANKA is not set
294# CONFIG_BLKFIN_CACHE_LOCK is not set 314# CONFIG_BFIN_ICACHE_LOCK is not set
295# CONFIG_BLKFIN_WB is not set 315# CONFIG_BFIN_WB is not set
296CONFIG_BLKFIN_WT=y 316CONFIG_BFIN_WT=y
297CONFIG_L1_MAX_PIECE=16 317CONFIG_L1_MAX_PIECE=16
298 318
299# 319#
300# Clock Settings
301#
302# CONFIG_BFIN_KERNEL_CLOCK is not set
303
304#
305# Asynchonous Memory Configuration 320# Asynchonous Memory Configuration
306# 321#
307 322
@@ -326,12 +341,13 @@ CONFIG_C_AMBEN_ALL=y
326CONFIG_BANK_0=0x7BB0 341CONFIG_BANK_0=0x7BB0
327CONFIG_BANK_1=0x7BB0 342CONFIG_BANK_1=0x7BB0
328CONFIG_BANK_2=0x7BB0 343CONFIG_BANK_2=0x7BB0
329CONFIG_BANK_3=0x99B3 344CONFIG_BANK_3=0xAAC3
330 345
331# 346#
332# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 347# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
333# 348#
334# CONFIG_PCI is not set 349# CONFIG_PCI is not set
350# CONFIG_ARCH_SUPPORTS_MSI is not set
335 351
336# 352#
337# PCCARD (PCMCIA/CardBus) support 353# PCCARD (PCMCIA/CardBus) support
@@ -339,10 +355,6 @@ CONFIG_BANK_3=0x99B3
339# CONFIG_PCCARD is not set 355# CONFIG_PCCARD is not set
340 356
341# 357#
342# PCI Hotplug Support
343#
344
345#
346# Executable file formats 358# Executable file formats
347# 359#
348CONFIG_BINFMT_ELF_FDPIC=y 360CONFIG_BINFMT_ELF_FDPIC=y
@@ -364,7 +376,6 @@ CONFIG_NET=y
364# 376#
365# Networking options 377# Networking options
366# 378#
367# CONFIG_NETDEBUG is not set
368CONFIG_PACKET=y 379CONFIG_PACKET=y
369# CONFIG_PACKET_MMAP is not set 380# CONFIG_PACKET_MMAP is not set
370CONFIG_UNIX=y 381CONFIG_UNIX=y
@@ -405,20 +416,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
405# CONFIG_NETLABEL is not set 416# CONFIG_NETLABEL is not set
406# CONFIG_NETWORK_SECMARK is not set 417# CONFIG_NETWORK_SECMARK is not set
407# CONFIG_NETFILTER is not set 418# CONFIG_NETFILTER is not set
408
409#
410# DCCP Configuration (EXPERIMENTAL)
411#
412# CONFIG_IP_DCCP is not set 419# CONFIG_IP_DCCP is not set
413
414#
415# SCTP Configuration (EXPERIMENTAL)
416#
417# CONFIG_IP_SCTP is not set 420# CONFIG_IP_SCTP is not set
418
419#
420# TIPC Configuration (EXPERIMENTAL)
421#
422# CONFIG_TIPC is not set 421# CONFIG_TIPC is not set
423# CONFIG_ATM is not set 422# CONFIG_ATM is not set
424# CONFIG_BRIDGE is not set 423# CONFIG_BRIDGE is not set
@@ -485,7 +484,16 @@ CONFIG_IRTTY_SIR=m
485# FIR device drivers 484# FIR device drivers
486# 485#
487# CONFIG_BT is not set 486# CONFIG_BT is not set
487# CONFIG_AF_RXRPC is not set
488
489#
490# Wireless
491#
492# CONFIG_CFG80211 is not set
493# CONFIG_WIRELESS_EXT is not set
494# CONFIG_MAC80211 is not set
488# CONFIG_IEEE80211 is not set 495# CONFIG_IEEE80211 is not set
496# CONFIG_RFKILL is not set
489 497
490# 498#
491# Device Drivers 499# Device Drivers
@@ -503,10 +511,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
503# Connector - unified userspace <-> kernelspace linker 511# Connector - unified userspace <-> kernelspace linker
504# 512#
505# CONFIG_CONNECTOR is not set 513# CONFIG_CONNECTOR is not set
506
507#
508# Memory Technology Devices (MTD)
509#
510CONFIG_MTD=y 514CONFIG_MTD=y
511# CONFIG_MTD_DEBUG is not set 515# CONFIG_MTD_DEBUG is not set
512# CONFIG_MTD_CONCAT is not set 516# CONFIG_MTD_CONCAT is not set
@@ -550,7 +554,6 @@ CONFIG_MTD_MW320D=m
550CONFIG_MTD_RAM=y 554CONFIG_MTD_RAM=y
551CONFIG_MTD_ROM=m 555CONFIG_MTD_ROM=m
552# CONFIG_MTD_ABSENT is not set 556# CONFIG_MTD_ABSENT is not set
553# CONFIG_MTD_OBSOLETE_CHIPS is not set
554 557
555# 558#
556# Mapping drivers for chip access 559# Mapping drivers for chip access
@@ -588,16 +591,13 @@ CONFIG_BFIN_FLASH_BANK_3=0x7BB0
588# CONFIG_MTD_DOC2000 is not set 591# CONFIG_MTD_DOC2000 is not set
589# CONFIG_MTD_DOC2001 is not set 592# CONFIG_MTD_DOC2001 is not set
590# CONFIG_MTD_DOC2001PLUS is not set 593# CONFIG_MTD_DOC2001PLUS is not set
591
592#
593# NAND Flash Device Drivers
594#
595# CONFIG_MTD_NAND is not set 594# CONFIG_MTD_NAND is not set
595# CONFIG_MTD_ONENAND is not set
596 596
597# 597#
598# OneNAND Flash Device Drivers 598# UBI - Unsorted block images
599# 599#
600# CONFIG_MTD_ONENAND is not set 600# CONFIG_MTD_UBI is not set
601 601
602# 602#
603# Parallel port support 603# Parallel port support
@@ -625,10 +625,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
625# 625#
626# Misc devices 626# Misc devices
627# 627#
628
629#
630# ATA/ATAPI/MFM/RLL support
631#
632# CONFIG_IDE is not set 628# CONFIG_IDE is not set
633 629
634# 630#
@@ -637,10 +633,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
637# CONFIG_RAID_ATTRS is not set 633# CONFIG_RAID_ATTRS is not set
638# CONFIG_SCSI is not set 634# CONFIG_SCSI is not set
639# CONFIG_SCSI_NETLINK is not set 635# CONFIG_SCSI_NETLINK is not set
640
641#
642# Serial ATA (prod) and Parallel ATA (experimental) drivers
643#
644# CONFIG_ATA is not set 636# CONFIG_ATA is not set
645 637
646# 638#
@@ -649,19 +641,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
649# CONFIG_MD is not set 641# CONFIG_MD is not set
650 642
651# 643#
652# Fusion MPT device support
653#
654# CONFIG_FUSION is not set
655
656#
657# IEEE 1394 (FireWire) support
658#
659
660#
661# I2O device support
662#
663
664#
665# Network device support 644# Network device support
666# 645#
667CONFIG_NETDEVICES=y 646CONFIG_NETDEVICES=y
@@ -669,10 +648,6 @@ CONFIG_NETDEVICES=y
669# CONFIG_BONDING is not set 648# CONFIG_BONDING is not set
670# CONFIG_EQUALIZER is not set 649# CONFIG_EQUALIZER is not set
671# CONFIG_TUN is not set 650# CONFIG_TUN is not set
672
673#
674# PHY device support
675#
676# CONFIG_PHYLIB is not set 651# CONFIG_PHYLIB is not set
677 652
678# 653#
@@ -682,27 +657,15 @@ CONFIG_NET_ETHERNET=y
682CONFIG_MII=y 657CONFIG_MII=y
683CONFIG_SMC91X=y 658CONFIG_SMC91X=y
684# CONFIG_SMSC911X is not set 659# CONFIG_SMSC911X is not set
660# CONFIG_DM9000 is not set
661CONFIG_NETDEV_1000=y
662CONFIG_NETDEV_10000=y
685 663
686# 664#
687# Ethernet (1000 Mbit) 665# Wireless LAN
688#
689
690#
691# Ethernet (10000 Mbit)
692#
693
694#
695# Token Ring devices
696#
697
698#
699# Wireless LAN (non-hamradio)
700#
701# CONFIG_NET_RADIO is not set
702
703#
704# Wan interfaces
705# 666#
667# CONFIG_WLAN_PRE80211 is not set
668# CONFIG_WLAN_80211 is not set
706# CONFIG_WAN is not set 669# CONFIG_WAN is not set
707# CONFIG_PPP is not set 670# CONFIG_PPP is not set
708# CONFIG_SLIP is not set 671# CONFIG_SLIP is not set
@@ -726,6 +689,7 @@ CONFIG_SMC91X=y
726# 689#
727CONFIG_INPUT=m 690CONFIG_INPUT=m
728# CONFIG_INPUT_FF_MEMLESS is not set 691# CONFIG_INPUT_FF_MEMLESS is not set
692# CONFIG_INPUT_POLLDEV is not set
729 693
730# 694#
731# Userland interfaces 695# Userland interfaces
@@ -742,6 +706,7 @@ CONFIG_INPUT_EVDEV=m
742# CONFIG_INPUT_KEYBOARD is not set 706# CONFIG_INPUT_KEYBOARD is not set
743# CONFIG_INPUT_MOUSE is not set 707# CONFIG_INPUT_MOUSE is not set
744# CONFIG_INPUT_JOYSTICK is not set 708# CONFIG_INPUT_JOYSTICK is not set
709# CONFIG_INPUT_TABLET is not set
745# CONFIG_INPUT_TOUCHSCREEN is not set 710# CONFIG_INPUT_TOUCHSCREEN is not set
746# CONFIG_INPUT_MISC is not set 711# CONFIG_INPUT_MISC is not set
747 712
@@ -756,7 +721,7 @@ CONFIG_INPUT_EVDEV=m
756# 721#
757# CONFIG_AD9960 is not set 722# CONFIG_AD9960 is not set
758# CONFIG_SPI_ADC_BF533 is not set 723# CONFIG_SPI_ADC_BF533 is not set
759# CONFIG_BF5xx_PFLAGS is not set 724# CONFIG_BFIN_PFLAGS is not set
760# CONFIG_BF5xx_PPIFCD is not set 725# CONFIG_BF5xx_PPIFCD is not set
761# CONFIG_BF5xx_TIMERS is not set 726# CONFIG_BF5xx_TIMERS is not set
762# CONFIG_BF5xx_PPI is not set 727# CONFIG_BF5xx_PPI is not set
@@ -796,10 +761,6 @@ CONFIG_UNIX98_PTYS=y
796# IPMI 761# IPMI
797# 762#
798# CONFIG_IPMI_HANDLER is not set 763# CONFIG_IPMI_HANDLER is not set
799
800#
801# Watchdog Cards
802#
803CONFIG_WATCHDOG=y 764CONFIG_WATCHDOG=y
804# CONFIG_WATCHDOG_NOWAYOUT is not set 765# CONFIG_WATCHDOG_NOWAYOUT is not set
805 766
@@ -810,7 +771,6 @@ CONFIG_WATCHDOG=y
810CONFIG_BFIN_WDT=y 771CONFIG_BFIN_WDT=y
811CONFIG_HW_RANDOM=y 772CONFIG_HW_RANDOM=y
812# CONFIG_GEN_RTC is not set 773# CONFIG_GEN_RTC is not set
813# CONFIG_DTLK is not set
814# CONFIG_R3964 is not set 774# CONFIG_R3964 is not set
815# CONFIG_RAW_DRIVER is not set 775# CONFIG_RAW_DRIVER is not set
816 776
@@ -818,10 +778,6 @@ CONFIG_HW_RANDOM=y
818# TPM devices 778# TPM devices
819# 779#
820# CONFIG_TCG_TPM is not set 780# CONFIG_TCG_TPM is not set
821
822#
823# I2C support
824#
825# CONFIG_I2C is not set 781# CONFIG_I2C is not set
826 782
827# 783#
@@ -840,22 +796,22 @@ CONFIG_SPI_BFIN=y
840# SPI Protocol Masters 796# SPI Protocol Masters
841# 797#
842# CONFIG_SPI_AT25 is not set 798# CONFIG_SPI_AT25 is not set
799# CONFIG_SPI_SPIDEV is not set
843 800
844# 801#
845# Dallas's 1-wire bus 802# Dallas's 1-wire bus
846# 803#
847# CONFIG_W1 is not set 804# CONFIG_W1 is not set
848
849#
850# Hardware Monitoring support
851#
852CONFIG_HWMON=y 805CONFIG_HWMON=y
853# CONFIG_HWMON_VID is not set 806# CONFIG_HWMON_VID is not set
854# CONFIG_SENSORS_ABITUGURU is not set 807# CONFIG_SENSORS_ABITUGURU is not set
855# CONFIG_SENSORS_F71805F is not set 808# CONFIG_SENSORS_F71805F is not set
856# CONFIG_SENSORS_LM70 is not set 809# CONFIG_SENSORS_LM70 is not set
857# CONFIG_SENSORS_PC87427 is not set 810# CONFIG_SENSORS_PC87427 is not set
811# CONFIG_SENSORS_SMSC47M1 is not set
812# CONFIG_SENSORS_SMSC47B397 is not set
858# CONFIG_SENSORS_VT1211 is not set 813# CONFIG_SENSORS_VT1211 is not set
814# CONFIG_SENSORS_W83627HF is not set
859# CONFIG_HWMON_DEBUG_CHIP is not set 815# CONFIG_HWMON_DEBUG_CHIP is not set
860 816
861# 817#
@@ -867,16 +823,19 @@ CONFIG_HWMON=y
867# Multimedia devices 823# Multimedia devices
868# 824#
869# CONFIG_VIDEO_DEV is not set 825# CONFIG_VIDEO_DEV is not set
826# CONFIG_DVB_CORE is not set
827CONFIG_DAB=y
870 828
871# 829#
872# Digital Video Broadcasting Devices 830# Graphics support
873# 831#
874# CONFIG_DVB is not set 832# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
875 833
876# 834#
877# Graphics support 835# Display device support
878# 836#
879# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 837# CONFIG_DISPLAY_SUPPORT is not set
838# CONFIG_VGASTATE is not set
880# CONFIG_FB is not set 839# CONFIG_FB is not set
881 840
882# 841#
@@ -899,18 +858,17 @@ CONFIG_USB_ARCH_HAS_HCD=y
899# CONFIG_USB is not set 858# CONFIG_USB is not set
900 859
901# 860#
902# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 861# Enable Host or Gadget support to see Inventra options
903# 862#
904 863
905# 864#
906# USB Gadget Support 865# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
907# 866#
908# CONFIG_USB_GADGET is not set
909 867
910# 868#
911# MMC/SD Card support 869# USB Gadget Support
912# 870#
913# CONFIG_SPI_MMC is not set 871# CONFIG_USB_GADGET is not set
914# CONFIG_MMC is not set 872# CONFIG_MMC is not set
915 873
916# 874#
@@ -953,14 +911,6 @@ CONFIG_USB_ARCH_HAS_HCD=y
953# 911#
954 912
955# 913#
956# Auxiliary Display support
957#
958
959#
960# Virtualization
961#
962
963#
964# PBX support 914# PBX support
965# 915#
966# CONFIG_PBX is not set 916# CONFIG_PBX is not set
@@ -1060,6 +1010,7 @@ CONFIG_LOCKD=m
1060CONFIG_LOCKD_V4=y 1010CONFIG_LOCKD_V4=y
1061CONFIG_NFS_COMMON=y 1011CONFIG_NFS_COMMON=y
1062CONFIG_SUNRPC=m 1012CONFIG_SUNRPC=m
1013# CONFIG_SUNRPC_BIND34 is not set
1063# CONFIG_RPCSEC_GSS_KRB5 is not set 1014# CONFIG_RPCSEC_GSS_KRB5 is not set
1064# CONFIG_RPCSEC_GSS_SPKM3 is not set 1015# CONFIG_RPCSEC_GSS_SPKM3 is not set
1065CONFIG_SMB_FS=m 1016CONFIG_SMB_FS=m
@@ -1137,14 +1088,20 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1137CONFIG_ENABLE_MUST_CHECK=y 1088CONFIG_ENABLE_MUST_CHECK=y
1138# CONFIG_MAGIC_SYSRQ is not set 1089# CONFIG_MAGIC_SYSRQ is not set
1139# CONFIG_UNUSED_SYMBOLS is not set 1090# CONFIG_UNUSED_SYMBOLS is not set
1140# CONFIG_DEBUG_FS is not set 1091CONFIG_DEBUG_FS=y
1141# CONFIG_HEADERS_CHECK is not set 1092# CONFIG_HEADERS_CHECK is not set
1142# CONFIG_DEBUG_KERNEL is not set 1093# CONFIG_DEBUG_KERNEL is not set
1143CONFIG_LOG_BUF_SHIFT=14
1144# CONFIG_DEBUG_BUGVERBOSE is not set 1094# CONFIG_DEBUG_BUGVERBOSE is not set
1145# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set 1095CONFIG_DEBUG_MMRS=y
1146CONFIG_DEBUG_HUNT_FOR_ZERO=y 1096CONFIG_DEBUG_HUNT_FOR_ZERO=y
1097CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1098CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
1099# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
1100# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1101CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
1102# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1147# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1103# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1104CONFIG_EARLY_PRINTK=y
1148# CONFIG_DUAL_CORE_TEST_MODULE is not set 1105# CONFIG_DUAL_CORE_TEST_MODULE is not set
1149CONFIG_CPLB_INFO=y 1106CONFIG_CPLB_INFO=y
1150CONFIG_ACCESS_CHECK=y 1107CONFIG_ACCESS_CHECK=y
@@ -1168,6 +1125,7 @@ CONFIG_SECURITY_CAPABILITIES=m
1168CONFIG_BITREVERSE=y 1125CONFIG_BITREVERSE=y
1169CONFIG_CRC_CCITT=m 1126CONFIG_CRC_CCITT=m
1170# CONFIG_CRC16 is not set 1127# CONFIG_CRC16 is not set
1128# CONFIG_CRC_ITU_T is not set
1171CONFIG_CRC32=y 1129CONFIG_CRC32=y
1172# CONFIG_LIBCRC32C is not set 1130# CONFIG_LIBCRC32C is not set
1173CONFIG_ZLIB_INFLATE=y 1131CONFIG_ZLIB_INFLATE=y
@@ -1175,3 +1133,4 @@ CONFIG_ZLIB_DEFLATE=m
1175CONFIG_PLIST=y 1133CONFIG_PLIST=y
1176CONFIG_HAS_IOMEM=y 1134CONFIG_HAS_IOMEM=y
1177CONFIG_HAS_IOPORT=y 1135CONFIG_HAS_IOPORT=y
1136CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/PNAV-10_defconfig b/arch/blackfin/configs/PNAV-10_defconfig
index 983ed181c896..15e36aaf2186 100644
--- a/arch/blackfin/configs/PNAV-10_defconfig
+++ b/arch/blackfin/configs/PNAV-10_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21.5 3# Linux kernel version: 2.6.22.6
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -15,8 +15,9 @@ CONFIG_GENERIC_HWEIGHT=y
15CONFIG_GENERIC_HARDIRQS=y 15CONFIG_GENERIC_HARDIRQS=y
16CONFIG_GENERIC_IRQ_PROBE=y 16CONFIG_GENERIC_IRQ_PROBE=y
17# CONFIG_GENERIC_TIME is not set 17# CONFIG_GENERIC_TIME is not set
18CONFIG_GENERIC_CALIBRATE_DELAY=y 18CONFIG_GENERIC_GPIO=y
19CONFIG_FORCE_MAX_ZONEORDER=14 19CONFIG_FORCE_MAX_ZONEORDER=14
20CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_IRQCHIP_DEMUX_GPIO=y 21CONFIG_IRQCHIP_DEMUX_GPIO=y
21CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
22 23
@@ -41,6 +42,7 @@ CONFIG_SYSVIPC_SYSCTL=y
41# CONFIG_UTS_NS is not set 42# CONFIG_UTS_NS is not set
42# CONFIG_AUDIT is not set 43# CONFIG_AUDIT is not set
43# CONFIG_IKCONFIG is not set 44# CONFIG_IKCONFIG is not set
45CONFIG_LOG_BUF_SHIFT=14
44CONFIG_SYSFS_DEPRECATED=y 46CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 47# CONFIG_RELAY is not set
46# CONFIG_BLK_DEV_INITRD is not set 48# CONFIG_BLK_DEV_INITRD is not set
@@ -57,15 +59,20 @@ CONFIG_BUG=y
57CONFIG_ELF_CORE=y 59CONFIG_ELF_CORE=y
58CONFIG_BASE_FULL=y 60CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 61CONFIG_FUTEX=y
62CONFIG_ANON_INODES=y
63CONFIG_EPOLL=y
64CONFIG_SIGNALFD=y
65CONFIG_TIMERFD=y
66CONFIG_EVENTFD=y
67CONFIG_VM_EVENT_COUNTERS=y
60CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=9 68CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=9
61CONFIG_BUDDY=y
62# CONFIG_NP2 is not set 69# CONFIG_NP2 is not set
63CONFIG_SLAB=y 70CONFIG_SLAB=y
64CONFIG_VM_EVENT_COUNTERS=y 71# CONFIG_SLUB is not set
72# CONFIG_SLOB is not set
65CONFIG_RT_MUTEXES=y 73CONFIG_RT_MUTEXES=y
66CONFIG_TINY_SHMEM=y 74CONFIG_TINY_SHMEM=y
67CONFIG_BASE_SMALL=0 75CONFIG_BASE_SMALL=0
68# CONFIG_SLOB is not set
69 76
70# 77#
71# Loadable module support 78# Loadable module support
@@ -147,13 +154,6 @@ CONFIG_IRQ_PLL_WAKEUP=7
147# 154#
148 155
149# 156#
150# PORT F/G Selection
151#
152CONFIG_BF537_PORT_F=y
153# CONFIG_BF537_PORT_G is not set
154# CONFIG_BF537_PORT_H is not set
155
156#
157# Interrupt Priority Assignment 157# Interrupt Priority Assignment
158# 158#
159 159
@@ -198,19 +198,17 @@ CONFIG_IRQ_WATCH=13
198# CONFIG_CMDLINE_BOOL is not set 198# CONFIG_CMDLINE_BOOL is not set
199 199
200# 200#
201# Board Setup 201# Clock/PLL Setup
202# 202#
203CONFIG_CLKIN_HZ=24576000 203CONFIG_CLKIN_HZ=24576000
204CONFIG_MEM_SIZE=64 204# CONFIG_BFIN_KERNEL_CLOCK is not set
205CONFIG_MEM_ADD_WIDTH=10 205CONFIG_MAX_VCO_HZ=600000000
206CONFIG_BOOT_LOAD=0x1000 206CONFIG_MIN_VCO_HZ=50000000
207 207CONFIG_MAX_SCLK_HZ=133000000
208# 208CONFIG_MIN_SCLK_HZ=27000000
209# Blackfin Kernel Optimizations
210#
211 209
212# 210#
213# Timer Tick 211# Kernel Timer/Scheduler
214# 212#
215# CONFIG_HZ_100 is not set 213# CONFIG_HZ_100 is not set
216CONFIG_HZ_250=y 214CONFIG_HZ_250=y
@@ -219,6 +217,20 @@ CONFIG_HZ_250=y
219CONFIG_HZ=250 217CONFIG_HZ=250
220 218
221# 219#
220# Memory Setup
221#
222CONFIG_MEM_SIZE=64
223CONFIG_MEM_ADD_WIDTH=10
224CONFIG_BOOT_LOAD=0x1000
225CONFIG_BFIN_SCRATCH_REG_RETN=y
226# CONFIG_BFIN_SCRATCH_REG_RETE is not set
227# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
228
229#
230# Blackfin Kernel Optimizations
231#
232
233#
222# Memory Optimizations 234# Memory Optimizations
223# 235#
224CONFIG_I_ENTRY_L1=y 236CONFIG_I_ENTRY_L1=y
@@ -257,20 +269,15 @@ CONFIG_DMA_UNCACHED_1M=y
257# 269#
258# Cache Support 270# Cache Support
259# 271#
260CONFIG_BLKFIN_CACHE=y 272CONFIG_BFIN_ICACHE=y
261CONFIG_BLKFIN_DCACHE=y 273CONFIG_BFIN_DCACHE=y
262# CONFIG_BLKFIN_DCACHE_BANKA is not set 274# CONFIG_BFIN_DCACHE_BANKA is not set
263# CONFIG_BLKFIN_CACHE_LOCK is not set 275# CONFIG_BFIN_ICACHE_LOCK is not set
264CONFIG_BLKFIN_WB=y 276CONFIG_BFIN_WB=y
265# CONFIG_BLKFIN_WT is not set 277# CONFIG_BFIN_WT is not set
266CONFIG_L1_MAX_PIECE=16 278CONFIG_L1_MAX_PIECE=16
267 279
268# 280#
269# Clock Settings
270#
271# CONFIG_BFIN_KERNEL_CLOCK is not set
272
273#
274# Asynchonous Memory Configuration 281# Asynchonous Memory Configuration
275# 282#
276 283
@@ -297,6 +304,7 @@ CONFIG_BANK_3=0x99B3
297# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 304# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
298# 305#
299# CONFIG_PCI is not set 306# CONFIG_PCI is not set
307# CONFIG_ARCH_SUPPORTS_MSI is not set
300 308
301# 309#
302# PCCARD (PCMCIA/CardBus) support 310# PCCARD (PCMCIA/CardBus) support
@@ -304,10 +312,6 @@ CONFIG_BANK_3=0x99B3
304# CONFIG_PCCARD is not set 312# CONFIG_PCCARD is not set
305 313
306# 314#
307# PCI Hotplug Support
308#
309
310#
311# Executable file formats 315# Executable file formats
312# 316#
313CONFIG_BINFMT_ELF_FDPIC=y 317CONFIG_BINFMT_ELF_FDPIC=y
@@ -334,7 +338,6 @@ CONFIG_NET=y
334# 338#
335# Networking options 339# Networking options
336# 340#
337# CONFIG_NETDEBUG is not set
338CONFIG_PACKET=y 341CONFIG_PACKET=y
339# CONFIG_PACKET_MMAP is not set 342# CONFIG_PACKET_MMAP is not set
340CONFIG_UNIX=y 343CONFIG_UNIX=y
@@ -375,20 +378,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
375# CONFIG_NETLABEL is not set 378# CONFIG_NETLABEL is not set
376# CONFIG_NETWORK_SECMARK is not set 379# CONFIG_NETWORK_SECMARK is not set
377# CONFIG_NETFILTER is not set 380# CONFIG_NETFILTER is not set
378
379#
380# DCCP Configuration (EXPERIMENTAL)
381#
382# CONFIG_IP_DCCP is not set 381# CONFIG_IP_DCCP is not set
383
384#
385# SCTP Configuration (EXPERIMENTAL)
386#
387# CONFIG_IP_SCTP is not set 382# CONFIG_IP_SCTP is not set
388
389#
390# TIPC Configuration (EXPERIMENTAL)
391#
392# CONFIG_TIPC is not set 383# CONFIG_TIPC is not set
393# CONFIG_ATM is not set 384# CONFIG_ATM is not set
394# CONFIG_BRIDGE is not set 385# CONFIG_BRIDGE is not set
@@ -414,7 +405,16 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
414# CONFIG_HAMRADIO is not set 405# CONFIG_HAMRADIO is not set
415# CONFIG_IRDA is not set 406# CONFIG_IRDA is not set
416# CONFIG_BT is not set 407# CONFIG_BT is not set
408# CONFIG_AF_RXRPC is not set
409
410#
411# Wireless
412#
413# CONFIG_CFG80211 is not set
414# CONFIG_WIRELESS_EXT is not set
415# CONFIG_MAC80211 is not set
417# CONFIG_IEEE80211 is not set 416# CONFIG_IEEE80211 is not set
417# CONFIG_RFKILL is not set
418 418
419# 419#
420# Device Drivers 420# Device Drivers
@@ -432,10 +432,6 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
432# Connector - unified userspace <-> kernelspace linker 432# Connector - unified userspace <-> kernelspace linker
433# 433#
434# CONFIG_CONNECTOR is not set 434# CONFIG_CONNECTOR is not set
435
436#
437# Memory Technology Devices (MTD)
438#
439CONFIG_MTD=y 435CONFIG_MTD=y
440# CONFIG_MTD_DEBUG is not set 436# CONFIG_MTD_DEBUG is not set
441# CONFIG_MTD_CONCAT is not set 437# CONFIG_MTD_CONCAT is not set
@@ -473,7 +469,6 @@ CONFIG_MTD_CFI_I2=y
473CONFIG_MTD_RAM=y 469CONFIG_MTD_RAM=y
474# CONFIG_MTD_ROM is not set 470# CONFIG_MTD_ROM is not set
475# CONFIG_MTD_ABSENT is not set 471# CONFIG_MTD_ABSENT is not set
476# CONFIG_MTD_OBSOLETE_CHIPS is not set
477 472
478# 473#
479# Mapping drivers for chip access 474# Mapping drivers for chip access
@@ -499,13 +494,10 @@ CONFIG_MTD_UCLINUX=y
499# CONFIG_MTD_DOC2000 is not set 494# CONFIG_MTD_DOC2000 is not set
500# CONFIG_MTD_DOC2001 is not set 495# CONFIG_MTD_DOC2001 is not set
501# CONFIG_MTD_DOC2001PLUS is not set 496# CONFIG_MTD_DOC2001PLUS is not set
502
503#
504# NAND Flash Device Drivers
505#
506CONFIG_MTD_NAND=y 497CONFIG_MTD_NAND=y
507# CONFIG_MTD_NAND_VERIFY_WRITE is not set 498# CONFIG_MTD_NAND_VERIFY_WRITE is not set
508# CONFIG_MTD_NAND_ECC_SMC is not set 499# CONFIG_MTD_NAND_ECC_SMC is not set
500# CONFIG_MTD_NAND_MUSEUM_IDS is not set
509CONFIG_MTD_NAND_BFIN=y 501CONFIG_MTD_NAND_BFIN=y
510CONFIG_BFIN_NAND_BASE=0x20100000 502CONFIG_BFIN_NAND_BASE=0x20100000
511CONFIG_BFIN_NAND_CLE=2 503CONFIG_BFIN_NAND_CLE=2
@@ -514,11 +506,13 @@ CONFIG_BFIN_NAND_READY=44
514CONFIG_MTD_NAND_IDS=y 506CONFIG_MTD_NAND_IDS=y
515# CONFIG_MTD_NAND_DISKONCHIP is not set 507# CONFIG_MTD_NAND_DISKONCHIP is not set
516# CONFIG_MTD_NAND_NANDSIM is not set 508# CONFIG_MTD_NAND_NANDSIM is not set
509# CONFIG_MTD_NAND_PLATFORM is not set
510# CONFIG_MTD_ONENAND is not set
517 511
518# 512#
519# OneNAND Flash Device Drivers 513# UBI - Unsorted block images
520# 514#
521# CONFIG_MTD_ONENAND is not set 515# CONFIG_MTD_UBI is not set
522 516
523# 517#
524# Parallel port support 518# Parallel port support
@@ -546,10 +540,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
546# 540#
547# Misc devices 541# Misc devices
548# 542#
549
550#
551# ATA/ATAPI/MFM/RLL support
552#
553# CONFIG_IDE is not set 543# CONFIG_IDE is not set
554 544
555# 545#
@@ -558,10 +548,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
558# CONFIG_RAID_ATTRS is not set 548# CONFIG_RAID_ATTRS is not set
559# CONFIG_SCSI is not set 549# CONFIG_SCSI is not set
560# CONFIG_SCSI_NETLINK is not set 550# CONFIG_SCSI_NETLINK is not set
561
562#
563# Serial ATA (prod) and Parallel ATA (experimental) drivers
564#
565# CONFIG_ATA is not set 551# CONFIG_ATA is not set
566 552
567# 553#
@@ -570,19 +556,6 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
570# CONFIG_MD is not set 556# CONFIG_MD is not set
571 557
572# 558#
573# Fusion MPT device support
574#
575# CONFIG_FUSION is not set
576
577#
578# IEEE 1394 (FireWire) support
579#
580
581#
582# I2O device support
583#
584
585#
586# Network device support 559# Network device support
587# 560#
588CONFIG_NETDEVICES=y 561CONFIG_NETDEVICES=y
@@ -590,11 +563,20 @@ CONFIG_NETDEVICES=y
590# CONFIG_BONDING is not set 563# CONFIG_BONDING is not set
591# CONFIG_EQUALIZER is not set 564# CONFIG_EQUALIZER is not set
592# CONFIG_TUN is not set 565# CONFIG_TUN is not set
566CONFIG_PHYLIB=y
593 567
594# 568#
595# PHY device support 569# MII PHY device drivers
596# 570#
597# CONFIG_PHYLIB is not set 571# CONFIG_MARVELL_PHY is not set
572# CONFIG_DAVICOM_PHY is not set
573# CONFIG_QSEMI_PHY is not set
574# CONFIG_LXT_PHY is not set
575# CONFIG_CICADA_PHY is not set
576# CONFIG_VITESSE_PHY is not set
577# CONFIG_SMSC_PHY is not set
578# CONFIG_BROADCOM_PHY is not set
579# CONFIG_FIXED_PHY is not set
598 580
599# 581#
600# Ethernet (10 or 100Mbit) 582# Ethernet (10 or 100Mbit)
@@ -608,27 +590,15 @@ CONFIG_BFIN_TX_DESC_NUM=100
608CONFIG_BFIN_RX_DESC_NUM=100 590CONFIG_BFIN_RX_DESC_NUM=100
609CONFIG_BFIN_MAC_RMII=y 591CONFIG_BFIN_MAC_RMII=y
610# CONFIG_SMSC911X is not set 592# CONFIG_SMSC911X is not set
593# CONFIG_DM9000 is not set
594CONFIG_NETDEV_1000=y
595CONFIG_NETDEV_10000=y
611 596
612# 597#
613# Ethernet (1000 Mbit) 598# Wireless LAN
614#
615
616#
617# Ethernet (10000 Mbit)
618#
619
620#
621# Token Ring devices
622#
623
624#
625# Wireless LAN (non-hamradio)
626#
627# CONFIG_NET_RADIO is not set
628
629#
630# Wan interfaces
631# 599#
600# CONFIG_WLAN_PRE80211 is not set
601# CONFIG_WLAN_80211 is not set
632# CONFIG_WAN is not set 602# CONFIG_WAN is not set
633# CONFIG_PPP is not set 603# CONFIG_PPP is not set
634# CONFIG_SLIP is not set 604# CONFIG_SLIP is not set
@@ -652,6 +622,7 @@ CONFIG_BFIN_MAC_RMII=y
652# 622#
653CONFIG_INPUT=y 623CONFIG_INPUT=y
654# CONFIG_INPUT_FF_MEMLESS is not set 624# CONFIG_INPUT_FF_MEMLESS is not set
625# CONFIG_INPUT_POLLDEV is not set
655 626
656# 627#
657# Userland interfaces 628# Userland interfaces
@@ -670,6 +641,7 @@ CONFIG_INPUT_EVDEV=y
670# CONFIG_INPUT_KEYBOARD is not set 641# CONFIG_INPUT_KEYBOARD is not set
671# CONFIG_INPUT_MOUSE is not set 642# CONFIG_INPUT_MOUSE is not set
672# CONFIG_INPUT_JOYSTICK is not set 643# CONFIG_INPUT_JOYSTICK is not set
644# CONFIG_INPUT_TABLET is not set
673CONFIG_INPUT_TOUCHSCREEN=y 645CONFIG_INPUT_TOUCHSCREEN=y
674# CONFIG_TOUCHSCREEN_ADS7846 is not set 646# CONFIG_TOUCHSCREEN_ADS7846 is not set
675CONFIG_TOUCHSCREEN_AD7877=y 647CONFIG_TOUCHSCREEN_AD7877=y
@@ -681,7 +653,13 @@ CONFIG_TOUCHSCREEN_AD7877=y
681# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 653# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
682# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 654# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
683# CONFIG_TOUCHSCREEN_UCB1400 is not set 655# CONFIG_TOUCHSCREEN_UCB1400 is not set
656# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
684CONFIG_INPUT_MISC=y 657CONFIG_INPUT_MISC=y
658# CONFIG_INPUT_ATI_REMOTE is not set
659# CONFIG_INPUT_ATI_REMOTE2 is not set
660# CONFIG_INPUT_KEYSPAN_REMOTE is not set
661# CONFIG_INPUT_POWERMATE is not set
662# CONFIG_INPUT_YEALINK is not set
685CONFIG_INPUT_UINPUT=y 663CONFIG_INPUT_UINPUT=y
686# CONFIG_BF53X_PFBUTTONS is not set 664# CONFIG_BF53X_PFBUTTONS is not set
687# CONFIG_TWI_KEYPAD is not set 665# CONFIG_TWI_KEYPAD is not set
@@ -697,7 +675,7 @@ CONFIG_INPUT_UINPUT=y
697# 675#
698# CONFIG_AD9960 is not set 676# CONFIG_AD9960 is not set
699# CONFIG_SPI_ADC_BF533 is not set 677# CONFIG_SPI_ADC_BF533 is not set
700# CONFIG_BF5xx_PFLAGS is not set 678# CONFIG_BFIN_PFLAGS is not set
701# CONFIG_BF5xx_PPIFCD is not set 679# CONFIG_BF5xx_PPIFCD is not set
702# CONFIG_BF5xx_TIMERS is not set 680# CONFIG_BF5xx_TIMERS is not set
703# CONFIG_BF5xx_PPI is not set 681# CONFIG_BF5xx_PPI is not set
@@ -749,14 +727,9 @@ CONFIG_CAN_BLACKFIN=m
749# IPMI 727# IPMI
750# 728#
751# CONFIG_IPMI_HANDLER is not set 729# CONFIG_IPMI_HANDLER is not set
752
753#
754# Watchdog Cards
755#
756# CONFIG_WATCHDOG is not set 730# CONFIG_WATCHDOG is not set
757CONFIG_HW_RANDOM=y 731CONFIG_HW_RANDOM=y
758# CONFIG_GEN_RTC is not set 732# CONFIG_GEN_RTC is not set
759# CONFIG_DTLK is not set
760# CONFIG_R3964 is not set 733# CONFIG_R3964 is not set
761# CONFIG_RAW_DRIVER is not set 734# CONFIG_RAW_DRIVER is not set
762 735
@@ -764,11 +737,8 @@ CONFIG_HW_RANDOM=y
764# TPM devices 737# TPM devices
765# 738#
766# CONFIG_TCG_TPM is not set 739# CONFIG_TCG_TPM is not set
767
768#
769# I2C support
770#
771CONFIG_I2C=y 740CONFIG_I2C=y
741CONFIG_I2C_BOARDINFO=y
772CONFIG_I2C_CHARDEV=y 742CONFIG_I2C_CHARDEV=y
773 743
774# 744#
@@ -784,10 +754,11 @@ CONFIG_I2C_CHARDEV=y
784# CONFIG_I2C_BLACKFIN_GPIO is not set 754# CONFIG_I2C_BLACKFIN_GPIO is not set
785CONFIG_I2C_BLACKFIN_TWI=y 755CONFIG_I2C_BLACKFIN_TWI=y
786CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 756CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50
757# CONFIG_I2C_GPIO is not set
787# CONFIG_I2C_OCORES is not set 758# CONFIG_I2C_OCORES is not set
788# CONFIG_I2C_PARPORT_LIGHT is not set 759# CONFIG_I2C_PARPORT_LIGHT is not set
760# CONFIG_I2C_SIMTEC is not set
789# CONFIG_I2C_STUB is not set 761# CONFIG_I2C_STUB is not set
790# CONFIG_I2C_PCA_ISA is not set
791 762
792# 763#
793# Miscellaneous I2C Chip support 764# Miscellaneous I2C Chip support
@@ -823,18 +794,16 @@ CONFIG_SPI_BFIN=y
823# SPI Protocol Masters 794# SPI Protocol Masters
824# 795#
825# CONFIG_SPI_AT25 is not set 796# CONFIG_SPI_AT25 is not set
797# CONFIG_SPI_SPIDEV is not set
826 798
827# 799#
828# Dallas's 1-wire bus 800# Dallas's 1-wire bus
829# 801#
830# CONFIG_W1 is not set 802# CONFIG_W1 is not set
831
832#
833# Hardware Monitoring support
834#
835CONFIG_HWMON=y 803CONFIG_HWMON=y
836# CONFIG_HWMON_VID is not set 804# CONFIG_HWMON_VID is not set
837# CONFIG_SENSORS_ABITUGURU is not set 805# CONFIG_SENSORS_ABITUGURU is not set
806# CONFIG_SENSORS_AD7418 is not set
838# CONFIG_SENSORS_ADM1021 is not set 807# CONFIG_SENSORS_ADM1021 is not set
839# CONFIG_SENSORS_ADM1025 is not set 808# CONFIG_SENSORS_ADM1025 is not set
840# CONFIG_SENSORS_ADM1026 is not set 809# CONFIG_SENSORS_ADM1026 is not set
@@ -862,6 +831,7 @@ CONFIG_HWMON=y
862# CONFIG_SENSORS_LM90 is not set 831# CONFIG_SENSORS_LM90 is not set
863# CONFIG_SENSORS_LM92 is not set 832# CONFIG_SENSORS_LM92 is not set
864# CONFIG_SENSORS_MAX1619 is not set 833# CONFIG_SENSORS_MAX1619 is not set
834# CONFIG_SENSORS_MAX6650 is not set
865# CONFIG_SENSORS_PC87360 is not set 835# CONFIG_SENSORS_PC87360 is not set
866# CONFIG_SENSORS_PC87427 is not set 836# CONFIG_SENSORS_PC87427 is not set
867# CONFIG_SENSORS_SMSC47M1 is not set 837# CONFIG_SENSORS_SMSC47M1 is not set
@@ -886,11 +856,8 @@ CONFIG_HWMON=y
886# Multimedia devices 856# Multimedia devices
887# 857#
888# CONFIG_VIDEO_DEV is not set 858# CONFIG_VIDEO_DEV is not set
889 859# CONFIG_DVB_CORE is not set
890# 860CONFIG_DAB=y
891# Digital Video Broadcasting Devices
892#
893# CONFIG_DVB is not set
894 861
895# 862#
896# Graphics support 863# Graphics support
@@ -898,12 +865,23 @@ CONFIG_HWMON=y
898CONFIG_BACKLIGHT_LCD_SUPPORT=y 865CONFIG_BACKLIGHT_LCD_SUPPORT=y
899CONFIG_BACKLIGHT_CLASS_DEVICE=y 866CONFIG_BACKLIGHT_CLASS_DEVICE=y
900CONFIG_LCD_CLASS_DEVICE=y 867CONFIG_LCD_CLASS_DEVICE=y
868
869#
870# Display device support
871#
872# CONFIG_DISPLAY_SUPPORT is not set
873# CONFIG_VGASTATE is not set
901CONFIG_FB=y 874CONFIG_FB=y
902CONFIG_FIRMWARE_EDID=y 875CONFIG_FIRMWARE_EDID=y
903# CONFIG_FB_DDC is not set 876# CONFIG_FB_DDC is not set
904CONFIG_FB_CFB_FILLRECT=y 877CONFIG_FB_CFB_FILLRECT=y
905CONFIG_FB_CFB_COPYAREA=y 878CONFIG_FB_CFB_COPYAREA=y
906CONFIG_FB_CFB_IMAGEBLIT=y 879CONFIG_FB_CFB_IMAGEBLIT=y
880# CONFIG_FB_SYS_FILLRECT is not set
881# CONFIG_FB_SYS_COPYAREA is not set
882# CONFIG_FB_SYS_IMAGEBLIT is not set
883# CONFIG_FB_SYS_FOPS is not set
884CONFIG_FB_DEFERRED_IO=y
907# CONFIG_FB_SVGALIB is not set 885# CONFIG_FB_SVGALIB is not set
908# CONFIG_FB_MACMODES is not set 886# CONFIG_FB_MACMODES is not set
909# CONFIG_FB_BACKLIGHT is not set 887# CONFIG_FB_BACKLIGHT is not set
@@ -921,10 +899,6 @@ CONFIG_FB_BFIN_LANDSCAPE=y
921# CONFIG_FB_BFIN_BGR is not set 899# CONFIG_FB_BFIN_BGR is not set
922# CONFIG_FB_S1D13XXX is not set 900# CONFIG_FB_S1D13XXX is not set
923# CONFIG_FB_VIRTUAL is not set 901# CONFIG_FB_VIRTUAL is not set
924
925#
926# Logo configuration
927#
928# CONFIG_LOGO is not set 902# CONFIG_LOGO is not set
929 903
930# 904#
@@ -936,8 +910,6 @@ CONFIG_SOUND=y
936# Advanced Linux Sound Architecture 910# Advanced Linux Sound Architecture
937# 911#
938CONFIG_SND=m 912CONFIG_SND=m
939CONFIG_SND_TIMER=m
940CONFIG_SND_PCM=m
941# CONFIG_SND_SEQUENCER is not set 913# CONFIG_SND_SEQUENCER is not set
942# CONFIG_SND_MIXER_OSS is not set 914# CONFIG_SND_MIXER_OSS is not set
943# CONFIG_SND_PCM_OSS is not set 915# CONFIG_SND_PCM_OSS is not set
@@ -959,19 +931,23 @@ CONFIG_SND_PCM=m
959# ALSA Blackfin devices 931# ALSA Blackfin devices
960# 932#
961# CONFIG_SND_BLACKFIN_AD1836 is not set 933# CONFIG_SND_BLACKFIN_AD1836 is not set
962CONFIG_SND_BLACKFIN_AD1981B=m
963# CONFIG_SND_BFIN_AD73311 is not set 934# CONFIG_SND_BFIN_AD73311 is not set
964 935
965# 936#
966# SoC audio support 937# System on Chip audio support
967# 938#
968# CONFIG_SND_SOC is not set 939# CONFIG_SND_SOC is not set
969 940
970# 941#
942# SoC Audio for the ADI Blackfin
943#
944# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
945
946#
971# Open Sound System 947# Open Sound System
972# 948#
973CONFIG_SOUND_PRIME=y 949CONFIG_SOUND_PRIME=y
974# CONFIG_OBSOLETE_OSS is not set 950# CONFIG_OSS_OBSOLETE is not set
975# CONFIG_SOUND_MSNDCLAS is not set 951# CONFIG_SOUND_MSNDCLAS is not set
976# CONFIG_SOUND_MSNDPIN is not set 952# CONFIG_SOUND_MSNDPIN is not set
977 953
@@ -989,18 +965,17 @@ CONFIG_USB_ARCH_HAS_HCD=y
989# CONFIG_USB is not set 965# CONFIG_USB is not set
990 966
991# 967#
992# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 968# Enable Host or Gadget support to see Inventra options
993# 969#
994 970
995# 971#
996# USB Gadget Support 972# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
997# 973#
998# CONFIG_USB_GADGET is not set
999 974
1000# 975#
1001# MMC/SD Card support 976# USB Gadget Support
1002# 977#
1003# CONFIG_SPI_MMC is not set 978# CONFIG_USB_GADGET is not set
1004# CONFIG_MMC is not set 979# CONFIG_MMC is not set
1005 980
1006# 981#
@@ -1040,44 +1015,50 @@ CONFIG_RTC_INTF_SYSFS=y
1040CONFIG_RTC_INTF_PROC=y 1015CONFIG_RTC_INTF_PROC=y
1041CONFIG_RTC_INTF_DEV=y 1016CONFIG_RTC_INTF_DEV=y
1042# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set 1017# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1018# CONFIG_RTC_DRV_TEST is not set
1043 1019
1044# 1020#
1045# RTC drivers 1021# I2C RTC drivers
1046# 1022#
1047# CONFIG_RTC_DRV_X1205 is not set
1048# CONFIG_RTC_DRV_DS1307 is not set 1023# CONFIG_RTC_DRV_DS1307 is not set
1049# CONFIG_RTC_DRV_DS1553 is not set
1050# CONFIG_RTC_DRV_ISL1208 is not set
1051# CONFIG_RTC_DRV_DS1672 is not set 1024# CONFIG_RTC_DRV_DS1672 is not set
1052# CONFIG_RTC_DRV_DS1742 is not set 1025# CONFIG_RTC_DRV_MAX6900 is not set
1026# CONFIG_RTC_DRV_RS5C372 is not set
1027# CONFIG_RTC_DRV_ISL1208 is not set
1028# CONFIG_RTC_DRV_X1205 is not set
1053# CONFIG_RTC_DRV_PCF8563 is not set 1029# CONFIG_RTC_DRV_PCF8563 is not set
1030# CONFIG_RTC_DRV_PCF8583 is not set
1031
1032#
1033# SPI RTC drivers
1034#
1054# CONFIG_RTC_DRV_RS5C348 is not set 1035# CONFIG_RTC_DRV_RS5C348 is not set
1055# CONFIG_RTC_DRV_RS5C372 is not set
1056# CONFIG_RTC_DRV_M48T86 is not set
1057# CONFIG_RTC_DRV_TEST is not set
1058# CONFIG_RTC_DRV_MAX6902 is not set 1036# CONFIG_RTC_DRV_MAX6902 is not set
1059# CONFIG_RTC_DRV_V3020 is not set
1060CONFIG_RTC_DRV_BFIN=y
1061 1037
1062# 1038#
1063# DMA Engine support 1039# Platform RTC drivers
1064# 1040#
1065# CONFIG_DMA_ENGINE is not set 1041# CONFIG_RTC_DRV_DS1553 is not set
1042# CONFIG_RTC_DRV_DS1742 is not set
1043# CONFIG_RTC_DRV_M48T86 is not set
1044# CONFIG_RTC_DRV_V3020 is not set
1066 1045
1067# 1046#
1068# DMA Clients 1047# on-CPU RTC drivers
1069# 1048#
1049CONFIG_RTC_DRV_BFIN=y
1070 1050
1071# 1051#
1072# DMA Devices 1052# DMA Engine support
1073# 1053#
1054# CONFIG_DMA_ENGINE is not set
1074 1055
1075# 1056#
1076# Auxiliary Display support 1057# DMA Clients
1077# 1058#
1078 1059
1079# 1060#
1080# Virtualization 1061# DMA Devices
1081# 1062#
1082 1063
1083# 1064#
@@ -1176,6 +1157,7 @@ CONFIG_LOCKD=m
1176CONFIG_LOCKD_V4=y 1157CONFIG_LOCKD_V4=y
1177CONFIG_NFS_COMMON=y 1158CONFIG_NFS_COMMON=y
1178CONFIG_SUNRPC=m 1159CONFIG_SUNRPC=m
1160# CONFIG_SUNRPC_BIND34 is not set
1179# CONFIG_RPCSEC_GSS_KRB5 is not set 1161# CONFIG_RPCSEC_GSS_KRB5 is not set
1180# CONFIG_RPCSEC_GSS_SPKM3 is not set 1162# CONFIG_RPCSEC_GSS_SPKM3 is not set
1181CONFIG_SMB_FS=m 1163CONFIG_SMB_FS=m
@@ -1256,11 +1238,17 @@ CONFIG_ENABLE_MUST_CHECK=y
1256# CONFIG_DEBUG_FS is not set 1238# CONFIG_DEBUG_FS is not set
1257# CONFIG_HEADERS_CHECK is not set 1239# CONFIG_HEADERS_CHECK is not set
1258# CONFIG_DEBUG_KERNEL is not set 1240# CONFIG_DEBUG_KERNEL is not set
1259CONFIG_LOG_BUF_SHIFT=14
1260# CONFIG_DEBUG_BUGVERBOSE is not set 1241# CONFIG_DEBUG_BUGVERBOSE is not set
1261# CONFIG_DEBUG_SERIAL_EARLY_INIT is not set 1242# CONFIG_DEBUG_MMRS is not set
1262# CONFIG_DEBUG_HUNT_FOR_ZERO is not set 1243# CONFIG_DEBUG_HUNT_FOR_ZERO is not set
1244CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1245CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
1246# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
1247# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1248CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
1249# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1263# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1250# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1251# CONFIG_EARLY_PRINTK is not set
1264# CONFIG_CPLB_INFO is not set 1252# CONFIG_CPLB_INFO is not set
1265# CONFIG_ACCESS_CHECK is not set 1253# CONFIG_ACCESS_CHECK is not set
1266 1254
@@ -1283,9 +1271,11 @@ CONFIG_SECURITY_CAPABILITIES=y
1283CONFIG_BITREVERSE=y 1271CONFIG_BITREVERSE=y
1284CONFIG_CRC_CCITT=m 1272CONFIG_CRC_CCITT=m
1285# CONFIG_CRC16 is not set 1273# CONFIG_CRC16 is not set
1274# CONFIG_CRC_ITU_T is not set
1286CONFIG_CRC32=y 1275CONFIG_CRC32=y
1287# CONFIG_LIBCRC32C is not set 1276# CONFIG_LIBCRC32C is not set
1288CONFIG_ZLIB_INFLATE=y 1277CONFIG_ZLIB_INFLATE=y
1289CONFIG_PLIST=y 1278CONFIG_PLIST=y
1290CONFIG_HAS_IOMEM=y 1279CONFIG_HAS_IOMEM=y
1291CONFIG_HAS_IOPORT=y 1280CONFIG_HAS_IOPORT=y
1281CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/kernel/Makefile b/arch/blackfin/kernel/Makefile
index f429ebc3a961..8aeb6066b19b 100644
--- a/arch/blackfin/kernel/Makefile
+++ b/arch/blackfin/kernel/Makefile
@@ -7,11 +7,10 @@ extra-y := init_task.o vmlinux.lds
7obj-y := \ 7obj-y := \
8 entry.o process.o bfin_ksyms.o ptrace.o setup.o signal.o \ 8 entry.o process.o bfin_ksyms.o ptrace.o setup.o signal.o \
9 sys_bfin.o time.o traps.o irqchip.o dma-mapping.o flat.o \ 9 sys_bfin.o time.o traps.o irqchip.o dma-mapping.o flat.o \
10 fixed_code.o cplbinit.o cacheinit.o 10 fixed_code.o cplbinit.o cacheinit.o reboot.o bfin_gpio.o
11 11
12obj-$(CONFIG_BF53x) += bfin_gpio.o
13obj-$(CONFIG_BF561) += bfin_gpio.o
14obj-$(CONFIG_MODULES) += module.o 12obj-$(CONFIG_MODULES) += module.o
15obj-$(CONFIG_BFIN_DMA_5XX) += bfin_dma_5xx.o 13obj-$(CONFIG_BFIN_DMA_5XX) += bfin_dma_5xx.o
16obj-$(CONFIG_DUAL_CORE_TEST_MODULE) += dualcore_test.o 14obj-$(CONFIG_DUAL_CORE_TEST_MODULE) += dualcore_test.o
17obj-$(CONFIG_KGDB) += kgdb.o 15obj-$(CONFIG_KGDB) += kgdb.o
16obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 7cf02f02a1db..e19164fb4cd1 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -73,6 +73,11 @@ static int __init blackfin_dma_init(void)
73 /* Mark MEMDMA Channel 0 as requested since we're using it internally */ 73 /* Mark MEMDMA Channel 0 as requested since we're using it internally */
74 dma_ch[CH_MEM_STREAM0_DEST].chan_status = DMA_CHANNEL_REQUESTED; 74 dma_ch[CH_MEM_STREAM0_DEST].chan_status = DMA_CHANNEL_REQUESTED;
75 dma_ch[CH_MEM_STREAM0_SRC].chan_status = DMA_CHANNEL_REQUESTED; 75 dma_ch[CH_MEM_STREAM0_SRC].chan_status = DMA_CHANNEL_REQUESTED;
76
77#if defined(CONFIG_DEB_DMA_URGENT)
78 bfin_write_EBIU_DDRQUE(bfin_read_EBIU_DDRQUE()
79 | DEB1_URGENT | DEB2_URGENT | DEB3_URGENT);
80#endif
76 return 0; 81 return 0;
77} 82}
78 83
@@ -265,10 +270,23 @@ void set_dma_next_desc_addr(unsigned int channel, unsigned long addr)
265 270
266 dma_ch[channel].regs->next_desc_ptr = addr; 271 dma_ch[channel].regs->next_desc_ptr = addr;
267 SSYNC(); 272 SSYNC();
268 pr_debug("set_dma_start_addr() : END\n"); 273 pr_debug("set_dma_next_desc_addr() : END\n");
269} 274}
270EXPORT_SYMBOL(set_dma_next_desc_addr); 275EXPORT_SYMBOL(set_dma_next_desc_addr);
271 276
277void set_dma_curr_desc_addr(unsigned int channel, unsigned long addr)
278{
279 pr_debug("set_dma_curr_desc_addr() : BEGIN \n");
280
281 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
282 && channel < MAX_BLACKFIN_DMA_CHANNEL));
283
284 dma_ch[channel].regs->curr_desc_ptr = addr;
285 SSYNC();
286 pr_debug("set_dma_curr_desc_addr() : END\n");
287}
288EXPORT_SYMBOL(set_dma_curr_desc_addr);
289
272void set_dma_x_count(unsigned int channel, unsigned short x_count) 290void set_dma_x_count(unsigned int channel, unsigned short x_count)
273{ 291{
274 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE 292 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
@@ -345,6 +363,16 @@ void set_dma_sg(unsigned int channel, struct dmasg *sg, int nr_sg)
345} 363}
346EXPORT_SYMBOL(set_dma_sg); 364EXPORT_SYMBOL(set_dma_sg);
347 365
366void set_dma_curr_addr(unsigned int channel, unsigned long addr)
367{
368 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
369 && channel < MAX_BLACKFIN_DMA_CHANNEL));
370
371 dma_ch[channel].regs->curr_addr_ptr = addr;
372 SSYNC();
373}
374EXPORT_SYMBOL(set_dma_curr_addr);
375
348/*------------------------------------------------------------------------------ 376/*------------------------------------------------------------------------------
349 * Get the DMA status of a specific DMA channel from the system. 377 * Get the DMA status of a specific DMA channel from the system.
350 *-----------------------------------------------------------------------------*/ 378 *-----------------------------------------------------------------------------*/
@@ -408,6 +436,10 @@ static void *__dma_memcpy(void *dest, const void *src, size_t size)
408 blackfin_dcache_flush_range((unsigned int)src, 436 blackfin_dcache_flush_range((unsigned int)src,
409 (unsigned int)(src + size)); 437 (unsigned int)(src + size));
410 438
439 if ((unsigned long)dest < memory_end)
440 blackfin_dcache_invalidate_range((unsigned int)dest,
441 (unsigned int)(dest + size));
442
411 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR); 443 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
412 444
413 if ((unsigned long)src < (unsigned long)dest) 445 if ((unsigned long)src < (unsigned long)dest)
@@ -515,6 +547,8 @@ static void *__dma_memcpy(void *dest, const void *src, size_t size)
515 } 547 }
516 } 548 }
517 549
550 SSYNC();
551
518 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)) 552 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE))
519 ; 553 ;
520 554
@@ -524,9 +558,6 @@ static void *__dma_memcpy(void *dest, const void *src, size_t size)
524 bfin_write_MDMA_S0_CONFIG(0); 558 bfin_write_MDMA_S0_CONFIG(0);
525 bfin_write_MDMA_D0_CONFIG(0); 559 bfin_write_MDMA_D0_CONFIG(0);
526 560
527 if ((unsigned long)dest < memory_end)
528 blackfin_dcache_invalidate_range((unsigned int)dest,
529 (unsigned int)(dest + size));
530 local_irq_restore(flags); 561 local_irq_restore(flags);
531 562
532 return dest; 563 return dest;
@@ -555,13 +586,14 @@ void *safe_dma_memcpy(void *dest, const void *src, size_t size)
555} 586}
556EXPORT_SYMBOL(safe_dma_memcpy); 587EXPORT_SYMBOL(safe_dma_memcpy);
557 588
558void dma_outsb(void __iomem *addr, const void *buf, unsigned short len) 589void dma_outsb(unsigned long addr, const void *buf, unsigned short len)
559{ 590{
560 unsigned long flags; 591 unsigned long flags;
561 592
562 local_irq_save(flags); 593 local_irq_save(flags);
563 594
564 blackfin_dcache_flush_range((unsigned int)buf, (unsigned int)(buf) + len); 595 blackfin_dcache_flush_range((unsigned int)buf,
596 (unsigned int)(buf) + len);
565 597
566 bfin_write_MDMA_D0_START_ADDR(addr); 598 bfin_write_MDMA_D0_START_ADDR(addr);
567 bfin_write_MDMA_D0_X_COUNT(len); 599 bfin_write_MDMA_D0_X_COUNT(len);
@@ -576,6 +608,8 @@ void dma_outsb(void __iomem *addr, const void *buf, unsigned short len)
576 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_8); 608 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_8);
577 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_8); 609 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_8);
578 610
611 SSYNC();
612
579 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)); 613 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
580 614
581 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR); 615 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
@@ -588,10 +622,13 @@ void dma_outsb(void __iomem *addr, const void *buf, unsigned short len)
588EXPORT_SYMBOL(dma_outsb); 622EXPORT_SYMBOL(dma_outsb);
589 623
590 624
591void dma_insb(const void __iomem *addr, void *buf, unsigned short len) 625void dma_insb(unsigned long addr, void *buf, unsigned short len)
592{ 626{
593 unsigned long flags; 627 unsigned long flags;
594 628
629 blackfin_dcache_invalidate_range((unsigned int)buf,
630 (unsigned int)(buf) + len);
631
595 local_irq_save(flags); 632 local_irq_save(flags);
596 bfin_write_MDMA_D0_START_ADDR(buf); 633 bfin_write_MDMA_D0_START_ADDR(buf);
597 bfin_write_MDMA_D0_X_COUNT(len); 634 bfin_write_MDMA_D0_X_COUNT(len);
@@ -606,7 +643,7 @@ void dma_insb(const void __iomem *addr, void *buf, unsigned short len)
606 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_8); 643 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_8);
607 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_8); 644 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_8);
608 645
609 blackfin_dcache_invalidate_range((unsigned int)buf, (unsigned int)(buf) + len); 646 SSYNC();
610 647
611 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)); 648 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
612 649
@@ -619,13 +656,14 @@ void dma_insb(const void __iomem *addr, void *buf, unsigned short len)
619} 656}
620EXPORT_SYMBOL(dma_insb); 657EXPORT_SYMBOL(dma_insb);
621 658
622void dma_outsw(void __iomem *addr, const void *buf, unsigned short len) 659void dma_outsw(unsigned long addr, const void *buf, unsigned short len)
623{ 660{
624 unsigned long flags; 661 unsigned long flags;
625 662
626 local_irq_save(flags); 663 local_irq_save(flags);
627 664
628 blackfin_dcache_flush_range((unsigned int)buf, (unsigned int)(buf) + len); 665 blackfin_dcache_flush_range((unsigned int)buf,
666 (unsigned int)(buf) + len * sizeof(short));
629 667
630 bfin_write_MDMA_D0_START_ADDR(addr); 668 bfin_write_MDMA_D0_START_ADDR(addr);
631 bfin_write_MDMA_D0_X_COUNT(len); 669 bfin_write_MDMA_D0_X_COUNT(len);
@@ -640,6 +678,8 @@ void dma_outsw(void __iomem *addr, const void *buf, unsigned short len)
640 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16); 678 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16);
641 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16); 679 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16);
642 680
681 SSYNC();
682
643 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)); 683 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
644 684
645 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR); 685 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
@@ -651,10 +691,13 @@ void dma_outsw(void __iomem *addr, const void *buf, unsigned short len)
651} 691}
652EXPORT_SYMBOL(dma_outsw); 692EXPORT_SYMBOL(dma_outsw);
653 693
654void dma_insw(const void __iomem *addr, void *buf, unsigned short len) 694void dma_insw(unsigned long addr, void *buf, unsigned short len)
655{ 695{
656 unsigned long flags; 696 unsigned long flags;
657 697
698 blackfin_dcache_invalidate_range((unsigned int)buf,
699 (unsigned int)(buf) + len * sizeof(short));
700
658 local_irq_save(flags); 701 local_irq_save(flags);
659 702
660 bfin_write_MDMA_D0_START_ADDR(buf); 703 bfin_write_MDMA_D0_START_ADDR(buf);
@@ -670,7 +713,7 @@ void dma_insw(const void __iomem *addr, void *buf, unsigned short len)
670 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16); 713 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16);
671 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16); 714 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16);
672 715
673 blackfin_dcache_invalidate_range((unsigned int)buf, (unsigned int)(buf) + len); 716 SSYNC();
674 717
675 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)); 718 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
676 719
@@ -683,13 +726,14 @@ void dma_insw(const void __iomem *addr, void *buf, unsigned short len)
683} 726}
684EXPORT_SYMBOL(dma_insw); 727EXPORT_SYMBOL(dma_insw);
685 728
686void dma_outsl(void __iomem *addr, const void *buf, unsigned short len) 729void dma_outsl(unsigned long addr, const void *buf, unsigned short len)
687{ 730{
688 unsigned long flags; 731 unsigned long flags;
689 732
690 local_irq_save(flags); 733 local_irq_save(flags);
691 734
692 blackfin_dcache_flush_range((unsigned int)buf, (unsigned int)(buf) + len); 735 blackfin_dcache_flush_range((unsigned int)buf,
736 (unsigned int)(buf) + len * sizeof(long));
693 737
694 bfin_write_MDMA_D0_START_ADDR(addr); 738 bfin_write_MDMA_D0_START_ADDR(addr);
695 bfin_write_MDMA_D0_X_COUNT(len); 739 bfin_write_MDMA_D0_X_COUNT(len);
@@ -704,6 +748,8 @@ void dma_outsl(void __iomem *addr, const void *buf, unsigned short len)
704 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_32); 748 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_32);
705 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_32); 749 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_32);
706 750
751 SSYNC();
752
707 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)); 753 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
708 754
709 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR); 755 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
@@ -715,10 +761,13 @@ void dma_outsl(void __iomem *addr, const void *buf, unsigned short len)
715} 761}
716EXPORT_SYMBOL(dma_outsl); 762EXPORT_SYMBOL(dma_outsl);
717 763
718void dma_insl(const void __iomem *addr, void *buf, unsigned short len) 764void dma_insl(unsigned long addr, void *buf, unsigned short len)
719{ 765{
720 unsigned long flags; 766 unsigned long flags;
721 767
768 blackfin_dcache_invalidate_range((unsigned int)buf,
769 (unsigned int)(buf) + len * sizeof(long));
770
722 local_irq_save(flags); 771 local_irq_save(flags);
723 772
724 bfin_write_MDMA_D0_START_ADDR(buf); 773 bfin_write_MDMA_D0_START_ADDR(buf);
@@ -734,7 +783,7 @@ void dma_insl(const void __iomem *addr, void *buf, unsigned short len)
734 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_32); 783 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_32);
735 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_32); 784 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_32);
736 785
737 blackfin_dcache_invalidate_range((unsigned int)buf, (unsigned int)(buf) + len); 786 SSYNC();
738 787
739 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)); 788 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
740 789
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 5d488ef965ce..3fe0cd49e8db 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -7,7 +7,7 @@
7 * Description: GPIO Abstraction Layer 7 * Description: GPIO Abstraction Layer
8 * 8 *
9 * Modified: 9 * Modified:
10 * Copyright 2006 Analog Devices Inc. 10 * Copyright 2007 Analog Devices Inc.
11 * 11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 * 13 *
@@ -28,9 +28,9 @@
28 */ 28 */
29 29
30/* 30/*
31* Number BF537/6/4 BF561 BF533/2/1 31* Number BF537/6/4 BF561 BF533/2/1 BF549/8/4/2
32* 32*
33* GPIO_0 PF0 PF0 PF0 33* GPIO_0 PF0 PF0 PF0 PA0...PJ13
34* GPIO_1 PF1 PF1 PF1 34* GPIO_1 PF1 PF1 PF1
35* GPIO_2 PF2 PF2 PF2 35* GPIO_2 PF2 PF2 PF2
36* GPIO_3 PF3 PF3 PF3 36* GPIO_3 PF3 PF3 PF3
@@ -80,6 +80,7 @@
80* GPIO_47 PH15 PF47 80* GPIO_47 PH15 PF47
81*/ 81*/
82 82
83#include <linux/delay.h>
83#include <linux/module.h> 84#include <linux/module.h>
84#include <linux/err.h> 85#include <linux/err.h>
85#include <asm/blackfin.h> 86#include <asm/blackfin.h>
@@ -87,6 +88,36 @@
87#include <asm/portmux.h> 88#include <asm/portmux.h>
88#include <linux/irq.h> 89#include <linux/irq.h>
89 90
91#if ANOMALY_05000311 || ANOMALY_05000323
92enum {
93 AWA_data = SYSCR,
94 AWA_data_clear = SYSCR,
95 AWA_data_set = SYSCR,
96 AWA_toggle = SYSCR,
97 AWA_maska = UART_SCR,
98 AWA_maska_clear = UART_SCR,
99 AWA_maska_set = UART_SCR,
100 AWA_maska_toggle = UART_SCR,
101 AWA_maskb = UART_GCTL,
102 AWA_maskb_clear = UART_GCTL,
103 AWA_maskb_set = UART_GCTL,
104 AWA_maskb_toggle = UART_GCTL,
105 AWA_dir = SPORT1_STAT,
106 AWA_polar = SPORT1_STAT,
107 AWA_edge = SPORT1_STAT,
108 AWA_both = SPORT1_STAT,
109#if ANOMALY_05000311
110 AWA_inen = TIMER_ENABLE,
111#elif ANOMALY_05000323
112 AWA_inen = DMA1_1_CONFIG,
113#endif
114};
115 /* Anomaly Workaround */
116#define AWA_DUMMY_READ(name) bfin_read16(AWA_ ## name)
117#else
118#define AWA_DUMMY_READ(...) do { } while (0)
119#endif
120
90#ifdef BF533_FAMILY 121#ifdef BF533_FAMILY
91static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = { 122static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
92 (struct gpio_port_t *) FIO_FLAG_D, 123 (struct gpio_port_t *) FIO_FLAG_D,
@@ -116,11 +147,31 @@ static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
116}; 147};
117#endif 148#endif
118 149
150#ifdef BF548_FAMILY
151static struct gpio_port_t *gpio_array[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
152 (struct gpio_port_t *)PORTA_FER,
153 (struct gpio_port_t *)PORTB_FER,
154 (struct gpio_port_t *)PORTC_FER,
155 (struct gpio_port_t *)PORTD_FER,
156 (struct gpio_port_t *)PORTE_FER,
157 (struct gpio_port_t *)PORTF_FER,
158 (struct gpio_port_t *)PORTG_FER,
159 (struct gpio_port_t *)PORTH_FER,
160 (struct gpio_port_t *)PORTI_FER,
161 (struct gpio_port_t *)PORTJ_FER,
162};
163#endif
164
119static unsigned short reserved_gpio_map[gpio_bank(MAX_BLACKFIN_GPIOS)]; 165static unsigned short reserved_gpio_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
120static unsigned short reserved_peri_map[gpio_bank(MAX_BLACKFIN_GPIOS + 16)]; 166static unsigned short reserved_peri_map[gpio_bank(MAX_BLACKFIN_GPIOS + 16)];
121char *str_ident = NULL;
122 167
123#define RESOURCE_LABEL_SIZE 16 168#define MAX_RESOURCES 256
169#define RESOURCE_LABEL_SIZE 16
170
171struct str_ident {
172 char name[RESOURCE_LABEL_SIZE];
173} *str_ident;
174
124 175
125#ifdef CONFIG_PM 176#ifdef CONFIG_PM
126static unsigned short wakeup_map[gpio_bank(MAX_BLACKFIN_GPIOS)]; 177static unsigned short wakeup_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
@@ -141,21 +192,32 @@ static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG0_INT
141 192
142#endif /* CONFIG_PM */ 193#endif /* CONFIG_PM */
143 194
195#if defined(BF548_FAMILY)
196inline int check_gpio(unsigned short gpio)
197{
198 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
199 || gpio == GPIO_PH14 || gpio == GPIO_PH15
200 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15
201 || gpio > MAX_BLACKFIN_GPIOS)
202 return -EINVAL;
203 return 0;
204}
205#else
144inline int check_gpio(unsigned short gpio) 206inline int check_gpio(unsigned short gpio)
145{ 207{
146 if (gpio >= MAX_BLACKFIN_GPIOS) 208 if (gpio >= MAX_BLACKFIN_GPIOS)
147 return -EINVAL; 209 return -EINVAL;
148 return 0; 210 return 0;
149} 211}
212#endif
150 213
151static void set_label(unsigned short ident, const char *label) 214static void set_label(unsigned short ident, const char *label)
152{ 215{
153 216
154 if (label && str_ident) { 217 if (label && str_ident) {
155 strncpy(str_ident + ident * RESOURCE_LABEL_SIZE, label, 218 strncpy(str_ident[ident].name, label,
156 RESOURCE_LABEL_SIZE); 219 RESOURCE_LABEL_SIZE);
157 str_ident[ident * RESOURCE_LABEL_SIZE + 220 str_ident[ident].name[RESOURCE_LABEL_SIZE - 1] = 0;
158 RESOURCE_LABEL_SIZE - 1] = 0;
159 } 221 }
160} 222}
161 223
@@ -164,14 +226,13 @@ static char *get_label(unsigned short ident)
164 if (!str_ident) 226 if (!str_ident)
165 return "UNKNOWN"; 227 return "UNKNOWN";
166 228
167 return (str_ident[ident * RESOURCE_LABEL_SIZE] ? 229 return (*str_ident[ident].name ? str_ident[ident].name : "UNKNOWN");
168 (str_ident + ident * RESOURCE_LABEL_SIZE) : "UNKNOWN");
169} 230}
170 231
171static int cmp_label(unsigned short ident, const char *label) 232static int cmp_label(unsigned short ident, const char *label)
172{ 233{
173 if (label && str_ident) 234 if (label && str_ident)
174 return strncmp(str_ident + ident * RESOURCE_LABEL_SIZE, 235 return strncmp(str_ident[ident].name,
175 label, strlen(label)); 236 label, strlen(label));
176 else 237 else
177 return -EINVAL; 238 return -EINVAL;
@@ -181,50 +242,84 @@ static int cmp_label(unsigned short ident, const char *label)
181static void port_setup(unsigned short gpio, unsigned short usage) 242static void port_setup(unsigned short gpio, unsigned short usage)
182{ 243{
183 if (!check_gpio(gpio)) { 244 if (!check_gpio(gpio)) {
184 if (usage == GPIO_USAGE) { 245 if (usage == GPIO_USAGE)
185 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); 246 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
186 } else 247 else
187 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); 248 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
188 SSYNC(); 249 SSYNC();
189 } 250 }
190} 251}
252#elif defined(BF548_FAMILY)
253static void port_setup(unsigned short gpio, unsigned short usage)
254{
255 if (usage == GPIO_USAGE)
256 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
257 else
258 gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio);
259 SSYNC();
260}
191#else 261#else
192# define port_setup(...) do { } while (0) 262# define port_setup(...) do { } while (0)
193#endif 263#endif
194 264
195#ifdef BF537_FAMILY 265#ifdef BF537_FAMILY
196 266static struct {
197#define PMUX_LUT_RES 0 267 unsigned short res;
198#define PMUX_LUT_OFFSET 1 268 unsigned short offset;
199#define PMUX_LUT_ENTRIES 41 269} port_mux_lut[] = {
200#define PMUX_LUT_SIZE 2 270 {.res = P_PPI0_D13, .offset = 11},
201 271 {.res = P_PPI0_D14, .offset = 11},
202static unsigned short port_mux_lut[PMUX_LUT_ENTRIES][PMUX_LUT_SIZE] = { 272 {.res = P_PPI0_D15, .offset = 11},
203 {P_PPI0_D13, 11}, {P_PPI0_D14, 11}, {P_PPI0_D15, 11}, 273 {.res = P_SPORT1_TFS, .offset = 11},
204 {P_SPORT1_TFS, 11}, {P_SPORT1_TSCLK, 11}, {P_SPORT1_DTPRI, 11}, 274 {.res = P_SPORT1_TSCLK, .offset = 11},
205 {P_PPI0_D10, 10}, {P_PPI0_D11, 10}, {P_PPI0_D12, 10}, 275 {.res = P_SPORT1_DTPRI, .offset = 11},
206 {P_SPORT1_RSCLK, 10}, {P_SPORT1_RFS, 10}, {P_SPORT1_DRPRI, 10}, 276 {.res = P_PPI0_D10, .offset = 10},
207 {P_PPI0_D8, 9}, {P_PPI0_D9, 9}, {P_SPORT1_DRSEC, 9}, 277 {.res = P_PPI0_D11, .offset = 10},
208 {P_SPORT1_DTSEC, 9}, {P_TMR2, 8}, {P_PPI0_FS3, 8}, {P_TMR3, 7}, 278 {.res = P_PPI0_D12, .offset = 10},
209 {P_SPI0_SSEL4, 7}, {P_TMR4, 6}, {P_SPI0_SSEL5, 6}, {P_TMR5, 5}, 279 {.res = P_SPORT1_RSCLK, .offset = 10},
210 {P_SPI0_SSEL6, 5}, {P_UART1_RX, 4}, {P_UART1_TX, 4}, {P_TMR6, 4}, 280 {.res = P_SPORT1_RFS, .offset = 10},
211 {P_TMR7, 4}, {P_UART0_RX, 3}, {P_UART0_TX, 3}, {P_DMAR0, 3}, 281 {.res = P_SPORT1_DRPRI, .offset = 10},
212 {P_DMAR1, 3}, {P_SPORT0_DTSEC, 1}, {P_SPORT0_DRSEC, 1}, 282 {.res = P_PPI0_D8, .offset = 9},
213 {P_CAN0_RX, 1}, {P_CAN0_TX, 1}, {P_SPI0_SSEL7, 1}, 283 {.res = P_PPI0_D9, .offset = 9},
214 {P_SPORT0_TFS, 0}, {P_SPORT0_DTPRI, 0}, {P_SPI0_SSEL2, 0}, 284 {.res = P_SPORT1_DRSEC, .offset = 9},
215 {P_SPI0_SSEL3, 0} 285 {.res = P_SPORT1_DTSEC, .offset = 9},
286 {.res = P_TMR2, .offset = 8},
287 {.res = P_PPI0_FS3, .offset = 8},
288 {.res = P_TMR3, .offset = 7},
289 {.res = P_SPI0_SSEL4, .offset = 7},
290 {.res = P_TMR4, .offset = 6},
291 {.res = P_SPI0_SSEL5, .offset = 6},
292 {.res = P_TMR5, .offset = 5},
293 {.res = P_SPI0_SSEL6, .offset = 5},
294 {.res = P_UART1_RX, .offset = 4},
295 {.res = P_UART1_TX, .offset = 4},
296 {.res = P_TMR6, .offset = 4},
297 {.res = P_TMR7, .offset = 4},
298 {.res = P_UART0_RX, .offset = 3},
299 {.res = P_UART0_TX, .offset = 3},
300 {.res = P_DMAR0, .offset = 3},
301 {.res = P_DMAR1, .offset = 3},
302 {.res = P_SPORT0_DTSEC, .offset = 1},
303 {.res = P_SPORT0_DRSEC, .offset = 1},
304 {.res = P_CAN0_RX, .offset = 1},
305 {.res = P_CAN0_TX, .offset = 1},
306 {.res = P_SPI0_SSEL7, .offset = 1},
307 {.res = P_SPORT0_TFS, .offset = 0},
308 {.res = P_SPORT0_DTPRI, .offset = 0},
309 {.res = P_SPI0_SSEL2, .offset = 0},
310 {.res = P_SPI0_SSEL3, .offset = 0},
216}; 311};
217 312
218static void portmux_setup(unsigned short per, unsigned short function) 313static void portmux_setup(unsigned short per, unsigned short function)
219{ 314{
220 u16 y, muxreg, offset; 315 u16 y, offset, muxreg;
221 316
222 for (y = 0; y < PMUX_LUT_ENTRIES; y++) { 317 for (y = 0; y < ARRAY_SIZE(port_mux_lut); y++) {
223 if (port_mux_lut[y][PMUX_LUT_RES] == per) { 318 if (port_mux_lut[y].res == per) {
224 319
225 /* SET PORTMUX REG */ 320 /* SET PORTMUX REG */
226 321
227 offset = port_mux_lut[y][PMUX_LUT_OFFSET]; 322 offset = port_mux_lut[y].offset;
228 muxreg = bfin_read_PORT_MUX(); 323 muxreg = bfin_read_PORT_MUX();
229 324
230 if (offset != 1) { 325 if (offset != 1) {
@@ -238,18 +333,42 @@ static void portmux_setup(unsigned short per, unsigned short function)
238 } 333 }
239 } 334 }
240} 335}
336#elif defined(BF548_FAMILY)
337inline void portmux_setup(unsigned short portno, unsigned short function)
338{
339 u32 pmux;
340
341 pmux = gpio_array[gpio_bank(portno)]->port_mux;
342
343 pmux &= ~(0x3 << (2 * gpio_sub_n(portno)));
344 pmux |= (function & 0x3) << (2 * gpio_sub_n(portno));
241 345
346 gpio_array[gpio_bank(portno)]->port_mux = pmux;
347}
348
349inline u16 get_portmux(unsigned short portno)
350{
351 u32 pmux;
352
353 pmux = gpio_array[gpio_bank(portno)]->port_mux;
354
355 return (pmux >> (2 * gpio_sub_n(portno)) & 0x3);
356}
242#else 357#else
243# define portmux_setup(...) do { } while (0) 358# define portmux_setup(...) do { } while (0)
244#endif 359#endif
245 360
361#ifndef BF548_FAMILY
246static void default_gpio(unsigned short gpio) 362static void default_gpio(unsigned short gpio)
247{ 363{
248 unsigned short bank, bitmask; 364 unsigned short bank, bitmask;
365 unsigned long flags;
249 366
250 bank = gpio_bank(gpio); 367 bank = gpio_bank(gpio);
251 bitmask = gpio_bit(gpio); 368 bitmask = gpio_bit(gpio);
252 369
370 local_irq_save(flags);
371
253 gpio_bankb[bank]->maska_clear = bitmask; 372 gpio_bankb[bank]->maska_clear = bitmask;
254 gpio_bankb[bank]->maskb_clear = bitmask; 373 gpio_bankb[bank]->maskb_clear = bitmask;
255 SSYNC(); 374 SSYNC();
@@ -258,24 +377,32 @@ static void default_gpio(unsigned short gpio)
258 gpio_bankb[bank]->polar &= ~bitmask; 377 gpio_bankb[bank]->polar &= ~bitmask;
259 gpio_bankb[bank]->both &= ~bitmask; 378 gpio_bankb[bank]->both &= ~bitmask;
260 gpio_bankb[bank]->edge &= ~bitmask; 379 gpio_bankb[bank]->edge &= ~bitmask;
380 AWA_DUMMY_READ(edge);
381 local_irq_restore(flags);
382
261} 383}
384#else
385# define default_gpio(...) do { } while (0)
386#endif
262 387
263static int __init bfin_gpio_init(void) 388static int __init bfin_gpio_init(void)
264{ 389{
265 390 str_ident = kcalloc(MAX_RESOURCES,
266 str_ident = kzalloc(RESOURCE_LABEL_SIZE * 256, GFP_KERNEL); 391 sizeof(struct str_ident), GFP_KERNEL);
267 if (!str_ident) 392 if (str_ident == NULL)
268 return -ENOMEM; 393 return -ENOMEM;
269 394
395 memset(str_ident, 0, MAX_RESOURCES * sizeof(struct str_ident));
396
270 printk(KERN_INFO "Blackfin GPIO Controller\n"); 397 printk(KERN_INFO "Blackfin GPIO Controller\n");
271 398
272 return 0; 399 return 0;
273 400
274} 401}
275
276arch_initcall(bfin_gpio_init); 402arch_initcall(bfin_gpio_init);
277 403
278 404
405#ifndef BF548_FAMILY
279/*********************************************************** 406/***********************************************************
280* 407*
281* FUNCTIONS: Blackfin General Purpose Ports Access Functions 408* FUNCTIONS: Blackfin General Purpose Ports Access Functions
@@ -305,6 +432,7 @@ void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \
305 gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \ 432 gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \
306 else \ 433 else \
307 gpio_bankb[gpio_bank(gpio)]->name &= ~gpio_bit(gpio); \ 434 gpio_bankb[gpio_bank(gpio)]->name &= ~gpio_bit(gpio); \
435 AWA_DUMMY_READ(name); \
308 local_irq_restore(flags); \ 436 local_irq_restore(flags); \
309} \ 437} \
310EXPORT_SYMBOL(set_gpio_ ## name); 438EXPORT_SYMBOL(set_gpio_ ## name);
@@ -316,6 +444,22 @@ SET_GPIO(edge)
316SET_GPIO(both) 444SET_GPIO(both)
317 445
318 446
447#if ANOMALY_05000311 || ANOMALY_05000323
448#define SET_GPIO_SC(name) \
449void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \
450{ \
451 unsigned long flags; \
452 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); \
453 local_irq_save(flags); \
454 if (arg) \
455 gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \
456 else \
457 gpio_bankb[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \
458 AWA_DUMMY_READ(name); \
459 local_irq_restore(flags); \
460} \
461EXPORT_SYMBOL(set_gpio_ ## name);
462#else
319#define SET_GPIO_SC(name) \ 463#define SET_GPIO_SC(name) \
320void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \ 464void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \
321{ \ 465{ \
@@ -326,37 +470,20 @@ void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \
326 gpio_bankb[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \ 470 gpio_bankb[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \
327} \ 471} \
328EXPORT_SYMBOL(set_gpio_ ## name); 472EXPORT_SYMBOL(set_gpio_ ## name);
473#endif
329 474
330SET_GPIO_SC(maska) 475SET_GPIO_SC(maska)
331SET_GPIO_SC(maskb) 476SET_GPIO_SC(maskb)
332
333#if defined(ANOMALY_05000311)
334void set_gpio_data(unsigned short gpio, unsigned short arg)
335{
336 unsigned long flags;
337 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
338 local_irq_save(flags);
339 if (arg)
340 gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
341 else
342 gpio_bankb[gpio_bank(gpio)]->data_clear = gpio_bit(gpio);
343 bfin_read_CHIPID();
344 local_irq_restore(flags);
345}
346EXPORT_SYMBOL(set_gpio_data);
347#else
348SET_GPIO_SC(data) 477SET_GPIO_SC(data)
349#endif
350
351 478
352#if defined(ANOMALY_05000311) 479#if ANOMALY_05000311 || ANOMALY_05000323
353void set_gpio_toggle(unsigned short gpio) 480void set_gpio_toggle(unsigned short gpio)
354{ 481{
355 unsigned long flags; 482 unsigned long flags;
356 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); 483 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
357 local_irq_save(flags); 484 local_irq_save(flags);
358 gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); 485 gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
359 bfin_read_CHIPID(); 486 AWA_DUMMY_READ(toggle);
360 local_irq_restore(flags); 487 local_irq_restore(flags);
361} 488}
362#else 489#else
@@ -371,13 +498,27 @@ EXPORT_SYMBOL(set_gpio_toggle);
371 498
372/*Set current PORT date (16-bit word)*/ 499/*Set current PORT date (16-bit word)*/
373 500
501#if ANOMALY_05000311 || ANOMALY_05000323
374#define SET_GPIO_P(name) \ 502#define SET_GPIO_P(name) \
375void set_gpiop_ ## name(unsigned short gpio, unsigned short arg) \ 503void set_gpiop_ ## name(unsigned short gpio, unsigned short arg) \
376{ \ 504{ \
505 unsigned long flags; \
506 local_irq_save(flags); \
377 gpio_bankb[gpio_bank(gpio)]->name = arg; \ 507 gpio_bankb[gpio_bank(gpio)]->name = arg; \
508 AWA_DUMMY_READ(name); \
509 local_irq_restore(flags); \
378} \ 510} \
379EXPORT_SYMBOL(set_gpiop_ ## name); 511EXPORT_SYMBOL(set_gpiop_ ## name);
512#else
513#define SET_GPIO_P(name) \
514void set_gpiop_ ## name(unsigned short gpio, unsigned short arg) \
515{ \
516 gpio_bankb[gpio_bank(gpio)]->name = arg; \
517} \
518EXPORT_SYMBOL(set_gpiop_ ## name);
519#endif
380 520
521SET_GPIO_P(data)
381SET_GPIO_P(dir) 522SET_GPIO_P(dir)
382SET_GPIO_P(inen) 523SET_GPIO_P(inen)
383SET_GPIO_P(polar) 524SET_GPIO_P(polar)
@@ -387,31 +528,30 @@ SET_GPIO_P(maska)
387SET_GPIO_P(maskb) 528SET_GPIO_P(maskb)
388 529
389 530
390#if defined(ANOMALY_05000311)
391void set_gpiop_data(unsigned short gpio, unsigned short arg)
392{
393 unsigned long flags;
394 local_irq_save(flags);
395 gpio_bankb[gpio_bank(gpio)]->data = arg;
396 bfin_read_CHIPID();
397 local_irq_restore(flags);
398}
399EXPORT_SYMBOL(set_gpiop_data);
400#else
401SET_GPIO_P(data)
402#endif
403
404
405
406/* Get a specific bit */ 531/* Get a specific bit */
407 532#if ANOMALY_05000311 || ANOMALY_05000323
533#define GET_GPIO(name) \
534unsigned short get_gpio_ ## name(unsigned short gpio) \
535{ \
536 unsigned long flags; \
537 unsigned short ret; \
538 local_irq_save(flags); \
539 ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio)); \
540 AWA_DUMMY_READ(name); \
541 local_irq_restore(flags); \
542 return ret; \
543} \
544EXPORT_SYMBOL(get_gpio_ ## name);
545#else
408#define GET_GPIO(name) \ 546#define GET_GPIO(name) \
409unsigned short get_gpio_ ## name(unsigned short gpio) \ 547unsigned short get_gpio_ ## name(unsigned short gpio) \
410{ \ 548{ \
411 return (0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio))); \ 549 return (0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio))); \
412} \ 550} \
413EXPORT_SYMBOL(get_gpio_ ## name); 551EXPORT_SYMBOL(get_gpio_ ## name);
552#endif
414 553
554GET_GPIO(data)
415GET_GPIO(dir) 555GET_GPIO(dir)
416GET_GPIO(inen) 556GET_GPIO(inen)
417GET_GPIO(polar) 557GET_GPIO(polar)
@@ -420,33 +560,31 @@ GET_GPIO(both)
420GET_GPIO(maska) 560GET_GPIO(maska)
421GET_GPIO(maskb) 561GET_GPIO(maskb)
422 562
423
424#if defined(ANOMALY_05000311)
425unsigned short get_gpio_data(unsigned short gpio)
426{
427 unsigned long flags;
428 unsigned short ret;
429 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
430 local_irq_save(flags);
431 ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->data >> gpio_sub_n(gpio));
432 bfin_read_CHIPID();
433 local_irq_restore(flags);
434 return ret;
435}
436EXPORT_SYMBOL(get_gpio_data);
437#else
438GET_GPIO(data)
439#endif
440
441/*Get current PORT date (16-bit word)*/ 563/*Get current PORT date (16-bit word)*/
442 564
565#if ANOMALY_05000311 || ANOMALY_05000323
566#define GET_GPIO_P(name) \
567unsigned short get_gpiop_ ## name(unsigned short gpio) \
568{ \
569 unsigned long flags; \
570 unsigned short ret; \
571 local_irq_save(flags); \
572 ret = (gpio_bankb[gpio_bank(gpio)]->name); \
573 AWA_DUMMY_READ(name); \
574 local_irq_restore(flags); \
575 return ret; \
576} \
577EXPORT_SYMBOL(get_gpiop_ ## name);
578#else
443#define GET_GPIO_P(name) \ 579#define GET_GPIO_P(name) \
444unsigned short get_gpiop_ ## name(unsigned short gpio) \ 580unsigned short get_gpiop_ ## name(unsigned short gpio) \
445{ \ 581{ \
446 return (gpio_bankb[gpio_bank(gpio)]->name);\ 582 return (gpio_bankb[gpio_bank(gpio)]->name);\
447} \ 583} \
448EXPORT_SYMBOL(get_gpiop_ ## name); 584EXPORT_SYMBOL(get_gpiop_ ## name);
585#endif
449 586
587GET_GPIO_P(data)
450GET_GPIO_P(dir) 588GET_GPIO_P(dir)
451GET_GPIO_P(inen) 589GET_GPIO_P(inen)
452GET_GPIO_P(polar) 590GET_GPIO_P(polar)
@@ -455,21 +593,6 @@ GET_GPIO_P(both)
455GET_GPIO_P(maska) 593GET_GPIO_P(maska)
456GET_GPIO_P(maskb) 594GET_GPIO_P(maskb)
457 595
458#if defined(ANOMALY_05000311)
459unsigned short get_gpiop_data(unsigned short gpio)
460{
461 unsigned long flags;
462 unsigned short ret;
463 local_irq_save(flags);
464 ret = gpio_bankb[gpio_bank(gpio)]->data;
465 bfin_read_CHIPID();
466 local_irq_restore(flags);
467 return ret;
468}
469EXPORT_SYMBOL(get_gpiop_data);
470#else
471GET_GPIO_P(data)
472#endif
473 596
474#ifdef CONFIG_PM 597#ifdef CONFIG_PM
475/*********************************************************** 598/***********************************************************
@@ -593,6 +716,8 @@ u32 gpio_pm_setup(void)
593 } 716 }
594 } 717 }
595 718
719 AWA_DUMMY_READ(maskb_set);
720
596 if (sic_iwr) 721 if (sic_iwr)
597 return sic_iwr; 722 return sic_iwr;
598 else 723 else
@@ -624,12 +749,99 @@ void gpio_pm_restore(void)
624 749
625 gpio_bankb[bank]->maskb = gpio_bank_saved[bank].maskb; 750 gpio_bankb[bank]->maskb = gpio_bank_saved[bank].maskb;
626 } 751 }
752 AWA_DUMMY_READ(maskb);
627} 753}
628 754
629#endif 755#endif
756#endif /* BF548_FAMILY */
630 757
758/***********************************************************
759*
760* FUNCTIONS: Blackfin Peripheral Resource Allocation
761* and PortMux Setup
762*
763* INPUTS/OUTPUTS:
764* per Peripheral Identifier
765* label String
766*
767* DESCRIPTION: Blackfin Peripheral Resource Allocation and Setup API
768*
769* CAUTION:
770*************************************************************
771* MODIFICATION HISTORY :
772**************************************************************/
773
774#ifdef BF548_FAMILY
775int peripheral_request(unsigned short per, const char *label)
776{
777 unsigned long flags;
778 unsigned short ident = P_IDENT(per);
779
780 /*
781 * Don't cares are pins with only one dedicated function
782 */
783
784 if (per & P_DONTCARE)
785 return 0;
786
787 if (!(per & P_DEFINED))
788 return -ENODEV;
789
790 if (check_gpio(ident) < 0)
791 return -EINVAL;
792
793 local_irq_save(flags);
794
795 if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
796 printk(KERN_ERR
797 "%s: Peripheral %d is already reserved as GPIO by %s !\n",
798 __FUNCTION__, ident, get_label(ident));
799 dump_stack();
800 local_irq_restore(flags);
801 return -EBUSY;
802 }
803
804 if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) {
805
806 u16 funct = get_portmux(ident);
807
808 /*
809 * Pin functions like AMC address strobes my
810 * be requested and used by several drivers
811 */
812
813 if (!((per & P_MAYSHARE) && (funct == P_FUNCT2MUX(per)))) {
814
815 /*
816 * Allow that the identical pin function can
817 * be requested from the same driver twice
818 */
819
820 if (cmp_label(ident, label) == 0)
821 goto anyway;
631 822
823 printk(KERN_ERR
824 "%s: Peripheral %d function %d is already reserved by %s !\n",
825 __FUNCTION__, ident, P_FUNCT2MUX(per), get_label(ident));
826 dump_stack();
827 local_irq_restore(flags);
828 return -EBUSY;
829 }
830 }
632 831
832anyway:
833 reserved_peri_map[gpio_bank(ident)] |= gpio_bit(ident);
834
835 portmux_setup(ident, P_FUNCT2MUX(per));
836 port_setup(ident, PERIPHERAL_USAGE);
837
838 local_irq_restore(flags);
839 set_label(ident, label);
840
841 return 0;
842}
843EXPORT_SYMBOL(peripheral_request);
844#else
633 845
634int peripheral_request(unsigned short per, const char *label) 846int peripheral_request(unsigned short per, const char *label)
635{ 847{
@@ -680,7 +892,7 @@ int peripheral_request(unsigned short per, const char *label)
680 892
681 printk(KERN_ERR 893 printk(KERN_ERR
682 "%s: Peripheral %d function %d is already" 894 "%s: Peripheral %d function %d is already"
683 "reserved by %s !\n", 895 " reserved by %s !\n",
684 __FUNCTION__, ident, P_FUNCT2MUX(per), 896 __FUNCTION__, ident, P_FUNCT2MUX(per),
685 get_label(ident)); 897 get_label(ident));
686 dump_stack(); 898 dump_stack();
@@ -691,8 +903,6 @@ int peripheral_request(unsigned short per, const char *label)
691 } 903 }
692 904
693anyway: 905anyway:
694
695
696 portmux_setup(per, P_FUNCT2MUX(per)); 906 portmux_setup(per, P_FUNCT2MUX(per));
697 907
698 port_setup(ident, PERIPHERAL_USAGE); 908 port_setup(ident, PERIPHERAL_USAGE);
@@ -704,6 +914,7 @@ anyway:
704 return 0; 914 return 0;
705} 915}
706EXPORT_SYMBOL(peripheral_request); 916EXPORT_SYMBOL(peripheral_request);
917#endif
707 918
708int peripheral_request_list(unsigned short per[], const char *label) 919int peripheral_request_list(unsigned short per[], const char *label)
709{ 920{
@@ -711,9 +922,15 @@ int peripheral_request_list(unsigned short per[], const char *label)
711 int ret; 922 int ret;
712 923
713 for (cnt = 0; per[cnt] != 0; cnt++) { 924 for (cnt = 0; per[cnt] != 0; cnt++) {
925
714 ret = peripheral_request(per[cnt], label); 926 ret = peripheral_request(per[cnt], label);
715 if (ret < 0) 927
716 return ret; 928 if (ret < 0) {
929 for ( ; cnt > 0; cnt--) {
930 peripheral_free(per[cnt - 1]);
931 }
932 return ret;
933 }
717 } 934 }
718 935
719 return 0; 936 return 0;
@@ -748,6 +965,8 @@ void peripheral_free(unsigned short per)
748 965
749 reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident); 966 reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident);
750 967
968 set_label(ident, "free");
969
751 local_irq_restore(flags); 970 local_irq_restore(flags);
752} 971}
753EXPORT_SYMBOL(peripheral_free); 972EXPORT_SYMBOL(peripheral_free);
@@ -768,8 +987,8 @@ EXPORT_SYMBOL(peripheral_free_list);
768* FUNCTIONS: Blackfin GPIO Driver 987* FUNCTIONS: Blackfin GPIO Driver
769* 988*
770* INPUTS/OUTPUTS: 989* INPUTS/OUTPUTS:
771* gpio - GPIO Number between 0 and MAX_BLACKFIN_GPIOS 990* gpio PIO Number between 0 and MAX_BLACKFIN_GPIOS
772* 991* label String
773* 992*
774* DESCRIPTION: Blackfin GPIO Driver API 993* DESCRIPTION: Blackfin GPIO Driver API
775* 994*
@@ -787,17 +1006,39 @@ int gpio_request(unsigned short gpio, const char *label)
787 1006
788 local_irq_save(flags); 1007 local_irq_save(flags);
789 1008
1009 /*
1010 * Allow that the identical GPIO can
1011 * be requested from the same driver twice
1012 * Do nothing and return -
1013 */
1014
1015 if (cmp_label(gpio, label) == 0) {
1016 local_irq_restore(flags);
1017 return 0;
1018 }
1019
790 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) { 1020 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
791 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved!\n", gpio); 1021 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n",
1022 gpio, get_label(gpio));
792 dump_stack(); 1023 dump_stack();
793 local_irq_restore(flags); 1024 local_irq_restore(flags);
794 return -EBUSY; 1025 return -EBUSY;
795 } 1026 }
1027 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
1028 printk(KERN_ERR
1029 "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n",
1030 gpio, get_label(gpio));
1031 dump_stack();
1032 local_irq_restore(flags);
1033 return -EBUSY;
1034 }
1035
796 reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio); 1036 reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio);
797 1037
798 local_irq_restore(flags); 1038 local_irq_restore(flags);
799 1039
800 port_setup(gpio, GPIO_USAGE); 1040 port_setup(gpio, GPIO_USAGE);
1041 set_label(gpio, label);
801 1042
802 return 0; 1043 return 0;
803} 1044}
@@ -823,10 +1064,57 @@ void gpio_free(unsigned short gpio)
823 1064
824 reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio); 1065 reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
825 1066
1067 set_label(gpio, "free");
1068
826 local_irq_restore(flags); 1069 local_irq_restore(flags);
827} 1070}
828EXPORT_SYMBOL(gpio_free); 1071EXPORT_SYMBOL(gpio_free);
829 1072
1073#ifdef BF548_FAMILY
1074void gpio_direction_input(unsigned short gpio)
1075{
1076 unsigned long flags;
1077
1078 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
1079
1080 local_irq_save(flags);
1081 gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio);
1082 gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio);
1083 local_irq_restore(flags);
1084}
1085EXPORT_SYMBOL(gpio_direction_input);
1086
1087void gpio_direction_output(unsigned short gpio)
1088{
1089 unsigned long flags;
1090
1091 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
1092
1093 local_irq_save(flags);
1094 gpio_array[gpio_bank(gpio)]->port_inen &= ~gpio_bit(gpio);
1095 gpio_array[gpio_bank(gpio)]->port_dir_set = gpio_bit(gpio);
1096 local_irq_restore(flags);
1097}
1098EXPORT_SYMBOL(gpio_direction_output);
1099
1100void gpio_set_value(unsigned short gpio, unsigned short arg)
1101{
1102 if (arg)
1103 gpio_array[gpio_bank(gpio)]->port_set = gpio_bit(gpio);
1104 else
1105 gpio_array[gpio_bank(gpio)]->port_clear = gpio_bit(gpio);
1106
1107}
1108EXPORT_SYMBOL(gpio_set_value);
1109
1110unsigned short gpio_get_value(unsigned short gpio)
1111{
1112 return (1 & (gpio_array[gpio_bank(gpio)]->port_data >> gpio_sub_n(gpio)));
1113}
1114EXPORT_SYMBOL(gpio_get_value);
1115
1116#else
1117
830void gpio_direction_input(unsigned short gpio) 1118void gpio_direction_input(unsigned short gpio)
831{ 1119{
832 unsigned long flags; 1120 unsigned long flags;
@@ -836,6 +1124,7 @@ void gpio_direction_input(unsigned short gpio)
836 local_irq_save(flags); 1124 local_irq_save(flags);
837 gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); 1125 gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
838 gpio_bankb[gpio_bank(gpio)]->inen |= gpio_bit(gpio); 1126 gpio_bankb[gpio_bank(gpio)]->inen |= gpio_bit(gpio);
1127 AWA_DUMMY_READ(inen);
839 local_irq_restore(flags); 1128 local_irq_restore(flags);
840} 1129}
841EXPORT_SYMBOL(gpio_direction_input); 1130EXPORT_SYMBOL(gpio_direction_input);
@@ -849,6 +1138,28 @@ void gpio_direction_output(unsigned short gpio)
849 local_irq_save(flags); 1138 local_irq_save(flags);
850 gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); 1139 gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
851 gpio_bankb[gpio_bank(gpio)]->dir |= gpio_bit(gpio); 1140 gpio_bankb[gpio_bank(gpio)]->dir |= gpio_bit(gpio);
1141 AWA_DUMMY_READ(dir);
852 local_irq_restore(flags); 1142 local_irq_restore(flags);
853} 1143}
854EXPORT_SYMBOL(gpio_direction_output); 1144EXPORT_SYMBOL(gpio_direction_output);
1145
1146/* If we are booting from SPI and our board lacks a strong enough pull up,
1147 * the core can reset and execute the bootrom faster than the resistor can
1148 * pull the signal logically high. To work around this (common) error in
1149 * board design, we explicitly set the pin back to GPIO mode, force /CS
1150 * high, and wait for the electrons to do their thing.
1151 *
1152 * This function only makes sense to be called from reset code, but it
1153 * lives here as we need to force all the GPIO states w/out going through
1154 * BUG() checks and such.
1155 */
1156void bfin_gpio_reset_spi0_ssel1(void)
1157{
1158 u16 gpio = P_IDENT(P_SPI0_SSEL1);
1159
1160 port_setup(gpio, GPIO_USAGE);
1161 gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
1162 udelay(1);
1163}
1164
1165#endif /*BF548_FAMILY */
diff --git a/arch/blackfin/kernel/bfin_ksyms.c b/arch/blackfin/kernel/bfin_ksyms.c
index 70455949cfd2..2198afe40f33 100644
--- a/arch/blackfin/kernel/bfin_ksyms.c
+++ b/arch/blackfin/kernel/bfin_ksyms.c
@@ -60,6 +60,7 @@ EXPORT_SYMBOL(csum_partial_copy);
60 * their interface isn't gonna change any time soon now, so 60 * their interface isn't gonna change any time soon now, so
61 * it's OK to leave it out of version control. 61 * it's OK to leave it out of version control.
62 */ 62 */
63EXPORT_SYMBOL(strcpy);
63EXPORT_SYMBOL(memcpy); 64EXPORT_SYMBOL(memcpy);
64EXPORT_SYMBOL(memset); 65EXPORT_SYMBOL(memset);
65EXPORT_SYMBOL(memcmp); 66EXPORT_SYMBOL(memcmp);
diff --git a/arch/blackfin/kernel/cacheinit.c b/arch/blackfin/kernel/cacheinit.c
index 4d41a40e8133..62cbba7364b0 100644
--- a/arch/blackfin/kernel/cacheinit.c
+++ b/arch/blackfin/kernel/cacheinit.c
@@ -21,9 +21,10 @@
21 21
22#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <asm/blackfin.h> 23#include <asm/blackfin.h>
24#include <asm/cplb.h>
24#include <asm/cplbinit.h> 25#include <asm/cplbinit.h>
25 26
26#if defined(CONFIG_BLKFIN_CACHE) 27#if defined(CONFIG_BFIN_ICACHE)
27void bfin_icache_init(void) 28void bfin_icache_init(void)
28{ 29{
29 unsigned long *table = icplb_table; 30 unsigned long *table = icplb_table;
@@ -44,7 +45,7 @@ void bfin_icache_init(void)
44} 45}
45#endif 46#endif
46 47
47#if defined(CONFIG_BLKFIN_DCACHE) 48#if defined(CONFIG_BFIN_DCACHE)
48void bfin_dcache_init(void) 49void bfin_dcache_init(void)
49{ 50{
50 unsigned long *table = dcplb_table; 51 unsigned long *table = dcplb_table;
diff --git a/arch/blackfin/kernel/cplbinit.c b/arch/blackfin/kernel/cplbinit.c
index bbdb403fcb55..f2db6a5e2b5b 100644
--- a/arch/blackfin/kernel/cplbinit.c
+++ b/arch/blackfin/kernel/cplbinit.c
@@ -23,6 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24 24
25#include <asm/blackfin.h> 25#include <asm/blackfin.h>
26#include <asm/cplb.h>
26#include <asm/cplbinit.h> 27#include <asm/cplbinit.h>
27 28
28u_long icplb_table[MAX_CPLBS+1]; 29u_long icplb_table[MAX_CPLBS+1];
@@ -56,7 +57,7 @@ struct s_cplb {
56 struct cplb_tab switch_d; 57 struct cplb_tab switch_d;
57}; 58};
58 59
59#if defined(CONFIG_BLKFIN_DCACHE) || defined(CONFIG_BLKFIN_CACHE) 60#if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE)
60static struct cplb_desc cplb_data[] = { 61static struct cplb_desc cplb_data[] = {
61 { 62 {
62 .start = 0, 63 .start = 0,
@@ -230,8 +231,8 @@ static void __fill_code_cplbtab(struct cplb_tab *t, int i, u32 a_start, u32 a_en
230 cplb_data[i].psize, 231 cplb_data[i].psize,
231 cplb_data[i].i_conf); 232 cplb_data[i].i_conf);
232 } else { 233 } else {
233#if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263)) 234#if defined(CONFIG_BFIN_ICACHE)
234 if (i == SDRAM_KERN) { 235 if (ANOMALY_05000263 && i == SDRAM_KERN) {
235 fill_cplbtab(t, 236 fill_cplbtab(t,
236 cplb_data[i].start, 237 cplb_data[i].start,
237 cplb_data[i].end, 238 cplb_data[i].end,
diff --git a/arch/blackfin/kernel/early_printk.c b/arch/blackfin/kernel/early_printk.c
new file mode 100644
index 000000000000..6ec518a81113
--- /dev/null
+++ b/arch/blackfin/kernel/early_printk.c
@@ -0,0 +1,214 @@
1/*
2 * File: arch/blackfin/kernel/early_printk.c
3 * Based on: arch/x86_64/kernel/early_printk.c
4 * Author: Robin Getz <rgetz@blackfin.uclinux.org
5 *
6 * Created: 14Aug2007
7 * Description: allow a console to be used for early printk
8 *
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 */
24
25#include <linux/kernel.h>
26#include <linux/init.h>
27#include <linux/serial_core.h>
28#include <linux/console.h>
29#include <linux/string.h>
30#include <asm/blackfin.h>
31#include <asm/irq_handler.h>
32#include <asm/early_printk.h>
33
34#ifdef CONFIG_SERIAL_BFIN
35extern struct console *bfin_earlyserial_init(unsigned int port,
36 unsigned int cflag);
37#endif
38
39static struct console *early_console;
40
41/* Default console */
42#define DEFAULT_PORT 0
43#define DEFAULT_CFLAG CS8|B57600
44
45/* Default console for early crashes */
46#define DEFAULT_EARLY_PORT "serial,uart0,57600"
47
48#ifdef CONFIG_SERIAL_CORE
49/* What should get here is "0,57600" */
50static struct console * __init earlyserial_init(char *buf)
51{
52 int baud, bit;
53 char parity;
54 unsigned int serial_port = DEFAULT_PORT;
55 unsigned int cflag = DEFAULT_CFLAG;
56
57 serial_port = simple_strtoul(buf, &buf, 10);
58 buf++;
59
60 cflag = 0;
61 baud = simple_strtoul(buf, &buf, 10);
62 switch (baud) {
63 case 1200:
64 cflag |= B1200;
65 break;
66 case 2400:
67 cflag |= B2400;
68 break;
69 case 4800:
70 cflag |= B4800;
71 break;
72 case 9600:
73 cflag |= B9600;
74 break;
75 case 19200:
76 cflag |= B19200;
77 break;
78 case 38400:
79 cflag |= B38400;
80 break;
81 case 115200:
82 cflag |= B115200;
83 break;
84 default:
85 cflag |= B57600;
86 }
87
88 parity = buf[0];
89 buf++;
90 switch (parity) {
91 case 'e':
92 cflag |= PARENB;
93 break;
94 case 'o':
95 cflag |= PARODD;
96 break;
97 }
98
99 bit = simple_strtoul(buf, &buf, 10);
100 switch (bit) {
101 case 5:
102 cflag |= CS5;
103 break;
104 case 6:
105 cflag |= CS5;
106 break;
107 case 7:
108 cflag |= CS5;
109 break;
110 default:
111 cflag |= CS8;
112 }
113
114#ifdef CONFIG_SERIAL_BFIN
115 return bfin_earlyserial_init(serial_port, cflag);
116#else
117 return NULL;
118#endif
119
120}
121#endif
122
123int __init setup_early_printk(char *buf)
124{
125
126 /* Crashing in here would be really bad, so check both the var
127 and the pointer before we start using it
128 */
129 if (!buf)
130 return 0;
131
132 if (!*buf)
133 return 0;
134
135 if (early_console != NULL)
136 return 0;
137
138#ifdef CONFIG_SERIAL_BFIN
139 /* Check for Blackfin Serial */
140 if (!strncmp(buf, "serial,uart", 11)) {
141 buf += 11;
142 early_console = earlyserial_init(buf);
143 }
144#endif
145#ifdef CONFIG_FB
146 /* TODO: add framebuffer console support */
147#endif
148
149 if (likely(early_console)) {
150 early_console->flags |= CON_BOOT;
151
152 register_console(early_console);
153 printk(KERN_INFO "early printk enabled on %s%d\n",
154 early_console->name,
155 early_console->index);
156 }
157
158 return 0;
159}
160
161/*
162 * Set up a temporary Event Vector Table, so if something bad happens before
163 * the kernel is fully started, it doesn't vector off into somewhere we don't
164 * know
165 */
166
167asmlinkage void __init init_early_exception_vectors(void)
168{
169 SSYNC();
170
171 /* cannot program in software:
172 * evt0 - emulation (jtag)
173 * evt1 - reset
174 */
175 bfin_write_EVT2(early_trap);
176 bfin_write_EVT3(early_trap);
177 bfin_write_EVT5(early_trap);
178 bfin_write_EVT6(early_trap);
179 bfin_write_EVT7(early_trap);
180 bfin_write_EVT8(early_trap);
181 bfin_write_EVT9(early_trap);
182 bfin_write_EVT10(early_trap);
183 bfin_write_EVT11(early_trap);
184 bfin_write_EVT12(early_trap);
185 bfin_write_EVT13(early_trap);
186 bfin_write_EVT14(early_trap);
187 bfin_write_EVT15(early_trap);
188 CSYNC();
189
190 /* Set all the return from interupt, exception, NMI to a known place
191 * so if we do a RETI, RETX or RETN by mistake - we go somewhere known
192 * Note - don't change RETS - we are in a subroutine, or
193 * RETE - since it might screw up if emulator is attached
194 */
195 asm("\tRETI = %0; RETX = %0; RETN = %0;\n"
196 : : "p"(early_trap));
197
198}
199
200asmlinkage void __init early_trap_c(struct pt_regs *fp, void *retaddr)
201{
202 /* This can happen before the uart is initialized, so initialize
203 * the UART now
204 */
205 if (likely(early_console == NULL))
206 setup_early_printk(DEFAULT_EARLY_PORT);
207
208 dump_bfin_regs(fp, retaddr);
209 dump_bfin_trace_buffer();
210
211 panic("Died early");
212}
213
214early_param("earlyprintk", setup_early_printk);
diff --git a/arch/blackfin/kernel/irqchip.c b/arch/blackfin/kernel/irqchip.c
index 1fc001c7abda..73647c158774 100644
--- a/arch/blackfin/kernel/irqchip.c
+++ b/arch/blackfin/kernel/irqchip.c
@@ -34,6 +34,7 @@
34#include <linux/kallsyms.h> 34#include <linux/kallsyms.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/irq.h> 36#include <linux/irq.h>
37#include <asm/trace.h>
37 38
38static unsigned long irq_err_count; 39static unsigned long irq_err_count;
39static spinlock_t irq_controller_lock; 40static spinlock_t irq_controller_lock;
@@ -97,9 +98,8 @@ int show_interrupts(struct seq_file *p, void *v)
97 */ 98 */
98 99
99#ifdef CONFIG_DO_IRQ_L1 100#ifdef CONFIG_DO_IRQ_L1
100asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)__attribute__((l1_text)); 101__attribute__((l1_text))
101#endif 102#endif
102
103asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) 103asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
104{ 104{
105 struct pt_regs *old_regs; 105 struct pt_regs *old_regs;
@@ -144,4 +144,12 @@ void __init init_IRQ(void)
144 } 144 }
145 145
146 init_arch_irq(); 146 init_arch_irq();
147
148#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
149 /* Now that evt_ivhw is set up, turn this on */
150 trace_buff_offset = 0;
151 bfin_write_TBUFCTL(BFIN_TRACE_ON);
152 printk(KERN_INFO "Hardware Trace expanded to %ik\n",
153 1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN);
154#endif
147} 155}
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 6a7aefe48346..9124467651c4 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -134,31 +134,6 @@ void cpu_idle(void)
134 } 134 }
135} 135}
136 136
137void machine_restart(char *__unused)
138{
139#if defined(CONFIG_BLKFIN_CACHE)
140 bfin_write_IMEM_CONTROL(0x01);
141 SSYNC();
142#endif
143 bfin_reset();
144 /* Dont do anything till the reset occurs */
145 while (1) {
146 SSYNC();
147 }
148}
149
150void machine_halt(void)
151{
152 for (;;)
153 asm volatile ("idle");
154}
155
156void machine_power_off(void)
157{
158 for (;;)
159 asm volatile ("idle");
160}
161
162void show_regs(struct pt_regs *regs) 137void show_regs(struct pt_regs *regs)
163{ 138{
164 printk(KERN_NOTICE "\n"); 139 printk(KERN_NOTICE "\n");
@@ -420,7 +395,8 @@ void finish_atomic_sections (struct pt_regs *regs)
420#if defined(CONFIG_ACCESS_CHECK) 395#if defined(CONFIG_ACCESS_CHECK)
421int _access_ok(unsigned long addr, unsigned long size) 396int _access_ok(unsigned long addr, unsigned long size)
422{ 397{
423 398 if (size == 0)
399 return 1;
424 if (addr > (addr + size)) 400 if (addr > (addr + size))
425 return 0; 401 return 0;
426 if (segment_eq(get_fs(), KERNEL_DS)) 402 if (segment_eq(get_fs(), KERNEL_DS))
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index ed800c7456dd..64ce5fea8609 100644
--- a/arch/blackfin/kernel/ptrace.c
+++ b/arch/blackfin/kernel/ptrace.c
@@ -44,6 +44,7 @@
44#include <asm/processor.h> 44#include <asm/processor.h>
45#include <asm/asm-offsets.h> 45#include <asm/asm-offsets.h>
46#include <asm/dma.h> 46#include <asm/dma.h>
47#include <asm/fixed_code.h>
47 48
48#define MAX_SHARED_LIBS 3 49#define MAX_SHARED_LIBS 3
49#define TEXT_OFFSET 0 50#define TEXT_OFFSET 0
@@ -169,6 +170,9 @@ static inline int is_user_addr_valid(struct task_struct *child,
169 && start + len <= (unsigned long)sraml->addr + sraml->length) 170 && start + len <= (unsigned long)sraml->addr + sraml->length)
170 return 0; 171 return 0;
171 172
173 if (start >= FIXED_CODE_START && start + len <= FIXED_CODE_END)
174 return 0;
175
172 return -EIO; 176 return -EIO;
173} 177}
174 178
@@ -215,9 +219,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
215 copied = sizeof(tmp); 219 copied = sizeof(tmp);
216 } else 220 } else
217#endif 221#endif
218 copied = 222 if (addr + add >= FIXED_CODE_START
219 access_process_vm(child, addr + add, &tmp, 223 && addr + add + sizeof(tmp) <= FIXED_CODE_END) {
220 sizeof(tmp), 0); 224 memcpy(&tmp, (const void *)(addr + add), sizeof(tmp));
225 copied = sizeof(tmp);
226 } else
227 copied = access_process_vm(child, addr + add, &tmp,
228 sizeof(tmp), 0);
221 pr_debug("ptrace: copied size %d [0x%08lx]\n", copied, tmp); 229 pr_debug("ptrace: copied size %d [0x%08lx]\n", copied, tmp);
222 if (copied != sizeof(tmp)) 230 if (copied != sizeof(tmp))
223 break; 231 break;
@@ -281,9 +289,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
281 copied = sizeof(data); 289 copied = sizeof(data);
282 } else 290 } else
283#endif 291#endif
284 copied = 292 if (addr + add >= FIXED_CODE_START
285 access_process_vm(child, addr + add, &data, 293 && addr + add + sizeof(data) <= FIXED_CODE_END) {
286 sizeof(data), 1); 294 memcpy((void *)(addr + add), &data, sizeof(data));
295 copied = sizeof(data);
296 } else
297 copied = access_process_vm(child, addr + add, &data,
298 sizeof(data), 1);
287 pr_debug("ptrace: copied size %d\n", copied); 299 pr_debug("ptrace: copied size %d\n", copied);
288 if (copied != sizeof(data)) 300 if (copied != sizeof(data))
289 break; 301 break;
diff --git a/arch/blackfin/kernel/reboot.c b/arch/blackfin/kernel/reboot.c
new file mode 100644
index 000000000000..356078ec462b
--- /dev/null
+++ b/arch/blackfin/kernel/reboot.c
@@ -0,0 +1,78 @@
1/*
2 * arch/blackfin/kernel/reboot.c - handle shutdown/reboot
3 *
4 * Copyright 2004-2007 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#include <linux/interrupt.h>
10#include <asm/bfin-global.h>
11#include <asm/reboot.h>
12#include <asm/system.h>
13
14#if defined(BF537_FAMILY) || defined(BF533_FAMILY)
15#define SYSCR_VAL 0x0
16#elif defined(BF561_FAMILY)
17#define SYSCR_VAL 0x20
18#elif defined(BF548_FAMILY)
19#define SYSCR_VAL 0x10
20#endif
21
22/* A system soft reset makes external memory unusable
23 * so force this function into L1.
24 */
25__attribute__((l1_text))
26void bfin_reset(void)
27{
28 /* force BMODE and disable Core B (as needed) */
29 bfin_write_SYSCR(SYSCR_VAL);
30
31 /* we use asm ssync here because it's save and we save some L1 */
32 asm("ssync;");
33
34 while (1) {
35 /* initiate system soft reset with magic 0x7 */
36 bfin_write_SWRST(0x7);
37 asm("ssync;");
38 /* clear system soft reset */
39 bfin_write_SWRST(0);
40 asm("ssync;");
41 /* issue core reset */
42 asm("raise 1");
43 }
44}
45
46__attribute__((weak))
47void native_machine_restart(char *cmd)
48{
49}
50
51void machine_restart(char *cmd)
52{
53 native_machine_restart(cmd);
54 local_irq_disable();
55 bfin_reset();
56}
57
58__attribute__((weak))
59void native_machine_halt(void)
60{
61 idle_with_irq_disabled();
62}
63
64void machine_halt(void)
65{
66 native_machine_halt();
67}
68
69__attribute__((weak))
70void native_machine_power_off(void)
71{
72 idle_with_irq_disabled();
73}
74
75void machine_power_off(void)
76{
77 native_machine_power_off();
78}
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 88f221b89b33..8dcd76e87ed5 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -39,10 +39,12 @@
39#include <linux/cramfs_fs.h> 39#include <linux/cramfs_fs.h>
40#include <linux/romfs_fs.h> 40#include <linux/romfs_fs.h>
41 41
42#include <asm/cplb.h>
42#include <asm/cacheflush.h> 43#include <asm/cacheflush.h>
43#include <asm/blackfin.h> 44#include <asm/blackfin.h>
44#include <asm/cplbinit.h> 45#include <asm/cplbinit.h>
45#include <asm/fixed_code.h> 46#include <asm/fixed_code.h>
47#include <asm/early_printk.h>
46 48
47u16 _bfin_swrst; 49u16 _bfin_swrst;
48 50
@@ -66,21 +68,21 @@ char __initdata command_line[COMMAND_LINE_SIZE];
66 68
67void __init bf53x_cache_init(void) 69void __init bf53x_cache_init(void)
68{ 70{
69#if defined(CONFIG_BLKFIN_DCACHE) || defined(CONFIG_BLKFIN_CACHE) 71#if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE)
70 generate_cpl_tables(); 72 generate_cpl_tables();
71#endif 73#endif
72 74
73#ifdef CONFIG_BLKFIN_CACHE 75#ifdef CONFIG_BFIN_ICACHE
74 bfin_icache_init(); 76 bfin_icache_init();
75 printk(KERN_INFO "Instruction Cache Enabled\n"); 77 printk(KERN_INFO "Instruction Cache Enabled\n");
76#endif 78#endif
77 79
78#ifdef CONFIG_BLKFIN_DCACHE 80#ifdef CONFIG_BFIN_DCACHE
79 bfin_dcache_init(); 81 bfin_dcache_init();
80 printk(KERN_INFO "Data Cache Enabled" 82 printk(KERN_INFO "Data Cache Enabled"
81# if defined CONFIG_BLKFIN_WB 83# if defined CONFIG_BFIN_WB
82 " (write-back)" 84 " (write-back)"
83# elif defined CONFIG_BLKFIN_WT 85# elif defined CONFIG_BFIN_WT
84 " (write-through)" 86 " (write-through)"
85# endif 87# endif
86 "\n"); 88 "\n");
@@ -156,8 +158,10 @@ static __init void parse_cmdline_early(char *cmdline_p)
156 1; 158 1;
157 } 159 }
158 } 160 }
161 } else if (!memcmp(to, "earlyprintk=", 12)) {
162 to += 12;
163 setup_early_printk(to);
159 } 164 }
160
161 } 165 }
162 c = *(to++); 166 c = *(to++);
163 if (!c) 167 if (!c)
@@ -176,22 +180,36 @@ void __init setup_arch(char **cmdline_p)
176#ifdef CONFIG_DUMMY_CONSOLE 180#ifdef CONFIG_DUMMY_CONSOLE
177 conswitchp = &dummy_con; 181 conswitchp = &dummy_con;
178#endif 182#endif
183
184#if defined(CONFIG_CMDLINE_BOOL)
185 strncpy(&command_line[0], CONFIG_CMDLINE, sizeof(command_line));
186 command_line[sizeof(command_line) - 1] = 0;
187#endif
188
189 /* Keep a copy of command line */
190 *cmdline_p = &command_line[0];
191 memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
192 boot_command_line[COMMAND_LINE_SIZE - 1] = '\0';
193
194 /* setup memory defaults from the user config */
195 physical_mem_end = 0;
196 _ramend = CONFIG_MEM_SIZE * 1024 * 1024;
197
198 parse_cmdline_early(&command_line[0]);
199
179 cclk = get_cclk(); 200 cclk = get_cclk();
180 sclk = get_sclk(); 201 sclk = get_sclk();
181 202
182#if !defined(CONFIG_BFIN_KERNEL_CLOCK) && defined(ANOMALY_05000273) 203#if !defined(CONFIG_BFIN_KERNEL_CLOCK)
183 if (cclk == sclk) 204 if (ANOMALY_05000273 && cclk == sclk)
184 panic("ANOMALY 05000273, SCLK can not be same as CCLK"); 205 panic("ANOMALY 05000273, SCLK can not be same as CCLK");
185#endif 206#endif
186 207
187#if defined(ANOMALY_05000266) 208#ifdef BF561_FAMILY
188 bfin_read_IMDMA_D0_IRQ_STATUS(); 209 if (ANOMALY_05000266) {
189 bfin_read_IMDMA_D1_IRQ_STATUS(); 210 bfin_read_IMDMA_D0_IRQ_STATUS();
190#endif 211 bfin_read_IMDMA_D1_IRQ_STATUS();
191 212 }
192#ifdef DEBUG_SERIAL_EARLY_INIT
193 bfin_console_init(); /* early console registration */
194 /* this give a chance to get printk() working before crash. */
195#endif 213#endif
196 214
197 printk(KERN_INFO "Hardware Trace "); 215 printk(KERN_INFO "Hardware Trace ");
@@ -212,22 +230,6 @@ void __init setup_arch(char **cmdline_p)
212 flash_probe(); 230 flash_probe();
213#endif 231#endif
214 232
215#if defined(CONFIG_CMDLINE_BOOL)
216 strncpy(&command_line[0], CONFIG_CMDLINE, sizeof(command_line));
217 command_line[sizeof(command_line) - 1] = 0;
218#endif
219
220 /* Keep a copy of command line */
221 *cmdline_p = &command_line[0];
222 memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
223 boot_command_line[COMMAND_LINE_SIZE - 1] = '\0';
224
225 /* setup memory defaults from the user config */
226 physical_mem_end = 0;
227 _ramend = CONFIG_MEM_SIZE * 1024 * 1024;
228
229 parse_cmdline_early(&command_line[0]);
230
231 if (physical_mem_end == 0) 233 if (physical_mem_end == 0)
232 physical_mem_end = _ramend; 234 physical_mem_end = _ramend;
233 235
@@ -260,7 +262,7 @@ void __init setup_arch(char **cmdline_p)
260 && ((unsigned long *)mtd_phys)[1] == ROMSB_WORD1) 262 && ((unsigned long *)mtd_phys)[1] == ROMSB_WORD1)
261 mtd_size = 263 mtd_size =
262 PAGE_ALIGN(be32_to_cpu(((unsigned long *)mtd_phys)[2])); 264 PAGE_ALIGN(be32_to_cpu(((unsigned long *)mtd_phys)[2]));
263# if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263)) 265# if (defined(CONFIG_BFIN_ICACHE) && ANOMALY_05000263)
264 /* Due to a Hardware Anomaly we need to limit the size of usable 266 /* Due to a Hardware Anomaly we need to limit the size of usable
265 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on 267 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on
266 * 05000263 - Hardware loop corrupted when taking an ICPLB exception 268 * 05000263 - Hardware loop corrupted when taking an ICPLB exception
@@ -289,7 +291,7 @@ void __init setup_arch(char **cmdline_p)
289 _ebss = memory_mtd_start; /* define _ebss for compatible */ 291 _ebss = memory_mtd_start; /* define _ebss for compatible */
290#endif /* CONFIG_MTD_UCLINUX */ 292#endif /* CONFIG_MTD_UCLINUX */
291 293
292#if (defined(CONFIG_BLKFIN_CACHE) && defined(ANOMALY_05000263)) 294#if (defined(CONFIG_BFIN_ICACHE) && ANOMALY_05000263)
293 /* Due to a Hardware Anomaly we need to limit the size of usable 295 /* Due to a Hardware Anomaly we need to limit the size of usable
294 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on 296 * instruction memory to max 60MB, 56 if HUNT_FOR_ZERO is on
295 * 05000263 - Hardware loop corrupted when taking an ICPLB exception 297 * 05000263 - Hardware loop corrupted when taking an ICPLB exception
@@ -334,13 +336,11 @@ void __init setup_arch(char **cmdline_p)
334 CPU, bfin_revid()); 336 CPU, bfin_revid());
335 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); 337 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n");
336 338
337 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu Mhz System Clock\n", 339 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n",
338 cclk / 1000000, sclk / 1000000); 340 cclk / 1000000, sclk / 1000000);
339 341
340#if defined(ANOMALY_05000273) 342 if (ANOMALY_05000273 && (cclk >> 1) <= sclk)
341 if ((cclk >> 1) <= sclk)
342 printk("\n\n\nANOMALY_05000273: CCLK must be >= 2*SCLK !!!\n\n\n"); 343 printk("\n\n\nANOMALY_05000273: CCLK must be >= 2*SCLK !!!\n\n\n");
343#endif
344 344
345 printk(KERN_INFO "Board Memory: %ldMB\n", physical_mem_end >> 20); 345 printk(KERN_INFO "Board Memory: %ldMB\n", physical_mem_end >> 20);
346 printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20); 346 printk(KERN_INFO "Kernel Managed Memory: %ldMB\n", _ramend >> 20);
@@ -535,9 +535,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
535 seq_printf(m, "I-CACHE:\tOFF\n"); 535 seq_printf(m, "I-CACHE:\tOFF\n");
536 if ((bfin_read_DMEM_CONTROL()) & (ENDCPLB | DMC_ENABLE)) 536 if ((bfin_read_DMEM_CONTROL()) & (ENDCPLB | DMC_ENABLE))
537 seq_printf(m, "D-CACHE:\tON" 537 seq_printf(m, "D-CACHE:\tON"
538#if defined CONFIG_BLKFIN_WB 538#if defined CONFIG_BFIN_WB
539 " (write-back)" 539 " (write-back)"
540#elif defined CONFIG_BLKFIN_WT 540#elif defined CONFIG_BFIN_WT
541 " (write-through)" 541 " (write-through)"
542#endif 542#endif
543 "\n"); 543 "\n");
@@ -566,15 +566,15 @@ static int show_cpuinfo(struct seq_file *m, void *v)
566 } 566 }
567 567
568 568
569 seq_printf(m, "I-CACHE Size:\t%dKB\n", BLKFIN_ICACHESIZE / 1024); 569 seq_printf(m, "I-CACHE Size:\t%dKB\n", BFIN_ICACHESIZE / 1024);
570 seq_printf(m, "D-CACHE Size:\t%dKB\n", dcache_size); 570 seq_printf(m, "D-CACHE Size:\t%dKB\n", dcache_size);
571 seq_printf(m, "I-CACHE Setup:\t%d Sub-banks/%d Ways, %d Lines/Way\n", 571 seq_printf(m, "I-CACHE Setup:\t%d Sub-banks/%d Ways, %d Lines/Way\n",
572 BLKFIN_ISUBBANKS, BLKFIN_IWAYS, BLKFIN_ILINES); 572 BFIN_ISUBBANKS, BFIN_IWAYS, BFIN_ILINES);
573 seq_printf(m, 573 seq_printf(m,
574 "D-CACHE Setup:\t%d Super-banks/%d Sub-banks/%d Ways, %d Lines/Way\n", 574 "D-CACHE Setup:\t%d Super-banks/%d Sub-banks/%d Ways, %d Lines/Way\n",
575 dsup_banks, BLKFIN_DSUBBANKS, BLKFIN_DWAYS, 575 dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS,
576 BLKFIN_DLINES); 576 BFIN_DLINES);
577#ifdef CONFIG_BLKFIN_CACHE_LOCK 577#ifdef CONFIG_BFIN_ICACHE_LOCK
578 switch (read_iloc()) { 578 switch (read_iloc()) {
579 case WAY0_L: 579 case WAY0_L:
580 seq_printf(m, "Way0 Locked-Down\n"); 580 seq_printf(m, "Way0 Locked-Down\n");
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 792a8416fe10..8823e9ade584 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -51,10 +51,9 @@ void __init trap_init(void)
51 CSYNC(); 51 CSYNC();
52} 52}
53 53
54asmlinkage void trap_c(struct pt_regs *fp);
55
56int kstack_depth_to_print = 48; 54int kstack_depth_to_print = 48;
57 55
56#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
58static int printk_address(unsigned long address) 57static int printk_address(unsigned long address)
59{ 58{
60 struct vm_list_struct *vml; 59 struct vm_list_struct *vml;
@@ -131,10 +130,22 @@ static int printk_address(unsigned long address)
131 /* we were unable to find this address anywhere */ 130 /* we were unable to find this address anywhere */
132 return printk("[<0x%p>]", (void *)address); 131 return printk("[<0x%p>]", (void *)address);
133} 132}
133#endif
134
135asmlinkage void double_fault_c(struct pt_regs *fp)
136{
137 printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n");
138 dump_bfin_regs(fp, (void *)fp->retx);
139 panic("Double Fault - unrecoverable event\n");
140
141}
134 142
135asmlinkage void trap_c(struct pt_regs *fp) 143asmlinkage void trap_c(struct pt_regs *fp)
136{ 144{
137 int j, sig = 0; 145#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
146 int j;
147#endif
148 int sig = 0;
138 siginfo_t info; 149 siginfo_t info;
139 unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE; 150 unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE;
140 151
@@ -391,10 +402,6 @@ asmlinkage void trap_c(struct pt_regs *fp)
391 break; 402 break;
392 } 403 }
393 404
394 info.si_signo = sig;
395 info.si_errno = 0;
396 info.si_addr = (void *)fp->pc;
397 force_sig_info(sig, &info, current);
398 if (sig != 0 && sig != SIGTRAP) { 405 if (sig != 0 && sig != SIGTRAP) {
399 unsigned long stack; 406 unsigned long stack;
400 dump_bfin_regs(fp, (void *)fp->retx); 407 dump_bfin_regs(fp, (void *)fp->retx);
@@ -403,6 +410,10 @@ asmlinkage void trap_c(struct pt_regs *fp)
403 if (current->mm == NULL) 410 if (current->mm == NULL)
404 panic("Kernel exception"); 411 panic("Kernel exception");
405 } 412 }
413 info.si_signo = sig;
414 info.si_errno = 0;
415 info.si_addr = (void *)fp->pc;
416 force_sig_info(sig, &info, current);
406 417
407 /* if the address that we are about to return to is not valid, set it 418 /* if the address that we are about to return to is not valid, set it
408 * to a valid address, if we have a current application or panic 419 * to a valid address, if we have a current application or panic
@@ -429,24 +440,56 @@ asmlinkage void trap_c(struct pt_regs *fp)
429 440
430/* Typical exception handling routines */ 441/* Typical exception handling routines */
431 442
443#define EXPAND_LEN ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN) * 256 - 1)
444
432void dump_bfin_trace_buffer(void) 445void dump_bfin_trace_buffer(void)
433{ 446{
434 int tflags; 447#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
448 int tflags, i = 0;
449#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
450 int j, index;
451#endif
452
435 trace_buffer_save(tflags); 453 trace_buffer_save(tflags);
436 454
455 printk(KERN_EMERG "Hardware Trace:\n");
456
437 if (likely(bfin_read_TBUFSTAT() & TBUFCNT)) { 457 if (likely(bfin_read_TBUFSTAT() & TBUFCNT)) {
438 int i; 458 for (; bfin_read_TBUFSTAT() & TBUFCNT; i++) {
439 printk(KERN_EMERG "Hardware Trace:\n"); 459 printk(KERN_EMERG "%4i Target : ", i);
440 for (i = 0; bfin_read_TBUFSTAT() & TBUFCNT; i++) {
441 printk(KERN_EMERG "%2i Target : ", i);
442 printk_address((unsigned long)bfin_read_TBUF()); 460 printk_address((unsigned long)bfin_read_TBUF());
443 printk("\n" KERN_EMERG " Source : "); 461 printk("\n" KERN_EMERG " Source : ");
444 printk_address((unsigned long)bfin_read_TBUF()); 462 printk_address((unsigned long)bfin_read_TBUF());
445 printk("\n"); 463 printk("\n");
446 } 464 }
447 } 465 }
448 466
467#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
468 if (trace_buff_offset)
469 index = trace_buff_offset/4 - 1;
470 else
471 index = EXPAND_LEN;
472
473 j = (1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN) * 128;
474 while (j) {
475 printk(KERN_EMERG "%4i Target : ", i);
476 printk_address(software_trace_buff[index]);
477 index -= 1;
478 if (index < 0 )
479 index = EXPAND_LEN;
480 printk("\n" KERN_EMERG " Source : ");
481 printk_address(software_trace_buff[index]);
482 index -= 1;
483 if (index < 0)
484 index = EXPAND_LEN;
485 printk("\n");
486 j--;
487 i++;
488 }
489#endif
490
449 trace_buffer_restore(tflags); 491 trace_buffer_restore(tflags);
492#endif
450} 493}
451EXPORT_SYMBOL(dump_bfin_trace_buffer); 494EXPORT_SYMBOL(dump_bfin_trace_buffer);
452 495
@@ -510,7 +553,9 @@ void show_stack(struct task_struct *task, unsigned long *stack)
510void dump_stack(void) 553void dump_stack(void)
511{ 554{
512 unsigned long stack; 555 unsigned long stack;
556#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
513 int tflags; 557 int tflags;
558#endif
514 trace_buffer_save(tflags); 559 trace_buffer_save(tflags);
515 dump_bfin_trace_buffer(); 560 dump_bfin_trace_buffer();
516 show_stack(current, &stack); 561 show_stack(current, &stack);
@@ -559,8 +604,7 @@ void dump_bfin_regs(struct pt_regs *fp, void *retaddr)
559 unsigned short x = 0; 604 unsigned short x = 0;
560 for (; i < ((unsigned int)retaddr & 0xFFFFFFF0) + 32; i += 2) { 605 for (; i < ((unsigned int)retaddr & 0xFFFFFFF0) + 32; i += 2) {
561 if (!(i & 0xF)) 606 if (!(i & 0xF))
562 printk(KERN_EMERG "\n" KERN_EMERG 607 printk("\n" KERN_EMERG "0x%08x: ", i);
563 "0x%08x: ", i);
564 608
565 if (get_user(x, (unsigned short *)i)) 609 if (get_user(x, (unsigned short *)i))
566 break; 610 break;
@@ -655,6 +699,42 @@ asmlinkage int sys_bfin_spinlock(int *spinlock)
655 return ret; 699 return ret;
656} 700}
657 701
702int bfin_request_exception(unsigned int exception, void (*handler)(void))
703{
704 void (*curr_handler)(void);
705
706 if (exception > 0x3F)
707 return -EINVAL;
708
709 curr_handler = ex_table[exception];
710
711 if (curr_handler != ex_replaceable)
712 return -EBUSY;
713
714 ex_table[exception] = handler;
715
716 return 0;
717}
718EXPORT_SYMBOL(bfin_request_exception);
719
720int bfin_free_exception(unsigned int exception, void (*handler)(void))
721{
722 void (*curr_handler)(void);
723
724 if (exception > 0x3F)
725 return -EINVAL;
726
727 curr_handler = ex_table[exception];
728
729 if (curr_handler != handler)
730 return -EBUSY;
731
732 ex_table[exception] = ex_replaceable;
733
734 return 0;
735}
736EXPORT_SYMBOL(bfin_free_exception);
737
658void panic_cplb_error(int cplb_panic, struct pt_regs *fp) 738void panic_cplb_error(int cplb_panic, struct pt_regs *fp)
659{ 739{
660 switch (cplb_panic) { 740 switch (cplb_panic) {
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index fb53780247bc..eec43674a465 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -49,7 +49,8 @@ SECTIONS
49 TEXT_TEXT 49 TEXT_TEXT
50 SCHED_TEXT 50 SCHED_TEXT
51 LOCK_TEXT 51 LOCK_TEXT
52 *(.text.lock) 52 KPROBES_TEXT
53 *(.text.*)
53 *(.fixup) 54 *(.fixup)
54 55
55 . = ALIGN(16); 56 . = ALIGN(16);
@@ -61,7 +62,7 @@ SECTIONS
61 __etext = .; 62 __etext = .;
62 } 63 }
63 64
64 RODATA 65 RO_DATA(PAGE_SIZE)
65 66
66 .data : 67 .data :
67 { 68 {
@@ -72,50 +73,63 @@ SECTIONS
72 __sdata = .; 73 __sdata = .;
73 . = ALIGN(THREAD_SIZE); 74 . = ALIGN(THREAD_SIZE);
74 *(.data.init_task) 75 *(.data.init_task)
75 DATA_DATA
76 CONSTRUCTORS
77 76
78 . = ALIGN(32); 77 . = ALIGN(32);
79 *(.data.cacheline_aligned) 78 *(.data.cacheline_aligned)
80 79
80 DATA_DATA
81 *(.data.*)
82 CONSTRUCTORS
83
81 . = ALIGN(THREAD_SIZE); 84 . = ALIGN(THREAD_SIZE);
82 __edata = .; 85 __edata = .;
83 } 86 }
84 87
85 ___init_begin = .; 88 ___init_begin = .;
86 .init : 89
90 .init.text :
87 { 91 {
88 . = ALIGN(PAGE_SIZE); 92 . = ALIGN(PAGE_SIZE);
89 __sinittext = .; 93 __sinittext = .;
90 *(.init.text) 94 *(.init.text)
91 __einittext = .; 95 __einittext = .;
96 }
97 .init.data :
98 {
99 . = ALIGN(16);
92 *(.init.data) 100 *(.init.data)
101 }
102 .init.setup :
103 {
93 . = ALIGN(16); 104 . = ALIGN(16);
94 ___setup_start = .; 105 ___setup_start = .;
95 *(.init.setup) 106 *(.init.setup)
96 ___setup_end = .; 107 ___setup_end = .;
97 ___start___param = .; 108 }
98 *(__param) 109 .initcall.init :
99 ___stop___param = .; 110 {
100 ___initcall_start = .; 111 ___initcall_start = .;
101 INITCALLS 112 INITCALLS
102 ___initcall_end = .; 113 ___initcall_end = .;
114 }
115 .con_initcall.init :
116 {
103 ___con_initcall_start = .; 117 ___con_initcall_start = .;
104 *(.con_initcall.init) 118 *(.con_initcall.init)
105 ___con_initcall_end = .; 119 ___con_initcall_end = .;
106 ___security_initcall_start = .; 120 }
107 *(.security_initcall.init) 121 SECURITY_INIT
108 ___security_initcall_end = .; 122 .init.ramfs :
123 {
109 . = ALIGN(4); 124 . = ALIGN(4);
110 ___initramfs_start = .; 125 ___initramfs_start = .;
111 *(.init.ramfs) 126 *(.init.ramfs)
112 ___initramfs_end = .; 127 ___initramfs_end = .;
113 . = ALIGN(4);
114 } 128 }
115 129
116 __l1_lma_start = .; 130 __l1_lma_start = .;
117 131
118 .text_l1 L1_CODE_START : AT(LOADADDR(.init) + SIZEOF(.init)) 132 .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs))
119 { 133 {
120 . = ALIGN(4); 134 . = ALIGN(4);
121 __stext_l1 = .; 135 __stext_l1 = .;
@@ -164,13 +178,19 @@ SECTIONS
164 { 178 {
165 . = ALIGN(4); 179 . = ALIGN(4);
166 ___bss_start = .; 180 ___bss_start = .;
167 *(.bss) 181 *(.bss .bss.*)
168 *(COMMON) 182 *(COMMON)
169 . = ALIGN(4); 183 . = ALIGN(4);
170 ___bss_stop = .; 184 ___bss_stop = .;
171 __end = .; 185 __end = .;
172 } 186 }
173 187
188 STABS_DEBUG
189
190 DWARF_DEBUG
191
192 NOTES
193
174 /DISCARD/ : 194 /DISCARD/ :
175 { 195 {
176 *(.exit.text) 196 *(.exit.text)
diff --git a/arch/blackfin/lib/memcmp.S b/arch/blackfin/lib/memcmp.S
index b88c5d2d1ebe..219fa2877c62 100644
--- a/arch/blackfin/lib/memcmp.S
+++ b/arch/blackfin/lib/memcmp.S
@@ -61,7 +61,7 @@ ENTRY(_memcmp)
61 61
62 LSETUP (.Lquad_loop_s, .Lquad_loop_e) LC0=P1; 62 LSETUP (.Lquad_loop_s, .Lquad_loop_e) LC0=P1;
63.Lquad_loop_s: 63.Lquad_loop_s:
64#ifdef ANOMALY_05000202 64#if ANOMALY_05000202
65 R0 = [P0++]; 65 R0 = [P0++];
66 R1 = [I0++]; 66 R1 = [I0++];
67#else 67#else
diff --git a/arch/blackfin/lib/memcpy.S b/arch/blackfin/lib/memcpy.S
index 14a5585bbd02..2e6336492b4b 100644
--- a/arch/blackfin/lib/memcpy.S
+++ b/arch/blackfin/lib/memcpy.S
@@ -98,7 +98,7 @@ ENTRY(_memcpy)
98 R0 = R1; 98 R0 = R1;
99 I1 = P1; 99 I1 = P1;
100 R3 = [I1++]; 100 R3 = [I1++];
101#ifdef ANOMALY_05000202 101#if ANOMALY_05000202
102.Lword_loops: 102.Lword_loops:
103 [P0++] = R3; 103 [P0++] = R3;
104.Lword_loope: 104.Lword_loope:
diff --git a/arch/blackfin/lib/memmove.S b/arch/blackfin/lib/memmove.S
index 6ee6e206e77c..33f8653145b7 100644
--- a/arch/blackfin/lib/memmove.S
+++ b/arch/blackfin/lib/memmove.S
@@ -70,7 +70,7 @@ ENTRY(_memmove)
70 R1 = [I0++]; 70 R1 = [I0++];
71 71
72 LSETUP (.Lquad_loops, .Lquad_loope) LC0=P1; 72 LSETUP (.Lquad_loops, .Lquad_loope) LC0=P1;
73#ifdef ANOMALY_05000202 73#if ANOMALY_05000202
74.Lquad_loops: 74.Lquad_loops:
75 [P0++] = R1; 75 [P0++] = R1;
76.Lquad_loope: 76.Lquad_loope:
@@ -102,7 +102,7 @@ ENTRY(_memmove)
102 R1 = B[P3--] (Z); 102 R1 = B[P3--] (Z);
103 CC = P2 == 0; 103 CC = P2 == 0;
104 IF CC JUMP .Lno_loop; 104 IF CC JUMP .Lno_loop;
105#ifdef ANOMALY_05000245 105#if ANOMALY_05000245
106 NOP; 106 NOP;
107 NOP; 107 NOP;
108#endif 108#endif
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
index 4545f363e641..a57b52d207cd 100644
--- a/arch/blackfin/mach-bf533/boards/cm_bf533.c
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -34,7 +34,9 @@
34#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
35#include <linux/spi/flash.h> 35#include <linux/spi/flash.h>
36#include <linux/usb_isp1362.h> 36#include <linux/usb_isp1362.h>
37#include <linux/pata_platform.h>
37#include <linux/irq.h> 38#include <linux/irq.h>
39#include <asm/dma.h>
38#include <asm/bfin5xx_spi.h> 40#include <asm/bfin5xx_spi.h>
39 41
40/* 42/*
@@ -93,7 +95,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
93 /* the modalias must be the same as spi device driver name */ 95 /* the modalias must be the same as spi device driver name */
94 .modalias = "m25p80", /* Name of spi_driver for this device */ 96 .modalias = "m25p80", /* Name of spi_driver for this device */
95 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 97 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
96 .bus_num = 1, /* Framework bus number */ 98 .bus_num = 0, /* Framework bus number */
97 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ 99 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
98 .platform_data = &bfin_spi_flash_data, 100 .platform_data = &bfin_spi_flash_data,
99 .controller_data = &spi_flash_chip_info, 101 .controller_data = &spi_flash_chip_info,
@@ -101,7 +103,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
101 }, { 103 }, {
102 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 104 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
103 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 105 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
104 .bus_num = 1, /* Framework bus number */ 106 .bus_num = 0, /* Framework bus number */
105 .chip_select = 2, /* Framework chip select. */ 107 .chip_select = 2, /* Framework chip select. */
106 .platform_data = NULL, /* No spi_driver specific config */ 108 .platform_data = NULL, /* No spi_driver specific config */
107 .controller_data = &spi_adc_chip_info, 109 .controller_data = &spi_adc_chip_info,
@@ -110,24 +112,40 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
110 { 112 {
111 .modalias = "ad1836-spi", 113 .modalias = "ad1836-spi",
112 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 114 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
113 .bus_num = 1, 115 .bus_num = 0,
114 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 116 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
115 .controller_data = &ad1836_spi_chip_info, 117 .controller_data = &ad1836_spi_chip_info,
116 }, 118 },
117#endif 119#endif
118}; 120};
119 121
122/* SPI (0) */
123static struct resource bfin_spi0_resource[] = {
124 [0] = {
125 .start = SPI0_REGBASE,
126 .end = SPI0_REGBASE + 0xFF,
127 .flags = IORESOURCE_MEM,
128 },
129 [1] = {
130 .start = CH_SPI,
131 .end = CH_SPI,
132 .flags = IORESOURCE_IRQ,
133 }
134};
135
120/* SPI controller data */ 136/* SPI controller data */
121static struct bfin5xx_spi_master spi_bfin_master_info = { 137static struct bfin5xx_spi_master bfin_spi0_info = {
122 .num_chipselect = 8, 138 .num_chipselect = 8,
123 .enable_dma = 1, /* master has the ability to do dma transfer */ 139 .enable_dma = 1, /* master has the ability to do dma transfer */
124}; 140};
125 141
126static struct platform_device spi_bfin_master_device = { 142static struct platform_device bfin_spi0_device = {
127 .name = "bfin-spi-master", 143 .name = "bfin-spi",
128 .id = 1, /* Bus number */ 144 .id = 0, /* Bus number */
145 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
146 .resource = bfin_spi0_resource,
129 .dev = { 147 .dev = {
130 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 148 .platform_data = &bfin_spi0_info, /* Passed to driver */
131 }, 149 },
132}; 150};
133#endif /* spi master and devices */ 151#endif /* spi master and devices */
@@ -227,6 +245,43 @@ static struct platform_device isp1362_hcd_device = {
227}; 245};
228#endif 246#endif
229 247
248#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
249#define PATA_INT 38
250
251static struct pata_platform_info bfin_pata_platform_data = {
252 .ioport_shift = 2,
253 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
254};
255
256static struct resource bfin_pata_resources[] = {
257 {
258 .start = 0x2030C000,
259 .end = 0x2030C01F,
260 .flags = IORESOURCE_MEM,
261 },
262 {
263 .start = 0x2030D018,
264 .end = 0x2030D01B,
265 .flags = IORESOURCE_MEM,
266 },
267 {
268 .start = PATA_INT,
269 .end = PATA_INT,
270 .flags = IORESOURCE_IRQ,
271 },
272};
273
274static struct platform_device bfin_pata_device = {
275 .name = "pata_platform",
276 .id = -1,
277 .num_resources = ARRAY_SIZE(bfin_pata_resources),
278 .resource = bfin_pata_resources,
279 .dev = {
280 .platform_data = &bfin_pata_platform_data,
281 }
282};
283#endif
284
230static struct platform_device *cm_bf533_devices[] __initdata = { 285static struct platform_device *cm_bf533_devices[] __initdata = {
231#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 286#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
232 &bfin_uart_device, 287 &bfin_uart_device,
@@ -250,7 +305,11 @@ static struct platform_device *cm_bf533_devices[] __initdata = {
250#endif 305#endif
251 306
252#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 307#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
253 &spi_bfin_master_device, 308 &bfin_spi0_device,
309#endif
310
311#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
312 &bfin_pata_device,
254#endif 313#endif
255}; 314};
256 315
@@ -261,6 +320,10 @@ static int __init cm_bf533_init(void)
261#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 320#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
262 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 321 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
263#endif 322#endif
323
324#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
325 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
326#endif
264 return 0; 327 return 0;
265} 328}
266 329
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index 0000b8f1239c..5c1e35d3c012 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -35,7 +35,9 @@
35#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
36#include <linux/spi/flash.h> 36#include <linux/spi/flash.h>
37#include <linux/usb_isp1362.h> 37#include <linux/usb_isp1362.h>
38#include <linux/pata_platform.h>
38#include <linux/irq.h> 39#include <linux/irq.h>
40#include <asm/dma.h>
39#include <asm/bfin5xx_spi.h> 41#include <asm/bfin5xx_spi.h>
40 42
41/* 43/*
@@ -50,6 +52,12 @@ static struct platform_device rtc_device = {
50}; 52};
51#endif 53#endif
52 54
55#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
56static struct platform_device bfin_fb_adv7393_device = {
57 .name = "bfin-adv7393",
58};
59#endif
60
53/* 61/*
54 * USB-LAN EzExtender board 62 * USB-LAN EzExtender board
55 * Driver needs to know address, irq and flag pin. 63 * Driver needs to know address, irq and flag pin.
@@ -131,7 +139,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
131 /* the modalias must be the same as spi device driver name */ 139 /* the modalias must be the same as spi device driver name */
132 .modalias = "m25p80", /* Name of spi_driver for this device */ 140 .modalias = "m25p80", /* Name of spi_driver for this device */
133 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 141 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
134 .bus_num = 1, /* Framework bus number */ 142 .bus_num = 0, /* Framework bus number */
135 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/ 143 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
136 .platform_data = &bfin_spi_flash_data, 144 .platform_data = &bfin_spi_flash_data,
137 .controller_data = &spi_flash_chip_info, 145 .controller_data = &spi_flash_chip_info,
@@ -143,7 +151,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
143 { 151 {
144 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 152 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
145 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 153 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
146 .bus_num = 1, /* Framework bus number */ 154 .bus_num = 0, /* Framework bus number */
147 .chip_select = 1, /* Framework chip select. */ 155 .chip_select = 1, /* Framework chip select. */
148 .platform_data = NULL, /* No spi_driver specific config */ 156 .platform_data = NULL, /* No spi_driver specific config */
149 .controller_data = &spi_adc_chip_info, 157 .controller_data = &spi_adc_chip_info,
@@ -154,24 +162,40 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
154 { 162 {
155 .modalias = "ad1836-spi", 163 .modalias = "ad1836-spi",
156 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 164 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
157 .bus_num = 1, 165 .bus_num = 0,
158 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 166 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
159 .controller_data = &ad1836_spi_chip_info, 167 .controller_data = &ad1836_spi_chip_info,
160 }, 168 },
161#endif 169#endif
162}; 170};
163 171
172/* SPI (0) */
173static struct resource bfin_spi0_resource[] = {
174 [0] = {
175 .start = SPI0_REGBASE,
176 .end = SPI0_REGBASE + 0xFF,
177 .flags = IORESOURCE_MEM,
178 },
179 [1] = {
180 .start = CH_SPI,
181 .end = CH_SPI,
182 .flags = IORESOURCE_IRQ,
183 }
184};
185
164/* SPI controller data */ 186/* SPI controller data */
165static struct bfin5xx_spi_master spi_bfin_master_info = { 187static struct bfin5xx_spi_master bfin_spi0_info = {
166 .num_chipselect = 8, 188 .num_chipselect = 8,
167 .enable_dma = 1, /* master has the ability to do dma transfer */ 189 .enable_dma = 1, /* master has the ability to do dma transfer */
168}; 190};
169 191
170static struct platform_device spi_bfin_master_device = { 192static struct platform_device bfin_spi0_device = {
171 .name = "bfin-spi-master", 193 .name = "bfin-spi",
172 .id = 1, /* Bus number */ 194 .id = 0, /* Bus number */
195 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
196 .resource = bfin_spi0_resource,
173 .dev = { 197 .dev = {
174 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 198 .platform_data = &bfin_spi0_info, /* Passed to driver */
175 }, 199 },
176}; 200};
177#endif /* spi master and devices */ 201#endif /* spi master and devices */
@@ -193,13 +217,54 @@ static struct platform_device bfin_uart_device = {
193}; 217};
194#endif 218#endif
195 219
220#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
221#define PATA_INT 55
222
223static struct pata_platform_info bfin_pata_platform_data = {
224 .ioport_shift = 1,
225 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
226};
227
228static struct resource bfin_pata_resources[] = {
229 {
230 .start = 0x20314020,
231 .end = 0x2031403F,
232 .flags = IORESOURCE_MEM,
233 },
234 {
235 .start = 0x2031401C,
236 .end = 0x2031401F,
237 .flags = IORESOURCE_MEM,
238 },
239 {
240 .start = PATA_INT,
241 .end = PATA_INT,
242 .flags = IORESOURCE_IRQ,
243 },
244};
245
246static struct platform_device bfin_pata_device = {
247 .name = "pata_platform",
248 .id = -1,
249 .num_resources = ARRAY_SIZE(bfin_pata_resources),
250 .resource = bfin_pata_resources,
251 .dev = {
252 .platform_data = &bfin_pata_platform_data,
253 }
254};
255#endif
256
196static struct platform_device *ezkit_devices[] __initdata = { 257static struct platform_device *ezkit_devices[] __initdata = {
197#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 258#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
198 &smc91x_device, 259 &smc91x_device,
199#endif 260#endif
200 261
201#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 262#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
202 &spi_bfin_master_device, 263 &bfin_spi0_device,
264#endif
265
266#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
267 &bfin_fb_adv7393_device,
203#endif 268#endif
204 269
205#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 270#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
@@ -209,6 +274,10 @@ static struct platform_device *ezkit_devices[] __initdata = {
209#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 274#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
210 &bfin_uart_device, 275 &bfin_uart_device,
211#endif 276#endif
277
278#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
279 &bfin_pata_device,
280#endif
212}; 281};
213 282
214static int __init ezkit_init(void) 283static int __init ezkit_init(void)
@@ -218,6 +287,10 @@ static int __init ezkit_init(void)
218#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 287#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
219 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 288 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
220#endif 289#endif
290
291#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
292 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
293#endif
221 return 0; 294 return 0;
222} 295}
223 296
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index a9143c4cbdcd..8975e06ea158 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -37,8 +37,11 @@
37#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 37#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
38#include <linux/usb_isp1362.h> 38#include <linux/usb_isp1362.h>
39#endif 39#endif
40#include <linux/pata_platform.h>
40#include <linux/irq.h> 41#include <linux/irq.h>
42#include <asm/dma.h>
41#include <asm/bfin5xx_spi.h> 43#include <asm/bfin5xx_spi.h>
44#include <asm/reboot.h>
42 45
43/* 46/*
44 * Name the Board for the /proc/cpuinfo 47 * Name the Board for the /proc/cpuinfo
@@ -77,6 +80,12 @@ static struct platform_device smc91x_device = {
77}; 80};
78#endif 81#endif
79 82
83#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
84static struct platform_device bfin_fb_adv7393_device = {
85 .name = "bfin-adv7393",
86};
87#endif
88
80#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 89#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
81static struct resource net2272_bfin_resources[] = { 90static struct resource net2272_bfin_resources[] = {
82 { 91 {
@@ -177,7 +186,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
177 /* the modalias must be the same as spi device driver name */ 186 /* the modalias must be the same as spi device driver name */
178 .modalias = "m25p80", /* Name of spi_driver for this device */ 187 .modalias = "m25p80", /* Name of spi_driver for this device */
179 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 188 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
180 .bus_num = 1, /* Framework bus number */ 189 .bus_num = 0, /* Framework bus number */
181 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/ 190 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
182 .platform_data = &bfin_spi_flash_data, 191 .platform_data = &bfin_spi_flash_data,
183 .controller_data = &spi_flash_chip_info, 192 .controller_data = &spi_flash_chip_info,
@@ -189,7 +198,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
189 { 198 {
190 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 199 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
191 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 200 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
192 .bus_num = 1, /* Framework bus number */ 201 .bus_num = 0, /* Framework bus number */
193 .chip_select = 1, /* Framework chip select. */ 202 .chip_select = 1, /* Framework chip select. */
194 .platform_data = NULL, /* No spi_driver specific config */ 203 .platform_data = NULL, /* No spi_driver specific config */
195 .controller_data = &spi_adc_chip_info, 204 .controller_data = &spi_adc_chip_info,
@@ -200,7 +209,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
200 { 209 {
201 .modalias = "ad1836-spi", 210 .modalias = "ad1836-spi",
202 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */ 211 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */
203 .bus_num = 1, 212 .bus_num = 0,
204 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 213 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
205 .controller_data = &ad1836_spi_chip_info, 214 .controller_data = &ad1836_spi_chip_info,
206 }, 215 },
@@ -210,7 +219,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
210 { 219 {
211 .modalias = "spi_mmc_dummy", 220 .modalias = "spi_mmc_dummy",
212 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 221 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
213 .bus_num = 1, 222 .bus_num = 0,
214 .chip_select = 0, 223 .chip_select = 0,
215 .platform_data = NULL, 224 .platform_data = NULL,
216 .controller_data = &spi_mmc_chip_info, 225 .controller_data = &spi_mmc_chip_info,
@@ -219,7 +228,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
219 { 228 {
220 .modalias = "spi_mmc", 229 .modalias = "spi_mmc",
221 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 230 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
222 .bus_num = 1, 231 .bus_num = 0,
223 .chip_select = CONFIG_SPI_MMC_CS_CHAN, 232 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
224 .platform_data = NULL, 233 .platform_data = NULL,
225 .controller_data = &spi_mmc_chip_info, 234 .controller_data = &spi_mmc_chip_info,
@@ -231,16 +240,16 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
231 { 240 {
232 .modalias = "fxs-spi", 241 .modalias = "fxs-spi",
233 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 242 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
234 .bus_num = 1, 243 .bus_num = 0,
235 .chip_select = 3, 244 .chip_select = 8 - CONFIG_J11_JUMPER,
236 .controller_data = &spi_si3xxx_chip_info, 245 .controller_data = &spi_si3xxx_chip_info,
237 .mode = SPI_MODE_3, 246 .mode = SPI_MODE_3,
238 }, 247 },
239 { 248 {
240 .modalias = "fxo-spi", 249 .modalias = "fxo-spi",
241 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 250 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
242 .bus_num = 1, 251 .bus_num = 0,
243 .chip_select = 2, 252 .chip_select = 8 - CONFIG_J19_JUMPER,
244 .controller_data = &spi_si3xxx_chip_info, 253 .controller_data = &spi_si3xxx_chip_info,
245 .mode = SPI_MODE_3, 254 .mode = SPI_MODE_3,
246 }, 255 },
@@ -250,7 +259,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
250 { 259 {
251 .modalias = "ad5304_spi", 260 .modalias = "ad5304_spi",
252 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 261 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
253 .bus_num = 1, 262 .bus_num = 0,
254 .chip_select = 2, 263 .chip_select = 2,
255 .platform_data = NULL, 264 .platform_data = NULL,
256 .controller_data = &ad5304_chip_info, 265 .controller_data = &ad5304_chip_info,
@@ -259,17 +268,33 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
259#endif 268#endif
260}; 269};
261 270
271/* SPI (0) */
272static struct resource bfin_spi0_resource[] = {
273 [0] = {
274 .start = SPI0_REGBASE,
275 .end = SPI0_REGBASE + 0xFF,
276 .flags = IORESOURCE_MEM,
277 },
278 [1] = {
279 .start = CH_SPI,
280 .end = CH_SPI,
281 .flags = IORESOURCE_IRQ,
282 }
283};
284
262/* SPI controller data */ 285/* SPI controller data */
263static struct bfin5xx_spi_master spi_bfin_master_info = { 286static struct bfin5xx_spi_master bfin_spi0_info = {
264 .num_chipselect = 8, 287 .num_chipselect = 8,
265 .enable_dma = 1, /* master has the ability to do dma transfer */ 288 .enable_dma = 1, /* master has the ability to do dma transfer */
266}; 289};
267 290
268static struct platform_device spi_bfin_master_device = { 291static struct platform_device bfin_spi0_device = {
269 .name = "bfin-spi-master", 292 .name = "bfin-spi",
270 .id = 1, /* Bus number */ 293 .id = 0, /* Bus number */
294 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
295 .resource = bfin_spi0_resource,
271 .dev = { 296 .dev = {
272 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 297 .platform_data = &bfin_spi0_info, /* Passed to driver */
273 }, 298 },
274}; 299};
275#endif /* spi master and devices */ 300#endif /* spi master and devices */
@@ -309,6 +334,43 @@ static struct platform_device bfin_sport1_uart_device = {
309}; 334};
310#endif 335#endif
311 336
337#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
338#define PATA_INT 55
339
340static struct pata_platform_info bfin_pata_platform_data = {
341 .ioport_shift = 1,
342 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
343};
344
345static struct resource bfin_pata_resources[] = {
346 {
347 .start = 0x20314020,
348 .end = 0x2031403F,
349 .flags = IORESOURCE_MEM,
350 },
351 {
352 .start = 0x2031401C,
353 .end = 0x2031401F,
354 .flags = IORESOURCE_MEM,
355 },
356 {
357 .start = PATA_INT,
358 .end = PATA_INT,
359 .flags = IORESOURCE_IRQ,
360 },
361};
362
363static struct platform_device bfin_pata_device = {
364 .name = "pata_platform",
365 .id = -1,
366 .num_resources = ARRAY_SIZE(bfin_pata_resources),
367 .resource = bfin_pata_resources,
368 .dev = {
369 .platform_data = &bfin_pata_platform_data,
370 }
371};
372#endif
373
312static struct platform_device *stamp_devices[] __initdata = { 374static struct platform_device *stamp_devices[] __initdata = {
313#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 375#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
314 &rtc_device, 376 &rtc_device,
@@ -318,12 +380,16 @@ static struct platform_device *stamp_devices[] __initdata = {
318 &smc91x_device, 380 &smc91x_device,
319#endif 381#endif
320 382
383#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
384 &bfin_fb_adv7393_device,
385#endif
386
321#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 387#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
322 &net2272_bfin_device, 388 &net2272_bfin_device,
323#endif 389#endif
324 390
325#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 391#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
326 &spi_bfin_master_device, 392 &bfin_spi0_device,
327#endif 393#endif
328 394
329#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 395#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
@@ -334,6 +400,10 @@ static struct platform_device *stamp_devices[] __initdata = {
334 &bfin_sport0_uart_device, 400 &bfin_sport0_uart_device,
335 &bfin_sport1_uart_device, 401 &bfin_sport1_uart_device,
336#endif 402#endif
403
404#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
405 &bfin_pata_device,
406#endif
337}; 407};
338 408
339static int __init stamp_init(void) 409static int __init stamp_init(void)
@@ -355,8 +425,23 @@ static int __init stamp_init(void)
355#endif 425#endif
356 426
357#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 427#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
358 return spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 428 spi_register_board_info(bfin_spi_board_info,
429 ARRAY_SIZE(bfin_spi_board_info));
430#endif
431#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
432 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
359#endif 433#endif
434 return 0;
360} 435}
361 436
362arch_initcall(stamp_init); 437arch_initcall(stamp_init);
438
439void native_machine_restart(char *cmd)
440{
441#if defined(CONFIG_BFIN_SHARED_FLASH_ENET)
442# define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN)
443 bfin_write_FIO_INEN(~BIT_TO_SET);
444 bfin_write_FIO_DIR(BIT_TO_SET);
445 bfin_write_FIO_FLAG_C(BIT_TO_SET);
446#endif
447}
diff --git a/arch/blackfin/mach-bf533/head.S b/arch/blackfin/mach-bf533/head.S
index 7dd0e9c3a936..1ded945a6fa0 100644
--- a/arch/blackfin/mach-bf533/head.S
+++ b/arch/blackfin/mach-bf533/head.S
@@ -32,11 +32,9 @@
32#include <asm/blackfin.h> 32#include <asm/blackfin.h>
33#include <asm/trace.h> 33#include <asm/trace.h>
34#if CONFIG_BFIN_KERNEL_CLOCK 34#if CONFIG_BFIN_KERNEL_CLOCK
35#include <asm/mach-common/clocks.h>
35#include <asm/mach/mem_init.h> 36#include <asm/mach/mem_init.h>
36#endif 37#endif
37#if CONFIG_DEBUG_KERNEL_START
38#include <asm/mach-common/def_LPBlackfin.h>
39#endif
40 38
41.global __rambase 39.global __rambase
42.global __ramstart 40.global __ramstart
@@ -52,10 +50,12 @@ __INIT
52ENTRY(__start) 50ENTRY(__start)
53 /* R0: argument of command line string, passed from uboot, save it */ 51 /* R0: argument of command line string, passed from uboot, save it */
54 R7 = R0; 52 R7 = R0;
55 /* Set the SYSCFG register: 53 /* Enable Cycle Counter and Nesting Of Interrupts */
56 * Enable Cycle Counter and Nesting Of Interrupts (3rd Bit) 54#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
57 */ 55 R0 = SYSCFG_SNEN;
58 R0 = 0x36; 56#else
57 R0 = SYSCFG_SNEN | SYSCFG_CCEN;
58#endif
59 SYSCFG = R0; 59 SYSCFG = R0;
60 R0 = 0; 60 R0 = 0;
61 61
@@ -97,40 +97,10 @@ ENTRY(__start)
97 M2 = r0; 97 M2 = r0;
98 M3 = r0; 98 M3 = r0;
99 99
100 trace_buffer_start(p0,r0); 100 trace_buffer_init(p0,r0);
101 P0 = R1; 101 P0 = R1;
102 R0 = R1; 102 R0 = R1;
103 103
104#if CONFIG_DEBUG_KERNEL_START
105
106/*
107 * Set up a temporary Event Vector Table, so if something bad happens before
108 * the kernel is fully started, it doesn't vector off into the bootloaders
109 * table
110 */
111 P0.l = lo(EVT2);
112 P0.h = hi(EVT2);
113 P1.l = lo(EVT15);
114 P1.h = hi(EVT15);
115 P2.l = debug_kernel_start_trap;
116 P2.h = debug_kernel_start_trap;
117
118 RTS = P2;
119 RTI = P2;
120 RTX = P2;
121 RTN = P2;
122 RTE = P2;
123
124.Lfill_temp_vector_table:
125 [P0++] = P2; /* Core Event Vector Table */
126 CC = P0 == P1;
127 if !CC JUMP .Lfill_temp_vector_table
128 P0 = r0;
129 P1 = r0;
130 P2 = r0;
131
132#endif
133
134 p0.h = hi(FIO_MASKA_C); 104 p0.h = hi(FIO_MASKA_C);
135 p0.l = lo(FIO_MASKA_C); 105 p0.l = lo(FIO_MASKA_C);
136 r0 = 0xFFFF(Z); 106 r0 = 0xFFFF(Z);
@@ -144,38 +114,38 @@ ENTRY(__start)
144 ssync; 114 ssync;
145 115
146 /* Turn off the icache */ 116 /* Turn off the icache */
147 p0.l = (IMEM_CONTROL & 0xFFFF); 117 p0.l = LO(IMEM_CONTROL);
148 p0.h = (IMEM_CONTROL >> 16); 118 p0.h = HI(IMEM_CONTROL);
149 R1 = [p0]; 119 R1 = [p0];
150 R0 = ~ENICPLB; 120 R0 = ~ENICPLB;
151 R0 = R0 & R1; 121 R0 = R0 & R1;
152 122
153 /* Anomaly 05000125 */ 123 /* Anomaly 05000125 */
154#ifdef ANOMALY_05000125 124#if ANOMALY_05000125
155 CLI R2; 125 CLI R2;
156 SSYNC; 126 SSYNC;
157#endif 127#endif
158 [p0] = R0; 128 [p0] = R0;
159 SSYNC; 129 SSYNC;
160#ifdef ANOMALY_05000125 130#if ANOMALY_05000125
161 STI R2; 131 STI R2;
162#endif 132#endif
163 133
164 /* Turn off the dcache */ 134 /* Turn off the dcache */
165 p0.l = (DMEM_CONTROL & 0xFFFF); 135 p0.l = LO(DMEM_CONTROL);
166 p0.h = (DMEM_CONTROL >> 16); 136 p0.h = HI(DMEM_CONTROL);
167 R1 = [p0]; 137 R1 = [p0];
168 R0 = ~ENDCPLB; 138 R0 = ~ENDCPLB;
169 R0 = R0 & R1; 139 R0 = R0 & R1;
170 140
171 /* Anomaly 05000125 */ 141 /* Anomaly 05000125 */
172#ifdef ANOMALY_05000125 142#if ANOMALY_05000125
173 CLI R2; 143 CLI R2;
174 SSYNC; 144 SSYNC;
175#endif 145#endif
176 [p0] = R0; 146 [p0] = R0;
177 SSYNC; 147 SSYNC;
178#ifdef ANOMALY_05000125 148#if ANOMALY_05000125
179 STI R2; 149 STI R2;
180#endif 150#endif
181 151
@@ -211,6 +181,12 @@ ENTRY(__start)
211 fp = sp; 181 fp = sp;
212 usp = sp; 182 usp = sp;
213 183
184#ifdef CONFIG_EARLY_PRINTK
185 SP += -12;
186 call _init_early_exception_vectors;
187 SP += 12;
188#endif
189
214 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 190 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
215 call _bf53x_relocate_l1_mem; 191 call _bf53x_relocate_l1_mem;
216#if CONFIG_BFIN_KERNEL_CLOCK 192#if CONFIG_BFIN_KERNEL_CLOCK
@@ -264,7 +240,7 @@ ENTRY(__start)
264 p0.l = .LWAIT_HERE; 240 p0.l = .LWAIT_HERE;
265 p0.h = .LWAIT_HERE; 241 p0.h = .LWAIT_HERE;
266 reti = p0; 242 reti = p0;
267#if defined(ANOMALY_05000281) 243#if ANOMALY_05000281
268 nop; nop; nop; 244 nop; nop; nop;
269#endif 245#endif
270 rti; 246 rti;
@@ -417,8 +393,8 @@ ENTRY(_start_dma_code)
417 w[p0] = r0.l; 393 w[p0] = r0.l;
418 ssync; 394 ssync;
419 395
420 p0.l = (EBIU_SDBCTL & 0xFFFF); 396 p0.l = LO(EBIU_SDBCTL);
421 p0.h = (EBIU_SDBCTL >> 16); /* SDRAM Memory Bank Control Register */ 397 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
422 r0 = mem_SDBCTL; 398 r0 = mem_SDBCTL;
423 w[p0] = r0.l; 399 w[p0] = r0.l;
424 ssync; 400 ssync;
@@ -456,276 +432,6 @@ ENTRY(_start_dma_code)
456ENDPROC(_start_dma_code) 432ENDPROC(_start_dma_code)
457#endif /* CONFIG_BFIN_KERNEL_CLOCK */ 433#endif /* CONFIG_BFIN_KERNEL_CLOCK */
458 434
459ENTRY(_bfin_reset)
460 /* No more interrupts to be handled*/
461 CLI R6;
462 SSYNC;
463
464#if defined(CONFIG_BFIN_SHARED_FLASH_ENET)
465 p0.h = hi(FIO_INEN);
466 p0.l = lo(FIO_INEN);
467 r0.l = ~(1 << CONFIG_ENET_FLASH_PIN);
468 w[p0] = r0.l;
469
470 p0.h = hi(FIO_DIR);
471 p0.l = lo(FIO_DIR);
472 r0.l = (1 << CONFIG_ENET_FLASH_PIN);
473 w[p0] = r0.l;
474
475 p0.h = hi(FIO_FLAG_C);
476 p0.l = lo(FIO_FLAG_C);
477 r0.l = (1 << CONFIG_ENET_FLASH_PIN);
478 w[p0] = r0.l;
479#endif
480
481 /* Clear the IMASK register */
482 p0.h = hi(IMASK);
483 p0.l = lo(IMASK);
484 r0 = 0x0;
485 [p0] = r0;
486
487 /* Clear the ILAT register */
488 p0.h = hi(ILAT);
489 p0.l = lo(ILAT);
490 r0 = [p0];
491 [p0] = r0;
492 SSYNC;
493
494 /* make sure SYSCR is set to use BMODE */
495 P0.h = hi(SYSCR);
496 P0.l = lo(SYSCR);
497 R0.l = 0x0;
498 W[P0] = R0.l;
499 SSYNC;
500
501 /* issue a system soft reset */
502 P1.h = hi(SWRST);
503 P1.l = lo(SWRST);
504 R1.l = 0x0007;
505 W[P1] = R1;
506 SSYNC;
507
508 /* clear system soft reset */
509 R0.l = 0x0000;
510 W[P0] = R0;
511 SSYNC;
512
513 /* issue core reset */
514 raise 1;
515
516 RTS;
517ENDPROC(_bfin_reset)
518
519#if CONFIG_DEBUG_KERNEL_START
520debug_kernel_start_trap:
521 /* Set up a temp stack in L1 - SDRAM might not be working */
522 P0.L = lo(L1_DATA_A_START + 0x100);
523 P0.H = hi(L1_DATA_A_START + 0x100);
524 SP = P0;
525
526 /* Make sure the Clocks are the way I think they should be */
527 r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
528 r0 = r0 << 9; /* Shift it over, */
529 r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
530 r0 = r1 | r0;
531 r1 = PLL_BYPASS; /* Bypass the PLL? */
532 r1 = r1 << 8; /* Shift it over */
533 r0 = r1 | r0; /* add them all together */
534
535 p0.h = hi(PLL_CTL);
536 p0.l = lo(PLL_CTL); /* Load the address */
537 cli r2; /* Disable interrupts */
538 ssync;
539 w[p0] = r0.l; /* Set the value */
540 idle; /* Wait for the PLL to stablize */
541 sti r2; /* Enable interrupts */
542
543.Lcheck_again1:
544 p0.h = hi(PLL_STAT);
545 p0.l = lo(PLL_STAT);
546 R0 = W[P0](Z);
547 CC = BITTST(R0,5);
548 if ! CC jump .Lcheck_again1;
549
550 /* Configure SCLK & CCLK Dividers */
551 r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
552 p0.h = hi(PLL_DIV);
553 p0.l = lo(PLL_DIV);
554 w[p0] = r0.l;
555 ssync;
556
557 /* Make sure UART is enabled - you can never be sure */
558
559/*
560 * Setup for console. Argument comes from the menuconfig
561 */
562
563#ifdef CONFIG_BAUD_9600
564#define CONSOLE_BAUD_RATE 9600
565#elif CONFIG_BAUD_19200
566#define CONSOLE_BAUD_RATE 19200
567#elif CONFIG_BAUD_38400
568#define CONSOLE_BAUD_RATE 38400
569#elif CONFIG_BAUD_57600
570#define CONSOLE_BAUD_RATE 57600
571#elif CONFIG_BAUD_115200
572#define CONSOLE_BAUD_RATE 115200
573#endif
574
575 p0.h = hi(UART_GCTL);
576 p0.l = lo(UART_GCTL);
577 r0 = 0x00(Z);
578 w[p0] = r0.L; /* To Turn off UART clocks */
579 ssync;
580
581 p0.h = hi(UART_LCR);
582 p0.l = lo(UART_LCR);
583 r0 = 0x83(Z);
584 w[p0] = r0.L; /* To enable DLL writes */
585 ssync;
586
587 R1 = (((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT) / CONFIG_SCLK_DIV) / (CONSOLE_BAUD_RATE * 16));
588
589 p0.h = hi(UART_DLL);
590 p0.l = lo(UART_DLL);
591 r0 = 0xFF(Z);
592 r0 = R1 & R0;
593 w[p0] = r0.L;
594 ssync;
595
596 p0.h = hi(UART_DLH);
597 p0.l = lo(UART_DLH);
598 r1 >>= 8 ;
599 w[p0] = r1.L;
600 ssync;
601
602 p0.h = hi(UART_GCTL);
603 p0.l = lo(UART_GCTL);
604 r0 = 0x0(Z);
605 w[p0] = r0.L; /* To enable UART clock */
606 ssync;
607
608 p0.h = hi(UART_LCR);
609 p0.l = lo(UART_LCR);
610 r0 = 0x03(Z);
611 w[p0] = r0.L; /* To Turn on UART */
612 ssync;
613
614 p0.h = hi(UART_GCTL);
615 p0.l = lo(UART_GCTL);
616 r0 = 0x01(Z);
617 w[p0] = r0.L; /* To Turn on UART Clocks */
618 ssync;
619
620 P0.h = hi(UART_THR);
621 P0.l = lo(UART_THR);
622 P1.h = hi(UART_LSR);
623 P1.l = lo(UART_LSR);
624
625 R0.L = 'K';
626 call .Lwait_char;
627 R0.L='e';
628 call .Lwait_char;
629 R0.L='r';
630 call .Lwait_char;
631 R0.L='n'
632 call .Lwait_char;
633 R0.L='e'
634 call .Lwait_char;
635 R0.L='l';
636 call .Lwait_char;
637 R0.L=' ';
638 call .Lwait_char;
639 R0.L='c';
640 call .Lwait_char;
641 R0.L='r';
642 call .Lwait_char;
643 R0.L='a';
644 call .Lwait_char;
645 R0.L='s';
646 call .Lwait_char;
647 R0.L='h';
648 call .Lwait_char;
649 R0.L='\r';
650 call .Lwait_char;
651 R0.L='\n';
652 call .Lwait_char;
653
654 R0.L='S';
655 call .Lwait_char;
656 R0.L='E';
657 call .Lwait_char;
658 R0.L='Q'
659 call .Lwait_char;
660 R0.L='S'
661 call .Lwait_char;
662 R0.L='T';
663 call .Lwait_char;
664 R0.L='A';
665 call .Lwait_char;
666 R0.L='T';
667 call .Lwait_char;
668 R0.L='=';
669 call .Lwait_char;
670 R2 = SEQSTAT;
671 call .Ldump_reg;
672
673 R0.L=' ';
674 call .Lwait_char;
675 R0.L='R';
676 call .Lwait_char;
677 R0.L='E'
678 call .Lwait_char;
679 R0.L='T'
680 call .Lwait_char;
681 R0.L='X';
682 call .Lwait_char;
683 R0.L='=';
684 call .Lwait_char;
685 R2 = RETX;
686 call .Ldump_reg;
687
688 R0.L='\r';
689 call .Lwait_char;
690 R0.L='\n';
691 call .Lwait_char;
692
693.Ldebug_kernel_start_trap_done:
694 JUMP .Ldebug_kernel_start_trap_done;
695.Ldump_reg:
696 R3 = 32;
697 R4 = 0x0F;
698 R5 = ':'; /* one past 9 */
699
700.Ldump_reg2:
701 R0 = R2;
702 R3 += -4;
703 R0 >>>= R3;
704 R0 = R0 & R4;
705 R0 += 0x30;
706 CC = R0 <= R5;
707 if CC JUMP .Ldump_reg1;
708 R0 += 7;
709
710.Ldump_reg1:
711 R1.l = W[P1];
712 CC = BITTST(R1, 5);
713 if !CC JUMP .Ldump_reg1;
714 W[P0] = r0;
715
716 CC = R3 == 0;
717 if !CC JUMP .Ldump_reg2
718 RTS;
719
720.Lwait_char:
721 R1.l = W[P1];
722 CC = BITTST(R1, 5);
723 if !CC JUMP .Lwait_char;
724 W[P0] = r0;
725 RTS;
726
727#endif /* CONFIG_DEBUG_KERNEL_START */
728
729.data 435.data
730 436
731/* 437/*
diff --git a/arch/blackfin/mach-bf537/Kconfig b/arch/blackfin/mach-bf537/Kconfig
index cc9ae38a4dda..e6648db09519 100644
--- a/arch/blackfin/mach-bf537/Kconfig
+++ b/arch/blackfin/mach-bf537/Kconfig
@@ -2,33 +2,6 @@ if (BF537 || BF534 || BF536)
2 2
3menu "BF537 Specific Configuration" 3menu "BF537 Specific Configuration"
4 4
5comment "PORT F/G Selection"
6choice
7 prompt "Select BF537/6/4 default GPIO PFx PORTx"
8 help
9 Quick Hack for BF537/6/4 default GPIO PFx PORTF.
10
11config BF537_PORT_F
12 bool "Select BF537/6/4 default GPIO PFx PORTF"
13 depends on (BF537 || BF536 || BF534)
14 help
15 Quick Hack for BF537/6/4 default GPIO PFx PORTF.
16
17config BF537_PORT_G
18 bool "Select BF537/6/4 default GPIO PFx PORTG"
19 depends on (BF537 || BF536 || BF534)
20 help
21 Quick Hack for BF537/6/4 default GPIO PFx PORTG.
22
23config BF537_PORT_H
24 bool "Select BF537/6/4 default GPIO PFx PORTH"
25 depends on (BF537 || BF536 || BF534)
26 help
27 Quick Hack for BF537/6/4 default GPIO PFx PORTH
28 Use only when Blackfin EMAC support is not required.
29
30endchoice
31
32comment "Interrupt Priority Assignment" 5comment "Interrupt Priority Assignment"
33menu "Priority" 6menu "Priority"
34 7
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537.c b/arch/blackfin/mach-bf537/boards/cm_bf537.c
index a8f947b72754..44dea05e1d03 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537.c
@@ -35,7 +35,9 @@
35#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
36#include <linux/spi/flash.h> 36#include <linux/spi/flash.h>
37#include <linux/usb_isp1362.h> 37#include <linux/usb_isp1362.h>
38#include <linux/pata_platform.h>
38#include <linux/irq.h> 39#include <linux/irq.h>
40#include <asm/dma.h>
39#include <asm/bfin5xx_spi.h> 41#include <asm/bfin5xx_spi.h>
40 42
41/* 43/*
@@ -113,7 +115,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
113 /* the modalias must be the same as spi device driver name */ 115 /* the modalias must be the same as spi device driver name */
114 .modalias = "m25p80", /* Name of spi_driver for this device */ 116 .modalias = "m25p80", /* Name of spi_driver for this device */
115 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 117 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
116 .bus_num = 1, /* Framework bus number */ 118 .bus_num = 0, /* Framework bus number */
117 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ 119 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
118 .platform_data = &bfin_spi_flash_data, 120 .platform_data = &bfin_spi_flash_data,
119 .controller_data = &spi_flash_chip_info, 121 .controller_data = &spi_flash_chip_info,
@@ -125,7 +127,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
125 { 127 {
126 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 128 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
127 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 129 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
128 .bus_num = 1, /* Framework bus number */ 130 .bus_num = 0, /* Framework bus number */
129 .chip_select = 1, /* Framework chip select. */ 131 .chip_select = 1, /* Framework chip select. */
130 .platform_data = NULL, /* No spi_driver specific config */ 132 .platform_data = NULL, /* No spi_driver specific config */
131 .controller_data = &spi_adc_chip_info, 133 .controller_data = &spi_adc_chip_info,
@@ -136,7 +138,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
136 { 138 {
137 .modalias = "ad1836-spi", 139 .modalias = "ad1836-spi",
138 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 140 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
139 .bus_num = 1, 141 .bus_num = 0,
140 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 142 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
141 .controller_data = &ad1836_spi_chip_info, 143 .controller_data = &ad1836_spi_chip_info,
142 }, 144 },
@@ -146,7 +148,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
146 { 148 {
147 .modalias = "ad9960-spi", 149 .modalias = "ad9960-spi",
148 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ 150 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
149 .bus_num = 1, 151 .bus_num = 0,
150 .chip_select = 1, 152 .chip_select = 1,
151 .controller_data = &ad9960_spi_chip_info, 153 .controller_data = &ad9960_spi_chip_info,
152 }, 154 },
@@ -156,7 +158,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
156 { 158 {
157 .modalias = "spi_mmc_dummy", 159 .modalias = "spi_mmc_dummy",
158 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 160 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
159 .bus_num = 1, 161 .bus_num = 0,
160 .chip_select = 7, 162 .chip_select = 7,
161 .platform_data = NULL, 163 .platform_data = NULL,
162 .controller_data = &spi_mmc_chip_info, 164 .controller_data = &spi_mmc_chip_info,
@@ -165,7 +167,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
165 { 167 {
166 .modalias = "spi_mmc", 168 .modalias = "spi_mmc",
167 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 169 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
168 .bus_num = 1, 170 .bus_num = 0,
169 .chip_select = CONFIG_SPI_MMC_CS_CHAN, 171 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
170 .platform_data = NULL, 172 .platform_data = NULL,
171 .controller_data = &spi_mmc_chip_info, 173 .controller_data = &spi_mmc_chip_info,
@@ -174,17 +176,33 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
174#endif 176#endif
175}; 177};
176 178
179/* SPI (0) */
180static struct resource bfin_spi0_resource[] = {
181 [0] = {
182 .start = SPI0_REGBASE,
183 .end = SPI0_REGBASE + 0xFF,
184 .flags = IORESOURCE_MEM,
185 },
186 [1] = {
187 .start = CH_SPI,
188 .end = CH_SPI,
189 .flags = IORESOURCE_IRQ,
190 }
191};
192
177/* SPI controller data */ 193/* SPI controller data */
178static struct bfin5xx_spi_master spi_bfin_master_info = { 194static struct bfin5xx_spi_master bfin_spi0_info = {
179 .num_chipselect = 8, 195 .num_chipselect = 8,
180 .enable_dma = 1, /* master has the ability to do dma transfer */ 196 .enable_dma = 1, /* master has the ability to do dma transfer */
181}; 197};
182 198
183static struct platform_device spi_bfin_master_device = { 199static struct platform_device bfin_spi0_device = {
184 .name = "bfin-spi-master", 200 .name = "bfin-spi",
185 .id = 1, /* Bus number */ 201 .id = 0, /* Bus number */
202 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
203 .resource = bfin_spi0_resource,
186 .dev = { 204 .dev = {
187 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 205 .platform_data = &bfin_spi0_info, /* Passed to driver */
188 }, 206 },
189}; 207};
190#endif /* spi master and devices */ 208#endif /* spi master and devices */
@@ -316,6 +334,43 @@ static struct platform_device bfin_mac_device = {
316}; 334};
317#endif 335#endif
318 336
337#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
338#define PATA_INT 64
339
340static struct pata_platform_info bfin_pata_platform_data = {
341 .ioport_shift = 2,
342 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
343};
344
345static struct resource bfin_pata_resources[] = {
346 {
347 .start = 0x2030C000,
348 .end = 0x2030C01F,
349 .flags = IORESOURCE_MEM,
350 },
351 {
352 .start = 0x2030D018,
353 .end = 0x2030D01B,
354 .flags = IORESOURCE_MEM,
355 },
356 {
357 .start = PATA_INT,
358 .end = PATA_INT,
359 .flags = IORESOURCE_IRQ,
360 },
361};
362
363static struct platform_device bfin_pata_device = {
364 .name = "pata_platform",
365 .id = -1,
366 .num_resources = ARRAY_SIZE(bfin_pata_resources),
367 .resource = bfin_pata_resources,
368 .dev = {
369 .platform_data = &bfin_pata_platform_data,
370 }
371};
372#endif
373
319static struct platform_device *cm_bf537_devices[] __initdata = { 374static struct platform_device *cm_bf537_devices[] __initdata = {
320#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 375#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
321 &rtc_device, 376 &rtc_device,
@@ -347,7 +402,11 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
347#endif 402#endif
348 403
349#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 404#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
350 &spi_bfin_master_device, 405 &bfin_spi0_device,
406#endif
407
408#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
409 &bfin_pata_device,
351#endif 410#endif
352}; 411};
353 412
@@ -358,6 +417,10 @@ static int __init cm_bf537_init(void)
358#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 417#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
359 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 418 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
360#endif 419#endif
420
421#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
422 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
423#endif
361 return 0; 424 return 0;
362} 425}
363 426
diff --git a/arch/blackfin/mach-bf537/boards/generic_board.c b/arch/blackfin/mach-bf537/boards/generic_board.c
index 648d984e98d6..5e9d09eb8579 100644
--- a/arch/blackfin/mach-bf537/boards/generic_board.c
+++ b/arch/blackfin/mach-bf537/boards/generic_board.c
@@ -8,7 +8,7 @@
8 * 8 *
9 * Modified: 9 * Modified:
10 * Copyright 2005 National ICT Australia (NICTA) 10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2006 Analog Devices Inc. 11 * Copyright 2004-2007 Analog Devices Inc.
12 * 12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 * 14 *
@@ -34,20 +34,74 @@
34#include <linux/mtd/partitions.h> 34#include <linux/mtd/partitions.h>
35#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
36#include <linux/spi/flash.h> 36#include <linux/spi/flash.h>
37#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
37#include <linux/usb_isp1362.h> 38#include <linux/usb_isp1362.h>
39#endif
40#include <linux/pata_platform.h>
38#include <linux/irq.h> 41#include <linux/irq.h>
42#include <linux/interrupt.h>
39#include <linux/usb_sl811.h> 43#include <linux/usb_sl811.h>
44#include <asm/dma.h>
40#include <asm/bfin5xx_spi.h> 45#include <asm/bfin5xx_spi.h>
46#include <asm/reboot.h>
47#include <linux/spi/ad7877.h>
41 48
42/* 49/*
43 * Name the Board for the /proc/cpuinfo 50 * Name the Board for the /proc/cpuinfo
44 */ 51 */
45char *bfin_board_name = "UNKNOWN BOARD"; 52char *bfin_board_name = "GENERIC Board";
46 53
47/* 54/*
48 * Driver needs to know address, irq and flag pin. 55 * Driver needs to know address, irq and flag pin.
49 */ 56 */
50 57
58#define ISP1761_BASE 0x203C0000
59#define ISP1761_IRQ IRQ_PF7
60
61#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
62static struct resource bfin_isp1761_resources[] = {
63 [0] = {
64 .name = "isp1761-regs",
65 .start = ISP1761_BASE + 0x00000000,
66 .end = ISP1761_BASE + 0x000fffff,
67 .flags = IORESOURCE_MEM,
68 },
69 [1] = {
70 .start = ISP1761_IRQ,
71 .end = ISP1761_IRQ,
72 .flags = IORESOURCE_IRQ,
73 },
74};
75
76static struct platform_device bfin_isp1761_device = {
77 .name = "isp1761",
78 .id = 0,
79 .num_resources = ARRAY_SIZE(bfin_isp1761_resources),
80 .resource = bfin_isp1761_resources,
81};
82
83static struct platform_device *bfin_isp1761_devices[] = {
84 &bfin_isp1761_device,
85};
86
87int __init bfin_isp1761_init(void)
88{
89 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
90
91 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
92 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
93
94 return platform_add_devices(bfin_isp1761_devices, num_devices);
95}
96
97void __exit bfin_isp1761_exit(void)
98{
99 platform_device_unregister(&bfin_isp1761_device);
100}
101
102arch_initcall(bfin_isp1761_init);
103#endif
104
51#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 105#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
52static struct resource bfin_pcmcia_cf_resources[] = { 106static struct resource bfin_pcmcia_cf_resources[] = {
53 { 107 {
@@ -59,10 +113,6 @@ static struct resource bfin_pcmcia_cf_resources[] = {
59 .end = 0x20311FFF, 113 .end = 0x20311FFF,
60 .flags = IORESOURCE_MEM, 114 .flags = IORESOURCE_MEM,
61 }, { 115 }, {
62 .start = IRQ_PROG_INTA,
63 .end = IRQ_PROG_INTA,
64 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
65 }, {
66 .start = IRQ_PF4, 116 .start = IRQ_PF4,
67 .end = IRQ_PF4, 117 .end = IRQ_PF4,
68 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, 118 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
@@ -96,14 +146,7 @@ static struct resource smc91x_resources[] = {
96 .end = 0x20300300 + 16, 146 .end = 0x20300300 + 16,
97 .flags = IORESOURCE_MEM, 147 .flags = IORESOURCE_MEM,
98 }, { 148 }, {
99 .start = IRQ_PROG_INTB, 149
100 .end = IRQ_PROG_INTB,
101 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
102 }, {
103 /*
104 * denotes the flag pin and is used directly if
105 * CONFIG_IRQCHIP_DEMUX_GPIO is defined.
106 */
107 .start = IRQ_PF7, 150 .start = IRQ_PF7,
108 .end = IRQ_PF7, 151 .end = IRQ_PF7,
109 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 152 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
@@ -117,6 +160,28 @@ static struct platform_device smc91x_device = {
117}; 160};
118#endif 161#endif
119 162
163#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
164static struct resource dm9000_resources[] = {
165 [0] = {
166 .start = 0x203FB800,
167 .end = 0x203FB800 + 8,
168 .flags = IORESOURCE_MEM,
169 },
170 [1] = {
171 .start = IRQ_PF9,
172 .end = IRQ_PF9,
173 .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
174 },
175};
176
177static struct platform_device dm9000_device = {
178 .name = "dm9000",
179 .id = -1,
180 .num_resources = ARRAY_SIZE(dm9000_resources),
181 .resource = dm9000_resources,
182};
183#endif
184
120#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) 185#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
121static struct resource sl811_hcd_resources[] = { 186static struct resource sl811_hcd_resources[] = {
122 { 187 {
@@ -128,12 +193,8 @@ static struct resource sl811_hcd_resources[] = {
128 .end = 0x20340004, 193 .end = 0x20340004,
129 .flags = IORESOURCE_MEM, 194 .flags = IORESOURCE_MEM,
130 }, { 195 }, {
131 .start = IRQ_PROG_INTA, 196 .start = CONFIG_USB_SL811_BFIN_IRQ,
132 .end = IRQ_PROG_INTA, 197 .end = CONFIG_USB_SL811_BFIN_IRQ,
133 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
134 }, {
135 .start = IRQ_PF0 + CONFIG_USB_SL811_BFIN_GPIO,
136 .end = IRQ_PF0 + CONFIG_USB_SL811_BFIN_GPIO,
137 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 198 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
138 }, 199 },
139}; 200};
@@ -141,21 +202,19 @@ static struct resource sl811_hcd_resources[] = {
141#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) 202#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
142void sl811_port_power(struct device *dev, int is_on) 203void sl811_port_power(struct device *dev, int is_on)
143{ 204{
144 unsigned short mask = (1<<CONFIG_USB_SL811_BFIN_GPIO_VBUS); 205 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
145 206 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS);
146 bfin_write_PORT_FER(bfin_read_PORT_FER() & ~mask);
147 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | mask);
148 207
149 if (is_on) 208 if (is_on)
150 bfin_write_FIO_FLAG_S(mask); 209 gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 1);
151 else 210 else
152 bfin_write_FIO_FLAG_C(mask); 211 gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 0);
153} 212}
154#endif 213#endif
155 214
156static struct sl811_platform_data sl811_priv = { 215static struct sl811_platform_data sl811_priv = {
157 .potpg = 10, 216 .potpg = 10,
158 .power = 250, /* == 500mA */ 217 .power = 250, /* == 500mA */
159#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) 218#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
160 .port_power = &sl811_port_power, 219 .port_power = &sl811_port_power,
161#endif 220#endif
@@ -170,7 +229,6 @@ static struct platform_device sl811_hcd_device = {
170 .num_resources = ARRAY_SIZE(sl811_hcd_resources), 229 .num_resources = ARRAY_SIZE(sl811_hcd_resources),
171 .resource = sl811_hcd_resources, 230 .resource = sl811_hcd_resources,
172}; 231};
173
174#endif 232#endif
175 233
176#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 234#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
@@ -184,13 +242,9 @@ static struct resource isp1362_hcd_resources[] = {
184 .end = 0x20360004, 242 .end = 0x20360004,
185 .flags = IORESOURCE_MEM, 243 .flags = IORESOURCE_MEM,
186 }, { 244 }, {
187 .start = IRQ_PROG_INTA, 245 .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
188 .end = IRQ_PROG_INTA, 246 .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
189 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 247 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
190 }, {
191 .start = IRQ_PF0 + CONFIG_USB_ISP1362_BFIN_GPIO,
192 .end = IRQ_PF0 + CONFIG_USB_ISP1362_BFIN_GPIO,
193 .flags = IORESOURCE_IRQ,
194 }, 248 },
195}; 249};
196 250
@@ -246,7 +300,8 @@ static struct platform_device net2272_bfin_device = {
246#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 300#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
247/* all SPI peripherals info goes here */ 301/* all SPI peripherals info goes here */
248 302
249#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 303#if defined(CONFIG_MTD_M25P80) \
304 || defined(CONFIG_MTD_M25P80_MODULE)
250static struct mtd_partition bfin_spi_flash_partitions[] = { 305static struct mtd_partition bfin_spi_flash_partitions[] = {
251 { 306 {
252 .name = "bootloader", 307 .name = "bootloader",
@@ -302,70 +357,198 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
302}; 357};
303#endif 358#endif
304 359
360#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
361static struct bfin5xx_spi_chip spi_mmc_chip_info = {
362 .enable_dma = 1,
363 .bits_per_word = 8,
364};
365#endif
366
367#if defined(CONFIG_PBX)
368static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
369 .ctl_reg = 0x4, /* send zero */
370 .enable_dma = 0,
371 .bits_per_word = 8,
372 .cs_change_per_word = 1,
373};
374#endif
375
376#if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
377static struct bfin5xx_spi_chip ad5304_chip_info = {
378 .enable_dma = 0,
379 .bits_per_word = 16,
380};
381#endif
382
383#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
384static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
385 .enable_dma = 0,
386 .bits_per_word = 16,
387};
388
389static const struct ad7877_platform_data bfin_ad7877_ts_info = {
390 .model = 7877,
391 .vref_delay_usecs = 50, /* internal, no capacitor */
392 .x_plate_ohms = 419,
393 .y_plate_ohms = 486,
394 .pressure_max = 1000,
395 .pressure_min = 0,
396 .stopacq_polarity = 1,
397 .first_conversion_delay = 3,
398 .acquisition_time = 1,
399 .averaging = 1,
400 .pen_down_acc_interval = 1,
401};
402#endif
403
305static struct spi_board_info bfin_spi_board_info[] __initdata = { 404static struct spi_board_info bfin_spi_board_info[] __initdata = {
306#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) 405#if defined(CONFIG_MTD_M25P80) \
406 || defined(CONFIG_MTD_M25P80_MODULE)
307 { 407 {
308 /* the modalias must be the same as spi device driver name */ 408 /* the modalias must be the same as spi device driver name */
309 .modalias = "m25p80", /* Name of spi_driver for this device */ 409 .modalias = "m25p80", /* Name of spi_driver for this device */
310 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 410 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
311 .bus_num = 1, /* Framework bus number */ 411 .bus_num = 0, /* Framework bus number */
312 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL1*/ 412 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
313 .platform_data = &bfin_spi_flash_data, 413 .platform_data = &bfin_spi_flash_data,
314 .controller_data = &spi_flash_chip_info, 414 .controller_data = &spi_flash_chip_info,
315 .mode = SPI_MODE_3, 415 .mode = SPI_MODE_3,
316 }, 416 },
317#endif 417#endif
318 418
319#if defined(CONFIG_SPI_ADC_BF533) || defined(CONFIG_SPI_ADC_BF533_MODULE) 419#if defined(CONFIG_SPI_ADC_BF533) \
420 || defined(CONFIG_SPI_ADC_BF533_MODULE)
320 { 421 {
321 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 422 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
322 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 423 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
323 .bus_num = 1, /* Framework bus number */ 424 .bus_num = 0, /* Framework bus number */
324 .chip_select = 1, /* Framework chip select. */ 425 .chip_select = 1, /* Framework chip select. */
325 .platform_data = NULL, /* No spi_driver specific config */ 426 .platform_data = NULL, /* No spi_driver specific config */
326 .controller_data = &spi_adc_chip_info, 427 .controller_data = &spi_adc_chip_info,
327 }, 428 },
328#endif 429#endif
329 430
330#if defined(CONFIG_SND_BLACKFIN_AD1836) || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) 431#if defined(CONFIG_SND_BLACKFIN_AD1836) \
432 || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
331 { 433 {
332 .modalias = "ad1836-spi", 434 .modalias = "ad1836-spi",
333 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 435 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
334 .bus_num = 1, 436 .bus_num = 0,
335 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 437 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
336 .controller_data = &ad1836_spi_chip_info, 438 .controller_data = &ad1836_spi_chip_info,
337 }, 439 },
338#endif 440#endif
339
340#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE) 441#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
341 { 442 {
342 .modalias = "ad9960-spi", 443 .modalias = "ad9960-spi",
343 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ 444 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
344 .bus_num = 1, 445 .bus_num = 0,
345 .chip_select = 1, 446 .chip_select = 1,
346 .controller_data = &ad9960_spi_chip_info, 447 .controller_data = &ad9960_spi_chip_info,
347 }, 448 },
348#endif 449#endif
450#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
451 {
452 .modalias = "spi_mmc_dummy",
453 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
454 .bus_num = 0,
455 .chip_select = 0,
456 .platform_data = NULL,
457 .controller_data = &spi_mmc_chip_info,
458 .mode = SPI_MODE_3,
459 },
460 {
461 .modalias = "spi_mmc",
462 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
463 .bus_num = 0,
464 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
465 .platform_data = NULL,
466 .controller_data = &spi_mmc_chip_info,
467 .mode = SPI_MODE_3,
468 },
469#endif
470#if defined(CONFIG_PBX)
471 {
472 .modalias = "fxs-spi",
473 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
474 .bus_num = 0,
475 .chip_select = 8 - CONFIG_J11_JUMPER,
476 .controller_data = &spi_si3xxx_chip_info,
477 .mode = SPI_MODE_3,
478 },
479 {
480 .modalias = "fxo-spi",
481 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
482 .bus_num = 0,
483 .chip_select = 8 - CONFIG_J19_JUMPER,
484 .controller_data = &spi_si3xxx_chip_info,
485 .mode = SPI_MODE_3,
486 },
487#endif
488#if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
489 {
490 .modalias = "ad5304_spi",
491 .max_speed_hz = 1250000, /* max spi clock (SCK) speed in HZ */
492 .bus_num = 0,
493 .chip_select = 2,
494 .platform_data = NULL,
495 .controller_data = &ad5304_chip_info,
496 .mode = SPI_MODE_2,
497 },
498#endif
499#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
500 {
501 .modalias = "ad7877",
502 .platform_data = &bfin_ad7877_ts_info,
503 .irq = IRQ_PF6,
504 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
505 .bus_num = 1,
506 .chip_select = 1,
507 .controller_data = &spi_ad7877_chip_info,
508 },
509#endif
349}; 510};
350 511
351/* SPI controller data */ 512/* SPI controller data */
352static struct bfin5xx_spi_master spi_bfin_master_info = { 513static struct bfin5xx_spi_master bfin_spi0_info = {
353 .num_chipselect = 8, 514 .num_chipselect = 8,
354 .enable_dma = 1, /* master has the ability to do dma transfer */ 515 .enable_dma = 1, /* master has the ability to do dma transfer */
355}; 516};
356 517
357static struct platform_device spi_bfin_master_device = { 518/* SPI (0) */
358 .name = "bfin-spi-master", 519static struct resource bfin_spi0_resource[] = {
359 .id = 1, /* Bus number */ 520 [0] = {
521 .start = SPI0_REGBASE,
522 .end = SPI0_REGBASE + 0xFF,
523 .flags = IORESOURCE_MEM,
524 },
525 [1] = {
526 .start = CH_SPI,
527 .end = CH_SPI,
528 .flags = IORESOURCE_IRQ,
529 },
530};
531
532static struct platform_device bfin_spi0_device = {
533 .name = "bfin-spi",
534 .id = 0, /* Bus number */
535 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
536 .resource = bfin_spi0_resource,
360 .dev = { 537 .dev = {
361 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 538 .platform_data = &bfin_spi0_info, /* Passed to driver */
362 }, 539 },
363}; 540};
364#endif /* spi master and devices */ 541#endif /* spi master and devices */
365 542
366#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 543#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
367static struct platform_device bfin_fb_device = { 544static struct platform_device bfin_fb_device = {
368 .name = "bf537-fb", 545 .name = "bf537-lq035",
546};
547#endif
548
549#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
550static struct platform_device bfin_fb_adv7393_device = {
551 .name = "bfin-adv7393",
369}; 552};
370#endif 553#endif
371 554
@@ -390,15 +573,86 @@ static struct platform_device bfin_uart_device = {
390}; 573};
391#endif 574#endif
392 575
393static struct platform_device *stamp_devices[] __initdata = { 576#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
394#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 577static struct resource bfin_twi0_resource[] = {
395 &rtc_device, 578 [0] = {
579 .start = TWI0_REGBASE,
580 .end = TWI0_REGBASE + 0xFF,
581 .flags = IORESOURCE_MEM,
582 },
583 [1] = {
584 .start = IRQ_TWI,
585 .end = IRQ_TWI,
586 .flags = IORESOURCE_IRQ,
587 },
588};
589
590static struct platform_device i2c_bfin_twi_device = {
591 .name = "i2c-bfin-twi",
592 .id = 0,
593 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
594 .resource = bfin_twi0_resource,
595};
596#endif
597
598#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
599static struct platform_device bfin_sport0_uart_device = {
600 .name = "bfin-sport-uart",
601 .id = 0,
602};
603
604static struct platform_device bfin_sport1_uart_device = {
605 .name = "bfin-sport-uart",
606 .id = 1,
607};
608#endif
609
610#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
611#define PATA_INT 55
612
613static struct pata_platform_info bfin_pata_platform_data = {
614 .ioport_shift = 1,
615 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
616};
617
618static struct resource bfin_pata_resources[] = {
619 {
620 .start = 0x20314020,
621 .end = 0x2031403F,
622 .flags = IORESOURCE_MEM,
623 },
624 {
625 .start = 0x2031401C,
626 .end = 0x2031401F,
627 .flags = IORESOURCE_MEM,
628 },
629 {
630 .start = PATA_INT,
631 .end = PATA_INT,
632 .flags = IORESOURCE_IRQ,
633 },
634};
635
636static struct platform_device bfin_pata_device = {
637 .name = "pata_platform",
638 .id = -1,
639 .num_resources = ARRAY_SIZE(bfin_pata_resources),
640 .resource = bfin_pata_resources,
641 .dev = {
642 .platform_data = &bfin_pata_platform_data,
643 }
644};
396#endif 645#endif
397 646
647static struct platform_device *stamp_devices[] __initdata = {
398#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 648#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
399 &bfin_pcmcia_cf_device, 649 &bfin_pcmcia_cf_device,
400#endif 650#endif
401 651
652#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
653 &rtc_device,
654#endif
655
402#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE) 656#if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
403 &sl811_hcd_device, 657 &sl811_hcd_device,
404#endif 658#endif
@@ -411,6 +665,10 @@ static struct platform_device *stamp_devices[] __initdata = {
411 &smc91x_device, 665 &smc91x_device,
412#endif 666#endif
413 667
668#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
669 &dm9000_device,
670#endif
671
414#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) 672#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
415 &bfin_mac_device, 673 &bfin_mac_device,
416#endif 674#endif
@@ -420,16 +678,33 @@ static struct platform_device *stamp_devices[] __initdata = {
420#endif 678#endif
421 679
422#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 680#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
423 &spi_bfin_master_device, 681 &bfin_spi0_device,
424#endif 682#endif
425 683
426#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 684#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
427 &bfin_fb_device, 685 &bfin_fb_device,
428#endif 686#endif
429 687
688#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
689 &bfin_fb_adv7393_device,
690#endif
691
430#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 692#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
431 &bfin_uart_device, 693 &bfin_uart_device,
432#endif 694#endif
695
696#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
697 &i2c_bfin_twi_device,
698#endif
699
700#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
701 &bfin_sport0_uart_device,
702 &bfin_sport1_uart_device,
703#endif
704
705#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
706 &bfin_pata_device,
707#endif
433}; 708};
434 709
435static int __init stamp_init(void) 710static int __init stamp_init(void)
@@ -437,9 +712,21 @@ static int __init stamp_init(void)
437 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); 712 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
438 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); 713 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
439#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 714#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
440 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 715 spi_register_board_info(bfin_spi_board_info,
716 ARRAY_SIZE(bfin_spi_board_info));
717#endif
718
719#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
720 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
441#endif 721#endif
442 return 0; 722 return 0;
443} 723}
444 724
445arch_initcall(stamp_init); 725arch_initcall(stamp_init);
726
727void native_machine_restart(char *cmd)
728{
729 /* workaround reboot hang when booting from SPI */
730 if ((bfin_read_SYSCR() & 0x7) == 0x3)
731 bfin_gpio_reset_spi0_ssel1();
732}
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c
index 8806f1230f2d..20507e92a3a4 100644
--- a/arch/blackfin/mach-bf537/boards/pnav10.c
+++ b/arch/blackfin/mach-bf537/boards/pnav10.c
@@ -38,6 +38,7 @@
38#include <linux/usb_isp1362.h> 38#include <linux/usb_isp1362.h>
39#endif 39#endif
40#include <linux/irq.h> 40#include <linux/irq.h>
41#include <asm/dma.h>
41#include <asm/bfin5xx_spi.h> 42#include <asm/bfin5xx_spi.h>
42#include <linux/usb_sl811.h> 43#include <linux/usb_sl811.h>
43 44
@@ -130,15 +131,13 @@ static struct resource sl811_hcd_resources[] = {
130#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) 131#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
131void sl811_port_power(struct device *dev, int is_on) 132void sl811_port_power(struct device *dev, int is_on)
132{ 133{
133 unsigned short mask = (1 << CONFIG_USB_SL811_BFIN_GPIO_VBUS); 134 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
134 135 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS);
135 bfin_write_PORT_FER(bfin_read_PORT_FER() & ~mask);
136 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | mask);
137 136
138 if (is_on) 137 if (is_on)
139 bfin_write_FIO_FLAG_S(mask); 138 gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 1);
140 else 139 else
141 bfin_write_FIO_FLAG_C(mask); 140 gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 0);
142} 141}
143#endif 142#endif
144 143
@@ -323,7 +322,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
323 /* the modalias must be the same as spi device driver name */ 322 /* the modalias must be the same as spi device driver name */
324 .modalias = "m25p80", /* Name of spi_driver for this device */ 323 .modalias = "m25p80", /* Name of spi_driver for this device */
325 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 324 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
326 .bus_num = 1, /* Framework bus number */ 325 .bus_num = 0, /* Framework bus number */
327 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ 326 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
328 .platform_data = &bfin_spi_flash_data, 327 .platform_data = &bfin_spi_flash_data,
329 .controller_data = &spi_flash_chip_info, 328 .controller_data = &spi_flash_chip_info,
@@ -336,7 +335,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
336 { 335 {
337 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 336 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
338 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 337 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
339 .bus_num = 1, /* Framework bus number */ 338 .bus_num = 0, /* Framework bus number */
340 .chip_select = 1, /* Framework chip select. */ 339 .chip_select = 1, /* Framework chip select. */
341 .platform_data = NULL, /* No spi_driver specific config */ 340 .platform_data = NULL, /* No spi_driver specific config */
342 .controller_data = &spi_adc_chip_info, 341 .controller_data = &spi_adc_chip_info,
@@ -348,7 +347,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
348 { 347 {
349 .modalias = "ad1836-spi", 348 .modalias = "ad1836-spi",
350 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 349 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
351 .bus_num = 1, 350 .bus_num = 0,
352 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 351 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
353 .controller_data = &ad1836_spi_chip_info, 352 .controller_data = &ad1836_spi_chip_info,
354 }, 353 },
@@ -357,7 +356,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
357 { 356 {
358 .modalias = "ad9960-spi", 357 .modalias = "ad9960-spi",
359 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ 358 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
360 .bus_num = 1, 359 .bus_num = 0,
361 .chip_select = 1, 360 .chip_select = 1,
362 .controller_data = &ad9960_spi_chip_info, 361 .controller_data = &ad9960_spi_chip_info,
363 }, 362 },
@@ -366,7 +365,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
366 { 365 {
367 .modalias = "spi_mmc_dummy", 366 .modalias = "spi_mmc_dummy",
368 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 367 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
369 .bus_num = 1, 368 .bus_num = 0,
370 .chip_select = 7, 369 .chip_select = 7,
371 .platform_data = NULL, 370 .platform_data = NULL,
372 .controller_data = &spi_mmc_chip_info, 371 .controller_data = &spi_mmc_chip_info,
@@ -375,7 +374,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
375 { 374 {
376 .modalias = "spi_mmc", 375 .modalias = "spi_mmc",
377 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 376 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
378 .bus_num = 1, 377 .bus_num = 0,
379 .chip_select = CONFIG_SPI_MMC_CS_CHAN, 378 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
380 .platform_data = NULL, 379 .platform_data = NULL,
381 .controller_data = &spi_mmc_chip_info, 380 .controller_data = &spi_mmc_chip_info,
@@ -396,24 +395,40 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
396 395
397}; 396};
398 397
398/* SPI (0) */
399static struct resource bfin_spi0_resource[] = {
400 [0] = {
401 .start = SPI0_REGBASE,
402 .end = SPI0_REGBASE + 0xFF,
403 .flags = IORESOURCE_MEM,
404 },
405 [1] = {
406 .start = CH_SPI,
407 .end = CH_SPI,
408 .flags = IORESOURCE_IRQ,
409 }
410};
411
399/* SPI controller data */ 412/* SPI controller data */
400static struct bfin5xx_spi_master spi_bfin_master_info = { 413static struct bfin5xx_spi_master bfin_spi0_info = {
401 .num_chipselect = 8, 414 .num_chipselect = 8,
402 .enable_dma = 1, /* master has the ability to do dma transfer */ 415 .enable_dma = 1, /* master has the ability to do dma transfer */
403}; 416};
404 417
405static struct platform_device spi_bfin_master_device = { 418static struct platform_device bfin_spi0_device = {
406 .name = "bfin-spi-master", 419 .name = "bfin-spi",
407 .id = 1, /* Bus number */ 420 .id = 0, /* Bus number */
421 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
422 .resource = bfin_spi0_resource,
408 .dev = { 423 .dev = {
409 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 424 .platform_data = &bfin_spi0_info, /* Passed to driver */
410 }, 425 },
411}; 426};
412#endif /* spi master and devices */ 427#endif /* spi master and devices */
413 428
414#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 429#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
415static struct platform_device bfin_fb_device = { 430static struct platform_device bfin_fb_device = {
416 .name = "bf537-fb", 431 .name = "bf537-lq035",
417}; 432};
418#endif 433#endif
419 434
@@ -469,7 +484,7 @@ static struct platform_device *stamp_devices[] __initdata = {
469#endif 484#endif
470 485
471#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 486#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
472 &spi_bfin_master_device, 487 &bfin_spi0_device,
473#endif 488#endif
474 489
475#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 490#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index 9c43d7756510..47d7d4a0e73d 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -37,10 +37,13 @@
37#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 37#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
38#include <linux/usb_isp1362.h> 38#include <linux/usb_isp1362.h>
39#endif 39#endif
40#include <linux/pata_platform.h>
40#include <linux/irq.h> 41#include <linux/irq.h>
41#include <linux/interrupt.h> 42#include <linux/interrupt.h>
42#include <linux/usb_sl811.h> 43#include <linux/usb_sl811.h>
44#include <asm/dma.h>
43#include <asm/bfin5xx_spi.h> 45#include <asm/bfin5xx_spi.h>
46#include <asm/reboot.h>
44#include <linux/spi/ad7877.h> 47#include <linux/spi/ad7877.h>
45 48
46/* 49/*
@@ -199,15 +202,13 @@ static struct resource sl811_hcd_resources[] = {
199#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS) 202#if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
200void sl811_port_power(struct device *dev, int is_on) 203void sl811_port_power(struct device *dev, int is_on)
201{ 204{
202 unsigned short mask = (1 << CONFIG_USB_SL811_BFIN_GPIO_VBUS); 205 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS, "usb:SL811_VBUS");
203 206 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS);
204 bfin_write_PORT_FER(bfin_read_PORT_FER() & ~mask);
205 bfin_write_FIO_DIR(bfin_read_FIO_DIR() | mask);
206 207
207 if (is_on) 208 if (is_on)
208 bfin_write_FIO_FLAG_S(mask); 209 gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 1);
209 else 210 else
210 bfin_write_FIO_FLAG_C(mask); 211 gpio_set_value(CONFIG_USB_SL811_BFIN_GPIO_VBUS, 0);
211} 212}
212#endif 213#endif
213 214
@@ -407,7 +408,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
407 /* the modalias must be the same as spi device driver name */ 408 /* the modalias must be the same as spi device driver name */
408 .modalias = "m25p80", /* Name of spi_driver for this device */ 409 .modalias = "m25p80", /* Name of spi_driver for this device */
409 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 410 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
410 .bus_num = 1, /* Framework bus number */ 411 .bus_num = 0, /* Framework bus number */
411 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ 412 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
412 .platform_data = &bfin_spi_flash_data, 413 .platform_data = &bfin_spi_flash_data,
413 .controller_data = &spi_flash_chip_info, 414 .controller_data = &spi_flash_chip_info,
@@ -420,7 +421,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
420 { 421 {
421 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 422 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
422 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 423 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
423 .bus_num = 1, /* Framework bus number */ 424 .bus_num = 0, /* Framework bus number */
424 .chip_select = 1, /* Framework chip select. */ 425 .chip_select = 1, /* Framework chip select. */
425 .platform_data = NULL, /* No spi_driver specific config */ 426 .platform_data = NULL, /* No spi_driver specific config */
426 .controller_data = &spi_adc_chip_info, 427 .controller_data = &spi_adc_chip_info,
@@ -432,7 +433,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
432 { 433 {
433 .modalias = "ad1836-spi", 434 .modalias = "ad1836-spi",
434 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 435 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
435 .bus_num = 1, 436 .bus_num = 0,
436 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 437 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
437 .controller_data = &ad1836_spi_chip_info, 438 .controller_data = &ad1836_spi_chip_info,
438 }, 439 },
@@ -441,7 +442,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
441 { 442 {
442 .modalias = "ad9960-spi", 443 .modalias = "ad9960-spi",
443 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ 444 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
444 .bus_num = 1, 445 .bus_num = 0,
445 .chip_select = 1, 446 .chip_select = 1,
446 .controller_data = &ad9960_spi_chip_info, 447 .controller_data = &ad9960_spi_chip_info,
447 }, 448 },
@@ -450,7 +451,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
450 { 451 {
451 .modalias = "spi_mmc_dummy", 452 .modalias = "spi_mmc_dummy",
452 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 453 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
453 .bus_num = 1, 454 .bus_num = 0,
454 .chip_select = 0, 455 .chip_select = 0,
455 .platform_data = NULL, 456 .platform_data = NULL,
456 .controller_data = &spi_mmc_chip_info, 457 .controller_data = &spi_mmc_chip_info,
@@ -459,7 +460,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
459 { 460 {
460 .modalias = "spi_mmc", 461 .modalias = "spi_mmc",
461 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 462 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
462 .bus_num = 1, 463 .bus_num = 0,
463 .chip_select = CONFIG_SPI_MMC_CS_CHAN, 464 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
464 .platform_data = NULL, 465 .platform_data = NULL,
465 .controller_data = &spi_mmc_chip_info, 466 .controller_data = &spi_mmc_chip_info,
@@ -470,16 +471,16 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
470 { 471 {
471 .modalias = "fxs-spi", 472 .modalias = "fxs-spi",
472 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 473 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
473 .bus_num = 1, 474 .bus_num = 0,
474 .chip_select = 3, 475 .chip_select = 8 - CONFIG_J11_JUMPER,
475 .controller_data = &spi_si3xxx_chip_info, 476 .controller_data = &spi_si3xxx_chip_info,
476 .mode = SPI_MODE_3, 477 .mode = SPI_MODE_3,
477 }, 478 },
478 { 479 {
479 .modalias = "fxo-spi", 480 .modalias = "fxo-spi",
480 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 481 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
481 .bus_num = 1, 482 .bus_num = 0,
482 .chip_select = 2, 483 .chip_select = 8 - CONFIG_J19_JUMPER,
483 .controller_data = &spi_si3xxx_chip_info, 484 .controller_data = &spi_si3xxx_chip_info,
484 .mode = SPI_MODE_3, 485 .mode = SPI_MODE_3,
485 }, 486 },
@@ -488,7 +489,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
488 { 489 {
489 .modalias = "ad5304_spi", 490 .modalias = "ad5304_spi",
490 .max_speed_hz = 1250000, /* max spi clock (SCK) speed in HZ */ 491 .max_speed_hz = 1250000, /* max spi clock (SCK) speed in HZ */
491 .bus_num = 1, 492 .bus_num = 0,
492 .chip_select = 2, 493 .chip_select = 2,
493 .platform_data = NULL, 494 .platform_data = NULL,
494 .controller_data = &ad5304_chip_info, 495 .controller_data = &ad5304_chip_info,
@@ -509,23 +510,45 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
509}; 510};
510 511
511/* SPI controller data */ 512/* SPI controller data */
512static struct bfin5xx_spi_master spi_bfin_master_info = { 513static struct bfin5xx_spi_master bfin_spi0_info = {
513 .num_chipselect = 8, 514 .num_chipselect = 8,
514 .enable_dma = 1, /* master has the ability to do dma transfer */ 515 .enable_dma = 1, /* master has the ability to do dma transfer */
515}; 516};
516 517
517static struct platform_device spi_bfin_master_device = { 518/* SPI (0) */
518 .name = "bfin-spi-master", 519static struct resource bfin_spi0_resource[] = {
519 .id = 1, /* Bus number */ 520 [0] = {
521 .start = SPI0_REGBASE,
522 .end = SPI0_REGBASE + 0xFF,
523 .flags = IORESOURCE_MEM,
524 },
525 [1] = {
526 .start = CH_SPI,
527 .end = CH_SPI,
528 .flags = IORESOURCE_IRQ,
529 },
530};
531
532static struct platform_device bfin_spi0_device = {
533 .name = "bfin-spi",
534 .id = 0, /* Bus number */
535 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
536 .resource = bfin_spi0_resource,
520 .dev = { 537 .dev = {
521 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 538 .platform_data = &bfin_spi0_info, /* Passed to driver */
522 }, 539 },
523}; 540};
524#endif /* spi master and devices */ 541#endif /* spi master and devices */
525 542
526#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 543#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
527static struct platform_device bfin_fb_device = { 544static struct platform_device bfin_fb_device = {
528 .name = "bf537-fb", 545 .name = "bf537-lq035",
546};
547#endif
548
549#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
550static struct platform_device bfin_fb_adv7393_device = {
551 .name = "bfin-adv7393",
529}; 552};
530#endif 553#endif
531 554
@@ -551,9 +574,24 @@ static struct platform_device bfin_uart_device = {
551#endif 574#endif
552 575
553#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 576#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
577static struct resource bfin_twi0_resource[] = {
578 [0] = {
579 .start = TWI0_REGBASE,
580 .end = TWI0_REGBASE,
581 .flags = IORESOURCE_MEM,
582 },
583 [1] = {
584 .start = IRQ_TWI,
585 .end = IRQ_TWI,
586 .flags = IORESOURCE_IRQ,
587 },
588};
589
554static struct platform_device i2c_bfin_twi_device = { 590static struct platform_device i2c_bfin_twi_device = {
555 .name = "i2c-bfin-twi", 591 .name = "i2c-bfin-twi",
556 .id = 0, 592 .id = 0,
593 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
594 .resource = bfin_twi0_resource,
557}; 595};
558#endif 596#endif
559 597
@@ -569,6 +607,43 @@ static struct platform_device bfin_sport1_uart_device = {
569}; 607};
570#endif 608#endif
571 609
610#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
611#define PATA_INT 55
612
613static struct pata_platform_info bfin_pata_platform_data = {
614 .ioport_shift = 1,
615 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
616};
617
618static struct resource bfin_pata_resources[] = {
619 {
620 .start = 0x20314020,
621 .end = 0x2031403F,
622 .flags = IORESOURCE_MEM,
623 },
624 {
625 .start = 0x2031401C,
626 .end = 0x2031401F,
627 .flags = IORESOURCE_MEM,
628 },
629 {
630 .start = PATA_INT,
631 .end = PATA_INT,
632 .flags = IORESOURCE_IRQ,
633 },
634};
635
636static struct platform_device bfin_pata_device = {
637 .name = "pata_platform",
638 .id = -1,
639 .num_resources = ARRAY_SIZE(bfin_pata_resources),
640 .resource = bfin_pata_resources,
641 .dev = {
642 .platform_data = &bfin_pata_platform_data,
643 }
644};
645#endif
646
572static struct platform_device *stamp_devices[] __initdata = { 647static struct platform_device *stamp_devices[] __initdata = {
573#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 648#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
574 &bfin_pcmcia_cf_device, 649 &bfin_pcmcia_cf_device,
@@ -603,13 +678,17 @@ static struct platform_device *stamp_devices[] __initdata = {
603#endif 678#endif
604 679
605#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 680#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
606 &spi_bfin_master_device, 681 &bfin_spi0_device,
607#endif 682#endif
608 683
609#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE) 684#if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
610 &bfin_fb_device, 685 &bfin_fb_device,
611#endif 686#endif
612 687
688#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
689 &bfin_fb_adv7393_device,
690#endif
691
613#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 692#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
614 &bfin_uart_device, 693 &bfin_uart_device,
615#endif 694#endif
@@ -622,6 +701,10 @@ static struct platform_device *stamp_devices[] __initdata = {
622 &bfin_sport0_uart_device, 701 &bfin_sport0_uart_device,
623 &bfin_sport1_uart_device, 702 &bfin_sport1_uart_device,
624#endif 703#endif
704
705#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
706 &bfin_pata_device,
707#endif
625}; 708};
626 709
627static int __init stamp_init(void) 710static int __init stamp_init(void)
@@ -632,7 +715,18 @@ static int __init stamp_init(void)
632 spi_register_board_info(bfin_spi_board_info, 715 spi_register_board_info(bfin_spi_board_info,
633 ARRAY_SIZE(bfin_spi_board_info)); 716 ARRAY_SIZE(bfin_spi_board_info));
634#endif 717#endif
718
719#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
720 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
721#endif
635 return 0; 722 return 0;
636} 723}
637 724
638arch_initcall(stamp_init); 725arch_initcall(stamp_init);
726
727void native_machine_restart(char *cmd)
728{
729 /* workaround reboot hang when booting from SPI */
730 if ((bfin_read_SYSCR() & 0x7) == 0x3)
731 bfin_gpio_reset_spi0_ssel1();
732}
diff --git a/arch/blackfin/mach-bf537/head.S b/arch/blackfin/mach-bf537/head.S
index 429c8a1019da..3014fe8dd155 100644
--- a/arch/blackfin/mach-bf537/head.S
+++ b/arch/blackfin/mach-bf537/head.S
@@ -33,6 +33,7 @@
33#include <asm/trace.h> 33#include <asm/trace.h>
34 34
35#if CONFIG_BFIN_KERNEL_CLOCK 35#if CONFIG_BFIN_KERNEL_CLOCK
36#include <asm/mach-common/clocks.h>
36#include <asm/mach/mem_init.h> 37#include <asm/mach/mem_init.h>
37#endif 38#endif
38 39
@@ -50,10 +51,12 @@ __INIT
50ENTRY(__start) 51ENTRY(__start)
51 /* R0: argument of command line string, passed from uboot, save it */ 52 /* R0: argument of command line string, passed from uboot, save it */
52 R7 = R0; 53 R7 = R0;
53 /* Set the SYSCFG register: 54 /* Enable Cycle Counter and Nesting Of Interrupts */
54 * Enable Cycle Counter and Nesting Of Interrupts (3rd Bit) 55#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
55 */ 56 R0 = SYSCFG_SNEN;
56 R0 = 0x36; 57#else
58 R0 = SYSCFG_SNEN | SYSCFG_CCEN;
59#endif
57 SYSCFG = R0; 60 SYSCFG = R0;
58 R0 = 0; 61 R0 = 0;
59 62
@@ -95,43 +98,43 @@ ENTRY(__start)
95 M2 = r0; 98 M2 = r0;
96 M3 = r0; 99 M3 = r0;
97 100
98 trace_buffer_start(p0,r0); 101 trace_buffer_init(p0,r0);
99 P0 = R1; 102 P0 = R1;
100 R0 = R1; 103 R0 = R1;
101 104
102 /* Turn off the icache */ 105 /* Turn off the icache */
103 p0.l = (IMEM_CONTROL & 0xFFFF); 106 p0.l = LO(IMEM_CONTROL);
104 p0.h = (IMEM_CONTROL >> 16); 107 p0.h = HI(IMEM_CONTROL);
105 R1 = [p0]; 108 R1 = [p0];
106 R0 = ~ENICPLB; 109 R0 = ~ENICPLB;
107 R0 = R0 & R1; 110 R0 = R0 & R1;
108 111
109 /* Anomaly 05000125 */ 112 /* Anomaly 05000125 */
110#ifdef ANOMALY_05000125 113#if ANOMALY_05000125
111 CLI R2; 114 CLI R2;
112 SSYNC; 115 SSYNC;
113#endif 116#endif
114 [p0] = R0; 117 [p0] = R0;
115 SSYNC; 118 SSYNC;
116#ifdef ANOMALY_05000125 119#if ANOMALY_05000125
117 STI R2; 120 STI R2;
118#endif 121#endif
119 122
120 /* Turn off the dcache */ 123 /* Turn off the dcache */
121 p0.l = (DMEM_CONTROL & 0xFFFF); 124 p0.l = LO(DMEM_CONTROL);
122 p0.h = (DMEM_CONTROL >> 16); 125 p0.h = HI(DMEM_CONTROL);
123 R1 = [p0]; 126 R1 = [p0];
124 R0 = ~ENDCPLB; 127 R0 = ~ENDCPLB;
125 R0 = R0 & R1; 128 R0 = R0 & R1;
126 129
127 /* Anomaly 05000125 */ 130 /* Anomaly 05000125 */
128#ifdef ANOMALY_05000125 131#if ANOMALY_05000125
129 CLI R2; 132 CLI R2;
130 SSYNC; 133 SSYNC;
131#endif 134#endif
132 [p0] = R0; 135 [p0] = R0;
133 SSYNC; 136 SSYNC;
134#ifdef ANOMALY_05000125 137#if ANOMALY_05000125
135 STI R2; 138 STI R2;
136#endif 139#endif
137 140
@@ -141,12 +144,12 @@ ENTRY(__start)
141 */ 144 */
142 p0.h = hi(BFIN_PORT_MUX); 145 p0.h = hi(BFIN_PORT_MUX);
143 p0.l = lo(BFIN_PORT_MUX); 146 p0.l = lo(BFIN_PORT_MUX);
144#ifdef ANOMALY_05000212 147#if ANOMALY_05000212
145 R0.L = W[P0]; /* Read */ 148 R0.L = W[P0]; /* Read */
146 SSYNC; 149 SSYNC;
147#endif 150#endif
148 R0 = (PGDE_UART | PFTE_UART)(Z); 151 R0 = (PGDE_UART | PFTE_UART)(Z);
149#ifdef ANOMALY_05000212 152#if ANOMALY_05000212
150 W[P0] = R0.L; /* Write */ 153 W[P0] = R0.L; /* Write */
151 SSYNC; 154 SSYNC;
152#endif 155#endif
@@ -155,12 +158,12 @@ ENTRY(__start)
155 158
156 p0.h = hi(PORTF_FER); 159 p0.h = hi(PORTF_FER);
157 p0.l = lo(PORTF_FER); 160 p0.l = lo(PORTF_FER);
158#ifdef ANOMALY_05000212 161#if ANOMALY_05000212
159 R0.L = W[P0]; /* Read */ 162 R0.L = W[P0]; /* Read */
160 SSYNC; 163 SSYNC;
161#endif 164#endif
162 R0 = 0x000F(Z); 165 R0 = 0x000F(Z);
163#ifdef ANOMALY_05000212 166#if ANOMALY_05000212
164 W[P0] = R0.L; /* Write */ 167 W[P0] = R0.L; /* Write */
165 SSYNC; 168 SSYNC;
166#endif 169#endif
@@ -221,6 +224,12 @@ ENTRY(__start)
221 fp = sp; 224 fp = sp;
222 usp = sp; 225 usp = sp;
223 226
227#ifdef CONFIG_EARLY_PRINTK
228 SP += -12;
229 call _init_early_exception_vectors;
230 SP += 12;
231#endif
232
224 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 233 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
225 call _bf53x_relocate_l1_mem; 234 call _bf53x_relocate_l1_mem;
226#if CONFIG_BFIN_KERNEL_CLOCK 235#if CONFIG_BFIN_KERNEL_CLOCK
@@ -274,7 +283,7 @@ ENTRY(__start)
274 p0.l = .LWAIT_HERE; 283 p0.l = .LWAIT_HERE;
275 p0.h = .LWAIT_HERE; 284 p0.h = .LWAIT_HERE;
276 reti = p0; 285 reti = p0;
277#if defined(ANOMALY_05000281) 286#if ANOMALY_05000281
278 nop; nop; nop; 287 nop; nop; nop;
279#endif 288#endif
280 rti; 289 rti;
@@ -436,8 +445,8 @@ ENTRY(_start_dma_code)
436 w[p0] = r0.l; 445 w[p0] = r0.l;
437 ssync; 446 ssync;
438 447
439 p0.l = (EBIU_SDBCTL & 0xFFFF); 448 p0.l = LO(EBIU_SDBCTL);
440 p0.h = (EBIU_SDBCTL >> 16); /* SDRAM Memory Bank Control Register */ 449 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
441 r0 = mem_SDBCTL; 450 r0 = mem_SDBCTL;
442 w[p0] = r0.l; 451 w[p0] = r0.l;
443 ssync; 452 ssync;
@@ -475,85 +484,6 @@ ENTRY(_start_dma_code)
475ENDPROC(_start_dma_code) 484ENDPROC(_start_dma_code)
476#endif /* CONFIG_BFIN_KERNEL_CLOCK */ 485#endif /* CONFIG_BFIN_KERNEL_CLOCK */
477 486
478ENTRY(_bfin_reset)
479 /* No more interrupts to be handled*/
480 CLI R6;
481 SSYNC;
482
483#if defined(CONFIG_MTD_M25P80)
484 /*
485 * The following code fix the SPI flash reboot issue,
486 * /CS signal of the chip which is using PF10 return to GPIO mode
487 */
488 p0.h = hi(PORTF_FER);
489 p0.l = lo(PORTF_FER);
490 r0.l = 0x0000;
491 w[p0] = r0.l;
492 SSYNC;
493
494 /* /CS return to high */
495 p0.h = hi(PORTFIO);
496 p0.l = lo(PORTFIO);
497 r0.l = 0xFFFF;
498 w[p0] = r0.l;
499 SSYNC;
500
501 /* Delay some time, This is necessary */
502 r1.h = 0;
503 r1.l = 0x400;
504 p1 = r1;
505 lsetup (.L_delay_lab1, .L_delay_lab1_end) lc1 = p1;
506.L_delay_lab1:
507 r0.h = 0;
508 r0.l = 0x8000;
509 p0 = r0;
510 lsetup (.L_delay_lab0, .L_delay_lab0_end) lc0 = p0;
511.L_delay_lab0:
512 nop;
513.L_delay_lab0_end:
514 nop;
515.L_delay_lab1_end:
516 nop;
517#endif
518
519 /* Clear the IMASK register */
520 p0.h = hi(IMASK);
521 p0.l = lo(IMASK);
522 r0 = 0x0;
523 [p0] = r0;
524
525 /* Clear the ILAT register */
526 p0.h = hi(ILAT);
527 p0.l = lo(ILAT);
528 r0 = [p0];
529 [p0] = r0;
530 SSYNC;
531
532 /* make sure SYSCR is set to use BMODE */
533 P0.h = hi(SYSCR);
534 P0.l = lo(SYSCR);
535 R0.l = 0x0;
536 W[P0] = R0.l;
537 SSYNC;
538
539 /* issue a system soft reset */
540 P1.h = hi(SWRST);
541 P1.l = lo(SWRST);
542 R1.l = 0x0007;
543 W[P1] = R1;
544 SSYNC;
545
546 /* clear system soft reset */
547 R0.l = 0x0000;
548 W[P0] = R0;
549 SSYNC;
550
551 /* issue core reset */
552 raise 1;
553
554 RTS;
555ENDPROC(_bfin_reset)
556
557.data 487.data
558 488
559/* 489/*
diff --git a/arch/blackfin/mach-bf548/Kconfig b/arch/blackfin/mach-bf548/Kconfig
index e78b03d56c7c..08d8dc83701c 100644
--- a/arch/blackfin/mach-bf548/Kconfig
+++ b/arch/blackfin/mach-bf548/Kconfig
@@ -2,6 +2,13 @@ if (BF54x)
2 2
3menu "BF548 Specific Configuration" 3menu "BF548 Specific Configuration"
4 4
5config DEB_DMA_URGENT
6 bool "DMA has priority over core for ext. accesses"
7 depends on BF54x
8 default n
9 help
10 Treat any DEB1, DEB2 and DEB3 request as Urgent
11
5comment "Interrupt Priority Assignment" 12comment "Interrupt Priority Assignment"
6menu "Priority" 13menu "Priority"
7 14
@@ -282,7 +289,7 @@ menu "Assignment"
282 289
283config PINTx_REASSIGN 290config PINTx_REASSIGN
284 bool "Reprogram PINT Assignment" 291 bool "Reprogram PINT Assignment"
285 default n 292 default y
286 help 293 help
287 The interrupt assignment registers controls the pin-to-interrupt 294 The interrupt assignment registers controls the pin-to-interrupt
288 assignment in a byte-wide manner. Each option allows you to select 295 assignment in a byte-wide manner. Each option allows you to select
@@ -303,7 +310,7 @@ config PINT1_ASSIGN
303config PINT2_ASSIGN 310config PINT2_ASSIGN
304 hex "PINT2_ASSIGN" 311 hex "PINT2_ASSIGN"
305 depends on PINTx_REASSIGN 312 depends on PINTx_REASSIGN
306 default 0x00000101 313 default 0x07000101
307config PINT3_ASSIGN 314config PINT3_ASSIGN
308 hex "PINT3_ASSIGN" 315 hex "PINT3_ASSIGN"
309 depends on PINTx_REASSIGN 316 depends on PINTx_REASSIGN
diff --git a/arch/blackfin/mach-bf548/Makefile b/arch/blackfin/mach-bf548/Makefile
index 060ad78ebf1d..7e7c9c8ac5b2 100644
--- a/arch/blackfin/mach-bf548/Makefile
+++ b/arch/blackfin/mach-bf548/Makefile
@@ -4,6 +4,6 @@
4 4
5extra-y := head.o 5extra-y := head.o
6 6
7obj-y := ints-priority.o dma.o gpio.o 7obj-y := ints-priority.o dma.o
8 8
9obj-$(CONFIG_CPU_FREQ) += cpu.o 9obj-$(CONFIG_CPU_FREQ) += cpu.o
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 96ad95fab1a8..2c47db494f7d 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -35,9 +35,16 @@
35#include <linux/spi/spi.h> 35#include <linux/spi/spi.h>
36#include <linux/spi/flash.h> 36#include <linux/spi/flash.h>
37#include <linux/irq.h> 37#include <linux/irq.h>
38#include <linux/irq.h>
39#include <linux/interrupt.h> 38#include <linux/interrupt.h>
39#include <linux/usb/musb.h>
40#include <asm/bfin5xx_spi.h> 40#include <asm/bfin5xx_spi.h>
41#include <asm/cplb.h>
42#include <asm/dma.h>
43#include <asm/gpio.h>
44#include <asm/nand.h>
45#include <asm/mach/bf54x_keys.h>
46#include <linux/input.h>
47#include <linux/spi/ad7877.h>
41 48
42/* 49/*
43 * Name the Board for the /proc/cpuinfo 50 * Name the Board for the /proc/cpuinfo
@@ -48,6 +55,88 @@ char *bfin_board_name = "ADSP-BF548-EZKIT";
48 * Driver needs to know address, irq and flag pin. 55 * Driver needs to know address, irq and flag pin.
49 */ 56 */
50 57
58#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
59
60#include <asm/mach/bf54x-lq043.h>
61
62static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
63 .width = 480,
64 .height = 272,
65 .xres = {480, 480, 480},
66 .yres = {272, 272, 272},
67 .bpp = {24, 24, 24},
68 .disp = GPIO_PE3,
69};
70
71static struct resource bf54x_lq043_resources[] = {
72 {
73 .start = IRQ_EPPI0_ERR,
74 .end = IRQ_EPPI0_ERR,
75 .flags = IORESOURCE_IRQ,
76 },
77};
78
79static struct platform_device bf54x_lq043_device = {
80 .name = "bf54x-lq043",
81 .id = -1,
82 .num_resources = ARRAY_SIZE(bf54x_lq043_resources),
83 .resource = bf54x_lq043_resources,
84 .dev = {
85 .platform_data = &bf54x_lq043_data,
86 },
87};
88#endif
89
90#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
91static int bf548_keymap[] = {
92 KEYVAL(0, 0, KEY_ENTER),
93 KEYVAL(0, 1, KEY_HELP),
94 KEYVAL(0, 2, KEY_0),
95 KEYVAL(0, 3, KEY_BACKSPACE),
96 KEYVAL(1, 0, KEY_TAB),
97 KEYVAL(1, 1, KEY_9),
98 KEYVAL(1, 2, KEY_8),
99 KEYVAL(1, 3, KEY_7),
100 KEYVAL(2, 0, KEY_DOWN),
101 KEYVAL(2, 1, KEY_6),
102 KEYVAL(2, 2, KEY_5),
103 KEYVAL(2, 3, KEY_4),
104 KEYVAL(3, 0, KEY_UP),
105 KEYVAL(3, 1, KEY_3),
106 KEYVAL(3, 2, KEY_2),
107 KEYVAL(3, 3, KEY_1),
108};
109
110static struct bfin_kpad_platform_data bf54x_kpad_data = {
111 .rows = 4,
112 .cols = 4,
113 .keymap = bf548_keymap,
114 .keymapsize = ARRAY_SIZE(bf548_keymap),
115 .repeat = 0,
116 .debounce_time = 5000, /* ns (5ms) */
117 .coldrive_time = 1000, /* ns (1ms) */
118 .keyup_test_interval = 50, /* ms (50ms) */
119};
120
121static struct resource bf54x_kpad_resources[] = {
122 {
123 .start = IRQ_KEY,
124 .end = IRQ_KEY,
125 .flags = IORESOURCE_IRQ,
126 },
127};
128
129static struct platform_device bf54x_kpad_device = {
130 .name = "bf54x-keys",
131 .id = -1,
132 .num_resources = ARRAY_SIZE(bf54x_kpad_resources),
133 .resource = bf54x_kpad_resources,
134 .dev = {
135 .platform_data = &bf54x_kpad_data,
136 },
137};
138#endif
139
51#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 140#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
52static struct platform_device rtc_device = { 141static struct platform_device rtc_device = {
53 .name = "rtc-bfin", 142 .name = "rtc-bfin",
@@ -94,6 +183,344 @@ static struct platform_device bfin_uart_device = {
94}; 183};
95#endif 184#endif
96 185
186#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
187static struct resource smsc911x_resources[] = {
188 {
189 .name = "smsc911x-memory",
190 .start = 0x24000000,
191 .end = 0x24000000 + 0xFF,
192 .flags = IORESOURCE_MEM,
193 },
194 {
195 .start = IRQ_PE8,
196 .end = IRQ_PE8,
197 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
198 },
199};
200static struct platform_device smsc911x_device = {
201 .name = "smsc911x",
202 .id = 0,
203 .num_resources = ARRAY_SIZE(smsc911x_resources),
204 .resource = smsc911x_resources,
205};
206#endif
207
208#if defined(CONFIG_USB_BF54x_HCD) || defined(CONFIG_USB_BF54x_HCD_MODULE)
209static struct resource bf54x_hcd_resources[] = {
210 {
211 .start = 0xFFC03C00,
212 .end = 0xFFC040FF,
213 .flags = IORESOURCE_MEM,
214 },
215};
216
217static struct platform_device bf54x_hcd = {
218 .name = "bf54x-hcd",
219 .id = 0,
220 .num_resources = ARRAY_SIZE(bf54x_hcd_resources),
221 .resource = bf54x_hcd_resources,
222};
223#endif
224
225#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
226static struct resource musb_resources[] = {
227 [0] = {
228 .start = 0xFFC03C00,
229 .end = 0xFFC040FF,
230 .flags = IORESOURCE_MEM,
231 },
232 [1] = { /* general IRQ */
233 .start = IRQ_USB_INT0,
234 .end = IRQ_USB_INT0,
235 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
236 },
237 [2] = { /* DMA IRQ */
238 .start = IRQ_USB_DMA,
239 .end = IRQ_USB_DMA,
240 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
241 },
242};
243
244static struct musb_hdrc_platform_data musb_plat = {
245#ifdef CONFIG_USB_MUSB_OTG
246 .mode = MUSB_OTG,
247#elif CONFIG_USB_MUSB_HDRC_HCD
248 .mode = MUSB_HOST,
249#elif CONFIG_USB_GADGET_MUSB_HDRC
250 .mode = MUSB_PERIPHERAL,
251#endif
252 .multipoint = 1,
253};
254
255static u64 musb_dmamask = ~(u32)0;
256
257static struct platform_device musb_device = {
258 .name = "musb_hdrc",
259 .id = 0,
260 .dev = {
261 .dma_mask = &musb_dmamask,
262 .coherent_dma_mask = 0xffffffff,
263 .platform_data = &musb_plat,
264 },
265 .num_resources = ARRAY_SIZE(musb_resources),
266 .resource = musb_resources,
267};
268#endif
269
270#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
271static struct resource bfin_atapi_resources[] = {
272 {
273 .start = 0xFFC03800,
274 .end = 0xFFC0386F,
275 .flags = IORESOURCE_MEM,
276 },
277 {
278 .start = IRQ_ATAPI_ERR,
279 .end = IRQ_ATAPI_ERR,
280 .flags = IORESOURCE_IRQ,
281 },
282};
283
284static struct platform_device bfin_atapi_device = {
285 .name = "pata-bf54x",
286 .id = -1,
287 .num_resources = ARRAY_SIZE(bfin_atapi_resources),
288 .resource = bfin_atapi_resources,
289};
290#endif
291
292#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
293static struct mtd_partition partition_info[] = {
294 {
295 .name = "Linux Kernel",
296 .offset = 0,
297 .size = 4 * SIZE_1M,
298 },
299 {
300 .name = "File System",
301 .offset = 4 * SIZE_1M,
302 .size = (256 - 4) * SIZE_1M,
303 },
304};
305
306static struct bf5xx_nand_platform bf5xx_nand_platform = {
307 .page_size = NFC_PG_SIZE_256,
308 .data_width = NFC_NWIDTH_8,
309 .partitions = partition_info,
310 .nr_partitions = ARRAY_SIZE(partition_info),
311 .rd_dly = 3,
312 .wr_dly = 3,
313};
314
315static struct resource bf5xx_nand_resources[] = {
316 {
317 .start = 0xFFC03B00,
318 .end = 0xFFC03B4F,
319 .flags = IORESOURCE_MEM,
320 },
321 {
322 .start = CH_NFC,
323 .end = CH_NFC,
324 .flags = IORESOURCE_IRQ,
325 },
326};
327
328static struct platform_device bf5xx_nand_device = {
329 .name = "bf5xx-nand",
330 .id = 0,
331 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
332 .resource = bf5xx_nand_resources,
333 .dev = {
334 .platform_data = &bf5xx_nand_platform,
335 },
336};
337#endif
338
339#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN)
340static struct platform_device bf54x_sdh_device = {
341 .name = "bfin-sdh",
342 .id = 0,
343};
344#endif
345
346#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
347/* all SPI peripherals info goes here */
348#if defined(CONFIG_MTD_M25P80) \
349 || defined(CONFIG_MTD_M25P80_MODULE)
350/* SPI flash chip (m25p16) */
351static struct mtd_partition bfin_spi_flash_partitions[] = {
352 {
353 .name = "bootloader",
354 .size = 0x00040000,
355 .offset = 0,
356 .mask_flags = MTD_CAP_ROM
357 }, {
358 .name = "linux kernel",
359 .size = 0x1c0000,
360 .offset = 0x40000
361 }
362};
363
364static struct flash_platform_data bfin_spi_flash_data = {
365 .name = "m25p80",
366 .parts = bfin_spi_flash_partitions,
367 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
368 .type = "m25p16",
369};
370
371static struct bfin5xx_spi_chip spi_flash_chip_info = {
372 .enable_dma = 0, /* use dma transfer with this chip*/
373 .bits_per_word = 8,
374 .cs_change_per_word = 0,
375};
376#endif
377
378#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
379static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
380 .cs_change_per_word = 1,
381 .enable_dma = 0,
382 .bits_per_word = 16,
383};
384
385static const struct ad7877_platform_data bfin_ad7877_ts_info = {
386 .model = 7877,
387 .vref_delay_usecs = 50, /* internal, no capacitor */
388 .x_plate_ohms = 419,
389 .y_plate_ohms = 486,
390 .pressure_max = 1000,
391 .pressure_min = 0,
392 .stopacq_polarity = 1,
393 .first_conversion_delay = 3,
394 .acquisition_time = 1,
395 .averaging = 1,
396 .pen_down_acc_interval = 1,
397};
398#endif
399
400static struct spi_board_info bf54x_spi_board_info[] __initdata = {
401#if defined(CONFIG_MTD_M25P80) \
402 || defined(CONFIG_MTD_M25P80_MODULE)
403 {
404 /* the modalias must be the same as spi device driver name */
405 .modalias = "m25p80", /* Name of spi_driver for this device */
406 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
407 .bus_num = 0, /* Framework bus number */
408 .chip_select = 1, /* SPI_SSEL1*/
409 .platform_data = &bfin_spi_flash_data,
410 .controller_data = &spi_flash_chip_info,
411 .mode = SPI_MODE_3,
412 },
413#endif
414#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
415{
416 .modalias = "ad7877",
417 .platform_data = &bfin_ad7877_ts_info,
418 .irq = IRQ_PJ11,
419 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
420 .bus_num = 0,
421 .chip_select = 2,
422 .controller_data = &spi_ad7877_chip_info,
423},
424#endif
425};
426
427/* SPI (0) */
428static struct resource bfin_spi0_resource[] = {
429 [0] = {
430 .start = SPI0_REGBASE,
431 .end = SPI0_REGBASE + 0xFF,
432 .flags = IORESOURCE_MEM,
433 },
434 [1] = {
435 .start = CH_SPI0,
436 .end = CH_SPI0,
437 .flags = IORESOURCE_IRQ,
438 }
439};
440
441/* SPI (1) */
442static struct resource bfin_spi1_resource[] = {
443 [0] = {
444 .start = SPI1_REGBASE,
445 .end = SPI1_REGBASE + 0xFF,
446 .flags = IORESOURCE_MEM,
447 },
448 [1] = {
449 .start = CH_SPI1,
450 .end = CH_SPI1,
451 .flags = IORESOURCE_IRQ,
452 }
453};
454
455/* SPI controller data */
456static struct bfin5xx_spi_master bf54x_spi_master_info = {
457 .num_chipselect = 8,
458 .enable_dma = 1, /* master has the ability to do dma transfer */
459};
460
461static struct platform_device bf54x_spi_master0 = {
462 .name = "bfin-spi",
463 .id = 0, /* Bus number */
464 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
465 .resource = bfin_spi0_resource,
466 .dev = {
467 .platform_data = &bf54x_spi_master_info, /* Passed to driver */
468 },
469};
470
471static struct platform_device bf54x_spi_master1 = {
472 .name = "bfin-spi",
473 .id = 1, /* Bus number */
474 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
475 .resource = bfin_spi1_resource,
476 .dev = {
477 .platform_data = &bf54x_spi_master_info, /* Passed to driver */
478 },
479};
480#endif /* spi master and devices */
481
482#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
483static struct resource bfin_twi0_resource[] = {
484 [0] = {
485 .start = TWI0_REGBASE,
486 .end = TWI0_REGBASE + 0xFF,
487 .flags = IORESOURCE_MEM,
488 },
489 [1] = {
490 .start = IRQ_TWI0,
491 .end = IRQ_TWI0,
492 .flags = IORESOURCE_IRQ,
493 },
494};
495
496static struct platform_device i2c_bfin_twi0_device = {
497 .name = "i2c-bfin-twi",
498 .id = 0,
499 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
500 .resource = bfin_twi0_resource,
501};
502
503static struct resource bfin_twi1_resource[] = {
504 [0] = {
505 .start = TWI1_REGBASE,
506 .end = TWI1_REGBASE + 0xFF,
507 .flags = IORESOURCE_MEM,
508 },
509 [1] = {
510 .start = IRQ_TWI1,
511 .end = IRQ_TWI1,
512 .flags = IORESOURCE_IRQ,
513 },
514};
515
516static struct platform_device i2c_bfin_twi1_device = {
517 .name = "i2c-bfin-twi",
518 .id = 1,
519 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
520 .resource = bfin_twi1_resource,
521};
522#endif
523
97static struct platform_device *ezkit_devices[] __initdata = { 524static struct platform_device *ezkit_devices[] __initdata = {
98#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 525#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
99 &rtc_device, 526 &rtc_device,
@@ -102,12 +529,60 @@ static struct platform_device *ezkit_devices[] __initdata = {
102#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 529#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
103 &bfin_uart_device, 530 &bfin_uart_device,
104#endif 531#endif
532
533#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
534 &bf54x_lq043_device,
535#endif
536
537#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
538 &smsc911x_device,
539#endif
540
541#if defined(CONFIG_USB_BF54x_HCD) || defined(CONFIG_USB_BF54x_HCD_MODULE)
542 &bf54x_hcd,
543#endif
544
545#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
546 &musb_device,
547#endif
548
549#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
550 &bfin_atapi_device,
551#endif
552
553#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
554 &bf5xx_nand_device,
555#endif
556
557#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN)
558 &bf54x_sdh_device,
559#endif
560
561#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
562 &bf54x_spi_master0,
563/* &bf54x_spi_master1,*/
564#endif
565
566#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
567 &bf54x_kpad_device,
568#endif
569
570#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
571 &i2c_bfin_twi0_device,
572 &i2c_bfin_twi1_device,
573#endif
105}; 574};
106 575
107static int __init stamp_init(void) 576static int __init stamp_init(void)
108{ 577{
109 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); 578 printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
110 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); 579 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
580
581#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
582 spi_register_board_info(bf54x_spi_board_info,
583 ARRAY_SIZE(bf54x_spi_board_info));
584#endif
585
111 return 0; 586 return 0;
112} 587}
113 588
diff --git a/arch/blackfin/mach-bf548/gpio.c b/arch/blackfin/mach-bf548/gpio.c
deleted file mode 100644
index 0da5f0003b8c..000000000000
--- a/arch/blackfin/mach-bf548/gpio.c
+++ /dev/null
@@ -1,323 +0,0 @@
1/*
2 * File: arch/blackfin/mach-bf548/gpio.c
3 * Based on:
4 * Author: Michael Hennerich (hennerich@blackfin.uclinux.org)
5 *
6 * Created:
7 * Description: GPIO Abstraction Layer
8 *
9 * Modified:
10 * Copyright 2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/module.h>
31#include <linux/err.h>
32#include <asm/blackfin.h>
33#include <asm/gpio.h>
34#include <asm/portmux.h>
35#include <linux/irq.h>
36
37static struct gpio_port_t *gpio_array[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
38 (struct gpio_port_t *)PORTA_FER,
39 (struct gpio_port_t *)PORTB_FER,
40 (struct gpio_port_t *)PORTC_FER,
41 (struct gpio_port_t *)PORTD_FER,
42 (struct gpio_port_t *)PORTE_FER,
43 (struct gpio_port_t *)PORTF_FER,
44 (struct gpio_port_t *)PORTG_FER,
45 (struct gpio_port_t *)PORTH_FER,
46 (struct gpio_port_t *)PORTI_FER,
47 (struct gpio_port_t *)PORTJ_FER,
48};
49
50static unsigned short reserved_gpio_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
51static unsigned short reserved_peri_map[gpio_bank(MAX_BLACKFIN_GPIOS)];
52
53inline int check_gpio(unsigned short gpio)
54{
55 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
56 || gpio == GPIO_PH14 || gpio == GPIO_PH15
57 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15
58 || gpio > MAX_BLACKFIN_GPIOS)
59 return -EINVAL;
60 return 0;
61}
62
63inline void portmux_setup(unsigned short portno, unsigned short function)
64{
65 u32 pmux;
66
67 pmux = gpio_array[gpio_bank(portno)]->port_mux;
68
69 pmux &= ~(0x3 << (2 * gpio_sub_n(portno)));
70 pmux |= (function & 0x3) << (2 * gpio_sub_n(portno));
71
72 gpio_array[gpio_bank(portno)]->port_mux = pmux;
73
74}
75
76inline u16 get_portmux(unsigned short portno)
77{
78 u32 pmux;
79
80 pmux = gpio_array[gpio_bank(portno)]->port_mux;
81
82 return (pmux >> (2 * gpio_sub_n(portno)) & 0x3);
83
84}
85
86static void port_setup(unsigned short gpio, unsigned short usage)
87{
88 if (usage == GPIO_USAGE) {
89 if (gpio_array[gpio_bank(gpio)]->port_fer & gpio_bit(gpio))
90 printk(KERN_WARNING
91 "bfin-gpio: Possible Conflict with Peripheral "
92 "usage and GPIO %d detected!\n", gpio);
93 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
94 } else
95 gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio);
96 SSYNC();
97}
98
99static int __init bfin_gpio_init(void)
100{
101 printk(KERN_INFO "Blackfin GPIO Controller\n");
102
103 return 0;
104}
105
106arch_initcall(bfin_gpio_init);
107
108int peripheral_request(unsigned short per, const char *label)
109{
110 unsigned long flags;
111 unsigned short ident = P_IDENT(per);
112
113 if (!(per & P_DEFINED))
114 return -ENODEV;
115
116 if (check_gpio(ident) < 0)
117 return -EINVAL;
118
119 local_irq_save(flags);
120
121 if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
122 printk(KERN_ERR
123 "%s: Peripheral %d is already reserved as GPIO!\n",
124 __FUNCTION__, per);
125 dump_stack();
126 local_irq_restore(flags);
127 return -EBUSY;
128 }
129
130 if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) {
131
132 u16 funct = get_portmux(ident);
133
134 if (!((per & P_MAYSHARE) && (funct == P_FUNCT2MUX(per)))) {
135 printk(KERN_ERR
136 "%s: Peripheral %d is already reserved!\n",
137 __FUNCTION__, per);
138 dump_stack();
139 local_irq_restore(flags);
140 return -EBUSY;
141 }
142 }
143
144 reserved_peri_map[gpio_bank(ident)] |= gpio_bit(ident);
145
146 portmux_setup(ident, P_FUNCT2MUX(per));
147 port_setup(ident, PERIPHERAL_USAGE);
148
149 local_irq_restore(flags);
150
151 return 0;
152}
153EXPORT_SYMBOL(peripheral_request);
154
155int peripheral_request_list(unsigned short per[], const char *label)
156{
157
158 u16 cnt;
159 int ret;
160
161 for (cnt = 0; per[cnt] != 0; cnt++) {
162 ret = peripheral_request(per[cnt], label);
163 if (ret < 0)
164 return ret;
165 }
166
167 return 0;
168}
169EXPORT_SYMBOL(peripheral_request_list);
170
171void peripheral_free(unsigned short per)
172{
173 unsigned long flags;
174 unsigned short ident = P_IDENT(per);
175
176 if (!(per & P_DEFINED))
177 return;
178
179 if (check_gpio(ident) < 0)
180 return;
181
182 local_irq_save(flags);
183
184 if (unlikely(!(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident)))) {
185 printk(KERN_ERR "bfin-gpio: Peripheral %d wasn't reserved!\n", per);
186 dump_stack();
187 local_irq_restore(flags);
188 return;
189 }
190
191 if (!(per & P_MAYSHARE)) {
192 port_setup(ident, GPIO_USAGE);
193 }
194
195 reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident);
196
197 local_irq_restore(flags);
198}
199EXPORT_SYMBOL(peripheral_free);
200
201void peripheral_free_list(unsigned short per[])
202{
203 u16 cnt;
204
205 for (cnt = 0; per[cnt] != 0; cnt++) {
206 peripheral_free(per[cnt]);
207 }
208
209}
210EXPORT_SYMBOL(peripheral_free_list);
211
212/***********************************************************
213*
214* FUNCTIONS: Blackfin GPIO Driver
215*
216* INPUTS/OUTPUTS:
217* gpio - GPIO Number between 0 and MAX_BLACKFIN_GPIOS
218*
219*
220* DESCRIPTION: Blackfin GPIO Driver API
221*
222* CAUTION:
223*************************************************************
224* MODIFICATION HISTORY :
225**************************************************************/
226
227int gpio_request(unsigned short gpio, const char *label)
228{
229 unsigned long flags;
230
231 if (check_gpio(gpio) < 0)
232 return -EINVAL;
233
234 local_irq_save(flags);
235
236 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
237 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved!\n", gpio);
238 dump_stack();
239 local_irq_restore(flags);
240 return -EBUSY;
241 }
242
243 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
244 printk(KERN_ERR
245 "bfin-gpio: GPIO %d is already reserved as Peripheral!\n", gpio);
246 dump_stack();
247 local_irq_restore(flags);
248 return -EBUSY;
249 }
250
251 reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio);
252
253 local_irq_restore(flags);
254
255 port_setup(gpio, GPIO_USAGE);
256
257 return 0;
258}
259EXPORT_SYMBOL(gpio_request);
260
261void gpio_free(unsigned short gpio)
262{
263 unsigned long flags;
264
265 if (check_gpio(gpio) < 0)
266 return;
267
268 local_irq_save(flags);
269
270 if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) {
271 printk(KERN_ERR "bfin-gpio: GPIO %d wasn't reserved!\n", gpio);
272 dump_stack();
273 local_irq_restore(flags);
274 return;
275 }
276
277 reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
278
279 local_irq_restore(flags);
280}
281EXPORT_SYMBOL(gpio_free);
282
283void gpio_direction_input(unsigned short gpio)
284{
285 unsigned long flags;
286
287 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
288
289 local_irq_save(flags);
290 gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio);
291 gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio);
292 local_irq_restore(flags);
293}
294EXPORT_SYMBOL(gpio_direction_input);
295
296void gpio_direction_output(unsigned short gpio)
297{
298 unsigned long flags;
299
300 BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)));
301
302 local_irq_save(flags);
303 gpio_array[gpio_bank(gpio)]->port_inen &= ~gpio_bit(gpio);
304 gpio_array[gpio_bank(gpio)]->port_dir_set = gpio_bit(gpio);
305 local_irq_restore(flags);
306}
307EXPORT_SYMBOL(gpio_direction_output);
308
309void gpio_set_value(unsigned short gpio, unsigned short arg)
310{
311 if (arg)
312 gpio_array[gpio_bank(gpio)]->port_set = gpio_bit(gpio);
313 else
314 gpio_array[gpio_bank(gpio)]->port_clear = gpio_bit(gpio);
315
316}
317EXPORT_SYMBOL(gpio_set_value);
318
319unsigned short gpio_get_value(unsigned short gpio)
320{
321 return (1 & (gpio_array[gpio_bank(gpio)]->port_data >> gpio_sub_n(gpio)));
322}
323EXPORT_SYMBOL(gpio_get_value);
diff --git a/arch/blackfin/mach-bf548/head.S b/arch/blackfin/mach-bf548/head.S
index 06751ae8b857..3071c243d426 100644
--- a/arch/blackfin/mach-bf548/head.S
+++ b/arch/blackfin/mach-bf548/head.S
@@ -31,6 +31,7 @@
31#include <asm/blackfin.h> 31#include <asm/blackfin.h>
32#include <asm/trace.h> 32#include <asm/trace.h>
33#if CONFIG_BFIN_KERNEL_CLOCK 33#if CONFIG_BFIN_KERNEL_CLOCK
34#include <asm/mach-common/clocks.h>
34#include <asm/mach/mem_init.h> 35#include <asm/mach/mem_init.h>
35#endif 36#endif
36 37
@@ -49,9 +50,13 @@ ENTRY(__start)
49ENTRY(__stext) 50ENTRY(__stext)
50 /* R0: argument of command line string, passed from uboot, save it */ 51 /* R0: argument of command line string, passed from uboot, save it */
51 R7 = R0; 52 R7 = R0;
52 /* Set the SYSCFG register */ 53 /* Enable Cycle Counter and Nesting Of Interrupts */
53 R0 = 0x36; 54#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
54 SYSCFG = R0; /*Enable Cycle Counter and Nesting Of Interrupts(3rd Bit)*/ 55 R0 = SYSCFG_SNEN;
56#else
57 R0 = SYSCFG_SNEN | SYSCFG_CCEN;
58#endif
59 SYSCFG = R0;
55 R0 = 0; 60 R0 = 0;
56 61
57 /* Clear Out All the data and pointer Registers*/ 62 /* Clear Out All the data and pointer Registers*/
@@ -92,13 +97,13 @@ ENTRY(__stext)
92 M2 = r0; 97 M2 = r0;
93 M3 = r0; 98 M3 = r0;
94 99
95 trace_buffer_start(p0,r0); 100 trace_buffer_init(p0,r0);
96 P0 = R1; 101 P0 = R1;
97 R0 = R1; 102 R0 = R1;
98 103
99 /* Turn off the icache */ 104 /* Turn off the icache */
100 p0.l = (IMEM_CONTROL & 0xFFFF); 105 p0.l = LO(IMEM_CONTROL);
101 p0.h = (IMEM_CONTROL >> 16); 106 p0.h = HI(IMEM_CONTROL);
102 R1 = [p0]; 107 R1 = [p0];
103 R0 = ~ENICPLB; 108 R0 = ~ENICPLB;
104 R0 = R0 & R1; 109 R0 = R0 & R1;
@@ -106,8 +111,8 @@ ENTRY(__stext)
106 SSYNC; 111 SSYNC;
107 112
108 /* Turn off the dcache */ 113 /* Turn off the dcache */
109 p0.l = (DMEM_CONTROL & 0xFFFF); 114 p0.l = LO(DMEM_CONTROL);
110 p0.h = (DMEM_CONTROL >> 16); 115 p0.h = HI(DMEM_CONTROL);
111 R1 = [p0]; 116 R1 = [p0];
112 R0 = ~ENDCPLB; 117 R0 = ~ENDCPLB;
113 R0 = R0 & R1; 118 R0 = R0 & R1;
@@ -120,6 +125,12 @@ ENTRY(__stext)
120 FP = SP; 125 FP = SP;
121 USP = SP; 126 USP = SP;
122 127
128#ifdef CONFIG_EARLY_PRINTK
129 SP += -12;
130 call _init_early_exception_vectors;
131 SP += 12;
132#endif
133
123 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 134 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
124 call _bf53x_relocate_l1_mem; 135 call _bf53x_relocate_l1_mem;
125#if CONFIG_BFIN_KERNEL_CLOCK 136#if CONFIG_BFIN_KERNEL_CLOCK
@@ -172,7 +183,7 @@ ENTRY(__stext)
172 p0.l = .LWAIT_HERE; 183 p0.l = .LWAIT_HERE;
173 p0.h = .LWAIT_HERE; 184 p0.h = .LWAIT_HERE;
174 reti = p0; 185 reti = p0;
175#if defined (ANOMALY_05000281) 186#if ANOMALY_05000281
176 nop; 187 nop;
177 nop; 188 nop;
178 nop; 189 nop;
@@ -335,8 +346,8 @@ ENTRY(_start_dma_code)
335 w[p0] = r0.l; 346 w[p0] = r0.l;
336 ssync; 347 ssync;
337 348
338 p0.l = (EBIU_SDBCTL & 0xFFFF); 349 p0.l = LO(EBIU_SDBCTL);
339 p0.h = (EBIU_SDBCTL >> 16); /* SDRAM Memory Bank Control Register */ 350 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
340 r0 = mem_SDBCTL; 351 r0 = mem_SDBCTL;
341 w[p0] = r0.l; 352 w[p0] = r0.l;
342 ssync; 353 ssync;
@@ -373,129 +384,6 @@ ENTRY(_start_dma_code)
373 RTS; 384 RTS;
374#endif /* CONFIG_BFIN_KERNEL_CLOCK */ 385#endif /* CONFIG_BFIN_KERNEL_CLOCK */
375 386
376ENTRY(_bfin_reset)
377 /* No more interrupts to be handled*/
378 CLI R6;
379 SSYNC;
380
381#if defined(CONFIG_MTD_M25P80)
382/*
383 * The following code fix the SPI flash reboot issue,
384 * /CS signal of the chip which is using PF10 return to GPIO mode
385 */
386 p0.h = hi(PORTF_FER);
387 p0.l = lo(PORTF_FER);
388 r0.l = 0x0000;
389 w[p0] = r0.l;
390 SSYNC;
391
392/* /CS return to high */
393 p0.h = hi(PORTFIO);
394 p0.l = lo(PORTFIO);
395 r0.l = 0xFFFF;
396 w[p0] = r0.l;
397 SSYNC;
398
399/* Delay some time, This is necessary */
400 r1.h = 0;
401 r1.l = 0x400;
402 p1 = r1;
403 lsetup (_delay_lab1,_delay_lab1_end ) lc1 = p1;
404_delay_lab1:
405 r0.h = 0;
406 r0.l = 0x8000;
407 p0 = r0;
408 lsetup (_delay_lab0,_delay_lab0_end ) lc0 = p0;
409_delay_lab0:
410 nop;
411_delay_lab0_end:
412 nop;
413_delay_lab1_end:
414 nop;
415#endif
416
417 /* Clear the bits 13-15 in SWRST if they werent cleared */
418 p0.h = hi(SWRST);
419 p0.l = lo(SWRST);
420 csync;
421 r0.l = w[p0];
422
423 /* Clear the IMASK register */
424 p0.h = hi(IMASK);
425 p0.l = lo(IMASK);
426 r0 = 0x0;
427 [p0] = r0;
428
429 /* Clear the ILAT register */
430 p0.h = hi(ILAT);
431 p0.l = lo(ILAT);
432 r0 = [p0];
433 [p0] = r0;
434 SSYNC;
435
436 /* Disable the WDOG TIMER */
437 p0.h = hi(WDOG_CTL);
438 p0.l = lo(WDOG_CTL);
439 r0.l = 0xAD6;
440 w[p0] = r0.l;
441 SSYNC;
442
443 /* Clear the sticky bit incase it is already set */
444 p0.h = hi(WDOG_CTL);
445 p0.l = lo(WDOG_CTL);
446 r0.l = 0x8AD6;
447 w[p0] = r0.l;
448 SSYNC;
449
450 /* Program the count value */
451 R0.l = 0x100;
452 R0.h = 0x0;
453 P0.h = hi(WDOG_CNT);
454 P0.l = lo(WDOG_CNT);
455 [P0] = R0;
456 SSYNC;
457
458 /* Program WDOG_STAT if necessary */
459 P0.h = hi(WDOG_CTL);
460 P0.l = lo(WDOG_CTL);
461 R0 = W[P0](Z);
462 CC = BITTST(R0,1);
463 if !CC JUMP .LWRITESTAT;
464 CC = BITTST(R0,2);
465 if !CC JUMP .LWRITESTAT;
466 JUMP .LSKIP_WRITE;
467
468.LWRITESTAT:
469 /* When watch dog timer is enabled,
470 * a write to STAT will load the contents of CNT to STAT
471 */
472 R0 = 0x0000(z);
473 P0.h = hi(WDOG_STAT);
474 P0.l = lo(WDOG_STAT)
475 [P0] = R0;
476 SSYNC;
477
478.LSKIP_WRITE:
479 /* Enable the reset event */
480 P0.h = hi(WDOG_CTL);
481 P0.l = lo(WDOG_CTL);
482 R0 = W[P0](Z);
483 BITCLR(R0,1);
484 BITCLR(R0,2);
485 W[P0] = R0.L;
486 SSYNC;
487 NOP;
488
489 /* Enable the wdog counter */
490 R0 = W[P0](Z);
491 BITCLR(R0,4);
492 W[P0] = R0.L;
493 SSYNC;
494
495 IDLE;
496
497 RTS;
498
499.data 387.data
500 388
501/* 389/*
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c
index 5b2b544529a1..cd827a1b6ba1 100644
--- a/arch/blackfin/mach-bf561/boards/cm_bf561.c
+++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c
@@ -34,7 +34,9 @@
34#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
35#include <linux/spi/flash.h> 35#include <linux/spi/flash.h>
36#include <linux/usb_isp1362.h> 36#include <linux/usb_isp1362.h>
37#include <linux/pata_platform.h>
37#include <linux/irq.h> 38#include <linux/irq.h>
39#include <asm/dma.h>
38#include <asm/bfin5xx_spi.h> 40#include <asm/bfin5xx_spi.h>
39 41
40/* 42/*
@@ -112,7 +114,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
112 /* the modalias must be the same as spi device driver name */ 114 /* the modalias must be the same as spi device driver name */
113 .modalias = "m25p80", /* Name of spi_driver for this device */ 115 .modalias = "m25p80", /* Name of spi_driver for this device */
114 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 116 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
115 .bus_num = 1, /* Framework bus number */ 117 .bus_num = 0, /* Framework bus number */
116 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ 118 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
117 .platform_data = &bfin_spi_flash_data, 119 .platform_data = &bfin_spi_flash_data,
118 .controller_data = &spi_flash_chip_info, 120 .controller_data = &spi_flash_chip_info,
@@ -124,7 +126,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
124 { 126 {
125 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 127 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
126 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 128 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
127 .bus_num = 1, /* Framework bus number */ 129 .bus_num = 0, /* Framework bus number */
128 .chip_select = 1, /* Framework chip select. */ 130 .chip_select = 1, /* Framework chip select. */
129 .platform_data = NULL, /* No spi_driver specific config */ 131 .platform_data = NULL, /* No spi_driver specific config */
130 .controller_data = &spi_adc_chip_info, 132 .controller_data = &spi_adc_chip_info,
@@ -135,7 +137,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
135 { 137 {
136 .modalias = "ad1836-spi", 138 .modalias = "ad1836-spi",
137 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 139 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
138 .bus_num = 1, 140 .bus_num = 0,
139 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 141 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
140 .controller_data = &ad1836_spi_chip_info, 142 .controller_data = &ad1836_spi_chip_info,
141 }, 143 },
@@ -144,7 +146,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
144 { 146 {
145 .modalias = "ad9960-spi", 147 .modalias = "ad9960-spi",
146 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ 148 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
147 .bus_num = 1, 149 .bus_num = 0,
148 .chip_select = 1, 150 .chip_select = 1,
149 .controller_data = &ad9960_spi_chip_info, 151 .controller_data = &ad9960_spi_chip_info,
150 }, 152 },
@@ -153,7 +155,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
153 { 155 {
154 .modalias = "spi_mmc", 156 .modalias = "spi_mmc",
155 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 157 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
156 .bus_num = 1, 158 .bus_num = 0,
157 .chip_select = CONFIG_SPI_MMC_CS_CHAN, 159 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
158 .platform_data = NULL, 160 .platform_data = NULL,
159 .controller_data = &spi_mmc_chip_info, 161 .controller_data = &spi_mmc_chip_info,
@@ -162,17 +164,33 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
162#endif 164#endif
163}; 165};
164 166
167/* SPI (0) */
168static struct resource bfin_spi0_resource[] = {
169 [0] = {
170 .start = SPI0_REGBASE,
171 .end = SPI0_REGBASE + 0xFF,
172 .flags = IORESOURCE_MEM,
173 },
174 [1] = {
175 .start = CH_SPI,
176 .end = CH_SPI,
177 .flags = IORESOURCE_IRQ,
178 }
179};
180
165/* SPI controller data */ 181/* SPI controller data */
166static struct bfin5xx_spi_master spi_bfin_master_info = { 182static struct bfin5xx_spi_master bfin_spi0_info = {
167 .num_chipselect = 8, 183 .num_chipselect = 8,
168 .enable_dma = 1, /* master has the ability to do dma transfer */ 184 .enable_dma = 1, /* master has the ability to do dma transfer */
169}; 185};
170 186
171static struct platform_device spi_bfin_master_device = { 187static struct platform_device bfin_spi0_device = {
172 .name = "bfin-spi-master", 188 .name = "bfin-spi",
173 .id = 1, /* Bus number */ 189 .id = 0, /* Bus number */
190 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
191 .resource = bfin_spi0_resource,
174 .dev = { 192 .dev = {
175 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 193 .platform_data = &bfin_spi0_info, /* Passed to driver */
176 }, 194 },
177}; 195};
178#endif /* spi master and devices */ 196#endif /* spi master and devices */
@@ -256,6 +274,43 @@ static struct platform_device bfin_uart_device = {
256}; 274};
257#endif 275#endif
258 276
277#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
278#define PATA_INT 119
279
280static struct pata_platform_info bfin_pata_platform_data = {
281 .ioport_shift = 2,
282 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
283};
284
285static struct resource bfin_pata_resources[] = {
286 {
287 .start = 0x2400C000,
288 .end = 0x2400C001F,
289 .flags = IORESOURCE_MEM,
290 },
291 {
292 .start = 0x2400D018,
293 .end = 0x2400D01B,
294 .flags = IORESOURCE_MEM,
295 },
296 {
297 .start = PATA_INT,
298 .end = PATA_INT,
299 .flags = IORESOURCE_IRQ,
300 },
301};
302
303static struct platform_device bfin_pata_device = {
304 .name = "pata_platform",
305 .id = -1,
306 .num_resources = ARRAY_SIZE(bfin_pata_resources),
307 .resource = bfin_pata_resources,
308 .dev = {
309 .platform_data = &bfin_pata_platform_data,
310 }
311};
312#endif
313
259static struct platform_device *cm_bf561_devices[] __initdata = { 314static struct platform_device *cm_bf561_devices[] __initdata = {
260 315
261#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 316#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
@@ -271,9 +326,12 @@ static struct platform_device *cm_bf561_devices[] __initdata = {
271#endif 326#endif
272 327
273#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 328#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
274 &spi_bfin_master_device, 329 &bfin_spi0_device,
275#endif 330#endif
276 331
332#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
333 &bfin_pata_device,
334#endif
277}; 335};
278 336
279static int __init cm_bf561_init(void) 337static int __init cm_bf561_init(void)
@@ -283,6 +341,10 @@ static int __init cm_bf561_init(void)
283#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 341#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
284 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 342 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
285#endif 343#endif
344
345#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
346 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
347#endif
286 return 0; 348 return 0;
287} 349}
288 350
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 724191da20a2..57e14edca8b1 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -32,6 +32,8 @@
32#include <linux/spi/spi.h> 32#include <linux/spi/spi.h>
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/pata_platform.h>
36#include <asm/dma.h>
35#include <asm/bfin5xx_spi.h> 37#include <asm/bfin5xx_spi.h>
36 38
37/* 39/*
@@ -140,17 +142,33 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
140#endif 142#endif
141#endif 143#endif
142 144
145/* SPI (0) */
146static struct resource bfin_spi0_resource[] = {
147 [0] = {
148 .start = SPI0_REGBASE,
149 .end = SPI0_REGBASE + 0xFF,
150 .flags = IORESOURCE_MEM,
151 },
152 [1] = {
153 .start = CH_SPI,
154 .end = CH_SPI,
155 .flags = IORESOURCE_IRQ,
156 }
157};
158
143/* SPI controller data */ 159/* SPI controller data */
144static struct bfin5xx_spi_master spi_bfin_master_info = { 160static struct bfin5xx_spi_master bfin_spi0_info = {
145 .num_chipselect = 8, 161 .num_chipselect = 8,
146 .enable_dma = 1, /* master has the ability to do dma transfer */ 162 .enable_dma = 1, /* master has the ability to do dma transfer */
147}; 163};
148 164
149static struct platform_device spi_bfin_master_device = { 165static struct platform_device bfin_spi0_device = {
150 .name = "bfin-spi-master", 166 .name = "bfin-spi",
151 .id = 1, /* Bus number */ 167 .id = 0, /* Bus number */
168 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
169 .resource = bfin_spi0_resource,
152 .dev = { 170 .dev = {
153 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 171 .platform_data = &bfin_spi0_info, /* Passed to driver */
154 }, 172 },
155}; 173};
156 174
@@ -160,23 +178,63 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
160 { 178 {
161 .modalias = "ad1836-spi", 179 .modalias = "ad1836-spi",
162 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 180 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
163 .bus_num = 1, 181 .bus_num = 0,
164 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 182 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
165 .controller_data = &ad1836_spi_chip_info, 183 .controller_data = &ad1836_spi_chip_info,
166 }, 184 },
167#endif 185#endif
168}; 186};
169 187
188#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
189#define PATA_INT 55
190
191static struct pata_platform_info bfin_pata_platform_data = {
192 .ioport_shift = 1,
193 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
194};
195
196static struct resource bfin_pata_resources[] = {
197 {
198 .start = 0x20314020,
199 .end = 0x2031403F,
200 .flags = IORESOURCE_MEM,
201 },
202 {
203 .start = 0x2031401C,
204 .end = 0x2031401F,
205 .flags = IORESOURCE_MEM,
206 },
207 {
208 .start = PATA_INT,
209 .end = PATA_INT,
210 .flags = IORESOURCE_IRQ,
211 },
212};
213
214static struct platform_device bfin_pata_device = {
215 .name = "pata_platform",
216 .id = -1,
217 .num_resources = ARRAY_SIZE(bfin_pata_resources),
218 .resource = bfin_pata_resources,
219 .dev = {
220 .platform_data = &bfin_pata_platform_data,
221 }
222};
223#endif
224
170static struct platform_device *ezkit_devices[] __initdata = { 225static struct platform_device *ezkit_devices[] __initdata = {
171#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 226#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
172 &smc91x_device, 227 &smc91x_device,
173#endif 228#endif
174#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 229#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
175 &spi_bfin_master_device, 230 &bfin_spi0_device,
176#endif 231#endif
177#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 232#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
178 &bfin_uart_device, 233 &bfin_uart_device,
179#endif 234#endif
235#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
236 &bfin_pata_device,
237#endif
180}; 238};
181 239
182static int __init ezkit_init(void) 240static int __init ezkit_init(void)
@@ -194,7 +252,15 @@ static int __init ezkit_init(void)
194 SSYNC(); 252 SSYNC();
195#endif 253#endif
196 254
197 return spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 255#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
256 spi_register_board_info(bfin_spi_board_info,
257 ARRAY_SIZE(bfin_spi_board_info));
258#endif
259
260#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
261 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
262#endif
263 return 0;
198} 264}
199 265
200arch_initcall(ezkit_init); 266arch_initcall(ezkit_init);
diff --git a/arch/blackfin/mach-bf561/head.S b/arch/blackfin/mach-bf561/head.S
index 38650a628980..96a3d456fb6d 100644
--- a/arch/blackfin/mach-bf561/head.S
+++ b/arch/blackfin/mach-bf561/head.S
@@ -33,6 +33,7 @@
33#include <asm/trace.h> 33#include <asm/trace.h>
34 34
35#if CONFIG_BFIN_KERNEL_CLOCK 35#if CONFIG_BFIN_KERNEL_CLOCK
36#include <asm/mach-common/clocks.h>
36#include <asm/mach/mem_init.h> 37#include <asm/mach/mem_init.h>
37#endif 38#endif
38 39
@@ -50,10 +51,12 @@ __INIT
50ENTRY(__start) 51ENTRY(__start)
51 /* R0: argument of command line string, passed from uboot, save it */ 52 /* R0: argument of command line string, passed from uboot, save it */
52 R7 = R0; 53 R7 = R0;
53 /* Set the SYSCFG register: 54 /* Enable Cycle Counter and Nesting Of Interrupts */
54 * Enable Cycle Counter and Nesting Of Interrupts (3rd Bit) 55#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
55 */ 56 R0 = SYSCFG_SNEN;
56 R0 = 0x36; 57#else
58 R0 = SYSCFG_SNEN | SYSCFG_CCEN;
59#endif
57 SYSCFG = R0; 60 SYSCFG = R0;
58 R0 = 0; 61 R0 = 0;
59 62
@@ -95,43 +98,42 @@ ENTRY(__start)
95 M2 = r0; 98 M2 = r0;
96 M3 = r0; 99 M3 = r0;
97 100
98 trace_buffer_start(p0,r0); 101 trace_buffer_init(p0,r0);
99 P0 = R1; 102 P0 = R1;
100 R0 = R1; 103 R0 = R1;
101 104
102 /* Turn off the icache */ 105 /* Turn off the icache */
103 p0.l = (IMEM_CONTROL & 0xFFFF); 106 p0.l = LO(IMEM_CONTROL);
104 p0.h = (IMEM_CONTROL >> 16); 107 p0.h = HI(IMEM_CONTROL);
105 R1 = [p0]; 108 R1 = [p0];
106 R0 = ~ENICPLB; 109 R0 = ~ENICPLB;
107 R0 = R0 & R1; 110 R0 = R0 & R1;
108 111
109 /* Anomaly 05000125 */ 112#if ANOMALY_05000125
110#ifdef ANOMALY_05000125
111 CLI R2; 113 CLI R2;
112 SSYNC; 114 SSYNC;
113#endif 115#endif
114 [p0] = R0; 116 [p0] = R0;
115 SSYNC; 117 SSYNC;
116#ifdef ANOMALY_05000125 118#if ANOMALY_05000125
117 STI R2; 119 STI R2;
118#endif 120#endif
119 121
120 /* Turn off the dcache */ 122 /* Turn off the dcache */
121 p0.l = (DMEM_CONTROL & 0xFFFF); 123 p0.l = LO(DMEM_CONTROL);
122 p0.h = (DMEM_CONTROL >> 16); 124 p0.h = HI(DMEM_CONTROL);
123 R1 = [p0]; 125 R1 = [p0];
124 R0 = ~ENDCPLB; 126 R0 = ~ENDCPLB;
125 R0 = R0 & R1; 127 R0 = R0 & R1;
126 128
127 /* Anomaly 05000125 */ 129 /* Anomaly 05000125 */
128#ifdef ANOMALY_05000125 130#if ANOMALY_05000125
129 CLI R2; 131 CLI R2;
130 SSYNC; 132 SSYNC;
131#endif 133#endif
132 [p0] = R0; 134 [p0] = R0;
133 SSYNC; 135 SSYNC;
134#ifdef ANOMALY_05000125 136#if ANOMALY_05000125
135 STI R2; 137 STI R2;
136#endif 138#endif
137 139
@@ -167,6 +169,12 @@ ENTRY(__start)
167 fp = sp; 169 fp = sp;
168 usp = sp; 170 usp = sp;
169 171
172#ifdef CONFIG_EARLY_PRINTK
173 SP += -12;
174 call _init_early_exception_vectors;
175 SP += 12;
176#endif
177
170 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 178 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
171 call _bf53x_relocate_l1_mem; 179 call _bf53x_relocate_l1_mem;
172#if CONFIG_BFIN_KERNEL_CLOCK 180#if CONFIG_BFIN_KERNEL_CLOCK
@@ -220,7 +228,7 @@ ENTRY(__start)
220 p0.l = .LWAIT_HERE; 228 p0.l = .LWAIT_HERE;
221 p0.h = .LWAIT_HERE; 229 p0.h = .LWAIT_HERE;
222 reti = p0; 230 reti = p0;
223#if defined(ANOMALY_05000281) 231#if ANOMALY_05000281
224 nop; nop; nop; 232 nop; nop; nop;
225#endif 233#endif
226 rti; 234 rti;
@@ -372,8 +380,8 @@ ENTRY(_start_dma_code)
372 w[p0] = r0.l; 380 w[p0] = r0.l;
373 ssync; 381 ssync;
374 382
375 p0.l = (EBIU_SDBCTL & 0xFFFF); 383 p0.l = LO(EBIU_SDBCTL);
376 p0.h = (EBIU_SDBCTL >> 16); /* SDRAM Memory Bank Control Register */ 384 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
377 r0 = mem_SDBCTL; 385 r0 = mem_SDBCTL;
378 w[p0] = r0.l; 386 w[p0] = r0.l;
379 ssync; 387 ssync;
@@ -404,66 +412,6 @@ ENTRY(_start_dma_code)
404ENDPROC(_start_dma_code) 412ENDPROC(_start_dma_code)
405#endif /* CONFIG_BFIN_KERNEL_CLOCK */ 413#endif /* CONFIG_BFIN_KERNEL_CLOCK */
406 414
407ENTRY(_bfin_reset)
408 /* No more interrupts to be handled*/
409 CLI R6;
410 SSYNC;
411
412#if defined(CONFIG_BFIN_SHARED_FLASH_ENET)
413 p0.h = hi(FIO_INEN);
414 p0.l = lo(FIO_INEN);
415 r0.l = ~(PF1 | PF0);
416 w[p0] = r0.l;
417
418 p0.h = hi(FIO_DIR);
419 p0.l = lo(FIO_DIR);
420 r0.l = (PF1 | PF0);
421 w[p0] = r0.l;
422
423 p0.h = hi(FIO_FLAG_C);
424 p0.l = lo(FIO_FLAG_C);
425 r0.l = (PF1 | PF0);
426 w[p0] = r0.l;
427#endif
428
429 /* Clear the IMASK register */
430 p0.h = hi(IMASK);
431 p0.l = lo(IMASK);
432 r0 = 0x0;
433 [p0] = r0;
434
435 /* Clear the ILAT register */
436 p0.h = hi(ILAT);
437 p0.l = lo(ILAT);
438 r0 = [p0];
439 [p0] = r0;
440 SSYNC;
441
442 /* make sure SYSCR is set to use BMODE */
443 P0.h = hi(SYSCR);
444 P0.l = lo(SYSCR);
445 R0.l = 0x20; /* on BF561, disable core b */
446 W[P0] = R0.l;
447 SSYNC;
448
449 /* issue a system soft reset */
450 P1.h = hi(SWRST);
451 P1.l = lo(SWRST);
452 R1.l = 0x0007;
453 W[P1] = R1;
454 SSYNC;
455
456 /* clear system soft reset */
457 R0.l = 0x0000;
458 W[P0] = R0;
459 SSYNC;
460
461 /* issue core reset */
462 raise 1;
463
464 RTS;
465ENDPROC(_bfin_reset)
466
467.data 415.data
468 416
469/* 417/*
diff --git a/arch/blackfin/mach-common/Makefile b/arch/blackfin/mach-common/Makefile
index 0279ede70392..4d7733dfd5de 100644
--- a/arch/blackfin/mach-common/Makefile
+++ b/arch/blackfin/mach-common/Makefile
@@ -4,7 +4,7 @@
4 4
5obj-y := \ 5obj-y := \
6 cache.o cacheinit.o cplbhdlr.o cplbmgr.o entry.o \ 6 cache.o cacheinit.o cplbhdlr.o cplbmgr.o entry.o \
7 interrupt.o lock.o irqpanic.o 7 interrupt.o lock.o irqpanic.o arch_checks.o
8 8
9obj-$(CONFIG_CPLB_INFO) += cplbinfo.o 9obj-$(CONFIG_CPLB_INFO) += cplbinfo.o
10obj-$(CONFIG_BFIN_SINGLE_CORE) += ints-priority-sc.o 10obj-$(CONFIG_BFIN_SINGLE_CORE) += ints-priority-sc.o
diff --git a/arch/blackfin/mach-common/arch_checks.c b/arch/blackfin/mach-common/arch_checks.c
new file mode 100644
index 000000000000..2f6ce397780f
--- /dev/null
+++ b/arch/blackfin/mach-common/arch_checks.c
@@ -0,0 +1,60 @@
1/*
2 * File: arch/blackfin/mach-common/arch_checks.c
3 * Based on:
4 * Author: Robin Getz <rgetz@blackfin.uclinux.org>
5 *
6 * Created: 25Jul07
7 * Description: Do some checking to make sure things are OK
8 *
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <asm/mach/anomaly.h>
31#include <asm/mach-common/clocks.h>
32
33#ifdef CONFIG_BFIN_KERNEL_CLOCK
34
35# if (CONFIG_VCO_HZ > CONFIG_MAX_VCO_HZ)
36# error "VCO selected is more than maximum value. Please change the VCO multipler"
37# endif
38
39# if (CONFIG_SCLK_HZ > CONFIG_MAX_SCLK_HZ)
40# error "Sclk value selected is more than maximum. Please select a proper value for SCLK multiplier"
41# endif
42
43# if (CONFIG_SCLK_HZ < CONFIG_MIN_SCLK_HZ)
44# error "Sclk value selected is less than minimum. Please select a proper value for SCLK multiplier"
45# endif
46
47# if (ANOMALY_05000273) && (CONFIG_SCLK_HZ * 2 > CONFIG_CCLK_HZ)
48# error "ANOMALY 05000273, please make sure CCLK is at least 2x SCLK"
49# endif
50
51# if (CONFIG_SCLK_HZ > CONFIG_CCLK_HZ) && (CONFIG_SCLK_HZ != CONFIG_CLKIN_HZ) && (CONFIG_CCLK_HZ != CONFIG_CLKIN_HZ)
52# error "Please select sclk less than cclk"
53# endif
54
55#endif /* CONFIG_BFIN_KERNEL_CLOCK */
56
57#if (CONFIG_MEM_SIZE % 4)
58#error "SDRAM mem size must be multible of 4MB"
59#endif
60
diff --git a/arch/blackfin/mach-common/cache.S b/arch/blackfin/mach-common/cache.S
index 7063795eb7c0..0521b1588204 100644
--- a/arch/blackfin/mach-common/cache.S
+++ b/arch/blackfin/mach-common/cache.S
@@ -79,8 +79,8 @@ ENTRY(_icache_invalidate)
79ENTRY(_invalidate_entire_icache) 79ENTRY(_invalidate_entire_icache)
80 [--SP] = ( R7:5); 80 [--SP] = ( R7:5);
81 81
82 P0.L = (IMEM_CONTROL & 0xFFFF); 82 P0.L = LO(IMEM_CONTROL);
83 P0.H = (IMEM_CONTROL >> 16); 83 P0.H = HI(IMEM_CONTROL);
84 R7 = [P0]; 84 R7 = [P0];
85 85
86 /* Clear the IMC bit , All valid bits in the instruction 86 /* Clear the IMC bit , All valid bits in the instruction
@@ -197,8 +197,8 @@ ENTRY(_invalidate_entire_dcache)
197ENTRY(_dcache_invalidate) 197ENTRY(_dcache_invalidate)
198 [--SP] = ( R7:6); 198 [--SP] = ( R7:6);
199 199
200 P0.L = (DMEM_CONTROL & 0xFFFF); 200 P0.L = LO(DMEM_CONTROL);
201 P0.H = (DMEM_CONTROL >> 16); 201 P0.H = HI(DMEM_CONTROL);
202 R7 = [P0]; 202 R7 = [P0];
203 203
204 /* Clear the DMC[1:0] bits, All valid bits in the data 204 /* Clear the DMC[1:0] bits, All valid bits in the data
diff --git a/arch/blackfin/mach-common/cacheinit.S b/arch/blackfin/mach-common/cacheinit.S
index 5be6b975ae4a..22fada0c1cb3 100644
--- a/arch/blackfin/mach-common/cacheinit.S
+++ b/arch/blackfin/mach-common/cacheinit.S
@@ -38,13 +38,13 @@
38 38
39.text 39.text
40 40
41#ifdef ANOMALY_05000125 41#if ANOMALY_05000125
42#if defined(CONFIG_BLKFIN_CACHE) 42#if defined(CONFIG_BFIN_ICACHE)
43ENTRY(_bfin_write_IMEM_CONTROL) 43ENTRY(_bfin_write_IMEM_CONTROL)
44 44
45 /* Enable Instruction Cache */ 45 /* Enable Instruction Cache */
46 P0.l = (IMEM_CONTROL & 0xFFFF); 46 P0.l = LO(IMEM_CONTROL);
47 P0.h = (IMEM_CONTROL >> 16); 47 P0.h = HI(IMEM_CONTROL);
48 48
49 /* Anomaly 05000125 */ 49 /* Anomaly 05000125 */
50 CLI R1; 50 CLI R1;
@@ -58,10 +58,10 @@ ENTRY(_bfin_write_IMEM_CONTROL)
58ENDPROC(_bfin_write_IMEM_CONTROL) 58ENDPROC(_bfin_write_IMEM_CONTROL)
59#endif 59#endif
60 60
61#if defined(CONFIG_BLKFIN_DCACHE) 61#if defined(CONFIG_BFIN_DCACHE)
62ENTRY(_bfin_write_DMEM_CONTROL) 62ENTRY(_bfin_write_DMEM_CONTROL)
63 P0.l = (DMEM_CONTROL & 0xFFFF); 63 P0.l = LO(DMEM_CONTROL);
64 P0.h = (DMEM_CONTROL >> 16); 64 P0.h = HI(DMEM_CONTROL);
65 65
66 CLI R1; 66 CLI R1;
67 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */ 67 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
diff --git a/arch/blackfin/mach-common/cplbhdlr.S b/arch/blackfin/mach-common/cplbhdlr.S
index 2f3c72c23997..2788532de72b 100644
--- a/arch/blackfin/mach-common/cplbhdlr.S
+++ b/arch/blackfin/mach-common/cplbhdlr.S
@@ -69,14 +69,14 @@ ENTRY(__cplb_hdr)
69 69
70.Lis_icplb_miss: 70.Lis_icplb_miss:
71 71
72#if defined(CONFIG_BLKFIN_CACHE) || defined(CONFIG_BLKFIN_DCACHE) 72#if defined(CONFIG_BFIN_ICACHE) || defined(CONFIG_BFIN_DCACHE)
73# if defined(CONFIG_BLKFIN_CACHE) && !defined(CONFIG_BLKFIN_DCACHE) 73# if defined(CONFIG_BFIN_ICACHE) && !defined(CONFIG_BFIN_DCACHE)
74 R1 = CPLB_ENABLE_ICACHE; 74 R1 = CPLB_ENABLE_ICACHE;
75# endif 75# endif
76# if !defined(CONFIG_BLKFIN_CACHE) && defined(CONFIG_BLKFIN_DCACHE) 76# if !defined(CONFIG_BFIN_ICACHE) && defined(CONFIG_BFIN_DCACHE)
77 R1 = CPLB_ENABLE_DCACHE; 77 R1 = CPLB_ENABLE_DCACHE;
78# endif 78# endif
79# if defined(CONFIG_BLKFIN_CACHE) && defined(CONFIG_BLKFIN_DCACHE) 79# if defined(CONFIG_BFIN_ICACHE) && defined(CONFIG_BFIN_DCACHE)
80 R1 = CPLB_ENABLE_DCACHE | CPLB_ENABLE_ICACHE; 80 R1 = CPLB_ENABLE_DCACHE | CPLB_ENABLE_ICACHE;
81# endif 81# endif
82#else 82#else
diff --git a/arch/blackfin/mach-common/cplbmgr.S b/arch/blackfin/mach-common/cplbmgr.S
index e4b47e09cf13..946703ef48ff 100644
--- a/arch/blackfin/mach-common/cplbmgr.S
+++ b/arch/blackfin/mach-common/cplbmgr.S
@@ -75,15 +75,15 @@ ENTRY(_cplb_mgr)
75 * from the configuration table. 75 * from the configuration table.
76 */ 76 */
77 77
78 P4.L = (ICPLB_FAULT_ADDR & 0xFFFF); 78 P4.L = LO(ICPLB_FAULT_ADDR);
79 P4.H = (ICPLB_FAULT_ADDR >> 16); 79 P4.H = HI(ICPLB_FAULT_ADDR);
80 80
81 P1 = 16; 81 P1 = 16;
82 P5.L = _page_size_table; 82 P5.L = _page_size_table;
83 P5.H = _page_size_table; 83 P5.H = _page_size_table;
84 84
85 P0.L = (ICPLB_DATA0 & 0xFFFF); 85 P0.L = LO(ICPLB_DATA0);
86 P0.H = (ICPLB_DATA0 >> 16); 86 P0.H = HI(ICPLB_DATA0);
87 R4 = [P4]; /* Get faulting address*/ 87 R4 = [P4]; /* Get faulting address*/
88 R6 = 64; /* Advance past the fault address, which*/ 88 R6 = 64; /* Advance past the fault address, which*/
89 R6 = R6 + R4; /* we'll use if we find a match*/ 89 R6 = R6 + R4; /* we'll use if we find a match*/
@@ -117,13 +117,13 @@ ENTRY(_cplb_mgr)
117 I0 = R4; /* Fault address we'll search for*/ 117 I0 = R4; /* Fault address we'll search for*/
118 118
119 /* set up pointers */ 119 /* set up pointers */
120 P0.L = (ICPLB_DATA0 & 0xFFFF); 120 P0.L = LO(ICPLB_DATA0);
121 P0.H = (ICPLB_DATA0 >> 16); 121 P0.H = HI(ICPLB_DATA0);
122 122
123 /* The replacement procedure for ICPLBs */ 123 /* The replacement procedure for ICPLBs */
124 124
125 P4.L = (IMEM_CONTROL & 0xFFFF); 125 P4.L = LO(IMEM_CONTROL);
126 P4.H = (IMEM_CONTROL >> 16); 126 P4.H = HI(IMEM_CONTROL);
127 127
128 /* disable cplbs */ 128 /* disable cplbs */
129 R5 = [P4]; /* Control Register*/ 129 R5 = [P4]; /* Control Register*/
@@ -243,8 +243,8 @@ ENTRY(_cplb_mgr)
243 * last entry of the table. 243 * last entry of the table.
244 */ 244 */
245 245
246 P1.L = (ICPLB_DATA15 & 0xFFFF); /* ICPLB_DATA15 */ 246 P1.L = LO(ICPLB_DATA15); /* ICPLB_DATA15 */
247 P1.H = (ICPLB_DATA15 >> 16); 247 P1.H = HI(ICPLB_DATA15);
248 [P1] = R2; 248 [P1] = R2;
249 [P1-0x100] = R4; 249 [P1-0x100] = R4;
250#ifdef CONFIG_CPLB_INFO 250#ifdef CONFIG_CPLB_INFO
@@ -292,10 +292,10 @@ ENTRY(_cplb_mgr)
292 * pending writes associated with the CPLB. 292 * pending writes associated with the CPLB.
293 */ 293 */
294 294
295 P4.L = (DCPLB_STATUS & 0xFFFF); 295 P4.L = LO(DCPLB_STATUS);
296 P4.H = (DCPLB_STATUS >> 16); 296 P4.H = HI(DCPLB_STATUS);
297 P3.L = (DCPLB_DATA0 & 0xFFFF); 297 P3.L = LO(DCPLB_DATA0);
298 P3.H = (DCPLB_DATA0 >> 16); 298 P3.H = HI(DCPLB_DATA0);
299 R5 = [P4]; 299 R5 = [P4];
300 300
301 /* A protection violation can be caused by more than just writes 301 /* A protection violation can be caused by more than just writes
@@ -355,11 +355,11 @@ ENTRY(_cplb_mgr)
355 * config table, that covers the faulting address. 355 * config table, that covers the faulting address.
356 */ 356 */
357 357
358 P1.L = (DCPLB_DATA15 & 0xFFFF); 358 P1.L = LO(DCPLB_DATA15);
359 P1.H = (DCPLB_DATA15 >> 16); 359 P1.H = HI(DCPLB_DATA15);
360 360
361 P4.L = (DCPLB_FAULT_ADDR & 0xFFFF); 361 P4.L = LO(DCPLB_FAULT_ADDR);
362 P4.H = (DCPLB_FAULT_ADDR >> 16); 362 P4.H = HI(DCPLB_FAULT_ADDR);
363 R4 = [P4]; 363 R4 = [P4];
364 I0 = R4; 364 I0 = R4;
365 365
@@ -368,8 +368,8 @@ ENTRY(_cplb_mgr)
368 R6 = R1; /* Save for later*/ 368 R6 = R1; /* Save for later*/
369 369
370 /* Turn off CPLBs while we work.*/ 370 /* Turn off CPLBs while we work.*/
371 P4.L = (DMEM_CONTROL & 0xFFFF); 371 P4.L = LO(DMEM_CONTROL);
372 P4.H = (DMEM_CONTROL >> 16); 372 P4.H = HI(DMEM_CONTROL);
373 R5 = [P4]; 373 R5 = [P4];
374 BITCLR(R5,ENDCPLB_P); 374 BITCLR(R5,ENDCPLB_P);
375 CLI R0; 375 CLI R0;
@@ -384,8 +384,8 @@ ENTRY(_cplb_mgr)
384 * are no good. 384 * are no good.
385 */ 385 */
386 386
387 I1.L = (DCPLB_DATA0 & 0xFFFF); 387 I1.L = LO(DCPLB_DATA0);
388 I1.H = (DCPLB_DATA0 >> 16); 388 I1.H = HI(DCPLB_DATA0);
389 P1 = 2; 389 P1 = 2;
390 P2 = 16; 390 P2 = 16;
391 I2.L = _dcplb_preference; 391 I2.L = _dcplb_preference;
@@ -405,7 +405,7 @@ ENTRY(_cplb_mgr)
405 P3.L = _page_size_table; /* retrieve end address */ 405 P3.L = _page_size_table; /* retrieve end address */
406 P3.H = _page_size_table; /* retrieve end address */ 406 P3.H = _page_size_table; /* retrieve end address */
407 R3 = 0x1002; /* 16th - position, 2 bits -length */ 407 R3 = 0x1002; /* 16th - position, 2 bits -length */
408#ifdef ANOMALY_05000209 408#if ANOMALY_05000209
409 nop; /* Anomaly 05000209 */ 409 nop; /* Anomaly 05000209 */
410#endif 410#endif
411 R7 = EXTRACT(R1,R3.l); 411 R7 = EXTRACT(R1,R3.l);
@@ -475,8 +475,8 @@ ENTRY(_cplb_mgr)
475 * one space closer to the start. 475 * one space closer to the start.
476 */ 476 */
477 477
478 R1.L = (DCPLB_DATA16 & 0xFFFF); /* DCPLB_DATA15 + 4 */ 478 R1.L = LO(DCPLB_DATA16); /* DCPLB_DATA15 + 4 */
479 R1.H = (DCPLB_DATA16 >> 16); 479 R1.H = HI(DCPLB_DATA16);
480 R0 = P0; 480 R0 = P0;
481 481
482 /* If the victim happens to be in DCPLB15, 482 /* If the victim happens to be in DCPLB15,
@@ -549,8 +549,8 @@ ENTRY(_cplb_mgr)
549 * if necessary. 549 * if necessary.
550 */ 550 */
551 551
552 P1.L = (DCPLB_DATA15 & 0xFFFF); 552 P1.L = LO(DCPLB_DATA15);
553 P1.H = (DCPLB_DATA15 >> 16); 553 P1.H = HI(DCPLB_DATA15);
554 554
555 /* If the DCPLB has cache bits set, but caching hasn't 555 /* If the DCPLB has cache bits set, but caching hasn't
556 * been enabled, then we want to mask off the cache-in-L1 556 * been enabled, then we want to mask off the cache-in-L1
@@ -565,7 +565,7 @@ ENTRY(_cplb_mgr)
565 * cost of first-write exceptions to mark the page as dirty. 565 * cost of first-write exceptions to mark the page as dirty.
566 */ 566 */
567 567
568#ifdef CONFIG_BLKFIN_WT 568#ifdef CONFIG_BFIN_WT
569 BITSET(R6, 14); /* Set WT*/ 569 BITSET(R6, 14); /* Set WT*/
570#endif 570#endif
571 571
diff --git a/arch/blackfin/mach-common/dpmc.S b/arch/blackfin/mach-common/dpmc.S
index 97cdcd6a00d4..39fbc2861107 100644
--- a/arch/blackfin/mach-common/dpmc.S
+++ b/arch/blackfin/mach-common/dpmc.S
@@ -39,8 +39,8 @@ ENTRY(_unmask_wdog_wakeup_evt)
39 P0.H = hi(SICA_IWR1); 39 P0.H = hi(SICA_IWR1);
40 P0.L = lo(SICA_IWR1); 40 P0.L = lo(SICA_IWR1);
41#else 41#else
42 P0.h = (SIC_IWR >> 16); 42 P0.h = HI(SIC_IWR);
43 P0.l = (SIC_IWR & 0xFFFF); 43 P0.l = LO(SIC_IWR);
44#endif 44#endif
45 R7 = [P0]; 45 R7 = [P0];
46#if defined(CONFIG_BF561) 46#if defined(CONFIG_BF561)
@@ -60,11 +60,11 @@ ENTRY(_unmask_wdog_wakeup_evt)
60 */ 60 */
61 R7 = 0x0000(z); 61 R7 = 0x0000(z);
62#if defined(CONFIG_BF561) 62#if defined(CONFIG_BF561)
63 P0.h = (WDOGA_STAT >> 16); 63 P0.h = HI(WDOGA_STAT);
64 P0.l = (WDOGA_STAT & 0xFFFF); 64 P0.l = LO(WDOGA_STAT);
65#else 65#else
66 P0.h = (WDOG_STAT >> 16); 66 P0.h = HI(WDOG_STAT);
67 P0.l = (WDOG_STAT & 0xFFFF); 67 P0.l = LO(WDOG_STAT);
68#endif 68#endif
69 [P0] = R7; 69 [P0] = R7;
70 SSYNC; 70 SSYNC;
@@ -73,21 +73,21 @@ ENTRY(_unmask_wdog_wakeup_evt)
73ENTRY(_program_wdog_timer) 73ENTRY(_program_wdog_timer)
74 [--SP] = ( R7:0, P5:0 ); 74 [--SP] = ( R7:0, P5:0 );
75#if defined(CONFIG_BF561) 75#if defined(CONFIG_BF561)
76 P0.h = (WDOGA_CNT >> 16); 76 P0.h = HI(WDOGA_CNT);
77 P0.l = (WDOGA_CNT & 0xFFFF); 77 P0.l = LO(WDOGA_CNT);
78#else 78#else
79 P0.h = (WDOG_CNT >> 16); 79 P0.h = HI(WDOG_CNT);
80 P0.l = (WDOG_CNT & 0xFFFF); 80 P0.l = LO(WDOG_CNT);
81#endif 81#endif
82 [P0] = R0; 82 [P0] = R0;
83 SSYNC; 83 SSYNC;
84 84
85#if defined(CONFIG_BF561) 85#if defined(CONFIG_BF561)
86 P0.h = (WDOGA_CTL >> 16); 86 P0.h = HI(WDOGA_CTL);
87 P0.l = (WDOGA_CTL & 0xFFFF); 87 P0.l = LO(WDOGA_CTL);
88#else 88#else
89 P0.h = (WDOG_CTL >> 16); 89 P0.h = HI(WDOG_CTL);
90 P0.l = (WDOG_CTL & 0xFFFF); 90 P0.l = LO(WDOG_CTL);
91#endif 91#endif
92 R7 = W[P0](Z); 92 R7 = W[P0](Z);
93 CC = BITTST(R7,1); 93 CC = BITTST(R7,1);
@@ -97,11 +97,11 @@ ENTRY(_program_wdog_timer)
97 97
98.LSKIP_WRITE_TO_STAT: 98.LSKIP_WRITE_TO_STAT:
99#if defined(CONFIG_BF561) 99#if defined(CONFIG_BF561)
100 P0.h = (WDOGA_CTL >> 16); 100 P0.h = HI(WDOGA_CTL);
101 P0.l = (WDOGA_CTL & 0xFFFF); 101 P0.l = LO(WDOGA_CTL);
102#else 102#else
103 P0.h = (WDOG_CTL >> 16); 103 P0.h = HI(WDOG_CTL);
104 P0.l = (WDOG_CTL & 0xFFFF); 104 P0.l = LO(WDOG_CTL);
105#endif 105#endif
106 R7 = W[P0](Z); 106 R7 = W[P0](Z);
107 BITCLR(R7,1); /* Enable GP event */ 107 BITCLR(R7,1); /* Enable GP event */
@@ -122,11 +122,11 @@ ENTRY(_clear_wdog_wakeup_evt)
122 [--SP] = ( R7:0, P5:0 ); 122 [--SP] = ( R7:0, P5:0 );
123 123
124#if defined(CONFIG_BF561) 124#if defined(CONFIG_BF561)
125 P0.h = (WDOGA_CTL >> 16); 125 P0.h = HI(WDOGA_CTL);
126 P0.l = (WDOGA_CTL & 0xFFFF); 126 P0.l = LO(WDOGA_CTL);
127#else 127#else
128 P0.h = (WDOG_CTL >> 16); 128 P0.h = HI(WDOG_CTL);
129 P0.l = (WDOG_CTL & 0xFFFF); 129 P0.l = LO(WDOG_CTL);
130#endif 130#endif
131 R7 = 0x0AD6(Z); 131 R7 = 0x0AD6(Z);
132 W[P0] = R7.L; 132 W[P0] = R7.L;
@@ -149,11 +149,11 @@ ENTRY(_clear_wdog_wakeup_evt)
149ENTRY(_disable_wdog_timer) 149ENTRY(_disable_wdog_timer)
150 [--SP] = ( R7:0, P5:0 ); 150 [--SP] = ( R7:0, P5:0 );
151#if defined(CONFIG_BF561) 151#if defined(CONFIG_BF561)
152 P0.h = (WDOGA_CTL >> 16); 152 P0.h = HI(WDOGA_CTL);
153 P0.l = (WDOGA_CTL & 0xFFFF); 153 P0.l = LO(WDOGA_CTL);
154#else 154#else
155 P0.h = (WDOG_CTL >> 16); 155 P0.h = HI(WDOG_CTL);
156 P0.l = (WDOG_CTL & 0xFFFF); 156 P0.l = LO(WDOG_CTL);
157#endif 157#endif
158 R7 = 0xAD6(Z); 158 R7 = 0xAD6(Z);
159 W[P0] = R7.L; 159 W[P0] = R7.L;
@@ -300,7 +300,7 @@ ENTRY(_sleep_deeper)
300 P0.H = hi(PLL_CTL); 300 P0.H = hi(PLL_CTL);
301 P0.L = lo(PLL_CTL); 301 P0.L = lo(PLL_CTL);
302 R5 = W[P0](z); 302 R5 = W[P0](z);
303 R0.L = (MIN_VC/CONFIG_CLKIN_HZ) << 9; 303 R0.L = (CONFIG_MIN_VCO_HZ/CONFIG_CLKIN_HZ) << 9;
304 W[P0] = R0.l; 304 W[P0] = R0.l;
305 305
306 SSYNC; 306 SSYNC;
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index 960458808344..e3ad5802868a 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -29,21 +29,7 @@
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 */ 30 */
31 31
32/* 32/* NOTE: This code handles signal-recognition, which happens every time
33 * 25-Dec-2004 - LG Soft India
34 * 1. Fix in return_from_int, to make sure any pending
35 * system call in ILAT for this process to get
36 * executed, otherwise in case context switch happens,
37 * system call of first process (i.e in ILAT) will be
38 * carried forward to the switched process.
39 * 2. Removed Constant references for the following
40 * a. IPEND
41 * b. EXCAUSE mask
42 * c. PAGE Mask
43 */
44
45/*
46 * NOTE: This code handles signal-recognition, which happens every time
47 * after a timer-interrupt and after each system call. 33 * after a timer-interrupt and after each system call.
48 */ 34 */
49 35
@@ -58,6 +44,23 @@
58 44
59#include <asm/mach-common/context.S> 45#include <asm/mach-common/context.S>
60 46
47#if defined(CONFIG_BFIN_SCRATCH_REG_RETN)
48# define EX_SCRATCH_REG RETN
49#elif defined(CONFIG_BFIN_SCRATCH_REG_RETE)
50# define EX_SCRATCH_REG RETE
51#else
52# define EX_SCRATCH_REG CYCLES
53#endif
54
55#if ANOMALY_05000281
56ENTRY(_safe_speculative_execution)
57 NOP;
58 NOP;
59 NOP;
60 jump _safe_speculative_execution;
61ENDPROC(_safe_speculative_execution)
62#endif
63
61#ifdef CONFIG_EXCPT_IRQ_SYSC_L1 64#ifdef CONFIG_EXCPT_IRQ_SYSC_L1
62.section .l1.text 65.section .l1.text
63#else 66#else
@@ -69,7 +72,7 @@
69 * patch up CPLB misses on the kernel stack. 72 * patch up CPLB misses on the kernel stack.
70 */ 73 */
71ENTRY(_ex_dcplb) 74ENTRY(_ex_dcplb)
72#if defined(ANOMALY_05000261) 75#if ANOMALY_05000261
73 /* 76 /*
74 * Work around an anomaly: if we see a new DCPLB fault, return 77 * Work around an anomaly: if we see a new DCPLB fault, return
75 * without doing anything. Then, if we get the same fault again, 78 * without doing anything. Then, if we get the same fault again,
@@ -93,7 +96,7 @@ ENTRY(_ex_icplb)
93 call __cplb_hdr; 96 call __cplb_hdr;
94 DEBUG_START_HWTRACE(p5, r7) 97 DEBUG_START_HWTRACE(p5, r7)
95 RESTORE_ALL_SYS 98 RESTORE_ALL_SYS
96 SP = RETN; 99 SP = EX_SCRATCH_REG;
97 rtx; 100 rtx;
98ENDPROC(_ex_icplb) 101ENDPROC(_ex_icplb)
99 102
@@ -102,7 +105,7 @@ ENTRY(_ex_syscall)
102 (R7:6,P5:4) = [sp++]; 105 (R7:6,P5:4) = [sp++];
103 ASTAT = [sp++]; 106 ASTAT = [sp++];
104 raise 15; /* invoked by TRAP #0, for sys call */ 107 raise 15; /* invoked by TRAP #0, for sys call */
105 sp = retn; 108 sp = EX_SCRATCH_REG;
106 rtx 109 rtx
107ENDPROC(_ex_syscall) 110ENDPROC(_ex_syscall)
108 111
@@ -135,9 +138,9 @@ ENTRY(_ex_single_step)
135 cc = r6 == r7; 138 cc = r6 == r7;
136 if !cc jump _ex_trap_c; 139 if !cc jump _ex_trap_c;
137 140
138_return_from_exception: 141ENTRY(_return_from_exception)
139 DEBUG_START_HWTRACE(p5, r7) 142 DEBUG_START_HWTRACE(p5, r7)
140#ifdef ANOMALY_05000257 143#if ANOMALY_05000257
141 R7=LC0; 144 R7=LC0;
142 LC0=R7; 145 LC0=R7;
143 R7=LC1; 146 R7=LC1;
@@ -145,7 +148,7 @@ _return_from_exception:
145#endif 148#endif
146 (R7:6,P5:4) = [sp++]; 149 (R7:6,P5:4) = [sp++];
147 ASTAT = [sp++]; 150 ASTAT = [sp++];
148 sp = retn; 151 sp = EX_SCRATCH_REG;
149 rtx; 152 rtx;
150ENDPROC(_ex_soft_bp) 153ENDPROC(_ex_soft_bp)
151 154
@@ -163,7 +166,17 @@ ENTRY(_handle_bad_cplb)
163 [--sp] = ASTAT; 166 [--sp] = ASTAT;
164 [--sp] = (R7:6, P5:4); 167 [--sp] = (R7:6, P5:4);
165 168
169ENTRY(_ex_replaceable)
170 nop;
171
166ENTRY(_ex_trap_c) 172ENTRY(_ex_trap_c)
173 /* Make sure we are not in a double fault */
174 p4.l = lo(IPEND);
175 p4.h = hi(IPEND);
176 r7 = [p4];
177 CC = BITTST (r7, 5);
178 if CC jump _double_fault;
179
167 /* Call C code (trap_c) to handle the exception, which most 180 /* Call C code (trap_c) to handle the exception, which most
168 * likely involves sending a signal to the current process. 181 * likely involves sending a signal to the current process.
169 * To avoid double faults, lower our priority to IRQ5 first. 182 * To avoid double faults, lower our priority to IRQ5 first.
@@ -204,11 +217,57 @@ ENTRY(_ex_trap_c)
204 DEBUG_START_HWTRACE(p5, r7) 217 DEBUG_START_HWTRACE(p5, r7)
205 (R7:6,P5:4) = [sp++]; 218 (R7:6,P5:4) = [sp++];
206 ASTAT = [sp++]; 219 ASTAT = [sp++];
207 SP = RETN; 220 SP = EX_SCRATCH_REG;
208 raise 5; 221 raise 5;
209 rtx; 222 rtx;
210ENDPROC(_ex_trap_c) 223ENDPROC(_ex_trap_c)
211 224
225/* We just realized we got an exception, while we were processing a different
226 * exception. This is a unrecoverable event, so crash
227 */
228ENTRY(_double_fault)
229 /* Turn caches & protection off, to ensure we don't get any more
230 * double exceptions
231 */
232
233 P4.L = LO(IMEM_CONTROL);
234 P4.H = HI(IMEM_CONTROL);
235
236 R5 = [P4]; /* Control Register*/
237 BITCLR(R5,ENICPLB_P);
238 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
239 .align 8;
240 [P4] = R5;
241 SSYNC;
242
243 P4.L = LO(DMEM_CONTROL);
244 P4.H = HI(DMEM_CONTROL);
245 R5 = [P4];
246 BITCLR(R5,ENDCPLB_P);
247 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
248 .align 8;
249 [P4] = R5;
250 SSYNC;
251
252 /* Fix up the stack */
253 (R7:6,P5:4) = [sp++];
254 ASTAT = [sp++];
255 SP = EX_SCRATCH_REG;
256
257 /* We should be out of the exception stack, and back down into
258 * kernel or user space stack
259 */
260 SAVE_ALL_SYS
261
262 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
263 SP += -12;
264 call _double_fault_c;
265 SP += 12;
266.L_double_fault_panic:
267 JUMP .L_double_fault_panic
268
269ENDPROC(_double_fault)
270
212ENTRY(_exception_to_level5) 271ENTRY(_exception_to_level5)
213 SAVE_ALL_SYS 272 SAVE_ALL_SYS
214 273
@@ -279,7 +338,7 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
279 * covered by a CPLB. Switch to an exception stack; use RETN as a 338 * covered by a CPLB. Switch to an exception stack; use RETN as a
280 * scratch register (for want of a better option). 339 * scratch register (for want of a better option).
281 */ 340 */
282 retn = sp; 341 EX_SCRATCH_REG = sp;
283 sp.l = _exception_stack_top; 342 sp.l = _exception_stack_top;
284 sp.h = _exception_stack_top; 343 sp.h = _exception_stack_top;
285 /* Try to deal with syscalls quickly. */ 344 /* Try to deal with syscalls quickly. */
@@ -290,8 +349,8 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
290 r6.l = lo(SEQSTAT_EXCAUSE); 349 r6.l = lo(SEQSTAT_EXCAUSE);
291 r6.h = hi(SEQSTAT_EXCAUSE); 350 r6.h = hi(SEQSTAT_EXCAUSE);
292 r7 = r7 & r6; 351 r7 = r7 & r6;
293 p5.h = _extable; 352 p5.h = _ex_table;
294 p5.l = _extable; 353 p5.l = _ex_table;
295 p4 = r7; 354 p4 = r7;
296 p5 = p5 + (p4 << 2); 355 p5 = p5 + (p4 << 2);
297 p4 = [p5]; 356 p4 = [p5];
@@ -634,9 +693,9 @@ ENTRY(_return_from_int)
634 p1.h = _schedule_and_signal_from_int; 693 p1.h = _schedule_and_signal_from_int;
635 [p0] = p1; 694 [p0] = p1;
636 csync; 695 csync;
637#if defined(ANOMALY_05000281) 696#if ANOMALY_05000281
638 r0.l = lo(CONFIG_BOOT_LOAD); 697 r0.l = _safe_speculative_execution;
639 r0.h = hi(CONFIG_BOOT_LOAD); 698 r0.h = _safe_speculative_execution;
640 reti = r0; 699 reti = r0;
641#endif 700#endif
642 r0 = 0x801f (z); 701 r0 = 0x801f (z);
@@ -648,9 +707,9 @@ ENTRY(_return_from_int)
648ENDPROC(_return_from_int) 707ENDPROC(_return_from_int)
649 708
650ENTRY(_lower_to_irq14) 709ENTRY(_lower_to_irq14)
651#if defined(ANOMALY_05000281) 710#if ANOMALY_05000281
652 r0.l = lo(CONFIG_BOOT_LOAD); 711 r0.l = _safe_speculative_execution;
653 r0.h = hi(CONFIG_BOOT_LOAD); 712 r0.h = _safe_speculative_execution;
654 reti = r0; 713 reti = r0;
655#endif 714#endif
656 r0 = 0x401f; 715 r0 = 0x401f;
@@ -731,6 +790,114 @@ ENTRY(_init_exception_buff)
731 rts; 790 rts;
732ENDPROC(_init_exception_buff) 791ENDPROC(_init_exception_buff)
733 792
793/* We handle this 100% in exception space - to reduce overhead
794 * Only potiential problem is if the software buffer gets swapped out of the
795 * CPLB table - then double fault. - so we don't let this happen in other places
796 */
797#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
798ENTRY(_ex_trace_buff_full)
799 [--sp] = P3;
800 [--sp] = P2;
801 [--sp] = LC0;
802 [--sp] = LT0;
803 [--sp] = LB0;
804 P5.L = _trace_buff_offset;
805 P5.H = _trace_buff_offset;
806 P3 = [P5]; /* trace_buff_offset */
807 P5.L = lo(TBUFSTAT);
808 P5.H = hi(TBUFSTAT);
809 R7 = [P5];
810 R7 <<= 1; /* double, since we need to read twice */
811 LC0 = R7;
812 R7 <<= 2; /* need to shift over again,
813 * to get the number of bytes */
814 P5.L = lo(TBUF);
815 P5.H = hi(TBUF);
816 R6 = ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*1024) - 1;
817
818 P2 = R7;
819 P3 = P3 + P2;
820 R7 = P3;
821 R7 = R7 & R6;
822 P3 = R7;
823 P2.L = _trace_buff_offset;
824 P2.H = _trace_buff_offset;
825 [P2] = P3;
826
827 P2.L = _software_trace_buff;
828 P2.H = _software_trace_buff;
829
830 LSETUP (.Lstart, .Lend) LC0;
831.Lstart:
832 R7 = [P5]; /* read TBUF */
833 P4 = P3 + P2;
834 [P4] = R7;
835 P3 += -4;
836 R7 = P3;
837 R7 = R7 & R6;
838.Lend:
839 P3 = R7;
840
841 LB0 = [sp++];
842 LT0 = [sp++];
843 LC0 = [sp++];
844 P2 = [sp++];
845 P3 = [sp++];
846 jump _return_from_exception;
847ENDPROC(_ex_trace_buff_full)
848
849#if CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN == 4
850.data
851#else
852.section .l1.data.B
853#endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN */
854ENTRY(_trace_buff_offset)
855 .long 0;
856ALIGN
857ENTRY(_software_trace_buff)
858 .rept ((1 << CONFIG_DEBUG_BFIN_HWTRACE_EXPAND_LEN)*256);
859 .long 0
860 .endr
861#endif /* CONFIG_DEBUG_BFIN_HWTRACE_EXPAND */
862
863#if CONFIG_EARLY_PRINTK
864.section .init.text
865ENTRY(_early_trap)
866 SAVE_ALL_SYS
867 trace_buffer_stop(p0,r0);
868
869 /* Turn caches off, to ensure we don't get double exceptions */
870
871 P4.L = LO(IMEM_CONTROL);
872 P4.H = HI(IMEM_CONTROL);
873
874 R5 = [P4]; /* Control Register*/
875 BITCLR(R5,ENICPLB_P);
876 CLI R1;
877 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
878 .align 8;
879 [P4] = R5;
880 SSYNC;
881
882 P4.L = LO(DMEM_CONTROL);
883 P4.H = HI(DMEM_CONTROL);
884 R5 = [P4];
885 BITCLR(R5,ENDCPLB_P);
886 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
887 .align 8;
888 [P4] = R5;
889 SSYNC;
890 STI R1;
891
892 r0 = sp; /* stack frame pt_regs pointer argument ==> r0 */
893 r1 = RETX;
894
895 SP += -12;
896 call _early_trap_c;
897 SP += 12;
898ENDPROC(_early_trap)
899#endif /* CONFIG_EARLY_PRINTK */
900
734/* 901/*
735 * Put these in the kernel data section - that should always be covered by 902 * Put these in the kernel data section - that should always be covered by
736 * a CPLB. This is needed to ensure we don't get double fault conditions 903 * a CPLB. This is needed to ensure we don't get double fault conditions
@@ -741,30 +908,33 @@ ENDPROC(_init_exception_buff)
741#else 908#else
742.data 909.data
743#endif 910#endif
744ALIGN 911ENTRY(_ex_table)
745_extable:
746 /* entry for each EXCAUSE[5:0] 912 /* entry for each EXCAUSE[5:0]
747 * This table must be in sync with the table in ./kernel/traps.c 913 * This table must be in sync with the table in ./kernel/traps.c
748 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined 914 * EXCPT instruction can provide 4 bits of EXCAUSE, allowing 16 to be user defined
749 */ 915 */
750 .long _ex_syscall; /* 0x00 - User Defined - Linux Syscall */ 916 .long _ex_syscall /* 0x00 - User Defined - Linux Syscall */
751 .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */ 917 .long _ex_soft_bp /* 0x01 - User Defined - Software breakpoint */
752 .long _ex_trap_c /* 0x02 - User Defined */ 918 .long _ex_replaceable /* 0x02 - User Defined */
753 .long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */ 919 .long _ex_trap_c /* 0x03 - User Defined - userspace stack overflow */
754 .long _ex_trap_c /* 0x04 - User Defined */ 920 .long _ex_replaceable /* 0x04 - User Defined */
755 .long _ex_trap_c /* 0x05 - User Defined */ 921 .long _ex_replaceable /* 0x05 - User Defined */
756 .long _ex_trap_c /* 0x06 - User Defined */ 922 .long _ex_replaceable /* 0x06 - User Defined */
757 .long _ex_trap_c /* 0x07 - User Defined */ 923 .long _ex_replaceable /* 0x07 - User Defined */
758 .long _ex_trap_c /* 0x08 - User Defined */ 924 .long _ex_replaceable /* 0x08 - User Defined */
759 .long _ex_trap_c /* 0x09 - User Defined */ 925 .long _ex_replaceable /* 0x09 - User Defined */
760 .long _ex_trap_c /* 0x0A - User Defined */ 926 .long _ex_replaceable /* 0x0A - User Defined */
761 .long _ex_trap_c /* 0x0B - User Defined */ 927 .long _ex_replaceable /* 0x0B - User Defined */
762 .long _ex_trap_c /* 0x0C - User Defined */ 928 .long _ex_replaceable /* 0x0C - User Defined */
763 .long _ex_trap_c /* 0x0D - User Defined */ 929 .long _ex_replaceable /* 0x0D - User Defined */
764 .long _ex_trap_c /* 0x0E - User Defined */ 930 .long _ex_replaceable /* 0x0E - User Defined */
765 .long _ex_trap_c /* 0x0F - User Defined */ 931 .long _ex_replaceable /* 0x0F - User Defined */
766 .long _ex_single_step /* 0x10 - HW Single step */ 932 .long _ex_single_step /* 0x10 - HW Single step */
933#ifdef CONFIG_DEBUG_BFIN_HWTRACE_EXPAND
934 .long _ex_trace_buff_full /* 0x11 - Trace Buffer Full */
935#else
767 .long _ex_trap_c /* 0x11 - Trace Buffer Full */ 936 .long _ex_trap_c /* 0x11 - Trace Buffer Full */
937#endif
768 .long _ex_trap_c /* 0x12 - Reserved */ 938 .long _ex_trap_c /* 0x12 - Reserved */
769 .long _ex_trap_c /* 0x13 - Reserved */ 939 .long _ex_trap_c /* 0x13 - Reserved */
770 .long _ex_trap_c /* 0x14 - Reserved */ 940 .long _ex_trap_c /* 0x14 - Reserved */
@@ -812,8 +982,8 @@ _extable:
812 .long _ex_trap_c /* 0x3D - Reserved */ 982 .long _ex_trap_c /* 0x3D - Reserved */
813 .long _ex_trap_c /* 0x3E - Reserved */ 983 .long _ex_trap_c /* 0x3E - Reserved */
814 .long _ex_trap_c /* 0x3F - Reserved */ 984 .long _ex_trap_c /* 0x3F - Reserved */
985END(_ex_table)
815 986
816ALIGN
817ENTRY(_sys_call_table) 987ENTRY(_sys_call_table)
818 .long _sys_restart_syscall /* 0 */ 988 .long _sys_restart_syscall /* 0 */
819 .long _sys_exit 989 .long _sys_exit
@@ -1184,7 +1354,7 @@ _exception_stack:
1184 .endr 1354 .endr
1185_exception_stack_top: 1355_exception_stack_top:
1186 1356
1187#if defined(ANOMALY_05000261) 1357#if ANOMALY_05000261
1188/* Used by the assembly entry point to work around an anomaly. */ 1358/* Used by the assembly entry point to work around an anomaly. */
1189_last_cplb_fault_retx: 1359_last_cplb_fault_retx:
1190 .long 0; 1360 .long 0;
diff --git a/arch/blackfin/mach-common/interrupt.S b/arch/blackfin/mach-common/interrupt.S
index 203e20709163..c6b32fe0f6e9 100644
--- a/arch/blackfin/mach-common/interrupt.S
+++ b/arch/blackfin/mach-common/interrupt.S
@@ -46,30 +46,6 @@
46 46
47.align 4 /* just in case */ 47.align 4 /* just in case */
48 48
49/*
50 * initial interrupt handlers
51 */
52
53#ifndef CONFIG_KGDB
54 /* interrupt routine for emulation - 0 */
55 /* Currently used only if GDB stub is not in - invalid */
56 /* gdb-stub set the evt itself */
57 /* save registers for post-mortem only */
58ENTRY(_evt_emulation)
59 SAVE_ALL_SYS
60#ifdef CONFIG_FRAME_POINTER
61 fp = 0;
62#endif
63 r0 = IRQ_EMU;
64 r1 = sp;
65 SP += -12;
66 call _irq_panic;
67 SP += 12;
68 /* - GDB stub fills this in by itself (if defined) */
69 rte;
70ENDPROC(_evt_emulation)
71#endif
72
73/* Common interrupt entry code. First we do CLI, then push 49/* Common interrupt entry code. First we do CLI, then push
74 * RETI, to keep interrupts disabled, but to allow this state to be changed 50 * RETI, to keep interrupts disabled, but to allow this state to be changed
75 * by local_bh_enable. 51 * by local_bh_enable.
@@ -140,7 +116,7 @@ __common_int_entry:
140 fp = 0; 116 fp = 0;
141#endif 117#endif
142 118
143#if defined (ANOMALY_05000283) || defined (ANOMALY_05000315) 119#if ANOMALY_05000283 || ANOMALY_05000315
144 cc = r7 == r7; 120 cc = r7 == r7;
145 p5.h = 0xffc0; 121 p5.h = 0xffc0;
146 p5.l = 0x0014; 122 p5.l = 0x0014;
@@ -163,7 +139,7 @@ ENTRY(_evt_ivhw)
163#ifdef CONFIG_FRAME_POINTER 139#ifdef CONFIG_FRAME_POINTER
164 fp = 0; 140 fp = 0;
165#endif 141#endif
166#ifdef ANOMALY_05000283 142#if ANOMALY_05000283
167 cc = r7 == r7; 143 cc = r7 == r7;
168 p5.h = 0xffc0; 144 p5.h = 0xffc0;
169 p5.l = 0x0014; 145 p5.l = 0x0014;
@@ -201,27 +177,15 @@ ENTRY(_evt_ivhw)
201 jump .Lcommon_restore_context; 177 jump .Lcommon_restore_context;
202#endif 178#endif
203 179
204/* interrupt routine for evt2 - 2. This is NMI. */ 180/* Interrupt routine for evt2 (NMI).
205ENTRY(_evt_evt2) 181 * We don't actually use this, so just return.
206 SAVE_CONTEXT 182 * For inner circle type details, please see:
207#ifdef CONFIG_FRAME_POINTER 183 * http://docs.blackfin.uclinux.org/doku.php?id=linux:nmi
208 fp = 0; 184 */
209#endif 185ENTRY(_evt_nmi)
210#ifdef ANOMALY_05000283 186.weak _evt_nmi
211 cc = r7 == r7;
212 p5.h = 0xffc0;
213 p5.l = 0x0014;
214 if cc jump 1f;
215 r7.l = W[p5];
2161:
217#endif
218 r0 = IRQ_NMI;
219 r1 = sp;
220 SP += -12;
221 call _asm_do_IRQ;
222 SP += 12;
223 RESTORE_CONTEXT
224 rtn; 187 rtn;
188ENDPROC(_evt_nmi)
225 189
226/* interrupt routine for core timer - 6 */ 190/* interrupt routine for core timer - 6 */
227ENTRY(_evt_timer) 191ENTRY(_evt_timer)
diff --git a/arch/blackfin/mach-common/ints-priority-dc.c b/arch/blackfin/mach-common/ints-priority-dc.c
index 660f881b620a..2db3546fc874 100644
--- a/arch/blackfin/mach-common/ints-priority-dc.c
+++ b/arch/blackfin/mach-common/ints-priority-dc.c
@@ -221,7 +221,7 @@ static unsigned int bf561_gpio_irq_startup(unsigned int irq)
221 221
222 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) { 222 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
223 223
224 ret = gpio_request(gpionr, NULL); 224 ret = gpio_request(gpionr, "IRQ");
225 if (ret) 225 if (ret)
226 return ret; 226 return ret;
227 227
@@ -261,7 +261,7 @@ static int bf561_gpio_irq_type(unsigned int irq, unsigned int type)
261 261
262 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) { 262 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
263 263
264 ret = gpio_request(gpionr, NULL); 264 ret = gpio_request(gpionr, "IRQ");
265 if (ret) 265 if (ret)
266 return ret; 266 return ret;
267 267
@@ -362,10 +362,11 @@ void __init init_exception_vectors(void)
362{ 362{
363 SSYNC(); 363 SSYNC();
364 364
365#ifndef CONFIG_KGDB 365 /* cannot program in software:
366 bfin_write_EVT0(evt_emulation); 366 * evt0 - emulation (jtag)
367#endif 367 * evt1 - reset
368 bfin_write_EVT2(evt_evt2); 368 */
369 bfin_write_EVT2(evt_nmi);
369 bfin_write_EVT3(trap); 370 bfin_write_EVT3(trap);
370 bfin_write_EVT5(evt_ivhw); 371 bfin_write_EVT5(evt_ivhw);
371 bfin_write_EVT6(evt_timer); 372 bfin_write_EVT6(evt_timer);
diff --git a/arch/blackfin/mach-common/ints-priority-sc.c b/arch/blackfin/mach-common/ints-priority-sc.c
index 4708023fe716..d3b7672b2b94 100644
--- a/arch/blackfin/mach-common/ints-priority-sc.c
+++ b/arch/blackfin/mach-common/ints-priority-sc.c
@@ -343,7 +343,7 @@ static unsigned int bfin_gpio_irq_startup(unsigned int irq)
343 u16 gpionr = irq - IRQ_PF0; 343 u16 gpionr = irq - IRQ_PF0;
344 344
345 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) { 345 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
346 ret = gpio_request(gpionr, NULL); 346 ret = gpio_request(gpionr, "IRQ");
347 if (ret) 347 if (ret)
348 return ret; 348 return ret;
349 } 349 }
@@ -377,7 +377,7 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
377 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING | 377 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
378 IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { 378 IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
379 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) { 379 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
380 ret = gpio_request(gpionr, NULL); 380 ret = gpio_request(gpionr, "IRQ");
381 if (ret) 381 if (ret)
382 return ret; 382 return ret;
383 } 383 }
@@ -587,7 +587,7 @@ static unsigned int bfin_gpio_irq_startup(unsigned int irq)
587 } 587 }
588 588
589 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) { 589 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
590 ret = gpio_request(gpionr, NULL); 590 ret = gpio_request(gpionr, "IRQ");
591 if (ret) 591 if (ret)
592 return ret; 592 return ret;
593 } 593 }
@@ -627,7 +627,7 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
627 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING | 627 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
628 IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { 628 IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
629 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) { 629 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
630 ret = gpio_request(gpionr, NULL); 630 ret = gpio_request(gpionr, "IRQ");
631 if (ret) 631 if (ret)
632 return ret; 632 return ret;
633 } 633 }
@@ -721,10 +721,11 @@ void __init init_exception_vectors(void)
721{ 721{
722 SSYNC(); 722 SSYNC();
723 723
724#ifndef CONFIG_KGDB 724 /* cannot program in software:
725 bfin_write_EVT0(evt_emulation); 725 * evt0 - emulation (jtag)
726#endif 726 * evt1 - reset
727 bfin_write_EVT2(evt_evt2); 727 */
728 bfin_write_EVT2(evt_nmi);
728 bfin_write_EVT3(trap); 729 bfin_write_EVT3(trap);
729 bfin_write_EVT5(evt_ivhw); 730 bfin_write_EVT5(evt_ivhw);
730 bfin_write_EVT6(evt_timer); 731 bfin_write_EVT6(evt_timer);
diff --git a/arch/blackfin/mach-common/lock.S b/arch/blackfin/mach-common/lock.S
index 386ac8dda076..28b87fe9ce3c 100644
--- a/arch/blackfin/mach-common/lock.S
+++ b/arch/blackfin/mach-common/lock.S
@@ -33,7 +33,7 @@
33 33
34.text 34.text
35 35
36#ifdef CONFIG_BLKFIN_CACHE_LOCK 36#ifdef CONFIG_BFIN_ICACHE_LOCK
37 37
38/* When you come here, it is assumed that 38/* When you come here, it is assumed that
39 * R0 - Which way to be locked 39 * R0 - Which way to be locked
@@ -43,12 +43,12 @@ ENTRY(_cache_grab_lock)
43 43
44 [--SP]=( R7:0,P5:0 ); 44 [--SP]=( R7:0,P5:0 );
45 45
46 P1.H = (IMEM_CONTROL >> 16); 46 P1.H = HI(IMEM_CONTROL);
47 P1.L = (IMEM_CONTROL & 0xFFFF); 47 P1.L = LO(IMEM_CONTROL);
48 P5.H = (ICPLB_ADDR0 >> 16); 48 P5.H = HI(ICPLB_ADDR0);
49 P5.L = (ICPLB_ADDR0 & 0xFFFF); 49 P5.L = LO(ICPLB_ADDR0);
50 P4.H = (ICPLB_DATA0 >> 16); 50 P4.H = HI(ICPLB_DATA0);
51 P4.L = (ICPLB_DATA0 & 0xFFFF); 51 P4.L = LO(ICPLB_DATA0);
52 R7 = R0; 52 R7 = R0;
53 53
54 /* If the code of interest already resides in the cache 54 /* If the code of interest already resides in the cache
@@ -167,8 +167,8 @@ ENTRY(_cache_lock)
167 167
168 [--SP]=( R7:0,P5:0 ); 168 [--SP]=( R7:0,P5:0 );
169 169
170 P1.H = (IMEM_CONTROL >> 16); 170 P1.H = HI(IMEM_CONTROL);
171 P1.L = (IMEM_CONTROL & 0xFFFF); 171 P1.L = LO(IMEM_CONTROL);
172 172
173 /* Disable the Interrupts*/ 173 /* Disable the Interrupts*/
174 CLI R3; 174 CLI R3;
@@ -189,14 +189,14 @@ ENTRY(_cache_lock)
189 RTS; 189 RTS;
190ENDPROC(_cache_lock) 190ENDPROC(_cache_lock)
191 191
192#endif /* BLKFIN_CACHE_LOCK */ 192#endif /* BFIN_ICACHE_LOCK */
193 193
194/* Return the ILOC bits of IMEM_CONTROL 194/* Return the ILOC bits of IMEM_CONTROL
195 */ 195 */
196 196
197ENTRY(_read_iloc) 197ENTRY(_read_iloc)
198 P1.H = (IMEM_CONTROL >> 16); 198 P1.H = HI(IMEM_CONTROL);
199 P1.L = (IMEM_CONTROL & 0xFFFF); 199 P1.L = LO(IMEM_CONTROL);
200 R1 = 0xF; 200 R1 = 0xF;
201 R0 = [P1]; 201 R0 = [P1];
202 R0 = R0 >> 3; 202 R0 = R0 >> 3;
diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
index 68459cc052a1..e97ea8fc8dc4 100644
--- a/arch/blackfin/mm/init.c
+++ b/arch/blackfin/mm/init.c
@@ -53,7 +53,7 @@ static unsigned long empty_bad_page;
53 53
54unsigned long empty_zero_page; 54unsigned long empty_zero_page;
55 55
56void __init show_mem(void) 56void show_mem(void)
57{ 57{
58 unsigned long i; 58 unsigned long i;
59 int free = 0, total = 0, reserved = 0, shared = 0; 59 int free = 0, total = 0, reserved = 0, shared = 0;
diff --git a/arch/blackfin/oprofile/op_blackfin.h b/arch/blackfin/oprofile/op_blackfin.h
index f88f446c814f..05dd08c9d154 100644
--- a/arch/blackfin/oprofile/op_blackfin.h
+++ b/arch/blackfin/oprofile/op_blackfin.h
@@ -68,7 +68,7 @@ static inline unsigned int ctr_read(void)
68 unsigned int tmp; 68 unsigned int tmp;
69 69
70 tmp = bfin_read_PFCTL(); 70 tmp = bfin_read_PFCTL();
71 __builtin_bfin_csync(); 71 CSYNC();
72 72
73 return tmp; 73 return tmp;
74} 74}
@@ -76,21 +76,21 @@ static inline unsigned int ctr_read(void)
76static inline void ctr_write(unsigned int val) 76static inline void ctr_write(unsigned int val)
77{ 77{
78 bfin_write_PFCTL(val); 78 bfin_write_PFCTL(val);
79 __builtin_bfin_csync(); 79 CSYNC();
80} 80}
81 81
82static inline void count_read(unsigned int *count) 82static inline void count_read(unsigned int *count)
83{ 83{
84 count[0] = bfin_read_PFCNTR0(); 84 count[0] = bfin_read_PFCNTR0();
85 count[1] = bfin_read_PFCNTR1(); 85 count[1] = bfin_read_PFCNTR1();
86 __builtin_bfin_csync(); 86 CSYNC();
87} 87}
88 88
89static inline void count_write(unsigned int *count) 89static inline void count_write(unsigned int *count)
90{ 90{
91 bfin_write_PFCNTR0(count[0]); 91 bfin_write_PFCNTR0(count[0]);
92 bfin_write_PFCNTR1(count[1]); 92 bfin_write_PFCNTR1(count[1]);
93 __builtin_bfin_csync(); 93 CSYNC();
94} 94}
95 95
96extern int pm_overflow_handler(int irq, struct pt_regs *regs); 96extern int pm_overflow_handler(int irq, struct pt_regs *regs);
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 97b64d7d6bf6..6bbbc2755e44 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -226,7 +226,7 @@ config PARAVIRT
226 However, when run without a hypervisor the kernel is 226 However, when run without a hypervisor the kernel is
227 theoretically slower. If in doubt, say N. 227 theoretically slower. If in doubt, say N.
228 228
229source "arch/i386/xen/Kconfig" 229source "arch/x86/xen/Kconfig"
230 230
231config VMI 231config VMI
232 bool "VMI Paravirt-ops support" 232 bool "VMI Paravirt-ops support"
@@ -707,7 +707,7 @@ config MATH_EMULATION
707 intend to use this kernel on different machines. 707 intend to use this kernel on different machines.
708 708
709 More information about the internals of the Linux math coprocessor 709 More information about the internals of the Linux math coprocessor
710 emulation can be found in <file:arch/i386/math-emu/README>. 710 emulation can be found in <file:arch/x86/math-emu/README>.
711 711
712 If you are not sure, say Y; apart from resulting in a 66 KB bigger 712 If you are not sure, say Y; apart from resulting in a 66 KB bigger
713 kernel, it won't hurt. 713 kernel, it won't hurt.
@@ -1067,7 +1067,7 @@ config APM_REAL_MODE_POWER_OFF
1067 1067
1068endif # APM 1068endif # APM
1069 1069
1070source "arch/i386/kernel/cpu/cpufreq/Kconfig" 1070source "arch/x86/kernel/cpu/cpufreq/Kconfig"
1071 1071
1072endmenu 1072endmenu
1073 1073
@@ -1206,6 +1206,16 @@ config SCx200HR_TIMER
1206 processor goes idle (as is done by the scheduler). The 1206 processor goes idle (as is done by the scheduler). The
1207 other workaround is idle=poll boot option. 1207 other workaround is idle=poll boot option.
1208 1208
1209config GEODE_MFGPT_TIMER
1210 bool "Geode Multi-Function General Purpose Timer (MFGPT) events"
1211 depends on MGEODE_LX && GENERIC_TIME && GENERIC_CLOCKEVENTS
1212 default y
1213 help
1214 This driver provides a clock event source based on the MFGPT
1215 timer(s) in the CS5535 and CS5536 companion chip for the geode.
1216 MFGPTs have a better resolution and max interval than the
1217 generic PIT, and are suitable for use as high-res timers.
1218
1209config K8_NB 1219config K8_NB
1210 def_bool y 1220 def_bool y
1211 depends on AGP_AMD64 1221 depends on AGP_AMD64
@@ -1240,7 +1250,7 @@ menuconfig INSTRUMENTATION
1240 1250
1241if INSTRUMENTATION 1251if INSTRUMENTATION
1242 1252
1243source "arch/i386/oprofile/Kconfig" 1253source "arch/x86/oprofile/Kconfig"
1244 1254
1245config KPROBES 1255config KPROBES
1246 bool "Kprobes" 1256 bool "Kprobes"
diff --git a/arch/i386/Makefile b/arch/i386/Makefile
index 52b932478c6d..5e50dbf00f3e 100644
--- a/arch/i386/Makefile
+++ b/arch/i386/Makefile
@@ -17,6 +17,9 @@
17# 20050320 Kianusch Sayah Karadji <kianusch@sk-tech.net> 17# 20050320 Kianusch Sayah Karadji <kianusch@sk-tech.net>
18# Added support for GEODE CPU 18# Added support for GEODE CPU
19 19
20# Fill in SRCARCH
21SRCARCH := x86
22
20HAS_BIARCH := $(call cc-option-yn, -m32) 23HAS_BIARCH := $(call cc-option-yn, -m32)
21ifeq ($(HAS_BIARCH),y) 24ifeq ($(HAS_BIARCH),y)
22AS := $(AS) --32 25AS := $(AS) --32
@@ -61,62 +64,62 @@ AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONF
61CFLAGS += $(cflags-y) 64CFLAGS += $(cflags-y)
62 65
63# Default subarch .c files 66# Default subarch .c files
64mcore-y := mach-default 67mcore-y := arch/x86/mach-default
65 68
66# Voyager subarch support 69# Voyager subarch support
67mflags-$(CONFIG_X86_VOYAGER) := -Iinclude/asm-i386/mach-voyager 70mflags-$(CONFIG_X86_VOYAGER) := -Iinclude/asm-x86/mach-voyager
68mcore-$(CONFIG_X86_VOYAGER) := mach-voyager 71mcore-$(CONFIG_X86_VOYAGER) := arch/x86/mach-voyager
69 72
70# VISWS subarch support 73# VISWS subarch support
71mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-i386/mach-visws 74mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-x86/mach-visws
72mcore-$(CONFIG_X86_VISWS) := mach-visws 75mcore-$(CONFIG_X86_VISWS) := arch/x86/mach-visws
73 76
74# NUMAQ subarch support 77# NUMAQ subarch support
75mflags-$(CONFIG_X86_NUMAQ) := -Iinclude/asm-i386/mach-numaq 78mflags-$(CONFIG_X86_NUMAQ) := -Iinclude/asm-x86/mach-numaq
76mcore-$(CONFIG_X86_NUMAQ) := mach-default 79mcore-$(CONFIG_X86_NUMAQ) := arch/x86/mach-default
77 80
78# BIGSMP subarch support 81# BIGSMP subarch support
79mflags-$(CONFIG_X86_BIGSMP) := -Iinclude/asm-i386/mach-bigsmp 82mflags-$(CONFIG_X86_BIGSMP) := -Iinclude/asm-x86/mach-bigsmp
80mcore-$(CONFIG_X86_BIGSMP) := mach-default 83mcore-$(CONFIG_X86_BIGSMP) := arch/x86/mach-default
81 84
82#Summit subarch support 85#Summit subarch support
83mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-i386/mach-summit 86mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-x86/mach-summit
84mcore-$(CONFIG_X86_SUMMIT) := mach-default 87mcore-$(CONFIG_X86_SUMMIT) := arch/x86/mach-default
85 88
86# generic subarchitecture 89# generic subarchitecture
87mflags-$(CONFIG_X86_GENERICARCH) := -Iinclude/asm-i386/mach-generic 90mflags-$(CONFIG_X86_GENERICARCH) := -Iinclude/asm-x86/mach-generic
88mcore-$(CONFIG_X86_GENERICARCH) := mach-default 91mcore-$(CONFIG_X86_GENERICARCH) := arch/x86/mach-default
89core-$(CONFIG_X86_GENERICARCH) += arch/i386/mach-generic/ 92core-$(CONFIG_X86_GENERICARCH) += arch/x86/mach-generic/
90 93
91# ES7000 subarch support 94# ES7000 subarch support
92mflags-$(CONFIG_X86_ES7000) := -Iinclude/asm-i386/mach-es7000 95mflags-$(CONFIG_X86_ES7000) := -Iinclude/asm-x86/mach-es7000
93mcore-$(CONFIG_X86_ES7000) := mach-default 96mcore-$(CONFIG_X86_ES7000) := arch/x86/mach-default
94core-$(CONFIG_X86_ES7000) := arch/i386/mach-es7000/ 97core-$(CONFIG_X86_ES7000) := arch/x86/mach-es7000/
95 98
96# Xen paravirtualization support 99# Xen paravirtualization support
97core-$(CONFIG_XEN) += arch/i386/xen/ 100core-$(CONFIG_XEN) += arch/x86/xen/
98 101
99# default subarch .h files 102# default subarch .h files
100mflags-y += -Iinclude/asm-i386/mach-default 103mflags-y += -Iinclude/asm-x86/mach-default
101 104
102head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o 105head-y := arch/x86/kernel/head_32.o arch/x86/kernel/init_task_32.o
103 106
104libs-y += arch/i386/lib/ 107libs-y += arch/x86/lib/
105core-y += arch/i386/kernel/ \ 108core-y += arch/x86/kernel/ \
106 arch/i386/mm/ \ 109 arch/x86/mm/ \
107 arch/i386/$(mcore-y)/ \ 110 $(mcore-y)/ \
108 arch/i386/crypto/ 111 arch/x86/crypto/
109drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/ 112drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/
110drivers-$(CONFIG_PCI) += arch/i386/pci/ 113drivers-$(CONFIG_PCI) += arch/x86/pci/
111# must be linked after kernel/ 114# must be linked after kernel/
112drivers-$(CONFIG_OPROFILE) += arch/i386/oprofile/ 115drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
113drivers-$(CONFIG_PM) += arch/i386/power/ 116drivers-$(CONFIG_PM) += arch/x86/power/
114drivers-$(CONFIG_FB) += arch/i386/video/ 117drivers-$(CONFIG_FB) += arch/x86/video/
115 118
116CFLAGS += $(mflags-y) 119CFLAGS += $(mflags-y)
117AFLAGS += $(mflags-y) 120AFLAGS += $(mflags-y)
118 121
119boot := arch/i386/boot 122boot := arch/x86/boot
120 123
121PHONY += zImage bzImage compressed zlilo bzlilo \ 124PHONY += zImage bzImage compressed zlilo bzlilo \
122 zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install 125 zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
@@ -125,9 +128,11 @@ all: bzImage
125 128
126# KBUILD_IMAGE specify target image being built 129# KBUILD_IMAGE specify target image being built
127 KBUILD_IMAGE := $(boot)/bzImage 130 KBUILD_IMAGE := $(boot)/bzImage
128zImage zlilo zdisk: KBUILD_IMAGE := arch/i386/boot/zImage 131zImage zlilo zdisk: KBUILD_IMAGE := arch/x86/boot/zImage
129 132
130zImage bzImage: vmlinux 133zImage bzImage: vmlinux
134 $(Q)mkdir -p $(objtree)/arch/i386/boot
135 $(Q)ln -fsn $(objtree)/arch/x86/boot/bzImage $(objtree)/arch/i386/boot/bzImage
131 $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) 136 $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
132 137
133compressed: zImage 138compressed: zImage
@@ -145,7 +150,8 @@ install:
145 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install 150 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
146 151
147archclean: 152archclean:
148 $(Q)$(MAKE) $(clean)=arch/i386/boot 153 $(Q)rm -rf $(objtree)/arch/i386/boot
154 $(Q)$(MAKE) $(clean)=arch/x86/boot
149 155
150define archhelp 156define archhelp
151 echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' 157 echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
deleted file mode 100644
index 9d33b00de659..000000000000
--- a/arch/i386/kernel/Makefile
+++ /dev/null
@@ -1,88 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5extra-y := head.o init_task.o vmlinux.lds
6
7obj-y := process.o signal.o entry.o traps.o irq.o \
8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
9 pci-dma.o i386_ksyms.o i387.o bootflag.o e820.o\
10 quirks.o i8237.o topology.o alternative.o i8253.o tsc.o
11
12obj-$(CONFIG_STACKTRACE) += stacktrace.o
13obj-y += cpu/
14obj-y += acpi/
15obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o
16obj-$(CONFIG_MCA) += mca.o
17obj-$(CONFIG_X86_MSR) += msr.o
18obj-$(CONFIG_X86_CPUID) += cpuid.o
19obj-$(CONFIG_MICROCODE) += microcode.o
20obj-$(CONFIG_APM) += apm.o
21obj-$(CONFIG_X86_SMP) += smp.o smpboot.o tsc_sync.o
22obj-$(CONFIG_SMP) += smpcommon.o
23obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
24obj-$(CONFIG_X86_MPPARSE) += mpparse.o
25obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
26obj-$(CONFIG_X86_IO_APIC) += io_apic.o
27obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups.o
28obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o
29obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
30obj-$(CONFIG_X86_NUMAQ) += numaq.o
31obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o
32obj-$(CONFIG_KPROBES) += kprobes.o
33obj-$(CONFIG_MODULES) += module.o
34obj-y += sysenter.o vsyscall.o
35obj-$(CONFIG_ACPI_SRAT) += srat.o
36obj-$(CONFIG_EFI) += efi.o efi_stub.o
37obj-$(CONFIG_DOUBLEFAULT) += doublefault.o
38obj-$(CONFIG_VM86) += vm86.o
39obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
40obj-$(CONFIG_HPET_TIMER) += hpet.o
41obj-$(CONFIG_K8_NB) += k8.o
42obj-$(CONFIG_MGEODE_LX) += geode.o
43
44obj-$(CONFIG_VMI) += vmi.o vmiclock.o
45obj-$(CONFIG_PARAVIRT) += paravirt.o
46obj-y += pcspeaker.o
47
48obj-$(CONFIG_SCx200) += scx200.o
49
50# vsyscall.o contains the vsyscall DSO images as __initdata.
51# We must build both images before we can assemble it.
52# Note: kbuild does not track this dependency due to usage of .incbin
53$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so
54targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
55targets += vsyscall-note.o vsyscall.lds
56
57# The DSO images are built using a special linker script.
58quiet_cmd_syscall = SYSCALL $@
59 cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
60 -Wl,-T,$(filter-out FORCE,$^) -o $@
61
62export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH)
63
64vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
65 $(call ld-option, -Wl$(comma)--hash-style=sysv)
66SYSCFLAGS_vsyscall-sysenter.so = $(vsyscall-flags)
67SYSCFLAGS_vsyscall-int80.so = $(vsyscall-flags)
68
69$(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so: \
70$(obj)/vsyscall-%.so: $(src)/vsyscall.lds \
71 $(obj)/vsyscall-%.o $(obj)/vsyscall-note.o FORCE
72 $(call if_changed,syscall)
73
74# We also create a special relocatable object that should mirror the symbol
75# table and layout of the linked DSO. With ld -R we can then refer to
76# these symbols in the kernel code rather than hand-coded addresses.
77extra-y += vsyscall-syms.o
78$(obj)/built-in.o: $(obj)/vsyscall-syms.o
79$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
80
81SYSCFLAGS_vsyscall-syms.o = -r
82$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
83 $(obj)/vsyscall-sysenter.o $(obj)/vsyscall-note.o FORCE
84 $(call if_changed,syscall)
85
86k8-y += ../../x86_64/kernel/k8.o
87stacktrace-y += ../../x86_64/kernel/stacktrace.o
88
diff --git a/arch/i386/kernel/early_printk.c b/arch/i386/kernel/early_printk.c
deleted file mode 100644
index 92f812ba275c..000000000000
--- a/arch/i386/kernel/early_printk.c
+++ /dev/null
@@ -1,2 +0,0 @@
1
2#include "../../x86_64/kernel/early_printk.c"
diff --git a/arch/i386/kernel/quirks.c b/arch/i386/kernel/quirks.c
deleted file mode 100644
index 6722469c2633..000000000000
--- a/arch/i386/kernel/quirks.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * This file contains work-arounds for x86 and x86_64 platform bugs.
3 */
4#include <linux/pci.h>
5#include <linux/irq.h>
6
7#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI)
8
9static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
10{
11 u8 config, rev;
12 u32 word;
13
14 /* BIOS may enable hardware IRQ balancing for
15 * E7520/E7320/E7525(revision ID 0x9 and below)
16 * based platforms.
17 * Disable SW irqbalance/affinity on those platforms.
18 */
19 pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev);
20 if (rev > 0x9)
21 return;
22
23 /* enable access to config space*/
24 pci_read_config_byte(dev, 0xf4, &config);
25 pci_write_config_byte(dev, 0xf4, config|0x2);
26
27 /* read xTPR register */
28 raw_pci_ops->read(0, 0, 0x40, 0x4c, 2, &word);
29
30 if (!(word & (1 << 13))) {
31 printk(KERN_INFO "Intel E7520/7320/7525 detected. "
32 "Disabling irq balancing and affinity\n");
33#ifdef CONFIG_IRQBALANCE
34 irqbalance_disable("");
35#endif
36 noirqdebug_setup("");
37#ifdef CONFIG_PROC_FS
38 no_irq_affinity = 1;
39#endif
40 }
41
42 /* put back the original value for config space*/
43 if (!(config & 0x2))
44 pci_write_config_byte(dev, 0xf4, config);
45}
46DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_intel_irqbalance);
47DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_intel_irqbalance);
48DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, quirk_intel_irqbalance);
49#endif
diff --git a/arch/i386/kernel/tsc_sync.c b/arch/i386/kernel/tsc_sync.c
deleted file mode 100644
index 12424629af87..000000000000
--- a/arch/i386/kernel/tsc_sync.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../x86_64/kernel/tsc_sync.c"
diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile
deleted file mode 100644
index 4d105fdfe817..000000000000
--- a/arch/i386/lib/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
1#
2# Makefile for i386-specific library files..
3#
4
5
6lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \
7 bitops.o semaphore.o string.o
8
9lib-$(CONFIG_X86_USE_3DNOW) += mmx.o
10
11obj-$(CONFIG_SMP) += msr-on-cpu.o
diff --git a/arch/i386/mach-generic/Makefile b/arch/i386/mach-generic/Makefile
deleted file mode 100644
index 6914485c0d85..000000000000
--- a/arch/i386/mach-generic/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
1#
2# Makefile for the generic architecture
3#
4
5EXTRA_CFLAGS := -Iarch/i386/kernel
6
7obj-y := probe.o summit.o bigsmp.o es7000.o default.o ../mach-es7000/
diff --git a/arch/i386/mm/Makefile b/arch/i386/mm/Makefile
deleted file mode 100644
index 80908b5aa60f..000000000000
--- a/arch/i386/mm/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
1#
2# Makefile for the linux i386-specific parts of the memory manager.
3#
4
5obj-y := init.o pgtable.o fault.o ioremap.o extable.o pageattr.o mmap.o
6
7obj-$(CONFIG_NUMA) += discontig.o
8obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
9obj-$(CONFIG_HIGHMEM) += highmem.o
10obj-$(CONFIG_BOOT_IOREMAP) += boot_ioremap.o
diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c
index 4017696ada63..08b117e2c54b 100644
--- a/arch/ia64/hp/sim/simeth.c
+++ b/arch/ia64/hp/sim/simeth.c
@@ -294,6 +294,9 @@ simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
294 return NOTIFY_DONE; 294 return NOTIFY_DONE;
295 } 295 }
296 296
297 if (dev->nd_net != &init_net)
298 return NOTIFY_DONE;
299
297 if ( event != NETDEV_UP && event != NETDEV_DOWN ) return NOTIFY_DONE; 300 if ( event != NETDEV_UP && event != NETDEV_DOWN ) return NOTIFY_DONE;
298 301
299 /* 302 /*
diff --git a/arch/ia64/ia32/audit.c b/arch/ia64/ia32/audit.c
index 8850fe40ea34..5e901c75df1b 100644
--- a/arch/ia64/ia32/audit.c
+++ b/arch/ia64/ia32/audit.c
@@ -1,4 +1,4 @@
1#include <asm-i386/unistd.h> 1#include <asm-x86/unistd_32.h>
2 2
3unsigned ia32_dir_class[] = { 3unsigned ia32_dir_class[] = {
4#include <asm-generic/audit_dir_write.h> 4#include <asm-generic/audit_dir_write.h>
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 3b807b4bc7cd..f943736541cb 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -3,6 +3,7 @@ config MIPS
3 default y 3 default y
4 # Horrible source of confusion. Die, die, die ... 4 # Horrible source of confusion. Die, die, die ...
5 select EMBEDDED 5 select EMBEDDED
6 select RTC_LIB
6 7
7mainmenu "Linux/MIPS Kernel Configuration" 8mainmenu "Linux/MIPS Kernel Configuration"
8 9
@@ -44,12 +45,30 @@ config BASLER_EXCITE_PROTOTYPE
44 note that a kernel built with this option selected will not be 45 note that a kernel built with this option selected will not be
45 able to run on normal units. 46 able to run on normal units.
46 47
48config BCM47XX
49 bool "BCM47XX based boards"
50 select DMA_NONCOHERENT
51 select HW_HAS_PCI
52 select IRQ_CPU
53 select SYS_HAS_CPU_MIPS32_R1
54 select SYS_SUPPORTS_32BIT_KERNEL
55 select SYS_SUPPORTS_LITTLE_ENDIAN
56 select SSB
57 select SSB_DRIVER_MIPS
58 select GENERIC_GPIO
59 select SYS_HAS_EARLY_PRINTK
60 select CFE
61 help
62 Support for BCM47XX based boards
63
47config MIPS_COBALT 64config MIPS_COBALT
48 bool "Cobalt Server" 65 bool "Cobalt Server"
49 select DMA_NONCOHERENT 66 select DMA_NONCOHERENT
50 select HW_HAS_PCI 67 select HW_HAS_PCI
68 select I8253
51 select I8259 69 select I8259
52 select IRQ_CPU 70 select IRQ_CPU
71 select IRQ_GT641XX
53 select PCI_GT64XXX_PCI0 72 select PCI_GT64XXX_PCI0
54 select SYS_HAS_CPU_NEVADA 73 select SYS_HAS_CPU_NEVADA
55 select SYS_HAS_EARLY_PRINTK 74 select SYS_HAS_EARLY_PRINTK
@@ -93,6 +112,8 @@ config MACH_JAZZ
93 select ARC32 112 select ARC32
94 select ARCH_MAY_HAVE_PC_FDC 113 select ARCH_MAY_HAVE_PC_FDC
95 select GENERIC_ISA_DMA 114 select GENERIC_ISA_DMA
115 select IRQ_CPU
116 select I8253
96 select I8259 117 select I8259
97 select ISA 118 select ISA
98 select PCSPEAKER 119 select PCSPEAKER
@@ -107,6 +128,20 @@ config MACH_JAZZ
107 Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and 128 Members include the Acer PICA, MIPS Magnum 4000, MIPS Millenium and
108 Olivetti M700-10 workstations. 129 Olivetti M700-10 workstations.
109 130
131config LASAT
132 bool "LASAT Networks platforms"
133 select DMA_NONCOHERENT
134 select SYS_HAS_EARLY_PRINTK
135 select HW_HAS_PCI
136 select PCI_GT64XXX_PCI0
137 select MIPS_NILE4
138 select R5000_CPU_SCACHE
139 select SYS_HAS_CPU_R5000
140 select SYS_SUPPORTS_32BIT_KERNEL
141 select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
142 select SYS_SUPPORTS_LITTLE_ENDIAN
143 select GENERIC_HARDIRQS_NO__DO_IRQ
144
110config LEMOTE_FULONG 145config LEMOTE_FULONG
111 bool "Lemote Fulong mini-PC" 146 bool "Lemote Fulong mini-PC"
112 select ARCH_SPARSEMEM_ENABLE 147 select ARCH_SPARSEMEM_ENABLE
@@ -168,6 +203,7 @@ config MIPS_MALTA
168 select GENERIC_ISA_DMA 203 select GENERIC_ISA_DMA
169 select IRQ_CPU 204 select IRQ_CPU
170 select HW_HAS_PCI 205 select HW_HAS_PCI
206 select I8253
171 select I8259 207 select I8259
172 select MIPS_BOARDS_GEN 208 select MIPS_BOARDS_GEN
173 select MIPS_BONITO64 209 select MIPS_BONITO64
@@ -301,7 +337,9 @@ config QEMU
301 select DMA_COHERENT 337 select DMA_COHERENT
302 select GENERIC_ISA_DMA 338 select GENERIC_ISA_DMA
303 select HAVE_STD_PC_SERIAL_PORT 339 select HAVE_STD_PC_SERIAL_PORT
340 select I8253
304 select I8259 341 select I8259
342 select IRQ_CPU
305 select ISA 343 select ISA
306 select PCSPEAKER 344 select PCSPEAKER
307 select SWAP_IO_SPACE 345 select SWAP_IO_SPACE
@@ -328,6 +366,7 @@ config SGI_IP22
328 select BOOT_ELF32 366 select BOOT_ELF32
329 select DMA_NONCOHERENT 367 select DMA_NONCOHERENT
330 select HW_HAS_EISA 368 select HW_HAS_EISA
369 select I8253
331 select IP22_CPU_SCACHE 370 select IP22_CPU_SCACHE
332 select IRQ_CPU 371 select IRQ_CPU
333 select GENERIC_ISA_DMA_SUPPORT_BROKEN 372 select GENERIC_ISA_DMA_SUPPORT_BROKEN
@@ -352,7 +391,6 @@ config SGI_IP27
352 select SYS_HAS_EARLY_PRINTK 391 select SYS_HAS_EARLY_PRINTK
353 select HW_HAS_PCI 392 select HW_HAS_PCI
354 select NR_CPUS_DEFAULT_64 393 select NR_CPUS_DEFAULT_64
355 select PCI_DOMAINS
356 select SYS_HAS_CPU_R10000 394 select SYS_HAS_CPU_R10000
357 select SYS_SUPPORTS_64BIT_KERNEL 395 select SYS_SUPPORTS_64BIT_KERNEL
358 select SYS_SUPPORTS_BIG_ENDIAN 396 select SYS_SUPPORTS_BIG_ENDIAN
@@ -484,7 +522,6 @@ config SIBYTE_BIGSUR
484 select BOOT_ELF32 522 select BOOT_ELF32
485 select DMA_COHERENT 523 select DMA_COHERENT
486 select NR_CPUS_DEFAULT_4 524 select NR_CPUS_DEFAULT_4
487 select PCI_DOMAINS
488 select SIBYTE_BCM1x80 525 select SIBYTE_BCM1x80
489 select SWAP_IO_SPACE 526 select SWAP_IO_SPACE
490 select SYS_HAS_CPU_SB1 527 select SYS_HAS_CPU_SB1
@@ -502,6 +539,7 @@ config SNI_RM
502 select HW_HAS_EISA 539 select HW_HAS_EISA
503 select HW_HAS_PCI 540 select HW_HAS_PCI
504 select IRQ_CPU 541 select IRQ_CPU
542 select I8253
505 select I8259 543 select I8259
506 select ISA 544 select ISA
507 select PCSPEAKER 545 select PCSPEAKER
@@ -599,6 +637,7 @@ endchoice
599 637
600source "arch/mips/au1000/Kconfig" 638source "arch/mips/au1000/Kconfig"
601source "arch/mips/jazz/Kconfig" 639source "arch/mips/jazz/Kconfig"
640source "arch/mips/lasat/Kconfig"
602source "arch/mips/pmc-sierra/Kconfig" 641source "arch/mips/pmc-sierra/Kconfig"
603source "arch/mips/sgi-ip27/Kconfig" 642source "arch/mips/sgi-ip27/Kconfig"
604source "arch/mips/sibyte/Kconfig" 643source "arch/mips/sibyte/Kconfig"
@@ -635,10 +674,18 @@ config GENERIC_CALIBRATE_DELAY
635 bool 674 bool
636 default y 675 default y
637 676
677config GENERIC_CLOCKEVENTS
678 bool
679 default y
680
638config GENERIC_TIME 681config GENERIC_TIME
639 bool 682 bool
640 default y 683 default y
641 684
685config GENERIC_CMOS_UPDATE
686 bool
687 default y
688
642config SCHED_NO_NO_OMIT_FRAME_POINTER 689config SCHED_NO_NO_OMIT_FRAME_POINTER
643 bool 690 bool
644 default y 691 default y
@@ -659,6 +706,9 @@ config ARCH_MAY_HAVE_PC_FDC
659config BOOT_RAW 706config BOOT_RAW
660 bool 707 bool
661 708
709config CFE
710 bool
711
662config DMA_COHERENT 712config DMA_COHERENT
663 bool 713 bool
664 714
@@ -706,6 +756,9 @@ config MIPS_BONITO64
706config MIPS_MSC 756config MIPS_MSC
707 bool 757 bool
708 758
759config MIPS_NILE4
760 bool
761
709config MIPS_DISABLE_OBSOLETE_IDE 762config MIPS_DISABLE_OBSOLETE_IDE
710 bool 763 bool
711 764
@@ -775,6 +828,9 @@ config IRQ_MSP_CIC
775config IRQ_TXX9 828config IRQ_TXX9
776 bool 829 bool
777 830
831config IRQ_GT641XX
832 bool
833
778config MIPS_BOARDS_GEN 834config MIPS_BOARDS_GEN
779 bool 835 bool
780 836
@@ -856,6 +912,8 @@ config BOOT_ELF64
856 912
857menu "CPU selection" 913menu "CPU selection"
858 914
915source "kernel/time/Kconfig"
916
859choice 917choice
860 prompt "CPU type" 918 prompt "CPU type"
861 default CPU_R4X00 919 default CPU_R4X00
@@ -1316,6 +1374,7 @@ config MIPS_MT_SMTC
1316 depends on CPU_MIPS32_R2 1374 depends on CPU_MIPS32_R2
1317 #depends on CPU_MIPS64_R2 # once there is hardware ... 1375 #depends on CPU_MIPS64_R2 # once there is hardware ...
1318 depends on SYS_SUPPORTS_MULTITHREADING 1376 depends on SYS_SUPPORTS_MULTITHREADING
1377 select GENERIC_CLOCKEVENTS_BROADCAST
1319 select CPU_MIPSR2_IRQ_VI 1378 select CPU_MIPSR2_IRQ_VI
1320 select CPU_MIPSR2_IRQ_EI 1379 select CPU_MIPSR2_IRQ_EI
1321 select CPU_MIPSR2_SRS 1380 select CPU_MIPSR2_SRS
@@ -1378,6 +1437,19 @@ config MIPS_MT_SMTC_IM_BACKSTOP
1378 impact on interrupt service overhead. Disable it only if you know 1437 impact on interrupt service overhead. Disable it only if you know
1379 what you are doing. 1438 what you are doing.
1380 1439
1440config MIPS_MT_SMTC_IRQAFF
1441 bool "Support IRQ affinity API"
1442 depends on MIPS_MT_SMTC
1443 default n
1444 help
1445 Enables SMP IRQ affinity API (/proc/irq/*/smp_affinity, etc.)
1446 for SMTC Linux kernel. Requires platform support, of which
1447 an example can be found in the MIPS kernel i8259 and Malta
1448 platform code. It is recommended that MIPS_MT_SMTC_INSTANT_REPLAY
1449 be enabled if MIPS_MT_SMTC_IRQAFF is used. Adds overhead to
1450 interrupt dispatch, and should be used only if you know what
1451 you are doing.
1452
1381config MIPS_VPE_LOADER_TOM 1453config MIPS_VPE_LOADER_TOM
1382 bool "Load VPE program into memory hidden from linux" 1454 bool "Load VPE program into memory hidden from linux"
1383 depends on MIPS_VPE_LOADER 1455 depends on MIPS_VPE_LOADER
@@ -1472,6 +1544,9 @@ config CPU_HAS_SYNC
1472 depends on !CPU_R3000 1544 depends on !CPU_R3000
1473 default y 1545 default y
1474 1546
1547config GENERIC_CLOCKEVENTS_BROADCAST
1548 bool
1549
1475# 1550#
1476# Use the generic interrupt handling code in kernel/irq/: 1551# Use the generic interrupt handling code in kernel/irq/:
1477# 1552#
@@ -1762,6 +1837,7 @@ config HW_HAS_PCI
1762config PCI 1837config PCI
1763 bool "Support for PCI controller" 1838 bool "Support for PCI controller"
1764 depends on HW_HAS_PCI 1839 depends on HW_HAS_PCI
1840 select PCI_DOMAINS
1765 help 1841 help
1766 Find out whether you have a PCI motherboard. PCI is the name of a 1842 Find out whether you have a PCI motherboard. PCI is the name of a
1767 bus system, i.e. the way the CPU talks to the other stuff inside 1843 bus system, i.e. the way the CPU talks to the other stuff inside
@@ -1775,7 +1851,6 @@ config PCI
1775 1851
1776config PCI_DOMAINS 1852config PCI_DOMAINS
1777 bool 1853 bool
1778 depends on PCI
1779 1854
1780source "drivers/pci/Kconfig" 1855source "drivers/pci/Kconfig"
1781 1856
@@ -1824,6 +1899,9 @@ config MMU
1824 bool 1899 bool
1825 default y 1900 default y
1826 1901
1902config I8253
1903 bool
1904
1827config PCSPEAKER 1905config PCSPEAKER
1828 bool 1906 bool
1829 1907
@@ -1840,21 +1918,6 @@ source "fs/Kconfig.binfmt"
1840config TRAD_SIGNALS 1918config TRAD_SIGNALS
1841 bool 1919 bool
1842 1920
1843config BUILD_ELF64
1844 bool "Use 64-bit ELF format for building"
1845 depends on 64BIT
1846 help
1847 A 64-bit kernel is usually built using the 64-bit ELF binary object
1848 format as it's one that allows arbitrary 64-bit constructs. For
1849 kernels that are loaded within the KSEG compatibility segments the
1850 32-bit ELF format can optionally be used resulting in a somewhat
1851 smaller binary, but this option is not explicitly supported by the
1852 toolchain and since binutils 2.14 it does not even work at all.
1853
1854 Say Y to use the 64-bit format or N to use the 32-bit one.
1855
1856 If unsure say Y.
1857
1858config BINFMT_IRIX 1921config BINFMT_IRIX
1859 bool "Include IRIX binary compatibility" 1922 bool "Include IRIX binary compatibility"
1860 depends on CPU_BIG_ENDIAN && 32BIT && BROKEN 1923 depends on CPU_BIG_ENDIAN && 32BIT && BROKEN
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 32c1c8fb6f98..ebd5d02a7d78 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -60,11 +60,6 @@ vmlinux-32 = vmlinux.32
60vmlinux-64 = vmlinux 60vmlinux-64 = vmlinux
61 61
62cflags-y += -mabi=64 62cflags-y += -mabi=64
63ifdef CONFIG_BUILD_ELF64
64cflags-y += $(call cc-option,-mno-explicit-relocs)
65else
66cflags-y += $(call cc-option,-msym32)
67endif
68endif 63endif
69 64
70all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) 65all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32)
@@ -153,7 +148,8 @@ endif
153# 148#
154# Firmware support 149# Firmware support
155# 150#
156libs-$(CONFIG_ARC) += arch/mips/arc/ 151libs-$(CONFIG_ARC) += arch/mips/fw/arc/
152libs-$(CONFIG_CFE) += arch/mips/fw/cfe/
157libs-$(CONFIG_SIBYTE_CFE) += arch/mips/sibyte/cfe/ 153libs-$(CONFIG_SIBYTE_CFE) += arch/mips/sibyte/cfe/
158 154
159# 155#
@@ -367,6 +363,13 @@ cflags-$(CONFIG_BASLER_EXCITE) += -Iinclude/asm-mips/mach-excite
367load-$(CONFIG_BASLER_EXCITE) += 0x80100000 363load-$(CONFIG_BASLER_EXCITE) += 0x80100000
368 364
369# 365#
366# LASAT platforms
367#
368core-$(CONFIG_LASAT) += arch/mips/lasat/
369cflags-$(CONFIG_LASAT) += -Iinclude/asm-mips/mach-lasat
370load-$(CONFIG_LASAT) += 0xffffffff80000000
371
372#
370# Common VR41xx 373# Common VR41xx
371# 374#
372core-$(CONFIG_MACH_VR41XX) += arch/mips/vr41xx/common/ 375core-$(CONFIG_MACH_VR41XX) += arch/mips/vr41xx/common/
@@ -533,6 +536,13 @@ libs-$(CONFIG_SIBYTE_BIGSUR) += arch/mips/sibyte/swarm/
533load-$(CONFIG_SIBYTE_BIGSUR) := 0xffffffff80100000 536load-$(CONFIG_SIBYTE_BIGSUR) := 0xffffffff80100000
534 537
535# 538#
539# Broadcom BCM47XX boards
540#
541core-$(CONFIG_BCM47XX) += arch/mips/bcm47xx/
542cflags-$(CONFIG_BCM47XX) += -Iinclude/asm-mips/mach-bcm47xx
543load-$(CONFIG_BCM47XX) := 0xffffffff80001000
544
545#
536# SNI RM 546# SNI RM
537# 547#
538core-$(CONFIG_SNI_RM) += arch/mips/sni/ 548core-$(CONFIG_SNI_RM) += arch/mips/sni/
@@ -578,6 +588,26 @@ else
578JIFFIES = jiffies_64 588JIFFIES = jiffies_64
579endif 589endif
580 590
591#
592# Automatically detect the build format. By default we choose
593# the elf format according to the load address.
594# We can always force a build with a 64-bits symbol format by
595# passing 'KBUILD_SYM32=no' option to the make's command line.
596#
597ifdef CONFIG_64BIT
598 ifndef KBUILD_SYM32
599 ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0)
600 KBUILD_SYM32 = y
601 endif
602 endif
603
604 ifeq ($(KBUILD_SYM32), y)
605 ifeq ($(call cc-option-yn,-msym32), y)
606 cflags-y += -msym32 -DKBUILD_64BIT_SYM32
607 endif
608 endif
609endif
610
581AFLAGS += $(cflags-y) 611AFLAGS += $(cflags-y)
582CFLAGS += $(cflags-y) \ 612CFLAGS += $(cflags-y) \
583 -D"VMLINUX_LOAD_ADDRESS=$(load-y)" 613 -D"VMLINUX_LOAD_ADDRESS=$(load-y)"
@@ -615,6 +645,11 @@ core-y += arch/mips/kernel/ arch/mips/mm/ arch/mips/math-emu/
615 645
616drivers-$(CONFIG_OPROFILE) += arch/mips/oprofile/ 646drivers-$(CONFIG_OPROFILE) += arch/mips/oprofile/
617 647
648ifdef CONFIG_LASAT
649rom.bin rom.sw: vmlinux
650 $(Q)$(MAKE) $(build)=arch/mips/lasat/image $@
651endif
652
618# 653#
619# Some machines like the Indy need 32-bit ELF binaries for booting purposes. 654# Some machines like the Indy need 32-bit ELF binaries for booting purposes.
620# Other need ECOFF, so we build a 32-bit ELF binary for them which we then 655# Other need ECOFF, so we build a 32-bit ELF binary for them which we then
@@ -658,6 +693,7 @@ endif
658 693
659archclean: 694archclean:
660 @$(MAKE) $(clean)=arch/mips/boot 695 @$(MAKE) $(clean)=arch/mips/boot
696 @$(MAKE) $(clean)=arch/mips/lasat
661 697
662define archhelp 698define archhelp
663 echo ' vmlinux.ecoff - ECOFF boot image' 699 echo ' vmlinux.ecoff - ECOFF boot image'
diff --git a/arch/mips/au1000/common/dbdma.c b/arch/mips/au1000/common/dbdma.c
index 626de44bd888..461cf0139737 100644
--- a/arch/mips/au1000/common/dbdma.c
+++ b/arch/mips/au1000/common/dbdma.c
@@ -184,7 +184,7 @@ static dbdev_tab_t dbdev_tab[] = {
184static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; 184static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS];
185 185
186static dbdev_tab_t * 186static dbdev_tab_t *
187find_dbdev_id (u32 id) 187find_dbdev_id(u32 id)
188{ 188{
189 int i; 189 int i;
190 dbdev_tab_t *p; 190 dbdev_tab_t *p;
@@ -213,7 +213,7 @@ au1xxx_ddma_add_device(dbdev_tab_t *dev)
213 if ( NULL != p ) 213 if ( NULL != p )
214 { 214 {
215 memcpy(p, dev, sizeof(dbdev_tab_t)); 215 memcpy(p, dev, sizeof(dbdev_tab_t));
216 p->dev_id = DSCR_DEV2CUSTOM_ID(new_id,dev->dev_id); 216 p->dev_id = DSCR_DEV2CUSTOM_ID(new_id, dev->dev_id);
217 ret = p->dev_id; 217 ret = p->dev_id;
218 new_id++; 218 new_id++;
219#if 0 219#if 0
@@ -671,7 +671,7 @@ _au1xxx_dbdma_put_dest(u32 chanid, void *buf, int nbytes, u32 flags)
671 * parts. If it is fixedin the future, these dma_cache_inv will just 671 * parts. If it is fixedin the future, these dma_cache_inv will just
672 * be nothing more than empty macros. See io.h. 672 * be nothing more than empty macros. See io.h.
673 * */ 673 * */
674 dma_cache_inv((unsigned long)buf,nbytes); 674 dma_cache_inv((unsigned long)buf, nbytes);
675 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */ 675 dp->dscr_cmd0 |= DSCR_CMD0_V; /* Let it rip */
676 au_sync(); 676 au_sync();
677 dma_cache_wback_inv((unsigned long)dp, sizeof(dp)); 677 dma_cache_wback_inv((unsigned long)dp, sizeof(dp));
diff --git a/arch/mips/au1000/common/dbg_io.c b/arch/mips/au1000/common/dbg_io.c
index 0a50af7f34b8..79e0b0a51ace 100644
--- a/arch/mips/au1000/common/dbg_io.c
+++ b/arch/mips/au1000/common/dbg_io.c
@@ -53,7 +53,7 @@ typedef unsigned int uint32;
53 53
54/* memory-mapped read/write of the port */ 54/* memory-mapped read/write of the port */
55#define UART16550_READ(y) (au_readl(DEBUG_BASE + y) & 0xff) 55#define UART16550_READ(y) (au_readl(DEBUG_BASE + y) & 0xff)
56#define UART16550_WRITE(y,z) (au_writel(z&0xff, DEBUG_BASE + y)) 56#define UART16550_WRITE(y, z) (au_writel(z&0xff, DEBUG_BASE + y))
57 57
58extern unsigned long get_au1x00_uart_baud_base(void); 58extern unsigned long get_au1x00_uart_baud_base(void);
59extern unsigned long cal_r4koff(void); 59extern unsigned long cal_r4koff(void);
diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c
index ea6e99fbe2f7..a6640b998c6e 100644
--- a/arch/mips/au1000/common/irq.c
+++ b/arch/mips/au1000/common/irq.c
@@ -65,19 +65,6 @@
65#define EXT_INTC1_REQ1 5 /* IP 5 */ 65#define EXT_INTC1_REQ1 5 /* IP 5 */
66#define MIPS_TIMER_IP 7 /* IP 7 */ 66#define MIPS_TIMER_IP 7 /* IP 7 */
67 67
68extern void set_debug_traps(void);
69extern irq_cpustat_t irq_stat [NR_CPUS];
70extern void mips_timer_interrupt(void);
71
72static void setup_local_irq(unsigned int irq, int type, int int_req);
73static void end_irq(unsigned int irq_nr);
74static inline void mask_and_ack_level_irq(unsigned int irq_nr);
75static inline void mask_and_ack_rise_edge_irq(unsigned int irq_nr);
76static inline void mask_and_ack_fall_edge_irq(unsigned int irq_nr);
77static inline void mask_and_ack_either_edge_irq(unsigned int irq_nr);
78inline void local_enable_irq(unsigned int irq_nr);
79inline void local_disable_irq(unsigned int irq_nr);
80
81void (*board_init_irq)(void); 68void (*board_init_irq)(void);
82 69
83static DEFINE_SPINLOCK(irq_lock); 70static DEFINE_SPINLOCK(irq_lock);
@@ -646,7 +633,7 @@ asmlinkage void plat_irq_dispatch(void)
646 unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; 633 unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
647 634
648 if (pending & CAUSEF_IP7) 635 if (pending & CAUSEF_IP7)
649 mips_timer_interrupt(); 636 do_IRQ(63);
650 else if (pending & CAUSEF_IP2) 637 else if (pending & CAUSEF_IP2)
651 intc0_req0_irqdispatch(); 638 intc0_req0_irqdispatch();
652 else if (pending & CAUSEF_IP3) 639 else if (pending & CAUSEF_IP3)
diff --git a/arch/mips/au1000/common/pci.c b/arch/mips/au1000/common/pci.c
index 6c25e6c09f78..9be99a68932a 100644
--- a/arch/mips/au1000/common/pci.c
+++ b/arch/mips/au1000/common/pci.c
@@ -74,6 +74,7 @@ static int __init au1x_pci_setup(void)
74 printk(KERN_ERR "Unable to ioremap pci space\n"); 74 printk(KERN_ERR "Unable to ioremap pci space\n");
75 return 1; 75 return 1;
76 } 76 }
77 au1x_controller.io_map_base = virt_io_addr;
77 78
78#ifdef CONFIG_DMA_NONCOHERENT 79#ifdef CONFIG_DMA_NONCOHERENT
79 { 80 {
diff --git a/arch/mips/au1000/common/power.c b/arch/mips/au1000/common/power.c
index 3901e8e04755..6f57f72a7d57 100644
--- a/arch/mips/au1000/common/power.c
+++ b/arch/mips/au1000/common/power.c
@@ -211,7 +211,7 @@ int au_sleep(void)
211 unsigned long wakeup, flags; 211 unsigned long wakeup, flags;
212 extern void save_and_sleep(void); 212 extern void save_and_sleep(void);
213 213
214 spin_lock_irqsave(&pm_lock,flags); 214 spin_lock_irqsave(&pm_lock, flags);
215 215
216 save_core_regs(); 216 save_core_regs();
217 217
diff --git a/arch/mips/au1000/common/reset.c b/arch/mips/au1000/common/reset.c
index de5447e83849..b8638d293cf9 100644
--- a/arch/mips/au1000/common/reset.c
+++ b/arch/mips/au1000/common/reset.c
@@ -42,7 +42,7 @@ extern void (*flush_cache_all)(void);
42void au1000_restart(char *command) 42void au1000_restart(char *command)
43{ 43{
44 /* Set all integrated peripherals to disabled states */ 44 /* Set all integrated peripherals to disabled states */
45 extern void board_reset (void); 45 extern void board_reset(void);
46 u32 prid = read_c0_prid(); 46 u32 prid = read_c0_prid();
47 47
48 printk(KERN_NOTICE "\n** Resetting Integrated Peripherals\n"); 48 printk(KERN_NOTICE "\n** Resetting Integrated Peripherals\n");
diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index a95b37773196..b212c0726125 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -50,7 +50,6 @@ extern void au1000_halt(void);
50extern void au1000_power_off(void); 50extern void au1000_power_off(void);
51extern void au1x_time_init(void); 51extern void au1x_time_init(void);
52extern void au1x_timer_setup(struct irqaction *irq); 52extern void au1x_timer_setup(struct irqaction *irq);
53extern void au1xxx_time_init(void);
54extern void set_cpuspec(void); 53extern void set_cpuspec(void);
55 54
56void __init plat_mem_setup(void) 55void __init plat_mem_setup(void)
@@ -112,7 +111,6 @@ void __init plat_mem_setup(void)
112 _machine_restart = au1000_restart; 111 _machine_restart = au1000_restart;
113 _machine_halt = au1000_halt; 112 _machine_halt = au1000_halt;
114 pm_power_off = au1000_power_off; 113 pm_power_off = au1000_power_off;
115 board_time_init = au1xxx_time_init;
116 114
117 /* IO/MEM resources. */ 115 /* IO/MEM resources. */
118 set_io_port_base(0); 116 set_io_port_base(0);
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index 8fc29982d700..2556399708ba 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -64,48 +64,8 @@ static unsigned long last_pc0, last_match20;
64 64
65static DEFINE_SPINLOCK(time_lock); 65static DEFINE_SPINLOCK(time_lock);
66 66
67static inline void ack_r4ktimer(unsigned long newval)
68{
69 write_c0_compare(newval);
70}
71
72/*
73 * There are a lot of conceptually broken versions of the MIPS timer interrupt
74 * handler floating around. This one is rather different, but the algorithm
75 * is provably more robust.
76 */
77unsigned long wtimer; 67unsigned long wtimer;
78 68
79void mips_timer_interrupt(void)
80{
81 int irq = 63;
82
83 irq_enter();
84 kstat_this_cpu.irqs[irq]++;
85
86 if (r4k_offset == 0)
87 goto null;
88
89 do {
90 kstat_this_cpu.irqs[irq]++;
91 do_timer(1);
92#ifndef CONFIG_SMP
93 update_process_times(user_mode(get_irq_regs()));
94#endif
95 r4k_cur += r4k_offset;
96 ack_r4ktimer(r4k_cur);
97
98 } while (((unsigned long)read_c0_count()
99 - r4k_cur) < 0x7fffffff);
100
101 irq_exit();
102 return;
103
104null:
105 ack_r4ktimer(0);
106 irq_exit();
107}
108
109#ifdef CONFIG_PM 69#ifdef CONFIG_PM
110irqreturn_t counter0_irq(int irq, void *dev_id) 70irqreturn_t counter0_irq(int irq, void *dev_id)
111{ 71{
@@ -240,7 +200,7 @@ unsigned long cal_r4koff(void)
240 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S); 200 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S);
241 201
242 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); 202 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S);
243 au_writel (0, SYS_TOYWRITE); 203 au_writel(0, SYS_TOYWRITE);
244 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); 204 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S);
245 205
246 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * 206 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) *
@@ -329,7 +289,3 @@ void __init plat_timer_setup(struct irqaction *irq)
329 289
330#endif 290#endif
331} 291}
332
333void __init au1xxx_time_init(void)
334{
335}
diff --git a/arch/mips/au1000/db1x00/board_setup.c b/arch/mips/au1000/db1x00/board_setup.c
index 8b08edb977be..99eafeada518 100644
--- a/arch/mips/au1000/db1x00/board_setup.c
+++ b/arch/mips/au1000/db1x00/board_setup.c
@@ -46,7 +46,7 @@
46 46
47static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; 47static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
48 48
49void board_reset (void) 49void board_reset(void)
50{ 50{
51 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ 51 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
52 bcsr->swreset = 0x0000; 52 bcsr->swreset = 0x0000;
diff --git a/arch/mips/au1000/db1x00/init.c b/arch/mips/au1000/db1x00/init.c
index 0a3f025eb023..4d7bcfc8cf73 100644
--- a/arch/mips/au1000/db1x00/init.c
+++ b/arch/mips/au1000/db1x00/init.c
@@ -59,14 +59,12 @@ void __init prom_init(void)
59 prom_argv = (char **) fw_arg1; 59 prom_argv = (char **) fw_arg1;
60 prom_envp = (char **) fw_arg2; 60 prom_envp = (char **) fw_arg2;
61 61
62 mips_machgroup = MACH_GROUP_ALCHEMY;
63
64 /* Set the platform # */ 62 /* Set the platform # */
65#if defined (CONFIG_MIPS_DB1550) 63#if defined(CONFIG_MIPS_DB1550)
66 mips_machtype = MACH_DB1550; 64 mips_machtype = MACH_DB1550;
67#elif defined (CONFIG_MIPS_DB1500) 65#elif defined(CONFIG_MIPS_DB1500)
68 mips_machtype = MACH_DB1500; 66 mips_machtype = MACH_DB1500;
69#elif defined (CONFIG_MIPS_DB1100) 67#elif defined(CONFIG_MIPS_DB1100)
70 mips_machtype = MACH_DB1100; 68 mips_machtype = MACH_DB1100;
71#else 69#else
72 mips_machtype = MACH_DB1000; 70 mips_machtype = MACH_DB1000;
diff --git a/arch/mips/au1000/mtx-1/board_setup.c b/arch/mips/au1000/mtx-1/board_setup.c
index 7bc5af8917da..abfc4bcddf7a 100644
--- a/arch/mips/au1000/mtx-1/board_setup.c
+++ b/arch/mips/au1000/mtx-1/board_setup.c
@@ -46,7 +46,7 @@
46extern int (*board_pci_idsel)(unsigned int devsel, int assert); 46extern int (*board_pci_idsel)(unsigned int devsel, int assert);
47int mtx1_pci_idsel(unsigned int devsel, int assert); 47int mtx1_pci_idsel(unsigned int devsel, int assert);
48 48
49void board_reset (void) 49void board_reset(void)
50{ 50{
51 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ 51 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
52 au_writel(0x00000000, 0xAE00001C); 52 au_writel(0x00000000, 0xAE00001C);
@@ -54,11 +54,11 @@ void board_reset (void)
54 54
55void __init board_setup(void) 55void __init board_setup(void)
56{ 56{
57#ifdef CONFIG_USB_OHCI 57#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
58 // enable USB power switch 58 // enable USB power switch
59 au_writel( au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR ); 59 au_writel( au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR );
60 au_writel( 0x100000, GPIO2_OUTPUT ); 60 au_writel( 0x100000, GPIO2_OUTPUT );
61#endif // defined (CONFIG_USB_OHCI) 61#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */
62 62
63#ifdef CONFIG_PCI 63#ifdef CONFIG_PCI
64#if defined(__MIPSEB__) 64#if defined(__MIPSEB__)
diff --git a/arch/mips/au1000/mtx-1/init.c b/arch/mips/au1000/mtx-1/init.c
index 88f2b6d97281..2aa7b2ed6a8c 100644
--- a/arch/mips/au1000/mtx-1/init.c
+++ b/arch/mips/au1000/mtx-1/init.c
@@ -56,7 +56,6 @@ void __init prom_init(void)
56 prom_argv = (char **) fw_arg1; 56 prom_argv = (char **) fw_arg1;
57 prom_envp = (char **) fw_arg2; 57 prom_envp = (char **) fw_arg2;
58 58
59 mips_machgroup = MACH_GROUP_ALCHEMY;
60 mips_machtype = MACH_MTX1; /* set the platform # */ 59 mips_machtype = MACH_MTX1; /* set the platform # */
61 60
62 prom_init_cmdline(); 61 prom_init_cmdline();
diff --git a/arch/mips/au1000/pb1000/board_setup.c b/arch/mips/au1000/pb1000/board_setup.c
index 824cfafaff92..5198c4f98b43 100644
--- a/arch/mips/au1000/pb1000/board_setup.c
+++ b/arch/mips/au1000/pb1000/board_setup.c
@@ -39,7 +39,7 @@
39#include <asm/mach-au1x00/au1000.h> 39#include <asm/mach-au1x00/au1000.h>
40#include <asm/mach-pb1x00/pb1000.h> 40#include <asm/mach-pb1x00/pb1000.h>
41 41
42void board_reset (void) 42void board_reset(void)
43{ 43{
44} 44}
45 45
@@ -54,7 +54,7 @@ void __init board_setup(void)
54 au_writel(0, SYS_PINSTATERD); 54 au_writel(0, SYS_PINSTATERD);
55 udelay(100); 55 udelay(100);
56 56
57#ifdef CONFIG_USB_OHCI 57#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
58 /* zero and disable FREQ2 */ 58 /* zero and disable FREQ2 */
59 sys_freqctrl = au_readl(SYS_FREQCTRL0); 59 sys_freqctrl = au_readl(SYS_FREQCTRL0);
60 sys_freqctrl &= ~0xFFF00000; 60 sys_freqctrl &= ~0xFFF00000;
@@ -102,7 +102,7 @@ void __init board_setup(void)
102 /* 102 /*
103 * Route 48MHz FREQ2 into USB Host and/or Device 103 * Route 48MHz FREQ2 into USB Host and/or Device
104 */ 104 */
105#ifdef CONFIG_USB_OHCI 105#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
106 sys_clksrc |= ((4<<12) | (0<<11) | (0<<10)); 106 sys_clksrc |= ((4<<12) | (0<<11) | (0<<10));
107#endif 107#endif
108 au_writel(sys_clksrc, SYS_CLKSRC); 108 au_writel(sys_clksrc, SYS_CLKSRC);
@@ -116,7 +116,7 @@ void __init board_setup(void)
116 au_writel(pin_func, SYS_PINFUNC); 116 au_writel(pin_func, SYS_PINFUNC);
117 au_writel(0x2800, SYS_TRIOUTCLR); 117 au_writel(0x2800, SYS_TRIOUTCLR);
118 au_writel(0x0030, SYS_OUTPUTCLR); 118 au_writel(0x0030, SYS_OUTPUTCLR);
119#endif // defined (CONFIG_USB_OHCI) 119#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */
120 120
121 // make gpio 15 an input (for interrupt line) 121 // make gpio 15 an input (for interrupt line)
122 pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x100); 122 pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x100);
diff --git a/arch/mips/au1000/pb1000/init.c b/arch/mips/au1000/pb1000/init.c
index e9fa1bab81f3..4535f7208e18 100644
--- a/arch/mips/au1000/pb1000/init.c
+++ b/arch/mips/au1000/pb1000/init.c
@@ -54,7 +54,6 @@ void __init prom_init(void)
54 prom_argv = (char **) fw_arg1; 54 prom_argv = (char **) fw_arg1;
55 prom_envp = (char **) fw_arg2; 55 prom_envp = (char **) fw_arg2;
56 56
57 mips_machgroup = MACH_GROUP_ALCHEMY;
58 mips_machtype = MACH_PB1000; 57 mips_machtype = MACH_PB1000;
59 58
60 prom_init_cmdline(); 59 prom_init_cmdline();
diff --git a/arch/mips/au1000/pb1100/board_setup.c b/arch/mips/au1000/pb1100/board_setup.c
index 6bc1f8e1b608..42874a6b31d1 100644
--- a/arch/mips/au1000/pb1100/board_setup.c
+++ b/arch/mips/au1000/pb1100/board_setup.c
@@ -39,7 +39,7 @@
39#include <asm/mach-au1x00/au1000.h> 39#include <asm/mach-au1x00/au1000.h>
40#include <asm/mach-pb1x00/pb1100.h> 40#include <asm/mach-pb1x00/pb1100.h>
41 41
42void board_reset (void) 42void board_reset(void)
43{ 43{
44 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ 44 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
45 au_writel(0x00000000, 0xAE00001C); 45 au_writel(0x00000000, 0xAE00001C);
@@ -54,7 +54,7 @@ void __init board_setup(void)
54 au_writel(0, SYS_PININPUTEN); 54 au_writel(0, SYS_PININPUTEN);
55 udelay(100); 55 udelay(100);
56 56
57#ifdef CONFIG_USB_OHCI 57#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
58 { 58 {
59 u32 pin_func, sys_freqctrl, sys_clksrc; 59 u32 pin_func, sys_freqctrl, sys_clksrc;
60 60
@@ -98,7 +98,7 @@ void __init board_setup(void)
98 pin_func |= 0x8000; 98 pin_func |= 0x8000;
99 au_writel(pin_func, SYS_PINFUNC); 99 au_writel(pin_func, SYS_PINFUNC);
100 } 100 }
101#endif // defined (CONFIG_USB_OHCI) 101#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */
102 102
103 /* Enable sys bus clock divider when IDLE state or no bus activity. */ 103 /* Enable sys bus clock divider when IDLE state or no bus activity. */
104 au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL); 104 au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
diff --git a/arch/mips/au1000/pb1100/init.c b/arch/mips/au1000/pb1100/init.c
index 6131b56f41b5..7ba6852de7cd 100644
--- a/arch/mips/au1000/pb1100/init.c
+++ b/arch/mips/au1000/pb1100/init.c
@@ -55,7 +55,6 @@ void __init prom_init(void)
55 prom_argv = (char **) fw_arg1; 55 prom_argv = (char **) fw_arg1;
56 prom_envp = (char **) fw_arg3; 56 prom_envp = (char **) fw_arg3;
57 57
58 mips_machgroup = MACH_GROUP_ALCHEMY;
59 mips_machtype = MACH_PB1100; 58 mips_machtype = MACH_PB1100;
60 59
61 prom_init_cmdline(); 60 prom_init_cmdline();
diff --git a/arch/mips/au1000/pb1200/board_setup.c b/arch/mips/au1000/pb1200/board_setup.c
index eea2092bde8d..2122515f79d7 100644
--- a/arch/mips/au1000/pb1200/board_setup.c
+++ b/arch/mips/au1000/pb1200/board_setup.c
@@ -57,7 +57,7 @@
57extern void _board_init_irq(void); 57extern void _board_init_irq(void);
58extern void (*board_init_irq)(void); 58extern void (*board_init_irq)(void);
59 59
60void board_reset (void) 60void board_reset(void)
61{ 61{
62 bcsr->resets = 0; 62 bcsr->resets = 0;
63 bcsr->system = 0; 63 bcsr->system = 0;
@@ -148,7 +148,7 @@ void __init board_setup(void)
148} 148}
149 149
150int 150int
151board_au1200fb_panel (void) 151board_au1200fb_panel(void)
152{ 152{
153 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR; 153 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
154 int p; 154 int p;
@@ -160,7 +160,7 @@ board_au1200fb_panel (void)
160} 160}
161 161
162int 162int
163board_au1200fb_panel_init (void) 163board_au1200fb_panel_init(void)
164{ 164{
165 /* Apply power */ 165 /* Apply power */
166 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR; 166 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
@@ -170,7 +170,7 @@ board_au1200fb_panel_init (void)
170} 170}
171 171
172int 172int
173board_au1200fb_panel_shutdown (void) 173board_au1200fb_panel_shutdown(void)
174{ 174{
175 /* Remove power */ 175 /* Remove power */
176 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR; 176 BCSR *bcsr = (BCSR *)BCSR_KSEG1_ADDR;
diff --git a/arch/mips/au1000/pb1200/init.c b/arch/mips/au1000/pb1200/init.c
index 27f09e374e15..5a70029d5388 100644
--- a/arch/mips/au1000/pb1200/init.c
+++ b/arch/mips/au1000/pb1200/init.c
@@ -55,7 +55,6 @@ void __init prom_init(void)
55 prom_argv = (char **) fw_arg1; 55 prom_argv = (char **) fw_arg1;
56 prom_envp = (char **) fw_arg2; 56 prom_envp = (char **) fw_arg2;
57 57
58 mips_machgroup = MACH_GROUP_ALCHEMY;
59 mips_machtype = MACH_PB1200; 58 mips_machtype = MACH_PB1200;
60 59
61 prom_init_cmdline(); 60 prom_init_cmdline();
diff --git a/arch/mips/au1000/pb1200/irqmap.c b/arch/mips/au1000/pb1200/irqmap.c
index b73b2d18bf56..7c708db04a88 100644
--- a/arch/mips/au1000/pb1200/irqmap.c
+++ b/arch/mips/au1000/pb1200/irqmap.c
@@ -132,7 +132,7 @@ static void pb1200_shutdown_irq( unsigned int irq_nr )
132 pb1200_disable_irq(irq_nr); 132 pb1200_disable_irq(irq_nr);
133 if (--pb1200_cascade_en == 0) 133 if (--pb1200_cascade_en == 0)
134 { 134 {
135 free_irq(AU1000_GPIO_7,&pb1200_cascade_handler ); 135 free_irq(AU1000_GPIO_7, &pb1200_cascade_handler );
136 } 136 }
137 return; 137 return;
138} 138}
diff --git a/arch/mips/au1000/pb1500/board_setup.c b/arch/mips/au1000/pb1500/board_setup.c
index c9b655616fb3..5446836869d6 100644
--- a/arch/mips/au1000/pb1500/board_setup.c
+++ b/arch/mips/au1000/pb1500/board_setup.c
@@ -39,7 +39,7 @@
39#include <asm/mach-au1x00/au1000.h> 39#include <asm/mach-au1x00/au1000.h>
40#include <asm/mach-pb1x00/pb1500.h> 40#include <asm/mach-pb1x00/pb1500.h>
41 41
42void board_reset (void) 42void board_reset(void)
43{ 43{
44 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ 44 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
45 au_writel(0x00000000, 0xAE00001C); 45 au_writel(0x00000000, 0xAE00001C);
@@ -56,7 +56,7 @@ void __init board_setup(void)
56 au_writel(0, SYS_PINSTATERD); 56 au_writel(0, SYS_PINSTATERD);
57 udelay(100); 57 udelay(100);
58 58
59#ifdef CONFIG_USB_OHCI 59#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
60 60
61 /* GPIO201 is input for PCMCIA card detect */ 61 /* GPIO201 is input for PCMCIA card detect */
62 /* GPIO203 is input for PCMCIA interrupt request */ 62 /* GPIO203 is input for PCMCIA interrupt request */
@@ -85,7 +85,7 @@ void __init board_setup(void)
85 /* 85 /*
86 * Route 48MHz FREQ2 into USB Host and/or Device 86 * Route 48MHz FREQ2 into USB Host and/or Device
87 */ 87 */
88#ifdef CONFIG_USB_OHCI 88#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
89 sys_clksrc |= ((4<<12) | (0<<11) | (0<<10)); 89 sys_clksrc |= ((4<<12) | (0<<11) | (0<<10));
90#endif 90#endif
91 au_writel(sys_clksrc, SYS_CLKSRC); 91 au_writel(sys_clksrc, SYS_CLKSRC);
@@ -95,7 +95,7 @@ void __init board_setup(void)
95 // 2nd USB port is USB host 95 // 2nd USB port is USB host
96 pin_func |= 0x8000; 96 pin_func |= 0x8000;
97 au_writel(pin_func, SYS_PINFUNC); 97 au_writel(pin_func, SYS_PINFUNC);
98#endif // defined (CONFIG_USB_OHCI) 98#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */
99 99
100 100
101 101
diff --git a/arch/mips/au1000/pb1500/init.c b/arch/mips/au1000/pb1500/init.c
index 733d2e469db2..e58a9d6c5021 100644
--- a/arch/mips/au1000/pb1500/init.c
+++ b/arch/mips/au1000/pb1500/init.c
@@ -55,7 +55,6 @@ void __init prom_init(void)
55 prom_argv = (char **) fw_arg1; 55 prom_argv = (char **) fw_arg1;
56 prom_envp = (char **) fw_arg2; 56 prom_envp = (char **) fw_arg2;
57 57
58 mips_machgroup = MACH_GROUP_ALCHEMY;
59 mips_machtype = MACH_PB1500; 58 mips_machtype = MACH_PB1500;
60 59
61 prom_init_cmdline(); 60 prom_init_cmdline();
diff --git a/arch/mips/au1000/pb1550/board_setup.c b/arch/mips/au1000/pb1550/board_setup.c
index 05fd27dc24e6..e3cfb0d73180 100644
--- a/arch/mips/au1000/pb1550/board_setup.c
+++ b/arch/mips/au1000/pb1550/board_setup.c
@@ -44,7 +44,7 @@
44#include <asm/mach-au1x00/au1000.h> 44#include <asm/mach-au1x00/au1000.h>
45#include <asm/mach-pb1x00/pb1550.h> 45#include <asm/mach-pb1x00/pb1550.h>
46 46
47void board_reset (void) 47void board_reset(void)
48{ 48{
49 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ 49 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
50 au_writew(au_readw(0xAF00001C) & ~(1<<15), 0xAF00001C); 50 au_writew(au_readw(0xAF00001C) & ~(1<<15), 0xAF00001C);
diff --git a/arch/mips/au1000/pb1550/init.c b/arch/mips/au1000/pb1550/init.c
index 41daa3371be3..fad53bf5aad1 100644
--- a/arch/mips/au1000/pb1550/init.c
+++ b/arch/mips/au1000/pb1550/init.c
@@ -55,7 +55,6 @@ void __init prom_init(void)
55 prom_argv = (char **) fw_arg1; 55 prom_argv = (char **) fw_arg1;
56 prom_envp = (char **) fw_arg2; 56 prom_envp = (char **) fw_arg2;
57 57
58 mips_machgroup = MACH_GROUP_ALCHEMY;
59 mips_machtype = MACH_PB1550; 58 mips_machtype = MACH_PB1550;
60 59
61 prom_init_cmdline(); 60 prom_init_cmdline();
diff --git a/arch/mips/au1000/xxs1500/board_setup.c b/arch/mips/au1000/xxs1500/board_setup.c
index ae3d6b19e94d..a9237f41933d 100644
--- a/arch/mips/au1000/xxs1500/board_setup.c
+++ b/arch/mips/au1000/xxs1500/board_setup.c
@@ -39,7 +39,7 @@
39#include <asm/pgtable.h> 39#include <asm/pgtable.h>
40#include <asm/au1000.h> 40#include <asm/au1000.h>
41 41
42void board_reset (void) 42void board_reset(void)
43{ 43{
44 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ 44 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
45 au_writel(0x00000000, 0xAE00001C); 45 au_writel(0x00000000, 0xAE00001C);
diff --git a/arch/mips/au1000/xxs1500/init.c b/arch/mips/au1000/xxs1500/init.c
index f1c76533b6fc..9f839c36f69e 100644
--- a/arch/mips/au1000/xxs1500/init.c
+++ b/arch/mips/au1000/xxs1500/init.c
@@ -54,7 +54,6 @@ void __init prom_init(void)
54 prom_argv = (char **) fw_arg1; 54 prom_argv = (char **) fw_arg1;
55 prom_envp = (char **) fw_arg2; 55 prom_envp = (char **) fw_arg2;
56 56
57 mips_machgroup = MACH_GROUP_ALCHEMY;
58 mips_machtype = MACH_XXS1500; /* set the platform # */ 57 mips_machtype = MACH_XXS1500; /* set the platform # */
59 58
60 prom_init_cmdline(); 59 prom_init_cmdline();
diff --git a/arch/mips/basler/excite/excite_prom.c b/arch/mips/basler/excite/excite_prom.c
index 6ecd512b999d..2d752c2f6e59 100644
--- a/arch/mips/basler/excite/excite_prom.c
+++ b/arch/mips/basler/excite/excite_prom.c
@@ -136,7 +136,6 @@ void __init prom_init(void)
136# error 64 bit support not implemented 136# error 64 bit support not implemented
137#endif /* CONFIG_64BIT */ 137#endif /* CONFIG_64BIT */
138 138
139 mips_machgroup = MACH_GROUP_TITAN;
140 mips_machtype = MACH_TITAN_EXCITE; 139 mips_machtype = MACH_TITAN_EXCITE;
141} 140}
142 141
diff --git a/arch/mips/basler/excite/excite_setup.c b/arch/mips/basler/excite/excite_setup.c
index 56003188f17c..404ca9284b30 100644
--- a/arch/mips/basler/excite/excite_setup.c
+++ b/arch/mips/basler/excite/excite_setup.c
@@ -68,7 +68,7 @@ DEFINE_SPINLOCK(titan_lock);
68int titan_irqflags; 68int titan_irqflags;
69 69
70 70
71static void excite_timer_init(void) 71void __init plat_time_init(void)
72{ 72{
73 const u32 modebit5 = ocd_readl(0x00e4); 73 const u32 modebit5 = ocd_readl(0x00e4);
74 unsigned int 74 unsigned int
@@ -216,7 +216,7 @@ static int __init excite_platform_init(void)
216 titan_writel(0x80021dff, GXCFG); /* XDMA reset */ 216 titan_writel(0x80021dff, GXCFG); /* XDMA reset */
217 titan_writel(0x00000000, CPXCISRA); 217 titan_writel(0x00000000, CPXCISRA);
218 titan_writel(0x00000000, CPXCISRB); /* clear pending interrupts */ 218 titan_writel(0x00000000, CPXCISRB); /* clear pending interrupts */
219#if defined (CONFIG_HIGHMEM) 219#if defined(CONFIG_HIGHMEM)
220# error change for HIGHMEM support! 220# error change for HIGHMEM support!
221#else 221#else
222 titan_writel(0x00000000, GXDMADRPFX); /* buffer address prefix */ 222 titan_writel(0x00000000, GXDMADRPFX); /* buffer address prefix */
@@ -261,16 +261,13 @@ void __init plat_mem_setup(void)
261 /* Announce RAM to system */ 261 /* Announce RAM to system */
262 add_memory_region(0x00000000, memsize, BOOT_MEM_RAM); 262 add_memory_region(0x00000000, memsize, BOOT_MEM_RAM);
263 263
264 /* Set up timer initialization hooks */
265 board_time_init = excite_timer_init;
266
267 /* Set up the peripheral address map */ 264 /* Set up the peripheral address map */
268 *(boot_ocd_base + (LKB9 / sizeof (u32))) = 0; 265 *(boot_ocd_base + (LKB9 / sizeof(u32))) = 0;
269 *(boot_ocd_base + (LKB10 / sizeof (u32))) = 0; 266 *(boot_ocd_base + (LKB10 / sizeof(u32))) = 0;
270 *(boot_ocd_base + (LKB11 / sizeof (u32))) = 0; 267 *(boot_ocd_base + (LKB11 / sizeof(u32))) = 0;
271 *(boot_ocd_base + (LKB12 / sizeof (u32))) = 0; 268 *(boot_ocd_base + (LKB12 / sizeof(u32))) = 0;
272 wmb(); 269 wmb();
273 *(boot_ocd_base + (LKB0 / sizeof (u32))) = EXCITE_PHYS_OCD >> 4; 270 *(boot_ocd_base + (LKB0 / sizeof(u32))) = EXCITE_PHYS_OCD >> 4;
274 wmb(); 271 wmb();
275 272
276 ocd_writel((EXCITE_PHYS_TITAN >> 4) | 0x1UL, LKB5); 273 ocd_writel((EXCITE_PHYS_TITAN >> 4) | 0x1UL, LKB5);
diff --git a/arch/mips/bcm47xx/Makefile b/arch/mips/bcm47xx/Makefile
new file mode 100644
index 000000000000..35294b12d638
--- /dev/null
+++ b/arch/mips/bcm47xx/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for the BCM47XX specific kernel interface routines
3# under Linux.
4#
5
6obj-y := gpio.o irq.o prom.o serial.o setup.o time.o wgt634u.o
diff --git a/arch/mips/bcm47xx/gpio.c b/arch/mips/bcm47xx/gpio.c
new file mode 100644
index 000000000000..f5a53acf995a
--- /dev/null
+++ b/arch/mips/bcm47xx/gpio.c
@@ -0,0 +1,79 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net>
7 */
8
9#include <linux/ssb/ssb.h>
10#include <linux/ssb/ssb_driver_chipcommon.h>
11#include <linux/ssb/ssb_driver_extif.h>
12#include <asm/mach-bcm47xx/bcm47xx.h>
13#include <asm/mach-bcm47xx/gpio.h>
14
15int bcm47xx_gpio_to_irq(unsigned gpio)
16{
17 if (ssb_bcm47xx.chipco.dev)
18 return ssb_mips_irq(ssb_bcm47xx.chipco.dev) + 2;
19 else if (ssb_bcm47xx.extif.dev)
20 return ssb_mips_irq(ssb_bcm47xx.extif.dev) + 2;
21 else
22 return -EINVAL;
23}
24EXPORT_SYMBOL_GPL(bcm47xx_gpio_to_irq);
25
26int bcm47xx_gpio_get_value(unsigned gpio)
27{
28 if (ssb_bcm47xx.chipco.dev)
29 return ssb_chipco_gpio_in(&ssb_bcm47xx.chipco, 1 << gpio);
30 else if (ssb_bcm47xx.extif.dev)
31 return ssb_extif_gpio_in(&ssb_bcm47xx.extif, 1 << gpio);
32 else
33 return 0;
34}
35EXPORT_SYMBOL_GPL(bcm47xx_gpio_get_value);
36
37void bcm47xx_gpio_set_value(unsigned gpio, int value)
38{
39 if (ssb_bcm47xx.chipco.dev)
40 ssb_chipco_gpio_out(&ssb_bcm47xx.chipco,
41 1 << gpio,
42 value ? 1 << gpio : 0);
43 else if (ssb_bcm47xx.extif.dev)
44 ssb_extif_gpio_out(&ssb_bcm47xx.extif,
45 1 << gpio,
46 value ? 1 << gpio : 0);
47}
48EXPORT_SYMBOL_GPL(bcm47xx_gpio_set_value);
49
50int bcm47xx_gpio_direction_input(unsigned gpio)
51{
52 if (ssb_bcm47xx.chipco.dev && (gpio < BCM47XX_CHIPCO_GPIO_LINES))
53 ssb_chipco_gpio_outen(&ssb_bcm47xx.chipco,
54 1 << gpio, 0);
55 else if (ssb_bcm47xx.extif.dev && (gpio < BCM47XX_EXTIF_GPIO_LINES))
56 ssb_extif_gpio_outen(&ssb_bcm47xx.extif,
57 1 << gpio, 0);
58 else
59 return -EINVAL;
60 return 0;
61}
62EXPORT_SYMBOL_GPL(bcm47xx_gpio_direction_input);
63
64int bcm47xx_gpio_direction_output(unsigned gpio, int value)
65{
66 bcm47xx_gpio_set_value(gpio, value);
67
68 if (ssb_bcm47xx.chipco.dev && (gpio < BCM47XX_CHIPCO_GPIO_LINES))
69 ssb_chipco_gpio_outen(&ssb_bcm47xx.chipco,
70 1 << gpio, 1 << gpio);
71 else if (ssb_bcm47xx.extif.dev && (gpio < BCM47XX_EXTIF_GPIO_LINES))
72 ssb_extif_gpio_outen(&ssb_bcm47xx.extif,
73 1 << gpio, 1 << gpio);
74 else
75 return -EINVAL;
76 return 0;
77}
78EXPORT_SYMBOL_GPL(bcm47xx_gpio_direction_output);
79
diff --git a/arch/mips/bcm47xx/irq.c b/arch/mips/bcm47xx/irq.c
new file mode 100644
index 000000000000..325757acd020
--- /dev/null
+++ b/arch/mips/bcm47xx/irq.c
@@ -0,0 +1,55 @@
1/*
2 * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
12 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
13 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
14 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
15 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
16 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
18 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25#include <linux/types.h>
26#include <linux/interrupt.h>
27#include <linux/irq.h>
28#include <asm/irq_cpu.h>
29
30void plat_irq_dispatch(void)
31{
32 u32 cause;
33
34 cause = read_c0_cause() & read_c0_status() & CAUSEF_IP;
35
36 clear_c0_status(cause);
37
38 if (cause & CAUSEF_IP7)
39 do_IRQ(7);
40 if (cause & CAUSEF_IP2)
41 do_IRQ(2);
42 if (cause & CAUSEF_IP3)
43 do_IRQ(3);
44 if (cause & CAUSEF_IP4)
45 do_IRQ(4);
46 if (cause & CAUSEF_IP5)
47 do_IRQ(5);
48 if (cause & CAUSEF_IP6)
49 do_IRQ(6);
50}
51
52void __init arch_init_irq(void)
53{
54 mips_cpu_irq_init();
55}
diff --git a/arch/mips/bcm47xx/prom.c b/arch/mips/bcm47xx/prom.c
new file mode 100644
index 000000000000..079e33d52783
--- /dev/null
+++ b/arch/mips/bcm47xx/prom.c
@@ -0,0 +1,158 @@
1/*
2 * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org>
3 * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
11 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
13 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
14 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
15 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
16 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
17 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
18 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
19 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#include <linux/init.h>
27#include <linux/types.h>
28#include <linux/kernel.h>
29#include <linux/spinlock.h>
30#include <asm/bootinfo.h>
31#include <asm/fw/cfe/cfe_api.h>
32#include <asm/fw/cfe/cfe_error.h>
33
34static int cfe_cons_handle;
35
36const char *get_system_type(void)
37{
38 return "Broadcom BCM47XX";
39}
40
41void prom_putchar(char c)
42{
43 while (cfe_write(cfe_cons_handle, &c, 1) == 0)
44 ;
45}
46
47static __init void prom_init_cfe(void)
48{
49 uint32_t cfe_ept;
50 uint32_t cfe_handle;
51 uint32_t cfe_eptseal;
52 int argc = fw_arg0;
53 char **envp = (char **) fw_arg2;
54 int *prom_vec = (int *) fw_arg3;
55
56 /*
57 * Check if a loader was used; if NOT, the 4 arguments are
58 * what CFE gives us (handle, 0, EPT and EPTSEAL)
59 */
60 if (argc < 0) {
61 cfe_handle = (uint32_t)argc;
62 cfe_ept = (uint32_t)envp;
63 cfe_eptseal = (uint32_t)prom_vec;
64 } else {
65 if ((int)prom_vec < 0) {
66 /*
67 * Old loader; all it gives us is the handle,
68 * so use the "known" entrypoint and assume
69 * the seal.
70 */
71 cfe_handle = (uint32_t)prom_vec;
72 cfe_ept = 0xBFC00500;
73 cfe_eptseal = CFE_EPTSEAL;
74 } else {
75 /*
76 * Newer loaders bundle the handle/ept/eptseal
77 * Note: prom_vec is in the loader's useg
78 * which is still alive in the TLB.
79 */
80 cfe_handle = prom_vec[0];
81 cfe_ept = prom_vec[2];
82 cfe_eptseal = prom_vec[3];
83 }
84 }
85
86 if (cfe_eptseal != CFE_EPTSEAL) {
87 /* too early for panic to do any good */
88 printk(KERN_ERR "CFE's entrypoint seal doesn't match.");
89 while (1) ;
90 }
91
92 cfe_init(cfe_handle, cfe_ept);
93}
94
95static __init void prom_init_console(void)
96{
97 /* Initialize CFE console */
98 cfe_cons_handle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
99}
100
101static __init void prom_init_cmdline(void)
102{
103 char buf[CL_SIZE];
104
105 /* Get the kernel command line from CFE */
106 if (cfe_getenv("LINUX_CMDLINE", buf, CL_SIZE) >= 0) {
107 buf[CL_SIZE-1] = 0;
108 strcpy(arcs_cmdline, buf);
109 }
110
111 /* Force a console handover by adding a console= argument if needed,
112 * as CFE is not available anymore later in the boot process. */
113 if ((strstr(arcs_cmdline, "console=")) == NULL) {
114 /* Try to read the default serial port used by CFE */
115 if ((cfe_getenv("BOOT_CONSOLE", buf, CL_SIZE) < 0)
116 || (strncmp("uart", buf, 4)))
117 /* Default to uart0 */
118 strcpy(buf, "uart0");
119
120 /* Compute the new command line */
121 snprintf(arcs_cmdline, CL_SIZE, "%s console=ttyS%c,115200",
122 arcs_cmdline, buf[4]);
123 }
124}
125
126static __init void prom_init_mem(void)
127{
128 unsigned long mem;
129
130 /* Figure out memory size by finding aliases.
131 *
132 * We should theoretically use the mapping from CFE using cfe_enummem().
133 * However as the BCM47XX is mostly used on low-memory systems, we
134 * want to reuse the memory used by CFE (around 4MB). That means cfe_*
135 * functions stop to work at some point during the boot, we should only
136 * call them at the beginning of the boot.
137 */
138 for (mem = (1 << 20); mem < (128 << 20); mem += (1 << 20)) {
139 if (*(unsigned long *)((unsigned long)(prom_init) + mem) ==
140 *(unsigned long *)(prom_init))
141 break;
142 }
143
144 add_memory_region(0, mem, BOOT_MEM_RAM);
145}
146
147void __init prom_init(void)
148{
149 prom_init_cfe();
150 prom_init_console();
151 prom_init_cmdline();
152 prom_init_mem();
153}
154
155void __init prom_free_prom_memory(void)
156{
157}
158
diff --git a/arch/mips/bcm47xx/serial.c b/arch/mips/bcm47xx/serial.c
new file mode 100644
index 000000000000..59c11afdb2ab
--- /dev/null
+++ b/arch/mips/bcm47xx/serial.c
@@ -0,0 +1,52 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net>
7 */
8
9#include <linux/module.h>
10#include <linux/init.h>
11#include <linux/serial.h>
12#include <linux/serial_8250.h>
13#include <linux/ssb/ssb.h>
14#include <bcm47xx.h>
15
16static struct plat_serial8250_port uart8250_data[5];
17
18static struct platform_device uart8250_device = {
19 .name = "serial8250",
20 .id = PLAT8250_DEV_PLATFORM,
21 .dev = {
22 .platform_data = uart8250_data,
23 },
24};
25
26static int __init uart8250_init(void)
27{
28 int i;
29 struct ssb_mipscore *mcore = &(ssb_bcm47xx.mipscore);
30
31 memset(&uart8250_data, 0, sizeof(uart8250_data));
32
33 for (i = 0; i < mcore->nr_serial_ports; i++) {
34 struct plat_serial8250_port *p = &(uart8250_data[i]);
35 struct ssb_serial_port *ssb_port = &(mcore->serial_ports[i]);
36
37 p->mapbase = (unsigned int) ssb_port->regs;
38 p->membase = (void *) ssb_port->regs;
39 p->irq = ssb_port->irq + 2;
40 p->uartclk = ssb_port->baud_base;
41 p->regshift = ssb_port->reg_shift;
42 p->iotype = UPIO_MEM;
43 p->flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
44 }
45 return platform_device_register(&uart8250_device);
46}
47
48module_init(uart8250_init);
49
50MODULE_AUTHOR("Aurelien Jarno <aurelien@aurel32.net>");
51MODULE_LICENSE("GPL");
52MODULE_DESCRIPTION("8250 UART probe driver for the BCM47XX platforms");
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c
new file mode 100644
index 000000000000..1b6b0fa5028f
--- /dev/null
+++ b/arch/mips/bcm47xx/setup.c
@@ -0,0 +1,123 @@
1/*
2 * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org>
3 * Copyright (C) 2005 Waldemar Brodkorb <wbx@openwrt.org>
4 * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org>
5 * Copyright (C) 2006 Michael Buesch <mb@bu3sch.de>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
15 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
18 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
20 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */
27
28#include <linux/types.h>
29#include <linux/ssb/ssb.h>
30#include <asm/bootinfo.h>
31#include <asm/reboot.h>
32#include <asm/time.h>
33#include <bcm47xx.h>
34#include <asm/fw/cfe/cfe_api.h>
35
36struct ssb_bus ssb_bcm47xx;
37EXPORT_SYMBOL(ssb_bcm47xx);
38
39static void bcm47xx_machine_restart(char *command)
40{
41 printk(KERN_ALERT "Please stand by while rebooting the system...\n");
42 local_irq_disable();
43 /* Set the watchdog timer to reset immediately */
44 ssb_chipco_watchdog_timer_set(&ssb_bcm47xx.chipco, 1);
45 while (1)
46 cpu_relax();
47}
48
49static void bcm47xx_machine_halt(void)
50{
51 /* Disable interrupts and watchdog and spin forever */
52 local_irq_disable();
53 ssb_chipco_watchdog_timer_set(&ssb_bcm47xx.chipco, 0);
54 while (1)
55 cpu_relax();
56}
57
58static void str2eaddr(char *str, char *dest)
59{
60 int i = 0;
61
62 if (str == NULL) {
63 memset(dest, 0, 6);
64 return;
65 }
66
67 for (;;) {
68 dest[i++] = (char) simple_strtoul(str, NULL, 16);
69 str += 2;
70 if (!*str++ || i == 6)
71 break;
72 }
73}
74
75static int bcm47xx_get_invariants(struct ssb_bus *bus,
76 struct ssb_init_invariants *iv)
77{
78 char buf[100];
79
80 /* Fill boardinfo structure */
81 memset(&(iv->boardinfo), 0 , sizeof(struct ssb_boardinfo));
82
83 if (cfe_getenv("boardvendor", buf, sizeof(buf)) >= 0)
84 iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
85 if (cfe_getenv("boardtype", buf, sizeof(buf)) >= 0)
86 iv->boardinfo.type = (u16)simple_strtoul(buf, NULL, 0);
87 if (cfe_getenv("boardrev", buf, sizeof(buf)) >= 0)
88 iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0);
89
90 /* Fill sprom structure */
91 memset(&(iv->sprom), 0, sizeof(struct ssb_sprom));
92 iv->sprom.revision = 3;
93
94 if (cfe_getenv("et0macaddr", buf, sizeof(buf)) >= 0)
95 str2eaddr(buf, iv->sprom.r1.et0mac);
96 if (cfe_getenv("et1macaddr", buf, sizeof(buf)) >= 0)
97 str2eaddr(buf, iv->sprom.r1.et1mac);
98 if (cfe_getenv("et0phyaddr", buf, sizeof(buf)) >= 0)
99 iv->sprom.r1.et0phyaddr = simple_strtoul(buf, NULL, 10);
100 if (cfe_getenv("et1phyaddr", buf, sizeof(buf)) >= 0)
101 iv->sprom.r1.et1phyaddr = simple_strtoul(buf, NULL, 10);
102 if (cfe_getenv("et0mdcport", buf, sizeof(buf)) >= 0)
103 iv->sprom.r1.et0mdcport = simple_strtoul(buf, NULL, 10);
104 if (cfe_getenv("et1mdcport", buf, sizeof(buf)) >= 0)
105 iv->sprom.r1.et1mdcport = simple_strtoul(buf, NULL, 10);
106
107 return 0;
108}
109
110void __init plat_mem_setup(void)
111{
112 int err;
113
114 err = ssb_bus_ssbbus_register(&ssb_bcm47xx, SSB_ENUM_BASE,
115 bcm47xx_get_invariants);
116 if (err)
117 panic("Failed to initialize SSB bus (err %d)\n", err);
118
119 _machine_restart = bcm47xx_machine_restart;
120 _machine_halt = bcm47xx_machine_halt;
121 pm_power_off = bcm47xx_machine_halt;
122}
123
diff --git a/arch/mips/bcm47xx/time.c b/arch/mips/bcm47xx/time.c
new file mode 100644
index 000000000000..0ab4676c8bd3
--- /dev/null
+++ b/arch/mips/bcm47xx/time.c
@@ -0,0 +1,55 @@
1/*
2 * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
10 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
12 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
13 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
14 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
15 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
16 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
17 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
18 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25
26#include <linux/init.h>
27#include <linux/ssb/ssb.h>
28#include <asm/time.h>
29#include <bcm47xx.h>
30
31void __init plat_time_init(void)
32{
33 unsigned long hz;
34
35 /*
36 * Use deterministic values for initial counter interrupt
37 * so that calibrate delay avoids encountering a counter wrap.
38 */
39 write_c0_count(0);
40 write_c0_compare(0xffff);
41
42 hz = ssb_cpu_clock(&ssb_bcm47xx.mipscore) / 2;
43 if (!hz)
44 hz = 100000000;
45
46 /* Set MIPS counter frequency for fixed_rate_gettimeoffset() */
47 mips_hpt_frequency = hz;
48}
49
50void __init
51plat_timer_setup(struct irqaction *irq)
52{
53 /* Enable the timer interrupt */
54 setup_irq(7, irq);
55}
diff --git a/arch/mips/bcm47xx/wgt634u.c b/arch/mips/bcm47xx/wgt634u.c
new file mode 100644
index 000000000000..5a017eaee712
--- /dev/null
+++ b/arch/mips/bcm47xx/wgt634u.c
@@ -0,0 +1,64 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2007 Aurelien Jarno <aurelien@aurel32.net>
7 */
8
9#include <linux/platform_device.h>
10#include <linux/module.h>
11#include <linux/leds.h>
12#include <linux/ssb/ssb.h>
13#include <asm/mach-bcm47xx/bcm47xx.h>
14
15/* GPIO definitions for the WGT634U */
16#define WGT634U_GPIO_LED 3
17#define WGT634U_GPIO_RESET 2
18#define WGT634U_GPIO_TP1 7
19#define WGT634U_GPIO_TP2 6
20#define WGT634U_GPIO_TP3 5
21#define WGT634U_GPIO_TP4 4
22#define WGT634U_GPIO_TP5 1
23
24static struct gpio_led wgt634u_leds[] = {
25 {
26 .name = "power",
27 .gpio = WGT634U_GPIO_LED,
28 .active_low = 1,
29 .default_trigger = "heartbeat",
30 },
31};
32
33static struct gpio_led_platform_data wgt634u_led_data = {
34 .num_leds = ARRAY_SIZE(wgt634u_leds),
35 .leds = wgt634u_leds,
36};
37
38static struct platform_device wgt634u_gpio_leds = {
39 .name = "leds-gpio",
40 .id = -1,
41 .dev = {
42 .platform_data = &wgt634u_led_data,
43 }
44};
45
46static int __init wgt634u_init(void)
47{
48 /* There is no easy way to detect that we are running on a WGT634U
49 * machine. Use the MAC address as an heuristic. Netgear Inc. has
50 * been allocated ranges 00:09:5b:xx:xx:xx and 00:0f:b5:xx:xx:xx.
51 */
52
53 u8 *et0mac = ssb_bcm47xx.sprom.r1.et0mac;
54
55 if (et0mac[0] == 0x00 &&
56 ((et0mac[1] == 0x09 && et0mac[2] == 0x5b) ||
57 (et0mac[1] == 0x0f && et0mac[2] == 0xb5)))
58 return platform_device_register(&wgt634u_gpio_leds);
59 else
60 return -ENODEV;
61}
62
63module_init(wgt634u_init);
64
diff --git a/arch/mips/boot/addinitrd.c b/arch/mips/boot/addinitrd.c
index 8b3033304770..b5b3febc10cc 100644
--- a/arch/mips/boot/addinitrd.c
+++ b/arch/mips/boot/addinitrd.c
@@ -32,15 +32,15 @@
32 32
33#define SWAB(a) (swab ? swab32(a) : (a)) 33#define SWAB(a) (swab ? swab32(a) : (a))
34 34
35void die (char *s) 35void die(char *s)
36{ 36{
37 perror (s); 37 perror(s);
38 exit (1); 38 exit(1);
39} 39}
40 40
41int main (int argc, char *argv[]) 41int main(int argc, char *argv[])
42{ 42{
43 int fd_vmlinux,fd_initrd,fd_outfile; 43 int fd_vmlinux, fd_initrd, fd_outfile;
44 FILHDR efile; 44 FILHDR efile;
45 AOUTHDR eaout; 45 AOUTHDR eaout;
46 SCNHDR esecs[3]; 46 SCNHDR esecs[3];
@@ -48,22 +48,22 @@ int main (int argc, char *argv[])
48 char buf[1024]; 48 char buf[1024];
49 unsigned long loadaddr; 49 unsigned long loadaddr;
50 unsigned long initrd_header[2]; 50 unsigned long initrd_header[2];
51 int i,cnt; 51 int i, cnt;
52 int swab = 0; 52 int swab = 0;
53 53
54 if (argc != 4) { 54 if (argc != 4) {
55 printf ("Usage: %s <vmlinux> <initrd> <outfile>\n",argv[0]); 55 printf("Usage: %s <vmlinux> <initrd> <outfile>\n", argv[0]);
56 exit (1); 56 exit(1);
57 } 57 }
58 58
59 if ((fd_vmlinux = open (argv[1],O_RDONLY)) < 0) 59 if ((fd_vmlinux = open (argv[1], O_RDONLY)) < 0)
60 die ("open vmlinux"); 60 die("open vmlinux");
61 if (read (fd_vmlinux, &efile, sizeof efile) != sizeof efile) 61 if (read (fd_vmlinux, &efile, sizeof efile) != sizeof efile)
62 die ("read file header"); 62 die("read file header");
63 if (read (fd_vmlinux, &eaout, sizeof eaout) != sizeof eaout) 63 if (read (fd_vmlinux, &eaout, sizeof eaout) != sizeof eaout)
64 die ("read aout header"); 64 die("read aout header");
65 if (read (fd_vmlinux, esecs, sizeof esecs) != sizeof esecs) 65 if (read (fd_vmlinux, esecs, sizeof esecs) != sizeof esecs)
66 die ("read section headers"); 66 die("read section headers");
67 /* 67 /*
68 * check whether the file is good for us 68 * check whether the file is good for us
69 */ 69 */
@@ -82,13 +82,13 @@ int main (int argc, char *argv[])
82 82
83 /* make sure we have an empty data segment for the initrd */ 83 /* make sure we have an empty data segment for the initrd */
84 if (eaout.dsize || esecs[1].s_size) { 84 if (eaout.dsize || esecs[1].s_size) {
85 fprintf (stderr, "Data segment not empty. Giving up!\n"); 85 fprintf(stderr, "Data segment not empty. Giving up!\n");
86 exit (1); 86 exit(1);
87 } 87 }
88 if ((fd_initrd = open (argv[2], O_RDONLY)) < 0) 88 if ((fd_initrd = open (argv[2], O_RDONLY)) < 0)
89 die ("open initrd"); 89 die("open initrd");
90 if (fstat (fd_initrd, &st) < 0) 90 if (fstat (fd_initrd, &st) < 0)
91 die ("fstat initrd"); 91 die("fstat initrd");
92 loadaddr = ((SWAB(esecs[2].s_vaddr) + SWAB(esecs[2].s_size) 92 loadaddr = ((SWAB(esecs[2].s_vaddr) + SWAB(esecs[2].s_size)
93 + MIPS_PAGE_SIZE-1) & ~MIPS_PAGE_MASK) - 8; 93 + MIPS_PAGE_SIZE-1) & ~MIPS_PAGE_MASK) - 8;
94 if (loadaddr < (SWAB(esecs[2].s_vaddr) + SWAB(esecs[2].s_size))) 94 if (loadaddr < (SWAB(esecs[2].s_vaddr) + SWAB(esecs[2].s_size)))
@@ -98,34 +98,34 @@ int main (int argc, char *argv[])
98 eaout.dsize = esecs[1].s_size = initrd_header[1] = SWAB(st.st_size+8); 98 eaout.dsize = esecs[1].s_size = initrd_header[1] = SWAB(st.st_size+8);
99 eaout.data_start = esecs[1].s_vaddr = esecs[1].s_paddr = SWAB(loadaddr); 99 eaout.data_start = esecs[1].s_vaddr = esecs[1].s_paddr = SWAB(loadaddr);
100 100
101 if ((fd_outfile = open (argv[3], O_RDWR|O_CREAT|O_TRUNC,0666)) < 0) 101 if ((fd_outfile = open (argv[3], O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0)
102 die ("open outfile"); 102 die("open outfile");
103 if (write (fd_outfile, &efile, sizeof efile) != sizeof efile) 103 if (write (fd_outfile, &efile, sizeof efile) != sizeof efile)
104 die ("write file header"); 104 die("write file header");
105 if (write (fd_outfile, &eaout, sizeof eaout) != sizeof eaout) 105 if (write (fd_outfile, &eaout, sizeof eaout) != sizeof eaout)
106 die ("write aout header"); 106 die("write aout header");
107 if (write (fd_outfile, esecs, sizeof esecs) != sizeof esecs) 107 if (write (fd_outfile, esecs, sizeof esecs) != sizeof esecs)
108 die ("write section headers"); 108 die("write section headers");
109 /* skip padding */ 109 /* skip padding */
110 if(lseek(fd_vmlinux, SWAB(esecs[0].s_scnptr), SEEK_SET) == (off_t)-1) 110 if(lseek(fd_vmlinux, SWAB(esecs[0].s_scnptr), SEEK_SET) == (off_t)-1)
111 die ("lseek vmlinux"); 111 die("lseek vmlinux");
112 if(lseek(fd_outfile, SWAB(esecs[0].s_scnptr), SEEK_SET) == (off_t)-1) 112 if(lseek(fd_outfile, SWAB(esecs[0].s_scnptr), SEEK_SET) == (off_t)-1)
113 die ("lseek outfile"); 113 die("lseek outfile");
114 /* copy text segment */ 114 /* copy text segment */
115 cnt = SWAB(eaout.tsize); 115 cnt = SWAB(eaout.tsize);
116 while (cnt) { 116 while (cnt) {
117 if ((i = read (fd_vmlinux, buf, sizeof buf)) <= 0) 117 if ((i = read (fd_vmlinux, buf, sizeof buf)) <= 0)
118 die ("read vmlinux"); 118 die("read vmlinux");
119 if (write (fd_outfile, buf, i) != i) 119 if (write (fd_outfile, buf, i) != i)
120 die ("write vmlinux"); 120 die("write vmlinux");
121 cnt -= i; 121 cnt -= i;
122 } 122 }
123 if (write (fd_outfile, initrd_header, sizeof initrd_header) != sizeof initrd_header) 123 if (write (fd_outfile, initrd_header, sizeof initrd_header) != sizeof initrd_header)
124 die ("write initrd header"); 124 die("write initrd header");
125 while ((i = read (fd_initrd, buf, sizeof buf)) > 0) 125 while ((i = read (fd_initrd, buf, sizeof buf)) > 0)
126 if (write (fd_outfile, buf, i) != i) 126 if (write (fd_outfile, buf, i) != i)
127 die ("write initrd"); 127 die("write initrd");
128 close (fd_vmlinux); 128 close(fd_vmlinux);
129 close (fd_initrd); 129 close(fd_initrd);
130 return 0; 130 return 0;
131} 131}
diff --git a/arch/mips/boot/elf2ecoff.c b/arch/mips/boot/elf2ecoff.c
index c3543d9eb266..c5a7f308c405 100644
--- a/arch/mips/boot/elf2ecoff.c
+++ b/arch/mips/boot/elf2ecoff.c
@@ -467,7 +467,7 @@ int main(int argc, char *argv[])
467 esecs[0].s_scnptr = N_TXTOFF(efh, eah); 467 esecs[0].s_scnptr = N_TXTOFF(efh, eah);
468 esecs[1].s_scnptr = N_DATOFF(efh, eah); 468 esecs[1].s_scnptr = N_DATOFF(efh, eah);
469#define ECOFF_SEGMENT_ALIGNMENT(a) 0x10 469#define ECOFF_SEGMENT_ALIGNMENT(a) 0x10
470#define ECOFF_ROUND(s,a) (((s)+(a)-1)&~((a)-1)) 470#define ECOFF_ROUND(s, a) (((s)+(a)-1)&~((a)-1))
471 esecs[2].s_scnptr = esecs[1].s_scnptr + 471 esecs[2].s_scnptr = esecs[1].s_scnptr +
472 ECOFF_ROUND(esecs[1].s_size, ECOFF_SEGMENT_ALIGNMENT(&eah)); 472 ECOFF_ROUND(esecs[1].s_size, ECOFF_SEGMENT_ALIGNMENT(&eah));
473 if (addflag) { 473 if (addflag) {
diff --git a/arch/mips/cobalt/Makefile b/arch/mips/cobalt/Makefile
index a043f93f7d08..6b83f4ddc8fc 100644
--- a/arch/mips/cobalt/Makefile
+++ b/arch/mips/cobalt/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the Cobalt micro systems family specific parts of the kernel 2# Makefile for the Cobalt micro systems family specific parts of the kernel
3# 3#
4 4
5obj-y := buttons.o irq.o reset.o rtc.o serial.o setup.o 5obj-y := buttons.o irq.o led.o reset.o rtc.o serial.o setup.o
6 6
7obj-$(CONFIG_PCI) += pci.o 7obj-$(CONFIG_PCI) += pci.o
8obj-$(CONFIG_EARLY_PRINTK) += console.o 8obj-$(CONFIG_EARLY_PRINTK) += console.o
diff --git a/arch/mips/cobalt/console.c b/arch/mips/cobalt/console.c
index 0485d51f7216..db330e811025 100644
--- a/arch/mips/cobalt/console.c
+++ b/arch/mips/cobalt/console.c
@@ -1,16 +1,15 @@
1/* 1/*
2 * (C) P. Horton 2006 2 * (C) P. Horton 2006
3 */ 3 */
4#include <linux/io.h>
4#include <linux/serial_reg.h> 5#include <linux/serial_reg.h>
5 6
6#include <asm/addrspace.h> 7#define UART_BASE ((void __iomem *)CKSEG1ADDR(0x1c800000))
7
8#include <cobalt.h>
9 8
10void prom_putchar(char c) 9void prom_putchar(char c)
11{ 10{
12 while(!(COBALT_UART[UART_LSR] & UART_LSR_THRE)) 11 while (!(readb(UART_BASE + UART_LSR) & UART_LSR_THRE))
13 ; 12 ;
14 13
15 COBALT_UART[UART_TX] = c; 14 writeb(c, UART_BASE + UART_TX);
16} 15}
diff --git a/arch/mips/cobalt/irq.c b/arch/mips/cobalt/irq.c
index 950ad1e8be44..ac4fb912649d 100644
--- a/arch/mips/cobalt/irq.c
+++ b/arch/mips/cobalt/irq.c
@@ -15,102 +15,48 @@
15 15
16#include <asm/i8259.h> 16#include <asm/i8259.h>
17#include <asm/irq_cpu.h> 17#include <asm/irq_cpu.h>
18#include <asm/irq_gt641xx.h>
18#include <asm/gt64120.h> 19#include <asm/gt64120.h>
19 20
20#include <cobalt.h> 21#include <irq.h>
21
22/*
23 * We have two types of interrupts that we handle, ones that come in through
24 * the CPU interrupt lines, and ones that come in on the via chip. The CPU
25 * mappings are:
26 *
27 * 16 - Software interrupt 0 (unused) IE_SW0
28 * 17 - Software interrupt 1 (unused) IE_SW1
29 * 18 - Galileo chip (timer) IE_IRQ0
30 * 19 - Tulip 0 + NCR SCSI IE_IRQ1
31 * 20 - Tulip 1 IE_IRQ2
32 * 21 - 16550 UART IE_IRQ3
33 * 22 - VIA southbridge PIC IE_IRQ4
34 * 23 - unused IE_IRQ5
35 *
36 * The VIA chip is a master/slave 8259 setup and has the following interrupts:
37 *
38 * 8 - RTC
39 * 9 - PCI
40 * 14 - IDE0
41 * 15 - IDE1
42 */
43
44static inline void galileo_irq(void)
45{
46 unsigned int mask, pending, devfn;
47
48 mask = GT_READ(GT_INTRMASK_OFS);
49 pending = GT_READ(GT_INTRCAUSE_OFS) & mask;
50
51 if (pending & GT_INTR_T0EXP_MSK) {
52 GT_WRITE(GT_INTRCAUSE_OFS, ~GT_INTR_T0EXP_MSK);
53 do_IRQ(COBALT_GALILEO_IRQ);
54 } else if (pending & GT_INTR_RETRYCTR0_MSK) {
55 devfn = GT_READ(GT_PCI0_CFGADDR_OFS) >> 8;
56 GT_WRITE(GT_INTRCAUSE_OFS, ~GT_INTR_RETRYCTR0_MSK);
57 printk(KERN_WARNING
58 "Galileo: PCI retry count exceeded (%02x.%u)\n",
59 PCI_SLOT(devfn), PCI_FUNC(devfn));
60 } else {
61 GT_WRITE(GT_INTRMASK_OFS, mask & ~pending);
62 printk(KERN_WARNING
63 "Galileo: masking unexpected interrupt %08x\n", pending);
64 }
65}
66
67static inline void via_pic_irq(void)
68{
69 int irq;
70
71 irq = i8259_irq();
72 if (irq >= 0)
73 do_IRQ(irq);
74}
75 22
76asmlinkage void plat_irq_dispatch(void) 23asmlinkage void plat_irq_dispatch(void)
77{ 24{
78 unsigned pending = read_c0_status() & read_c0_cause(); 25 unsigned pending = read_c0_status() & read_c0_cause() & ST0_IM;
26 int irq;
79 27
80 if (pending & CAUSEF_IP2) /* COBALT_GALILEO_IRQ (18) */ 28 if (pending & CAUSEF_IP2)
81 galileo_irq(); 29 gt641xx_irq_dispatch();
82 else if (pending & CAUSEF_IP6) /* COBALT_VIA_IRQ (22) */ 30 else if (pending & CAUSEF_IP6) {
83 via_pic_irq(); 31 irq = i8259_irq();
84 else if (pending & CAUSEF_IP3) /* COBALT_ETH0_IRQ (19) */ 32 if (irq < 0)
85 do_IRQ(COBALT_CPU_IRQ + 3); 33 spurious_interrupt();
86 else if (pending & CAUSEF_IP4) /* COBALT_ETH1_IRQ (20) */ 34 else
87 do_IRQ(COBALT_CPU_IRQ + 4); 35 do_IRQ(irq);
88 else if (pending & CAUSEF_IP5) /* COBALT_SERIAL_IRQ (21) */ 36 } else if (pending & CAUSEF_IP3)
89 do_IRQ(COBALT_CPU_IRQ + 5); 37 do_IRQ(MIPS_CPU_IRQ_BASE + 3);
90 else if (pending & CAUSEF_IP7) /* IRQ 23 */ 38 else if (pending & CAUSEF_IP4)
91 do_IRQ(COBALT_CPU_IRQ + 7); 39 do_IRQ(MIPS_CPU_IRQ_BASE + 4);
40 else if (pending & CAUSEF_IP5)
41 do_IRQ(MIPS_CPU_IRQ_BASE + 5);
42 else if (pending & CAUSEF_IP7)
43 do_IRQ(MIPS_CPU_IRQ_BASE + 7);
44 else
45 spurious_interrupt();
92} 46}
93 47
94static struct irqaction irq_via = { 48static struct irqaction cascade = {
95 no_action, 0, { { 0, } }, "cascade", NULL, NULL 49 .handler = no_action,
50 .mask = CPU_MASK_NONE,
51 .name = "cascade",
96}; 52};
97 53
98void __init arch_init_irq(void) 54void __init arch_init_irq(void)
99{ 55{
100 /* 56 mips_cpu_irq_init();
101 * Mask all Galileo interrupts. The Galileo 57 gt641xx_irq_init();
102 * handler is set in cobalt_timer_setup() 58 init_i8259_irqs();
103 */
104 GT_WRITE(GT_INTRMASK_OFS, 0);
105
106 init_i8259_irqs(); /* 0 ... 15 */
107 mips_cpu_irq_init(); /* 16 ... 23 */
108
109 /*
110 * Mask all cpu interrupts
111 * (except IE4, we already masked those at VIA level)
112 */
113 change_c0_status(ST0_IM, IE_IRQ4);
114 59
115 setup_irq(COBALT_VIA_IRQ, &irq_via); 60 setup_irq(GT641XX_CASCADE_IRQ, &cascade);
61 setup_irq(I8259_CASCADE_IRQ, &cascade);
116} 62}
diff --git a/arch/mips/cobalt/led.c b/arch/mips/cobalt/led.c
new file mode 100644
index 000000000000..1c6ebd468b07
--- /dev/null
+++ b/arch/mips/cobalt/led.c
@@ -0,0 +1,62 @@
1/*
2 * Registration of Cobalt LED platform device.
3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/errno.h>
21#include <linux/init.h>
22#include <linux/ioport.h>
23#include <linux/platform_device.h>
24
25#include <cobalt.h>
26
27static struct resource cobalt_led_resource __initdata = {
28 .start = 0x1c000000,
29 .end = 0x1c000000,
30 .flags = IORESOURCE_MEM,
31};
32
33static __init int cobalt_led_add(void)
34{
35 struct platform_device *pdev;
36 int retval;
37
38 if (cobalt_board_id == COBALT_BRD_ID_QUBE1 ||
39 cobalt_board_id == COBALT_BRD_ID_QUBE2)
40 pdev = platform_device_alloc("cobalt-qube-leds", -1);
41 else
42 pdev = platform_device_alloc("cobalt-raq-leds", -1);
43
44 if (!pdev)
45 return -ENOMEM;
46
47 retval = platform_device_add_resources(pdev, &cobalt_led_resource, 1);
48 if (retval)
49 goto err_free_device;
50
51 retval = platform_device_add(pdev);
52 if (retval)
53 goto err_free_device;
54
55 return 0;
56
57err_free_device:
58 platform_device_put(pdev);
59
60 return retval;
61}
62device_initcall(cobalt_led_add);
diff --git a/arch/mips/cobalt/reset.c b/arch/mips/cobalt/reset.c
index 43cca21fdbc0..71eb4ccc4bc1 100644
--- a/arch/mips/cobalt/reset.c
+++ b/arch/mips/cobalt/reset.c
@@ -8,36 +8,46 @@
8 * Copyright (C) 1995, 1996, 1997 by Ralf Baechle 8 * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
9 * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv) 9 * Copyright (C) 2001 by Liam Davies (ldavies@agile.tv)
10 */ 10 */
11#include <linux/init.h>
12#include <linux/io.h>
11#include <linux/jiffies.h> 13#include <linux/jiffies.h>
12 14#include <linux/leds.h>
13#include <asm/io.h>
14#include <asm/reboot.h>
15 15
16#include <cobalt.h> 16#include <cobalt.h>
17 17
18#define RESET_PORT ((void __iomem *)CKSEG1ADDR(0x1c000000))
19#define RESET 0x0f
20
21DEFINE_LED_TRIGGER(power_off_led_trigger);
22
23static int __init ledtrig_power_off_init(void)
24{
25 led_trigger_register_simple("power-off", &power_off_led_trigger);
26 return 0;
27}
28device_initcall(ledtrig_power_off_init);
29
18void cobalt_machine_halt(void) 30void cobalt_machine_halt(void)
19{ 31{
20 int state, last, diff; 32 int state, last, diff;
21 unsigned long mark; 33 unsigned long mark;
22 34
23 /* 35 /*
24 * turn off bar on Qube, flash power off LED on RaQ (0.5Hz) 36 * turn on power off LED on RaQ
25 * 37 *
26 * restart if ENTER and SELECT are pressed 38 * restart if ENTER and SELECT are pressed
27 */ 39 */
28 40
29 last = COBALT_KEY_PORT; 41 last = COBALT_KEY_PORT;
30 42
31 for (state = 0;;) { 43 led_trigger_event(power_off_led_trigger, LED_FULL);
32
33 state ^= COBALT_LED_POWER_OFF;
34 COBALT_LED_PORT = state;
35 44
45 for (state = 0;;) {
36 diff = COBALT_KEY_PORT ^ last; 46 diff = COBALT_KEY_PORT ^ last;
37 last ^= diff; 47 last ^= diff;
38 48
39 if((diff & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)) && !(~last & (COBALT_KEY_ENTER | COBALT_KEY_SELECT))) 49 if((diff & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)) && !(~last & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)))
40 COBALT_LED_PORT = COBALT_LED_RESET; 50 writeb(RESET, RESET_PORT);
41 51
42 for (mark = jiffies; jiffies - mark < HZ;) 52 for (mark = jiffies; jiffies - mark < HZ;)
43 ; 53 ;
@@ -46,17 +56,8 @@ void cobalt_machine_halt(void)
46 56
47void cobalt_machine_restart(char *command) 57void cobalt_machine_restart(char *command)
48{ 58{
49 COBALT_LED_PORT = COBALT_LED_RESET; 59 writeb(RESET, RESET_PORT);
50 60
51 /* we should never get here */ 61 /* we should never get here */
52 cobalt_machine_halt(); 62 cobalt_machine_halt();
53} 63}
54
55/*
56 * This triggers the luser mode device driver for the power switch ;-)
57 */
58void cobalt_machine_power_off(void)
59{
60 printk("You can switch the machine off now.\n");
61 cobalt_machine_halt();
62}
diff --git a/arch/mips/cobalt/rtc.c b/arch/mips/cobalt/rtc.c
index 284daefc5c55..e70794b8bcba 100644
--- a/arch/mips/cobalt/rtc.c
+++ b/arch/mips/cobalt/rtc.c
@@ -20,6 +20,7 @@
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/ioport.h> 22#include <linux/ioport.h>
23#include <linux/mc146818rtc.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24 25
25static struct resource cobalt_rtc_resource[] __initdata = { 26static struct resource cobalt_rtc_resource[] __initdata = {
@@ -29,8 +30,8 @@ static struct resource cobalt_rtc_resource[] __initdata = {
29 .flags = IORESOURCE_IO, 30 .flags = IORESOURCE_IO,
30 }, 31 },
31 { 32 {
32 .start = 8, 33 .start = RTC_IRQ,
33 .end = 8, 34 .end = RTC_IRQ,
34 .flags = IORESOURCE_IRQ, 35 .flags = IORESOURCE_IRQ,
35 }, 36 },
36}; 37};
diff --git a/arch/mips/cobalt/serial.c b/arch/mips/cobalt/serial.c
index 08e739704cc9..53b8d0d6da90 100644
--- a/arch/mips/cobalt/serial.c
+++ b/arch/mips/cobalt/serial.c
@@ -24,6 +24,7 @@
24#include <linux/serial_8250.h> 24#include <linux/serial_8250.h>
25 25
26#include <cobalt.h> 26#include <cobalt.h>
27#include <irq.h>
27 28
28static struct resource cobalt_uart_resource[] __initdata = { 29static struct resource cobalt_uart_resource[] __initdata = {
29 { 30 {
@@ -32,15 +33,15 @@ static struct resource cobalt_uart_resource[] __initdata = {
32 .flags = IORESOURCE_MEM, 33 .flags = IORESOURCE_MEM,
33 }, 34 },
34 { 35 {
35 .start = COBALT_SERIAL_IRQ, 36 .start = SERIAL_IRQ,
36 .end = COBALT_SERIAL_IRQ, 37 .end = SERIAL_IRQ,
37 .flags = IORESOURCE_IRQ, 38 .flags = IORESOURCE_IRQ,
38 }, 39 },
39}; 40};
40 41
41static struct plat_serial8250_port cobalt_serial8250_port[] = { 42static struct plat_serial8250_port cobalt_serial8250_port[] = {
42 { 43 {
43 .irq = COBALT_SERIAL_IRQ, 44 .irq = SERIAL_IRQ,
44 .uartclk = 18432000, 45 .uartclk = 18432000,
45 .iotype = UPIO_MEM, 46 .iotype = UPIO_MEM,
46 .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, 47 .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c
index 7abe45e78425..d11bb1bc7b6b 100644
--- a/arch/mips/cobalt/setup.c
+++ b/arch/mips/cobalt/setup.c
@@ -15,15 +15,16 @@
15 15
16#include <asm/bootinfo.h> 16#include <asm/bootinfo.h>
17#include <asm/time.h> 17#include <asm/time.h>
18#include <asm/i8253.h>
18#include <asm/io.h> 19#include <asm/io.h>
19#include <asm/reboot.h> 20#include <asm/reboot.h>
20#include <asm/gt64120.h> 21#include <asm/gt64120.h>
21 22
22#include <cobalt.h> 23#include <cobalt.h>
24#include <irq.h>
23 25
24extern void cobalt_machine_restart(char *command); 26extern void cobalt_machine_restart(char *command);
25extern void cobalt_machine_halt(void); 27extern void cobalt_machine_halt(void);
26extern void cobalt_machine_power_off(void);
27 28
28const char *get_system_type(void) 29const char *get_system_type(void)
29{ 30{
@@ -45,14 +46,10 @@ void __init plat_timer_setup(struct irqaction *irq)
45 /* Load timer value for HZ (TCLK is 50MHz) */ 46 /* Load timer value for HZ (TCLK is 50MHz) */
46 GT_WRITE(GT_TC0_OFS, 50*1000*1000 / HZ); 47 GT_WRITE(GT_TC0_OFS, 50*1000*1000 / HZ);
47 48
48 /* Enable timer */ 49 /* Enable timer0 */
49 GT_WRITE(GT_TC_CONTROL_OFS, GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK); 50 GT_WRITE(GT_TC_CONTROL_OFS, GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
50 51
51 /* Register interrupt */ 52 setup_irq(GT641XX_TIMER0_IRQ, irq);
52 setup_irq(COBALT_GALILEO_IRQ, irq);
53
54 /* Enable interrupt */
55 GT_WRITE(GT_INTRMASK_OFS, GT_INTR_T0EXP_MSK | GT_READ(GT_INTRMASK_OFS));
56} 53}
57 54
58/* 55/*
@@ -87,13 +84,18 @@ static struct resource cobalt_reserved_resources[] = {
87 }, 84 },
88}; 85};
89 86
87void __init plat_time_init(void)
88{
89 setup_pit_timer();
90}
91
90void __init plat_mem_setup(void) 92void __init plat_mem_setup(void)
91{ 93{
92 int i; 94 int i;
93 95
94 _machine_restart = cobalt_machine_restart; 96 _machine_restart = cobalt_machine_restart;
95 _machine_halt = cobalt_machine_halt; 97 _machine_halt = cobalt_machine_halt;
96 pm_power_off = cobalt_machine_power_off; 98 pm_power_off = cobalt_machine_halt;
97 99
98 set_io_port_base(CKSEG1ADDR(GT_DEF_PCI0_IO_BASE)); 100 set_io_port_base(CKSEG1ADDR(GT_DEF_PCI0_IO_BASE));
99 101
@@ -117,8 +119,6 @@ void __init prom_init(void)
117 unsigned long memsz; 119 unsigned long memsz;
118 char **argv; 120 char **argv;
119 121
120 mips_machgroup = MACH_GROUP_COBALT;
121
122 memsz = fw_arg0 & 0x7fff0000; 122 memsz = fw_arg0 & 0x7fff0000;
123 narg = fw_arg0 & 0x0000ffff; 123 narg = fw_arg0 & 0x0000ffff;
124 124
diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig
index 700a3a2d688e..80b0c99c2cfb 100644
--- a/arch/mips/configs/bigsur_defconfig
+++ b/arch/mips/configs/bigsur_defconfig
@@ -69,7 +69,6 @@ CONFIG_SIBYTE_SB1xxx_SOC=y
69CONFIG_SIBYTE_CFE=y 69CONFIG_SIBYTE_CFE=y
70# CONFIG_SIBYTE_CFE_CONSOLE is not set 70# CONFIG_SIBYTE_CFE_CONSOLE is not set
71# CONFIG_SIBYTE_BUS_WATCHER is not set 71# CONFIG_SIBYTE_BUS_WATCHER is not set
72# CONFIG_SIBYTE_SB1250_PROF is not set
73# CONFIG_SIBYTE_TBPROF is not set 72# CONFIG_SIBYTE_TBPROF is not set
74CONFIG_RWSEM_GENERIC_SPINLOCK=y 73CONFIG_RWSEM_GENERIC_SPINLOCK=y
75# CONFIG_ARCH_HAS_ILOG2_U32 is not set 74# CONFIG_ARCH_HAS_ILOG2_U32 is not set
@@ -574,7 +573,7 @@ CONFIG_MII=y
574# CONFIG_HAMACHI is not set 573# CONFIG_HAMACHI is not set
575# CONFIG_YELLOWFIN is not set 574# CONFIG_YELLOWFIN is not set
576# CONFIG_R8169 is not set 575# CONFIG_R8169 is not set
577CONFIG_NET_SB1250_MAC=y 576CONFIG_SB1250_MAC=y
578# CONFIG_SIS190 is not set 577# CONFIG_SIS190 is not set
579# CONFIG_SKGE is not set 578# CONFIG_SKGE is not set
580# CONFIG_SKY2 is not set 579# CONFIG_SKY2 is not set
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig
index ebcb7ad8814b..36c13039e237 100644
--- a/arch/mips/configs/cobalt_defconfig
+++ b/arch/mips/configs/cobalt_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-rc2 3# Linux kernel version: 2.6.23-rc5
4# Tue Aug 7 22:12:54 2007 4# Thu Sep 6 13:14:29 2007
5# 5#
6CONFIG_MIPS=y 6CONFIG_MIPS=y
7 7
@@ -55,12 +55,14 @@ CONFIG_DMA_NONCOHERENT=y
55CONFIG_DMA_NEED_PCI_MAP_STATE=y 55CONFIG_DMA_NEED_PCI_MAP_STATE=y
56CONFIG_EARLY_PRINTK=y 56CONFIG_EARLY_PRINTK=y
57CONFIG_SYS_HAS_EARLY_PRINTK=y 57CONFIG_SYS_HAS_EARLY_PRINTK=y
58# CONFIG_HOTPLUG_CPU is not set
58CONFIG_I8259=y 59CONFIG_I8259=y
59# CONFIG_NO_IOPORT is not set 60# CONFIG_NO_IOPORT is not set
60# CONFIG_CPU_BIG_ENDIAN is not set 61# CONFIG_CPU_BIG_ENDIAN is not set
61CONFIG_CPU_LITTLE_ENDIAN=y 62CONFIG_CPU_LITTLE_ENDIAN=y
62CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y 63CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
63CONFIG_IRQ_CPU=y 64CONFIG_IRQ_CPU=y
65CONFIG_IRQ_GT641XX=y
64CONFIG_PCI_GT64XXX_PCI0=y 66CONFIG_PCI_GT64XXX_PCI0=y
65CONFIG_MIPS_L1_CACHE_SHIFT=5 67CONFIG_MIPS_L1_CACHE_SHIFT=5
66 68
@@ -235,6 +237,7 @@ CONFIG_TRAD_SIGNALS=y
235# Power management options 237# Power management options
236# 238#
237# CONFIG_PM is not set 239# CONFIG_PM is not set
240CONFIG_SUSPEND_UP_POSSIBLE=y
238 241
239# 242#
240# Networking 243# Networking
@@ -844,7 +847,21 @@ CONFIG_USB_MON=y
844# 847#
845# CONFIG_USB_GADGET is not set 848# CONFIG_USB_GADGET is not set
846# CONFIG_MMC is not set 849# CONFIG_MMC is not set
847# CONFIG_NEW_LEDS is not set 850CONFIG_NEW_LEDS=y
851CONFIG_LEDS_CLASS=y
852
853#
854# LED drivers
855#
856CONFIG_LEDS_COBALT_QUBE=y
857CONFIG_LEDS_COBALT_RAQ=y
858
859#
860# LED Triggers
861#
862CONFIG_LEDS_TRIGGERS=y
863# CONFIG_LEDS_TRIGGER_TIMER is not set
864# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
848# CONFIG_INFINIBAND is not set 865# CONFIG_INFINIBAND is not set
849CONFIG_RTC_LIB=y 866CONFIG_RTC_LIB=y
850CONFIG_RTC_CLASS=y 867CONFIG_RTC_CLASS=y
diff --git a/arch/mips/configs/lasat_defconfig b/arch/mips/configs/lasat_defconfig
new file mode 100644
index 000000000000..2c665fcef089
--- /dev/null
+++ b/arch/mips/configs/lasat_defconfig
@@ -0,0 +1,828 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc3
4# Sat Aug 18 17:37:58 2007
5#
6CONFIG_MIPS=y
7
8#
9# Machine selection
10#
11# CONFIG_MACH_ALCHEMY is not set
12# CONFIG_BASLER_EXCITE is not set
13# CONFIG_MIPS_COBALT is not set
14# CONFIG_MACH_DECSTATION is not set
15# CONFIG_MACH_JAZZ is not set
16CONFIG_LASAT=y
17# CONFIG_LEMOTE_FULONG is not set
18# CONFIG_MIPS_ATLAS is not set
19# CONFIG_MIPS_MALTA is not set
20# CONFIG_MIPS_SEAD is not set
21# CONFIG_MIPS_SIM is not set
22# CONFIG_MARKEINS is not set
23# CONFIG_MACH_VR41XX is not set
24# CONFIG_PNX8550_JBS is not set
25# CONFIG_PNX8550_STB810 is not set
26# CONFIG_PMC_MSP is not set
27# CONFIG_PMC_YOSEMITE is not set
28# CONFIG_QEMU is not set
29# CONFIG_SGI_IP22 is not set
30# CONFIG_SGI_IP27 is not set
31# CONFIG_SGI_IP32 is not set
32# CONFIG_SIBYTE_CRHINE is not set
33# CONFIG_SIBYTE_CARMEL is not set
34# CONFIG_SIBYTE_CRHONE is not set
35# CONFIG_SIBYTE_RHONE is not set
36# CONFIG_SIBYTE_SWARM is not set
37# CONFIG_SIBYTE_LITTLESUR is not set
38# CONFIG_SIBYTE_SENTOSA is not set
39# CONFIG_SIBYTE_PTSWARM is not set
40# CONFIG_SIBYTE_BIGSUR is not set
41# CONFIG_SNI_RM is not set
42# CONFIG_TOSHIBA_JMR3927 is not set
43# CONFIG_TOSHIBA_RBTX4927 is not set
44# CONFIG_TOSHIBA_RBTX4938 is not set
45# CONFIG_WR_PPMC is not set
46CONFIG_PICVUE=y
47CONFIG_PICVUE_PROC=y
48CONFIG_DS1603=y
49CONFIG_LASAT_SYSCTL=y
50CONFIG_RWSEM_GENERIC_SPINLOCK=y
51# CONFIG_ARCH_HAS_ILOG2_U32 is not set
52# CONFIG_ARCH_HAS_ILOG2_U64 is not set
53CONFIG_GENERIC_FIND_NEXT_BIT=y
54CONFIG_GENERIC_HWEIGHT=y
55CONFIG_GENERIC_CALIBRATE_DELAY=y
56CONFIG_GENERIC_TIME=y
57CONFIG_GENERIC_CMOS_UPDATE=y
58CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
59CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
60CONFIG_DMA_NONCOHERENT=y
61CONFIG_DMA_NEED_PCI_MAP_STATE=y
62CONFIG_EARLY_PRINTK=y
63CONFIG_SYS_HAS_EARLY_PRINTK=y
64# CONFIG_HOTPLUG_CPU is not set
65CONFIG_MIPS_NILE4=y
66# CONFIG_NO_IOPORT is not set
67# CONFIG_CPU_BIG_ENDIAN is not set
68CONFIG_CPU_LITTLE_ENDIAN=y
69CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
70CONFIG_PCI_GT64XXX_PCI0=y
71CONFIG_MIPS_L1_CACHE_SHIFT=5
72
73#
74# CPU selection
75#
76# CONFIG_CPU_LOONGSON2 is not set
77# CONFIG_CPU_MIPS32_R1 is not set
78# CONFIG_CPU_MIPS32_R2 is not set
79# CONFIG_CPU_MIPS64_R1 is not set
80# CONFIG_CPU_MIPS64_R2 is not set
81# CONFIG_CPU_R3000 is not set
82# CONFIG_CPU_TX39XX is not set
83# CONFIG_CPU_VR41XX is not set
84# CONFIG_CPU_R4300 is not set
85# CONFIG_CPU_R4X00 is not set
86# CONFIG_CPU_TX49XX is not set
87CONFIG_CPU_R5000=y
88# CONFIG_CPU_R5432 is not set
89# CONFIG_CPU_R6000 is not set
90# CONFIG_CPU_NEVADA is not set
91# CONFIG_CPU_R8000 is not set
92# CONFIG_CPU_R10000 is not set
93# CONFIG_CPU_RM7000 is not set
94# CONFIG_CPU_RM9000 is not set
95# CONFIG_CPU_SB1 is not set
96CONFIG_SYS_HAS_CPU_R5000=y
97CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
98CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
99CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
100
101#
102# Kernel type
103#
104CONFIG_32BIT=y
105# CONFIG_64BIT is not set
106CONFIG_PAGE_SIZE_4KB=y
107# CONFIG_PAGE_SIZE_8KB is not set
108# CONFIG_PAGE_SIZE_16KB is not set
109# CONFIG_PAGE_SIZE_64KB is not set
110CONFIG_BOARD_SCACHE=y
111CONFIG_R5000_CPU_SCACHE=y
112CONFIG_MIPS_MT_DISABLED=y
113# CONFIG_MIPS_MT_SMP is not set
114# CONFIG_MIPS_MT_SMTC is not set
115CONFIG_CPU_HAS_LLSC=y
116CONFIG_CPU_HAS_SYNC=y
117CONFIG_GENERIC_HARDIRQS=y
118CONFIG_GENERIC_IRQ_PROBE=y
119CONFIG_ARCH_FLATMEM_ENABLE=y
120CONFIG_SELECT_MEMORY_MODEL=y
121CONFIG_FLATMEM_MANUAL=y
122# CONFIG_DISCONTIGMEM_MANUAL is not set
123# CONFIG_SPARSEMEM_MANUAL is not set
124CONFIG_FLATMEM=y
125CONFIG_FLAT_NODE_MEM_MAP=y
126# CONFIG_SPARSEMEM_STATIC is not set
127CONFIG_SPLIT_PTLOCK_CPUS=4
128# CONFIG_RESOURCES_64BIT is not set
129CONFIG_ZONE_DMA_FLAG=0
130CONFIG_VIRT_TO_BUS=y
131# CONFIG_HZ_48 is not set
132# CONFIG_HZ_100 is not set
133# CONFIG_HZ_128 is not set
134# CONFIG_HZ_250 is not set
135# CONFIG_HZ_256 is not set
136CONFIG_HZ_1000=y
137# CONFIG_HZ_1024 is not set
138CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
139CONFIG_HZ=1000
140CONFIG_PREEMPT_NONE=y
141# CONFIG_PREEMPT_VOLUNTARY is not set
142# CONFIG_PREEMPT is not set
143# CONFIG_KEXEC is not set
144# CONFIG_SECCOMP is not set
145CONFIG_LOCKDEP_SUPPORT=y
146CONFIG_STACKTRACE_SUPPORT=y
147CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
148
149#
150# General setup
151#
152CONFIG_EXPERIMENTAL=y
153CONFIG_BROKEN_ON_SMP=y
154CONFIG_INIT_ENV_ARG_LIMIT=32
155CONFIG_LOCALVERSION=""
156CONFIG_LOCALVERSION_AUTO=y
157CONFIG_SWAP=y
158CONFIG_SYSVIPC=y
159CONFIG_SYSVIPC_SYSCTL=y
160# CONFIG_POSIX_MQUEUE is not set
161# CONFIG_BSD_PROCESS_ACCT is not set
162# CONFIG_TASKSTATS is not set
163# CONFIG_USER_NS is not set
164# CONFIG_AUDIT is not set
165# CONFIG_IKCONFIG is not set
166CONFIG_LOG_BUF_SHIFT=14
167# CONFIG_SYSFS_DEPRECATED is not set
168# CONFIG_RELAY is not set
169# CONFIG_BLK_DEV_INITRD is not set
170CONFIG_CC_OPTIMIZE_FOR_SIZE=y
171CONFIG_SYSCTL=y
172CONFIG_EMBEDDED=y
173# CONFIG_SYSCTL_SYSCALL is not set
174# CONFIG_KALLSYMS is not set
175# CONFIG_HOTPLUG is not set
176CONFIG_PRINTK=y
177CONFIG_BUG=y
178CONFIG_ELF_CORE=y
179CONFIG_BASE_FULL=y
180CONFIG_FUTEX=y
181# CONFIG_EPOLL is not set
182# CONFIG_SIGNALFD is not set
183# CONFIG_TIMERFD is not set
184# CONFIG_EVENTFD is not set
185CONFIG_SHMEM=y
186CONFIG_VM_EVENT_COUNTERS=y
187CONFIG_SLAB=y
188# CONFIG_SLUB is not set
189# CONFIG_SLOB is not set
190CONFIG_RT_MUTEXES=y
191# CONFIG_TINY_SHMEM is not set
192CONFIG_BASE_SMALL=0
193# CONFIG_MODULES is not set
194CONFIG_BLOCK=y
195# CONFIG_LBD is not set
196# CONFIG_BLK_DEV_IO_TRACE is not set
197# CONFIG_LSF is not set
198# CONFIG_BLK_DEV_BSG is not set
199
200#
201# IO Schedulers
202#
203CONFIG_IOSCHED_NOOP=y
204CONFIG_IOSCHED_AS=y
205# CONFIG_IOSCHED_DEADLINE is not set
206# CONFIG_IOSCHED_CFQ is not set
207CONFIG_DEFAULT_AS=y
208# CONFIG_DEFAULT_DEADLINE is not set
209# CONFIG_DEFAULT_CFQ is not set
210# CONFIG_DEFAULT_NOOP is not set
211CONFIG_DEFAULT_IOSCHED="anticipatory"
212
213#
214# Bus options (PCI, PCMCIA, EISA, ISA, TC)
215#
216CONFIG_HW_HAS_PCI=y
217CONFIG_PCI=y
218# CONFIG_ARCH_SUPPORTS_MSI is not set
219CONFIG_MMU=y
220
221#
222# PCCARD (PCMCIA/CardBus) support
223#
224
225#
226# Executable file formats
227#
228CONFIG_BINFMT_ELF=y
229# CONFIG_BINFMT_MISC is not set
230CONFIG_TRAD_SIGNALS=y
231
232#
233# Power management options
234#
235# CONFIG_PM is not set
236
237#
238# Networking
239#
240CONFIG_NET=y
241
242#
243# Networking options
244#
245CONFIG_PACKET=y
246CONFIG_PACKET_MMAP=y
247CONFIG_UNIX=y
248# CONFIG_NET_KEY is not set
249CONFIG_INET=y
250# CONFIG_IP_MULTICAST is not set
251# CONFIG_IP_ADVANCED_ROUTER is not set
252CONFIG_IP_FIB_HASH=y
253# CONFIG_IP_PNP is not set
254# CONFIG_NET_IPIP is not set
255# CONFIG_NET_IPGRE is not set
256# CONFIG_ARPD is not set
257# CONFIG_SYN_COOKIES is not set
258# CONFIG_INET_AH is not set
259# CONFIG_INET_ESP is not set
260# CONFIG_INET_IPCOMP is not set
261# CONFIG_INET_XFRM_TUNNEL is not set
262# CONFIG_INET_TUNNEL is not set
263# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
264# CONFIG_INET_XFRM_MODE_TUNNEL is not set
265# CONFIG_INET_XFRM_MODE_BEET is not set
266# CONFIG_INET_DIAG is not set
267# CONFIG_TCP_CONG_ADVANCED is not set
268CONFIG_TCP_CONG_CUBIC=y
269CONFIG_DEFAULT_TCP_CONG="cubic"
270# CONFIG_TCP_MD5SIG is not set
271# CONFIG_IPV6 is not set
272# CONFIG_INET6_XFRM_TUNNEL is not set
273# CONFIG_INET6_TUNNEL is not set
274# CONFIG_NETWORK_SECMARK is not set
275# CONFIG_NETFILTER is not set
276# CONFIG_IP_DCCP is not set
277# CONFIG_IP_SCTP is not set
278# CONFIG_TIPC is not set
279# CONFIG_ATM is not set
280# CONFIG_BRIDGE is not set
281# CONFIG_VLAN_8021Q is not set
282# CONFIG_DECNET is not set
283# CONFIG_LLC2 is not set
284# CONFIG_IPX is not set
285# CONFIG_ATALK is not set
286# CONFIG_X25 is not set
287# CONFIG_LAPB is not set
288# CONFIG_ECONET is not set
289# CONFIG_WAN_ROUTER is not set
290
291#
292# QoS and/or fair queueing
293#
294# CONFIG_NET_SCHED is not set
295
296#
297# Network testing
298#
299# CONFIG_NET_PKTGEN is not set
300# CONFIG_HAMRADIO is not set
301# CONFIG_IRDA is not set
302# CONFIG_BT is not set
303# CONFIG_AF_RXRPC is not set
304
305#
306# Wireless
307#
308# CONFIG_CFG80211 is not set
309# CONFIG_WIRELESS_EXT is not set
310# CONFIG_MAC80211 is not set
311# CONFIG_IEEE80211 is not set
312# CONFIG_RFKILL is not set
313# CONFIG_NET_9P is not set
314
315#
316# Device Drivers
317#
318
319#
320# Generic Driver Options
321#
322CONFIG_STANDALONE=y
323CONFIG_PREVENT_FIRMWARE_BUILD=y
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
329CONFIG_MTD_PARTITIONS=y
330# CONFIG_MTD_REDBOOT_PARTS is not set
331# CONFIG_MTD_CMDLINE_PARTS 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#
348CONFIG_MTD_CFI=y
349# CONFIG_MTD_JEDECPROBE is not set
350CONFIG_MTD_GEN_PROBE=y
351# CONFIG_MTD_CFI_ADV_OPTIONS is not set
352CONFIG_MTD_MAP_BANK_WIDTH_1=y
353CONFIG_MTD_MAP_BANK_WIDTH_2=y
354CONFIG_MTD_MAP_BANK_WIDTH_4=y
355# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
356# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
357# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
358CONFIG_MTD_CFI_I1=y
359CONFIG_MTD_CFI_I2=y
360# CONFIG_MTD_CFI_I4 is not set
361# CONFIG_MTD_CFI_I8 is not set
362# CONFIG_MTD_CFI_INTELEXT is not set
363CONFIG_MTD_CFI_AMDSTD=y
364# CONFIG_MTD_CFI_STAA is not set
365CONFIG_MTD_CFI_UTIL=y
366# CONFIG_MTD_RAM is not set
367# CONFIG_MTD_ROM is not set
368# CONFIG_MTD_ABSENT is not set
369
370#
371# Mapping drivers for chip access
372#
373# CONFIG_MTD_COMPLEX_MAPPINGS is not set
374# CONFIG_MTD_PHYSMAP is not set
375CONFIG_MTD_LASAT=y
376# CONFIG_MTD_PLATRAM is not set
377
378#
379# Self-contained MTD device drivers
380#
381# CONFIG_MTD_PMC551 is not set
382# CONFIG_MTD_SLRAM is not set
383# CONFIG_MTD_PHRAM is not set
384# CONFIG_MTD_MTDRAM is not set
385# CONFIG_MTD_BLOCK2MTD is not set
386
387#
388# Disk-On-Chip Device Drivers
389#
390# CONFIG_MTD_DOC2000 is not set
391# CONFIG_MTD_DOC2001 is not set
392# CONFIG_MTD_DOC2001PLUS is not set
393# CONFIG_MTD_NAND is not set
394# CONFIG_MTD_ONENAND is not set
395
396#
397# UBI - Unsorted block images
398#
399# CONFIG_MTD_UBI is not set
400# CONFIG_PARPORT is not set
401CONFIG_BLK_DEV=y
402# CONFIG_BLK_CPQ_DA is not set
403# CONFIG_BLK_CPQ_CISS_DA is not set
404# CONFIG_BLK_DEV_DAC960 is not set
405# CONFIG_BLK_DEV_UMEM is not set
406# CONFIG_BLK_DEV_COW_COMMON is not set
407# CONFIG_BLK_DEV_LOOP is not set
408# CONFIG_BLK_DEV_NBD is not set
409# CONFIG_BLK_DEV_SX8 is not set
410# CONFIG_BLK_DEV_RAM is not set
411# CONFIG_CDROM_PKTCDVD is not set
412# CONFIG_ATA_OVER_ETH is not set
413# CONFIG_MISC_DEVICES is not set
414CONFIG_IDE=y
415CONFIG_IDE_MAX_HWIFS=4
416CONFIG_BLK_DEV_IDE=y
417
418#
419# Please see Documentation/ide.txt for help/info on IDE drives
420#
421# CONFIG_BLK_DEV_IDE_SATA is not set
422CONFIG_BLK_DEV_IDEDISK=y
423CONFIG_IDEDISK_MULTI_MODE=y
424# CONFIG_BLK_DEV_IDECD is not set
425# CONFIG_BLK_DEV_IDETAPE is not set
426# CONFIG_BLK_DEV_IDEFLOPPY is not set
427# CONFIG_IDE_TASK_IOCTL is not set
428CONFIG_IDE_PROC_FS=y
429
430#
431# IDE chipset support/bugfixes
432#
433CONFIG_IDE_GENERIC=y
434CONFIG_BLK_DEV_IDEPCI=y
435# CONFIG_IDEPCI_SHARE_IRQ is not set
436CONFIG_IDEPCI_PCIBUS_ORDER=y
437# CONFIG_BLK_DEV_OFFBOARD is not set
438CONFIG_BLK_DEV_GENERIC=y
439# CONFIG_BLK_DEV_OPTI621 is not set
440CONFIG_BLK_DEV_IDEDMA_PCI=y
441# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
442# CONFIG_IDEDMA_ONLYDISK is not set
443# CONFIG_BLK_DEV_AEC62XX is not set
444# CONFIG_BLK_DEV_ALI15X3 is not set
445# CONFIG_BLK_DEV_AMD74XX is not set
446CONFIG_BLK_DEV_CMD64X=y
447# CONFIG_BLK_DEV_TRIFLEX is not set
448# CONFIG_BLK_DEV_CY82C693 is not set
449# CONFIG_BLK_DEV_CS5520 is not set
450# CONFIG_BLK_DEV_CS5530 is not set
451# CONFIG_BLK_DEV_HPT34X is not set
452# CONFIG_BLK_DEV_HPT366 is not set
453# CONFIG_BLK_DEV_JMICRON is not set
454# CONFIG_BLK_DEV_SC1200 is not set
455# CONFIG_BLK_DEV_PIIX is not set
456# CONFIG_BLK_DEV_IT8213 is not set
457# CONFIG_BLK_DEV_IT821X is not set
458# CONFIG_BLK_DEV_NS87415 is not set
459# CONFIG_BLK_DEV_PDC202XX_OLD is not set
460# CONFIG_BLK_DEV_PDC202XX_NEW is not set
461# CONFIG_BLK_DEV_SVWKS is not set
462# CONFIG_BLK_DEV_SIIMAGE is not set
463# CONFIG_BLK_DEV_SLC90E66 is not set
464# CONFIG_BLK_DEV_TRM290 is not set
465# CONFIG_BLK_DEV_VIA82CXXX is not set
466# CONFIG_BLK_DEV_TC86C001 is not set
467# CONFIG_IDE_ARM is not set
468CONFIG_BLK_DEV_IDEDMA=y
469# CONFIG_IDEDMA_IVB is not set
470# CONFIG_BLK_DEV_HD is not set
471
472#
473# SCSI device support
474#
475# CONFIG_RAID_ATTRS is not set
476# CONFIG_SCSI is not set
477# CONFIG_SCSI_DMA is not set
478# CONFIG_SCSI_NETLINK is not set
479# CONFIG_ATA is not set
480# CONFIG_MD is not set
481
482#
483# Fusion MPT device support
484#
485# CONFIG_FUSION is not set
486
487#
488# IEEE 1394 (FireWire) support
489#
490# CONFIG_FIREWIRE is not set
491# CONFIG_IEEE1394 is not set
492# CONFIG_I2O is not set
493CONFIG_NETDEVICES=y
494# CONFIG_NETDEVICES_MULTIQUEUE is not set
495# CONFIG_DUMMY is not set
496# CONFIG_BONDING is not set
497# CONFIG_MACVLAN is not set
498# CONFIG_EQUALIZER is not set
499# CONFIG_TUN is not set
500# CONFIG_ARCNET is not set
501# CONFIG_PHYLIB is not set
502CONFIG_NET_ETHERNET=y
503CONFIG_MII=y
504# CONFIG_AX88796 is not set
505# CONFIG_HAPPYMEAL is not set
506# CONFIG_SUNGEM is not set
507# CONFIG_CASSINI is not set
508# CONFIG_NET_VENDOR_3COM is not set
509# CONFIG_DM9000 is not set
510# CONFIG_NET_TULIP is not set
511# CONFIG_HP100 is not set
512CONFIG_NET_PCI=y
513CONFIG_PCNET32=y
514# CONFIG_PCNET32_NAPI is not set
515# CONFIG_AMD8111_ETH is not set
516# CONFIG_ADAPTEC_STARFIRE is not set
517# CONFIG_B44 is not set
518# CONFIG_FORCEDETH is not set
519# CONFIG_TC35815 is not set
520# CONFIG_DGRS is not set
521# CONFIG_EEPRO100 is not set
522# CONFIG_E100 is not set
523# CONFIG_FEALNX is not set
524# CONFIG_NATSEMI is not set
525# CONFIG_NE2K_PCI is not set
526# CONFIG_8139CP is not set
527# CONFIG_8139TOO is not set
528# CONFIG_SIS900 is not set
529# CONFIG_EPIC100 is not set
530# CONFIG_SUNDANCE is not set
531# CONFIG_TLAN is not set
532# CONFIG_VIA_RHINE is not set
533# CONFIG_SC92031 is not set
534# CONFIG_NETDEV_1000 is not set
535# CONFIG_NETDEV_10000 is not set
536# CONFIG_TR is not set
537
538#
539# Wireless LAN
540#
541# CONFIG_WLAN_PRE80211 is not set
542# CONFIG_WLAN_80211 is not set
543# CONFIG_WAN is not set
544# CONFIG_FDDI is not set
545# CONFIG_HIPPI is not set
546# CONFIG_PPP is not set
547# CONFIG_SLIP is not set
548# CONFIG_SHAPER is not set
549# CONFIG_NETCONSOLE is not set
550# CONFIG_NETPOLL is not set
551# CONFIG_NET_POLL_CONTROLLER is not set
552# CONFIG_ISDN is not set
553# CONFIG_PHONE is not set
554
555#
556# Input device support
557#
558CONFIG_INPUT=y
559# CONFIG_INPUT_FF_MEMLESS is not set
560# CONFIG_INPUT_POLLDEV is not set
561
562#
563# Userland interfaces
564#
565# CONFIG_INPUT_MOUSEDEV is not set
566# CONFIG_INPUT_JOYDEV is not set
567# CONFIG_INPUT_TSDEV is not set
568# CONFIG_INPUT_EVDEV is not set
569# CONFIG_INPUT_EVBUG is not set
570
571#
572# Input Device Drivers
573#
574# CONFIG_INPUT_KEYBOARD is not set
575# CONFIG_INPUT_MOUSE is not set
576# CONFIG_INPUT_JOYSTICK is not set
577# CONFIG_INPUT_TABLET is not set
578# CONFIG_INPUT_TOUCHSCREEN is not set
579# CONFIG_INPUT_MISC is not set
580
581#
582# Hardware I/O ports
583#
584CONFIG_SERIO=y
585CONFIG_SERIO_I8042=y
586CONFIG_SERIO_SERPORT=y
587# CONFIG_SERIO_PCIPS2 is not set
588# CONFIG_SERIO_LIBPS2 is not set
589CONFIG_SERIO_RAW=y
590# CONFIG_GAMEPORT is not set
591
592#
593# Character devices
594#
595# CONFIG_VT is not set
596# CONFIG_SERIAL_NONSTANDARD is not set
597
598#
599# Serial drivers
600#
601CONFIG_SERIAL_8250=y
602CONFIG_SERIAL_8250_CONSOLE=y
603# CONFIG_SERIAL_8250_PCI is not set
604CONFIG_SERIAL_8250_NR_UARTS=4
605CONFIG_SERIAL_8250_RUNTIME_UARTS=4
606# CONFIG_SERIAL_8250_EXTENDED is not set
607
608#
609# Non-8250 serial port support
610#
611CONFIG_SERIAL_CORE=y
612CONFIG_SERIAL_CORE_CONSOLE=y
613# CONFIG_SERIAL_JSM is not set
614CONFIG_UNIX98_PTYS=y
615CONFIG_LEGACY_PTYS=y
616CONFIG_LEGACY_PTY_COUNT=256
617# CONFIG_IPMI_HANDLER is not set
618# CONFIG_WATCHDOG is not set
619# CONFIG_HW_RANDOM is not set
620# CONFIG_RTC is not set
621# CONFIG_R3964 is not set
622# CONFIG_APPLICOM is not set
623# CONFIG_DRM is not set
624# CONFIG_RAW_DRIVER is not set
625# CONFIG_TCG_TPM is not set
626CONFIG_DEVPORT=y
627# CONFIG_I2C is not set
628
629#
630# SPI support
631#
632# CONFIG_SPI is not set
633# CONFIG_SPI_MASTER is not set
634# CONFIG_W1 is not set
635# CONFIG_POWER_SUPPLY is not set
636# CONFIG_HWMON is not set
637
638#
639# Multifunction device drivers
640#
641# CONFIG_MFD_SM501 is not set
642
643#
644# Multimedia devices
645#
646# CONFIG_VIDEO_DEV is not set
647# CONFIG_DVB_CORE is not set
648# CONFIG_DAB is not set
649
650#
651# Graphics support
652#
653# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
654
655#
656# Display device support
657#
658# CONFIG_DISPLAY_SUPPORT is not set
659# CONFIG_VGASTATE is not set
660# CONFIG_VIDEO_OUTPUT_CONTROL is not set
661# CONFIG_FB is not set
662
663#
664# Sound
665#
666# CONFIG_SOUND is not set
667# CONFIG_HID_SUPPORT is not set
668# CONFIG_USB_SUPPORT is not set
669# CONFIG_MMC is not set
670# CONFIG_NEW_LEDS is not set
671# CONFIG_INFINIBAND is not set
672# CONFIG_RTC_CLASS is not set
673
674#
675# DMA Engine support
676#
677# CONFIG_DMA_ENGINE is not set
678
679#
680# DMA Clients
681#
682
683#
684# DMA Devices
685#
686
687#
688# Userspace I/O
689#
690# CONFIG_UIO is not set
691
692#
693# File systems
694#
695CONFIG_EXT2_FS=y
696# CONFIG_EXT2_FS_XATTR is not set
697# CONFIG_EXT2_FS_XIP is not set
698CONFIG_EXT3_FS=y
699# CONFIG_EXT3_FS_XATTR is not set
700# CONFIG_EXT4DEV_FS is not set
701CONFIG_JBD=y
702# CONFIG_JBD_DEBUG is not set
703# CONFIG_REISERFS_FS is not set
704# CONFIG_JFS_FS is not set
705# CONFIG_FS_POSIX_ACL is not set
706# CONFIG_XFS_FS is not set
707# CONFIG_GFS2_FS is not set
708# CONFIG_OCFS2_FS is not set
709# CONFIG_MINIX_FS is not set
710# CONFIG_ROMFS_FS is not set
711# CONFIG_INOTIFY is not set
712# CONFIG_QUOTA is not set
713# CONFIG_DNOTIFY is not set
714# CONFIG_AUTOFS_FS is not set
715# CONFIG_AUTOFS4_FS is not set
716# CONFIG_FUSE_FS is not set
717
718#
719# CD-ROM/DVD Filesystems
720#
721# CONFIG_ISO9660_FS is not set
722# CONFIG_UDF_FS is not set
723
724#
725# DOS/FAT/NT Filesystems
726#
727# CONFIG_MSDOS_FS is not set
728# CONFIG_VFAT_FS is not set
729# CONFIG_NTFS_FS is not set
730
731#
732# Pseudo filesystems
733#
734CONFIG_PROC_FS=y
735CONFIG_PROC_KCORE=y
736CONFIG_PROC_SYSCTL=y
737CONFIG_SYSFS=y
738CONFIG_TMPFS=y
739# CONFIG_TMPFS_POSIX_ACL is not set
740# CONFIG_HUGETLB_PAGE is not set
741CONFIG_RAMFS=y
742CONFIG_CONFIGFS_FS=y
743
744#
745# Miscellaneous filesystems
746#
747# CONFIG_ADFS_FS is not set
748# CONFIG_AFFS_FS is not set
749# CONFIG_HFS_FS is not set
750# CONFIG_HFSPLUS_FS is not set
751# CONFIG_BEFS_FS is not set
752# CONFIG_BFS_FS is not set
753# CONFIG_EFS_FS is not set
754# CONFIG_JFFS2_FS is not set
755# CONFIG_CRAMFS is not set
756# CONFIG_VXFS_FS is not set
757# CONFIG_HPFS_FS is not set
758# CONFIG_QNX4FS_FS is not set
759# CONFIG_SYSV_FS is not set
760# CONFIG_UFS_FS is not set
761
762#
763# Network File Systems
764#
765# CONFIG_NFS_FS is not set
766# CONFIG_NFSD is not set
767# CONFIG_SMB_FS is not set
768# CONFIG_CIFS is not set
769# CONFIG_NCP_FS is not set
770# CONFIG_CODA_FS is not set
771# CONFIG_AFS_FS is not set
772
773#
774# Partition Types
775#
776# CONFIG_PARTITION_ADVANCED is not set
777CONFIG_MSDOS_PARTITION=y
778
779#
780# Native Language Support
781#
782# CONFIG_NLS is not set
783
784#
785# Distributed Lock Manager
786#
787# CONFIG_DLM is not set
788
789#
790# Profiling support
791#
792# CONFIG_PROFILING is not set
793
794#
795# Kernel hacking
796#
797CONFIG_TRACE_IRQFLAGS_SUPPORT=y
798# CONFIG_PRINTK_TIME is not set
799CONFIG_ENABLE_MUST_CHECK=y
800CONFIG_MAGIC_SYSRQ=y
801# CONFIG_UNUSED_SYMBOLS is not set
802# CONFIG_DEBUG_FS is not set
803# CONFIG_HEADERS_CHECK is not set
804# CONFIG_DEBUG_KERNEL is not set
805CONFIG_CROSSCOMPILE=y
806CONFIG_CMDLINE=""
807
808#
809# Security options
810#
811# CONFIG_KEYS is not set
812# CONFIG_SECURITY is not set
813# CONFIG_CRYPTO is not set
814
815#
816# Library routines
817#
818CONFIG_BITREVERSE=y
819# CONFIG_CRC_CCITT is not set
820# CONFIG_CRC16 is not set
821# CONFIG_CRC_ITU_T is not set
822CONFIG_CRC32=y
823# CONFIG_CRC7 is not set
824# CONFIG_LIBCRC32C is not set
825CONFIG_PLIST=y
826CONFIG_HAS_IOMEM=y
827CONFIG_HAS_IOPORT=y
828CONFIG_HAS_DMA=y
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
new file mode 100644
index 000000000000..0280ef389d8d
--- /dev/null
+++ b/arch/mips/configs/mtx1_defconfig
@@ -0,0 +1,3115 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.23-rc8
4# Sun Sep 30 12:56:10 2007
5#
6CONFIG_MIPS=y
7
8#
9# Machine selection
10#
11CONFIG_MACH_ALCHEMY=y
12# CONFIG_BASLER_EXCITE is not set
13# CONFIG_MIPS_COBALT is not set
14# CONFIG_MACH_DECSTATION is not set
15# CONFIG_MACH_JAZZ is not set
16# CONFIG_LEMOTE_FULONG is not set
17# CONFIG_MIPS_ATLAS is not set
18# CONFIG_MIPS_MALTA is not set
19# CONFIG_MIPS_SEAD is not set
20# CONFIG_MIPS_SIM is not set
21# CONFIG_MARKEINS is not set
22# CONFIG_MACH_VR41XX is not set
23# CONFIG_PNX8550_JBS is not set
24# CONFIG_PNX8550_STB810 is not set
25# CONFIG_PMC_MSP is not set
26# CONFIG_PMC_YOSEMITE is not set
27# CONFIG_QEMU is not set
28# CONFIG_SGI_IP22 is not set
29# CONFIG_SGI_IP27 is not set
30# CONFIG_SGI_IP32 is not set
31# CONFIG_SIBYTE_CRHINE is not set
32# CONFIG_SIBYTE_CARMEL is not set
33# CONFIG_SIBYTE_CRHONE is not set
34# CONFIG_SIBYTE_RHONE is not set
35# CONFIG_SIBYTE_SWARM is not set
36# CONFIG_SIBYTE_LITTLESUR is not set
37# CONFIG_SIBYTE_SENTOSA is not set
38# CONFIG_SIBYTE_PTSWARM is not set
39# CONFIG_SIBYTE_BIGSUR is not set
40# CONFIG_SNI_RM is not set
41# CONFIG_TOSHIBA_JMR3927 is not set
42# CONFIG_TOSHIBA_RBTX4927 is not set
43# CONFIG_TOSHIBA_RBTX4938 is not set
44# CONFIG_WR_PPMC is not set
45CONFIG_MIPS_MTX1=y
46# CONFIG_MIPS_BOSPORUS is not set
47# CONFIG_MIPS_DB1000 is not set
48# CONFIG_MIPS_DB1100 is not set
49# CONFIG_MIPS_DB1200 is not set
50# CONFIG_MIPS_DB1500 is not set
51# CONFIG_MIPS_DB1550 is not set
52# CONFIG_MIPS_MIRAGE is not set
53# CONFIG_MIPS_PB1000 is not set
54# CONFIG_MIPS_PB1100 is not set
55# CONFIG_MIPS_PB1200 is not set
56# CONFIG_MIPS_PB1500 is not set
57# CONFIG_MIPS_PB1550 is not set
58# CONFIG_MIPS_XXS1500 is not set
59CONFIG_SOC_AU1500=y
60CONFIG_SOC_AU1X00=y
61CONFIG_RWSEM_GENERIC_SPINLOCK=y
62# CONFIG_ARCH_HAS_ILOG2_U32 is not set
63# CONFIG_ARCH_HAS_ILOG2_U64 is not set
64CONFIG_GENERIC_FIND_NEXT_BIT=y
65CONFIG_GENERIC_HWEIGHT=y
66CONFIG_GENERIC_CALIBRATE_DELAY=y
67CONFIG_GENERIC_TIME=y
68CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
69# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
70CONFIG_DMA_NONCOHERENT=y
71CONFIG_DMA_NEED_PCI_MAP_STATE=y
72# CONFIG_HOTPLUG_CPU is not set
73# CONFIG_NO_IOPORT is not set
74# CONFIG_CPU_BIG_ENDIAN is not set
75CONFIG_CPU_LITTLE_ENDIAN=y
76CONFIG_SYS_SUPPORTS_APM_EMULATION=y
77CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
78CONFIG_MIPS_L1_CACHE_SHIFT=5
79
80#
81# CPU selection
82#
83# CONFIG_CPU_LOONGSON2 is not set
84CONFIG_CPU_MIPS32_R1=y
85# CONFIG_CPU_MIPS32_R2 is not set
86# CONFIG_CPU_MIPS64_R1 is not set
87# CONFIG_CPU_MIPS64_R2 is not set
88# CONFIG_CPU_R3000 is not set
89# CONFIG_CPU_TX39XX is not set
90# CONFIG_CPU_VR41XX is not set
91# CONFIG_CPU_R4300 is not set
92# CONFIG_CPU_R4X00 is not set
93# CONFIG_CPU_TX49XX is not set
94# CONFIG_CPU_R5000 is not set
95# CONFIG_CPU_R5432 is not set
96# CONFIG_CPU_R6000 is not set
97# CONFIG_CPU_NEVADA is not set
98# CONFIG_CPU_R8000 is not set
99# CONFIG_CPU_R10000 is not set
100# CONFIG_CPU_RM7000 is not set
101# CONFIG_CPU_RM9000 is not set
102# CONFIG_CPU_SB1 is not set
103CONFIG_SYS_HAS_CPU_MIPS32_R1=y
104CONFIG_CPU_MIPS32=y
105CONFIG_CPU_MIPSR1=y
106CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
107CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
108
109#
110# Kernel type
111#
112CONFIG_32BIT=y
113# CONFIG_64BIT is not set
114CONFIG_PAGE_SIZE_4KB=y
115# CONFIG_PAGE_SIZE_8KB is not set
116# CONFIG_PAGE_SIZE_16KB is not set
117# CONFIG_PAGE_SIZE_64KB is not set
118CONFIG_CPU_HAS_PREFETCH=y
119CONFIG_MIPS_MT_DISABLED=y
120# CONFIG_MIPS_MT_SMP is not set
121# CONFIG_MIPS_MT_SMTC is not set
122CONFIG_64BIT_PHYS_ADDR=y
123CONFIG_CPU_HAS_LLSC=y
124CONFIG_CPU_HAS_SYNC=y
125CONFIG_GENERIC_HARDIRQS=y
126CONFIG_GENERIC_IRQ_PROBE=y
127CONFIG_CPU_SUPPORTS_HIGHMEM=y
128CONFIG_ARCH_FLATMEM_ENABLE=y
129CONFIG_SELECT_MEMORY_MODEL=y
130CONFIG_FLATMEM_MANUAL=y
131# CONFIG_DISCONTIGMEM_MANUAL is not set
132# CONFIG_SPARSEMEM_MANUAL is not set
133CONFIG_FLATMEM=y
134CONFIG_FLAT_NODE_MEM_MAP=y
135# CONFIG_SPARSEMEM_STATIC is not set
136CONFIG_SPLIT_PTLOCK_CPUS=4
137CONFIG_RESOURCES_64BIT=y
138CONFIG_ZONE_DMA_FLAG=0
139CONFIG_VIRT_TO_BUS=y
140# CONFIG_HZ_48 is not set
141# CONFIG_HZ_100 is not set
142# CONFIG_HZ_128 is not set
143CONFIG_HZ_250=y
144# CONFIG_HZ_256 is not set
145# CONFIG_HZ_1000 is not set
146# CONFIG_HZ_1024 is not set
147CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
148CONFIG_HZ=250
149# CONFIG_PREEMPT_NONE is not set
150CONFIG_PREEMPT_VOLUNTARY=y
151# CONFIG_PREEMPT is not set
152# CONFIG_KEXEC is not set
153CONFIG_SECCOMP=y
154CONFIG_LOCKDEP_SUPPORT=y
155CONFIG_STACKTRACE_SUPPORT=y
156CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
157
158#
159# General setup
160#
161CONFIG_EXPERIMENTAL=y
162CONFIG_BROKEN_ON_SMP=y
163CONFIG_INIT_ENV_ARG_LIMIT=32
164CONFIG_LOCALVERSION=""
165# CONFIG_LOCALVERSION_AUTO is not set
166CONFIG_SWAP=y
167CONFIG_SYSVIPC=y
168CONFIG_SYSVIPC_SYSCTL=y
169CONFIG_POSIX_MQUEUE=y
170CONFIG_BSD_PROCESS_ACCT=y
171CONFIG_BSD_PROCESS_ACCT_V3=y
172# CONFIG_TASKSTATS is not set
173# CONFIG_USER_NS is not set
174CONFIG_AUDIT=y
175# CONFIG_IKCONFIG is not set
176CONFIG_LOG_BUF_SHIFT=17
177CONFIG_SYSFS_DEPRECATED=y
178CONFIG_RELAY=y
179CONFIG_BLK_DEV_INITRD=y
180CONFIG_INITRAMFS_SOURCE=""
181# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
182CONFIG_SYSCTL=y
183CONFIG_EMBEDDED=y
184CONFIG_SYSCTL_SYSCALL=y
185CONFIG_KALLSYMS=y
186# CONFIG_KALLSYMS_EXTRA_PASS is not set
187CONFIG_HOTPLUG=y
188CONFIG_PRINTK=y
189CONFIG_BUG=y
190CONFIG_ELF_CORE=y
191CONFIG_BASE_FULL=y
192CONFIG_FUTEX=y
193CONFIG_ANON_INODES=y
194CONFIG_EPOLL=y
195CONFIG_SIGNALFD=y
196CONFIG_EVENTFD=y
197CONFIG_SHMEM=y
198CONFIG_VM_EVENT_COUNTERS=y
199CONFIG_SLAB=y
200# CONFIG_SLUB is not set
201# CONFIG_SLOB is not set
202CONFIG_RT_MUTEXES=y
203# CONFIG_TINY_SHMEM is not set
204CONFIG_BASE_SMALL=0
205CONFIG_MODULES=y
206CONFIG_MODULE_UNLOAD=y
207# CONFIG_MODULE_FORCE_UNLOAD is not set
208CONFIG_MODVERSIONS=y
209CONFIG_MODULE_SRCVERSION_ALL=y
210CONFIG_KMOD=y
211CONFIG_BLOCK=y
212CONFIG_LBD=y
213# CONFIG_BLK_DEV_IO_TRACE is not set
214# CONFIG_LSF is not set
215# CONFIG_BLK_DEV_BSG is not set
216
217#
218# IO Schedulers
219#
220CONFIG_IOSCHED_NOOP=y
221CONFIG_IOSCHED_AS=y
222CONFIG_IOSCHED_DEADLINE=y
223CONFIG_IOSCHED_CFQ=y
224# CONFIG_DEFAULT_AS is not set
225# CONFIG_DEFAULT_DEADLINE is not set
226CONFIG_DEFAULT_CFQ=y
227# CONFIG_DEFAULT_NOOP is not set
228CONFIG_DEFAULT_IOSCHED="cfq"
229
230#
231# Bus options (PCI, PCMCIA, EISA, ISA, TC)
232#
233CONFIG_HW_HAS_PCI=y
234CONFIG_PCI=y
235# CONFIG_ARCH_SUPPORTS_MSI is not set
236CONFIG_MMU=y
237
238#
239# PCCARD (PCMCIA/CardBus) support
240#
241CONFIG_PCCARD=m
242# CONFIG_PCMCIA_DEBUG is not set
243CONFIG_PCMCIA=m
244CONFIG_PCMCIA_LOAD_CIS=y
245CONFIG_PCMCIA_IOCTL=y
246CONFIG_CARDBUS=y
247
248#
249# PC-card bridges
250#
251CONFIG_YENTA=m
252CONFIG_YENTA_O2=y
253CONFIG_YENTA_RICOH=y
254CONFIG_YENTA_TI=y
255CONFIG_YENTA_ENE_TUNE=y
256CONFIG_YENTA_TOSHIBA=y
257CONFIG_PD6729=m
258CONFIG_I82092=m
259# CONFIG_PCMCIA_AU1X00 is not set
260CONFIG_PCCARD_NONSTATIC=m
261# CONFIG_HOTPLUG_PCI is not set
262
263#
264# Executable file formats
265#
266CONFIG_BINFMT_ELF=y
267CONFIG_BINFMT_MISC=m
268CONFIG_TRAD_SIGNALS=y
269
270#
271# Power management options
272#
273CONFIG_PM=y
274# CONFIG_PM_LEGACY is not set
275# CONFIG_PM_DEBUG is not set
276CONFIG_PM_SLEEP=y
277CONFIG_SUSPEND_UP_POSSIBLE=y
278CONFIG_SUSPEND=y
279# CONFIG_APM_EMULATION is not set
280
281#
282# Networking
283#
284CONFIG_NET=y
285
286#
287# Networking options
288#
289CONFIG_PACKET=m
290CONFIG_PACKET_MMAP=y
291CONFIG_UNIX=y
292CONFIG_XFRM=y
293CONFIG_XFRM_USER=m
294# CONFIG_XFRM_SUB_POLICY is not set
295# CONFIG_XFRM_MIGRATE is not set
296CONFIG_NET_KEY=m
297# CONFIG_NET_KEY_MIGRATE is not set
298CONFIG_INET=y
299CONFIG_IP_MULTICAST=y
300CONFIG_IP_ADVANCED_ROUTER=y
301CONFIG_ASK_IP_FIB_HASH=y
302# CONFIG_IP_FIB_TRIE is not set
303CONFIG_IP_FIB_HASH=y
304CONFIG_IP_MULTIPLE_TABLES=y
305CONFIG_IP_ROUTE_MULTIPATH=y
306CONFIG_IP_ROUTE_VERBOSE=y
307# CONFIG_IP_PNP is not set
308CONFIG_NET_IPIP=m
309CONFIG_NET_IPGRE=m
310CONFIG_NET_IPGRE_BROADCAST=y
311CONFIG_IP_MROUTE=y
312CONFIG_IP_PIMSM_V1=y
313CONFIG_IP_PIMSM_V2=y
314# CONFIG_ARPD is not set
315CONFIG_SYN_COOKIES=y
316CONFIG_INET_AH=m
317CONFIG_INET_ESP=m
318CONFIG_INET_IPCOMP=m
319CONFIG_INET_XFRM_TUNNEL=m
320CONFIG_INET_TUNNEL=m
321CONFIG_INET_XFRM_MODE_TRANSPORT=m
322CONFIG_INET_XFRM_MODE_TUNNEL=m
323CONFIG_INET_XFRM_MODE_BEET=m
324CONFIG_INET_DIAG=y
325CONFIG_INET_TCP_DIAG=y
326# CONFIG_TCP_CONG_ADVANCED is not set
327CONFIG_TCP_CONG_CUBIC=y
328CONFIG_DEFAULT_TCP_CONG="cubic"
329# CONFIG_TCP_MD5SIG is not set
330CONFIG_IP_VS=m
331# CONFIG_IP_VS_DEBUG is not set
332CONFIG_IP_VS_TAB_BITS=12
333
334#
335# IPVS transport protocol load balancing support
336#
337CONFIG_IP_VS_PROTO_TCP=y
338CONFIG_IP_VS_PROTO_UDP=y
339CONFIG_IP_VS_PROTO_ESP=y
340CONFIG_IP_VS_PROTO_AH=y
341
342#
343# IPVS scheduler
344#
345CONFIG_IP_VS_RR=m
346CONFIG_IP_VS_WRR=m
347CONFIG_IP_VS_LC=m
348CONFIG_IP_VS_WLC=m
349CONFIG_IP_VS_LBLC=m
350CONFIG_IP_VS_LBLCR=m
351CONFIG_IP_VS_DH=m
352CONFIG_IP_VS_SH=m
353CONFIG_IP_VS_SED=m
354CONFIG_IP_VS_NQ=m
355
356#
357# IPVS application helper
358#
359CONFIG_IP_VS_FTP=m
360CONFIG_IPV6=m
361CONFIG_IPV6_PRIVACY=y
362# CONFIG_IPV6_ROUTER_PREF is not set
363# CONFIG_IPV6_OPTIMISTIC_DAD is not set
364CONFIG_INET6_AH=m
365CONFIG_INET6_ESP=m
366CONFIG_INET6_IPCOMP=m
367# CONFIG_IPV6_MIP6 is not set
368CONFIG_INET6_XFRM_TUNNEL=m
369CONFIG_INET6_TUNNEL=m
370CONFIG_INET6_XFRM_MODE_TRANSPORT=m
371CONFIG_INET6_XFRM_MODE_TUNNEL=m
372CONFIG_INET6_XFRM_MODE_BEET=m
373CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
374CONFIG_IPV6_SIT=m
375CONFIG_IPV6_TUNNEL=m
376# CONFIG_IPV6_MULTIPLE_TABLES is not set
377# CONFIG_NETLABEL is not set
378CONFIG_NETWORK_SECMARK=y
379CONFIG_NETFILTER=y
380# CONFIG_NETFILTER_DEBUG is not set
381CONFIG_BRIDGE_NETFILTER=y
382
383#
384# Core Netfilter Configuration
385#
386CONFIG_NETFILTER_NETLINK=m
387CONFIG_NETFILTER_NETLINK_QUEUE=m
388CONFIG_NETFILTER_NETLINK_LOG=m
389# CONFIG_NF_CONNTRACK_ENABLED is not set
390# CONFIG_NF_CONNTRACK is not set
391CONFIG_NETFILTER_XTABLES=m
392CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
393CONFIG_NETFILTER_XT_TARGET_DSCP=m
394CONFIG_NETFILTER_XT_TARGET_MARK=m
395CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
396# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
397# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
398CONFIG_NETFILTER_XT_TARGET_SECMARK=m
399# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
400CONFIG_NETFILTER_XT_MATCH_COMMENT=m
401CONFIG_NETFILTER_XT_MATCH_DCCP=m
402CONFIG_NETFILTER_XT_MATCH_DSCP=m
403CONFIG_NETFILTER_XT_MATCH_ESP=m
404CONFIG_NETFILTER_XT_MATCH_LENGTH=m
405CONFIG_NETFILTER_XT_MATCH_LIMIT=m
406CONFIG_NETFILTER_XT_MATCH_MAC=m
407CONFIG_NETFILTER_XT_MATCH_MARK=m
408CONFIG_NETFILTER_XT_MATCH_POLICY=m
409CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
410CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
411CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
412CONFIG_NETFILTER_XT_MATCH_QUOTA=m
413CONFIG_NETFILTER_XT_MATCH_REALM=m
414CONFIG_NETFILTER_XT_MATCH_SCTP=m
415CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
416CONFIG_NETFILTER_XT_MATCH_STRING=m
417CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
418# CONFIG_NETFILTER_XT_MATCH_U32 is not set
419# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
420
421#
422# IP: Netfilter Configuration
423#
424CONFIG_IP_NF_QUEUE=m
425CONFIG_IP_NF_IPTABLES=m
426CONFIG_IP_NF_MATCH_IPRANGE=m
427CONFIG_IP_NF_MATCH_TOS=m
428CONFIG_IP_NF_MATCH_RECENT=m
429CONFIG_IP_NF_MATCH_ECN=m
430CONFIG_IP_NF_MATCH_AH=m
431CONFIG_IP_NF_MATCH_TTL=m
432CONFIG_IP_NF_MATCH_OWNER=m
433CONFIG_IP_NF_MATCH_ADDRTYPE=m
434CONFIG_IP_NF_FILTER=m
435CONFIG_IP_NF_TARGET_REJECT=m
436CONFIG_IP_NF_TARGET_LOG=m
437CONFIG_IP_NF_TARGET_ULOG=m
438CONFIG_IP_NF_MANGLE=m
439CONFIG_IP_NF_TARGET_TOS=m
440CONFIG_IP_NF_TARGET_ECN=m
441CONFIG_IP_NF_TARGET_TTL=m
442CONFIG_IP_NF_RAW=m
443CONFIG_IP_NF_ARPTABLES=m
444CONFIG_IP_NF_ARPFILTER=m
445CONFIG_IP_NF_ARP_MANGLE=m
446
447#
448# IPv6: Netfilter Configuration (EXPERIMENTAL)
449#
450CONFIG_IP6_NF_QUEUE=m
451CONFIG_IP6_NF_IPTABLES=m
452CONFIG_IP6_NF_MATCH_RT=m
453CONFIG_IP6_NF_MATCH_OPTS=m
454CONFIG_IP6_NF_MATCH_FRAG=m
455CONFIG_IP6_NF_MATCH_HL=m
456CONFIG_IP6_NF_MATCH_OWNER=m
457CONFIG_IP6_NF_MATCH_IPV6HEADER=m
458CONFIG_IP6_NF_MATCH_AH=m
459# CONFIG_IP6_NF_MATCH_MH is not set
460CONFIG_IP6_NF_MATCH_EUI64=m
461CONFIG_IP6_NF_FILTER=m
462CONFIG_IP6_NF_TARGET_LOG=m
463CONFIG_IP6_NF_TARGET_REJECT=m
464CONFIG_IP6_NF_MANGLE=m
465CONFIG_IP6_NF_TARGET_HL=m
466CONFIG_IP6_NF_RAW=m
467
468#
469# DECnet: Netfilter Configuration
470#
471CONFIG_DECNET_NF_GRABULATOR=m
472
473#
474# Bridge: Netfilter Configuration
475#
476CONFIG_BRIDGE_NF_EBTABLES=m
477CONFIG_BRIDGE_EBT_BROUTE=m
478CONFIG_BRIDGE_EBT_T_FILTER=m
479CONFIG_BRIDGE_EBT_T_NAT=m
480CONFIG_BRIDGE_EBT_802_3=m
481CONFIG_BRIDGE_EBT_AMONG=m
482CONFIG_BRIDGE_EBT_ARP=m
483CONFIG_BRIDGE_EBT_IP=m
484CONFIG_BRIDGE_EBT_LIMIT=m
485CONFIG_BRIDGE_EBT_MARK=m
486CONFIG_BRIDGE_EBT_PKTTYPE=m
487CONFIG_BRIDGE_EBT_STP=m
488CONFIG_BRIDGE_EBT_VLAN=m
489CONFIG_BRIDGE_EBT_ARPREPLY=m
490CONFIG_BRIDGE_EBT_DNAT=m
491CONFIG_BRIDGE_EBT_MARK_T=m
492CONFIG_BRIDGE_EBT_REDIRECT=m
493CONFIG_BRIDGE_EBT_SNAT=m
494CONFIG_BRIDGE_EBT_LOG=m
495CONFIG_BRIDGE_EBT_ULOG=m
496CONFIG_IP_DCCP=m
497CONFIG_INET_DCCP_DIAG=m
498CONFIG_IP_DCCP_ACKVEC=y
499
500#
501# DCCP CCIDs Configuration (EXPERIMENTAL)
502#
503CONFIG_IP_DCCP_CCID2=m
504# CONFIG_IP_DCCP_CCID2_DEBUG is not set
505CONFIG_IP_DCCP_CCID3=m
506CONFIG_IP_DCCP_TFRC_LIB=m
507# CONFIG_IP_DCCP_CCID3_DEBUG is not set
508CONFIG_IP_DCCP_CCID3_RTO=100
509CONFIG_IP_SCTP=m
510# CONFIG_SCTP_DBG_MSG is not set
511# CONFIG_SCTP_DBG_OBJCNT is not set
512# CONFIG_SCTP_HMAC_NONE is not set
513# CONFIG_SCTP_HMAC_SHA1 is not set
514CONFIG_SCTP_HMAC_MD5=y
515CONFIG_TIPC=m
516# CONFIG_TIPC_ADVANCED is not set
517# CONFIG_TIPC_DEBUG is not set
518CONFIG_ATM=y
519CONFIG_ATM_CLIP=y
520# CONFIG_ATM_CLIP_NO_ICMP is not set
521CONFIG_ATM_LANE=m
522CONFIG_ATM_MPOA=m
523CONFIG_ATM_BR2684=m
524# CONFIG_ATM_BR2684_IPFILTER is not set
525CONFIG_BRIDGE=m
526CONFIG_VLAN_8021Q=m
527CONFIG_DECNET=m
528# CONFIG_DECNET_ROUTER is not set
529CONFIG_LLC=y
530CONFIG_LLC2=m
531CONFIG_IPX=m
532# CONFIG_IPX_INTERN is not set
533CONFIG_ATALK=m
534CONFIG_DEV_APPLETALK=m
535CONFIG_IPDDP=m
536CONFIG_IPDDP_ENCAP=y
537CONFIG_IPDDP_DECAP=y
538CONFIG_X25=m
539CONFIG_LAPB=m
540CONFIG_ECONET=m
541CONFIG_ECONET_AUNUDP=y
542CONFIG_ECONET_NATIVE=y
543CONFIG_WAN_ROUTER=m
544
545#
546# QoS and/or fair queueing
547#
548CONFIG_NET_SCHED=y
549CONFIG_NET_SCH_FIFO=y
550
551#
552# Queueing/Scheduling
553#
554CONFIG_NET_SCH_CBQ=m
555CONFIG_NET_SCH_HTB=m
556CONFIG_NET_SCH_HFSC=m
557CONFIG_NET_SCH_ATM=m
558CONFIG_NET_SCH_PRIO=m
559# CONFIG_NET_SCH_RR is not set
560CONFIG_NET_SCH_RED=m
561CONFIG_NET_SCH_SFQ=m
562CONFIG_NET_SCH_TEQL=m
563CONFIG_NET_SCH_TBF=m
564CONFIG_NET_SCH_GRED=m
565CONFIG_NET_SCH_DSMARK=m
566CONFIG_NET_SCH_NETEM=m
567CONFIG_NET_SCH_INGRESS=m
568
569#
570# Classification
571#
572CONFIG_NET_CLS=y
573CONFIG_NET_CLS_BASIC=m
574CONFIG_NET_CLS_TCINDEX=m
575CONFIG_NET_CLS_ROUTE4=m
576CONFIG_NET_CLS_ROUTE=y
577CONFIG_NET_CLS_FW=m
578CONFIG_NET_CLS_U32=m
579# CONFIG_CLS_U32_PERF is not set
580CONFIG_CLS_U32_MARK=y
581CONFIG_NET_CLS_RSVP=m
582CONFIG_NET_CLS_RSVP6=m
583CONFIG_NET_EMATCH=y
584CONFIG_NET_EMATCH_STACK=32
585CONFIG_NET_EMATCH_CMP=m
586CONFIG_NET_EMATCH_NBYTE=m
587CONFIG_NET_EMATCH_U32=m
588CONFIG_NET_EMATCH_META=m
589CONFIG_NET_EMATCH_TEXT=m
590CONFIG_NET_CLS_ACT=y
591CONFIG_NET_ACT_POLICE=y
592# CONFIG_NET_ACT_GACT is not set
593# CONFIG_NET_ACT_MIRRED is not set
594# CONFIG_NET_ACT_IPT is not set
595# CONFIG_NET_ACT_PEDIT is not set
596# CONFIG_NET_ACT_SIMP is not set
597CONFIG_NET_CLS_POLICE=y
598# CONFIG_NET_CLS_IND is not set
599
600#
601# Network testing
602#
603CONFIG_NET_PKTGEN=m
604CONFIG_HAMRADIO=y
605
606#
607# Packet Radio protocols
608#
609CONFIG_AX25=m
610# CONFIG_AX25_DAMA_SLAVE is not set
611CONFIG_NETROM=m
612CONFIG_ROSE=m
613
614#
615# AX.25 network device drivers
616#
617CONFIG_MKISS=m
618CONFIG_6PACK=m
619CONFIG_BPQETHER=m
620CONFIG_BAYCOM_SER_FDX=m
621CONFIG_BAYCOM_SER_HDX=m
622CONFIG_BAYCOM_PAR=m
623CONFIG_BAYCOM_EPP=m
624CONFIG_YAM=m
625CONFIG_IRDA=m
626
627#
628# IrDA protocols
629#
630CONFIG_IRLAN=m
631CONFIG_IRNET=m
632CONFIG_IRCOMM=m
633CONFIG_IRDA_ULTRA=y
634
635#
636# IrDA options
637#
638CONFIG_IRDA_CACHE_LAST_LSAP=y
639CONFIG_IRDA_FAST_RR=y
640CONFIG_IRDA_DEBUG=y
641
642#
643# Infrared-port device drivers
644#
645
646#
647# SIR device drivers
648#
649CONFIG_IRTTY_SIR=m
650
651#
652# Dongle support
653#
654CONFIG_DONGLE=y
655CONFIG_ESI_DONGLE=m
656CONFIG_ACTISYS_DONGLE=m
657CONFIG_TEKRAM_DONGLE=m
658# CONFIG_TOIM3232_DONGLE is not set
659CONFIG_LITELINK_DONGLE=m
660CONFIG_MA600_DONGLE=m
661CONFIG_GIRBIL_DONGLE=m
662CONFIG_MCP2120_DONGLE=m
663CONFIG_OLD_BELKIN_DONGLE=m
664CONFIG_ACT200L_DONGLE=m
665# CONFIG_KINGSUN_DONGLE is not set
666
667#
668# Old SIR device drivers
669#
670# CONFIG_IRPORT_SIR is not set
671
672#
673# Old Serial dongle support
674#
675
676#
677# FIR device drivers
678#
679CONFIG_USB_IRDA=m
680CONFIG_SIGMATEL_FIR=m
681CONFIG_TOSHIBA_FIR=m
682CONFIG_VLSI_FIR=m
683CONFIG_MCS_FIR=m
684CONFIG_BT=m
685CONFIG_BT_L2CAP=m
686CONFIG_BT_SCO=m
687CONFIG_BT_RFCOMM=m
688CONFIG_BT_RFCOMM_TTY=y
689CONFIG_BT_BNEP=m
690CONFIG_BT_BNEP_MC_FILTER=y
691CONFIG_BT_BNEP_PROTO_FILTER=y
692CONFIG_BT_CMTP=m
693CONFIG_BT_HIDP=m
694
695#
696# Bluetooth device drivers
697#
698CONFIG_BT_HCIUSB=m
699CONFIG_BT_HCIUSB_SCO=y
700CONFIG_BT_HCIUART=m
701CONFIG_BT_HCIUART_H4=y
702CONFIG_BT_HCIUART_BCSP=y
703CONFIG_BT_HCIBCM203X=m
704CONFIG_BT_HCIBPA10X=m
705CONFIG_BT_HCIBFUSB=m
706CONFIG_BT_HCIDTL1=m
707CONFIG_BT_HCIBT3C=m
708CONFIG_BT_HCIBLUECARD=m
709CONFIG_BT_HCIBTUART=m
710CONFIG_BT_HCIVHCI=m
711CONFIG_AF_RXRPC=m
712# CONFIG_AF_RXRPC_DEBUG is not set
713# CONFIG_RXKAD is not set
714CONFIG_FIB_RULES=y
715
716#
717# Wireless
718#
719# CONFIG_CFG80211 is not set
720CONFIG_WIRELESS_EXT=y
721# CONFIG_MAC80211 is not set
722CONFIG_IEEE80211=m
723# CONFIG_IEEE80211_DEBUG is not set
724CONFIG_IEEE80211_CRYPT_WEP=m
725CONFIG_IEEE80211_CRYPT_CCMP=m
726CONFIG_IEEE80211_CRYPT_TKIP=m
727CONFIG_IEEE80211_SOFTMAC=m
728# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
729# CONFIG_RFKILL is not set
730# CONFIG_NET_9P is not set
731
732#
733# Device Drivers
734#
735
736#
737# Generic Driver Options
738#
739CONFIG_STANDALONE=y
740CONFIG_PREVENT_FIRMWARE_BUILD=y
741CONFIG_FW_LOADER=y
742# CONFIG_SYS_HYPERVISOR is not set
743CONFIG_CONNECTOR=m
744CONFIG_MTD=m
745# CONFIG_MTD_DEBUG is not set
746CONFIG_MTD_CONCAT=m
747CONFIG_MTD_PARTITIONS=y
748CONFIG_MTD_REDBOOT_PARTS=m
749CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
750# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
751# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set
752
753#
754# User Modules And Translation Layers
755#
756CONFIG_MTD_CHAR=m
757CONFIG_MTD_BLKDEVS=m
758CONFIG_MTD_BLOCK=m
759CONFIG_MTD_BLOCK_RO=m
760CONFIG_FTL=m
761CONFIG_NFTL=m
762CONFIG_NFTL_RW=y
763CONFIG_INFTL=m
764CONFIG_RFD_FTL=m
765CONFIG_SSFDC=m
766
767#
768# RAM/ROM/Flash chip drivers
769#
770CONFIG_MTD_CFI=m
771CONFIG_MTD_JEDECPROBE=m
772CONFIG_MTD_GEN_PROBE=m
773# CONFIG_MTD_CFI_ADV_OPTIONS is not set
774CONFIG_MTD_MAP_BANK_WIDTH_1=y
775CONFIG_MTD_MAP_BANK_WIDTH_2=y
776CONFIG_MTD_MAP_BANK_WIDTH_4=y
777# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
778# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
779# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
780CONFIG_MTD_CFI_I1=y
781CONFIG_MTD_CFI_I2=y
782# CONFIG_MTD_CFI_I4 is not set
783# CONFIG_MTD_CFI_I8 is not set
784CONFIG_MTD_CFI_INTELEXT=m
785CONFIG_MTD_CFI_AMDSTD=m
786CONFIG_MTD_CFI_STAA=m
787CONFIG_MTD_CFI_UTIL=m
788CONFIG_MTD_RAM=m
789CONFIG_MTD_ROM=m
790CONFIG_MTD_ABSENT=m
791
792#
793# Mapping drivers for chip access
794#
795CONFIG_MTD_COMPLEX_MAPPINGS=y
796CONFIG_MTD_PHYSMAP=m
797CONFIG_MTD_PHYSMAP_START=0x8000000
798CONFIG_MTD_PHYSMAP_LEN=0x4000000
799CONFIG_MTD_PHYSMAP_BANKWIDTH=2
800# CONFIG_MTD_ALCHEMY is not set
801# CONFIG_MTD_MTX1 is not set
802CONFIG_MTD_PCI=m
803CONFIG_MTD_PLATRAM=m
804
805#
806# Self-contained MTD device drivers
807#
808CONFIG_MTD_PMC551=m
809# CONFIG_MTD_PMC551_BUGFIX is not set
810# CONFIG_MTD_PMC551_DEBUG is not set
811CONFIG_MTD_DATAFLASH=m
812CONFIG_MTD_M25P80=m
813CONFIG_MTD_SLRAM=m
814CONFIG_MTD_PHRAM=m
815CONFIG_MTD_MTDRAM=m
816CONFIG_MTDRAM_TOTAL_SIZE=4096
817CONFIG_MTDRAM_ERASE_SIZE=128
818CONFIG_MTD_BLOCK2MTD=m
819
820#
821# Disk-On-Chip Device Drivers
822#
823CONFIG_MTD_DOC2000=m
824CONFIG_MTD_DOC2001=m
825CONFIG_MTD_DOC2001PLUS=m
826CONFIG_MTD_DOCPROBE=m
827CONFIG_MTD_DOCECC=m
828# CONFIG_MTD_DOCPROBE_ADVANCED is not set
829CONFIG_MTD_DOCPROBE_ADDRESS=0
830CONFIG_MTD_NAND=m
831# CONFIG_MTD_NAND_VERIFY_WRITE is not set
832# CONFIG_MTD_NAND_ECC_SMC is not set
833# CONFIG_MTD_NAND_MUSEUM_IDS is not set
834CONFIG_MTD_NAND_IDS=m
835CONFIG_MTD_NAND_DISKONCHIP=m
836# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
837CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
838# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
839# CONFIG_MTD_NAND_CAFE is not set
840CONFIG_MTD_NAND_NANDSIM=m
841# CONFIG_MTD_NAND_PLATFORM is not set
842CONFIG_MTD_ONENAND=m
843CONFIG_MTD_ONENAND_VERIFY_WRITE=y
844# CONFIG_MTD_ONENAND_OTP is not set
845
846#
847# UBI - Unsorted block images
848#
849# CONFIG_MTD_UBI is not set
850CONFIG_PARPORT=m
851CONFIG_PARPORT_PC=m
852CONFIG_PARPORT_SERIAL=m
853CONFIG_PARPORT_PC_FIFO=y
854CONFIG_PARPORT_PC_SUPERIO=y
855CONFIG_PARPORT_PC_PCMCIA=m
856# CONFIG_PARPORT_GSC is not set
857CONFIG_PARPORT_AX88796=m
858CONFIG_PARPORT_1284=y
859CONFIG_PARPORT_NOT_PC=y
860CONFIG_BLK_DEV=y
861CONFIG_PARIDE=m
862
863#
864# Parallel IDE high-level drivers
865#
866CONFIG_PARIDE_PD=m
867CONFIG_PARIDE_PCD=m
868CONFIG_PARIDE_PF=m
869CONFIG_PARIDE_PT=m
870CONFIG_PARIDE_PG=m
871
872#
873# Parallel IDE protocol modules
874#
875CONFIG_PARIDE_ATEN=m
876CONFIG_PARIDE_BPCK=m
877CONFIG_PARIDE_BPCK6=m
878CONFIG_PARIDE_COMM=m
879CONFIG_PARIDE_DSTR=m
880CONFIG_PARIDE_FIT2=m
881CONFIG_PARIDE_FIT3=m
882CONFIG_PARIDE_EPAT=m
883CONFIG_PARIDE_EPATC8=y
884CONFIG_PARIDE_EPIA=m
885CONFIG_PARIDE_FRIQ=m
886CONFIG_PARIDE_FRPW=m
887CONFIG_PARIDE_KBIC=m
888CONFIG_PARIDE_KTTI=m
889CONFIG_PARIDE_ON20=m
890CONFIG_PARIDE_ON26=m
891CONFIG_BLK_CPQ_DA=m
892CONFIG_BLK_CPQ_CISS_DA=m
893CONFIG_CISS_SCSI_TAPE=y
894CONFIG_BLK_DEV_DAC960=m
895CONFIG_BLK_DEV_UMEM=m
896# CONFIG_BLK_DEV_COW_COMMON is not set
897CONFIG_BLK_DEV_LOOP=m
898CONFIG_BLK_DEV_CRYPTOLOOP=m
899CONFIG_BLK_DEV_NBD=m
900CONFIG_BLK_DEV_SX8=m
901# CONFIG_BLK_DEV_UB is not set
902CONFIG_BLK_DEV_RAM=y
903CONFIG_BLK_DEV_RAM_COUNT=16
904CONFIG_BLK_DEV_RAM_SIZE=65536
905CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
906CONFIG_CDROM_PKTCDVD=m
907CONFIG_CDROM_PKTCDVD_BUFFERS=8
908# CONFIG_CDROM_PKTCDVD_WCACHE is not set
909CONFIG_ATA_OVER_ETH=m
910CONFIG_MISC_DEVICES=y
911# CONFIG_PHANTOM is not set
912# CONFIG_EEPROM_93CX6 is not set
913CONFIG_SGI_IOC4=m
914CONFIG_TIFM_CORE=m
915CONFIG_TIFM_7XX1=m
916CONFIG_IDE=y
917CONFIG_IDE_MAX_HWIFS=4
918CONFIG_BLK_DEV_IDE=y
919
920#
921# Please see Documentation/ide.txt for help/info on IDE drives
922#
923# CONFIG_BLK_DEV_IDE_SATA is not set
924CONFIG_BLK_DEV_IDEDISK=m
925# CONFIG_IDEDISK_MULTI_MODE is not set
926CONFIG_BLK_DEV_IDECS=m
927# CONFIG_BLK_DEV_DELKIN is not set
928CONFIG_BLK_DEV_IDECD=m
929CONFIG_BLK_DEV_IDETAPE=m
930CONFIG_BLK_DEV_IDEFLOPPY=m
931CONFIG_BLK_DEV_IDESCSI=m
932# CONFIG_IDE_TASK_IOCTL is not set
933CONFIG_IDE_PROC_FS=y
934
935#
936# IDE chipset support/bugfixes
937#
938CONFIG_IDE_GENERIC=m
939CONFIG_BLK_DEV_IDEPCI=y
940CONFIG_IDEPCI_SHARE_IRQ=y
941CONFIG_IDEPCI_PCIBUS_ORDER=y
942# CONFIG_BLK_DEV_OFFBOARD is not set
943CONFIG_BLK_DEV_GENERIC=m
944CONFIG_BLK_DEV_OPTI621=m
945CONFIG_BLK_DEV_IDEDMA_PCI=y
946# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
947# CONFIG_IDEDMA_ONLYDISK is not set
948CONFIG_BLK_DEV_AEC62XX=m
949CONFIG_BLK_DEV_ALI15X3=m
950# CONFIG_WDC_ALI15X3 is not set
951CONFIG_BLK_DEV_AMD74XX=m
952CONFIG_BLK_DEV_CMD64X=m
953CONFIG_BLK_DEV_TRIFLEX=m
954CONFIG_BLK_DEV_CY82C693=m
955# CONFIG_BLK_DEV_CS5520 is not set
956CONFIG_BLK_DEV_CS5530=m
957CONFIG_BLK_DEV_HPT34X=m
958# CONFIG_HPT34X_AUTODMA is not set
959CONFIG_BLK_DEV_HPT366=m
960# CONFIG_BLK_DEV_JMICRON is not set
961CONFIG_BLK_DEV_SC1200=m
962CONFIG_BLK_DEV_PIIX=m
963# CONFIG_BLK_DEV_IT8213 is not set
964CONFIG_BLK_DEV_IT821X=m
965CONFIG_BLK_DEV_NS87415=m
966CONFIG_BLK_DEV_PDC202XX_OLD=m
967CONFIG_PDC202XX_BURST=y
968CONFIG_BLK_DEV_PDC202XX_NEW=m
969CONFIG_BLK_DEV_SVWKS=m
970CONFIG_BLK_DEV_SIIMAGE=m
971# CONFIG_BLK_DEV_SLC90E66 is not set
972CONFIG_BLK_DEV_TRM290=m
973# CONFIG_BLK_DEV_VIA82CXXX is not set
974# CONFIG_BLK_DEV_TC86C001 is not set
975# CONFIG_IDE_ARM is not set
976CONFIG_BLK_DEV_IDEDMA=y
977# CONFIG_IDEDMA_IVB is not set
978# CONFIG_BLK_DEV_HD is not set
979
980#
981# SCSI device support
982#
983CONFIG_RAID_ATTRS=m
984CONFIG_SCSI=m
985CONFIG_SCSI_DMA=y
986# CONFIG_SCSI_TGT is not set
987CONFIG_SCSI_NETLINK=y
988CONFIG_SCSI_PROC_FS=y
989
990#
991# SCSI support type (disk, tape, CD-ROM)
992#
993CONFIG_BLK_DEV_SD=m
994CONFIG_CHR_DEV_ST=m
995CONFIG_CHR_DEV_OSST=m
996CONFIG_BLK_DEV_SR=m
997# CONFIG_BLK_DEV_SR_VENDOR is not set
998CONFIG_CHR_DEV_SG=m
999CONFIG_CHR_DEV_SCH=m
1000
1001#
1002# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
1003#
1004CONFIG_SCSI_MULTI_LUN=y
1005CONFIG_SCSI_CONSTANTS=y
1006CONFIG_SCSI_LOGGING=y
1007# CONFIG_SCSI_SCAN_ASYNC is not set
1008CONFIG_SCSI_WAIT_SCAN=m
1009
1010#
1011# SCSI Transports
1012#
1013CONFIG_SCSI_SPI_ATTRS=m
1014CONFIG_SCSI_FC_ATTRS=m
1015CONFIG_SCSI_ISCSI_ATTRS=m
1016CONFIG_SCSI_SAS_ATTRS=m
1017CONFIG_SCSI_SAS_LIBSAS=m
1018# CONFIG_SCSI_SAS_ATA is not set
1019# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
1020CONFIG_SCSI_LOWLEVEL=y
1021CONFIG_ISCSI_TCP=m
1022CONFIG_BLK_DEV_3W_XXXX_RAID=m
1023CONFIG_SCSI_3W_9XXX=m
1024CONFIG_SCSI_ACARD=m
1025CONFIG_SCSI_AACRAID=m
1026CONFIG_SCSI_AIC7XXX=m
1027CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
1028CONFIG_AIC7XXX_RESET_DELAY_MS=15000
1029CONFIG_AIC7XXX_DEBUG_ENABLE=y
1030CONFIG_AIC7XXX_DEBUG_MASK=0
1031CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
1032# CONFIG_SCSI_AIC7XXX_OLD is not set
1033CONFIG_SCSI_AIC79XX=m
1034CONFIG_AIC79XX_CMDS_PER_DEVICE=32
1035CONFIG_AIC79XX_RESET_DELAY_MS=15000
1036CONFIG_AIC79XX_DEBUG_ENABLE=y
1037CONFIG_AIC79XX_DEBUG_MASK=0
1038CONFIG_AIC79XX_REG_PRETTY_PRINT=y
1039CONFIG_SCSI_AIC94XX=m
1040# CONFIG_AIC94XX_DEBUG is not set
1041CONFIG_SCSI_DPT_I2O=m
1042CONFIG_SCSI_ARCMSR=m
1043CONFIG_MEGARAID_NEWGEN=y
1044CONFIG_MEGARAID_MM=m
1045CONFIG_MEGARAID_MAILBOX=m
1046CONFIG_MEGARAID_LEGACY=m
1047CONFIG_MEGARAID_SAS=m
1048CONFIG_SCSI_HPTIOP=m
1049CONFIG_SCSI_DMX3191D=m
1050CONFIG_SCSI_FUTURE_DOMAIN=m
1051CONFIG_SCSI_IPS=m
1052CONFIG_SCSI_INITIO=m
1053# CONFIG_SCSI_INIA100 is not set
1054CONFIG_SCSI_PPA=m
1055CONFIG_SCSI_IMM=m
1056# CONFIG_SCSI_IZIP_EPP16 is not set
1057# CONFIG_SCSI_IZIP_SLOW_CTR is not set
1058CONFIG_SCSI_STEX=m
1059CONFIG_SCSI_SYM53C8XX_2=m
1060CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
1061CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
1062CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
1063CONFIG_SCSI_SYM53C8XX_MMIO=y
1064CONFIG_SCSI_IPR=m
1065# CONFIG_SCSI_IPR_TRACE is not set
1066# CONFIG_SCSI_IPR_DUMP is not set
1067CONFIG_SCSI_QLOGIC_1280=m
1068CONFIG_SCSI_QLA_FC=m
1069CONFIG_SCSI_QLA_ISCSI=m
1070CONFIG_SCSI_LPFC=m
1071CONFIG_SCSI_DC395x=m
1072CONFIG_SCSI_DC390T=m
1073CONFIG_SCSI_NSP32=m
1074CONFIG_SCSI_DEBUG=m
1075# CONFIG_SCSI_SRP is not set
1076# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
1077CONFIG_ATA=m
1078# CONFIG_ATA_NONSTANDARD is not set
1079CONFIG_SATA_AHCI=m
1080CONFIG_SATA_SVW=m
1081CONFIG_ATA_PIIX=m
1082CONFIG_SATA_MV=m
1083CONFIG_SATA_NV=m
1084CONFIG_PDC_ADMA=m
1085CONFIG_SATA_QSTOR=m
1086CONFIG_SATA_PROMISE=m
1087CONFIG_SATA_SX4=m
1088CONFIG_SATA_SIL=m
1089CONFIG_SATA_SIL24=m
1090CONFIG_SATA_SIS=m
1091CONFIG_SATA_ULI=m
1092CONFIG_SATA_VIA=m
1093CONFIG_SATA_VITESSE=m
1094# CONFIG_SATA_INIC162X is not set
1095# CONFIG_PATA_ALI is not set
1096# CONFIG_PATA_AMD is not set
1097# CONFIG_PATA_ARTOP is not set
1098# CONFIG_PATA_ATIIXP is not set
1099# CONFIG_PATA_CMD640_PCI is not set
1100# CONFIG_PATA_CMD64X is not set
1101CONFIG_PATA_CS5520=m
1102# CONFIG_PATA_CS5530 is not set
1103# CONFIG_PATA_CYPRESS is not set
1104CONFIG_PATA_EFAR=m
1105CONFIG_ATA_GENERIC=m
1106# CONFIG_PATA_HPT366 is not set
1107# CONFIG_PATA_HPT37X is not set
1108# CONFIG_PATA_HPT3X2N is not set
1109# CONFIG_PATA_HPT3X3 is not set
1110# CONFIG_PATA_IT821X is not set
1111# CONFIG_PATA_IT8213 is not set
1112CONFIG_PATA_JMICRON=m
1113CONFIG_PATA_TRIFLEX=m
1114# CONFIG_PATA_MARVELL is not set
1115CONFIG_PATA_MPIIX=m
1116# CONFIG_PATA_OLDPIIX is not set
1117CONFIG_PATA_NETCELL=m
1118# CONFIG_PATA_NS87410 is not set
1119# CONFIG_PATA_OPTI is not set
1120# CONFIG_PATA_OPTIDMA is not set
1121CONFIG_PATA_PCMCIA=m
1122# CONFIG_PATA_PDC_OLD is not set
1123# CONFIG_PATA_RADISYS is not set
1124CONFIG_PATA_RZ1000=m
1125# CONFIG_PATA_SC1200 is not set
1126# CONFIG_PATA_SERVERWORKS is not set
1127CONFIG_PATA_PDC2027X=m
1128CONFIG_PATA_SIL680=m
1129CONFIG_PATA_SIS=m
1130CONFIG_PATA_VIA=m
1131CONFIG_PATA_WINBOND=m
1132# CONFIG_PATA_PLATFORM is not set
1133CONFIG_MD=y
1134CONFIG_BLK_DEV_MD=m
1135CONFIG_MD_LINEAR=m
1136CONFIG_MD_RAID0=m
1137CONFIG_MD_RAID1=m
1138CONFIG_MD_RAID10=m
1139CONFIG_MD_RAID456=m
1140# CONFIG_MD_RAID5_RESHAPE is not set
1141CONFIG_MD_MULTIPATH=m
1142CONFIG_MD_FAULTY=m
1143CONFIG_BLK_DEV_DM=m
1144# CONFIG_DM_DEBUG is not set
1145CONFIG_DM_CRYPT=m
1146CONFIG_DM_SNAPSHOT=m
1147CONFIG_DM_MIRROR=m
1148CONFIG_DM_ZERO=m
1149CONFIG_DM_MULTIPATH=m
1150CONFIG_DM_MULTIPATH_EMC=m
1151# CONFIG_DM_MULTIPATH_RDAC is not set
1152# CONFIG_DM_DELAY is not set
1153
1154#
1155# Fusion MPT device support
1156#
1157CONFIG_FUSION=y
1158CONFIG_FUSION_SPI=m
1159CONFIG_FUSION_FC=m
1160CONFIG_FUSION_SAS=m
1161CONFIG_FUSION_MAX_SGE=128
1162CONFIG_FUSION_CTL=m
1163CONFIG_FUSION_LAN=m
1164# CONFIG_FUSION_LOGGING is not set
1165
1166#
1167# IEEE 1394 (FireWire) support
1168#
1169# CONFIG_FIREWIRE is not set
1170CONFIG_IEEE1394=m
1171
1172#
1173# Subsystem Options
1174#
1175# CONFIG_IEEE1394_VERBOSEDEBUG is not set
1176
1177#
1178# Controllers
1179#
1180CONFIG_IEEE1394_PCILYNX=m
1181CONFIG_IEEE1394_OHCI1394=m
1182
1183#
1184# Protocols
1185#
1186CONFIG_IEEE1394_VIDEO1394=m
1187CONFIG_IEEE1394_SBP2=m
1188# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
1189CONFIG_IEEE1394_ETH1394_ROM_ENTRY=y
1190CONFIG_IEEE1394_ETH1394=m
1191CONFIG_IEEE1394_DV1394=m
1192CONFIG_IEEE1394_RAWIO=m
1193CONFIG_I2O=m
1194CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=y
1195CONFIG_I2O_EXT_ADAPTEC=y
1196CONFIG_I2O_CONFIG=m
1197CONFIG_I2O_CONFIG_OLD_IOCTL=y
1198CONFIG_I2O_BUS=m
1199CONFIG_I2O_BLOCK=m
1200CONFIG_I2O_SCSI=m
1201CONFIG_I2O_PROC=m
1202CONFIG_NETDEVICES=y
1203# CONFIG_NETDEVICES_MULTIQUEUE is not set
1204# CONFIG_IFB is not set
1205CONFIG_DUMMY=m
1206CONFIG_BONDING=m
1207# CONFIG_MACVLAN is not set
1208CONFIG_EQUALIZER=m
1209CONFIG_TUN=m
1210CONFIG_ARCNET=m
1211CONFIG_ARCNET_1201=m
1212CONFIG_ARCNET_1051=m
1213CONFIG_ARCNET_RAW=m
1214CONFIG_ARCNET_CAP=m
1215CONFIG_ARCNET_COM90xx=m
1216CONFIG_ARCNET_COM90xxIO=m
1217CONFIG_ARCNET_RIM_I=m
1218CONFIG_ARCNET_COM20020=m
1219CONFIG_ARCNET_COM20020_PCI=m
1220CONFIG_PHYLIB=m
1221
1222#
1223# MII PHY device drivers
1224#
1225CONFIG_MARVELL_PHY=m
1226CONFIG_DAVICOM_PHY=m
1227CONFIG_QSEMI_PHY=m
1228CONFIG_LXT_PHY=m
1229CONFIG_CICADA_PHY=m
1230CONFIG_VITESSE_PHY=m
1231CONFIG_SMSC_PHY=m
1232# CONFIG_BROADCOM_PHY is not set
1233# CONFIG_ICPLUS_PHY is not set
1234CONFIG_FIXED_PHY=m
1235# CONFIG_FIXED_MII_10_FDX is not set
1236# CONFIG_FIXED_MII_100_FDX is not set
1237CONFIG_NET_ETHERNET=y
1238CONFIG_MII=m
1239# CONFIG_AX88796 is not set
1240# CONFIG_MIPS_AU1X00_ENET is not set
1241CONFIG_HAPPYMEAL=m
1242CONFIG_SUNGEM=m
1243CONFIG_CASSINI=m
1244CONFIG_NET_VENDOR_3COM=y
1245CONFIG_VORTEX=m
1246CONFIG_TYPHOON=m
1247# CONFIG_SMC91X is not set
1248# CONFIG_DM9000 is not set
1249CONFIG_NET_TULIP=y
1250CONFIG_DE2104X=m
1251CONFIG_TULIP=m
1252# CONFIG_TULIP_MWI is not set
1253# CONFIG_TULIP_MMIO is not set
1254# CONFIG_TULIP_NAPI is not set
1255CONFIG_DE4X5=m
1256CONFIG_WINBOND_840=m
1257CONFIG_DM9102=m
1258CONFIG_ULI526X=m
1259CONFIG_PCMCIA_XIRCOM=m
1260# CONFIG_PCMCIA_XIRTULIP is not set
1261CONFIG_HP100=m
1262CONFIG_NET_PCI=y
1263CONFIG_PCNET32=m
1264# CONFIG_PCNET32_NAPI is not set
1265CONFIG_AMD8111_ETH=m
1266# CONFIG_AMD8111E_NAPI is not set
1267CONFIG_ADAPTEC_STARFIRE=m
1268# CONFIG_ADAPTEC_STARFIRE_NAPI is not set
1269CONFIG_B44=m
1270CONFIG_FORCEDETH=m
1271# CONFIG_FORCEDETH_NAPI is not set
1272# CONFIG_TC35815 is not set
1273CONFIG_DGRS=m
1274CONFIG_EEPRO100=m
1275CONFIG_E100=m
1276CONFIG_FEALNX=m
1277CONFIG_NATSEMI=m
1278CONFIG_NE2K_PCI=m
1279CONFIG_8139CP=m
1280CONFIG_8139TOO=m
1281# CONFIG_8139TOO_PIO is not set
1282# CONFIG_8139TOO_TUNE_TWISTER is not set
1283CONFIG_8139TOO_8129=y
1284# CONFIG_8139_OLD_RX_RESET is not set
1285CONFIG_SIS900=m
1286CONFIG_EPIC100=m
1287CONFIG_SUNDANCE=m
1288# CONFIG_SUNDANCE_MMIO is not set
1289CONFIG_TLAN=m
1290CONFIG_VIA_RHINE=m
1291# CONFIG_VIA_RHINE_MMIO is not set
1292# CONFIG_VIA_RHINE_NAPI is not set
1293# CONFIG_SC92031 is not set
1294CONFIG_NET_POCKET=y
1295CONFIG_DE600=m
1296CONFIG_DE620=m
1297CONFIG_NETDEV_1000=y
1298CONFIG_ACENIC=m
1299# CONFIG_ACENIC_OMIT_TIGON_I is not set
1300CONFIG_DL2K=m
1301CONFIG_E1000=m
1302# CONFIG_E1000_NAPI is not set
1303# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
1304CONFIG_NS83820=m
1305CONFIG_HAMACHI=m
1306CONFIG_YELLOWFIN=m
1307CONFIG_R8169=m
1308# CONFIG_R8169_NAPI is not set
1309CONFIG_R8169_VLAN=y
1310CONFIG_SIS190=m
1311CONFIG_SKGE=m
1312CONFIG_SKY2=m
1313CONFIG_SK98LIN=m
1314CONFIG_VIA_VELOCITY=m
1315CONFIG_TIGON3=m
1316CONFIG_BNX2=m
1317CONFIG_QLA3XXX=m
1318# CONFIG_ATL1 is not set
1319CONFIG_NETDEV_10000=y
1320CONFIG_CHELSIO_T1=m
1321# CONFIG_CHELSIO_T1_1G is not set
1322CONFIG_CHELSIO_T1_NAPI=y
1323# CONFIG_CHELSIO_T3 is not set
1324CONFIG_IXGB=m
1325# CONFIG_IXGB_NAPI is not set
1326CONFIG_S2IO=m
1327# CONFIG_S2IO_NAPI is not set
1328CONFIG_MYRI10GE=m
1329# CONFIG_NETXEN_NIC is not set
1330# CONFIG_MLX4_CORE is not set
1331CONFIG_TR=y
1332CONFIG_IBMOL=m
1333CONFIG_IBMLS=m
1334CONFIG_3C359=m
1335CONFIG_TMS380TR=m
1336CONFIG_TMSPCI=m
1337CONFIG_ABYSS=m
1338
1339#
1340# Wireless LAN
1341#
1342# CONFIG_WLAN_PRE80211 is not set
1343# CONFIG_WLAN_80211 is not set
1344
1345#
1346# USB Network Adapters
1347#
1348CONFIG_USB_CATC=m
1349CONFIG_USB_KAWETH=m
1350CONFIG_USB_PEGASUS=m
1351CONFIG_USB_RTL8150=m
1352CONFIG_USB_USBNET_MII=m
1353CONFIG_USB_USBNET=m
1354CONFIG_USB_NET_AX8817X=m
1355CONFIG_USB_NET_CDCETHER=m
1356# CONFIG_USB_NET_DM9601 is not set
1357CONFIG_USB_NET_GL620A=m
1358CONFIG_USB_NET_NET1080=m
1359CONFIG_USB_NET_PLUSB=m
1360CONFIG_USB_NET_MCS7830=m
1361CONFIG_USB_NET_RNDIS_HOST=m
1362CONFIG_USB_NET_CDC_SUBSET=m
1363CONFIG_USB_ALI_M5632=y
1364CONFIG_USB_AN2720=y
1365CONFIG_USB_BELKIN=y
1366CONFIG_USB_ARMLINUX=y
1367CONFIG_USB_EPSON2888=y
1368# CONFIG_USB_KC2190 is not set
1369CONFIG_USB_NET_ZAURUS=m
1370CONFIG_NET_PCMCIA=y
1371CONFIG_PCMCIA_3C589=m
1372CONFIG_PCMCIA_3C574=m
1373CONFIG_PCMCIA_FMVJ18X=m
1374CONFIG_PCMCIA_PCNET=m
1375CONFIG_PCMCIA_NMCLAN=m
1376CONFIG_PCMCIA_SMC91C92=m
1377CONFIG_PCMCIA_XIRC2PS=m
1378CONFIG_PCMCIA_AXNET=m
1379CONFIG_ARCNET_COM20020_CS=m
1380CONFIG_PCMCIA_IBMTR=m
1381CONFIG_WAN=y
1382CONFIG_LANMEDIA=m
1383CONFIG_HDLC=m
1384CONFIG_HDLC_RAW=m
1385CONFIG_HDLC_RAW_ETH=m
1386CONFIG_HDLC_CISCO=m
1387CONFIG_HDLC_FR=m
1388CONFIG_HDLC_PPP=m
1389CONFIG_HDLC_X25=m
1390CONFIG_PCI200SYN=m
1391CONFIG_WANXL=m
1392CONFIG_PC300=m
1393CONFIG_PC300_MLPPP=y
1394
1395#
1396# Cyclades-PC300 MLPPP support is disabled.
1397#
1398
1399#
1400# Refer to the file README.mlppp, provided by PC300 package.
1401#
1402# CONFIG_PC300TOO is not set
1403CONFIG_FARSYNC=m
1404CONFIG_DSCC4=m
1405CONFIG_DSCC4_PCISYNC=y
1406CONFIG_DSCC4_PCI_RST=y
1407CONFIG_DLCI=m
1408CONFIG_DLCI_MAX=8
1409CONFIG_WAN_ROUTER_DRIVERS=m
1410CONFIG_CYCLADES_SYNC=m
1411CONFIG_CYCLOMX_X25=y
1412CONFIG_LAPBETHER=m
1413CONFIG_X25_ASY=m
1414CONFIG_ATM_DRIVERS=y
1415# CONFIG_ATM_DUMMY is not set
1416CONFIG_ATM_TCP=m
1417CONFIG_ATM_LANAI=m
1418CONFIG_ATM_ENI=m
1419# CONFIG_ATM_ENI_DEBUG is not set
1420# CONFIG_ATM_ENI_TUNE_BURST is not set
1421CONFIG_ATM_FIRESTREAM=m
1422CONFIG_ATM_ZATM=m
1423# CONFIG_ATM_ZATM_DEBUG is not set
1424CONFIG_ATM_NICSTAR=m
1425# CONFIG_ATM_NICSTAR_USE_SUNI is not set
1426# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
1427CONFIG_ATM_IDT77252=m
1428# CONFIG_ATM_IDT77252_DEBUG is not set
1429# CONFIG_ATM_IDT77252_RCV_ALL is not set
1430CONFIG_ATM_IDT77252_USE_SUNI=y
1431CONFIG_ATM_AMBASSADOR=m
1432# CONFIG_ATM_AMBASSADOR_DEBUG is not set
1433CONFIG_ATM_HORIZON=m
1434# CONFIG_ATM_HORIZON_DEBUG is not set
1435CONFIG_ATM_IA=m
1436# CONFIG_ATM_IA_DEBUG is not set
1437CONFIG_ATM_FORE200E_MAYBE=m
1438CONFIG_ATM_FORE200E_PCA=y
1439CONFIG_ATM_FORE200E_PCA_DEFAULT_FW=y
1440# CONFIG_ATM_FORE200E_USE_TASKLET is not set
1441CONFIG_ATM_FORE200E_TX_RETRY=16
1442CONFIG_ATM_FORE200E_DEBUG=0
1443CONFIG_ATM_FORE200E=m
1444CONFIG_ATM_HE=m
1445CONFIG_ATM_HE_USE_SUNI=y
1446CONFIG_FDDI=y
1447CONFIG_DEFXX=m
1448# CONFIG_DEFXX_MMIO is not set
1449CONFIG_SKFP=m
1450CONFIG_HIPPI=y
1451CONFIG_ROADRUNNER=m
1452# CONFIG_ROADRUNNER_LARGE_RINGS is not set
1453CONFIG_PLIP=m
1454CONFIG_PPP=m
1455CONFIG_PPP_MULTILINK=y
1456CONFIG_PPP_FILTER=y
1457CONFIG_PPP_ASYNC=m
1458CONFIG_PPP_SYNC_TTY=m
1459CONFIG_PPP_DEFLATE=m
1460CONFIG_PPP_BSDCOMP=m
1461CONFIG_PPP_MPPE=m
1462CONFIG_PPPOE=m
1463CONFIG_PPPOATM=m
1464# CONFIG_PPPOL2TP is not set
1465CONFIG_SLIP=m
1466CONFIG_SLIP_COMPRESSED=y
1467CONFIG_SLHC=m
1468CONFIG_SLIP_SMART=y
1469CONFIG_SLIP_MODE_SLIP6=y
1470CONFIG_NET_FC=y
1471CONFIG_SHAPER=m
1472CONFIG_NETCONSOLE=m
1473CONFIG_NETPOLL=y
1474# CONFIG_NETPOLL_TRAP is not set
1475CONFIG_NET_POLL_CONTROLLER=y
1476CONFIG_ISDN=m
1477CONFIG_ISDN_I4L=m
1478CONFIG_ISDN_PPP=y
1479CONFIG_ISDN_PPP_VJ=y
1480CONFIG_ISDN_MPP=y
1481CONFIG_IPPP_FILTER=y
1482CONFIG_ISDN_PPP_BSDCOMP=m
1483CONFIG_ISDN_AUDIO=y
1484CONFIG_ISDN_TTY_FAX=y
1485CONFIG_ISDN_X25=y
1486
1487#
1488# ISDN feature submodules
1489#
1490# CONFIG_ISDN_DRV_LOOP is not set
1491CONFIG_ISDN_DIVERSION=m
1492
1493#
1494# ISDN4Linux hardware drivers
1495#
1496
1497#
1498# Passive cards
1499#
1500CONFIG_ISDN_DRV_HISAX=m
1501
1502#
1503# D-channel protocol features
1504#
1505CONFIG_HISAX_EURO=y
1506CONFIG_DE_AOC=y
1507# CONFIG_HISAX_NO_SENDCOMPLETE is not set
1508# CONFIG_HISAX_NO_LLC is not set
1509# CONFIG_HISAX_NO_KEYPAD is not set
1510CONFIG_HISAX_1TR6=y
1511CONFIG_HISAX_NI1=y
1512CONFIG_HISAX_MAX_CARDS=8
1513
1514#
1515# HiSax supported cards
1516#
1517CONFIG_HISAX_16_3=y
1518CONFIG_HISAX_TELESPCI=y
1519CONFIG_HISAX_S0BOX=y
1520CONFIG_HISAX_FRITZPCI=y
1521CONFIG_HISAX_AVM_A1_PCMCIA=y
1522CONFIG_HISAX_ELSA=y
1523CONFIG_HISAX_DIEHLDIVA=y
1524CONFIG_HISAX_SEDLBAUER=y
1525CONFIG_HISAX_NETJET=y
1526CONFIG_HISAX_NETJET_U=y
1527CONFIG_HISAX_NICCY=y
1528CONFIG_HISAX_BKM_A4T=y
1529CONFIG_HISAX_SCT_QUADRO=y
1530CONFIG_HISAX_GAZEL=y
1531CONFIG_HISAX_HFC_PCI=y
1532CONFIG_HISAX_W6692=y
1533CONFIG_HISAX_HFC_SX=y
1534CONFIG_HISAX_ENTERNOW_PCI=y
1535# CONFIG_HISAX_DEBUG is not set
1536
1537#
1538# HiSax PCMCIA card service modules
1539#
1540CONFIG_HISAX_SEDLBAUER_CS=m
1541CONFIG_HISAX_ELSA_CS=m
1542CONFIG_HISAX_AVM_A1_CS=m
1543CONFIG_HISAX_TELES_CS=m
1544
1545#
1546# HiSax sub driver modules
1547#
1548CONFIG_HISAX_ST5481=m
1549CONFIG_HISAX_HFCUSB=m
1550CONFIG_HISAX_HFC4S8S=m
1551CONFIG_HISAX_FRITZ_PCIPNP=m
1552CONFIG_HISAX_HDLC=y
1553
1554#
1555# Active cards
1556#
1557# CONFIG_HYSDN is not set
1558CONFIG_ISDN_DRV_GIGASET=m
1559CONFIG_GIGASET_BASE=m
1560CONFIG_GIGASET_M105=m
1561# CONFIG_GIGASET_M101 is not set
1562# CONFIG_GIGASET_DEBUG is not set
1563# CONFIG_GIGASET_UNDOCREQ is not set
1564CONFIG_ISDN_CAPI=m
1565CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y
1566CONFIG_CAPI_TRACE=y
1567CONFIG_ISDN_CAPI_MIDDLEWARE=y
1568CONFIG_ISDN_CAPI_CAPI20=m
1569CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
1570CONFIG_ISDN_CAPI_CAPIFS=m
1571CONFIG_ISDN_CAPI_CAPIDRV=m
1572
1573#
1574# CAPI hardware drivers
1575#
1576CONFIG_CAPI_AVM=y
1577CONFIG_ISDN_DRV_AVMB1_B1PCI=m
1578CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
1579CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
1580CONFIG_ISDN_DRV_AVMB1_AVM_CS=m
1581CONFIG_ISDN_DRV_AVMB1_T1PCI=m
1582CONFIG_ISDN_DRV_AVMB1_C4=m
1583CONFIG_CAPI_EICON=y
1584CONFIG_ISDN_DIVAS=m
1585CONFIG_ISDN_DIVAS_BRIPCI=y
1586CONFIG_ISDN_DIVAS_PRIPCI=y
1587CONFIG_ISDN_DIVAS_DIVACAPI=m
1588CONFIG_ISDN_DIVAS_USERIDI=m
1589CONFIG_ISDN_DIVAS_MAINT=m
1590CONFIG_PHONE=m
1591CONFIG_PHONE_IXJ=m
1592CONFIG_PHONE_IXJ_PCMCIA=m
1593
1594#
1595# Input device support
1596#
1597CONFIG_INPUT=y
1598CONFIG_INPUT_FF_MEMLESS=m
1599# CONFIG_INPUT_POLLDEV is not set
1600
1601#
1602# Userland interfaces
1603#
1604CONFIG_INPUT_MOUSEDEV=y
1605CONFIG_INPUT_MOUSEDEV_PSAUX=y
1606CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
1607CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
1608CONFIG_INPUT_JOYDEV=m
1609CONFIG_INPUT_TSDEV=m
1610CONFIG_INPUT_TSDEV_SCREEN_X=240
1611CONFIG_INPUT_TSDEV_SCREEN_Y=320
1612CONFIG_INPUT_EVDEV=m
1613CONFIG_INPUT_EVBUG=m
1614
1615#
1616# Input Device Drivers
1617#
1618CONFIG_INPUT_KEYBOARD=y
1619CONFIG_KEYBOARD_ATKBD=y
1620CONFIG_KEYBOARD_SUNKBD=m
1621CONFIG_KEYBOARD_LKKBD=m
1622CONFIG_KEYBOARD_XTKBD=m
1623CONFIG_KEYBOARD_NEWTON=m
1624CONFIG_KEYBOARD_STOWAWAY=m
1625CONFIG_INPUT_MOUSE=y
1626CONFIG_MOUSE_PS2=m
1627CONFIG_MOUSE_PS2_ALPS=y
1628CONFIG_MOUSE_PS2_LOGIPS2PP=y
1629CONFIG_MOUSE_PS2_SYNAPTICS=y
1630CONFIG_MOUSE_PS2_LIFEBOOK=y
1631CONFIG_MOUSE_PS2_TRACKPOINT=y
1632# CONFIG_MOUSE_PS2_TOUCHKIT is not set
1633CONFIG_MOUSE_SERIAL=m
1634# CONFIG_MOUSE_APPLETOUCH is not set
1635CONFIG_MOUSE_VSXXXAA=m
1636CONFIG_INPUT_JOYSTICK=y
1637CONFIG_JOYSTICK_ANALOG=m
1638CONFIG_JOYSTICK_A3D=m
1639CONFIG_JOYSTICK_ADI=m
1640CONFIG_JOYSTICK_COBRA=m
1641CONFIG_JOYSTICK_GF2K=m
1642CONFIG_JOYSTICK_GRIP=m
1643CONFIG_JOYSTICK_GRIP_MP=m
1644CONFIG_JOYSTICK_GUILLEMOT=m
1645CONFIG_JOYSTICK_INTERACT=m
1646CONFIG_JOYSTICK_SIDEWINDER=m
1647CONFIG_JOYSTICK_TMDC=m
1648CONFIG_JOYSTICK_IFORCE=m
1649CONFIG_JOYSTICK_IFORCE_USB=y
1650CONFIG_JOYSTICK_IFORCE_232=y
1651CONFIG_JOYSTICK_WARRIOR=m
1652CONFIG_JOYSTICK_MAGELLAN=m
1653CONFIG_JOYSTICK_SPACEORB=m
1654CONFIG_JOYSTICK_SPACEBALL=m
1655CONFIG_JOYSTICK_STINGER=m
1656CONFIG_JOYSTICK_TWIDJOY=m
1657CONFIG_JOYSTICK_DB9=m
1658CONFIG_JOYSTICK_GAMECON=m
1659CONFIG_JOYSTICK_TURBOGRAFX=m
1660CONFIG_JOYSTICK_JOYDUMP=m
1661# CONFIG_JOYSTICK_XPAD is not set
1662# CONFIG_INPUT_TABLET is not set
1663CONFIG_INPUT_TOUCHSCREEN=y
1664CONFIG_TOUCHSCREEN_ADS7846=m
1665# CONFIG_TOUCHSCREEN_FUJITSU is not set
1666CONFIG_TOUCHSCREEN_GUNZE=m
1667CONFIG_TOUCHSCREEN_ELO=m
1668CONFIG_TOUCHSCREEN_MTOUCH=m
1669CONFIG_TOUCHSCREEN_MK712=m
1670CONFIG_TOUCHSCREEN_PENMOUNT=m
1671CONFIG_TOUCHSCREEN_TOUCHRIGHT=m
1672CONFIG_TOUCHSCREEN_TOUCHWIN=m
1673# CONFIG_TOUCHSCREEN_UCB1400 is not set
1674# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
1675CONFIG_INPUT_MISC=y
1676CONFIG_INPUT_PCSPKR=m
1677# CONFIG_INPUT_ATI_REMOTE is not set
1678# CONFIG_INPUT_ATI_REMOTE2 is not set
1679# CONFIG_INPUT_KEYSPAN_REMOTE is not set
1680# CONFIG_INPUT_POWERMATE is not set
1681# CONFIG_INPUT_YEALINK is not set
1682CONFIG_INPUT_UINPUT=m
1683
1684#
1685# Hardware I/O ports
1686#
1687CONFIG_SERIO=y
1688CONFIG_SERIO_I8042=y
1689CONFIG_SERIO_SERPORT=m
1690CONFIG_SERIO_PARKBD=m
1691CONFIG_SERIO_PCIPS2=m
1692CONFIG_SERIO_LIBPS2=y
1693CONFIG_SERIO_RAW=m
1694CONFIG_GAMEPORT=m
1695CONFIG_GAMEPORT_NS558=m
1696CONFIG_GAMEPORT_L4=m
1697CONFIG_GAMEPORT_EMU10K1=m
1698CONFIG_GAMEPORT_FM801=m
1699
1700#
1701# Character devices
1702#
1703CONFIG_VT=y
1704CONFIG_VT_CONSOLE=y
1705CONFIG_HW_CONSOLE=y
1706CONFIG_VT_HW_CONSOLE_BINDING=y
1707CONFIG_SERIAL_NONSTANDARD=y
1708# CONFIG_COMPUTONE is not set
1709CONFIG_ROCKETPORT=m
1710CONFIG_CYCLADES=m
1711# CONFIG_CYZ_INTR is not set
1712CONFIG_DIGIEPCA=m
1713# CONFIG_MOXA_INTELLIO is not set
1714CONFIG_MOXA_SMARTIO=m
1715# CONFIG_MOXA_SMARTIO_NEW is not set
1716# CONFIG_ISI is not set
1717CONFIG_SYNCLINKMP=m
1718CONFIG_SYNCLINK_GT=m
1719CONFIG_N_HDLC=m
1720# CONFIG_RISCOM8 is not set
1721CONFIG_SPECIALIX=m
1722# CONFIG_SPECIALIX_RTSCTS is not set
1723CONFIG_SX=m
1724# CONFIG_RIO is not set
1725CONFIG_STALDRV=y
1726# CONFIG_STALLION is not set
1727# CONFIG_ISTALLION is not set
1728
1729#
1730# Serial drivers
1731#
1732CONFIG_SERIAL_8250=m
1733CONFIG_SERIAL_8250_PCI=m
1734CONFIG_SERIAL_8250_CS=m
1735CONFIG_SERIAL_8250_NR_UARTS=48
1736CONFIG_SERIAL_8250_RUNTIME_UARTS=4
1737CONFIG_SERIAL_8250_EXTENDED=y
1738CONFIG_SERIAL_8250_MANY_PORTS=y
1739CONFIG_SERIAL_8250_SHARE_IRQ=y
1740# CONFIG_SERIAL_8250_DETECT_IRQ is not set
1741CONFIG_SERIAL_8250_RSA=y
1742# CONFIG_SERIAL_8250_AU1X00 is not set
1743
1744#
1745# Non-8250 serial port support
1746#
1747CONFIG_SERIAL_CORE=m
1748CONFIG_SERIAL_JSM=m
1749CONFIG_UNIX98_PTYS=y
1750CONFIG_LEGACY_PTYS=y
1751CONFIG_LEGACY_PTY_COUNT=256
1752CONFIG_PRINTER=m
1753# CONFIG_LP_CONSOLE is not set
1754CONFIG_PPDEV=m
1755CONFIG_TIPAR=m
1756CONFIG_IPMI_HANDLER=m
1757# CONFIG_IPMI_PANIC_EVENT is not set
1758CONFIG_IPMI_DEVICE_INTERFACE=m
1759CONFIG_IPMI_SI=m
1760CONFIG_IPMI_WATCHDOG=m
1761CONFIG_IPMI_POWEROFF=m
1762CONFIG_WATCHDOG=y
1763# CONFIG_WATCHDOG_NOWAYOUT is not set
1764
1765#
1766# Watchdog Device Drivers
1767#
1768CONFIG_SOFT_WATCHDOG=m
1769# CONFIG_WDT_MTX1 is not set
1770
1771#
1772# PCI-based Watchdog Cards
1773#
1774CONFIG_PCIPCWATCHDOG=m
1775CONFIG_WDTPCI=m
1776CONFIG_WDT_501_PCI=y
1777
1778#
1779# USB-based Watchdog Cards
1780#
1781CONFIG_USBPCWATCHDOG=m
1782CONFIG_HW_RANDOM=y
1783CONFIG_RTC=y
1784CONFIG_R3964=m
1785CONFIG_APPLICOM=m
1786CONFIG_DRM=m
1787CONFIG_DRM_TDFX=m
1788CONFIG_DRM_R128=m
1789CONFIG_DRM_RADEON=m
1790CONFIG_DRM_MGA=m
1791CONFIG_DRM_VIA=m
1792CONFIG_DRM_SAVAGE=m
1793
1794#
1795# PCMCIA character devices
1796#
1797CONFIG_SYNCLINK_CS=m
1798CONFIG_CARDMAN_4000=m
1799CONFIG_CARDMAN_4040=m
1800CONFIG_RAW_DRIVER=m
1801CONFIG_MAX_RAW_DEVS=256
1802CONFIG_TCG_TPM=m
1803CONFIG_TCG_ATMEL=m
1804CONFIG_DEVPORT=y
1805CONFIG_I2C=m
1806CONFIG_I2C_BOARDINFO=y
1807CONFIG_I2C_CHARDEV=m
1808
1809#
1810# I2C Algorithms
1811#
1812CONFIG_I2C_ALGOBIT=m
1813CONFIG_I2C_ALGOPCF=m
1814CONFIG_I2C_ALGOPCA=m
1815
1816#
1817# I2C Hardware Bus support
1818#
1819CONFIG_I2C_ALI1535=m
1820CONFIG_I2C_ALI1563=m
1821CONFIG_I2C_ALI15X3=m
1822CONFIG_I2C_AMD756=m
1823CONFIG_I2C_AMD756_S4882=m
1824CONFIG_I2C_AMD8111=m
1825CONFIG_I2C_I801=m
1826CONFIG_I2C_I810=m
1827CONFIG_I2C_PIIX4=m
1828CONFIG_I2C_NFORCE2=m
1829CONFIG_I2C_OCORES=m
1830CONFIG_I2C_PARPORT=m
1831CONFIG_I2C_PARPORT_LIGHT=m
1832CONFIG_I2C_PROSAVAGE=m
1833CONFIG_I2C_SAVAGE4=m
1834# CONFIG_I2C_SIMTEC is not set
1835CONFIG_I2C_SIS5595=m
1836CONFIG_I2C_SIS630=m
1837CONFIG_I2C_SIS96X=m
1838# CONFIG_I2C_TAOS_EVM is not set
1839CONFIG_I2C_STUB=m
1840# CONFIG_I2C_TINY_USB is not set
1841CONFIG_I2C_VIA=m
1842CONFIG_I2C_VIAPRO=m
1843CONFIG_I2C_VOODOO3=m
1844
1845#
1846# Miscellaneous I2C Chip support
1847#
1848CONFIG_SENSORS_DS1337=m
1849CONFIG_SENSORS_DS1374=m
1850# CONFIG_DS1682 is not set
1851CONFIG_SENSORS_EEPROM=m
1852CONFIG_SENSORS_PCF8574=m
1853CONFIG_SENSORS_PCA9539=m
1854CONFIG_SENSORS_PCF8591=m
1855CONFIG_SENSORS_MAX6875=m
1856# CONFIG_SENSORS_TSL2550 is not set
1857# CONFIG_I2C_DEBUG_CORE is not set
1858# CONFIG_I2C_DEBUG_ALGO is not set
1859# CONFIG_I2C_DEBUG_BUS is not set
1860# CONFIG_I2C_DEBUG_CHIP is not set
1861
1862#
1863# SPI support
1864#
1865CONFIG_SPI=y
1866CONFIG_SPI_MASTER=y
1867
1868#
1869# SPI Master Controller Drivers
1870#
1871CONFIG_SPI_BITBANG=m
1872CONFIG_SPI_BUTTERFLY=m
1873# CONFIG_SPI_LM70_LLP is not set
1874
1875#
1876# SPI Protocol Masters
1877#
1878# CONFIG_SPI_AT25 is not set
1879# CONFIG_SPI_SPIDEV is not set
1880# CONFIG_SPI_TLE62X0 is not set
1881CONFIG_W1=m
1882CONFIG_W1_CON=y
1883
1884#
1885# 1-wire Bus Masters
1886#
1887CONFIG_W1_MASTER_MATROX=m
1888CONFIG_W1_MASTER_DS2490=m
1889CONFIG_W1_MASTER_DS2482=m
1890
1891#
1892# 1-wire Slaves
1893#
1894CONFIG_W1_SLAVE_THERM=m
1895CONFIG_W1_SLAVE_SMEM=m
1896CONFIG_W1_SLAVE_DS2433=m
1897# CONFIG_W1_SLAVE_DS2433_CRC is not set
1898# CONFIG_W1_SLAVE_DS2760 is not set
1899# CONFIG_POWER_SUPPLY is not set
1900CONFIG_HWMON=y
1901CONFIG_HWMON_VID=m
1902CONFIG_SENSORS_ABITUGURU=m
1903# CONFIG_SENSORS_ABITUGURU3 is not set
1904# CONFIG_SENSORS_AD7418 is not set
1905CONFIG_SENSORS_ADM1021=m
1906CONFIG_SENSORS_ADM1025=m
1907CONFIG_SENSORS_ADM1026=m
1908# CONFIG_SENSORS_ADM1029 is not set
1909CONFIG_SENSORS_ADM1031=m
1910CONFIG_SENSORS_ADM9240=m
1911CONFIG_SENSORS_ASB100=m
1912CONFIG_SENSORS_ATXP1=m
1913CONFIG_SENSORS_DS1621=m
1914CONFIG_SENSORS_F71805F=m
1915CONFIG_SENSORS_FSCHER=m
1916CONFIG_SENSORS_FSCPOS=m
1917CONFIG_SENSORS_GL518SM=m
1918CONFIG_SENSORS_GL520SM=m
1919CONFIG_SENSORS_IT87=m
1920CONFIG_SENSORS_LM63=m
1921CONFIG_SENSORS_LM70=m
1922CONFIG_SENSORS_LM75=m
1923CONFIG_SENSORS_LM77=m
1924CONFIG_SENSORS_LM78=m
1925CONFIG_SENSORS_LM80=m
1926CONFIG_SENSORS_LM83=m
1927CONFIG_SENSORS_LM85=m
1928CONFIG_SENSORS_LM87=m
1929CONFIG_SENSORS_LM90=m
1930CONFIG_SENSORS_LM92=m
1931# CONFIG_SENSORS_LM93 is not set
1932CONFIG_SENSORS_MAX1619=m
1933# CONFIG_SENSORS_MAX6650 is not set
1934CONFIG_SENSORS_PC87360=m
1935# CONFIG_SENSORS_PC87427 is not set
1936CONFIG_SENSORS_SIS5595=m
1937# CONFIG_SENSORS_DME1737 is not set
1938CONFIG_SENSORS_SMSC47M1=m
1939CONFIG_SENSORS_SMSC47M192=m
1940CONFIG_SENSORS_SMSC47B397=m
1941# CONFIG_SENSORS_THMC50 is not set
1942CONFIG_SENSORS_VIA686A=m
1943CONFIG_SENSORS_VT1211=m
1944CONFIG_SENSORS_VT8231=m
1945CONFIG_SENSORS_W83781D=m
1946CONFIG_SENSORS_W83791D=m
1947CONFIG_SENSORS_W83792D=m
1948# CONFIG_SENSORS_W83793 is not set
1949CONFIG_SENSORS_W83L785TS=m
1950CONFIG_SENSORS_W83627HF=m
1951CONFIG_SENSORS_W83627EHF=m
1952# CONFIG_HWMON_DEBUG_CHIP is not set
1953
1954#
1955# Multifunction device drivers
1956#
1957# CONFIG_MFD_SM501 is not set
1958
1959#
1960# Multimedia devices
1961#
1962CONFIG_VIDEO_DEV=m
1963CONFIG_VIDEO_V4L1=y
1964CONFIG_VIDEO_V4L1_COMPAT=y
1965CONFIG_VIDEO_V4L2=y
1966CONFIG_VIDEO_CAPTURE_DRIVERS=y
1967# CONFIG_VIDEO_ADV_DEBUG is not set
1968CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
1969CONFIG_VIDEO_TVAUDIO=m
1970CONFIG_VIDEO_TDA7432=m
1971CONFIG_VIDEO_TDA9840=m
1972CONFIG_VIDEO_TDA9875=m
1973CONFIG_VIDEO_TEA6415C=m
1974CONFIG_VIDEO_TEA6420=m
1975CONFIG_VIDEO_MSP3400=m
1976CONFIG_VIDEO_WM8775=m
1977CONFIG_VIDEO_BT819=m
1978CONFIG_VIDEO_BT856=m
1979CONFIG_VIDEO_KS0127=m
1980CONFIG_VIDEO_SAA7110=m
1981CONFIG_VIDEO_SAA7111=m
1982CONFIG_VIDEO_SAA7114=m
1983CONFIG_VIDEO_SAA711X=m
1984CONFIG_VIDEO_TVP5150=m
1985CONFIG_VIDEO_VPX3220=m
1986CONFIG_VIDEO_CX25840=m
1987CONFIG_VIDEO_CX2341X=m
1988CONFIG_VIDEO_SAA7185=m
1989CONFIG_VIDEO_ADV7170=m
1990CONFIG_VIDEO_ADV7175=m
1991CONFIG_VIDEO_VIVI=m
1992CONFIG_VIDEO_BT848=m
1993CONFIG_VIDEO_BT848_DVB=y
1994CONFIG_VIDEO_SAA6588=m
1995CONFIG_VIDEO_BWQCAM=m
1996CONFIG_VIDEO_CQCAM=m
1997CONFIG_VIDEO_W9966=m
1998CONFIG_VIDEO_CPIA=m
1999CONFIG_VIDEO_CPIA_PP=m
2000CONFIG_VIDEO_CPIA_USB=m
2001CONFIG_VIDEO_CPIA2=m
2002CONFIG_VIDEO_SAA5246A=m
2003CONFIG_VIDEO_SAA5249=m
2004CONFIG_TUNER_3036=m
2005# CONFIG_TUNER_TEA5761 is not set
2006CONFIG_VIDEO_STRADIS=m
2007CONFIG_VIDEO_ZORAN_ZR36060=m
2008CONFIG_VIDEO_ZORAN=m
2009CONFIG_VIDEO_ZORAN_BUZ=m
2010CONFIG_VIDEO_ZORAN_DC10=m
2011CONFIG_VIDEO_ZORAN_DC30=m
2012CONFIG_VIDEO_ZORAN_LML33=m
2013CONFIG_VIDEO_ZORAN_LML33R10=m
2014CONFIG_VIDEO_ZORAN_AVS6EYES=m
2015CONFIG_VIDEO_SAA7134=m
2016CONFIG_VIDEO_SAA7134_ALSA=m
2017CONFIG_VIDEO_SAA7134_OSS=m
2018CONFIG_VIDEO_SAA7134_DVB=m
2019CONFIG_VIDEO_MXB=m
2020CONFIG_VIDEO_DPC=m
2021CONFIG_VIDEO_HEXIUM_ORION=m
2022CONFIG_VIDEO_HEXIUM_GEMINI=m
2023CONFIG_VIDEO_CX88=m
2024CONFIG_VIDEO_CX88_ALSA=m
2025CONFIG_VIDEO_CX88_BLACKBIRD=m
2026CONFIG_VIDEO_CX88_DVB=m
2027CONFIG_VIDEO_CX88_VP3054=m
2028# CONFIG_VIDEO_IVTV is not set
2029# CONFIG_VIDEO_CAFE_CCIC is not set
2030CONFIG_V4L_USB_DRIVERS=y
2031CONFIG_VIDEO_PVRUSB2=m
2032CONFIG_VIDEO_PVRUSB2_29XXX=y
2033CONFIG_VIDEO_PVRUSB2_24XXX=y
2034CONFIG_VIDEO_PVRUSB2_SYSFS=y
2035# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
2036CONFIG_VIDEO_EM28XX=m
2037# CONFIG_VIDEO_USBVISION is not set
2038CONFIG_VIDEO_USBVIDEO=m
2039CONFIG_USB_VICAM=m
2040CONFIG_USB_IBMCAM=m
2041CONFIG_USB_KONICAWC=m
2042CONFIG_USB_QUICKCAM_MESSENGER=m
2043CONFIG_USB_ET61X251=m
2044CONFIG_VIDEO_OVCAMCHIP=m
2045CONFIG_USB_W9968CF=m
2046# CONFIG_USB_OV511 is not set
2047CONFIG_USB_SE401=m
2048CONFIG_USB_SN9C102=m
2049CONFIG_USB_STV680=m
2050CONFIG_USB_ZC0301=m
2051CONFIG_USB_PWC=m
2052# CONFIG_USB_PWC_DEBUG is not set
2053# CONFIG_USB_ZR364XX is not set
2054CONFIG_RADIO_ADAPTERS=y
2055CONFIG_RADIO_GEMTEK_PCI=m
2056CONFIG_RADIO_MAXIRADIO=m
2057CONFIG_RADIO_MAESTRO=m
2058CONFIG_USB_DSBR=m
2059CONFIG_DVB_CORE=m
2060CONFIG_DVB_CORE_ATTACH=y
2061CONFIG_DVB_CAPTURE_DRIVERS=y
2062
2063#
2064# Supported SAA7146 based PCI Adapters
2065#
2066CONFIG_DVB_AV7110=m
2067CONFIG_DVB_AV7110_OSD=y
2068CONFIG_DVB_BUDGET=m
2069CONFIG_DVB_BUDGET_CI=m
2070CONFIG_DVB_BUDGET_AV=m
2071CONFIG_DVB_BUDGET_PATCH=m
2072
2073#
2074# Supported USB Adapters
2075#
2076CONFIG_DVB_USB=m
2077# CONFIG_DVB_USB_DEBUG is not set
2078CONFIG_DVB_USB_A800=m
2079CONFIG_DVB_USB_DIBUSB_MB=m
2080CONFIG_DVB_USB_DIBUSB_MB_FAULTY=y
2081CONFIG_DVB_USB_DIBUSB_MC=m
2082CONFIG_DVB_USB_DIB0700=m
2083CONFIG_DVB_USB_UMT_010=m
2084CONFIG_DVB_USB_CXUSB=m
2085# CONFIG_DVB_USB_M920X is not set
2086# CONFIG_DVB_USB_GL861 is not set
2087# CONFIG_DVB_USB_AU6610 is not set
2088CONFIG_DVB_USB_DIGITV=m
2089CONFIG_DVB_USB_VP7045=m
2090CONFIG_DVB_USB_VP702X=m
2091CONFIG_DVB_USB_GP8PSK=m
2092CONFIG_DVB_USB_NOVA_T_USB2=m
2093# CONFIG_DVB_USB_TTUSB2 is not set
2094CONFIG_DVB_USB_DTT200U=m
2095# CONFIG_DVB_USB_OPERA1 is not set
2096# CONFIG_DVB_USB_AF9005 is not set
2097CONFIG_DVB_TTUSB_BUDGET=m
2098CONFIG_DVB_TTUSB_DEC=m
2099CONFIG_DVB_CINERGYT2=m
2100CONFIG_DVB_CINERGYT2_TUNING=y
2101CONFIG_DVB_CINERGYT2_STREAM_URB_COUNT=32
2102CONFIG_DVB_CINERGYT2_STREAM_BUF_SIZE=512
2103CONFIG_DVB_CINERGYT2_QUERY_INTERVAL=250
2104CONFIG_DVB_CINERGYT2_ENABLE_RC_INPUT_DEVICE=y
2105CONFIG_DVB_CINERGYT2_RC_QUERY_INTERVAL=100
2106
2107#
2108# Supported FlexCopII (B2C2) Adapters
2109#
2110CONFIG_DVB_B2C2_FLEXCOP=m
2111CONFIG_DVB_B2C2_FLEXCOP_PCI=m
2112CONFIG_DVB_B2C2_FLEXCOP_USB=m
2113# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set
2114
2115#
2116# Supported BT878 Adapters
2117#
2118CONFIG_DVB_BT8XX=m
2119
2120#
2121# Supported Pluto2 Adapters
2122#
2123CONFIG_DVB_PLUTO2=m
2124
2125#
2126# Supported DVB Frontends
2127#
2128
2129#
2130# Customise DVB Frontends
2131#
2132# CONFIG_DVB_FE_CUSTOMISE is not set
2133
2134#
2135# DVB-S (satellite) frontends
2136#
2137CONFIG_DVB_STV0299=m
2138CONFIG_DVB_CX24110=m
2139CONFIG_DVB_CX24123=m
2140CONFIG_DVB_TDA8083=m
2141CONFIG_DVB_MT312=m
2142CONFIG_DVB_VES1X93=m
2143CONFIG_DVB_S5H1420=m
2144CONFIG_DVB_TDA10086=m
2145
2146#
2147# DVB-T (terrestrial) frontends
2148#
2149CONFIG_DVB_SP8870=m
2150CONFIG_DVB_SP887X=m
2151CONFIG_DVB_CX22700=m
2152CONFIG_DVB_CX22702=m
2153CONFIG_DVB_L64781=m
2154CONFIG_DVB_TDA1004X=m
2155CONFIG_DVB_NXT6000=m
2156CONFIG_DVB_MT352=m
2157CONFIG_DVB_ZL10353=m
2158CONFIG_DVB_DIB3000MB=m
2159CONFIG_DVB_DIB3000MC=m
2160CONFIG_DVB_DIB7000M=m
2161CONFIG_DVB_DIB7000P=m
2162
2163#
2164# DVB-C (cable) frontends
2165#
2166CONFIG_DVB_VES1820=m
2167CONFIG_DVB_TDA10021=m
2168CONFIG_DVB_TDA10023=m
2169CONFIG_DVB_STV0297=m
2170
2171#
2172# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
2173#
2174CONFIG_DVB_NXT200X=m
2175CONFIG_DVB_OR51211=m
2176CONFIG_DVB_OR51132=m
2177CONFIG_DVB_BCM3510=m
2178CONFIG_DVB_LGDT330X=m
2179
2180#
2181# Tuners/PLL support
2182#
2183CONFIG_DVB_PLL=m
2184CONFIG_DVB_TDA826X=m
2185CONFIG_DVB_TDA827X=m
2186# CONFIG_DVB_TUNER_QT1010 is not set
2187CONFIG_DVB_TUNER_MT2060=m
2188
2189#
2190# Miscellaneous devices
2191#
2192CONFIG_DVB_LNBP21=m
2193CONFIG_DVB_ISL6421=m
2194CONFIG_DVB_TUA6100=m
2195CONFIG_VIDEO_SAA7146=m
2196CONFIG_VIDEO_SAA7146_VV=m
2197CONFIG_VIDEO_TUNER=m
2198CONFIG_VIDEO_BUF=m
2199CONFIG_VIDEO_BUF_DVB=m
2200CONFIG_VIDEO_BTCX=m
2201CONFIG_VIDEO_IR_I2C=m
2202CONFIG_VIDEO_IR=m
2203CONFIG_VIDEO_TVEEPROM=m
2204CONFIG_DAB=y
2205CONFIG_USB_DABUSB=m
2206
2207#
2208# Graphics support
2209#
2210CONFIG_BACKLIGHT_LCD_SUPPORT=y
2211CONFIG_LCD_CLASS_DEVICE=m
2212CONFIG_BACKLIGHT_CLASS_DEVICE=y
2213
2214#
2215# Display device support
2216#
2217# CONFIG_DISPLAY_SUPPORT is not set
2218CONFIG_VGASTATE=m
2219CONFIG_VIDEO_OUTPUT_CONTROL=m
2220CONFIG_FB=y
2221CONFIG_FIRMWARE_EDID=y
2222CONFIG_FB_DDC=m
2223CONFIG_FB_CFB_FILLRECT=m
2224CONFIG_FB_CFB_COPYAREA=m
2225CONFIG_FB_CFB_IMAGEBLIT=m
2226# CONFIG_FB_SYS_FILLRECT is not set
2227# CONFIG_FB_SYS_COPYAREA is not set
2228# CONFIG_FB_SYS_IMAGEBLIT is not set
2229# CONFIG_FB_SYS_FOPS is not set
2230CONFIG_FB_DEFERRED_IO=y
2231# CONFIG_FB_SVGALIB is not set
2232# CONFIG_FB_MACMODES is not set
2233CONFIG_FB_BACKLIGHT=y
2234CONFIG_FB_MODE_HELPERS=y
2235CONFIG_FB_TILEBLITTING=y
2236
2237#
2238# Frame buffer hardware drivers
2239#
2240CONFIG_FB_CIRRUS=m
2241CONFIG_FB_PM2=m
2242CONFIG_FB_PM2_FIFO_DISCONNECT=y
2243CONFIG_FB_CYBER2000=m
2244# CONFIG_FB_ASILIANT is not set
2245# CONFIG_FB_IMSTT is not set
2246CONFIG_FB_S1D13XXX=m
2247CONFIG_FB_NVIDIA=m
2248CONFIG_FB_NVIDIA_I2C=y
2249# CONFIG_FB_NVIDIA_DEBUG is not set
2250CONFIG_FB_NVIDIA_BACKLIGHT=y
2251CONFIG_FB_RIVA=m
2252CONFIG_FB_RIVA_I2C=y
2253# CONFIG_FB_RIVA_DEBUG is not set
2254CONFIG_FB_RIVA_BACKLIGHT=y
2255CONFIG_FB_MATROX=m
2256CONFIG_FB_MATROX_MILLENIUM=y
2257CONFIG_FB_MATROX_MYSTIQUE=y
2258CONFIG_FB_MATROX_G=y
2259CONFIG_FB_MATROX_I2C=m
2260CONFIG_FB_MATROX_MAVEN=m
2261CONFIG_FB_MATROX_MULTIHEAD=y
2262CONFIG_FB_RADEON=m
2263CONFIG_FB_RADEON_I2C=y
2264CONFIG_FB_RADEON_BACKLIGHT=y
2265# CONFIG_FB_RADEON_DEBUG is not set
2266CONFIG_FB_ATY128=m
2267CONFIG_FB_ATY128_BACKLIGHT=y
2268CONFIG_FB_ATY=m
2269CONFIG_FB_ATY_CT=y
2270CONFIG_FB_ATY_GENERIC_LCD=y
2271CONFIG_FB_ATY_GX=y
2272CONFIG_FB_ATY_BACKLIGHT=y
2273# CONFIG_FB_S3 is not set
2274CONFIG_FB_SAVAGE=m
2275CONFIG_FB_SAVAGE_I2C=y
2276CONFIG_FB_SAVAGE_ACCEL=y
2277CONFIG_FB_SIS=m
2278CONFIG_FB_SIS_300=y
2279CONFIG_FB_SIS_315=y
2280CONFIG_FB_NEOMAGIC=m
2281CONFIG_FB_KYRO=m
2282CONFIG_FB_3DFX=m
2283# CONFIG_FB_3DFX_ACCEL is not set
2284CONFIG_FB_VOODOO1=m
2285# CONFIG_FB_VT8623 is not set
2286CONFIG_FB_TRIDENT=m
2287# CONFIG_FB_TRIDENT_ACCEL is not set
2288# CONFIG_FB_ARK is not set
2289# CONFIG_FB_PM3 is not set
2290# CONFIG_FB_VIRTUAL is not set
2291
2292#
2293# Console display driver support
2294#
2295CONFIG_VGA_CONSOLE=y
2296# CONFIG_VGACON_SOFT_SCROLLBACK is not set
2297CONFIG_DUMMY_CONSOLE=y
2298CONFIG_FRAMEBUFFER_CONSOLE=m
2299# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
2300# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
2301# CONFIG_FONTS is not set
2302CONFIG_FONT_8x8=y
2303CONFIG_FONT_8x16=y
2304# CONFIG_LOGO is not set
2305
2306#
2307# Sound
2308#
2309CONFIG_SOUND=m
2310
2311#
2312# Advanced Linux Sound Architecture
2313#
2314CONFIG_SND=m
2315CONFIG_SND_TIMER=m
2316CONFIG_SND_PCM=m
2317CONFIG_SND_HWDEP=m
2318CONFIG_SND_RAWMIDI=m
2319CONFIG_SND_SEQUENCER=m
2320CONFIG_SND_SEQ_DUMMY=m
2321CONFIG_SND_OSSEMUL=y
2322CONFIG_SND_MIXER_OSS=m
2323CONFIG_SND_PCM_OSS=m
2324CONFIG_SND_PCM_OSS_PLUGINS=y
2325CONFIG_SND_SEQUENCER_OSS=y
2326CONFIG_SND_RTCTIMER=m
2327CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
2328CONFIG_SND_DYNAMIC_MINORS=y
2329CONFIG_SND_SUPPORT_OLD_API=y
2330CONFIG_SND_VERBOSE_PROCFS=y
2331# CONFIG_SND_VERBOSE_PRINTK is not set
2332# CONFIG_SND_DEBUG is not set
2333
2334#
2335# Generic devices
2336#
2337CONFIG_SND_MPU401_UART=m
2338CONFIG_SND_OPL3_LIB=m
2339CONFIG_SND_VX_LIB=m
2340CONFIG_SND_AC97_CODEC=m
2341CONFIG_SND_DUMMY=m
2342CONFIG_SND_VIRMIDI=m
2343CONFIG_SND_MTPAV=m
2344CONFIG_SND_MTS64=m
2345CONFIG_SND_SERIAL_U16550=m
2346CONFIG_SND_MPU401=m
2347# CONFIG_SND_PORTMAN2X4 is not set
2348
2349#
2350# PCI devices
2351#
2352CONFIG_SND_AD1889=m
2353CONFIG_SND_ALS300=m
2354CONFIG_SND_ALI5451=m
2355CONFIG_SND_ATIIXP=m
2356CONFIG_SND_ATIIXP_MODEM=m
2357CONFIG_SND_AU8810=m
2358CONFIG_SND_AU8820=m
2359CONFIG_SND_AU8830=m
2360CONFIG_SND_AZT3328=m
2361CONFIG_SND_BT87X=m
2362# CONFIG_SND_BT87X_OVERCLOCK is not set
2363CONFIG_SND_CA0106=m
2364CONFIG_SND_CMIPCI=m
2365CONFIG_SND_CS4281=m
2366CONFIG_SND_CS46XX=m
2367CONFIG_SND_CS46XX_NEW_DSP=y
2368CONFIG_SND_DARLA20=m
2369CONFIG_SND_GINA20=m
2370CONFIG_SND_LAYLA20=m
2371CONFIG_SND_DARLA24=m
2372CONFIG_SND_GINA24=m
2373CONFIG_SND_LAYLA24=m
2374CONFIG_SND_MONA=m
2375CONFIG_SND_MIA=m
2376CONFIG_SND_ECHO3G=m
2377CONFIG_SND_INDIGO=m
2378CONFIG_SND_INDIGOIO=m
2379CONFIG_SND_INDIGODJ=m
2380CONFIG_SND_EMU10K1=m
2381CONFIG_SND_EMU10K1X=m
2382CONFIG_SND_ENS1370=m
2383CONFIG_SND_ENS1371=m
2384CONFIG_SND_ES1938=m
2385CONFIG_SND_ES1968=m
2386CONFIG_SND_FM801=m
2387CONFIG_SND_FM801_TEA575X_BOOL=y
2388CONFIG_SND_FM801_TEA575X=m
2389CONFIG_SND_HDA_INTEL=m
2390CONFIG_SND_HDSP=m
2391CONFIG_SND_HDSPM=m
2392CONFIG_SND_ICE1712=m
2393CONFIG_SND_ICE1724=m
2394CONFIG_SND_INTEL8X0=m
2395CONFIG_SND_INTEL8X0M=m
2396CONFIG_SND_KORG1212=m
2397CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL=y
2398CONFIG_SND_MAESTRO3=m
2399CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL=y
2400CONFIG_SND_MIXART=m
2401CONFIG_SND_NM256=m
2402CONFIG_SND_PCXHR=m
2403CONFIG_SND_RIPTIDE=m
2404CONFIG_SND_RME32=m
2405CONFIG_SND_RME96=m
2406CONFIG_SND_RME9652=m
2407CONFIG_SND_SONICVIBES=m
2408CONFIG_SND_TRIDENT=m
2409CONFIG_SND_VIA82XX=m
2410CONFIG_SND_VIA82XX_MODEM=m
2411CONFIG_SND_VX222=m
2412CONFIG_SND_YMFPCI=m
2413CONFIG_SND_YMFPCI_FIRMWARE_IN_KERNEL=y
2414# CONFIG_SND_AC97_POWER_SAVE is not set
2415
2416#
2417# ALSA MIPS devices
2418#
2419# CONFIG_SND_AU1X00 is not set
2420
2421#
2422# USB devices
2423#
2424CONFIG_SND_USB_AUDIO=m
2425# CONFIG_SND_USB_CAIAQ is not set
2426
2427#
2428# PCMCIA devices
2429#
2430CONFIG_SND_VXPOCKET=m
2431CONFIG_SND_PDAUDIOCF=m
2432
2433#
2434# System on Chip audio support
2435#
2436# CONFIG_SND_SOC is not set
2437
2438#
2439# SoC Audio support for SuperH
2440#
2441
2442#
2443# Open Sound System
2444#
2445CONFIG_SOUND_PRIME=m
2446CONFIG_SOUND_TRIDENT=m
2447# CONFIG_SOUND_MSNDCLAS is not set
2448# CONFIG_SOUND_MSNDPIN is not set
2449CONFIG_AC97_BUS=m
2450CONFIG_HID_SUPPORT=y
2451CONFIG_HID=y
2452# CONFIG_HID_DEBUG is not set
2453
2454#
2455# USB Input Devices
2456#
2457CONFIG_USB_HID=m
2458CONFIG_USB_HIDINPUT_POWERBOOK=y
2459# CONFIG_HID_FF is not set
2460CONFIG_USB_HIDDEV=y
2461
2462#
2463# USB HID Boot Protocol drivers
2464#
2465CONFIG_USB_KBD=m
2466CONFIG_USB_MOUSE=m
2467CONFIG_USB_SUPPORT=y
2468CONFIG_USB_ARCH_HAS_HCD=y
2469CONFIG_USB_ARCH_HAS_OHCI=y
2470CONFIG_USB_ARCH_HAS_EHCI=y
2471CONFIG_USB=m
2472# CONFIG_USB_DEBUG is not set
2473
2474#
2475# Miscellaneous USB options
2476#
2477CONFIG_USB_DEVICEFS=y
2478CONFIG_USB_DEVICE_CLASS=y
2479# CONFIG_USB_DYNAMIC_MINORS is not set
2480CONFIG_USB_SUSPEND=y
2481# CONFIG_USB_PERSIST is not set
2482# CONFIG_USB_OTG is not set
2483
2484#
2485# USB Host Controller Drivers
2486#
2487CONFIG_USB_EHCI_HCD=m
2488CONFIG_USB_EHCI_SPLIT_ISO=y
2489CONFIG_USB_EHCI_ROOT_HUB_TT=y
2490CONFIG_USB_EHCI_TT_NEWSCHED=y
2491# CONFIG_USB_ISP116X_HCD is not set
2492CONFIG_USB_OHCI_HCD=m
2493# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
2494# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
2495CONFIG_USB_OHCI_LITTLE_ENDIAN=y
2496CONFIG_USB_UHCI_HCD=m
2497CONFIG_USB_U132_HCD=m
2498CONFIG_USB_SL811_HCD=m
2499CONFIG_USB_SL811_CS=m
2500# CONFIG_USB_R8A66597_HCD is not set
2501
2502#
2503# USB Device Class drivers
2504#
2505CONFIG_USB_ACM=m
2506CONFIG_USB_PRINTER=m
2507
2508#
2509# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
2510#
2511
2512#
2513# may also be needed; see USB_STORAGE Help for more information
2514#
2515CONFIG_USB_STORAGE=m
2516# CONFIG_USB_STORAGE_DEBUG is not set
2517CONFIG_USB_STORAGE_DATAFAB=y
2518CONFIG_USB_STORAGE_FREECOM=y
2519CONFIG_USB_STORAGE_ISD200=y
2520CONFIG_USB_STORAGE_DPCM=y
2521CONFIG_USB_STORAGE_USBAT=y
2522CONFIG_USB_STORAGE_SDDR09=y
2523CONFIG_USB_STORAGE_SDDR55=y
2524CONFIG_USB_STORAGE_JUMPSHOT=y
2525CONFIG_USB_STORAGE_ALAUDA=y
2526CONFIG_USB_STORAGE_KARMA=y
2527CONFIG_USB_LIBUSUAL=y
2528
2529#
2530# USB Imaging devices
2531#
2532CONFIG_USB_MDC800=m
2533CONFIG_USB_MICROTEK=m
2534CONFIG_USB_MON=y
2535
2536#
2537# USB port drivers
2538#
2539CONFIG_USB_USS720=m
2540
2541#
2542# USB Serial Converter support
2543#
2544CONFIG_USB_SERIAL=m
2545CONFIG_USB_SERIAL_GENERIC=y
2546CONFIG_USB_SERIAL_AIRCABLE=m
2547CONFIG_USB_SERIAL_AIRPRIME=m
2548CONFIG_USB_SERIAL_ARK3116=m
2549CONFIG_USB_SERIAL_BELKIN=m
2550CONFIG_USB_SERIAL_WHITEHEAT=m
2551CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
2552CONFIG_USB_SERIAL_CP2101=m
2553CONFIG_USB_SERIAL_CYPRESS_M8=m
2554CONFIG_USB_SERIAL_EMPEG=m
2555CONFIG_USB_SERIAL_FTDI_SIO=m
2556CONFIG_USB_SERIAL_FUNSOFT=m
2557CONFIG_USB_SERIAL_VISOR=m
2558CONFIG_USB_SERIAL_IPAQ=m
2559CONFIG_USB_SERIAL_IR=m
2560CONFIG_USB_SERIAL_EDGEPORT=m
2561CONFIG_USB_SERIAL_EDGEPORT_TI=m
2562CONFIG_USB_SERIAL_GARMIN=m
2563CONFIG_USB_SERIAL_IPW=m
2564CONFIG_USB_SERIAL_KEYSPAN_PDA=m
2565CONFIG_USB_SERIAL_KEYSPAN=m
2566# CONFIG_USB_SERIAL_KEYSPAN_MPR is not set
2567# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
2568# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
2569# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
2570# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
2571# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
2572# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
2573# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
2574# CONFIG_USB_SERIAL_KEYSPAN_USA19QW is not set
2575# CONFIG_USB_SERIAL_KEYSPAN_USA19QI is not set
2576# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
2577# CONFIG_USB_SERIAL_KEYSPAN_USA49WLC is not set
2578CONFIG_USB_SERIAL_KLSI=m
2579CONFIG_USB_SERIAL_KOBIL_SCT=m
2580CONFIG_USB_SERIAL_MCT_U232=m
2581CONFIG_USB_SERIAL_MOS7720=m
2582CONFIG_USB_SERIAL_MOS7840=m
2583CONFIG_USB_SERIAL_NAVMAN=m
2584CONFIG_USB_SERIAL_PL2303=m
2585# CONFIG_USB_SERIAL_OTI6858 is not set
2586CONFIG_USB_SERIAL_HP4X=m
2587CONFIG_USB_SERIAL_SAFE=m
2588# CONFIG_USB_SERIAL_SAFE_PADDED is not set
2589CONFIG_USB_SERIAL_SIERRAWIRELESS=m
2590CONFIG_USB_SERIAL_TI=m
2591CONFIG_USB_SERIAL_CYBERJACK=m
2592CONFIG_USB_SERIAL_XIRCOM=m
2593CONFIG_USB_SERIAL_OPTION=m
2594CONFIG_USB_SERIAL_OMNINET=m
2595# CONFIG_USB_SERIAL_DEBUG is not set
2596CONFIG_USB_EZUSB=y
2597
2598#
2599# USB Miscellaneous drivers
2600#
2601CONFIG_USB_EMI62=m
2602CONFIG_USB_EMI26=m
2603CONFIG_USB_ADUTUX=m
2604CONFIG_USB_AUERSWALD=m
2605CONFIG_USB_RIO500=m
2606CONFIG_USB_LEGOTOWER=m
2607CONFIG_USB_LCD=m
2608# CONFIG_USB_BERRY_CHARGE is not set
2609CONFIG_USB_LED=m
2610CONFIG_USB_CYPRESS_CY7C63=m
2611CONFIG_USB_CYTHERM=m
2612CONFIG_USB_PHIDGET=m
2613CONFIG_USB_PHIDGETKIT=m
2614CONFIG_USB_PHIDGETMOTORCONTROL=m
2615CONFIG_USB_PHIDGETSERVO=m
2616CONFIG_USB_IDMOUSE=m
2617CONFIG_USB_FTDI_ELAN=m
2618CONFIG_USB_APPLEDISPLAY=m
2619CONFIG_USB_SISUSBVGA=m
2620# CONFIG_USB_SISUSBVGA_CON is not set
2621CONFIG_USB_LD=m
2622CONFIG_USB_TRANCEVIBRATOR=m
2623# CONFIG_USB_IOWARRIOR is not set
2624CONFIG_USB_TEST=m
2625
2626#
2627# USB DSL modem support
2628#
2629CONFIG_USB_ATM=m
2630CONFIG_USB_SPEEDTOUCH=m
2631CONFIG_USB_CXACRU=m
2632CONFIG_USB_UEAGLEATM=m
2633CONFIG_USB_XUSBATM=m
2634
2635#
2636# USB Gadget Support
2637#
2638CONFIG_USB_GADGET=m
2639# CONFIG_USB_GADGET_DEBUG_FILES is not set
2640CONFIG_USB_GADGET_SELECTED=y
2641# CONFIG_USB_GADGET_AMD5536UDC is not set
2642# CONFIG_USB_GADGET_FSL_USB2 is not set
2643CONFIG_USB_GADGET_NET2280=y
2644CONFIG_USB_NET2280=m
2645# CONFIG_USB_GADGET_PXA2XX is not set
2646# CONFIG_USB_GADGET_M66592 is not set
2647# CONFIG_USB_GADGET_GOKU is not set
2648# CONFIG_USB_GADGET_LH7A40X is not set
2649# CONFIG_USB_GADGET_OMAP is not set
2650# CONFIG_USB_GADGET_S3C2410 is not set
2651# CONFIG_USB_GADGET_AT91 is not set
2652# CONFIG_USB_GADGET_DUMMY_HCD is not set
2653CONFIG_USB_GADGET_DUALSPEED=y
2654CONFIG_USB_ZERO=m
2655CONFIG_USB_ETH=m
2656CONFIG_USB_ETH_RNDIS=y
2657CONFIG_USB_GADGETFS=m
2658CONFIG_USB_FILE_STORAGE=m
2659# CONFIG_USB_FILE_STORAGE_TEST is not set
2660CONFIG_USB_G_SERIAL=m
2661CONFIG_USB_MIDI_GADGET=m
2662CONFIG_MMC=m
2663# CONFIG_MMC_DEBUG is not set
2664# CONFIG_MMC_UNSAFE_RESUME is not set
2665
2666#
2667# MMC/SD Card Drivers
2668#
2669CONFIG_MMC_BLOCK=m
2670CONFIG_MMC_BLOCK_BOUNCE=y
2671
2672#
2673# MMC/SD Host Controller Drivers
2674#
2675CONFIG_MMC_SDHCI=m
2676CONFIG_MMC_TIFM_SD=m
2677CONFIG_NEW_LEDS=y
2678CONFIG_LEDS_CLASS=m
2679
2680#
2681# LED drivers
2682#
2683
2684#
2685# LED Triggers
2686#
2687# CONFIG_LEDS_TRIGGERS is not set
2688CONFIG_INFINIBAND=m
2689CONFIG_INFINIBAND_USER_MAD=m
2690CONFIG_INFINIBAND_USER_ACCESS=m
2691CONFIG_INFINIBAND_USER_MEM=y
2692CONFIG_INFINIBAND_ADDR_TRANS=y
2693CONFIG_INFINIBAND_MTHCA=m
2694CONFIG_INFINIBAND_MTHCA_DEBUG=y
2695CONFIG_INFINIBAND_AMSO1100=m
2696CONFIG_INFINIBAND_AMSO1100_DEBUG=y
2697# CONFIG_MLX4_INFINIBAND is not set
2698CONFIG_INFINIBAND_IPOIB=m
2699# CONFIG_INFINIBAND_IPOIB_CM is not set
2700CONFIG_INFINIBAND_IPOIB_DEBUG=y
2701# CONFIG_INFINIBAND_IPOIB_DEBUG_DATA is not set
2702CONFIG_INFINIBAND_SRP=m
2703CONFIG_INFINIBAND_ISER=m
2704CONFIG_RTC_LIB=m
2705CONFIG_RTC_CLASS=m
2706
2707#
2708# RTC interfaces
2709#
2710CONFIG_RTC_INTF_SYSFS=y
2711CONFIG_RTC_INTF_PROC=y
2712CONFIG_RTC_INTF_DEV=y
2713CONFIG_RTC_INTF_DEV_UIE_EMUL=y
2714CONFIG_RTC_DRV_TEST=m
2715
2716#
2717# I2C RTC drivers
2718#
2719CONFIG_RTC_DRV_DS1307=m
2720CONFIG_RTC_DRV_DS1672=m
2721# CONFIG_RTC_DRV_MAX6900 is not set
2722CONFIG_RTC_DRV_RS5C372=m
2723CONFIG_RTC_DRV_ISL1208=m
2724CONFIG_RTC_DRV_X1205=m
2725CONFIG_RTC_DRV_PCF8563=m
2726CONFIG_RTC_DRV_PCF8583=m
2727# CONFIG_RTC_DRV_M41T80 is not set
2728
2729#
2730# SPI RTC drivers
2731#
2732CONFIG_RTC_DRV_RS5C348=m
2733CONFIG_RTC_DRV_MAX6902=m
2734
2735#
2736# Platform RTC drivers
2737#
2738# CONFIG_RTC_DRV_CMOS is not set
2739CONFIG_RTC_DRV_DS1553=m
2740# CONFIG_RTC_DRV_STK17TA8 is not set
2741CONFIG_RTC_DRV_DS1742=m
2742CONFIG_RTC_DRV_M48T86=m
2743# CONFIG_RTC_DRV_M48T59 is not set
2744CONFIG_RTC_DRV_V3020=m
2745
2746#
2747# on-CPU RTC drivers
2748#
2749
2750#
2751# DMA Engine support
2752#
2753CONFIG_DMA_ENGINE=y
2754
2755#
2756# DMA Clients
2757#
2758CONFIG_NET_DMA=y
2759
2760#
2761# DMA Devices
2762#
2763CONFIG_INTEL_IOATDMA=m
2764# CONFIG_AUXDISPLAY is not set
2765
2766#
2767# Userspace I/O
2768#
2769# CONFIG_UIO is not set
2770
2771#
2772# File systems
2773#
2774CONFIG_EXT2_FS=m
2775CONFIG_EXT2_FS_XATTR=y
2776CONFIG_EXT2_FS_POSIX_ACL=y
2777CONFIG_EXT2_FS_SECURITY=y
2778# CONFIG_EXT2_FS_XIP is not set
2779CONFIG_EXT3_FS=m
2780CONFIG_EXT3_FS_XATTR=y
2781CONFIG_EXT3_FS_POSIX_ACL=y
2782CONFIG_EXT3_FS_SECURITY=y
2783# CONFIG_EXT4DEV_FS is not set
2784CONFIG_JBD=m
2785# CONFIG_JBD_DEBUG is not set
2786CONFIG_FS_MBCACHE=m
2787CONFIG_REISERFS_FS=m
2788# CONFIG_REISERFS_CHECK is not set
2789# CONFIG_REISERFS_PROC_INFO is not set
2790CONFIG_REISERFS_FS_XATTR=y
2791CONFIG_REISERFS_FS_POSIX_ACL=y
2792CONFIG_REISERFS_FS_SECURITY=y
2793CONFIG_JFS_FS=m
2794CONFIG_JFS_POSIX_ACL=y
2795CONFIG_JFS_SECURITY=y
2796# CONFIG_JFS_DEBUG is not set
2797CONFIG_JFS_STATISTICS=y
2798CONFIG_FS_POSIX_ACL=y
2799CONFIG_XFS_FS=m
2800CONFIG_XFS_QUOTA=y
2801CONFIG_XFS_SECURITY=y
2802CONFIG_XFS_POSIX_ACL=y
2803CONFIG_XFS_RT=y
2804# CONFIG_GFS2_FS is not set
2805# CONFIG_OCFS2_FS is not set
2806CONFIG_MINIX_FS=m
2807CONFIG_ROMFS_FS=m
2808CONFIG_INOTIFY=y
2809CONFIG_INOTIFY_USER=y
2810CONFIG_QUOTA=y
2811CONFIG_QFMT_V1=m
2812CONFIG_QFMT_V2=m
2813CONFIG_QUOTACTL=y
2814CONFIG_DNOTIFY=y
2815CONFIG_AUTOFS_FS=m
2816CONFIG_AUTOFS4_FS=m
2817CONFIG_FUSE_FS=m
2818
2819#
2820# CD-ROM/DVD Filesystems
2821#
2822CONFIG_ISO9660_FS=m
2823CONFIG_JOLIET=y
2824CONFIG_ZISOFS=y
2825CONFIG_UDF_FS=m
2826CONFIG_UDF_NLS=y
2827
2828#
2829# DOS/FAT/NT Filesystems
2830#
2831CONFIG_FAT_FS=m
2832CONFIG_MSDOS_FS=m
2833CONFIG_VFAT_FS=m
2834CONFIG_FAT_DEFAULT_CODEPAGE=437
2835CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
2836CONFIG_NTFS_FS=m
2837# CONFIG_NTFS_DEBUG is not set
2838# CONFIG_NTFS_RW is not set
2839
2840#
2841# Pseudo filesystems
2842#
2843CONFIG_PROC_FS=y
2844CONFIG_PROC_KCORE=y
2845CONFIG_PROC_SYSCTL=y
2846CONFIG_SYSFS=y
2847CONFIG_TMPFS=y
2848# CONFIG_TMPFS_POSIX_ACL is not set
2849# CONFIG_HUGETLB_PAGE is not set
2850CONFIG_RAMFS=y
2851CONFIG_CONFIGFS_FS=m
2852
2853#
2854# Miscellaneous filesystems
2855#
2856CONFIG_ADFS_FS=m
2857# CONFIG_ADFS_FS_RW is not set
2858CONFIG_AFFS_FS=m
2859CONFIG_ECRYPT_FS=m
2860CONFIG_HFS_FS=m
2861CONFIG_HFSPLUS_FS=m
2862CONFIG_BEFS_FS=m
2863# CONFIG_BEFS_DEBUG is not set
2864CONFIG_BFS_FS=m
2865CONFIG_EFS_FS=m
2866CONFIG_JFFS2_FS=m
2867CONFIG_JFFS2_FS_DEBUG=0
2868CONFIG_JFFS2_FS_WRITEBUFFER=y
2869# CONFIG_JFFS2_SUMMARY is not set
2870# CONFIG_JFFS2_FS_XATTR is not set
2871# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
2872CONFIG_JFFS2_ZLIB=y
2873CONFIG_JFFS2_RTIME=y
2874# CONFIG_JFFS2_RUBIN is not set
2875CONFIG_CRAMFS=y
2876CONFIG_VXFS_FS=m
2877CONFIG_HPFS_FS=m
2878CONFIG_QNX4FS_FS=m
2879CONFIG_SYSV_FS=m
2880CONFIG_UFS_FS=m
2881# CONFIG_UFS_FS_WRITE is not set
2882# CONFIG_UFS_DEBUG is not set
2883
2884#
2885# Network File Systems
2886#
2887CONFIG_NFS_FS=m
2888CONFIG_NFS_V3=y
2889# CONFIG_NFS_V3_ACL is not set
2890CONFIG_NFS_V4=y
2891CONFIG_NFS_DIRECTIO=y
2892CONFIG_NFSD=m
2893CONFIG_NFSD_V3=y
2894# CONFIG_NFSD_V3_ACL is not set
2895CONFIG_NFSD_V4=y
2896CONFIG_NFSD_TCP=y
2897CONFIG_LOCKD=m
2898CONFIG_LOCKD_V4=y
2899CONFIG_EXPORTFS=m
2900CONFIG_NFS_COMMON=y
2901CONFIG_SUNRPC=m
2902CONFIG_SUNRPC_GSS=m
2903# CONFIG_SUNRPC_BIND34 is not set
2904CONFIG_RPCSEC_GSS_KRB5=m
2905CONFIG_RPCSEC_GSS_SPKM3=m
2906CONFIG_SMB_FS=m
2907# CONFIG_SMB_NLS_DEFAULT is not set
2908CONFIG_CIFS=m
2909# CONFIG_CIFS_STATS is not set
2910# CONFIG_CIFS_WEAK_PW_HASH is not set
2911# CONFIG_CIFS_XATTR is not set
2912# CONFIG_CIFS_DEBUG2 is not set
2913# CONFIG_CIFS_EXPERIMENTAL is not set
2914CONFIG_NCP_FS=m
2915CONFIG_NCPFS_PACKET_SIGNING=y
2916CONFIG_NCPFS_IOCTL_LOCKING=y
2917CONFIG_NCPFS_STRONG=y
2918CONFIG_NCPFS_NFS_NS=y
2919CONFIG_NCPFS_OS2_NS=y
2920# CONFIG_NCPFS_SMALLDOS is not set
2921CONFIG_NCPFS_NLS=y
2922CONFIG_NCPFS_EXTRAS=y
2923CONFIG_CODA_FS=m
2924# CONFIG_CODA_FS_OLD_API is not set
2925CONFIG_AFS_FS=m
2926# CONFIG_AFS_DEBUG is not set
2927
2928#
2929# Partition Types
2930#
2931CONFIG_PARTITION_ADVANCED=y
2932CONFIG_ACORN_PARTITION=y
2933# CONFIG_ACORN_PARTITION_CUMANA is not set
2934# CONFIG_ACORN_PARTITION_EESOX is not set
2935CONFIG_ACORN_PARTITION_ICS=y
2936# CONFIG_ACORN_PARTITION_ADFS is not set
2937# CONFIG_ACORN_PARTITION_POWERTEC is not set
2938CONFIG_ACORN_PARTITION_RISCIX=y
2939CONFIG_OSF_PARTITION=y
2940CONFIG_AMIGA_PARTITION=y
2941CONFIG_ATARI_PARTITION=y
2942CONFIG_MAC_PARTITION=y
2943CONFIG_MSDOS_PARTITION=y
2944CONFIG_BSD_DISKLABEL=y
2945CONFIG_MINIX_SUBPARTITION=y
2946CONFIG_SOLARIS_X86_PARTITION=y
2947CONFIG_UNIXWARE_DISKLABEL=y
2948CONFIG_LDM_PARTITION=y
2949# CONFIG_LDM_DEBUG is not set
2950CONFIG_SGI_PARTITION=y
2951CONFIG_ULTRIX_PARTITION=y
2952CONFIG_SUN_PARTITION=y
2953CONFIG_KARMA_PARTITION=y
2954CONFIG_EFI_PARTITION=y
2955# CONFIG_SYSV68_PARTITION is not set
2956
2957#
2958# Native Language Support
2959#
2960CONFIG_NLS=y
2961CONFIG_NLS_DEFAULT="cp437"
2962CONFIG_NLS_CODEPAGE_437=m
2963CONFIG_NLS_CODEPAGE_737=m
2964CONFIG_NLS_CODEPAGE_775=m
2965CONFIG_NLS_CODEPAGE_850=m
2966CONFIG_NLS_CODEPAGE_852=m
2967CONFIG_NLS_CODEPAGE_855=m
2968CONFIG_NLS_CODEPAGE_857=m
2969CONFIG_NLS_CODEPAGE_860=m
2970CONFIG_NLS_CODEPAGE_861=m
2971CONFIG_NLS_CODEPAGE_862=m
2972CONFIG_NLS_CODEPAGE_863=m
2973CONFIG_NLS_CODEPAGE_864=m
2974CONFIG_NLS_CODEPAGE_865=m
2975CONFIG_NLS_CODEPAGE_866=m
2976CONFIG_NLS_CODEPAGE_869=m
2977CONFIG_NLS_CODEPAGE_936=m
2978CONFIG_NLS_CODEPAGE_950=m
2979CONFIG_NLS_CODEPAGE_932=m
2980CONFIG_NLS_CODEPAGE_949=m
2981CONFIG_NLS_CODEPAGE_874=m
2982CONFIG_NLS_ISO8859_8=m
2983CONFIG_NLS_CODEPAGE_1250=m
2984CONFIG_NLS_CODEPAGE_1251=m
2985CONFIG_NLS_ASCII=m
2986CONFIG_NLS_ISO8859_1=m
2987CONFIG_NLS_ISO8859_2=m
2988CONFIG_NLS_ISO8859_3=m
2989CONFIG_NLS_ISO8859_4=m
2990CONFIG_NLS_ISO8859_5=m
2991CONFIG_NLS_ISO8859_6=m
2992CONFIG_NLS_ISO8859_7=m
2993CONFIG_NLS_ISO8859_9=m
2994CONFIG_NLS_ISO8859_13=m
2995CONFIG_NLS_ISO8859_14=m
2996CONFIG_NLS_ISO8859_15=m
2997CONFIG_NLS_KOI8_R=m
2998CONFIG_NLS_KOI8_U=m
2999CONFIG_NLS_UTF8=m
3000
3001#
3002# Distributed Lock Manager
3003#
3004CONFIG_DLM=m
3005# CONFIG_DLM_DEBUG is not set
3006
3007#
3008# Profiling support
3009#
3010CONFIG_PROFILING=y
3011CONFIG_OPROFILE=m
3012
3013#
3014# Kernel hacking
3015#
3016CONFIG_TRACE_IRQFLAGS_SUPPORT=y
3017# CONFIG_PRINTK_TIME is not set
3018# CONFIG_ENABLE_MUST_CHECK is not set
3019CONFIG_MAGIC_SYSRQ=y
3020# CONFIG_UNUSED_SYMBOLS is not set
3021# CONFIG_DEBUG_FS is not set
3022# CONFIG_HEADERS_CHECK is not set
3023# CONFIG_DEBUG_KERNEL is not set
3024# CONFIG_CROSSCOMPILE is not set
3025CONFIG_CMDLINE=""
3026CONFIG_SYS_SUPPORTS_KGDB=y
3027
3028#
3029# Security options
3030#
3031CONFIG_KEYS=y
3032# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
3033CONFIG_SECURITY=y
3034CONFIG_SECURITY_NETWORK=y
3035# CONFIG_SECURITY_NETWORK_XFRM is not set
3036CONFIG_SECURITY_CAPABILITIES=m
3037CONFIG_SECURITY_ROOTPLUG=m
3038CONFIG_SECURITY_SELINUX=y
3039CONFIG_SECURITY_SELINUX_BOOTPARAM=y
3040CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
3041CONFIG_SECURITY_SELINUX_DISABLE=y
3042CONFIG_SECURITY_SELINUX_DEVELOP=y
3043CONFIG_SECURITY_SELINUX_AVC_STATS=y
3044CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
3045# CONFIG_SECURITY_SELINUX_ENABLE_SECMARK_DEFAULT is not set
3046# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
3047CONFIG_XOR_BLOCKS=m
3048CONFIG_ASYNC_CORE=m
3049CONFIG_ASYNC_MEMCPY=m
3050CONFIG_ASYNC_XOR=m
3051CONFIG_CRYPTO=y
3052CONFIG_CRYPTO_ALGAPI=y
3053CONFIG_CRYPTO_BLKCIPHER=m
3054CONFIG_CRYPTO_HASH=y
3055CONFIG_CRYPTO_MANAGER=y
3056CONFIG_CRYPTO_HMAC=y
3057# CONFIG_CRYPTO_XCBC is not set
3058CONFIG_CRYPTO_NULL=m
3059CONFIG_CRYPTO_MD4=m
3060CONFIG_CRYPTO_MD5=y
3061CONFIG_CRYPTO_SHA1=m
3062CONFIG_CRYPTO_SHA256=m
3063CONFIG_CRYPTO_SHA512=m
3064CONFIG_CRYPTO_WP512=m
3065CONFIG_CRYPTO_TGR192=m
3066# CONFIG_CRYPTO_GF128MUL is not set
3067CONFIG_CRYPTO_ECB=m
3068CONFIG_CRYPTO_CBC=m
3069CONFIG_CRYPTO_PCBC=m
3070# CONFIG_CRYPTO_LRW is not set
3071# CONFIG_CRYPTO_CRYPTD is not set
3072CONFIG_CRYPTO_DES=m
3073# CONFIG_CRYPTO_FCRYPT is not set
3074CONFIG_CRYPTO_BLOWFISH=m
3075CONFIG_CRYPTO_TWOFISH=m
3076CONFIG_CRYPTO_TWOFISH_COMMON=m
3077CONFIG_CRYPTO_SERPENT=m
3078CONFIG_CRYPTO_AES=m
3079CONFIG_CRYPTO_CAST5=m
3080CONFIG_CRYPTO_CAST6=m
3081CONFIG_CRYPTO_TEA=m
3082CONFIG_CRYPTO_ARC4=m
3083CONFIG_CRYPTO_KHAZAD=m
3084CONFIG_CRYPTO_ANUBIS=m
3085CONFIG_CRYPTO_DEFLATE=m
3086CONFIG_CRYPTO_MICHAEL_MIC=m
3087CONFIG_CRYPTO_CRC32C=m
3088# CONFIG_CRYPTO_CAMELLIA is not set
3089CONFIG_CRYPTO_TEST=m
3090CONFIG_CRYPTO_HW=y
3091
3092#
3093# Library routines
3094#
3095CONFIG_BITREVERSE=y
3096CONFIG_CRC_CCITT=m
3097CONFIG_CRC16=m
3098# CONFIG_CRC_ITU_T is not set
3099CONFIG_CRC32=y
3100# CONFIG_CRC7 is not set
3101CONFIG_LIBCRC32C=m
3102CONFIG_AUDIT_GENERIC=y
3103CONFIG_ZLIB_INFLATE=y
3104CONFIG_ZLIB_DEFLATE=m
3105CONFIG_REED_SOLOMON=m
3106CONFIG_REED_SOLOMON_DEC16=y
3107CONFIG_TEXTSEARCH=y
3108CONFIG_TEXTSEARCH_KMP=m
3109CONFIG_TEXTSEARCH_BM=m
3110CONFIG_TEXTSEARCH_FSM=m
3111CONFIG_PLIST=y
3112CONFIG_HAS_IOMEM=y
3113CONFIG_HAS_IOPORT=y
3114CONFIG_HAS_DMA=y
3115CONFIG_CHECK_SIGNATURE=y
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig
index 93f9e8331ad7..3ed991ae0ebe 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -70,7 +70,6 @@ CONFIG_SIBYTE_HAS_LDT=y
70CONFIG_SIBYTE_CFE=y 70CONFIG_SIBYTE_CFE=y
71# CONFIG_SIBYTE_CFE_CONSOLE is not set 71# CONFIG_SIBYTE_CFE_CONSOLE is not set
72# CONFIG_SIBYTE_BUS_WATCHER is not set 72# CONFIG_SIBYTE_BUS_WATCHER is not set
73# CONFIG_SIBYTE_SB1250_PROF is not set
74# CONFIG_SIBYTE_TBPROF is not set 73# CONFIG_SIBYTE_TBPROF is not set
75CONFIG_RWSEM_GENERIC_SPINLOCK=y 74CONFIG_RWSEM_GENERIC_SPINLOCK=y
76# CONFIG_ARCH_HAS_ILOG2_U32 is not set 75# CONFIG_ARCH_HAS_ILOG2_U32 is not set
@@ -566,7 +565,7 @@ CONFIG_MII=y
566# CONFIG_HAMACHI is not set 565# CONFIG_HAMACHI is not set
567# CONFIG_YELLOWFIN is not set 566# CONFIG_YELLOWFIN is not set
568# CONFIG_R8169 is not set 567# CONFIG_R8169 is not set
569CONFIG_NET_SB1250_MAC=y 568CONFIG_SB1250_MAC=y
570# CONFIG_SIS190 is not set 569# CONFIG_SIS190 is not set
571# CONFIG_SKGE is not set 570# CONFIG_SKGE is not set
572# CONFIG_SKY2 is not set 571# CONFIG_SKY2 is not set
diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c
index 6d55e8aab668..6a17c9b508ea 100644
--- a/arch/mips/dec/ecc-berr.c
+++ b/arch/mips/dec/ecc-berr.c
@@ -263,7 +263,7 @@ static inline void dec_kn03_be_init(void)
263 */ 263 */
264 *mcr = (*mcr & ~(KN03_MCR_DIAGCHK | KN03_MCR_DIAGGEN)) | 264 *mcr = (*mcr & ~(KN03_MCR_DIAGCHK | KN03_MCR_DIAGGEN)) |
265 KN03_MCR_CORRECT; 265 KN03_MCR_CORRECT;
266 if (current_cpu_data.cputype == CPU_R4400SC) 266 if (current_cpu_type() == CPU_R4400SC)
267 *mbcs |= KN4K_MB_CSR_EE; 267 *mbcs |= KN4K_MB_CSR_EE;
268 fast_iob(); 268 fast_iob();
269} 269}
diff --git a/arch/mips/dec/kn02xa-berr.c b/arch/mips/dec/kn02xa-berr.c
index 7a053aadcd3a..5f04545c3606 100644
--- a/arch/mips/dec/kn02xa-berr.c
+++ b/arch/mips/dec/kn02xa-berr.c
@@ -132,7 +132,7 @@ void __init dec_kn02xa_be_init(void)
132 volatile u32 *mbcs = (void *)CKSEG1ADDR(KN4K_SLOT_BASE + KN4K_MB_CSR); 132 volatile u32 *mbcs = (void *)CKSEG1ADDR(KN4K_SLOT_BASE + KN4K_MB_CSR);
133 133
134 /* For KN04 we need to make sure EE (?) is enabled in the MB. */ 134 /* For KN04 we need to make sure EE (?) is enabled in the MB. */
135 if (current_cpu_data.cputype == CPU_R4000SC) 135 if (current_cpu_type() == CPU_R4000SC)
136 *mbcs |= KN4K_MB_CSR_EE; 136 *mbcs |= KN4K_MB_CSR_EE;
137 fast_iob(); 137 fast_iob();
138 138
diff --git a/arch/mips/dec/prom/identify.c b/arch/mips/dec/prom/identify.c
index cd85924e2572..95e26f4bb38f 100644
--- a/arch/mips/dec/prom/identify.c
+++ b/arch/mips/dec/prom/identify.c
@@ -133,9 +133,6 @@ void __init prom_identify_arch(u32 magic)
133 dec_firmrev = (dec_sysid & 0xff00) >> 8; 133 dec_firmrev = (dec_sysid & 0xff00) >> 8;
134 dec_etc = dec_sysid & 0xff; 134 dec_etc = dec_sysid & 0xff;
135 135
136 /* We're obviously one of the DEC machines */
137 mips_machgroup = MACH_GROUP_DEC;
138
139 /* 136 /*
140 * FIXME: This may not be an exhaustive list of DECStations/Servers! 137 * FIXME: This may not be an exhaustive list of DECStations/Servers!
141 * Put all model-specific initialisation calls here. 138 * Put all model-specific initialisation calls here.
diff --git a/arch/mips/dec/prom/init.c b/arch/mips/dec/prom/init.c
index 808c182fd3fa..93f1239af524 100644
--- a/arch/mips/dec/prom/init.c
+++ b/arch/mips/dec/prom/init.c
@@ -108,8 +108,8 @@ void __init prom_init(void)
108 108
109 /* Were we compiled with the right CPU option? */ 109 /* Were we compiled with the right CPU option? */
110#if defined(CONFIG_CPU_R3000) 110#if defined(CONFIG_CPU_R3000)
111 if ((current_cpu_data.cputype == CPU_R4000SC) || 111 if ((current_cpu_type() == CPU_R4000SC) ||
112 (current_cpu_data.cputype == CPU_R4400SC)) { 112 (current_cpu_type() == CPU_R4400SC)) {
113 static char r4k_msg[] __initdata = 113 static char r4k_msg[] __initdata =
114 "Please recompile with \"CONFIG_CPU_R4x00 = y\".\n"; 114 "Please recompile with \"CONFIG_CPU_R4x00 = y\".\n";
115 printk(cpu_msg); 115 printk(cpu_msg);
@@ -119,8 +119,8 @@ void __init prom_init(void)
119#endif 119#endif
120 120
121#if defined(CONFIG_CPU_R4X00) 121#if defined(CONFIG_CPU_R4X00)
122 if ((current_cpu_data.cputype == CPU_R3000) || 122 if ((current_cpu_type() == CPU_R3000) ||
123 (current_cpu_data.cputype == CPU_R3000A)) { 123 (current_cpu_type() == CPU_R3000A)) {
124 static char r3k_msg[] __initdata = 124 static char r3k_msg[] __initdata =
125 "Please recompile with \"CONFIG_CPU_R3000 = y\".\n"; 125 "Please recompile with \"CONFIG_CPU_R3000 = y\".\n";
126 printk(cpu_msg); 126 printk(cpu_msg);
diff --git a/arch/mips/dec/setup.c b/arch/mips/dec/setup.c
index 3e634f2f5443..bd5431e1f408 100644
--- a/arch/mips/dec/setup.c
+++ b/arch/mips/dec/setup.c
@@ -145,13 +145,9 @@ static void __init dec_be_init(void)
145 } 145 }
146} 146}
147 147
148
149extern void dec_time_init(void);
150
151void __init plat_mem_setup(void) 148void __init plat_mem_setup(void)
152{ 149{
153 board_be_init = dec_be_init; 150 board_be_init = dec_be_init;
154 board_time_init = dec_time_init;
155 151
156 wbflush_setup(); 152 wbflush_setup();
157 153
diff --git a/arch/mips/dec/time.c b/arch/mips/dec/time.c
index 8b7e0c17ac35..820e5331205f 100644
--- a/arch/mips/dec/time.c
+++ b/arch/mips/dec/time.c
@@ -24,7 +24,6 @@
24 24
25#include <asm/bootinfo.h> 25#include <asm/bootinfo.h>
26#include <asm/cpu.h> 26#include <asm/cpu.h>
27#include <asm/div64.h>
28#include <asm/io.h> 27#include <asm/io.h>
29#include <asm/irq.h> 28#include <asm/irq.h>
30#include <asm/mipsregs.h> 29#include <asm/mipsregs.h>
@@ -36,7 +35,7 @@
36#include <asm/dec/ioasic_addrs.h> 35#include <asm/dec/ioasic_addrs.h>
37#include <asm/dec/machtype.h> 36#include <asm/dec/machtype.h>
38 37
39static unsigned long dec_rtc_get_time(void) 38unsigned long read_persistent_clock(void)
40{ 39{
41 unsigned int year, mon, day, hour, min, sec, real_year; 40 unsigned int year, mon, day, hour, min, sec, real_year;
42 unsigned long flags; 41 unsigned long flags;
@@ -75,13 +74,13 @@ static unsigned long dec_rtc_get_time(void)
75} 74}
76 75
77/* 76/*
78 * In order to set the CMOS clock precisely, dec_rtc_set_mmss has to 77 * In order to set the CMOS clock precisely, rtc_mips_set_mmss has to
79 * be called 500 ms after the second nowtime has started, because when 78 * be called 500 ms after the second nowtime has started, because when
80 * nowtime is written into the registers of the CMOS clock, it will 79 * nowtime is written into the registers of the CMOS clock, it will
81 * jump to the next second precisely 500 ms later. Check the Dallas 80 * jump to the next second precisely 500 ms later. Check the Dallas
82 * DS1287 data sheet for details. 81 * DS1287 data sheet for details.
83 */ 82 */
84static int dec_rtc_set_mmss(unsigned long nowtime) 83int rtc_mips_set_mmss(unsigned long nowtime)
85{ 84{
86 int retval = 0; 85 int retval = 0;
87 int real_seconds, real_minutes, cmos_minutes; 86 int real_seconds, real_minutes, cmos_minutes;
@@ -140,7 +139,6 @@ static int dec_rtc_set_mmss(unsigned long nowtime)
140 return retval; 139 return retval;
141} 140}
142 141
143
144static int dec_timer_state(void) 142static int dec_timer_state(void)
145{ 143{
146 return (CMOS_READ(RTC_REG_C) & RTC_PF) != 0; 144 return (CMOS_READ(RTC_REG_C) & RTC_PF) != 0;
@@ -161,11 +159,8 @@ static cycle_t dec_ioasic_hpt_read(void)
161} 159}
162 160
163 161
164void __init dec_time_init(void) 162void __init plat_time_init(void)
165{ 163{
166 rtc_mips_get_time = dec_rtc_get_time;
167 rtc_mips_set_mmss = dec_rtc_set_mmss;
168
169 mips_timer_state = dec_timer_state; 164 mips_timer_state = dec_timer_state;
170 mips_timer_ack = dec_timer_ack; 165 mips_timer_ack = dec_timer_ack;
171 166
diff --git a/arch/mips/emma2rh/common/prom.c b/arch/mips/emma2rh/common/prom.c
index 7433bd8e5562..0f791eb6bb66 100644
--- a/arch/mips/emma2rh/common/prom.c
+++ b/arch/mips/emma2rh/common/prom.c
@@ -62,8 +62,6 @@ void __init prom_init(void)
62 strcat(arcs_cmdline, " "); 62 strcat(arcs_cmdline, " ");
63 } 63 }
64 64
65 mips_machgroup = MACH_GROUP_NEC_EMMA2RH;
66
67#if defined(CONFIG_MARKEINS) 65#if defined(CONFIG_MARKEINS)
68 mips_machtype = MACH_NEC_MARKEINS; 66 mips_machtype = MACH_NEC_MARKEINS;
69 add_memory_region(0, EMMA2RH_RAM_SIZE, BOOT_MEM_RAM); 67 add_memory_region(0, EMMA2RH_RAM_SIZE, BOOT_MEM_RAM);
diff --git a/arch/mips/emma2rh/markeins/setup.c b/arch/mips/emma2rh/markeins/setup.c
index 2f060e1ed36c..5e1da53b04a7 100644
--- a/arch/mips/emma2rh/markeins/setup.c
+++ b/arch/mips/emma2rh/markeins/setup.c
@@ -88,7 +88,7 @@ static unsigned int __init detect_bus_frequency(unsigned long rtc_base)
88 return clock[reg]; 88 return clock[reg];
89} 89}
90 90
91static void __init emma2rh_time_init(void) 91void __init plat_time_init(void)
92{ 92{
93 u32 reg; 93 u32 reg;
94 if (bus_frequency == 0) 94 if (bus_frequency == 0)
@@ -124,8 +124,6 @@ void __init plat_mem_setup(void)
124 124
125 set_io_port_base(KSEG1ADDR(EMMA2RH_PCI_IO_BASE)); 125 set_io_port_base(KSEG1ADDR(EMMA2RH_PCI_IO_BASE));
126 126
127 board_time_init = emma2rh_time_init;
128
129 _machine_restart = markeins_machine_restart; 127 _machine_restart = markeins_machine_restart;
130 _machine_halt = markeins_machine_halt; 128 _machine_halt = markeins_machine_halt;
131 pm_power_off = markeins_machine_power_off; 129 pm_power_off = markeins_machine_power_off;
diff --git a/arch/mips/arc/Makefile b/arch/mips/fw/arc/Makefile
index 4f349ec1ea2d..4f349ec1ea2d 100644
--- a/arch/mips/arc/Makefile
+++ b/arch/mips/fw/arc/Makefile
diff --git a/arch/mips/arc/arc_con.c b/arch/mips/fw/arc/arc_con.c
index bc32fe64f42a..bc32fe64f42a 100644
--- a/arch/mips/arc/arc_con.c
+++ b/arch/mips/fw/arc/arc_con.c
diff --git a/arch/mips/arc/cmdline.c b/arch/mips/fw/arc/cmdline.c
index fd604ef28823..fd604ef28823 100644
--- a/arch/mips/arc/cmdline.c
+++ b/arch/mips/fw/arc/cmdline.c
diff --git a/arch/mips/arc/env.c b/arch/mips/fw/arc/env.c
index e521a6e010aa..6f5dd42b96e2 100644
--- a/arch/mips/arc/env.c
+++ b/arch/mips/fw/arc/env.c
@@ -11,7 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/string.h> 12#include <linux/string.h>
13 13
14#include <asm/arc/types.h> 14#include <asm/fw/arc/types.h>
15#include <asm/sgialib.h> 15#include <asm/sgialib.h>
16 16
17PCHAR __init 17PCHAR __init
diff --git a/arch/mips/arc/file.c b/arch/mips/fw/arc/file.c
index cb0127cf5bc1..30335341b447 100644
--- a/arch/mips/arc/file.c
+++ b/arch/mips/fw/arc/file.c
@@ -10,7 +10,7 @@
10 */ 10 */
11#include <linux/init.h> 11#include <linux/init.h>
12 12
13#include <asm/arc/types.h> 13#include <asm/fw/arc/types.h>
14#include <asm/sgialib.h> 14#include <asm/sgialib.h>
15 15
16LONG 16LONG
diff --git a/arch/mips/arc/identify.c b/arch/mips/fw/arc/identify.c
index 4b907369b0f9..28dfd2e2989a 100644
--- a/arch/mips/arc/identify.c
+++ b/arch/mips/fw/arc/identify.c
@@ -22,52 +22,51 @@
22struct smatch { 22struct smatch {
23 char *arcname; 23 char *arcname;
24 char *liname; 24 char *liname;
25 int group;
26 int type; 25 int type;
27 int flags; 26 int flags;
28}; 27};
29 28
30static struct smatch mach_table[] = { 29static struct smatch mach_table[] = {
31 { "SGI-IP22", 30 {
32 "SGI Indy", 31 .arcname = "SGI-IP22",
33 MACH_GROUP_SGI, 32 .liname = "SGI Indy",
34 MACH_SGI_IP22, 33 .type = MACH_SGI_IP22,
35 PROM_FLAG_ARCS 34 .flags = PROM_FLAG_ARCS,
36 }, { "SGI-IP27", 35 }, {
37 "SGI Origin", 36 .arcname = "SGI-IP27",
38 MACH_GROUP_SGI, 37 .liname = "SGI Origin",
39 MACH_SGI_IP27, 38 .type = MACH_SGI_IP27,
40 PROM_FLAG_ARCS 39 .flags = PROM_FLAG_ARCS,
41 }, { "SGI-IP28", 40 }, {
42 "SGI IP28", 41 .arcname = "SGI-IP28",
43 MACH_GROUP_SGI, 42 .liname = "SGI IP28",
44 MACH_SGI_IP28, 43 .type = MACH_SGI_IP28,
45 PROM_FLAG_ARCS 44 .flags = PROM_FLAG_ARCS,
46 }, { "SGI-IP30", 45 }, {
47 "SGI Octane", 46 .arcname = "SGI-IP30",
48 MACH_GROUP_SGI, 47 .liname = "SGI Octane",
49 MACH_SGI_IP30, 48 .type = MACH_SGI_IP30,
50 PROM_FLAG_ARCS 49 .flags = PROM_FLAG_ARCS,
51 }, { "SGI-IP32", 50 }, {
52 "SGI O2", 51 .arcname = "SGI-IP32",
53 MACH_GROUP_SGI, 52 .liname = "SGI O2",
54 MACH_SGI_IP32, 53 .type = MACH_SGI_IP32,
55 PROM_FLAG_ARCS 54 .flags = PROM_FLAG_ARCS,
56 }, { "Microsoft-Jazz", 55 }, {
57 "Jazz MIPS_Magnum_4000", 56 .arcname = "Microsoft-Jazz",
58 MACH_GROUP_JAZZ, 57 .liname = "Jazz MIPS_Magnum_4000",
59 MACH_MIPS_MAGNUM_4000, 58 .type = MACH_MIPS_MAGNUM_4000,
60 0 59 .flags = 0,
61 }, { "PICA-61", 60 }, {
62 "Jazz Acer_PICA_61", 61 .arcname = "PICA-61",
63 MACH_GROUP_JAZZ, 62 .liname = "Jazz Acer_PICA_61",
64 MACH_ACER_PICA_61, 63 .type = MACH_ACER_PICA_61,
65 0 64 .flags = 0,
66 }, { "RM200PCI", 65 }, {
67 "SNI RM200_PCI", 66 .arcname = "RM200PCI",
68 MACH_GROUP_SNI_RM, 67 .liname = "SNI RM200_PCI",
69 MACH_SNI_RM200_PCI, 68 .type = MACH_SNI_RM200_PCI,
70 PROM_FLAG_DONT_FREE_TEMP 69 .flags = PROM_FLAG_DONT_FREE_TEMP,
71 } 70 }
72}; 71};
73 72
@@ -117,7 +116,6 @@ void __init prom_identify_arch(void)
117 mach = string_to_mach(iname); 116 mach = string_to_mach(iname);
118 system_type = mach->liname; 117 system_type = mach->liname;
119 118
120 mips_machgroup = mach->group;
121 mips_machtype = mach->type; 119 mips_machtype = mach->type;
122 prom_flags = mach->flags; 120 prom_flags = mach->flags;
123} 121}
diff --git a/arch/mips/arc/init.c b/arch/mips/fw/arc/init.c
index e2f75b13312f..e2f75b13312f 100644
--- a/arch/mips/arc/init.c
+++ b/arch/mips/fw/arc/init.c
diff --git a/arch/mips/arc/memory.c b/arch/mips/fw/arc/memory.c
index 83d15791ef6a..8b8eea2b6cf6 100644
--- a/arch/mips/arc/memory.c
+++ b/arch/mips/fw/arc/memory.c
@@ -63,7 +63,7 @@ static char *arc_mtypes[8] = {
63 : arc_mtypes[a.arc] 63 : arc_mtypes[a.arc]
64#endif 64#endif
65 65
66static inline int memtype_classify_arcs (union linux_memtypes type) 66static inline int memtype_classify_arcs(union linux_memtypes type)
67{ 67{
68 switch (type.arcs) { 68 switch (type.arcs) {
69 case arcs_fcontig: 69 case arcs_fcontig:
@@ -83,7 +83,7 @@ static inline int memtype_classify_arcs (union linux_memtypes type)
83 while(1); /* Nuke warning. */ 83 while(1); /* Nuke warning. */
84} 84}
85 85
86static inline int memtype_classify_arc (union linux_memtypes type) 86static inline int memtype_classify_arc(union linux_memtypes type)
87{ 87{
88 switch (type.arc) { 88 switch (type.arc) {
89 case arc_free: 89 case arc_free:
@@ -103,7 +103,7 @@ static inline int memtype_classify_arc (union linux_memtypes type)
103 while(1); /* Nuke warning. */ 103 while(1); /* Nuke warning. */
104} 104}
105 105
106static int __init prom_memtype_classify (union linux_memtypes type) 106static int __init prom_memtype_classify(union linux_memtypes type)
107{ 107{
108 if (prom_flags & PROM_FLAG_ARCS) /* SGI is ``different'' ... */ 108 if (prom_flags & PROM_FLAG_ARCS) /* SGI is ``different'' ... */
109 return memtype_classify_arcs(type); 109 return memtype_classify_arcs(type);
diff --git a/arch/mips/arc/misc.c b/arch/mips/fw/arc/misc.c
index b2e10b9e9452..e527c5fd5a32 100644
--- a/arch/mips/arc/misc.c
+++ b/arch/mips/fw/arc/misc.c
@@ -14,7 +14,7 @@
14 14
15#include <asm/bcache.h> 15#include <asm/bcache.h>
16 16
17#include <asm/arc/types.h> 17#include <asm/fw/arc/types.h>
18#include <asm/sgialib.h> 18#include <asm/sgialib.h>
19#include <asm/bootinfo.h> 19#include <asm/bootinfo.h>
20#include <asm/system.h> 20#include <asm/system.h>
diff --git a/arch/mips/arc/promlib.c b/arch/mips/fw/arc/promlib.c
index c508c00dbb64..c508c00dbb64 100644
--- a/arch/mips/arc/promlib.c
+++ b/arch/mips/fw/arc/promlib.c
diff --git a/arch/mips/arc/salone.c b/arch/mips/fw/arc/salone.c
index e6afb64723d0..e6afb64723d0 100644
--- a/arch/mips/arc/salone.c
+++ b/arch/mips/fw/arc/salone.c
diff --git a/arch/mips/arc/time.c b/arch/mips/fw/arc/time.c
index 299ff2c5c0b5..42138c837d48 100644
--- a/arch/mips/arc/time.c
+++ b/arch/mips/fw/arc/time.c
@@ -9,7 +9,7 @@
9 */ 9 */
10#include <linux/init.h> 10#include <linux/init.h>
11 11
12#include <asm/arc/types.h> 12#include <asm/fw/arc/types.h>
13#include <asm/sgialib.h> 13#include <asm/sgialib.h>
14 14
15struct linux_tinfo * __init 15struct linux_tinfo * __init
diff --git a/arch/mips/arc/tree.c b/arch/mips/fw/arc/tree.c
index abd1786ea09b..d68e5a59c1f6 100644
--- a/arch/mips/arc/tree.c
+++ b/arch/mips/fw/arc/tree.c
@@ -10,7 +10,7 @@
10 * Copyright (C) 1999 Silicon Graphics, Inc. 10 * Copyright (C) 1999 Silicon Graphics, Inc.
11 */ 11 */
12#include <linux/init.h> 12#include <linux/init.h>
13#include <asm/arc/types.h> 13#include <asm/fw/arc/types.h>
14#include <asm/sgialib.h> 14#include <asm/sgialib.h>
15 15
16#undef DEBUG_PROM_TREE 16#undef DEBUG_PROM_TREE
diff --git a/arch/mips/fw/cfe/Makefile b/arch/mips/fw/cfe/Makefile
new file mode 100644
index 000000000000..8f20044c0adf
--- /dev/null
+++ b/arch/mips/fw/cfe/Makefile
@@ -0,0 +1,5 @@
1#
2# Makefile for the Broadcom Common Firmware Environment support
3#
4
5lib-y += cfe_api.o
diff --git a/arch/mips/sibyte/cfe/cfe_api.c b/arch/mips/fw/cfe/cfe_api.c
index c0213605e18a..a9f69e4e40ac 100644
--- a/arch/mips/sibyte/cfe/cfe_api.c
+++ b/arch/mips/fw/cfe/cfe_api.c
@@ -30,7 +30,7 @@
30 * 30 *
31 ********************************************************************* */ 31 ********************************************************************* */
32 32
33#include "cfe_api.h" 33#include <asm/fw/cfe/cfe_api.h>
34#include "cfe_api_int.h" 34#include "cfe_api_int.h"
35 35
36/* Cast from a native pointer to a cfe_xptr_t and back. */ 36/* Cast from a native pointer to a cfe_xptr_t and back. */
diff --git a/arch/mips/sibyte/cfe/cfe_api_int.h b/arch/mips/fw/cfe/cfe_api_int.h
index f7e5a64b55f3..f7e5a64b55f3 100644
--- a/arch/mips/sibyte/cfe/cfe_api_int.h
+++ b/arch/mips/fw/cfe/cfe_api_int.h
diff --git a/arch/mips/gt64120/wrppmc/Makefile b/arch/mips/gt64120/wrppmc/Makefile
index bef15c90ae15..b49d282bee8a 100644
--- a/arch/mips/gt64120/wrppmc/Makefile
+++ b/arch/mips/gt64120/wrppmc/Makefile
@@ -9,6 +9,6 @@
9# Makefile for the Wind River MIPS 4KC PPMC Eval Board 9# Makefile for the Wind River MIPS 4KC PPMC Eval Board
10# 10#
11 11
12obj-y += irq.o reset.o setup.o time.o pci.o 12obj-y += irq.o pci.o reset.o serial.o setup.o time.o
13 13
14EXTRA_CFLAGS += -Werror 14EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/gt64120/wrppmc/irq.c b/arch/mips/gt64120/wrppmc/irq.c
index 06177bf5b1d6..c6e706274db4 100644
--- a/arch/mips/gt64120/wrppmc/irq.c
+++ b/arch/mips/gt64120/wrppmc/irq.c
@@ -9,26 +9,13 @@
9 * Free Software Foundation; either version 2 of the License, or (at your 9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version. 10 * option) any later version.
11 */ 11 */
12#include <linux/errno.h> 12#include <linux/hardirq.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel_stat.h> 14#include <linux/irq.h>
15#include <linux/module.h> 15
16#include <linux/signal.h>
17#include <linux/sched.h>
18#include <linux/types.h>
19#include <linux/interrupt.h>
20#include <linux/ioport.h>
21#include <linux/timex.h>
22#include <linux/slab.h>
23#include <linux/random.h>
24#include <linux/bitops.h>
25#include <asm/bootinfo.h>
26#include <asm/io.h>
27#include <asm/bitops.h>
28#include <asm/mipsregs.h>
29#include <asm/system.h>
30#include <asm/irq_cpu.h>
31#include <asm/gt64120.h> 16#include <asm/gt64120.h>
17#include <asm/irq_cpu.h>
18#include <asm/mipsregs.h>
32 19
33asmlinkage void plat_irq_dispatch(void) 20asmlinkage void plat_irq_dispatch(void)
34{ 21{
diff --git a/arch/mips/gt64120/wrppmc/pci.c b/arch/mips/gt64120/wrppmc/pci.c
index 0d5289bc1804..d06192faeb7c 100644
--- a/arch/mips/gt64120/wrppmc/pci.c
+++ b/arch/mips/gt64120/wrppmc/pci.c
@@ -8,9 +8,10 @@
8 * for more details. 8 * for more details.
9 */ 9 */
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/ioport.h>
11#include <linux/types.h> 12#include <linux/types.h>
12#include <linux/pci.h> 13#include <linux/pci.h>
13#include <linux/kernel.h> 14
14#include <asm/gt64120.h> 15#include <asm/gt64120.h>
15 16
16extern struct pci_ops gt64xxx_pci0_ops; 17extern struct pci_ops gt64xxx_pci0_ops;
diff --git a/arch/mips/gt64120/wrppmc/reset.c b/arch/mips/gt64120/wrppmc/reset.c
index b97039c6d3db..c355cff38f6c 100644
--- a/arch/mips/gt64120/wrppmc/reset.c
+++ b/arch/mips/gt64120/wrppmc/reset.c
@@ -5,14 +5,10 @@
5 * 5 *
6 * Copyright (C) 1997 Ralf Baechle 6 * Copyright (C) 1997 Ralf Baechle
7 */ 7 */
8#include <linux/sched.h> 8#include <linux/kernel.h>
9#include <linux/mm.h> 9
10#include <asm/io.h>
11#include <asm/pgtable.h>
12#include <asm/processor.h>
13#include <asm/reboot.h>
14#include <asm/system.h>
15#include <asm/cacheflush.h> 10#include <asm/cacheflush.h>
11#include <asm/mipsregs.h>
16 12
17void wrppmc_machine_restart(char *command) 13void wrppmc_machine_restart(char *command)
18{ 14{
diff --git a/arch/mips/gt64120/wrppmc/serial.c b/arch/mips/gt64120/wrppmc/serial.c
new file mode 100644
index 000000000000..5ec1c2ffd3a5
--- /dev/null
+++ b/arch/mips/gt64120/wrppmc/serial.c
@@ -0,0 +1,80 @@
1/*
2 * Registration of WRPPMC UART platform device.
3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/errno.h>
21#include <linux/init.h>
22#include <linux/ioport.h>
23#include <linux/platform_device.h>
24#include <linux/serial_8250.h>
25
26#include <asm/gt64120.h>
27
28static struct resource wrppmc_uart_resource[] __initdata = {
29 {
30 .start = WRPPMC_UART16550_BASE,
31 .end = WRPPMC_UART16550_BASE + 7,
32 .flags = IORESOURCE_MEM,
33 },
34 {
35 .start = WRPPMC_UART16550_IRQ,
36 .end = WRPPMC_UART16550_IRQ,
37 .flags = IORESOURCE_IRQ,
38 },
39};
40
41static struct plat_serial8250_port wrppmc_serial8250_port[] = {
42 {
43 .irq = WRPPMC_UART16550_IRQ,
44 .uartclk = WRPPMC_UART16550_CLOCK,
45 .iotype = UPIO_MEM,
46 .flags = UPF_IOREMAP | UPF_SKIP_TEST,
47 .mapbase = WRPPMC_UART16550_BASE,
48 },
49 {},
50};
51
52static __init int wrppmc_uart_add(void)
53{
54 struct platform_device *pdev;
55 int retval;
56
57 pdev = platform_device_alloc("serial8250", -1);
58 if (!pdev)
59 return -ENOMEM;
60
61 pdev->id = PLAT8250_DEV_PLATFORM;
62 pdev->dev.platform_data = wrppmc_serial8250_port;
63
64 retval = platform_device_add_resources(pdev, wrppmc_uart_resource,
65 ARRAY_SIZE(wrppmc_uart_resource));
66 if (retval)
67 goto err_free_device;
68
69 retval = platform_device_add(pdev);
70 if (retval)
71 goto err_free_device;
72
73 return 0;
74
75err_free_device:
76 platform_device_put(pdev);
77
78 return retval;
79}
80device_initcall(wrppmc_uart_add);
diff --git a/arch/mips/gt64120/wrppmc/setup.c b/arch/mips/gt64120/wrppmc/setup.c
index ed58c13b6032..51f6b7862460 100644
--- a/arch/mips/gt64120/wrppmc/setup.c
+++ b/arch/mips/gt64120/wrppmc/setup.c
@@ -11,10 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/string.h> 12#include <linux/string.h>
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/tty.h>
15#include <linux/serial.h>
16#include <linux/serial_core.h>
17#include <linux/serial_8250.h>
18#include <linux/pm.h> 14#include <linux/pm.h>
19 15
20#include <asm/io.h> 16#include <asm/io.h>
@@ -98,35 +94,8 @@ void __init prom_free_prom_memory(void)
98{ 94{
99} 95}
100 96
101#ifdef CONFIG_SERIAL_8250
102static void wrppmc_setup_serial(void)
103{
104 struct uart_port up;
105
106 memset(&up, 0x00, sizeof(struct uart_port));
107
108 /*
109 * A note about mapbase/membase
110 * -) mapbase is the physical address of the IO port.
111 * -) membase is an 'ioremapped' cookie.
112 */
113 up.line = 0;
114 up.type = PORT_16550;
115 up.iotype = UPIO_MEM;
116 up.mapbase = WRPPMC_UART16550_BASE;
117 up.membase = ioremap(up.mapbase, 8);
118 up.irq = WRPPMC_UART16550_IRQ;
119 up.uartclk = WRPPMC_UART16550_CLOCK;
120 up.flags = UPF_SKIP_TEST/* | UPF_BOOT_AUTOCONF */;
121 up.regshift = 0;
122
123 early_serial_setup(&up);
124}
125#endif
126
127void __init plat_mem_setup(void) 97void __init plat_mem_setup(void)
128{ 98{
129 extern void wrppmc_time_init(void);
130 extern void wrppmc_machine_restart(char *command); 99 extern void wrppmc_machine_restart(char *command);
131 extern void wrppmc_machine_halt(void); 100 extern void wrppmc_machine_halt(void);
132 extern void wrppmc_machine_power_off(void); 101 extern void wrppmc_machine_power_off(void);
@@ -135,17 +104,10 @@ void __init plat_mem_setup(void)
135 _machine_halt = wrppmc_machine_halt; 104 _machine_halt = wrppmc_machine_halt;
136 pm_power_off = wrppmc_machine_power_off; 105 pm_power_off = wrppmc_machine_power_off;
137 106
138 /* Use MIPS Count/Compare Timer */
139 board_time_init = wrppmc_time_init;
140
141 /* This makes the operations of 'in/out[bwl]' to the 107 /* This makes the operations of 'in/out[bwl]' to the
142 * physical address ( < KSEG0) can work via KSEG1 108 * physical address ( < KSEG0) can work via KSEG1
143 */ 109 */
144 set_io_port_base(KSEG1); 110 set_io_port_base(KSEG1);
145
146#ifdef CONFIG_SERIAL_8250
147 wrppmc_setup_serial();
148#endif
149} 111}
150 112
151const char *get_system_type(void) 113const char *get_system_type(void)
@@ -159,7 +121,6 @@ const char *get_system_type(void)
159 */ 121 */
160void __init prom_init(void) 122void __init prom_init(void)
161{ 123{
162 mips_machgroup = MACH_GROUP_WINDRIVER;
163 mips_machtype = MACH_WRPPMC; 124 mips_machtype = MACH_WRPPMC;
164 125
165 add_memory_region(WRPPMC_SDRAM_SCS0_BASE, WRPPMC_SDRAM_SCS0_SIZE, BOOT_MEM_RAM); 126 add_memory_region(WRPPMC_SDRAM_SCS0_BASE, WRPPMC_SDRAM_SCS0_SIZE, BOOT_MEM_RAM);
diff --git a/arch/mips/gt64120/wrppmc/time.c b/arch/mips/gt64120/wrppmc/time.c
index 5b440859bcee..b207e7f1417a 100644
--- a/arch/mips/gt64120/wrppmc/time.c
+++ b/arch/mips/gt64120/wrppmc/time.c
@@ -11,18 +11,11 @@
11 * Copyright (C) 2006, Wind River System Inc. 11 * Copyright (C) 2006, Wind River System Inc.
12 */ 12 */
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/string.h>
15#include <linux/kernel.h>
16#include <linux/param.h> /* for HZ */
17#include <linux/irq.h>
18#include <linux/timex.h>
19#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/irq.h>
20 16
21#include <asm/reboot.h>
22#include <asm/time.h>
23#include <asm/io.h>
24#include <asm/bootinfo.h>
25#include <asm/gt64120.h> 17#include <asm/gt64120.h>
18#include <asm/time.h>
26 19
27#define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */ 20#define WRPPMC_CPU_CLK_FREQ 40000000 /* 40MHZ */
28 21
@@ -38,7 +31,7 @@ void __init plat_timer_setup(struct irqaction *irq)
38 * NOTE: We disable all GT64120 timers, and use MIPS processor internal 31 * NOTE: We disable all GT64120 timers, and use MIPS processor internal
39 * timer as the source of kernel clock tick. 32 * timer as the source of kernel clock tick.
40 */ 33 */
41void __init wrppmc_time_init(void) 34void __init plat_time_init(void)
42{ 35{
43 /* Disable GT64120 timers */ 36 /* Disable GT64120 timers */
44 GT_WRITE(GT_TC_CONTROL_OFS, 0x00); 37 GT_WRITE(GT_TC_CONTROL_OFS, 0x00);
diff --git a/arch/mips/jazz/Makefile b/arch/mips/jazz/Makefile
index 575a9442bc82..5aee0c266d18 100644
--- a/arch/mips/jazz/Makefile
+++ b/arch/mips/jazz/Makefile
@@ -2,6 +2,6 @@
2# Makefile for the Jazz family specific parts of the kernel 2# Makefile for the Jazz family specific parts of the kernel
3# 3#
4 4
5obj-y := irq.o jazzdma.o jazz-platform.o reset.o setup.o 5obj-y := irq.o jazzdma.o reset.o setup.o
6 6
7EXTRA_CFLAGS += -Werror 7EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index 015cf4bb51dd..835b056cea36 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -6,20 +6,23 @@
6 * Copyright (C) 1992 Linus Torvalds 6 * Copyright (C) 1992 Linus Torvalds
7 * Copyright (C) 1994 - 2001, 2003 Ralf Baechle 7 * Copyright (C) 1994 - 2001, 2003 Ralf Baechle
8 */ 8 */
9#include <linux/clockchips.h>
9#include <linux/init.h> 10#include <linux/init.h>
10#include <linux/interrupt.h> 11#include <linux/interrupt.h>
11#include <linux/kernel.h> 12#include <linux/kernel.h>
12#include <linux/spinlock.h> 13#include <linux/spinlock.h>
13 14
15#include <asm/irq_cpu.h>
14#include <asm/i8259.h> 16#include <asm/i8259.h>
15#include <asm/io.h> 17#include <asm/io.h>
16#include <asm/jazz.h> 18#include <asm/jazz.h>
19#include <asm/pgtable.h>
17 20
18static DEFINE_SPINLOCK(r4030_lock); 21static DEFINE_SPINLOCK(r4030_lock);
19 22
20static void enable_r4030_irq(unsigned int irq) 23static void enable_r4030_irq(unsigned int irq)
21{ 24{
22 unsigned int mask = 1 << (irq - JAZZ_PARALLEL_IRQ); 25 unsigned int mask = 1 << (irq - JAZZ_IRQ_START);
23 unsigned long flags; 26 unsigned long flags;
24 27
25 spin_lock_irqsave(&r4030_lock, flags); 28 spin_lock_irqsave(&r4030_lock, flags);
@@ -30,7 +33,7 @@ static void enable_r4030_irq(unsigned int irq)
30 33
31void disable_r4030_irq(unsigned int irq) 34void disable_r4030_irq(unsigned int irq)
32{ 35{
33 unsigned int mask = ~(1 << (irq - JAZZ_PARALLEL_IRQ)); 36 unsigned int mask = ~(1 << (irq - JAZZ_IRQ_START));
34 unsigned long flags; 37 unsigned long flags;
35 38
36 spin_lock_irqsave(&r4030_lock, flags); 39 spin_lock_irqsave(&r4030_lock, flags);
@@ -51,7 +54,7 @@ void __init init_r4030_ints(void)
51{ 54{
52 int i; 55 int i;
53 56
54 for (i = JAZZ_PARALLEL_IRQ; i <= JAZZ_TIMER_IRQ; i++) 57 for (i = JAZZ_IRQ_START; i <= JAZZ_IRQ_END; i++)
55 set_irq_chip_and_handler(i, &r4030_irq_type, handle_level_irq); 58 set_irq_chip_and_handler(i, &r4030_irq_type, handle_level_irq);
56 59
57 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, 0); 60 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE, 0);
@@ -66,82 +69,87 @@ void __init init_r4030_ints(void)
66 */ 69 */
67void __init arch_init_irq(void) 70void __init arch_init_irq(void)
68{ 71{
72 /*
73 * this is a hack to get back the still needed wired mapping
74 * killed by init_mm()
75 */
76
77 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
78 add_wired_entry(0x02000017, 0x03c00017, 0xe0000000, PM_64K);
79 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
80 add_wired_entry(0x02400017, 0x02440017, 0xe2000000, PM_16M);
81 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
82 add_wired_entry(0x01800017, 0x01000017, 0xe4000000, PM_4M);
83
69 init_i8259_irqs(); /* Integrated i8259 */ 84 init_i8259_irqs(); /* Integrated i8259 */
85 mips_cpu_irq_init();
70 init_r4030_ints(); 86 init_r4030_ints();
71 87
72 change_c0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1); 88 change_c0_status(ST0_IM, IE_IRQ2 | IE_IRQ1);
73}
74
75static void loc_call(unsigned int irq, unsigned int mask)
76{
77 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE,
78 r4030_read_reg16(JAZZ_IO_IRQ_ENABLE) & mask);
79 do_IRQ(irq);
80 r4030_write_reg16(JAZZ_IO_IRQ_ENABLE,
81 r4030_read_reg16(JAZZ_IO_IRQ_ENABLE) | mask);
82}
83
84static void ll_local_dev(void)
85{
86 switch (r4030_read_reg32(JAZZ_IO_IRQ_SOURCE)) {
87 case 0:
88 panic("Unimplemented loc_no_irq handler");
89 break;
90 case 4:
91 loc_call(JAZZ_PARALLEL_IRQ, JAZZ_IE_PARALLEL);
92 break;
93 case 8:
94 loc_call(JAZZ_PARALLEL_IRQ, JAZZ_IE_FLOPPY);
95 break;
96 case 12:
97 panic("Unimplemented loc_sound handler");
98 break;
99 case 16:
100 panic("Unimplemented loc_video handler");
101 break;
102 case 20:
103 loc_call(JAZZ_ETHERNET_IRQ, JAZZ_IE_ETHERNET);
104 break;
105 case 24:
106 loc_call(JAZZ_SCSI_IRQ, JAZZ_IE_SCSI);
107 break;
108 case 28:
109 loc_call(JAZZ_KEYBOARD_IRQ, JAZZ_IE_KEYBOARD);
110 break;
111 case 32:
112 loc_call(JAZZ_MOUSE_IRQ, JAZZ_IE_MOUSE);
113 break;
114 case 36:
115 loc_call(JAZZ_SERIAL1_IRQ, JAZZ_IE_SERIAL1);
116 break;
117 case 40:
118 loc_call(JAZZ_SERIAL2_IRQ, JAZZ_IE_SERIAL2);
119 break;
120 }
121} 89}
122 90
123asmlinkage void plat_irq_dispatch(void) 91asmlinkage void plat_irq_dispatch(void)
124{ 92{
125 unsigned int pending = read_c0_cause() & read_c0_status(); 93 unsigned int pending = read_c0_cause() & read_c0_status();
94 unsigned int irq;
126 95
127 if (pending & IE_IRQ5) 96 if (pending & IE_IRQ4) {
128 write_c0_compare(0);
129 else if (pending & IE_IRQ4) {
130 r4030_read_reg32(JAZZ_TIMER_REGISTER); 97 r4030_read_reg32(JAZZ_TIMER_REGISTER);
131 do_IRQ(JAZZ_TIMER_IRQ); 98 do_IRQ(JAZZ_TIMER_IRQ);
132 } else if (pending & IE_IRQ3) 99 } else if (pending & IE_IRQ2)
133 panic("Unimplemented ISA NMI handler");
134 else if (pending & IE_IRQ2)
135 do_IRQ(r4030_read_reg32(JAZZ_EISA_IRQ_ACK)); 100 do_IRQ(r4030_read_reg32(JAZZ_EISA_IRQ_ACK));
136 else if (pending & IE_IRQ1) { 101 else if (pending & IE_IRQ1) {
137 ll_local_dev(); 102 irq = *(volatile u8 *)JAZZ_IO_IRQ_SOURCE >> 2;
138 } else if (unlikely(pending & IE_IRQ0)) 103 if (likely(irq > 0))
139 panic("Unimplemented local_dma handler"); 104 do_IRQ(irq + JAZZ_IRQ_START - 1);
140 else if (pending & IE_SW1) { 105 else
141 clear_c0_cause(IE_SW1); 106 panic("Unimplemented loc_no_irq handler");
142 panic("Unimplemented sw1 handler");
143 } else if (pending & IE_SW0) {
144 clear_c0_cause(IE_SW0);
145 panic("Unimplemented sw0 handler");
146 } 107 }
147} 108}
109
110static void r4030_set_mode(enum clock_event_mode mode,
111 struct clock_event_device *evt)
112{
113 /* Nothing to do ... */
114}
115
116struct clock_event_device r4030_clockevent = {
117 .name = "r4030",
118 .features = CLOCK_EVT_FEAT_PERIODIC,
119 .rating = 100,
120 .irq = JAZZ_TIMER_IRQ,
121 .cpumask = CPU_MASK_CPU0,
122 .set_mode = r4030_set_mode,
123};
124
125static irqreturn_t r4030_timer_interrupt(int irq, void *dev_id)
126{
127 r4030_clockevent.event_handler(&r4030_clockevent);
128
129 return IRQ_HANDLED;
130}
131
132static struct irqaction r4030_timer_irqaction = {
133 .handler = r4030_timer_interrupt,
134 .flags = IRQF_DISABLED,
135 .mask = CPU_MASK_CPU0,
136 .name = "timer",
137};
138
139void __init plat_timer_setup(struct irqaction *ignored)
140{
141 struct irqaction *irq = &r4030_timer_irqaction;
142
143 BUG_ON(HZ != 100);
144
145 /*
146 * Set clock to 100Hz.
147 *
148 * The R4030 timer receives an input clock of 1kHz which is divieded by
149 * a programmable 4-bit divider. This makes it fairly inflexible.
150 */
151 r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
152 setup_irq(JAZZ_TIMER_IRQ, irq);
153
154 clockevents_register_device(&r4030_clockevent);
155}
diff --git a/arch/mips/jazz/jazz-platform.c b/arch/mips/jazz/jazz-platform.c
deleted file mode 100644
index fd736703eef2..000000000000
--- a/arch/mips/jazz/jazz-platform.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
7 */
8#include <linux/init.h>
9#include <linux/module.h>
10#include <linux/serial_8250.h>
11
12#include <asm/jazz.h>
13
14/*
15 * Confusion ... It seems the original Microsoft Jazz machine used to have a
16 * 4.096MHz clock for its UART while the MIPS Magnum and Millenium systems
17 * had 8MHz. The Olivetti M700-10 and the Acer PICA have 1.8432MHz like PCs.
18 */
19#ifdef CONFIG_OLIVETTI_M700
20#define JAZZ_BASE_BAUD 1843200
21#else
22#define JAZZ_BASE_BAUD 8000000 /* 3072000 */
23#endif
24
25#define JAZZ_UART_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP)
26
27#define JAZZ_PORT(base, int) \
28{ \
29 .mapbase = base, \
30 .irq = int, \
31 .uartclk = JAZZ_BASE_BAUD, \
32 .iotype = UPIO_MEM, \
33 .flags = JAZZ_UART_FLAGS, \
34 .regshift = 0, \
35}
36
37static struct plat_serial8250_port uart8250_data[] = {
38 JAZZ_PORT(JAZZ_SERIAL1_BASE, JAZZ_SERIAL1_IRQ),
39 JAZZ_PORT(JAZZ_SERIAL2_BASE, JAZZ_SERIAL2_IRQ),
40 { },
41};
42
43static struct platform_device uart8250_device = {
44 .name = "serial8250",
45 .id = PLAT8250_DEV_PLATFORM,
46 .dev = {
47 .platform_data = uart8250_data,
48 },
49};
50
51static int __init uart8250_init(void)
52{
53 return platform_device_register(&uart8250_device);
54}
55
56module_init(uart8250_init);
57
58MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");
59MODULE_LICENSE("GPL");
60MODULE_DESCRIPTION("8250 UART probe driver for the Jazz family");
diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c
index e8e0ffb9354d..c672c08d49e5 100644
--- a/arch/mips/jazz/jazzdma.c
+++ b/arch/mips/jazz/jazzdma.c
@@ -27,7 +27,7 @@
27 */ 27 */
28#define CONF_DEBUG_VDMA 0 28#define CONF_DEBUG_VDMA 0
29 29
30static unsigned long vdma_pagetable_start; 30static VDMA_PGTBL_ENTRY *pgtbl;
31 31
32static DEFINE_SPINLOCK(vdma_lock); 32static DEFINE_SPINLOCK(vdma_lock);
33 33
@@ -46,7 +46,6 @@ static int debuglvl = 3;
46 */ 46 */
47static inline void vdma_pgtbl_init(void) 47static inline void vdma_pgtbl_init(void)
48{ 48{
49 VDMA_PGTBL_ENTRY *pgtbl = (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
50 unsigned long paddr = 0; 49 unsigned long paddr = 0;
51 int i; 50 int i;
52 51
@@ -60,31 +59,31 @@ static inline void vdma_pgtbl_init(void)
60/* 59/*
61 * Initialize the Jazz R4030 dma controller 60 * Initialize the Jazz R4030 dma controller
62 */ 61 */
63void __init vdma_init(void) 62static int __init vdma_init(void)
64{ 63{
65 /* 64 /*
66 * Allocate 32k of memory for DMA page tables. This needs to be page 65 * Allocate 32k of memory for DMA page tables. This needs to be page
67 * aligned and should be uncached to avoid cache flushing after every 66 * aligned and should be uncached to avoid cache flushing after every
68 * update. 67 * update.
69 */ 68 */
70 vdma_pagetable_start = 69 pgtbl = (VDMA_PGTBL_ENTRY *)__get_free_pages(GFP_KERNEL | GFP_DMA,
71 (unsigned long) alloc_bootmem_low_pages(VDMA_PGTBL_SIZE); 70 get_order(VDMA_PGTBL_SIZE));
72 if (!vdma_pagetable_start) 71 if (!pgtbl)
73 BUG(); 72 BUG();
74 dma_cache_wback_inv(vdma_pagetable_start, VDMA_PGTBL_SIZE); 73 dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE);
75 vdma_pagetable_start = KSEG1ADDR(vdma_pagetable_start); 74 pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
76 75
77 /* 76 /*
78 * Clear the R4030 translation table 77 * Clear the R4030 translation table
79 */ 78 */
80 vdma_pgtbl_init(); 79 vdma_pgtbl_init();
81 80
82 r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, 81 r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl));
83 CPHYSADDR(vdma_pagetable_start));
84 r4030_write_reg32(JAZZ_R4030_TRSTBL_LIM, VDMA_PGTBL_SIZE); 82 r4030_write_reg32(JAZZ_R4030_TRSTBL_LIM, VDMA_PGTBL_SIZE);
85 r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0); 83 r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0);
86 84
87 printk("VDMA: R4030 DMA pagetables initialized.\n"); 85 printk(KERN_INFO "VDMA: R4030 DMA pagetables initialized.\n");
86 return 0;
88} 87}
89 88
90/* 89/*
@@ -92,7 +91,6 @@ void __init vdma_init(void)
92 */ 91 */
93unsigned long vdma_alloc(unsigned long paddr, unsigned long size) 92unsigned long vdma_alloc(unsigned long paddr, unsigned long size)
94{ 93{
95 VDMA_PGTBL_ENTRY *entry = (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
96 int first, last, pages, frame, i; 94 int first, last, pages, frame, i;
97 unsigned long laddr, flags; 95 unsigned long laddr, flags;
98 96
@@ -114,10 +112,10 @@ unsigned long vdma_alloc(unsigned long paddr, unsigned long size)
114 /* 112 /*
115 * Find free chunk 113 * Find free chunk
116 */ 114 */
117 pages = (size + 4095) >> 12; /* no. of pages to allocate */ 115 pages = VDMA_PAGE(paddr + size) - VDMA_PAGE(paddr) + 1;
118 first = 0; 116 first = 0;
119 while (1) { 117 while (1) {
120 while (entry[first].owner != VDMA_PAGE_EMPTY && 118 while (pgtbl[first].owner != VDMA_PAGE_EMPTY &&
121 first < VDMA_PGTBL_ENTRIES) first++; 119 first < VDMA_PGTBL_ENTRIES) first++;
122 if (first + pages > VDMA_PGTBL_ENTRIES) { /* nothing free */ 120 if (first + pages > VDMA_PGTBL_ENTRIES) { /* nothing free */
123 spin_unlock_irqrestore(&vdma_lock, flags); 121 spin_unlock_irqrestore(&vdma_lock, flags);
@@ -125,12 +123,13 @@ unsigned long vdma_alloc(unsigned long paddr, unsigned long size)
125 } 123 }
126 124
127 last = first + 1; 125 last = first + 1;
128 while (entry[last].owner == VDMA_PAGE_EMPTY 126 while (pgtbl[last].owner == VDMA_PAGE_EMPTY
129 && last - first < pages) 127 && last - first < pages)
130 last++; 128 last++;
131 129
132 if (last - first == pages) 130 if (last - first == pages)
133 break; /* found */ 131 break; /* found */
132 first = last + 1;
134 } 133 }
135 134
136 /* 135 /*
@@ -140,8 +139,8 @@ unsigned long vdma_alloc(unsigned long paddr, unsigned long size)
140 frame = paddr & ~(VDMA_PAGESIZE - 1); 139 frame = paddr & ~(VDMA_PAGESIZE - 1);
141 140
142 for (i = first; i < last; i++) { 141 for (i = first; i < last; i++) {
143 entry[i].frame = frame; 142 pgtbl[i].frame = frame;
144 entry[i].owner = laddr; 143 pgtbl[i].owner = laddr;
145 frame += VDMA_PAGESIZE; 144 frame += VDMA_PAGESIZE;
146 } 145 }
147 146
@@ -160,10 +159,10 @@ unsigned long vdma_alloc(unsigned long paddr, unsigned long size)
160 printk("%08x ", i << 12); 159 printk("%08x ", i << 12);
161 printk("\nPADDR: "); 160 printk("\nPADDR: ");
162 for (i = first; i < last; i++) 161 for (i = first; i < last; i++)
163 printk("%08x ", entry[i].frame); 162 printk("%08x ", pgtbl[i].frame);
164 printk("\nOWNER: "); 163 printk("\nOWNER: ");
165 for (i = first; i < last; i++) 164 for (i = first; i < last; i++)
166 printk("%08x ", entry[i].owner); 165 printk("%08x ", pgtbl[i].owner);
167 printk("\n"); 166 printk("\n");
168 } 167 }
169 168
@@ -181,7 +180,6 @@ EXPORT_SYMBOL(vdma_alloc);
181 */ 180 */
182int vdma_free(unsigned long laddr) 181int vdma_free(unsigned long laddr)
183{ 182{
184 VDMA_PGTBL_ENTRY *pgtbl = (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
185 int i; 183 int i;
186 184
187 i = laddr >> 12; 185 i = laddr >> 12;
@@ -213,8 +211,6 @@ EXPORT_SYMBOL(vdma_free);
213 */ 211 */
214int vdma_remap(unsigned long laddr, unsigned long paddr, unsigned long size) 212int vdma_remap(unsigned long laddr, unsigned long paddr, unsigned long size)
215{ 213{
216 VDMA_PGTBL_ENTRY *pgtbl =
217 (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
218 int first, pages, npages; 214 int first, pages, npages;
219 215
220 if (laddr > 0xffffff) { 216 if (laddr > 0xffffff) {
@@ -289,8 +285,6 @@ unsigned long vdma_phys2log(unsigned long paddr)
289{ 285{
290 int i; 286 int i;
291 int frame; 287 int frame;
292 VDMA_PGTBL_ENTRY *pgtbl =
293 (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
294 288
295 frame = paddr & ~(VDMA_PAGESIZE - 1); 289 frame = paddr & ~(VDMA_PAGESIZE - 1);
296 290
@@ -312,9 +306,6 @@ EXPORT_SYMBOL(vdma_phys2log);
312 */ 306 */
313unsigned long vdma_log2phys(unsigned long laddr) 307unsigned long vdma_log2phys(unsigned long laddr)
314{ 308{
315 VDMA_PGTBL_ENTRY *pgtbl =
316 (VDMA_PGTBL_ENTRY *) vdma_pagetable_start;
317
318 return pgtbl[laddr >> 12].frame + (laddr & (VDMA_PAGESIZE - 1)); 309 return pgtbl[laddr >> 12].frame + (laddr & (VDMA_PAGESIZE - 1));
319} 310}
320 311
@@ -564,3 +555,5 @@ int vdma_get_enable(int channel)
564 555
565 return enable; 556 return enable;
566} 557}
558
559arch_initcall(vdma_init);
diff --git a/arch/mips/jazz/reset.c b/arch/mips/jazz/reset.c
index d8ade85060b3..dd889fe86bd1 100644
--- a/arch/mips/jazz/reset.c
+++ b/arch/mips/jazz/reset.c
@@ -49,8 +49,8 @@ void jazz_machine_restart(char *command)
49{ 49{
50 while(1) { 50 while(1) {
51 kb_wait(); 51 kb_wait();
52 jazz_write_command (0xd1); 52 jazz_write_command(0xd1);
53 kb_wait(); 53 kb_wait();
54 jazz_write_output (0x00); 54 jazz_write_output(0x00);
55 } 55 }
56} 56}
diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c
index 798279e06691..cfc7dce78dab 100644
--- a/arch/mips/jazz/setup.c
+++ b/arch/mips/jazz/setup.c
@@ -7,6 +7,7 @@
7 * 7 *
8 * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle 8 * Copyright (C) 1996, 1997, 1998, 2001 by Ralf Baechle
9 * Copyright (C) 2001 MIPS Technologies, Inc. 9 * Copyright (C) 2001 MIPS Technologies, Inc.
10 * Copyright (C) 2007 by Thomas Bogendoerfer
10 */ 11 */
11#include <linux/eisa.h> 12#include <linux/eisa.h>
12#include <linux/hdreg.h> 13#include <linux/hdreg.h>
@@ -20,8 +21,11 @@
20#include <linux/ide.h> 21#include <linux/ide.h>
21#include <linux/pm.h> 22#include <linux/pm.h>
22#include <linux/screen_info.h> 23#include <linux/screen_info.h>
24#include <linux/platform_device.h>
25#include <linux/serial_8250.h>
23 26
24#include <asm/bootinfo.h> 27#include <asm/bootinfo.h>
28#include <asm/i8253.h>
25#include <asm/irq.h> 29#include <asm/irq.h>
26#include <asm/jazz.h> 30#include <asm/jazz.h>
27#include <asm/jazzdma.h> 31#include <asm/jazzdma.h>
@@ -30,18 +34,12 @@
30#include <asm/pgtable.h> 34#include <asm/pgtable.h>
31#include <asm/time.h> 35#include <asm/time.h>
32#include <asm/traps.h> 36#include <asm/traps.h>
37#include <asm/mc146818-time.h>
33 38
34extern asmlinkage void jazz_handle_int(void); 39extern asmlinkage void jazz_handle_int(void);
35 40
36extern void jazz_machine_restart(char *command); 41extern void jazz_machine_restart(char *command);
37 42
38void __init plat_timer_setup(struct irqaction *irq)
39{
40 /* set the clock to 100 Hz */
41 r4030_write_reg32(JAZZ_TIMER_INTERVAL, 9);
42 setup_irq(JAZZ_TIMER_IRQ, irq);
43}
44
45static struct resource jazz_io_resources[] = { 43static struct resource jazz_io_resources[] = {
46 { 44 {
47 .start = 0x00, 45 .start = 0x00,
@@ -66,18 +64,21 @@ static struct resource jazz_io_resources[] = {
66 } 64 }
67}; 65};
68 66
67void __init plat_time_init(void)
68{
69 setup_pit_timer();
70}
71
69void __init plat_mem_setup(void) 72void __init plat_mem_setup(void)
70{ 73{
71 int i; 74 int i;
72 75
73 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */ 76 /* Map 0xe0000000 -> 0x0:800005C0, 0xe0010000 -> 0x1:30000580 */
74 add_wired_entry (0x02000017, 0x03c00017, 0xe0000000, PM_64K); 77 add_wired_entry(0x02000017, 0x03c00017, 0xe0000000, PM_64K);
75
76 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */ 78 /* Map 0xe2000000 -> 0x0:900005C0, 0xe3010000 -> 0x0:910005C0 */
77 add_wired_entry (0x02400017, 0x02440017, 0xe2000000, PM_16M); 79 add_wired_entry(0x02400017, 0x02440017, 0xe2000000, PM_16M);
78
79 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */ 80 /* Map 0xe4000000 -> 0x0:600005C0, 0xe4100000 -> 400005C0 */
80 add_wired_entry (0x01800017, 0x01000017, 0xe4000000, PM_4M); 81 add_wired_entry(0x01800017, 0x01000017, 0xe4000000, PM_4M);
81 82
82 set_io_port_base(JAZZ_PORT_BASE); 83 set_io_port_base(JAZZ_PORT_BASE);
83#ifdef CONFIG_EISA 84#ifdef CONFIG_EISA
@@ -94,6 +95,7 @@ void __init plat_mem_setup(void)
94 95
95 _machine_restart = jazz_machine_restart; 96 _machine_restart = jazz_machine_restart;
96 97
98#ifdef CONFIG_VT
97 screen_info = (struct screen_info) { 99 screen_info = (struct screen_info) {
98 0, 0, /* orig-x, orig-y */ 100 0, 0, /* orig-x, orig-y */
99 0, /* unused */ 101 0, /* unused */
@@ -105,6 +107,112 @@ void __init plat_mem_setup(void)
105 0, /* orig_video_isVGA */ 107 0, /* orig_video_isVGA */
106 16 /* orig_video_points */ 108 16 /* orig_video_points */
107 }; 109 };
110#endif
108 111
109 vdma_init(); 112 add_preferred_console("ttyS", 0, "9600");
110} 113}
114
115#ifdef CONFIG_OLIVETTI_M700
116#define UART_CLK 1843200
117#else
118/* Some Jazz machines seem to have an 8MHz crystal clock but I don't know
119 exactly which ones ... XXX */
120#define UART_CLK (8000000 / 16) /* ( 3072000 / 16) */
121#endif
122
123#define MEMPORT(_base, _irq) \
124 { \
125 .mapbase = (_base), \
126 .membase = (void *)(_base), \
127 .irq = (_irq), \
128 .uartclk = UART_CLK, \
129 .iotype = UPIO_MEM, \
130 .flags = UPF_BOOT_AUTOCONF, \
131 }
132
133static struct plat_serial8250_port jazz_serial_data[] = {
134 MEMPORT(JAZZ_SERIAL1_BASE, JAZZ_SERIAL1_IRQ),
135 MEMPORT(JAZZ_SERIAL2_BASE, JAZZ_SERIAL2_IRQ),
136 { },
137};
138
139static struct platform_device jazz_serial8250_device = {
140 .name = "serial8250",
141 .id = PLAT8250_DEV_PLATFORM,
142 .dev = {
143 .platform_data = jazz_serial_data,
144 },
145};
146
147static struct resource jazz_esp_rsrc[] = {
148 {
149 .start = JAZZ_SCSI_BASE,
150 .end = JAZZ_SCSI_BASE + 31,
151 .flags = IORESOURCE_MEM
152 },
153 {
154 .start = JAZZ_SCSI_DMA,
155 .end = JAZZ_SCSI_DMA,
156 .flags = IORESOURCE_MEM
157 },
158 {
159 .start = JAZZ_SCSI_IRQ,
160 .end = JAZZ_SCSI_IRQ,
161 .flags = IORESOURCE_IRQ
162 }
163};
164
165static struct platform_device jazz_esp_pdev = {
166 .name = "jazz_esp",
167 .num_resources = ARRAY_SIZE(jazz_esp_rsrc),
168 .resource = jazz_esp_rsrc
169};
170
171static struct resource jazz_sonic_rsrc[] = {
172 {
173 .start = JAZZ_ETHERNET_BASE,
174 .end = JAZZ_ETHERNET_BASE + 0xff,
175 .flags = IORESOURCE_MEM
176 },
177 {
178 .start = JAZZ_ETHERNET_IRQ,
179 .end = JAZZ_ETHERNET_IRQ,
180 .flags = IORESOURCE_IRQ
181 }
182};
183
184static struct platform_device jazz_sonic_pdev = {
185 .name = "jazzsonic",
186 .num_resources = ARRAY_SIZE(jazz_sonic_rsrc),
187 .resource = jazz_sonic_rsrc
188};
189
190static struct resource jazz_cmos_rsrc[] = {
191 {
192 .start = 0x70,
193 .end = 0x71,
194 .flags = IORESOURCE_IO
195 },
196 {
197 .start = 8,
198 .end = 8,
199 .flags = IORESOURCE_IRQ
200 }
201};
202
203static struct platform_device jazz_cmos_pdev = {
204 .name = "rtc_cmos",
205 .num_resources = ARRAY_SIZE(jazz_cmos_rsrc),
206 .resource = jazz_cmos_rsrc
207};
208
209static int __init jazz_setup_devinit(void)
210{
211 platform_device_register(&jazz_serial8250_device);
212 platform_device_register(&jazz_esp_pdev);
213 platform_device_register(&jazz_sonic_pdev);
214 platform_device_register(&jazz_cmos_pdev);
215 return 0;
216}
217
218device_initcall(jazz_setup_devinit);
diff --git a/arch/mips/jmr3927/rbhma3100/init.c b/arch/mips/jmr3927/rbhma3100/init.c
index 9169fab1773a..b643f75ec9a5 100644
--- a/arch/mips/jmr3927/rbhma3100/init.c
+++ b/arch/mips/jmr3927/rbhma3100/init.c
@@ -51,7 +51,6 @@ void __init prom_init(void)
51 if ((tx3927_ccfgptr->ccfg & TX3927_CCFG_TLBOFF) == 0) 51 if ((tx3927_ccfgptr->ccfg & TX3927_CCFG_TLBOFF) == 0)
52 puts("Warning: TX3927 TLB off\n"); 52 puts("Warning: TX3927 TLB off\n");
53#endif 53#endif
54 mips_machgroup = MACH_GROUP_TOSHIBA;
55 54
56#ifdef CONFIG_TOSHIBA_JMR3927 55#ifdef CONFIG_TOSHIBA_JMR3927
57 mips_machtype = MACH_TOSHIBA_JMR3927; 56 mips_machtype = MACH_TOSHIBA_JMR3927;
diff --git a/arch/mips/jmr3927/rbhma3100/irq.c b/arch/mips/jmr3927/rbhma3100/irq.c
index d9efe692e551..3a47e8ce1196 100644
--- a/arch/mips/jmr3927/rbhma3100/irq.c
+++ b/arch/mips/jmr3927/rbhma3100/irq.c
@@ -104,7 +104,9 @@ static irqreturn_t jmr3927_ioc_interrupt(int irq, void *dev_id)
104} 104}
105 105
106static struct irqaction ioc_action = { 106static struct irqaction ioc_action = {
107 jmr3927_ioc_interrupt, 0, CPU_MASK_NONE, "IOC", NULL, NULL, 107 .handler = jmr3927_ioc_interrupt,
108 .mask = CPU_MASK_NONE,
109 .name = "IOC",
108}; 110};
109 111
110static irqreturn_t jmr3927_pcierr_interrupt(int irq, void *dev_id) 112static irqreturn_t jmr3927_pcierr_interrupt(int irq, void *dev_id)
@@ -116,7 +118,9 @@ static irqreturn_t jmr3927_pcierr_interrupt(int irq, void *dev_id)
116 return IRQ_HANDLED; 118 return IRQ_HANDLED;
117} 119}
118static struct irqaction pcierr_action = { 120static struct irqaction pcierr_action = {
119 jmr3927_pcierr_interrupt, 0, CPU_MASK_NONE, "PCI error", NULL, NULL, 121 .handler = jmr3927_pcierr_interrupt,
122 .mask = CPU_MASK_NONE,
123 .name = "PCI error",
120}; 124};
121 125
122static void __init jmr3927_irq_init(void); 126static void __init jmr3927_irq_init(void);
diff --git a/arch/mips/jmr3927/rbhma3100/setup.c b/arch/mips/jmr3927/rbhma3100/setup.c
index fde56e86c2ab..7f14f70a1b88 100644
--- a/arch/mips/jmr3927/rbhma3100/setup.c
+++ b/arch/mips/jmr3927/rbhma3100/setup.c
@@ -109,7 +109,7 @@ static void jmr3927_timer_ack(void)
109 jmr3927_tmrptr->tisr = 0; /* ack interrupt */ 109 jmr3927_tmrptr->tisr = 0; /* ack interrupt */
110} 110}
111 111
112static void __init jmr3927_time_init(void) 112void __init plat_time_init(void)
113{ 113{
114 clocksource_mips.read = jmr3927_hpt_read; 114 clocksource_mips.read = jmr3927_hpt_read;
115 mips_timer_ack = jmr3927_timer_ack; 115 mips_timer_ack = jmr3927_timer_ack;
@@ -141,8 +141,6 @@ void __init plat_mem_setup(void)
141 141
142 set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO); 142 set_io_port_base(JMR3927_PORT_BASE + JMR3927_PCIIO);
143 143
144 board_time_init = jmr3927_time_init;
145
146 _machine_restart = jmr3927_machine_restart; 144 _machine_restart = jmr3927_machine_restart;
147 _machine_halt = jmr3927_machine_halt; 145 _machine_halt = jmr3927_machine_halt;
148 pm_power_off = jmr3927_machine_power_off; 146 pm_power_off = jmr3927_machine_power_off;
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index 2fd96d95a39c..a2689f93c160 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -51,6 +51,7 @@ obj-$(CONFIG_IRQ_CPU_RM7K) += irq-rm7000.o
51obj-$(CONFIG_IRQ_CPU_RM9K) += irq-rm9000.o 51obj-$(CONFIG_IRQ_CPU_RM9K) += irq-rm9000.o
52obj-$(CONFIG_MIPS_BOARDS_GEN) += irq-msc01.o 52obj-$(CONFIG_MIPS_BOARDS_GEN) += irq-msc01.o
53obj-$(CONFIG_IRQ_TXX9) += irq_txx9.o 53obj-$(CONFIG_IRQ_TXX9) += irq_txx9.o
54obj-$(CONFIG_IRQ_GT641XX) += irq-gt641xx.o
54 55
55obj-$(CONFIG_32BIT) += scall32-o32.o 56obj-$(CONFIG_32BIT) += scall32-o32.o
56obj-$(CONFIG_64BIT) += scall64-64.o 57obj-$(CONFIG_64BIT) += scall64-64.o
@@ -64,6 +65,7 @@ obj-$(CONFIG_PROC_FS) += proc.o
64 65
65obj-$(CONFIG_64BIT) += cpu-bugs64.o 66obj-$(CONFIG_64BIT) += cpu-bugs64.o
66 67
68obj-$(CONFIG_I8253) += i8253.o
67obj-$(CONFIG_PCSPEAKER) += pcspeaker.o 69obj-$(CONFIG_PCSPEAKER) += pcspeaker.o
68 70
69obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o 71obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c
index 993f7ec70f35..da41eac195ca 100644
--- a/arch/mips/kernel/binfmt_elfo32.c
+++ b/arch/mips/kernel/binfmt_elfo32.c
@@ -110,7 +110,7 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
110} 110}
111 111
112#undef ELF_CORE_COPY_REGS 112#undef ELF_CORE_COPY_REGS
113#define ELF_CORE_COPY_REGS(_dest,_regs) elf32_core_copy_regs(_dest,_regs); 113#define ELF_CORE_COPY_REGS(_dest, _regs) elf32_core_copy_regs(_dest, _regs);
114 114
115void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs) 115void elf32_core_copy_regs(elf_gregset_t grp, struct pt_regs *regs)
116{ 116{
diff --git a/arch/mips/kernel/cpu-bugs64.c b/arch/mips/kernel/cpu-bugs64.c
index 6648fde20b96..af78456d4138 100644
--- a/arch/mips/kernel/cpu-bugs64.c
+++ b/arch/mips/kernel/cpu-bugs64.c
@@ -29,7 +29,7 @@ static inline void align_mod(const int align, const int mod)
29 ".endr\n\t" 29 ".endr\n\t"
30 ".set pop" 30 ".set pop"
31 : 31 :
32 : GCC_IMM_ASM (align), GCC_IMM_ASM (mod)); 32 : GCC_IMM_ASM(align), GCC_IMM_ASM(mod));
33} 33}
34 34
35static inline void mult_sh_align_mod(long *v1, long *v2, long *w, 35static inline void mult_sh_align_mod(long *v1, long *v2, long *w,
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 3e004161ebd5..c8c47a2d1972 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -159,6 +159,7 @@ static inline void check_wait(void)
159 case CPU_5KC: 159 case CPU_5KC:
160 case CPU_25KF: 160 case CPU_25KF:
161 case CPU_PR4450: 161 case CPU_PR4450:
162 case CPU_BCM3302:
162 cpu_wait = r4k_wait; 163 cpu_wait = r4k_wait;
163 break; 164 break;
164 165
@@ -745,14 +746,6 @@ static inline void cpu_probe_sibyte(struct cpuinfo_mips *c)
745{ 746{
746 decode_configs(c); 747 decode_configs(c);
747 748
748 /*
749 * For historical reasons the SB1 comes with it's own variant of
750 * cache code which eventually will be folded into c-r4k.c. Until
751 * then we pretend it's got it's own cache architecture.
752 */
753 c->options &= ~MIPS_CPU_4K_CACHE;
754 c->options |= MIPS_CPU_SB1_CACHE;
755
756 switch (c->processor_id & 0xff00) { 749 switch (c->processor_id & 0xff00) {
757 case PRID_IMP_SB1: 750 case PRID_IMP_SB1:
758 c->cputype = CPU_SB1; 751 c->cputype = CPU_SB1;
@@ -793,9 +786,111 @@ static inline void cpu_probe_philips(struct cpuinfo_mips *c)
793} 786}
794 787
795 788
789static inline void cpu_probe_broadcom(struct cpuinfo_mips *c)
790{
791 decode_configs(c);
792 switch (c->processor_id & 0xff00) {
793 case PRID_IMP_BCM3302:
794 c->cputype = CPU_BCM3302;
795 break;
796 case PRID_IMP_BCM4710:
797 c->cputype = CPU_BCM4710;
798 break;
799 default:
800 c->cputype = CPU_UNKNOWN;
801 break;
802 }
803}
804
805const char *__cpu_name[NR_CPUS];
806
807/*
808 * Name a CPU
809 */
810static __init const char *cpu_to_name(struct cpuinfo_mips *c)
811{
812 const char *name = NULL;
813
814 switch (c->cputype) {
815 case CPU_UNKNOWN: name = "unknown"; break;
816 case CPU_R2000: name = "R2000"; break;
817 case CPU_R3000: name = "R3000"; break;
818 case CPU_R3000A: name = "R3000A"; break;
819 case CPU_R3041: name = "R3041"; break;
820 case CPU_R3051: name = "R3051"; break;
821 case CPU_R3052: name = "R3052"; break;
822 case CPU_R3081: name = "R3081"; break;
823 case CPU_R3081E: name = "R3081E"; break;
824 case CPU_R4000PC: name = "R4000PC"; break;
825 case CPU_R4000SC: name = "R4000SC"; break;
826 case CPU_R4000MC: name = "R4000MC"; break;
827 case CPU_R4200: name = "R4200"; break;
828 case CPU_R4400PC: name = "R4400PC"; break;
829 case CPU_R4400SC: name = "R4400SC"; break;
830 case CPU_R4400MC: name = "R4400MC"; break;
831 case CPU_R4600: name = "R4600"; break;
832 case CPU_R6000: name = "R6000"; break;
833 case CPU_R6000A: name = "R6000A"; break;
834 case CPU_R8000: name = "R8000"; break;
835 case CPU_R10000: name = "R10000"; break;
836 case CPU_R12000: name = "R12000"; break;
837 case CPU_R14000: name = "R14000"; break;
838 case CPU_R4300: name = "R4300"; break;
839 case CPU_R4650: name = "R4650"; break;
840 case CPU_R4700: name = "R4700"; break;
841 case CPU_R5000: name = "R5000"; break;
842 case CPU_R5000A: name = "R5000A"; break;
843 case CPU_R4640: name = "R4640"; break;
844 case CPU_NEVADA: name = "Nevada"; break;
845 case CPU_RM7000: name = "RM7000"; break;
846 case CPU_RM9000: name = "RM9000"; break;
847 case CPU_R5432: name = "R5432"; break;
848 case CPU_4KC: name = "MIPS 4Kc"; break;
849 case CPU_5KC: name = "MIPS 5Kc"; break;
850 case CPU_R4310: name = "R4310"; break;
851 case CPU_SB1: name = "SiByte SB1"; break;
852 case CPU_SB1A: name = "SiByte SB1A"; break;
853 case CPU_TX3912: name = "TX3912"; break;
854 case CPU_TX3922: name = "TX3922"; break;
855 case CPU_TX3927: name = "TX3927"; break;
856 case CPU_AU1000: name = "Au1000"; break;
857 case CPU_AU1500: name = "Au1500"; break;
858 case CPU_AU1100: name = "Au1100"; break;
859 case CPU_AU1550: name = "Au1550"; break;
860 case CPU_AU1200: name = "Au1200"; break;
861 case CPU_4KEC: name = "MIPS 4KEc"; break;
862 case CPU_4KSC: name = "MIPS 4KSc"; break;
863 case CPU_VR41XX: name = "NEC Vr41xx"; break;
864 case CPU_R5500: name = "R5500"; break;
865 case CPU_TX49XX: name = "TX49xx"; break;
866 case CPU_20KC: name = "MIPS 20Kc"; break;
867 case CPU_24K: name = "MIPS 24K"; break;
868 case CPU_25KF: name = "MIPS 25Kf"; break;
869 case CPU_34K: name = "MIPS 34K"; break;
870 case CPU_74K: name = "MIPS 74K"; break;
871 case CPU_VR4111: name = "NEC VR4111"; break;
872 case CPU_VR4121: name = "NEC VR4121"; break;
873 case CPU_VR4122: name = "NEC VR4122"; break;
874 case CPU_VR4131: name = "NEC VR4131"; break;
875 case CPU_VR4133: name = "NEC VR4133"; break;
876 case CPU_VR4181: name = "NEC VR4181"; break;
877 case CPU_VR4181A: name = "NEC VR4181A"; break;
878 case CPU_SR71000: name = "Sandcraft SR71000"; break;
879 case CPU_BCM3302: name = "Broadcom BCM3302"; break;
880 case CPU_BCM4710: name = "Broadcom BCM4710"; break;
881 case CPU_PR4450: name = "Philips PR4450"; break;
882 case CPU_LOONGSON2: name = "ICT Loongson-2"; break;
883 default:
884 BUG();
885 }
886
887 return name;
888}
889
796__init void cpu_probe(void) 890__init void cpu_probe(void)
797{ 891{
798 struct cpuinfo_mips *c = &current_cpu_data; 892 struct cpuinfo_mips *c = &current_cpu_data;
893 unsigned int cpu = smp_processor_id();
799 894
800 c->processor_id = PRID_IMP_UNKNOWN; 895 c->processor_id = PRID_IMP_UNKNOWN;
801 c->fpu_id = FPIR_IMP_NONE; 896 c->fpu_id = FPIR_IMP_NONE;
@@ -815,6 +910,9 @@ __init void cpu_probe(void)
815 case PRID_COMP_SIBYTE: 910 case PRID_COMP_SIBYTE:
816 cpu_probe_sibyte(c); 911 cpu_probe_sibyte(c);
817 break; 912 break;
913 case PRID_COMP_BROADCOM:
914 cpu_probe_broadcom(c);
915 break;
818 case PRID_COMP_SANDCRAFT: 916 case PRID_COMP_SANDCRAFT:
819 cpu_probe_sandcraft(c); 917 cpu_probe_sandcraft(c);
820 break; 918 break;
@@ -824,6 +922,14 @@ __init void cpu_probe(void)
824 default: 922 default:
825 c->cputype = CPU_UNKNOWN; 923 c->cputype = CPU_UNKNOWN;
826 } 924 }
925
926 /*
927 * Platform code can force the cpu type to optimize code
928 * generation. In that case be sure the cpu type is correctly
929 * manually setup otherwise it could trigger some nasty bugs.
930 */
931 BUG_ON(current_cpu_type() != c->cputype);
932
827 if (c->options & MIPS_CPU_FPU) { 933 if (c->options & MIPS_CPU_FPU) {
828 c->fpu_id = cpu_get_fpu_id(); 934 c->fpu_id = cpu_get_fpu_id();
829 935
@@ -835,13 +941,16 @@ __init void cpu_probe(void)
835 c->ases |= MIPS_ASE_MIPS3D; 941 c->ases |= MIPS_ASE_MIPS3D;
836 } 942 }
837 } 943 }
944
945 __cpu_name[cpu] = cpu_to_name(c);
838} 946}
839 947
840__init void cpu_report(void) 948__init void cpu_report(void)
841{ 949{
842 struct cpuinfo_mips *c = &current_cpu_data; 950 struct cpuinfo_mips *c = &current_cpu_data;
843 951
844 printk("CPU revision is: %08x\n", c->processor_id); 952 printk(KERN_INFO "CPU revision is: %08x (%s)\n",
953 c->processor_id, cpu_name_string());
845 if (c->options & MIPS_CPU_FPU) 954 if (c->options & MIPS_CPU_FPU)
846 printk("FPU revision is: %08x\n", c->fpu_id); 955 printk(KERN_INFO "FPU revision is: %08x\n", c->fpu_id);
847} 956}
diff --git a/arch/mips/kernel/gdb-stub.c b/arch/mips/kernel/gdb-stub.c
index cb5623aad552..3191afa29ad8 100644
--- a/arch/mips/kernel/gdb-stub.c
+++ b/arch/mips/kernel/gdb-stub.c
@@ -676,15 +676,18 @@ static void kgdb_wait(void *arg)
676static int kgdb_smp_call_kgdb_wait(void) 676static int kgdb_smp_call_kgdb_wait(void)
677{ 677{
678#ifdef CONFIG_SMP 678#ifdef CONFIG_SMP
679 cpumask_t mask = cpu_online_map;
679 struct call_data_struct data; 680 struct call_data_struct data;
680 int i, cpus = num_online_cpus() - 1;
681 int cpu = smp_processor_id(); 681 int cpu = smp_processor_id();
682 int cpus;
682 683
683 /* 684 /*
684 * Can die spectacularly if this CPU isn't yet marked online 685 * Can die spectacularly if this CPU isn't yet marked online
685 */ 686 */
686 BUG_ON(!cpu_online(cpu)); 687 BUG_ON(!cpu_online(cpu));
687 688
689 cpu_clear(cpu, mask);
690 cpus = cpus_weight(mask);
688 if (!cpus) 691 if (!cpus)
689 return 0; 692 return 0;
690 693
@@ -711,10 +714,7 @@ static int kgdb_smp_call_kgdb_wait(void)
711 call_data = &data; 714 call_data = &data;
712 mb(); 715 mb();
713 716
714 /* Send a message to all other CPUs and wait for them to respond */ 717 core_send_ipi_mask(mask, SMP_CALL_FUNCTION);
715 for (i = 0; i < NR_CPUS; i++)
716 if (cpu_online(i) && i != cpu)
717 core_send_ipi(i, SMP_CALL_FUNCTION);
718 718
719 /* Wait for response */ 719 /* Wait for response */
720 /* FIXME: lock-up detection, backtrace on lock-up */ 720 /* FIXME: lock-up detection, backtrace on lock-up */
@@ -733,7 +733,7 @@ static int kgdb_smp_call_kgdb_wait(void)
733 * returns 1 if you should skip the instruction at the trap address, 0 733 * returns 1 if you should skip the instruction at the trap address, 0
734 * otherwise. 734 * otherwise.
735 */ 735 */
736void handle_exception (struct gdb_regs *regs) 736void handle_exception(struct gdb_regs *regs)
737{ 737{
738 int trap; /* Trap type */ 738 int trap; /* Trap type */
739 int sigval; 739 int sigval;
@@ -769,7 +769,7 @@ void handle_exception (struct gdb_regs *regs)
769 /* 769 /*
770 * acquire the CPU spinlocks 770 * acquire the CPU spinlocks
771 */ 771 */
772 for (i = num_online_cpus()-1; i >= 0; i--) 772 for_each_online_cpu(i)
773 if (__raw_spin_trylock(&kgdb_cpulock[i]) == 0) 773 if (__raw_spin_trylock(&kgdb_cpulock[i]) == 0)
774 panic("kgdb: couldn't get cpulock %d\n", i); 774 panic("kgdb: couldn't get cpulock %d\n", i);
775 775
@@ -902,7 +902,7 @@ void handle_exception (struct gdb_regs *regs)
902 hex2mem(ptr, (char *)&regs->frame_ptr, 2*sizeof(long), 0, 0); 902 hex2mem(ptr, (char *)&regs->frame_ptr, 2*sizeof(long), 0, 0);
903 ptr += 2*(2*sizeof(long)); 903 ptr += 2*(2*sizeof(long));
904 hex2mem(ptr, (char *)&regs->cp0_index, 16*sizeof(long), 0, 0); 904 hex2mem(ptr, (char *)&regs->cp0_index, 16*sizeof(long), 0, 0);
905 strcpy(output_buffer,"OK"); 905 strcpy(output_buffer, "OK");
906 } 906 }
907 break; 907 break;
908 908
@@ -917,9 +917,9 @@ void handle_exception (struct gdb_regs *regs)
917 && hexToInt(&ptr, &length)) { 917 && hexToInt(&ptr, &length)) {
918 if (mem2hex((char *)addr, output_buffer, length, 1)) 918 if (mem2hex((char *)addr, output_buffer, length, 1))
919 break; 919 break;
920 strcpy (output_buffer, "E03"); 920 strcpy(output_buffer, "E03");
921 } else 921 } else
922 strcpy(output_buffer,"E01"); 922 strcpy(output_buffer, "E01");
923 break; 923 break;
924 924
925 /* 925 /*
@@ -996,7 +996,7 @@ void handle_exception (struct gdb_regs *regs)
996 ptr = &input_buffer[1]; 996 ptr = &input_buffer[1];
997 if (!hexToInt(&ptr, &baudrate)) 997 if (!hexToInt(&ptr, &baudrate))
998 { 998 {
999 strcpy(output_buffer,"B01"); 999 strcpy(output_buffer, "B01");
1000 break; 1000 break;
1001 } 1001 }
1002 1002
@@ -1015,7 +1015,7 @@ void handle_exception (struct gdb_regs *regs)
1015 break; 1015 break;
1016 default: 1016 default:
1017 baudrate = 0; 1017 baudrate = 0;
1018 strcpy(output_buffer,"B02"); 1018 strcpy(output_buffer, "B02");
1019 goto x1; 1019 goto x1;
1020 } 1020 }
1021 1021
@@ -1044,7 +1044,7 @@ finish_kgdb:
1044 1044
1045exit_kgdb_exception: 1045exit_kgdb_exception:
1046 /* release locks so other CPUs can go */ 1046 /* release locks so other CPUs can go */
1047 for (i = num_online_cpus()-1; i >= 0; i--) 1047 for_each_online_cpu(i)
1048 __raw_spin_unlock(&kgdb_cpulock[i]); 1048 __raw_spin_unlock(&kgdb_cpulock[i]);
1049 spin_unlock(&kgdb_lock); 1049 spin_unlock(&kgdb_lock);
1050 1050
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
new file mode 100644
index 000000000000..5d9830df3595
--- /dev/null
+++ b/arch/mips/kernel/i8253.c
@@ -0,0 +1,213 @@
1/*
2 * i8253.c 8253/PIT functions
3 *
4 */
5#include <linux/clockchips.h>
6#include <linux/init.h>
7#include <linux/interrupt.h>
8#include <linux/jiffies.h>
9#include <linux/module.h>
10#include <linux/spinlock.h>
11
12#include <asm/delay.h>
13#include <asm/i8253.h>
14#include <asm/io.h>
15
16static DEFINE_SPINLOCK(i8253_lock);
17
18/*
19 * Initialize the PIT timer.
20 *
21 * This is also called after resume to bring the PIT into operation again.
22 */
23static void init_pit_timer(enum clock_event_mode mode,
24 struct clock_event_device *evt)
25{
26 unsigned long flags;
27
28 spin_lock_irqsave(&i8253_lock, flags);
29
30 switch(mode) {
31 case CLOCK_EVT_MODE_PERIODIC:
32 /* binary, mode 2, LSB/MSB, ch 0 */
33 outb_p(0x34, PIT_MODE);
34 outb_p(LATCH & 0xff , PIT_CH0); /* LSB */
35 outb(LATCH >> 8 , PIT_CH0); /* MSB */
36 break;
37
38 case CLOCK_EVT_MODE_SHUTDOWN:
39 case CLOCK_EVT_MODE_UNUSED:
40 if (evt->mode == CLOCK_EVT_MODE_PERIODIC ||
41 evt->mode == CLOCK_EVT_MODE_ONESHOT) {
42 outb_p(0x30, PIT_MODE);
43 outb_p(0, PIT_CH0);
44 outb_p(0, PIT_CH0);
45 }
46 break;
47
48 case CLOCK_EVT_MODE_ONESHOT:
49 /* One shot setup */
50 outb_p(0x38, PIT_MODE);
51 break;
52
53 case CLOCK_EVT_MODE_RESUME:
54 /* Nothing to do here */
55 break;
56 }
57 spin_unlock_irqrestore(&i8253_lock, flags);
58}
59
60/*
61 * Program the next event in oneshot mode
62 *
63 * Delta is given in PIT ticks
64 */
65static int pit_next_event(unsigned long delta, struct clock_event_device *evt)
66{
67 unsigned long flags;
68
69 spin_lock_irqsave(&i8253_lock, flags);
70 outb_p(delta & 0xff , PIT_CH0); /* LSB */
71 outb(delta >> 8 , PIT_CH0); /* MSB */
72 spin_unlock_irqrestore(&i8253_lock, flags);
73
74 return 0;
75}
76
77/*
78 * On UP the PIT can serve all of the possible timer functions. On SMP systems
79 * it can be solely used for the global tick.
80 *
81 * The profiling and update capabilites are switched off once the local apic is
82 * registered. This mechanism replaces the previous #ifdef LOCAL_APIC -
83 * !using_apic_timer decisions in do_timer_interrupt_hook()
84 */
85struct clock_event_device pit_clockevent = {
86 .name = "pit",
87 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
88 .set_mode = init_pit_timer,
89 .set_next_event = pit_next_event,
90 .shift = 32,
91 .irq = 0,
92};
93
94irqreturn_t timer_interrupt(int irq, void *dev_id)
95{
96 pit_clockevent.event_handler(&pit_clockevent);
97
98 return IRQ_HANDLED;
99}
100
101static struct irqaction irq0 = {
102 .handler = timer_interrupt,
103 .flags = IRQF_DISABLED | IRQF_NOBALANCING,
104 .mask = CPU_MASK_NONE,
105 .name = "timer"
106};
107
108/*
109 * Initialize the conversion factor and the min/max deltas of the clock event
110 * structure and register the clock event source with the framework.
111 */
112void __init setup_pit_timer(void)
113{
114 /*
115 * Start pit with the boot cpu mask and make it global after the
116 * IO_APIC has been initialized.
117 */
118 pit_clockevent.cpumask = cpumask_of_cpu(0);
119 pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 32);
120 pit_clockevent.max_delta_ns =
121 clockevent_delta2ns(0x7FFF, &pit_clockevent);
122 pit_clockevent.min_delta_ns =
123 clockevent_delta2ns(0xF, &pit_clockevent);
124 clockevents_register_device(&pit_clockevent);
125
126 irq0.mask = cpumask_of_cpu(0);
127 setup_irq(0, &irq0);
128}
129
130/*
131 * Since the PIT overflows every tick, its not very useful
132 * to just read by itself. So use jiffies to emulate a free
133 * running counter:
134 */
135static cycle_t pit_read(void)
136{
137 unsigned long flags;
138 int count;
139 u32 jifs;
140 static int old_count;
141 static u32 old_jifs;
142
143 spin_lock_irqsave(&i8253_lock, flags);
144 /*
145 * Although our caller may have the read side of xtime_lock,
146 * this is now a seqlock, and we are cheating in this routine
147 * by having side effects on state that we cannot undo if
148 * there is a collision on the seqlock and our caller has to
149 * retry. (Namely, old_jifs and old_count.) So we must treat
150 * jiffies as volatile despite the lock. We read jiffies
151 * before latching the timer count to guarantee that although
152 * the jiffies value might be older than the count (that is,
153 * the counter may underflow between the last point where
154 * jiffies was incremented and the point where we latch the
155 * count), it cannot be newer.
156 */
157 jifs = jiffies;
158 outb_p(0x00, PIT_MODE); /* latch the count ASAP */
159 count = inb_p(PIT_CH0); /* read the latched count */
160 count |= inb_p(PIT_CH0) << 8;
161
162 /* VIA686a test code... reset the latch if count > max + 1 */
163 if (count > LATCH) {
164 outb_p(0x34, PIT_MODE);
165 outb_p(LATCH & 0xff, PIT_CH0);
166 outb(LATCH >> 8, PIT_CH0);
167 count = LATCH - 1;
168 }
169
170 /*
171 * It's possible for count to appear to go the wrong way for a
172 * couple of reasons:
173 *
174 * 1. The timer counter underflows, but we haven't handled the
175 * resulting interrupt and incremented jiffies yet.
176 * 2. Hardware problem with the timer, not giving us continuous time,
177 * the counter does small "jumps" upwards on some Pentium systems,
178 * (see c't 95/10 page 335 for Neptun bug.)
179 *
180 * Previous attempts to handle these cases intelligently were
181 * buggy, so we just do the simple thing now.
182 */
183 if (count > old_count && jifs == old_jifs) {
184 count = old_count;
185 }
186 old_count = count;
187 old_jifs = jifs;
188
189 spin_unlock_irqrestore(&i8253_lock, flags);
190
191 count = (LATCH - 1) - count;
192
193 return (cycle_t)(jifs * LATCH) + count;
194}
195
196static struct clocksource clocksource_pit = {
197 .name = "pit",
198 .rating = 110,
199 .read = pit_read,
200 .mask = CLOCKSOURCE_MASK(32),
201 .mult = 0,
202 .shift = 20,
203};
204
205static int __init init_pit_clocksource(void)
206{
207 if (num_possible_cpus() > 1) /* PIT does not scale! */
208 return 0;
209
210 clocksource_pit.mult = clocksource_hz2mult(CLOCK_TICK_RATE, 20);
211 return clocksource_register(&clocksource_pit);
212}
213arch_initcall(init_pit_clocksource);
diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index 3a2d255361bc..471013577108 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -30,8 +30,10 @@
30 30
31static int i8259A_auto_eoi = -1; 31static int i8259A_auto_eoi = -1;
32DEFINE_SPINLOCK(i8259A_lock); 32DEFINE_SPINLOCK(i8259A_lock);
33/* some platforms call this... */ 33static void disable_8259A_irq(unsigned int irq);
34void mask_and_ack_8259A(unsigned int); 34static void enable_8259A_irq(unsigned int irq);
35static void mask_and_ack_8259A(unsigned int irq);
36static void init_8259A(int auto_eoi);
35 37
36static struct irq_chip i8259A_chip = { 38static struct irq_chip i8259A_chip = {
37 .name = "XT-PIC", 39 .name = "XT-PIC",
@@ -39,6 +41,9 @@ static struct irq_chip i8259A_chip = {
39 .disable = disable_8259A_irq, 41 .disable = disable_8259A_irq,
40 .unmask = enable_8259A_irq, 42 .unmask = enable_8259A_irq,
41 .mask_ack = mask_and_ack_8259A, 43 .mask_ack = mask_and_ack_8259A,
44#ifdef CONFIG_MIPS_MT_SMTC_IRQAFF
45 .set_affinity = plat_set_irq_affinity,
46#endif /* CONFIG_MIPS_MT_SMTC_IRQAFF */
42}; 47};
43 48
44/* 49/*
@@ -53,7 +58,7 @@ static unsigned int cached_irq_mask = 0xffff;
53#define cached_master_mask (cached_irq_mask) 58#define cached_master_mask (cached_irq_mask)
54#define cached_slave_mask (cached_irq_mask >> 8) 59#define cached_slave_mask (cached_irq_mask >> 8)
55 60
56void disable_8259A_irq(unsigned int irq) 61static void disable_8259A_irq(unsigned int irq)
57{ 62{
58 unsigned int mask; 63 unsigned int mask;
59 unsigned long flags; 64 unsigned long flags;
@@ -69,7 +74,7 @@ void disable_8259A_irq(unsigned int irq)
69 spin_unlock_irqrestore(&i8259A_lock, flags); 74 spin_unlock_irqrestore(&i8259A_lock, flags);
70} 75}
71 76
72void enable_8259A_irq(unsigned int irq) 77static void enable_8259A_irq(unsigned int irq)
73{ 78{
74 unsigned int mask; 79 unsigned int mask;
75 unsigned long flags; 80 unsigned long flags;
@@ -122,14 +127,14 @@ static inline int i8259A_irq_real(unsigned int irq)
122 int irqmask = 1 << irq; 127 int irqmask = 1 << irq;
123 128
124 if (irq < 8) { 129 if (irq < 8) {
125 outb(0x0B,PIC_MASTER_CMD); /* ISR register */ 130 outb(0x0B, PIC_MASTER_CMD); /* ISR register */
126 value = inb(PIC_MASTER_CMD) & irqmask; 131 value = inb(PIC_MASTER_CMD) & irqmask;
127 outb(0x0A,PIC_MASTER_CMD); /* back to the IRR register */ 132 outb(0x0A, PIC_MASTER_CMD); /* back to the IRR register */
128 return value; 133 return value;
129 } 134 }
130 outb(0x0B,PIC_SLAVE_CMD); /* ISR register */ 135 outb(0x0B, PIC_SLAVE_CMD); /* ISR register */
131 value = inb(PIC_SLAVE_CMD) & (irqmask >> 8); 136 value = inb(PIC_SLAVE_CMD) & (irqmask >> 8);
132 outb(0x0A,PIC_SLAVE_CMD); /* back to the IRR register */ 137 outb(0x0A, PIC_SLAVE_CMD); /* back to the IRR register */
133 return value; 138 return value;
134} 139}
135 140
@@ -139,7 +144,7 @@ static inline int i8259A_irq_real(unsigned int irq)
139 * first, _then_ send the EOI, and the order of EOI 144 * first, _then_ send the EOI, and the order of EOI
140 * to the two 8259s is important! 145 * to the two 8259s is important!
141 */ 146 */
142void mask_and_ack_8259A(unsigned int irq) 147static void mask_and_ack_8259A(unsigned int irq)
143{ 148{
144 unsigned int irqmask; 149 unsigned int irqmask;
145 unsigned long flags; 150 unsigned long flags;
@@ -170,12 +175,12 @@ handle_real_irq:
170 if (irq & 8) { 175 if (irq & 8) {
171 inb(PIC_SLAVE_IMR); /* DUMMY - (do we need this?) */ 176 inb(PIC_SLAVE_IMR); /* DUMMY - (do we need this?) */
172 outb(cached_slave_mask, PIC_SLAVE_IMR); 177 outb(cached_slave_mask, PIC_SLAVE_IMR);
173 outb(0x60+(irq&7),PIC_SLAVE_CMD);/* 'Specific EOI' to slave */ 178 outb(0x60+(irq&7), PIC_SLAVE_CMD);/* 'Specific EOI' to slave */
174 outb(0x60+PIC_CASCADE_IR,PIC_MASTER_CMD); /* 'Specific EOI' to master-IRQ2 */ 179 outb(0x60+PIC_CASCADE_IR, PIC_MASTER_CMD); /* 'Specific EOI' to master-IRQ2 */
175 } else { 180 } else {
176 inb(PIC_MASTER_IMR); /* DUMMY - (do we need this?) */ 181 inb(PIC_MASTER_IMR); /* DUMMY - (do we need this?) */
177 outb(cached_master_mask, PIC_MASTER_IMR); 182 outb(cached_master_mask, PIC_MASTER_IMR);
178 outb(0x60+irq,PIC_MASTER_CMD); /* 'Specific EOI to master */ 183 outb(0x60+irq, PIC_MASTER_CMD); /* 'Specific EOI to master */
179 } 184 }
180 smtc_im_ack_irq(irq); 185 smtc_im_ack_irq(irq);
181 spin_unlock_irqrestore(&i8259A_lock, flags); 186 spin_unlock_irqrestore(&i8259A_lock, flags);
@@ -253,7 +258,7 @@ static int __init i8259A_init_sysfs(void)
253 258
254device_initcall(i8259A_init_sysfs); 259device_initcall(i8259A_init_sysfs);
255 260
256void init_8259A(int auto_eoi) 261static void init_8259A(int auto_eoi)
257{ 262{
258 unsigned long flags; 263 unsigned long flags;
259 264
@@ -300,7 +305,9 @@ void init_8259A(int auto_eoi)
300 * IRQ2 is cascade interrupt to second interrupt controller 305 * IRQ2 is cascade interrupt to second interrupt controller
301 */ 306 */
302static struct irqaction irq2 = { 307static struct irqaction irq2 = {
303 no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL 308 .handler = no_action,
309 .mask = CPU_MASK_NONE,
310 .name = "cascade",
304}; 311};
305 312
306static struct resource pic1_io_resource = { 313static struct resource pic1_io_resource = {
@@ -322,7 +329,7 @@ static struct resource pic2_io_resource = {
322 * driver compatibility reasons interrupts 0 - 15 to be the i8259 329 * driver compatibility reasons interrupts 0 - 15 to be the i8259
323 * interrupts even if the hardware uses a different interrupt numbering. 330 * interrupts even if the hardware uses a different interrupt numbering.
324 */ 331 */
325void __init init_i8259_irqs (void) 332void __init init_i8259_irqs(void)
326{ 333{
327 int i; 334 int i;
328 335
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
index 403d96f99e77..8ef5cf4cc423 100644
--- a/arch/mips/kernel/irixelf.c
+++ b/arch/mips/kernel/irixelf.c
@@ -203,8 +203,8 @@ static unsigned long * create_irix_tables(char * p, int argc, int envc,
203 * Put the ELF interpreter info on the stack 203 * Put the ELF interpreter info on the stack
204 */ 204 */
205#define NEW_AUX_ENT(nr, id, val) \ 205#define NEW_AUX_ENT(nr, id, val) \
206 __put_user ((id), sp+(nr*2)); \ 206 __put_user((id), sp+(nr*2)); \
207 __put_user ((val), sp+(nr*2+1)); \ 207 __put_user((val), sp+(nr*2+1)); \
208 208
209 sp -= 2; 209 sp -= 2;
210 NEW_AUX_ENT(0, AT_NULL, 0); 210 NEW_AUX_ENT(0, AT_NULL, 0);
@@ -212,17 +212,17 @@ static unsigned long * create_irix_tables(char * p, int argc, int envc,
212 if (exec) { 212 if (exec) {
213 sp -= 11*2; 213 sp -= 11*2;
214 214
215 NEW_AUX_ENT (0, AT_PHDR, load_addr + exec->e_phoff); 215 NEW_AUX_ENT(0, AT_PHDR, load_addr + exec->e_phoff);
216 NEW_AUX_ENT (1, AT_PHENT, sizeof (struct elf_phdr)); 216 NEW_AUX_ENT(1, AT_PHENT, sizeof(struct elf_phdr));
217 NEW_AUX_ENT (2, AT_PHNUM, exec->e_phnum); 217 NEW_AUX_ENT(2, AT_PHNUM, exec->e_phnum);
218 NEW_AUX_ENT (3, AT_PAGESZ, ELF_EXEC_PAGESIZE); 218 NEW_AUX_ENT(3, AT_PAGESZ, ELF_EXEC_PAGESIZE);
219 NEW_AUX_ENT (4, AT_BASE, interp_load_addr); 219 NEW_AUX_ENT(4, AT_BASE, interp_load_addr);
220 NEW_AUX_ENT (5, AT_FLAGS, 0); 220 NEW_AUX_ENT(5, AT_FLAGS, 0);
221 NEW_AUX_ENT (6, AT_ENTRY, (elf_addr_t) exec->e_entry); 221 NEW_AUX_ENT(6, AT_ENTRY, (elf_addr_t) exec->e_entry);
222 NEW_AUX_ENT (7, AT_UID, (elf_addr_t) current->uid); 222 NEW_AUX_ENT(7, AT_UID, (elf_addr_t) current->uid);
223 NEW_AUX_ENT (8, AT_EUID, (elf_addr_t) current->euid); 223 NEW_AUX_ENT(8, AT_EUID, (elf_addr_t) current->euid);
224 NEW_AUX_ENT (9, AT_GID, (elf_addr_t) current->gid); 224 NEW_AUX_ENT(9, AT_GID, (elf_addr_t) current->gid);
225 NEW_AUX_ENT (10, AT_EGID, (elf_addr_t) current->egid); 225 NEW_AUX_ENT(10, AT_EGID, (elf_addr_t) current->egid);
226 } 226 }
227#undef NEW_AUX_ENT 227#undef NEW_AUX_ENT
228 228
@@ -231,16 +231,16 @@ static unsigned long * create_irix_tables(char * p, int argc, int envc,
231 sp -= argc+1; 231 sp -= argc+1;
232 argv = sp; 232 argv = sp;
233 233
234 __put_user((elf_addr_t)argc,--sp); 234 __put_user((elf_addr_t)argc, --sp);
235 current->mm->arg_start = (unsigned long) p; 235 current->mm->arg_start = (unsigned long) p;
236 while (argc-->0) { 236 while (argc-->0) {
237 __put_user((unsigned long)p,argv++); 237 __put_user((unsigned long)p, argv++);
238 p += strlen_user(p); 238 p += strlen_user(p);
239 } 239 }
240 __put_user((unsigned long) NULL, argv); 240 __put_user((unsigned long) NULL, argv);
241 current->mm->arg_end = current->mm->env_start = (unsigned long) p; 241 current->mm->arg_end = current->mm->env_start = (unsigned long) p;
242 while (envc-->0) { 242 while (envc-->0) {
243 __put_user((unsigned long)p,envp++); 243 __put_user((unsigned long)p, envp++);
244 p += strlen_user(p); 244 p += strlen_user(p);
245 } 245 }
246 __put_user((unsigned long) NULL, envp); 246 __put_user((unsigned long) NULL, envp);
@@ -581,7 +581,7 @@ static void irix_map_prda_page(void)
581 struct prda *pp; 581 struct prda *pp;
582 582
583 down_write(&current->mm->mmap_sem); 583 down_write(&current->mm->mmap_sem);
584 v = do_brk (PRDA_ADDRESS, PAGE_SIZE); 584 v = do_brk(PRDA_ADDRESS, PAGE_SIZE);
585 up_write(&current->mm->mmap_sem); 585 up_write(&current->mm->mmap_sem);
586 586
587 if (v < 0) 587 if (v < 0)
@@ -815,7 +815,7 @@ out_free_interp:
815 kfree(elf_interpreter); 815 kfree(elf_interpreter);
816out_free_file: 816out_free_file:
817out_free_ph: 817out_free_ph:
818 kfree (elf_phdata); 818 kfree(elf_phdata);
819 goto out; 819 goto out;
820} 820}
821 821
@@ -831,7 +831,7 @@ static int load_irix_library(struct file *file)
831 int retval; 831 int retval;
832 unsigned int bss; 832 unsigned int bss;
833 int error; 833 int error;
834 int i,j, k; 834 int i, j, k;
835 835
836 error = kernel_read(file, 0, (char *) &elf_ex, sizeof(elf_ex)); 836 error = kernel_read(file, 0, (char *) &elf_ex, sizeof(elf_ex));
837 if (error != sizeof(elf_ex)) 837 if (error != sizeof(elf_ex))
@@ -1232,7 +1232,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
1232 strlcpy(psinfo.pr_fname, current->comm, sizeof(psinfo.pr_fname)); 1232 strlcpy(psinfo.pr_fname, current->comm, sizeof(psinfo.pr_fname));
1233 1233
1234 /* Try to dump the FPU. */ 1234 /* Try to dump the FPU. */
1235 prstatus.pr_fpvalid = dump_fpu (regs, &fpu); 1235 prstatus.pr_fpvalid = dump_fpu(regs, &fpu);
1236 if (!prstatus.pr_fpvalid) { 1236 if (!prstatus.pr_fpvalid) {
1237 numnote--; 1237 numnote--;
1238 } else { 1238 } else {
diff --git a/arch/mips/kernel/irixinv.c b/arch/mips/kernel/irixinv.c
index de8584f62311..cf2dcd3d6a93 100644
--- a/arch/mips/kernel/irixinv.c
+++ b/arch/mips/kernel/irixinv.c
@@ -14,7 +14,7 @@ int inventory_items = 0;
14 14
15static inventory_t inventory [MAX_INVENTORY]; 15static inventory_t inventory [MAX_INVENTORY];
16 16
17void add_to_inventory (int class, int type, int controller, int unit, int state) 17void add_to_inventory(int class, int type, int controller, int unit, int state)
18{ 18{
19 inventory_t *ni = &inventory [inventory_items]; 19 inventory_t *ni = &inventory [inventory_items];
20 20
@@ -30,7 +30,7 @@ void add_to_inventory (int class, int type, int controller, int unit, int state)
30 inventory_items++; 30 inventory_items++;
31} 31}
32 32
33int dump_inventory_to_user (void __user *userbuf, int size) 33int dump_inventory_to_user(void __user *userbuf, int size)
34{ 34{
35 inventory_t *inv = &inventory [0]; 35 inventory_t *inv = &inventory [0];
36 inventory_t __user *user = userbuf; 36 inventory_t __user *user = userbuf;
@@ -45,7 +45,7 @@ int dump_inventory_to_user (void __user *userbuf, int size)
45 return -EFAULT; 45 return -EFAULT;
46 user++; 46 user++;
47 } 47 }
48 return inventory_items * sizeof (inventory_t); 48 return inventory_items * sizeof(inventory_t);
49} 49}
50 50
51int __init init_inventory(void) 51int __init init_inventory(void)
@@ -55,24 +55,24 @@ int __init init_inventory(void)
55 * most likely this will not let just anyone run the X server 55 * most likely this will not let just anyone run the X server
56 * until we put the right values all over the place 56 * until we put the right values all over the place
57 */ 57 */
58 add_to_inventory (10, 3, 0, 0, 16400); 58 add_to_inventory(10, 3, 0, 0, 16400);
59 add_to_inventory (1, 1, 150, -1, 12); 59 add_to_inventory(1, 1, 150, -1, 12);
60 add_to_inventory (1, 3, 0, 0, 8976); 60 add_to_inventory(1, 3, 0, 0, 8976);
61 add_to_inventory (1, 2, 0, 0, 8976); 61 add_to_inventory(1, 2, 0, 0, 8976);
62 add_to_inventory (4, 8, 0, 0, 2); 62 add_to_inventory(4, 8, 0, 0, 2);
63 add_to_inventory (5, 5, 0, 0, 1); 63 add_to_inventory(5, 5, 0, 0, 1);
64 add_to_inventory (3, 3, 0, 0, 32768); 64 add_to_inventory(3, 3, 0, 0, 32768);
65 add_to_inventory (3, 4, 0, 0, 32768); 65 add_to_inventory(3, 4, 0, 0, 32768);
66 add_to_inventory (3, 8, 0, 0, 524288); 66 add_to_inventory(3, 8, 0, 0, 524288);
67 add_to_inventory (3, 9, 0, 0, 64); 67 add_to_inventory(3, 9, 0, 0, 64);
68 add_to_inventory (3, 1, 0, 0, 67108864); 68 add_to_inventory(3, 1, 0, 0, 67108864);
69 add_to_inventory (12, 3, 0, 0, 16); 69 add_to_inventory(12, 3, 0, 0, 16);
70 add_to_inventory (8, 7, 17, 0, 16777472); 70 add_to_inventory(8, 7, 17, 0, 16777472);
71 add_to_inventory (8, 0, 0, 0, 1); 71 add_to_inventory(8, 0, 0, 0, 1);
72 add_to_inventory (2, 1, 0, 13, 2); 72 add_to_inventory(2, 1, 0, 13, 2);
73 add_to_inventory (2, 2, 0, 2, 0); 73 add_to_inventory(2, 2, 0, 2, 0);
74 add_to_inventory (2, 2, 0, 1, 0); 74 add_to_inventory(2, 2, 0, 1, 0);
75 add_to_inventory (7, 14, 0, 0, 6); 75 add_to_inventory(7, 14, 0, 0, 6);
76 76
77 return 0; 77 return 0;
78} 78}
diff --git a/arch/mips/kernel/irixioctl.c b/arch/mips/kernel/irixioctl.c
index 30f9eb09db3f..2bde200d5ad0 100644
--- a/arch/mips/kernel/irixioctl.c
+++ b/arch/mips/kernel/irixioctl.c
@@ -238,7 +238,7 @@ asmlinkage int irix_ioctl(int fd, unsigned long cmd, unsigned long arg)
238 current->comm, current->pid, cmd); 238 current->comm, current->pid, cmd);
239 do_exit(255); 239 do_exit(255);
240#else 240#else
241 error = sys_ioctl (fd, cmd, arg); 241 error = sys_ioctl(fd, cmd, arg);
242#endif 242#endif
243 } 243 }
244 244
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index 28b2a8f00911..85c2e389edd6 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -163,9 +163,9 @@ static inline int handle_signal(unsigned long sig, siginfo_t *info,
163 ret = setup_irix_frame(ka, regs, sig, oldset); 163 ret = setup_irix_frame(ka, regs, sig, oldset);
164 164
165 spin_lock_irq(&current->sighand->siglock); 165 spin_lock_irq(&current->sighand->siglock);
166 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 166 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
167 if (!(ka->sa.sa_flags & SA_NODEFER)) 167 if (!(ka->sa.sa_flags & SA_NODEFER))
168 sigaddset(&current->blocked,sig); 168 sigaddset(&current->blocked, sig);
169 recalc_sigpending(); 169 recalc_sigpending();
170 spin_unlock_irq(&current->sighand->siglock); 170 spin_unlock_irq(&current->sighand->siglock);
171 171
@@ -605,8 +605,8 @@ repeat:
605 current->state = TASK_INTERRUPTIBLE; 605 current->state = TASK_INTERRUPTIBLE;
606 read_lock(&tasklist_lock); 606 read_lock(&tasklist_lock);
607 tsk = current; 607 tsk = current;
608 list_for_each(_p,&tsk->children) { 608 list_for_each(_p, &tsk->children) {
609 p = list_entry(_p,struct task_struct,sibling); 609 p = list_entry(_p, struct task_struct, sibling);
610 if ((type == IRIX_P_PID) && p->pid != pid) 610 if ((type == IRIX_P_PID) && p->pid != pid)
611 continue; 611 continue;
612 if ((type == IRIX_P_PGID) && process_group(p) != pid) 612 if ((type == IRIX_P_PGID) && process_group(p) != pid)
diff --git a/arch/mips/kernel/irq-gt641xx.c b/arch/mips/kernel/irq-gt641xx.c
new file mode 100644
index 000000000000..1b81b131f43c
--- /dev/null
+++ b/arch/mips/kernel/irq-gt641xx.c
@@ -0,0 +1,131 @@
1/*
2 * GT641xx IRQ routines.
3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/hardirq.h>
21#include <linux/init.h>
22#include <linux/irq.h>
23#include <linux/spinlock.h>
24#include <linux/types.h>
25
26#include <asm/gt64120.h>
27
28#define GT641XX_IRQ_TO_BIT(irq) (1U << (irq - GT641XX_IRQ_BASE))
29
30static DEFINE_SPINLOCK(gt641xx_irq_lock);
31
32static void ack_gt641xx_irq(unsigned int irq)
33{
34 unsigned long flags;
35 u32 cause;
36
37 spin_lock_irqsave(&gt641xx_irq_lock, flags);
38 cause = GT_READ(GT_INTRCAUSE_OFS);
39 cause &= ~GT641XX_IRQ_TO_BIT(irq);
40 GT_WRITE(GT_INTRCAUSE_OFS, cause);
41 spin_unlock_irqrestore(&gt641xx_irq_lock, flags);
42}
43
44static void mask_gt641xx_irq(unsigned int irq)
45{
46 unsigned long flags;
47 u32 mask;
48
49 spin_lock_irqsave(&gt641xx_irq_lock, flags);
50 mask = GT_READ(GT_INTRMASK_OFS);
51 mask &= ~GT641XX_IRQ_TO_BIT(irq);
52 GT_WRITE(GT_INTRMASK_OFS, mask);
53 spin_unlock_irqrestore(&gt641xx_irq_lock, flags);
54}
55
56static void mask_ack_gt641xx_irq(unsigned int irq)
57{
58 unsigned long flags;
59 u32 cause, mask;
60
61 spin_lock_irqsave(&gt641xx_irq_lock, flags);
62 mask = GT_READ(GT_INTRMASK_OFS);
63 mask &= ~GT641XX_IRQ_TO_BIT(irq);
64 GT_WRITE(GT_INTRMASK_OFS, mask);
65
66 cause = GT_READ(GT_INTRCAUSE_OFS);
67 cause &= ~GT641XX_IRQ_TO_BIT(irq);
68 GT_WRITE(GT_INTRCAUSE_OFS, cause);
69 spin_unlock_irqrestore(&gt641xx_irq_lock, flags);
70}
71
72static void unmask_gt641xx_irq(unsigned int irq)
73{
74 unsigned long flags;
75 u32 mask;
76
77 spin_lock_irqsave(&gt641xx_irq_lock, flags);
78 mask = GT_READ(GT_INTRMASK_OFS);
79 mask |= GT641XX_IRQ_TO_BIT(irq);
80 GT_WRITE(GT_INTRMASK_OFS, mask);
81 spin_unlock_irqrestore(&gt641xx_irq_lock, flags);
82}
83
84static struct irq_chip gt641xx_irq_chip = {
85 .name = "GT641xx",
86 .ack = ack_gt641xx_irq,
87 .mask = mask_gt641xx_irq,
88 .mask_ack = mask_ack_gt641xx_irq,
89 .unmask = unmask_gt641xx_irq,
90};
91
92void gt641xx_irq_dispatch(void)
93{
94 u32 cause, mask;
95 int i;
96
97 cause = GT_READ(GT_INTRCAUSE_OFS);
98 mask = GT_READ(GT_INTRMASK_OFS);
99 cause &= mask;
100
101 /*
102 * bit0 : logical or of all the interrupt bits.
103 * bit30: logical or of bits[29:26,20:1].
104 * bit31: logical or of bits[25:1].
105 */
106 for (i = 1; i < 30; i++) {
107 if (cause & (1U << i)) {
108 do_IRQ(GT641XX_IRQ_BASE + i);
109 return;
110 }
111 }
112
113 atomic_inc(&irq_err_count);
114}
115
116void __init gt641xx_irq_init(void)
117{
118 int i;
119
120 GT_WRITE(GT_INTRMASK_OFS, 0);
121 GT_WRITE(GT_INTRCAUSE_OFS, 0);
122
123 /*
124 * bit0 : logical or of all the interrupt bits.
125 * bit30: logical or of bits[29:26,20:1].
126 * bit31: logical or of bits[25:1].
127 */
128 for (i = 1; i < 30; i++)
129 set_irq_chip_and_handler(GT641XX_IRQ_BASE + i,
130 &gt641xx_irq_chip, handle_level_irq);
131}
diff --git a/arch/mips/kernel/irq-msc01.c b/arch/mips/kernel/irq-msc01.c
index 1ecdd50bfc60..4edc7e451d91 100644
--- a/arch/mips/kernel/irq-msc01.c
+++ b/arch/mips/kernel/irq-msc01.c
@@ -99,7 +99,7 @@ void ll_msc_irq(void)
99} 99}
100 100
101void 101void
102msc_bind_eic_interrupt (unsigned int irq, unsigned int set) 102msc_bind_eic_interrupt(unsigned int irq, unsigned int set)
103{ 103{
104 MSCIC_WRITE(MSC01_IC_RAMW, 104 MSCIC_WRITE(MSC01_IC_RAMW,
105 (irq<<MSC01_IC_RAMW_ADDR_SHF) | (set<<MSC01_IC_RAMW_DATA_SHF)); 105 (irq<<MSC01_IC_RAMW_ADDR_SHF) | (set<<MSC01_IC_RAMW_DATA_SHF));
@@ -130,7 +130,7 @@ void __init init_msc_irqs(unsigned long icubase, unsigned int irqbase, msc_irqma
130{ 130{
131 extern void (*board_bind_eic_interrupt)(unsigned int irq, unsigned int regset); 131 extern void (*board_bind_eic_interrupt)(unsigned int irq, unsigned int regset);
132 132
133 _icctrl_msc = (unsigned long) ioremap (icubase, 0x40000); 133 _icctrl_msc = (unsigned long) ioremap(icubase, 0x40000);
134 134
135 /* Reset interrupt controller - initialises all registers to 0 */ 135 /* Reset interrupt controller - initialises all registers to 0 */
136 MSCIC_WRITE(MSC01_IC_RST, MSC01_IC_RST_RST_BIT); 136 MSCIC_WRITE(MSC01_IC_RST, MSC01_IC_RST_RST_BIT);
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index a990aad2f049..d06e9c9af790 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -93,7 +93,7 @@ int show_interrupts(struct seq_file *p, void *v)
93 if (i == 0) { 93 if (i == 0) {
94 seq_printf(p, " "); 94 seq_printf(p, " ");
95 for_each_online_cpu(j) 95 for_each_online_cpu(j)
96 seq_printf(p, "CPU%d ",j); 96 seq_printf(p, "CPU%d ", j);
97 seq_putc(p, '\n'); 97 seq_putc(p, '\n');
98 } 98 }
99 99
@@ -102,7 +102,7 @@ int show_interrupts(struct seq_file *p, void *v)
102 action = irq_desc[i].action; 102 action = irq_desc[i].action;
103 if (!action) 103 if (!action)
104 goto skip; 104 goto skip;
105 seq_printf(p, "%3d: ",i); 105 seq_printf(p, "%3d: ", i);
106#ifndef CONFIG_SMP 106#ifndef CONFIG_SMP
107 seq_printf(p, "%10u ", kstat_irqs(i)); 107 seq_printf(p, "%10u ", kstat_irqs(i));
108#else 108#else
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
index cb9a14a1ca5b..d2c2e00e5864 100644
--- a/arch/mips/kernel/kspd.c
+++ b/arch/mips/kernel/kspd.c
@@ -118,11 +118,11 @@ struct apsp_table syscall_command_table[] = {
118 118
119static int sp_syscall(int num, int arg0, int arg1, int arg2, int arg3) 119static int sp_syscall(int num, int arg0, int arg1, int arg2, int arg3)
120{ 120{
121 register long int _num __asm__ ("$2") = num; 121 register long int _num __asm__("$2") = num;
122 register long int _arg0 __asm__ ("$4") = arg0; 122 register long int _arg0 __asm__("$4") = arg0;
123 register long int _arg1 __asm__ ("$5") = arg1; 123 register long int _arg1 __asm__("$5") = arg1;
124 register long int _arg2 __asm__ ("$6") = arg2; 124 register long int _arg2 __asm__("$6") = arg2;
125 register long int _arg3 __asm__ ("$7") = arg3; 125 register long int _arg3 __asm__("$7") = arg3;
126 126
127 mm_segment_t old_fs; 127 mm_segment_t old_fs;
128 128
@@ -239,7 +239,7 @@ void sp_work_handle_request(void)
239 case MTSP_SYSCALL_GETTOD: 239 case MTSP_SYSCALL_GETTOD:
240 memset(&tz, 0, sizeof(tz)); 240 memset(&tz, 0, sizeof(tz));
241 if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv, 241 if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv,
242 (int)&tz, 0,0)) == 0) 242 (int)&tz, 0, 0)) == 0)
243 ret.retval = tv.tv_sec; 243 ret.retval = tv.tv_sec;
244 break; 244 break;
245 245
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 135d9a5fe337..d6e01215fb2b 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -58,10 +58,10 @@
58#define AA(__x) ((unsigned long)((int)__x)) 58#define AA(__x) ((unsigned long)((int)__x))
59 59
60#ifdef __MIPSEB__ 60#ifdef __MIPSEB__
61#define merge_64(r1,r2) ((((r1) & 0xffffffffUL) << 32) + ((r2) & 0xffffffffUL)) 61#define merge_64(r1, r2) ((((r1) & 0xffffffffUL) << 32) + ((r2) & 0xffffffffUL))
62#endif 62#endif
63#ifdef __MIPSEL__ 63#ifdef __MIPSEL__
64#define merge_64(r1,r2) ((((r2) & 0xffffffffUL) << 32) + ((r1) & 0xffffffffUL)) 64#define merge_64(r1, r2) ((((r2) & 0xffffffffUL) << 32) + ((r1) & 0xffffffffUL))
65#endif 65#endif
66 66
67/* 67/*
@@ -96,7 +96,7 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
96#endif 96#endif
97 tmp.st_blocks = stat->blocks; 97 tmp.st_blocks = stat->blocks;
98 tmp.st_blksize = stat->blksize; 98 tmp.st_blksize = stat->blksize;
99 return copy_to_user(statbuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; 99 return copy_to_user(statbuf, &tmp, sizeof(tmp)) ? -EFAULT : 0;
100} 100}
101 101
102asmlinkage unsigned long 102asmlinkage unsigned long
@@ -300,13 +300,13 @@ asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
300{ 300{
301 struct timespec t; 301 struct timespec t;
302 int ret; 302 int ret;
303 mm_segment_t old_fs = get_fs (); 303 mm_segment_t old_fs = get_fs();
304 304
305 set_fs (KERNEL_DS); 305 set_fs(KERNEL_DS);
306 ret = sys_sched_rr_get_interval(pid, (struct timespec __user *)&t); 306 ret = sys_sched_rr_get_interval(pid, (struct timespec __user *)&t);
307 set_fs (old_fs); 307 set_fs(old_fs);
308 if (put_user (t.tv_sec, &interval->tv_sec) || 308 if (put_user (t.tv_sec, &interval->tv_sec) ||
309 __put_user (t.tv_nsec, &interval->tv_nsec)) 309 __put_user(t.tv_nsec, &interval->tv_nsec))
310 return -EFAULT; 310 return -EFAULT;
311 return ret; 311 return ret;
312} 312}
@@ -314,7 +314,7 @@ asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
314#ifdef CONFIG_SYSVIPC 314#ifdef CONFIG_SYSVIPC
315 315
316asmlinkage long 316asmlinkage long
317sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) 317sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth)
318{ 318{
319 int version, err; 319 int version, err;
320 320
@@ -373,7 +373,7 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
373#else 373#else
374 374
375asmlinkage long 375asmlinkage long
376sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) 376sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth)
377{ 377{
378 return -ENOSYS; 378 return -ENOSYS;
379} 379}
@@ -505,16 +505,16 @@ asmlinkage int sys32_ustat(dev_t dev, struct ustat32 __user * ubuf32)
505 505
506 set_fs(KERNEL_DS); 506 set_fs(KERNEL_DS);
507 err = sys_ustat(dev, (struct ustat __user *)&tmp); 507 err = sys_ustat(dev, (struct ustat __user *)&tmp);
508 set_fs (old_fs); 508 set_fs(old_fs);
509 509
510 if (err) 510 if (err)
511 goto out; 511 goto out;
512 512
513 memset(&tmp32,0,sizeof(struct ustat32)); 513 memset(&tmp32, 0, sizeof(struct ustat32));
514 tmp32.f_tfree = tmp.f_tfree; 514 tmp32.f_tfree = tmp.f_tfree;
515 tmp32.f_tinode = tmp.f_tinode; 515 tmp32.f_tinode = tmp.f_tinode;
516 516
517 err = copy_to_user(ubuf32,&tmp32,sizeof(struct ustat32)) ? -EFAULT : 0; 517 err = copy_to_user(ubuf32, &tmp32, sizeof(struct ustat32)) ? -EFAULT : 0;
518 518
519out: 519out:
520 return err; 520 return err;
diff --git a/arch/mips/kernel/mips-mt.c b/arch/mips/kernel/mips-mt.c
index 56750b02ab40..3d6b1ec1f328 100644
--- a/arch/mips/kernel/mips-mt.c
+++ b/arch/mips/kernel/mips-mt.c
@@ -236,7 +236,7 @@ void mips_mt_set_cpuoptions(void)
236 if (oconfig7 != nconfig7) { 236 if (oconfig7 != nconfig7) {
237 __asm__ __volatile("sync"); 237 __asm__ __volatile("sync");
238 write_c0_config7(nconfig7); 238 write_c0_config7(nconfig7);
239 ehb (); 239 ehb();
240 printk("Config7: 0x%08x\n", read_c0_config7()); 240 printk("Config7: 0x%08x\n", read_c0_config7());
241 } 241 }
242 242
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c
index ec04f5a1a5ea..efd2d1314123 100644
--- a/arch/mips/kernel/proc.c
+++ b/arch/mips/kernel/proc.c
@@ -17,76 +17,6 @@
17 17
18unsigned int vced_count, vcei_count; 18unsigned int vced_count, vcei_count;
19 19
20static const char *cpu_name[] = {
21 [CPU_UNKNOWN] = "unknown",
22 [CPU_R2000] = "R2000",
23 [CPU_R3000] = "R3000",
24 [CPU_R3000A] = "R3000A",
25 [CPU_R3041] = "R3041",
26 [CPU_R3051] = "R3051",
27 [CPU_R3052] = "R3052",
28 [CPU_R3081] = "R3081",
29 [CPU_R3081E] = "R3081E",
30 [CPU_R4000PC] = "R4000PC",
31 [CPU_R4000SC] = "R4000SC",
32 [CPU_R4000MC] = "R4000MC",
33 [CPU_R4200] = "R4200",
34 [CPU_R4400PC] = "R4400PC",
35 [CPU_R4400SC] = "R4400SC",
36 [CPU_R4400MC] = "R4400MC",
37 [CPU_R4600] = "R4600",
38 [CPU_R6000] = "R6000",
39 [CPU_R6000A] = "R6000A",
40 [CPU_R8000] = "R8000",
41 [CPU_R10000] = "R10000",
42 [CPU_R12000] = "R12000",
43 [CPU_R14000] = "R14000",
44 [CPU_R4300] = "R4300",
45 [CPU_R4650] = "R4650",
46 [CPU_R4700] = "R4700",
47 [CPU_R5000] = "R5000",
48 [CPU_R5000A] = "R5000A",
49 [CPU_R4640] = "R4640",
50 [CPU_NEVADA] = "Nevada",
51 [CPU_RM7000] = "RM7000",
52 [CPU_RM9000] = "RM9000",
53 [CPU_R5432] = "R5432",
54 [CPU_4KC] = "MIPS 4Kc",
55 [CPU_5KC] = "MIPS 5Kc",
56 [CPU_R4310] = "R4310",
57 [CPU_SB1] = "SiByte SB1",
58 [CPU_SB1A] = "SiByte SB1A",
59 [CPU_TX3912] = "TX3912",
60 [CPU_TX3922] = "TX3922",
61 [CPU_TX3927] = "TX3927",
62 [CPU_AU1000] = "Au1000",
63 [CPU_AU1500] = "Au1500",
64 [CPU_AU1100] = "Au1100",
65 [CPU_AU1550] = "Au1550",
66 [CPU_AU1200] = "Au1200",
67 [CPU_4KEC] = "MIPS 4KEc",
68 [CPU_4KSC] = "MIPS 4KSc",
69 [CPU_VR41XX] = "NEC Vr41xx",
70 [CPU_R5500] = "R5500",
71 [CPU_TX49XX] = "TX49xx",
72 [CPU_20KC] = "MIPS 20Kc",
73 [CPU_24K] = "MIPS 24K",
74 [CPU_25KF] = "MIPS 25Kf",
75 [CPU_34K] = "MIPS 34K",
76 [CPU_74K] = "MIPS 74K",
77 [CPU_VR4111] = "NEC VR4111",
78 [CPU_VR4121] = "NEC VR4121",
79 [CPU_VR4122] = "NEC VR4122",
80 [CPU_VR4131] = "NEC VR4131",
81 [CPU_VR4133] = "NEC VR4133",
82 [CPU_VR4181] = "NEC VR4181",
83 [CPU_VR4181A] = "NEC VR4181A",
84 [CPU_SR71000] = "Sandcraft SR71000",
85 [CPU_PR4450] = "Philips PR4450",
86 [CPU_LOONGSON2] = "ICT Loongson-2",
87};
88
89
90static int show_cpuinfo(struct seq_file *m, void *v) 20static int show_cpuinfo(struct seq_file *m, void *v)
91{ 21{
92 unsigned long n = (unsigned long) v - 1; 22 unsigned long n = (unsigned long) v - 1;
@@ -108,8 +38,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
108 seq_printf(m, "processor\t\t: %ld\n", n); 38 seq_printf(m, "processor\t\t: %ld\n", n);
109 sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n", 39 sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
110 cpu_data[n].options & MIPS_CPU_FPU ? " FPU V%d.%d" : ""); 40 cpu_data[n].options & MIPS_CPU_FPU ? " FPU V%d.%d" : "");
111 seq_printf(m, fmt, cpu_name[cpu_data[n].cputype <= CPU_LAST ? 41 seq_printf(m, fmt, __cpu_name[smp_processor_id()],
112 cpu_data[n].cputype : CPU_UNKNOWN],
113 (version >> 4) & 0x0f, version & 0x0f, 42 (version >> 4) & 0x0f, version & 0x0f,
114 (fp_vers >> 4) & 0x0f, fp_vers & 0x0f); 43 (fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
115 seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n", 44 seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n",
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index e6ce943099a0..11cb264f59ce 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -11,6 +11,7 @@
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/tick.h>
14#include <linux/kernel.h> 15#include <linux/kernel.h>
15#include <linux/mm.h> 16#include <linux/mm.h>
16#include <linux/stddef.h> 17#include <linux/stddef.h>
@@ -52,6 +53,7 @@ void __noreturn cpu_idle(void)
52{ 53{
53 /* endless idle loop with no priority at all */ 54 /* endless idle loop with no priority at all */
54 while (1) { 55 while (1) {
56 tick_nohz_stop_sched_tick();
55 while (!need_resched()) { 57 while (!need_resched()) {
56#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG 58#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG
57 extern void smtc_idle_loop_hook(void); 59 extern void smtc_idle_loop_hook(void);
@@ -61,6 +63,7 @@ void __noreturn cpu_idle(void)
61 if (cpu_wait) 63 if (cpu_wait)
62 (*cpu_wait)(); 64 (*cpu_wait)();
63 } 65 }
66 tick_nohz_restart_sched_tick();
64 preempt_enable_no_resched(); 67 preempt_enable_no_resched();
65 schedule(); 68 schedule();
66 preempt_disable(); 69 preempt_disable();
@@ -199,13 +202,13 @@ void elf_dump_regs(elf_greg_t *gp, struct pt_regs *regs)
199#endif 202#endif
200} 203}
201 204
202int dump_task_regs (struct task_struct *tsk, elf_gregset_t *regs) 205int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
203{ 206{
204 elf_dump_regs(*regs, task_pt_regs(tsk)); 207 elf_dump_regs(*regs, task_pt_regs(tsk));
205 return 1; 208 return 1;
206} 209}
207 210
208int dump_task_fpu (struct task_struct *t, elf_fpregset_t *fpr) 211int dump_task_fpu(struct task_struct *t, elf_fpregset_t *fpr)
209{ 212{
210 memcpy(fpr, &t->thread.fpu, sizeof(current->thread.fpu)); 213 memcpy(fpr, &t->thread.fpu, sizeof(current->thread.fpu));
211 214
@@ -231,8 +234,8 @@ long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
231 regs.cp0_epc = (unsigned long) kernel_thread_helper; 234 regs.cp0_epc = (unsigned long) kernel_thread_helper;
232 regs.cp0_status = read_c0_status(); 235 regs.cp0_status = read_c0_status();
233#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) 236#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
234 regs.cp0_status &= ~(ST0_KUP | ST0_IEC); 237 regs.cp0_status = (regs.cp0_status & ~(ST0_KUP | ST0_IEP | ST0_IEC)) |
235 regs.cp0_status |= ST0_IEP; 238 ((regs.cp0_status & (ST0_KUC | ST0_IEC)) << 2);
236#else 239#else
237 regs.cp0_status |= ST0_EXL; 240 regs.cp0_status |= ST0_EXL;
238#endif 241#endif
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index bbd57b20b43e..58aa6fec1146 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -54,7 +54,7 @@ void ptrace_disable(struct task_struct *child)
54 * for 32-bit kernels and for 32-bit processes on a 64-bit kernel. 54 * for 32-bit kernels and for 32-bit processes on a 64-bit kernel.
55 * Registers are sign extended to fill the available space. 55 * Registers are sign extended to fill the available space.
56 */ 56 */
57int ptrace_getregs (struct task_struct *child, __s64 __user *data) 57int ptrace_getregs(struct task_struct *child, __s64 __user *data)
58{ 58{
59 struct pt_regs *regs; 59 struct pt_regs *regs;
60 int i; 60 int i;
@@ -65,13 +65,13 @@ int ptrace_getregs (struct task_struct *child, __s64 __user *data)
65 regs = task_pt_regs(child); 65 regs = task_pt_regs(child);
66 66
67 for (i = 0; i < 32; i++) 67 for (i = 0; i < 32; i++)
68 __put_user (regs->regs[i], data + i); 68 __put_user(regs->regs[i], data + i);
69 __put_user (regs->lo, data + EF_LO - EF_R0); 69 __put_user(regs->lo, data + EF_LO - EF_R0);
70 __put_user (regs->hi, data + EF_HI - EF_R0); 70 __put_user(regs->hi, data + EF_HI - EF_R0);
71 __put_user (regs->cp0_epc, data + EF_CP0_EPC - EF_R0); 71 __put_user(regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
72 __put_user (regs->cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0); 72 __put_user(regs->cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0);
73 __put_user (regs->cp0_status, data + EF_CP0_STATUS - EF_R0); 73 __put_user(regs->cp0_status, data + EF_CP0_STATUS - EF_R0);
74 __put_user (regs->cp0_cause, data + EF_CP0_CAUSE - EF_R0); 74 __put_user(regs->cp0_cause, data + EF_CP0_CAUSE - EF_R0);
75 75
76 return 0; 76 return 0;
77} 77}
@@ -81,7 +81,7 @@ int ptrace_getregs (struct task_struct *child, __s64 __user *data)
81 * the 64-bit format. On a 32-bit kernel only the lower order half 81 * the 64-bit format. On a 32-bit kernel only the lower order half
82 * (according to endianness) will be used. 82 * (according to endianness) will be used.
83 */ 83 */
84int ptrace_setregs (struct task_struct *child, __s64 __user *data) 84int ptrace_setregs(struct task_struct *child, __s64 __user *data)
85{ 85{
86 struct pt_regs *regs; 86 struct pt_regs *regs;
87 int i; 87 int i;
@@ -92,17 +92,17 @@ int ptrace_setregs (struct task_struct *child, __s64 __user *data)
92 regs = task_pt_regs(child); 92 regs = task_pt_regs(child);
93 93
94 for (i = 0; i < 32; i++) 94 for (i = 0; i < 32; i++)
95 __get_user (regs->regs[i], data + i); 95 __get_user(regs->regs[i], data + i);
96 __get_user (regs->lo, data + EF_LO - EF_R0); 96 __get_user(regs->lo, data + EF_LO - EF_R0);
97 __get_user (regs->hi, data + EF_HI - EF_R0); 97 __get_user(regs->hi, data + EF_HI - EF_R0);
98 __get_user (regs->cp0_epc, data + EF_CP0_EPC - EF_R0); 98 __get_user(regs->cp0_epc, data + EF_CP0_EPC - EF_R0);
99 99
100 /* badvaddr, status, and cause may not be written. */ 100 /* badvaddr, status, and cause may not be written. */
101 101
102 return 0; 102 return 0;
103} 103}
104 104
105int ptrace_getfpregs (struct task_struct *child, __u32 __user *data) 105int ptrace_getfpregs(struct task_struct *child, __u32 __user *data)
106{ 106{
107 int i; 107 int i;
108 unsigned int tmp; 108 unsigned int tmp;
@@ -113,13 +113,13 @@ int ptrace_getfpregs (struct task_struct *child, __u32 __user *data)
113 if (tsk_used_math(child)) { 113 if (tsk_used_math(child)) {
114 fpureg_t *fregs = get_fpu_regs(child); 114 fpureg_t *fregs = get_fpu_regs(child);
115 for (i = 0; i < 32; i++) 115 for (i = 0; i < 32; i++)
116 __put_user (fregs[i], i + (__u64 __user *) data); 116 __put_user(fregs[i], i + (__u64 __user *) data);
117 } else { 117 } else {
118 for (i = 0; i < 32; i++) 118 for (i = 0; i < 32; i++)
119 __put_user ((__u64) -1, i + (__u64 __user *) data); 119 __put_user((__u64) -1, i + (__u64 __user *) data);
120 } 120 }
121 121
122 __put_user (child->thread.fpu.fcr31, data + 64); 122 __put_user(child->thread.fpu.fcr31, data + 64);
123 123
124 preempt_disable(); 124 preempt_disable();
125 if (cpu_has_fpu) { 125 if (cpu_has_fpu) {
@@ -142,12 +142,12 @@ int ptrace_getfpregs (struct task_struct *child, __u32 __user *data)
142 tmp = 0; 142 tmp = 0;
143 } 143 }
144 preempt_enable(); 144 preempt_enable();
145 __put_user (tmp, data + 65); 145 __put_user(tmp, data + 65);
146 146
147 return 0; 147 return 0;
148} 148}
149 149
150int ptrace_setfpregs (struct task_struct *child, __u32 __user *data) 150int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
151{ 151{
152 fpureg_t *fregs; 152 fpureg_t *fregs;
153 int i; 153 int i;
@@ -158,9 +158,9 @@ int ptrace_setfpregs (struct task_struct *child, __u32 __user *data)
158 fregs = get_fpu_regs(child); 158 fregs = get_fpu_regs(child);
159 159
160 for (i = 0; i < 32; i++) 160 for (i = 0; i < 32; i++)
161 __get_user (fregs[i], i + (__u64 __user *) data); 161 __get_user(fregs[i], i + (__u64 __user *) data);
162 162
163 __get_user (child->thread.fpu.fcr31, data + 64); 163 __get_user(child->thread.fpu.fcr31, data + 64);
164 164
165 /* FIR may not be written. */ 165 /* FIR may not be written. */
166 166
@@ -390,19 +390,19 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
390 } 390 }
391 391
392 case PTRACE_GETREGS: 392 case PTRACE_GETREGS:
393 ret = ptrace_getregs (child, (__u64 __user *) data); 393 ret = ptrace_getregs(child, (__u64 __user *) data);
394 break; 394 break;
395 395
396 case PTRACE_SETREGS: 396 case PTRACE_SETREGS:
397 ret = ptrace_setregs (child, (__u64 __user *) data); 397 ret = ptrace_setregs(child, (__u64 __user *) data);
398 break; 398 break;
399 399
400 case PTRACE_GETFPREGS: 400 case PTRACE_GETFPREGS:
401 ret = ptrace_getfpregs (child, (__u32 __user *) data); 401 ret = ptrace_getfpregs(child, (__u32 __user *) data);
402 break; 402 break;
403 403
404 case PTRACE_SETFPREGS: 404 case PTRACE_SETFPREGS:
405 ret = ptrace_setfpregs (child, (__u32 __user *) data); 405 ret = ptrace_setfpregs(child, (__u32 __user *) data);
406 break; 406 break;
407 407
408 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 408 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index d9a39c169450..f2bffed94fa3 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -36,11 +36,11 @@
36#include <asm/uaccess.h> 36#include <asm/uaccess.h>
37#include <asm/bootinfo.h> 37#include <asm/bootinfo.h>
38 38
39int ptrace_getregs (struct task_struct *child, __s64 __user *data); 39int ptrace_getregs(struct task_struct *child, __s64 __user *data);
40int ptrace_setregs (struct task_struct *child, __s64 __user *data); 40int ptrace_setregs(struct task_struct *child, __s64 __user *data);
41 41
42int ptrace_getfpregs (struct task_struct *child, __u32 __user *data); 42int ptrace_getfpregs(struct task_struct *child, __u32 __user *data);
43int ptrace_setfpregs (struct task_struct *child, __u32 __user *data); 43int ptrace_setfpregs(struct task_struct *child, __u32 __user *data);
44 44
45/* 45/*
46 * Tracing a 32-bit process with a 64-bit strace and vice versa will not 46 * Tracing a 32-bit process with a 64-bit strace and vice versa will not
@@ -346,19 +346,19 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
346 } 346 }
347 347
348 case PTRACE_GETREGS: 348 case PTRACE_GETREGS:
349 ret = ptrace_getregs (child, (__u64 __user *) (__u64) data); 349 ret = ptrace_getregs(child, (__u64 __user *) (__u64) data);
350 break; 350 break;
351 351
352 case PTRACE_SETREGS: 352 case PTRACE_SETREGS:
353 ret = ptrace_setregs (child, (__u64 __user *) (__u64) data); 353 ret = ptrace_setregs(child, (__u64 __user *) (__u64) data);
354 break; 354 break;
355 355
356 case PTRACE_GETFPREGS: 356 case PTRACE_GETFPREGS:
357 ret = ptrace_getfpregs (child, (__u32 __user *) (__u64) data); 357 ret = ptrace_getfpregs(child, (__u32 __user *) (__u64) data);
358 break; 358 break;
359 359
360 case PTRACE_SETFPREGS: 360 case PTRACE_SETFPREGS:
361 ret = ptrace_setfpregs (child, (__u32 __user *) (__u64) data); 361 ret = ptrace_setfpregs(child, (__u32 __user *) (__u64) data);
362 break; 362 break;
363 363
364 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 364 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 316685fca059..a06a27d6cfcd 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -51,10 +51,8 @@ EXPORT_SYMBOL(PCI_DMA_BUS_IS_PHYS);
51 * These are initialized so they are in the .data section 51 * These are initialized so they are in the .data section
52 */ 52 */
53unsigned long mips_machtype __read_mostly = MACH_UNKNOWN; 53unsigned long mips_machtype __read_mostly = MACH_UNKNOWN;
54unsigned long mips_machgroup __read_mostly = MACH_GROUP_UNKNOWN;
55 54
56EXPORT_SYMBOL(mips_machtype); 55EXPORT_SYMBOL(mips_machtype);
57EXPORT_SYMBOL(mips_machgroup);
58 56
59struct boot_mem_map boot_mem_map; 57struct boot_mem_map boot_mem_map;
60 58
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 2a08ce41bf2b..a4e106c56ab5 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -613,9 +613,9 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
613 ret = current->thread.abi->setup_frame(ka, regs, sig, oldset); 613 ret = current->thread.abi->setup_frame(ka, regs, sig, oldset);
614 614
615 spin_lock_irq(&current->sighand->siglock); 615 spin_lock_irq(&current->sighand->siglock);
616 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 616 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
617 if (!(ka->sa.sa_flags & SA_NODEFER)) 617 if (!(ka->sa.sa_flags & SA_NODEFER))
618 sigaddset(&current->blocked,sig); 618 sigaddset(&current->blocked, sig);
619 recalc_sigpending(); 619 recalc_sigpending();
620 spin_unlock_irq(&current->sighand->siglock); 620 spin_unlock_irq(&current->sighand->siglock);
621 621
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index 64b612a0a622..572c610db1b1 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -261,11 +261,11 @@ static inline int put_sigset(const sigset_t *kbuf, compat_sigset_t __user *ubuf)
261 default: 261 default:
262 __put_sigset_unknown_nsig(); 262 __put_sigset_unknown_nsig();
263 case 2: 263 case 2:
264 err |= __put_user (kbuf->sig[1] >> 32, &ubuf->sig[3]); 264 err |= __put_user(kbuf->sig[1] >> 32, &ubuf->sig[3]);
265 err |= __put_user (kbuf->sig[1] & 0xffffffff, &ubuf->sig[2]); 265 err |= __put_user(kbuf->sig[1] & 0xffffffff, &ubuf->sig[2]);
266 case 1: 266 case 1:
267 err |= __put_user (kbuf->sig[0] >> 32, &ubuf->sig[1]); 267 err |= __put_user(kbuf->sig[0] >> 32, &ubuf->sig[1]);
268 err |= __put_user (kbuf->sig[0] & 0xffffffff, &ubuf->sig[0]); 268 err |= __put_user(kbuf->sig[0] & 0xffffffff, &ubuf->sig[0]);
269 } 269 }
270 270
271 return err; 271 return err;
@@ -283,12 +283,12 @@ static inline int get_sigset(sigset_t *kbuf, const compat_sigset_t __user *ubuf)
283 default: 283 default:
284 __get_sigset_unknown_nsig(); 284 __get_sigset_unknown_nsig();
285 case 2: 285 case 2:
286 err |= __get_user (sig[3], &ubuf->sig[3]); 286 err |= __get_user(sig[3], &ubuf->sig[3]);
287 err |= __get_user (sig[2], &ubuf->sig[2]); 287 err |= __get_user(sig[2], &ubuf->sig[2]);
288 kbuf->sig[1] = sig[2] | (sig[3] << 32); 288 kbuf->sig[1] = sig[2] | (sig[3] << 32);
289 case 1: 289 case 1:
290 err |= __get_user (sig[1], &ubuf->sig[1]); 290 err |= __get_user(sig[1], &ubuf->sig[1]);
291 err |= __get_user (sig[0], &ubuf->sig[0]); 291 err |= __get_user(sig[0], &ubuf->sig[0]);
292 kbuf->sig[0] = sig[0] | (sig[1] << 32); 292 kbuf->sig[0] = sig[0] | (sig[1] << 32);
293 } 293 }
294 294
@@ -412,10 +412,10 @@ asmlinkage int sys32_sigaltstack(nabi_no_regargs struct pt_regs regs)
412 return -EFAULT; 412 return -EFAULT;
413 } 413 }
414 414
415 set_fs (KERNEL_DS); 415 set_fs(KERNEL_DS);
416 ret = do_sigaltstack(uss ? (stack_t __user *)&kss : NULL, 416 ret = do_sigaltstack(uss ? (stack_t __user *)&kss : NULL,
417 uoss ? (stack_t __user *)&koss : NULL, usp); 417 uoss ? (stack_t __user *)&koss : NULL, usp);
418 set_fs (old_fs); 418 set_fs(old_fs);
419 419
420 if (!ret && uoss) { 420 if (!ret && uoss) {
421 if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss))) 421 if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss)))
@@ -559,9 +559,9 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
559 /* It is more difficult to avoid calling this function than to 559 /* It is more difficult to avoid calling this function than to
560 call it and ignore errors. */ 560 call it and ignore errors. */
561 old_fs = get_fs(); 561 old_fs = get_fs();
562 set_fs (KERNEL_DS); 562 set_fs(KERNEL_DS);
563 do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]); 563 do_sigaltstack((stack_t __user *)&st, NULL, regs.regs[29]);
564 set_fs (old_fs); 564 set_fs(old_fs);
565 565
566 /* 566 /*
567 * Don't let your children do this ... 567 * Don't let your children do this ...
@@ -746,11 +746,11 @@ asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
746 if (set && get_sigset(&new_set, set)) 746 if (set && get_sigset(&new_set, set))
747 return -EFAULT; 747 return -EFAULT;
748 748
749 set_fs (KERNEL_DS); 749 set_fs(KERNEL_DS);
750 ret = sys_rt_sigprocmask(how, set ? (sigset_t __user *)&new_set : NULL, 750 ret = sys_rt_sigprocmask(how, set ? (sigset_t __user *)&new_set : NULL,
751 oset ? (sigset_t __user *)&old_set : NULL, 751 oset ? (sigset_t __user *)&old_set : NULL,
752 sigsetsize); 752 sigsetsize);
753 set_fs (old_fs); 753 set_fs(old_fs);
754 754
755 if (!ret && oset && put_sigset(&old_set, oset)) 755 if (!ret && oset && put_sigset(&old_set, oset))
756 return -EFAULT; 756 return -EFAULT;
@@ -765,9 +765,9 @@ asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *uset,
765 sigset_t set; 765 sigset_t set;
766 mm_segment_t old_fs = get_fs(); 766 mm_segment_t old_fs = get_fs();
767 767
768 set_fs (KERNEL_DS); 768 set_fs(KERNEL_DS);
769 ret = sys_rt_sigpending((sigset_t __user *)&set, sigsetsize); 769 ret = sys_rt_sigpending((sigset_t __user *)&set, sigsetsize);
770 set_fs (old_fs); 770 set_fs(old_fs);
771 771
772 if (!ret && put_sigset(&set, uset)) 772 if (!ret && put_sigset(&set, uset))
773 return -EFAULT; 773 return -EFAULT;
@@ -781,12 +781,12 @@ asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *
781 int ret; 781 int ret;
782 mm_segment_t old_fs = get_fs(); 782 mm_segment_t old_fs = get_fs();
783 783
784 if (copy_from_user (&info, uinfo, 3*sizeof(int)) || 784 if (copy_from_user(&info, uinfo, 3*sizeof(int)) ||
785 copy_from_user (info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE)) 785 copy_from_user(info._sifields._pad, uinfo->_sifields._pad, SI_PAD_SIZE))
786 return -EFAULT; 786 return -EFAULT;
787 set_fs (KERNEL_DS); 787 set_fs(KERNEL_DS);
788 ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info); 788 ret = sys_rt_sigqueueinfo(pid, sig, (siginfo_t __user *)&info);
789 set_fs (old_fs); 789 set_fs(old_fs);
790 return ret; 790 return ret;
791} 791}
792 792
@@ -801,10 +801,10 @@ sys32_waitid(int which, compat_pid_t pid,
801 mm_segment_t old_fs = get_fs(); 801 mm_segment_t old_fs = get_fs();
802 802
803 info.si_signo = 0; 803 info.si_signo = 0;
804 set_fs (KERNEL_DS); 804 set_fs(KERNEL_DS);
805 ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options, 805 ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
806 uru ? (struct rusage __user *) &ru : NULL); 806 uru ? (struct rusage __user *) &ru : NULL);
807 set_fs (old_fs); 807 set_fs(old_fs);
808 808
809 if (ret < 0 || info.si_signo == 0) 809 if (ret < 0 || info.si_signo == 0)
810 return ret; 810 return ret;
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index eb7e05926ebe..bb277e82d421 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -88,7 +88,7 @@ struct rt_sigframe_n32 {
88 88
89#endif /* !ICACHE_REFILLS_WORKAROUND_WAR */ 89#endif /* !ICACHE_REFILLS_WORKAROUND_WAR */
90 90
91extern void sigset_from_compat (sigset_t *set, compat_sigset_t *compat); 91extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
92 92
93asmlinkage int sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) 93asmlinkage int sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
94{ 94{
@@ -105,7 +105,7 @@ asmlinkage int sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
105 unewset = (compat_sigset_t __user *) regs.regs[4]; 105 unewset = (compat_sigset_t __user *) regs.regs[4];
106 if (copy_from_user(&uset, unewset, sizeof(uset))) 106 if (copy_from_user(&uset, unewset, sizeof(uset)))
107 return -EFAULT; 107 return -EFAULT;
108 sigset_from_compat (&newset, &uset); 108 sigset_from_compat(&newset, &uset);
109 sigdelsetmask(&newset, ~_BLOCKABLE); 109 sigdelsetmask(&newset, ~_BLOCKABLE);
110 110
111 spin_lock_irq(&current->sighand->siglock); 111 spin_lock_irq(&current->sighand->siglock);
diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c
index 05dcce416325..94e210cc6cb6 100644
--- a/arch/mips/kernel/smp-mt.c
+++ b/arch/mips/kernel/smp-mt.c
@@ -353,7 +353,7 @@ void core_send_ipi(int cpu, unsigned int action)
353 unsigned long flags; 353 unsigned long flags;
354 int vpflags; 354 int vpflags;
355 355
356 local_irq_save (flags); 356 local_irq_save(flags);
357 357
358 vpflags = dvpe(); /* cant access the other CPU's registers whilst MVPE enabled */ 358 vpflags = dvpe(); /* cant access the other CPU's registers whilst MVPE enabled */
359 359
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 73b0dab02668..432f2e376aea 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -38,6 +38,7 @@
38#include <asm/system.h> 38#include <asm/system.h>
39#include <asm/mmu_context.h> 39#include <asm/mmu_context.h>
40#include <asm/smp.h> 40#include <asm/smp.h>
41#include <asm/time.h>
41 42
42#ifdef CONFIG_MIPS_MT_SMTC 43#ifdef CONFIG_MIPS_MT_SMTC
43#include <asm/mipsmtregs.h> 44#include <asm/mipsmtregs.h>
@@ -70,6 +71,7 @@ asmlinkage __cpuinit void start_secondary(void)
70 cpu_probe(); 71 cpu_probe();
71 cpu_report(); 72 cpu_report();
72 per_cpu_trap_init(); 73 per_cpu_trap_init();
74 mips_clockevent_init();
73 prom_init_secondary(); 75 prom_init_secondary();
74 76
75 /* 77 /*
@@ -95,6 +97,8 @@ struct call_data_struct *call_data;
95 97
96/* 98/*
97 * Run a function on all other CPUs. 99 * Run a function on all other CPUs.
100 *
101 * <mask> cpuset_t of all processors to run the function on.
98 * <func> The function to run. This must be fast and non-blocking. 102 * <func> The function to run. This must be fast and non-blocking.
99 * <info> An arbitrary pointer to pass to the function. 103 * <info> An arbitrary pointer to pass to the function.
100 * <retry> If true, keep retrying until ready. 104 * <retry> If true, keep retrying until ready.
@@ -119,18 +123,20 @@ struct call_data_struct *call_data;
119 * Spin waiting for call_lock 123 * Spin waiting for call_lock
120 * Deadlock Deadlock 124 * Deadlock Deadlock
121 */ 125 */
122int smp_call_function (void (*func) (void *info), void *info, int retry, 126int smp_call_function_mask(cpumask_t mask, void (*func) (void *info),
123 int wait) 127 void *info, int retry, int wait)
124{ 128{
125 struct call_data_struct data; 129 struct call_data_struct data;
126 int i, cpus = num_online_cpus() - 1;
127 int cpu = smp_processor_id(); 130 int cpu = smp_processor_id();
131 int cpus;
128 132
129 /* 133 /*
130 * Can die spectacularly if this CPU isn't yet marked online 134 * Can die spectacularly if this CPU isn't yet marked online
131 */ 135 */
132 BUG_ON(!cpu_online(cpu)); 136 BUG_ON(!cpu_online(cpu));
133 137
138 cpu_clear(cpu, mask);
139 cpus = cpus_weight(mask);
134 if (!cpus) 140 if (!cpus)
135 return 0; 141 return 0;
136 142
@@ -149,9 +155,7 @@ int smp_call_function (void (*func) (void *info), void *info, int retry,
149 smp_mb(); 155 smp_mb();
150 156
151 /* Send a message to all other CPUs and wait for them to respond */ 157 /* Send a message to all other CPUs and wait for them to respond */
152 for_each_online_cpu(i) 158 core_send_ipi_mask(mask, SMP_CALL_FUNCTION);
153 if (i != cpu)
154 core_send_ipi(i, SMP_CALL_FUNCTION);
155 159
156 /* Wait for response */ 160 /* Wait for response */
157 /* FIXME: lock-up detection, backtrace on lock-up */ 161 /* FIXME: lock-up detection, backtrace on lock-up */
@@ -167,6 +171,11 @@ int smp_call_function (void (*func) (void *info), void *info, int retry,
167 return 0; 171 return 0;
168} 172}
169 173
174int smp_call_function(void (*func) (void *info), void *info, int retry,
175 int wait)
176{
177 return smp_call_function_mask(cpu_online_map, func, info, retry, wait);
178}
170 179
171void smp_call_function_interrupt(void) 180void smp_call_function_interrupt(void)
172{ 181{
@@ -197,8 +206,7 @@ void smp_call_function_interrupt(void)
197int smp_call_function_single(int cpu, void (*func) (void *info), void *info, 206int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
198 int retry, int wait) 207 int retry, int wait)
199{ 208{
200 struct call_data_struct data; 209 int ret, me;
201 int me;
202 210
203 /* 211 /*
204 * Can die spectacularly if this CPU isn't yet marked online 212 * Can die spectacularly if this CPU isn't yet marked online
@@ -217,33 +225,8 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
217 return 0; 225 return 0;
218 } 226 }
219 227
220 /* Can deadlock when called with interrupts disabled */ 228 ret = smp_call_function_mask(cpumask_of_cpu(cpu), func, info, retry,
221 WARN_ON(irqs_disabled()); 229 wait);
222
223 data.func = func;
224 data.info = info;
225 atomic_set(&data.started, 0);
226 data.wait = wait;
227 if (wait)
228 atomic_set(&data.finished, 0);
229
230 spin_lock(&smp_call_lock);
231 call_data = &data;
232 smp_mb();
233
234 /* Send a message to the other CPU */
235 core_send_ipi(cpu, SMP_CALL_FUNCTION);
236
237 /* Wait for response */
238 /* FIXME: lock-up detection, backtrace on lock-up */
239 while (atomic_read(&data.started) != 1)
240 barrier();
241
242 if (wait)
243 while (atomic_read(&data.finished) != 1)
244 barrier();
245 call_data = NULL;
246 spin_unlock(&smp_call_lock);
247 230
248 put_cpu(); 231 put_cpu();
249 return 0; 232 return 0;
@@ -390,12 +373,15 @@ void flush_tlb_mm(struct mm_struct *mm)
390 preempt_disable(); 373 preempt_disable();
391 374
392 if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) { 375 if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) {
393 smp_on_other_tlbs(flush_tlb_mm_ipi, (void *)mm); 376 smp_on_other_tlbs(flush_tlb_mm_ipi, mm);
394 } else { 377 } else {
395 int i; 378 cpumask_t mask = cpu_online_map;
396 for (i = 0; i < num_online_cpus(); i++) 379 unsigned int cpu;
397 if (smp_processor_id() != i) 380
398 cpu_context(i, mm) = 0; 381 cpu_clear(smp_processor_id(), mask);
382 for_each_online_cpu(cpu)
383 if (cpu_context(cpu, mm))
384 cpu_context(cpu, mm) = 0;
399 } 385 }
400 local_flush_tlb_mm(mm); 386 local_flush_tlb_mm(mm);
401 387
@@ -410,7 +396,7 @@ struct flush_tlb_data {
410 396
411static void flush_tlb_range_ipi(void *info) 397static void flush_tlb_range_ipi(void *info)
412{ 398{
413 struct flush_tlb_data *fd = (struct flush_tlb_data *)info; 399 struct flush_tlb_data *fd = info;
414 400
415 local_flush_tlb_range(fd->vma, fd->addr1, fd->addr2); 401 local_flush_tlb_range(fd->vma, fd->addr1, fd->addr2);
416} 402}
@@ -421,17 +407,21 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned l
421 407
422 preempt_disable(); 408 preempt_disable();
423 if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) { 409 if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) {
424 struct flush_tlb_data fd; 410 struct flush_tlb_data fd = {
411 .vma = vma,
412 .addr1 = start,
413 .addr2 = end,
414 };
425 415
426 fd.vma = vma; 416 smp_on_other_tlbs(flush_tlb_range_ipi, &fd);
427 fd.addr1 = start;
428 fd.addr2 = end;
429 smp_on_other_tlbs(flush_tlb_range_ipi, (void *)&fd);
430 } else { 417 } else {
431 int i; 418 cpumask_t mask = cpu_online_map;
432 for (i = 0; i < num_online_cpus(); i++) 419 unsigned int cpu;
433 if (smp_processor_id() != i) 420
434 cpu_context(i, mm) = 0; 421 cpu_clear(smp_processor_id(), mask);
422 for_each_online_cpu(cpu)
423 if (cpu_context(cpu, mm))
424 cpu_context(cpu, mm) = 0;
435 } 425 }
436 local_flush_tlb_range(vma, start, end); 426 local_flush_tlb_range(vma, start, end);
437 preempt_enable(); 427 preempt_enable();
@@ -439,23 +429,24 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned l
439 429
440static void flush_tlb_kernel_range_ipi(void *info) 430static void flush_tlb_kernel_range_ipi(void *info)
441{ 431{
442 struct flush_tlb_data *fd = (struct flush_tlb_data *)info; 432 struct flush_tlb_data *fd = info;
443 433
444 local_flush_tlb_kernel_range(fd->addr1, fd->addr2); 434 local_flush_tlb_kernel_range(fd->addr1, fd->addr2);
445} 435}
446 436
447void flush_tlb_kernel_range(unsigned long start, unsigned long end) 437void flush_tlb_kernel_range(unsigned long start, unsigned long end)
448{ 438{
449 struct flush_tlb_data fd; 439 struct flush_tlb_data fd = {
440 .addr1 = start,
441 .addr2 = end,
442 };
450 443
451 fd.addr1 = start; 444 on_each_cpu(flush_tlb_kernel_range_ipi, &fd, 1, 1);
452 fd.addr2 = end;
453 on_each_cpu(flush_tlb_kernel_range_ipi, (void *)&fd, 1, 1);
454} 445}
455 446
456static void flush_tlb_page_ipi(void *info) 447static void flush_tlb_page_ipi(void *info)
457{ 448{
458 struct flush_tlb_data *fd = (struct flush_tlb_data *)info; 449 struct flush_tlb_data *fd = info;
459 450
460 local_flush_tlb_page(fd->vma, fd->addr1); 451 local_flush_tlb_page(fd->vma, fd->addr1);
461} 452}
@@ -464,16 +455,20 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
464{ 455{
465 preempt_disable(); 456 preempt_disable();
466 if ((atomic_read(&vma->vm_mm->mm_users) != 1) || (current->mm != vma->vm_mm)) { 457 if ((atomic_read(&vma->vm_mm->mm_users) != 1) || (current->mm != vma->vm_mm)) {
467 struct flush_tlb_data fd; 458 struct flush_tlb_data fd = {
459 .vma = vma,
460 .addr1 = page,
461 };
468 462
469 fd.vma = vma; 463 smp_on_other_tlbs(flush_tlb_page_ipi, &fd);
470 fd.addr1 = page;
471 smp_on_other_tlbs(flush_tlb_page_ipi, (void *)&fd);
472 } else { 464 } else {
473 int i; 465 cpumask_t mask = cpu_online_map;
474 for (i = 0; i < num_online_cpus(); i++) 466 unsigned int cpu;
475 if (smp_processor_id() != i) 467
476 cpu_context(i, vma->vm_mm) = 0; 468 cpu_clear(smp_processor_id(), mask);
469 for_each_online_cpu(cpu)
470 if (cpu_context(cpu, vma->vm_mm))
471 cpu_context(cpu, vma->vm_mm) = 0;
477 } 472 }
478 local_flush_tlb_page(vma, page); 473 local_flush_tlb_page(vma, page);
479 preempt_enable(); 474 preempt_enable();
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index f09404377ef1..a8c1a698d588 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -1,5 +1,6 @@
1/* Copyright (C) 2004 Mips Technologies, Inc */ 1/* Copyright (C) 2004 Mips Technologies, Inc */
2 2
3#include <linux/clockchips.h>
3#include <linux/kernel.h> 4#include <linux/kernel.h>
4#include <linux/sched.h> 5#include <linux/sched.h>
5#include <linux/cpumask.h> 6#include <linux/cpumask.h>
@@ -62,7 +63,7 @@ asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
62 * Clock interrupt "latch" buffers, per "CPU" 63 * Clock interrupt "latch" buffers, per "CPU"
63 */ 64 */
64 65
65unsigned int ipi_timer_latch[NR_CPUS]; 66static atomic_t ipi_timer_latch[NR_CPUS];
66 67
67/* 68/*
68 * Number of InterProcessor Interupt (IPI) message buffers to allocate 69 * Number of InterProcessor Interupt (IPI) message buffers to allocate
@@ -179,7 +180,7 @@ void __init sanitize_tlb_entries(void)
179 180
180static void smtc_configure_tlb(void) 181static void smtc_configure_tlb(void)
181{ 182{
182 int i,tlbsiz,vpes; 183 int i, tlbsiz, vpes;
183 unsigned long mvpconf0; 184 unsigned long mvpconf0;
184 unsigned long config1val; 185 unsigned long config1val;
185 186
@@ -296,8 +297,10 @@ int __init mipsmt_build_cpu_map(int start_cpu_slot)
296 __cpu_number_map[i] = i; 297 __cpu_number_map[i] = i;
297 __cpu_logical_map[i] = i; 298 __cpu_logical_map[i] = i;
298 } 299 }
300#ifdef CONFIG_MIPS_MT_FPAFF
299 /* Initialize map of CPUs with FPUs */ 301 /* Initialize map of CPUs with FPUs */
300 cpus_clear(mt_fpu_cpumask); 302 cpus_clear(mt_fpu_cpumask);
303#endif
301 304
302 /* One of those TC's is the one booting, and not a secondary... */ 305 /* One of those TC's is the one booting, and not a secondary... */
303 printk("%i available secondary CPU TC(s)\n", i - 1); 306 printk("%i available secondary CPU TC(s)\n", i - 1);
@@ -359,7 +362,7 @@ void mipsmt_prepare_cpus(void)
359 IPIQ[i].head = IPIQ[i].tail = NULL; 362 IPIQ[i].head = IPIQ[i].tail = NULL;
360 spin_lock_init(&IPIQ[i].lock); 363 spin_lock_init(&IPIQ[i].lock);
361 IPIQ[i].depth = 0; 364 IPIQ[i].depth = 0;
362 ipi_timer_latch[i] = 0; 365 atomic_set(&ipi_timer_latch[i], 0);
363 } 366 }
364 367
365 /* cpu_data index starts at zero */ 368 /* cpu_data index starts at zero */
@@ -369,7 +372,7 @@ void mipsmt_prepare_cpus(void)
369 cpu++; 372 cpu++;
370 373
371 /* Report on boot-time options */ 374 /* Report on boot-time options */
372 mips_mt_set_cpuoptions (); 375 mips_mt_set_cpuoptions();
373 if (vpelimit > 0) 376 if (vpelimit > 0)
374 printk("Limit of %d VPEs set\n", vpelimit); 377 printk("Limit of %d VPEs set\n", vpelimit);
375 if (tclimit > 0) 378 if (tclimit > 0)
@@ -420,7 +423,7 @@ void mipsmt_prepare_cpus(void)
420 * code. Leave it alone! 423 * code. Leave it alone!
421 */ 424 */
422 if (tc != 0) { 425 if (tc != 0) {
423 smtc_tc_setup(vpe,tc, cpu); 426 smtc_tc_setup(vpe, tc, cpu);
424 cpu++; 427 cpu++;
425 } 428 }
426 printk(" %d", tc); 429 printk(" %d", tc);
@@ -428,7 +431,7 @@ void mipsmt_prepare_cpus(void)
428 } 431 }
429 if (slop) { 432 if (slop) {
430 if (tc != 0) { 433 if (tc != 0) {
431 smtc_tc_setup(vpe,tc, cpu); 434 smtc_tc_setup(vpe, tc, cpu);
432 cpu++; 435 cpu++;
433 } 436 }
434 printk(" %d", tc); 437 printk(" %d", tc);
@@ -482,10 +485,12 @@ void mipsmt_prepare_cpus(void)
482 485
483 /* Set up coprocessor affinity CPU mask(s) */ 486 /* Set up coprocessor affinity CPU mask(s) */
484 487
488#ifdef CONFIG_MIPS_MT_FPAFF
485 for (tc = 0; tc < ntc; tc++) { 489 for (tc = 0; tc < ntc; tc++) {
486 if (cpu_data[tc].options & MIPS_CPU_FPU) 490 if (cpu_data[tc].options & MIPS_CPU_FPU)
487 cpu_set(tc, mt_fpu_cpumask); 491 cpu_set(tc, mt_fpu_cpumask);
488 } 492 }
493#endif
489 494
490 /* set up ipi interrupts... */ 495 /* set up ipi interrupts... */
491 496
@@ -567,7 +572,7 @@ void smtc_init_secondary(void)
567 if (((read_c0_tcbind() & TCBIND_CURTC) != 0) && 572 if (((read_c0_tcbind() & TCBIND_CURTC) != 0) &&
568 ((read_c0_tcbind() & TCBIND_CURVPE) 573 ((read_c0_tcbind() & TCBIND_CURVPE)
569 != cpu_data[smp_processor_id() - 1].vpe_id)){ 574 != cpu_data[smp_processor_id() - 1].vpe_id)){
570 write_c0_compare (read_c0_count() + mips_hpt_frequency/HZ); 575 write_c0_compare(read_c0_count() + mips_hpt_frequency/HZ);
571 } 576 }
572 577
573 local_irq_enable(); 578 local_irq_enable();
@@ -606,6 +611,60 @@ int setup_irq_smtc(unsigned int irq, struct irqaction * new,
606 return setup_irq(irq, new); 611 return setup_irq(irq, new);
607} 612}
608 613
614#ifdef CONFIG_MIPS_MT_SMTC_IRQAFF
615/*
616 * Support for IRQ affinity to TCs
617 */
618
619void smtc_set_irq_affinity(unsigned int irq, cpumask_t affinity)
620{
621 /*
622 * If a "fast path" cache of quickly decodable affinity state
623 * is maintained, this is where it gets done, on a call up
624 * from the platform affinity code.
625 */
626}
627
628void smtc_forward_irq(unsigned int irq)
629{
630 int target;
631
632 /*
633 * OK wise guy, now figure out how to get the IRQ
634 * to be serviced on an authorized "CPU".
635 *
636 * Ideally, to handle the situation where an IRQ has multiple
637 * eligible CPUS, we would maintain state per IRQ that would
638 * allow a fair distribution of service requests. Since the
639 * expected use model is any-or-only-one, for simplicity
640 * and efficiency, we just pick the easiest one to find.
641 */
642
643 target = first_cpu(irq_desc[irq].affinity);
644
645 /*
646 * We depend on the platform code to have correctly processed
647 * IRQ affinity change requests to ensure that the IRQ affinity
648 * mask has been purged of bits corresponding to nonexistent and
649 * offline "CPUs", and to TCs bound to VPEs other than the VPE
650 * connected to the physical interrupt input for the interrupt
651 * in question. Otherwise we have a nasty problem with interrupt
652 * mask management. This is best handled in non-performance-critical
653 * platform IRQ affinity setting code, to minimize interrupt-time
654 * checks.
655 */
656
657 /* If no one is eligible, service locally */
658 if (target >= NR_CPUS) {
659 do_IRQ_no_affinity(irq);
660 return;
661 }
662
663 smtc_send_ipi(target, IRQ_AFFINITY_IPI, irq);
664}
665
666#endif /* CONFIG_MIPS_MT_SMTC_IRQAFF */
667
609/* 668/*
610 * IPI model for SMTC is tricky, because interrupts aren't TC-specific. 669 * IPI model for SMTC is tricky, because interrupts aren't TC-specific.
611 * Within a VPE one TC can interrupt another by different approaches. 670 * Within a VPE one TC can interrupt another by different approaches.
@@ -648,7 +707,7 @@ static void smtc_ipi_qdump(void)
648 * be done with the atomic.h primitives). And since this is 707 * be done with the atomic.h primitives). And since this is
649 * MIPS MT, we can assume that we have LL/SC. 708 * MIPS MT, we can assume that we have LL/SC.
650 */ 709 */
651static __inline__ int atomic_postincrement(unsigned int *pv) 710static inline int atomic_postincrement(atomic_t *v)
652{ 711{
653 unsigned long result; 712 unsigned long result;
654 713
@@ -659,9 +718,9 @@ static __inline__ int atomic_postincrement(unsigned int *pv)
659 " addu %1, %0, 1 \n" 718 " addu %1, %0, 1 \n"
660 " sc %1, %2 \n" 719 " sc %1, %2 \n"
661 " beqz %1, 1b \n" 720 " beqz %1, 1b \n"
662 " sync \n" 721 __WEAK_LLSC_MB
663 : "=&r" (result), "=&r" (temp), "=m" (*pv) 722 : "=&r" (result), "=&r" (temp), "=m" (v->counter)
664 : "m" (*pv) 723 : "m" (v->counter)
665 : "memory"); 724 : "memory");
666 725
667 return result; 726 return result;
@@ -689,6 +748,8 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
689 pipi->arg = (void *)action; 748 pipi->arg = (void *)action;
690 pipi->dest = cpu; 749 pipi->dest = cpu;
691 if (cpu_data[cpu].vpe_id != cpu_data[smp_processor_id()].vpe_id) { 750 if (cpu_data[cpu].vpe_id != cpu_data[smp_processor_id()].vpe_id) {
751 if (type == SMTC_CLOCK_TICK)
752 atomic_inc(&ipi_timer_latch[cpu]);
692 /* If not on same VPE, enqueue and send cross-VPE interupt */ 753 /* If not on same VPE, enqueue and send cross-VPE interupt */
693 smtc_ipi_nq(&IPIQ[cpu], pipi); 754 smtc_ipi_nq(&IPIQ[cpu], pipi);
694 LOCK_CORE_PRA(); 755 LOCK_CORE_PRA();
@@ -730,6 +791,8 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
730 } 791 }
731 smtc_ipi_nq(&IPIQ[cpu], pipi); 792 smtc_ipi_nq(&IPIQ[cpu], pipi);
732 } else { 793 } else {
794 if (type == SMTC_CLOCK_TICK)
795 atomic_inc(&ipi_timer_latch[cpu]);
733 post_direct_ipi(cpu, pipi); 796 post_direct_ipi(cpu, pipi);
734 write_tc_c0_tchalt(0); 797 write_tc_c0_tchalt(0);
735 UNLOCK_CORE_PRA(); 798 UNLOCK_CORE_PRA();
@@ -747,6 +810,7 @@ static void post_direct_ipi(int cpu, struct smtc_ipi *pipi)
747 unsigned long tcrestart; 810 unsigned long tcrestart;
748 extern u32 kernelsp[NR_CPUS]; 811 extern u32 kernelsp[NR_CPUS];
749 extern void __smtc_ipi_vector(void); 812 extern void __smtc_ipi_vector(void);
813//printk("%s: on %d for %d\n", __func__, smp_processor_id(), cpu);
750 814
751 /* Extract Status, EPC from halted TC */ 815 /* Extract Status, EPC from halted TC */
752 tcstatus = read_tc_c0_tcstatus(); 816 tcstatus = read_tc_c0_tcstatus();
@@ -797,25 +861,31 @@ static void ipi_call_interrupt(void)
797 smp_call_function_interrupt(); 861 smp_call_function_interrupt();
798} 862}
799 863
864DECLARE_PER_CPU(struct clock_event_device, smtc_dummy_clockevent_device);
865
800void ipi_decode(struct smtc_ipi *pipi) 866void ipi_decode(struct smtc_ipi *pipi)
801{ 867{
868 unsigned int cpu = smp_processor_id();
869 struct clock_event_device *cd;
802 void *arg_copy = pipi->arg; 870 void *arg_copy = pipi->arg;
803 int type_copy = pipi->type; 871 int type_copy = pipi->type;
804 int dest_copy = pipi->dest; 872 int ticks;
805 873
806 smtc_ipi_nq(&freeIPIq, pipi); 874 smtc_ipi_nq(&freeIPIq, pipi);
807 switch (type_copy) { 875 switch (type_copy) {
808 case SMTC_CLOCK_TICK: 876 case SMTC_CLOCK_TICK:
809 irq_enter(); 877 irq_enter();
810 kstat_this_cpu.irqs[MIPS_CPU_IRQ_BASE + cp0_compare_irq]++; 878 kstat_this_cpu.irqs[MIPS_CPU_IRQ_BASE + 1]++;
811 /* Invoke Clock "Interrupt" */ 879 cd = &per_cpu(smtc_dummy_clockevent_device, cpu);
812 ipi_timer_latch[dest_copy] = 0; 880 ticks = atomic_read(&ipi_timer_latch[cpu]);
813#ifdef CONFIG_SMTC_IDLE_HOOK_DEBUG 881 atomic_sub(ticks, &ipi_timer_latch[cpu]);
814 clock_hang_reported[dest_copy] = 0; 882 while (ticks) {
815#endif /* CONFIG_SMTC_IDLE_HOOK_DEBUG */ 883 cd->event_handler(cd);
816 local_timer_interrupt(0, NULL); 884 ticks--;
885 }
817 irq_exit(); 886 irq_exit();
818 break; 887 break;
888
819 case LINUX_SMP_IPI: 889 case LINUX_SMP_IPI:
820 switch ((int)arg_copy) { 890 switch ((int)arg_copy) {
821 case SMP_RESCHEDULE_YOURSELF: 891 case SMP_RESCHEDULE_YOURSELF:
@@ -830,6 +900,15 @@ void ipi_decode(struct smtc_ipi *pipi)
830 break; 900 break;
831 } 901 }
832 break; 902 break;
903#ifdef CONFIG_MIPS_MT_SMTC_IRQAFF
904 case IRQ_AFFINITY_IPI:
905 /*
906 * Accept a "forwarded" interrupt that was initially
907 * taken by a TC who doesn't have affinity for the IRQ.
908 */
909 do_IRQ_no_affinity((int)arg_copy);
910 break;
911#endif /* CONFIG_MIPS_MT_SMTC_IRQAFF */
833 default: 912 default:
834 printk("Impossible SMTC IPI Type 0x%x\n", type_copy); 913 printk("Impossible SMTC IPI Type 0x%x\n", type_copy);
835 break; 914 break;
@@ -858,25 +937,6 @@ void deferred_smtc_ipi(void)
858} 937}
859 938
860/* 939/*
861 * Send clock tick to all TCs except the one executing the funtion
862 */
863
864void smtc_timer_broadcast(void)
865{
866 int cpu;
867 int myTC = cpu_data[smp_processor_id()].tc_id;
868 int myVPE = cpu_data[smp_processor_id()].vpe_id;
869
870 smtc_cpu_stats[smp_processor_id()].timerints++;
871
872 for_each_online_cpu(cpu) {
873 if (cpu_data[cpu].vpe_id == myVPE &&
874 cpu_data[cpu].tc_id != myTC)
875 smtc_send_ipi(cpu, SMTC_CLOCK_TICK, 0);
876 }
877}
878
879/*
880 * Cross-VPE interrupts in the SMTC prototype use "software interrupts" 940 * Cross-VPE interrupts in the SMTC prototype use "software interrupts"
881 * set via cross-VPE MTTR manipulation of the Cause register. It would be 941 * set via cross-VPE MTTR manipulation of the Cause register. It would be
882 * in some regards preferable to have external logic for "doorbell" hardware 942 * in some regards preferable to have external logic for "doorbell" hardware
@@ -1117,11 +1177,11 @@ void smtc_idle_loop_hook(void)
1117 for (tc = 0; tc < NR_CPUS; tc++) { 1177 for (tc = 0; tc < NR_CPUS; tc++) {
1118 /* Don't check ourself - we'll dequeue IPIs just below */ 1178 /* Don't check ourself - we'll dequeue IPIs just below */
1119 if ((tc != smp_processor_id()) && 1179 if ((tc != smp_processor_id()) &&
1120 ipi_timer_latch[tc] > timerq_limit) { 1180 atomic_read(&ipi_timer_latch[tc]) > timerq_limit) {
1121 if (clock_hang_reported[tc] == 0) { 1181 if (clock_hang_reported[tc] == 0) {
1122 pdb_msg += sprintf(pdb_msg, 1182 pdb_msg += sprintf(pdb_msg,
1123 "TC %d looks hung with timer latch at %d\n", 1183 "TC %d looks hung with timer latch at %d\n",
1124 tc, ipi_timer_latch[tc]); 1184 tc, atomic_read(&ipi_timer_latch[tc]));
1125 clock_hang_reported[tc]++; 1185 clock_hang_reported[tc]++;
1126 } 1186 }
1127 } 1187 }
@@ -1162,7 +1222,7 @@ void smtc_soft_dump(void)
1162 smtc_ipi_qdump(); 1222 smtc_ipi_qdump();
1163 printk("Timer IPI Backlogs:\n"); 1223 printk("Timer IPI Backlogs:\n");
1164 for (i=0; i < NR_CPUS; i++) { 1224 for (i=0; i < NR_CPUS; i++) {
1165 printk("%d: %d\n", i, ipi_timer_latch[i]); 1225 printk("%d: %d\n", i, atomic_read(&ipi_timer_latch[i]));
1166 } 1226 }
1167 printk("%d Recoveries of \"stolen\" FPU\n", 1227 printk("%d Recoveries of \"stolen\" FPU\n",
1168 atomic_read(&smtc_fpu_recoveries)); 1228 atomic_read(&smtc_fpu_recoveries));
@@ -1204,7 +1264,7 @@ void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
1204 if (cpu_has_vtag_icache) 1264 if (cpu_has_vtag_icache)
1205 flush_icache_all(); 1265 flush_icache_all();
1206 /* Traverse all online CPUs (hack requires contigous range) */ 1266 /* Traverse all online CPUs (hack requires contigous range) */
1207 for (i = 0; i < num_online_cpus(); i++) { 1267 for_each_online_cpu(i) {
1208 /* 1268 /*
1209 * We don't need to worry about our own CPU, nor those of 1269 * We don't need to worry about our own CPU, nor those of
1210 * CPUs who don't share our TLB. 1270 * CPUs who don't share our TLB.
@@ -1233,7 +1293,7 @@ void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
1233 /* 1293 /*
1234 * SMTC shares the TLB within VPEs and possibly across all VPEs. 1294 * SMTC shares the TLB within VPEs and possibly across all VPEs.
1235 */ 1295 */
1236 for (i = 0; i < num_online_cpus(); i++) { 1296 for_each_online_cpu(i) {
1237 if ((smtc_status & SMTC_TLB_SHARED) || 1297 if ((smtc_status & SMTC_TLB_SHARED) ||
1238 (cpu_data[i].vpe_id == cpu_data[cpu].vpe_id)) 1298 (cpu_data[i].vpe_id == cpu_data[cpu].vpe_id))
1239 cpu_context(i, mm) = asid_cache(i) = asid; 1299 cpu_context(i, mm) = asid_cache(i) = asid;
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 7c800ec3ff55..17c4374d2209 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -245,7 +245,7 @@ asmlinkage int sys_olduname(struct oldold_utsname __user * name)
245 245
246 if (!name) 246 if (!name)
247 return -EFAULT; 247 return -EFAULT;
248 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) 248 if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname)))
249 return -EFAULT; 249 return -EFAULT;
250 250
251 error = __copy_to_user(&name->sysname, &utsname()->sysname, 251 error = __copy_to_user(&name->sysname, &utsname()->sysname,
@@ -314,8 +314,8 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
314 * 314 *
315 * This is really horribly ugly. 315 * This is really horribly ugly.
316 */ 316 */
317asmlinkage int sys_ipc (unsigned int call, int first, int second, 317asmlinkage int sys_ipc(unsigned int call, int first, int second,
318 unsigned long third, void __user *ptr, long fifth) 318 unsigned long third, void __user *ptr, long fifth)
319{ 319{
320 int version, ret; 320 int version, ret;
321 321
@@ -324,26 +324,26 @@ asmlinkage int sys_ipc (unsigned int call, int first, int second,
324 324
325 switch (call) { 325 switch (call) {
326 case SEMOP: 326 case SEMOP:
327 return sys_semtimedop (first, (struct sembuf __user *)ptr, 327 return sys_semtimedop(first, (struct sembuf __user *)ptr,
328 second, NULL); 328 second, NULL);
329 case SEMTIMEDOP: 329 case SEMTIMEDOP:
330 return sys_semtimedop (first, (struct sembuf __user *)ptr, 330 return sys_semtimedop(first, (struct sembuf __user *)ptr,
331 second, 331 second,
332 (const struct timespec __user *)fifth); 332 (const struct timespec __user *)fifth);
333 case SEMGET: 333 case SEMGET:
334 return sys_semget (first, second, third); 334 return sys_semget(first, second, third);
335 case SEMCTL: { 335 case SEMCTL: {
336 union semun fourth; 336 union semun fourth;
337 if (!ptr) 337 if (!ptr)
338 return -EINVAL; 338 return -EINVAL;
339 if (get_user(fourth.__pad, (void __user *__user *) ptr)) 339 if (get_user(fourth.__pad, (void __user *__user *) ptr))
340 return -EFAULT; 340 return -EFAULT;
341 return sys_semctl (first, second, third, fourth); 341 return sys_semctl(first, second, third, fourth);
342 } 342 }
343 343
344 case MSGSND: 344 case MSGSND:
345 return sys_msgsnd (first, (struct msgbuf __user *) ptr, 345 return sys_msgsnd(first, (struct msgbuf __user *) ptr,
346 second, third); 346 second, third);
347 case MSGRCV: 347 case MSGRCV:
348 switch (version) { 348 switch (version) {
349 case 0: { 349 case 0: {
@@ -353,45 +353,45 @@ asmlinkage int sys_ipc (unsigned int call, int first, int second,
353 353
354 if (copy_from_user(&tmp, 354 if (copy_from_user(&tmp,
355 (struct ipc_kludge __user *) ptr, 355 (struct ipc_kludge __user *) ptr,
356 sizeof (tmp))) 356 sizeof(tmp)))
357 return -EFAULT; 357 return -EFAULT;
358 return sys_msgrcv (first, tmp.msgp, second, 358 return sys_msgrcv(first, tmp.msgp, second,
359 tmp.msgtyp, third); 359 tmp.msgtyp, third);
360 } 360 }
361 default: 361 default:
362 return sys_msgrcv (first, 362 return sys_msgrcv(first,
363 (struct msgbuf __user *) ptr, 363 (struct msgbuf __user *) ptr,
364 second, fifth, third); 364 second, fifth, third);
365 } 365 }
366 case MSGGET: 366 case MSGGET:
367 return sys_msgget ((key_t) first, second); 367 return sys_msgget((key_t) first, second);
368 case MSGCTL: 368 case MSGCTL:
369 return sys_msgctl (first, second, 369 return sys_msgctl(first, second,
370 (struct msqid_ds __user *) ptr); 370 (struct msqid_ds __user *) ptr);
371 371
372 case SHMAT: 372 case SHMAT:
373 switch (version) { 373 switch (version) {
374 default: { 374 default: {
375 unsigned long raddr; 375 unsigned long raddr;
376 ret = do_shmat (first, (char __user *) ptr, second, 376 ret = do_shmat(first, (char __user *) ptr, second,
377 &raddr); 377 &raddr);
378 if (ret) 378 if (ret)
379 return ret; 379 return ret;
380 return put_user (raddr, (unsigned long __user *) third); 380 return put_user(raddr, (unsigned long __user *) third);
381 } 381 }
382 case 1: /* iBCS2 emulator entry point */ 382 case 1: /* iBCS2 emulator entry point */
383 if (!segment_eq(get_fs(), get_ds())) 383 if (!segment_eq(get_fs(), get_ds()))
384 return -EINVAL; 384 return -EINVAL;
385 return do_shmat (first, (char __user *) ptr, second, 385 return do_shmat(first, (char __user *) ptr, second,
386 (unsigned long *) third); 386 (unsigned long *) third);
387 } 387 }
388 case SHMDT: 388 case SHMDT:
389 return sys_shmdt ((char __user *)ptr); 389 return sys_shmdt((char __user *)ptr);
390 case SHMGET: 390 case SHMGET:
391 return sys_shmget (first, second, third); 391 return sys_shmget(first, second, third);
392 case SHMCTL: 392 case SHMCTL:
393 return sys_shmctl (first, second, 393 return sys_shmctl(first, second,
394 (struct shmid_ds __user *) ptr); 394 (struct shmid_ds __user *) ptr);
395 default: 395 default:
396 return -ENOSYS; 396 return -ENOSYS;
397 } 397 }
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c
index 93a148486f88..ee7790d9debe 100644
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -486,10 +486,10 @@ asmlinkage int irix_syssgi(struct pt_regs *regs)
486 486
487 switch (arg1) { 487 switch (arg1) {
488 case SGI_INV_SIZEOF: 488 case SGI_INV_SIZEOF:
489 retval = sizeof (inventory_t); 489 retval = sizeof(inventory_t);
490 break; 490 break;
491 case SGI_INV_READ: 491 case SGI_INV_READ:
492 retval = dump_inventory_to_user (buffer, count); 492 retval = dump_inventory_to_user(buffer, count);
493 break; 493 break;
494 default: 494 default:
495 retval = -EINVAL; 495 retval = -EINVAL;
@@ -778,7 +778,7 @@ asmlinkage int irix_times(struct tms __user *tbuf)
778 int err = 0; 778 int err = 0;
779 779
780 if (tbuf) { 780 if (tbuf) {
781 if (!access_ok(VERIFY_WRITE,tbuf,sizeof *tbuf)) 781 if (!access_ok(VERIFY_WRITE, tbuf, sizeof *tbuf))
782 return -EFAULT; 782 return -EFAULT;
783 783
784 err = __put_user(current->utime, &tbuf->tms_utime); 784 err = __put_user(current->utime, &tbuf->tms_utime);
@@ -1042,9 +1042,9 @@ asmlinkage unsigned long irix_mmap32(unsigned long addr, size_t len, int prot,
1042 long max_size = offset + len; 1042 long max_size = offset + len;
1043 1043
1044 if (max_size > file->f_path.dentry->d_inode->i_size) { 1044 if (max_size > file->f_path.dentry->d_inode->i_size) {
1045 old_pos = sys_lseek (fd, max_size - 1, 0); 1045 old_pos = sys_lseek(fd, max_size - 1, 0);
1046 sys_write (fd, (void __user *) "", 1); 1046 sys_write(fd, (void __user *) "", 1);
1047 sys_lseek (fd, old_pos, 0); 1047 sys_lseek(fd, old_pos, 0);
1048 } 1048 }
1049 } 1049 }
1050 } 1050 }
@@ -1176,7 +1176,7 @@ static int irix_xstat32_xlate(struct kstat *stat, void __user *ubuf)
1176 ub.st_ctime1 = stat->atime.tv_nsec; 1176 ub.st_ctime1 = stat->atime.tv_nsec;
1177 ub.st_blksize = stat->blksize; 1177 ub.st_blksize = stat->blksize;
1178 ub.st_blocks = stat->blocks; 1178 ub.st_blocks = stat->blocks;
1179 strcpy (ub.st_fstype, "efs"); 1179 strcpy(ub.st_fstype, "efs");
1180 1180
1181 return copy_to_user(ubuf, &ub, sizeof(ub)) ? -EFAULT : 0; 1181 return copy_to_user(ubuf, &ub, sizeof(ub)) ? -EFAULT : 0;
1182} 1182}
@@ -1208,7 +1208,7 @@ static int irix_xstat64_xlate(struct kstat *stat, void __user *ubuf)
1208 ks.st_nlink = (u32) stat->nlink; 1208 ks.st_nlink = (u32) stat->nlink;
1209 ks.st_uid = (s32) stat->uid; 1209 ks.st_uid = (s32) stat->uid;
1210 ks.st_gid = (s32) stat->gid; 1210 ks.st_gid = (s32) stat->gid;
1211 ks.st_rdev = sysv_encode_dev (stat->rdev); 1211 ks.st_rdev = sysv_encode_dev(stat->rdev);
1212 ks.st_pad2[0] = ks.st_pad2[1] = 0; 1212 ks.st_pad2[0] = ks.st_pad2[1] = 0;
1213 ks.st_size = (long long) stat->size; 1213 ks.st_size = (long long) stat->size;
1214 ks.st_pad3 = 0; 1214 ks.st_pad3 = 0;
@@ -1527,9 +1527,9 @@ asmlinkage int irix_mmap64(struct pt_regs *regs)
1527 long max_size = off2 + len; 1527 long max_size = off2 + len;
1528 1528
1529 if (max_size > file->f_path.dentry->d_inode->i_size) { 1529 if (max_size > file->f_path.dentry->d_inode->i_size) {
1530 old_pos = sys_lseek (fd, max_size - 1, 0); 1530 old_pos = sys_lseek(fd, max_size - 1, 0);
1531 sys_write (fd, (void __user *) "", 1); 1531 sys_write(fd, (void __user *) "", 1);
1532 sys_lseek (fd, old_pos, 0); 1532 sys_lseek(fd, old_pos, 0);
1533 } 1533 }
1534 } 1534 }
1535 } 1535 }
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 9a5596bf8571..5892491b40eb 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -11,6 +11,7 @@
11 * 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
12 * option) any later version. 12 * option) any later version.
13 */ 13 */
14#include <linux/clockchips.h>
14#include <linux/types.h> 15#include <linux/types.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/init.h> 17#include <linux/init.h>
@@ -24,6 +25,7 @@
24#include <linux/spinlock.h> 25#include <linux/spinlock.h>
25#include <linux/interrupt.h> 26#include <linux/interrupt.h>
26#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/kallsyms.h>
27 29
28#include <asm/bootinfo.h> 30#include <asm/bootinfo.h>
29#include <asm/cache.h> 31#include <asm/cache.h>
@@ -32,8 +34,11 @@
32#include <asm/cpu-features.h> 34#include <asm/cpu-features.h>
33#include <asm/div64.h> 35#include <asm/div64.h>
34#include <asm/sections.h> 36#include <asm/sections.h>
37#include <asm/smtc_ipi.h>
35#include <asm/time.h> 38#include <asm/time.h>
36 39
40#include <irq.h>
41
37/* 42/*
38 * The integer part of the number of usecs per jiffy is taken from tick, 43 * The integer part of the number of usecs per jiffy is taken from tick,
39 * but the fractional part is not recorded, so we calculate it using the 44 * but the fractional part is not recorded, so we calculate it using the
@@ -49,32 +54,27 @@
49 * forward reference 54 * forward reference
50 */ 55 */
51DEFINE_SPINLOCK(rtc_lock); 56DEFINE_SPINLOCK(rtc_lock);
57EXPORT_SYMBOL(rtc_lock);
52 58
53/* 59int __weak rtc_mips_set_time(unsigned long sec)
54 * By default we provide the null RTC ops
55 */
56static unsigned long null_rtc_get_time(void)
57{ 60{
58 return mktime(2000, 1, 1, 0, 0, 0); 61 return 0;
59} 62}
63EXPORT_SYMBOL(rtc_mips_set_time);
60 64
61static int null_rtc_set_time(unsigned long sec) 65int __weak rtc_mips_set_mmss(unsigned long nowtime)
62{ 66{
63 return 0; 67 return rtc_mips_set_time(nowtime);
64} 68}
65 69
66unsigned long (*rtc_mips_get_time)(void) = null_rtc_get_time; 70int update_persistent_clock(struct timespec now)
67int (*rtc_mips_set_time)(unsigned long) = null_rtc_set_time; 71{
68int (*rtc_mips_set_mmss)(unsigned long); 72 return rtc_mips_set_mmss(now.tv_sec);
69 73}
70 74
71/* how many counter cycles in a jiffy */ 75/* how many counter cycles in a jiffy */
72static unsigned long cycles_per_jiffy __read_mostly; 76static unsigned long cycles_per_jiffy __read_mostly;
73 77
74/* expirelo is the count value for next CPU timer interrupt */
75static unsigned int expirelo;
76
77
78/* 78/*
79 * Null timer ack for systems not needing one (e.g. i8254). 79 * Null timer ack for systems not needing one (e.g. i8254).
80 */ 80 */
@@ -93,18 +93,7 @@ static cycle_t null_hpt_read(void)
93 */ 93 */
94static void c0_timer_ack(void) 94static void c0_timer_ack(void)
95{ 95{
96 unsigned int count; 96 write_c0_compare(read_c0_compare());
97
98 /* Ack this timer interrupt and set the next one. */
99 expirelo += cycles_per_jiffy;
100 write_c0_compare(expirelo);
101
102 /* Check to see if we have missed any timer interrupts. */
103 while (((count = read_c0_count()) - expirelo) < 0x7fffffff) {
104 /* missed_timer_count++; */
105 expirelo = count + cycles_per_jiffy;
106 write_c0_compare(expirelo);
107 }
108} 97}
109 98
110/* 99/*
@@ -115,19 +104,9 @@ static cycle_t c0_hpt_read(void)
115 return read_c0_count(); 104 return read_c0_count();
116} 105}
117 106
118/* For use both as a high precision timer and an interrupt source. */
119static void __init c0_hpt_timer_init(void)
120{
121 expirelo = read_c0_count() + cycles_per_jiffy;
122 write_c0_compare(expirelo);
123}
124
125int (*mips_timer_state)(void); 107int (*mips_timer_state)(void);
126void (*mips_timer_ack)(void); 108void (*mips_timer_ack)(void);
127 109
128/* last time when xtime and rtc are sync'ed up */
129static long last_rtc_update;
130
131/* 110/*
132 * local_timer_interrupt() does profiling and process accounting 111 * local_timer_interrupt() does profiling and process accounting
133 * on a per-CPU basis. 112 * on a per-CPU basis.
@@ -144,60 +123,15 @@ void local_timer_interrupt(int irq, void *dev_id)
144 update_process_times(user_mode(get_irq_regs())); 123 update_process_times(user_mode(get_irq_regs()));
145} 124}
146 125
147/*
148 * High-level timer interrupt service routines. This function
149 * is set as irqaction->handler and is invoked through do_IRQ.
150 */
151irqreturn_t timer_interrupt(int irq, void *dev_id)
152{
153 write_seqlock(&xtime_lock);
154
155 mips_timer_ack();
156
157 /*
158 * call the generic timer interrupt handling
159 */
160 do_timer(1);
161
162 /*
163 * If we have an externally synchronized Linux clock, then update
164 * CMOS clock accordingly every ~11 minutes. rtc_mips_set_time() has to be
165 * called as close as possible to 500 ms before the new second starts.
166 */
167 if (ntp_synced() &&
168 xtime.tv_sec > last_rtc_update + 660 &&
169 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
170 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
171 if (rtc_mips_set_mmss(xtime.tv_sec) == 0) {
172 last_rtc_update = xtime.tv_sec;
173 } else {
174 /* do it again in 60 s */
175 last_rtc_update = xtime.tv_sec - 600;
176 }
177 }
178
179 write_sequnlock(&xtime_lock);
180
181 /*
182 * In UP mode, we call local_timer_interrupt() to do profiling
183 * and process accouting.
184 *
185 * In SMP mode, local_timer_interrupt() is invoked by appropriate
186 * low-level local timer interrupt handler.
187 */
188 local_timer_interrupt(irq, dev_id);
189
190 return IRQ_HANDLED;
191}
192
193int null_perf_irq(void) 126int null_perf_irq(void)
194{ 127{
195 return 0; 128 return 0;
196} 129}
197 130
131EXPORT_SYMBOL(null_perf_irq);
132
198int (*perf_irq)(void) = null_perf_irq; 133int (*perf_irq)(void) = null_perf_irq;
199 134
200EXPORT_SYMBOL(null_perf_irq);
201EXPORT_SYMBOL(perf_irq); 135EXPORT_SYMBOL(perf_irq);
202 136
203/* 137/*
@@ -215,7 +149,7 @@ EXPORT_SYMBOL_GPL(cp0_perfcount_irq);
215 * Possibly handle a performance counter interrupt. 149 * Possibly handle a performance counter interrupt.
216 * Return true if the timer interrupt should not be checked 150 * Return true if the timer interrupt should not be checked
217 */ 151 */
218static inline int handle_perf_irq (int r2) 152static inline int handle_perf_irq(int r2)
219{ 153{
220 /* 154 /*
221 * The performance counter overflow interrupt may be shared with the 155 * The performance counter overflow interrupt may be shared with the
@@ -229,63 +163,23 @@ static inline int handle_perf_irq (int r2)
229 !r2; 163 !r2;
230} 164}
231 165
232asmlinkage void ll_timer_interrupt(int irq)
233{
234 int r2 = cpu_has_mips_r2;
235
236 irq_enter();
237 kstat_this_cpu.irqs[irq]++;
238
239 if (handle_perf_irq(r2))
240 goto out;
241
242 if (r2 && ((read_c0_cause() & (1 << 30)) == 0))
243 goto out;
244
245 timer_interrupt(irq, NULL);
246
247out:
248 irq_exit();
249}
250
251asmlinkage void ll_local_timer_interrupt(int irq)
252{
253 irq_enter();
254 if (smp_processor_id() != 0)
255 kstat_this_cpu.irqs[irq]++;
256
257 /* we keep interrupt disabled all the time */
258 local_timer_interrupt(irq, NULL);
259
260 irq_exit();
261}
262
263/* 166/*
264 * time_init() - it does the following things. 167 * time_init() - it does the following things.
265 * 168 *
266 * 1) board_time_init() - 169 * 1) plat_time_init() -
267 * a) (optional) set up RTC routines, 170 * a) (optional) set up RTC routines,
268 * b) (optional) calibrate and set the mips_hpt_frequency 171 * b) (optional) calibrate and set the mips_hpt_frequency
269 * (only needed if you intended to use cpu counter as timer interrupt 172 * (only needed if you intended to use cpu counter as timer interrupt
270 * source) 173 * source)
271 * 2) setup xtime based on rtc_mips_get_time(). 174 * 2) calculate a couple of cached variables for later usage
272 * 3) calculate a couple of cached variables for later usage 175 * 3) plat_timer_setup() -
273 * 4) plat_timer_setup() -
274 * a) (optional) over-write any choices made above by time_init(). 176 * a) (optional) over-write any choices made above by time_init().
275 * b) machine specific code should setup the timer irqaction. 177 * b) machine specific code should setup the timer irqaction.
276 * c) enable the timer interrupt 178 * c) enable the timer interrupt
277 */ 179 */
278 180
279void (*board_time_init)(void);
280
281unsigned int mips_hpt_frequency; 181unsigned int mips_hpt_frequency;
282 182
283static struct irqaction timer_irqaction = {
284 .handler = timer_interrupt,
285 .flags = IRQF_DISABLED | IRQF_PERCPU,
286 .name = "timer",
287};
288
289static unsigned int __init calibrate_hpt(void) 183static unsigned int __init calibrate_hpt(void)
290{ 184{
291 cycle_t frequency, hpt_start, hpt_end, hpt_count, hz; 185 cycle_t frequency, hpt_start, hpt_end, hpt_count, hz;
@@ -334,6 +228,84 @@ struct clocksource clocksource_mips = {
334 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 228 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
335}; 229};
336 230
231static int mips_next_event(unsigned long delta,
232 struct clock_event_device *evt)
233{
234 unsigned int cnt;
235 int res;
236
237#ifdef CONFIG_MIPS_MT_SMTC
238 {
239 unsigned long flags, vpflags;
240 local_irq_save(flags);
241 vpflags = dvpe();
242#endif
243 cnt = read_c0_count();
244 cnt += delta;
245 write_c0_compare(cnt);
246 res = ((long)(read_c0_count() - cnt ) > 0) ? -ETIME : 0;
247#ifdef CONFIG_MIPS_MT_SMTC
248 evpe(vpflags);
249 local_irq_restore(flags);
250 }
251#endif
252 return res;
253}
254
255static void mips_set_mode(enum clock_event_mode mode,
256 struct clock_event_device *evt)
257{
258 /* Nothing to do ... */
259}
260
261static DEFINE_PER_CPU(struct clock_event_device, mips_clockevent_device);
262static int cp0_timer_irq_installed;
263
264static irqreturn_t timer_interrupt(int irq, void *dev_id)
265{
266 const int r2 = cpu_has_mips_r2;
267 struct clock_event_device *cd;
268 int cpu = smp_processor_id();
269
270 /*
271 * Suckage alert:
272 * Before R2 of the architecture there was no way to see if a
273 * performance counter interrupt was pending, so we have to run
274 * the performance counter interrupt handler anyway.
275 */
276 if (handle_perf_irq(r2))
277 goto out;
278
279 /*
280 * The same applies to performance counter interrupts. But with the
281 * above we now know that the reason we got here must be a timer
282 * interrupt. Being the paranoiacs we are we check anyway.
283 */
284 if (!r2 || (read_c0_cause() & (1 << 30))) {
285 c0_timer_ack();
286#ifdef CONFIG_MIPS_MT_SMTC
287 if (cpu_data[cpu].vpe_id)
288 goto out;
289 cpu = 0;
290#endif
291 cd = &per_cpu(mips_clockevent_device, cpu);
292 cd->event_handler(cd);
293 }
294
295out:
296 return IRQ_HANDLED;
297}
298
299static struct irqaction timer_irqaction = {
300 .handler = timer_interrupt,
301#ifdef CONFIG_MIPS_MT_SMTC
302 .flags = IRQF_DISABLED,
303#else
304 .flags = IRQF_DISABLED | IRQF_PERCPU,
305#endif
306 .name = "timer",
307};
308
337static void __init init_mips_clocksource(void) 309static void __init init_mips_clocksource(void)
338{ 310{
339 u64 temp; 311 u64 temp;
@@ -357,19 +329,127 @@ static void __init init_mips_clocksource(void)
357 clocksource_register(&clocksource_mips); 329 clocksource_register(&clocksource_mips);
358} 330}
359 331
360void __init time_init(void) 332void __init __weak plat_time_init(void)
333{
334}
335
336void __init __weak plat_timer_setup(struct irqaction *irq)
337{
338}
339
340#ifdef CONFIG_MIPS_MT_SMTC
341DEFINE_PER_CPU(struct clock_event_device, smtc_dummy_clockevent_device);
342
343static void smtc_set_mode(enum clock_event_mode mode,
344 struct clock_event_device *evt)
345{
346}
347
348int dummycnt[NR_CPUS];
349
350static void mips_broadcast(cpumask_t mask)
351{
352 unsigned int cpu;
353
354 for_each_cpu_mask(cpu, mask)
355 smtc_send_ipi(cpu, SMTC_CLOCK_TICK, 0);
356}
357
358static void setup_smtc_dummy_clockevent_device(void)
359{
360 //uint64_t mips_freq = mips_hpt_^frequency;
361 unsigned int cpu = smp_processor_id();
362 struct clock_event_device *cd;
363
364 cd = &per_cpu(smtc_dummy_clockevent_device, cpu);
365
366 cd->name = "SMTC";
367 cd->features = CLOCK_EVT_FEAT_DUMMY;
368
369 /* Calculate the min / max delta */
370 cd->mult = 0; //div_sc((unsigned long) mips_freq, NSEC_PER_SEC, 32);
371 cd->shift = 0; //32;
372 cd->max_delta_ns = 0; //clockevent_delta2ns(0x7fffffff, cd);
373 cd->min_delta_ns = 0; //clockevent_delta2ns(0x30, cd);
374
375 cd->rating = 200;
376 cd->irq = 17; //-1;
377// if (cpu)
378// cd->cpumask = CPU_MASK_ALL; // cpumask_of_cpu(cpu);
379// else
380 cd->cpumask = cpumask_of_cpu(cpu);
381
382 cd->set_mode = smtc_set_mode;
383
384 cd->broadcast = mips_broadcast;
385
386 clockevents_register_device(cd);
387}
388#endif
389
390static void mips_event_handler(struct clock_event_device *dev)
361{ 391{
362 if (board_time_init) 392}
363 board_time_init();
364 393
365 if (!rtc_mips_set_mmss) 394void __cpuinit mips_clockevent_init(void)
366 rtc_mips_set_mmss = rtc_mips_set_time; 395{
396 uint64_t mips_freq = mips_hpt_frequency;
397 unsigned int cpu = smp_processor_id();
398 struct clock_event_device *cd;
399 unsigned int irq = MIPS_CPU_IRQ_BASE + 7;
367 400
368 xtime.tv_sec = rtc_mips_get_time(); 401 if (!cpu_has_counter)
369 xtime.tv_nsec = 0; 402 return;
370 403
371 set_normalized_timespec(&wall_to_monotonic, 404#ifdef CONFIG_MIPS_MT_SMTC
372 -xtime.tv_sec, -xtime.tv_nsec); 405 setup_smtc_dummy_clockevent_device();
406
407 /*
408 * On SMTC we only register VPE0's compare interrupt as clockevent
409 * device.
410 */
411 if (cpu)
412 return;
413#endif
414
415 cd = &per_cpu(mips_clockevent_device, cpu);
416
417 cd->name = "MIPS";
418 cd->features = CLOCK_EVT_FEAT_ONESHOT;
419
420 /* Calculate the min / max delta */
421 cd->mult = div_sc((unsigned long) mips_freq, NSEC_PER_SEC, 32);
422 cd->shift = 32;
423 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
424 cd->min_delta_ns = clockevent_delta2ns(0x30, cd);
425
426 cd->rating = 300;
427 cd->irq = irq;
428#ifdef CONFIG_MIPS_MT_SMTC
429 cd->cpumask = CPU_MASK_ALL;
430#else
431 cd->cpumask = cpumask_of_cpu(cpu);
432#endif
433 cd->set_next_event = mips_next_event;
434 cd->set_mode = mips_set_mode;
435 cd->event_handler = mips_event_handler;
436
437 clockevents_register_device(cd);
438
439 if (!cp0_timer_irq_installed) {
440#ifdef CONFIG_MIPS_MT_SMTC
441#define CPUCTR_IMASKBIT (0x100 << cp0_compare_irq)
442 setup_irq_smtc(irq, &timer_irqaction, CPUCTR_IMASKBIT);
443#else
444 setup_irq(irq, &timer_irqaction);
445#endif /* CONFIG_MIPS_MT_SMTC */
446 cp0_timer_irq_installed = 1;
447 }
448}
449
450void __init time_init(void)
451{
452 plat_time_init();
373 453
374 /* Choose appropriate high precision timer routines. */ 454 /* Choose appropriate high precision timer routines. */
375 if (!cpu_has_counter && !clocksource_mips.read) 455 if (!cpu_has_counter && !clocksource_mips.read)
@@ -392,11 +472,6 @@ void __init time_init(void)
392 /* Calculate cache parameters. */ 472 /* Calculate cache parameters. */
393 cycles_per_jiffy = 473 cycles_per_jiffy =
394 (mips_hpt_frequency + HZ / 2) / HZ; 474 (mips_hpt_frequency + HZ / 2) / HZ;
395 /*
396 * This sets up the high precision
397 * timer for the first interrupt.
398 */
399 c0_hpt_timer_init();
400 } 475 }
401 } 476 }
402 if (!mips_hpt_frequency) 477 if (!mips_hpt_frequency)
@@ -406,6 +481,10 @@ void __init time_init(void)
406 printk("Using %u.%03u MHz high precision timer.\n", 481 printk("Using %u.%03u MHz high precision timer.\n",
407 ((mips_hpt_frequency + 500) / 1000) / 1000, 482 ((mips_hpt_frequency + 500) / 1000) / 1000,
408 ((mips_hpt_frequency + 500) / 1000) % 1000); 483 ((mips_hpt_frequency + 500) / 1000) % 1000);
484
485#ifdef CONFIG_IRQ_CPU
486 setup_irq(MIPS_CPU_IRQ_BASE + 7, &timer_irqaction);
487#endif
409 } 488 }
410 489
411 if (!mips_timer_ack) 490 if (!mips_timer_ack)
@@ -426,56 +505,5 @@ void __init time_init(void)
426 plat_timer_setup(&timer_irqaction); 505 plat_timer_setup(&timer_irqaction);
427 506
428 init_mips_clocksource(); 507 init_mips_clocksource();
508 mips_clockevent_init();
429} 509}
430
431#define FEBRUARY 2
432#define STARTOFTIME 1970
433#define SECDAY 86400L
434#define SECYR (SECDAY * 365)
435#define leapyear(y) ((!((y) % 4) && ((y) % 100)) || !((y) % 400))
436#define days_in_year(y) (leapyear(y) ? 366 : 365)
437#define days_in_month(m) (month_days[(m) - 1])
438
439static int month_days[12] = {
440 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
441};
442
443void to_tm(unsigned long tim, struct rtc_time *tm)
444{
445 long hms, day, gday;
446 int i;
447
448 gday = day = tim / SECDAY;
449 hms = tim % SECDAY;
450
451 /* Hours, minutes, seconds are easy */
452 tm->tm_hour = hms / 3600;
453 tm->tm_min = (hms % 3600) / 60;
454 tm->tm_sec = (hms % 3600) % 60;
455
456 /* Number of years in days */
457 for (i = STARTOFTIME; day >= days_in_year(i); i++)
458 day -= days_in_year(i);
459 tm->tm_year = i;
460
461 /* Number of months in days left */
462 if (leapyear(tm->tm_year))
463 days_in_month(FEBRUARY) = 29;
464 for (i = 1; day >= days_in_month(i); i++)
465 day -= days_in_month(i);
466 days_in_month(FEBRUARY) = 28;
467 tm->tm_mon = i - 1; /* tm_mon starts from 0 to 11 */
468
469 /* Days are what is left over (+1) from all that. */
470 tm->tm_mday = day + 1;
471
472 /*
473 * Determine the day of week
474 */
475 tm->tm_wday = (gday + 4) % 7; /* 1970/1/1 was Thursday */
476}
477
478EXPORT_SYMBOL(rtc_lock);
479EXPORT_SYMBOL(to_tm);
480EXPORT_SYMBOL(rtc_mips_set_time);
481EXPORT_SYMBOL(rtc_mips_get_time);
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 6379003f9d8d..632bce1bf420 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -295,7 +295,8 @@ void show_regs(struct pt_regs *regs)
295 if (1 <= cause && cause <= 5) 295 if (1 <= cause && cause <= 5)
296 printk("BadVA : %0*lx\n", field, regs->cp0_badvaddr); 296 printk("BadVA : %0*lx\n", field, regs->cp0_badvaddr);
297 297
298 printk("PrId : %08x\n", read_c0_prid()); 298 printk("PrId : %08x (%s)\n", read_c0_prid(),
299 cpu_name_string());
299} 300}
300 301
301void show_registers(struct pt_regs *regs) 302void show_registers(struct pt_regs *regs)
@@ -627,7 +628,7 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
627 lose_fpu(1); 628 lose_fpu(1);
628 629
629 /* Run the emulator */ 630 /* Run the emulator */
630 sig = fpu_emulator_cop1Handler (regs, &current->thread.fpu, 1); 631 sig = fpu_emulator_cop1Handler(regs, &current->thread.fpu, 1);
631 632
632 /* 633 /*
633 * We can't allow the emulated instruction to leave any of 634 * We can't allow the emulated instruction to leave any of
@@ -954,7 +955,7 @@ asmlinkage void do_reserved(struct pt_regs *regs)
954 */ 955 */
955static inline void parity_protection_init(void) 956static inline void parity_protection_init(void)
956{ 957{
957 switch (current_cpu_data.cputype) { 958 switch (current_cpu_type()) {
958 case CPU_24K: 959 case CPU_24K:
959 case CPU_34K: 960 case CPU_34K:
960 case CPU_5KC: 961 case CPU_5KC:
@@ -1075,8 +1076,8 @@ void *set_except_vector(int n, void *addr)
1075 1076
1076 exception_handlers[n] = handler; 1077 exception_handlers[n] = handler;
1077 if (n == 0 && cpu_has_divec) { 1078 if (n == 0 && cpu_has_divec) {
1078 *(volatile u32 *)(ebase + 0x200) = 0x08000000 | 1079 *(u32 *)(ebase + 0x200) = 0x08000000 |
1079 (0x03ffffff & (handler >> 2)); 1080 (0x03ffffff & (handler >> 2));
1080 flush_icache_range(ebase + 0x200, ebase + 0x204); 1081 flush_icache_range(ebase + 0x200, ebase + 0x204);
1081 } 1082 }
1082 return (void *)old_handler; 1083 return (void *)old_handler;
@@ -1165,11 +1166,11 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
1165 1166
1166 if (cpu_has_veic) { 1167 if (cpu_has_veic) {
1167 if (board_bind_eic_interrupt) 1168 if (board_bind_eic_interrupt)
1168 board_bind_eic_interrupt (n, srs); 1169 board_bind_eic_interrupt(n, srs);
1169 } else if (cpu_has_vint) { 1170 } else if (cpu_has_vint) {
1170 /* SRSMap is only defined if shadow sets are implemented */ 1171 /* SRSMap is only defined if shadow sets are implemented */
1171 if (mips_srs_max() > 1) 1172 if (mips_srs_max() > 1)
1172 change_c0_srsmap (0xf << n*4, srs << n*4); 1173 change_c0_srsmap(0xf << n*4, srs << n*4);
1173 } 1174 }
1174 1175
1175 if (srs == 0) { 1176 if (srs == 0) {
@@ -1198,10 +1199,10 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
1198 * Sigh... panicing won't help as the console 1199 * Sigh... panicing won't help as the console
1199 * is probably not configured :( 1200 * is probably not configured :(
1200 */ 1201 */
1201 panic ("VECTORSPACING too small"); 1202 panic("VECTORSPACING too small");
1202 } 1203 }
1203 1204
1204 memcpy (b, &except_vec_vi, handler_len); 1205 memcpy(b, &except_vec_vi, handler_len);
1205#ifdef CONFIG_MIPS_MT_SMTC 1206#ifdef CONFIG_MIPS_MT_SMTC
1206 BUG_ON(n > 7); /* Vector index %d exceeds SMTC maximum. */ 1207 BUG_ON(n > 7); /* Vector index %d exceeds SMTC maximum. */
1207 1208
@@ -1370,9 +1371,9 @@ void __init per_cpu_trap_init(void)
1370#endif /* CONFIG_MIPS_MT_SMTC */ 1371#endif /* CONFIG_MIPS_MT_SMTC */
1371 1372
1372 if (cpu_has_veic || cpu_has_vint) { 1373 if (cpu_has_veic || cpu_has_vint) {
1373 write_c0_ebase (ebase); 1374 write_c0_ebase(ebase);
1374 /* Setting vector spacing enables EI/VI mode */ 1375 /* Setting vector spacing enables EI/VI mode */
1375 change_c0_intctl (0x3e0, VECTORSPACING); 1376 change_c0_intctl(0x3e0, VECTORSPACING);
1376 } 1377 }
1377 if (cpu_has_divec) { 1378 if (cpu_has_divec) {
1378 if (cpu_has_mipsmt) { 1379 if (cpu_has_mipsmt) {
@@ -1390,8 +1391,8 @@ void __init per_cpu_trap_init(void)
1390 * o read IntCtl.IPPCI to determine the performance counter interrupt 1391 * o read IntCtl.IPPCI to determine the performance counter interrupt
1391 */ 1392 */
1392 if (cpu_has_mips_r2) { 1393 if (cpu_has_mips_r2) {
1393 cp0_compare_irq = (read_c0_intctl () >> 29) & 7; 1394 cp0_compare_irq = (read_c0_intctl() >> 29) & 7;
1394 cp0_perfcount_irq = (read_c0_intctl () >> 26) & 7; 1395 cp0_perfcount_irq = (read_c0_intctl() >> 26) & 7;
1395 if (cp0_perfcount_irq == cp0_compare_irq) 1396 if (cp0_perfcount_irq == cp0_compare_irq)
1396 cp0_perfcount_irq = -1; 1397 cp0_perfcount_irq = -1;
1397 } else { 1398 } else {
@@ -1429,14 +1430,17 @@ void __init per_cpu_trap_init(void)
1429} 1430}
1430 1431
1431/* Install CPU exception handler */ 1432/* Install CPU exception handler */
1432void __init set_handler (unsigned long offset, void *addr, unsigned long size) 1433void __init set_handler(unsigned long offset, void *addr, unsigned long size)
1433{ 1434{
1434 memcpy((void *)(ebase + offset), addr, size); 1435 memcpy((void *)(ebase + offset), addr, size);
1435 flush_icache_range(ebase + offset, ebase + offset + size); 1436 flush_icache_range(ebase + offset, ebase + offset + size);
1436} 1437}
1437 1438
1439static char panic_null_cerr[] __initdata =
1440 "Trying to set NULL cache error exception handler";
1441
1438/* Install uncached CPU exception handler */ 1442/* Install uncached CPU exception handler */
1439void __init set_uncached_handler (unsigned long offset, void *addr, unsigned long size) 1443void __init set_uncached_handler(unsigned long offset, void *addr, unsigned long size)
1440{ 1444{
1441#ifdef CONFIG_32BIT 1445#ifdef CONFIG_32BIT
1442 unsigned long uncached_ebase = KSEG1ADDR(ebase); 1446 unsigned long uncached_ebase = KSEG1ADDR(ebase);
@@ -1445,6 +1449,9 @@ void __init set_uncached_handler (unsigned long offset, void *addr, unsigned lon
1445 unsigned long uncached_ebase = TO_UNCAC(ebase); 1449 unsigned long uncached_ebase = TO_UNCAC(ebase);
1446#endif 1450#endif
1447 1451
1452 if (!addr)
1453 panic(panic_null_cerr);
1454
1448 memcpy((void *)(uncached_ebase + offset), addr, size); 1455 memcpy((void *)(uncached_ebase + offset), addr, size);
1449} 1456}
1450 1457
@@ -1464,7 +1471,7 @@ void __init trap_init(void)
1464 unsigned long i; 1471 unsigned long i;
1465 1472
1466 if (cpu_has_veic || cpu_has_vint) 1473 if (cpu_has_veic || cpu_has_vint)
1467 ebase = (unsigned long) alloc_bootmem_low_pages (0x200 + VECTORSPACING*64); 1474 ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64);
1468 else 1475 else
1469 ebase = CAC_BASE; 1476 ebase = CAC_BASE;
1470 1477
@@ -1490,7 +1497,7 @@ void __init trap_init(void)
1490 * destination. 1497 * destination.
1491 */ 1498 */
1492 if (cpu_has_ejtag && board_ejtag_handler_setup) 1499 if (cpu_has_ejtag && board_ejtag_handler_setup)
1493 board_ejtag_handler_setup (); 1500 board_ejtag_handler_setup();
1494 1501
1495 /* 1502 /*
1496 * Only some CPUs have the watch exceptions. 1503 * Only some CPUs have the watch exceptions.
@@ -1543,8 +1550,8 @@ void __init trap_init(void)
1543 set_except_vector(12, handle_ov); 1550 set_except_vector(12, handle_ov);
1544 set_except_vector(13, handle_tr); 1551 set_except_vector(13, handle_tr);
1545 1552
1546 if (current_cpu_data.cputype == CPU_R6000 || 1553 if (current_cpu_type() == CPU_R6000 ||
1547 current_cpu_data.cputype == CPU_R6000A) { 1554 current_cpu_type() == CPU_R6000A) {
1548 /* 1555 /*
1549 * The R6000 is the only R-series CPU that features a machine 1556 * The R6000 is the only R-series CPU that features a machine
1550 * check exception (similar to the R4000 cache error) and 1557 * check exception (similar to the R4000 cache error) and
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index d34b1fb3665d..c327b21bca81 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -481,7 +481,7 @@ fault:
481 if (fixup_exception(regs)) 481 if (fixup_exception(regs))
482 return; 482 return;
483 483
484 die_if_kernel ("Unhandled kernel unaligned access", regs); 484 die_if_kernel("Unhandled kernel unaligned access", regs);
485 send_sig(SIGSEGV, current, 1); 485 send_sig(SIGSEGV, current, 1);
486 486
487 return; 487 return;
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 087ab997487d..84f9a4cc6f2f 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -6,163 +6,202 @@
6OUTPUT_ARCH(mips) 6OUTPUT_ARCH(mips)
7ENTRY(kernel_entry) 7ENTRY(kernel_entry)
8jiffies = JIFFIES; 8jiffies = JIFFIES;
9
9SECTIONS 10SECTIONS
10{ 11{
11#ifdef CONFIG_BOOT_ELF64 12#ifdef CONFIG_BOOT_ELF64
12 /* Read-only sections, merged into text segment: */ 13 /* Read-only sections, merged into text segment: */
13 /* . = 0xc000000000000000; */ 14 /* . = 0xc000000000000000; */
14 15
15 /* This is the value for an Origin kernel, taken from an IRIX kernel. */ 16 /* This is the value for an Origin kernel, taken from an IRIX kernel. */
16 /* . = 0xc00000000001c000; */ 17 /* . = 0xc00000000001c000; */
17 18
18 /* Set the vaddr for the text segment to a value 19 /* Set the vaddr for the text segment to a value
19 >= 0xa800 0000 0001 9000 if no symmon is going to configured 20 * >= 0xa800 0000 0001 9000 if no symmon is going to configured
20 >= 0xa800 0000 0030 0000 otherwise */ 21 * >= 0xa800 0000 0030 0000 otherwise
22 */
21 23
22 /* . = 0xa800000000300000; */ 24 /* . = 0xa800000000300000; */
23 /* . = 0xa800000000300000; */ 25 /* . = 0xa800000000300000; */
24 . = 0xffffffff80300000; 26 . = 0xffffffff80300000;
25#endif 27#endif
26 . = LOADADDR; 28 . = LOADADDR;
27 /* read-only */ 29 /* read-only */
28 _text = .; /* Text and read-only data */ 30 _text = .; /* Text and read-only data */
29 .text : { 31 .text : {
30 TEXT_TEXT 32 TEXT_TEXT
31 SCHED_TEXT 33 SCHED_TEXT
32 LOCK_TEXT 34 LOCK_TEXT
33 *(.fixup) 35 *(.fixup)
34 *(.gnu.warning) 36 *(.gnu.warning)
35 } =0 37 } =0
36 38 _etext = .; /* End of text section */
37 _etext = .; /* End of text section */ 39
38 40 /* Exception table */
39 . = ALIGN(16); /* Exception table */ 41 . = ALIGN(16);
40 __start___ex_table = .; 42 __ex_table : {
41 __ex_table : { *(__ex_table) } 43 __start___ex_table = .;
42 __stop___ex_table = .; 44 *(__ex_table)
43 45 __stop___ex_table = .;
44 __start___dbe_table = .; /* Exception table for data bus errors */ 46 }
45 __dbe_table : { *(__dbe_table) } 47
46 __stop___dbe_table = .; 48 /* Exception table for data bus errors */
47 49 __dbe_table : {
48 NOTES 50 __start___dbe_table = .;
49 51 *(__dbe_table)
50 RODATA 52 __stop___dbe_table = .;
51 53 }
52 /* writeable */ 54 RODATA
53 .data : { /* Data */ 55
54 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */ 56 /* writeable */
55 /* 57 .data : { /* Data */
56 * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which 58 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
57 * limits the maximum alignment to at most 32kB and results in the following 59 /*
58 * warning: 60 * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
59 * 61 * limits the maximum alignment to at most 32kB and results in the following
60 * CC arch/mips/kernel/init_task.o 62 * warning:
61 * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’ 63 *
62 * is greater than maximum object file alignment. Using 32768 64 * CC arch/mips/kernel/init_task.o
63 */ 65 * arch/mips/kernel/init_task.c:30: warning: alignment of ‘init_thread_union’
64 . = ALIGN(_PAGE_SIZE); 66 * is greater than maximum object file alignment. Using 32768
65 *(.data.init_task) 67 */
66 68 . = ALIGN(_PAGE_SIZE);
67 DATA_DATA 69 *(.data.init_task)
68 70
69 CONSTRUCTORS 71 DATA_DATA
70 } 72 CONSTRUCTORS
71 _gp = . + 0x8000; 73 }
72 .lit8 : { *(.lit8) } 74 _gp = . + 0x8000;
73 .lit4 : { *(.lit4) } 75 .lit8 : {
74 /* We want the small data sections together, so single-instruction offsets 76 *(.lit8)
75 can access them all, and initialized data all before uninitialized, so 77 }
76 we can shorten the on-disk segment size. */ 78 .lit4 : {
77 .sdata : { *(.sdata) } 79 *(.lit4)
78 80 }
79 . = ALIGN(_PAGE_SIZE); 81 /* We want the small data sections together, so single-instruction offsets
80 __nosave_begin = .; 82 can access them all, and initialized data all before uninitialized, so
81 .data_nosave : { *(.data.nosave) } 83 we can shorten the on-disk segment size. */
82 . = ALIGN(_PAGE_SIZE); 84 .sdata : {
83 __nosave_end = .; 85 *(.sdata)
84 86 }
85 . = ALIGN(32); 87
86 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 88 . = ALIGN(_PAGE_SIZE);
87 89 .data_nosave : {
88 _edata = .; /* End of data section */ 90 __nosave_begin = .;
89 91 *(.data.nosave)
90 /* will be freed after init */ 92 }
91 . = ALIGN(_PAGE_SIZE); /* Init code and data */ 93 . = ALIGN(_PAGE_SIZE);
92 __init_begin = .; 94 __nosave_end = .;
93 .init.text : { 95
94 _sinittext = .; 96 . = ALIGN(32);
95 *(.init.text) 97 .data.cacheline_aligned : {
96 _einittext = .; 98 *(.data.cacheline_aligned)
97 } 99 }
98 .init.data : { *(.init.data) } 100 _edata = .; /* End of data section */
99 . = ALIGN(16); 101
100 __setup_start = .; 102 /* will be freed after init */
101 .init.setup : { *(.init.setup) } 103 . = ALIGN(_PAGE_SIZE); /* Init code and data */
102 __setup_end = .; 104 __init_begin = .;
103 105 .init.text : {
104 __initcall_start = .; 106 _sinittext = .;
105 .initcall.init : { 107 *(.init.text)
106 INITCALLS 108 _einittext = .;
107 } 109 }
108 __initcall_end = .; 110 .init.data : {
109 111 *(.init.data)
110 __con_initcall_start = .; 112 }
111 .con_initcall.init : { *(.con_initcall.init) } 113 . = ALIGN(16);
112 __con_initcall_end = .; 114 .init.setup : {
113 SECURITY_INIT 115 __setup_start = .;
114 /* .exit.text is discarded at runtime, not link time, to deal with 116 *(.init.setup)
115 references from .rodata */ 117 __setup_end = .;
116 .exit.text : { *(.exit.text) } 118 }
117 .exit.data : { *(.exit.data) } 119
120 .initcall.init : {
121 __initcall_start = .;
122 INITCALLS
123 __initcall_end = .;
124 }
125
126 .con_initcall.init : {
127 __con_initcall_start = .;
128 *(.con_initcall.init)
129 __con_initcall_end = .;
130 }
131 SECURITY_INIT
132
133 /* .exit.text is discarded at runtime, not link time, to deal with
134 * references from .rodata
135 */
136 .exit.text : {
137 *(.exit.text)
138 }
139 .exit.data : {
140 *(.exit.data)
141 }
118#if defined(CONFIG_BLK_DEV_INITRD) 142#if defined(CONFIG_BLK_DEV_INITRD)
119 . = ALIGN(_PAGE_SIZE); 143 . = ALIGN(_PAGE_SIZE);
120 __initramfs_start = .; 144 .init.ramfs : {
121 .init.ramfs : { *(.init.ramfs) } 145 __initramfs_start = .;
122 __initramfs_end = .; 146 *(.init.ramfs)
147 __initramfs_end = .;
148 }
123#endif 149#endif
124 PERCPU(_PAGE_SIZE) 150 PERCPU(_PAGE_SIZE)
125 . = ALIGN(_PAGE_SIZE); 151 . = ALIGN(_PAGE_SIZE);
126 __init_end = .; 152 __init_end = .;
127 /* freed after init ends here */ 153 /* freed after init ends here */
128 154
129 __bss_start = .; /* BSS */ 155 __bss_start = .; /* BSS */
130 .sbss : { 156 .sbss : {
131 *(.sbss) 157 *(.sbss)
132 *(.scommon) 158 *(.scommon)
133 } 159 }
134 .bss : { 160 .bss : {
135 *(.bss) 161 *(.bss)
136 *(COMMON) 162 *(COMMON)
137 } 163 }
138 __bss_stop = .; 164 __bss_stop = .;
139 165
140 _end = . ; 166 _end = . ;
141 167
142 /* Sections to be discarded */ 168 /* Sections to be discarded */
143 /DISCARD/ : { 169 /DISCARD/ : {
144 *(.exitcall.exit) 170 *(.exitcall.exit)
145 171
146 /* ABI crap starts here */ 172 /* ABI crap starts here */
147 *(.MIPS.options) 173 *(.MIPS.options)
148 *(.options) 174 *(.options)
149 *(.pdr) 175 *(.pdr)
150 *(.reginfo) 176 *(.reginfo)
151 } 177 }
152 178
153 /* These mark the ABI of the kernel for debuggers. */ 179 /* These mark the ABI of the kernel for debuggers. */
154 .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) } 180 .mdebug.abi32 : {
155 .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) } 181 KEEP(*(.mdebug.abi32))
156 182 }
157 /* This is the MIPS specific mdebug section. */ 183 .mdebug.abi64 : {
158 .mdebug : { *(.mdebug) } 184 KEEP(*(.mdebug.abi64))
159 185 }
160 STABS_DEBUG 186
161 187 /* This is the MIPS specific mdebug section. */
162 DWARF_DEBUG 188 .mdebug : {
163 189 *(.mdebug)
164 /* These must appear regardless of . */ 190 }
165 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) } 191
166 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) } 192 STABS_DEBUG
167 .note : { *(.note) } 193 DWARF_DEBUG
194
195 /* These must appear regardless of . */
196 .gptab.sdata : {
197 *(.gptab.data)
198 *(.gptab.sdata)
199 }
200 .gptab.sbss : {
201 *(.gptab.bss)
202 *(.gptab.sbss)
203 }
204 .note : {
205 *(.note)
206 }
168} 207}
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 3c09b9785f4c..61b729fa0548 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -936,8 +936,18 @@ static int vpe_elfload(struct vpe * v)
936 936
937 } 937 }
938 } else { 938 } else {
939 for (i = 0; i < hdr->e_shnum; i++) { 939 struct elf_phdr *phdr = (struct elf_phdr *) ((char *)hdr + hdr->e_phoff);
940 940
941 for (i = 0; i < hdr->e_phnum; i++) {
942 if (phdr->p_type != PT_LOAD)
943 continue;
944
945 memcpy((void *)phdr->p_vaddr, (char *)hdr + phdr->p_offset, phdr->p_filesz);
946 memset((void *)phdr->p_vaddr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz);
947 phdr++;
948 }
949
950 for (i = 0; i < hdr->e_shnum; i++) {
941 /* Internal symbols and strings. */ 951 /* Internal symbols and strings. */
942 if (sechdrs[i].sh_type == SHT_SYMTAB) { 952 if (sechdrs[i].sh_type == SHT_SYMTAB) {
943 symindex = i; 953 symindex = i;
@@ -948,39 +958,6 @@ static int vpe_elfload(struct vpe * v)
948 magic symbols */ 958 magic symbols */
949 sechdrs[i].sh_addr = (size_t) hdr + sechdrs[i].sh_offset; 959 sechdrs[i].sh_addr = (size_t) hdr + sechdrs[i].sh_offset;
950 } 960 }
951
952 /* filter sections we dont want in the final image */
953 if (!(sechdrs[i].sh_flags & SHF_ALLOC) ||
954 (sechdrs[i].sh_type == SHT_MIPS_REGINFO)) {
955 printk( KERN_DEBUG " ignoring section, "
956 "name %s type %x address 0x%x \n",
957 secstrings + sechdrs[i].sh_name,
958 sechdrs[i].sh_type, sechdrs[i].sh_addr);
959 continue;
960 }
961
962 if (sechdrs[i].sh_addr < (unsigned int)v->load_addr) {
963 printk( KERN_WARNING "VPE loader: "
964 "fully linked image has invalid section, "
965 "name %s type %x address 0x%x, before load "
966 "address of 0x%x\n",
967 secstrings + sechdrs[i].sh_name,
968 sechdrs[i].sh_type, sechdrs[i].sh_addr,
969 (unsigned int)v->load_addr);
970 return -ENOEXEC;
971 }
972
973 printk(KERN_DEBUG " copying section sh_name %s, sh_addr 0x%x "
974 "size 0x%x0 from x%p\n",
975 secstrings + sechdrs[i].sh_name, sechdrs[i].sh_addr,
976 sechdrs[i].sh_size, hdr + sechdrs[i].sh_offset);
977
978 if (sechdrs[i].sh_type != SHT_NOBITS)
979 memcpy((void *)sechdrs[i].sh_addr,
980 (char *)hdr + sechdrs[i].sh_offset,
981 sechdrs[i].sh_size);
982 else
983 memset((void *)sechdrs[i].sh_addr, 0, sechdrs[i].sh_size);
984 } 961 }
985 } 962 }
986 963
@@ -1044,7 +1021,7 @@ static int getcwd(char *buff, int size)
1044 old_fs = get_fs(); 1021 old_fs = get_fs();
1045 set_fs(KERNEL_DS); 1022 set_fs(KERNEL_DS);
1046 1023
1047 ret = sys_getcwd(buff,size); 1024 ret = sys_getcwd(buff, size);
1048 1025
1049 set_fs(old_fs); 1026 set_fs(old_fs);
1050 1027
diff --git a/arch/mips/lasat/Kconfig b/arch/mips/lasat/Kconfig
new file mode 100644
index 000000000000..1d2ee8a9be13
--- /dev/null
+++ b/arch/mips/lasat/Kconfig
@@ -0,0 +1,15 @@
1config PICVUE
2 tristate "PICVUE LCD display driver"
3 depends on LASAT
4
5config PICVUE_PROC
6 tristate "PICVUE LCD display driver /proc interface"
7 depends on PICVUE
8
9config DS1603
10 bool "DS1603 RTC driver"
11 depends on LASAT
12
13config LASAT_SYSCTL
14 bool "LASAT sysctl interface"
15 depends on LASAT
diff --git a/arch/mips/lasat/Makefile b/arch/mips/lasat/Makefile
new file mode 100644
index 000000000000..33791609fe99
--- /dev/null
+++ b/arch/mips/lasat/Makefile
@@ -0,0 +1,16 @@
1#
2# Makefile for the LASAT specific kernel interface routines under Linux.
3#
4
5obj-y += reset.o setup.o prom.o lasat_board.o \
6 at93c.o interrupt.o serial.o
7
8obj-$(CONFIG_LASAT_SYSCTL) += sysctl.o
9obj-$(CONFIG_DS1603) += ds1603.o
10obj-$(CONFIG_PICVUE) += picvue.o
11obj-$(CONFIG_PICVUE_PROC) += picvue_proc.o
12
13clean:
14 make -C image clean
15
16EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/lasat/at93c.c b/arch/mips/lasat/at93c.c
new file mode 100644
index 000000000000..793e234719a6
--- /dev/null
+++ b/arch/mips/lasat/at93c.c
@@ -0,0 +1,149 @@
1/*
2 * Atmel AT93C46 serial eeprom driver
3 *
4 * Brian Murphy <brian.murphy@eicon.com>
5 *
6 */
7#include <linux/kernel.h>
8#include <linux/delay.h>
9#include <asm/lasat/lasat.h>
10#include <linux/module.h>
11#include <linux/init.h>
12
13#include "at93c.h"
14
15#define AT93C_ADDR_SHIFT 7
16#define AT93C_ADDR_MAX ((1 << AT93C_ADDR_SHIFT) - 1)
17#define AT93C_RCMD (0x6 << AT93C_ADDR_SHIFT)
18#define AT93C_WCMD (0x5 << AT93C_ADDR_SHIFT)
19#define AT93C_WENCMD 0x260
20#define AT93C_WDSCMD 0x200
21
22struct at93c_defs *at93c;
23
24static void at93c_reg_write(u32 val)
25{
26 *at93c->reg = val;
27}
28
29static u32 at93c_reg_read(void)
30{
31 u32 tmp = *at93c->reg;
32 return tmp;
33}
34
35static u32 at93c_datareg_read(void)
36{
37 u32 tmp = *at93c->rdata_reg;
38 return tmp;
39}
40
41static void at93c_cycle_clk(u32 data)
42{
43 at93c_reg_write(data | at93c->clk);
44 lasat_ndelay(250);
45 at93c_reg_write(data & ~at93c->clk);
46 lasat_ndelay(250);
47}
48
49static void at93c_write_databit(u8 bit)
50{
51 u32 data = at93c_reg_read();
52 if (bit)
53 data |= 1 << at93c->wdata_shift;
54 else
55 data &= ~(1 << at93c->wdata_shift);
56
57 at93c_reg_write(data);
58 lasat_ndelay(100);
59 at93c_cycle_clk(data);
60}
61
62static unsigned int at93c_read_databit(void)
63{
64 u32 data;
65
66 at93c_cycle_clk(at93c_reg_read());
67 data = (at93c_datareg_read() >> at93c->rdata_shift) & 1;
68 return data;
69}
70
71static u8 at93c_read_byte(void)
72{
73 int i;
74 u8 data = 0;
75
76 for (i = 0; i <= 7; i++) {
77 data <<= 1;
78 data |= at93c_read_databit();
79 }
80 return data;
81}
82
83static void at93c_write_bits(u32 data, int size)
84{
85 int i;
86 int shift = size - 1;
87 u32 mask = (1 << shift);
88
89 for (i = 0; i < size; i++) {
90 at93c_write_databit((data & mask) >> shift);
91 data <<= 1;
92 }
93}
94
95static void at93c_init_op(void)
96{
97 at93c_reg_write((at93c_reg_read() | at93c->cs) &
98 ~at93c->clk & ~(1 << at93c->rdata_shift));
99 lasat_ndelay(50);
100}
101
102static void at93c_end_op(void)
103{
104 at93c_reg_write(at93c_reg_read() & ~at93c->cs);
105 lasat_ndelay(250);
106}
107
108static void at93c_wait(void)
109{
110 at93c_init_op();
111 while (!at93c_read_databit())
112 ;
113 at93c_end_op();
114};
115
116static void at93c_disable_wp(void)
117{
118 at93c_init_op();
119 at93c_write_bits(AT93C_WENCMD, 10);
120 at93c_end_op();
121}
122
123static void at93c_enable_wp(void)
124{
125 at93c_init_op();
126 at93c_write_bits(AT93C_WDSCMD, 10);
127 at93c_end_op();
128}
129
130u8 at93c_read(u8 addr)
131{
132 u8 byte;
133 at93c_init_op();
134 at93c_write_bits((addr & AT93C_ADDR_MAX)|AT93C_RCMD, 10);
135 byte = at93c_read_byte();
136 at93c_end_op();
137 return byte;
138}
139
140void at93c_write(u8 addr, u8 data)
141{
142 at93c_disable_wp();
143 at93c_init_op();
144 at93c_write_bits((addr & AT93C_ADDR_MAX)|AT93C_WCMD, 10);
145 at93c_write_bits(data, 8);
146 at93c_end_op();
147 at93c_wait();
148 at93c_enable_wp();
149}
diff --git a/arch/mips/lasat/at93c.h b/arch/mips/lasat/at93c.h
new file mode 100644
index 000000000000..cfe2f99b1d44
--- /dev/null
+++ b/arch/mips/lasat/at93c.h
@@ -0,0 +1,18 @@
1/*
2 * Atmel AT93C46 serial eeprom driver
3 *
4 * Brian Murphy <brian.murphy@eicon.com>
5 *
6 */
7
8extern struct at93c_defs {
9 volatile u32 *reg;
10 volatile u32 *rdata_reg;
11 int rdata_shift;
12 int wdata_shift;
13 u32 cs;
14 u32 clk;
15} *at93c;
16
17u8 at93c_read(u8 addr);
18void at93c_write(u8 addr, u8 data);
diff --git a/arch/mips/lasat/ds1603.c b/arch/mips/lasat/ds1603.c
new file mode 100644
index 000000000000..52cb1436a12a
--- /dev/null
+++ b/arch/mips/lasat/ds1603.c
@@ -0,0 +1,183 @@
1/*
2 * Dallas Semiconductors 1603 RTC driver
3 *
4 * Brian Murphy <brian@murphy.dk>
5 *
6 */
7#include <linux/kernel.h>
8#include <asm/lasat/lasat.h>
9#include <linux/delay.h>
10#include <asm/lasat/ds1603.h>
11#include <asm/time.h>
12
13#include "ds1603.h"
14
15#define READ_TIME_CMD 0x81
16#define SET_TIME_CMD 0x80
17#define TRIMMER_SET_CMD 0xC0
18#define TRIMMER_VALUE_MASK 0x38
19#define TRIMMER_SHIFT 3
20
21struct ds_defs *ds1603;
22
23/* HW specific register functions */
24static void rtc_reg_write(unsigned long val)
25{
26 *ds1603->reg = val;
27}
28
29static unsigned long rtc_reg_read(void)
30{
31 unsigned long tmp = *ds1603->reg;
32 return tmp;
33}
34
35static unsigned long rtc_datareg_read(void)
36{
37 unsigned long tmp = *ds1603->data_reg;
38 return tmp;
39}
40
41static void rtc_nrst_high(void)
42{
43 rtc_reg_write(rtc_reg_read() | ds1603->rst);
44}
45
46static void rtc_nrst_low(void)
47{
48 rtc_reg_write(rtc_reg_read() & ~ds1603->rst);
49}
50
51static void rtc_cycle_clock(unsigned long data)
52{
53 data |= ds1603->clk;
54 rtc_reg_write(data);
55 lasat_ndelay(250);
56 if (ds1603->data_reversed)
57 data &= ~ds1603->data;
58 else
59 data |= ds1603->data;
60 data &= ~ds1603->clk;
61 rtc_reg_write(data);
62 lasat_ndelay(250 + ds1603->huge_delay);
63}
64
65static void rtc_write_databit(unsigned int bit)
66{
67 unsigned long data = rtc_reg_read();
68 if (ds1603->data_reversed)
69 bit = !bit;
70 if (bit)
71 data |= ds1603->data;
72 else
73 data &= ~ds1603->data;
74
75 rtc_reg_write(data);
76 lasat_ndelay(50 + ds1603->huge_delay);
77 rtc_cycle_clock(data);
78}
79
80static unsigned int rtc_read_databit(void)
81{
82 unsigned int data;
83
84 data = (rtc_datareg_read() & (1 << ds1603->data_read_shift))
85 >> ds1603->data_read_shift;
86 rtc_cycle_clock(rtc_reg_read());
87 return data;
88}
89
90static void rtc_write_byte(unsigned int byte)
91{
92 int i;
93
94 for (i = 0; i <= 7; i++) {
95 rtc_write_databit(byte & 1L);
96 byte >>= 1;
97 }
98}
99
100static void rtc_write_word(unsigned long word)
101{
102 int i;
103
104 for (i = 0; i <= 31; i++) {
105 rtc_write_databit(word & 1L);
106 word >>= 1;
107 }
108}
109
110static unsigned long rtc_read_word(void)
111{
112 int i;
113 unsigned long word = 0;
114 unsigned long shift = 0;
115
116 for (i = 0; i <= 31; i++) {
117 word |= rtc_read_databit() << shift;
118 shift++;
119 }
120 return word;
121}
122
123static void rtc_init_op(void)
124{
125 rtc_nrst_high();
126
127 rtc_reg_write(rtc_reg_read() & ~ds1603->clk);
128
129 lasat_ndelay(50);
130}
131
132static void rtc_end_op(void)
133{
134 rtc_nrst_low();
135 lasat_ndelay(1000);
136}
137
138unsigned long read_persistent_clock(void)
139{
140 unsigned long word;
141 unsigned long flags;
142
143 spin_lock_irqsave(&rtc_lock, flags);
144 rtc_init_op();
145 rtc_write_byte(READ_TIME_CMD);
146 word = rtc_read_word();
147 rtc_end_op();
148 spin_unlock_irqrestore(&rtc_lock, flags);
149
150 return word;
151}
152
153int rtc_mips_set_mmss(unsigned long time)
154{
155 unsigned long flags;
156
157 spin_lock_irqsave(&rtc_lock, flags);
158 rtc_init_op();
159 rtc_write_byte(SET_TIME_CMD);
160 rtc_write_word(time);
161 rtc_end_op();
162 spin_unlock_irqrestore(&rtc_lock, flags);
163
164 return 0;
165}
166
167void ds1603_set_trimmer(unsigned int trimval)
168{
169 rtc_init_op();
170 rtc_write_byte(((trimval << TRIMMER_SHIFT) & TRIMMER_VALUE_MASK)
171 | (TRIMMER_SET_CMD));
172 rtc_end_op();
173}
174
175void ds1603_disable(void)
176{
177 ds1603_set_trimmer(TRIMMER_DISABLE_RTC);
178}
179
180void ds1603_enable(void)
181{
182 ds1603_set_trimmer(TRIMMER_DEFAULT);
183}
diff --git a/arch/mips/lasat/ds1603.h b/arch/mips/lasat/ds1603.h
new file mode 100644
index 000000000000..2da3704044fd
--- /dev/null
+++ b/arch/mips/lasat/ds1603.h
@@ -0,0 +1,31 @@
1/*
2 * Dallas Semiconductors 1603 RTC driver
3 *
4 * Brian Murphy <brian@murphy.dk>
5 *
6 */
7#ifndef __DS1603_H
8#define __DS1603_H
9
10struct ds_defs {
11 volatile u32 *reg;
12 volatile u32 *data_reg;
13 u32 rst;
14 u32 clk;
15 u32 data;
16 u32 data_read_shift;
17 char data_reversed;
18 u32 huge_delay;
19};
20
21extern struct ds_defs *ds1603;
22
23void ds1603_set_trimmer(unsigned int);
24void ds1603_enable(void);
25void ds1603_disable(void);
26void ds1603_init(struct ds_defs *);
27
28#define TRIMMER_DEFAULT 3
29#define TRIMMER_DISABLE_RTC 0
30
31#endif
diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
new file mode 100644
index 000000000000..5332449ec040
--- /dev/null
+++ b/arch/mips/lasat/image/Makefile
@@ -0,0 +1,54 @@
1#
2# MAKEFILE FOR THE MIPS LINUX BOOTLOADER AND ROM DEBUGGER
3#
4# i-data Networks
5#
6# Author: Thomas Horsten <thh@i-data.com>
7#
8
9ifndef Version
10 Version = "$(USER)-test"
11endif
12
13MKLASATIMG = mklasatimg
14MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
15KERNEL_IMAGE = $(TOPDIR)/vmlinux
16KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
17KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
18
19LDSCRIPT= -L$(obj) -Tromscript.normal
20
21HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
22 -D_kernel_entry=0x$(KERNEL_ENTRY) \
23 -D VERSION="\"$(Version)\"" \
24 -D TIMESTAMP=$(shell date +%s)
25
26$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
27 $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
28
29OBJECTS = head.o kImage.o
30
31rom.sw: $(obj)/rom.sw
32rom.bin: $(obj)/rom.bin
33
34$(obj)/rom.sw: $(obj)/rom.bin
35 $(MKLASATIMG) -o $@ -k $^ -m $(MKLASATIMG_ARCH)
36
37$(obj)/rom.bin: $(obj)/rom
38 $(OBJCOPY) -O binary -S $^ $@
39
40# Rule to make the bootloader
41$(obj)/rom: $(addprefix $(obj)/,$(OBJECTS))
42 $(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^
43
44$(obj)/%.o: $(obj)/%.gz
45 $(LD) -r -o $@ -b binary $<
46
47$(obj)/%.gz: $(obj)/%.bin
48 gzip -cf -9 $< > $@
49
50$(obj)/kImage.bin: $(KERNEL_IMAGE)
51 $(OBJCOPY) -O binary -S $^ $@
52
53clean:
54 rm -f rom rom.bin rom.sw kImage.bin kImage.o
diff --git a/arch/mips/lasat/image/head.S b/arch/mips/lasat/image/head.S
new file mode 100644
index 000000000000..efb95f2609c2
--- /dev/null
+++ b/arch/mips/lasat/image/head.S
@@ -0,0 +1,31 @@
1#include <asm/lasat/head.h>
2
3 .text
4 .section .text.start, "ax"
5 .set noreorder
6 .set mips3
7
8 /* Magic words identifying a software image */
9 .word LASAT_K_MAGIC0_VAL
10 .word LASAT_K_MAGIC1_VAL
11
12 /* Image header version */
13 .word 0x00000002
14
15 /* image start and size */
16 .word _image_start
17 .word _image_size
18
19 /* start of kernel and entrypoint in uncompressed image */
20 .word _kernel_start
21 .word _kernel_entry
22
23 /* Here we have room for future flags */
24
25 .org 0x40
26reldate:
27 .word TIMESTAMP
28
29 .org 0x50
30release:
31 .string VERSION
diff --git a/arch/mips/lasat/image/romscript.normal b/arch/mips/lasat/image/romscript.normal
new file mode 100644
index 000000000000..988f8ad189cb
--- /dev/null
+++ b/arch/mips/lasat/image/romscript.normal
@@ -0,0 +1,23 @@
1OUTPUT_ARCH(mips)
2
3SECTIONS
4{
5 .text :
6 {
7 *(.text.start)
8 }
9
10 /* Data in ROM */
11
12 .data ALIGN(0x10) :
13 {
14 *(.data)
15 }
16 _image_start = ADDR(.data);
17 _image_size = SIZEOF(.data);
18
19 .other :
20 {
21 *(.*)
22 }
23}
diff --git a/arch/mips/lasat/interrupt.c b/arch/mips/lasat/interrupt.c
new file mode 100644
index 000000000000..5f35289bfff5
--- /dev/null
+++ b/arch/mips/lasat/interrupt.c
@@ -0,0 +1,130 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Routines for generic manipulation of the interrupts found on the
19 * Lasat boards.
20 */
21#include <linux/init.h>
22#include <linux/irq.h>
23#include <linux/sched.h>
24#include <linux/slab.h>
25#include <linux/interrupt.h>
26#include <linux/kernel_stat.h>
27
28#include <asm/bootinfo.h>
29#include <asm/lasat/lasatint.h>
30#include <asm/time.h>
31#include <asm/gdb-stub.h>
32
33static volatile int *lasat_int_status;
34static volatile int *lasat_int_mask;
35static volatile int lasat_int_mask_shift;
36
37void disable_lasat_irq(unsigned int irq_nr)
38{
39 *lasat_int_mask &= ~(1 << irq_nr) << lasat_int_mask_shift;
40}
41
42void enable_lasat_irq(unsigned int irq_nr)
43{
44 *lasat_int_mask |= (1 << irq_nr) << lasat_int_mask_shift;
45}
46
47static struct irq_chip lasat_irq_type = {
48 .name = "Lasat",
49 .ack = disable_lasat_irq,
50 .mask = disable_lasat_irq,
51 .mask_ack = disable_lasat_irq,
52 .unmask = enable_lasat_irq,
53};
54
55static inline int ls1bit32(unsigned int x)
56{
57 int b = 31, s;
58
59 s = 16; if (x << 16 == 0) s = 0; b -= s; x <<= s;
60 s = 8; if (x << 8 == 0) s = 0; b -= s; x <<= s;
61 s = 4; if (x << 4 == 0) s = 0; b -= s; x <<= s;
62 s = 2; if (x << 2 == 0) s = 0; b -= s; x <<= s;
63 s = 1; if (x << 1 == 0) s = 0; b -= s;
64
65 return b;
66}
67
68static unsigned long (*get_int_status)(void);
69
70static unsigned long get_int_status_100(void)
71{
72 return *lasat_int_status & *lasat_int_mask;
73}
74
75static unsigned long get_int_status_200(void)
76{
77 unsigned long int_status;
78
79 int_status = *lasat_int_status;
80 int_status &= (int_status >> LASATINT_MASK_SHIFT_200) & 0xffff;
81 return int_status;
82}
83
84asmlinkage void plat_irq_dispatch(void)
85{
86 unsigned long int_status;
87 unsigned int cause = read_c0_cause();
88 int irq;
89
90 if (cause & CAUSEF_IP7) { /* R4000 count / compare IRQ */
91 ll_timer_interrupt(7);
92 return;
93 }
94
95 int_status = get_int_status();
96
97 /* if int_status == 0, then the interrupt has already been cleared */
98 if (int_status) {
99 irq = ls1bit32(int_status);
100
101 do_IRQ(irq);
102 }
103}
104
105void __init arch_init_irq(void)
106{
107 int i;
108
109 switch (mips_machtype) {
110 case MACH_LASAT_100:
111 lasat_int_status = (void *)LASAT_INT_STATUS_REG_100;
112 lasat_int_mask = (void *)LASAT_INT_MASK_REG_100;
113 lasat_int_mask_shift = LASATINT_MASK_SHIFT_100;
114 get_int_status = get_int_status_100;
115 *lasat_int_mask = 0;
116 break;
117 case MACH_LASAT_200:
118 lasat_int_status = (void *)LASAT_INT_STATUS_REG_200;
119 lasat_int_mask = (void *)LASAT_INT_MASK_REG_200;
120 lasat_int_mask_shift = LASATINT_MASK_SHIFT_200;
121 get_int_status = get_int_status_200;
122 *lasat_int_mask &= 0xffff;
123 break;
124 default:
125 panic("arch_init_irq: mips_machtype incorrect");
126 }
127
128 for (i = 0; i <= LASATINT_END; i++)
129 set_irq_chip_and_handler(i, &lasat_irq_type, handle_level_irq);
130}
diff --git a/arch/mips/lasat/lasat_board.c b/arch/mips/lasat/lasat_board.c
new file mode 100644
index 000000000000..ec2f658c3709
--- /dev/null
+++ b/arch/mips/lasat/lasat_board.c
@@ -0,0 +1,280 @@
1/*
2 * Thomas Horsten <thh@lasat.com>
3 * Copyright (C) 2000 LASAT Networks A/S.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Routines specific to the LASAT boards
19 */
20#include <linux/types.h>
21#include <linux/crc32.h>
22#include <asm/lasat/lasat.h>
23#include <linux/kernel.h>
24#include <linux/string.h>
25#include <linux/ctype.h>
26#include <asm/bootinfo.h>
27#include <asm/addrspace.h>
28#include "at93c.h"
29/* New model description table */
30#include "lasat_models.h"
31
32#define EEPROM_CRC(data, len) (~crc32(~0, data, len))
33
34struct lasat_info lasat_board_info;
35
36void update_bcastaddr(void);
37
38int EEPROMRead(unsigned int pos, unsigned char *data, int len)
39{
40 int i;
41
42 for (i = 0; i < len; i++)
43 *data++ = at93c_read(pos++);
44
45 return 0;
46}
47
48int EEPROMWrite(unsigned int pos, unsigned char *data, int len)
49{
50 int i;
51
52 for (i = 0; i < len; i++)
53 at93c_write(pos++, *data++);
54
55 return 0;
56}
57
58static void init_flash_sizes(void)
59{
60 unsigned long *lb = lasat_board_info.li_flashpart_base;
61 unsigned long *ls = lasat_board_info.li_flashpart_size;
62 int i;
63
64 ls[LASAT_MTD_BOOTLOADER] = 0x40000;
65 ls[LASAT_MTD_SERVICE] = 0xC0000;
66 ls[LASAT_MTD_NORMAL] = 0x100000;
67
68 if (mips_machtype == MACH_LASAT_100) {
69 lasat_board_info.li_flash_base = 0x1e000000;
70
71 lb[LASAT_MTD_BOOTLOADER] = 0x1e400000;
72
73 if (lasat_board_info.li_flash_size > 0x200000) {
74 ls[LASAT_MTD_CONFIG] = 0x100000;
75 ls[LASAT_MTD_FS] = 0x500000;
76 }
77 } else {
78 lasat_board_info.li_flash_base = 0x10000000;
79
80 if (lasat_board_info.li_flash_size < 0x1000000) {
81 lb[LASAT_MTD_BOOTLOADER] = 0x10000000;
82 ls[LASAT_MTD_CONFIG] = 0x100000;
83 if (lasat_board_info.li_flash_size >= 0x400000)
84 ls[LASAT_MTD_FS] =
85 lasat_board_info.li_flash_size - 0x300000;
86 }
87 }
88
89 for (i = 1; i < LASAT_MTD_LAST; i++)
90 lb[i] = lb[i-1] + ls[i-1];
91}
92
93int lasat_init_board_info(void)
94{
95 int c;
96 unsigned long crc;
97 unsigned long cfg0, cfg1;
98 const struct product_info *ppi;
99 int i_n_base_models = N_BASE_MODELS;
100 const char * const * i_txt_base_models = txt_base_models;
101 int i_n_prids = N_PRIDS;
102
103 memset(&lasat_board_info, 0, sizeof(lasat_board_info));
104
105 /* First read the EEPROM info */
106 EEPROMRead(0, (unsigned char *)&lasat_board_info.li_eeprom_info,
107 sizeof(struct lasat_eeprom_struct));
108
109 /* Check the CRC */
110 crc = EEPROM_CRC((unsigned char *)(&lasat_board_info.li_eeprom_info),
111 sizeof(struct lasat_eeprom_struct) - 4);
112
113 if (crc != lasat_board_info.li_eeprom_info.crc32) {
114 printk(KERN_WARNING "WARNING...\nWARNING...\nEEPROM CRC does "
115 "not match calculated, attempting to soldier on...\n");
116 }
117
118 if (lasat_board_info.li_eeprom_info.version != LASAT_EEPROM_VERSION) {
119 printk(KERN_WARNING "WARNING...\nWARNING...\nEEPROM version "
120 "%d, wanted version %d, attempting to soldier on...\n",
121 (unsigned int)lasat_board_info.li_eeprom_info.version,
122 LASAT_EEPROM_VERSION);
123 }
124
125 cfg0 = lasat_board_info.li_eeprom_info.cfg[0];
126 cfg1 = lasat_board_info.li_eeprom_info.cfg[1];
127
128 if (LASAT_W0_DSCTYPE(cfg0) != 1) {
129 printk(KERN_WARNING "WARNING...\nWARNING...\n"
130 "Invalid configuration read from EEPROM, attempting to "
131 "soldier on...");
132 }
133 /* We have a valid configuration */
134
135 switch (LASAT_W0_SDRAMBANKSZ(cfg0)) {
136 case 0:
137 lasat_board_info.li_memsize = 0x0800000;
138 break;
139 case 1:
140 lasat_board_info.li_memsize = 0x1000000;
141 break;
142 case 2:
143 lasat_board_info.li_memsize = 0x2000000;
144 break;
145 case 3:
146 lasat_board_info.li_memsize = 0x4000000;
147 break;
148 case 4:
149 lasat_board_info.li_memsize = 0x8000000;
150 break;
151 default:
152 lasat_board_info.li_memsize = 0;
153 }
154
155 switch (LASAT_W0_SDRAMBANKS(cfg0)) {
156 case 0:
157 break;
158 case 1:
159 lasat_board_info.li_memsize *= 2;
160 break;
161 default:
162 break;
163 }
164
165 switch (LASAT_W0_BUSSPEED(cfg0)) {
166 case 0x0:
167 lasat_board_info.li_bus_hz = 60000000;
168 break;
169 case 0x1:
170 lasat_board_info.li_bus_hz = 66000000;
171 break;
172 case 0x2:
173 lasat_board_info.li_bus_hz = 66666667;
174 break;
175 case 0x3:
176 lasat_board_info.li_bus_hz = 80000000;
177 break;
178 case 0x4:
179 lasat_board_info.li_bus_hz = 83333333;
180 break;
181 case 0x5:
182 lasat_board_info.li_bus_hz = 100000000;
183 break;
184 }
185
186 switch (LASAT_W0_CPUCLK(cfg0)) {
187 case 0x0:
188 lasat_board_info.li_cpu_hz =
189 lasat_board_info.li_bus_hz;
190 break;
191 case 0x1:
192 lasat_board_info.li_cpu_hz =
193 lasat_board_info.li_bus_hz +
194 (lasat_board_info.li_bus_hz >> 1);
195 break;
196 case 0x2:
197 lasat_board_info.li_cpu_hz =
198 lasat_board_info.li_bus_hz +
199 lasat_board_info.li_bus_hz;
200 break;
201 case 0x3:
202 lasat_board_info.li_cpu_hz =
203 lasat_board_info.li_bus_hz +
204 lasat_board_info.li_bus_hz +
205 (lasat_board_info.li_bus_hz >> 1);
206 break;
207 case 0x4:
208 lasat_board_info.li_cpu_hz =
209 lasat_board_info.li_bus_hz +
210 lasat_board_info.li_bus_hz +
211 lasat_board_info.li_bus_hz;
212 break;
213 }
214
215 /* Flash size */
216 switch (LASAT_W1_FLASHSIZE(cfg1)) {
217 case 0:
218 lasat_board_info.li_flash_size = 0x200000;
219 break;
220 case 1:
221 lasat_board_info.li_flash_size = 0x400000;
222 break;
223 case 2:
224 lasat_board_info.li_flash_size = 0x800000;
225 break;
226 case 3:
227 lasat_board_info.li_flash_size = 0x1000000;
228 break;
229 case 4:
230 lasat_board_info.li_flash_size = 0x2000000;
231 break;
232 }
233
234 init_flash_sizes();
235
236 lasat_board_info.li_bmid = LASAT_W0_BMID(cfg0);
237 lasat_board_info.li_prid = lasat_board_info.li_eeprom_info.prid;
238 if (lasat_board_info.li_prid == 0xffff || lasat_board_info.li_prid == 0)
239 lasat_board_info.li_prid = lasat_board_info.li_bmid;
240
241 /* Base model stuff */
242 if (lasat_board_info.li_bmid > i_n_base_models)
243 lasat_board_info.li_bmid = i_n_base_models;
244 strcpy(lasat_board_info.li_bmstr,
245 i_txt_base_models[lasat_board_info.li_bmid]);
246
247 /* Product ID dependent values */
248 c = lasat_board_info.li_prid;
249 if (c >= i_n_prids) {
250 strcpy(lasat_board_info.li_namestr, "Unknown Model");
251 strcpy(lasat_board_info.li_typestr, "Unknown Type");
252 } else {
253 ppi = &vendor_info_table[0].vi_product_info[c];
254 strcpy(lasat_board_info.li_namestr, ppi->pi_name);
255 if (ppi->pi_type)
256 strcpy(lasat_board_info.li_typestr, ppi->pi_type);
257 else
258 sprintf(lasat_board_info.li_typestr, "%d", 10 * c);
259 }
260
261#if defined(CONFIG_INET) && defined(CONFIG_SYSCTL)
262 update_bcastaddr();
263#endif
264
265 return 0;
266}
267
268void lasat_write_eeprom_info(void)
269{
270 unsigned long crc;
271
272 /* Generate the CRC */
273 crc = EEPROM_CRC((unsigned char *)(&lasat_board_info.li_eeprom_info),
274 sizeof(struct lasat_eeprom_struct) - 4);
275 lasat_board_info.li_eeprom_info.crc32 = crc;
276
277 /* Write the EEPROM info */
278 EEPROMWrite(0, (unsigned char *)&lasat_board_info.li_eeprom_info,
279 sizeof(struct lasat_eeprom_struct));
280}
diff --git a/arch/mips/lasat/lasat_models.h b/arch/mips/lasat/lasat_models.h
new file mode 100644
index 000000000000..e1cbd26ae1b3
--- /dev/null
+++ b/arch/mips/lasat/lasat_models.h
@@ -0,0 +1,67 @@
1/*
2 * Model description tables
3 */
4#include <linux/kernel.h>
5
6struct product_info {
7 const char *pi_name;
8 const char *pi_type;
9};
10
11struct vendor_info {
12 const char *vi_name;
13 const struct product_info *vi_product_info;
14};
15
16/*
17 * Base models
18 */
19static const char * const txt_base_models[] = {
20 "MQ 2", "MQ Pro", "SP 25", "SP 50", "SP 100", "SP 5000", "SP 7000",
21 "SP 1000", "Unknown"
22};
23#define N_BASE_MODELS (ARRAY_SIZE(txt_base_models) - 1)
24
25/*
26 * Eicon Networks
27 */
28static const char txt_en_mq[] = "Masquerade";
29static const char txt_en_sp[] = "Safepipe";
30
31static const struct product_info product_info_eicon[] = {
32 { txt_en_mq, "II" }, /* 0 */
33 { txt_en_mq, "Pro" }, /* 1 */
34 { txt_en_sp, "25" }, /* 2 */
35 { txt_en_sp, "50" }, /* 3 */
36 { txt_en_sp, "100" }, /* 4 */
37 { txt_en_sp, "5000" }, /* 5 */
38 { txt_en_sp, "7000" }, /* 6 */
39 { txt_en_sp, "30" }, /* 7 */
40 { txt_en_sp, "5100" }, /* 8 */
41 { txt_en_sp, "7100" }, /* 9 */
42 { txt_en_sp, "1110" }, /* 10 */
43 { txt_en_sp, "3020" }, /* 11 */
44 { txt_en_sp, "3030" }, /* 12 */
45 { txt_en_sp, "5020" }, /* 13 */
46 { txt_en_sp, "5030" }, /* 14 */
47 { txt_en_sp, "1120" }, /* 15 */
48 { txt_en_sp, "1130" }, /* 16 */
49 { txt_en_sp, "6010" }, /* 17 */
50 { txt_en_sp, "6110" }, /* 18 */
51 { txt_en_sp, "6210" }, /* 19 */
52 { txt_en_sp, "1020" }, /* 20 */
53 { txt_en_sp, "1040" }, /* 21 */
54 { txt_en_sp, "1050" }, /* 22 */
55 { txt_en_sp, "1060" }, /* 23 */
56};
57
58#define N_PRIDS ARRAY_SIZE(product_info_eicon)
59
60/*
61 * The vendor table
62 */
63static struct vendor_info const vendor_info_table[] = {
64 { "Eicon Networks", product_info_eicon },
65};
66
67#define N_VENDORS ARRAY_SIZE(vendor_info_table)
diff --git a/arch/mips/lasat/picvue.c b/arch/mips/lasat/picvue.c
new file mode 100644
index 000000000000..6471d0663fd8
--- /dev/null
+++ b/arch/mips/lasat/picvue.c
@@ -0,0 +1,244 @@
1/*
2 * Picvue PVC160206 display driver
3 *
4 * Brian Murphy <brian@murphy.dk>
5 *
6 */
7#include <linux/kernel.h>
8#include <linux/delay.h>
9#include <asm/bootinfo.h>
10#include <asm/lasat/lasat.h>
11#include <linux/module.h>
12#include <linux/init.h>
13#include <linux/errno.h>
14#include <linux/string.h>
15
16#include "picvue.h"
17
18#define PVC_BUSY 0x80
19#define PVC_NLINES 2
20#define PVC_DISPMEM 80
21#define PVC_LINELEN PVC_DISPMEM / PVC_NLINES
22
23struct pvc_defs *picvue;
24
25DECLARE_MUTEX(pvc_sem);
26
27static void pvc_reg_write(u32 val)
28{
29 *picvue->reg = val;
30}
31
32static u32 pvc_reg_read(void)
33{
34 u32 tmp = *picvue->reg;
35 return tmp;
36}
37
38static void pvc_write_byte(u32 data, u8 byte)
39{
40 data |= picvue->e;
41 pvc_reg_write(data);
42 data &= ~picvue->data_mask;
43 data |= byte << picvue->data_shift;
44 pvc_reg_write(data);
45 ndelay(220);
46 pvc_reg_write(data & ~picvue->e);
47 ndelay(220);
48}
49
50static u8 pvc_read_byte(u32 data)
51{
52 u8 byte;
53
54 data |= picvue->e;
55 pvc_reg_write(data);
56 ndelay(220);
57 byte = (pvc_reg_read() & picvue->data_mask) >> picvue->data_shift;
58 data &= ~picvue->e;
59 pvc_reg_write(data);
60 ndelay(220);
61 return byte;
62}
63
64static u8 pvc_read_data(void)
65{
66 u32 data = pvc_reg_read();
67 u8 byte;
68 data |= picvue->rw;
69 data &= ~picvue->rs;
70 pvc_reg_write(data);
71 ndelay(40);
72 byte = pvc_read_byte(data);
73 data |= picvue->rs;
74 pvc_reg_write(data);
75 return byte;
76}
77
78#define TIMEOUT 1000
79static int pvc_wait(void)
80{
81 int i = TIMEOUT;
82 int err = 0;
83
84 while ((pvc_read_data() & PVC_BUSY) && i)
85 i--;
86 if (i == 0)
87 err = -ETIME;
88
89 return err;
90}
91
92#define MODE_INST 0
93#define MODE_DATA 1
94static void pvc_write(u8 byte, int mode)
95{
96 u32 data = pvc_reg_read();
97 data &= ~picvue->rw;
98 if (mode == MODE_DATA)
99 data |= picvue->rs;
100 else
101 data &= ~picvue->rs;
102 pvc_reg_write(data);
103 ndelay(40);
104 pvc_write_byte(data, byte);
105 if (mode == MODE_DATA)
106 data &= ~picvue->rs;
107 else
108 data |= picvue->rs;
109 pvc_reg_write(data);
110 pvc_wait();
111}
112
113void pvc_write_string(const unsigned char *str, u8 addr, int line)
114{
115 int i = 0;
116
117 if (line > 0 && (PVC_NLINES > 1))
118 addr += 0x40 * line;
119 pvc_write(0x80 | addr, MODE_INST);
120
121 while (*str != 0 && i < PVC_LINELEN) {
122 pvc_write(*str++, MODE_DATA);
123 i++;
124 }
125}
126
127void pvc_write_string_centered(const unsigned char *str, int line)
128{
129 int len = strlen(str);
130 u8 addr;
131
132 if (len > PVC_VISIBLE_CHARS)
133 addr = 0;
134 else
135 addr = (PVC_VISIBLE_CHARS - strlen(str))/2;
136
137 pvc_write_string(str, addr, line);
138}
139
140void pvc_dump_string(const unsigned char *str)
141{
142 int len = strlen(str);
143
144 pvc_write_string(str, 0, 0);
145 if (len > PVC_VISIBLE_CHARS)
146 pvc_write_string(&str[PVC_VISIBLE_CHARS], 0, 1);
147}
148
149#define BM_SIZE 8
150#define MAX_PROGRAMMABLE_CHARS 8
151int pvc_program_cg(int charnum, u8 bitmap[BM_SIZE])
152{
153 int i;
154 int addr;
155
156 if (charnum > MAX_PROGRAMMABLE_CHARS)
157 return -ENOENT;
158
159 addr = charnum * 8;
160 pvc_write(0x40 | addr, MODE_INST);
161
162 for (i = 0; i < BM_SIZE; i++)
163 pvc_write(bitmap[i], MODE_DATA);
164 return 0;
165}
166
167#define FUNC_SET_CMD 0x20
168#define EIGHT_BYTE (1 << 4)
169#define FOUR_BYTE 0
170#define TWO_LINES (1 << 3)
171#define ONE_LINE 0
172#define LARGE_FONT (1 << 2)
173#define SMALL_FONT 0
174
175static void pvc_funcset(u8 cmd)
176{
177 pvc_write(FUNC_SET_CMD | (cmd & (EIGHT_BYTE|TWO_LINES|LARGE_FONT)),
178 MODE_INST);
179}
180
181#define ENTRYMODE_CMD 0x4
182#define AUTO_INC (1 << 1)
183#define AUTO_DEC 0
184#define CURSOR_FOLLOWS_DISP (1 << 0)
185
186static void pvc_entrymode(u8 cmd)
187{
188 pvc_write(ENTRYMODE_CMD | (cmd & (AUTO_INC|CURSOR_FOLLOWS_DISP)),
189 MODE_INST);
190}
191
192#define DISP_CNT_CMD 0x08
193#define DISP_OFF 0
194#define DISP_ON (1 << 2)
195#define CUR_ON (1 << 1)
196#define CUR_BLINK (1 << 0)
197void pvc_dispcnt(u8 cmd)
198{
199 pvc_write(DISP_CNT_CMD | (cmd & (DISP_ON|CUR_ON|CUR_BLINK)), MODE_INST);
200}
201
202#define MOVE_CMD 0x10
203#define DISPLAY (1 << 3)
204#define CURSOR 0
205#define RIGHT (1 << 2)
206#define LEFT 0
207void pvc_move(u8 cmd)
208{
209 pvc_write(MOVE_CMD | (cmd & (DISPLAY|RIGHT)), MODE_INST);
210}
211
212#define CLEAR_CMD 0x1
213void pvc_clear(void)
214{
215 pvc_write(CLEAR_CMD, MODE_INST);
216}
217
218#define HOME_CMD 0x2
219void pvc_home(void)
220{
221 pvc_write(HOME_CMD, MODE_INST);
222}
223
224int pvc_init(void)
225{
226 u8 cmd = EIGHT_BYTE;
227
228 if (PVC_NLINES == 2)
229 cmd |= (SMALL_FONT|TWO_LINES);
230 else
231 cmd |= (LARGE_FONT|ONE_LINE);
232 pvc_funcset(cmd);
233 pvc_dispcnt(DISP_ON);
234 pvc_entrymode(AUTO_INC);
235
236 pvc_clear();
237 pvc_write_string_centered("Display", 0);
238 pvc_write_string_centered("Initialized", 1);
239
240 return 0;
241}
242
243module_init(pvc_init);
244MODULE_LICENSE("GPL");
diff --git a/arch/mips/lasat/picvue.h b/arch/mips/lasat/picvue.h
new file mode 100644
index 000000000000..2a96bf971897
--- /dev/null
+++ b/arch/mips/lasat/picvue.h
@@ -0,0 +1,48 @@
1/*
2 * Picvue PVC160206 display driver
3 *
4 * Brian Murphy <brian.murphy@eicon.com>
5 *
6 */
7#include <asm/semaphore.h>
8
9struct pvc_defs {
10 volatile u32 *reg;
11 u32 data_shift;
12 u32 data_mask;
13 u32 e;
14 u32 rw;
15 u32 rs;
16};
17
18extern struct pvc_defs *picvue;
19
20#define PVC_NLINES 2
21#define PVC_DISPMEM 80
22#define PVC_LINELEN PVC_DISPMEM / PVC_NLINES
23#define PVC_VISIBLE_CHARS 16
24
25void pvc_write_string(const unsigned char *str, u8 addr, int line);
26void pvc_write_string_centered(const unsigned char *str, int line);
27void pvc_dump_string(const unsigned char *str);
28
29#define BM_SIZE 8
30#define MAX_PROGRAMMABLE_CHARS 8
31int pvc_program_cg(int charnum, u8 bitmap[BM_SIZE]);
32
33void pvc_dispcnt(u8 cmd);
34#define DISP_OFF 0
35#define DISP_ON (1 << 2)
36#define CUR_ON (1 << 1)
37#define CUR_BLINK (1 << 0)
38
39void pvc_move(u8 cmd);
40#define DISPLAY (1 << 3)
41#define CURSOR 0
42#define RIGHT (1 << 2)
43#define LEFT 0
44
45void pvc_clear(void);
46void pvc_home(void);
47
48extern struct semaphore pvc_sem;
diff --git a/arch/mips/lasat/picvue_proc.c b/arch/mips/lasat/picvue_proc.c
new file mode 100644
index 000000000000..9947c1525822
--- /dev/null
+++ b/arch/mips/lasat/picvue_proc.c
@@ -0,0 +1,191 @@
1/*
2 * Picvue PVC160206 display driver
3 *
4 * Brian Murphy <brian.murphy@eicon.com>
5 *
6 */
7#include <linux/kernel.h>
8#include <linux/module.h>
9#include <linux/init.h>
10#include <linux/errno.h>
11
12#include <linux/proc_fs.h>
13#include <linux/interrupt.h>
14
15#include <linux/timer.h>
16
17#include "picvue.h"
18
19static char pvc_lines[PVC_NLINES][PVC_LINELEN+1];
20static int pvc_linedata[PVC_NLINES];
21static struct proc_dir_entry *pvc_display_dir;
22static char *pvc_linename[PVC_NLINES] = {"line1", "line2"};
23#define DISPLAY_DIR_NAME "display"
24static int scroll_dir, scroll_interval;
25
26static struct timer_list timer;
27
28static void pvc_display(unsigned long data)
29{
30 int i;
31
32 pvc_clear();
33 for (i = 0; i < PVC_NLINES; i++)
34 pvc_write_string(pvc_lines[i], 0, i);
35}
36
37static DECLARE_TASKLET(pvc_display_tasklet, &pvc_display, 0);
38
39static int pvc_proc_read_line(char *page, char **start,
40 off_t off, int count,
41 int *eof, void *data)
42{
43 char *origpage = page;
44 int lineno = *(int *)data;
45
46 if (lineno < 0 || lineno > PVC_NLINES) {
47 printk(KERN_WARNING "proc_read_line: invalid lineno %d\n", lineno);
48 return 0;
49 }
50
51 down(&pvc_sem);
52 page += sprintf(page, "%s\n", pvc_lines[lineno]);
53 up(&pvc_sem);
54
55 return page - origpage;
56}
57
58static int pvc_proc_write_line(struct file *file, const char *buffer,
59 unsigned long count, void *data)
60{
61 int origcount = count;
62 int lineno = *(int *)data;
63
64 if (lineno < 0 || lineno > PVC_NLINES) {
65 printk(KERN_WARNING "proc_write_line: invalid lineno %d\n",
66 lineno);
67 return origcount;
68 }
69
70 if (count > PVC_LINELEN)
71 count = PVC_LINELEN;
72
73 if (buffer[count-1] == '\n')
74 count--;
75
76 down(&pvc_sem);
77 strncpy(pvc_lines[lineno], buffer, count);
78 pvc_lines[lineno][count] = '\0';
79 up(&pvc_sem);
80
81 tasklet_schedule(&pvc_display_tasklet);
82
83 return origcount;
84}
85
86static int pvc_proc_write_scroll(struct file *file, const char *buffer,
87 unsigned long count, void *data)
88{
89 int origcount = count;
90 int cmd = simple_strtol(buffer, NULL, 10);
91
92 down(&pvc_sem);
93 if (scroll_interval != 0)
94 del_timer(&timer);
95
96 if (cmd == 0) {
97 scroll_dir = 0;
98 scroll_interval = 0;
99 } else {
100 if (cmd < 0) {
101 scroll_dir = -1;
102 scroll_interval = -cmd;
103 } else {
104 scroll_dir = 1;
105 scroll_interval = cmd;
106 }
107 add_timer(&timer);
108 }
109 up(&pvc_sem);
110
111 return origcount;
112}
113
114static int pvc_proc_read_scroll(char *page, char **start,
115 off_t off, int count,
116 int *eof, void *data)
117{
118 char *origpage = page;
119
120 down(&pvc_sem);
121 page += sprintf(page, "%d\n", scroll_dir * scroll_interval);
122 up(&pvc_sem);
123
124 return page - origpage;
125}
126
127
128void pvc_proc_timerfunc(unsigned long data)
129{
130 if (scroll_dir < 0)
131 pvc_move(DISPLAY|RIGHT);
132 else if (scroll_dir > 0)
133 pvc_move(DISPLAY|LEFT);
134
135 timer.expires = jiffies + scroll_interval;
136 add_timer(&timer);
137}
138
139static void pvc_proc_cleanup(void)
140{
141 int i;
142 for (i = 0; i < PVC_NLINES; i++)
143 remove_proc_entry(pvc_linename[i], pvc_display_dir);
144 remove_proc_entry("scroll", pvc_display_dir);
145 remove_proc_entry(DISPLAY_DIR_NAME, NULL);
146
147 del_timer(&timer);
148}
149
150static int __init pvc_proc_init(void)
151{
152 struct proc_dir_entry *proc_entry;
153 int i;
154
155 pvc_display_dir = proc_mkdir(DISPLAY_DIR_NAME, NULL);
156 if (pvc_display_dir == NULL)
157 goto error;
158
159 for (i = 0; i < PVC_NLINES; i++) {
160 strcpy(pvc_lines[i], "");
161 pvc_linedata[i] = i;
162 }
163 for (i = 0; i < PVC_NLINES; i++) {
164 proc_entry = create_proc_entry(pvc_linename[i], 0644,
165 pvc_display_dir);
166 if (proc_entry == NULL)
167 goto error;
168
169 proc_entry->read_proc = pvc_proc_read_line;
170 proc_entry->write_proc = pvc_proc_write_line;
171 proc_entry->data = &pvc_linedata[i];
172 }
173 proc_entry = create_proc_entry("scroll", 0644, pvc_display_dir);
174 if (proc_entry == NULL)
175 goto error;
176
177 proc_entry->write_proc = pvc_proc_write_scroll;
178 proc_entry->read_proc = pvc_proc_read_scroll;
179
180 init_timer(&timer);
181 timer.function = pvc_proc_timerfunc;
182
183 return 0;
184error:
185 pvc_proc_cleanup();
186 return -ENOMEM;
187}
188
189module_init(pvc_proc_init);
190module_exit(pvc_proc_cleanup);
191MODULE_LICENSE("GPL");
diff --git a/arch/mips/lasat/prom.c b/arch/mips/lasat/prom.c
new file mode 100644
index 000000000000..209edcc26f07
--- /dev/null
+++ b/arch/mips/lasat/prom.c
@@ -0,0 +1,126 @@
1/*
2 * PROM interface routines.
3 */
4#include <linux/types.h>
5#include <linux/init.h>
6#include <linux/string.h>
7#include <linux/ctype.h>
8#include <linux/kernel.h>
9#include <linux/mm.h>
10#include <linux/bootmem.h>
11#include <linux/ioport.h>
12#include <asm/bootinfo.h>
13#include <asm/lasat/lasat.h>
14#include <asm/cpu.h>
15
16#include "at93c.h"
17#include <asm/lasat/eeprom.h>
18#include "prom.h"
19
20#define RESET_VECTOR 0xbfc00000
21#define PROM_JUMP_TABLE_ENTRY(n) (*((u32 *)(RESET_VECTOR + 0x20) + n))
22#define PROM_DISPLAY_ADDR PROM_JUMP_TABLE_ENTRY(0)
23#define PROM_PUTC_ADDR PROM_JUMP_TABLE_ENTRY(1)
24#define PROM_MONITOR_ADDR PROM_JUMP_TABLE_ENTRY(2)
25
26static void null_prom_display(const char *string, int pos, int clear)
27{
28}
29
30static void null_prom_monitor(void)
31{
32}
33
34static void null_prom_putc(char c)
35{
36}
37
38/* these are functions provided by the bootloader */
39static void (*__prom_putc)(char c) = null_prom_putc;
40
41void prom_putchar(char c)
42{
43 __prom_putc(c);
44}
45
46void (*prom_display)(const char *string, int pos, int clear) =
47 null_prom_display;
48void (*prom_monitor)(void) = null_prom_monitor;
49
50unsigned int lasat_ndelay_divider;
51
52static void setup_prom_vectors(void)
53{
54 u32 version = *(u32 *)(RESET_VECTOR + 0x90);
55
56 if (version >= 307) {
57 prom_display = (void *)PROM_DISPLAY_ADDR;
58 __prom_putc = (void *)PROM_PUTC_ADDR;
59 prom_monitor = (void *)PROM_MONITOR_ADDR;
60 }
61 printk(KERN_DEBUG "prom vectors set up\n");
62}
63
64static struct at93c_defs at93c_defs[N_MACHTYPES] = {
65 {
66 .reg = (void *)AT93C_REG_100,
67 .rdata_reg = (void *)AT93C_RDATA_REG_100,
68 .rdata_shift = AT93C_RDATA_SHIFT_100,
69 .wdata_shift = AT93C_WDATA_SHIFT_100,
70 .cs = AT93C_CS_M_100,
71 .clk = AT93C_CLK_M_100
72 }, {
73 .reg = (void *)AT93C_REG_200,
74 .rdata_reg = (void *)AT93C_RDATA_REG_200,
75 .rdata_shift = AT93C_RDATA_SHIFT_200,
76 .wdata_shift = AT93C_WDATA_SHIFT_200,
77 .cs = AT93C_CS_M_200,
78 .clk = AT93C_CLK_M_200
79 },
80};
81
82void __init prom_init(void)
83{
84 int argc = fw_arg0;
85 char **argv = (char **) fw_arg1;
86
87 setup_prom_vectors();
88
89 if (current_cpu_data.cputype == CPU_R5000) {
90 printk(KERN_INFO "LASAT 200 board\n");
91 mips_machtype = MACH_LASAT_200;
92 lasat_ndelay_divider = LASAT_200_DIVIDER;
93 } else {
94 printk(KERN_INFO "LASAT 100 board\n");
95 mips_machtype = MACH_LASAT_100;
96 lasat_ndelay_divider = LASAT_100_DIVIDER;
97 }
98
99 at93c = &at93c_defs[mips_machtype];
100
101 lasat_init_board_info(); /* Read info from EEPROM */
102
103 /* Get the command line */
104 if (argc > 0) {
105 strncpy(arcs_cmdline, argv[0], CL_SIZE-1);
106 arcs_cmdline[CL_SIZE-1] = '\0';
107 }
108
109 /* Set the I/O base address */
110 set_io_port_base(KSEG1);
111
112 /* Set memory regions */
113 ioport_resource.start = 0;
114 ioport_resource.end = 0xffffffff; /* Wrong, fixme. */
115
116 add_memory_region(0, lasat_board_info.li_memsize, BOOT_MEM_RAM);
117}
118
119void __init prom_free_prom_memory(void)
120{
121}
122
123const char *get_system_type(void)
124{
125 return lasat_board_info.li_bmstr;
126}
diff --git a/arch/mips/lasat/prom.h b/arch/mips/lasat/prom.h
new file mode 100644
index 000000000000..337acbc27442
--- /dev/null
+++ b/arch/mips/lasat/prom.h
@@ -0,0 +1,7 @@
1#ifndef __PROM_H
2#define __PROM_H
3
4extern void (*prom_display)(const char *string, int pos, int clear);
5extern void (*prom_monitor)(void);
6
7#endif /* __PROM_H */
diff --git a/arch/mips/lasat/reset.c b/arch/mips/lasat/reset.c
new file mode 100644
index 000000000000..b1e7a89fb730
--- /dev/null
+++ b/arch/mips/lasat/reset.c
@@ -0,0 +1,61 @@
1/*
2 * Thomas Horsten <thh@lasat.com>
3 * Copyright (C) 2000 LASAT Networks A/S.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Reset the LASAT board.
19 */
20#include <linux/kernel.h>
21#include <linux/pm.h>
22
23#include <asm/reboot.h>
24#include <asm/system.h>
25#include <asm/lasat/lasat.h>
26
27#include "picvue.h"
28#include "prom.h"
29
30static void lasat_machine_restart(char *command);
31static void lasat_machine_halt(void);
32
33/* Used to set machine to boot in service mode via /proc interface */
34int lasat_boot_to_service;
35
36static void lasat_machine_restart(char *command)
37{
38 local_irq_disable();
39
40 if (lasat_boot_to_service) {
41 *(volatile unsigned int *)0xa0000024 = 0xdeadbeef;
42 *(volatile unsigned int *)0xa00000fc = 0xfedeabba;
43 }
44 *lasat_misc->reset_reg = 0xbedead;
45 for (;;) ;
46}
47
48static void lasat_machine_halt(void)
49{
50 local_irq_disable();
51
52 prom_monitor();
53 for (;;) ;
54}
55
56void lasat_reboot_setup(void)
57{
58 _machine_restart = lasat_machine_restart;
59 _machine_halt = lasat_machine_halt;
60 pm_power_off = lasat_machine_halt;
61}
diff --git a/arch/mips/lasat/serial.c b/arch/mips/lasat/serial.c
new file mode 100644
index 000000000000..205bd397d75b
--- /dev/null
+++ b/arch/mips/lasat/serial.c
@@ -0,0 +1,94 @@
1/*
2 * Registration of Lasat UART platform device.
3 *
4 * Copyright (C) 2007 Brian Murphy <brian@murphy.dk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/errno.h>
21#include <linux/init.h>
22#include <linux/ioport.h>
23#include <linux/platform_device.h>
24#include <linux/serial_8250.h>
25
26#include <asm/bootinfo.h>
27#include <asm/lasat/lasat.h>
28#include <asm/lasat/serial.h>
29
30static struct resource lasat_serial_res[2] __initdata;
31
32static struct plat_serial8250_port lasat_serial8250_port[] = {
33 {
34 .iotype = UPIO_MEM,
35 .flags = UPF_IOREMAP | UPF_BOOT_AUTOCONF |
36 UPF_SKIP_TEST,
37 },
38 {},
39};
40
41static __init int lasat_uart_add(void)
42{
43 struct platform_device *pdev;
44 int retval;
45
46 pdev = platform_device_alloc("serial8250", -1);
47 if (!pdev)
48 return -ENOMEM;
49
50 if (mips_machtype == MACH_LASAT_100) {
51 lasat_serial_res[0].start = KSEG1ADDR(LASAT_UART_REGS_BASE_100);
52 lasat_serial_res[0].end = lasat_serial_res[0].start + LASAT_UART_REGS_SHIFT_100 * 8 - 1;
53 lasat_serial_res[0].flags = IORESOURCE_MEM;
54 lasat_serial_res[1].start = LASATINT_UART_100;
55 lasat_serial_res[1].end = LASATINT_UART_100;
56 lasat_serial_res[1].flags = IORESOURCE_IRQ;
57
58 lasat_serial8250_port[0].mapbase = LASAT_UART_REGS_BASE_100;
59 lasat_serial8250_port[0].uartclk = LASAT_BASE_BAUD_100 * 16;
60 lasat_serial8250_port[0].regshift = LASAT_UART_REGS_SHIFT_100;
61 lasat_serial8250_port[0].irq = LASATINT_UART_100;
62 } else {
63 lasat_serial_res[0].start = KSEG1ADDR(LASAT_UART_REGS_BASE_200);
64 lasat_serial_res[0].end = lasat_serial_res[0].start + LASAT_UART_REGS_SHIFT_200 * 8 - 1;
65 lasat_serial_res[0].flags = IORESOURCE_MEM;
66 lasat_serial_res[1].start = LASATINT_UART_200;
67 lasat_serial_res[1].end = LASATINT_UART_200;
68 lasat_serial_res[1].flags = IORESOURCE_IRQ;
69
70 lasat_serial8250_port[0].mapbase = LASAT_UART_REGS_BASE_200;
71 lasat_serial8250_port[0].uartclk = LASAT_BASE_BAUD_200 * 16;
72 lasat_serial8250_port[0].regshift = LASAT_UART_REGS_SHIFT_200;
73 lasat_serial8250_port[0].irq = LASATINT_UART_200;
74 }
75
76 pdev->id = PLAT8250_DEV_PLATFORM;
77 pdev->dev.platform_data = lasat_serial8250_port;
78
79 retval = platform_device_add_resources(pdev, lasat_serial_res, ARRAY_SIZE(lasat_serial_res));
80 if (retval)
81 goto err_free_device;
82
83 retval = platform_device_add(pdev);
84 if (retval)
85 goto err_free_device;
86
87 return 0;
88
89err_free_device:
90 platform_device_put(pdev);
91
92 return retval;
93}
94device_initcall(lasat_uart_add);
diff --git a/arch/mips/lasat/setup.c b/arch/mips/lasat/setup.c
new file mode 100644
index 000000000000..54827d0174bf
--- /dev/null
+++ b/arch/mips/lasat/setup.c
@@ -0,0 +1,154 @@
1/*
2 * Carsten Langgaard, carstenl@mips.com
3 * Copyright (C) 1999 MIPS Technologies, Inc. All rights reserved.
4 *
5 * Thomas Horsten <thh@lasat.com>
6 * Copyright (C) 2000 LASAT Networks A/S.
7 *
8 * Brian Murphy <brian@murphy.dk>
9 *
10 * This program is free software; you can distribute it and/or modify it
11 * under the terms of the GNU General Public License (Version 2) as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22 *
23 * Lasat specific setup.
24 */
25#include <linux/init.h>
26#include <linux/sched.h>
27#include <linux/pci.h>
28#include <linux/interrupt.h>
29#include <linux/tty.h>
30
31#include <asm/time.h>
32#include <asm/cpu.h>
33#include <asm/bootinfo.h>
34#include <asm/irq.h>
35#include <asm/lasat/lasat.h>
36#include <asm/lasat/serial.h>
37
38#ifdef CONFIG_PICVUE
39#include <linux/notifier.h>
40#endif
41
42#include "ds1603.h"
43#include <asm/lasat/ds1603.h>
44#include <asm/lasat/picvue.h>
45#include <asm/lasat/eeprom.h>
46
47#include "prom.h"
48
49int lasat_command_line;
50void lasatint_init(void);
51
52extern void lasat_reboot_setup(void);
53extern void pcisetup(void);
54extern void edhac_init(void *, void *, void *);
55extern void addrflt_init(void);
56
57struct lasat_misc lasat_misc_info[N_MACHTYPES] = {
58 {
59 .reset_reg = (void *)KSEG1ADDR(0x1c840000),
60 .flash_wp_reg = (void *)KSEG1ADDR(0x1c800000), 2
61 }, {
62 .reset_reg = (void *)KSEG1ADDR(0x11080000),
63 .flash_wp_reg = (void *)KSEG1ADDR(0x11000000), 6
64 }
65};
66
67struct lasat_misc *lasat_misc;
68
69#ifdef CONFIG_DS1603
70static struct ds_defs ds_defs[N_MACHTYPES] = {
71 { (void *)DS1603_REG_100, (void *)DS1603_REG_100,
72 DS1603_RST_100, DS1603_CLK_100, DS1603_DATA_100,
73 DS1603_DATA_SHIFT_100, 0, 0 },
74 { (void *)DS1603_REG_200, (void *)DS1603_DATA_REG_200,
75 DS1603_RST_200, DS1603_CLK_200, DS1603_DATA_200,
76 DS1603_DATA_READ_SHIFT_200, 1, 2000 }
77};
78#endif
79
80#ifdef CONFIG_PICVUE
81#include "picvue.h"
82static struct pvc_defs pvc_defs[N_MACHTYPES] = {
83 { (void *)PVC_REG_100, PVC_DATA_SHIFT_100, PVC_DATA_M_100,
84 PVC_E_100, PVC_RW_100, PVC_RS_100 },
85 { (void *)PVC_REG_200, PVC_DATA_SHIFT_200, PVC_DATA_M_200,
86 PVC_E_200, PVC_RW_200, PVC_RS_200 }
87};
88#endif
89
90static int lasat_panic_display(struct notifier_block *this,
91 unsigned long event, void *ptr)
92{
93#ifdef CONFIG_PICVUE
94 unsigned char *string = ptr;
95 if (string == NULL)
96 string = "Kernel Panic";
97 pvc_dump_string(string);
98#endif
99 return NOTIFY_DONE;
100}
101
102static int lasat_panic_prom_monitor(struct notifier_block *this,
103 unsigned long event, void *ptr)
104{
105 prom_monitor();
106 return NOTIFY_DONE;
107}
108
109static struct notifier_block lasat_panic_block[] =
110{
111 {
112 .notifier_call = lasat_panic_display,
113 .priority = INT_MAX
114 }, {
115 .notifier_call = lasat_panic_prom_monitor,
116 .priority = INT_MIN
117 }
118};
119
120void plat_time_init(void)
121{
122 mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2;
123}
124
125void __init plat_timer_setup(struct irqaction *irq)
126{
127 change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5);
128}
129
130void __init plat_mem_setup(void)
131{
132 int i;
133 lasat_misc = &lasat_misc_info[mips_machtype];
134#ifdef CONFIG_PICVUE
135 picvue = &pvc_defs[mips_machtype];
136#endif
137
138 /* Set up panic notifier */
139 for (i = 0; i < ARRAY_SIZE(lasat_panic_block); i++)
140 atomic_notifier_chain_register(&panic_notifier_list,
141 &lasat_panic_block[i]);
142
143 lasat_reboot_setup();
144
145#ifdef CONFIG_DS1603
146 ds1603 = &ds_defs[mips_machtype];
147#endif
148
149#ifdef DYNAMIC_SERIAL_INIT
150 serial_init();
151#endif
152
153 pr_info("Lasat specific initialization complete\n");
154}
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
new file mode 100644
index 000000000000..389336c4ecc5
--- /dev/null
+++ b/arch/mips/lasat/sysctl.c
@@ -0,0 +1,456 @@
1/*
2 * Thomas Horsten <thh@lasat.com>
3 * Copyright (C) 2000 LASAT Networks A/S.
4 *
5 * This program is free software; you can distribute it and/or modify it
6 * under the terms of the GNU General Public License (Version 2) as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
17 *
18 * Routines specific to the LASAT boards
19 */
20#include <linux/types.h>
21#include <asm/lasat/lasat.h>
22
23#include <linux/module.h>
24#include <linux/sysctl.h>
25#include <linux/stddef.h>
26#include <linux/init.h>
27#include <linux/fs.h>
28#include <linux/ctype.h>
29#include <linux/string.h>
30#include <linux/net.h>
31#include <linux/inet.h>
32#include <linux/mutex.h>
33#include <linux/uaccess.h>
34
35#include <asm/time.h>
36
37#include "sysctl.h"
38#include "ds1603.h"
39
40static DEFINE_MUTEX(lasat_info_mutex);
41
42/* Strategy function to write EEPROM after changing string entry */
43int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
44 void *oldval, size_t *oldlenp,
45 void *newval, size_t newlen)
46{
47 int r;
48
49 mutex_lock(&lasat_info_mutex);
50 r = sysctl_string(table, name,
51 nlen, oldval, oldlenp, newval, newlen);
52 if (r < 0) {
53 mutex_unlock(&lasat_info_mutex);
54 return r;
55 }
56 if (newval && newlen)
57 lasat_write_eeprom_info();
58 mutex_unlock(&lasat_info_mutex);
59
60 return 1;
61}
62
63
64/* And the same for proc */
65int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
66 void *buffer, size_t *lenp, loff_t *ppos)
67{
68 int r;
69
70 mutex_lock(&lasat_info_mutex);
71 r = proc_dostring(table, write, filp, buffer, lenp, ppos);
72 if ((!write) || r) {
73 mutex_unlock(&lasat_info_mutex);
74 return r;
75 }
76 lasat_write_eeprom_info();
77 mutex_unlock(&lasat_info_mutex);
78
79 return 0;
80}
81
82/* proc function to write EEPROM after changing int entry */
83int proc_dolasatint(ctl_table *table, int write, struct file *filp,
84 void *buffer, size_t *lenp, loff_t *ppos)
85{
86 int r;
87
88 mutex_lock(&lasat_info_mutex);
89 r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
90 if ((!write) || r) {
91 mutex_unlock(&lasat_info_mutex);
92 return r;
93 }
94 lasat_write_eeprom_info();
95 mutex_unlock(&lasat_info_mutex);
96
97 return 0;
98}
99
100static int rtctmp;
101
102#ifdef CONFIG_DS1603
103/* proc function to read/write RealTime Clock */
104int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
105 void *buffer, size_t *lenp, loff_t *ppos)
106{
107 int r;
108
109 mutex_lock(&lasat_info_mutex);
110 if (!write) {
111 rtctmp = read_persistent_clock();
112 /* check for time < 0 and set to 0 */
113 if (rtctmp < 0)
114 rtctmp = 0;
115 }
116 r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
117 if ((!write) || r) {
118 mutex_unlock(&lasat_info_mutex);
119 return r;
120 }
121 rtc_mips_set_mmss(rtctmp);
122 mutex_unlock(&lasat_info_mutex);
123
124 return 0;
125}
126#endif
127
128/* Sysctl for setting the IP addresses */
129int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen,
130 void *oldval, size_t *oldlenp,
131 void *newval, size_t newlen)
132{
133 int r;
134
135 mutex_lock(&lasat_info_mutex);
136 r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen);
137 if (r < 0) {
138 mutex_unlock(&lasat_info_mutex);
139 return r;
140 }
141 if (newval && newlen)
142 lasat_write_eeprom_info();
143 mutex_unlock(&lasat_info_mutex);
144
145 return 1;
146}
147
148#ifdef CONFIG_DS1603
149/* Same for RTC */
150int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen,
151 void *oldval, size_t *oldlenp,
152 void *newval, size_t newlen)
153{
154 int r;
155
156 mutex_lock(&lasat_info_mutex);
157 rtctmp = read_persistent_clock();
158 if (rtctmp < 0)
159 rtctmp = 0;
160 r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen);
161 if (r < 0) {
162 mutex_unlock(&lasat_info_mutex);
163 return r;
164 }
165 if (newval && newlen)
166 rtc_mips_set_mmss(rtctmp);
167 mutex_unlock(&lasat_info_mutex);
168
169 return 1;
170}
171#endif
172
173#ifdef CONFIG_INET
174static char lasat_bcastaddr[16];
175
176void update_bcastaddr(void)
177{
178 unsigned int ip;
179
180 ip = (lasat_board_info.li_eeprom_info.ipaddr &
181 lasat_board_info.li_eeprom_info.netmask) |
182 ~lasat_board_info.li_eeprom_info.netmask;
183
184 sprintf(lasat_bcastaddr, "%d.%d.%d.%d",
185 (ip) & 0xff,
186 (ip >> 8) & 0xff,
187 (ip >> 16) & 0xff,
188 (ip >> 24) & 0xff);
189}
190
191static char proc_lasat_ipbuf[32];
192
193/* Parsing of IP address */
194int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
195 void *buffer, size_t *lenp, loff_t *ppos)
196{
197 unsigned int ip;
198 char *p, c;
199 int len;
200
201 if (!table->data || !table->maxlen || !*lenp ||
202 (*ppos && !write)) {
203 *lenp = 0;
204 return 0;
205 }
206
207 mutex_lock(&lasat_info_mutex);
208 if (write) {
209 len = 0;
210 p = buffer;
211 while (len < *lenp) {
212 if (get_user(c, p++)) {
213 mutex_unlock(&lasat_info_mutex);
214 return -EFAULT;
215 }
216 if (c == 0 || c == '\n')
217 break;
218 len++;
219 }
220 if (len >= sizeof(proc_lasat_ipbuf)-1)
221 len = sizeof(proc_lasat_ipbuf) - 1;
222 if (copy_from_user(proc_lasat_ipbuf, buffer, len)) {
223 mutex_unlock(&lasat_info_mutex);
224 return -EFAULT;
225 }
226 proc_lasat_ipbuf[len] = 0;
227 *ppos += *lenp;
228 /* Now see if we can convert it to a valid IP */
229 ip = in_aton(proc_lasat_ipbuf);
230 *(unsigned int *)(table->data) = ip;
231 lasat_write_eeprom_info();
232 } else {
233 ip = *(unsigned int *)(table->data);
234 sprintf(proc_lasat_ipbuf, "%d.%d.%d.%d",
235 (ip) & 0xff,
236 (ip >> 8) & 0xff,
237 (ip >> 16) & 0xff,
238 (ip >> 24) & 0xff);
239 len = strlen(proc_lasat_ipbuf);
240 if (len > *lenp)
241 len = *lenp;
242 if (len)
243 if (copy_to_user(buffer, proc_lasat_ipbuf, len)) {
244 mutex_unlock(&lasat_info_mutex);
245 return -EFAULT;
246 }
247 if (len < *lenp) {
248 if (put_user('\n', ((char *) buffer) + len)) {
249 mutex_unlock(&lasat_info_mutex);
250 return -EFAULT;
251 }
252 len++;
253 }
254 *lenp = len;
255 *ppos += len;
256 }
257 update_bcastaddr();
258 mutex_unlock(&lasat_info_mutex);
259
260 return 0;
261}
262#endif /* defined(CONFIG_INET) */
263
264static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
265 void *oldval, size_t *oldlenp,
266 void *newval, size_t newlen)
267{
268 int r;
269
270 mutex_lock(&lasat_info_mutex);
271 r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen);
272 if (r < 0) {
273 mutex_unlock(&lasat_info_mutex);
274 return r;
275 }
276
277 if (newval && newlen) {
278 if (name && *name == LASAT_PRID)
279 lasat_board_info.li_eeprom_info.prid = *(int *)newval;
280
281 lasat_write_eeprom_info();
282 lasat_init_board_info();
283 }
284 mutex_unlock(&lasat_info_mutex);
285
286 return 0;
287}
288
289int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
290 void *buffer, size_t *lenp, loff_t *ppos)
291{
292 int r;
293
294 mutex_lock(&lasat_info_mutex);
295 r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
296 if ((!write) || r) {
297 mutex_unlock(&lasat_info_mutex);
298 return r;
299 }
300 if (filp && filp->f_path.dentry) {
301 if (!strcmp(filp->f_path.dentry->d_name.name, "prid"))
302 lasat_board_info.li_eeprom_info.prid =
303 lasat_board_info.li_prid;
304 if (!strcmp(filp->f_path.dentry->d_name.name, "debugaccess"))
305 lasat_board_info.li_eeprom_info.debugaccess =
306 lasat_board_info.li_debugaccess;
307 }
308 lasat_write_eeprom_info();
309 mutex_unlock(&lasat_info_mutex);
310
311 return 0;
312}
313
314extern int lasat_boot_to_service;
315
316#ifdef CONFIG_SYSCTL
317
318static ctl_table lasat_table[] = {
319 {
320 .ctl_name = CTL_UNNUMBERED,
321 .procname = "cpu-hz",
322 .data = &lasat_board_info.li_cpu_hz,
323 .maxlen = sizeof(int),
324 .mode = 0444,
325 .proc_handler = &proc_dointvec,
326 .strategy = &sysctl_intvec
327 },
328 {
329 .ctl_name = CTL_UNNUMBERED,
330 .procname = "bus-hz",
331 .data = &lasat_board_info.li_bus_hz,
332 .maxlen = sizeof(int),
333 .mode = 0444,
334 .proc_handler = &proc_dointvec,
335 .strategy = &sysctl_intvec
336 },
337 {
338 .ctl_name = CTL_UNNUMBERED,
339 .procname = "bmid",
340 .data = &lasat_board_info.li_bmid,
341 .maxlen = sizeof(int),
342 .mode = 0444,
343 .proc_handler = &proc_dointvec,
344 .strategy = &sysctl_intvec
345 },
346 {
347 .ctl_name = CTL_UNNUMBERED,
348 .procname = "prid",
349 .data = &lasat_board_info.li_prid,
350 .maxlen = sizeof(int),
351 .mode = 0644,
352 .proc_handler = &proc_lasat_eeprom_value,
353 .strategy = &sysctl_lasat_eeprom_value
354 },
355#ifdef CONFIG_INET
356 {
357 .ctl_name = CTL_UNNUMBERED,
358 .procname = "ipaddr",
359 .data = &lasat_board_info.li_eeprom_info.ipaddr,
360 .maxlen = sizeof(int),
361 .mode = 0644,
362 .proc_handler = &proc_lasat_ip,
363 .strategy = &sysctl_lasat_intvec
364 },
365 {
366 .ctl_name = LASAT_NETMASK,
367 .procname = "netmask",
368 .data = &lasat_board_info.li_eeprom_info.netmask,
369 .maxlen = sizeof(int),
370 .mode = 0644,
371 .proc_handler = &proc_lasat_ip,
372 .strategy = &sysctl_lasat_intvec
373 },
374 {
375 .ctl_name = CTL_UNNUMBERED,
376 .procname = "bcastaddr",
377 .data = &lasat_bcastaddr,
378 .maxlen = sizeof(lasat_bcastaddr),
379 .mode = 0600,
380 .proc_handler = &proc_dostring,
381 .strategy = &sysctl_string
382 },
383#endif
384 {
385 .ctl_name = CTL_UNNUMBERED,
386 .procname = "passwd_hash",
387 .data = &lasat_board_info.li_eeprom_info.passwd_hash,
388 .maxlen =
389 sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
390 .mode = 0600,
391 .proc_handler = &proc_dolasatstring,
392 .strategy = &sysctl_lasatstring
393 },
394 {
395 .ctl_name = CTL_UNNUMBERED,
396 .procname = "boot-service",
397 .data = &lasat_boot_to_service,
398 .maxlen = sizeof(int),
399 .mode = 0644,
400 .proc_handler = &proc_dointvec,
401 .strategy = &sysctl_intvec
402 },
403#ifdef CONFIG_DS1603
404 {
405 .ctl_name = CTL_UNNUMBERED,
406 .procname = "rtc",
407 .data = &rtctmp,
408 .maxlen = sizeof(int),
409 .mode = 0644,
410 .proc_handler = &proc_dolasatrtc,
411 .strategy = &sysctl_lasat_rtc
412 },
413#endif
414 {
415 .ctl_name = CTL_UNNUMBERED,
416 .procname = "namestr",
417 .data = &lasat_board_info.li_namestr,
418 .maxlen = sizeof(lasat_board_info.li_namestr),
419 .mode = 0444,
420 .proc_handler = &proc_dostring,
421 .strategy = &sysctl_string
422 },
423 {
424 .ctl_name = CTL_UNNUMBERED,
425 .procname = "typestr",
426 .data = &lasat_board_info.li_typestr,
427 .maxlen = sizeof(lasat_board_info.li_typestr),
428 .mode = 0444,
429 .proc_handler = &proc_dostring,
430 .strategy = &sysctl_string
431 },
432 {}
433};
434
435static ctl_table lasat_root_table[] = {
436 {
437 .ctl_name = CTL_UNNUMBERED,
438 .procname = "lasat",
439 .mode = 0555,
440 .child = lasat_table
441 },
442 {}
443};
444
445static int __init lasat_register_sysctl(void)
446{
447 struct ctl_table_header *lasat_table_header;
448
449 lasat_table_header =
450 register_sysctl_table(lasat_root_table);
451
452 return 0;
453}
454
455__initcall(lasat_register_sysctl);
456#endif /* CONFIG_SYSCTL */
diff --git a/arch/mips/lasat/sysctl.h b/arch/mips/lasat/sysctl.h
new file mode 100644
index 000000000000..341b97933423
--- /dev/null
+++ b/arch/mips/lasat/sysctl.h
@@ -0,0 +1,24 @@
1/*
2 * LASAT sysctl values
3 */
4
5#ifndef _LASAT_SYSCTL_H
6#define _LASAT_SYSCTL_H
7
8/* /proc/sys/lasat */
9enum {
10 LASAT_CPU_HZ = 1,
11 LASAT_BUS_HZ,
12 LASAT_MODEL,
13 LASAT_PRID,
14 LASAT_IPADDR,
15 LASAT_NETMASK,
16 LASAT_BCAST,
17 LASAT_PASSWORD,
18 LASAT_SBOOT,
19 LASAT_RTC,
20 LASAT_NAMESTR,
21 LASAT_TYPESTR,
22};
23
24#endif /* _LASAT_SYSCTL_H */
diff --git a/arch/mips/lemote/lm2e/Makefile b/arch/mips/lemote/lm2e/Makefile
index dcaf6f4c3a37..d34671d1b899 100644
--- a/arch/mips/lemote/lm2e/Makefile
+++ b/arch/mips/lemote/lm2e/Makefile
@@ -4,5 +4,4 @@
4 4
5obj-y += setup.o prom.o reset.o irq.o pci.o bonito-irq.o dbg_io.o mem.o 5obj-y += setup.o prom.o reset.o irq.o pci.o bonito-irq.o dbg_io.o mem.o
6 6
7EXTRA_AFLAGS := $(CFLAGS)
8EXTRA_CFLAGS += -Werror 7EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/lemote/lm2e/prom.c b/arch/mips/lemote/lm2e/prom.c
index 3efb1cf111f2..824336812198 100644
--- a/arch/mips/lemote/lm2e/prom.c
+++ b/arch/mips/lemote/lm2e/prom.c
@@ -57,7 +57,6 @@ void __init prom_init(void)
57 arg = (int *)fw_arg1; 57 arg = (int *)fw_arg1;
58 env = (int *)fw_arg2; 58 env = (int *)fw_arg2;
59 59
60 mips_machgroup = MACH_GROUP_LEMOTE;
61 mips_machtype = MACH_LEMOTE_FULONG; 60 mips_machtype = MACH_LEMOTE_FULONG;
62 61
63 prom_init_cmdline(); 62 prom_init_cmdline();
diff --git a/arch/mips/lemote/lm2e/setup.c b/arch/mips/lemote/lm2e/setup.c
index f34350a4f271..09314a20f9fb 100644
--- a/arch/mips/lemote/lm2e/setup.c
+++ b/arch/mips/lemote/lm2e/setup.c
@@ -58,13 +58,13 @@ void __init plat_timer_setup(struct irqaction *irq)
58 setup_irq(MIPS_CPU_IRQ_BASE + 7, irq); 58 setup_irq(MIPS_CPU_IRQ_BASE + 7, irq);
59} 59}
60 60
61static void __init loongson2e_time_init(void) 61void __init plat_time_init(void)
62{ 62{
63 /* setup mips r4k timer */ 63 /* setup mips r4k timer */
64 mips_hpt_frequency = cpu_clock_freq / 2; 64 mips_hpt_frequency = cpu_clock_freq / 2;
65} 65}
66 66
67static unsigned long __init mips_rtc_get_time(void) 67unsigned long read_persistent_clock(void)
68{ 68{
69 return mc146818_get_cmos_time(); 69 return mc146818_get_cmos_time();
70} 70}
@@ -89,9 +89,6 @@ void __init plat_mem_setup(void)
89 89
90 mips_reboot_setup(); 90 mips_reboot_setup();
91 91
92 board_time_init = loongson2e_time_init;
93 rtc_mips_get_time = mips_rtc_get_time;
94
95 __wbflush = wbflush_loongson2e; 92 __wbflush = wbflush_loongson2e;
96 93
97 add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM); 94 add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
diff --git a/arch/mips/lib/ucmpdi2.c b/arch/mips/lib/ucmpdi2.c
index e2ff6072b5a3..b33d8569bcb0 100644
--- a/arch/mips/lib/ucmpdi2.c
+++ b/arch/mips/lib/ucmpdi2.c
@@ -2,7 +2,7 @@
2 2
3#include "libgcc.h" 3#include "libgcc.h"
4 4
5word_type __ucmpdi2 (unsigned long long a, unsigned long long b) 5word_type __ucmpdi2(unsigned long long a, unsigned long long b)
6{ 6{
7 const DWunion au = {.ll = a}; 7 const DWunion au = {.ll = a};
8 const DWunion bu = {.ll = b}; 8 const DWunion bu = {.ll = b};
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index 17419e11ecad..b08fc65c13a6 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -178,24 +178,24 @@ static int isBranchInstr(mips_instruction * i)
178#define FR_BIT 0 178#define FR_BIT 0
179#endif 179#endif
180 180
181#define SIFROMREG(si,x) ((si) = \ 181#define SIFROMREG(si, x) ((si) = \
182 (xcp->cp0_status & FR_BIT) || !(x & 1) ? \ 182 (xcp->cp0_status & FR_BIT) || !(x & 1) ? \
183 (int)ctx->fpr[x] : \ 183 (int)ctx->fpr[x] : \
184 (int)(ctx->fpr[x & ~1] >> 32 )) 184 (int)(ctx->fpr[x & ~1] >> 32 ))
185#define SITOREG(si,x) (ctx->fpr[x & ~((xcp->cp0_status & FR_BIT) == 0)] = \ 185#define SITOREG(si, x) (ctx->fpr[x & ~((xcp->cp0_status & FR_BIT) == 0)] = \
186 (xcp->cp0_status & FR_BIT) || !(x & 1) ? \ 186 (xcp->cp0_status & FR_BIT) || !(x & 1) ? \
187 ctx->fpr[x & ~1] >> 32 << 32 | (u32)(si) : \ 187 ctx->fpr[x & ~1] >> 32 << 32 | (u32)(si) : \
188 ctx->fpr[x & ~1] << 32 >> 32 | (u64)(si) << 32) 188 ctx->fpr[x & ~1] << 32 >> 32 | (u64)(si) << 32)
189 189
190#define DIFROMREG(di,x) ((di) = \ 190#define DIFROMREG(di, x) ((di) = \
191 ctx->fpr[x & ~((xcp->cp0_status & FR_BIT) == 0)]) 191 ctx->fpr[x & ~((xcp->cp0_status & FR_BIT) == 0)])
192#define DITOREG(di,x) (ctx->fpr[x & ~((xcp->cp0_status & FR_BIT) == 0)] \ 192#define DITOREG(di, x) (ctx->fpr[x & ~((xcp->cp0_status & FR_BIT) == 0)] \
193 = (di)) 193 = (di))
194 194
195#define SPFROMREG(sp,x) SIFROMREG((sp).bits,x) 195#define SPFROMREG(sp, x) SIFROMREG((sp).bits, x)
196#define SPTOREG(sp,x) SITOREG((sp).bits,x) 196#define SPTOREG(sp, x) SITOREG((sp).bits, x)
197#define DPFROMREG(dp,x) DIFROMREG((dp).bits,x) 197#define DPFROMREG(dp, x) DIFROMREG((dp).bits, x)
198#define DPTOREG(dp,x) DITOREG((dp).bits,x) 198#define DPTOREG(dp, x) DITOREG((dp).bits, x)
199 199
200/* 200/*
201 * Emulate the single floating point instruction pointed at by EPC. 201 * Emulate the single floating point instruction pointed at by EPC.
@@ -549,16 +549,16 @@ static const unsigned char cmptab[8] = {
549 */ 549 */
550 550
551#define DEF3OP(name, p, f1, f2, f3) \ 551#define DEF3OP(name, p, f1, f2, f3) \
552static ieee754##p fpemu_##p##_##name (ieee754##p r, ieee754##p s, \ 552static ieee754##p fpemu_##p##_##name(ieee754##p r, ieee754##p s, \
553 ieee754##p t) \ 553 ieee754##p t) \
554{ \ 554{ \
555 struct _ieee754_csr ieee754_csr_save; \ 555 struct _ieee754_csr ieee754_csr_save; \
556 s = f1 (s, t); \ 556 s = f1(s, t); \
557 ieee754_csr_save = ieee754_csr; \ 557 ieee754_csr_save = ieee754_csr; \
558 s = f2 (s, r); \ 558 s = f2(s, r); \
559 ieee754_csr_save.cx |= ieee754_csr.cx; \ 559 ieee754_csr_save.cx |= ieee754_csr.cx; \
560 ieee754_csr_save.sx |= ieee754_csr.sx; \ 560 ieee754_csr_save.sx |= ieee754_csr.sx; \
561 s = f3 (s); \ 561 s = f3(s); \
562 ieee754_csr.cx |= ieee754_csr_save.cx; \ 562 ieee754_csr.cx |= ieee754_csr_save.cx; \
563 ieee754_csr.sx |= ieee754_csr_save.sx; \ 563 ieee754_csr.sx |= ieee754_csr_save.sx; \
564 return s; \ 564 return s; \
@@ -584,12 +584,12 @@ static ieee754sp fpemu_sp_rsqrt(ieee754sp s)
584 return ieee754sp_div(ieee754sp_one(0), ieee754sp_sqrt(s)); 584 return ieee754sp_div(ieee754sp_one(0), ieee754sp_sqrt(s));
585} 585}
586 586
587DEF3OP(madd, sp, ieee754sp_mul, ieee754sp_add,); 587DEF3OP(madd, sp, ieee754sp_mul, ieee754sp_add, );
588DEF3OP(msub, sp, ieee754sp_mul, ieee754sp_sub,); 588DEF3OP(msub, sp, ieee754sp_mul, ieee754sp_sub, );
589DEF3OP(nmadd, sp, ieee754sp_mul, ieee754sp_add, ieee754sp_neg); 589DEF3OP(nmadd, sp, ieee754sp_mul, ieee754sp_add, ieee754sp_neg);
590DEF3OP(nmsub, sp, ieee754sp_mul, ieee754sp_sub, ieee754sp_neg); 590DEF3OP(nmsub, sp, ieee754sp_mul, ieee754sp_sub, ieee754sp_neg);
591DEF3OP(madd, dp, ieee754dp_mul, ieee754dp_add,); 591DEF3OP(madd, dp, ieee754dp_mul, ieee754dp_add, );
592DEF3OP(msub, dp, ieee754dp_mul, ieee754dp_sub,); 592DEF3OP(msub, dp, ieee754dp_mul, ieee754dp_sub, );
593DEF3OP(nmadd, dp, ieee754dp_mul, ieee754dp_add, ieee754dp_neg); 593DEF3OP(nmadd, dp, ieee754dp_mul, ieee754dp_add, ieee754dp_neg);
594DEF3OP(nmsub, dp, ieee754dp_mul, ieee754dp_sub, ieee754dp_neg); 594DEF3OP(nmsub, dp, ieee754dp_mul, ieee754dp_sub, ieee754dp_neg);
595 595
diff --git a/arch/mips/math-emu/dp_mul.c b/arch/mips/math-emu/dp_mul.c
index f2373902f524..48908a809c17 100644
--- a/arch/mips/math-emu/dp_mul.c
+++ b/arch/mips/math-emu/dp_mul.c
@@ -121,7 +121,7 @@ ieee754dp ieee754dp_mul(ieee754dp x, ieee754dp y)
121 */ 121 */
122 122
123 /* 32 * 32 => 64 */ 123 /* 32 * 32 => 64 */
124#define DPXMULT(x,y) ((u64)(x) * (u64)y) 124#define DPXMULT(x, y) ((u64)(x) * (u64)y)
125 125
126 { 126 {
127 unsigned lxm = xm; 127 unsigned lxm = xm;
diff --git a/arch/mips/math-emu/ieee754.c b/arch/mips/math-emu/ieee754.c
index a93c45dbdefd..946aee331788 100644
--- a/arch/mips/math-emu/ieee754.c
+++ b/arch/mips/math-emu/ieee754.c
@@ -47,13 +47,13 @@
47 47
48 48
49#if (defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN) || defined(__MIPSEL__) 49#if (defined(BYTE_ORDER) && BYTE_ORDER == LITTLE_ENDIAN) || defined(__MIPSEL__)
50#define SPSTR(s,b,m) {m,b,s} 50#define SPSTR(s, b, m) {m, b, s}
51#define DPSTR(s,b,mh,ml) {ml,mh,b,s} 51#define DPSTR(s, b, mh, ml) {ml, mh, b, s}
52#endif 52#endif
53 53
54#ifdef __MIPSEB__ 54#ifdef __MIPSEB__
55#define SPSTR(s,b,m) {s,b,m} 55#define SPSTR(s, b, m) {s, b, m}
56#define DPSTR(s,b,mh,ml) {s,b,mh,ml} 56#define DPSTR(s, b, mh, ml) {s, b, mh, ml}
57#endif 57#endif
58 58
59const struct ieee754dp_konst __ieee754dp_spcvals[] = { 59const struct ieee754dp_konst __ieee754dp_spcvals[] = {
@@ -65,7 +65,7 @@ const struct ieee754dp_konst __ieee754dp_spcvals[] = {
65 DPSTR(1, 3 + DP_EBIAS, 0x40000, 0), /* - 10.0 */ 65 DPSTR(1, 3 + DP_EBIAS, 0x40000, 0), /* - 10.0 */
66 DPSTR(0, DP_EMAX + 1 + DP_EBIAS, 0, 0), /* + infinity */ 66 DPSTR(0, DP_EMAX + 1 + DP_EBIAS, 0, 0), /* + infinity */
67 DPSTR(1, DP_EMAX + 1 + DP_EBIAS, 0, 0), /* - infinity */ 67 DPSTR(1, DP_EMAX + 1 + DP_EBIAS, 0, 0), /* - infinity */
68 DPSTR(0,DP_EMAX+1+DP_EBIAS,0x7FFFF,0xFFFFFFFF), /* + indef quiet Nan */ 68 DPSTR(0, DP_EMAX+1+DP_EBIAS, 0x7FFFF, 0xFFFFFFFF), /* + indef quiet Nan */
69 DPSTR(0, DP_EMAX + DP_EBIAS, 0xFFFFF, 0xFFFFFFFF), /* + max */ 69 DPSTR(0, DP_EMAX + DP_EBIAS, 0xFFFFF, 0xFFFFFFFF), /* + max */
70 DPSTR(1, DP_EMAX + DP_EBIAS, 0xFFFFF, 0xFFFFFFFF), /* - max */ 70 DPSTR(1, DP_EMAX + DP_EBIAS, 0xFFFFF, 0xFFFFFFFF), /* - max */
71 DPSTR(0, DP_EMIN + DP_EBIAS, 0, 0), /* + min normal */ 71 DPSTR(0, DP_EMIN + DP_EBIAS, 0, 0), /* + min normal */
@@ -85,7 +85,7 @@ const struct ieee754sp_konst __ieee754sp_spcvals[] = {
85 SPSTR(1, 3 + SP_EBIAS, 0x200000), /* - 10.0 */ 85 SPSTR(1, 3 + SP_EBIAS, 0x200000), /* - 10.0 */
86 SPSTR(0, SP_EMAX + 1 + SP_EBIAS, 0), /* + infinity */ 86 SPSTR(0, SP_EMAX + 1 + SP_EBIAS, 0), /* + infinity */
87 SPSTR(1, SP_EMAX + 1 + SP_EBIAS, 0), /* - infinity */ 87 SPSTR(1, SP_EMAX + 1 + SP_EBIAS, 0), /* - infinity */
88 SPSTR(0,SP_EMAX+1+SP_EBIAS,0x3FFFFF), /* + indef quiet Nan */ 88 SPSTR(0, SP_EMAX+1+SP_EBIAS, 0x3FFFFF), /* + indef quiet Nan */
89 SPSTR(0, SP_EMAX + SP_EBIAS, 0x7FFFFF), /* + max normal */ 89 SPSTR(0, SP_EMAX + SP_EBIAS, 0x7FFFFF), /* + max normal */
90 SPSTR(1, SP_EMAX + SP_EBIAS, 0x7FFFFF), /* - max normal */ 90 SPSTR(1, SP_EMAX + SP_EBIAS, 0x7FFFFF), /* - max normal */
91 SPSTR(0, SP_EMIN + SP_EBIAS, 0), /* + min normal */ 91 SPSTR(0, SP_EMIN + SP_EBIAS, 0), /* + min normal */
diff --git a/arch/mips/math-emu/ieee754dp.h b/arch/mips/math-emu/ieee754dp.h
index a37370dae232..8977eb585a37 100644
--- a/arch/mips/math-emu/ieee754dp.h
+++ b/arch/mips/math-emu/ieee754dp.h
@@ -43,8 +43,8 @@
43/* convert denormal to normalized with extended exponent */ 43/* convert denormal to normalized with extended exponent */
44#define DPDNORMx(m,e) \ 44#define DPDNORMx(m,e) \
45 while( (m >> DP_MBITS) == 0) { m <<= 1; e--; } 45 while( (m >> DP_MBITS) == 0) { m <<= 1; e--; }
46#define DPDNORMX DPDNORMx(xm,xe) 46#define DPDNORMX DPDNORMx(xm, xe)
47#define DPDNORMY DPDNORMx(ym,ye) 47#define DPDNORMY DPDNORMx(ym, ye)
48 48
49static __inline ieee754dp builddp(int s, int bx, u64 m) 49static __inline ieee754dp builddp(int s, int bx, u64 m)
50{ 50{
@@ -71,13 +71,13 @@ extern ieee754dp ieee754dp_bestnan(ieee754dp, ieee754dp);
71extern ieee754dp ieee754dp_format(int, int, u64); 71extern ieee754dp ieee754dp_format(int, int, u64);
72 72
73 73
74#define DPNORMRET2(s,e,m,name,a0,a1) \ 74#define DPNORMRET2(s, e, m, name, a0, a1) \
75{ \ 75{ \
76 ieee754dp V = ieee754dp_format(s,e,m); \ 76 ieee754dp V = ieee754dp_format(s, e, m); \
77 if(TSTX()) \ 77 if(TSTX()) \
78 return ieee754dp_xcpt(V,name,a0,a1); \ 78 return ieee754dp_xcpt(V, name, a0, a1); \
79 else \ 79 else \
80 return V; \ 80 return V; \
81} 81}
82 82
83#define DPNORMRET1(s,e,m,name,a0) DPNORMRET2(s,e,m,name,a0,a0) 83#define DPNORMRET1(s, e, m, name, a0) DPNORMRET2(s, e, m, name, a0, a0)
diff --git a/arch/mips/math-emu/ieee754int.h b/arch/mips/math-emu/ieee754int.h
index 4a5a81d6b893..1a846c5425cd 100644
--- a/arch/mips/math-emu/ieee754int.h
+++ b/arch/mips/math-emu/ieee754int.h
@@ -55,16 +55,16 @@
55#define DPBEXP(dp) (dp.parts.bexp) 55#define DPBEXP(dp) (dp.parts.bexp)
56#define DPMANT(dp) (dp.parts.mant) 56#define DPMANT(dp) (dp.parts.mant)
57 57
58#define CLPAIR(x,y) ((x)*6+(y)) 58#define CLPAIR(x, y) ((x)*6+(y))
59 59
60#define CLEARCX \ 60#define CLEARCX \
61 (ieee754_csr.cx = 0) 61 (ieee754_csr.cx = 0)
62 62
63#define SETCX(x) \ 63#define SETCX(x) \
64 (ieee754_csr.cx |= (x),ieee754_csr.sx |= (x)) 64 (ieee754_csr.cx |= (x), ieee754_csr.sx |= (x))
65 65
66#define SETANDTESTCX(x) \ 66#define SETANDTESTCX(x) \
67 (SETCX(x),ieee754_csr.mx & (x)) 67 (SETCX(x), ieee754_csr.mx & (x))
68 68
69#define TSTX() \ 69#define TSTX() \
70 (ieee754_csr.cx & ieee754_csr.mx) 70 (ieee754_csr.cx & ieee754_csr.mx)
@@ -76,7 +76,7 @@
76#define COMPYSP \ 76#define COMPYSP \
77 unsigned ym; int ye; int ys; int yc 77 unsigned ym; int ye; int ys; int yc
78 78
79#define EXPLODESP(v,vc,vs,ve,vm) \ 79#define EXPLODESP(v, vc, vs, ve, vm) \
80{\ 80{\
81 vs = SPSIGN(v);\ 81 vs = SPSIGN(v);\
82 ve = SPBEXP(v);\ 82 ve = SPBEXP(v);\
@@ -100,8 +100,8 @@
100 vc = IEEE754_CLASS_NORM;\ 100 vc = IEEE754_CLASS_NORM;\
101 }\ 101 }\
102} 102}
103#define EXPLODEXSP EXPLODESP(x,xc,xs,xe,xm) 103#define EXPLODEXSP EXPLODESP(x, xc, xs, xe, xm)
104#define EXPLODEYSP EXPLODESP(y,yc,ys,ye,ym) 104#define EXPLODEYSP EXPLODESP(y, yc, ys, ye, ym)
105 105
106 106
107#define COMPXDP \ 107#define COMPXDP \
@@ -110,7 +110,7 @@ u64 xm; int xe; int xs; int xc
110#define COMPYDP \ 110#define COMPYDP \
111u64 ym; int ye; int ys; int yc 111u64 ym; int ye; int ys; int yc
112 112
113#define EXPLODEDP(v,vc,vs,ve,vm) \ 113#define EXPLODEDP(v, vc, vs, ve, vm) \
114{\ 114{\
115 vm = DPMANT(v);\ 115 vm = DPMANT(v);\
116 vs = DPSIGN(v);\ 116 vs = DPSIGN(v);\
@@ -134,10 +134,10 @@ u64 ym; int ye; int ys; int yc
134 vc = IEEE754_CLASS_NORM;\ 134 vc = IEEE754_CLASS_NORM;\
135 }\ 135 }\
136} 136}
137#define EXPLODEXDP EXPLODEDP(x,xc,xs,xe,xm) 137#define EXPLODEXDP EXPLODEDP(x, xc, xs, xe, xm)
138#define EXPLODEYDP EXPLODEDP(y,yc,ys,ye,ym) 138#define EXPLODEYDP EXPLODEDP(y, yc, ys, ye, ym)
139 139
140#define FLUSHDP(v,vc,vs,ve,vm) \ 140#define FLUSHDP(v, vc, vs, ve, vm) \
141 if(vc==IEEE754_CLASS_DNORM) {\ 141 if(vc==IEEE754_CLASS_DNORM) {\
142 if(ieee754_csr.nod) {\ 142 if(ieee754_csr.nod) {\
143 SETCX(IEEE754_INEXACT);\ 143 SETCX(IEEE754_INEXACT);\
@@ -148,7 +148,7 @@ u64 ym; int ye; int ys; int yc
148 }\ 148 }\
149 } 149 }
150 150
151#define FLUSHSP(v,vc,vs,ve,vm) \ 151#define FLUSHSP(v, vc, vs, ve, vm) \
152 if(vc==IEEE754_CLASS_DNORM) {\ 152 if(vc==IEEE754_CLASS_DNORM) {\
153 if(ieee754_csr.nod) {\ 153 if(ieee754_csr.nod) {\
154 SETCX(IEEE754_INEXACT);\ 154 SETCX(IEEE754_INEXACT);\
@@ -159,7 +159,7 @@ u64 ym; int ye; int ys; int yc
159 }\ 159 }\
160 } 160 }
161 161
162#define FLUSHXDP FLUSHDP(x,xc,xs,xe,xm) 162#define FLUSHXDP FLUSHDP(x, xc, xs, xe, xm)
163#define FLUSHYDP FLUSHDP(y,yc,ys,ye,ym) 163#define FLUSHYDP FLUSHDP(y, yc, ys, ye, ym)
164#define FLUSHXSP FLUSHSP(x,xc,xs,xe,xm) 164#define FLUSHXSP FLUSHSP(x, xc, xs, xe, xm)
165#define FLUSHYSP FLUSHSP(y,yc,ys,ye,ym) 165#define FLUSHYSP FLUSHSP(y, yc, ys, ye, ym)
diff --git a/arch/mips/math-emu/ieee754sp.h b/arch/mips/math-emu/ieee754sp.h
index ae82f51297e5..9917c1e4d947 100644
--- a/arch/mips/math-emu/ieee754sp.h
+++ b/arch/mips/math-emu/ieee754sp.h
@@ -48,8 +48,8 @@
48/* convert denormal to normalized with extended exponent */ 48/* convert denormal to normalized with extended exponent */
49#define SPDNORMx(m,e) \ 49#define SPDNORMx(m,e) \
50 while( (m >> SP_MBITS) == 0) { m <<= 1; e--; } 50 while( (m >> SP_MBITS) == 0) { m <<= 1; e--; }
51#define SPDNORMX SPDNORMx(xm,xe) 51#define SPDNORMX SPDNORMx(xm, xe)
52#define SPDNORMY SPDNORMx(ym,ye) 52#define SPDNORMY SPDNORMx(ym, ye)
53 53
54static __inline ieee754sp buildsp(int s, int bx, unsigned m) 54static __inline ieee754sp buildsp(int s, int bx, unsigned m)
55{ 55{
@@ -77,13 +77,13 @@ extern ieee754sp ieee754sp_bestnan(ieee754sp, ieee754sp);
77extern ieee754sp ieee754sp_format(int, int, unsigned); 77extern ieee754sp ieee754sp_format(int, int, unsigned);
78 78
79 79
80#define SPNORMRET2(s,e,m,name,a0,a1) \ 80#define SPNORMRET2(s, e, m, name, a0, a1) \
81{ \ 81{ \
82 ieee754sp V = ieee754sp_format(s,e,m); \ 82 ieee754sp V = ieee754sp_format(s, e, m); \
83 if(TSTX()) \ 83 if(TSTX()) \
84 return ieee754sp_xcpt(V,name,a0,a1); \ 84 return ieee754sp_xcpt(V, name, a0, a1); \
85 else \ 85 else \
86 return V; \ 86 return V; \
87} 87}
88 88
89#define SPNORMRET1(s,e,m,name,a0) SPNORMRET2(s,e,m,name,a0,a0) 89#define SPNORMRET1(s, e, m, name, a0) SPNORMRET2(s, e, m, name, a0, a0)
diff --git a/arch/mips/mips-boards/atlas/atlas_gdb.c b/arch/mips/mips-boards/atlas/atlas_gdb.c
index fb65280f1780..00c98cff62dc 100644
--- a/arch/mips/mips-boards/atlas/atlas_gdb.c
+++ b/arch/mips/mips-boards/atlas/atlas_gdb.c
@@ -22,7 +22,7 @@
22#include <asm/mips-boards/saa9730_uart.h> 22#include <asm/mips-boards/saa9730_uart.h>
23 23
24#define INB(a) inb((unsigned long)a) 24#define INB(a) inb((unsigned long)a)
25#define OUTB(x,a) outb(x,(unsigned long)a) 25#define OUTB(x, a) outb(x, (unsigned long)a)
26 26
27/* 27/*
28 * This is the interface to the remote debugger stub 28 * This is the interface to the remote debugger stub
diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c
index 3c692abc2553..6fb29c3ff62d 100644
--- a/arch/mips/mips-boards/atlas/atlas_int.c
+++ b/arch/mips/mips-boards/atlas/atlas_int.c
@@ -112,7 +112,7 @@ static inline void atlas_hw0_irqdispatch(void)
112 112
113static inline int clz(unsigned long x) 113static inline int clz(unsigned long x)
114{ 114{
115 __asm__ ( 115 __asm__(
116 " .set push \n" 116 " .set push \n"
117 " .set mips32 \n" 117 " .set mips32 \n"
118 " clz %0, %1 \n" 118 " clz %0, %1 \n"
@@ -194,7 +194,7 @@ asmlinkage void plat_irq_dispatch(void)
194 spurious_interrupt(); 194 spurious_interrupt();
195} 195}
196 196
197static inline void init_atlas_irqs (int base) 197static inline void init_atlas_irqs(int base)
198{ 198{
199 int i; 199 int i;
200 200
@@ -249,21 +249,21 @@ void __init arch_init_irq(void)
249 case MIPS_REVISION_CORID_CORE_24K: 249 case MIPS_REVISION_CORID_CORE_24K:
250 case MIPS_REVISION_CORID_CORE_EMUL_MSC: 250 case MIPS_REVISION_CORID_CORE_EMUL_MSC:
251 if (cpu_has_veic) 251 if (cpu_has_veic)
252 init_msc_irqs (MSC01E_INT_BASE, MSC01E_INT_BASE, 252 init_msc_irqs(MSC01E_INT_BASE, MSC01E_INT_BASE,
253 msc_eicirqmap, msc_nr_eicirqs); 253 msc_eicirqmap, msc_nr_eicirqs);
254 else 254 else
255 init_msc_irqs (MSC01E_INT_BASE, MSC01C_INT_BASE, 255 init_msc_irqs(MSC01E_INT_BASE, MSC01C_INT_BASE,
256 msc_irqmap, msc_nr_irqs); 256 msc_irqmap, msc_nr_irqs);
257 } 257 }
258 258
259 if (cpu_has_veic) { 259 if (cpu_has_veic) {
260 set_vi_handler (MSC01E_INT_ATLAS, atlas_hw0_irqdispatch); 260 set_vi_handler(MSC01E_INT_ATLAS, atlas_hw0_irqdispatch);
261 setup_irq (MSC01E_INT_BASE + MSC01E_INT_ATLAS, &atlasirq); 261 setup_irq(MSC01E_INT_BASE + MSC01E_INT_ATLAS, &atlasirq);
262 } else if (cpu_has_vint) { 262 } else if (cpu_has_vint) {
263 set_vi_handler (MIPSCPU_INT_ATLAS, atlas_hw0_irqdispatch); 263 set_vi_handler(MIPSCPU_INT_ATLAS, atlas_hw0_irqdispatch);
264#ifdef CONFIG_MIPS_MT_SMTC 264#ifdef CONFIG_MIPS_MT_SMTC
265 setup_irq_smtc (MIPS_CPU_IRQ_BASE + MIPSCPU_INT_ATLAS, 265 setup_irq_smtc(MIPS_CPU_IRQ_BASE + MIPSCPU_INT_ATLAS,
266 &atlasirq, (0x100 << MIPSCPU_INT_ATLAS)); 266 &atlasirq, (0x100 << MIPSCPU_INT_ATLAS));
267#else /* Not SMTC */ 267#else /* Not SMTC */
268 setup_irq(MIPS_CPU_IRQ_BASE + MIPSCPU_INT_ATLAS, &atlasirq); 268 setup_irq(MIPS_CPU_IRQ_BASE + MIPSCPU_INT_ATLAS, &atlasirq);
269#endif /* CONFIG_MIPS_MT_SMTC */ 269#endif /* CONFIG_MIPS_MT_SMTC */
diff --git a/arch/mips/mips-boards/atlas/atlas_setup.c b/arch/mips/mips-boards/atlas/atlas_setup.c
index c68358a476dd..e405d112a067 100644
--- a/arch/mips/mips-boards/atlas/atlas_setup.c
+++ b/arch/mips/mips-boards/atlas/atlas_setup.c
@@ -35,8 +35,6 @@
35#include <asm/traps.h> 35#include <asm/traps.h>
36 36
37extern void mips_reboot_setup(void); 37extern void mips_reboot_setup(void);
38extern void mips_time_init(void);
39extern unsigned long mips_rtc_get_time(void);
40 38
41#ifdef CONFIG_KGDB 39#ifdef CONFIG_KGDB
42extern void kgdb_config(void); 40extern void kgdb_config(void);
@@ -57,15 +55,12 @@ void __init plat_mem_setup(void)
57 55
58 ioport_resource.end = 0x7fffffff; 56 ioport_resource.end = 0x7fffffff;
59 57
60 serial_init (); 58 serial_init();
61 59
62#ifdef CONFIG_KGDB 60#ifdef CONFIG_KGDB
63 kgdb_config(); 61 kgdb_config();
64#endif 62#endif
65 mips_reboot_setup(); 63 mips_reboot_setup();
66
67 board_time_init = mips_time_init;
68 rtc_mips_get_time = mips_rtc_get_time;
69} 64}
70 65
71static void __init serial_init(void) 66static void __init serial_init(void)
diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c
index e2c7147fedf7..30f1f54cb68b 100644
--- a/arch/mips/mips-boards/generic/init.c
+++ b/arch/mips/mips-boards/generic/init.c
@@ -166,15 +166,15 @@ static void __init console_config(void)
166 bits = '8'; 166 bits = '8';
167 if (flow == '\0') 167 if (flow == '\0')
168 flow = 'r'; 168 flow = 'r';
169 sprintf (console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow); 169 sprintf(console_string, " console=ttyS0,%d%c%c%c", baud, parity, bits, flow);
170 strcat (prom_getcmdline(), console_string); 170 strcat(prom_getcmdline(), console_string);
171 pr_info("Config serial console:%s\n", console_string); 171 pr_info("Config serial console:%s\n", console_string);
172 } 172 }
173} 173}
174#endif 174#endif
175 175
176#ifdef CONFIG_KGDB 176#ifdef CONFIG_KGDB
177void __init kgdb_config (void) 177void __init kgdb_config(void)
178{ 178{
179 extern int (*generic_putDebugChar)(char); 179 extern int (*generic_putDebugChar)(char);
180 extern char (*generic_getDebugChar)(void); 180 extern char (*generic_getDebugChar)(void);
@@ -218,7 +218,7 @@ void __init kgdb_config (void)
218 { 218 {
219 char *s; 219 char *s;
220 for (s = "Please connect GDB to this port\r\n"; *s; ) 220 for (s = "Please connect GDB to this port\r\n"; *s; )
221 generic_putDebugChar (*s++); 221 generic_putDebugChar(*s++);
222 } 222 }
223 223
224 /* Breakpoint is invoked after interrupts are initialised */ 224 /* Breakpoint is invoked after interrupts are initialised */
@@ -226,7 +226,7 @@ void __init kgdb_config (void)
226} 226}
227#endif 227#endif
228 228
229void __init mips_nmi_setup (void) 229void __init mips_nmi_setup(void)
230{ 230{
231 void *base; 231 void *base;
232 extern char except_vec_nmi; 232 extern char except_vec_nmi;
@@ -238,7 +238,7 @@ void __init mips_nmi_setup (void)
238 flush_icache_range((unsigned long)base, (unsigned long)base + 0x80); 238 flush_icache_range((unsigned long)base, (unsigned long)base + 0x80);
239} 239}
240 240
241void __init mips_ejtag_setup (void) 241void __init mips_ejtag_setup(void)
242{ 242{
243 void *base; 243 void *base;
244 extern char except_vec_ejtag_debug; 244 extern char except_vec_ejtag_debug;
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index ae39953da2c4..dc272c188233 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -125,7 +125,7 @@ struct prom_pmemblock * __init prom_getmdesc(void)
125 return &mdesc[0]; 125 return &mdesc[0];
126} 126}
127 127
128static int __init prom_memtype_classify (unsigned int type) 128static int __init prom_memtype_classify(unsigned int type)
129{ 129{
130 switch (type) { 130 switch (type) {
131 case yamon_free: 131 case yamon_free:
@@ -158,7 +158,7 @@ void __init prom_meminit(void)
158 long type; 158 long type;
159 unsigned long base, size; 159 unsigned long base, size;
160 160
161 type = prom_memtype_classify (p->type); 161 type = prom_memtype_classify(p->type);
162 base = p->base; 162 base = p->base;
163 size = p->size; 163 size = p->size;
164 164
diff --git a/arch/mips/mips-boards/generic/pci.c b/arch/mips/mips-boards/generic/pci.c
index c9852206890a..b9743190609a 100644
--- a/arch/mips/mips-boards/generic/pci.c
+++ b/arch/mips/mips-boards/generic/pci.c
@@ -239,5 +239,5 @@ void __init mips_pcibios_init(void)
239 iomem_resource.end &= 0xfffffffffULL; /* 64 GB */ 239 iomem_resource.end &= 0xfffffffffULL; /* 64 GB */
240 ioport_resource.end = controller->io_resource->end; 240 ioport_resource.end = controller->io_resource->end;
241 241
242 register_pci_controller (controller); 242 register_pci_controller(controller);
243} 243}
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index d7bff9ca5356..1d00b778ff1e 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -31,6 +31,7 @@
31#include <asm/mipsregs.h> 31#include <asm/mipsregs.h>
32#include <asm/mipsmtregs.h> 32#include <asm/mipsmtregs.h>
33#include <asm/hardirq.h> 33#include <asm/hardirq.h>
34#include <asm/i8253.h>
34#include <asm/irq.h> 35#include <asm/irq.h>
35#include <asm/div64.h> 36#include <asm/div64.h>
36#include <asm/cpu.h> 37#include <asm/cpu.h>
@@ -55,7 +56,6 @@ unsigned long cpu_khz;
55 56
56static int mips_cpu_timer_irq; 57static int mips_cpu_timer_irq;
57extern int cp0_perfcount_irq; 58extern int cp0_perfcount_irq;
58extern void smtc_timer_broadcast(void);
59 59
60static void mips_timer_dispatch(void) 60static void mips_timer_dispatch(void)
61{ 61{
@@ -68,108 +68,6 @@ static void mips_perf_dispatch(void)
68} 68}
69 69
70/* 70/*
71 * Redeclare until I get around mopping the timer code insanity on MIPS.
72 */
73extern int null_perf_irq(void);
74
75extern int (*perf_irq)(void);
76
77/*
78 * Possibly handle a performance counter interrupt.
79 * Return true if the timer interrupt should not be checked
80 */
81static inline int handle_perf_irq (int r2)
82{
83 /*
84 * The performance counter overflow interrupt may be shared with the
85 * timer interrupt (cp0_perfcount_irq < 0). If it is and a
86 * performance counter has overflowed (perf_irq() == IRQ_HANDLED)
87 * and we can't reliably determine if a counter interrupt has also
88 * happened (!r2) then don't check for a timer interrupt.
89 */
90 return (cp0_perfcount_irq < 0) &&
91 perf_irq() == IRQ_HANDLED &&
92 !r2;
93}
94
95irqreturn_t mips_timer_interrupt(int irq, void *dev_id)
96{
97 int cpu = smp_processor_id();
98
99#ifdef CONFIG_MIPS_MT_SMTC
100 /*
101 * In an SMTC system, one Count/Compare set exists per VPE.
102 * Which TC within a VPE gets the interrupt is essentially
103 * random - we only know that it shouldn't be one with
104 * IXMT set. Whichever TC gets the interrupt needs to
105 * send special interprocessor interrupts to the other
106 * TCs to make sure that they schedule, etc.
107 *
108 * That code is specific to the SMTC kernel, not to
109 * the a particular platform, so it's invoked from
110 * the general MIPS timer_interrupt routine.
111 */
112
113 /*
114 * We could be here due to timer interrupt,
115 * perf counter overflow, or both.
116 */
117 (void) handle_perf_irq(1);
118
119 if (read_c0_cause() & (1 << 30)) {
120 /*
121 * There are things we only want to do once per tick
122 * in an "MP" system. One TC of each VPE will take
123 * the actual timer interrupt. The others will get
124 * timer broadcast IPIs. We use whoever it is that takes
125 * the tick on VPE 0 to run the full timer_interrupt().
126 */
127 if (cpu_data[cpu].vpe_id == 0) {
128 timer_interrupt(irq, NULL);
129 } else {
130 write_c0_compare(read_c0_count() +
131 (mips_hpt_frequency/HZ));
132 local_timer_interrupt(irq, dev_id);
133 }
134 smtc_timer_broadcast();
135 }
136#else /* CONFIG_MIPS_MT_SMTC */
137 int r2 = cpu_has_mips_r2;
138
139 if (handle_perf_irq(r2))
140 goto out;
141
142 if (r2 && ((read_c0_cause() & (1 << 30)) == 0))
143 goto out;
144
145 if (cpu == 0) {
146 /*
147 * CPU 0 handles the global timer interrupt job and process
148 * accounting resets count/compare registers to trigger next
149 * timer int.
150 */
151 timer_interrupt(irq, NULL);
152 } else {
153 /* Everyone else needs to reset the timer int here as
154 ll_local_timer_interrupt doesn't */
155 /*
156 * FIXME: need to cope with counter underflow.
157 * More support needs to be added to kernel/time for
158 * counter/timer interrupts on multiple CPU's
159 */
160 write_c0_compare(read_c0_count() + (mips_hpt_frequency/HZ));
161
162 /*
163 * Other CPUs should do profiling and process accounting
164 */
165 local_timer_interrupt(irq, dev_id);
166 }
167out:
168#endif /* CONFIG_MIPS_MT_SMTC */
169 return IRQ_HANDLED;
170}
171
172/*
173 * Estimate CPU frequency. Sets mips_hpt_frequency as a side-effect 71 * Estimate CPU frequency. Sets mips_hpt_frequency as a side-effect
174 */ 72 */
175static unsigned int __init estimate_cpu_frequency(void) 73static unsigned int __init estimate_cpu_frequency(void)
@@ -224,19 +122,19 @@ static unsigned int __init estimate_cpu_frequency(void)
224 return count; 122 return count;
225} 123}
226 124
227unsigned long __init mips_rtc_get_time(void) 125unsigned long read_persistent_clock(void)
228{ 126{
229 return mc146818_get_cmos_time(); 127 return mc146818_get_cmos_time();
230} 128}
231 129
232void __init mips_time_init(void) 130void __init plat_time_init(void)
233{ 131{
234 unsigned int est_freq; 132 unsigned int est_freq;
235 133
236 /* Set Data mode - binary. */ 134 /* Set Data mode - binary. */
237 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL); 135 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
238 136
239 est_freq = estimate_cpu_frequency (); 137 est_freq = estimate_cpu_frequency();
240 138
241 printk("CPU frequency %d.%02d MHz\n", est_freq/1000000, 139 printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
242 (est_freq%1000000)*100/1000000); 140 (est_freq%1000000)*100/1000000);
@@ -244,38 +142,37 @@ void __init mips_time_init(void)
244 cpu_khz = est_freq / 1000; 142 cpu_khz = est_freq / 1000;
245 143
246 mips_scroll_message(); 144 mips_scroll_message();
145#ifdef CONFIG_I8253 /* Only Malta has a PIT */
146 setup_pit_timer();
147#endif
247} 148}
248 149
249irqreturn_t mips_perf_interrupt(int irq, void *dev_id) 150//static irqreturn_t mips_perf_interrupt(int irq, void *dev_id)
250{ 151//{
251 return perf_irq(); 152// return perf_irq();
252} 153//}
253 154
254static struct irqaction perf_irqaction = { 155//static struct irqaction perf_irqaction = {
255 .handler = mips_perf_interrupt, 156// .handler = mips_perf_interrupt,
256 .flags = IRQF_DISABLED | IRQF_PERCPU, 157// .flags = IRQF_DISABLED | IRQF_PERCPU,
257 .name = "performance", 158// .name = "performance",
258}; 159//};
259 160
260void __init plat_perf_setup(struct irqaction *irq) 161void __init plat_perf_setup(void)
261{ 162{
163// struct irqaction *irq = &perf_irqaction;
164
262 cp0_perfcount_irq = -1; 165 cp0_perfcount_irq = -1;
263 166
264#ifdef MSC01E_INT_BASE 167#ifdef MSC01E_INT_BASE
265 if (cpu_has_veic) { 168 if (cpu_has_veic) {
266 set_vi_handler (MSC01E_INT_PERFCTR, mips_perf_dispatch); 169 set_vi_handler(MSC01E_INT_PERFCTR, mips_perf_dispatch);
267 cp0_perfcount_irq = MSC01E_INT_BASE + MSC01E_INT_PERFCTR; 170 cp0_perfcount_irq = MSC01E_INT_BASE + MSC01E_INT_PERFCTR;
268 } else 171 } else
269#endif 172#endif
270 if (cp0_perfcount_irq >= 0) { 173 if (cp0_perfcount_irq >= 0) {
271 if (cpu_has_vint) 174 if (cpu_has_vint)
272 set_vi_handler(cp0_perfcount_irq, mips_perf_dispatch); 175 set_vi_handler(cp0_perfcount_irq, mips_perf_dispatch);
273#ifdef CONFIG_MIPS_MT_SMTC
274 setup_irq_smtc(cp0_perfcount_irq, irq,
275 0x100 << cp0_perfcount_irq);
276#else
277 setup_irq(cp0_perfcount_irq, irq);
278#endif /* CONFIG_MIPS_MT_SMTC */
279#ifdef CONFIG_SMP 176#ifdef CONFIG_SMP
280 set_irq_handler(cp0_perfcount_irq, handle_percpu_irq); 177 set_irq_handler(cp0_perfcount_irq, handle_percpu_irq);
281#endif 178#endif
@@ -286,7 +183,7 @@ void __init plat_timer_setup(struct irqaction *irq)
286{ 183{
287#ifdef MSC01E_INT_BASE 184#ifdef MSC01E_INT_BASE
288 if (cpu_has_veic) { 185 if (cpu_has_veic) {
289 set_vi_handler (MSC01E_INT_CPUCTR, mips_timer_dispatch); 186 set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch);
290 mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR; 187 mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR;
291 } 188 }
292 else 189 else
@@ -297,8 +194,6 @@ void __init plat_timer_setup(struct irqaction *irq)
297 mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; 194 mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
298 } 195 }
299 196
300 /* we are using the cpu counter for timer interrupts */
301 irq->handler = mips_timer_interrupt; /* we use our own handler */
302#ifdef CONFIG_MIPS_MT_SMTC 197#ifdef CONFIG_MIPS_MT_SMTC
303 setup_irq_smtc(mips_cpu_timer_irq, irq, 0x100 << cp0_compare_irq); 198 setup_irq_smtc(mips_cpu_timer_irq, irq, 0x100 << cp0_compare_irq);
304#else 199#else
@@ -308,5 +203,5 @@ void __init plat_timer_setup(struct irqaction *irq)
308 set_irq_handler(mips_cpu_timer_irq, handle_percpu_irq); 203 set_irq_handler(mips_cpu_timer_irq, handle_percpu_irq);
309#endif 204#endif
310 205
311 plat_perf_setup(&perf_irqaction); 206 plat_perf_setup();
312} 207}
diff --git a/arch/mips/mips-boards/malta/malta_int.c b/arch/mips/mips-boards/malta/malta_int.c
index b73f21823c5e..f010261b75d8 100644
--- a/arch/mips/mips-boards/malta/malta_int.c
+++ b/arch/mips/mips-boards/malta/malta_int.c
@@ -124,7 +124,7 @@ static void corehi_irqdispatch(void)
124{ 124{
125 unsigned int intedge, intsteer, pcicmd, pcibadaddr; 125 unsigned int intedge, intsteer, pcicmd, pcibadaddr;
126 unsigned int pcimstat, intisr, inten, intpol; 126 unsigned int pcimstat, intisr, inten, intpol;
127 unsigned int intrcause,datalo,datahi; 127 unsigned int intrcause, datalo, datahi;
128 struct pt_regs *regs = get_irq_regs(); 128 struct pt_regs *regs = get_irq_regs();
129 129
130 printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n"); 130 printk("CoreHI interrupt, shouldn't happen, so we die here!!!\n");
@@ -178,7 +178,7 @@ static void corehi_irqdispatch(void)
178 178
179static inline int clz(unsigned long x) 179static inline int clz(unsigned long x)
180{ 180{
181 __asm__ ( 181 __asm__(
182 " .set push \n" 182 " .set push \n"
183 " .set mips32 \n" 183 " .set mips32 \n"
184 " clz %0, %1 \n" 184 " clz %0, %1 \n"
@@ -303,32 +303,32 @@ void __init arch_init_irq(void)
303 case MIPS_REVISION_SCON_SOCIT: 303 case MIPS_REVISION_SCON_SOCIT:
304 case MIPS_REVISION_SCON_ROCIT: 304 case MIPS_REVISION_SCON_ROCIT:
305 if (cpu_has_veic) 305 if (cpu_has_veic)
306 init_msc_irqs (MIPS_MSC01_IC_REG_BASE, MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs); 306 init_msc_irqs(MIPS_MSC01_IC_REG_BASE, MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs);
307 else 307 else
308 init_msc_irqs (MIPS_MSC01_IC_REG_BASE, MSC01C_INT_BASE, msc_irqmap, msc_nr_irqs); 308 init_msc_irqs(MIPS_MSC01_IC_REG_BASE, MSC01C_INT_BASE, msc_irqmap, msc_nr_irqs);
309 break; 309 break;
310 310
311 case MIPS_REVISION_SCON_SOCITSC: 311 case MIPS_REVISION_SCON_SOCITSC:
312 case MIPS_REVISION_SCON_SOCITSCP: 312 case MIPS_REVISION_SCON_SOCITSCP:
313 if (cpu_has_veic) 313 if (cpu_has_veic)
314 init_msc_irqs (MIPS_SOCITSC_IC_REG_BASE, MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs); 314 init_msc_irqs(MIPS_SOCITSC_IC_REG_BASE, MSC01E_INT_BASE, msc_eicirqmap, msc_nr_eicirqs);
315 else 315 else
316 init_msc_irqs (MIPS_SOCITSC_IC_REG_BASE, MSC01C_INT_BASE, msc_irqmap, msc_nr_irqs); 316 init_msc_irqs(MIPS_SOCITSC_IC_REG_BASE, MSC01C_INT_BASE, msc_irqmap, msc_nr_irqs);
317 } 317 }
318 318
319 if (cpu_has_veic) { 319 if (cpu_has_veic) {
320 set_vi_handler (MSC01E_INT_I8259A, malta_hw0_irqdispatch); 320 set_vi_handler(MSC01E_INT_I8259A, malta_hw0_irqdispatch);
321 set_vi_handler (MSC01E_INT_COREHI, corehi_irqdispatch); 321 set_vi_handler(MSC01E_INT_COREHI, corehi_irqdispatch);
322 setup_irq (MSC01E_INT_BASE+MSC01E_INT_I8259A, &i8259irq); 322 setup_irq(MSC01E_INT_BASE+MSC01E_INT_I8259A, &i8259irq);
323 setup_irq (MSC01E_INT_BASE+MSC01E_INT_COREHI, &corehi_irqaction); 323 setup_irq(MSC01E_INT_BASE+MSC01E_INT_COREHI, &corehi_irqaction);
324 } 324 }
325 else if (cpu_has_vint) { 325 else if (cpu_has_vint) {
326 set_vi_handler (MIPSCPU_INT_I8259A, malta_hw0_irqdispatch); 326 set_vi_handler(MIPSCPU_INT_I8259A, malta_hw0_irqdispatch);
327 set_vi_handler (MIPSCPU_INT_COREHI, corehi_irqdispatch); 327 set_vi_handler(MIPSCPU_INT_COREHI, corehi_irqdispatch);
328#ifdef CONFIG_MIPS_MT_SMTC 328#ifdef CONFIG_MIPS_MT_SMTC
329 setup_irq_smtc (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq, 329 setup_irq_smtc(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq,
330 (0x100 << MIPSCPU_INT_I8259A)); 330 (0x100 << MIPSCPU_INT_I8259A));
331 setup_irq_smtc (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI, 331 setup_irq_smtc(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI,
332 &corehi_irqaction, (0x100 << MIPSCPU_INT_COREHI)); 332 &corehi_irqaction, (0x100 << MIPSCPU_INT_COREHI));
333 /* 333 /*
334 * Temporary hack to ensure that the subsidiary device 334 * Temporary hack to ensure that the subsidiary device
@@ -343,12 +343,12 @@ void __init arch_init_irq(void)
343 irq_hwmask[i] = (0x100 << MIPSCPU_INT_I8259A); 343 irq_hwmask[i] = (0x100 << MIPSCPU_INT_I8259A);
344 } 344 }
345#else /* Not SMTC */ 345#else /* Not SMTC */
346 setup_irq (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq); 346 setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq);
347 setup_irq (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction); 347 setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction);
348#endif /* CONFIG_MIPS_MT_SMTC */ 348#endif /* CONFIG_MIPS_MT_SMTC */
349 } 349 }
350 else { 350 else {
351 setup_irq (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq); 351 setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_I8259A, &i8259irq);
352 setup_irq (MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction); 352 setup_irq(MIPS_CPU_IRQ_BASE+MIPSCPU_INT_COREHI, &corehi_irqaction);
353 } 353 }
354} 354}
diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c
index 8f1b78dfd89f..9a2636e56243 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -36,7 +36,6 @@
36#endif 36#endif
37 37
38extern void mips_reboot_setup(void); 38extern void mips_reboot_setup(void);
39extern void mips_time_init(void);
40extern unsigned long mips_rtc_get_time(void); 39extern unsigned long mips_rtc_get_time(void);
41 40
42#ifdef CONFIG_KGDB 41#ifdef CONFIG_KGDB
@@ -100,7 +99,7 @@ void __init plat_mem_setup(void)
100 enable_dma(4); 99 enable_dma(4);
101 100
102#ifdef CONFIG_KGDB 101#ifdef CONFIG_KGDB
103 kgdb_config (); 102 kgdb_config();
104#endif 103#endif
105 104
106 if (mips_revision_sconid == MIPS_REVISION_SCON_BONITO) { 105 if (mips_revision_sconid == MIPS_REVISION_SCON_BONITO) {
@@ -109,7 +108,7 @@ void __init plat_mem_setup(void)
109 argptr = prom_getcmdline(); 108 argptr = prom_getcmdline();
110 if (strstr(argptr, "debug")) { 109 if (strstr(argptr, "debug")) {
111 BONITO_BONGENCFG |= BONITO_BONGENCFG_DEBUGMODE; 110 BONITO_BONGENCFG |= BONITO_BONGENCFG_DEBUGMODE;
112 printk ("Enabled Bonito debug mode\n"); 111 printk("Enabled Bonito debug mode\n");
113 } 112 }
114 else 113 else
115 BONITO_BONGENCFG &= ~BONITO_BONGENCFG_DEBUGMODE; 114 BONITO_BONGENCFG &= ~BONITO_BONGENCFG_DEBUGMODE;
@@ -160,14 +159,14 @@ void __init plat_mem_setup(void)
160 if (pciclock != 33 && !strstr (argptr, "idebus=")) { 159 if (pciclock != 33 && !strstr (argptr, "idebus=")) {
161 printk("WARNING: PCI clock is %dMHz, setting idebus\n", pciclock); 160 printk("WARNING: PCI clock is %dMHz, setting idebus\n", pciclock);
162 argptr += strlen(argptr); 161 argptr += strlen(argptr);
163 sprintf (argptr, " idebus=%d", pciclock); 162 sprintf(argptr, " idebus=%d", pciclock);
164 if (pciclock < 20 || pciclock > 66) 163 if (pciclock < 20 || pciclock > 66)
165 printk ("WARNING: IDE timing calculations will be incorrect\n"); 164 printk("WARNING: IDE timing calculations will be incorrect\n");
166 } 165 }
167 } 166 }
168#endif 167#endif
169#ifdef CONFIG_BLK_DEV_FD 168#ifdef CONFIG_BLK_DEV_FD
170 fd_activate (); 169 fd_activate();
171#endif 170#endif
172#ifdef CONFIG_VT 171#ifdef CONFIG_VT
173#if defined(CONFIG_VGA_CONSOLE) 172#if defined(CONFIG_VGA_CONSOLE)
@@ -177,7 +176,7 @@ void __init plat_mem_setup(void)
177 0, /* orig-video-page */ 176 0, /* orig-video-page */
178 0, /* orig-video-mode */ 177 0, /* orig-video-mode */
179 80, /* orig-video-cols */ 178 80, /* orig-video-cols */
180 0,0,0, /* ega_ax, ega_bx, ega_cx */ 179 0, 0, 0, /* ega_ax, ega_bx, ega_cx */
181 25, /* orig-video-lines */ 180 25, /* orig-video-lines */
182 VIDEO_TYPE_VGAC, /* orig-video-isVGA */ 181 VIDEO_TYPE_VGAC, /* orig-video-isVGA */
183 16 /* orig-video-points */ 182 16 /* orig-video-points */
@@ -185,7 +184,4 @@ void __init plat_mem_setup(void)
185#endif 184#endif
186#endif 185#endif
187 mips_reboot_setup(); 186 mips_reboot_setup();
188
189 board_time_init = mips_time_init;
190 rtc_mips_get_time = mips_rtc_get_time;
191} 187}
diff --git a/arch/mips/mips-boards/malta/malta_smtc.c b/arch/mips/mips-boards/malta/malta_smtc.c
index ae05d058cb37..5c980f4a48fe 100644
--- a/arch/mips/mips-boards/malta/malta_smtc.c
+++ b/arch/mips/mips-boards/malta/malta_smtc.c
@@ -88,3 +88,53 @@ void __cpuinit prom_smp_finish(void)
88void prom_cpus_done(void) 88void prom_cpus_done(void)
89{ 89{
90} 90}
91
92#ifdef CONFIG_MIPS_MT_SMTC_IRQAFF
93/*
94 * IRQ affinity hook
95 */
96
97
98void plat_set_irq_affinity(unsigned int irq, cpumask_t affinity)
99{
100 cpumask_t tmask = affinity;
101 int cpu = 0;
102 void smtc_set_irq_affinity(unsigned int irq, cpumask_t aff);
103
104 /*
105 * On the legacy Malta development board, all I/O interrupts
106 * are routed through the 8259 and combined in a single signal
107 * to the CPU daughterboard, and on the CoreFPGA2/3 34K models,
108 * that signal is brought to IP2 of both VPEs. To avoid racing
109 * concurrent interrupt service events, IP2 is enabled only on
110 * one VPE, by convention VPE0. So long as no bits are ever
111 * cleared in the affinity mask, there will never be any
112 * interrupt forwarding. But as soon as a program or operator
113 * sets affinity for one of the related IRQs, we need to make
114 * sure that we don't ever try to forward across the VPE boundry,
115 * at least not until we engineer a system where the interrupt
116 * _ack() or _end() function can somehow know that it corresponds
117 * to an interrupt taken on another VPE, and perform the appropriate
118 * restoration of Status.IM state using MFTR/MTTR instead of the
119 * normal local behavior. We also ensure that no attempt will
120 * be made to forward to an offline "CPU".
121 */
122
123 for_each_cpu_mask(cpu, affinity) {
124 if ((cpu_data[cpu].vpe_id != 0) || !cpu_online(cpu))
125 cpu_clear(cpu, tmask);
126 }
127 irq_desc[irq].affinity = tmask;
128
129 if (cpus_empty(tmask))
130 /*
131 * We could restore a default mask here, but the
132 * runtime code can anyway deal with the null set
133 */
134 printk(KERN_WARNING
135 "IRQ affinity leaves no legal CPU for IRQ %d\n", irq);
136
137 /* Do any generic SMTC IRQ affinity setup */
138 smtc_set_irq_affinity(irq, tmask);
139}
140#endif /* CONFIG_MIPS_MT_SMTC_IRQAFF */
diff --git a/arch/mips/mips-boards/sead/sead_int.c b/arch/mips/mips-boards/sead/sead_int.c
index 9ca0f82f1360..ec6dd194c14a 100644
--- a/arch/mips/mips-boards/sead/sead_int.c
+++ b/arch/mips/mips-boards/sead/sead_int.c
@@ -31,7 +31,7 @@
31 31
32static inline int clz(unsigned long x) 32static inline int clz(unsigned long x)
33{ 33{
34 __asm__ ( 34 __asm__(
35 " .set push \n" 35 " .set push \n"
36 " .set mips32 \n" 36 " .set mips32 \n"
37 " clz %0, %1 \n" 37 " clz %0, %1 \n"
diff --git a/arch/mips/mips-boards/sead/sead_setup.c b/arch/mips/mips-boards/sead/sead_setup.c
index 5f70eaf01fab..1fb61b852304 100644
--- a/arch/mips/mips-boards/sead/sead_setup.c
+++ b/arch/mips/mips-boards/sead/sead_setup.c
@@ -35,7 +35,6 @@
35#include <asm/time.h> 35#include <asm/time.h>
36 36
37extern void mips_reboot_setup(void); 37extern void mips_reboot_setup(void);
38extern void mips_time_init(void);
39 38
40static void __init serial_init(void); 39static void __init serial_init(void);
41 40
@@ -50,9 +49,7 @@ void __init plat_mem_setup(void)
50{ 49{
51 ioport_resource.end = 0x7fffffff; 50 ioport_resource.end = 0x7fffffff;
52 51
53 serial_init (); 52 serial_init();
54
55 board_time_init = mips_time_init;
56 53
57 mips_reboot_setup(); 54 mips_reboot_setup();
58} 55}
diff --git a/arch/mips/mipssim/sim_int.c b/arch/mips/mipssim/sim_int.c
index 5cbc3509ab52..46067ad542dc 100644
--- a/arch/mips/mipssim/sim_int.c
+++ b/arch/mips/mipssim/sim_int.c
@@ -25,7 +25,7 @@
25 25
26static inline int clz(unsigned long x) 26static inline int clz(unsigned long x)
27{ 27{
28 __asm__ ( 28 __asm__(
29 " .set push \n" 29 " .set push \n"
30 " .set mips32 \n" 30 " .set mips32 \n"
31 " clz %0, %1 \n" 31 " clz %0, %1 \n"
diff --git a/arch/mips/mipssim/sim_mem.c b/arch/mips/mipssim/sim_mem.c
index 2312483eb838..953d836a7713 100644
--- a/arch/mips/mipssim/sim_mem.c
+++ b/arch/mips/mipssim/sim_mem.c
@@ -69,7 +69,7 @@ struct prom_pmemblock * __init prom_getmdesc(void)
69 return &mdesc[0]; 69 return &mdesc[0];
70} 70}
71 71
72static int __init prom_memtype_classify (unsigned int type) 72static int __init prom_memtype_classify(unsigned int type)
73{ 73{
74 switch (type) { 74 switch (type) {
75 case simmem_free: 75 case simmem_free:
@@ -90,7 +90,7 @@ void __init prom_meminit(void)
90 long type; 90 long type;
91 unsigned long base, size; 91 unsigned long base, size;
92 92
93 type = prom_memtype_classify (p->type); 93 type = prom_memtype_classify(p->type);
94 base = p->base; 94 base = p->base;
95 size = p->size; 95 size = p->size;
96 96
diff --git a/arch/mips/mipssim/sim_setup.c b/arch/mips/mipssim/sim_setup.c
index d012719c4d24..452c129d02c1 100644
--- a/arch/mips/mipssim/sim_setup.c
+++ b/arch/mips/mipssim/sim_setup.c
@@ -36,7 +36,6 @@
36#include <asm/mips-boards/simint.h> 36#include <asm/mips-boards/simint.h>
37 37
38 38
39extern void sim_time_init(void);
40static void __init serial_init(void); 39static void __init serial_init(void);
41unsigned int _isbonito = 0; 40unsigned int _isbonito = 0;
42 41
@@ -54,7 +53,6 @@ void __init plat_mem_setup(void)
54 53
55 serial_init(); 54 serial_init();
56 55
57 board_time_init = sim_time_init;
58 pr_info("Linux started...\n"); 56 pr_info("Linux started...\n");
59 57
60#ifdef CONFIG_MIPS_MT_SMP 58#ifdef CONFIG_MIPS_MT_SMP
diff --git a/arch/mips/mipssim/sim_time.c b/arch/mips/mipssim/sim_time.c
index a0f5a5dca1b2..e7fa0d1078a3 100644
--- a/arch/mips/mipssim/sim_time.c
+++ b/arch/mips/mipssim/sim_time.c
@@ -23,77 +23,6 @@
23 23
24unsigned long cpu_khz; 24unsigned long cpu_khz;
25 25
26irqreturn_t sim_timer_interrupt(int irq, void *dev_id)
27{
28#ifdef CONFIG_SMP
29 int cpu = smp_processor_id();
30
31 /*
32 * CPU 0 handles the global timer interrupt job
33 * resets count/compare registers to trigger next timer int.
34 */
35#ifndef CONFIG_MIPS_MT_SMTC
36 if (cpu == 0) {
37 timer_interrupt(irq, dev_id);
38 } else {
39 /* Everyone else needs to reset the timer int here as
40 ll_local_timer_interrupt doesn't */
41 /*
42 * FIXME: need to cope with counter underflow.
43 * More support needs to be added to kernel/time for
44 * counter/timer interrupts on multiple CPU's
45 */
46 write_c0_compare (read_c0_count() + ( mips_hpt_frequency/HZ));
47 }
48#else /* SMTC */
49 /*
50 * In SMTC system, one Count/Compare set exists per VPE.
51 * Which TC within a VPE gets the interrupt is essentially
52 * random - we only know that it shouldn't be one with
53 * IXMT set. Whichever TC gets the interrupt needs to
54 * send special interprocessor interrupts to the other
55 * TCs to make sure that they schedule, etc.
56 *
57 * That code is specific to the SMTC kernel, not to
58 * the simulation platform, so it's invoked from
59 * the general MIPS timer_interrupt routine.
60 *
61 * We have a problem in that the interrupt vector code
62 * had to turn off the timer IM bit to avoid redundant
63 * entries, but we may never get to mips_cpu_irq_end
64 * to turn it back on again if the scheduler gets
65 * involved. So we clear the pending timer here,
66 * and re-enable the mask...
67 */
68
69 int vpflags = dvpe();
70 write_c0_compare (read_c0_count() - 1);
71 clear_c0_cause(0x100 << cp0_compare_irq);
72 set_c0_status(0x100 << cp0_compare_irq);
73 irq_enable_hazard();
74 evpe(vpflags);
75
76 if (cpu_data[cpu].vpe_id == 0)
77 timer_interrupt(irq, dev_id);
78 else
79 write_c0_compare (read_c0_count() + ( mips_hpt_frequency/HZ));
80 smtc_timer_broadcast(cpu_data[cpu].vpe_id);
81
82#endif /* CONFIG_MIPS_MT_SMTC */
83
84 /*
85 * every CPU should do profiling and process accounting
86 */
87 local_timer_interrupt (irq, dev_id);
88
89 return IRQ_HANDLED;
90#else
91 return timer_interrupt (irq, dev_id);
92#endif
93}
94
95
96
97/* 26/*
98 * Estimate CPU frequency. Sets mips_hpt_frequency as a side-effect 27 * Estimate CPU frequency. Sets mips_hpt_frequency as a side-effect
99 */ 28 */
@@ -146,7 +75,7 @@ static unsigned int __init estimate_cpu_frequency(void)
146 return count; 75 return count;
147} 76}
148 77
149void __init sim_time_init(void) 78void __init plat_time_init(void)
150{ 79{
151 unsigned int est_freq, flags; 80 unsigned int est_freq, flags;
152 81
@@ -155,7 +84,7 @@ void __init sim_time_init(void)
155 /* Set Data mode - binary. */ 84 /* Set Data mode - binary. */
156 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL); 85 CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
157 86
158 est_freq = estimate_cpu_frequency (); 87 est_freq = estimate_cpu_frequency();
159 88
160 printk(KERN_INFO "CPU frequency %d.%02d MHz\n", est_freq / 1000000, 89 printk(KERN_INFO "CPU frequency %d.%02d MHz\n", est_freq / 1000000,
161 (est_freq % 1000000) * 100 / 1000000); 90 (est_freq % 1000000) * 100 / 1000000);
@@ -185,7 +114,6 @@ void __init plat_timer_setup(struct irqaction *irq)
185 } 114 }
186 115
187 /* we are using the cpu counter for timer interrupts */ 116 /* we are using the cpu counter for timer interrupts */
188 irq->handler = sim_timer_interrupt;
189 setup_irq(mips_cpu_timer_irq, irq); 117 setup_irq(mips_cpu_timer_irq, irq);
190 118
191#ifdef CONFIG_SMP 119#ifdef CONFIG_SMP
diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile
index 43e4810dcaa8..32fd5db95774 100644
--- a/arch/mips/mm/Makefile
+++ b/arch/mips/mm/Makefile
@@ -22,7 +22,7 @@ obj-$(CONFIG_CPU_R5432) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
22obj-$(CONFIG_CPU_R8000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r8k.o 22obj-$(CONFIG_CPU_R8000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r8k.o
23obj-$(CONFIG_CPU_RM7000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 23obj-$(CONFIG_CPU_RM7000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
24obj-$(CONFIG_CPU_RM9000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 24obj-$(CONFIG_CPU_RM9000) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
25obj-$(CONFIG_CPU_SB1) += c-sb1.o cerr-sb1.o cex-sb1.o pg-sb1.o \ 25obj-$(CONFIG_CPU_SB1) += c-r4k.o cerr-sb1.o cex-sb1.o pg-sb1.o \
26 tlb-r4k.o 26 tlb-r4k.o
27obj-$(CONFIG_CPU_TX39XX) += c-tx39.o pg-r4k.o tlb-r3k.o 27obj-$(CONFIG_CPU_TX39XX) += c-tx39.o pg-r4k.o tlb-r3k.o
28obj-$(CONFIG_CPU_TX49XX) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o 28obj-$(CONFIG_CPU_TX49XX) += c-r4k.o cex-gen.o pg-r4k.o tlb-r4k.o
diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c
index 59868a1edf66..c55312f6fd3a 100644
--- a/arch/mips/mm/c-r3k.c
+++ b/arch/mips/mm/c-r3k.c
@@ -121,7 +121,7 @@ static void r3k_flush_icache_range(unsigned long start, unsigned long end)
121 write_c0_status((ST0_ISC|ST0_SWC|flags)&~ST0_IEC); 121 write_c0_status((ST0_ISC|ST0_SWC|flags)&~ST0_IEC);
122 122
123 for (i = 0; i < size; i += 0x080) { 123 for (i = 0; i < size; i += 0x080) {
124 asm ( "sb\t$0, 0x000(%0)\n\t" 124 asm( "sb\t$0, 0x000(%0)\n\t"
125 "sb\t$0, 0x004(%0)\n\t" 125 "sb\t$0, 0x004(%0)\n\t"
126 "sb\t$0, 0x008(%0)\n\t" 126 "sb\t$0, 0x008(%0)\n\t"
127 "sb\t$0, 0x00c(%0)\n\t" 127 "sb\t$0, 0x00c(%0)\n\t"
@@ -178,7 +178,7 @@ static void r3k_flush_dcache_range(unsigned long start, unsigned long end)
178 write_c0_status((ST0_ISC|flags)&~ST0_IEC); 178 write_c0_status((ST0_ISC|flags)&~ST0_IEC);
179 179
180 for (i = 0; i < size; i += 0x080) { 180 for (i = 0; i < size; i += 0x080) {
181 asm ( "sb\t$0, 0x000(%0)\n\t" 181 asm( "sb\t$0, 0x000(%0)\n\t"
182 "sb\t$0, 0x004(%0)\n\t" 182 "sb\t$0, 0x004(%0)\n\t"
183 "sb\t$0, 0x008(%0)\n\t" 183 "sb\t$0, 0x008(%0)\n\t"
184 "sb\t$0, 0x00c(%0)\n\t" 184 "sb\t$0, 0x00c(%0)\n\t"
@@ -217,8 +217,8 @@ static void r3k_flush_dcache_range(unsigned long start, unsigned long end)
217 write_c0_status(flags); 217 write_c0_status(flags);
218} 218}
219 219
220static inline unsigned long get_phys_page (unsigned long addr, 220static inline unsigned long get_phys_page(unsigned long addr,
221 struct mm_struct *mm) 221 struct mm_struct *mm)
222{ 222{
223 pgd_t *pgd; 223 pgd_t *pgd;
224 pud_t *pud; 224 pud_t *pud;
@@ -281,13 +281,13 @@ static void r3k_flush_cache_sigtramp(unsigned long addr)
281 write_c0_status(flags&~ST0_IEC); 281 write_c0_status(flags&~ST0_IEC);
282 282
283 /* Fill the TLB to avoid an exception with caches isolated. */ 283 /* Fill the TLB to avoid an exception with caches isolated. */
284 asm ( "lw\t$0, 0x000(%0)\n\t" 284 asm( "lw\t$0, 0x000(%0)\n\t"
285 "lw\t$0, 0x004(%0)\n\t" 285 "lw\t$0, 0x004(%0)\n\t"
286 : : "r" (addr) ); 286 : : "r" (addr) );
287 287
288 write_c0_status((ST0_ISC|ST0_SWC|flags)&~ST0_IEC); 288 write_c0_status((ST0_ISC|ST0_SWC|flags)&~ST0_IEC);
289 289
290 asm ( "sb\t$0, 0x000(%0)\n\t" 290 asm( "sb\t$0, 0x000(%0)\n\t"
291 "sb\t$0, 0x004(%0)\n\t" 291 "sb\t$0, 0x004(%0)\n\t"
292 : : "r" (addr) ); 292 : : "r" (addr) );
293 293
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index bad571971bf6..971f6c047b8a 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -8,7 +8,9 @@
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */ 9 */
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/highmem.h>
11#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/linkage.h>
12#include <linux/sched.h> 14#include <linux/sched.h>
13#include <linux/mm.h> 15#include <linux/mm.h>
14#include <linux/bitops.h> 16#include <linux/bitops.h>
@@ -162,12 +164,12 @@ static inline void tx49_blast_icache32(void)
162 /* I'm in even chunk. blast odd chunks */ 164 /* I'm in even chunk. blast odd chunks */
163 for (ws = 0; ws < ws_end; ws += ws_inc) 165 for (ws = 0; ws < ws_end; ws += ws_inc)
164 for (addr = start + 0x400; addr < end; addr += 0x400 * 2) 166 for (addr = start + 0x400; addr < end; addr += 0x400 * 2)
165 cache32_unroll32(addr|ws,Index_Invalidate_I); 167 cache32_unroll32(addr|ws, Index_Invalidate_I);
166 CACHE32_UNROLL32_ALIGN; 168 CACHE32_UNROLL32_ALIGN;
167 /* I'm in odd chunk. blast even chunks */ 169 /* I'm in odd chunk. blast even chunks */
168 for (ws = 0; ws < ws_end; ws += ws_inc) 170 for (ws = 0; ws < ws_end; ws += ws_inc)
169 for (addr = start; addr < end; addr += 0x400 * 2) 171 for (addr = start; addr < end; addr += 0x400 * 2)
170 cache32_unroll32(addr|ws,Index_Invalidate_I); 172 cache32_unroll32(addr|ws, Index_Invalidate_I);
171} 173}
172 174
173static inline void blast_icache32_r4600_v1_page_indexed(unsigned long page) 175static inline void blast_icache32_r4600_v1_page_indexed(unsigned long page)
@@ -193,12 +195,12 @@ static inline void tx49_blast_icache32_page_indexed(unsigned long page)
193 /* I'm in even chunk. blast odd chunks */ 195 /* I'm in even chunk. blast odd chunks */
194 for (ws = 0; ws < ws_end; ws += ws_inc) 196 for (ws = 0; ws < ws_end; ws += ws_inc)
195 for (addr = start + 0x400; addr < end; addr += 0x400 * 2) 197 for (addr = start + 0x400; addr < end; addr += 0x400 * 2)
196 cache32_unroll32(addr|ws,Index_Invalidate_I); 198 cache32_unroll32(addr|ws, Index_Invalidate_I);
197 CACHE32_UNROLL32_ALIGN; 199 CACHE32_UNROLL32_ALIGN;
198 /* I'm in odd chunk. blast even chunks */ 200 /* I'm in odd chunk. blast even chunks */
199 for (ws = 0; ws < ws_end; ws += ws_inc) 201 for (ws = 0; ws < ws_end; ws += ws_inc)
200 for (addr = start; addr < end; addr += 0x400 * 2) 202 for (addr = start; addr < end; addr += 0x400 * 2)
201 cache32_unroll32(addr|ws,Index_Invalidate_I); 203 cache32_unroll32(addr|ws, Index_Invalidate_I);
202} 204}
203 205
204static void (* r4k_blast_icache_page)(unsigned long addr); 206static void (* r4k_blast_icache_page)(unsigned long addr);
@@ -317,23 +319,6 @@ static void __init r4k_blast_scache_setup(void)
317 r4k_blast_scache = blast_scache128; 319 r4k_blast_scache = blast_scache128;
318} 320}
319 321
320/*
321 * This is former mm's flush_cache_all() which really should be
322 * flush_cache_vunmap these days ...
323 */
324static inline void local_r4k_flush_cache_all(void * args)
325{
326 r4k_blast_dcache();
327}
328
329static void r4k_flush_cache_all(void)
330{
331 if (!cpu_has_dc_aliases)
332 return;
333
334 r4k_on_each_cpu(local_r4k_flush_cache_all, NULL, 1, 1);
335}
336
337static inline void local_r4k___flush_cache_all(void * args) 322static inline void local_r4k___flush_cache_all(void * args)
338{ 323{
339#if defined(CONFIG_CPU_LOONGSON2) 324#if defined(CONFIG_CPU_LOONGSON2)
@@ -343,7 +328,7 @@ static inline void local_r4k___flush_cache_all(void * args)
343 r4k_blast_dcache(); 328 r4k_blast_dcache();
344 r4k_blast_icache(); 329 r4k_blast_icache();
345 330
346 switch (current_cpu_data.cputype) { 331 switch (current_cpu_type()) {
347 case CPU_R4000SC: 332 case CPU_R4000SC:
348 case CPU_R4000MC: 333 case CPU_R4000MC:
349 case CPU_R4400SC: 334 case CPU_R4400SC:
@@ -392,10 +377,10 @@ static inline void local_r4k_flush_cache_mm(void * args)
392 * R4000SC and R4400SC indexed S-cache ops also invalidate primary 377 * R4000SC and R4400SC indexed S-cache ops also invalidate primary
393 * caches, so we can bail out early. 378 * caches, so we can bail out early.
394 */ 379 */
395 if (current_cpu_data.cputype == CPU_R4000SC || 380 if (current_cpu_type() == CPU_R4000SC ||
396 current_cpu_data.cputype == CPU_R4000MC || 381 current_cpu_type() == CPU_R4000MC ||
397 current_cpu_data.cputype == CPU_R4400SC || 382 current_cpu_type() == CPU_R4400SC ||
398 current_cpu_data.cputype == CPU_R4400MC) { 383 current_cpu_type() == CPU_R4400MC) {
399 r4k_blast_scache(); 384 r4k_blast_scache();
400 return; 385 return;
401 } 386 }
@@ -422,13 +407,14 @@ static inline void local_r4k_flush_cache_page(void *args)
422 struct flush_cache_page_args *fcp_args = args; 407 struct flush_cache_page_args *fcp_args = args;
423 struct vm_area_struct *vma = fcp_args->vma; 408 struct vm_area_struct *vma = fcp_args->vma;
424 unsigned long addr = fcp_args->addr; 409 unsigned long addr = fcp_args->addr;
425 unsigned long paddr = fcp_args->pfn << PAGE_SHIFT; 410 struct page *page = pfn_to_page(fcp_args->pfn);
426 int exec = vma->vm_flags & VM_EXEC; 411 int exec = vma->vm_flags & VM_EXEC;
427 struct mm_struct *mm = vma->vm_mm; 412 struct mm_struct *mm = vma->vm_mm;
428 pgd_t *pgdp; 413 pgd_t *pgdp;
429 pud_t *pudp; 414 pud_t *pudp;
430 pmd_t *pmdp; 415 pmd_t *pmdp;
431 pte_t *ptep; 416 pte_t *ptep;
417 void *vaddr;
432 418
433 /* 419 /*
434 * If ownes no valid ASID yet, cannot possibly have gotten 420 * If ownes no valid ASID yet, cannot possibly have gotten
@@ -450,43 +436,40 @@ static inline void local_r4k_flush_cache_page(void *args)
450 if (!(pte_val(*ptep) & _PAGE_PRESENT)) 436 if (!(pte_val(*ptep) & _PAGE_PRESENT))
451 return; 437 return;
452 438
453 /* 439 if ((mm == current->active_mm) && (pte_val(*ptep) & _PAGE_VALID))
454 * Doing flushes for another ASID than the current one is 440 vaddr = NULL;
455 * too difficult since stupid R4k caches do a TLB translation 441 else {
456 * for every cache flush operation. So we do indexed flushes 442 /*
457 * in that case, which doesn't overly flush the cache too much. 443 * Use kmap_coherent or kmap_atomic to do flushes for
458 */ 444 * another ASID than the current one.
459 if ((mm == current->active_mm) && (pte_val(*ptep) & _PAGE_VALID)) { 445 */
460 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { 446 if (cpu_has_dc_aliases)
461 r4k_blast_dcache_page(addr); 447 vaddr = kmap_coherent(page, addr);
462 if (exec && !cpu_icache_snoops_remote_store) 448 else
463 r4k_blast_scache_page(addr); 449 vaddr = kmap_atomic(page, KM_USER0);
464 } 450 addr = (unsigned long)vaddr;
465 if (exec)
466 r4k_blast_icache_page(addr);
467
468 return;
469 } 451 }
470 452
471 /*
472 * Do indexed flush, too much work to get the (possible) TLB refills
473 * to work correctly.
474 */
475 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) { 453 if (cpu_has_dc_aliases || (exec && !cpu_has_ic_fills_f_dc)) {
476 r4k_blast_dcache_page_indexed(cpu_has_pindexed_dcache ? 454 r4k_blast_dcache_page(addr);
477 paddr : addr); 455 if (exec && !cpu_icache_snoops_remote_store)
478 if (exec && !cpu_icache_snoops_remote_store) { 456 r4k_blast_scache_page(addr);
479 r4k_blast_scache_page_indexed(paddr);
480 }
481 } 457 }
482 if (exec) { 458 if (exec) {
483 if (cpu_has_vtag_icache && mm == current->active_mm) { 459 if (vaddr && cpu_has_vtag_icache && mm == current->active_mm) {
484 int cpu = smp_processor_id(); 460 int cpu = smp_processor_id();
485 461
486 if (cpu_context(cpu, mm) != 0) 462 if (cpu_context(cpu, mm) != 0)
487 drop_mmu_context(mm, cpu); 463 drop_mmu_context(mm, cpu);
488 } else 464 } else
489 r4k_blast_icache_page_indexed(addr); 465 r4k_blast_icache_page(addr);
466 }
467
468 if (vaddr) {
469 if (cpu_has_dc_aliases)
470 kunmap_coherent();
471 else
472 kunmap_atomic(vaddr, KM_USER0);
490 } 473 }
491} 474}
492 475
@@ -948,12 +931,16 @@ static void __init probe_pcache(void)
948 switch (c->cputype) { 931 switch (c->cputype) {
949 case CPU_20KC: 932 case CPU_20KC:
950 case CPU_25KF: 933 case CPU_25KF:
934 case CPU_SB1:
935 case CPU_SB1A:
951 c->dcache.flags |= MIPS_CACHE_PINDEX; 936 c->dcache.flags |= MIPS_CACHE_PINDEX;
937 break;
938
952 case CPU_R10000: 939 case CPU_R10000:
953 case CPU_R12000: 940 case CPU_R12000:
954 case CPU_R14000: 941 case CPU_R14000:
955 case CPU_SB1:
956 break; 942 break;
943
957 case CPU_24K: 944 case CPU_24K:
958 case CPU_34K: 945 case CPU_34K:
959 case CPU_74K: 946 case CPU_74K:
@@ -1210,7 +1197,7 @@ static void __init coherency_setup(void)
1210 * this bit and; some wire it to zero, others like Toshiba had the 1197 * this bit and; some wire it to zero, others like Toshiba had the
1211 * silly idea of putting something else there ... 1198 * silly idea of putting something else there ...
1212 */ 1199 */
1213 switch (current_cpu_data.cputype) { 1200 switch (current_cpu_type()) {
1214 case CPU_R4000PC: 1201 case CPU_R4000PC:
1215 case CPU_R4000SC: 1202 case CPU_R4000SC:
1216 case CPU_R4000MC: 1203 case CPU_R4000MC:
@@ -1235,11 +1222,20 @@ void __init r4k_cache_init(void)
1235{ 1222{
1236 extern void build_clear_page(void); 1223 extern void build_clear_page(void);
1237 extern void build_copy_page(void); 1224 extern void build_copy_page(void);
1238 extern char except_vec2_generic; 1225 extern char __weak except_vec2_generic;
1226 extern char __weak except_vec2_sb1;
1239 struct cpuinfo_mips *c = &current_cpu_data; 1227 struct cpuinfo_mips *c = &current_cpu_data;
1240 1228
1241 /* Default cache error handler for R4000 and R5000 family */ 1229 switch (c->cputype) {
1242 set_uncached_handler (0x100, &except_vec2_generic, 0x80); 1230 case CPU_SB1:
1231 case CPU_SB1A:
1232 set_uncached_handler(0x100, &except_vec2_sb1, 0x80);
1233 break;
1234
1235 default:
1236 set_uncached_handler(0x100, &except_vec2_generic, 0x80);
1237 break;
1238 }
1243 1239
1244 probe_pcache(); 1240 probe_pcache();
1245 setup_scache(); 1241 setup_scache();
@@ -1265,7 +1261,7 @@ void __init r4k_cache_init(void)
1265 PAGE_SIZE - 1); 1261 PAGE_SIZE - 1);
1266 else 1262 else
1267 shm_align_mask = PAGE_SIZE-1; 1263 shm_align_mask = PAGE_SIZE-1;
1268 flush_cache_all = r4k_flush_cache_all; 1264 flush_cache_all = cache_noop;
1269 __flush_cache_all = r4k___flush_cache_all; 1265 __flush_cache_all = r4k___flush_cache_all;
1270 flush_cache_mm = r4k_flush_cache_mm; 1266 flush_cache_mm = r4k_flush_cache_mm;
1271 flush_cache_page = r4k_flush_cache_page; 1267 flush_cache_page = r4k_flush_cache_page;
diff --git a/arch/mips/mm/c-sb1.c b/arch/mips/mm/c-sb1.c
deleted file mode 100644
index 85ce2842d0da..000000000000
--- a/arch/mips/mm/c-sb1.c
+++ /dev/null
@@ -1,535 +0,0 @@
1/*
2 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
3 * Copyright (C) 1997, 2001 Ralf Baechle (ralf@gnu.org)
4 * Copyright (C) 2000, 2001, 2002, 2003 Broadcom Corporation
5 * Copyright (C) 2004 Maciej W. Rozycki
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21#include <linux/init.h>
22#include <linux/hardirq.h>
23
24#include <asm/asm.h>
25#include <asm/bootinfo.h>
26#include <asm/cacheops.h>
27#include <asm/cpu.h>
28#include <asm/mipsregs.h>
29#include <asm/mmu_context.h>
30#include <asm/uaccess.h>
31
32extern void sb1_dma_init(void);
33
34/* These are probed at ld_mmu time */
35static unsigned long icache_size;
36static unsigned long dcache_size;
37
38static unsigned short icache_line_size;
39static unsigned short dcache_line_size;
40
41static unsigned int icache_index_mask;
42static unsigned int dcache_index_mask;
43
44static unsigned short icache_assoc;
45static unsigned short dcache_assoc;
46
47static unsigned short icache_sets;
48static unsigned short dcache_sets;
49
50static unsigned int icache_range_cutoff;
51static unsigned int dcache_range_cutoff;
52
53static inline void sb1_on_each_cpu(void (*func) (void *info), void *info,
54 int retry, int wait)
55{
56 preempt_disable();
57 smp_call_function(func, info, retry, wait);
58 func(info);
59 preempt_enable();
60}
61
62/*
63 * The dcache is fully coherent to the system, with one
64 * big caveat: the instruction stream. In other words,
65 * if we miss in the icache, and have dirty data in the
66 * L1 dcache, then we'll go out to memory (or the L2) and
67 * get the not-as-recent data.
68 *
69 * So the only time we have to flush the dcache is when
70 * we're flushing the icache. Since the L2 is fully
71 * coherent to everything, including I/O, we never have
72 * to flush it
73 */
74
75#define cache_set_op(op, addr) \
76 __asm__ __volatile__( \
77 " .set noreorder \n" \
78 " .set mips64\n\t \n" \
79 " cache %0, (0<<13)(%1) \n" \
80 " cache %0, (1<<13)(%1) \n" \
81 " cache %0, (2<<13)(%1) \n" \
82 " cache %0, (3<<13)(%1) \n" \
83 " .set mips0 \n" \
84 " .set reorder" \
85 : \
86 : "i" (op), "r" (addr))
87
88#define sync() \
89 __asm__ __volatile( \
90 " .set mips64\n\t \n" \
91 " sync \n" \
92 " .set mips0")
93
94#define mispredict() \
95 __asm__ __volatile__( \
96 " bnezl $0, 1f \n" /* Force mispredict */ \
97 "1: \n");
98
99/*
100 * Writeback and invalidate the entire dcache
101 */
102static inline void __sb1_writeback_inv_dcache_all(void)
103{
104 unsigned long addr = 0;
105
106 while (addr < dcache_line_size * dcache_sets) {
107 cache_set_op(Index_Writeback_Inv_D, addr);
108 addr += dcache_line_size;
109 }
110}
111
112/*
113 * Writeback and invalidate a range of the dcache. The addresses are
114 * virtual, and since we're using index ops and bit 12 is part of both
115 * the virtual frame and physical index, we have to clear both sets
116 * (bit 12 set and cleared).
117 */
118static inline void __sb1_writeback_inv_dcache_range(unsigned long start,
119 unsigned long end)
120{
121 unsigned long index;
122
123 start &= ~(dcache_line_size - 1);
124 end = (end + dcache_line_size - 1) & ~(dcache_line_size - 1);
125
126 while (start != end) {
127 index = start & dcache_index_mask;
128 cache_set_op(Index_Writeback_Inv_D, index);
129 cache_set_op(Index_Writeback_Inv_D, index ^ (1<<12));
130 start += dcache_line_size;
131 }
132 sync();
133}
134
135/*
136 * Writeback and invalidate a range of the dcache. With physical
137 * addresseses, we don't have to worry about possible bit 12 aliasing.
138 * XXXKW is it worth turning on KX and using hit ops with xkphys?
139 */
140static inline void __sb1_writeback_inv_dcache_phys_range(unsigned long start,
141 unsigned long end)
142{
143 start &= ~(dcache_line_size - 1);
144 end = (end + dcache_line_size - 1) & ~(dcache_line_size - 1);
145
146 while (start != end) {
147 cache_set_op(Index_Writeback_Inv_D, start & dcache_index_mask);
148 start += dcache_line_size;
149 }
150 sync();
151}
152
153
154/*
155 * Invalidate the entire icache
156 */
157static inline void __sb1_flush_icache_all(void)
158{
159 unsigned long addr = 0;
160
161 while (addr < icache_line_size * icache_sets) {
162 cache_set_op(Index_Invalidate_I, addr);
163 addr += icache_line_size;
164 }
165}
166
167/*
168 * Invalidate a range of the icache. The addresses are virtual, and
169 * the cache is virtually indexed and tagged. However, we don't
170 * necessarily have the right ASID context, so use index ops instead
171 * of hit ops.
172 */
173static inline void __sb1_flush_icache_range(unsigned long start,
174 unsigned long end)
175{
176 start &= ~(icache_line_size - 1);
177 end = (end + icache_line_size - 1) & ~(icache_line_size - 1);
178
179 while (start != end) {
180 cache_set_op(Index_Invalidate_I, start & icache_index_mask);
181 start += icache_line_size;
182 }
183 mispredict();
184 sync();
185}
186
187/*
188 * Flush the icache for a given physical page. Need to writeback the
189 * dcache first, then invalidate the icache. If the page isn't
190 * executable, nothing is required.
191 */
192static void local_sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn)
193{
194 int cpu = smp_processor_id();
195
196#ifndef CONFIG_SMP
197 if (!(vma->vm_flags & VM_EXEC))
198 return;
199#endif
200
201 __sb1_writeback_inv_dcache_range(addr, addr + PAGE_SIZE);
202
203 /*
204 * Bumping the ASID is probably cheaper than the flush ...
205 */
206 if (vma->vm_mm == current->active_mm) {
207 if (cpu_context(cpu, vma->vm_mm) != 0)
208 drop_mmu_context(vma->vm_mm, cpu);
209 } else
210 __sb1_flush_icache_range(addr, addr + PAGE_SIZE);
211}
212
213#ifdef CONFIG_SMP
214struct flush_cache_page_args {
215 struct vm_area_struct *vma;
216 unsigned long addr;
217 unsigned long pfn;
218};
219
220static void sb1_flush_cache_page_ipi(void *info)
221{
222 struct flush_cache_page_args *args = info;
223
224 local_sb1_flush_cache_page(args->vma, args->addr, args->pfn);
225}
226
227/* Dirty dcache could be on another CPU, so do the IPIs */
228static void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn)
229{
230 struct flush_cache_page_args args;
231
232 if (!(vma->vm_flags & VM_EXEC))
233 return;
234
235 addr &= PAGE_MASK;
236 args.vma = vma;
237 args.addr = addr;
238 args.pfn = pfn;
239 sb1_on_each_cpu(sb1_flush_cache_page_ipi, (void *) &args, 1, 1);
240}
241#else
242void sb1_flush_cache_page(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn)
243 __attribute__((alias("local_sb1_flush_cache_page")));
244#endif
245
246#ifdef CONFIG_SMP
247static void sb1_flush_cache_data_page_ipi(void *info)
248{
249 unsigned long start = (unsigned long)info;
250
251 __sb1_writeback_inv_dcache_range(start, start + PAGE_SIZE);
252}
253
254static void sb1_flush_cache_data_page(unsigned long addr)
255{
256 if (in_atomic())
257 __sb1_writeback_inv_dcache_range(addr, addr + PAGE_SIZE);
258 else
259 on_each_cpu(sb1_flush_cache_data_page_ipi, (void *) addr, 1, 1);
260}
261#else
262
263static void local_sb1_flush_cache_data_page(unsigned long addr)
264{
265 __sb1_writeback_inv_dcache_range(addr, addr + PAGE_SIZE);
266}
267
268void sb1_flush_cache_data_page(unsigned long)
269 __attribute__((alias("local_sb1_flush_cache_data_page")));
270#endif
271
272/*
273 * Invalidate all caches on this CPU
274 */
275static void __used local_sb1___flush_cache_all(void)
276{
277 __sb1_writeback_inv_dcache_all();
278 __sb1_flush_icache_all();
279}
280
281#ifdef CONFIG_SMP
282void sb1___flush_cache_all_ipi(void *ignored)
283 __attribute__((alias("local_sb1___flush_cache_all")));
284
285static void sb1___flush_cache_all(void)
286{
287 sb1_on_each_cpu(sb1___flush_cache_all_ipi, 0, 1, 1);
288}
289#else
290void sb1___flush_cache_all(void)
291 __attribute__((alias("local_sb1___flush_cache_all")));
292#endif
293
294/*
295 * When flushing a range in the icache, we have to first writeback
296 * the dcache for the same range, so new ifetches will see any
297 * data that was dirty in the dcache.
298 *
299 * The start/end arguments are Kseg addresses (possibly mapped Kseg).
300 */
301
302static void local_sb1_flush_icache_range(unsigned long start,
303 unsigned long end)
304{
305 /* Just wb-inv the whole dcache if the range is big enough */
306 if ((end - start) > dcache_range_cutoff)
307 __sb1_writeback_inv_dcache_all();
308 else
309 __sb1_writeback_inv_dcache_range(start, end);
310
311 /* Just flush the whole icache if the range is big enough */
312 if ((end - start) > icache_range_cutoff)
313 __sb1_flush_icache_all();
314 else
315 __sb1_flush_icache_range(start, end);
316}
317
318#ifdef CONFIG_SMP
319struct flush_icache_range_args {
320 unsigned long start;
321 unsigned long end;
322};
323
324static void sb1_flush_icache_range_ipi(void *info)
325{
326 struct flush_icache_range_args *args = info;
327
328 local_sb1_flush_icache_range(args->start, args->end);
329}
330
331void sb1_flush_icache_range(unsigned long start, unsigned long end)
332{
333 struct flush_icache_range_args args;
334
335 args.start = start;
336 args.end = end;
337 sb1_on_each_cpu(sb1_flush_icache_range_ipi, &args, 1, 1);
338}
339#else
340void sb1_flush_icache_range(unsigned long start, unsigned long end)
341 __attribute__((alias("local_sb1_flush_icache_range")));
342#endif
343
344/*
345 * A signal trampoline must fit into a single cacheline.
346 */
347static void local_sb1_flush_cache_sigtramp(unsigned long addr)
348{
349 cache_set_op(Index_Writeback_Inv_D, addr & dcache_index_mask);
350 cache_set_op(Index_Writeback_Inv_D, (addr ^ (1<<12)) & dcache_index_mask);
351 cache_set_op(Index_Invalidate_I, addr & icache_index_mask);
352 mispredict();
353}
354
355#ifdef CONFIG_SMP
356static void sb1_flush_cache_sigtramp_ipi(void *info)
357{
358 unsigned long iaddr = (unsigned long) info;
359 local_sb1_flush_cache_sigtramp(iaddr);
360}
361
362static void sb1_flush_cache_sigtramp(unsigned long addr)
363{
364 sb1_on_each_cpu(sb1_flush_cache_sigtramp_ipi, (void *) addr, 1, 1);
365}
366#else
367void sb1_flush_cache_sigtramp(unsigned long addr)
368 __attribute__((alias("local_sb1_flush_cache_sigtramp")));
369#endif
370
371
372/*
373 * Anything that just flushes dcache state can be ignored, as we're always
374 * coherent in dcache space. This is just a dummy function that all the
375 * nop'ed routines point to
376 */
377static void sb1_nop(void)
378{
379}
380
381/*
382 * Cache set values (from the mips64 spec)
383 * 0 - 64
384 * 1 - 128
385 * 2 - 256
386 * 3 - 512
387 * 4 - 1024
388 * 5 - 2048
389 * 6 - 4096
390 * 7 - Reserved
391 */
392
393static unsigned int decode_cache_sets(unsigned int config_field)
394{
395 if (config_field == 7) {
396 /* JDCXXX - Find a graceful way to abort. */
397 return 0;
398 }
399 return (1<<(config_field + 6));
400}
401
402/*
403 * Cache line size values (from the mips64 spec)
404 * 0 - No cache present.
405 * 1 - 4 bytes
406 * 2 - 8 bytes
407 * 3 - 16 bytes
408 * 4 - 32 bytes
409 * 5 - 64 bytes
410 * 6 - 128 bytes
411 * 7 - Reserved
412 */
413
414static unsigned int decode_cache_line_size(unsigned int config_field)
415{
416 if (config_field == 0) {
417 return 0;
418 } else if (config_field == 7) {
419 /* JDCXXX - Find a graceful way to abort. */
420 return 0;
421 }
422 return (1<<(config_field + 1));
423}
424
425/*
426 * Relevant bits of the config1 register format (from the MIPS32/MIPS64 specs)
427 *
428 * 24:22 Icache sets per way
429 * 21:19 Icache line size
430 * 18:16 Icache Associativity
431 * 15:13 Dcache sets per way
432 * 12:10 Dcache line size
433 * 9:7 Dcache Associativity
434 */
435
436static char *way_string[] = {
437 "direct mapped", "2-way", "3-way", "4-way",
438 "5-way", "6-way", "7-way", "8-way",
439};
440
441static __init void probe_cache_sizes(void)
442{
443 u32 config1;
444
445 config1 = read_c0_config1();
446 icache_line_size = decode_cache_line_size((config1 >> 19) & 0x7);
447 dcache_line_size = decode_cache_line_size((config1 >> 10) & 0x7);
448 icache_sets = decode_cache_sets((config1 >> 22) & 0x7);
449 dcache_sets = decode_cache_sets((config1 >> 13) & 0x7);
450 icache_assoc = ((config1 >> 16) & 0x7) + 1;
451 dcache_assoc = ((config1 >> 7) & 0x7) + 1;
452 icache_size = icache_line_size * icache_sets * icache_assoc;
453 dcache_size = dcache_line_size * dcache_sets * dcache_assoc;
454 /* Need to remove non-index bits for index ops */
455 icache_index_mask = (icache_sets - 1) * icache_line_size;
456 dcache_index_mask = (dcache_sets - 1) * dcache_line_size;
457 /*
458 * These are for choosing range (index ops) versus all.
459 * icache flushes all ways for each set, so drop icache_assoc.
460 * dcache flushes all ways and each setting of bit 12 for each
461 * index, so drop dcache_assoc and halve the dcache_sets.
462 */
463 icache_range_cutoff = icache_sets * icache_line_size;
464 dcache_range_cutoff = (dcache_sets / 2) * icache_line_size;
465
466 printk("Primary instruction cache %ldkB, %s, linesize %d bytes.\n",
467 icache_size >> 10, way_string[icache_assoc - 1],
468 icache_line_size);
469 printk("Primary data cache %ldkB, %s, linesize %d bytes.\n",
470 dcache_size >> 10, way_string[dcache_assoc - 1],
471 dcache_line_size);
472}
473
474/*
475 * This is called from cache.c. We have to set up all the
476 * memory management function pointers, as well as initialize
477 * the caches and tlbs
478 */
479void __init sb1_cache_init(void)
480{
481 extern char except_vec2_sb1;
482
483 /* Special cache error handler for SB1 */
484 set_uncached_handler (0x100, &except_vec2_sb1, 0x80);
485
486 probe_cache_sizes();
487
488#ifdef CONFIG_SIBYTE_DMA_PAGEOPS
489 sb1_dma_init();
490#endif
491
492 /*
493 * None of these are needed for the SB1 - the Dcache is
494 * physically indexed and tagged, so no virtual aliasing can
495 * occur
496 */
497 flush_cache_range = (void *) sb1_nop;
498 flush_cache_mm = (void (*)(struct mm_struct *))sb1_nop;
499 flush_cache_all = sb1_nop;
500
501 /* These routines are for Icache coherence with the Dcache */
502 flush_icache_range = sb1_flush_icache_range;
503 flush_icache_all = __sb1_flush_icache_all; /* local only */
504
505 /* This implies an Icache flush too, so can't be nop'ed */
506 flush_cache_page = sb1_flush_cache_page;
507
508 flush_cache_sigtramp = sb1_flush_cache_sigtramp;
509 local_flush_data_cache_page = (void *) sb1_nop;
510 flush_data_cache_page = sb1_flush_cache_data_page;
511
512 /* Full flush */
513 __flush_cache_all = sb1___flush_cache_all;
514
515 change_c0_config(CONF_CM_CMASK, CONF_CM_DEFAULT);
516
517 /*
518 * This is the only way to force the update of K0 to complete
519 * before subsequent instruction fetch.
520 */
521 __asm__ __volatile__(
522 ".set push \n"
523 " .set noat \n"
524 " .set noreorder \n"
525 " .set mips3 \n"
526 " " STR(PTR_LA) " $1, 1f \n"
527 " " STR(MTC0) " $1, $14 \n"
528 " eret \n"
529 "1: .set pop"
530 :
531 :
532 : "memory");
533
534 local_sb1___flush_cache_all();
535}
diff --git a/arch/mips/mm/c-tx39.c b/arch/mips/mm/c-tx39.c
index 560a6de96556..9ea121e8cdce 100644
--- a/arch/mips/mm/c-tx39.c
+++ b/arch/mips/mm/c-tx39.c
@@ -69,7 +69,7 @@ static void tx39h_dma_cache_wback_inv(unsigned long addr, unsigned long size)
69/* TX39H2,TX39H3 */ 69/* TX39H2,TX39H3 */
70static inline void tx39_blast_dcache_page(unsigned long addr) 70static inline void tx39_blast_dcache_page(unsigned long addr)
71{ 71{
72 if (current_cpu_data.cputype != CPU_TX3912) 72 if (current_cpu_type() != CPU_TX3912)
73 blast_dcache16_page(addr); 73 blast_dcache16_page(addr);
74} 74}
75 75
@@ -307,7 +307,7 @@ static __init void tx39_probe_cache(void)
307 TX39_CONF_DCS_SHIFT)); 307 TX39_CONF_DCS_SHIFT));
308 308
309 current_cpu_data.icache.linesz = 16; 309 current_cpu_data.icache.linesz = 16;
310 switch (current_cpu_data.cputype) { 310 switch (current_cpu_type()) {
311 case CPU_TX3912: 311 case CPU_TX3912:
312 current_cpu_data.icache.ways = 1; 312 current_cpu_data.icache.ways = 1;
313 current_cpu_data.dcache.ways = 1; 313 current_cpu_data.dcache.ways = 1;
@@ -341,7 +341,7 @@ void __init tx39_cache_init(void)
341 341
342 tx39_probe_cache(); 342 tx39_probe_cache();
343 343
344 switch (current_cpu_data.cputype) { 344 switch (current_cpu_type()) {
345 case CPU_TX3912: 345 case CPU_TX3912:
346 /* TX39/H core (writethru direct-map cache) */ 346 /* TX39/H core (writethru direct-map cache) */
347 flush_cache_all = tx39h_flush_icache_all; 347 flush_cache_all = tx39h_flush_icache_all;
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 81f925a9a731..43dde874f414 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -3,13 +3,14 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1994 - 2003, 07 by Ralf Baechle (ralf@linux-mips.org) 6 * Copyright (C) 1994 - 2003, 06, 07 by Ralf Baechle (ralf@linux-mips.org)
7 * Copyright (C) 2007 MIPS Technologies, Inc. 7 * Copyright (C) 2007 MIPS Technologies, Inc.
8 */ 8 */
9#include <linux/fs.h> 9#include <linux/fs.h>
10#include <linux/fcntl.h> 10#include <linux/fcntl.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/linkage.h>
13#include <linux/module.h> 14#include <linux/module.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
15#include <linux/mm.h> 16#include <linux/mm.h>
@@ -157,12 +158,6 @@ void __init cpu_cache_init(void)
157 tx39_cache_init(); 158 tx39_cache_init();
158 return; 159 return;
159 } 160 }
160 if (cpu_has_sb1_cache) {
161 extern void __weak sb1_cache_init(void);
162
163 sb1_cache_init();
164 return;
165 }
166 161
167 panic(cache_panic); 162 panic(cache_panic);
168} 163}
diff --git a/arch/mips/mm/cerr-sb1.c b/arch/mips/mm/cerr-sb1.c
index 4c72e650f9b6..e7f539e3284b 100644
--- a/arch/mips/mm/cerr-sb1.c
+++ b/arch/mips/mm/cerr-sb1.c
@@ -271,14 +271,22 @@ asmlinkage void sb1_cache_error(void)
271 271
272/* Parity lookup table. */ 272/* Parity lookup table. */
273static const uint8_t parity[256] = { 273static const uint8_t parity[256] = {
274 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, 274 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
275 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0, 275 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
276 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0, 276 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
277 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, 277 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
278 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0, 278 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
279 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, 279 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
280 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, 280 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
281 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0 281 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
282 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
283 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
284 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
285 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
286 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
287 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
288 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
289 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0
282}; 290};
283 291
284/* Masks to select bits for Hamming parity, mask_72_64[i] for bit[i] */ 292/* Masks to select bits for Hamming parity, mask_72_64[i] for bit[i] */
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index f60b3dc0fc62..98b5e5bac02e 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -35,8 +35,8 @@ static inline unsigned long dma_addr_to_virt(dma_addr_t dma_addr)
35static inline int cpu_is_noncoherent_r10000(struct device *dev) 35static inline int cpu_is_noncoherent_r10000(struct device *dev)
36{ 36{
37 return !plat_device_is_coherent(dev) && 37 return !plat_device_is_coherent(dev) &&
38 (current_cpu_data.cputype == CPU_R10000 || 38 (current_cpu_type() == CPU_R10000 ||
39 current_cpu_data.cputype == CPU_R12000); 39 current_cpu_type() == CPU_R12000);
40} 40}
41 41
42void *dma_alloc_noncoherent(struct device *dev, size_t size, 42void *dma_alloc_noncoherent(struct device *dev, size_t size,
diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c
index e47e9e9486bf..4f770ac885ce 100644
--- a/arch/mips/mm/pg-r4k.c
+++ b/arch/mips/mm/pg-r4k.c
@@ -347,13 +347,14 @@ void __init build_clear_page(void)
347{ 347{
348 unsigned int loop_start; 348 unsigned int loop_start;
349 unsigned long off; 349 unsigned long off;
350 int i;
350 351
351 epc = (unsigned int *) &clear_page_array; 352 epc = (unsigned int *) &clear_page_array;
352 instruction_pending = 0; 353 instruction_pending = 0;
353 store_offset = 0; 354 store_offset = 0;
354 355
355 if (cpu_has_prefetch) { 356 if (cpu_has_prefetch) {
356 switch (current_cpu_data.cputype) { 357 switch (current_cpu_type()) {
357 case CPU_TX49XX: 358 case CPU_TX49XX:
358 /* TX49 supports only Pref_Load */ 359 /* TX49 supports only Pref_Load */
359 pref_offset_clear = 0; 360 pref_offset_clear = 0;
@@ -434,12 +435,22 @@ dest = label();
434 build_jr_ra(); 435 build_jr_ra();
435 436
436 BUG_ON(epc > clear_page_array + ARRAY_SIZE(clear_page_array)); 437 BUG_ON(epc > clear_page_array + ARRAY_SIZE(clear_page_array));
438
439 pr_info("Synthesized clear page handler (%u instructions).\n",
440 (unsigned int)(epc - clear_page_array));
441
442 pr_debug("\t.set push\n");
443 pr_debug("\t.set noreorder\n");
444 for (i = 0; i < (epc - clear_page_array); i++)
445 pr_debug("\t.word 0x%08x\n", clear_page_array[i]);
446 pr_debug("\t.set pop\n");
437} 447}
438 448
439void __init build_copy_page(void) 449void __init build_copy_page(void)
440{ 450{
441 unsigned int loop_start; 451 unsigned int loop_start;
442 unsigned long off; 452 unsigned long off;
453 int i;
443 454
444 epc = (unsigned int *) &copy_page_array; 455 epc = (unsigned int *) &copy_page_array;
445 store_offset = load_offset = 0; 456 store_offset = load_offset = 0;
@@ -515,4 +526,13 @@ dest = label();
515 build_jr_ra(); 526 build_jr_ra();
516 527
517 BUG_ON(epc > copy_page_array + ARRAY_SIZE(copy_page_array)); 528 BUG_ON(epc > copy_page_array + ARRAY_SIZE(copy_page_array));
529
530 pr_info("Synthesized copy page handler (%u instructions).\n",
531 (unsigned int)(epc - copy_page_array));
532
533 pr_debug("\t.set push\n");
534 pr_debug("\t.set noreorder\n");
535 for (i = 0; i < (epc - copy_page_array); i++)
536 pr_debug("\t.word 0x%08x\n", copy_page_array[i]);
537 pr_debug("\t.set pop\n");
518} 538}
diff --git a/arch/mips/mm/pg-sb1.c b/arch/mips/mm/pg-sb1.c
index adb37d0a30ea..a3e98c243a89 100644
--- a/arch/mips/mm/pg-sb1.c
+++ b/arch/mips/mm/pg-sb1.c
@@ -188,9 +188,9 @@ static inline void copy_page_cpu(void *to, void *from)
188 : "+r" (src), "+r" (dst) 188 : "+r" (src), "+r" (dst)
189 : "r" (end) 189 : "r" (end)
190#ifdef CONFIG_64BIT 190#ifdef CONFIG_64BIT
191 : "$8","$9","$10","$11","memory"); 191 : "$8", "$9", "$10", "$11", "memory");
192#else 192#else
193 : "$2","$3","$6","$7","$8","$9","$10","$11","memory"); 193 : "$2", "$3", "$6", "$7", "$8", "$9", "$10", "$11", "memory");
194#endif 194#endif
195} 195}
196 196
@@ -292,3 +292,11 @@ void copy_page(void *to, void *from)
292 292
293EXPORT_SYMBOL(clear_page); 293EXPORT_SYMBOL(clear_page);
294EXPORT_SYMBOL(copy_page); 294EXPORT_SYMBOL(copy_page);
295
296void __init build_clear_page(void)
297{
298}
299
300void __init build_copy_page(void)
301{
302}
diff --git a/arch/mips/mm/pgtable.c b/arch/mips/mm/pgtable.c
index c93aa6cbcaca..57df1c38e303 100644
--- a/arch/mips/mm/pgtable.c
+++ b/arch/mips/mm/pgtable.c
@@ -29,9 +29,9 @@ void show_mem(void)
29 shared += page_count(page) - 1; 29 shared += page_count(page) - 1;
30 } 30 }
31 printk("%d pages of RAM\n", total); 31 printk("%d pages of RAM\n", total);
32 printk("%d pages of HIGHMEM\n",highmem); 32 printk("%d pages of HIGHMEM\n", highmem);
33 printk("%d reserved pages\n",reserved); 33 printk("%d reserved pages\n", reserved);
34 printk("%d pages shared\n",shared); 34 printk("%d pages shared\n", shared);
35 printk("%d pages swap cached\n",cached); 35 printk("%d pages swap cached\n", cached);
36#endif 36#endif
37} 37}
diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c
index 42b50964c644..c13170bc675c 100644
--- a/arch/mips/mm/sc-mips.c
+++ b/arch/mips/mm/sc-mips.c
@@ -102,7 +102,7 @@ static inline int __init mips_sc_probe(void)
102 102
103int __init mips_sc_init(void) 103int __init mips_sc_init(void)
104{ 104{
105 int found = mips_sc_probe (); 105 int found = mips_sc_probe();
106 if (found) { 106 if (found) {
107 mips_sc_enable(); 107 mips_sc_enable();
108 bcops = &mips_sc_ops; 108 bcops = &mips_sc_ops;
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index dcd6913dc1ff..74ae0348cc92 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -491,7 +491,7 @@ void __init tlb_init(void)
491 int wired = current_cpu_data.tlbsize - ntlb; 491 int wired = current_cpu_data.tlbsize - ntlb;
492 write_c0_wired(wired); 492 write_c0_wired(wired);
493 write_c0_index(wired-1); 493 write_c0_index(wired-1);
494 printk ("Restricting TLB to %d entries\n", ntlb); 494 printk("Restricting TLB to %d entries\n", ntlb);
495 } else 495 } else
496 printk("Ignoring invalid argument ntlb=%d\n", ntlb); 496 printk("Ignoring invalid argument ntlb=%d\n", ntlb);
497 } 497 }
diff --git a/arch/mips/mm/tlb-r8k.c b/arch/mips/mm/tlb-r8k.c
index 266a47d65eed..bd8409d8ff62 100644
--- a/arch/mips/mm/tlb-r8k.c
+++ b/arch/mips/mm/tlb-r8k.c
@@ -56,7 +56,7 @@ void local_flush_tlb_mm(struct mm_struct *mm)
56 int cpu = smp_processor_id(); 56 int cpu = smp_processor_id();
57 57
58 if (cpu_context(cpu, mm) != 0) 58 if (cpu_context(cpu, mm) != 0)
59 drop_mmu_context(mm,cpu); 59 drop_mmu_context(mm, cpu);
60} 60}
61 61
62void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start, 62void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 6c425b052442..01b0961acfb6 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -35,24 +35,24 @@
35#include <asm/smp.h> 35#include <asm/smp.h>
36#include <asm/war.h> 36#include <asm/war.h>
37 37
38static __init int __maybe_unused r45k_bvahwbug(void) 38static inline int r45k_bvahwbug(void)
39{ 39{
40 /* XXX: We should probe for the presence of this bug, but we don't. */ 40 /* XXX: We should probe for the presence of this bug, but we don't. */
41 return 0; 41 return 0;
42} 42}
43 43
44static __init int __maybe_unused r4k_250MHZhwbug(void) 44static inline int r4k_250MHZhwbug(void)
45{ 45{
46 /* XXX: We should probe for the presence of this bug, but we don't. */ 46 /* XXX: We should probe for the presence of this bug, but we don't. */
47 return 0; 47 return 0;
48} 48}
49 49
50static __init int __maybe_unused bcm1250_m3_war(void) 50static inline int __maybe_unused bcm1250_m3_war(void)
51{ 51{
52 return BCM1250_M3_WAR; 52 return BCM1250_M3_WAR;
53} 53}
54 54
55static __init int __maybe_unused r10000_llsc_war(void) 55static inline int __maybe_unused r10000_llsc_war(void)
56{ 56{
57 return R10000_LLSC_WAR; 57 return R10000_LLSC_WAR;
58} 58}
@@ -66,7 +66,7 @@ static __init int __maybe_unused r10000_llsc_war(void)
66 * why; it's not an issue caused by the core RTL. 66 * why; it's not an issue caused by the core RTL.
67 * 67 *
68 */ 68 */
69static __init int __attribute__((unused)) m4kc_tlbp_war(void) 69static int __init m4kc_tlbp_war(void)
70{ 70{
71 return (current_cpu_data.processor_id & 0xffff00) == 71 return (current_cpu_data.processor_id & 0xffff00) ==
72 (PRID_COMP_MIPS | PRID_IMP_4KC); 72 (PRID_COMP_MIPS | PRID_IMP_4KC);
@@ -140,60 +140,60 @@ struct insn {
140 | (e) << RE_SH \ 140 | (e) << RE_SH \
141 | (f) << FUNC_SH) 141 | (f) << FUNC_SH)
142 142
143static __initdata struct insn insn_table[] = { 143static struct insn insn_table[] __initdata = {
144 { insn_addiu, M(addiu_op,0,0,0,0,0), RS | RT | SIMM }, 144 { insn_addiu, M(addiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
145 { insn_addu, M(spec_op,0,0,0,0,addu_op), RS | RT | RD }, 145 { insn_addu, M(spec_op, 0, 0, 0, 0, addu_op), RS | RT | RD },
146 { insn_and, M(spec_op,0,0,0,0,and_op), RS | RT | RD }, 146 { insn_and, M(spec_op, 0, 0, 0, 0, and_op), RS | RT | RD },
147 { insn_andi, M(andi_op,0,0,0,0,0), RS | RT | UIMM }, 147 { insn_andi, M(andi_op, 0, 0, 0, 0, 0), RS | RT | UIMM },
148 { insn_beq, M(beq_op,0,0,0,0,0), RS | RT | BIMM }, 148 { insn_beq, M(beq_op, 0, 0, 0, 0, 0), RS | RT | BIMM },
149 { insn_beql, M(beql_op,0,0,0,0,0), RS | RT | BIMM }, 149 { insn_beql, M(beql_op, 0, 0, 0, 0, 0), RS | RT | BIMM },
150 { insn_bgez, M(bcond_op,0,bgez_op,0,0,0), RS | BIMM }, 150 { insn_bgez, M(bcond_op, 0, bgez_op, 0, 0, 0), RS | BIMM },
151 { insn_bgezl, M(bcond_op,0,bgezl_op,0,0,0), RS | BIMM }, 151 { insn_bgezl, M(bcond_op, 0, bgezl_op, 0, 0, 0), RS | BIMM },
152 { insn_bltz, M(bcond_op,0,bltz_op,0,0,0), RS | BIMM }, 152 { insn_bltz, M(bcond_op, 0, bltz_op, 0, 0, 0), RS | BIMM },
153 { insn_bltzl, M(bcond_op,0,bltzl_op,0,0,0), RS | BIMM }, 153 { insn_bltzl, M(bcond_op, 0, bltzl_op, 0, 0, 0), RS | BIMM },
154 { insn_bne, M(bne_op,0,0,0,0,0), RS | RT | BIMM }, 154 { insn_bne, M(bne_op, 0, 0, 0, 0, 0), RS | RT | BIMM },
155 { insn_daddiu, M(daddiu_op,0,0,0,0,0), RS | RT | SIMM }, 155 { insn_daddiu, M(daddiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
156 { insn_daddu, M(spec_op,0,0,0,0,daddu_op), RS | RT | RD }, 156 { insn_daddu, M(spec_op, 0, 0, 0, 0, daddu_op), RS | RT | RD },
157 { insn_dmfc0, M(cop0_op,dmfc_op,0,0,0,0), RT | RD | SET}, 157 { insn_dmfc0, M(cop0_op, dmfc_op, 0, 0, 0, 0), RT | RD | SET},
158 { insn_dmtc0, M(cop0_op,dmtc_op,0,0,0,0), RT | RD | SET}, 158 { insn_dmtc0, M(cop0_op, dmtc_op, 0, 0, 0, 0), RT | RD | SET},
159 { insn_dsll, M(spec_op,0,0,0,0,dsll_op), RT | RD | RE }, 159 { insn_dsll, M(spec_op, 0, 0, 0, 0, dsll_op), RT | RD | RE },
160 { insn_dsll32, M(spec_op,0,0,0,0,dsll32_op), RT | RD | RE }, 160 { insn_dsll32, M(spec_op, 0, 0, 0, 0, dsll32_op), RT | RD | RE },
161 { insn_dsra, M(spec_op,0,0,0,0,dsra_op), RT | RD | RE }, 161 { insn_dsra, M(spec_op, 0, 0, 0, 0, dsra_op), RT | RD | RE },
162 { insn_dsrl, M(spec_op,0,0,0,0,dsrl_op), RT | RD | RE }, 162 { insn_dsrl, M(spec_op, 0, 0, 0, 0, dsrl_op), RT | RD | RE },
163 { insn_dsrl32, M(spec_op,0,0,0,0,dsrl32_op), RT | RD | RE }, 163 { insn_dsrl32, M(spec_op, 0, 0, 0, 0, dsrl32_op), RT | RD | RE },
164 { insn_dsubu, M(spec_op,0,0,0,0,dsubu_op), RS | RT | RD }, 164 { insn_dsubu, M(spec_op, 0, 0, 0, 0, dsubu_op), RS | RT | RD },
165 { insn_eret, M(cop0_op,cop_op,0,0,0,eret_op), 0 }, 165 { insn_eret, M(cop0_op, cop_op, 0, 0, 0, eret_op), 0 },
166 { insn_j, M(j_op,0,0,0,0,0), JIMM }, 166 { insn_j, M(j_op, 0, 0, 0, 0, 0), JIMM },
167 { insn_jal, M(jal_op,0,0,0,0,0), JIMM }, 167 { insn_jal, M(jal_op, 0, 0, 0, 0, 0), JIMM },
168 { insn_jr, M(spec_op,0,0,0,0,jr_op), RS }, 168 { insn_jr, M(spec_op, 0, 0, 0, 0, jr_op), RS },
169 { insn_ld, M(ld_op,0,0,0,0,0), RS | RT | SIMM }, 169 { insn_ld, M(ld_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
170 { insn_ll, M(ll_op,0,0,0,0,0), RS | RT | SIMM }, 170 { insn_ll, M(ll_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
171 { insn_lld, M(lld_op,0,0,0,0,0), RS | RT | SIMM }, 171 { insn_lld, M(lld_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
172 { insn_lui, M(lui_op,0,0,0,0,0), RT | SIMM }, 172 { insn_lui, M(lui_op, 0, 0, 0, 0, 0), RT | SIMM },
173 { insn_lw, M(lw_op,0,0,0,0,0), RS | RT | SIMM }, 173 { insn_lw, M(lw_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
174 { insn_mfc0, M(cop0_op,mfc_op,0,0,0,0), RT | RD | SET}, 174 { insn_mfc0, M(cop0_op, mfc_op, 0, 0, 0, 0), RT | RD | SET},
175 { insn_mtc0, M(cop0_op,mtc_op,0,0,0,0), RT | RD | SET}, 175 { insn_mtc0, M(cop0_op, mtc_op, 0, 0, 0, 0), RT | RD | SET},
176 { insn_ori, M(ori_op,0,0,0,0,0), RS | RT | UIMM }, 176 { insn_ori, M(ori_op, 0, 0, 0, 0, 0), RS | RT | UIMM },
177 { insn_rfe, M(cop0_op,cop_op,0,0,0,rfe_op), 0 }, 177 { insn_rfe, M(cop0_op, cop_op, 0, 0, 0, rfe_op), 0 },
178 { insn_sc, M(sc_op,0,0,0,0,0), RS | RT | SIMM }, 178 { insn_sc, M(sc_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
179 { insn_scd, M(scd_op,0,0,0,0,0), RS | RT | SIMM }, 179 { insn_scd, M(scd_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
180 { insn_sd, M(sd_op,0,0,0,0,0), RS | RT | SIMM }, 180 { insn_sd, M(sd_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
181 { insn_sll, M(spec_op,0,0,0,0,sll_op), RT | RD | RE }, 181 { insn_sll, M(spec_op, 0, 0, 0, 0, sll_op), RT | RD | RE },
182 { insn_sra, M(spec_op,0,0,0,0,sra_op), RT | RD | RE }, 182 { insn_sra, M(spec_op, 0, 0, 0, 0, sra_op), RT | RD | RE },
183 { insn_srl, M(spec_op,0,0,0,0,srl_op), RT | RD | RE }, 183 { insn_srl, M(spec_op, 0, 0, 0, 0, srl_op), RT | RD | RE },
184 { insn_subu, M(spec_op,0,0,0,0,subu_op), RS | RT | RD }, 184 { insn_subu, M(spec_op, 0, 0, 0, 0, subu_op), RS | RT | RD },
185 { insn_sw, M(sw_op,0,0,0,0,0), RS | RT | SIMM }, 185 { insn_sw, M(sw_op, 0, 0, 0, 0, 0), RS | RT | SIMM },
186 { insn_tlbp, M(cop0_op,cop_op,0,0,0,tlbp_op), 0 }, 186 { insn_tlbp, M(cop0_op, cop_op, 0, 0, 0, tlbp_op), 0 },
187 { insn_tlbwi, M(cop0_op,cop_op,0,0,0,tlbwi_op), 0 }, 187 { insn_tlbwi, M(cop0_op, cop_op, 0, 0, 0, tlbwi_op), 0 },
188 { insn_tlbwr, M(cop0_op,cop_op,0,0,0,tlbwr_op), 0 }, 188 { insn_tlbwr, M(cop0_op, cop_op, 0, 0, 0, tlbwr_op), 0 },
189 { insn_xor, M(spec_op,0,0,0,0,xor_op), RS | RT | RD }, 189 { insn_xor, M(spec_op, 0, 0, 0, 0, xor_op), RS | RT | RD },
190 { insn_xori, M(xori_op,0,0,0,0,0), RS | RT | UIMM }, 190 { insn_xori, M(xori_op, 0, 0, 0, 0, 0), RS | RT | UIMM },
191 { insn_invalid, 0, 0 } 191 { insn_invalid, 0, 0 }
192}; 192};
193 193
194#undef M 194#undef M
195 195
196static __init u32 build_rs(u32 arg) 196static u32 __init build_rs(u32 arg)
197{ 197{
198 if (arg & ~RS_MASK) 198 if (arg & ~RS_MASK)
199 printk(KERN_WARNING "TLB synthesizer field overflow\n"); 199 printk(KERN_WARNING "TLB synthesizer field overflow\n");
@@ -201,7 +201,7 @@ static __init u32 build_rs(u32 arg)
201 return (arg & RS_MASK) << RS_SH; 201 return (arg & RS_MASK) << RS_SH;
202} 202}
203 203
204static __init u32 build_rt(u32 arg) 204static u32 __init build_rt(u32 arg)
205{ 205{
206 if (arg & ~RT_MASK) 206 if (arg & ~RT_MASK)
207 printk(KERN_WARNING "TLB synthesizer field overflow\n"); 207 printk(KERN_WARNING "TLB synthesizer field overflow\n");
@@ -209,7 +209,7 @@ static __init u32 build_rt(u32 arg)
209 return (arg & RT_MASK) << RT_SH; 209 return (arg & RT_MASK) << RT_SH;
210} 210}
211 211
212static __init u32 build_rd(u32 arg) 212static u32 __init build_rd(u32 arg)
213{ 213{
214 if (arg & ~RD_MASK) 214 if (arg & ~RD_MASK)
215 printk(KERN_WARNING "TLB synthesizer field overflow\n"); 215 printk(KERN_WARNING "TLB synthesizer field overflow\n");
@@ -217,7 +217,7 @@ static __init u32 build_rd(u32 arg)
217 return (arg & RD_MASK) << RD_SH; 217 return (arg & RD_MASK) << RD_SH;
218} 218}
219 219
220static __init u32 build_re(u32 arg) 220static u32 __init build_re(u32 arg)
221{ 221{
222 if (arg & ~RE_MASK) 222 if (arg & ~RE_MASK)
223 printk(KERN_WARNING "TLB synthesizer field overflow\n"); 223 printk(KERN_WARNING "TLB synthesizer field overflow\n");
@@ -225,7 +225,7 @@ static __init u32 build_re(u32 arg)
225 return (arg & RE_MASK) << RE_SH; 225 return (arg & RE_MASK) << RE_SH;
226} 226}
227 227
228static __init u32 build_simm(s32 arg) 228static u32 __init build_simm(s32 arg)
229{ 229{
230 if (arg > 0x7fff || arg < -0x8000) 230 if (arg > 0x7fff || arg < -0x8000)
231 printk(KERN_WARNING "TLB synthesizer field overflow\n"); 231 printk(KERN_WARNING "TLB synthesizer field overflow\n");
@@ -233,7 +233,7 @@ static __init u32 build_simm(s32 arg)
233 return arg & 0xffff; 233 return arg & 0xffff;
234} 234}
235 235
236static __init u32 build_uimm(u32 arg) 236static u32 __init build_uimm(u32 arg)
237{ 237{
238 if (arg & ~IMM_MASK) 238 if (arg & ~IMM_MASK)
239 printk(KERN_WARNING "TLB synthesizer field overflow\n"); 239 printk(KERN_WARNING "TLB synthesizer field overflow\n");
@@ -241,7 +241,7 @@ static __init u32 build_uimm(u32 arg)
241 return arg & IMM_MASK; 241 return arg & IMM_MASK;
242} 242}
243 243
244static __init u32 build_bimm(s32 arg) 244static u32 __init build_bimm(s32 arg)
245{ 245{
246 if (arg > 0x1ffff || arg < -0x20000) 246 if (arg > 0x1ffff || arg < -0x20000)
247 printk(KERN_WARNING "TLB synthesizer field overflow\n"); 247 printk(KERN_WARNING "TLB synthesizer field overflow\n");
@@ -252,7 +252,7 @@ static __init u32 build_bimm(s32 arg)
252 return ((arg < 0) ? (1 << 15) : 0) | ((arg >> 2) & 0x7fff); 252 return ((arg < 0) ? (1 << 15) : 0) | ((arg >> 2) & 0x7fff);
253} 253}
254 254
255static __init u32 build_jimm(u32 arg) 255static u32 __init build_jimm(u32 arg)
256{ 256{
257 if (arg & ~((JIMM_MASK) << 2)) 257 if (arg & ~((JIMM_MASK) << 2))
258 printk(KERN_WARNING "TLB synthesizer field overflow\n"); 258 printk(KERN_WARNING "TLB synthesizer field overflow\n");
@@ -260,7 +260,7 @@ static __init u32 build_jimm(u32 arg)
260 return (arg >> 2) & JIMM_MASK; 260 return (arg >> 2) & JIMM_MASK;
261} 261}
262 262
263static __init u32 build_func(u32 arg) 263static u32 __init build_func(u32 arg)
264{ 264{
265 if (arg & ~FUNC_MASK) 265 if (arg & ~FUNC_MASK)
266 printk(KERN_WARNING "TLB synthesizer field overflow\n"); 266 printk(KERN_WARNING "TLB synthesizer field overflow\n");
@@ -268,7 +268,7 @@ static __init u32 build_func(u32 arg)
268 return arg & FUNC_MASK; 268 return arg & FUNC_MASK;
269} 269}
270 270
271static __init u32 build_set(u32 arg) 271static u32 __init build_set(u32 arg)
272{ 272{
273 if (arg & ~SET_MASK) 273 if (arg & ~SET_MASK)
274 printk(KERN_WARNING "TLB synthesizer field overflow\n"); 274 printk(KERN_WARNING "TLB synthesizer field overflow\n");
@@ -315,69 +315,69 @@ static void __init build_insn(u32 **buf, enum opcode opc, ...)
315} 315}
316 316
317#define I_u1u2u3(op) \ 317#define I_u1u2u3(op) \
318 static inline void __init i##op(u32 **buf, unsigned int a, \ 318 static inline void i##op(u32 **buf, unsigned int a, \
319 unsigned int b, unsigned int c) \ 319 unsigned int b, unsigned int c) \
320 { \ 320 { \
321 build_insn(buf, insn##op, a, b, c); \ 321 build_insn(buf, insn##op, a, b, c); \
322 } 322 }
323 323
324#define I_u2u1u3(op) \ 324#define I_u2u1u3(op) \
325 static inline void __init i##op(u32 **buf, unsigned int a, \ 325 static inline void i##op(u32 **buf, unsigned int a, \
326 unsigned int b, unsigned int c) \ 326 unsigned int b, unsigned int c) \
327 { \ 327 { \
328 build_insn(buf, insn##op, b, a, c); \ 328 build_insn(buf, insn##op, b, a, c); \
329 } 329 }
330 330
331#define I_u3u1u2(op) \ 331#define I_u3u1u2(op) \
332 static inline void __init i##op(u32 **buf, unsigned int a, \ 332 static inline void i##op(u32 **buf, unsigned int a, \
333 unsigned int b, unsigned int c) \ 333 unsigned int b, unsigned int c) \
334 { \ 334 { \
335 build_insn(buf, insn##op, b, c, a); \ 335 build_insn(buf, insn##op, b, c, a); \
336 } 336 }
337 337
338#define I_u1u2s3(op) \ 338#define I_u1u2s3(op) \
339 static inline void __init i##op(u32 **buf, unsigned int a, \ 339 static inline void i##op(u32 **buf, unsigned int a, \
340 unsigned int b, signed int c) \ 340 unsigned int b, signed int c) \
341 { \ 341 { \
342 build_insn(buf, insn##op, a, b, c); \ 342 build_insn(buf, insn##op, a, b, c); \
343 } 343 }
344 344
345#define I_u2s3u1(op) \ 345#define I_u2s3u1(op) \
346 static inline void __init i##op(u32 **buf, unsigned int a, \ 346 static inline void i##op(u32 **buf, unsigned int a, \
347 signed int b, unsigned int c) \ 347 signed int b, unsigned int c) \
348 { \ 348 { \
349 build_insn(buf, insn##op, c, a, b); \ 349 build_insn(buf, insn##op, c, a, b); \
350 } 350 }
351 351
352#define I_u2u1s3(op) \ 352#define I_u2u1s3(op) \
353 static inline void __init i##op(u32 **buf, unsigned int a, \ 353 static inline void i##op(u32 **buf, unsigned int a, \
354 unsigned int b, signed int c) \ 354 unsigned int b, signed int c) \
355 { \ 355 { \
356 build_insn(buf, insn##op, b, a, c); \ 356 build_insn(buf, insn##op, b, a, c); \
357 } 357 }
358 358
359#define I_u1u2(op) \ 359#define I_u1u2(op) \
360 static inline void __init i##op(u32 **buf, unsigned int a, \ 360 static inline void i##op(u32 **buf, unsigned int a, \
361 unsigned int b) \ 361 unsigned int b) \
362 { \ 362 { \
363 build_insn(buf, insn##op, a, b); \ 363 build_insn(buf, insn##op, a, b); \
364 } 364 }
365 365
366#define I_u1s2(op) \ 366#define I_u1s2(op) \
367 static inline void __init i##op(u32 **buf, unsigned int a, \ 367 static inline void i##op(u32 **buf, unsigned int a, \
368 signed int b) \ 368 signed int b) \
369 { \ 369 { \
370 build_insn(buf, insn##op, a, b); \ 370 build_insn(buf, insn##op, a, b); \
371 } 371 }
372 372
373#define I_u1(op) \ 373#define I_u1(op) \
374 static inline void __init i##op(u32 **buf, unsigned int a) \ 374 static inline void i##op(u32 **buf, unsigned int a) \
375 { \ 375 { \
376 build_insn(buf, insn##op, a); \ 376 build_insn(buf, insn##op, a); \
377 } 377 }
378 378
379#define I_0(op) \ 379#define I_0(op) \
380 static inline void __init i##op(u32 **buf) \ 380 static inline void i##op(u32 **buf) \
381 { \ 381 { \
382 build_insn(buf, insn##op); \ 382 build_insn(buf, insn##op); \
383 } 383 }
@@ -457,7 +457,7 @@ struct label {
457 enum label_id lab; 457 enum label_id lab;
458}; 458};
459 459
460static __init void build_label(struct label **lab, u32 *addr, 460static void __init build_label(struct label **lab, u32 *addr,
461 enum label_id l) 461 enum label_id l)
462{ 462{
463 (*lab)->addr = addr; 463 (*lab)->addr = addr;
@@ -526,34 +526,34 @@ L_LA(_r3000_write_probe_fail)
526#define i_ehb(buf) i_sll(buf, 0, 0, 3) 526#define i_ehb(buf) i_sll(buf, 0, 0, 3)
527 527
528#ifdef CONFIG_64BIT 528#ifdef CONFIG_64BIT
529static __init int __maybe_unused in_compat_space_p(long addr) 529static int __init __maybe_unused in_compat_space_p(long addr)
530{ 530{
531 /* Is this address in 32bit compat space? */ 531 /* Is this address in 32bit compat space? */
532 return (((addr) & 0xffffffff00000000L) == 0xffffffff00000000L); 532 return (((addr) & 0xffffffff00000000L) == 0xffffffff00000000L);
533} 533}
534 534
535static __init int __maybe_unused rel_highest(long val) 535static int __init __maybe_unused rel_highest(long val)
536{ 536{
537 return ((((val + 0x800080008000L) >> 48) & 0xffff) ^ 0x8000) - 0x8000; 537 return ((((val + 0x800080008000L) >> 48) & 0xffff) ^ 0x8000) - 0x8000;
538} 538}
539 539
540static __init int __maybe_unused rel_higher(long val) 540static int __init __maybe_unused rel_higher(long val)
541{ 541{
542 return ((((val + 0x80008000L) >> 32) & 0xffff) ^ 0x8000) - 0x8000; 542 return ((((val + 0x80008000L) >> 32) & 0xffff) ^ 0x8000) - 0x8000;
543} 543}
544#endif 544#endif
545 545
546static __init int rel_hi(long val) 546static int __init rel_hi(long val)
547{ 547{
548 return ((((val + 0x8000L) >> 16) & 0xffff) ^ 0x8000) - 0x8000; 548 return ((((val + 0x8000L) >> 16) & 0xffff) ^ 0x8000) - 0x8000;
549} 549}
550 550
551static __init int rel_lo(long val) 551static int __init rel_lo(long val)
552{ 552{
553 return ((val & 0xffff) ^ 0x8000) - 0x8000; 553 return ((val & 0xffff) ^ 0x8000) - 0x8000;
554} 554}
555 555
556static __init void i_LA_mostly(u32 **buf, unsigned int rs, long addr) 556static void __init i_LA_mostly(u32 **buf, unsigned int rs, long addr)
557{ 557{
558#ifdef CONFIG_64BIT 558#ifdef CONFIG_64BIT
559 if (!in_compat_space_p(addr)) { 559 if (!in_compat_space_p(addr)) {
@@ -571,7 +571,7 @@ static __init void i_LA_mostly(u32 **buf, unsigned int rs, long addr)
571 i_lui(buf, rs, rel_hi(addr)); 571 i_lui(buf, rs, rel_hi(addr));
572} 572}
573 573
574static __init void __maybe_unused i_LA(u32 **buf, unsigned int rs, 574static void __init __maybe_unused i_LA(u32 **buf, unsigned int rs,
575 long addr) 575 long addr)
576{ 576{
577 i_LA_mostly(buf, rs, addr); 577 i_LA_mostly(buf, rs, addr);
@@ -589,7 +589,7 @@ struct reloc {
589 enum label_id lab; 589 enum label_id lab;
590}; 590};
591 591
592static __init void r_mips_pc16(struct reloc **rel, u32 *addr, 592static void __init r_mips_pc16(struct reloc **rel, u32 *addr,
593 enum label_id l) 593 enum label_id l)
594{ 594{
595 (*rel)->addr = addr; 595 (*rel)->addr = addr;
@@ -614,7 +614,7 @@ static inline void __resolve_relocs(struct reloc *rel, struct label *lab)
614 } 614 }
615} 615}
616 616
617static __init void resolve_relocs(struct reloc *rel, struct label *lab) 617static void __init resolve_relocs(struct reloc *rel, struct label *lab)
618{ 618{
619 struct label *l; 619 struct label *l;
620 620
@@ -624,7 +624,7 @@ static __init void resolve_relocs(struct reloc *rel, struct label *lab)
624 __resolve_relocs(rel, l); 624 __resolve_relocs(rel, l);
625} 625}
626 626
627static __init void move_relocs(struct reloc *rel, u32 *first, u32 *end, 627static void __init move_relocs(struct reloc *rel, u32 *first, u32 *end,
628 long off) 628 long off)
629{ 629{
630 for (; rel->lab != label_invalid; rel++) 630 for (; rel->lab != label_invalid; rel++)
@@ -632,7 +632,7 @@ static __init void move_relocs(struct reloc *rel, u32 *first, u32 *end,
632 rel->addr += off; 632 rel->addr += off;
633} 633}
634 634
635static __init void move_labels(struct label *lab, u32 *first, u32 *end, 635static void __init move_labels(struct label *lab, u32 *first, u32 *end,
636 long off) 636 long off)
637{ 637{
638 for (; lab->lab != label_invalid; lab++) 638 for (; lab->lab != label_invalid; lab++)
@@ -640,7 +640,7 @@ static __init void move_labels(struct label *lab, u32 *first, u32 *end,
640 lab->addr += off; 640 lab->addr += off;
641} 641}
642 642
643static __init void copy_handler(struct reloc *rel, struct label *lab, 643static void __init copy_handler(struct reloc *rel, struct label *lab,
644 u32 *first, u32 *end, u32 *target) 644 u32 *first, u32 *end, u32 *target)
645{ 645{
646 long off = (long)(target - first); 646 long off = (long)(target - first);
@@ -651,7 +651,7 @@ static __init void copy_handler(struct reloc *rel, struct label *lab,
651 move_labels(lab, first, end, off); 651 move_labels(lab, first, end, off);
652} 652}
653 653
654static __init int __maybe_unused insn_has_bdelay(struct reloc *rel, 654static int __init __maybe_unused insn_has_bdelay(struct reloc *rel,
655 u32 *addr) 655 u32 *addr)
656{ 656{
657 for (; rel->lab != label_invalid; rel++) { 657 for (; rel->lab != label_invalid; rel++) {
@@ -743,11 +743,11 @@ il_bgez(u32 **p, struct reloc **r, unsigned int reg, enum label_id l)
743 * We deliberately chose a buffer size of 128, so we won't scribble 743 * We deliberately chose a buffer size of 128, so we won't scribble
744 * over anything important on overflow before we panic. 744 * over anything important on overflow before we panic.
745 */ 745 */
746static __initdata u32 tlb_handler[128]; 746static u32 tlb_handler[128] __initdata;
747 747
748/* simply assume worst case size for labels and relocs */ 748/* simply assume worst case size for labels and relocs */
749static __initdata struct label labels[128]; 749static struct label labels[128] __initdata;
750static __initdata struct reloc relocs[128]; 750static struct reloc relocs[128] __initdata;
751 751
752/* 752/*
753 * The R3000 TLB handler is simple. 753 * The R3000 TLB handler is simple.
@@ -801,7 +801,7 @@ static void __init build_r3000_tlb_refill_handler(void)
801 * other one.To keep things simple, we first assume linear space, 801 * other one.To keep things simple, we first assume linear space,
802 * then we relocate it to the final handler layout as needed. 802 * then we relocate it to the final handler layout as needed.
803 */ 803 */
804static __initdata u32 final_handler[64]; 804static u32 final_handler[64] __initdata;
805 805
806/* 806/*
807 * Hazards 807 * Hazards
@@ -825,9 +825,9 @@ static __initdata u32 final_handler[64];
825 * 825 *
826 * As if we MIPS hackers wouldn't know how to nop pipelines happy ... 826 * As if we MIPS hackers wouldn't know how to nop pipelines happy ...
827 */ 827 */
828static __init void __maybe_unused build_tlb_probe_entry(u32 **p) 828static void __init __maybe_unused build_tlb_probe_entry(u32 **p)
829{ 829{
830 switch (current_cpu_data.cputype) { 830 switch (current_cpu_type()) {
831 /* Found by experiment: R4600 v2.0 needs this, too. */ 831 /* Found by experiment: R4600 v2.0 needs this, too. */
832 case CPU_R4600: 832 case CPU_R4600:
833 case CPU_R5000: 833 case CPU_R5000:
@@ -849,7 +849,7 @@ static __init void __maybe_unused build_tlb_probe_entry(u32 **p)
849 */ 849 */
850enum tlb_write_entry { tlb_random, tlb_indexed }; 850enum tlb_write_entry { tlb_random, tlb_indexed };
851 851
852static __init void build_tlb_write_entry(u32 **p, struct label **l, 852static void __init build_tlb_write_entry(u32 **p, struct label **l,
853 struct reloc **r, 853 struct reloc **r,
854 enum tlb_write_entry wmode) 854 enum tlb_write_entry wmode)
855{ 855{
@@ -860,7 +860,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
860 case tlb_indexed: tlbw = i_tlbwi; break; 860 case tlb_indexed: tlbw = i_tlbwi; break;
861 } 861 }
862 862
863 switch (current_cpu_data.cputype) { 863 switch (current_cpu_type()) {
864 case CPU_R4000PC: 864 case CPU_R4000PC:
865 case CPU_R4000SC: 865 case CPU_R4000SC:
866 case CPU_R4000MC: 866 case CPU_R4000MC:
@@ -908,6 +908,8 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
908 case CPU_4KSC: 908 case CPU_4KSC:
909 case CPU_20KC: 909 case CPU_20KC:
910 case CPU_25KF: 910 case CPU_25KF:
911 case CPU_BCM3302:
912 case CPU_BCM4710:
911 case CPU_LOONGSON2: 913 case CPU_LOONGSON2:
912 if (m4kc_tlbp_war()) 914 if (m4kc_tlbp_war())
913 i_nop(p); 915 i_nop(p);
@@ -991,7 +993,7 @@ static __init void build_tlb_write_entry(u32 **p, struct label **l,
991 * TMP and PTR are scratch. 993 * TMP and PTR are scratch.
992 * TMP will be clobbered, PTR will hold the pmd entry. 994 * TMP will be clobbered, PTR will hold the pmd entry.
993 */ 995 */
994static __init void 996static void __init
995build_get_pmde64(u32 **p, struct label **l, struct reloc **r, 997build_get_pmde64(u32 **p, struct label **l, struct reloc **r,
996 unsigned int tmp, unsigned int ptr) 998 unsigned int tmp, unsigned int ptr)
997{ 999{
@@ -1052,7 +1054,7 @@ build_get_pmde64(u32 **p, struct label **l, struct reloc **r,
1052 * BVADDR is the faulting address, PTR is scratch. 1054 * BVADDR is the faulting address, PTR is scratch.
1053 * PTR will hold the pgd for vmalloc. 1055 * PTR will hold the pgd for vmalloc.
1054 */ 1056 */
1055static __init void 1057static void __init
1056build_get_pgd_vmalloc64(u32 **p, struct label **l, struct reloc **r, 1058build_get_pgd_vmalloc64(u32 **p, struct label **l, struct reloc **r,
1057 unsigned int bvaddr, unsigned int ptr) 1059 unsigned int bvaddr, unsigned int ptr)
1058{ 1060{
@@ -1116,7 +1118,7 @@ build_get_pgd_vmalloc64(u32 **p, struct label **l, struct reloc **r,
1116 * TMP and PTR are scratch. 1118 * TMP and PTR are scratch.
1117 * TMP will be clobbered, PTR will hold the pgd entry. 1119 * TMP will be clobbered, PTR will hold the pgd entry.
1118 */ 1120 */
1119static __init void __maybe_unused 1121static void __init __maybe_unused
1120build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr) 1122build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
1121{ 1123{
1122 long pgdc = (long)pgd_current; 1124 long pgdc = (long)pgd_current;
@@ -1151,12 +1153,12 @@ build_get_pgde32(u32 **p, unsigned int tmp, unsigned int ptr)
1151 1153
1152#endif /* !CONFIG_64BIT */ 1154#endif /* !CONFIG_64BIT */
1153 1155
1154static __init void build_adjust_context(u32 **p, unsigned int ctx) 1156static void __init build_adjust_context(u32 **p, unsigned int ctx)
1155{ 1157{
1156 unsigned int shift = 4 - (PTE_T_LOG2 + 1) + PAGE_SHIFT - 12; 1158 unsigned int shift = 4 - (PTE_T_LOG2 + 1) + PAGE_SHIFT - 12;
1157 unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1); 1159 unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1);
1158 1160
1159 switch (current_cpu_data.cputype) { 1161 switch (current_cpu_type()) {
1160 case CPU_VR41XX: 1162 case CPU_VR41XX:
1161 case CPU_VR4111: 1163 case CPU_VR4111:
1162 case CPU_VR4121: 1164 case CPU_VR4121:
@@ -1177,7 +1179,7 @@ static __init void build_adjust_context(u32 **p, unsigned int ctx)
1177 i_andi(p, ctx, ctx, mask); 1179 i_andi(p, ctx, ctx, mask);
1178} 1180}
1179 1181
1180static __init void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr) 1182static void __init build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr)
1181{ 1183{
1182 /* 1184 /*
1183 * Bug workaround for the Nevada. It seems as if under certain 1185 * Bug workaround for the Nevada. It seems as if under certain
@@ -1186,7 +1188,7 @@ static __init void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr)
1186 * in a different cacheline or a load instruction, probably any 1188 * in a different cacheline or a load instruction, probably any
1187 * memory reference, is between them. 1189 * memory reference, is between them.
1188 */ 1190 */
1189 switch (current_cpu_data.cputype) { 1191 switch (current_cpu_type()) {
1190 case CPU_NEVADA: 1192 case CPU_NEVADA:
1191 i_LW(p, ptr, 0, ptr); 1193 i_LW(p, ptr, 0, ptr);
1192 GET_CONTEXT(p, tmp); /* get context reg */ 1194 GET_CONTEXT(p, tmp); /* get context reg */
@@ -1202,7 +1204,7 @@ static __init void build_get_ptep(u32 **p, unsigned int tmp, unsigned int ptr)
1202 i_ADDU(p, ptr, ptr, tmp); /* add in offset */ 1204 i_ADDU(p, ptr, ptr, tmp); /* add in offset */
1203} 1205}
1204 1206
1205static __init void build_update_entries(u32 **p, unsigned int tmp, 1207static void __init build_update_entries(u32 **p, unsigned int tmp,
1206 unsigned int ptep) 1208 unsigned int ptep)
1207{ 1209{
1208 /* 1210 /*
@@ -1870,7 +1872,7 @@ void __init build_tlb_refill_handler(void)
1870 */ 1872 */
1871 static int run_once = 0; 1873 static int run_once = 0;
1872 1874
1873 switch (current_cpu_data.cputype) { 1875 switch (current_cpu_type()) {
1874 case CPU_R2000: 1876 case CPU_R2000:
1875 case CPU_R3000: 1877 case CPU_R3000:
1876 case CPU_R3000A: 1878 case CPU_R3000A:
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index 4e0a90b3916b..aa52aa146cea 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -74,7 +74,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
74 struct op_mips_model *lmodel = NULL; 74 struct op_mips_model *lmodel = NULL;
75 int res; 75 int res;
76 76
77 switch (current_cpu_data.cputype) { 77 switch (current_cpu_type()) {
78 case CPU_5KC: 78 case CPU_5KC:
79 case CPU_20KC: 79 case CPU_20KC:
80 case CPU_24K: 80 case CPU_24K:
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index 1ea5c9c1010b..423bc2c473df 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -118,7 +118,7 @@ static void mipsxx_reg_setup(struct op_counter_config *ctr)
118 118
119/* Program all of the registers in preparation for enabling profiling. */ 119/* Program all of the registers in preparation for enabling profiling. */
120 120
121static void mipsxx_cpu_setup (void *args) 121static void mipsxx_cpu_setup(void *args)
122{ 122{
123 unsigned int counters = op_model_mipsxx_ops.num_counters; 123 unsigned int counters = op_model_mipsxx_ops.num_counters;
124 124
@@ -222,7 +222,7 @@ static inline int n_counters(void)
222{ 222{
223 int counters; 223 int counters;
224 224
225 switch (current_cpu_data.cputype) { 225 switch (current_cpu_type()) {
226 case CPU_R10000: 226 case CPU_R10000:
227 counters = 2; 227 counters = 2;
228 break; 228 break;
@@ -274,7 +274,7 @@ static int __init mipsxx_init(void)
274#endif 274#endif
275 275
276 op_model_mipsxx_ops.num_counters = counters; 276 op_model_mipsxx_ops.num_counters = counters;
277 switch (current_cpu_data.cputype) { 277 switch (current_cpu_type()) {
278 case CPU_20KC: 278 case CPU_20KC:
279 op_model_mipsxx_ops.cpu_type = "mips/20K"; 279 op_model_mipsxx_ops.cpu_type = "mips/20K";
280 break; 280 break;
diff --git a/arch/mips/oprofile/op_model_rm9000.c b/arch/mips/oprofile/op_model_rm9000.c
index d29040a56aea..a45d3202894f 100644
--- a/arch/mips/oprofile/op_model_rm9000.c
+++ b/arch/mips/oprofile/op_model_rm9000.c
@@ -60,7 +60,7 @@ static void rm9000_reg_setup(struct op_counter_config *ctr)
60 60
61/* Program all of the registers in preparation for enabling profiling. */ 61/* Program all of the registers in preparation for enabling profiling. */
62 62
63static void rm9000_cpu_setup (void *args) 63static void rm9000_cpu_setup(void *args)
64{ 64{
65 uint64_t perfcount; 65 uint64_t perfcount;
66 66
diff --git a/arch/mips/pci/Makefile b/arch/mips/pci/Makefile
index 4ee6800e67e6..ed0c07622baa 100644
--- a/arch/mips/pci/Makefile
+++ b/arch/mips/pci/Makefile
@@ -10,6 +10,7 @@ obj-y += pci.o
10obj-$(CONFIG_MIPS_BONITO64) += ops-bonito64.o 10obj-$(CONFIG_MIPS_BONITO64) += ops-bonito64.o
11obj-$(CONFIG_PCI_GT64XXX_PCI0) += ops-gt64xxx_pci0.o 11obj-$(CONFIG_PCI_GT64XXX_PCI0) += ops-gt64xxx_pci0.o
12obj-$(CONFIG_MIPS_MSC) += ops-msc.o 12obj-$(CONFIG_MIPS_MSC) += ops-msc.o
13obj-$(CONFIG_MIPS_NILE4) += ops-nile4.o
13obj-$(CONFIG_MIPS_TX3927) += ops-tx3927.o 14obj-$(CONFIG_MIPS_TX3927) += ops-tx3927.o
14obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o 15obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o
15obj-$(CONFIG_NEC_CMBVR4133) += fixup-vr4133.o 16obj-$(CONFIG_NEC_CMBVR4133) += fixup-vr4133.o
@@ -19,6 +20,7 @@ obj-$(CONFIG_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o
19# These are still pretty much in the old state, watch, go blind. 20# These are still pretty much in the old state, watch, go blind.
20# 21#
21obj-$(CONFIG_BASLER_EXCITE) += ops-titan.o pci-excite.o fixup-excite.o 22obj-$(CONFIG_BASLER_EXCITE) += ops-titan.o pci-excite.o fixup-excite.o
23obj-$(CONFIG_LASAT) += pci-lasat.o
22obj-$(CONFIG_MIPS_ATLAS) += fixup-atlas.o 24obj-$(CONFIG_MIPS_ATLAS) += fixup-atlas.o
23obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o 25obj-$(CONFIG_MIPS_COBALT) += fixup-cobalt.o
24obj-$(CONFIG_SOC_AU1500) += fixup-au1000.o ops-au1000.o 26obj-$(CONFIG_SOC_AU1500) += fixup-au1000.o ops-au1000.o
diff --git a/arch/mips/pci/fixup-atlas.c b/arch/mips/pci/fixup-atlas.c
index 45224fd2c7ba..506e883a8c71 100644
--- a/arch/mips/pci/fixup-atlas.c
+++ b/arch/mips/pci/fixup-atlas.c
@@ -77,12 +77,12 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
77 * code, but it is better than nothing... 77 * code, but it is better than nothing...
78 */ 78 */
79 79
80static void atlas_saa9730_base_fixup (struct pci_dev *pdev) 80static void atlas_saa9730_base_fixup(struct pci_dev *pdev)
81{ 81{
82 extern void *saa9730_base; 82 extern void *saa9730_base;
83 if (pdev->bus == 0 && PCI_SLOT(pdev->devfn) == 19) 83 if (pdev->bus == 0 && PCI_SLOT(pdev->devfn) == 19)
84 (void) pci_read_config_dword (pdev, 0x14, (u32 *)&saa9730_base); 84 (void) pci_read_config_dword(pdev, 0x14, (u32 *)&saa9730_base);
85 printk ("saa9730_base = %x\n", saa9730_base); 85 printk("saa9730_base = %x\n", saa9730_base);
86} 86}
87 87
88DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_PHILIPS, PCI_DEVICE_ID_PHILIPS_SAA9730, 88DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_PHILIPS, PCI_DEVICE_ID_PHILIPS_SAA9730,
diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c
index 76b4f0ffb1e5..f7df1142912b 100644
--- a/arch/mips/pci/fixup-cobalt.c
+++ b/arch/mips/pci/fixup-cobalt.c
@@ -18,6 +18,24 @@
18#include <asm/gt64120.h> 18#include <asm/gt64120.h>
19 19
20#include <cobalt.h> 20#include <cobalt.h>
21#include <irq.h>
22
23/*
24 * PCI slot numbers
25 */
26#define COBALT_PCICONF_CPU 0x06
27#define COBALT_PCICONF_ETH0 0x07
28#define COBALT_PCICONF_RAQSCSI 0x08
29#define COBALT_PCICONF_VIA 0x09
30#define COBALT_PCICONF_PCISLOT 0x0A
31#define COBALT_PCICONF_ETH1 0x0C
32
33/*
34 * The Cobalt board ID information. The boards have an ID number wired
35 * into the VIA that is available in the high nibble of register 94.
36 */
37#define VIA_COBALT_BRD_ID_REG 0x94
38#define VIA_COBALT_BRD_REG_to_ID(reg) ((unsigned char)(reg) >> 4)
21 39
22static void qube_raq_galileo_early_fixup(struct pci_dev *dev) 40static void qube_raq_galileo_early_fixup(struct pci_dev *dev)
23{ 41{
@@ -132,29 +150,29 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0,
132 150
133static char irq_tab_qube1[] __initdata = { 151static char irq_tab_qube1[] __initdata = {
134 [COBALT_PCICONF_CPU] = 0, 152 [COBALT_PCICONF_CPU] = 0,
135 [COBALT_PCICONF_ETH0] = COBALT_QUBE1_ETH0_IRQ, 153 [COBALT_PCICONF_ETH0] = QUBE1_ETH0_IRQ,
136 [COBALT_PCICONF_RAQSCSI] = COBALT_SCSI_IRQ, 154 [COBALT_PCICONF_RAQSCSI] = SCSI_IRQ,
137 [COBALT_PCICONF_VIA] = 0, 155 [COBALT_PCICONF_VIA] = 0,
138 [COBALT_PCICONF_PCISLOT] = COBALT_QUBE_SLOT_IRQ, 156 [COBALT_PCICONF_PCISLOT] = PCISLOT_IRQ,
139 [COBALT_PCICONF_ETH1] = 0 157 [COBALT_PCICONF_ETH1] = 0
140}; 158};
141 159
142static char irq_tab_cobalt[] __initdata = { 160static char irq_tab_cobalt[] __initdata = {
143 [COBALT_PCICONF_CPU] = 0, 161 [COBALT_PCICONF_CPU] = 0,
144 [COBALT_PCICONF_ETH0] = COBALT_ETH0_IRQ, 162 [COBALT_PCICONF_ETH0] = ETH0_IRQ,
145 [COBALT_PCICONF_RAQSCSI] = COBALT_SCSI_IRQ, 163 [COBALT_PCICONF_RAQSCSI] = SCSI_IRQ,
146 [COBALT_PCICONF_VIA] = 0, 164 [COBALT_PCICONF_VIA] = 0,
147 [COBALT_PCICONF_PCISLOT] = COBALT_QUBE_SLOT_IRQ, 165 [COBALT_PCICONF_PCISLOT] = PCISLOT_IRQ,
148 [COBALT_PCICONF_ETH1] = COBALT_ETH1_IRQ 166 [COBALT_PCICONF_ETH1] = ETH1_IRQ
149}; 167};
150 168
151static char irq_tab_raq2[] __initdata = { 169static char irq_tab_raq2[] __initdata = {
152 [COBALT_PCICONF_CPU] = 0, 170 [COBALT_PCICONF_CPU] = 0,
153 [COBALT_PCICONF_ETH0] = COBALT_ETH0_IRQ, 171 [COBALT_PCICONF_ETH0] = ETH0_IRQ,
154 [COBALT_PCICONF_RAQSCSI] = COBALT_RAQ_SCSI_IRQ, 172 [COBALT_PCICONF_RAQSCSI] = RAQ2_SCSI_IRQ,
155 [COBALT_PCICONF_VIA] = 0, 173 [COBALT_PCICONF_VIA] = 0,
156 [COBALT_PCICONF_PCISLOT] = COBALT_QUBE_SLOT_IRQ, 174 [COBALT_PCICONF_PCISLOT] = PCISLOT_IRQ,
157 [COBALT_PCICONF_ETH1] = COBALT_ETH1_IRQ 175 [COBALT_PCICONF_ETH1] = ETH1_IRQ
158}; 176};
159 177
160int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 178int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
diff --git a/arch/mips/pci/ops-au1000.c b/arch/mips/pci/ops-au1000.c
index 7932dfe5eb9b..6b29904acf45 100644
--- a/arch/mips/pci/ops-au1000.c
+++ b/arch/mips/pci/ops-au1000.c
@@ -112,7 +112,7 @@ static int config_access(unsigned char access_type, struct pci_bus *bus,
112 first_cfg = 0; 112 first_cfg = 0;
113 pci_cfg_vm = get_vm_area(0x2000, VM_IOREMAP); 113 pci_cfg_vm = get_vm_area(0x2000, VM_IOREMAP);
114 if (!pci_cfg_vm) 114 if (!pci_cfg_vm)
115 panic (KERN_ERR "PCI unable to get vm area\n"); 115 panic(KERN_ERR "PCI unable to get vm area\n");
116 pci_cfg_wired_entry = read_c0_wired(); 116 pci_cfg_wired_entry = read_c0_wired();
117 add_wired_entry(0, 0, (unsigned long)pci_cfg_vm->addr, PM_4K); 117 add_wired_entry(0, 0, (unsigned long)pci_cfg_vm->addr, PM_4K);
118 last_entryLo0 = last_entryLo1 = 0xffffffff; 118 last_entryLo0 = last_entryLo1 = 0xffffffff;
diff --git a/arch/mips/pci/ops-mace.c b/arch/mips/pci/ops-mace.c
index 8008e31c5e81..fe5451449304 100644
--- a/arch/mips/pci/ops-mace.c
+++ b/arch/mips/pci/ops-mace.c
@@ -29,22 +29,20 @@
29 * 4 N/C 29 * 4 N/C
30 */ 30 */
31 31
32#define chkslot(_bus,_devfn) \ 32static inline int mkaddr(struct pci_bus *bus, unsigned int devfn,
33do { \ 33 unsigned int reg)
34 if ((_bus)->number > 0 || PCI_SLOT (_devfn) < 1 \ 34{
35 || PCI_SLOT (_devfn) > 3) \ 35 return ((bus->number & 0xff) << 16) |
36 return PCIBIOS_DEVICE_NOT_FOUND; \ 36 ((devfn & 0xff) << 8) |
37} while (0) 37 (reg & 0xfc);
38}
38 39
39#define mkaddr(_devfn, _reg) \
40((((_devfn) & 0xffUL) << 8) | ((_reg) & 0xfcUL))
41 40
42static int 41static int
43mace_pci_read_config(struct pci_bus *bus, unsigned int devfn, 42mace_pci_read_config(struct pci_bus *bus, unsigned int devfn,
44 int reg, int size, u32 *val) 43 int reg, int size, u32 *val)
45{ 44{
46 chkslot(bus, devfn); 45 mace->pci.config_addr = mkaddr(bus, devfn, reg);
47 mace->pci.config_addr = mkaddr(devfn, reg);
48 switch (size) { 46 switch (size) {
49 case 1: 47 case 1:
50 *val = mace->pci.config_data.b[(reg & 3) ^ 3]; 48 *val = mace->pci.config_data.b[(reg & 3) ^ 3];
@@ -66,8 +64,7 @@ static int
66mace_pci_write_config(struct pci_bus *bus, unsigned int devfn, 64mace_pci_write_config(struct pci_bus *bus, unsigned int devfn,
67 int reg, int size, u32 val) 65 int reg, int size, u32 val)
68{ 66{
69 chkslot(bus, devfn); 67 mace->pci.config_addr = mkaddr(bus, devfn, reg);
70 mace->pci.config_addr = mkaddr(devfn, reg);
71 switch (size) { 68 switch (size) {
72 case 1: 69 case 1:
73 mace->pci.config_data.b[(reg & 3) ^ 3] = val; 70 mace->pci.config_data.b[(reg & 3) ^ 3] = val;
diff --git a/arch/mips/pci/ops-nile4.c b/arch/mips/pci/ops-nile4.c
new file mode 100644
index 000000000000..b7f0fb0210f4
--- /dev/null
+++ b/arch/mips/pci/ops-nile4.c
@@ -0,0 +1,147 @@
1#include <linux/kernel.h>
2#include <linux/init.h>
3#include <linux/pci.h>
4#include <asm/bootinfo.h>
5
6#include <asm/lasat/lasat.h>
7#include <asm/gt64120.h>
8#include <asm/nile4.h>
9
10#define PCI_ACCESS_READ 0
11#define PCI_ACCESS_WRITE 1
12
13#define LO(reg) (reg / 4)
14#define HI(reg) (reg / 4 + 1)
15
16volatile unsigned long *const vrc_pciregs = (void *) Vrc5074_BASE;
17
18static DEFINE_SPINLOCK(nile4_pci_lock);
19
20static int nile4_pcibios_config_access(unsigned char access_type,
21 struct pci_bus *bus, unsigned int devfn, int where, u32 *val)
22{
23 unsigned char busnum = bus->number;
24 u32 adr, mask, err;
25
26 if ((busnum == 0) && (PCI_SLOT(devfn) > 8))
27 /* The addressing scheme chosen leaves room for just
28 * 8 devices on the first busnum (besides the PCI
29 * controller itself) */
30 return PCIBIOS_DEVICE_NOT_FOUND;
31
32 if ((busnum == 0) && (devfn == PCI_DEVFN(0, 0))) {
33 /* Access controller registers directly */
34 if (access_type == PCI_ACCESS_WRITE) {
35 vrc_pciregs[(0x200 + where) >> 2] = *val;
36 } else {
37 *val = vrc_pciregs[(0x200 + where) >> 2];
38 }
39 return PCIBIOS_SUCCESSFUL;
40 }
41
42 /* Temporarily map PCI Window 1 to config space */
43 mask = vrc_pciregs[LO(NILE4_PCIINIT1)];
44 vrc_pciregs[LO(NILE4_PCIINIT1)] = 0x0000001a | (busnum ? 0x200 : 0);
45
46 /* Clear PCI Error register. This also clears the Error Type
47 * bits in the Control register */
48 vrc_pciregs[LO(NILE4_PCIERR)] = 0;
49 vrc_pciregs[HI(NILE4_PCIERR)] = 0;
50
51 /* Setup address */
52 if (busnum == 0)
53 adr =
54 KSEG1ADDR(PCI_WINDOW1) +
55 ((1 << (PCI_SLOT(devfn) + 15)) | (PCI_FUNC(devfn) << 8)
56 | (where & ~3));
57 else
58 adr = KSEG1ADDR(PCI_WINDOW1) | (busnum << 16) | (devfn << 8) |
59 (where & ~3);
60
61 if (access_type == PCI_ACCESS_WRITE)
62 *(u32 *) adr = *val;
63 else
64 *val = *(u32 *) adr;
65
66 /* Check for master or target abort */
67 err = (vrc_pciregs[HI(NILE4_PCICTRL)] >> 5) & 0x7;
68
69 /* Restore PCI Window 1 */
70 vrc_pciregs[LO(NILE4_PCIINIT1)] = mask;
71
72 if (err)
73 return PCIBIOS_DEVICE_NOT_FOUND;
74
75 return PCIBIOS_SUCCESSFUL;
76}
77
78static int nile4_pcibios_read(struct pci_bus *bus, unsigned int devfn,
79 int where, int size, u32 *val)
80{
81 unsigned long flags;
82 u32 data = 0;
83 int err;
84
85 if ((size == 2) && (where & 1))
86 return PCIBIOS_BAD_REGISTER_NUMBER;
87 else if ((size == 4) && (where & 3))
88 return PCIBIOS_BAD_REGISTER_NUMBER;
89
90 spin_lock_irqsave(&nile4_pci_lock, flags);
91 err = nile4_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where,
92 &data);
93 spin_unlock_irqrestore(&nile4_pci_lock, flags);
94
95 if (err)
96 return err;
97
98 if (size == 1)
99 *val = (data >> ((where & 3) << 3)) & 0xff;
100 else if (size == 2)
101 *val = (data >> ((where & 3) << 3)) & 0xffff;
102 else
103 *val = data;
104
105 return PCIBIOS_SUCCESSFUL;
106}
107
108static int nile4_pcibios_write(struct pci_bus *bus, unsigned int devfn,
109 int where, int size, u32 val)
110{
111 unsigned long flags;
112 u32 data = 0;
113 int err;
114
115 if ((size == 2) && (where & 1))
116 return PCIBIOS_BAD_REGISTER_NUMBER;
117 else if ((size == 4) && (where & 3))
118 return PCIBIOS_BAD_REGISTER_NUMBER;
119
120 spin_lock_irqsave(&nile4_pci_lock, flags);
121 err = nile4_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where,
122 &data);
123 spin_unlock_irqrestore(&nile4_pci_lock, flags);
124
125 if (err)
126 return err;
127
128 if (size == 1)
129 data = (data & ~(0xff << ((where & 3) << 3))) |
130 (val << ((where & 3) << 3));
131 else if (size == 2)
132 data = (data & ~(0xffff << ((where & 3) << 3))) |
133 (val << ((where & 3) << 3));
134 else
135 data = val;
136
137 if (nile4_pcibios_config_access
138 (PCI_ACCESS_WRITE, bus, devfn, where, &data))
139 return -1;
140
141 return PCIBIOS_SUCCESSFUL;
142}
143
144struct pci_ops nile4_pci_ops = {
145 .read = nile4_pcibios_read,
146 .write = nile4_pcibios_write,
147};
diff --git a/arch/mips/pci/ops-sni.c b/arch/mips/pci/ops-sni.c
index fa2d2c60f797..97ed25b92edf 100644
--- a/arch/mips/pci/ops-sni.c
+++ b/arch/mips/pci/ops-sni.c
@@ -70,13 +70,13 @@ static int pcimt_write(struct pci_bus *bus, unsigned int devfn, int reg,
70 70
71 switch (size) { 71 switch (size) {
72 case 1: 72 case 1:
73 outb (val, PCIMT_CONFIG_DATA + (reg & 3)); 73 outb(val, PCIMT_CONFIG_DATA + (reg & 3));
74 break; 74 break;
75 case 2: 75 case 2:
76 outw (val, PCIMT_CONFIG_DATA + (reg & 2)); 76 outw(val, PCIMT_CONFIG_DATA + (reg & 2));
77 break; 77 break;
78 case 4: 78 case 4:
79 outl (val, PCIMT_CONFIG_DATA); 79 outl(val, PCIMT_CONFIG_DATA);
80 break; 80 break;
81 } 81 }
82 82
@@ -93,7 +93,7 @@ static int pcit_set_config_address(unsigned int busno, unsigned int devfn, int r
93 if ((devfn > 255) || (reg > 255) || (busno > 255)) 93 if ((devfn > 255) || (reg > 255) || (busno > 255))
94 return PCIBIOS_BAD_REGISTER_NUMBER; 94 return PCIBIOS_BAD_REGISTER_NUMBER;
95 95
96 outl ((1 << 31) | ((busno & 0xff) << 16) | ((devfn & 0xff) << 8) | (reg & 0xfc), 0xcf8); 96 outl((1 << 31) | ((busno & 0xff) << 16) | ((devfn & 0xff) << 8) | (reg & 0xfc), 0xcf8);
97 return PCIBIOS_SUCCESSFUL; 97 return PCIBIOS_SUCCESSFUL;
98} 98}
99 99
@@ -108,12 +108,12 @@ static int pcit_read(struct pci_bus *bus, unsigned int devfn, int reg,
108 * we don't do it, we will get a data bus error 108 * we don't do it, we will get a data bus error
109 */ 109 */
110 if (bus->number == 0) { 110 if (bus->number == 0) {
111 pcit_set_config_address (0, 0, 0x68); 111 pcit_set_config_address(0, 0, 0x68);
112 outl (inl (0xcfc) | 0xc0000000, 0xcfc); 112 outl(inl(0xcfc) | 0xc0000000, 0xcfc);
113 if ((res = pcit_set_config_address(0, devfn, 0))) 113 if ((res = pcit_set_config_address(0, devfn, 0)))
114 return res; 114 return res;
115 outl (0xffffffff, 0xcfc); 115 outl(0xffffffff, 0xcfc);
116 pcit_set_config_address (0, 0, 0x68); 116 pcit_set_config_address(0, 0, 0x68);
117 if (inl(0xcfc) & 0x100000) 117 if (inl(0xcfc) & 0x100000)
118 return PCIBIOS_DEVICE_NOT_FOUND; 118 return PCIBIOS_DEVICE_NOT_FOUND;
119 } 119 }
@@ -144,13 +144,13 @@ static int pcit_write(struct pci_bus *bus, unsigned int devfn, int reg,
144 144
145 switch (size) { 145 switch (size) {
146 case 1: 146 case 1:
147 outb (val, PCIMT_CONFIG_DATA + (reg & 3)); 147 outb(val, PCIMT_CONFIG_DATA + (reg & 3));
148 break; 148 break;
149 case 2: 149 case 2:
150 outw (val, PCIMT_CONFIG_DATA + (reg & 2)); 150 outw(val, PCIMT_CONFIG_DATA + (reg & 2));
151 break; 151 break;
152 case 4: 152 case 4:
153 outl (val, PCIMT_CONFIG_DATA); 153 outl(val, PCIMT_CONFIG_DATA);
154 break; 154 break;
155 } 155 }
156 156
diff --git a/arch/mips/pci/pci-bcm1480.c b/arch/mips/pci/pci-bcm1480.c
index 2b4e30c7d105..5443ea3596f8 100644
--- a/arch/mips/pci/pci-bcm1480.c
+++ b/arch/mips/pci/pci-bcm1480.c
@@ -49,8 +49,8 @@
49 * Macros for calculating offsets into config space given a device 49 * Macros for calculating offsets into config space given a device
50 * structure or dev/fun/reg 50 * structure or dev/fun/reg
51 */ 51 */
52#define CFGOFFSET(bus,devfn,where) (((bus)<<16)+((devfn)<<8)+(where)) 52#define CFGOFFSET(bus, devfn, where) (((bus)<<16)+((devfn)<<8)+(where))
53#define CFGADDR(bus,devfn,where) CFGOFFSET((bus)->number,(devfn),where) 53#define CFGADDR(bus, devfn, where) CFGOFFSET((bus)->number, (devfn), where)
54 54
55static void *cfg_space; 55static void *cfg_space;
56 56
@@ -255,7 +255,7 @@ static int __init bcm1480_pcibios_init(void)
255 register_pci_controller(&bcm1480_controller); 255 register_pci_controller(&bcm1480_controller);
256 256
257#ifdef CONFIG_VGA_CONSOLE 257#ifdef CONFIG_VGA_CONSOLE
258 take_over_console(&vga_con,0,MAX_NR_CONSOLES-1,1); 258 take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1);
259#endif 259#endif
260 return 0; 260 return 0;
261} 261}
diff --git a/arch/mips/pci/pci-bcm1480ht.c b/arch/mips/pci/pci-bcm1480ht.c
index ba2e34b09231..a63e3bd6b0ac 100644
--- a/arch/mips/pci/pci-bcm1480ht.c
+++ b/arch/mips/pci/pci-bcm1480ht.c
@@ -48,8 +48,8 @@
48 * Macros for calculating offsets into config space given a device 48 * Macros for calculating offsets into config space given a device
49 * structure or dev/fun/reg 49 * structure or dev/fun/reg
50 */ 50 */
51#define CFGOFFSET(bus,devfn,where) (((bus)<<16)+((devfn)<<8)+(where)) 51#define CFGOFFSET(bus, devfn, where) (((bus)<<16)+((devfn)<<8)+(where))
52#define CFGADDR(bus,devfn,where) CFGOFFSET((bus)->number,(devfn),where) 52#define CFGADDR(bus, devfn, where) CFGOFFSET((bus)->number, (devfn), where)
53 53
54static void *ht_cfg_space; 54static void *ht_cfg_space;
55 55
diff --git a/arch/mips/pci/pci-lasat.c b/arch/mips/pci/pci-lasat.c
new file mode 100644
index 000000000000..5abd5c7119be
--- /dev/null
+++ b/arch/mips/pci/pci-lasat.c
@@ -0,0 +1,91 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2000, 2001, 04 Keith M Wesolowski
7 */
8#include <linux/kernel.h>
9#include <linux/init.h>
10#include <linux/pci.h>
11#include <linux/types.h>
12#include <asm/bootinfo.h>
13
14extern struct pci_ops nile4_pci_ops;
15extern struct pci_ops gt64xxx_pci0_ops;
16static struct resource lasat_pci_mem_resource = {
17 .name = "LASAT PCI MEM",
18 .start = 0x18000000,
19 .end = 0x19ffffff,
20 .flags = IORESOURCE_MEM,
21};
22
23static struct resource lasat_pci_io_resource = {
24 .name = "LASAT PCI IO",
25 .start = 0x1a000000,
26 .end = 0x1bffffff,
27 .flags = IORESOURCE_IO,
28};
29
30static struct pci_controller lasat_pci_controller = {
31 .mem_resource = &lasat_pci_mem_resource,
32 .io_resource = &lasat_pci_io_resource,
33};
34
35static int __init lasat_pci_setup(void)
36{
37 printk(KERN_DEBUG "PCI: starting\n");
38
39 switch (mips_machtype) {
40 case MACH_LASAT_100:
41 lasat_pci_controller.pci_ops = &gt64xxx_pci0_ops;
42 break;
43 case MACH_LASAT_200:
44 lasat_pci_controller.pci_ops = &nile4_pci_ops;
45 break;
46 default:
47 panic("pcibios_init: mips_machtype incorrect");
48 }
49
50 register_pci_controller(&lasat_pci_controller);
51
52 return 0;
53}
54
55arch_initcall(lasat_pci_setup);
56
57#define LASATINT_ETH1 0
58#define LASATINT_ETH0 1
59#define LASATINT_HDC 2
60#define LASATINT_COMP 3
61#define LASATINT_HDLC 4
62#define LASATINT_PCIA 5
63#define LASATINT_PCIB 6
64#define LASATINT_PCIC 7
65#define LASATINT_PCID 8
66
67int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
68{
69 switch (slot) {
70 case 1:
71 case 2:
72 case 3:
73 return LASATINT_PCIA + (((slot-1) + (pin-1)) % 4);
74 case 4:
75 return LASATINT_ETH1; /* Ethernet 1 (LAN 2) */
76 case 5:
77 return LASATINT_ETH0; /* Ethernet 0 (LAN 1) */
78 case 6:
79 return LASATINT_HDC; /* IDE controller */
80 default:
81 return 0xff; /* Illegal */
82 }
83
84 return -1;
85}
86
87/* Do platform specific device initialization at pci_enable_device() time */
88int pcibios_plat_dev_init(struct pci_dev *dev)
89{
90 return 0;
91}
diff --git a/arch/mips/pci/pci-sb1250.c b/arch/mips/pci/pci-sb1250.c
index c1ac6493155e..42e4d2c800fa 100644
--- a/arch/mips/pci/pci-sb1250.c
+++ b/arch/mips/pci/pci-sb1250.c
@@ -49,8 +49,8 @@
49 * Macros for calculating offsets into config space given a device 49 * Macros for calculating offsets into config space given a device
50 * structure or dev/fun/reg 50 * structure or dev/fun/reg
51 */ 51 */
52#define CFGOFFSET(bus,devfn,where) (((bus)<<16) + ((devfn)<<8) + (where)) 52#define CFGOFFSET(bus, devfn, where) (((bus)<<16) + ((devfn)<<8) + (where))
53#define CFGADDR(bus,devfn,where) CFGOFFSET((bus)->number,(devfn),where) 53#define CFGADDR(bus, devfn, where) CFGOFFSET((bus)->number, (devfn), where)
54 54
55static void *cfg_space; 55static void *cfg_space;
56 56
diff --git a/arch/mips/pci/pci-vr41xx.c b/arch/mips/pci/pci-vr41xx.c
index 9885fa403603..240df9e33813 100644
--- a/arch/mips/pci/pci-vr41xx.c
+++ b/arch/mips/pci/pci-vr41xx.c
@@ -228,7 +228,7 @@ static int __init vr41xx_pciu_init(void)
228 else 228 else
229 pciu_write(PCIEXACCREG, 0); 229 pciu_write(PCIEXACCREG, 0);
230 230
231 if (current_cpu_data.cputype == CPU_VR4122) 231 if (current_cpu_type() == CPU_VR4122)
232 pciu_write(PCITRDYVREG, TRDYV(setup->wait_time_limit_from_irdy_to_trdy)); 232 pciu_write(PCITRDYVREG, TRDYV(setup->wait_time_limit_from_irdy_to_trdy));
233 233
234 pciu_write(LATTIMEREG, MLTIM(setup->master_latency_timer)); 234 pciu_write(LATTIMEREG, MLTIM(setup->master_latency_timer));
diff --git a/arch/mips/philips/pnx8550/common/proc.c b/arch/mips/philips/pnx8550/common/proc.c
index 92311e95b700..18b125e3b65d 100644
--- a/arch/mips/philips/pnx8550/common/proc.c
+++ b/arch/mips/philips/pnx8550/common/proc.c
@@ -27,20 +27,20 @@
27#include <uart.h> 27#include <uart.h>
28 28
29 29
30static int pnx8550_timers_read (char* page, char** start, off_t offset, int count, int* eof, void* data) 30static int pnx8550_timers_read(char* page, char** start, off_t offset, int count, int* eof, void* data)
31{ 31{
32 int len = 0; 32 int len = 0;
33 int configPR = read_c0_config7(); 33 int configPR = read_c0_config7();
34 34
35 if (offset==0) { 35 if (offset==0) {
36 len += sprintf(&page[len],"Timer: count, compare, tc, status\n"); 36 len += sprintf(&page[len], "Timer: count, compare, tc, status\n");
37 len += sprintf(&page[len]," 1: %11i, %8i, %1i, %s\n", 37 len += sprintf(&page[len], " 1: %11i, %8i, %1i, %s\n",
38 read_c0_count(), read_c0_compare(), 38 read_c0_count(), read_c0_compare(),
39 (configPR>>6)&0x1, ((configPR>>3)&0x1)? "off":"on"); 39 (configPR>>6)&0x1, ((configPR>>3)&0x1)? "off":"on");
40 len += sprintf(&page[len]," 2: %11i, %8i, %1i, %s\n", 40 len += sprintf(&page[len], " 2: %11i, %8i, %1i, %s\n",
41 read_c0_count2(), read_c0_compare2(), 41 read_c0_count2(), read_c0_compare2(),
42 (configPR>>7)&0x1, ((configPR>>4)&0x1)? "off":"on"); 42 (configPR>>7)&0x1, ((configPR>>4)&0x1)? "off":"on");
43 len += sprintf(&page[len]," 3: %11i, %8i, %1i, %s\n", 43 len += sprintf(&page[len], " 3: %11i, %8i, %1i, %s\n",
44 read_c0_count3(), read_c0_compare3(), 44 read_c0_count3(), read_c0_compare3(),
45 (configPR>>8)&0x1, ((configPR>>5)&0x1)? "off":"on"); 45 (configPR>>8)&0x1, ((configPR>>5)&0x1)? "off":"on");
46 } 46 }
@@ -48,23 +48,23 @@ static int pnx8550_timers_read (char* page, char** start, off_t offset, int coun
48 return len; 48 return len;
49} 49}
50 50
51static int pnx8550_registers_read (char* page, char** start, off_t offset, int count, int* eof, void* data) 51static int pnx8550_registers_read(char* page, char** start, off_t offset, int count, int* eof, void* data)
52{ 52{
53 int len = 0; 53 int len = 0;
54 54
55 if (offset==0) { 55 if (offset==0) {
56 len += sprintf(&page[len],"config1: %#10.8x\n",read_c0_config1()); 56 len += sprintf(&page[len], "config1: %#10.8x\n", read_c0_config1());
57 len += sprintf(&page[len],"config2: %#10.8x\n",read_c0_config2()); 57 len += sprintf(&page[len], "config2: %#10.8x\n", read_c0_config2());
58 len += sprintf(&page[len],"config3: %#10.8x\n",read_c0_config3()); 58 len += sprintf(&page[len], "config3: %#10.8x\n", read_c0_config3());
59 len += sprintf(&page[len],"configPR: %#10.8x\n",read_c0_config7()); 59 len += sprintf(&page[len], "configPR: %#10.8x\n", read_c0_config7());
60 len += sprintf(&page[len],"status: %#10.8x\n",read_c0_status()); 60 len += sprintf(&page[len], "status: %#10.8x\n", read_c0_status());
61 len += sprintf(&page[len],"cause: %#10.8x\n",read_c0_cause()); 61 len += sprintf(&page[len], "cause: %#10.8x\n", read_c0_cause());
62 len += sprintf(&page[len],"count: %#10.8x\n",read_c0_count()); 62 len += sprintf(&page[len], "count: %#10.8x\n", read_c0_count());
63 len += sprintf(&page[len],"count_2: %#10.8x\n",read_c0_count2()); 63 len += sprintf(&page[len], "count_2: %#10.8x\n", read_c0_count2());
64 len += sprintf(&page[len],"count_3: %#10.8x\n",read_c0_count3()); 64 len += sprintf(&page[len], "count_3: %#10.8x\n", read_c0_count3());
65 len += sprintf(&page[len],"compare: %#10.8x\n",read_c0_compare()); 65 len += sprintf(&page[len], "compare: %#10.8x\n", read_c0_compare());
66 len += sprintf(&page[len],"compare_2: %#10.8x\n",read_c0_compare2()); 66 len += sprintf(&page[len], "compare_2: %#10.8x\n", read_c0_compare2());
67 len += sprintf(&page[len],"compare_3: %#10.8x\n",read_c0_compare3()); 67 len += sprintf(&page[len], "compare_3: %#10.8x\n", read_c0_compare3());
68 } 68 }
69 69
70 return len; 70 return len;
diff --git a/arch/mips/philips/pnx8550/common/setup.c b/arch/mips/philips/pnx8550/common/setup.c
index 5bd737477685..2ce298f4d19a 100644
--- a/arch/mips/philips/pnx8550/common/setup.c
+++ b/arch/mips/philips/pnx8550/common/setup.c
@@ -47,7 +47,6 @@ extern void pnx8550_machine_halt(void);
47extern void pnx8550_machine_power_off(void); 47extern void pnx8550_machine_power_off(void);
48extern struct resource ioport_resource; 48extern struct resource ioport_resource;
49extern struct resource iomem_resource; 49extern struct resource iomem_resource;
50extern void pnx8550_time_init(void);
51extern void rs_kgdb_hook(int tty_no); 50extern void rs_kgdb_hook(int tty_no);
52extern char *prom_getcmdline(void); 51extern char *prom_getcmdline(void);
53 52
@@ -104,8 +103,6 @@ void __init plat_mem_setup(void)
104 _machine_halt = pnx8550_machine_halt; 103 _machine_halt = pnx8550_machine_halt;
105 pm_power_off = pnx8550_machine_power_off; 104 pm_power_off = pnx8550_machine_power_off;
106 105
107 board_time_init = pnx8550_time_init;
108
109 /* Clear the Global 2 Register, PCI Inta Output Enable Registers 106 /* Clear the Global 2 Register, PCI Inta Output Enable Registers
110 Bit 1:Enable DAC Powerdown 107 Bit 1:Enable DAC Powerdown
111 -> 0:DACs are enabled and are working normally 108 -> 0:DACs are enabled and are working normally
diff --git a/arch/mips/philips/pnx8550/common/time.c b/arch/mips/philips/pnx8550/common/time.c
index 68def3880a1c..e818fd0f1584 100644
--- a/arch/mips/philips/pnx8550/common/time.c
+++ b/arch/mips/philips/pnx8550/common/time.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright 2001, 2002, 2003 MontaVista Software Inc. 2 * Copyright 2001, 2002, 2003 MontaVista Software Inc.
3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net 3 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
4 * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
4 * 5 *
5 * Common time service routines for MIPS machines. See 6 * Common time service routines for MIPS machines. See
6 * Documents/MIPS/README.txt. 7 * Documents/MIPS/README.txt.
@@ -46,16 +47,16 @@ static void timer_ack(void)
46} 47}
47 48
48/* 49/*
49 * pnx8550_time_init() - it does the following things: 50 * plat_time_init() - it does the following things:
50 * 51 *
51 * 1) board_time_init() - 52 * 1) plat_time_init() -
52 * a) (optional) set up RTC routines, 53 * a) (optional) set up RTC routines,
53 * b) (optional) calibrate and set the mips_hpt_frequency 54 * b) (optional) calibrate and set the mips_hpt_frequency
54 * (only needed if you intended to use cpu counter as timer interrupt 55 * (only needed if you intended to use cpu counter as timer interrupt
55 * source) 56 * source)
56 */ 57 */
57 58
58void pnx8550_time_init(void) 59__init void plat_time_init(void)
59{ 60{
60 unsigned int n; 61 unsigned int n;
61 unsigned int m; 62 unsigned int m;
diff --git a/arch/mips/philips/pnx8550/jbs/init.c b/arch/mips/philips/pnx8550/jbs/init.c
index 85f449174bc3..cfd90fa3d799 100644
--- a/arch/mips/philips/pnx8550/jbs/init.c
+++ b/arch/mips/philips/pnx8550/jbs/init.c
@@ -48,7 +48,6 @@ void __init prom_init(void)
48 48
49 unsigned long memsize; 49 unsigned long memsize;
50 50
51 mips_machgroup = MACH_GROUP_PHILIPS;
52 mips_machtype = MACH_PHILIPS_JBS; 51 mips_machtype = MACH_PHILIPS_JBS;
53 52
54 //memsize = 0x02800000; /* Trimedia uses memory above */ 53 //memsize = 0x02800000; /* Trimedia uses memory above */
diff --git a/arch/mips/philips/pnx8550/stb810/prom_init.c b/arch/mips/philips/pnx8550/stb810/prom_init.c
index ea5b4e0fb47d..fdb33ed089b9 100644
--- a/arch/mips/philips/pnx8550/stb810/prom_init.c
+++ b/arch/mips/philips/pnx8550/stb810/prom_init.c
@@ -41,7 +41,6 @@ void __init prom_init(void)
41 41
42 prom_init_cmdline(); 42 prom_init_cmdline();
43 43
44 mips_machgroup = MACH_GROUP_PHILIPS;
45 mips_machtype = MACH_PHILIPS_STB810; 44 mips_machtype = MACH_PHILIPS_STB810;
46 45
47 memsize = 0x08000000; /* Trimedia uses memory above */ 46 memsize = 0x08000000; /* Trimedia uses memory above */
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_hwbutton.c b/arch/mips/pmc-sierra/msp71xx/msp_hwbutton.c
index 6fa85728158b..ab96a2d7f4c4 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_hwbutton.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_hwbutton.c
@@ -163,7 +163,7 @@ static int msp_hwbutton_register(struct hwbutton_interrupt *hirq)
163 CIC_EXT_SET_ACTIVE_HI(cic_ext, hirq->eirq); 163 CIC_EXT_SET_ACTIVE_HI(cic_ext, hirq->eirq);
164 *CIC_EXT_CFG_REG = cic_ext; 164 *CIC_EXT_CFG_REG = cic_ext;
165 165
166 return request_irq(hirq->irq, hwbutton_handler, SA_INTERRUPT, 166 return request_irq(hirq->irq, hwbutton_handler, IRQF_DISABLED,
167 hirq->name, (void *)hirq); 167 hirq->name, (void *)hirq);
168} 168}
169 169
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_serial.c b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
index e25bac537d77..15e7b8000b4c 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_serial.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
@@ -117,7 +117,7 @@ void __init msp_serial_setup(void)
117 117
118 /* Initialize first serial port */ 118 /* Initialize first serial port */
119 up.mapbase = MSP_UART0_BASE; 119 up.mapbase = MSP_UART0_BASE;
120 up.membase = ioremap_nocache(up.mapbase,MSP_UART_REG_LEN); 120 up.membase = ioremap_nocache(up.mapbase, MSP_UART_REG_LEN);
121 up.irq = MSP_INT_UART0; 121 up.irq = MSP_INT_UART0;
122 up.uartclk = uartclk; 122 up.uartclk = uartclk;
123 up.regshift = 2; 123 up.regshift = 2;
@@ -145,9 +145,9 @@ void __init msp_serial_setup(void)
145 if( DEBUG_PORT_BASE == KSEG1ADDR(MSP_UART1_BASE) ) { 145 if( DEBUG_PORT_BASE == KSEG1ADDR(MSP_UART1_BASE) ) {
146 if( mips_machtype == MACH_MSP4200_FPGA 146 if( mips_machtype == MACH_MSP4200_FPGA
147 || mips_machtype == MACH_MSP7120_FPGA ) 147 || mips_machtype == MACH_MSP7120_FPGA )
148 initDebugPort(uartclk,19200); 148 initDebugPort(uartclk, 19200);
149 else 149 else
150 initDebugPort(uartclk,57600); 150 initDebugPort(uartclk, 57600);
151 } 151 }
152#endif 152#endif
153 break; 153 break;
@@ -157,7 +157,7 @@ void __init msp_serial_setup(void)
157 } 157 }
158 158
159 up.mapbase = MSP_UART1_BASE; 159 up.mapbase = MSP_UART1_BASE;
160 up.membase = ioremap_nocache(up.mapbase,MSP_UART_REG_LEN); 160 up.membase = ioremap_nocache(up.mapbase, MSP_UART_REG_LEN);
161 up.irq = MSP_INT_UART1; 161 up.irq = MSP_INT_UART1;
162 up.line = 1; 162 up.line = 1;
163 up.private_data = (void*)UART1_STATUS_REG; 163 up.private_data = (void*)UART1_STATUS_REG;
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_setup.c b/arch/mips/pmc-sierra/msp71xx/msp_setup.c
index 8f69b789be90..c93675615f5d 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_setup.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_setup.c
@@ -25,7 +25,6 @@
25#define MSP_BOARD_RESET_GPIO 9 25#define MSP_BOARD_RESET_GPIO 9
26#endif 26#endif
27 27
28extern void msp_timer_init(void);
29extern void msp_serial_setup(void); 28extern void msp_serial_setup(void);
30extern void pmctwiled_setup(void); 29extern void pmctwiled_setup(void);
31 30
@@ -149,8 +148,6 @@ void __init plat_mem_setup(void)
149 _machine_restart = msp_restart; 148 _machine_restart = msp_restart;
150 _machine_halt = msp_halt; 149 _machine_halt = msp_halt;
151 pm_power_off = msp_power_off; 150 pm_power_off = msp_power_off;
152
153 board_time_init = msp_timer_init;
154} 151}
155 152
156void __init prom_init(void) 153void __init prom_init(void)
@@ -176,16 +173,13 @@ void __init prom_init(void)
176 case FAMILY_FPGA: 173 case FAMILY_FPGA:
177 if (FPGA_IS_MSP4200(revision)) { 174 if (FPGA_IS_MSP4200(revision)) {
178 /* Old-style revision ID */ 175 /* Old-style revision ID */
179 mips_machgroup = MACH_GROUP_MSP;
180 mips_machtype = MACH_MSP4200_FPGA; 176 mips_machtype = MACH_MSP4200_FPGA;
181 } else { 177 } else {
182 mips_machgroup = MACH_GROUP_MSP;
183 mips_machtype = MACH_MSP_OTHER; 178 mips_machtype = MACH_MSP_OTHER;
184 } 179 }
185 break; 180 break;
186 181
187 case FAMILY_MSP4200: 182 case FAMILY_MSP4200:
188 mips_machgroup = MACH_GROUP_MSP;
189#if defined(CONFIG_PMC_MSP4200_EVAL) 183#if defined(CONFIG_PMC_MSP4200_EVAL)
190 mips_machtype = MACH_MSP4200_EVAL; 184 mips_machtype = MACH_MSP4200_EVAL;
191#elif defined(CONFIG_PMC_MSP4200_GW) 185#elif defined(CONFIG_PMC_MSP4200_GW)
@@ -196,12 +190,10 @@ void __init prom_init(void)
196 break; 190 break;
197 191
198 case FAMILY_MSP4200_FPGA: 192 case FAMILY_MSP4200_FPGA:
199 mips_machgroup = MACH_GROUP_MSP;
200 mips_machtype = MACH_MSP4200_FPGA; 193 mips_machtype = MACH_MSP4200_FPGA;
201 break; 194 break;
202 195
203 case FAMILY_MSP7100: 196 case FAMILY_MSP7100:
204 mips_machgroup = MACH_GROUP_MSP;
205#if defined(CONFIG_PMC_MSP7120_EVAL) 197#if defined(CONFIG_PMC_MSP7120_EVAL)
206 mips_machtype = MACH_MSP7120_EVAL; 198 mips_machtype = MACH_MSP7120_EVAL;
207#elif defined(CONFIG_PMC_MSP7120_GW) 199#elif defined(CONFIG_PMC_MSP7120_GW)
@@ -212,22 +204,14 @@ void __init prom_init(void)
212 break; 204 break;
213 205
214 case FAMILY_MSP7100_FPGA: 206 case FAMILY_MSP7100_FPGA:
215 mips_machgroup = MACH_GROUP_MSP;
216 mips_machtype = MACH_MSP7120_FPGA; 207 mips_machtype = MACH_MSP7120_FPGA;
217 break; 208 break;
218 209
219 default: 210 default:
220 /* we don't recognize the machine */ 211 /* we don't recognize the machine */
221 mips_machgroup = MACH_GROUP_UNKNOWN;
222 mips_machtype = MACH_UNKNOWN; 212 mips_machtype = MACH_UNKNOWN;
223 break;
224 }
225
226 /* make sure we have the right initialization routine - sanity */
227 if (mips_machgroup != MACH_GROUP_MSP) {
228 ppfinit("Unknown machine group in a "
229 "MSP initialization routine\n");
230 panic("***Bogosity factor five***, exiting\n"); 213 panic("***Bogosity factor five***, exiting\n");
214 break;
231 } 215 }
232 216
233 prom_init_cmdline(); 217 prom_init_cmdline();
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_time.c b/arch/mips/pmc-sierra/msp71xx/msp_time.c
index 2a2beac5a4f8..f221d4763625 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_time.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_time.c
@@ -36,7 +36,7 @@
36#include <msp_int.h> 36#include <msp_int.h>
37#include <msp_regs.h> 37#include <msp_regs.h>
38 38
39void __init msp_timer_init(void) 39void __init plat_time_init(void)
40{ 40{
41 char *endp, *s; 41 char *endp, *s;
42 unsigned long cpu_rate = 0; 42 unsigned long cpu_rate = 0;
@@ -81,7 +81,6 @@ void __init msp_timer_init(void)
81 mips_hpt_frequency = cpu_rate/2; 81 mips_hpt_frequency = cpu_rate/2;
82} 82}
83 83
84
85void __init plat_timer_setup(struct irqaction *irq) 84void __init plat_timer_setup(struct irqaction *irq)
86{ 85{
87#ifdef CONFIG_IRQ_MSP_CIC 86#ifdef CONFIG_IRQ_MSP_CIC
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_usb.c b/arch/mips/pmc-sierra/msp71xx/msp_usb.c
index 21f9c70b6923..f7ca4f582331 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_usb.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_usb.c
@@ -58,7 +58,7 @@ static struct platform_device msp_usbhost_device = {
58 .dma_mask = &msp_usbhost_dma_mask, 58 .dma_mask = &msp_usbhost_dma_mask,
59 .coherent_dma_mask = DMA_32BIT_MASK, 59 .coherent_dma_mask = DMA_32BIT_MASK,
60 }, 60 },
61 .num_resources = ARRAY_SIZE (msp_usbhost_resources), 61 .num_resources = ARRAY_SIZE(msp_usbhost_resources),
62 .resource = msp_usbhost_resources, 62 .resource = msp_usbhost_resources,
63}; 63};
64#endif /* CONFIG_USB_EHCI_HCD */ 64#endif /* CONFIG_USB_EHCI_HCD */
@@ -86,7 +86,7 @@ static struct platform_device msp_usbdev_device = {
86 .dma_mask = &msp_usbdev_dma_mask, 86 .dma_mask = &msp_usbdev_dma_mask,
87 .coherent_dma_mask = DMA_32BIT_MASK, 87 .coherent_dma_mask = DMA_32BIT_MASK,
88 }, 88 },
89 .num_resources = ARRAY_SIZE (msp_usbdev_resources), 89 .num_resources = ARRAY_SIZE(msp_usbdev_resources),
90 .resource = msp_usbdev_resources, 90 .resource = msp_usbdev_resources,
91}; 91};
92#endif /* CONFIG_USB_GADGET */ 92#endif /* CONFIG_USB_GADGET */
@@ -129,7 +129,7 @@ static int __init msp_usb_setup(void)
129 ppfinit("platform add USB HOST done %s.\n", 129 ppfinit("platform add USB HOST done %s.\n",
130 msp_devs[0]->name); 130 msp_devs[0]->name);
131 131
132 result = platform_add_devices(msp_devs, ARRAY_SIZE (msp_devs)); 132 result = platform_add_devices(msp_devs, ARRAY_SIZE(msp_devs));
133#endif /* CONFIG_USB_EHCI_HCD */ 133#endif /* CONFIG_USB_EHCI_HCD */
134 } 134 }
135#if defined(CONFIG_USB_GADGET) 135#if defined(CONFIG_USB_GADGET)
@@ -139,7 +139,7 @@ static int __init msp_usb_setup(void)
139 ppfinit("platform add USB DEVICE done %s.\n", 139 ppfinit("platform add USB DEVICE done %s.\n",
140 msp_devs[0]->name); 140 msp_devs[0]->name);
141 141
142 result = platform_add_devices(msp_devs, ARRAY_SIZE (msp_devs)); 142 result = platform_add_devices(msp_devs, ARRAY_SIZE(msp_devs));
143 } 143 }
144#endif /* CONFIG_USB_GADGET */ 144#endif /* CONFIG_USB_GADGET */
145#endif /* CONFIG_USB_EHCI_HCD || CONFIG_USB_GADGET */ 145#endif /* CONFIG_USB_EHCI_HCD || CONFIG_USB_GADGET */
diff --git a/arch/mips/pmc-sierra/yosemite/ht.c b/arch/mips/pmc-sierra/yosemite/ht.c
index 1f7c999eb7c6..6380662bbf3c 100644
--- a/arch/mips/pmc-sierra/yosemite/ht.c
+++ b/arch/mips/pmc-sierra/yosemite/ht.c
@@ -115,7 +115,7 @@ static int titan_ht_config_read_word(struct pci_dev *device,
115 115
116u32 longswap(unsigned long l) 116u32 longswap(unsigned long l)
117{ 117{
118 unsigned char b1,b2,b3,b4; 118 unsigned char b1, b2, b3, b4;
119 119
120 b1 = l&255; 120 b1 = l&255;
121 b2 = (l>>8)&255; 121 b2 = (l>>8)&255;
diff --git a/arch/mips/pmc-sierra/yosemite/prom.c b/arch/mips/pmc-sierra/yosemite/prom.c
index 0cd78f0f5f2d..9b9936de6589 100644
--- a/arch/mips/pmc-sierra/yosemite/prom.c
+++ b/arch/mips/pmc-sierra/yosemite/prom.c
@@ -126,7 +126,6 @@ void __init prom_init(void)
126 env++; 126 env++;
127 } 127 }
128 128
129 mips_machgroup = MACH_GROUP_TITAN;
130 mips_machtype = MACH_TITAN_YOSEMITE; 129 mips_machtype = MACH_TITAN_YOSEMITE;
131 130
132 prom_grab_secondary(); 131 prom_grab_secondary();
diff --git a/arch/mips/pmc-sierra/yosemite/setup.c b/arch/mips/pmc-sierra/yosemite/setup.c
index 58862c8d1d00..015fcc363dc0 100644
--- a/arch/mips/pmc-sierra/yosemite/setup.c
+++ b/arch/mips/pmc-sierra/yosemite/setup.c
@@ -70,7 +70,7 @@ void __init bus_error_init(void)
70} 70}
71 71
72 72
73unsigned long m48t37y_get_time(void) 73unsigned long read_persistent_clock(void)
74{ 74{
75 unsigned int year, month, day, hour, min, sec; 75 unsigned int year, month, day, hour, min, sec;
76 unsigned long flags; 76 unsigned long flags;
@@ -95,13 +95,17 @@ unsigned long m48t37y_get_time(void)
95 return mktime(year, month, day, hour, min, sec); 95 return mktime(year, month, day, hour, min, sec);
96} 96}
97 97
98int m48t37y_set_time(unsigned long sec) 98int rtc_mips_set_time(unsigned long tim)
99{ 99{
100 struct rtc_time tm; 100 struct rtc_time tm;
101 unsigned long flags; 101 unsigned long flags;
102 102
103 /* convert to a more useful format -- note months count from 0 */ 103 /*
104 to_tm(sec, &tm); 104 * Convert to a more useful format -- note months count from 0
105 * and years from 1900
106 */
107 rtc_time_to_tm(tim, &tm);
108 tm.tm_year += 1900;
105 tm.tm_mon += 1; 109 tm.tm_mon += 1;
106 110
107 spin_lock_irqsave(&rtc_lock, flags); 111 spin_lock_irqsave(&rtc_lock, flags);
@@ -138,7 +142,7 @@ void __init plat_timer_setup(struct irqaction *irq)
138 setup_irq(7, irq); 142 setup_irq(7, irq);
139} 143}
140 144
141void yosemite_time_init(void) 145void __init plat_time_init(void)
142{ 146{
143 mips_hpt_frequency = cpu_clock_freq / 2; 147 mips_hpt_frequency = cpu_clock_freq / 2;
144mips_hpt_frequency = 33000000 * 3 * 5; 148mips_hpt_frequency = 33000000 * 3 * 5;
@@ -198,17 +202,6 @@ static void __init py_rtc_setup(void)
198 m48t37_base = ioremap(YOSEMITE_RTC_BASE, YOSEMITE_RTC_SIZE); 202 m48t37_base = ioremap(YOSEMITE_RTC_BASE, YOSEMITE_RTC_SIZE);
199 if (!m48t37_base) 203 if (!m48t37_base)
200 printk(KERN_ERR "Mapping the RTC failed\n"); 204 printk(KERN_ERR "Mapping the RTC failed\n");
201
202 rtc_mips_get_time = m48t37y_get_time;
203 rtc_mips_set_time = m48t37y_set_time;
204
205 write_seqlock(&xtime_lock);
206 xtime.tv_sec = m48t37y_get_time();
207 xtime.tv_nsec = 0;
208
209 set_normalized_timespec(&wall_to_monotonic,
210 -xtime.tv_sec, -xtime.tv_nsec);
211 write_sequnlock(&xtime_lock);
212} 205}
213 206
214/* Not only time init but that's what the hook it's called through is named */ 207/* Not only time init but that's what the hook it's called through is named */
@@ -221,7 +214,6 @@ static void __init py_late_time_init(void)
221 214
222void __init plat_mem_setup(void) 215void __init plat_mem_setup(void)
223{ 216{
224 board_time_init = yosemite_time_init;
225 late_time_init = py_late_time_init; 217 late_time_init = py_late_time_init;
226 218
227 /* Add memory regions */ 219 /* Add memory regions */
diff --git a/arch/mips/qemu/q-firmware.c b/arch/mips/qemu/q-firmware.c
index fb2a8673a6bf..c2239b417587 100644
--- a/arch/mips/qemu/q-firmware.c
+++ b/arch/mips/qemu/q-firmware.c
@@ -10,7 +10,7 @@ void __init prom_init(void)
10 cmdline = (int *) (CKSEG0 + (0x10 << 20) - 260); 10 cmdline = (int *) (CKSEG0 + (0x10 << 20) - 260);
11 if (*cmdline == 0x12345678) { 11 if (*cmdline == 0x12345678) {
12 if (*(char *)(cmdline + 1)) 12 if (*(char *)(cmdline + 1))
13 strcpy (arcs_cmdline, (char *)(cmdline + 1)); 13 strcpy(arcs_cmdline, (char *)(cmdline + 1));
14 add_memory_region(0x0<<20, cmdline[-1], BOOT_MEM_RAM); 14 add_memory_region(0x0<<20, cmdline[-1], BOOT_MEM_RAM);
15 } else { 15 } else {
16 add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM); 16 add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM);
diff --git a/arch/mips/qemu/q-irq.c b/arch/mips/qemu/q-irq.c
index 89891e984b3b..4681757460a1 100644
--- a/arch/mips/qemu/q-irq.c
+++ b/arch/mips/qemu/q-irq.c
@@ -2,6 +2,7 @@
2#include <linux/linkage.h> 2#include <linux/linkage.h>
3 3
4#include <asm/i8259.h> 4#include <asm/i8259.h>
5#include <asm/irq_cpu.h>
5#include <asm/mipsregs.h> 6#include <asm/mipsregs.h>
6#include <asm/qemu.h> 7#include <asm/qemu.h>
7#include <asm/system.h> 8#include <asm/system.h>
@@ -12,7 +13,7 @@ asmlinkage void plat_irq_dispatch(void)
12 unsigned int pending = read_c0_status() & read_c0_cause(); 13 unsigned int pending = read_c0_status() & read_c0_cause();
13 14
14 if (pending & 0x8000) { 15 if (pending & 0x8000) {
15 ll_timer_interrupt(Q_COUNT_COMPARE_IRQ); 16 do_IRQ(Q_COUNT_COMPARE_IRQ);
16 return; 17 return;
17 } 18 }
18 if (pending & 0x0400) { 19 if (pending & 0x0400) {
@@ -29,6 +30,7 @@ void __init arch_init_irq(void)
29{ 30{
30 mips_hpt_frequency = QEMU_C0_COUNTER_CLOCK; /* 100MHz */ 31 mips_hpt_frequency = QEMU_C0_COUNTER_CLOCK; /* 100MHz */
31 32
33 mips_cpu_irq_init();
32 init_i8259_irqs(); 34 init_i8259_irqs();
33 set_c0_status(0x8400); 35 set_c0_status(0x8400);
34} 36}
diff --git a/arch/mips/qemu/q-setup.c b/arch/mips/qemu/q-setup.c
index 841394336f00..23d34c1917c0 100644
--- a/arch/mips/qemu/q-setup.c
+++ b/arch/mips/qemu/q-setup.c
@@ -1,4 +1,6 @@
1#include <linux/init.h> 1#include <linux/init.h>
2
3#include <asm/i8253.h>
2#include <asm/io.h> 4#include <asm/io.h>
3#include <asm/time.h> 5#include <asm/time.h>
4 6
@@ -11,13 +13,9 @@ const char *get_system_type(void)
11 return "Qemu"; 13 return "Qemu";
12} 14}
13 15
14void __init plat_timer_setup(struct irqaction *irq) 16void __init plat_time_init(void)
15{ 17{
16 /* set the clock to 100 Hz */ 18 setup_pit_timer();
17 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
18 outb_p(LATCH & 0xff , 0x40); /* LSB */
19 outb(LATCH >> 8 , 0x40); /* MSB */
20 setup_irq(0, irq);
21} 19}
22 20
23void __init plat_mem_setup(void) 21void __init plat_mem_setup(void)
diff --git a/arch/mips/sgi-ip22/ip22-eisa.c b/arch/mips/sgi-ip22/ip22-eisa.c
index 6b6e97b90c6e..26854fb11e7c 100644
--- a/arch/mips/sgi-ip22/ip22-eisa.c
+++ b/arch/mips/sgi-ip22/ip22-eisa.c
@@ -55,7 +55,7 @@ static char __init *decode_eisa_sig(unsigned long addr)
55 int i; 55 int i;
56 56
57 for (i = 0; i < 4; i++) { 57 for (i = 0; i < 4; i++) {
58 sig[i] = inb (addr + i); 58 sig[i] = inb(addr + i);
59 59
60 if (!i && (sig[0] & 0x80)) 60 if (!i && (sig[0] & 0x80))
61 return NULL; 61 return NULL;
diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c
index 18348321795d..f6d9bf4b26e7 100644
--- a/arch/mips/sgi-ip22/ip22-int.c
+++ b/arch/mips/sgi-ip22/ip22-int.c
@@ -20,10 +20,10 @@
20#include <asm/mipsregs.h> 20#include <asm/mipsregs.h>
21#include <asm/addrspace.h> 21#include <asm/addrspace.h>
22#include <asm/irq_cpu.h> 22#include <asm/irq_cpu.h>
23
24#include <asm/sgi/ioc.h> 23#include <asm/sgi/ioc.h>
25#include <asm/sgi/hpc3.h> 24#include <asm/sgi/hpc3.h>
26#include <asm/sgi/ip22.h> 25#include <asm/sgi/ip22.h>
26#include <asm/time.h>
27 27
28/* #define DEBUG_SGINT */ 28/* #define DEBUG_SGINT */
29 29
@@ -204,7 +204,6 @@ static struct irqaction map1_cascade = {
204#define SGI_INTERRUPTS SGINT_LOCAL3 204#define SGI_INTERRUPTS SGINT_LOCAL3
205#endif 205#endif
206 206
207extern void indy_r4k_timer_interrupt(void);
208extern void indy_8254timer_irq(void); 207extern void indy_8254timer_irq(void);
209 208
210/* 209/*
@@ -243,7 +242,7 @@ asmlinkage void plat_irq_dispatch(void)
243 * First we check for r4k counter/timer IRQ. 242 * First we check for r4k counter/timer IRQ.
244 */ 243 */
245 if (pending & CAUSEF_IP7) 244 if (pending & CAUSEF_IP7)
246 indy_r4k_timer_interrupt(); 245 do_IRQ(SGI_TIMER_IRQ);
247 else if (pending & CAUSEF_IP2) 246 else if (pending & CAUSEF_IP2)
248 indy_local0_irqdispatch(); 247 indy_local0_irqdispatch();
249 else if (pending & CAUSEF_IP3) 248 else if (pending & CAUSEF_IP3)
@@ -345,6 +344,6 @@ void __init arch_init_irq(void)
345 344
346#ifdef CONFIG_EISA 345#ifdef CONFIG_EISA
347 if (ip22_is_fullhouse()) /* Only Indigo-2 has EISA stuff */ 346 if (ip22_is_fullhouse()) /* Only Indigo-2 has EISA stuff */
348 ip22_eisa_init (); 347 ip22_eisa_init();
349#endif 348#endif
350} 349}
diff --git a/arch/mips/sgi-ip22/ip22-setup.c b/arch/mips/sgi-ip22/ip22-setup.c
index e7ce7982db72..174f09e42f6b 100644
--- a/arch/mips/sgi-ip22/ip22-setup.c
+++ b/arch/mips/sgi-ip22/ip22-setup.c
@@ -51,7 +51,6 @@ void ip22_do_break(void)
51EXPORT_SYMBOL(ip22_do_break); 51EXPORT_SYMBOL(ip22_do_break);
52 52
53extern void ip22_be_init(void) __init; 53extern void ip22_be_init(void) __init;
54extern void ip22_time_init(void) __init;
55 54
56void __init plat_mem_setup(void) 55void __init plat_mem_setup(void)
57{ 56{
@@ -59,7 +58,6 @@ void __init plat_mem_setup(void)
59 char *cserial; 58 char *cserial;
60 59
61 board_be_init = ip22_be_init; 60 board_be_init = ip22_be_init;
62 ip22_time_init();
63 61
64 /* Init the INDY HPC I/O controller. Need to call this before 62 /* Init the INDY HPC I/O controller. Need to call this before
65 * fucking with the memory controller because it needs to know the 63 * fucking with the memory controller because it needs to know the
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index de3d01823ad5..9b9bffd2e8fb 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -20,6 +20,7 @@
20 20
21#include <asm/cpu.h> 21#include <asm/cpu.h>
22#include <asm/mipsregs.h> 22#include <asm/mipsregs.h>
23#include <asm/i8253.h>
23#include <asm/io.h> 24#include <asm/io.h>
24#include <asm/irq.h> 25#include <asm/irq.h>
25#include <asm/time.h> 26#include <asm/time.h>
@@ -29,10 +30,10 @@
29#include <asm/sgi/ip22.h> 30#include <asm/sgi/ip22.h>
30 31
31/* 32/*
32 * note that mktime uses month from 1 to 12 while to_tm 33 * Note that mktime uses month from 1 to 12 while rtc_time_to_tm
33 * uses 0 to 11. 34 * uses 0 to 11.
34 */ 35 */
35static unsigned long indy_rtc_get_time(void) 36unsigned long read_persistent_clock(void)
36{ 37{
37 unsigned int yrs, mon, day, hrs, min, sec; 38 unsigned int yrs, mon, day, hrs, min, sec;
38 unsigned int save_control; 39 unsigned int save_control;
@@ -60,16 +61,16 @@ static unsigned long indy_rtc_get_time(void)
60 return mktime(yrs + 1900, mon, day, hrs, min, sec); 61 return mktime(yrs + 1900, mon, day, hrs, min, sec);
61} 62}
62 63
63static int indy_rtc_set_time(unsigned long tim) 64int rtc_mips_set_time(unsigned long tim)
64{ 65{
65 struct rtc_time tm; 66 struct rtc_time tm;
66 unsigned int save_control; 67 unsigned int save_control;
67 unsigned long flags; 68 unsigned long flags;
68 69
69 to_tm(tim, &tm); 70 rtc_time_to_tm(tim, &tm);
70 71
71 tm.tm_mon += 1; /* tm_mon starts at zero */ 72 tm.tm_mon += 1; /* tm_mon starts at zero */
72 tm.tm_year -= 1940; 73 tm.tm_year -= 40;
73 if (tm.tm_year >= 100) 74 if (tm.tm_year >= 100)
74 tm.tm_year -= 100; 75 tm.tm_year -= 100;
75 76
@@ -128,7 +129,7 @@ static unsigned long dosample(void)
128/* 129/*
129 * Here we need to calibrate the cycle counter to at least be close. 130 * Here we need to calibrate the cycle counter to at least be close.
130 */ 131 */
131static __init void indy_time_init(void) 132__init void plat_time_init(void)
132{ 133{
133 unsigned long r4k_ticks[3]; 134 unsigned long r4k_ticks[3];
134 unsigned long r4k_tick; 135 unsigned long r4k_tick;
@@ -172,6 +173,9 @@ static __init void indy_time_init(void)
172 (int) (r4k_tick % (500000 / HZ))); 173 (int) (r4k_tick % (500000 / HZ)));
173 174
174 mips_hpt_frequency = r4k_tick * HZ; 175 mips_hpt_frequency = r4k_tick * HZ;
176
177 if (ip22_is_fullhouse())
178 setup_pit_timer();
175} 179}
176 180
177/* Generic SGI handler for (spurious) 8254 interrupts */ 181/* Generic SGI handler for (spurious) 8254 interrupts */
@@ -189,16 +193,6 @@ void indy_8254timer_irq(void)
189 irq_exit(); 193 irq_exit();
190} 194}
191 195
192void indy_r4k_timer_interrupt(void)
193{
194 int irq = SGI_TIMER_IRQ;
195
196 irq_enter();
197 kstat_this_cpu.irqs[irq]++;
198 timer_interrupt(irq, NULL);
199 irq_exit();
200}
201
202void __init plat_timer_setup(struct irqaction *irq) 196void __init plat_timer_setup(struct irqaction *irq)
203{ 197{
204 /* over-write the handler, we use our own way */ 198 /* over-write the handler, we use our own way */
@@ -207,12 +201,3 @@ void __init plat_timer_setup(struct irqaction *irq)
207 /* setup irqaction */ 201 /* setup irqaction */
208 setup_irq(SGI_TIMER_IRQ, irq); 202 setup_irq(SGI_TIMER_IRQ, irq);
209} 203}
210
211void __init ip22_time_init(void)
212{
213 /* setup hookup functions */
214 rtc_mips_get_time = indy_rtc_get_time;
215 rtc_mips_set_time = indy_rtc_set_time;
216
217 board_time_init = indy_time_init;
218}
diff --git a/arch/mips/sgi-ip27/ip27-berr.c b/arch/mips/sgi-ip27/ip27-berr.c
index 123141ab21a2..7d05e68fdc77 100644
--- a/arch/mips/sgi-ip27/ip27-berr.c
+++ b/arch/mips/sgi-ip27/ip27-berr.c
@@ -21,8 +21,6 @@
21#include <asm/traps.h> 21#include <asm/traps.h>
22#include <asm/uaccess.h> 22#include <asm/uaccess.h>
23 23
24extern void dump_tlb_all(void);
25
26static void dump_hub_information(unsigned long errst0, unsigned long errst1) 24static void dump_hub_information(unsigned long errst0, unsigned long errst1)
27{ 25{
28 static char *err_type[2][8] = { 26 static char *err_type[2][8] = {
diff --git a/arch/mips/sgi-ip27/ip27-init.c b/arch/mips/sgi-ip27/ip27-init.c
index 74158d349630..681b593071cb 100644
--- a/arch/mips/sgi-ip27/ip27-init.c
+++ b/arch/mips/sgi-ip27/ip27-init.c
@@ -47,6 +47,9 @@ cnodeid_t cpuid_to_compact_node[MAXCPUS];
47 47
48EXPORT_SYMBOL(nasid_to_compact_node); 48EXPORT_SYMBOL(nasid_to_compact_node);
49 49
50struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
51EXPORT_SYMBOL_GPL(sn_cpu_info);
52
50extern void pcibr_setup(cnodeid_t); 53extern void pcibr_setup(cnodeid_t);
51 54
52extern void xtalk_probe_node(cnodeid_t nid); 55extern void xtalk_probe_node(cnodeid_t nid);
@@ -191,7 +194,6 @@ static inline void ioc3_eth_init(void)
191 ioc3->eier = 0; 194 ioc3->eier = 0;
192} 195}
193 196
194extern void ip27_time_init(void);
195extern void ip27_reboot_setup(void); 197extern void ip27_reboot_setup(void);
196 198
197void __init plat_mem_setup(void) 199void __init plat_mem_setup(void)
@@ -238,6 +240,4 @@ void __init plat_mem_setup(void)
238 per_cpu_init(); 240 per_cpu_init();
239 241
240 set_io_port_base(IO_BASE); 242 set_io_port_base(IO_BASE);
241
242 board_time_init = ip27_time_init;
243} 243}
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c
index fbb27728a76a..a70656d42191 100644
--- a/arch/mips/sgi-ip27/ip27-smp.c
+++ b/arch/mips/sgi-ip27/ip27-smp.c
@@ -33,7 +33,7 @@ static void alloc_cpupda(cpuid_t cpu, int cpunum)
33 nasid_t nasid = COMPACT_TO_NASID_NODEID(node); 33 nasid_t nasid = COMPACT_TO_NASID_NODEID(node);
34 34
35 cputonasid(cpunum) = nasid; 35 cputonasid(cpunum) = nasid;
36 cpu_data[cpunum].p_nodeid = node; 36 sn_cpu_info[cpunum].p_nodeid = node;
37 cputoslice(cpunum) = get_cpu_slice(cpu); 37 cputoslice(cpunum) = get_cpu_slice(cpu);
38} 38}
39 39
@@ -176,7 +176,7 @@ void __cpuinit prom_boot_secondary(int cpu, struct task_struct *idle)
176 unsigned long gp = (unsigned long)task_thread_info(idle); 176 unsigned long gp = (unsigned long)task_thread_info(idle);
177 unsigned long sp = __KSTK_TOS(idle); 177 unsigned long sp = __KSTK_TOS(idle);
178 178
179 LAUNCH_SLAVE(cputonasid(cpu),cputoslice(cpu), 179 LAUNCH_SLAVE(cputonasid(cpu), cputoslice(cpu),
180 (launch_proc_t)MAPPED_KERN_RW_TO_K0(smp_bootstrap), 180 (launch_proc_t)MAPPED_KERN_RW_TO_K0(smp_bootstrap),
181 0, (void *) sp, (void *) gp); 181 0, (void *) sp, (void *) gp);
182} 182}
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 8c3c78c63ccd..b7b3479b6bce 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -40,7 +40,6 @@
40#define TICK_SIZE (tick_nsec / 1000) 40#define TICK_SIZE (tick_nsec / 1000)
41 41
42static unsigned long ct_cur[NR_CPUS]; /* What counter should be at next timer irq */ 42static unsigned long ct_cur[NR_CPUS]; /* What counter should be at next timer irq */
43static long last_rtc_update; /* Last time the rtc clock got updated */
44 43
45#if 0 44#if 0
46static int set_rtc_mmss(unsigned long nowtime) 45static int set_rtc_mmss(unsigned long nowtime)
@@ -113,23 +112,6 @@ again:
113 112
114 update_process_times(user_mode(get_irq_regs())); 113 update_process_times(user_mode(get_irq_regs()));
115 114
116 /*
117 * If we have an externally synchronized Linux clock, then update
118 * RTC clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
119 * called as close as possible to when a second starts.
120 */
121 if (ntp_synced() &&
122 xtime.tv_sec > last_rtc_update + 660 &&
123 (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
124 (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
125 if (rtc_mips_set_time(xtime.tv_sec) == 0) {
126 last_rtc_update = xtime.tv_sec;
127 } else {
128 last_rtc_update = xtime.tv_sec - 600;
129 /* do it again in 60 s */
130 }
131 }
132
133 write_sequnlock(&xtime_lock); 115 write_sequnlock(&xtime_lock);
134 irq_exit(); 116 irq_exit();
135} 117}
@@ -141,7 +123,7 @@ again:
141#include <asm/sn/sn0/hubio.h> 123#include <asm/sn/sn0/hubio.h>
142#include <asm/pci/bridge.h> 124#include <asm/pci/bridge.h>
143 125
144static __init unsigned long get_m48t35_time(void) 126unsigned long read_persistent_clock(void)
145{ 127{
146 unsigned int year, month, date, hour, min, sec; 128 unsigned int year, month, date, hour, min, sec;
147 struct m48t35_rtc *rtc; 129 struct m48t35_rtc *rtc;
@@ -218,17 +200,23 @@ void __init plat_timer_setup(struct irqaction *irq)
218 setup_irq(irqno, &rt_irqaction); 200 setup_irq(irqno, &rt_irqaction);
219} 201}
220 202
221static cycle_t ip27_hpt_read(void) 203static cycle_t hub_rt_read(void)
222{ 204{
223 return REMOTE_HUB_L(cputonasid(0), PI_RT_COUNT); 205 return REMOTE_HUB_L(cputonasid(0), PI_RT_COUNT);
224} 206}
225 207
226void __init ip27_time_init(void) 208struct clocksource ht_rt_clocksource = {
209 .name = "HUB",
210 .rating = 200,
211 .read = hub_rt_read,
212 .mask = CLOCKSOURCE_MASK(52),
213 .shift = 32,
214 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
215};
216
217void __init plat_time_init(void)
227{ 218{
228 clocksource_mips.read = ip27_hpt_read; 219 clocksource_register(&ht_rt_clocksource);
229 mips_hpt_frequency = CYCLES_PER_SEC;
230 xtime.tv_sec = get_m48t35_time();
231 xtime.tv_nsec = 0;
232} 220}
233 221
234void __init cpu_time_init(void) 222void __init cpu_time_init(void)
diff --git a/arch/mips/sgi-ip32/crime.c b/arch/mips/sgi-ip32/crime.c
index bff508704d03..563c614ad021 100644
--- a/arch/mips/sgi-ip32/crime.c
+++ b/arch/mips/sgi-ip32/crime.c
@@ -35,8 +35,8 @@ void __init crime_init(void)
35 id = crime->id; 35 id = crime->id;
36 rev = id & CRIME_ID_REV; 36 rev = id & CRIME_ID_REV;
37 id = (id & CRIME_ID_IDBITS) >> 4; 37 id = (id & CRIME_ID_IDBITS) >> 4;
38 printk (KERN_INFO "CRIME id %1x rev %d at 0x%0*lx\n", 38 printk(KERN_INFO "CRIME id %1x rev %d at 0x%0*lx\n",
39 id, rev, field, (unsigned long) CRIME_BASE); 39 id, rev, field, (unsigned long) CRIME_BASE);
40} 40}
41 41
42irqreturn_t crime_memerr_intr(unsigned int irq, void *dev_id) 42irqreturn_t crime_memerr_intr(unsigned int irq, void *dev_id)
@@ -96,7 +96,7 @@ irqreturn_t crime_cpuerr_intr(unsigned int irq, void *dev_id)
96 unsigned long addr = crime->cpu_error_addr & CRIME_CPU_ERROR_ADDR_MASK; 96 unsigned long addr = crime->cpu_error_addr & CRIME_CPU_ERROR_ADDR_MASK;
97 97
98 addr <<= 2; 98 addr <<= 2;
99 printk ("CRIME CPU error at 0x%09lx status 0x%08lx\n", addr, stat); 99 printk("CRIME CPU error at 0x%09lx status 0x%08lx\n", addr, stat);
100 crime->cpu_error_stat = 0; 100 crime->cpu_error_stat = 0;
101 101
102 return IRQ_HANDLED; 102 return IRQ_HANDLED;
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index fb9da9acf53f..7f4b793c3df3 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -117,10 +117,18 @@ static void inline flush_mace_bus(void)
117extern irqreturn_t crime_memerr_intr(int irq, void *dev_id); 117extern irqreturn_t crime_memerr_intr(int irq, void *dev_id);
118extern irqreturn_t crime_cpuerr_intr(int irq, void *dev_id); 118extern irqreturn_t crime_cpuerr_intr(int irq, void *dev_id);
119 119
120struct irqaction memerr_irq = { crime_memerr_intr, IRQF_DISABLED, 120struct irqaction memerr_irq = {
121 CPU_MASK_NONE, "CRIME memory error", NULL, NULL }; 121 .handler = crime_memerr_intr,
122struct irqaction cpuerr_irq = { crime_cpuerr_intr, IRQF_DISABLED, 122 .flags = IRQF_DISABLED,
123 CPU_MASK_NONE, "CRIME CPU error", NULL, NULL }; 123 .mask = CPU_MASK_NONE,
124 .name = "CRIME memory error",
125};
126struct irqaction cpuerr_irq = {
127 .handler = crime_cpuerr_intr,
128 .flags = IRQF_DISABLED,
129 .mask = CPU_MASK_NONE,
130 .name = "CRIME CPU error",
131};
124 132
125/* 133/*
126 * For interrupts wired from a single device to the CPU. Only the clock 134 * For interrupts wired from a single device to the CPU. Only the clock
@@ -140,7 +148,7 @@ static void disable_cpu_irq(unsigned int irq)
140static void end_cpu_irq(unsigned int irq) 148static void end_cpu_irq(unsigned int irq)
141{ 149{
142 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 150 if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
143 enable_cpu_irq (irq); 151 enable_cpu_irq(irq);
144} 152}
145 153
146static struct irq_chip ip32_cpu_interrupt = { 154static struct irq_chip ip32_cpu_interrupt = {
@@ -281,11 +289,11 @@ static struct irq_chip ip32_macepci_interrupt = {
281 289
282static unsigned long maceisa_mask; 290static unsigned long maceisa_mask;
283 291
284static void enable_maceisa_irq (unsigned int irq) 292static void enable_maceisa_irq(unsigned int irq)
285{ 293{
286 unsigned int crime_int = 0; 294 unsigned int crime_int = 0;
287 295
288 DBG ("maceisa enable: %u\n", irq); 296 DBG("maceisa enable: %u\n", irq);
289 297
290 switch (irq) { 298 switch (irq) {
291 case MACEISA_AUDIO_SW_IRQ ... MACEISA_AUDIO3_MERR_IRQ: 299 case MACEISA_AUDIO_SW_IRQ ... MACEISA_AUDIO3_MERR_IRQ:
@@ -298,7 +306,7 @@ static void enable_maceisa_irq (unsigned int irq)
298 crime_int = MACE_SUPERIO_INT; 306 crime_int = MACE_SUPERIO_INT;
299 break; 307 break;
300 } 308 }
301 DBG ("crime_int %08x enabled\n", crime_int); 309 DBG("crime_int %08x enabled\n", crime_int);
302 crime_mask |= crime_int; 310 crime_mask |= crime_int;
303 crime->imask = crime_mask; 311 crime->imask = crime_mask;
304 maceisa_mask |= 1 << (irq - 33); 312 maceisa_mask |= 1 << (irq - 33);
@@ -389,15 +397,15 @@ static struct irq_chip ip32_mace_interrupt = {
389 397
390static void ip32_unknown_interrupt(void) 398static void ip32_unknown_interrupt(void)
391{ 399{
392 printk ("Unknown interrupt occurred!\n"); 400 printk("Unknown interrupt occurred!\n");
393 printk ("cp0_status: %08x\n", read_c0_status()); 401 printk("cp0_status: %08x\n", read_c0_status());
394 printk ("cp0_cause: %08x\n", read_c0_cause()); 402 printk("cp0_cause: %08x\n", read_c0_cause());
395 printk ("CRIME intr mask: %016lx\n", crime->imask); 403 printk("CRIME intr mask: %016lx\n", crime->imask);
396 printk ("CRIME intr status: %016lx\n", crime->istat); 404 printk("CRIME intr status: %016lx\n", crime->istat);
397 printk ("CRIME hardware intr register: %016lx\n", crime->hard_int); 405 printk("CRIME hardware intr register: %016lx\n", crime->hard_int);
398 printk ("MACE ISA intr mask: %08lx\n", mace->perif.ctrl.imask); 406 printk("MACE ISA intr mask: %08lx\n", mace->perif.ctrl.imask);
399 printk ("MACE ISA intr status: %08lx\n", mace->perif.ctrl.istat); 407 printk("MACE ISA intr status: %08lx\n", mace->perif.ctrl.istat);
400 printk ("MACE PCI control register: %08x\n", mace->pci.control); 408 printk("MACE PCI control register: %08x\n", mace->pci.control);
401 409
402 printk("Register dump:\n"); 410 printk("Register dump:\n");
403 show_regs(get_irq_regs()); 411 show_regs(get_irq_regs());
@@ -449,7 +457,7 @@ static void ip32_irq4(void)
449 457
450static void ip32_irq5(void) 458static void ip32_irq5(void)
451{ 459{
452 ll_timer_interrupt(IP32_R4K_TIMER_IRQ); 460 do_IRQ(IP32_R4K_TIMER_IRQ);
453} 461}
454 462
455asmlinkage void plat_irq_dispatch(void) 463asmlinkage void plat_irq_dispatch(void)
diff --git a/arch/mips/sgi-ip32/ip32-memory.c b/arch/mips/sgi-ip32/ip32-memory.c
index 849d392a0013..ca93ecf825ae 100644
--- a/arch/mips/sgi-ip32/ip32-memory.c
+++ b/arch/mips/sgi-ip32/ip32-memory.c
@@ -19,7 +19,7 @@
19 19
20extern void crime_init(void); 20extern void crime_init(void);
21 21
22void __init prom_meminit (void) 22void __init prom_meminit(void)
23{ 23{
24 u64 base, size; 24 u64 base, size;
25 int bank; 25 int bank;
@@ -38,7 +38,7 @@ void __init prom_meminit (void)
38 38
39 printk("CRIME MC: bank %u base 0x%016lx size %luMiB\n", 39 printk("CRIME MC: bank %u base 0x%016lx size %luMiB\n",
40 bank, base, size >> 20); 40 bank, base, size >> 20);
41 add_memory_region (base, size, BOOT_MEM_RAM); 41 add_memory_region(base, size, BOOT_MEM_RAM);
42 } 42 }
43} 43}
44 44
diff --git a/arch/mips/sgi-ip32/ip32-setup.c b/arch/mips/sgi-ip32/ip32-setup.c
index bbba066cb405..4125a5ba119e 100644
--- a/arch/mips/sgi-ip32/ip32-setup.c
+++ b/arch/mips/sgi-ip32/ip32-setup.c
@@ -62,10 +62,15 @@ static inline void str2eaddr(unsigned char *ea, unsigned char *str)
62} 62}
63#endif 63#endif
64 64
65unsigned long read_persistent_clock(void)
66{
67 return mc146818_get_cmos_time();
68}
69
65/* An arbitrary time; this can be decreased if reliability looks good */ 70/* An arbitrary time; this can be decreased if reliability looks good */
66#define WAIT_MS 10 71#define WAIT_MS 10
67 72
68void __init ip32_time_init(void) 73void __init plat_time_init(void)
69{ 74{
70 printk(KERN_INFO "Calibrating system timer... "); 75 printk(KERN_INFO "Calibrating system timer... ");
71 write_c0_count(0); 76 write_c0_count(0);
@@ -85,11 +90,6 @@ void __init plat_mem_setup(void)
85{ 90{
86 board_be_init = ip32_be_init; 91 board_be_init = ip32_be_init;
87 92
88 rtc_mips_get_time = mc146818_get_cmos_time;
89 rtc_mips_set_mmss = mc146818_set_rtc_mmss;
90
91 board_time_init = ip32_time_init;
92
93#ifdef CONFIG_SGI_O2MACE_ETH 93#ifdef CONFIG_SGI_O2MACE_ETH
94 { 94 {
95 char *mac = ArcGetEnvironmentVariable("eaddr"); 95 char *mac = ArcGetEnvironmentVariable("eaddr");
diff --git a/arch/mips/sibyte/Kconfig b/arch/mips/sibyte/Kconfig
index fdd7bd98fb44..e8fb880272bd 100644
--- a/arch/mips/sibyte/Kconfig
+++ b/arch/mips/sibyte/Kconfig
@@ -1,6 +1,7 @@
1config SIBYTE_SB1250 1config SIBYTE_SB1250
2 bool 2 bool
3 select HW_HAS_PCI 3 select HW_HAS_PCI
4 select IRQ_CPU
4 select SIBYTE_ENABLE_LDT_IF_PCI 5 select SIBYTE_ENABLE_LDT_IF_PCI
5 select SIBYTE_HAS_ZBUS_PROFILING 6 select SIBYTE_HAS_ZBUS_PROFILING
6 select SIBYTE_SB1xxx_SOC 7 select SIBYTE_SB1xxx_SOC
@@ -8,6 +9,7 @@ config SIBYTE_SB1250
8 9
9config SIBYTE_BCM1120 10config SIBYTE_BCM1120
10 bool 11 bool
12 select IRQ_CPU
11 select SIBYTE_BCM112X 13 select SIBYTE_BCM112X
12 select SIBYTE_HAS_ZBUS_PROFILING 14 select SIBYTE_HAS_ZBUS_PROFILING
13 select SIBYTE_SB1xxx_SOC 15 select SIBYTE_SB1xxx_SOC
@@ -15,6 +17,7 @@ config SIBYTE_BCM1120
15config SIBYTE_BCM1125 17config SIBYTE_BCM1125
16 bool 18 bool
17 select HW_HAS_PCI 19 select HW_HAS_PCI
20 select IRQ_CPU
18 select SIBYTE_BCM112X 21 select SIBYTE_BCM112X
19 select SIBYTE_HAS_ZBUS_PROFILING 22 select SIBYTE_HAS_ZBUS_PROFILING
20 select SIBYTE_SB1xxx_SOC 23 select SIBYTE_SB1xxx_SOC
@@ -22,6 +25,7 @@ config SIBYTE_BCM1125
22config SIBYTE_BCM1125H 25config SIBYTE_BCM1125H
23 bool 26 bool
24 select HW_HAS_PCI 27 select HW_HAS_PCI
28 select IRQ_CPU
25 select SIBYTE_BCM112X 29 select SIBYTE_BCM112X
26 select SIBYTE_ENABLE_LDT_IF_PCI 30 select SIBYTE_ENABLE_LDT_IF_PCI
27 select SIBYTE_HAS_ZBUS_PROFILING 31 select SIBYTE_HAS_ZBUS_PROFILING
@@ -29,12 +33,14 @@ config SIBYTE_BCM1125H
29 33
30config SIBYTE_BCM112X 34config SIBYTE_BCM112X
31 bool 35 bool
36 select IRQ_CPU
32 select SIBYTE_SB1xxx_SOC 37 select SIBYTE_SB1xxx_SOC
33 select SIBYTE_HAS_ZBUS_PROFILING 38 select SIBYTE_HAS_ZBUS_PROFILING
34 39
35config SIBYTE_BCM1x80 40config SIBYTE_BCM1x80
36 bool 41 bool
37 select HW_HAS_PCI 42 select HW_HAS_PCI
43 select IRQ_CPU
38 select SIBYTE_HAS_ZBUS_PROFILING 44 select SIBYTE_HAS_ZBUS_PROFILING
39 select SIBYTE_SB1xxx_SOC 45 select SIBYTE_SB1xxx_SOC
40 select SYS_SUPPORTS_SMP 46 select SYS_SUPPORTS_SMP
@@ -42,6 +48,7 @@ config SIBYTE_BCM1x80
42config SIBYTE_BCM1x55 48config SIBYTE_BCM1x55
43 bool 49 bool
44 select HW_HAS_PCI 50 select HW_HAS_PCI
51 select IRQ_CPU
45 select SIBYTE_SB1xxx_SOC 52 select SIBYTE_SB1xxx_SOC
46 select SIBYTE_HAS_ZBUS_PROFILING 53 select SIBYTE_HAS_ZBUS_PROFILING
47 select SYS_SUPPORTS_SMP 54 select SYS_SUPPORTS_SMP
@@ -49,6 +56,7 @@ config SIBYTE_BCM1x55
49config SIBYTE_SB1xxx_SOC 56config SIBYTE_SB1xxx_SOC
50 bool 57 bool
51 select DMA_COHERENT 58 select DMA_COHERENT
59 select IRQ_CPU
52 select SIBYTE_CFE 60 select SIBYTE_CFE
53 select SWAP_IO_SPACE 61 select SWAP_IO_SPACE
54 select SYS_SUPPORTS_32BIT_KERNEL 62 select SYS_SUPPORTS_32BIT_KERNEL
@@ -124,6 +132,7 @@ config SB1_CERR_STALL
124config SIBYTE_CFE 132config SIBYTE_CFE
125 bool "Booting from CFE" 133 bool "Booting from CFE"
126 depends on SIBYTE_SB1xxx_SOC 134 depends on SIBYTE_SB1xxx_SOC
135 select CFE
127 select SYS_HAS_EARLY_PRINTK 136 select SYS_HAS_EARLY_PRINTK
128 help 137 help
129 Make use of the CFE API for enumerating available memory, 138 Make use of the CFE API for enumerating available memory,
@@ -165,10 +174,6 @@ config SIBYTE_BW_TRACE
165 buffer activity. Raw buffer data is dumped to console, and 174 buffer activity. Raw buffer data is dumped to console, and
166 must be processed off-line. 175 must be processed off-line.
167 176
168config SIBYTE_SB1250_PROF
169 bool "Support for SB1/SOC profiling - SB1/SCD perf counters"
170 depends on SIBYTE_SB1xxx_SOC
171
172config SIBYTE_TBPROF 177config SIBYTE_TBPROF
173 tristate "Support for ZBbus profiling" 178 tristate "Support for ZBbus profiling"
174 depends on SIBYTE_HAS_ZBUS_PROFILING 179 depends on SIBYTE_HAS_ZBUS_PROFILING
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index e729b5f30264..7aa79bf63c4a 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -289,7 +289,7 @@ int bcm1480_steal_irq(int irq)
289 if (irq >= BCM1480_NR_IRQS) 289 if (irq >= BCM1480_NR_IRQS)
290 return -EINVAL; 290 return -EINVAL;
291 291
292 spin_lock_irqsave(&desc->lock,flags); 292 spin_lock_irqsave(&desc->lock, flags);
293 /* Don't allow sharing at all for these */ 293 /* Don't allow sharing at all for these */
294 if (desc->action != NULL) 294 if (desc->action != NULL)
295 retval = -EBUSY; 295 retval = -EBUSY;
@@ -297,7 +297,7 @@ int bcm1480_steal_irq(int irq)
297 desc->action = &bcm1480_dummy_action; 297 desc->action = &bcm1480_dummy_action;
298 desc->depth = 0; 298 desc->depth = 0;
299 } 299 }
300 spin_unlock_irqrestore(&desc->lock,flags); 300 spin_unlock_irqrestore(&desc->lock, flags);
301 return 0; 301 return 0;
302} 302}
303 303
@@ -431,8 +431,8 @@ void __init arch_init_irq(void)
431 431
432#include <linux/delay.h> 432#include <linux/delay.h>
433 433
434#define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg))) 434#define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
435#define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg))) 435#define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
436 436
437static void bcm1480_kgdb_interrupt(void) 437static void bcm1480_kgdb_interrupt(void)
438{ 438{
@@ -450,7 +450,6 @@ static void bcm1480_kgdb_interrupt(void)
450 450
451#endif /* CONFIG_KGDB */ 451#endif /* CONFIG_KGDB */
452 452
453extern void bcm1480_timer_interrupt(void);
454extern void bcm1480_mailbox_interrupt(void); 453extern void bcm1480_mailbox_interrupt(void);
455 454
456asmlinkage void plat_irq_dispatch(void) 455asmlinkage void plat_irq_dispatch(void)
@@ -470,8 +469,16 @@ asmlinkage void plat_irq_dispatch(void)
470 else 469 else
471#endif 470#endif
472 471
473 if (pending & CAUSEF_IP4) 472 if (pending & CAUSEF_IP4) {
474 bcm1480_timer_interrupt(); 473 int cpu = smp_processor_id();
474 int irq = K_BCM1480_INT_TIMER_0 + cpu;
475
476 /* Reset the timer */
477 __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS,
478 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
479
480 do_IRQ(irq);
481 }
475 482
476#ifdef CONFIG_SMP 483#ifdef CONFIG_SMP
477 else if (pending & CAUSEF_IP3) 484 else if (pending & CAUSEF_IP3)
diff --git a/arch/mips/sibyte/bcm1480/setup.c b/arch/mips/sibyte/bcm1480/setup.c
index 7e1aa348b8e0..05ed92c92b69 100644
--- a/arch/mips/sibyte/bcm1480/setup.c
+++ b/arch/mips/sibyte/bcm1480/setup.c
@@ -43,16 +43,49 @@ static unsigned int part_type;
43static char *soc_str; 43static char *soc_str;
44static char *pass_str; 44static char *pass_str;
45 45
46static inline int setup_bcm1x80_bcm1x55(void); 46static int __init setup_bcm1x80_bcm1x55(void)
47{
48 int ret = 0;
49
50 switch (soc_pass) {
51 case K_SYS_REVISION_BCM1480_S0:
52 periph_rev = 1;
53 pass_str = "S0 (pass1)";
54 break;
55 case K_SYS_REVISION_BCM1480_A1:
56 periph_rev = 1;
57 pass_str = "A1 (pass1)";
58 break;
59 case K_SYS_REVISION_BCM1480_A2:
60 periph_rev = 1;
61 pass_str = "A2 (pass1)";
62 break;
63 case K_SYS_REVISION_BCM1480_A3:
64 periph_rev = 1;
65 pass_str = "A3 (pass1)";
66 break;
67 case K_SYS_REVISION_BCM1480_B0:
68 periph_rev = 1;
69 pass_str = "B0 (pass2)";
70 break;
71 default:
72 printk("Unknown %s rev %x\n", soc_str, soc_pass);
73 periph_rev = 1;
74 pass_str = "Unknown Revision";
75 break;
76 }
77
78 return ret;
79}
47 80
48/* Setup code likely to be common to all SiByte platforms */ 81/* Setup code likely to be common to all SiByte platforms */
49 82
50static inline int sys_rev_decode(void) 83static int __init sys_rev_decode(void)
51{ 84{
52 int ret = 0; 85 int ret = 0;
53 86
54 switch (soc_type) { 87 switch (soc_type) {
55 case K_SYS_SOC_TYPE_BCM1x80: 88 case K_SYS_SOC_TYPE_BCM1x80:
56 if (part_type == K_SYS_PART_BCM1480) 89 if (part_type == K_SYS_PART_BCM1480)
57 soc_str = "BCM1480"; 90 soc_str = "BCM1480";
58 else if (part_type == K_SYS_PART_BCM1280) 91 else if (part_type == K_SYS_PART_BCM1280)
@@ -62,7 +95,7 @@ static inline int sys_rev_decode(void)
62 ret = setup_bcm1x80_bcm1x55(); 95 ret = setup_bcm1x80_bcm1x55();
63 break; 96 break;
64 97
65 case K_SYS_SOC_TYPE_BCM1x55: 98 case K_SYS_SOC_TYPE_BCM1x55:
66 if (part_type == K_SYS_PART_BCM1455) 99 if (part_type == K_SYS_PART_BCM1455)
67 soc_str = "BCM1455"; 100 soc_str = "BCM1455";
68 else if (part_type == K_SYS_PART_BCM1255) 101 else if (part_type == K_SYS_PART_BCM1255)
@@ -72,49 +105,16 @@ static inline int sys_rev_decode(void)
72 ret = setup_bcm1x80_bcm1x55(); 105 ret = setup_bcm1x80_bcm1x55();
73 break; 106 break;
74 107
75 default: 108 default:
76 printk("Unknown part type %x\n", part_type); 109 printk("Unknown part type %x\n", part_type);
77 ret = 1; 110 ret = 1;
78 break; 111 break;
79 } 112 }
80 return ret;
81}
82 113
83static inline int setup_bcm1x80_bcm1x55(void)
84{
85 int ret = 0;
86
87 switch (soc_pass) {
88 case K_SYS_REVISION_BCM1480_S0:
89 periph_rev = 1;
90 pass_str = "S0 (pass1)";
91 break;
92 case K_SYS_REVISION_BCM1480_A1:
93 periph_rev = 1;
94 pass_str = "A1 (pass1)";
95 break;
96 case K_SYS_REVISION_BCM1480_A2:
97 periph_rev = 1;
98 pass_str = "A2 (pass1)";
99 break;
100 case K_SYS_REVISION_BCM1480_A3:
101 periph_rev = 1;
102 pass_str = "A3 (pass1)";
103 break;
104 case K_SYS_REVISION_BCM1480_B0:
105 periph_rev = 1;
106 pass_str = "B0 (pass2)";
107 break;
108 default:
109 printk("Unknown %s rev %x\n", soc_str, soc_pass);
110 periph_rev = 1;
111 pass_str = "Unknown Revision";
112 break;
113 }
114 return ret; 114 return ret;
115} 115}
116 116
117void bcm1480_setup(void) 117void __init bcm1480_setup(void)
118{ 118{
119 uint64_t sys_rev; 119 uint64_t sys_rev;
120 int plldiv; 120 int plldiv;
diff --git a/arch/mips/sibyte/bcm1480/time.c b/arch/mips/sibyte/bcm1480/time.c
index 6f3f71bf4244..40d7126cd5bf 100644
--- a/arch/mips/sibyte/bcm1480/time.c
+++ b/arch/mips/sibyte/bcm1480/time.c
@@ -25,6 +25,7 @@
25 * code to do general bookkeeping (e.g. update jiffies, run 25 * code to do general bookkeeping (e.g. update jiffies, run
26 * bottom halves, etc.) 26 * bottom halves, etc.)
27 */ 27 */
28#include <linux/clockchips.h>
28#include <linux/interrupt.h> 29#include <linux/interrupt.h>
29#include <linux/sched.h> 30#include <linux/sched.h>
30#include <linux/spinlock.h> 31#include <linux/spinlock.h>
@@ -55,15 +56,12 @@
55 56
56extern int bcm1480_steal_irq(int irq); 57extern int bcm1480_steal_irq(int irq);
57 58
58void bcm1480_time_init(void) 59void __init plat_time_init(void)
59{ 60{
60 int cpu = smp_processor_id(); 61 unsigned int cpu = smp_processor_id();
61 int irq = K_BCM1480_INT_TIMER_0+cpu; 62 unsigned int irq = K_BCM1480_INT_TIMER_0 + cpu;
62 63
63 /* Only have 4 general purpose timers */ 64 BUG_ON(cpu > 3); /* Only have 4 general purpose timers */
64 if (cpu > 3) {
65 BUG();
66 }
67 65
68 bcm1480_mask_irq(cpu, irq); 66 bcm1480_mask_irq(cpu, irq);
69 67
@@ -71,27 +69,83 @@ void bcm1480_time_init(void)
71 __raw_writeq(IMR_IP4_VAL, IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) 69 __raw_writeq(IMR_IP4_VAL, IOADDR(A_BCM1480_IMR_REGISTER(cpu, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H)
72 + (irq<<3))); 70 + (irq<<3)));
73 71
74 /* the general purpose timer ticks at 1 Mhz independent of the rest of the system */ 72 bcm1480_unmask_irq(cpu, irq);
75 /* Disable the timer and set up the count */ 73 bcm1480_steal_irq(irq);
76 __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); 74}
77 __raw_writeq( 75
78 BCM1480_HPT_VALUE/HZ 76/*
79 , IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT))); 77 * The general purpose timer ticks at 1 Mhz independent if
78 * the rest of the system
79 */
80static void sibyte_set_mode(enum clock_event_mode mode,
81 struct clock_event_device *evt)
82{
83 unsigned int cpu = smp_processor_id();
84 void __iomem *timer_cfg, *timer_init;
85
86 timer_cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
87 timer_init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
88
89 switch (mode) {
90 case CLOCK_EVT_MODE_PERIODIC:
91 __raw_writeq(0, timer_cfg);
92 __raw_writeq(BCM1480_HPT_VALUE / HZ - 1, timer_init);
93 __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
94 timer_cfg);
95 break;
96
97 case CLOCK_EVT_MODE_ONESHOT:
98 /* Stop the timer until we actually program a shot */
99 case CLOCK_EVT_MODE_SHUTDOWN:
100 __raw_writeq(0, timer_cfg);
101 break;
102
103 case CLOCK_EVT_MODE_UNUSED: /* shuddup gcc */
104 ;
105 }
106}
107
108struct clock_event_device sibyte_hpt_clockevent = {
109 .name = "bcm1480-counter",
110 .features = CLOCK_EVT_FEAT_PERIODIC,
111 .set_mode = sibyte_set_mode,
112 .shift = 32,
113 .irq = 0,
114};
115
116static irqreturn_t sibyte_counter_handler(int irq, void *dev_id)
117{
118 struct clock_event_device *cd = &sibyte_hpt_clockevent;
119 unsigned int cpu = smp_processor_id();
80 120
81 /* Set the timer running */ 121 /* Reset the timer */
82 __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS, 122 __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS,
83 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); 123 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
124 cd->event_handler(cd);
84 125
85 bcm1480_unmask_irq(cpu, irq); 126 return IRQ_HANDLED;
86 bcm1480_steal_irq(irq); 127}
87 /* 128
88 * This interrupt is "special" in that it doesn't use the request_irq 129static struct irqaction sibyte_counter_irqaction = {
89 * way to hook the irq line. The timer interrupt is initialized early 130 .handler = sibyte_counter_handler,
90 * enough to make this a major pain, and it's also firing enough to 131 .flags = IRQF_DISABLED | IRQF_PERCPU,
91 * warrant a bit of special case code. bcm1480_timer_interrupt is 132 .name = "timer",
92 * called directly from irq_handler.S when IP[4] is set during an 133};
93 * interrupt 134
94 */ 135/*
136 * This interrupt is "special" in that it doesn't use the request_irq
137 * way to hook the irq line. The timer interrupt is initialized early
138 * enough to make this a major pain, and it's also firing enough to
139 * warrant a bit of special case code. bcm1480_timer_interrupt is
140 * called directly from irq_handler.S when IP[4] is set during an
141 * interrupt
142 */
143static void __init sb1480_clockevent_init(void)
144{
145 unsigned int cpu = smp_processor_id();
146 unsigned int irq = K_BCM1480_INT_TIMER_0 + cpu;
147
148 setup_irq(irq, &sibyte_counter_irqaction);
95} 149}
96 150
97void bcm1480_timer_interrupt(void) 151void bcm1480_timer_interrupt(void)
@@ -103,18 +157,7 @@ void bcm1480_timer_interrupt(void)
103 __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS, 157 __raw_writeq(M_SCD_TIMER_ENABLE|M_SCD_TIMER_MODE_CONTINUOUS,
104 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG))); 158 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
105 159
106 if (cpu == 0) { 160 ll_timer_interrupt(irq);
107 /*
108 * CPU 0 handles the global timer interrupt job
109 */
110 ll_timer_interrupt(irq);
111 }
112 else {
113 /*
114 * other CPUs should just do profiling and process accounting
115 */
116 ll_local_timer_interrupt(irq);
117 }
118} 161}
119 162
120static cycle_t bcm1480_hpt_read(void) 163static cycle_t bcm1480_hpt_read(void)
@@ -129,4 +172,5 @@ void __init bcm1480_hpt_setup(void)
129{ 172{
130 clocksource_mips.read = bcm1480_hpt_read; 173 clocksource_mips.read = bcm1480_hpt_read;
131 mips_hpt_frequency = BCM1480_HPT_VALUE; 174 mips_hpt_frequency = BCM1480_HPT_VALUE;
175 sb1480_clockevent_init();
132} 176}
diff --git a/arch/mips/sibyte/cfe/Makefile b/arch/mips/sibyte/cfe/Makefile
index 059d84a1d8a8..a1214937b705 100644
--- a/arch/mips/sibyte/cfe/Makefile
+++ b/arch/mips/sibyte/cfe/Makefile
@@ -1,3 +1,3 @@
1lib-y = cfe_api.o setup.o 1lib-y = setup.o
2lib-$(CONFIG_SMP) += smp.o 2lib-$(CONFIG_SMP) += smp.o
3lib-$(CONFIG_SIBYTE_CFE_CONSOLE) += console.o 3lib-$(CONFIG_SIBYTE_CFE_CONSOLE) += console.o
diff --git a/arch/mips/sibyte/cfe/cfe_api.h b/arch/mips/sibyte/cfe/cfe_api.h
deleted file mode 100644
index d8230cc53b81..000000000000
--- a/arch/mips/sibyte/cfe/cfe_api.h
+++ /dev/null
@@ -1,185 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001, 2002 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19/* *********************************************************************
20 *
21 * Broadcom Common Firmware Environment (CFE)
22 *
23 * Device function prototypes File: cfe_api.h
24 *
25 * This file contains declarations for doing callbacks to
26 * cfe from an application. It should be the only header
27 * needed by the application to use this library
28 *
29 * Authors: Mitch Lichtenberg, Chris Demetriou
30 *
31 ********************************************************************* */
32
33#ifndef CFE_API_H
34#define CFE_API_H
35
36/*
37 * Apply customizations here for different OSes. These need to:
38 * * typedef uint64_t, int64_t, intptr_t, uintptr_t.
39 * * define cfe_strlen() if use of an existing function is desired.
40 * * define CFE_API_IMPL_NAMESPACE if API functions are to use
41 * names in the implementation namespace.
42 * Also, optionally, if the build environment does not do so automatically,
43 * CFE_API_* can be defined here as desired.
44 */
45/* Begin customization. */
46#include <linux/types.h>
47#include <linux/string.h>
48
49typedef long intptr_t;
50
51#define cfe_strlen strlen
52
53#define CFE_API_ALL
54#define CFE_API_STRLEN_CUSTOM
55/* End customization. */
56
57
58/* *********************************************************************
59 * Constants
60 ********************************************************************* */
61
62/* Seal indicating CFE's presence, passed to user program. */
63#define CFE_EPTSEAL 0x43464531
64
65#define CFE_MI_RESERVED 0 /* memory is reserved, do not use */
66#define CFE_MI_AVAILABLE 1 /* memory is available */
67
68#define CFE_FLG_WARMSTART 0x00000001
69#define CFE_FLG_FULL_ARENA 0x00000001
70#define CFE_FLG_ENV_PERMANENT 0x00000001
71
72#define CFE_CPU_CMD_START 1
73#define CFE_CPU_CMD_STOP 0
74
75#define CFE_STDHANDLE_CONSOLE 0
76
77#define CFE_DEV_NETWORK 1
78#define CFE_DEV_DISK 2
79#define CFE_DEV_FLASH 3
80#define CFE_DEV_SERIAL 4
81#define CFE_DEV_CPU 5
82#define CFE_DEV_NVRAM 6
83#define CFE_DEV_CLOCK 7
84#define CFE_DEV_OTHER 8
85#define CFE_DEV_MASK 0x0F
86
87#define CFE_CACHE_FLUSH_D 1
88#define CFE_CACHE_INVAL_I 2
89#define CFE_CACHE_INVAL_D 4
90#define CFE_CACHE_INVAL_L2 8
91
92#define CFE_FWI_64BIT 0x00000001
93#define CFE_FWI_32BIT 0x00000002
94#define CFE_FWI_RELOC 0x00000004
95#define CFE_FWI_UNCACHED 0x00000008
96#define CFE_FWI_MULTICPU 0x00000010
97#define CFE_FWI_FUNCSIM 0x00000020
98#define CFE_FWI_RTLSIM 0x00000040
99
100typedef struct {
101 int64_t fwi_version; /* major, minor, eco version */
102 int64_t fwi_totalmem; /* total installed mem */
103 int64_t fwi_flags; /* various flags */
104 int64_t fwi_boardid; /* board ID */
105 int64_t fwi_bootarea_va; /* VA of boot area */
106 int64_t fwi_bootarea_pa; /* PA of boot area */
107 int64_t fwi_bootarea_size; /* size of boot area */
108} cfe_fwinfo_t;
109
110
111/*
112 * cfe_strlen is handled specially: If already defined, it has been
113 * overridden in this environment with a standard strlen-like function.
114 */
115#ifdef cfe_strlen
116# define CFE_API_STRLEN_CUSTOM
117#else
118# ifdef CFE_API_IMPL_NAMESPACE
119# define cfe_strlen(a) __cfe_strlen(a)
120# endif
121int cfe_strlen(char *name);
122#endif
123
124/*
125 * Defines and prototypes for functions which take no arguments.
126 */
127#ifdef CFE_API_IMPL_NAMESPACE
128int64_t __cfe_getticks(void);
129#define cfe_getticks() __cfe_getticks()
130#else
131int64_t cfe_getticks(void);
132#endif
133
134/*
135 * Defines and prototypes for the rest of the functions.
136 */
137#ifdef CFE_API_IMPL_NAMESPACE
138#define cfe_close(a) __cfe_close(a)
139#define cfe_cpu_start(a,b,c,d,e) __cfe_cpu_start(a,b,c,d,e)
140#define cfe_cpu_stop(a) __cfe_cpu_stop(a)
141#define cfe_enumenv(a,b,d,e,f) __cfe_enumenv(a,b,d,e,f)
142#define cfe_enummem(a,b,c,d,e) __cfe_enummem(a,b,c,d,e)
143#define cfe_exit(a,b) __cfe_exit(a,b)
144#define cfe_flushcache(a) __cfe_cacheflush(a)
145#define cfe_getdevinfo(a) __cfe_getdevinfo(a)
146#define cfe_getenv(a,b,c) __cfe_getenv(a,b,c)
147#define cfe_getfwinfo(a) __cfe_getfwinfo(a)
148#define cfe_getstdhandle(a) __cfe_getstdhandle(a)
149#define cfe_init(a,b) __cfe_init(a,b)
150#define cfe_inpstat(a) __cfe_inpstat(a)
151#define cfe_ioctl(a,b,c,d,e,f) __cfe_ioctl(a,b,c,d,e,f)
152#define cfe_open(a) __cfe_open(a)
153#define cfe_read(a,b,c) __cfe_read(a,b,c)
154#define cfe_readblk(a,b,c,d) __cfe_readblk(a,b,c,d)
155#define cfe_setenv(a,b) __cfe_setenv(a,b)
156#define cfe_write(a,b,c) __cfe_write(a,b,c)
157#define cfe_writeblk(a,b,c,d) __cfe_writeblk(a,b,c,d)
158#endif /* CFE_API_IMPL_NAMESPACE */
159
160int cfe_close(int handle);
161int cfe_cpu_start(int cpu, void (*fn) (void), long sp, long gp, long a1);
162int cfe_cpu_stop(int cpu);
163int cfe_enumenv(int idx, char *name, int namelen, char *val, int vallen);
164int cfe_enummem(int idx, int flags, uint64_t * start, uint64_t * length,
165 uint64_t * type);
166int cfe_exit(int warm, int status);
167int cfe_flushcache(int flg);
168int cfe_getdevinfo(char *name);
169int cfe_getenv(char *name, char *dest, int destlen);
170int cfe_getfwinfo(cfe_fwinfo_t * info);
171int cfe_getstdhandle(int flg);
172int cfe_init(uint64_t handle, uint64_t ept);
173int cfe_inpstat(int handle);
174int cfe_ioctl(int handle, unsigned int ioctlnum, unsigned char *buffer,
175 int length, int *retlen, uint64_t offset);
176int cfe_open(char *name);
177int cfe_read(int handle, unsigned char *buffer, int length);
178int cfe_readblk(int handle, int64_t offset, unsigned char *buffer,
179 int length);
180int cfe_setenv(char *name, char *val);
181int cfe_write(int handle, unsigned char *buffer, int length);
182int cfe_writeblk(int handle, int64_t offset, unsigned char *buffer,
183 int length);
184
185#endif /* CFE_API_H */
diff --git a/arch/mips/sibyte/cfe/cfe_error.h b/arch/mips/sibyte/cfe/cfe_error.h
deleted file mode 100644
index 975f00002cbe..000000000000
--- a/arch/mips/sibyte/cfe/cfe_error.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Copyright (C) 2000, 2001, 2002 Broadcom Corporation
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19/* *********************************************************************
20 *
21 * Broadcom Common Firmware Environment (CFE)
22 *
23 * Error codes File: cfe_error.h
24 *
25 * CFE's global error code list is here.
26 *
27 * Author: Mitch Lichtenberg
28 *
29 ********************************************************************* */
30
31
32#define CFE_OK 0
33#define CFE_ERR -1 /* generic error */
34#define CFE_ERR_INV_COMMAND -2
35#define CFE_ERR_EOF -3
36#define CFE_ERR_IOERR -4
37#define CFE_ERR_NOMEM -5
38#define CFE_ERR_DEVNOTFOUND -6
39#define CFE_ERR_DEVOPEN -7
40#define CFE_ERR_INV_PARAM -8
41#define CFE_ERR_ENVNOTFOUND -9
42#define CFE_ERR_ENVREADONLY -10
43
44#define CFE_ERR_NOTELF -11
45#define CFE_ERR_NOT32BIT -12
46#define CFE_ERR_WRONGENDIAN -13
47#define CFE_ERR_BADELFVERS -14
48#define CFE_ERR_NOTMIPS -15
49#define CFE_ERR_BADELFFMT -16
50#define CFE_ERR_BADADDR -17
51
52#define CFE_ERR_FILENOTFOUND -18
53#define CFE_ERR_UNSUPPORTED -19
54
55#define CFE_ERR_HOSTUNKNOWN -20
56
57#define CFE_ERR_TIMEOUT -21
58
59#define CFE_ERR_PROTOCOLERR -22
60
61#define CFE_ERR_NETDOWN -23
62#define CFE_ERR_NONAMESERVER -24
63
64#define CFE_ERR_NOHANDLES -25
65#define CFE_ERR_ALREADYBOUND -26
66
67#define CFE_ERR_CANNOTSET -27
68#define CFE_ERR_NOMORE -28
69#define CFE_ERR_BADFILESYS -29
70#define CFE_ERR_FSNOTAVAIL -30
71
72#define CFE_ERR_INVBOOTBLOCK -31
73#define CFE_ERR_WRONGDEVTYPE -32
74#define CFE_ERR_BBCHECKSUM -33
75#define CFE_ERR_BOOTPROGCHKSUM -34
76
77#define CFE_ERR_LDRNOTAVAIL -35
78
79#define CFE_ERR_NOTREADY -36
80
81#define CFE_ERR_GETMEM -37
82#define CFE_ERR_SETMEM -38
83
84#define CFE_ERR_NOTCONN -39
85#define CFE_ERR_ADDRINUSE -40
diff --git a/arch/mips/sibyte/cfe/console.c b/arch/mips/sibyte/cfe/console.c
index 4cec9d798d2f..81e3d54376e9 100644
--- a/arch/mips/sibyte/cfe/console.c
+++ b/arch/mips/sibyte/cfe/console.c
@@ -4,8 +4,8 @@
4 4
5#include <asm/sibyte/board.h> 5#include <asm/sibyte/board.h>
6 6
7#include "cfe_api.h" 7#include <asm/fw/cfe/cfe_api.h>
8#include "cfe_error.h" 8#include <asm/fw/cfe/cfe_error.h>
9 9
10extern int cfe_cons_handle; 10extern int cfe_cons_handle;
11 11
@@ -14,7 +14,7 @@ static void cfe_console_write(struct console *cons, const char *str,
14{ 14{
15 int i, last, written; 15 int i, last, written;
16 16
17 for (i=0,last=0; i<count; i++) { 17 for (i=0, last=0; i<count; i++) {
18 if (!str[i]) 18 if (!str[i])
19 /* XXXKW can/should this ever happen? */ 19 /* XXXKW can/should this ever happen? */
20 return; 20 return;
diff --git a/arch/mips/sibyte/cfe/setup.c b/arch/mips/sibyte/cfe/setup.c
index 51898dd1304a..dbd6e6fdd3f9 100644
--- a/arch/mips/sibyte/cfe/setup.c
+++ b/arch/mips/sibyte/cfe/setup.c
@@ -29,8 +29,8 @@
29#include <asm/reboot.h> 29#include <asm/reboot.h>
30#include <asm/sibyte/board.h> 30#include <asm/sibyte/board.h>
31 31
32#include "cfe_api.h" 32#include <asm/fw/cfe/cfe_api.h>
33#include "cfe_error.h" 33#include <asm/fw/cfe/cfe_error.h>
34 34
35/* Max ram addressable in 32-bit segments */ 35/* Max ram addressable in 32-bit segments */
36#ifdef CONFIG_64BIT 36#ifdef CONFIG_64BIT
@@ -309,7 +309,7 @@ void __init prom_init(void)
309 } 309 }
310 310
311#ifdef CONFIG_KGDB 311#ifdef CONFIG_KGDB
312 if ((arg = strstr(arcs_cmdline,"kgdb=duart")) != NULL) 312 if ((arg = strstr(arcs_cmdline, "kgdb=duart")) != NULL)
313 kgdb_port = (arg[10] == '0') ? 0 : 1; 313 kgdb_port = (arg[10] == '0') ? 0 : 1;
314 else 314 else
315 kgdb_port = 1; 315 kgdb_port = 1;
@@ -339,7 +339,6 @@ void __init prom_init(void)
339 /* Not sure this is needed, but it's the safe way. */ 339 /* Not sure this is needed, but it's the safe way. */
340 arcs_cmdline[CL_SIZE-1] = 0; 340 arcs_cmdline[CL_SIZE-1] = 0;
341 341
342 mips_machgroup = MACH_GROUP_SIBYTE;
343 prom_meminit(); 342 prom_meminit();
344} 343}
345 344
diff --git a/arch/mips/sibyte/cfe/smp.c b/arch/mips/sibyte/cfe/smp.c
index 5de4cff9d14a..534a62912f21 100644
--- a/arch/mips/sibyte/cfe/smp.c
+++ b/arch/mips/sibyte/cfe/smp.c
@@ -21,8 +21,8 @@
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <asm/processor.h> 22#include <asm/processor.h>
23 23
24#include "cfe_api.h" 24#include <asm/fw/cfe/cfe_api.h>
25#include "cfe_error.h" 25#include <asm/fw/cfe/cfe_error.h>
26 26
27/* 27/*
28 * Use CFE to find out how many CPUs are available, setting up 28 * Use CFE to find out how many CPUs are available, setting up
diff --git a/arch/mips/sibyte/common/Makefile b/arch/mips/sibyte/common/Makefile
index f8ae30066a05..48a91b9e5870 100644
--- a/arch/mips/sibyte/common/Makefile
+++ b/arch/mips/sibyte/common/Makefile
@@ -2,5 +2,4 @@ obj-y :=
2 2
3obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o 3obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o
4 4
5EXTRA_AFLAGS := $(CFLAGS)
6EXTRA_CFLAGS += -Werror 5EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
index 4fcdaa8ba514..63b444eaf01e 100644
--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -276,8 +276,8 @@ static int sbprof_zbprof_start(struct file *filp)
276 sbp.next_tb_sample = 0; 276 sbp.next_tb_sample = 0;
277 filp->f_pos = 0; 277 filp->f_pos = 0;
278 278
279 err = request_irq (K_INT_TRACE_FREEZE, sbprof_tb_intr, 0, 279 err = request_irq(K_INT_TRACE_FREEZE, sbprof_tb_intr, 0,
280 DEVNAME " trace freeze", &sbp); 280 DEVNAME " trace freeze", &sbp);
281 if (err) 281 if (err)
282 return -EBUSY; 282 return -EBUSY;
283 283
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index ad593a6c20be..7659174819c6 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -28,6 +28,7 @@
28#include <asm/errno.h> 28#include <asm/errno.h>
29#include <asm/signal.h> 29#include <asm/signal.h>
30#include <asm/system.h> 30#include <asm/system.h>
31#include <asm/time.h>
31#include <asm/io.h> 32#include <asm/io.h>
32 33
33#include <asm/sibyte/sb1250_regs.h> 34#include <asm/sibyte/sb1250_regs.h>
@@ -258,7 +259,7 @@ int sb1250_steal_irq(int irq)
258 if (irq >= SB1250_NR_IRQS) 259 if (irq >= SB1250_NR_IRQS)
259 return -EINVAL; 260 return -EINVAL;
260 261
261 spin_lock_irqsave(&desc->lock,flags); 262 spin_lock_irqsave(&desc->lock, flags);
262 /* Don't allow sharing at all for these */ 263 /* Don't allow sharing at all for these */
263 if (desc->action != NULL) 264 if (desc->action != NULL)
264 retval = -EBUSY; 265 retval = -EBUSY;
@@ -266,7 +267,7 @@ int sb1250_steal_irq(int irq)
266 desc->action = &sb1250_dummy_action; 267 desc->action = &sb1250_dummy_action;
267 desc->depth = 0; 268 desc->depth = 0;
268 } 269 }
269 spin_unlock_irqrestore(&desc->lock,flags); 270 spin_unlock_irqrestore(&desc->lock, flags);
270 return 0; 271 return 0;
271} 272}
272 273
@@ -380,8 +381,8 @@ void __init arch_init_irq(void)
380 381
381#include <linux/delay.h> 382#include <linux/delay.h>
382 383
383#define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg))) 384#define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
384#define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg))) 385#define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
385 386
386static void sb1250_kgdb_interrupt(void) 387static void sb1250_kgdb_interrupt(void)
387{ 388{
@@ -399,18 +400,45 @@ static void sb1250_kgdb_interrupt(void)
399 400
400#endif /* CONFIG_KGDB */ 401#endif /* CONFIG_KGDB */
401 402
402extern void sb1250_timer_interrupt(void); 403static inline void sb1250_timer_interrupt(void)
404{
405 int cpu = smp_processor_id();
406 int irq = K_INT_TIMER_0 + cpu;
407
408 irq_enter();
409 kstat_this_cpu.irqs[irq]++;
410
411 write_seqlock(&xtime_lock);
412
413 /* ACK interrupt */
414 ____raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
415 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
416
417 /*
418 * call the generic timer interrupt handling
419 */
420 do_timer(1);
421
422 write_sequnlock(&xtime_lock);
423
424 /*
425 * In UP mode, we call local_timer_interrupt() to do profiling
426 * and process accouting.
427 *
428 * In SMP mode, local_timer_interrupt() is invoked by appropriate
429 * low-level local timer interrupt handler.
430 */
431 local_timer_interrupt(irq);
432
433 irq_exit();
434}
435
403extern void sb1250_mailbox_interrupt(void); 436extern void sb1250_mailbox_interrupt(void);
404 437
405asmlinkage void plat_irq_dispatch(void) 438asmlinkage void plat_irq_dispatch(void)
406{ 439{
407 unsigned int pending; 440 unsigned int pending;
408 441
409#ifdef CONFIG_SIBYTE_SB1250_PROF
410 /* Set compare to count to silence count/compare timer interrupts */
411 write_c0_compare(read_c0_count());
412#endif
413
414 /* 442 /*
415 * What a pain. We have to be really careful saving the upper 32 bits 443 * What a pain. We have to be really careful saving the upper 32 bits
416 * of any * register across function calls if we don't want them 444 * of any * register across function calls if we don't want them
@@ -423,13 +451,9 @@ asmlinkage void plat_irq_dispatch(void)
423 451
424 pending = read_c0_cause() & read_c0_status() & ST0_IM; 452 pending = read_c0_cause() & read_c0_status() & ST0_IM;
425 453
426#ifdef CONFIG_SIBYTE_SB1250_PROF 454 if (pending & CAUSEF_IP7) /* CPU performance counter interrupt */
427 if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */ 455 do_IRQ(MIPS_CPU_IRQ_BASE + 7);
428 sbprof_cpu_intr(); 456 else if (pending & CAUSEF_IP4)
429 else
430#endif
431
432 if (pending & CAUSEF_IP4)
433 sb1250_timer_interrupt(); 457 sb1250_timer_interrupt();
434 458
435#ifdef CONFIG_SMP 459#ifdef CONFIG_SMP
diff --git a/arch/mips/sibyte/sb1250/prom.c b/arch/mips/sibyte/sb1250/prom.c
index 257c4e674353..cf8f6b3de86c 100644
--- a/arch/mips/sibyte/sb1250/prom.c
+++ b/arch/mips/sibyte/sb1250/prom.c
@@ -66,7 +66,7 @@ static void prom_linux_exit(void)
66{ 66{
67#ifdef CONFIG_SMP 67#ifdef CONFIG_SMP
68 if (smp_processor_id()) { 68 if (smp_processor_id()) {
69 smp_call_function(prom_cpu0_exit,NULL,1,1); 69 smp_call_function(prom_cpu0_exit, NULL, 1, 1);
70 } 70 }
71#endif 71#endif
72 while(1); 72 while(1);
@@ -83,7 +83,6 @@ void __init prom_init(void)
83 83
84 strcpy(arcs_cmdline, "root=/dev/ram0 "); 84 strcpy(arcs_cmdline, "root=/dev/ram0 ");
85 85
86 mips_machgroup = MACH_GROUP_SIBYTE;
87 prom_meminit(); 86 prom_meminit();
88} 87}
89 88
diff --git a/arch/mips/sibyte/sb1250/setup.c b/arch/mips/sibyte/sb1250/setup.c
index 2d5c6d8b41f2..0444da1e23c2 100644
--- a/arch/mips/sibyte/sb1250/setup.c
+++ b/arch/mips/sibyte/sb1250/setup.c
@@ -40,43 +40,6 @@ static char *soc_str;
40static char *pass_str; 40static char *pass_str;
41static unsigned int war_pass; /* XXXKW don't overload PASS defines? */ 41static unsigned int war_pass; /* XXXKW don't overload PASS defines? */
42 42
43static inline int setup_bcm1250(void);
44static inline int setup_bcm112x(void);
45
46/* Setup code likely to be common to all SiByte platforms */
47
48static int __init sys_rev_decode(void)
49{
50 int ret = 0;
51
52 war_pass = soc_pass;
53 switch (soc_type) {
54 case K_SYS_SOC_TYPE_BCM1250:
55 case K_SYS_SOC_TYPE_BCM1250_ALT:
56 case K_SYS_SOC_TYPE_BCM1250_ALT2:
57 soc_str = "BCM1250";
58 ret = setup_bcm1250();
59 break;
60 case K_SYS_SOC_TYPE_BCM1120:
61 soc_str = "BCM1120";
62 ret = setup_bcm112x();
63 break;
64 case K_SYS_SOC_TYPE_BCM1125:
65 soc_str = "BCM1125";
66 ret = setup_bcm112x();
67 break;
68 case K_SYS_SOC_TYPE_BCM1125H:
69 soc_str = "BCM1125H";
70 ret = setup_bcm112x();
71 break;
72 default:
73 printk("Unknown SOC type %x\n", soc_type);
74 ret = 1;
75 break;
76 }
77 return ret;
78}
79
80static int __init setup_bcm1250(void) 43static int __init setup_bcm1250(void)
81{ 44{
82 int ret = 0; 45 int ret = 0;
@@ -120,6 +83,7 @@ static int __init setup_bcm1250(void)
120 } 83 }
121 break; 84 break;
122 } 85 }
86
123 return ret; 87 return ret;
124} 88}
125 89
@@ -158,6 +122,42 @@ static int __init setup_bcm112x(void)
158 printk("Unknown %s rev %x\n", soc_str, soc_pass); 122 printk("Unknown %s rev %x\n", soc_str, soc_pass);
159 ret = 1; 123 ret = 1;
160 } 124 }
125
126 return ret;
127}
128
129/* Setup code likely to be common to all SiByte platforms */
130
131static int __init sys_rev_decode(void)
132{
133 int ret = 0;
134
135 war_pass = soc_pass;
136 switch (soc_type) {
137 case K_SYS_SOC_TYPE_BCM1250:
138 case K_SYS_SOC_TYPE_BCM1250_ALT:
139 case K_SYS_SOC_TYPE_BCM1250_ALT2:
140 soc_str = "BCM1250";
141 ret = setup_bcm1250();
142 break;
143 case K_SYS_SOC_TYPE_BCM1120:
144 soc_str = "BCM1120";
145 ret = setup_bcm112x();
146 break;
147 case K_SYS_SOC_TYPE_BCM1125:
148 soc_str = "BCM1125";
149 ret = setup_bcm112x();
150 break;
151 case K_SYS_SOC_TYPE_BCM1125H:
152 soc_str = "BCM1125H";
153 ret = setup_bcm112x();
154 break;
155 default:
156 printk("Unknown SOC type %x\n", soc_type);
157 ret = 1;
158 break;
159 }
160
161 return ret; 161 return ret;
162} 162}
163 163
diff --git a/arch/mips/sibyte/sb1250/time.c b/arch/mips/sibyte/sb1250/time.c
index 2efffe15ff23..38199ad8fc54 100644
--- a/arch/mips/sibyte/sb1250/time.c
+++ b/arch/mips/sibyte/sb1250/time.c
@@ -25,6 +25,7 @@
25 * code to do general bookkeeping (e.g. update jiffies, run 25 * code to do general bookkeeping (e.g. update jiffies, run
26 * bottom halves, etc.) 26 * bottom halves, etc.)
27 */ 27 */
28#include <linux/clockchips.h>
28#include <linux/interrupt.h> 29#include <linux/interrupt.h>
29#include <linux/sched.h> 30#include <linux/sched.h>
30#include <linux/spinlock.h> 31#include <linux/spinlock.h>
@@ -71,16 +72,158 @@ void __init sb1250_hpt_setup(void)
71 } 72 }
72} 73}
73 74
75/*
76 * The general purpose timer ticks at 1 Mhz independent if
77 * the rest of the system
78 */
79static void sibyte_set_mode(enum clock_event_mode mode,
80 struct clock_event_device *evt)
81{
82 unsigned int cpu = smp_processor_id();
83 void __iomem *timer_cfg, *timer_init;
84
85 timer_cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
86 timer_init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
74 87
75void sb1250_time_init(void) 88 switch(mode) {
89 case CLOCK_EVT_MODE_PERIODIC:
90 __raw_writeq(0, timer_cfg);
91 __raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1, timer_init);
92 __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
93 timer_cfg);
94 break;
95
96 case CLOCK_EVT_MODE_ONESHOT:
97 /* Stop the timer until we actually program a shot */
98 case CLOCK_EVT_MODE_SHUTDOWN:
99 __raw_writeq(0, timer_cfg);
100 break;
101
102 case CLOCK_EVT_MODE_UNUSED: /* shuddup gcc */
103 ;
104 }
105}
106
107static int
108sibyte_next_event(unsigned long delta, struct clock_event_device *evt)
76{ 109{
77 int cpu = smp_processor_id(); 110 unsigned int cpu = smp_processor_id();
78 int irq = K_INT_TIMER_0+cpu; 111 void __iomem *timer_cfg, *timer_init;
79 112
80 /* Only have 4 general purpose timers, and we use last one as hpt */ 113 timer_cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
81 if (cpu > 2) { 114 timer_init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
82 BUG(); 115
116 __raw_writeq(0, timer_cfg);
117 __raw_writeq(delta, timer_init);
118 __raw_writeq(M_SCD_TIMER_ENABLE, timer_cfg);
119
120 return 0;
121}
122
123struct clock_event_device sibyte_hpt_clockevent = {
124 .name = "sb1250-counter",
125 .features = CLOCK_EVT_FEAT_PERIODIC,
126 .set_mode = sibyte_set_mode,
127 .set_next_event = sibyte_next_event,
128 .shift = 32,
129 .irq = 0,
130};
131
132static irqreturn_t sibyte_counter_handler(int irq, void *dev_id)
133{
134 struct clock_event_device *cd = &sibyte_hpt_clockevent;
135
136 cd->event_handler(cd);
137
138 return IRQ_HANDLED;
139}
140
141static struct irqaction sibyte_irqaction = {
142 .handler = sibyte_counter_handler,
143 .flags = IRQF_DISABLED | IRQF_PERCPU,
144 .name = "timer",
145};
146
147/*
148 * The general purpose timer ticks at 1 Mhz independent if
149 * the rest of the system
150 */
151static void sibyte_set_mode(enum clock_event_mode mode,
152 struct clock_event_device *evt)
153{
154 unsigned int cpu = smp_processor_id();
155 void __iomem *timer_cfg, *timer_init;
156
157 timer_cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
158 timer_init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
159
160 switch (mode) {
161 case CLOCK_EVT_MODE_PERIODIC:
162 __raw_writeq(0, timer_cfg);
163 __raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1, timer_init);
164 __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
165 timer_cfg);
166 break;
167
168 case CLOCK_EVT_MODE_ONESHOT:
169 /* Stop the timer until we actually program a shot */
170 case CLOCK_EVT_MODE_SHUTDOWN:
171 __raw_writeq(0, timer_cfg);
172 break;
173
174 case CLOCK_EVT_MODE_UNUSED: /* shuddup gcc */
175 ;
83 } 176 }
177}
178
179static int
180sibyte_next_event(unsigned long delta, struct clock_event_device *evt)
181{
182 unsigned int cpu = smp_processor_id();
183 void __iomem *timer_cfg, *timer_init;
184
185 timer_cfg = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
186 timer_init = IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG));
187
188 __raw_writeq(0, timer_cfg);
189 __raw_writeq(delta, timer_init);
190 __raw_writeq(M_SCD_TIMER_ENABLE, timer_cfg);
191
192 return 0;
193}
194
195struct clock_event_device sibyte_hpt_clockevent = {
196 .name = "sb1250-counter",
197 .features = CLOCK_EVT_FEAT_PERIODIC,
198 .set_mode = sibyte_set_mode,
199 .set_next_event = sibyte_next_event,
200 .shift = 32,
201 .irq = 0,
202};
203
204static irqreturn_t sibyte_counter_handler(int irq, void *dev_id)
205{
206 struct clock_event_device *cd = &sibyte_hpt_clockevent;
207
208 cd->event_handler(cd);
209
210 return IRQ_HANDLED;
211}
212
213static struct irqaction sibyte_irqaction = {
214 .handler = sibyte_counter_handler,
215 .flags = IRQF_DISABLED | IRQF_PERCPU,
216 .name = "timer",
217};
218
219static void __init sb1250_clockevent_init(void)
220{
221 struct clock_event_device *cd = &sibyte_hpt_clockevent;
222 unsigned int cpu = smp_processor_id();
223 int irq = K_INT_TIMER_0 + cpu;
224
225 /* Only have 4 general purpose timers, and we use last one as hpt */
226 BUG_ON(cpu > 2);
84 227
85 sb1250_mask_irq(cpu, irq); 228 sb1250_mask_irq(cpu, irq);
86 229
@@ -88,24 +231,11 @@ void sb1250_time_init(void)
88 __raw_writeq(IMR_IP4_VAL, 231 __raw_writeq(IMR_IP4_VAL,
89 IOADDR(A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE) + 232 IOADDR(A_IMR_REGISTER(cpu, R_IMR_INTERRUPT_MAP_BASE) +
90 (irq << 3))); 233 (irq << 3)));
91 234 cd->cpumask = cpumask_of_cpu(0);
92 /* the general purpose timer ticks at 1 Mhz independent if the rest of the system */
93 /* Disable the timer and set up the count */
94 __raw_writeq(0, IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
95#ifdef CONFIG_SIMULATION
96 __raw_writeq((50000 / HZ) - 1,
97 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
98#else
99 __raw_writeq((V_SCD_TIMER_FREQ / HZ) - 1,
100 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_INIT)));
101#endif
102
103 /* Set the timer running */
104 __raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
105 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
106 235
107 sb1250_unmask_irq(cpu, irq); 236 sb1250_unmask_irq(cpu, irq);
108 sb1250_steal_irq(irq); 237 sb1250_steal_irq(irq);
238
109 /* 239 /*
110 * This interrupt is "special" in that it doesn't use the request_irq 240 * This interrupt is "special" in that it doesn't use the request_irq
111 * way to hook the irq line. The timer interrupt is initialized early 241 * way to hook the irq line. The timer interrupt is initialized early
@@ -114,29 +244,15 @@ void sb1250_time_init(void)
114 * called directly from irq_handler.S when IP[4] is set during an 244 * called directly from irq_handler.S when IP[4] is set during an
115 * interrupt 245 * interrupt
116 */ 246 */
247 setup_irq(irq, &sibyte_irqaction);
248
249 clockevents_register_device(cd);
117} 250}
118 251
119void sb1250_timer_interrupt(void) 252void __init plat_time_init(void)
120{ 253{
121 int cpu = smp_processor_id(); 254 sb1250_clocksource_init();
122 int irq = K_INT_TIMER_0 + cpu; 255 sb1250_clockevent_init();
123
124 /* ACK interrupt */
125 ____raw_writeq(M_SCD_TIMER_ENABLE | M_SCD_TIMER_MODE_CONTINUOUS,
126 IOADDR(A_SCD_TIMER_REGISTER(cpu, R_SCD_TIMER_CFG)));
127
128 if (cpu == 0) {
129 /*
130 * CPU 0 handles the global timer interrupt job
131 */
132 ll_timer_interrupt(irq);
133 }
134 else {
135 /*
136 * other CPUs should just do profiling and process accounting
137 */
138 ll_local_timer_interrupt(irq);
139 }
140} 256}
141 257
142/* 258/*
diff --git a/arch/mips/sibyte/swarm/dbg_io.c b/arch/mips/sibyte/swarm/dbg_io.c
index 75ce14c8eb69..b97ae3048482 100644
--- a/arch/mips/sibyte/swarm/dbg_io.c
+++ b/arch/mips/sibyte/swarm/dbg_io.c
@@ -37,8 +37,8 @@ static int duart_initialized = 0; /* 0: need to be init'ed by kgdb */
37/* -------------------- END OF CONFIG --------------------- */ 37/* -------------------- END OF CONFIG --------------------- */
38extern int kgdb_port; 38extern int kgdb_port;
39 39
40#define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port,reg))) 40#define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
41#define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port,reg))) 41#define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
42 42
43void putDebugChar(unsigned char c); 43void putDebugChar(unsigned char c);
44unsigned char getDebugChar(void); 44unsigned char getDebugChar(void);
diff --git a/arch/mips/sibyte/swarm/rtc_m41t81.c b/arch/mips/sibyte/swarm/rtc_m41t81.c
index c13914bdda59..26fbff4c15b1 100644
--- a/arch/mips/sibyte/swarm/rtc_m41t81.c
+++ b/arch/mips/sibyte/swarm/rtc_m41t81.c
@@ -146,7 +146,8 @@ int m41t81_set_time(unsigned long t)
146 struct rtc_time tm; 146 struct rtc_time tm;
147 unsigned long flags; 147 unsigned long flags;
148 148
149 to_tm(t, &tm); 149 /* Note we don't care about the century */
150 rtc_time_to_tm(t, &tm);
150 151
151 /* 152 /*
152 * Note the write order matters as it ensures the correctness. 153 * Note the write order matters as it ensures the correctness.
diff --git a/arch/mips/sibyte/swarm/rtc_xicor1241.c b/arch/mips/sibyte/swarm/rtc_xicor1241.c
index f4a178836415..ff3e5dabb348 100644
--- a/arch/mips/sibyte/swarm/rtc_xicor1241.c
+++ b/arch/mips/sibyte/swarm/rtc_xicor1241.c
@@ -115,7 +115,8 @@ int xicor_set_time(unsigned long t)
115 int tmp; 115 int tmp;
116 unsigned long flags; 116 unsigned long flags;
117 117
118 to_tm(t, &tm); 118 rtc_time_to_tm(t, &tm);
119 tm.tm_year += 1900;
119 120
120 spin_lock_irqsave(&rtc_lock, flags); 121 spin_lock_irqsave(&rtc_lock, flags);
121 /* unlock writes to the CCR */ 122 /* unlock writes to the CCR */
diff --git a/arch/mips/sibyte/swarm/setup.c b/arch/mips/sibyte/swarm/setup.c
index 83572d8f3e14..8b3ef0e4cd55 100644
--- a/arch/mips/sibyte/swarm/setup.c
+++ b/arch/mips/sibyte/swarm/setup.c
@@ -69,7 +69,7 @@ const char *get_system_type(void)
69 return "SiByte " SIBYTE_BOARD_NAME; 69 return "SiByte " SIBYTE_BOARD_NAME;
70} 70}
71 71
72void __init swarm_time_init(void) 72void __init plat_time_init(void)
73{ 73{
74#if defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X) 74#if defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
75 /* Setup HPT */ 75 /* Setup HPT */
@@ -104,6 +104,44 @@ int swarm_be_handler(struct pt_regs *regs, int is_fixup)
104 return (is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL); 104 return (is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL);
105} 105}
106 106
107enum swarm_rtc_type {
108 RTC_NONE,
109 RTC_XICOR,
110 RTC_M4LT81
111};
112
113enum swarm_rtc_type swarm_rtc_type;
114
115unsigned long read_persistent_clock(void)
116{
117 switch (swarm_rtc_type) {
118 case RTC_XICOR:
119 return xicor_get_time();
120
121 case RTC_M4LT81:
122 return m41t81_get_time();
123
124 case RTC_NONE:
125 default:
126 return mktime(2000, 1, 1, 0, 0, 0);
127 }
128}
129
130int rtc_mips_set_time(unsigned long sec)
131{
132 switch (swarm_rtc_type) {
133 case RTC_XICOR:
134 return xicor_set_time(sec);
135
136 case RTC_M4LT81:
137 return m41t81_set_time(sec);
138
139 case RTC_NONE:
140 default:
141 return -1;
142 }
143}
144
107void __init plat_mem_setup(void) 145void __init plat_mem_setup(void)
108{ 146{
109#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80) 147#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
@@ -116,20 +154,12 @@ void __init plat_mem_setup(void)
116 154
117 panic_timeout = 5; /* For debug. */ 155 panic_timeout = 5; /* For debug. */
118 156
119 board_time_init = swarm_time_init;
120 board_be_handler = swarm_be_handler; 157 board_be_handler = swarm_be_handler;
121 158
122 if (xicor_probe()) { 159 if (xicor_probe())
123 printk("swarm setup: Xicor 1241 RTC detected.\n"); 160 swarm_rtc_type = RTC_XICOR;
124 rtc_mips_get_time = xicor_get_time; 161 if (m41t81_probe())
125 rtc_mips_set_time = xicor_set_time; 162 swarm_rtc_type = RTC_M4LT81;
126 }
127
128 if (m41t81_probe()) {
129 printk("swarm setup: M41T81 RTC detected.\n");
130 rtc_mips_get_time = m41t81_get_time;
131 rtc_mips_set_time = m41t81_set_time;
132 }
133 163
134 printk("This kernel optimized for " 164 printk("This kernel optimized for "
135#ifdef CONFIG_SIMULATION 165#ifdef CONFIG_SIMULATION
diff --git a/arch/mips/sni/a20r.c b/arch/mips/sni/a20r.c
index acc9ba76c1a9..b74607599971 100644
--- a/arch/mips/sni/a20r.c
+++ b/arch/mips/sni/a20r.c
@@ -127,7 +127,7 @@ static u32 a20r_ack_hwint(void)
127{ 127{
128 u32 status = read_c0_status(); 128 u32 status = read_c0_status();
129 129
130 write_c0_status (status | 0x00010000); 130 write_c0_status(status | 0x00010000);
131 asm volatile( 131 asm volatile(
132 " .set push \n" 132 " .set push \n"
133 " .set noat \n" 133 " .set noat \n"
@@ -195,7 +195,7 @@ static void a20r_hwint(void)
195 u32 cause, status; 195 u32 cause, status;
196 int irq; 196 int irq;
197 197
198 clear_c0_status (IE_IRQ0); 198 clear_c0_status(IE_IRQ0);
199 status = a20r_ack_hwint(); 199 status = a20r_ack_hwint();
200 cause = read_c0_cause(); 200 cause = read_c0_cause();
201 201
@@ -213,7 +213,7 @@ void __init sni_a20r_irq_init(void)
213 set_irq_chip(i, &a20r_irq_type); 213 set_irq_chip(i, &a20r_irq_type);
214 sni_hwint = a20r_hwint; 214 sni_hwint = a20r_hwint;
215 change_c0_status(ST0_IM, IE_IRQ0); 215 change_c0_status(ST0_IM, IE_IRQ0);
216 setup_irq (SNI_A20R_IRQ_BASE + 3, &sni_isa_irq); 216 setup_irq(SNI_A20R_IRQ_BASE + 3, &sni_isa_irq);
217} 217}
218 218
219void sni_a20r_init(void) 219void sni_a20r_init(void)
diff --git a/arch/mips/sni/pcimt.c b/arch/mips/sni/pcimt.c
index 44b1ae62aa4a..39bb15f1f2a6 100644
--- a/arch/mips/sni/pcimt.c
+++ b/arch/mips/sni/pcimt.c
@@ -284,9 +284,9 @@ static void sni_pcimt_hwint(void)
284 u32 pending = read_c0_cause() & read_c0_status(); 284 u32 pending = read_c0_cause() & read_c0_status();
285 285
286 if (pending & C_IRQ5) 286 if (pending & C_IRQ5)
287 do_IRQ (MIPS_CPU_IRQ_BASE + 7); 287 do_IRQ(MIPS_CPU_IRQ_BASE + 7);
288 else if (pending & C_IRQ4) 288 else if (pending & C_IRQ4)
289 do_IRQ (MIPS_CPU_IRQ_BASE + 6); 289 do_IRQ(MIPS_CPU_IRQ_BASE + 6);
290 else if (pending & C_IRQ3) 290 else if (pending & C_IRQ3)
291 pcimt_hwint3(); 291 pcimt_hwint3();
292 else if (pending & C_IRQ1) 292 else if (pending & C_IRQ1)
@@ -313,7 +313,6 @@ void __init sni_pcimt_init(void)
313{ 313{
314 sni_pcimt_detect(); 314 sni_pcimt_detect();
315 sni_pcimt_sc_init(); 315 sni_pcimt_sc_init();
316 board_time_init = sni_cpu_time_init;
317 ioport_resource.end = sni_io_resource.end; 316 ioport_resource.end = sni_io_resource.end;
318#ifdef CONFIG_PCI 317#ifdef CONFIG_PCI
319 PCIBIOS_MIN_IO = 0x9000; 318 PCIBIOS_MIN_IO = 0x9000;
diff --git a/arch/mips/sni/pcit.c b/arch/mips/sni/pcit.c
index 2480c478dcbd..416f397c768b 100644
--- a/arch/mips/sni/pcit.c
+++ b/arch/mips/sni/pcit.c
@@ -188,8 +188,8 @@ static void pcit_hwint1(void)
188 irq = ffs((pending >> 16) & 0x7f); 188 irq = ffs((pending >> 16) & 0x7f);
189 189
190 if (likely(irq > 0)) 190 if (likely(irq > 0))
191 do_IRQ (irq + SNI_PCIT_INT_START - 1); 191 do_IRQ(irq + SNI_PCIT_INT_START - 1);
192 set_c0_status (IE_IRQ1); 192 set_c0_status(IE_IRQ1);
193} 193}
194 194
195static void pcit_hwint0(void) 195static void pcit_hwint0(void)
@@ -201,8 +201,8 @@ static void pcit_hwint0(void)
201 irq = ffs((pending >> 16) & 0x3f); 201 irq = ffs((pending >> 16) & 0x3f);
202 202
203 if (likely(irq > 0)) 203 if (likely(irq > 0))
204 do_IRQ (irq + SNI_PCIT_INT_START - 1); 204 do_IRQ(irq + SNI_PCIT_INT_START - 1);
205 set_c0_status (IE_IRQ0); 205 set_c0_status(IE_IRQ0);
206} 206}
207 207
208static void sni_pcit_hwint(void) 208static void sni_pcit_hwint(void)
@@ -212,11 +212,11 @@ static void sni_pcit_hwint(void)
212 if (pending & C_IRQ1) 212 if (pending & C_IRQ1)
213 pcit_hwint1(); 213 pcit_hwint1();
214 else if (pending & C_IRQ2) 214 else if (pending & C_IRQ2)
215 do_IRQ (MIPS_CPU_IRQ_BASE + 4); 215 do_IRQ(MIPS_CPU_IRQ_BASE + 4);
216 else if (pending & C_IRQ3) 216 else if (pending & C_IRQ3)
217 do_IRQ (MIPS_CPU_IRQ_BASE + 5); 217 do_IRQ(MIPS_CPU_IRQ_BASE + 5);
218 else if (pending & C_IRQ5) 218 else if (pending & C_IRQ5)
219 do_IRQ (MIPS_CPU_IRQ_BASE + 7); 219 do_IRQ(MIPS_CPU_IRQ_BASE + 7);
220} 220}
221 221
222static void sni_pcit_hwint_cplus(void) 222static void sni_pcit_hwint_cplus(void)
@@ -226,13 +226,13 @@ static void sni_pcit_hwint_cplus(void)
226 if (pending & C_IRQ0) 226 if (pending & C_IRQ0)
227 pcit_hwint0(); 227 pcit_hwint0();
228 else if (pending & C_IRQ1) 228 else if (pending & C_IRQ1)
229 do_IRQ (MIPS_CPU_IRQ_BASE + 3); 229 do_IRQ(MIPS_CPU_IRQ_BASE + 3);
230 else if (pending & C_IRQ2) 230 else if (pending & C_IRQ2)
231 do_IRQ (MIPS_CPU_IRQ_BASE + 4); 231 do_IRQ(MIPS_CPU_IRQ_BASE + 4);
232 else if (pending & C_IRQ3) 232 else if (pending & C_IRQ3)
233 do_IRQ (MIPS_CPU_IRQ_BASE + 5); 233 do_IRQ(MIPS_CPU_IRQ_BASE + 5);
234 else if (pending & C_IRQ5) 234 else if (pending & C_IRQ5)
235 do_IRQ (MIPS_CPU_IRQ_BASE + 7); 235 do_IRQ(MIPS_CPU_IRQ_BASE + 7);
236} 236}
237 237
238void __init sni_pcit_irq_init(void) 238void __init sni_pcit_irq_init(void)
@@ -245,7 +245,7 @@ void __init sni_pcit_irq_init(void)
245 *(volatile u32 *)SNI_PCIT_INT_REG = 0; 245 *(volatile u32 *)SNI_PCIT_INT_REG = 0;
246 sni_hwint = sni_pcit_hwint; 246 sni_hwint = sni_pcit_hwint;
247 change_c0_status(ST0_IM, IE_IRQ1); 247 change_c0_status(ST0_IM, IE_IRQ1);
248 setup_irq (SNI_PCIT_INT_START + 6, &sni_isa_irq); 248 setup_irq(SNI_PCIT_INT_START + 6, &sni_isa_irq);
249} 249}
250 250
251void __init sni_pcit_cplus_irq_init(void) 251void __init sni_pcit_cplus_irq_init(void)
@@ -258,12 +258,11 @@ void __init sni_pcit_cplus_irq_init(void)
258 *(volatile u32 *)SNI_PCIT_INT_REG = 0x40000000; 258 *(volatile u32 *)SNI_PCIT_INT_REG = 0x40000000;
259 sni_hwint = sni_pcit_hwint_cplus; 259 sni_hwint = sni_pcit_hwint_cplus;
260 change_c0_status(ST0_IM, IE_IRQ0); 260 change_c0_status(ST0_IM, IE_IRQ0);
261 setup_irq (MIPS_CPU_IRQ_BASE + 3, &sni_isa_irq); 261 setup_irq(MIPS_CPU_IRQ_BASE + 3, &sni_isa_irq);
262} 262}
263 263
264void __init sni_pcit_init(void) 264void __init sni_pcit_init(void)
265{ 265{
266 board_time_init = sni_cpu_time_init;
267 ioport_resource.end = sni_io_resource.end; 266 ioport_resource.end = sni_io_resource.end;
268#ifdef CONFIG_PCI 267#ifdef CONFIG_PCI
269 PCIBIOS_MIN_IO = 0x9000; 268 PCIBIOS_MIN_IO = 0x9000;
diff --git a/arch/mips/sni/reset.c b/arch/mips/sni/reset.c
index 38b6a97a31b5..79f8d70f48c9 100644
--- a/arch/mips/sni/reset.c
+++ b/arch/mips/sni/reset.c
@@ -35,7 +35,7 @@ void sni_machine_restart(char *command)
35 kb_wait(); 35 kb_wait();
36 for (j = 0; j < 100000 ; j++) 36 for (j = 0; j < 100000 ; j++)
37 /* nothing */; 37 /* nothing */;
38 outb_p(0xfe,0x64); /* pulse reset low */ 38 outb_p(0xfe, 0x64); /* pulse reset low */
39 } 39 }
40 } 40 }
41} 41}
diff --git a/arch/mips/sni/rm200.c b/arch/mips/sni/rm200.c
index 28a11d8605ce..67b061eef6cd 100644
--- a/arch/mips/sni/rm200.c
+++ b/arch/mips/sni/rm200.c
@@ -162,16 +162,16 @@ static void sni_rm200_hwint(void)
162 int irq; 162 int irq;
163 163
164 if (pending & C_IRQ5) 164 if (pending & C_IRQ5)
165 do_IRQ (MIPS_CPU_IRQ_BASE + 7); 165 do_IRQ(MIPS_CPU_IRQ_BASE + 7);
166 else if (pending & C_IRQ0) { 166 else if (pending & C_IRQ0) {
167 clear_c0_status (IE_IRQ0); 167 clear_c0_status(IE_IRQ0);
168 mask = *(volatile u8 *)SNI_RM200_INT_ENA_REG ^ 0x1f; 168 mask = *(volatile u8 *)SNI_RM200_INT_ENA_REG ^ 0x1f;
169 stat = *(volatile u8 *)SNI_RM200_INT_STAT_REG ^ 0x14; 169 stat = *(volatile u8 *)SNI_RM200_INT_STAT_REG ^ 0x14;
170 irq = ffs(stat & mask & 0x1f); 170 irq = ffs(stat & mask & 0x1f);
171 171
172 if (likely(irq > 0)) 172 if (likely(irq > 0))
173 do_IRQ (irq + SNI_RM200_INT_START - 1); 173 do_IRQ(irq + SNI_RM200_INT_START - 1);
174 set_c0_status (IE_IRQ0); 174 set_c0_status(IE_IRQ0);
175 } 175 }
176} 176}
177 177
@@ -187,12 +187,11 @@ void __init sni_rm200_irq_init(void)
187 set_irq_chip(i, &rm200_irq_type); 187 set_irq_chip(i, &rm200_irq_type);
188 sni_hwint = sni_rm200_hwint; 188 sni_hwint = sni_rm200_hwint;
189 change_c0_status(ST0_IM, IE_IRQ0); 189 change_c0_status(ST0_IM, IE_IRQ0);
190 setup_irq (SNI_RM200_INT_START + 0, &sni_isa_irq); 190 setup_irq(SNI_RM200_INT_START + 0, &sni_isa_irq);
191} 191}
192 192
193void __init sni_rm200_init(void) 193void __init sni_rm200_init(void)
194{ 194{
195 set_io_port_base(SNI_PORT_BASE + 0x02000000); 195 set_io_port_base(SNI_PORT_BASE + 0x02000000);
196 ioport_resource.end += 0x02000000; 196 ioport_resource.end += 0x02000000;
197 board_time_init = sni_cpu_time_init;
198} 197}
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c
index 6edbb3051c82..e8b26bdee24c 100644
--- a/arch/mips/sni/setup.c
+++ b/arch/mips/sni/setup.c
@@ -15,7 +15,7 @@
15#include <linux/screen_info.h> 15#include <linux/screen_info.h>
16 16
17#ifdef CONFIG_ARC 17#ifdef CONFIG_ARC
18#include <asm/arc/types.h> 18#include <asm/fw/arc/types.h>
19#include <asm/sgialib.h> 19#include <asm/sgialib.h>
20#endif 20#endif
21 21
@@ -106,11 +106,11 @@ static void __devinit quirk_cirrus_ram_size(struct pci_dev *dev)
106 * need to do it here, otherwise we get screen corruption 106 * need to do it here, otherwise we get screen corruption
107 * on older Cirrus chips 107 * on older Cirrus chips
108 */ 108 */
109 pci_read_config_word (dev, PCI_COMMAND, &cmd); 109 pci_read_config_word(dev, PCI_COMMAND, &cmd);
110 if ((cmd & (PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) 110 if ((cmd & (PCI_COMMAND_IO|PCI_COMMAND_MEMORY))
111 == (PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) { 111 == (PCI_COMMAND_IO|PCI_COMMAND_MEMORY)) {
112 vga_wseq (NULL, CL_SEQR6, 0x12); /* unlock all extension registers */ 112 vga_wseq(NULL, CL_SEQR6, 0x12); /* unlock all extension registers */
113 vga_wseq (NULL, CL_SEQRF, 0x18); 113 vga_wseq(NULL, CL_SEQRF, 0x18);
114 } 114 }
115} 115}
116 116
diff --git a/arch/mips/sni/sniprom.c b/arch/mips/sni/sniprom.c
index db544a6e23f3..eff4b89d7b75 100644
--- a/arch/mips/sni/sniprom.c
+++ b/arch/mips/sni/sniprom.c
@@ -45,7 +45,7 @@ void prom_putchar(char c)
45static char *(*__prom_getenv)(char *) = (char *(*)(char *))PROM_ENTRY(PROM_GETENV); 45static char *(*__prom_getenv)(char *) = (char *(*)(char *))PROM_ENTRY(PROM_GETENV);
46static void (*__prom_get_memconf)(void *) = (void (*)(void *))PROM_ENTRY(PROM_GET_MEMCONF); 46static void (*__prom_get_memconf)(void *) = (void (*)(void *))PROM_ENTRY(PROM_GET_MEMCONF);
47 47
48char *prom_getenv (char *s) 48char *prom_getenv(char *s)
49{ 49{
50 return __prom_getenv(s); 50 return __prom_getenv(s);
51} 51}
@@ -131,9 +131,9 @@ static void __init sni_console_setup(void)
131 int port; 131 int port;
132 static char options[8]; 132 static char options[8];
133 133
134 cdev = prom_getenv ("console_dev"); 134 cdev = prom_getenv("console_dev");
135 if (strncmp (cdev, "tty", 3) == 0) { 135 if (strncmp (cdev, "tty", 3) == 0) {
136 ctype = prom_getenv ("console"); 136 ctype = prom_getenv("console");
137 switch (*ctype) { 137 switch (*ctype) {
138 default: 138 default:
139 case 'l': 139 case 'l':
@@ -233,7 +233,7 @@ void __init prom_init(void)
233 systype = "RM300-Exx"; 233 systype = "RM300-Exx";
234 break; 234 break;
235 } 235 }
236 pr_debug("Found SNI brdtype %02x name %s\n", sni_brd_type,systype); 236 pr_debug("Found SNI brdtype %02x name %s\n", sni_brd_type, systype);
237 237
238#ifdef DEBUG 238#ifdef DEBUG
239 sni_idprom_dump(); 239 sni_idprom_dump();
diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c
index 20028fc7757e..b80877349d38 100644
--- a/arch/mips/sni/time.c
+++ b/arch/mips/sni/time.c
@@ -2,8 +2,10 @@
2#include <linux/interrupt.h> 2#include <linux/interrupt.h>
3#include <linux/time.h> 3#include <linux/time.h>
4 4
5#include <asm/i8253.h>
5#include <asm/sni.h> 6#include <asm/sni.h>
6#include <asm/time.h> 7#include <asm/time.h>
8#include <asm-generic/rtc.h>
7 9
8#define SNI_CLOCK_TICK_RATE 3686400 10#define SNI_CLOCK_TICK_RATE 3686400
9#define SNI_COUNTER2_DIV 64 11#define SNI_COUNTER2_DIV 64
@@ -42,23 +44,23 @@ static __init unsigned long dosample(void)
42 volatile u8 msb, lsb; 44 volatile u8 msb, lsb;
43 45
44 /* Start the counter. */ 46 /* Start the counter. */
45 outb_p (0x34, 0x43); 47 outb_p(0x34, 0x43);
46 outb_p(SNI_8254_TCSAMP_COUNTER & 0xff, 0x40); 48 outb_p(SNI_8254_TCSAMP_COUNTER & 0xff, 0x40);
47 outb (SNI_8254_TCSAMP_COUNTER >> 8, 0x40); 49 outb(SNI_8254_TCSAMP_COUNTER >> 8, 0x40);
48 50
49 /* Get initial counter invariant */ 51 /* Get initial counter invariant */
50 ct0 = read_c0_count(); 52 ct0 = read_c0_count();
51 53
52 /* Latch and spin until top byte of counter0 is zero */ 54 /* Latch and spin until top byte of counter0 is zero */
53 do { 55 do {
54 outb (0x00, 0x43); 56 outb(0x00, 0x43);
55 lsb = inb (0x40); 57 lsb = inb(0x40);
56 msb = inb (0x40); 58 msb = inb(0x40);
57 ct1 = read_c0_count(); 59 ct1 = read_c0_count();
58 } while (msb); 60 } while (msb);
59 61
60 /* Stop the counter. */ 62 /* Stop the counter. */
61 outb (0x38, 0x43); 63 outb(0x38, 0x43);
62 /* 64 /*
63 * Return the difference, this is how far the r4k counter increments 65 * Return the difference, this is how far the r4k counter increments
64 * for every 1/HZ seconds. We round off the nearest 1 MHz of master 66 * for every 1/HZ seconds. We round off the nearest 1 MHz of master
@@ -71,7 +73,7 @@ static __init unsigned long dosample(void)
71/* 73/*
72 * Here we need to calibrate the cycle counter to at least be close. 74 * Here we need to calibrate the cycle counter to at least be close.
73 */ 75 */
74__init void sni_cpu_time_init(void) 76void __init plat_time_init(void)
75{ 77{
76 unsigned long r4k_ticks[3]; 78 unsigned long r4k_ticks[3];
77 unsigned long r4k_tick; 79 unsigned long r4k_tick;
@@ -115,6 +117,8 @@ __init void sni_cpu_time_init(void)
115 (int) (r4k_tick % (500000 / HZ))); 117 (int) (r4k_tick % (500000 / HZ)));
116 118
117 mips_hpt_frequency = r4k_tick * HZ; 119 mips_hpt_frequency = r4k_tick * HZ;
120
121 setup_pit_timer();
118} 122}
119 123
120/* 124/*
@@ -133,7 +137,7 @@ void __init plat_timer_setup(struct irqaction *irq)
133 case SNI_BRD_10NEW: 137 case SNI_BRD_10NEW:
134 case SNI_BRD_TOWER_OASIC: 138 case SNI_BRD_TOWER_OASIC:
135 case SNI_BRD_MINITOWER: 139 case SNI_BRD_MINITOWER:
136 sni_a20r_timer_setup (irq); 140 sni_a20r_timer_setup(irq);
137 break; 141 break;
138 142
139 case SNI_BRD_PCI_TOWER: 143 case SNI_BRD_PCI_TOWER:
@@ -142,7 +146,12 @@ void __init plat_timer_setup(struct irqaction *irq)
142 case SNI_BRD_PCI_DESKTOP: 146 case SNI_BRD_PCI_DESKTOP:
143 case SNI_BRD_PCI_TOWER_CPLUS: 147 case SNI_BRD_PCI_TOWER_CPLUS:
144 case SNI_BRD_PCI_MTOWER_CPLUS: 148 case SNI_BRD_PCI_MTOWER_CPLUS:
145 sni_cpu_timer_setup (irq); 149 sni_cpu_timer_setup(irq);
146 break; 150 break;
147 } 151 }
148} 152}
153
154unsigned long read_persistent_clock(void)
155{
156 return -1;
157}
diff --git a/arch/mips/tx4927/common/tx4927_dbgio.c b/arch/mips/tx4927/common/tx4927_dbgio.c
index 09bdf2baa835..d8423e001b2d 100644
--- a/arch/mips/tx4927/common/tx4927_dbgio.c
+++ b/arch/mips/tx4927/common/tx4927_dbgio.c
@@ -31,7 +31,6 @@
31 31
32#include <asm/mipsregs.h> 32#include <asm/mipsregs.h>
33#include <asm/system.h> 33#include <asm/system.h>
34#include <asm/tx4927/tx4927_mips.h>
35 34
36u8 getDebugChar(void) 35u8 getDebugChar(void)
37{ 36{
diff --git a/arch/mips/tx4927/common/tx4927_prom.c b/arch/mips/tx4927/common/tx4927_prom.c
index 7d4cbf512d8a..6eed53d8f386 100644
--- a/arch/mips/tx4927/common/tx4927_prom.c
+++ b/arch/mips/tx4927/common/tx4927_prom.c
@@ -38,7 +38,7 @@
38#include <asm/bootinfo.h> 38#include <asm/bootinfo.h>
39#include <asm/tx4927/tx4927.h> 39#include <asm/tx4927/tx4927.h>
40 40
41static unsigned int __init tx4927_process_sdccr(u64 * addr) 41static unsigned int __init tx4927_process_sdccr(unsigned long addr)
42{ 42{
43 u64 val; 43 u64 val;
44 unsigned int sdccr_ce; 44 unsigned int sdccr_ce;
@@ -52,7 +52,7 @@ static unsigned int __init tx4927_process_sdccr(u64 * addr)
52 unsigned int mw = 0; 52 unsigned int mw = 0;
53 unsigned int msize = 0; 53 unsigned int msize = 0;
54 54
55 val = (*((vu64 *) (addr))); 55 val = __raw_readq((void __iomem *)addr);
56 56
57 /* MVMCP -- need #defs for these bits masks */ 57 /* MVMCP -- need #defs for these bits masks */
58 sdccr_ce = ((val & (1 << 10)) >> 10); 58 sdccr_ce = ((val & (1 << 10)) >> 10);
@@ -136,10 +136,10 @@ unsigned int __init tx4927_get_mem_size(void)
136 unsigned int total; 136 unsigned int total;
137 137
138 /* MVMCP -- need #defs for these registers */ 138 /* MVMCP -- need #defs for these registers */
139 c0 = tx4927_process_sdccr((u64 *) 0xff1f8000); 139 c0 = tx4927_process_sdccr(0xff1f8000);
140 c1 = tx4927_process_sdccr((u64 *) 0xff1f8008); 140 c1 = tx4927_process_sdccr(0xff1f8008);
141 c2 = tx4927_process_sdccr((u64 *) 0xff1f8010); 141 c2 = tx4927_process_sdccr(0xff1f8010);
142 c3 = tx4927_process_sdccr((u64 *) 0xff1f8018); 142 c3 = tx4927_process_sdccr(0xff1f8018);
143 total = c0 + c1 + c2 + c3; 143 total = c0 + c1 + c2 + c3;
144 144
145 return (total); 145 return (total);
diff --git a/arch/mips/tx4927/common/tx4927_setup.c b/arch/mips/tx4927/common/tx4927_setup.c
index c8e49feb345b..8ce0989671d8 100644
--- a/arch/mips/tx4927/common/tx4927_setup.c
+++ b/arch/mips/tx4927/common/tx4927_setup.c
@@ -49,14 +49,11 @@
49 49
50#undef DEBUG 50#undef DEBUG
51 51
52void __init tx4927_time_init(void);
53void dump_cp0(char *key); 52void dump_cp0(char *key);
54 53
55 54
56void __init plat_mem_setup(void) 55void __init plat_mem_setup(void)
57{ 56{
58 board_time_init = tx4927_time_init;
59
60#ifdef CONFIG_TOSHIBA_RBTX4927 57#ifdef CONFIG_TOSHIBA_RBTX4927
61 { 58 {
62 extern void toshiba_rbtx4927_setup(void); 59 extern void toshiba_rbtx4927_setup(void);
@@ -65,20 +62,16 @@ void __init plat_mem_setup(void)
65#endif 62#endif
66} 63}
67 64
68void __init tx4927_time_init(void) 65void __init plat_time_init(void)
69{ 66{
70
71#ifdef CONFIG_TOSHIBA_RBTX4927 67#ifdef CONFIG_TOSHIBA_RBTX4927
72 { 68 {
73 extern void toshiba_rbtx4927_time_init(void); 69 extern void toshiba_rbtx4927_time_init(void);
74 toshiba_rbtx4927_time_init(); 70 toshiba_rbtx4927_time_init();
75 } 71 }
76#endif 72#endif
77
78 return;
79} 73}
80 74
81
82void __init plat_timer_setup(struct irqaction *irq) 75void __init plat_timer_setup(struct irqaction *irq)
83{ 76{
84 setup_irq(TX4927_IRQ_CPU_TIMER, irq); 77 setup_irq(TX4927_IRQ_CPU_TIMER, irq);
@@ -124,10 +117,10 @@ dump_cp0(char *key)
124 return; 117 return;
125} 118}
126 119
127void print_pic(char *key, u32 reg, char *name) 120void print_pic(char *key, unsigned long reg, char *name)
128{ 121{
129 printk("%s pic:0x%08x:%s=0x%08x\n", key, reg, name, 122 printk(KERN_INFO "%s pic:0x%08lx:%s=0x%08x\n", key, reg, name,
130 TX4927_RD(reg)); 123 __raw_readl((void __iomem *)reg));
131 return; 124 return;
132} 125}
133 126
@@ -166,9 +159,10 @@ void dump_pic(char *key)
166} 159}
167 160
168 161
169void print_addr(char *hdr, char *key, u32 addr) 162void print_addr(char *hdr, char *key, unsigned long addr)
170{ 163{
171 printk("%s %s:0x%08x=0x%08x\n", hdr, key, addr, TX4927_RD(addr)); 164 printk(KERN_INFO "%s %s:0x%08lx=0x%08x\n", hdr, key, addr,
165 __raw_readl((void __iomem *)addr));
172 return; 166 return;
173} 167}
174 168
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
index 9607ad5e734a..3f808b629242 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_irq.c
@@ -176,7 +176,7 @@ static const u32 toshiba_rbtx4927_irq_debug_flag =
176 printk( "%s(%s:%u)::%s", __FUNCTION__, __FILE__, __LINE__, tmp ); \ 176 printk( "%s(%s:%u)::%s", __FUNCTION__, __FILE__, __LINE__, tmp ); \
177 } 177 }
178#else 178#else
179#define TOSHIBA_RBTX4927_IRQ_DPRINTK(flag,str...) 179#define TOSHIBA_RBTX4927_IRQ_DPRINTK(flag, str...)
180#endif 180#endif
181 181
182 182
@@ -204,8 +204,8 @@ static struct irq_chip toshiba_rbtx4927_irq_ioc_type = {
204 .mask_ack = toshiba_rbtx4927_irq_ioc_disable, 204 .mask_ack = toshiba_rbtx4927_irq_ioc_disable,
205 .unmask = toshiba_rbtx4927_irq_ioc_enable, 205 .unmask = toshiba_rbtx4927_irq_ioc_enable,
206}; 206};
207#define TOSHIBA_RBTX4927_IOC_INTR_ENAB 0xbc002000 207#define TOSHIBA_RBTX4927_IOC_INTR_ENAB (void __iomem *)0xbc002000UL
208#define TOSHIBA_RBTX4927_IOC_INTR_STAT 0xbc002006 208#define TOSHIBA_RBTX4927_IOC_INTR_STAT (void __iomem *)0xbc002006UL
209 209
210 210
211u32 bit2num(u32 num) 211u32 bit2num(u32 num)
@@ -224,7 +224,7 @@ int toshiba_rbtx4927_irq_nested(int sw_irq)
224{ 224{
225 u32 level3; 225 u32 level3;
226 226
227 level3 = reg_rd08(TOSHIBA_RBTX4927_IOC_INTR_STAT) & 0x1f; 227 level3 = readb(TOSHIBA_RBTX4927_IOC_INTR_STAT) & 0x1f;
228 if (level3) { 228 if (level3) {
229 sw_irq = TOSHIBA_RBTX4927_IRQ_IOC_BEG + bit2num(level3); 229 sw_irq = TOSHIBA_RBTX4927_IRQ_IOC_BEG + bit2num(level3);
230 if (sw_irq != TOSHIBA_RBTX4927_IRQ_NEST_ISA_ON_IOC) { 230 if (sw_irq != TOSHIBA_RBTX4927_IRQ_NEST_ISA_ON_IOC) {
@@ -243,10 +243,12 @@ int toshiba_rbtx4927_irq_nested(int sw_irq)
243 return (sw_irq); 243 return (sw_irq);
244} 244}
245 245
246//#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, 0, CPU_MASK_NONE, s, NULL, NULL } 246static struct irqaction toshiba_rbtx4927_irq_ioc_action = {
247#define TOSHIBA_RBTX4927_PIC_ACTION(s) { no_action, IRQF_SHARED, CPU_MASK_NONE, s, NULL, NULL } 247 .handler = no_action,
248static struct irqaction toshiba_rbtx4927_irq_ioc_action = 248 .flags = IRQF_SHARED,
249TOSHIBA_RBTX4927_PIC_ACTION(TOSHIBA_RBTX4927_IOC_NAME); 249 .mask = CPU_MASK_NONE,
250 .name = TOSHIBA_RBTX4927_IOC_NAME
251};
250 252
251 253
252/**********************************************************************************/ 254/**********************************************************************************/
@@ -286,9 +288,9 @@ static void toshiba_rbtx4927_irq_ioc_enable(unsigned int irq)
286 panic("\n"); 288 panic("\n");
287 } 289 }
288 290
289 v = TX4927_RD08(TOSHIBA_RBTX4927_IOC_INTR_ENAB); 291 v = readb(TOSHIBA_RBTX4927_IOC_INTR_ENAB);
290 v |= (1 << (irq - TOSHIBA_RBTX4927_IRQ_IOC_BEG)); 292 v |= (1 << (irq - TOSHIBA_RBTX4927_IRQ_IOC_BEG));
291 TOSHIBA_RBTX4927_WR08(TOSHIBA_RBTX4927_IOC_INTR_ENAB, v); 293 writeb(v, TOSHIBA_RBTX4927_IOC_INTR_ENAB);
292} 294}
293 295
294 296
@@ -306,9 +308,10 @@ static void toshiba_rbtx4927_irq_ioc_disable(unsigned int irq)
306 panic("\n"); 308 panic("\n");
307 } 309 }
308 310
309 v = TX4927_RD08(TOSHIBA_RBTX4927_IOC_INTR_ENAB); 311 v = readb(TOSHIBA_RBTX4927_IOC_INTR_ENAB);
310 v &= ~(1 << (irq - TOSHIBA_RBTX4927_IRQ_IOC_BEG)); 312 v &= ~(1 << (irq - TOSHIBA_RBTX4927_IRQ_IOC_BEG));
311 TOSHIBA_RBTX4927_WR08(TOSHIBA_RBTX4927_IOC_INTR_ENAB, v); 313 writeb(v, TOSHIBA_RBTX4927_IOC_INTR_ENAB);
314 mmiowb();
312} 315}
313 316
314 317
@@ -385,12 +388,12 @@ void toshiba_rbtx4927_irq_dump_pics(char *s)
385 level1_m = level0_m; 388 level1_m = level0_m;
386 level1_s = level0_s & 0x87; 389 level1_s = level0_s & 0x87;
387 390
388 level2 = TX4927_RD(0xff1ff6a0); 391 level2 = __raw_readl((void __iomem *)0xff1ff6a0UL);
389 level2_p = (((level2 & 0x10000)) ? 0 : 1); 392 level2_p = (((level2 & 0x10000)) ? 0 : 1);
390 level2_s = (((level2 & 0x1f) == 0x1f) ? 0 : (level2 & 0x1f)); 393 level2_s = (((level2 & 0x1f) == 0x1f) ? 0 : (level2 & 0x1f));
391 394
392 level3_m = reg_rd08(TOSHIBA_RBTX4927_IOC_INTR_ENAB) & 0x1f; 395 level3_m = readb(TOSHIBA_RBTX4927_IOC_INTR_ENAB) & 0x1f;
393 level3_s = reg_rd08(TOSHIBA_RBTX4927_IOC_INTR_STAT) & 0x1f; 396 level3_s = readb(TOSHIBA_RBTX4927_IOC_INTR_STAT) & 0x1f;
394 397
395 level4_m = inb(0x21); 398 level4_m = inb(0x21);
396 outb(0x0A, 0x20); 399 outb(0x0A, 0x20);
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c
index 9a3a5babd1fb..f3f86857beae 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_prom.c
@@ -66,8 +66,6 @@ void __init prom_init(void)
66 66
67 prom_init_cmdline(); 67 prom_init_cmdline();
68 68
69 mips_machgroup = MACH_GROUP_TOSHIBA;
70
71 if ((read_c0_prid() & 0xff) == PRID_REV_TX4927) { 69 if ((read_c0_prid() & 0xff) == PRID_REV_TX4927) {
72 mips_machtype = MACH_TOSHIBA_RBTX4927; 70 mips_machtype = MACH_TOSHIBA_RBTX4927;
73 toshiba_name = "TX4927"; 71 toshiba_name = "TX4927";
diff --git a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
index 3e84237abe63..acaf613358c7 100644
--- a/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
+++ b/arch/mips/tx4927/toshiba_rbtx4927/toshiba_rbtx4927_setup.c
@@ -122,7 +122,7 @@ static const u32 toshiba_rbtx4927_setup_debug_flag =
122 printk( "%s(%s:%u)::%s", __FUNCTION__, __FILE__, __LINE__, tmp ); \ 122 printk( "%s(%s:%u)::%s", __FUNCTION__, __FILE__, __LINE__, tmp ); \
123 } 123 }
124#else 124#else
125#define TOSHIBA_RBTX4927_SETUP_DPRINTK(flag,str...) 125#define TOSHIBA_RBTX4927_SETUP_DPRINTK(flag, str...)
126#endif 126#endif
127 127
128/* These functions are used for rebooting or halting the machine*/ 128/* These functions are used for rebooting or halting the machine*/
@@ -497,7 +497,7 @@ void __init tx4927_pci_setup(void)
497 "Internal"); 497 "Internal");
498 called = 1; 498 called = 1;
499 } 499 }
500 printk("%s PCIC --%s PCICLK:",toshiba_name, 500 printk("%s PCIC --%s PCICLK:", toshiba_name,
501 (tx4927_ccfgptr->ccfg & TX4927_CCFG_PCI66) ? " PCI66" : ""); 501 (tx4927_ccfgptr->ccfg & TX4927_CCFG_PCI66) ? " PCI66" : "");
502 if (tx4927_ccfgptr->pcfg & TX4927_PCFG_PCICLKEN_ALL) { 502 if (tx4927_ccfgptr->pcfg & TX4927_PCFG_PCICLKEN_ALL) {
503 int pciclk = 0; 503 int pciclk = 0;
@@ -679,25 +679,30 @@ void __init tx4927_pci_setup(void)
679 679
680#endif /* CONFIG_PCI */ 680#endif /* CONFIG_PCI */
681 681
682static void __noreturn wait_forever(void)
683{
684 while (1)
685 if (cpu_wait)
686 (*cpu_wait)();
687}
688
682void toshiba_rbtx4927_restart(char *command) 689void toshiba_rbtx4927_restart(char *command)
683{ 690{
684 printk(KERN_NOTICE "System Rebooting...\n"); 691 printk(KERN_NOTICE "System Rebooting...\n");
685 692
686 /* enable the s/w reset register */ 693 /* enable the s/w reset register */
687 reg_wr08(RBTX4927_SW_RESET_ENABLE, RBTX4927_SW_RESET_ENABLE_SET); 694 writeb(RBTX4927_SW_RESET_ENABLE_SET, RBTX4927_SW_RESET_ENABLE);
688 695
689 /* wait for enable to be seen */ 696 /* wait for enable to be seen */
690 while ((reg_rd08(RBTX4927_SW_RESET_ENABLE) & 697 while ((readb(RBTX4927_SW_RESET_ENABLE) &
691 RBTX4927_SW_RESET_ENABLE_SET) == 0x00); 698 RBTX4927_SW_RESET_ENABLE_SET) == 0x00);
692 699
693 /* do a s/w reset */ 700 /* do a s/w reset */
694 reg_wr08(RBTX4927_SW_RESET_DO, RBTX4927_SW_RESET_DO_SET); 701 writeb(RBTX4927_SW_RESET_DO_SET, RBTX4927_SW_RESET_DO);
695 702
696 /* do something passive while waiting for reset */ 703 /* do something passive while waiting for reset */
697 local_irq_disable(); 704 local_irq_disable();
698 while (1) 705 wait_forever();
699 asm_wait();
700
701 /* no return */ 706 /* no return */
702} 707}
703 708
@@ -706,9 +711,7 @@ void toshiba_rbtx4927_halt(void)
706{ 711{
707 printk(KERN_NOTICE "System Halted\n"); 712 printk(KERN_NOTICE "System Halted\n");
708 local_irq_disable(); 713 local_irq_disable();
709 while (1) { 714 wait_forever();
710 asm_wait();
711 }
712 /* no return */ 715 /* no return */
713} 716}
714 717
@@ -720,7 +723,7 @@ void toshiba_rbtx4927_power_off(void)
720 723
721void __init toshiba_rbtx4927_setup(void) 724void __init toshiba_rbtx4927_setup(void)
722{ 725{
723 vu32 cp0_config; 726 u32 cp0_config;
724 char *argptr; 727 char *argptr;
725 728
726 printk("CPU is %s\n", toshiba_name); 729 printk("CPU is %s\n", toshiba_name);
@@ -747,15 +750,6 @@ void __init toshiba_rbtx4927_setup(void)
747 } 750 }
748#endif 751#endif
749 752
750 /* setup serial stuff */
751 TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
752 ":Setting up tx4927 sio.\n");
753 TX4927_WR(0xff1ff314, 0x00000000); /* h/w flow control off */
754 TX4927_WR(0xff1ff414, 0x00000000); /* h/w flow control off */
755
756 TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
757 "+\n");
758
759 set_io_port_base(KSEG1 + TBTX4927_ISA_IO_OFFSET); 753 set_io_port_base(KSEG1 + TBTX4927_ISA_IO_OFFSET);
760 TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP, 754 TOSHIBA_RBTX4927_SETUP_DPRINTK(TOSHIBA_RBTX4927_SETUP_SETUP,
761 ":mips_io_port_base=0x%08lx\n", 755 ":mips_io_port_base=0x%08lx\n",
diff --git a/arch/mips/tx4938/common/setup.c b/arch/mips/tx4938/common/setup.c
index 142abf453e40..ab4082267553 100644
--- a/arch/mips/tx4938/common/setup.c
+++ b/arch/mips/tx4938/common/setup.c
@@ -34,25 +34,16 @@
34#include <asm/tx4938/rbtx4938.h> 34#include <asm/tx4938/rbtx4938.h>
35 35
36extern void toshiba_rbtx4938_setup(void); 36extern void toshiba_rbtx4938_setup(void);
37extern void rbtx4938_time_init(void);
38 37
39void __init tx4938_setup(void); 38void __init tx4938_setup(void);
40void __init tx4938_time_init(void);
41void dump_cp0(char *key); 39void dump_cp0(char *key);
42 40
43void __init 41void __init
44plat_mem_setup(void) 42plat_mem_setup(void)
45{ 43{
46 board_time_init = tx4938_time_init;
47 toshiba_rbtx4938_setup(); 44 toshiba_rbtx4938_setup();
48} 45}
49 46
50void __init
51tx4938_time_init(void)
52{
53 rbtx4938_time_init();
54}
55
56void __init plat_timer_setup(struct irqaction *irq) 47void __init plat_timer_setup(struct irqaction *irq)
57{ 48{
58 setup_irq(TX4938_IRQ_CPU_TIMER, irq); 49 setup_irq(TX4938_IRQ_CPU_TIMER, irq);
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/prom.c b/arch/mips/tx4938/toshiba_rbtx4938/prom.c
index 7dc6a0aae21c..69f21c1b7942 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/prom.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/prom.c
@@ -47,7 +47,6 @@ void __init prom_init(void)
47#ifndef CONFIG_TX4938_NAND_BOOT 47#ifndef CONFIG_TX4938_NAND_BOOT
48 prom_init_cmdline(); 48 prom_init_cmdline();
49#endif 49#endif
50 mips_machgroup = MACH_GROUP_TOSHIBA;
51 mips_machtype = MACH_TOSHIBA_RBTX4938; 50 mips_machtype = MACH_TOSHIBA_RBTX4938;
52 51
53 msize = tx4938_get_mem_size(); 52 msize = tx4938_get_mem_size();
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
index f236b1ff8923..ceecaf498957 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -39,7 +39,6 @@
39#include <asm/tx4938/spi.h> 39#include <asm/tx4938/spi.h>
40#include <asm/gpio.h> 40#include <asm/gpio.h>
41 41
42extern void rbtx4938_time_init(void) __init;
43extern char * __init prom_getcmdline(void); 42extern char * __init prom_getcmdline(void);
44static inline void tx4938_report_pcic_status1(struct tx4938_pcic_reg *pcicptr); 43static inline void tx4938_report_pcic_status1(struct tx4938_pcic_reg *pcicptr);
45 44
@@ -458,9 +457,9 @@ extern struct pci_controller tx4938_pci_controller[];
458static int __init tx4938_pcibios_init(void) 457static int __init tx4938_pcibios_init(void)
459{ 458{
460 unsigned long mem_base[2]; 459 unsigned long mem_base[2];
461 unsigned long mem_size[2] = {TX4938_PCIMEM_SIZE_0,TX4938_PCIMEM_SIZE_1}; /* MAX 128M,64K */ 460 unsigned long mem_size[2] = {TX4938_PCIMEM_SIZE_0, TX4938_PCIMEM_SIZE_1}; /* MAX 128M,64K */
462 unsigned long io_base[2]; 461 unsigned long io_base[2];
463 unsigned long io_size[2] = {TX4938_PCIIO_SIZE_0,TX4938_PCIIO_SIZE_1}; /* MAX 16M,64K */ 462 unsigned long io_size[2] = {TX4938_PCIIO_SIZE_0, TX4938_PCIIO_SIZE_1}; /* MAX 16M,64K */
464 /* TX4938 PCIC1: 64K MEM/IO is enough for ETH0,ETH1 */ 463 /* TX4938 PCIC1: 64K MEM/IO is enough for ETH0,ETH1 */
465 int extarb = !(tx4938_ccfgptr->ccfg & TX4938_CCFG_PCIXARB); 464 int extarb = !(tx4938_ccfgptr->ccfg & TX4938_CCFG_PCIXARB);
466 465
@@ -856,7 +855,7 @@ void tx4938_report_pcic_status(void)
856/* We use onchip r4k counter or TMR timer as our system wide timer 855/* We use onchip r4k counter or TMR timer as our system wide timer
857 * interrupt running at 100HZ. */ 856 * interrupt running at 100HZ. */
858 857
859void __init rbtx4938_time_init(void) 858void __init plat_time_init(void)
860{ 859{
861 mips_hpt_frequency = txx9_cpu_clock / 2; 860 mips_hpt_frequency = txx9_cpu_clock / 2;
862} 861}
diff --git a/arch/mips/vr41xx/common/bcu.c b/arch/mips/vr41xx/common/bcu.c
index ff272b2e8395..d77c330a0d59 100644
--- a/arch/mips/vr41xx/common/bcu.c
+++ b/arch/mips/vr41xx/common/bcu.c
@@ -70,7 +70,7 @@ EXPORT_SYMBOL_GPL(vr41xx_get_tclock_frequency);
70 70
71static inline uint16_t read_clkspeed(void) 71static inline uint16_t read_clkspeed(void)
72{ 72{
73 switch (current_cpu_data.cputype) { 73 switch (current_cpu_type()) {
74 case CPU_VR4111: 74 case CPU_VR4111:
75 case CPU_VR4121: return readw(CLKSPEEDREG_TYPE1); 75 case CPU_VR4121: return readw(CLKSPEEDREG_TYPE1);
76 case CPU_VR4122: 76 case CPU_VR4122:
@@ -88,7 +88,7 @@ static inline unsigned long calculate_pclock(uint16_t clkspeed)
88{ 88{
89 unsigned long pclock = 0; 89 unsigned long pclock = 0;
90 90
91 switch (current_cpu_data.cputype) { 91 switch (current_cpu_type()) {
92 case CPU_VR4111: 92 case CPU_VR4111:
93 case CPU_VR4121: 93 case CPU_VR4121:
94 pclock = 18432000 * 64; 94 pclock = 18432000 * 64;
@@ -138,7 +138,7 @@ static inline unsigned long calculate_vtclock(uint16_t clkspeed, unsigned long p
138{ 138{
139 unsigned long vtclock = 0; 139 unsigned long vtclock = 0;
140 140
141 switch (current_cpu_data.cputype) { 141 switch (current_cpu_type()) {
142 case CPU_VR4111: 142 case CPU_VR4111:
143 /* The NEC VR4111 doesn't have the VTClock. */ 143 /* The NEC VR4111 doesn't have the VTClock. */
144 break; 144 break;
@@ -180,7 +180,7 @@ static inline unsigned long calculate_tclock(uint16_t clkspeed, unsigned long pc
180{ 180{
181 unsigned long tclock = 0; 181 unsigned long tclock = 0;
182 182
183 switch (current_cpu_data.cputype) { 183 switch (current_cpu_type()) {
184 case CPU_VR4111: 184 case CPU_VR4111:
185 if (!(clkspeed & DIV2B)) 185 if (!(clkspeed & DIV2B))
186 tclock = pclock / 2; 186 tclock = pclock / 2;
diff --git a/arch/mips/vr41xx/common/cmu.c b/arch/mips/vr41xx/common/cmu.c
index 657c5133c933..ad0e8e3409d9 100644
--- a/arch/mips/vr41xx/common/cmu.c
+++ b/arch/mips/vr41xx/common/cmu.c
@@ -95,8 +95,8 @@ void vr41xx_supply_clock(vr41xx_clock_t clock)
95 cmuclkmsk |= MSKFIR | MSKFFIR; 95 cmuclkmsk |= MSKFIR | MSKFFIR;
96 break; 96 break;
97 case DSIU_CLOCK: 97 case DSIU_CLOCK:
98 if (current_cpu_data.cputype == CPU_VR4111 || 98 if (current_cpu_type() == CPU_VR4111 ||
99 current_cpu_data.cputype == CPU_VR4121) 99 current_cpu_type() == CPU_VR4121)
100 cmuclkmsk |= MSKDSIU; 100 cmuclkmsk |= MSKDSIU;
101 else 101 else
102 cmuclkmsk |= MSKSIU | MSKDSIU; 102 cmuclkmsk |= MSKSIU | MSKDSIU;
@@ -146,8 +146,8 @@ void vr41xx_mask_clock(vr41xx_clock_t clock)
146 cmuclkmsk &= ~MSKPIU; 146 cmuclkmsk &= ~MSKPIU;
147 break; 147 break;
148 case SIU_CLOCK: 148 case SIU_CLOCK:
149 if (current_cpu_data.cputype == CPU_VR4111 || 149 if (current_cpu_type() == CPU_VR4111 ||
150 current_cpu_data.cputype == CPU_VR4121) { 150 current_cpu_type() == CPU_VR4121) {
151 cmuclkmsk &= ~(MSKSIU | MSKSSIU); 151 cmuclkmsk &= ~(MSKSIU | MSKSSIU);
152 } else { 152 } else {
153 if (cmuclkmsk & MSKDSIU) 153 if (cmuclkmsk & MSKDSIU)
@@ -166,8 +166,8 @@ void vr41xx_mask_clock(vr41xx_clock_t clock)
166 cmuclkmsk &= ~(MSKFIR | MSKFFIR); 166 cmuclkmsk &= ~(MSKFIR | MSKFFIR);
167 break; 167 break;
168 case DSIU_CLOCK: 168 case DSIU_CLOCK:
169 if (current_cpu_data.cputype == CPU_VR4111 || 169 if (current_cpu_type() == CPU_VR4111 ||
170 current_cpu_data.cputype == CPU_VR4121) { 170 current_cpu_type() == CPU_VR4121) {
171 cmuclkmsk &= ~MSKDSIU; 171 cmuclkmsk &= ~MSKDSIU;
172 } else { 172 } else {
173 if (cmuclkmsk & MSKSSIU) 173 if (cmuclkmsk & MSKSSIU)
@@ -216,7 +216,7 @@ static int __init vr41xx_cmu_init(void)
216{ 216{
217 unsigned long start, size; 217 unsigned long start, size;
218 218
219 switch (current_cpu_data.cputype) { 219 switch (current_cpu_type()) {
220 case CPU_VR4111: 220 case CPU_VR4111:
221 case CPU_VR4121: 221 case CPU_VR4121:
222 start = CMU_TYPE1_BASE; 222 start = CMU_TYPE1_BASE;
@@ -246,7 +246,7 @@ static int __init vr41xx_cmu_init(void)
246 } 246 }
247 247
248 cmuclkmsk = cmu_read(CMUCLKMSK); 248 cmuclkmsk = cmu_read(CMUCLKMSK);
249 if (current_cpu_data.cputype == CPU_VR4133) 249 if (current_cpu_type() == CPU_VR4133)
250 cmuclkmsk2 = cmu_read(CMUCLKMSK2); 250 cmuclkmsk2 = cmu_read(CMUCLKMSK2);
251 251
252 spin_lock_init(&cmu_lock); 252 spin_lock_init(&cmu_lock);
diff --git a/arch/mips/vr41xx/common/giu.c b/arch/mips/vr41xx/common/giu.c
index d21f6f2d22a3..2b272f1496fe 100644
--- a/arch/mips/vr41xx/common/giu.c
+++ b/arch/mips/vr41xx/common/giu.c
@@ -81,7 +81,7 @@ static int __init vr41xx_giu_add(void)
81 if (!pdev) 81 if (!pdev)
82 return -ENOMEM; 82 return -ENOMEM;
83 83
84 switch (current_cpu_data.cputype) { 84 switch (current_cpu_type()) {
85 case CPU_VR4111: 85 case CPU_VR4111:
86 case CPU_VR4121: 86 case CPU_VR4121:
87 pdev->id = GPIO_50PINS_PULLUPDOWN; 87 pdev->id = GPIO_50PINS_PULLUPDOWN;
diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c
index adabc6bad440..1899601e5862 100644
--- a/arch/mips/vr41xx/common/icu.c
+++ b/arch/mips/vr41xx/common/icu.c
@@ -157,8 +157,8 @@ void vr41xx_enable_piuint(uint16_t mask)
157 struct irq_desc *desc = irq_desc + PIU_IRQ; 157 struct irq_desc *desc = irq_desc + PIU_IRQ;
158 unsigned long flags; 158 unsigned long flags;
159 159
160 if (current_cpu_data.cputype == CPU_VR4111 || 160 if (current_cpu_type() == CPU_VR4111 ||
161 current_cpu_data.cputype == CPU_VR4121) { 161 current_cpu_type() == CPU_VR4121) {
162 spin_lock_irqsave(&desc->lock, flags); 162 spin_lock_irqsave(&desc->lock, flags);
163 icu1_set(MPIUINTREG, mask); 163 icu1_set(MPIUINTREG, mask);
164 spin_unlock_irqrestore(&desc->lock, flags); 164 spin_unlock_irqrestore(&desc->lock, flags);
@@ -172,8 +172,8 @@ void vr41xx_disable_piuint(uint16_t mask)
172 struct irq_desc *desc = irq_desc + PIU_IRQ; 172 struct irq_desc *desc = irq_desc + PIU_IRQ;
173 unsigned long flags; 173 unsigned long flags;
174 174
175 if (current_cpu_data.cputype == CPU_VR4111 || 175 if (current_cpu_type() == CPU_VR4111 ||
176 current_cpu_data.cputype == CPU_VR4121) { 176 current_cpu_type() == CPU_VR4121) {
177 spin_lock_irqsave(&desc->lock, flags); 177 spin_lock_irqsave(&desc->lock, flags);
178 icu1_clear(MPIUINTREG, mask); 178 icu1_clear(MPIUINTREG, mask);
179 spin_unlock_irqrestore(&desc->lock, flags); 179 spin_unlock_irqrestore(&desc->lock, flags);
@@ -187,8 +187,8 @@ void vr41xx_enable_aiuint(uint16_t mask)
187 struct irq_desc *desc = irq_desc + AIU_IRQ; 187 struct irq_desc *desc = irq_desc + AIU_IRQ;
188 unsigned long flags; 188 unsigned long flags;
189 189
190 if (current_cpu_data.cputype == CPU_VR4111 || 190 if (current_cpu_type() == CPU_VR4111 ||
191 current_cpu_data.cputype == CPU_VR4121) { 191 current_cpu_type() == CPU_VR4121) {
192 spin_lock_irqsave(&desc->lock, flags); 192 spin_lock_irqsave(&desc->lock, flags);
193 icu1_set(MAIUINTREG, mask); 193 icu1_set(MAIUINTREG, mask);
194 spin_unlock_irqrestore(&desc->lock, flags); 194 spin_unlock_irqrestore(&desc->lock, flags);
@@ -202,8 +202,8 @@ void vr41xx_disable_aiuint(uint16_t mask)
202 struct irq_desc *desc = irq_desc + AIU_IRQ; 202 struct irq_desc *desc = irq_desc + AIU_IRQ;
203 unsigned long flags; 203 unsigned long flags;
204 204
205 if (current_cpu_data.cputype == CPU_VR4111 || 205 if (current_cpu_type() == CPU_VR4111 ||
206 current_cpu_data.cputype == CPU_VR4121) { 206 current_cpu_type() == CPU_VR4121) {
207 spin_lock_irqsave(&desc->lock, flags); 207 spin_lock_irqsave(&desc->lock, flags);
208 icu1_clear(MAIUINTREG, mask); 208 icu1_clear(MAIUINTREG, mask);
209 spin_unlock_irqrestore(&desc->lock, flags); 209 spin_unlock_irqrestore(&desc->lock, flags);
@@ -217,8 +217,8 @@ void vr41xx_enable_kiuint(uint16_t mask)
217 struct irq_desc *desc = irq_desc + KIU_IRQ; 217 struct irq_desc *desc = irq_desc + KIU_IRQ;
218 unsigned long flags; 218 unsigned long flags;
219 219
220 if (current_cpu_data.cputype == CPU_VR4111 || 220 if (current_cpu_type() == CPU_VR4111 ||
221 current_cpu_data.cputype == CPU_VR4121) { 221 current_cpu_type() == CPU_VR4121) {
222 spin_lock_irqsave(&desc->lock, flags); 222 spin_lock_irqsave(&desc->lock, flags);
223 icu1_set(MKIUINTREG, mask); 223 icu1_set(MKIUINTREG, mask);
224 spin_unlock_irqrestore(&desc->lock, flags); 224 spin_unlock_irqrestore(&desc->lock, flags);
@@ -232,8 +232,8 @@ void vr41xx_disable_kiuint(uint16_t mask)
232 struct irq_desc *desc = irq_desc + KIU_IRQ; 232 struct irq_desc *desc = irq_desc + KIU_IRQ;
233 unsigned long flags; 233 unsigned long flags;
234 234
235 if (current_cpu_data.cputype == CPU_VR4111 || 235 if (current_cpu_type() == CPU_VR4111 ||
236 current_cpu_data.cputype == CPU_VR4121) { 236 current_cpu_type() == CPU_VR4121) {
237 spin_lock_irqsave(&desc->lock, flags); 237 spin_lock_irqsave(&desc->lock, flags);
238 icu1_clear(MKIUINTREG, mask); 238 icu1_clear(MKIUINTREG, mask);
239 spin_unlock_irqrestore(&desc->lock, flags); 239 spin_unlock_irqrestore(&desc->lock, flags);
@@ -319,9 +319,9 @@ void vr41xx_enable_pciint(void)
319 struct irq_desc *desc = irq_desc + PCI_IRQ; 319 struct irq_desc *desc = irq_desc + PCI_IRQ;
320 unsigned long flags; 320 unsigned long flags;
321 321
322 if (current_cpu_data.cputype == CPU_VR4122 || 322 if (current_cpu_type() == CPU_VR4122 ||
323 current_cpu_data.cputype == CPU_VR4131 || 323 current_cpu_type() == CPU_VR4131 ||
324 current_cpu_data.cputype == CPU_VR4133) { 324 current_cpu_type() == CPU_VR4133) {
325 spin_lock_irqsave(&desc->lock, flags); 325 spin_lock_irqsave(&desc->lock, flags);
326 icu2_write(MPCIINTREG, PCIINT0); 326 icu2_write(MPCIINTREG, PCIINT0);
327 spin_unlock_irqrestore(&desc->lock, flags); 327 spin_unlock_irqrestore(&desc->lock, flags);
@@ -335,9 +335,9 @@ void vr41xx_disable_pciint(void)
335 struct irq_desc *desc = irq_desc + PCI_IRQ; 335 struct irq_desc *desc = irq_desc + PCI_IRQ;
336 unsigned long flags; 336 unsigned long flags;
337 337
338 if (current_cpu_data.cputype == CPU_VR4122 || 338 if (current_cpu_type() == CPU_VR4122 ||
339 current_cpu_data.cputype == CPU_VR4131 || 339 current_cpu_type() == CPU_VR4131 ||
340 current_cpu_data.cputype == CPU_VR4133) { 340 current_cpu_type() == CPU_VR4133) {
341 spin_lock_irqsave(&desc->lock, flags); 341 spin_lock_irqsave(&desc->lock, flags);
342 icu2_write(MPCIINTREG, 0); 342 icu2_write(MPCIINTREG, 0);
343 spin_unlock_irqrestore(&desc->lock, flags); 343 spin_unlock_irqrestore(&desc->lock, flags);
@@ -351,9 +351,9 @@ void vr41xx_enable_scuint(void)
351 struct irq_desc *desc = irq_desc + SCU_IRQ; 351 struct irq_desc *desc = irq_desc + SCU_IRQ;
352 unsigned long flags; 352 unsigned long flags;
353 353
354 if (current_cpu_data.cputype == CPU_VR4122 || 354 if (current_cpu_type() == CPU_VR4122 ||
355 current_cpu_data.cputype == CPU_VR4131 || 355 current_cpu_type() == CPU_VR4131 ||
356 current_cpu_data.cputype == CPU_VR4133) { 356 current_cpu_type() == CPU_VR4133) {
357 spin_lock_irqsave(&desc->lock, flags); 357 spin_lock_irqsave(&desc->lock, flags);
358 icu2_write(MSCUINTREG, SCUINT0); 358 icu2_write(MSCUINTREG, SCUINT0);
359 spin_unlock_irqrestore(&desc->lock, flags); 359 spin_unlock_irqrestore(&desc->lock, flags);
@@ -367,9 +367,9 @@ void vr41xx_disable_scuint(void)
367 struct irq_desc *desc = irq_desc + SCU_IRQ; 367 struct irq_desc *desc = irq_desc + SCU_IRQ;
368 unsigned long flags; 368 unsigned long flags;
369 369
370 if (current_cpu_data.cputype == CPU_VR4122 || 370 if (current_cpu_type() == CPU_VR4122 ||
371 current_cpu_data.cputype == CPU_VR4131 || 371 current_cpu_type() == CPU_VR4131 ||
372 current_cpu_data.cputype == CPU_VR4133) { 372 current_cpu_type() == CPU_VR4133) {
373 spin_lock_irqsave(&desc->lock, flags); 373 spin_lock_irqsave(&desc->lock, flags);
374 icu2_write(MSCUINTREG, 0); 374 icu2_write(MSCUINTREG, 0);
375 spin_unlock_irqrestore(&desc->lock, flags); 375 spin_unlock_irqrestore(&desc->lock, flags);
@@ -383,9 +383,9 @@ void vr41xx_enable_csiint(uint16_t mask)
383 struct irq_desc *desc = irq_desc + CSI_IRQ; 383 struct irq_desc *desc = irq_desc + CSI_IRQ;
384 unsigned long flags; 384 unsigned long flags;
385 385
386 if (current_cpu_data.cputype == CPU_VR4122 || 386 if (current_cpu_type() == CPU_VR4122 ||
387 current_cpu_data.cputype == CPU_VR4131 || 387 current_cpu_type() == CPU_VR4131 ||
388 current_cpu_data.cputype == CPU_VR4133) { 388 current_cpu_type() == CPU_VR4133) {
389 spin_lock_irqsave(&desc->lock, flags); 389 spin_lock_irqsave(&desc->lock, flags);
390 icu2_set(MCSIINTREG, mask); 390 icu2_set(MCSIINTREG, mask);
391 spin_unlock_irqrestore(&desc->lock, flags); 391 spin_unlock_irqrestore(&desc->lock, flags);
@@ -399,9 +399,9 @@ void vr41xx_disable_csiint(uint16_t mask)
399 struct irq_desc *desc = irq_desc + CSI_IRQ; 399 struct irq_desc *desc = irq_desc + CSI_IRQ;
400 unsigned long flags; 400 unsigned long flags;
401 401
402 if (current_cpu_data.cputype == CPU_VR4122 || 402 if (current_cpu_type() == CPU_VR4122 ||
403 current_cpu_data.cputype == CPU_VR4131 || 403 current_cpu_type() == CPU_VR4131 ||
404 current_cpu_data.cputype == CPU_VR4133) { 404 current_cpu_type() == CPU_VR4133) {
405 spin_lock_irqsave(&desc->lock, flags); 405 spin_lock_irqsave(&desc->lock, flags);
406 icu2_clear(MCSIINTREG, mask); 406 icu2_clear(MCSIINTREG, mask);
407 spin_unlock_irqrestore(&desc->lock, flags); 407 spin_unlock_irqrestore(&desc->lock, flags);
@@ -415,9 +415,9 @@ void vr41xx_enable_bcuint(void)
415 struct irq_desc *desc = irq_desc + BCU_IRQ; 415 struct irq_desc *desc = irq_desc + BCU_IRQ;
416 unsigned long flags; 416 unsigned long flags;
417 417
418 if (current_cpu_data.cputype == CPU_VR4122 || 418 if (current_cpu_type() == CPU_VR4122 ||
419 current_cpu_data.cputype == CPU_VR4131 || 419 current_cpu_type() == CPU_VR4131 ||
420 current_cpu_data.cputype == CPU_VR4133) { 420 current_cpu_type() == CPU_VR4133) {
421 spin_lock_irqsave(&desc->lock, flags); 421 spin_lock_irqsave(&desc->lock, flags);
422 icu2_write(MBCUINTREG, BCUINTR); 422 icu2_write(MBCUINTREG, BCUINTR);
423 spin_unlock_irqrestore(&desc->lock, flags); 423 spin_unlock_irqrestore(&desc->lock, flags);
@@ -431,9 +431,9 @@ void vr41xx_disable_bcuint(void)
431 struct irq_desc *desc = irq_desc + BCU_IRQ; 431 struct irq_desc *desc = irq_desc + BCU_IRQ;
432 unsigned long flags; 432 unsigned long flags;
433 433
434 if (current_cpu_data.cputype == CPU_VR4122 || 434 if (current_cpu_type() == CPU_VR4122 ||
435 current_cpu_data.cputype == CPU_VR4131 || 435 current_cpu_type() == CPU_VR4131 ||
436 current_cpu_data.cputype == CPU_VR4133) { 436 current_cpu_type() == CPU_VR4133) {
437 spin_lock_irqsave(&desc->lock, flags); 437 spin_lock_irqsave(&desc->lock, flags);
438 icu2_write(MBCUINTREG, 0); 438 icu2_write(MBCUINTREG, 0);
439 spin_unlock_irqrestore(&desc->lock, flags); 439 spin_unlock_irqrestore(&desc->lock, flags);
@@ -608,7 +608,7 @@ int vr41xx_set_intassign(unsigned int irq, unsigned char intassign)
608{ 608{
609 int retval = -EINVAL; 609 int retval = -EINVAL;
610 610
611 if (current_cpu_data.cputype != CPU_VR4133) 611 if (current_cpu_type() != CPU_VR4133)
612 return -EINVAL; 612 return -EINVAL;
613 613
614 if (intassign > INTASSIGN_MAX) 614 if (intassign > INTASSIGN_MAX)
@@ -665,7 +665,7 @@ static int __init vr41xx_icu_init(void)
665 unsigned long icu1_start, icu2_start; 665 unsigned long icu1_start, icu2_start;
666 int i; 666 int i;
667 667
668 switch (current_cpu_data.cputype) { 668 switch (current_cpu_type()) {
669 case CPU_VR4111: 669 case CPU_VR4111:
670 case CPU_VR4121: 670 case CPU_VR4121:
671 icu1_start = ICU1_TYPE1_BASE; 671 icu1_start = ICU1_TYPE1_BASE;
diff --git a/arch/mips/vr41xx/common/init.c b/arch/mips/vr41xx/common/init.c
index 4f97e0ba9e24..407cec203b29 100644
--- a/arch/mips/vr41xx/common/init.c
+++ b/arch/mips/vr41xx/common/init.c
@@ -36,7 +36,7 @@ static void __init iomem_resource_init(void)
36 iomem_resource.end = IO_MEM_RESOURCE_END; 36 iomem_resource.end = IO_MEM_RESOURCE_END;
37} 37}
38 38
39static void __init setup_timer_frequency(void) 39void __init plat_time_init(void)
40{ 40{
41 unsigned long tclock; 41 unsigned long tclock;
42 42
@@ -53,16 +53,10 @@ void __init plat_timer_setup(struct irqaction *irq)
53 setup_irq(TIMER_IRQ, irq); 53 setup_irq(TIMER_IRQ, irq);
54} 54}
55 55
56static void __init timer_init(void)
57{
58 board_time_init = setup_timer_frequency;
59}
60
61void __init plat_mem_setup(void) 56void __init plat_mem_setup(void)
62{ 57{
63 vr41xx_calculate_clock_frequency(); 58 vr41xx_calculate_clock_frequency();
64 59
65 timer_init();
66 iomem_resource_init(); 60 iomem_resource_init();
67} 61}
68 62
diff --git a/arch/mips/vr41xx/common/pmu.c b/arch/mips/vr41xx/common/pmu.c
index 5e469796413f..028aaf75eb21 100644
--- a/arch/mips/vr41xx/common/pmu.c
+++ b/arch/mips/vr41xx/common/pmu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * pmu.c, Power Management Unit routines for NEC VR4100 series. 2 * pmu.c, Power Management Unit routines for NEC VR4100 series.
3 * 3 *
4 * Copyright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2003-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
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
@@ -22,11 +22,13 @@
22#include <linux/ioport.h> 22#include <linux/ioport.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <linux/pm.h> 24#include <linux/pm.h>
25#include <linux/smp.h> 25#include <linux/sched.h>
26#include <linux/types.h> 26#include <linux/types.h>
27 27
28#include <asm/cacheflush.h>
28#include <asm/cpu.h> 29#include <asm/cpu.h>
29#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/processor.h>
30#include <asm/reboot.h> 32#include <asm/reboot.h>
31#include <asm/system.h> 33#include <asm/system.h>
32 34
@@ -44,11 +46,23 @@ static void __iomem *pmu_base;
44#define pmu_read(offset) readw(pmu_base + (offset)) 46#define pmu_read(offset) readw(pmu_base + (offset))
45#define pmu_write(offset, value) writew((value), pmu_base + (offset)) 47#define pmu_write(offset, value) writew((value), pmu_base + (offset))
46 48
49static void vr41xx_cpu_wait(void)
50{
51 local_irq_disable();
52 if (!need_resched())
53 /*
54 * "standby" sets IE bit of the CP0_STATUS to 1.
55 */
56 __asm__("standby;\n");
57 else
58 local_irq_enable();
59}
60
47static inline void software_reset(void) 61static inline void software_reset(void)
48{ 62{
49 uint16_t pmucnt2; 63 uint16_t pmucnt2;
50 64
51 switch (current_cpu_data.cputype) { 65 switch (current_cpu_type()) {
52 case CPU_VR4122: 66 case CPU_VR4122:
53 case CPU_VR4131: 67 case CPU_VR4131:
54 case CPU_VR4133: 68 case CPU_VR4133:
@@ -57,6 +71,11 @@ static inline void software_reset(void)
57 pmu_write(PMUCNT2REG, pmucnt2); 71 pmu_write(PMUCNT2REG, pmucnt2);
58 break; 72 break;
59 default: 73 default:
74 set_c0_status(ST0_BEV | ST0_ERL);
75 change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
76 flush_cache_all();
77 write_c0_wired(0);
78 __asm__("jr %0"::"r"(0xbfc00000));
60 break; 79 break;
61 } 80 }
62} 81}
@@ -65,7 +84,6 @@ static void vr41xx_restart(char *command)
65{ 84{
66 local_irq_disable(); 85 local_irq_disable();
67 software_reset(); 86 software_reset();
68 printk(KERN_NOTICE "\nYou can reset your system\n");
69 while (1) ; 87 while (1) ;
70} 88}
71 89
@@ -73,21 +91,14 @@ static void vr41xx_halt(void)
73{ 91{
74 local_irq_disable(); 92 local_irq_disable();
75 printk(KERN_NOTICE "\nYou can turn off the power supply\n"); 93 printk(KERN_NOTICE "\nYou can turn off the power supply\n");
76 while (1) ; 94 __asm__("hibernate;\n");
77}
78
79static void vr41xx_power_off(void)
80{
81 local_irq_disable();
82 printk(KERN_NOTICE "\nYou can turn off the power supply\n");
83 while (1) ;
84} 95}
85 96
86static int __init vr41xx_pmu_init(void) 97static int __init vr41xx_pmu_init(void)
87{ 98{
88 unsigned long start, size; 99 unsigned long start, size;
89 100
90 switch (current_cpu_data.cputype) { 101 switch (current_cpu_type()) {
91 case CPU_VR4111: 102 case CPU_VR4111:
92 case CPU_VR4121: 103 case CPU_VR4121:
93 start = PMU_TYPE1_BASE; 104 start = PMU_TYPE1_BASE;
@@ -113,9 +124,10 @@ static int __init vr41xx_pmu_init(void)
113 return -EBUSY; 124 return -EBUSY;
114 } 125 }
115 126
127 cpu_wait = vr41xx_cpu_wait;
116 _machine_restart = vr41xx_restart; 128 _machine_restart = vr41xx_restart;
117 _machine_halt = vr41xx_halt; 129 _machine_halt = vr41xx_halt;
118 pm_power_off = vr41xx_power_off; 130 pm_power_off = vr41xx_halt;
119 131
120 return 0; 132 return 0;
121} 133}
diff --git a/arch/mips/vr41xx/common/rtc.c b/arch/mips/vr41xx/common/rtc.c
index cce605b3d688..9f26c14edcac 100644
--- a/arch/mips/vr41xx/common/rtc.c
+++ b/arch/mips/vr41xx/common/rtc.c
@@ -82,7 +82,7 @@ static int __init vr41xx_rtc_add(void)
82 if (!pdev) 82 if (!pdev)
83 return -ENOMEM; 83 return -ENOMEM;
84 84
85 switch (current_cpu_data.cputype) { 85 switch (current_cpu_type()) {
86 case CPU_VR4111: 86 case CPU_VR4111:
87 case CPU_VR4121: 87 case CPU_VR4121:
88 res = rtc_type1_resource; 88 res = rtc_type1_resource;
diff --git a/arch/mips/vr41xx/common/siu.c b/arch/mips/vr41xx/common/siu.c
index a1e774142163..b735f45b25f0 100644
--- a/arch/mips/vr41xx/common/siu.c
+++ b/arch/mips/vr41xx/common/siu.c
@@ -83,7 +83,7 @@ static int __init vr41xx_siu_add(void)
83 if (!pdev) 83 if (!pdev)
84 return -ENOMEM; 84 return -ENOMEM;
85 85
86 switch (current_cpu_data.cputype) { 86 switch (current_cpu_type()) {
87 case CPU_VR4111: 87 case CPU_VR4111:
88 case CPU_VR4121: 88 case CPU_VR4121:
89 pdev->dev.platform_data = siu_type1_ports; 89 pdev->dev.platform_data = siu_type1_ports;
diff --git a/arch/mips/vr41xx/nec-cmbvr4133/init.c b/arch/mips/vr41xx/nec-cmbvr4133/init.c
index ae1af6b21c45..7c5e18ee2231 100644
--- a/arch/mips/vr41xx/nec-cmbvr4133/init.c
+++ b/arch/mips/vr41xx/nec-cmbvr4133/init.c
@@ -36,7 +36,7 @@ void disable_pcnet(void)
36 */ 36 */
37 37
38 writel((2 << 16) | 38 writel((2 << 16) |
39 (PCI_DEVFN(1,0) << 8) | 39 (PCI_DEVFN(1, 0) << 8) |
40 (0 & 0xfc) | 40 (0 & 0xfc) |
41 1UL, 41 1UL,
42 PCICONFAREG); 42 PCICONFAREG);
@@ -44,7 +44,7 @@ void disable_pcnet(void)
44 data = readl(PCICONFDREG); 44 data = readl(PCICONFDREG);
45 45
46 writel((2 << 16) | 46 writel((2 << 16) |
47 (PCI_DEVFN(1,0) << 8) | 47 (PCI_DEVFN(1, 0) << 8) |
48 (4 & 0xfc) | 48 (4 & 0xfc) |
49 1UL, 49 1UL,
50 PCICONFAREG); 50 PCICONFAREG);
@@ -52,7 +52,7 @@ void disable_pcnet(void)
52 data = readl(PCICONFDREG); 52 data = readl(PCICONFDREG);
53 53
54 writel((2 << 16) | 54 writel((2 << 16) |
55 (PCI_DEVFN(1,0) << 8) | 55 (PCI_DEVFN(1, 0) << 8) |
56 (4 & 0xfc) | 56 (4 & 0xfc) |
57 1UL, 57 1UL,
58 PCICONFAREG); 58 PCICONFAREG);
diff --git a/arch/mips/vr41xx/nec-cmbvr4133/m1535plus.c b/arch/mips/vr41xx/nec-cmbvr4133/m1535plus.c
index f45caccedc07..1341f3287d04 100644
--- a/arch/mips/vr41xx/nec-cmbvr4133/m1535plus.c
+++ b/arch/mips/vr41xx/nec-cmbvr4133/m1535plus.c
@@ -38,7 +38,7 @@
38 outb_p((dev_no), DATA_PORT(port)); \ 38 outb_p((dev_no), DATA_PORT(port)); \
39 } while(0) 39 } while(0)
40 40
41#define WRITE_CONFIG_DATA(port,index,data) \ 41#define WRITE_CONFIG_DATA(port, index, data) \
42 do { \ 42 do { \
43 outb_p((index), INDEX_PORT(port)); \ 43 outb_p((index), INDEX_PORT(port)); \
44 outb_p((data), DATA_PORT(port)); \ 44 outb_p((data), DATA_PORT(port)); \
@@ -206,8 +206,8 @@ static inline u16 ali_config_readw(u8 reg, int devfn)
206int vr4133_rockhopper = 0; 206int vr4133_rockhopper = 0;
207void __init ali_m5229_preinit(void) 207void __init ali_m5229_preinit(void)
208{ 208{
209 if (ali_config_readw(PCI_VENDOR_ID,16) == PCI_VENDOR_ID_AL && 209 if (ali_config_readw(PCI_VENDOR_ID, 16) == PCI_VENDOR_ID_AL &&
210 ali_config_readw(PCI_DEVICE_ID,16) == PCI_DEVICE_ID_AL_M1533) { 210 ali_config_readw(PCI_DEVICE_ID, 16) == PCI_DEVICE_ID_AL_M1533) {
211 printk(KERN_INFO "Found an NEC Rockhopper \n"); 211 printk(KERN_INFO "Found an NEC Rockhopper \n");
212 vr4133_rockhopper = 1; 212 vr4133_rockhopper = 1;
213 /* 213 /*
diff --git a/arch/mips/vr41xx/nec-cmbvr4133/setup.c b/arch/mips/vr41xx/nec-cmbvr4133/setup.c
index b20b93b2b95e..58e47686b499 100644
--- a/arch/mips/vr41xx/nec-cmbvr4133/setup.c
+++ b/arch/mips/vr41xx/nec-cmbvr4133/setup.c
@@ -64,7 +64,6 @@ static void __init nec_cmbvr4133_setup(void)
64#endif 64#endif
65 set_io_port_base(KSEG1ADDR(0x16000000)); 65 set_io_port_base(KSEG1ADDR(0x16000000));
66 66
67 mips_machgroup = MACH_GROUP_NEC_VR41XX;
68 mips_machtype = MACH_NEC_CMBVR4133; 67 mips_machtype = MACH_NEC_CMBVR4133;
69 68
70#ifdef CONFIG_PCI 69#ifdef CONFIG_PCI
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 24bea97c736c..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
@@ -395,7 +396,6 @@ void do_softirq(void)
395 396
396 local_irq_restore(flags); 397 local_irq_restore(flags);
397} 398}
398EXPORT_SYMBOL(do_softirq);
399 399
400 400
401/* 401/*
@@ -418,10 +418,16 @@ irq_hw_number_t virq_to_hw(unsigned int virq)
418} 418}
419EXPORT_SYMBOL_GPL(virq_to_hw); 419EXPORT_SYMBOL_GPL(virq_to_hw);
420 420
421__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)
422 unsigned int revmap_arg, 422{
423 struct irq_host_ops *ops, 423 return h->of_node != NULL && h->of_node == np;
424 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)
425{ 431{
426 struct irq_host *host; 432 struct irq_host *host;
427 unsigned int size = sizeof(struct irq_host); 433 unsigned int size = sizeof(struct irq_host);
@@ -432,13 +438,7 @@ __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
432 /* Allocate structure and revmap table if using linear mapping */ 438 /* Allocate structure and revmap table if using linear mapping */
433 if (revmap_type == IRQ_HOST_MAP_LINEAR) 439 if (revmap_type == IRQ_HOST_MAP_LINEAR)
434 size += revmap_arg * sizeof(unsigned int); 440 size += revmap_arg * sizeof(unsigned int);
435 if (mem_init_done) 441 host = zalloc_maybe_bootmem(size, GFP_KERNEL);
436 host = kzalloc(size, GFP_KERNEL);
437 else {
438 host = alloc_bootmem(size);
439 if (host)
440 memset(host, 0, size);
441 }
442 if (host == NULL) 442 if (host == NULL)
443 return NULL; 443 return NULL;
444 444
@@ -446,6 +446,10 @@ __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
446 host->revmap_type = revmap_type; 446 host->revmap_type = revmap_type;
447 host->inval_irq = inval_irq; 447 host->inval_irq = inval_irq;
448 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;
449 453
450 spin_lock_irqsave(&irq_big_lock, flags); 454 spin_lock_irqsave(&irq_big_lock, flags);
451 455
@@ -477,7 +481,7 @@ __init_refok struct irq_host *irq_alloc_host(unsigned int revmap_type,
477 host->inval_irq = 0; 481 host->inval_irq = 0;
478 /* setup us as the host for all legacy interrupts */ 482 /* setup us as the host for all legacy interrupts */
479 for (i = 1; i < NUM_ISA_INTERRUPTS; i++) { 483 for (i = 1; i < NUM_ISA_INTERRUPTS; i++) {
480 irq_map[i].hwirq = 0; 484 irq_map[i].hwirq = i;
481 smp_wmb(); 485 smp_wmb();
482 irq_map[i].host = host; 486 irq_map[i].host = host;
483 smp_wmb(); 487 smp_wmb();
@@ -521,7 +525,7 @@ struct irq_host *irq_find_host(struct device_node *node)
521 */ 525 */
522 spin_lock_irqsave(&irq_big_lock, flags); 526 spin_lock_irqsave(&irq_big_lock, flags);
523 list_for_each_entry(h, &irq_hosts, link) 527 list_for_each_entry(h, &irq_hosts, link)
524 if (h->ops->match == NULL || h->ops->match(h, node)) { 528 if (h->ops->match(h, node)) {
525 found = h; 529 found = h;
526 break; 530 break;
527 } 531 }
@@ -996,6 +1000,68 @@ static int irq_late_init(void)
996} 1000}
997arch_initcall(irq_late_init); 1001arch_initcall(irq_late_init);
998 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
999#endif /* CONFIG_PPC_MERGE */ 1065#endif /* CONFIG_PPC_MERGE */
1000 1066
1001#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 1b3e008fd148..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,12 +43,19 @@ 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
38 47
39config 440GP 48config 440EPX
40 bool 49 bool
50 select PPC_FPU
41# Disabled until the new EMAC Driver is merged. 51# Disabled until the new EMAC Driver is merged.
52# select IBM_NEW_EMAC_EMAC4
42# select IBM_NEW_EMAC_ZMII 53# select IBM_NEW_EMAC_ZMII
43 54
55config 440GP
56 bool
57 select IBM_NEW_EMAC_ZMII
58
44config 440GX 59config 440GX
45 bool 60 bool
46 61
@@ -49,7 +64,7 @@ config 440SP
49 64
50config 440A 65config 440A
51 bool 66 bool
52 depends on 440GX 67 depends on 440GX || 440EPX
53 default y 68 default y
54 69
55# 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/Kconfig b/arch/powerpc/platforms/cell/Kconfig
index ac8032034fb8..e1e2f6a43019 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -10,6 +10,10 @@ config PPC_CELL_NATIVE
10 select PPC_INDIRECT_IO 10 select PPC_INDIRECT_IO
11 select PPC_NATIVE 11 select PPC_NATIVE
12 select MPIC 12 select MPIC
13 select IBM_NEW_EMAC_EMAC4
14 select IBM_NEW_EMAC_RGMII
15 select IBM_NEW_EMAC_ZMII #test only
16 select IBM_NEW_EMAC_TAH #test only
13 default n 17 default n
14 18
15config PPC_IBM_CELL_BLADE 19config PPC_IBM_CELL_BLADE
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 c50ad22bf73e..5123e9d4164b 100644
--- a/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -24,7 +24,7 @@
24#include <asm/machdep.h> 24#include <asm/machdep.h>
25#include <asm/of_platform.h> 25#include <asm/of_platform.h>
26#include <asm/prom.h> 26#include <asm/prom.h>
27#include "cbe_regs.h" 27#include <asm/cell-regs.h>
28#include "cbe_cpufreq.h" 28#include "cbe_cpufreq.h"
29 29
30static DEFINE_MUTEX(cbe_switch_mutex); 30static DEFINE_MUTEX(cbe_switch_mutex);
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c b/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
index 163263b3e1cd..70fa7aef5edd 100644
--- a/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
@@ -28,8 +28,8 @@
28#include <linux/time.h> 28#include <linux/time.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/hw_irq.h> 30#include <asm/hw_irq.h>
31#include <asm/cell-regs.h>
31 32
32#include "cbe_regs.h"
33#include "cbe_cpufreq.h" 33#include "cbe_cpufreq.h"
34 34
35/* to write to MIC register */ 35/* to write to MIC register */
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c b/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
index fc6f38982ff4..6a2c1b0a9a94 100644
--- a/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
@@ -27,12 +27,12 @@
27#include <asm/processor.h> 27#include <asm/processor.h>
28#include <asm/prom.h> 28#include <asm/prom.h>
29#include <asm/pmi.h> 29#include <asm/pmi.h>
30#include <asm/cell-regs.h>
30 31
31#ifdef DEBUG 32#ifdef DEBUG
32#include <asm/time.h> 33#include <asm/time.h>
33#endif 34#endif
34 35
35#include "cbe_regs.h"
36#include "cbe_cpufreq.h" 36#include "cbe_cpufreq.h"
37 37
38static u8 pmi_slow_mode_limit[MAX_CBE]; 38static u8 pmi_slow_mode_limit[MAX_CBE];
diff --git a/arch/powerpc/platforms/cell/cbe_regs.c b/arch/powerpc/platforms/cell/cbe_regs.c
index c8f7f0007422..16a9b07e7b0c 100644
--- a/arch/powerpc/platforms/cell/cbe_regs.c
+++ b/arch/powerpc/platforms/cell/cbe_regs.c
@@ -16,8 +16,7 @@
16#include <asm/ptrace.h> 16#include <asm/ptrace.h>
17#include <asm/of_device.h> 17#include <asm/of_device.h>
18#include <asm/of_platform.h> 18#include <asm/of_platform.h>
19 19#include <asm/cell-regs.h>
20#include "cbe_regs.h"
21 20
22/* 21/*
23 * Current implementation uses "cpu" nodes. We build our own mapping 22 * Current implementation uses "cpu" nodes. We build our own mapping
diff --git a/arch/powerpc/platforms/cell/cbe_regs.h b/arch/powerpc/platforms/cell/cbe_regs.h
deleted file mode 100644
index b24025f2ac7a..000000000000
--- a/arch/powerpc/platforms/cell/cbe_regs.h
+++ /dev/null
@@ -1,271 +0,0 @@
1/*
2 * cbe_regs.h
3 *
4 * This file is intended to hold the various register definitions for CBE
5 * on-chip system devices (memory controller, IO controller, etc...)
6 *
7 * (C) Copyright IBM Corporation 2001,2006
8 *
9 * Authors: Maximino Aguilar (maguilar@us.ibm.com)
10 * David J. Erb (djerb@us.ibm.com)
11 *
12 * (c) 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
13 */
14
15#ifndef CBE_REGS_H
16#define CBE_REGS_H
17
18#include <asm/cell-pmu.h>
19
20/*
21 *
22 * Some HID register definitions
23 *
24 */
25
26/* CBE specific HID0 bits */
27#define HID0_CBE_THERM_WAKEUP 0x0000020000000000ul
28#define HID0_CBE_SYSERR_WAKEUP 0x0000008000000000ul
29#define HID0_CBE_THERM_INT_EN 0x0000000400000000ul
30#define HID0_CBE_SYSERR_INT_EN 0x0000000200000000ul
31
32#define MAX_CBE 2
33
34/*
35 *
36 * Pervasive unit register definitions
37 *
38 */
39
40union spe_reg {
41 u64 val;
42 u8 spe[8];
43};
44
45union ppe_spe_reg {
46 u64 val;
47 struct {
48 u32 ppe;
49 u32 spe;
50 };
51};
52
53
54struct cbe_pmd_regs {
55 /* Debug Bus Control */
56 u64 pad_0x0000; /* 0x0000 */
57
58 u64 group_control; /* 0x0008 */
59
60 u8 pad_0x0010_0x00a8 [0x00a8 - 0x0010]; /* 0x0010 */
61
62 u64 debug_bus_control; /* 0x00a8 */
63
64 u8 pad_0x00b0_0x0100 [0x0100 - 0x00b0]; /* 0x00b0 */
65
66 u64 trace_aux_data; /* 0x0100 */
67 u64 trace_buffer_0_63; /* 0x0108 */
68 u64 trace_buffer_64_127; /* 0x0110 */
69 u64 trace_address; /* 0x0118 */
70 u64 ext_tr_timer; /* 0x0120 */
71
72 u8 pad_0x0128_0x0400 [0x0400 - 0x0128]; /* 0x0128 */
73
74 /* Performance Monitor */
75 u64 pm_status; /* 0x0400 */
76 u64 pm_control; /* 0x0408 */
77 u64 pm_interval; /* 0x0410 */
78 u64 pm_ctr[4]; /* 0x0418 */
79 u64 pm_start_stop; /* 0x0438 */
80 u64 pm07_control[8]; /* 0x0440 */
81
82 u8 pad_0x0480_0x0800 [0x0800 - 0x0480]; /* 0x0480 */
83
84 /* Thermal Sensor Registers */
85 union spe_reg ts_ctsr1; /* 0x0800 */
86 u64 ts_ctsr2; /* 0x0808 */
87 union spe_reg ts_mtsr1; /* 0x0810 */
88 u64 ts_mtsr2; /* 0x0818 */
89 union spe_reg ts_itr1; /* 0x0820 */
90 u64 ts_itr2; /* 0x0828 */
91 u64 ts_gitr; /* 0x0830 */
92 u64 ts_isr; /* 0x0838 */
93 u64 ts_imr; /* 0x0840 */
94 union spe_reg tm_cr1; /* 0x0848 */
95 u64 tm_cr2; /* 0x0850 */
96 u64 tm_simr; /* 0x0858 */
97 union ppe_spe_reg tm_tpr; /* 0x0860 */
98 union spe_reg tm_str1; /* 0x0868 */
99 u64 tm_str2; /* 0x0870 */
100 union ppe_spe_reg tm_tsr; /* 0x0878 */
101
102 /* Power Management */
103 u64 pmcr; /* 0x0880 */
104#define CBE_PMD_PAUSE_ZERO_CONTROL 0x10000
105 u64 pmsr; /* 0x0888 */
106
107 /* Time Base Register */
108 u64 tbr; /* 0x0890 */
109
110 u8 pad_0x0898_0x0c00 [0x0c00 - 0x0898]; /* 0x0898 */
111
112 /* Fault Isolation Registers */
113 u64 checkstop_fir; /* 0x0c00 */
114 u64 recoverable_fir; /* 0x0c08 */
115 u64 spec_att_mchk_fir; /* 0x0c10 */
116 u32 fir_mode_reg; /* 0x0c18 */
117 u8 pad_0x0c1c_0x0c20 [4]; /* 0x0c1c */
118#define CBE_PMD_FIR_MODE_M8 0x00800
119 u64 fir_enable_mask; /* 0x0c20 */
120
121 u8 pad_0x0c28_0x0ca8 [0x0ca8 - 0x0c28]; /* 0x0c28 */
122 u64 ras_esc_0; /* 0x0ca8 */
123 u8 pad_0x0cb0_0x1000 [0x1000 - 0x0cb0]; /* 0x0cb0 */
124};
125
126extern struct cbe_pmd_regs __iomem *cbe_get_pmd_regs(struct device_node *np);
127extern struct cbe_pmd_regs __iomem *cbe_get_cpu_pmd_regs(int cpu);
128
129/*
130 * PMU shadow registers
131 *
132 * Many of the registers in the performance monitoring unit are write-only,
133 * so we need to save a copy of what we write to those registers.
134 *
135 * The actual data counters are read/write. However, writing to the counters
136 * only takes effect if the PMU is enabled. Otherwise the value is stored in
137 * a hardware latch until the next time the PMU is enabled. So we save a copy
138 * of the counter values if we need to read them back while the PMU is
139 * disabled. The counter_value_in_latch field is a bitmap indicating which
140 * counters currently have a value waiting to be written.
141 */
142
143struct cbe_pmd_shadow_regs {
144 u32 group_control;
145 u32 debug_bus_control;
146 u32 trace_address;
147 u32 ext_tr_timer;
148 u32 pm_status;
149 u32 pm_control;
150 u32 pm_interval;
151 u32 pm_start_stop;
152 u32 pm07_control[NR_CTRS];
153
154 u32 pm_ctr[NR_PHYS_CTRS];
155 u32 counter_value_in_latch;
156};
157
158extern struct cbe_pmd_shadow_regs *cbe_get_pmd_shadow_regs(struct device_node *np);
159extern struct cbe_pmd_shadow_regs *cbe_get_cpu_pmd_shadow_regs(int cpu);
160
161/*
162 *
163 * IIC unit register definitions
164 *
165 */
166
167struct cbe_iic_pending_bits {
168 u32 data;
169 u8 flags;
170 u8 class;
171 u8 source;
172 u8 prio;
173};
174
175#define CBE_IIC_IRQ_VALID 0x80
176#define CBE_IIC_IRQ_IPI 0x40
177
178struct cbe_iic_thread_regs {
179 struct cbe_iic_pending_bits pending;
180 struct cbe_iic_pending_bits pending_destr;
181 u64 generate;
182 u64 prio;
183};
184
185struct cbe_iic_regs {
186 u8 pad_0x0000_0x0400[0x0400 - 0x0000]; /* 0x0000 */
187
188 /* IIC interrupt registers */
189 struct cbe_iic_thread_regs thread[2]; /* 0x0400 */
190
191 u64 iic_ir; /* 0x0440 */
192#define CBE_IIC_IR_PRIO(x) (((x) & 0xf) << 12)
193#define CBE_IIC_IR_DEST_NODE(x) (((x) & 0xf) << 4)
194#define CBE_IIC_IR_DEST_UNIT(x) ((x) & 0xf)
195#define CBE_IIC_IR_IOC_0 0x0
196#define CBE_IIC_IR_IOC_1S 0xb
197#define CBE_IIC_IR_PT_0 0xe
198#define CBE_IIC_IR_PT_1 0xf
199
200 u64 iic_is; /* 0x0448 */
201#define CBE_IIC_IS_PMI 0x2
202
203 u8 pad_0x0450_0x0500[0x0500 - 0x0450]; /* 0x0450 */
204
205 /* IOC FIR */
206 u64 ioc_fir_reset; /* 0x0500 */
207 u64 ioc_fir_set; /* 0x0508 */
208 u64 ioc_checkstop_enable; /* 0x0510 */
209 u64 ioc_fir_error_mask; /* 0x0518 */
210 u64 ioc_syserr_enable; /* 0x0520 */
211 u64 ioc_fir; /* 0x0528 */
212
213 u8 pad_0x0530_0x1000[0x1000 - 0x0530]; /* 0x0530 */
214};
215
216extern struct cbe_iic_regs __iomem *cbe_get_iic_regs(struct device_node *np);
217extern struct cbe_iic_regs __iomem *cbe_get_cpu_iic_regs(int cpu);
218
219
220struct cbe_mic_tm_regs {
221 u8 pad_0x0000_0x0040[0x0040 - 0x0000]; /* 0x0000 */
222
223 u64 mic_ctl_cnfg2; /* 0x0040 */
224#define CBE_MIC_ENABLE_AUX_TRC 0x8000000000000000LL
225#define CBE_MIC_DISABLE_PWR_SAV_2 0x0200000000000000LL
226#define CBE_MIC_DISABLE_AUX_TRC_WRAP 0x0100000000000000LL
227#define CBE_MIC_ENABLE_AUX_TRC_INT 0x0080000000000000LL
228
229 u64 pad_0x0048; /* 0x0048 */
230
231 u64 mic_aux_trc_base; /* 0x0050 */
232 u64 mic_aux_trc_max_addr; /* 0x0058 */
233 u64 mic_aux_trc_cur_addr; /* 0x0060 */
234 u64 mic_aux_trc_grf_addr; /* 0x0068 */
235 u64 mic_aux_trc_grf_data; /* 0x0070 */
236
237 u64 pad_0x0078; /* 0x0078 */
238
239 u64 mic_ctl_cnfg_0; /* 0x0080 */
240#define CBE_MIC_DISABLE_PWR_SAV_0 0x8000000000000000LL
241
242 u64 pad_0x0088; /* 0x0088 */
243
244 u64 slow_fast_timer_0; /* 0x0090 */
245 u64 slow_next_timer_0; /* 0x0098 */
246
247 u8 pad_0x00a0_0x01c0[0x01c0 - 0x0a0]; /* 0x00a0 */
248
249 u64 mic_ctl_cnfg_1; /* 0x01c0 */
250#define CBE_MIC_DISABLE_PWR_SAV_1 0x8000000000000000LL
251 u64 pad_0x01c8; /* 0x01c8 */
252
253 u64 slow_fast_timer_1; /* 0x01d0 */
254 u64 slow_next_timer_1; /* 0x01d8 */
255
256 u8 pad_0x01e0_0x1000[0x1000 - 0x01e0]; /* 0x01e0 */
257};
258
259extern struct cbe_mic_tm_regs __iomem *cbe_get_mic_tm_regs(struct device_node *np);
260extern struct cbe_mic_tm_regs __iomem *cbe_get_cpu_mic_tm_regs(int cpu);
261
262/* some utility functions to deal with SMT */
263extern u32 cbe_get_hw_thread_id(int cpu);
264extern u32 cbe_cpu_to_node(int cpu);
265extern u32 cbe_node_to_cpu(int node);
266
267/* Init this module early */
268extern void cbe_regs_init(void);
269
270
271#endif /* CBE_REGS_H */
diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c
index fb5eda48467d..4852bf312d83 100644
--- a/arch/powerpc/platforms/cell/cbe_thermal.c
+++ b/arch/powerpc/platforms/cell/cbe_thermal.c
@@ -52,8 +52,8 @@
52#include <asm/spu.h> 52#include <asm/spu.h>
53#include <asm/io.h> 53#include <asm/io.h>
54#include <asm/prom.h> 54#include <asm/prom.h>
55#include <asm/cell-regs.h>
55 56
56#include "cbe_regs.h"
57#include "spu_priv1_mmio.h" 57#include "spu_priv1_mmio.h"
58 58
59#define TEMP_MIN 65 59#define TEMP_MIN 65
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 47264e722029..151fd8b82d63 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -41,9 +41,9 @@
41#include <asm/prom.h> 41#include <asm/prom.h>
42#include <asm/ptrace.h> 42#include <asm/ptrace.h>
43#include <asm/machdep.h> 43#include <asm/machdep.h>
44#include <asm/cell-regs.h>
44 45
45#include "interrupt.h" 46#include "interrupt.h"
46#include "cbe_regs.h"
47 47
48struct iic { 48struct iic {
49 struct cbe_iic_thread_regs __iomem *regs; 49 struct cbe_iic_thread_regs __iomem *regs;
@@ -381,7 +381,7 @@ static int __init setup_iic(void)
381void __init iic_init_IRQ(void) 381void __init iic_init_IRQ(void)
382{ 382{
383 /* Setup an irq host data structure */ 383 /* Setup an irq host data structure */
384 iic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, IIC_SOURCE_COUNT, 384 iic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_LINEAR, IIC_SOURCE_COUNT,
385 &iic_host_ops, IIC_IRQ_INVALID); 385 &iic_host_ops, IIC_IRQ_INVALID);
386 BUG_ON(iic_host == NULL); 386 BUG_ON(iic_host == NULL);
387 irq_set_default_host(iic_host); 387 irq_set_default_host(iic_host);
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 760caa76841a..faabc3fdc130 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -34,8 +34,8 @@
34#include <asm/udbg.h> 34#include <asm/udbg.h>
35#include <asm/of_platform.h> 35#include <asm/of_platform.h>
36#include <asm/lmb.h> 36#include <asm/lmb.h>
37#include <asm/cell-regs.h>
37 38
38#include "cbe_regs.h"
39#include "interrupt.h" 39#include "interrupt.h"
40 40
41/* Define CELL_IOMMU_REAL_UNMAP to actually unmap non-used pages 41/* Define CELL_IOMMU_REAL_UNMAP to actually unmap non-used pages
diff --git a/arch/powerpc/platforms/cell/pervasive.c b/arch/powerpc/platforms/cell/pervasive.c
index 4ede22d363fa..0304589c0a80 100644
--- a/arch/powerpc/platforms/cell/pervasive.c
+++ b/arch/powerpc/platforms/cell/pervasive.c
@@ -34,9 +34,9 @@
34#include <asm/prom.h> 34#include <asm/prom.h>
35#include <asm/pgtable.h> 35#include <asm/pgtable.h>
36#include <asm/reg.h> 36#include <asm/reg.h>
37#include <asm/cell-regs.h>
37 38
38#include "pervasive.h" 39#include "pervasive.h"
39#include "cbe_regs.h"
40 40
41static int sysreset_hack; 41static int sysreset_hack;
42 42
diff --git a/arch/powerpc/platforms/cell/pmu.c b/arch/powerpc/platforms/cell/pmu.c
index 66ca4b5a1dbc..1ed303678887 100644
--- a/arch/powerpc/platforms/cell/pmu.c
+++ b/arch/powerpc/platforms/cell/pmu.c
@@ -30,8 +30,8 @@
30#include <asm/pmc.h> 30#include <asm/pmc.h>
31#include <asm/reg.h> 31#include <asm/reg.h>
32#include <asm/spu.h> 32#include <asm/spu.h>
33#include <asm/cell-regs.h>
33 34
34#include "cbe_regs.h"
35#include "interrupt.h" 35#include "interrupt.h"
36 36
37/* 37/*
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c
index 3961a085b432..b2494ebcdbe9 100644
--- a/arch/powerpc/platforms/cell/ras.c
+++ b/arch/powerpc/platforms/cell/ras.c
@@ -10,9 +10,9 @@
10#include <asm/prom.h> 10#include <asm/prom.h>
11#include <asm/machdep.h> 11#include <asm/machdep.h>
12#include <asm/rtas.h> 12#include <asm/rtas.h>
13#include <asm/cell-regs.h>
13 14
14#include "ras.h" 15#include "ras.h"
15#include "cbe_regs.h"
16 16
17 17
18static void dump_fir(int cpu) 18static void dump_fir(int cpu)
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index db6654272e13..98e7ef8e6fc6 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -52,9 +52,9 @@
52#include <asm/udbg.h> 52#include <asm/udbg.h>
53#include <asm/mpic.h> 53#include <asm/mpic.h>
54#include <asm/of_platform.h> 54#include <asm/of_platform.h>
55#include <asm/cell-regs.h>
55 56
56#include "interrupt.h" 57#include "interrupt.h"
57#include "cbe_regs.h"
58#include "pervasive.h" 58#include "pervasive.h"
59#include "ras.h" 59#include "ras.h"
60 60
@@ -83,12 +83,22 @@ static void cell_progress(char *s, unsigned short hex)
83 83
84static int __init cell_publish_devices(void) 84static int __init cell_publish_devices(void)
85{ 85{
86 int node;
87
86 if (!machine_is(cell)) 88 if (!machine_is(cell))
87 return 0; 89 return 0;
88 90
89 /* Publish OF platform devices for southbridge IOs */ 91 /* Publish OF platform devices for southbridge IOs */
90 of_platform_bus_probe(NULL, NULL, NULL); 92 of_platform_bus_probe(NULL, NULL, NULL);
91 93
94 /* There is no device for the MIC memory controller, thus we create
95 * a platform device for it to attach the EDAC driver to.
96 */
97 for_each_online_node(node) {
98 if (cbe_get_cpu_mic_tm_regs(cbe_node_to_cpu(node)) == NULL)
99 continue;
100 platform_device_register_simple("cbe-mic", node, NULL, 0);
101 }
92 return 0; 102 return 0;
93} 103}
94device_initcall(cell_publish_devices); 104device_initcall(cell_publish_devices);
@@ -161,11 +171,6 @@ static void __init cell_setup_arch(void)
161 /* init to some ~sane value until calibrate_delay() runs */ 171 /* init to some ~sane value until calibrate_delay() runs */
162 loops_per_jiffy = 50000000; 172 loops_per_jiffy = 50000000;
163 173
164 if (ROOT_DEV == 0) {
165 printk("No ramdisk, default root is /dev/hda2\n");
166 ROOT_DEV = Root_HDA2;
167 }
168
169 /* Find and initialize PCI host bridges */ 174 /* Find and initialize PCI host bridges */
170 init_pci_config_tokens(); 175 init_pci_config_tokens();
171 find_and_init_phbs(); 176 find_and_init_phbs();
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index 05f4b3d3d756..3f4b4aef756d 100644
--- a/arch/powerpc/platforms/cell/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -63,7 +63,6 @@ enum {
63 63
64struct spider_pic { 64struct spider_pic {
65 struct irq_host *host; 65 struct irq_host *host;
66 struct device_node *of_node;
67 void __iomem *regs; 66 void __iomem *regs;
68 unsigned int node_id; 67 unsigned int node_id;
69}; 68};
@@ -176,12 +175,6 @@ static struct irq_chip spider_pic = {
176 .set_type = spider_set_irq_type, 175 .set_type = spider_set_irq_type,
177}; 176};
178 177
179static int spider_host_match(struct irq_host *h, struct device_node *node)
180{
181 struct spider_pic *pic = h->host_data;
182 return node == pic->of_node;
183}
184
185static int spider_host_map(struct irq_host *h, unsigned int virq, 178static int spider_host_map(struct irq_host *h, unsigned int virq,
186 irq_hw_number_t hw) 179 irq_hw_number_t hw)
187{ 180{
@@ -208,7 +201,6 @@ static int spider_host_xlate(struct irq_host *h, struct device_node *ct,
208} 201}
209 202
210static struct irq_host_ops spider_host_ops = { 203static struct irq_host_ops spider_host_ops = {
211 .match = spider_host_match,
212 .map = spider_host_map, 204 .map = spider_host_map,
213 .xlate = spider_host_xlate, 205 .xlate = spider_host_xlate,
214}; 206};
@@ -247,18 +239,18 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic)
247 * tree in case the device-tree is ever fixed 239 * tree in case the device-tree is ever fixed
248 */ 240 */
249 struct of_irq oirq; 241 struct of_irq oirq;
250 if (of_irq_map_one(pic->of_node, 0, &oirq) == 0) { 242 if (of_irq_map_one(pic->host->of_node, 0, &oirq) == 0) {
251 virq = irq_create_of_mapping(oirq.controller, oirq.specifier, 243 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
252 oirq.size); 244 oirq.size);
253 return virq; 245 return virq;
254 } 246 }
255 247
256 /* Now do the horrible hacks */ 248 /* Now do the horrible hacks */
257 tmp = of_get_property(pic->of_node, "#interrupt-cells", NULL); 249 tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL);
258 if (tmp == NULL) 250 if (tmp == NULL)
259 return NO_IRQ; 251 return NO_IRQ;
260 intsize = *tmp; 252 intsize = *tmp;
261 imap = of_get_property(pic->of_node, "interrupt-map", &imaplen); 253 imap = of_get_property(pic->host->of_node, "interrupt-map", &imaplen);
262 if (imap == NULL || imaplen < (intsize + 1)) 254 if (imap == NULL || imaplen < (intsize + 1))
263 return NO_IRQ; 255 return NO_IRQ;
264 iic = of_find_node_by_phandle(imap[intsize]); 256 iic = of_find_node_by_phandle(imap[intsize]);
@@ -308,15 +300,13 @@ static void __init spider_init_one(struct device_node *of_node, int chip,
308 panic("spider_pic: can't map registers !"); 300 panic("spider_pic: can't map registers !");
309 301
310 /* Allocate a host */ 302 /* Allocate a host */
311 pic->host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, SPIDER_SRC_COUNT, 303 pic->host = irq_alloc_host(of_node_get(of_node), IRQ_HOST_MAP_LINEAR,
312 &spider_host_ops, SPIDER_IRQ_INVALID); 304 SPIDER_SRC_COUNT, &spider_host_ops,
305 SPIDER_IRQ_INVALID);
313 if (pic->host == NULL) 306 if (pic->host == NULL)
314 panic("spider_pic: can't allocate irq host !"); 307 panic("spider_pic: can't allocate irq host !");
315 pic->host->host_data = pic; 308 pic->host->host_data = pic;
316 309
317 /* Fill out other bits */
318 pic->of_node = of_node_get(of_node);
319
320 /* Go through all sources and disable them */ 310 /* Go through all sources and disable them */
321 for (i = 0; i < SPIDER_SRC_COUNT; i++) { 311 for (i = 0; i < SPIDER_SRC_COUNT; i++) {
322 void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i; 312 void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i;
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index 106d2921e2d9..c83c3e3f5178 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -168,7 +168,7 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
168#else 168#else
169 psize = mm->context.user_psize; 169 psize = mm->context.user_psize;
170#endif 170#endif
171 vsid = (get_vsid(mm->context.id, ea) << SLB_VSID_SHIFT) | 171 vsid = (get_vsid(mm->context.id, ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
172 SLB_VSID_USER; 172 SLB_VSID_USER;
173 break; 173 break;
174 case VMALLOC_REGION_ID: 174 case VMALLOC_REGION_ID:
@@ -176,12 +176,12 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
176 psize = mmu_vmalloc_psize; 176 psize = mmu_vmalloc_psize;
177 else 177 else
178 psize = mmu_io_psize; 178 psize = mmu_io_psize;
179 vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | 179 vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
180 SLB_VSID_KERNEL; 180 SLB_VSID_KERNEL;
181 break; 181 break;
182 case KERNEL_REGION_ID: 182 case KERNEL_REGION_ID:
183 psize = mmu_linear_psize; 183 psize = mmu_linear_psize;
184 vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | 184 vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
185 SLB_VSID_KERNEL; 185 SLB_VSID_KERNEL;
186 break; 186 break;
187 default: 187 default:
@@ -458,7 +458,7 @@ static int spu_shutdown(struct sys_device *sysdev)
458 return 0; 458 return 0;
459} 459}
460 460
461struct sysdev_class spu_sysdev_class = { 461static struct sysdev_class spu_sysdev_class = {
462 set_kset_name("spu"), 462 set_kset_name("spu"),
463 .shutdown = spu_shutdown, 463 .shutdown = spu_shutdown,
464}; 464};
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c
index 47ec3be3edcd..dceb8b6a9382 100644
--- a/arch/powerpc/platforms/cell/spu_callbacks.c
+++ b/arch/powerpc/platforms/cell/spu_callbacks.c
@@ -2,7 +2,7 @@
2 * System call callback functions for SPUs 2 * System call callback functions for SPUs
3 */ 3 */
4 4
5#define DEBUG 5#undef DEBUG
6 6
7#include <linux/kallsyms.h> 7#include <linux/kallsyms.h>
8#include <linux/module.h> 8#include <linux/module.h>
@@ -33,7 +33,7 @@
33 * mbind, mq_open, ipc, ... 33 * mbind, mq_open, ipc, ...
34 */ 34 */
35 35
36void *spu_syscall_table[] = { 36static void *spu_syscall_table[] = {
37#define SYSCALL(func) sys_ni_syscall, 37#define SYSCALL(func) sys_ni_syscall,
38#define COMPAT_SYS(func) sys_ni_syscall, 38#define COMPAT_SYS(func) sys_ni_syscall,
39#define PPC_SYS(func) sys_ni_syscall, 39#define PPC_SYS(func) sys_ni_syscall,
diff --git a/arch/powerpc/platforms/cell/spu_coredump.c b/arch/powerpc/platforms/cell/spu_coredump.c
deleted file mode 100644
index 4fd37ff1e210..000000000000
--- a/arch/powerpc/platforms/cell/spu_coredump.c
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * SPU core dump code
3 *
4 * (C) Copyright 2006 IBM Corp.
5 *
6 * Author: Dwayne Grant McConnell <decimal@us.ibm.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#include <linux/file.h>
24#include <linux/module.h>
25#include <linux/syscalls.h>
26
27#include <asm/spu.h>
28
29static struct spu_coredump_calls *spu_coredump_calls;
30static DEFINE_MUTEX(spu_coredump_mutex);
31
32int arch_notes_size(void)
33{
34 long ret;
35
36 ret = -ENOSYS;
37 mutex_lock(&spu_coredump_mutex);
38 if (spu_coredump_calls && try_module_get(spu_coredump_calls->owner)) {
39 ret = spu_coredump_calls->arch_notes_size();
40 module_put(spu_coredump_calls->owner);
41 }
42 mutex_unlock(&spu_coredump_mutex);
43 return ret;
44}
45
46void arch_write_notes(struct file *file)
47{
48 mutex_lock(&spu_coredump_mutex);
49 if (spu_coredump_calls && try_module_get(spu_coredump_calls->owner)) {
50 spu_coredump_calls->arch_write_notes(file);
51 module_put(spu_coredump_calls->owner);
52 }
53 mutex_unlock(&spu_coredump_mutex);
54}
55
56int register_arch_coredump_calls(struct spu_coredump_calls *calls)
57{
58 int ret = 0;
59
60
61 mutex_lock(&spu_coredump_mutex);
62 if (spu_coredump_calls)
63 ret = -EBUSY;
64 else
65 spu_coredump_calls = calls;
66 mutex_unlock(&spu_coredump_mutex);
67 return ret;
68}
69EXPORT_SYMBOL_GPL(register_arch_coredump_calls);
70
71void unregister_arch_coredump_calls(struct spu_coredump_calls *calls)
72{
73 BUG_ON(spu_coredump_calls != calls);
74
75 mutex_lock(&spu_coredump_mutex);
76 spu_coredump_calls = NULL;
77 mutex_unlock(&spu_coredump_mutex);
78}
79EXPORT_SYMBOL_GPL(unregister_arch_coredump_calls);
diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c
index 0e14f532500e..1b010707488d 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -377,10 +377,10 @@ static int qs20_reg_memory[QS20_SPES_PER_BE] = { 1, 1, 0, 0, 0, 0, 0, 0 };
377static struct spu *spu_lookup_reg(int node, u32 reg) 377static struct spu *spu_lookup_reg(int node, u32 reg)
378{ 378{
379 struct spu *spu; 379 struct spu *spu;
380 u32 *spu_reg; 380 const u32 *spu_reg;
381 381
382 list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) { 382 list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) {
383 spu_reg = (u32*)of_get_property(spu_devnode(spu), "reg", NULL); 383 spu_reg = of_get_property(spu_devnode(spu), "reg", NULL);
384 if (*spu_reg == reg) 384 if (*spu_reg == reg)
385 return spu; 385 return spu;
386 } 386 }
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c
index 027ac32cc636..a9438b719fe8 100644
--- a/arch/powerpc/platforms/cell/spu_syscalls.c
+++ b/arch/powerpc/platforms/cell/spu_syscalls.c
@@ -2,6 +2,7 @@
2 * SPU file system -- system call stubs 2 * SPU file system -- system call stubs
3 * 3 *
4 * (C) Copyright IBM Deutschland Entwicklung GmbH 2005 4 * (C) Copyright IBM Deutschland Entwicklung GmbH 2005
5 * (C) Copyright 2006-2007, IBM Corporation
5 * 6 *
6 * Author: Arnd Bergmann <arndb@de.ibm.com> 7 * Author: Arnd Bergmann <arndb@de.ibm.com>
7 * 8 *
@@ -20,44 +21,73 @@
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */ 22 */
22#include <linux/file.h> 23#include <linux/file.h>
24#include <linux/fs.h>
23#include <linux/module.h> 25#include <linux/module.h>
24#include <linux/syscalls.h> 26#include <linux/syscalls.h>
27#include <linux/rcupdate.h>
25 28
26#include <asm/spu.h> 29#include <asm/spu.h>
27 30
28struct spufs_calls spufs_calls = { 31/* protected by rcu */
29 .owner = NULL, 32static struct spufs_calls *spufs_calls;
30};
31 33
32/* These stub syscalls are needed to have the actual implementation 34#ifdef CONFIG_SPU_FS_MODULE
33 * within a loadable module. When spufs is built into the kernel, 35
34 * this file is not used and the syscalls directly enter the fs code */ 36static inline struct spufs_calls *spufs_calls_get(void)
37{
38 struct spufs_calls *calls = NULL;
39
40 rcu_read_lock();
41 calls = rcu_dereference(spufs_calls);
42 if (calls && !try_module_get(calls->owner))
43 calls = NULL;
44 rcu_read_unlock();
45
46 return calls;
47}
48
49static inline void spufs_calls_put(struct spufs_calls *calls)
50{
51 BUG_ON(calls != spufs_calls);
52
53 /* we don't need to rcu this, as we hold a reference to the module */
54 module_put(spufs_calls->owner);
55}
56
57#else /* !defined CONFIG_SPU_FS_MODULE */
58
59static inline struct spufs_calls *spufs_calls_get(void)
60{
61 return spufs_calls;
62}
63
64static inline void spufs_calls_put(struct spufs_calls *calls) { }
65
66#endif /* CONFIG_SPU_FS_MODULE */
35 67
36asmlinkage long sys_spu_create(const char __user *name, 68asmlinkage long sys_spu_create(const char __user *name,
37 unsigned int flags, mode_t mode, int neighbor_fd) 69 unsigned int flags, mode_t mode, int neighbor_fd)
38{ 70{
39 long ret; 71 long ret;
40 struct module *owner = spufs_calls.owner;
41 struct file *neighbor; 72 struct file *neighbor;
42 int fput_needed; 73 int fput_needed;
74 struct spufs_calls *calls;
43 75
44 ret = -ENOSYS; 76 calls = spufs_calls_get();
45 if (owner && try_module_get(owner)) { 77 if (!calls)
46 if (flags & SPU_CREATE_AFFINITY_SPU) { 78 return -ENOSYS;
47 neighbor = fget_light(neighbor_fd, &fput_needed); 79
48 ret = -EBADF; 80 if (flags & SPU_CREATE_AFFINITY_SPU) {
49 if (neighbor) { 81 ret = -EBADF;
50 ret = spufs_calls.create_thread(name, flags, 82 neighbor = fget_light(neighbor_fd, &fput_needed);
51 mode, neighbor); 83 if (neighbor) {
52 fput_light(neighbor, fput_needed); 84 ret = calls->create_thread(name, flags, mode, neighbor);
53 } 85 fput_light(neighbor, fput_needed);
54 }
55 else {
56 ret = spufs_calls.create_thread(name, flags,
57 mode, NULL);
58 } 86 }
59 module_put(owner); 87 } else
60 } 88 ret = calls->create_thread(name, flags, mode, NULL);
89
90 spufs_calls_put(calls);
61 return ret; 91 return ret;
62} 92}
63 93
@@ -66,37 +96,69 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus)
66 long ret; 96 long ret;
67 struct file *filp; 97 struct file *filp;
68 int fput_needed; 98 int fput_needed;
69 struct module *owner = spufs_calls.owner; 99 struct spufs_calls *calls;
70 100
71 ret = -ENOSYS; 101 calls = spufs_calls_get();
72 if (owner && try_module_get(owner)) { 102 if (!calls)
73 ret = -EBADF; 103 return -ENOSYS;
74 filp = fget_light(fd, &fput_needed); 104
75 if (filp) { 105 ret = -EBADF;
76 ret = spufs_calls.spu_run(filp, unpc, ustatus); 106 filp = fget_light(fd, &fput_needed);
77 fput_light(filp, fput_needed); 107 if (filp) {
78 } 108 ret = calls->spu_run(filp, unpc, ustatus);
79 module_put(owner); 109 fput_light(filp, fput_needed);
80 } 110 }
111
112 spufs_calls_put(calls);
113 return ret;
114}
115
116int elf_coredump_extra_notes_size(void)
117{
118 struct spufs_calls *calls;
119 int ret;
120
121 calls = spufs_calls_get();
122 if (!calls)
123 return 0;
124
125 ret = calls->coredump_extra_notes_size();
126
127 spufs_calls_put(calls);
128
129 return ret;
130}
131
132int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset)
133{
134 struct spufs_calls *calls;
135 int ret;
136
137 calls = spufs_calls_get();
138 if (!calls)
139 return 0;
140
141 ret = calls->coredump_extra_notes_write(file, foffset);
142
143 spufs_calls_put(calls);
144
81 return ret; 145 return ret;
82} 146}
83 147
84int register_spu_syscalls(struct spufs_calls *calls) 148int register_spu_syscalls(struct spufs_calls *calls)
85{ 149{
86 if (spufs_calls.owner) 150 if (spufs_calls)
87 return -EBUSY; 151 return -EBUSY;
88 152
89 spufs_calls.create_thread = calls->create_thread; 153 rcu_assign_pointer(spufs_calls, calls);
90 spufs_calls.spu_run = calls->spu_run;
91 smp_mb();
92 spufs_calls.owner = calls->owner;
93 return 0; 154 return 0;
94} 155}
95EXPORT_SYMBOL_GPL(register_spu_syscalls); 156EXPORT_SYMBOL_GPL(register_spu_syscalls);
96 157
97void unregister_spu_syscalls(struct spufs_calls *calls) 158void unregister_spu_syscalls(struct spufs_calls *calls)
98{ 159{
99 BUG_ON(spufs_calls.owner != calls->owner); 160 BUG_ON(spufs_calls->owner != calls->owner);
100 spufs_calls.owner = NULL; 161 rcu_assign_pointer(spufs_calls, NULL);
162 synchronize_rcu();
101} 163}
102EXPORT_SYMBOL_GPL(unregister_spu_syscalls); 164EXPORT_SYMBOL_GPL(unregister_spu_syscalls);
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index 5e31799b1e3f..80f62363e1ce 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -31,16 +31,7 @@
31 31
32#include "spufs.h" 32#include "spufs.h"
33 33
34struct spufs_ctx_info { 34static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer,
35 struct list_head list;
36 int dfd;
37 int memsize; /* in bytes */
38 struct spu_context *ctx;
39};
40
41static LIST_HEAD(ctx_info_list);
42
43static ssize_t do_coredump_read(int num, struct spu_context *ctx, void __user *buffer,
44 size_t size, loff_t *off) 35 size_t size, loff_t *off)
45{ 36{
46 u64 data; 37 u64 data;
@@ -50,49 +41,57 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void __user *b
50 return spufs_coredump_read[num].read(ctx, buffer, size, off); 41 return spufs_coredump_read[num].read(ctx, buffer, size, off);
51 42
52 data = spufs_coredump_read[num].get(ctx); 43 data = spufs_coredump_read[num].get(ctx);
53 ret = copy_to_user(buffer, &data, 8); 44 ret = snprintf(buffer, size, "0x%.16lx", data);
54 return ret ? -EFAULT : 8; 45 if (ret >= size)
46 return size;
47 return ++ret; /* count trailing NULL */
55} 48}
56 49
57/* 50/*
58 * These are the only things you should do on a core-file: use only these 51 * These are the only things you should do on a core-file: use only these
59 * functions to write out all the necessary info. 52 * functions to write out all the necessary info.
60 */ 53 */
61static int spufs_dump_write(struct file *file, const void *addr, int nr) 54static int spufs_dump_write(struct file *file, const void *addr, int nr, loff_t *foffset)
62{ 55{
63 return file->f_op->write(file, addr, nr, &file->f_pos) == nr; 56 unsigned long limit = current->signal->rlim[RLIMIT_CORE].rlim_cur;
64} 57 ssize_t written;
65 58
66static int spufs_dump_seek(struct file *file, loff_t off) 59 if (*foffset + nr > limit)
67{ 60 return -EIO;
68 if (file->f_op->llseek) { 61
69 if (file->f_op->llseek(file, off, 0) != off) 62 written = file->f_op->write(file, addr, nr, &file->f_pos);
70 return 0; 63 *foffset += written;
71 } else 64
72 file->f_pos = off; 65 if (written != nr)
73 return 1; 66 return -EIO;
67
68 return 0;
74} 69}
75 70
76static void spufs_fill_memsize(struct spufs_ctx_info *ctx_info) 71static int spufs_dump_align(struct file *file, char *buf, loff_t new_off,
72 loff_t *foffset)
77{ 73{
78 struct spu_context *ctx; 74 int rc, size;
79 unsigned long long lslr; 75
76 size = min((loff_t)PAGE_SIZE, new_off - *foffset);
77 memset(buf, 0, size);
78
79 rc = 0;
80 while (rc == 0 && new_off > *foffset) {
81 size = min((loff_t)PAGE_SIZE, new_off - *foffset);
82 rc = spufs_dump_write(file, buf, size, foffset);
83 }
80 84
81 ctx = ctx_info->ctx; 85 return rc;
82 lslr = ctx->csa.priv2.spu_lslr_RW;
83 ctx_info->memsize = lslr + 1;
84} 86}
85 87
86static int spufs_ctx_note_size(struct spufs_ctx_info *ctx_info) 88static int spufs_ctx_note_size(struct spu_context *ctx, int dfd)
87{ 89{
88 int dfd, memsize, i, sz, total = 0; 90 int i, sz, total = 0;
89 char *name; 91 char *name;
90 char fullname[80]; 92 char fullname[80];
91 93
92 dfd = ctx_info->dfd; 94 for (i = 0; spufs_coredump_read[i].name != NULL; i++) {
93 memsize = ctx_info->memsize;
94
95 for (i = 0; spufs_coredump_read[i].name; i++) {
96 name = spufs_coredump_read[i].name; 95 name = spufs_coredump_read[i].name;
97 sz = spufs_coredump_read[i].size; 96 sz = spufs_coredump_read[i].size;
98 97
@@ -100,39 +99,12 @@ static int spufs_ctx_note_size(struct spufs_ctx_info *ctx_info)
100 99
101 total += sizeof(struct elf_note); 100 total += sizeof(struct elf_note);
102 total += roundup(strlen(fullname) + 1, 4); 101 total += roundup(strlen(fullname) + 1, 4);
103 if (!strcmp(name, "mem")) 102 total += roundup(sz, 4);
104 total += roundup(memsize, 4);
105 else
106 total += roundup(sz, 4);
107 } 103 }
108 104
109 return total; 105 return total;
110} 106}
111 107
112static int spufs_add_one_context(struct file *file, int dfd)
113{
114 struct spu_context *ctx;
115 struct spufs_ctx_info *ctx_info;
116 int size;
117
118 ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx;
119 if (ctx->flags & SPU_CREATE_NOSCHED)
120 return 0;
121
122 ctx_info = kzalloc(sizeof(*ctx_info), GFP_KERNEL);
123 if (unlikely(!ctx_info))
124 return -ENOMEM;
125
126 ctx_info->dfd = dfd;
127 ctx_info->ctx = ctx;
128
129 spufs_fill_memsize(ctx_info);
130
131 size = spufs_ctx_note_size(ctx_info);
132 list_add(&ctx_info->list, &ctx_info_list);
133 return size;
134}
135
136/* 108/*
137 * The additional architecture-specific notes for Cell are various 109 * The additional architecture-specific notes for Cell are various
138 * context files in the spu context. 110 * context files in the spu context.
@@ -142,33 +114,57 @@ static int spufs_add_one_context(struct file *file, int dfd)
142 * internal functionality to dump them without needing to actually 114 * internal functionality to dump them without needing to actually
143 * open the files. 115 * open the files.
144 */ 116 */
145static int spufs_arch_notes_size(void) 117static struct spu_context *coredump_next_context(int *fd)
146{ 118{
147 struct fdtable *fdt = files_fdtable(current->files); 119 struct fdtable *fdt = files_fdtable(current->files);
148 int size = 0, fd; 120 struct file *file;
121 struct spu_context *ctx = NULL;
149 122
150 for (fd = 0; fd < fdt->max_fds; fd++) { 123 for (; *fd < fdt->max_fds; (*fd)++) {
151 if (FD_ISSET(fd, fdt->open_fds)) { 124 if (!FD_ISSET(*fd, fdt->open_fds))
152 struct file *file = fcheck(fd); 125 continue;
153 126
154 if (file && file->f_op == &spufs_context_fops) { 127 file = fcheck(*fd);
155 int rval = spufs_add_one_context(file, fd); 128
156 if (rval < 0) 129 if (!file || file->f_op != &spufs_context_fops)
157 break; 130 continue;
158 size += rval; 131
159 } 132 ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx;
160 } 133 if (ctx->flags & SPU_CREATE_NOSCHED)
134 continue;
135
136 /* start searching the next fd next time we're called */
137 (*fd)++;
138 break;
161 } 139 }
162 140
163 return size; 141 return ctx;
164} 142}
165 143
166static void spufs_arch_write_note(struct spufs_ctx_info *ctx_info, int i, 144int spufs_coredump_extra_notes_size(void)
167 struct file *file)
168{ 145{
169 struct spu_context *ctx; 146 struct spu_context *ctx;
147 int size = 0, rc, fd;
148
149 fd = 0;
150 while ((ctx = coredump_next_context(&fd)) != NULL) {
151 spu_acquire_saved(ctx);
152 rc = spufs_ctx_note_size(ctx, fd);
153 spu_release_saved(ctx);
154 if (rc < 0)
155 break;
156
157 size += rc;
158 }
159
160 return size;
161}
162
163static int spufs_arch_write_note(struct spu_context *ctx, int i,
164 struct file *file, int dfd, loff_t *foffset)
165{
170 loff_t pos = 0; 166 loff_t pos = 0;
171 int sz, dfd, rc, total = 0; 167 int sz, rc, nread, total = 0;
172 const int bufsz = PAGE_SIZE; 168 const int bufsz = PAGE_SIZE;
173 char *name; 169 char *name;
174 char fullname[80], *buf; 170 char fullname[80], *buf;
@@ -176,64 +172,70 @@ static void spufs_arch_write_note(struct spufs_ctx_info *ctx_info, int i,
176 172
177 buf = (void *)get_zeroed_page(GFP_KERNEL); 173 buf = (void *)get_zeroed_page(GFP_KERNEL);
178 if (!buf) 174 if (!buf)
179 return; 175 return -ENOMEM;
180 176
181 dfd = ctx_info->dfd;
182 name = spufs_coredump_read[i].name; 177 name = spufs_coredump_read[i].name;
183 178 sz = spufs_coredump_read[i].size;
184 if (!strcmp(name, "mem"))
185 sz = ctx_info->memsize;
186 else
187 sz = spufs_coredump_read[i].size;
188
189 ctx = ctx_info->ctx;
190 if (!ctx)
191 goto out;
192 179
193 sprintf(fullname, "SPU/%d/%s", dfd, name); 180 sprintf(fullname, "SPU/%d/%s", dfd, name);
194 en.n_namesz = strlen(fullname) + 1; 181 en.n_namesz = strlen(fullname) + 1;
195 en.n_descsz = sz; 182 en.n_descsz = sz;
196 en.n_type = NT_SPU; 183 en.n_type = NT_SPU;
197 184
198 if (!spufs_dump_write(file, &en, sizeof(en))) 185 rc = spufs_dump_write(file, &en, sizeof(en), foffset);
186 if (rc)
199 goto out; 187 goto out;
200 if (!spufs_dump_write(file, fullname, en.n_namesz)) 188
189 rc = spufs_dump_write(file, fullname, en.n_namesz, foffset);
190 if (rc)
201 goto out; 191 goto out;
202 if (!spufs_dump_seek(file, roundup((unsigned long)file->f_pos, 4))) 192
193 rc = spufs_dump_align(file, buf, roundup(*foffset, 4), foffset);
194 if (rc)
203 goto out; 195 goto out;
204 196
205 do { 197 do {
206 rc = do_coredump_read(i, ctx, buf, bufsz, &pos); 198 nread = do_coredump_read(i, ctx, buf, bufsz, &pos);
207 if (rc > 0) { 199 if (nread > 0) {
208 if (!spufs_dump_write(file, buf, rc)) 200 rc = spufs_dump_write(file, buf, nread, foffset);
201 if (rc)
209 goto out; 202 goto out;
210 total += rc; 203 total += nread;
211 } 204 }
212 } while (rc == bufsz && total < sz); 205 } while (nread == bufsz && total < sz);
206
207 if (nread < 0) {
208 rc = nread;
209 goto out;
210 }
211
212 rc = spufs_dump_align(file, buf, roundup(*foffset - total + sz, 4),
213 foffset);
213 214
214 spufs_dump_seek(file, roundup((unsigned long)file->f_pos
215 - total + sz, 4));
216out: 215out:
217 free_page((unsigned long)buf); 216 free_page((unsigned long)buf);
217 return rc;
218} 218}
219 219
220static void spufs_arch_write_notes(struct file *file) 220int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset)
221{ 221{
222 int j; 222 struct spu_context *ctx;
223 struct spufs_ctx_info *ctx_info, *next; 223 int fd, j, rc;
224 224
225 list_for_each_entry_safe(ctx_info, next, &ctx_info_list, list) { 225 fd = 0;
226 spu_acquire_saved(ctx_info->ctx); 226 while ((ctx = coredump_next_context(&fd)) != NULL) {
227 for (j = 0; j < spufs_coredump_num_notes; j++) 227 spu_acquire_saved(ctx);
228 spufs_arch_write_note(ctx_info, j, file); 228
229 spu_release_saved(ctx_info->ctx); 229 for (j = 0; spufs_coredump_read[j].name != NULL; j++) {
230 list_del(&ctx_info->list); 230 rc = spufs_arch_write_note(ctx, j, file, fd, foffset);
231 kfree(ctx_info); 231 if (rc) {
232 spu_release_saved(ctx);
233 return rc;
234 }
235 }
236
237 spu_release_saved(ctx);
232 } 238 }
233}
234 239
235struct spu_coredump_calls spufs_coredump_calls = { 240 return 0;
236 .arch_notes_size = spufs_arch_notes_size, 241}
237 .arch_write_notes = spufs_arch_write_notes,
238 .owner = THIS_MODULE,
239};
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 7de4e919687b..d72b16d6816e 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -199,9 +199,9 @@ static int spufs_mem_mmap(struct file *file, struct vm_area_struct *vma)
199} 199}
200 200
201#ifdef CONFIG_SPU_FS_64K_LS 201#ifdef CONFIG_SPU_FS_64K_LS
202unsigned long spufs_get_unmapped_area(struct file *file, unsigned long addr, 202static unsigned long spufs_get_unmapped_area(struct file *file,
203 unsigned long len, unsigned long pgoff, 203 unsigned long addr, unsigned long len, unsigned long pgoff,
204 unsigned long flags) 204 unsigned long flags)
205{ 205{
206 struct spu_context *ctx = file->private_data; 206 struct spu_context *ctx = file->private_data;
207 struct spu_state *csa = &ctx->csa; 207 struct spu_state *csa = &ctx->csa;
@@ -1076,6 +1076,36 @@ static const struct file_operations spufs_signal2_nosched_fops = {
1076 .mmap = spufs_signal2_mmap, 1076 .mmap = spufs_signal2_mmap,
1077}; 1077};
1078 1078
1079/*
1080 * This is a wrapper around DEFINE_SIMPLE_ATTRIBUTE which does the
1081 * work of acquiring (or not) the SPU context before calling through
1082 * to the actual get routine. The set routine is called directly.
1083 */
1084#define SPU_ATTR_NOACQUIRE 0
1085#define SPU_ATTR_ACQUIRE 1
1086#define SPU_ATTR_ACQUIRE_SAVED 2
1087
1088#define DEFINE_SPUFS_ATTRIBUTE(__name, __get, __set, __fmt, __acquire) \
1089static u64 __##__get(void *data) \
1090{ \
1091 struct spu_context *ctx = data; \
1092 u64 ret; \
1093 \
1094 if (__acquire == SPU_ATTR_ACQUIRE) { \
1095 spu_acquire(ctx); \
1096 ret = __get(ctx); \
1097 spu_release(ctx); \
1098 } else if (__acquire == SPU_ATTR_ACQUIRE_SAVED) { \
1099 spu_acquire_saved(ctx); \
1100 ret = __get(ctx); \
1101 spu_release_saved(ctx); \
1102 } else \
1103 ret = __get(ctx); \
1104 \
1105 return ret; \
1106} \
1107DEFINE_SIMPLE_ATTRIBUTE(__name, __##__get, __set, __fmt);
1108
1079static void spufs_signal1_type_set(void *data, u64 val) 1109static void spufs_signal1_type_set(void *data, u64 val)
1080{ 1110{
1081 struct spu_context *ctx = data; 1111 struct spu_context *ctx = data;
@@ -1085,25 +1115,13 @@ static void spufs_signal1_type_set(void *data, u64 val)
1085 spu_release(ctx); 1115 spu_release(ctx);
1086} 1116}
1087 1117
1088static u64 __spufs_signal1_type_get(void *data) 1118static u64 spufs_signal1_type_get(struct spu_context *ctx)
1089{ 1119{
1090 struct spu_context *ctx = data;
1091 return ctx->ops->signal1_type_get(ctx); 1120 return ctx->ops->signal1_type_get(ctx);
1092} 1121}
1122DEFINE_SPUFS_ATTRIBUTE(spufs_signal1_type, spufs_signal1_type_get,
1123 spufs_signal1_type_set, "%llu", SPU_ATTR_ACQUIRE);
1093 1124
1094static u64 spufs_signal1_type_get(void *data)
1095{
1096 struct spu_context *ctx = data;
1097 u64 ret;
1098
1099 spu_acquire(ctx);
1100 ret = __spufs_signal1_type_get(data);
1101 spu_release(ctx);
1102
1103 return ret;
1104}
1105DEFINE_SIMPLE_ATTRIBUTE(spufs_signal1_type, spufs_signal1_type_get,
1106 spufs_signal1_type_set, "%llu");
1107 1125
1108static void spufs_signal2_type_set(void *data, u64 val) 1126static void spufs_signal2_type_set(void *data, u64 val)
1109{ 1127{
@@ -1114,25 +1132,12 @@ static void spufs_signal2_type_set(void *data, u64 val)
1114 spu_release(ctx); 1132 spu_release(ctx);
1115} 1133}
1116 1134
1117static u64 __spufs_signal2_type_get(void *data) 1135static u64 spufs_signal2_type_get(struct spu_context *ctx)
1118{ 1136{
1119 struct spu_context *ctx = data;
1120 return ctx->ops->signal2_type_get(ctx); 1137 return ctx->ops->signal2_type_get(ctx);
1121} 1138}
1122 1139DEFINE_SPUFS_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
1123static u64 spufs_signal2_type_get(void *data) 1140 spufs_signal2_type_set, "%llu", SPU_ATTR_ACQUIRE);
1124{
1125 struct spu_context *ctx = data;
1126 u64 ret;
1127
1128 spu_acquire(ctx);
1129 ret = __spufs_signal2_type_get(data);
1130 spu_release(ctx);
1131
1132 return ret;
1133}
1134DEFINE_SIMPLE_ATTRIBUTE(spufs_signal2_type, spufs_signal2_type_get,
1135 spufs_signal2_type_set, "%llu");
1136 1141
1137#if SPUFS_MMAP_4K 1142#if SPUFS_MMAP_4K
1138static unsigned long spufs_mss_mmap_nopfn(struct vm_area_struct *vma, 1143static unsigned long spufs_mss_mmap_nopfn(struct vm_area_struct *vma,
@@ -1608,17 +1613,12 @@ static void spufs_npc_set(void *data, u64 val)
1608 spu_release(ctx); 1613 spu_release(ctx);
1609} 1614}
1610 1615
1611static u64 spufs_npc_get(void *data) 1616static u64 spufs_npc_get(struct spu_context *ctx)
1612{ 1617{
1613 struct spu_context *ctx = data; 1618 return ctx->ops->npc_read(ctx);
1614 u64 ret;
1615 spu_acquire(ctx);
1616 ret = ctx->ops->npc_read(ctx);
1617 spu_release(ctx);
1618 return ret;
1619} 1619}
1620DEFINE_SIMPLE_ATTRIBUTE(spufs_npc_ops, spufs_npc_get, spufs_npc_set, 1620DEFINE_SPUFS_ATTRIBUTE(spufs_npc_ops, spufs_npc_get, spufs_npc_set,
1621 "0x%llx\n") 1621 "0x%llx\n", SPU_ATTR_ACQUIRE);
1622 1622
1623static void spufs_decr_set(void *data, u64 val) 1623static void spufs_decr_set(void *data, u64 val)
1624{ 1624{
@@ -1629,24 +1629,13 @@ static void spufs_decr_set(void *data, u64 val)
1629 spu_release_saved(ctx); 1629 spu_release_saved(ctx);
1630} 1630}
1631 1631
1632static u64 __spufs_decr_get(void *data) 1632static u64 spufs_decr_get(struct spu_context *ctx)
1633{ 1633{
1634 struct spu_context *ctx = data;
1635 struct spu_lscsa *lscsa = ctx->csa.lscsa; 1634 struct spu_lscsa *lscsa = ctx->csa.lscsa;
1636 return lscsa->decr.slot[0]; 1635 return lscsa->decr.slot[0];
1637} 1636}
1638 1637DEFINE_SPUFS_ATTRIBUTE(spufs_decr_ops, spufs_decr_get, spufs_decr_set,
1639static u64 spufs_decr_get(void *data) 1638 "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED);
1640{
1641 struct spu_context *ctx = data;
1642 u64 ret;
1643 spu_acquire_saved(ctx);
1644 ret = __spufs_decr_get(data);
1645 spu_release_saved(ctx);
1646 return ret;
1647}
1648DEFINE_SIMPLE_ATTRIBUTE(spufs_decr_ops, spufs_decr_get, spufs_decr_set,
1649 "0x%llx\n")
1650 1639
1651static void spufs_decr_status_set(void *data, u64 val) 1640static void spufs_decr_status_set(void *data, u64 val)
1652{ 1641{
@@ -1659,26 +1648,16 @@ static void spufs_decr_status_set(void *data, u64 val)
1659 spu_release_saved(ctx); 1648 spu_release_saved(ctx);
1660} 1649}
1661 1650
1662static u64 __spufs_decr_status_get(void *data) 1651static u64 spufs_decr_status_get(struct spu_context *ctx)
1663{ 1652{
1664 struct spu_context *ctx = data;
1665 if (ctx->csa.priv2.mfc_control_RW & MFC_CNTL_DECREMENTER_RUNNING) 1653 if (ctx->csa.priv2.mfc_control_RW & MFC_CNTL_DECREMENTER_RUNNING)
1666 return SPU_DECR_STATUS_RUNNING; 1654 return SPU_DECR_STATUS_RUNNING;
1667 else 1655 else
1668 return 0; 1656 return 0;
1669} 1657}
1670 1658DEFINE_SPUFS_ATTRIBUTE(spufs_decr_status_ops, spufs_decr_status_get,
1671static u64 spufs_decr_status_get(void *data) 1659 spufs_decr_status_set, "0x%llx\n",
1672{ 1660 SPU_ATTR_ACQUIRE_SAVED);
1673 struct spu_context *ctx = data;
1674 u64 ret;
1675 spu_acquire_saved(ctx);
1676 ret = __spufs_decr_status_get(data);
1677 spu_release_saved(ctx);
1678 return ret;
1679}
1680DEFINE_SIMPLE_ATTRIBUTE(spufs_decr_status_ops, spufs_decr_status_get,
1681 spufs_decr_status_set, "0x%llx\n")
1682 1661
1683static void spufs_event_mask_set(void *data, u64 val) 1662static void spufs_event_mask_set(void *data, u64 val)
1684{ 1663{
@@ -1689,28 +1668,18 @@ static void spufs_event_mask_set(void *data, u64 val)
1689 spu_release_saved(ctx); 1668 spu_release_saved(ctx);
1690} 1669}
1691 1670
1692static u64 __spufs_event_mask_get(void *data) 1671static u64 spufs_event_mask_get(struct spu_context *ctx)
1693{ 1672{
1694 struct spu_context *ctx = data;
1695 struct spu_lscsa *lscsa = ctx->csa.lscsa; 1673 struct spu_lscsa *lscsa = ctx->csa.lscsa;
1696 return lscsa->event_mask.slot[0]; 1674 return lscsa->event_mask.slot[0];
1697} 1675}
1698 1676
1699static u64 spufs_event_mask_get(void *data) 1677DEFINE_SPUFS_ATTRIBUTE(spufs_event_mask_ops, spufs_event_mask_get,
1700{ 1678 spufs_event_mask_set, "0x%llx\n",
1701 struct spu_context *ctx = data; 1679 SPU_ATTR_ACQUIRE_SAVED);
1702 u64 ret;
1703 spu_acquire_saved(ctx);
1704 ret = __spufs_event_mask_get(data);
1705 spu_release_saved(ctx);
1706 return ret;
1707}
1708DEFINE_SIMPLE_ATTRIBUTE(spufs_event_mask_ops, spufs_event_mask_get,
1709 spufs_event_mask_set, "0x%llx\n")
1710 1680
1711static u64 __spufs_event_status_get(void *data) 1681static u64 spufs_event_status_get(struct spu_context *ctx)
1712{ 1682{
1713 struct spu_context *ctx = data;
1714 struct spu_state *state = &ctx->csa; 1683 struct spu_state *state = &ctx->csa;
1715 u64 stat; 1684 u64 stat;
1716 stat = state->spu_chnlcnt_RW[0]; 1685 stat = state->spu_chnlcnt_RW[0];
@@ -1718,19 +1687,8 @@ static u64 __spufs_event_status_get(void *data)
1718 return state->spu_chnldata_RW[0]; 1687 return state->spu_chnldata_RW[0];
1719 return 0; 1688 return 0;
1720} 1689}
1721 1690DEFINE_SPUFS_ATTRIBUTE(spufs_event_status_ops, spufs_event_status_get,
1722static u64 spufs_event_status_get(void *data) 1691 NULL, "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED)
1723{
1724 struct spu_context *ctx = data;
1725 u64 ret = 0;
1726
1727 spu_acquire_saved(ctx);
1728 ret = __spufs_event_status_get(data);
1729 spu_release_saved(ctx);
1730 return ret;
1731}
1732DEFINE_SIMPLE_ATTRIBUTE(spufs_event_status_ops, spufs_event_status_get,
1733 NULL, "0x%llx\n")
1734 1692
1735static void spufs_srr0_set(void *data, u64 val) 1693static void spufs_srr0_set(void *data, u64 val)
1736{ 1694{
@@ -1741,45 +1699,32 @@ static void spufs_srr0_set(void *data, u64 val)
1741 spu_release_saved(ctx); 1699 spu_release_saved(ctx);
1742} 1700}
1743 1701
1744static u64 spufs_srr0_get(void *data) 1702static u64 spufs_srr0_get(struct spu_context *ctx)
1745{ 1703{
1746 struct spu_context *ctx = data;
1747 struct spu_lscsa *lscsa = ctx->csa.lscsa; 1704 struct spu_lscsa *lscsa = ctx->csa.lscsa;
1748 u64 ret; 1705 return lscsa->srr0.slot[0];
1749 spu_acquire_saved(ctx);
1750 ret = lscsa->srr0.slot[0];
1751 spu_release_saved(ctx);
1752 return ret;
1753} 1706}
1754DEFINE_SIMPLE_ATTRIBUTE(spufs_srr0_ops, spufs_srr0_get, spufs_srr0_set, 1707DEFINE_SPUFS_ATTRIBUTE(spufs_srr0_ops, spufs_srr0_get, spufs_srr0_set,
1755 "0x%llx\n") 1708 "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED)
1756 1709
1757static u64 spufs_id_get(void *data) 1710static u64 spufs_id_get(struct spu_context *ctx)
1758{ 1711{
1759 struct spu_context *ctx = data;
1760 u64 num; 1712 u64 num;
1761 1713
1762 spu_acquire(ctx);
1763 if (ctx->state == SPU_STATE_RUNNABLE) 1714 if (ctx->state == SPU_STATE_RUNNABLE)
1764 num = ctx->spu->number; 1715 num = ctx->spu->number;
1765 else 1716 else
1766 num = (unsigned int)-1; 1717 num = (unsigned int)-1;
1767 spu_release(ctx);
1768 1718
1769 return num; 1719 return num;
1770} 1720}
1771DEFINE_SIMPLE_ATTRIBUTE(spufs_id_ops, spufs_id_get, NULL, "0x%llx\n") 1721DEFINE_SPUFS_ATTRIBUTE(spufs_id_ops, spufs_id_get, NULL, "0x%llx\n",
1772 1722 SPU_ATTR_ACQUIRE)
1773static u64 __spufs_object_id_get(void *data)
1774{
1775 struct spu_context *ctx = data;
1776 return ctx->object_id;
1777}
1778 1723
1779static u64 spufs_object_id_get(void *data) 1724static u64 spufs_object_id_get(struct spu_context *ctx)
1780{ 1725{
1781 /* FIXME: Should there really be no locking here? */ 1726 /* FIXME: Should there really be no locking here? */
1782 return __spufs_object_id_get(data); 1727 return ctx->object_id;
1783} 1728}
1784 1729
1785static void spufs_object_id_set(void *data, u64 id) 1730static void spufs_object_id_set(void *data, u64 id)
@@ -1788,27 +1733,15 @@ static void spufs_object_id_set(void *data, u64 id)
1788 ctx->object_id = id; 1733 ctx->object_id = id;
1789} 1734}
1790 1735
1791DEFINE_SIMPLE_ATTRIBUTE(spufs_object_id_ops, spufs_object_id_get, 1736DEFINE_SPUFS_ATTRIBUTE(spufs_object_id_ops, spufs_object_id_get,
1792 spufs_object_id_set, "0x%llx\n"); 1737 spufs_object_id_set, "0x%llx\n", SPU_ATTR_NOACQUIRE);
1793 1738
1794static u64 __spufs_lslr_get(void *data) 1739static u64 spufs_lslr_get(struct spu_context *ctx)
1795{ 1740{
1796 struct spu_context *ctx = data;
1797 return ctx->csa.priv2.spu_lslr_RW; 1741 return ctx->csa.priv2.spu_lslr_RW;
1798} 1742}
1799 1743DEFINE_SPUFS_ATTRIBUTE(spufs_lslr_ops, spufs_lslr_get, NULL, "0x%llx\n",
1800static u64 spufs_lslr_get(void *data) 1744 SPU_ATTR_ACQUIRE_SAVED);
1801{
1802 struct spu_context *ctx = data;
1803 u64 ret;
1804
1805 spu_acquire_saved(ctx);
1806 ret = __spufs_lslr_get(data);
1807 spu_release_saved(ctx);
1808
1809 return ret;
1810}
1811DEFINE_SIMPLE_ATTRIBUTE(spufs_lslr_ops, spufs_lslr_get, NULL, "0x%llx\n")
1812 1745
1813static int spufs_info_open(struct inode *inode, struct file *file) 1746static int spufs_info_open(struct inode *inode, struct file *file)
1814{ 1747{
@@ -2231,25 +2164,25 @@ struct tree_descr spufs_dir_nosched_contents[] = {
2231}; 2164};
2232 2165
2233struct spufs_coredump_reader spufs_coredump_read[] = { 2166struct spufs_coredump_reader spufs_coredump_read[] = {
2234 { "regs", __spufs_regs_read, NULL, 128 * 16 }, 2167 { "regs", __spufs_regs_read, NULL, sizeof(struct spu_reg128[128])},
2235 { "fpcr", __spufs_fpcr_read, NULL, 16 }, 2168 { "fpcr", __spufs_fpcr_read, NULL, sizeof(struct spu_reg128) },
2236 { "lslr", NULL, __spufs_lslr_get, 11 }, 2169 { "lslr", NULL, spufs_lslr_get, 19 },
2237 { "decr", NULL, __spufs_decr_get, 11 }, 2170 { "decr", NULL, spufs_decr_get, 19 },
2238 { "decr_status", NULL, __spufs_decr_status_get, 11 }, 2171 { "decr_status", NULL, spufs_decr_status_get, 19 },
2239 { "mem", __spufs_mem_read, NULL, 256 * 1024, }, 2172 { "mem", __spufs_mem_read, NULL, LS_SIZE, },
2240 { "signal1", __spufs_signal1_read, NULL, 4 }, 2173 { "signal1", __spufs_signal1_read, NULL, sizeof(u32) },
2241 { "signal1_type", NULL, __spufs_signal1_type_get, 2 }, 2174 { "signal1_type", NULL, spufs_signal1_type_get, 19 },
2242 { "signal2", __spufs_signal2_read, NULL, 4 }, 2175 { "signal2", __spufs_signal2_read, NULL, sizeof(u32) },
2243 { "signal2_type", NULL, __spufs_signal2_type_get, 2 }, 2176 { "signal2_type", NULL, spufs_signal2_type_get, 19 },
2244 { "event_mask", NULL, __spufs_event_mask_get, 8 }, 2177 { "event_mask", NULL, spufs_event_mask_get, 19 },
2245 { "event_status", NULL, __spufs_event_status_get, 8 }, 2178 { "event_status", NULL, spufs_event_status_get, 19 },
2246 { "mbox_info", __spufs_mbox_info_read, NULL, 4 }, 2179 { "mbox_info", __spufs_mbox_info_read, NULL, sizeof(u32) },
2247 { "ibox_info", __spufs_ibox_info_read, NULL, 4 }, 2180 { "ibox_info", __spufs_ibox_info_read, NULL, sizeof(u32) },
2248 { "wbox_info", __spufs_wbox_info_read, NULL, 16 }, 2181 { "wbox_info", __spufs_wbox_info_read, NULL, 4 * sizeof(u32)},
2249 { "dma_info", __spufs_dma_info_read, NULL, 69 * 8 }, 2182 { "dma_info", __spufs_dma_info_read, NULL, sizeof(struct spu_dma_info)},
2250 { "proxydma_info", __spufs_proxydma_info_read, NULL, 35 * 8 }, 2183 { "proxydma_info", __spufs_proxydma_info_read,
2251 { "object-id", NULL, __spufs_object_id_get, 19 }, 2184 NULL, sizeof(struct spu_proxydma_info)},
2252 { }, 2185 { "object-id", NULL, spufs_object_id_get, 19 },
2186 { "npc", NULL, spufs_npc_get, 19 },
2187 { NULL },
2253}; 2188};
2254int spufs_coredump_num_notes = ARRAY_SIZE(spufs_coredump_read) - 1;
2255
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index b3d0dd118dd0..11098747d09b 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -43,6 +43,7 @@
43 43
44static struct kmem_cache *spufs_inode_cache; 44static struct kmem_cache *spufs_inode_cache;
45char *isolated_loader; 45char *isolated_loader;
46static int isolated_loader_size;
46 47
47static struct inode * 48static struct inode *
48spufs_alloc_inode(struct super_block *sb) 49spufs_alloc_inode(struct super_block *sb)
@@ -667,7 +668,8 @@ spufs_parse_options(char *options, struct inode *root)
667 668
668static void spufs_exit_isolated_loader(void) 669static void spufs_exit_isolated_loader(void)
669{ 670{
670 kfree(isolated_loader); 671 free_pages((unsigned long) isolated_loader,
672 get_order(isolated_loader_size));
671} 673}
672 674
673static void 675static void
@@ -685,11 +687,12 @@ spufs_init_isolated_loader(void)
685 if (!loader) 687 if (!loader)
686 return; 688 return;
687 689
688 /* kmalloc should align on a 16 byte boundary..* */ 690 /* the loader must be align on a 16 byte boundary */
689 isolated_loader = kmalloc(size, GFP_KERNEL); 691 isolated_loader = (char *)__get_free_pages(GFP_KERNEL, get_order(size));
690 if (!isolated_loader) 692 if (!isolated_loader)
691 return; 693 return;
692 694
695 isolated_loader_size = size;
693 memcpy(isolated_loader, loader, size); 696 memcpy(isolated_loader, loader, size);
694 printk(KERN_INFO "spufs: SPU isolation mode enabled\n"); 697 printk(KERN_INFO "spufs: SPU isolation mode enabled\n");
695} 698}
@@ -787,16 +790,11 @@ static int __init spufs_init(void)
787 ret = register_spu_syscalls(&spufs_calls); 790 ret = register_spu_syscalls(&spufs_calls);
788 if (ret) 791 if (ret)
789 goto out_fs; 792 goto out_fs;
790 ret = register_arch_coredump_calls(&spufs_coredump_calls);
791 if (ret)
792 goto out_syscalls;
793 793
794 spufs_init_isolated_loader(); 794 spufs_init_isolated_loader();
795 795
796 return 0; 796 return 0;
797 797
798out_syscalls:
799 unregister_spu_syscalls(&spufs_calls);
800out_fs: 798out_fs:
801 unregister_filesystem(&spufs_type); 799 unregister_filesystem(&spufs_type);
802out_sched: 800out_sched:
@@ -812,7 +810,6 @@ static void __exit spufs_exit(void)
812{ 810{
813 spu_sched_exit(); 811 spu_sched_exit();
814 spufs_exit_isolated_loader(); 812 spufs_exit_isolated_loader();
815 unregister_arch_coredump_calls(&spufs_coredump_calls);
816 unregister_spu_syscalls(&spufs_calls); 813 unregister_spu_syscalls(&spufs_calls);
817 unregister_filesystem(&spufs_type); 814 unregister_filesystem(&spufs_type);
818 kmem_cache_destroy(spufs_inode_cache); 815 kmem_cache_destroy(spufs_inode_cache);
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index 958f10e90fdd..1ce5e22ea5f4 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -205,7 +205,7 @@ static int spu_reacquire_runnable(struct spu_context *ctx, u32 *npc,
205 * This means we can only do a very rough approximation of POSIX 205 * This means we can only do a very rough approximation of POSIX
206 * signal semantics. 206 * signal semantics.
207 */ 207 */
208int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret, 208static int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret,
209 unsigned int *npc) 209 unsigned int *npc)
210{ 210{
211 int ret; 211 int ret;
@@ -241,7 +241,7 @@ int spu_handle_restartsys(struct spu_context *ctx, long *spu_ret,
241 return ret; 241 return ret;
242} 242}
243 243
244int spu_process_callback(struct spu_context *ctx) 244static int spu_process_callback(struct spu_context *ctx)
245{ 245{
246 struct spu_syscall_block s; 246 struct spu_syscall_block s;
247 u32 ls_pointer, npc; 247 u32 ls_pointer, npc;
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 5bebe7fbe056..4d257b3f9336 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -230,8 +230,6 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx)
230 230
231 if (ctx->flags & SPU_CREATE_NOSCHED) 231 if (ctx->flags & SPU_CREATE_NOSCHED)
232 atomic_inc(&cbe_spu_info[spu->node].reserved_spus); 232 atomic_inc(&cbe_spu_info[spu->node].reserved_spus);
233 if (!list_empty(&ctx->aff_list))
234 atomic_inc(&ctx->gang->aff_sched_count);
235 233
236 ctx->stats.slb_flt_base = spu->stats.slb_flt; 234 ctx->stats.slb_flt_base = spu->stats.slb_flt;
237 ctx->stats.class2_intr_base = spu->stats.class2_intr; 235 ctx->stats.class2_intr_base = spu->stats.class2_intr;
@@ -392,7 +390,6 @@ static int has_affinity(struct spu_context *ctx)
392 if (list_empty(&ctx->aff_list)) 390 if (list_empty(&ctx->aff_list))
393 return 0; 391 return 0;
394 392
395 mutex_lock(&gang->aff_mutex);
396 if (!gang->aff_ref_spu) { 393 if (!gang->aff_ref_spu) {
397 if (!(gang->aff_flags & AFF_MERGED)) 394 if (!(gang->aff_flags & AFF_MERGED))
398 aff_merge_remaining_ctxs(gang); 395 aff_merge_remaining_ctxs(gang);
@@ -400,7 +397,6 @@ static int has_affinity(struct spu_context *ctx)
400 aff_set_offsets(gang); 397 aff_set_offsets(gang);
401 aff_set_ref_point_location(gang); 398 aff_set_ref_point_location(gang);
402 } 399 }
403 mutex_unlock(&gang->aff_mutex);
404 400
405 return gang->aff_ref_spu != NULL; 401 return gang->aff_ref_spu != NULL;
406} 402}
@@ -418,9 +414,16 @@ static void spu_unbind_context(struct spu *spu, struct spu_context *ctx)
418 414
419 if (spu->ctx->flags & SPU_CREATE_NOSCHED) 415 if (spu->ctx->flags & SPU_CREATE_NOSCHED)
420 atomic_dec(&cbe_spu_info[spu->node].reserved_spus); 416 atomic_dec(&cbe_spu_info[spu->node].reserved_spus);
421 if (!list_empty(&ctx->aff_list)) 417
422 if (atomic_dec_and_test(&ctx->gang->aff_sched_count)) 418 if (ctx->gang){
423 ctx->gang->aff_ref_spu = NULL; 419 mutex_lock(&ctx->gang->aff_mutex);
420 if (has_affinity(ctx)) {
421 if (atomic_dec_and_test(&ctx->gang->aff_sched_count))
422 ctx->gang->aff_ref_spu = NULL;
423 }
424 mutex_unlock(&ctx->gang->aff_mutex);
425 }
426
424 spu_switch_notify(spu, NULL); 427 spu_switch_notify(spu, NULL);
425 spu_unmap_mappings(ctx); 428 spu_unmap_mappings(ctx);
426 spu_save(&ctx->csa, spu); 429 spu_save(&ctx->csa, spu);
@@ -511,20 +514,32 @@ static void spu_prio_wait(struct spu_context *ctx)
511 514
512static struct spu *spu_get_idle(struct spu_context *ctx) 515static struct spu *spu_get_idle(struct spu_context *ctx)
513{ 516{
514 struct spu *spu; 517 struct spu *spu, *aff_ref_spu;
515 int node, n; 518 int node, n;
516 519
517 if (has_affinity(ctx)) { 520 if (ctx->gang) {
518 node = ctx->gang->aff_ref_spu->node; 521 mutex_lock(&ctx->gang->aff_mutex);
522 if (has_affinity(ctx)) {
523 aff_ref_spu = ctx->gang->aff_ref_spu;
524 atomic_inc(&ctx->gang->aff_sched_count);
525 mutex_unlock(&ctx->gang->aff_mutex);
526 node = aff_ref_spu->node;
519 527
520 mutex_lock(&cbe_spu_info[node].list_mutex); 528 mutex_lock(&cbe_spu_info[node].list_mutex);
521 spu = ctx_location(ctx->gang->aff_ref_spu, ctx->aff_offset, node); 529 spu = ctx_location(aff_ref_spu, ctx->aff_offset, node);
522 if (spu && spu->alloc_state == SPU_FREE) 530 if (spu && spu->alloc_state == SPU_FREE)
523 goto found; 531 goto found;
524 mutex_unlock(&cbe_spu_info[node].list_mutex); 532 mutex_unlock(&cbe_spu_info[node].list_mutex);
525 return NULL;
526 }
527 533
534 mutex_lock(&ctx->gang->aff_mutex);
535 if (atomic_dec_and_test(&ctx->gang->aff_sched_count))
536 ctx->gang->aff_ref_spu = NULL;
537 mutex_unlock(&ctx->gang->aff_mutex);
538
539 return NULL;
540 }
541 mutex_unlock(&ctx->gang->aff_mutex);
542 }
528 node = cpu_to_node(raw_smp_processor_id()); 543 node = cpu_to_node(raw_smp_processor_id());
529 for (n = 0; n < MAX_NUMNODES; n++, node++) { 544 for (n = 0; n < MAX_NUMNODES; n++, node++) {
530 node = (node < MAX_NUMNODES) ? node : 0; 545 node = (node < MAX_NUMNODES) ? node : 0;
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 2bfdeb8ea8bd..ca47b991bda5 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -200,9 +200,14 @@ extern struct tree_descr spufs_dir_contents[];
200extern struct tree_descr spufs_dir_nosched_contents[]; 200extern struct tree_descr spufs_dir_nosched_contents[];
201 201
202/* system call implementation */ 202/* system call implementation */
203extern struct spufs_calls spufs_calls;
203long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status); 204long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status);
204long spufs_create(struct nameidata *nd, unsigned int flags, 205long spufs_create(struct nameidata *nd, unsigned int flags,
205 mode_t mode, struct file *filp); 206 mode_t mode, struct file *filp);
207/* ELF coredump callbacks for writing SPU ELF notes */
208extern int spufs_coredump_extra_notes_size(void);
209extern int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset);
210
206extern const struct file_operations spufs_context_fops; 211extern const struct file_operations spufs_context_fops;
207 212
208/* gang management */ 213/* gang management */
@@ -295,7 +300,7 @@ struct spufs_coredump_reader {
295 char *name; 300 char *name;
296 ssize_t (*read)(struct spu_context *ctx, 301 ssize_t (*read)(struct spu_context *ctx,
297 char __user *buffer, size_t size, loff_t *pos); 302 char __user *buffer, size_t size, loff_t *pos);
298 u64 (*get)(void *data); 303 u64 (*get)(struct spu_context *ctx);
299 size_t size; 304 size_t size;
300}; 305};
301extern struct spufs_coredump_reader spufs_coredump_read[]; 306extern struct spufs_coredump_reader spufs_coredump_read[];
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index 27ffdae98e5a..3d64c81cc6e2 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -699,7 +699,7 @@ static inline void get_kernel_slb(u64 ea, u64 slb[2])
699 llp = mmu_psize_defs[mmu_linear_psize].sllp; 699 llp = mmu_psize_defs[mmu_linear_psize].sllp;
700 else 700 else
701 llp = mmu_psize_defs[mmu_virtual_psize].sllp; 701 llp = mmu_psize_defs[mmu_virtual_psize].sllp;
702 slb[0] = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | 702 slb[0] = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
703 SLB_VSID_KERNEL | llp; 703 SLB_VSID_KERNEL | llp;
704 slb[1] = (ea & ESID_MASK) | SLB_ESID_V; 704 slb[1] = (ea & ESID_MASK) | SLB_ESID_V;
705} 705}
@@ -1559,15 +1559,15 @@ static inline void restore_decr_wrapped(struct spu_state *csa, struct spu *spu)
1559 * "wrapped" flag is set, OR in a '1' to 1559 * "wrapped" flag is set, OR in a '1' to
1560 * CSA.SPU_Event_Status[Tm]. 1560 * CSA.SPU_Event_Status[Tm].
1561 */ 1561 */
1562 if (csa->lscsa->decr_status.slot[0] & SPU_DECR_STATUS_WRAPPED) { 1562 if (!(csa->lscsa->decr_status.slot[0] & SPU_DECR_STATUS_WRAPPED))
1563 csa->spu_chnldata_RW[0] |= 0x20; 1563 return;
1564 } 1564
1565 if ((csa->lscsa->decr_status.slot[0] & SPU_DECR_STATUS_WRAPPED) && 1565 if ((csa->spu_chnlcnt_RW[0] == 0) &&
1566 (csa->spu_chnlcnt_RW[0] == 0 && 1566 (csa->spu_chnldata_RW[1] & 0x20) &&
1567 ((csa->spu_chnldata_RW[2] & 0x20) == 0x0) && 1567 !(csa->spu_chnldata_RW[0] & 0x20))
1568 ((csa->spu_chnldata_RW[0] & 0x20) != 0x1))) {
1569 csa->spu_chnlcnt_RW[0] = 1; 1568 csa->spu_chnlcnt_RW[0] = 1;
1570 } 1569
1570 csa->spu_chnldata_RW[0] |= 0x20;
1571} 1571}
1572 1572
1573static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu) 1573static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu)
@@ -2146,19 +2146,6 @@ int spu_restore(struct spu_state *new, struct spu *spu)
2146} 2146}
2147EXPORT_SYMBOL_GPL(spu_restore); 2147EXPORT_SYMBOL_GPL(spu_restore);
2148 2148
2149/**
2150 * spu_harvest - SPU harvest (reset) operation
2151 * @spu: pointer to SPU iomem structure.
2152 *
2153 * Perform SPU harvest (reset) operation.
2154 */
2155void spu_harvest(struct spu *spu)
2156{
2157 acquire_spu_lock(spu);
2158 harvest(NULL, spu);
2159 release_spu_lock(spu);
2160}
2161
2162static void init_prob(struct spu_state *csa) 2149static void init_prob(struct spu_state *csa)
2163{ 2150{
2164 csa->spu_chnlcnt_RW[9] = 1; 2151 csa->spu_chnlcnt_RW[9] = 1;
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c
index 43f0fb88abbc..2c34f7170190 100644
--- a/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ b/arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -58,26 +58,8 @@ out:
58 return ret; 58 return ret;
59} 59}
60 60
61#ifndef MODULE 61static long do_spu_create(const char __user *pathname, unsigned int flags,
62asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, __u32 __user *ustatus) 62 mode_t mode, struct file *neighbor)
63{
64 int fput_needed;
65 struct file *filp;
66 long ret;
67
68 ret = -EBADF;
69 filp = fget_light(fd, &fput_needed);
70 if (filp) {
71 ret = do_spu_run(filp, unpc, ustatus);
72 fput_light(filp, fput_needed);
73 }
74
75 return ret;
76}
77#endif
78
79asmlinkage long do_spu_create(const char __user *pathname, unsigned int flags,
80 mode_t mode, struct file *neighbor)
81{ 63{
82 char *tmp; 64 char *tmp;
83 int ret; 65 int ret;
@@ -99,32 +81,10 @@ asmlinkage long do_spu_create(const char __user *pathname, unsigned int flags,
99 return ret; 81 return ret;
100} 82}
101 83
102#ifndef MODULE
103asmlinkage long sys_spu_create(const char __user *pathname, unsigned int flags,
104 mode_t mode, int neighbor_fd)
105{
106 int fput_needed;
107 struct file *neighbor;
108 long ret;
109
110 if (flags & SPU_CREATE_AFFINITY_SPU) {
111 ret = -EBADF;
112 neighbor = fget_light(neighbor_fd, &fput_needed);
113 if (neighbor) {
114 ret = do_spu_create(pathname, flags, mode, neighbor);
115 fput_light(neighbor, fput_needed);
116 }
117 }
118 else {
119 ret = do_spu_create(pathname, flags, mode, NULL);
120 }
121
122 return ret;
123}
124#endif
125
126struct spufs_calls spufs_calls = { 84struct spufs_calls spufs_calls = {
127 .create_thread = do_spu_create, 85 .create_thread = do_spu_create,
128 .spu_run = do_spu_run, 86 .spu_run = do_spu_run,
87 .coredump_extra_notes_size = spufs_coredump_extra_notes_size,
88 .coredump_extra_notes_write = spufs_coredump_extra_notes_write,
129 .owner = THIS_MODULE, 89 .owner = THIS_MODULE,
130}; 90};
diff --git a/arch/powerpc/platforms/celleb/Kconfig b/arch/powerpc/platforms/celleb/Kconfig
index 2db1e293433e..04748d410fc9 100644
--- a/arch/powerpc/platforms/celleb/Kconfig
+++ b/arch/powerpc/platforms/celleb/Kconfig
@@ -2,6 +2,7 @@ config PPC_CELLEB
2 bool "Toshiba's Cell Reference Set 'Celleb' Architecture" 2 bool "Toshiba's Cell Reference Set 'Celleb' Architecture"
3 depends on PPC_MULTIPLATFORM && PPC64 3 depends on PPC_MULTIPLATFORM && PPC64
4 select PPC_CELL 4 select PPC_CELL
5 select PPC_INDIRECT_IO
5 select PPC_OF_PLATFORM_PCI 6 select PPC_OF_PLATFORM_PCI
6 select HAS_TXX9_SERIAL 7 select HAS_TXX9_SERIAL
7 select PPC_UDBG_BEAT 8 select PPC_UDBG_BEAT
diff --git a/arch/powerpc/platforms/celleb/Makefile b/arch/powerpc/platforms/celleb/Makefile
index 5240046d8671..889d43f715ea 100644
--- a/arch/powerpc/platforms/celleb/Makefile
+++ b/arch/powerpc/platforms/celleb/Makefile
@@ -1,6 +1,7 @@
1obj-y += interrupt.o iommu.o setup.o \ 1obj-y += interrupt.o iommu.o setup.o \
2 htab.o beat.o pci.o \ 2 htab.o beat.o hvCall.o pci.o \
3 scc_epci.o scc_uhc.o hvCall.o 3 scc_epci.o scc_uhc.o \
4 io-workarounds.o
4 5
5obj-$(CONFIG_SMP) += smp.o 6obj-$(CONFIG_SMP) += smp.o
6obj-$(CONFIG_PPC_UDBG_BEAT) += udbg_beat.o 7obj-$(CONFIG_PPC_UDBG_BEAT) += udbg_beat.o
diff --git a/arch/powerpc/platforms/celleb/beat.c b/arch/powerpc/platforms/celleb/beat.c
index 99341ce8a697..93ebb7d85120 100644
--- a/arch/powerpc/platforms/celleb/beat.c
+++ b/arch/powerpc/platforms/celleb/beat.c
@@ -22,16 +22,24 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/err.h> 23#include <linux/err.h>
24#include <linux/rtc.h> 24#include <linux/rtc.h>
25#include <linux/interrupt.h>
26#include <linux/irqreturn.h>
27#include <linux/reboot.h>
25 28
26#include <asm/hvconsole.h> 29#include <asm/hvconsole.h>
27#include <asm/time.h> 30#include <asm/time.h>
31#include <asm/machdep.h>
32#include <asm/firmware.h>
28 33
29#include "beat_wrapper.h" 34#include "beat_wrapper.h"
30#include "beat.h" 35#include "beat.h"
36#include "interrupt.h"
37
38static int beat_pm_poweroff_flag;
31 39
32void beat_restart(char *cmd) 40void beat_restart(char *cmd)
33{ 41{
34 beat_shutdown_logical_partition(1); 42 beat_shutdown_logical_partition(!beat_pm_poweroff_flag);
35} 43}
36 44
37void beat_power_off(void) 45void beat_power_off(void)
@@ -158,6 +166,102 @@ int64_t beat_put_term_char(u64 vterm, u64 len, u64 t1, u64 t2)
158 return beat_put_characters_to_console(vterm, len, (u8*)db); 166 return beat_put_characters_to_console(vterm, len, (u8*)db);
159} 167}
160 168
169void beat_power_save(void)
170{
171 beat_pause(0);
172}
173
174#ifdef CONFIG_KEXEC
175void beat_kexec_cpu_down(int crash, int secondary)
176{
177 beatic_deinit_IRQ();
178}
179#endif
180
181static irqreturn_t beat_power_event(int virq, void *arg)
182{
183 printk(KERN_DEBUG "Beat: power button pressed\n");
184 beat_pm_poweroff_flag = 1;
185 ctrl_alt_del();
186 return IRQ_HANDLED;
187}
188
189static irqreturn_t beat_reset_event(int virq, void *arg)
190{
191 printk(KERN_DEBUG "Beat: reset button pressed\n");
192 beat_pm_poweroff_flag = 0;
193 ctrl_alt_del();
194 return IRQ_HANDLED;
195}
196
197static struct beat_event_list {
198 const char *typecode;
199 irq_handler_t handler;
200 unsigned int virq;
201} beat_event_list[] = {
202 { "power", beat_power_event, 0 },
203 { "reset", beat_reset_event, 0 },
204};
205
206static int __init beat_register_event(void)
207{
208 u64 path[4], data[2];
209 int rc, i;
210 unsigned int virq;
211
212 for (i = 0; i < ARRAY_SIZE(beat_event_list); i++) {
213 struct beat_event_list *ev = &beat_event_list[i];
214
215 if (beat_construct_event_receive_port(data) != 0) {
216 printk(KERN_ERR "Beat: "
217 "cannot construct event receive port for %s\n",
218 ev->typecode);
219 return -EINVAL;
220 }
221
222 virq = irq_create_mapping(NULL, data[0]);
223 if (virq == NO_IRQ) {
224 printk(KERN_ERR "Beat: failed to get virtual IRQ"
225 " for event receive port for %s\n",
226 ev->typecode);
227 beat_destruct_event_receive_port(data[0]);
228 return -EIO;
229 }
230 ev->virq = virq;
231
232 rc = request_irq(virq, ev->handler, IRQF_DISABLED,
233 ev->typecode, NULL);
234 if (rc != 0) {
235 printk(KERN_ERR "Beat: failed to request virtual IRQ"
236 " for event receive port for %s\n",
237 ev->typecode);
238 beat_destruct_event_receive_port(data[0]);
239 return rc;
240 }
241
242 path[0] = 0x1000000065780000ul; /* 1,ex */
243 path[1] = 0x627574746f6e0000ul; /* button */
244 path[2] = 0;
245 strncpy((char *)&path[2], ev->typecode, 8);
246 path[3] = 0;
247 data[1] = 0;
248
249 beat_create_repository_node(path, data);
250 }
251 return 0;
252}
253
254static int __init beat_event_init(void)
255{
256 if (!firmware_has_feature(FW_FEATURE_BEAT))
257 return -EINVAL;
258
259 beat_pm_poweroff_flag = 0;
260 return beat_register_event();
261}
262
263device_initcall(beat_event_init);
264
161EXPORT_SYMBOL(beat_get_term_char); 265EXPORT_SYMBOL(beat_get_term_char);
162EXPORT_SYMBOL(beat_put_term_char); 266EXPORT_SYMBOL(beat_put_term_char);
163EXPORT_SYMBOL(beat_halt_code); 267EXPORT_SYMBOL(beat_halt_code);
diff --git a/arch/powerpc/platforms/celleb/beat.h b/arch/powerpc/platforms/celleb/beat.h
index 2b16bf3bee89..b2e292df13ca 100644
--- a/arch/powerpc/platforms/celleb/beat.h
+++ b/arch/powerpc/platforms/celleb/beat.h
@@ -36,5 +36,7 @@ ssize_t beat_nvram_get_size(void);
36ssize_t beat_nvram_read(char *, size_t, loff_t *); 36ssize_t beat_nvram_read(char *, size_t, loff_t *);
37ssize_t beat_nvram_write(char *, size_t, loff_t *); 37ssize_t beat_nvram_write(char *, size_t, loff_t *);
38int beat_set_xdabr(unsigned long); 38int beat_set_xdabr(unsigned long);
39void beat_power_save(void);
40void beat_kexec_cpu_down(int, int);
39 41
40#endif /* _CELLEB_BEAT_H */ 42#endif /* _CELLEB_BEAT_H */
diff --git a/arch/powerpc/platforms/celleb/beat_syscall.h b/arch/powerpc/platforms/celleb/beat_syscall.h
index 14e16974773f..8580dc7e1798 100644
--- a/arch/powerpc/platforms/celleb/beat_syscall.h
+++ b/arch/powerpc/platforms/celleb/beat_syscall.h
@@ -157,4 +157,8 @@
157#define HV_rtc_write __BEAT_ADD_VENDOR_ID(0x191, 1) 157#define HV_rtc_write __BEAT_ADD_VENDOR_ID(0x191, 1)
158#define HV_eeprom_read __BEAT_ADD_VENDOR_ID(0x192, 1) 158#define HV_eeprom_read __BEAT_ADD_VENDOR_ID(0x192, 1)
159#define HV_eeprom_write __BEAT_ADD_VENDOR_ID(0x193, 1) 159#define HV_eeprom_write __BEAT_ADD_VENDOR_ID(0x193, 1)
160#define HV_insert_htab_entry3 __BEAT_ADD_VENDOR_ID(0x104, 1)
161#define HV_invalidate_htab_entry3 __BEAT_ADD_VENDOR_ID(0x105, 1)
162#define HV_update_htab_permission3 __BEAT_ADD_VENDOR_ID(0x106, 1)
163#define HV_clear_htab3 __BEAT_ADD_VENDOR_ID(0x107, 1)
160#endif 164#endif
diff --git a/arch/powerpc/platforms/celleb/beat_wrapper.h b/arch/powerpc/platforms/celleb/beat_wrapper.h
index 76ea0a6a9011..cbc1487df7de 100644
--- a/arch/powerpc/platforms/celleb/beat_wrapper.h
+++ b/arch/powerpc/platforms/celleb/beat_wrapper.h
@@ -98,6 +98,37 @@ static inline s64 beat_write_htab_entry(u64 htab_id, u64 slot,
98 return ret; 98 return ret;
99} 99}
100 100
101static inline s64 beat_insert_htab_entry3(u64 htab_id, u64 group,
102 u64 hpte_v, u64 hpte_r, u64 mask_v, u64 value_v, u64 *slot)
103{
104 u64 dummy[1];
105 s64 ret;
106
107 ret = beat_hcall1(HV_insert_htab_entry3, dummy, htab_id, group,
108 hpte_v, hpte_r, mask_v, value_v);
109 *slot = dummy[0];
110 return ret;
111}
112
113static inline s64 beat_invalidate_htab_entry3(u64 htab_id, u64 group,
114 u64 va, u64 pss)
115{
116 return beat_hcall_norets(HV_invalidate_htab_entry3,
117 htab_id, group, va, pss);
118}
119
120static inline s64 beat_update_htab_permission3(u64 htab_id, u64 group,
121 u64 va, u64 pss, u64 ptel_mask, u64 ptel_value)
122{
123 return beat_hcall_norets(HV_update_htab_permission3,
124 htab_id, group, va, pss, ptel_mask, ptel_value);
125}
126
127static inline s64 beat_clear_htab3(u64 htab_id)
128{
129 return beat_hcall_norets(HV_clear_htab3, htab_id);
130}
131
101static inline void beat_shutdown_logical_partition(u64 code) 132static inline void beat_shutdown_logical_partition(u64 code)
102{ 133{
103 (void)beat_hcall_norets(HV_shutdown_logical_partition, code); 134 (void)beat_hcall_norets(HV_shutdown_logical_partition, code);
@@ -217,4 +248,41 @@ static inline s64 beat_put_iopte(u64 ioas_id, u64 io_addr, u64 real_addr,
217 ioid, flags); 248 ioid, flags);
218} 249}
219 250
251static inline s64 beat_construct_event_receive_port(u64 *port)
252{
253 u64 dummy[1];
254 s64 ret;
255
256 ret = beat_hcall1(HV_construct_event_receive_port, dummy);
257 *port = dummy[0];
258 return ret;
259}
260
261static inline s64 beat_destruct_event_receive_port(u64 port)
262{
263 s64 ret;
264
265 ret = beat_hcall_norets(HV_destruct_event_receive_port, port);
266 return ret;
267}
268
269static inline s64 beat_create_repository_node(u64 path[4], u64 data[2])
270{
271 s64 ret;
272
273 ret = beat_hcall_norets(HV_create_repository_node2,
274 path[0], path[1], path[2], path[3], data[0], data[1]);
275 return ret;
276}
277
278static inline s64 beat_get_repository_node_value(u64 lpid, u64 path[4],
279 u64 data[2])
280{
281 s64 ret;
282
283 ret = beat_hcall2(HV_get_repository_node_value2, data,
284 lpid, path[0], path[1], path[2], path[3]);
285 return ret;
286}
287
220#endif 288#endif
diff --git a/arch/powerpc/platforms/celleb/htab.c b/arch/powerpc/platforms/celleb/htab.c
index 279d7339e170..fbf27c74ebda 100644
--- a/arch/powerpc/platforms/celleb/htab.c
+++ b/arch/powerpc/platforms/celleb/htab.c
@@ -90,7 +90,7 @@ static inline unsigned int beat_read_mask(unsigned hpte_group)
90static long beat_lpar_hpte_insert(unsigned long hpte_group, 90static long beat_lpar_hpte_insert(unsigned long hpte_group,
91 unsigned long va, unsigned long pa, 91 unsigned long va, unsigned long pa,
92 unsigned long rflags, unsigned long vflags, 92 unsigned long rflags, unsigned long vflags,
93 int psize) 93 int psize, int ssize)
94{ 94{
95 unsigned long lpar_rc; 95 unsigned long lpar_rc;
96 unsigned long slot; 96 unsigned long slot;
@@ -105,7 +105,8 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group,
105 "rflags=%lx, vflags=%lx, psize=%d)\n", 105 "rflags=%lx, vflags=%lx, psize=%d)\n",
106 hpte_group, va, pa, rflags, vflags, psize); 106 hpte_group, va, pa, rflags, vflags, psize);
107 107
108 hpte_v = hpte_encode_v(va, psize) | vflags | HPTE_V_VALID; 108 hpte_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M) |
109 vflags | HPTE_V_VALID;
109 hpte_r = hpte_encode_r(pa, psize) | rflags; 110 hpte_r = hpte_encode_r(pa, psize) | rflags;
110 111
111 if (!(vflags & HPTE_V_BOLTED)) 112 if (!(vflags & HPTE_V_BOLTED))
@@ -184,12 +185,12 @@ static void beat_lpar_hptab_clear(void)
184static long beat_lpar_hpte_updatepp(unsigned long slot, 185static long beat_lpar_hpte_updatepp(unsigned long slot,
185 unsigned long newpp, 186 unsigned long newpp,
186 unsigned long va, 187 unsigned long va,
187 int psize, int local) 188 int psize, int ssize, int local)
188{ 189{
189 unsigned long lpar_rc; 190 unsigned long lpar_rc;
190 unsigned long dummy0, dummy1, want_v; 191 unsigned long dummy0, dummy1, want_v;
191 192
192 want_v = hpte_encode_v(va, psize); 193 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
193 194
194 DBG_LOW(" update: " 195 DBG_LOW(" update: "
195 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ", 196 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ",
@@ -225,8 +226,8 @@ static long beat_lpar_hpte_find(unsigned long va, int psize)
225 long slot; 226 long slot;
226 unsigned long want_v, hpte_v; 227 unsigned long want_v, hpte_v;
227 228
228 hash = hpt_hash(va, mmu_psize_defs[psize].shift); 229 hash = hpt_hash(va, mmu_psize_defs[psize].shift, MMU_SEGSIZE_256M);
229 want_v = hpte_encode_v(va, psize); 230 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
230 231
231 for (j = 0; j < 2; j++) { 232 for (j = 0; j < 2; j++) {
232 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 233 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
@@ -251,11 +252,11 @@ static long beat_lpar_hpte_find(unsigned long va, int psize)
251 252
252static void beat_lpar_hpte_updateboltedpp(unsigned long newpp, 253static void beat_lpar_hpte_updateboltedpp(unsigned long newpp,
253 unsigned long ea, 254 unsigned long ea,
254 int psize) 255 int psize, int ssize)
255{ 256{
256 unsigned long lpar_rc, slot, vsid, va, dummy0, dummy1; 257 unsigned long lpar_rc, slot, vsid, va, dummy0, dummy1;
257 258
258 vsid = get_kernel_vsid(ea); 259 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M);
259 va = (vsid << 28) | (ea & 0x0fffffff); 260 va = (vsid << 28) | (ea & 0x0fffffff);
260 261
261 spin_lock(&beat_htab_lock); 262 spin_lock(&beat_htab_lock);
@@ -270,7 +271,7 @@ static void beat_lpar_hpte_updateboltedpp(unsigned long newpp,
270} 271}
271 272
272static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long va, 273static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
273 int psize, int local) 274 int psize, int ssize, int local)
274{ 275{
275 unsigned long want_v; 276 unsigned long want_v;
276 unsigned long lpar_rc; 277 unsigned long lpar_rc;
@@ -279,7 +280,7 @@ static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
279 280
280 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n", 281 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
281 slot, va, psize, local); 282 slot, va, psize, local);
282 want_v = hpte_encode_v(va, psize); 283 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
283 284
284 spin_lock_irqsave(&beat_htab_lock, flags); 285 spin_lock_irqsave(&beat_htab_lock, flags);
285 dummy1 = beat_lpar_hpte_getword0(slot); 286 dummy1 = beat_lpar_hpte_getword0(slot);
@@ -306,3 +307,134 @@ void __init hpte_init_beat(void)
306 ppc_md.hpte_remove = beat_lpar_hpte_remove; 307 ppc_md.hpte_remove = beat_lpar_hpte_remove;
307 ppc_md.hpte_clear_all = beat_lpar_hptab_clear; 308 ppc_md.hpte_clear_all = beat_lpar_hptab_clear;
308} 309}
310
311static long beat_lpar_hpte_insert_v3(unsigned long hpte_group,
312 unsigned long va, unsigned long pa,
313 unsigned long rflags, unsigned long vflags,
314 int psize, int ssize)
315{
316 unsigned long lpar_rc;
317 unsigned long slot;
318 unsigned long hpte_v, hpte_r;
319
320 /* same as iseries */
321 if (vflags & HPTE_V_SECONDARY)
322 return -1;
323
324 if (!(vflags & HPTE_V_BOLTED))
325 DBG_LOW("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
326 "rflags=%lx, vflags=%lx, psize=%d)\n",
327 hpte_group, va, pa, rflags, vflags, psize);
328
329 hpte_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M) |
330 vflags | HPTE_V_VALID;
331 hpte_r = hpte_encode_r(pa, psize) | rflags;
332
333 if (!(vflags & HPTE_V_BOLTED))
334 DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
335
336 if (rflags & (_PAGE_GUARDED|_PAGE_NO_CACHE))
337 hpte_r &= ~_PAGE_COHERENT;
338
339 /* insert into not-volted entry */
340 lpar_rc = beat_insert_htab_entry3(0, hpte_group, hpte_v, hpte_r,
341 HPTE_V_BOLTED, 0, &slot);
342 /*
343 * Since we try and ioremap PHBs we don't own, the pte insert
344 * will fail. However we must catch the failure in hash_page
345 * or we will loop forever, so return -2 in this case.
346 */
347 if (unlikely(lpar_rc != 0)) {
348 if (!(vflags & HPTE_V_BOLTED))
349 DBG_LOW(" lpar err %lx\n", lpar_rc);
350 return -2;
351 }
352 if (!(vflags & HPTE_V_BOLTED))
353 DBG_LOW(" -> slot: %lx\n", slot);
354
355 /* We have to pass down the secondary bucket bit here as well */
356 return (slot ^ hpte_group) & 15;
357}
358
359/*
360 * NOTE: for updatepp ops we are fortunate that the linux "newpp" bits and
361 * the low 3 bits of flags happen to line up. So no transform is needed.
362 * We can probably optimize here and assume the high bits of newpp are
363 * already zero. For now I am paranoid.
364 */
365static long beat_lpar_hpte_updatepp_v3(unsigned long slot,
366 unsigned long newpp,
367 unsigned long va,
368 int psize, int ssize, int local)
369{
370 unsigned long lpar_rc;
371 unsigned long want_v;
372 unsigned long pss;
373
374 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
375 pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc;
376
377 DBG_LOW(" update: "
378 "avpnv=%016lx, slot=%016lx, psize: %d, newpp %016lx ... ",
379 want_v & HPTE_V_AVPN, slot, psize, newpp);
380
381 lpar_rc = beat_update_htab_permission3(0, slot, want_v, pss, 7, newpp);
382
383 if (lpar_rc == 0xfffffff7) {
384 DBG_LOW("not found !\n");
385 return -1;
386 }
387
388 DBG_LOW("ok\n");
389
390 BUG_ON(lpar_rc != 0);
391
392 return 0;
393}
394
395static void beat_lpar_hpte_invalidate_v3(unsigned long slot, unsigned long va,
396 int psize, int ssize, int local)
397{
398 unsigned long want_v;
399 unsigned long lpar_rc;
400 unsigned long pss;
401
402 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
403 slot, va, psize, local);
404 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
405 pss = (psize == MMU_PAGE_4K) ? -1UL : mmu_psize_defs[psize].penc;
406
407 lpar_rc = beat_invalidate_htab_entry3(0, slot, want_v, pss);
408
409 /* E_busy can be valid output: page may be already replaced */
410 BUG_ON(lpar_rc != 0 && lpar_rc != 0xfffffff7);
411}
412
413static int64_t _beat_lpar_hptab_clear_v3(void)
414{
415 return beat_clear_htab3(0);
416}
417
418static void beat_lpar_hptab_clear_v3(void)
419{
420 _beat_lpar_hptab_clear_v3();
421}
422
423void __init hpte_init_beat_v3(void)
424{
425 if (_beat_lpar_hptab_clear_v3() == 0) {
426 ppc_md.hpte_invalidate = beat_lpar_hpte_invalidate_v3;
427 ppc_md.hpte_updatepp = beat_lpar_hpte_updatepp_v3;
428 ppc_md.hpte_updateboltedpp = beat_lpar_hpte_updateboltedpp;
429 ppc_md.hpte_insert = beat_lpar_hpte_insert_v3;
430 ppc_md.hpte_remove = beat_lpar_hpte_remove;
431 ppc_md.hpte_clear_all = beat_lpar_hptab_clear_v3;
432 } else {
433 ppc_md.hpte_invalidate = beat_lpar_hpte_invalidate;
434 ppc_md.hpte_updatepp = beat_lpar_hpte_updatepp;
435 ppc_md.hpte_updateboltedpp = beat_lpar_hpte_updateboltedpp;
436 ppc_md.hpte_insert = beat_lpar_hpte_insert;
437 ppc_md.hpte_remove = beat_lpar_hpte_remove;
438 ppc_md.hpte_clear_all = beat_lpar_hptab_clear;
439 }
440}
diff --git a/arch/powerpc/platforms/celleb/interrupt.c b/arch/powerpc/platforms/celleb/interrupt.c
index 98e6665681d3..c7c68ca70c82 100644
--- a/arch/powerpc/platforms/celleb/interrupt.c
+++ b/arch/powerpc/platforms/celleb/interrupt.c
@@ -175,11 +175,18 @@ static int beatic_pic_host_xlate(struct irq_host *h, struct device_node *ct,
175 return 0; 175 return 0;
176} 176}
177 177
178static int beatic_pic_host_match(struct irq_host *h, struct device_node *np)
179{
180 /* Match all */
181 return 1;
182}
183
178static struct irq_host_ops beatic_pic_host_ops = { 184static struct irq_host_ops beatic_pic_host_ops = {
179 .map = beatic_pic_host_map, 185 .map = beatic_pic_host_map,
180 .remap = beatic_pic_host_remap, 186 .remap = beatic_pic_host_remap,
181 .unmap = beatic_pic_host_unmap, 187 .unmap = beatic_pic_host_unmap,
182 .xlate = beatic_pic_host_xlate, 188 .xlate = beatic_pic_host_xlate,
189 .match = beatic_pic_host_match,
183}; 190};
184 191
185/* 192/*
@@ -242,7 +249,7 @@ void __init beatic_init_IRQ(void)
242 ppc_md.get_irq = beatic_get_irq; 249 ppc_md.get_irq = beatic_get_irq;
243 250
244 /* Allocate an irq host */ 251 /* Allocate an irq host */
245 beatic_host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, 252 beatic_host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0,
246 &beatic_pic_host_ops, 253 &beatic_pic_host_ops,
247 0); 254 0);
248 BUG_ON(beatic_host == NULL); 255 BUG_ON(beatic_host == NULL);
diff --git a/arch/powerpc/platforms/celleb/io-workarounds.c b/arch/powerpc/platforms/celleb/io-workarounds.c
new file mode 100644
index 000000000000..2b912140bcbb
--- /dev/null
+++ b/arch/powerpc/platforms/celleb/io-workarounds.c
@@ -0,0 +1,279 @@
1/*
2 * Support for Celleb io workarounds
3 *
4 * (C) Copyright 2006-2007 TOSHIBA CORPORATION
5 *
6 * This file is based to arch/powerpc/platform/cell/io-workarounds.c
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#undef DEBUG
24
25#include <linux/of_device.h>
26#include <linux/irq.h>
27
28#include <asm/io.h>
29#include <asm/prom.h>
30#include <asm/machdep.h>
31#include <asm/pci-bridge.h>
32#include <asm/ppc-pci.h>
33
34#include "pci.h"
35
36#define MAX_CELLEB_PCI_BUS 4
37
38void *celleb_dummy_page_va;
39
40static struct celleb_pci_bus {
41 struct pci_controller *phb;
42 void (*dummy_read)(struct pci_controller *);
43} celleb_pci_busses[MAX_CELLEB_PCI_BUS];
44
45static int celleb_pci_count = 0;
46
47static struct celleb_pci_bus *celleb_pci_find(unsigned long vaddr,
48 unsigned long paddr)
49{
50 int i, j;
51 struct resource *res;
52
53 for (i = 0; i < celleb_pci_count; i++) {
54 struct celleb_pci_bus *bus = &celleb_pci_busses[i];
55 struct pci_controller *phb = bus->phb;
56 if (paddr)
57 for (j = 0; j < 3; j++) {
58 res = &phb->mem_resources[j];
59 if (paddr >= res->start && paddr <= res->end)
60 return bus;
61 }
62 res = &phb->io_resource;
63 if (vaddr && vaddr >= res->start && vaddr <= res->end)
64 return bus;
65 }
66 return NULL;
67}
68
69static void celleb_io_flush(const PCI_IO_ADDR addr)
70{
71 struct celleb_pci_bus *bus;
72 int token;
73
74 token = PCI_GET_ADDR_TOKEN(addr);
75
76 if (token && token <= celleb_pci_count)
77 bus = &celleb_pci_busses[token - 1];
78 else {
79 unsigned long vaddr, paddr;
80 pte_t *ptep;
81
82 vaddr = (unsigned long)PCI_FIX_ADDR(addr);
83 if (vaddr < PHB_IO_BASE || vaddr >= PHB_IO_END)
84 return;
85
86 ptep = find_linux_pte(init_mm.pgd, vaddr);
87 if (ptep == NULL)
88 paddr = 0;
89 else
90 paddr = pte_pfn(*ptep) << PAGE_SHIFT;
91 bus = celleb_pci_find(vaddr, paddr);
92
93 if (bus == NULL)
94 return;
95 }
96
97 if (bus->dummy_read)
98 bus->dummy_read(bus->phb);
99}
100
101static u8 celleb_readb(const PCI_IO_ADDR addr)
102{
103 u8 val;
104 val = __do_readb(addr);
105 celleb_io_flush(addr);
106 return val;
107}
108
109static u16 celleb_readw(const PCI_IO_ADDR addr)
110{
111 u16 val;
112 val = __do_readw(addr);
113 celleb_io_flush(addr);
114 return val;
115}
116
117static u32 celleb_readl(const PCI_IO_ADDR addr)
118{
119 u32 val;
120 val = __do_readl(addr);
121 celleb_io_flush(addr);
122 return val;
123}
124
125static u64 celleb_readq(const PCI_IO_ADDR addr)
126{
127 u64 val;
128 val = __do_readq(addr);
129 celleb_io_flush(addr);
130 return val;
131}
132
133static u16 celleb_readw_be(const PCI_IO_ADDR addr)
134{
135 u16 val;
136 val = __do_readw_be(addr);
137 celleb_io_flush(addr);
138 return val;
139}
140
141static u32 celleb_readl_be(const PCI_IO_ADDR addr)
142{
143 u32 val;
144 val = __do_readl_be(addr);
145 celleb_io_flush(addr);
146 return val;
147}
148
149static u64 celleb_readq_be(const PCI_IO_ADDR addr)
150{
151 u64 val;
152 val = __do_readq_be(addr);
153 celleb_io_flush(addr);
154 return val;
155}
156
157static void celleb_readsb(const PCI_IO_ADDR addr,
158 void *buf, unsigned long count)
159{
160 __do_readsb(addr, buf, count);
161 celleb_io_flush(addr);
162}
163
164static void celleb_readsw(const PCI_IO_ADDR addr,
165 void *buf, unsigned long count)
166{
167 __do_readsw(addr, buf, count);
168 celleb_io_flush(addr);
169}
170
171static void celleb_readsl(const PCI_IO_ADDR addr,
172 void *buf, unsigned long count)
173{
174 __do_readsl(addr, buf, count);
175 celleb_io_flush(addr);
176}
177
178static void celleb_memcpy_fromio(void *dest,
179 const PCI_IO_ADDR src,
180 unsigned long n)
181{
182 __do_memcpy_fromio(dest, src, n);
183 celleb_io_flush(src);
184}
185
186static void __iomem *celleb_ioremap(unsigned long addr,
187 unsigned long size,
188 unsigned long flags)
189{
190 struct celleb_pci_bus *bus;
191 void __iomem *res = __ioremap(addr, size, flags);
192 int busno;
193
194 bus = celleb_pci_find(0, addr);
195 if (bus != NULL) {
196 busno = bus - celleb_pci_busses;
197 PCI_SET_ADDR_TOKEN(res, busno + 1);
198 }
199 return res;
200}
201
202static void celleb_iounmap(volatile void __iomem *addr)
203{
204 return __iounmap(PCI_FIX_ADDR(addr));
205}
206
207static struct ppc_pci_io celleb_pci_io __initdata = {
208 .readb = celleb_readb,
209 .readw = celleb_readw,
210 .readl = celleb_readl,
211 .readq = celleb_readq,
212 .readw_be = celleb_readw_be,
213 .readl_be = celleb_readl_be,
214 .readq_be = celleb_readq_be,
215 .readsb = celleb_readsb,
216 .readsw = celleb_readsw,
217 .readsl = celleb_readsl,
218 .memcpy_fromio = celleb_memcpy_fromio,
219};
220
221void __init celleb_pci_add_one(struct pci_controller *phb,
222 void (*dummy_read)(struct pci_controller *))
223{
224 struct celleb_pci_bus *bus = &celleb_pci_busses[celleb_pci_count];
225 struct device_node *np = phb->arch_data;
226
227 if (celleb_pci_count >= MAX_CELLEB_PCI_BUS) {
228 printk(KERN_ERR "Too many pci bridges, workarounds"
229 " disabled for %s\n", np->full_name);
230 return;
231 }
232
233 celleb_pci_count++;
234
235 bus->phb = phb;
236 bus->dummy_read = dummy_read;
237}
238
239static struct of_device_id celleb_pci_workaround_match[] __initdata = {
240 {
241 .name = "pci-pseudo",
242 .data = fake_pci_workaround_init,
243 }, {
244 .name = "epci",
245 .data = epci_workaround_init,
246 }, {
247 },
248};
249
250int __init celleb_pci_workaround_init(void)
251{
252 struct pci_controller *phb;
253 struct device_node *node;
254 const struct of_device_id *match;
255 void (*init_func)(struct pci_controller *);
256
257 celleb_dummy_page_va = kmalloc(PAGE_SIZE, GFP_KERNEL);
258 if (!celleb_dummy_page_va) {
259 printk(KERN_ERR "Celleb: dummy read disabled."
260 "Alloc celleb_dummy_page_va failed\n");
261 return 1;
262 }
263
264 list_for_each_entry(phb, &hose_list, list_node) {
265 node = phb->arch_data;
266 match = of_match_node(celleb_pci_workaround_match, node);
267
268 if (match) {
269 init_func = match->data;
270 (*init_func)(phb);
271 }
272 }
273
274 ppc_pci_io = celleb_pci_io;
275 ppc_md.ioremap = celleb_ioremap;
276 ppc_md.iounmap = celleb_iounmap;
277
278 return 0;
279}
diff --git a/arch/powerpc/platforms/celleb/pci.c b/arch/powerpc/platforms/celleb/pci.c
index e9ac19c4bba4..6bc32fda7a6b 100644
--- a/arch/powerpc/platforms/celleb/pci.c
+++ b/arch/powerpc/platforms/celleb/pci.c
@@ -31,6 +31,7 @@
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/bootmem.h> 32#include <linux/bootmem.h>
33#include <linux/pci_regs.h> 33#include <linux/pci_regs.h>
34#include <linux/of_device.h>
34 35
35#include <asm/io.h> 36#include <asm/io.h>
36#include <asm/irq.h> 37#include <asm/irq.h>
@@ -242,8 +243,8 @@ static int celleb_fake_pci_write_config(struct pci_bus *bus,
242} 243}
243 244
244static struct pci_ops celleb_fake_pci_ops = { 245static struct pci_ops celleb_fake_pci_ops = {
245 celleb_fake_pci_read_config, 246 .read = celleb_fake_pci_read_config,
246 celleb_fake_pci_write_config 247 .write = celleb_fake_pci_write_config,
247}; 248};
248 249
249static inline void celleb_setup_pci_base_addrs(struct pci_controller *hose, 250static inline void celleb_setup_pci_base_addrs(struct pci_controller *hose,
@@ -288,8 +289,8 @@ static inline void celleb_setup_pci_base_addrs(struct pci_controller *hose,
288 celleb_config_write_fake(config, PCI_COMMAND, 2, val); 289 celleb_config_write_fake(config, PCI_COMMAND, 2, val);
289} 290}
290 291
291static int __devinit celleb_setup_fake_pci_device(struct device_node *node, 292static int __init celleb_setup_fake_pci_device(struct device_node *node,
292 struct pci_controller *hose) 293 struct pci_controller *hose)
293{ 294{
294 unsigned int rlen; 295 unsigned int rlen;
295 int num_base_addr = 0; 296 int num_base_addr = 0;
@@ -327,10 +328,7 @@ static int __devinit celleb_setup_fake_pci_device(struct device_node *node,
327 328
328 size = 256; 329 size = 256;
329 config = &private->fake_config[devno][fn]; 330 config = &private->fake_config[devno][fn];
330 if (mem_init_done) 331 *config = alloc_maybe_bootmem(size, GFP_KERNEL);
331 *config = kzalloc(size, GFP_KERNEL);
332 else
333 *config = alloc_bootmem(size);
334 if (*config == NULL) { 332 if (*config == NULL) {
335 printk(KERN_ERR "PCI: " 333 printk(KERN_ERR "PCI: "
336 "not enough memory for fake configuration space\n"); 334 "not enough memory for fake configuration space\n");
@@ -341,10 +339,7 @@ static int __devinit celleb_setup_fake_pci_device(struct device_node *node,
341 339
342 size = sizeof(struct celleb_pci_resource); 340 size = sizeof(struct celleb_pci_resource);
343 res = &private->res[devno][fn]; 341 res = &private->res[devno][fn];
344 if (mem_init_done) 342 *res = alloc_maybe_bootmem(size, GFP_KERNEL);
345 *res = kzalloc(size, GFP_KERNEL);
346 else
347 *res = alloc_bootmem(size);
348 if (*res == NULL) { 343 if (*res == NULL) {
349 printk(KERN_ERR 344 printk(KERN_ERR
350 "PCI: not enough memory for resource data space\n"); 345 "PCI: not enough memory for resource data space\n");
@@ -418,8 +413,8 @@ error:
418 return 1; 413 return 1;
419} 414}
420 415
421static int __devinit phb_set_bus_ranges(struct device_node *dev, 416static int __init phb_set_bus_ranges(struct device_node *dev,
422 struct pci_controller *phb) 417 struct pci_controller *phb)
423{ 418{
424 const int *bus_range; 419 const int *bus_range;
425 unsigned int len; 420 unsigned int len;
@@ -434,46 +429,65 @@ static int __devinit phb_set_bus_ranges(struct device_node *dev,
434 return 0; 429 return 0;
435} 430}
436 431
437static void __devinit celleb_alloc_private_mem(struct pci_controller *hose) 432static void __init celleb_alloc_private_mem(struct pci_controller *hose)
438{ 433{
439 if (mem_init_done) 434 hose->private_data =
440 hose->private_data = 435 alloc_maybe_bootmem(sizeof(struct celleb_pci_private),
441 kzalloc(sizeof(struct celleb_pci_private), GFP_KERNEL); 436 GFP_KERNEL);
442 else
443 hose->private_data =
444 alloc_bootmem(sizeof(struct celleb_pci_private));
445} 437}
446 438
447int __devinit celleb_setup_phb(struct pci_controller *phb) 439static int __init celleb_setup_fake_pci(struct device_node *dev,
440 struct pci_controller *phb)
448{ 441{
449 const char *name;
450 struct device_node *dev = phb->arch_data;
451 struct device_node *node; 442 struct device_node *node;
452 unsigned int rlen;
453 443
454 name = of_get_property(dev, "name", &rlen); 444 phb->ops = &celleb_fake_pci_ops;
455 if (!name) 445 celleb_alloc_private_mem(phb);
456 return 1;
457 446
458 pr_debug("PCI: celleb_setup_phb() %s\n", name); 447 for (node = of_get_next_child(dev, NULL);
459 phb_set_bus_ranges(dev, phb); 448 node != NULL; node = of_get_next_child(dev, node))
460 phb->buid = 1; 449 celleb_setup_fake_pci_device(node, phb);
450
451 return 0;
452}
461 453
462 if (strcmp(name, "epci") == 0) { 454void __init fake_pci_workaround_init(struct pci_controller *phb)
463 phb->ops = &celleb_epci_ops; 455{
464 return celleb_setup_epci(dev, phb); 456 /**
457 * We will add fake pci bus to scc_pci_bus for the purpose to improve
458 * I/O Macro performance. But device-tree and device drivers
459 * are not ready to use address with a token.
460 */
461
462 /* celleb_pci_add_one(phb, NULL); */
463}
465 464
466 } else if (strcmp(name, "pci-pseudo") == 0) { 465static struct of_device_id celleb_phb_match[] __initdata = {
467 phb->ops = &celleb_fake_pci_ops; 466 {
468 celleb_alloc_private_mem(phb); 467 .name = "pci-pseudo",
469 for (node = of_get_next_child(dev, NULL); 468 .data = celleb_setup_fake_pci,
470 node != NULL; node = of_get_next_child(dev, node)) 469 }, {
471 celleb_setup_fake_pci_device(node, phb); 470 .name = "epci",
471 .data = celleb_setup_epci,
472 }, {
473 },
474};
472 475
473 } else 476int __init celleb_setup_phb(struct pci_controller *phb)
477{
478 struct device_node *dev = phb->arch_data;
479 const struct of_device_id *match;
480 int (*setup_func)(struct device_node *, struct pci_controller *);
481
482 match = of_match_node(celleb_phb_match, dev);
483 if (!match)
474 return 1; 484 return 1;
475 485
476 return 0; 486 phb_set_bus_ranges(dev, phb);
487 phb->buid = 1;
488
489 setup_func = match->data;
490 return (*setup_func)(dev, phb);
477} 491}
478 492
479int celleb_pci_probe_mode(struct pci_bus *bus) 493int celleb_pci_probe_mode(struct pci_bus *bus)
diff --git a/arch/powerpc/platforms/celleb/pci.h b/arch/powerpc/platforms/celleb/pci.h
index 5340e348e297..5d5544ffeddb 100644
--- a/arch/powerpc/platforms/celleb/pci.h
+++ b/arch/powerpc/platforms/celleb/pci.h
@@ -25,11 +25,18 @@
25 25
26#include <asm/pci-bridge.h> 26#include <asm/pci-bridge.h>
27#include <asm/prom.h> 27#include <asm/prom.h>
28#include <asm/ppc-pci.h>
28 29
29extern int celleb_setup_phb(struct pci_controller *); 30extern int celleb_setup_phb(struct pci_controller *);
30extern int celleb_pci_probe_mode(struct pci_bus *); 31extern int celleb_pci_probe_mode(struct pci_bus *);
31 32
32extern struct pci_ops celleb_epci_ops;
33extern int celleb_setup_epci(struct device_node *, struct pci_controller *); 33extern int celleb_setup_epci(struct device_node *, struct pci_controller *);
34 34
35extern void *celleb_dummy_page_va;
36extern int __init celleb_pci_workaround_init(void);
37extern void __init celleb_pci_add_one(struct pci_controller *,
38 void (*)(struct pci_controller *));
39extern void fake_pci_workaround_init(struct pci_controller *);
40extern void epci_workaround_init(struct pci_controller *);
41
35#endif /* _CELLEB_PCI_H */ 42#endif /* _CELLEB_PCI_H */
diff --git a/arch/powerpc/platforms/celleb/scc.h b/arch/powerpc/platforms/celleb/scc.h
index e9ce8a7c1882..6be1542a6e66 100644
--- a/arch/powerpc/platforms/celleb/scc.h
+++ b/arch/powerpc/platforms/celleb/scc.h
@@ -53,7 +53,7 @@
53#define SCC_EPCI_STATUS 0x808 53#define SCC_EPCI_STATUS 0x808
54#define SCC_EPCI_ABTSET 0x80c 54#define SCC_EPCI_ABTSET 0x80c
55#define SCC_EPCI_WATRP 0x810 55#define SCC_EPCI_WATRP 0x810
56#define SCC_EPCI_DUMMYRADR 0x814 56#define SCC_EPCI_DUMYRADR 0x814
57#define SCC_EPCI_SWRESP 0x818 57#define SCC_EPCI_SWRESP 0x818
58#define SCC_EPCI_CNTOPT 0x81c 58#define SCC_EPCI_CNTOPT 0x81c
59#define SCC_EPCI_ECMODE 0xf00 59#define SCC_EPCI_ECMODE 0xf00
diff --git a/arch/powerpc/platforms/celleb/scc_epci.c b/arch/powerpc/platforms/celleb/scc_epci.c
index c4b011094bd6..9d076426676c 100644
--- a/arch/powerpc/platforms/celleb/scc_epci.c
+++ b/arch/powerpc/platforms/celleb/scc_epci.c
@@ -43,7 +43,11 @@
43 43
44#define iob() __asm__ __volatile__("eieio; sync":::"memory") 44#define iob() __asm__ __volatile__("eieio; sync":::"memory")
45 45
46static inline volatile void __iomem *celleb_epci_get_epci_base( 46struct epci_private {
47 dma_addr_t dummy_page_da;
48};
49
50static inline PCI_IO_ADDR celleb_epci_get_epci_base(
47 struct pci_controller *hose) 51 struct pci_controller *hose)
48{ 52{
49 /* 53 /*
@@ -55,7 +59,7 @@ static inline volatile void __iomem *celleb_epci_get_epci_base(
55 return hose->cfg_addr; 59 return hose->cfg_addr;
56} 60}
57 61
58static inline volatile void __iomem *celleb_epci_get_epci_cfg( 62static inline PCI_IO_ADDR celleb_epci_get_epci_cfg(
59 struct pci_controller *hose) 63 struct pci_controller *hose)
60{ 64{
61 /* 65 /*
@@ -67,20 +71,11 @@ static inline volatile void __iomem *celleb_epci_get_epci_cfg(
67 return hose->cfg_data; 71 return hose->cfg_data;
68} 72}
69 73
70#if 0 /* test code for epci dummy read */ 74static void scc_epci_dummy_read(struct pci_controller *hose)
71static void celleb_epci_dummy_read(struct pci_dev *dev)
72{ 75{
73 volatile void __iomem *epci_base; 76 PCI_IO_ADDR epci_base;
74 struct device_node *node;
75 struct pci_controller *hose;
76 u32 val; 77 u32 val;
77 78
78 node = (struct device_node *)dev->bus->sysdata;
79 hose = pci_find_hose_for_OF_device(node);
80
81 if (!hose)
82 return;
83
84 epci_base = celleb_epci_get_epci_base(hose); 79 epci_base = celleb_epci_get_epci_base(hose);
85 80
86 val = in_be32(epci_base + SCC_EPCI_WATRP); 81 val = in_be32(epci_base + SCC_EPCI_WATRP);
@@ -88,21 +83,45 @@ static void celleb_epci_dummy_read(struct pci_dev *dev)
88 83
89 return; 84 return;
90} 85}
91#endif 86
87void __init epci_workaround_init(struct pci_controller *hose)
88{
89 PCI_IO_ADDR epci_base;
90 PCI_IO_ADDR reg;
91 struct epci_private *private = hose->private_data;
92
93 BUG_ON(!private);
94
95 private->dummy_page_da = dma_map_single(hose->parent,
96 celleb_dummy_page_va, PAGE_SIZE, DMA_FROM_DEVICE);
97 if (private->dummy_page_da == DMA_ERROR_CODE) {
98 printk(KERN_ERR "EPCI: dummy read disabled."
99 "Map dummy page failed.\n");
100 return;
101 }
102
103 celleb_pci_add_one(hose, scc_epci_dummy_read);
104 epci_base = celleb_epci_get_epci_base(hose);
105
106 reg = epci_base + SCC_EPCI_DUMYRADR;
107 out_be32(reg, private->dummy_page_da);
108}
92 109
93static inline void clear_and_disable_master_abort_interrupt( 110static inline void clear_and_disable_master_abort_interrupt(
94 struct pci_controller *hose) 111 struct pci_controller *hose)
95{ 112{
96 volatile void __iomem *epci_base, *reg; 113 PCI_IO_ADDR epci_base;
114 PCI_IO_ADDR reg;
97 epci_base = celleb_epci_get_epci_base(hose); 115 epci_base = celleb_epci_get_epci_base(hose);
98 reg = epci_base + PCI_COMMAND; 116 reg = epci_base + PCI_COMMAND;
99 out_be32(reg, in_be32(reg) | (PCI_STATUS_REC_MASTER_ABORT << 16)); 117 out_be32(reg, in_be32(reg) | (PCI_STATUS_REC_MASTER_ABORT << 16));
100} 118}
101 119
102static int celleb_epci_check_abort(struct pci_controller *hose, 120static int celleb_epci_check_abort(struct pci_controller *hose,
103 volatile void __iomem *addr) 121 PCI_IO_ADDR addr)
104{ 122{
105 volatile void __iomem *reg, *epci_base; 123 PCI_IO_ADDR reg;
124 PCI_IO_ADDR epci_base;
106 u32 val; 125 u32 val;
107 126
108 iob(); 127 iob();
@@ -132,12 +151,12 @@ static int celleb_epci_check_abort(struct pci_controller *hose,
132 return PCIBIOS_SUCCESSFUL; 151 return PCIBIOS_SUCCESSFUL;
133} 152}
134 153
135static volatile void __iomem *celleb_epci_make_config_addr( 154static PCI_IO_ADDR celleb_epci_make_config_addr(
136 struct pci_bus *bus, 155 struct pci_bus *bus,
137 struct pci_controller *hose, 156 struct pci_controller *hose,
138 unsigned int devfn, int where) 157 unsigned int devfn, int where)
139{ 158{
140 volatile void __iomem *addr; 159 PCI_IO_ADDR addr;
141 160
142 if (bus != hose->bus) 161 if (bus != hose->bus)
143 addr = celleb_epci_get_epci_cfg(hose) + 162 addr = celleb_epci_get_epci_cfg(hose) +
@@ -157,7 +176,8 @@ static volatile void __iomem *celleb_epci_make_config_addr(
157static int celleb_epci_read_config(struct pci_bus *bus, 176static int celleb_epci_read_config(struct pci_bus *bus,
158 unsigned int devfn, int where, int size, u32 * val) 177 unsigned int devfn, int where, int size, u32 * val)
159{ 178{
160 volatile void __iomem *epci_base, *addr; 179 PCI_IO_ADDR epci_base;
180 PCI_IO_ADDR addr;
161 struct device_node *node; 181 struct device_node *node;
162 struct pci_controller *hose; 182 struct pci_controller *hose;
163 183
@@ -220,7 +240,8 @@ static int celleb_epci_read_config(struct pci_bus *bus,
220static int celleb_epci_write_config(struct pci_bus *bus, 240static int celleb_epci_write_config(struct pci_bus *bus,
221 unsigned int devfn, int where, int size, u32 val) 241 unsigned int devfn, int where, int size, u32 val)
222{ 242{
223 volatile void __iomem *epci_base, *addr; 243 PCI_IO_ADDR epci_base;
244 PCI_IO_ADDR addr;
224 struct device_node *node; 245 struct device_node *node;
225 struct pci_controller *hose; 246 struct pci_controller *hose;
226 247
@@ -278,15 +299,16 @@ static int celleb_epci_write_config(struct pci_bus *bus,
278} 299}
279 300
280struct pci_ops celleb_epci_ops = { 301struct pci_ops celleb_epci_ops = {
281 celleb_epci_read_config, 302 .read = celleb_epci_read_config,
282 celleb_epci_write_config, 303 .write = celleb_epci_write_config,
283}; 304};
284 305
285/* to be moved in FW */ 306/* to be moved in FW */
286static int __devinit celleb_epci_init(struct pci_controller *hose) 307static int __init celleb_epci_init(struct pci_controller *hose)
287{ 308{
288 u32 val; 309 u32 val;
289 volatile void __iomem *reg, *epci_base; 310 PCI_IO_ADDR reg;
311 PCI_IO_ADDR epci_base;
290 int hwres = 0; 312 int hwres = 0;
291 313
292 epci_base = celleb_epci_get_epci_base(hose); 314 epci_base = celleb_epci_get_epci_base(hose);
@@ -403,7 +425,7 @@ static int __devinit celleb_epci_init(struct pci_controller *hose)
403 return 0; 425 return 0;
404} 426}
405 427
406int __devinit celleb_setup_epci(struct device_node *node, 428int __init celleb_setup_epci(struct device_node *node,
407 struct pci_controller *hose) 429 struct pci_controller *hose)
408{ 430{
409 struct resource r; 431 struct resource r;
@@ -440,10 +462,24 @@ int __devinit celleb_setup_epci(struct device_node *node,
440 r.start, (unsigned long)hose->cfg_data, 462 r.start, (unsigned long)hose->cfg_data,
441 (r.end - r.start + 1)); 463 (r.end - r.start + 1));
442 464
465 hose->private_data = kzalloc(sizeof(struct epci_private), GFP_KERNEL);
466 if (hose->private_data == NULL) {
467 printk(KERN_ERR "EPCI: no memory for private data.\n");
468 goto error;
469 }
470
471 hose->ops = &celleb_epci_ops;
443 celleb_epci_init(hose); 472 celleb_epci_init(hose);
444 473
445 return 0; 474 return 0;
446 475
447error: 476error:
477 kfree(hose->private_data);
478
479 if (hose->cfg_addr)
480 iounmap(hose->cfg_addr);
481
482 if (hose->cfg_data)
483 iounmap(hose->cfg_data);
448 return 1; 484 return 1;
449} 485}
diff --git a/arch/powerpc/platforms/celleb/scc_sio.c b/arch/powerpc/platforms/celleb/scc_sio.c
index bcd25f54d986..610008211ca1 100644
--- a/arch/powerpc/platforms/celleb/scc_sio.c
+++ b/arch/powerpc/platforms/celleb/scc_sio.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * setup serial port in SCC 2 * setup serial port in SCC
3 * 3 *
4 * (C) Copyright 2006 TOSHIBA CORPORATION 4 * (C) Copyright 2006-2007 TOSHIBA CORPORATION
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -28,58 +28,58 @@
28 28
29/* sio irq0=0xb00010022 irq0=0xb00010023 irq2=0xb00010024 29/* sio irq0=0xb00010022 irq0=0xb00010023 irq2=0xb00010024
30 mmio=0xfff000-0x1000,0xff2000-0x1000 */ 30 mmio=0xfff000-0x1000,0xff2000-0x1000 */
31static int txx9_serial_bitmap = 0; 31static int txx9_serial_bitmap __initdata = 0;
32 32
33static struct { 33static struct {
34 uint32_t offset; 34 uint32_t offset;
35 uint32_t index; 35 uint32_t index;
36} txx9_scc_tab[3] = { 36} txx9_scc_tab[3] __initdata = {
37 { 0x300, 0 }, /* 0xFFF300 */ 37 { 0x300, 0 }, /* 0xFFF300 */
38 { 0x400, 0 }, /* 0xFFF400 */ 38 { 0x400, 0 }, /* 0xFFF400 */
39 { 0x800, 1 } /* 0xFF2800 */ 39 { 0x800, 1 } /* 0xFF2800 */
40}; 40};
41 41
42static int txx9_serial_init(void) 42static int __init txx9_serial_init(void)
43{ 43{
44 extern int early_serial_txx9_setup(struct uart_port *port); 44 extern int early_serial_txx9_setup(struct uart_port *port);
45 struct device_node *node; 45 struct device_node *node = NULL;
46 int i; 46 int i;
47 struct uart_port req; 47 struct uart_port req;
48 struct of_irq irq; 48 struct of_irq irq;
49 struct resource res; 49 struct resource res;
50 50
51 node = of_find_node_by_path("/ioif1/sio"); 51 while ((node = of_find_compatible_node(node,
52 if (!node) 52 "serial", "toshiba,sio-scc")) != NULL) {
53 return 0; 53 for (i = 0; i < ARRAY_SIZE(txx9_scc_tab); i++) {
54 if (!(txx9_serial_bitmap & (1<<i)))
55 continue;
54 56
55 for(i = 0; i < sizeof(txx9_scc_tab)/sizeof(txx9_scc_tab[0]); i++) { 57 if (of_irq_map_one(node, i, &irq))
56 if (!(txx9_serial_bitmap & (1<<i))) 58 continue;
57 continue; 59 if (of_address_to_resource(node,
60 txx9_scc_tab[i].index, &res))
61 continue;
58 62
59 if (of_irq_map_one(node, i, &irq)) 63 memset(&req, 0, sizeof(req));
60 continue; 64 req.line = i;
61 if (of_address_to_resource(node, txx9_scc_tab[i].index, &res)) 65 req.iotype = UPIO_MEM;
62 continue; 66 req.mapbase = res.start + txx9_scc_tab[i].offset;
63
64 memset(&req, 0, sizeof(req));
65 req.line = i;
66 req.iotype = UPIO_MEM;
67 req.mapbase = res.start + txx9_scc_tab[i].offset;
68#ifdef CONFIG_SERIAL_TXX9_CONSOLE 67#ifdef CONFIG_SERIAL_TXX9_CONSOLE
69 req.membase = ioremap(req.mapbase, 0x24); 68 req.membase = ioremap(req.mapbase, 0x24);
70#endif 69#endif
71 req.irq = irq_create_of_mapping(irq.controller, 70 req.irq = irq_create_of_mapping(irq.controller,
72 irq.specifier, irq.size); 71 irq.specifier, irq.size);
73 req.flags |= UPF_IOREMAP | UPF_BUGGY_UART /*HAVE_CTS_LINE*/; 72 req.flags |= UPF_IOREMAP | UPF_BUGGY_UART
74 req.uartclk = 83300000; 73 /*HAVE_CTS_LINE*/;
75 early_serial_txx9_setup(&req); 74 req.uartclk = 83300000;
75 early_serial_txx9_setup(&req);
76 }
76 } 77 }
77 78
78 of_node_put(node);
79 return 0; 79 return 0;
80} 80}
81 81
82static int txx9_serial_config(char *ptr) 82static int __init txx9_serial_config(char *ptr)
83{ 83{
84 int i; 84 int i;
85 85
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
index 5e9f7f163571..1769d755eff3 100644
--- a/arch/powerpc/platforms/celleb/setup.c
+++ b/arch/powerpc/platforms/celleb/setup.c
@@ -73,7 +73,7 @@ static void celleb_show_cpuinfo(struct seq_file *m)
73 of_node_put(root); 73 of_node_put(root);
74} 74}
75 75
76static int celleb_machine_type_hack(char *ptr) 76static int __init celleb_machine_type_hack(char *ptr)
77{ 77{
78 strncpy(celleb_machine_type, ptr, sizeof(celleb_machine_type)); 78 strncpy(celleb_machine_type, ptr, sizeof(celleb_machine_type));
79 celleb_machine_type[sizeof(celleb_machine_type)-1] = 0; 79 celleb_machine_type[sizeof(celleb_machine_type)-1] = 0;
@@ -101,21 +101,11 @@ static void __init celleb_setup_arch(void)
101 /* init to some ~sane value until calibrate_delay() runs */ 101 /* init to some ~sane value until calibrate_delay() runs */
102 loops_per_jiffy = 50000000; 102 loops_per_jiffy = 50000000;
103 103
104 if (ROOT_DEV == 0) {
105 printk("No ramdisk, default root is /dev/hda2\n");
106 ROOT_DEV = Root_HDA2;
107 }
108
109#ifdef CONFIG_DUMMY_CONSOLE 104#ifdef CONFIG_DUMMY_CONSOLE
110 conswitchp = &dummy_con; 105 conswitchp = &dummy_con;
111#endif 106#endif
112} 107}
113 108
114static void beat_power_save(void)
115{
116 beat_pause(0);
117}
118
119static int __init celleb_probe(void) 109static int __init celleb_probe(void)
120{ 110{
121 unsigned long root = of_get_flat_dt_root(); 111 unsigned long root = of_get_flat_dt_root();
@@ -124,18 +114,11 @@ static int __init celleb_probe(void)
124 return 0; 114 return 0;
125 115
126 powerpc_firmware_features |= FW_FEATURE_CELLEB_POSSIBLE; 116 powerpc_firmware_features |= FW_FEATURE_CELLEB_POSSIBLE;
127 hpte_init_beat(); 117 hpte_init_beat_v3();
128 return 1; 118 return 1;
129} 119}
130 120
131#ifdef CONFIG_KEXEC 121static struct of_device_id celleb_bus_ids[] __initdata = {
132static void celleb_kexec_cpu_down(int crash, int secondary)
133{
134 beatic_deinit_IRQ();
135}
136#endif
137
138static struct of_device_id celleb_bus_ids[] = {
139 { .type = "scc", }, 122 { .type = "scc", },
140 { .type = "ioif", }, /* old style */ 123 { .type = "ioif", }, /* old style */
141 {}, 124 {},
@@ -149,6 +132,8 @@ static int __init celleb_publish_devices(void)
149 /* Publish OF platform devices for southbridge IOs */ 132 /* Publish OF platform devices for southbridge IOs */
150 of_platform_bus_probe(NULL, celleb_bus_ids, NULL); 133 of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
151 134
135 celleb_pci_workaround_init();
136
152 return 0; 137 return 0;
153} 138}
154device_initcall(celleb_publish_devices); 139device_initcall(celleb_publish_devices);
@@ -175,7 +160,7 @@ define_machine(celleb) {
175 .pci_probe_mode = celleb_pci_probe_mode, 160 .pci_probe_mode = celleb_pci_probe_mode,
176 .pci_setup_phb = celleb_setup_phb, 161 .pci_setup_phb = celleb_setup_phb,
177#ifdef CONFIG_KEXEC 162#ifdef CONFIG_KEXEC
178 .kexec_cpu_down = celleb_kexec_cpu_down, 163 .kexec_cpu_down = beat_kexec_cpu_down,
179 .machine_kexec = default_machine_kexec, 164 .machine_kexec = default_machine_kexec,
180 .machine_kexec_prepare = default_machine_kexec_prepare, 165 .machine_kexec_prepare = default_machine_kexec_prepare,
181 .machine_crash_shutdown = default_machine_crash_shutdown, 166 .machine_crash_shutdown = default_machine_crash_shutdown,
diff --git a/arch/powerpc/platforms/chrp/gg2.h b/arch/powerpc/platforms/chrp/gg2.h
new file mode 100644
index 000000000000..341ae55b99fb
--- /dev/null
+++ b/arch/powerpc/platforms/chrp/gg2.h
@@ -0,0 +1,61 @@
1/*
2 * include/asm-ppc/gg2.h -- VLSI VAS96011/12 `Golden Gate 2' register definitions
3 *
4 * Copyright (C) 1997 Geert Uytterhoeven
5 *
6 * This file is based on the following documentation:
7 *
8 * The VAS96011/12 Chipset, Data Book, Edition 1.0
9 * VLSI Technology, Inc.
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file COPYING in the main directory of this archive
13 * for more details.
14 */
15
16#ifndef _ASMPPC_GG2_H
17#define _ASMPPC_GG2_H
18
19 /*
20 * Memory Map (CHRP mode)
21 */
22
23#define GG2_PCI_MEM_BASE 0xc0000000 /* Peripheral memory space */
24#define GG2_ISA_MEM_BASE 0xf7000000 /* Peripheral memory alias */
25#define GG2_ISA_IO_BASE 0xf8000000 /* Peripheral I/O space */
26#define GG2_PCI_CONFIG_BASE 0xfec00000 /* PCI configuration space */
27#define GG2_INT_ACK_SPECIAL 0xfec80000 /* Interrupt acknowledge and */
28 /* special PCI cycles */
29#define GG2_ROM_BASE0 0xff000000 /* ROM bank 0 */
30#define GG2_ROM_BASE1 0xff800000 /* ROM bank 1 */
31
32
33 /*
34 * GG2 specific PCI Registers
35 */
36
37extern void __iomem *gg2_pci_config_base; /* kernel virtual address */
38
39#define GG2_PCI_BUSNO 0x40 /* Bus number */
40#define GG2_PCI_SUBBUSNO 0x41 /* Subordinate bus number */
41#define GG2_PCI_DISCCTR 0x42 /* Disconnect counter */
42#define GG2_PCI_PPC_CTRL 0x50 /* PowerPC interface control register */
43#define GG2_PCI_ADDR_MAP 0x5c /* Address map */
44#define GG2_PCI_PCI_CTRL 0x60 /* PCI interface control register */
45#define GG2_PCI_ROM_CTRL 0x70 /* ROM interface control register */
46#define GG2_PCI_ROM_TIME 0x74 /* ROM timing */
47#define GG2_PCI_CC_CTRL 0x80 /* Cache controller control register */
48#define GG2_PCI_DRAM_BANK0 0x90 /* Control register for DRAM bank #0 */
49#define GG2_PCI_DRAM_BANK1 0x94 /* Control register for DRAM bank #1 */
50#define GG2_PCI_DRAM_BANK2 0x98 /* Control register for DRAM bank #2 */
51#define GG2_PCI_DRAM_BANK3 0x9c /* Control register for DRAM bank #3 */
52#define GG2_PCI_DRAM_BANK4 0xa0 /* Control register for DRAM bank #4 */
53#define GG2_PCI_DRAM_BANK5 0xa4 /* Control register for DRAM bank #5 */
54#define GG2_PCI_DRAM_TIME0 0xb0 /* Timing parameters set #0 */
55#define GG2_PCI_DRAM_TIME1 0xb4 /* Timing parameters set #1 */
56#define GG2_PCI_DRAM_CTRL 0xc0 /* DRAM control */
57#define GG2_PCI_ERR_CTRL 0xd0 /* Error control register */
58#define GG2_PCI_ERR_STATUS 0xd4 /* Error status register */
59 /* Cleared when read */
60
61#endif /* _ASMPPC_GG2_H */
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 28d1647b204e..e43465d34d29 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -13,7 +13,6 @@
13#include <asm/irq.h> 13#include <asm/irq.h>
14#include <asm/hydra.h> 14#include <asm/hydra.h>
15#include <asm/prom.h> 15#include <asm/prom.h>
16#include <asm/gg2.h>
17#include <asm/machdep.h> 16#include <asm/machdep.h>
18#include <asm/sections.h> 17#include <asm/sections.h>
19#include <asm/pci-bridge.h> 18#include <asm/pci-bridge.h>
@@ -21,6 +20,7 @@
21#include <asm/rtas.h> 20#include <asm/rtas.h>
22 21
23#include "chrp.h" 22#include "chrp.h"
23#include "gg2.h"
24 24
25/* LongTrail */ 25/* LongTrail */
26void __iomem *gg2_pci_config_base; 26void __iomem *gg2_pci_config_base;
@@ -86,8 +86,8 @@ int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
86 86
87static struct pci_ops gg2_pci_ops = 87static struct pci_ops gg2_pci_ops =
88{ 88{
89 gg2_read_config, 89 .read = gg2_read_config,
90 gg2_write_config 90 .write = gg2_write_config,
91}; 91};
92 92
93/* 93/*
@@ -124,8 +124,8 @@ int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
124 124
125static struct pci_ops rtas_pci_ops = 125static struct pci_ops rtas_pci_ops =
126{ 126{
127 rtas_read_config, 127 .read = rtas_read_config,
128 rtas_write_config 128 .write = rtas_write_config,
129}; 129};
130 130
131volatile struct Hydra __iomem *Hydra = NULL; 131volatile struct Hydra __iomem *Hydra = NULL;
@@ -338,3 +338,32 @@ void chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105)
338} 338}
339DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, 339DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
340 chrp_pci_fixup_winbond_ata); 340 chrp_pci_fixup_winbond_ata);
341
342/* Pegasos2 firmware version 20040810 configures the built-in IDE controller
343 * in legacy mode, but sets the PCI registers to PCI native mode.
344 * The chip can only operate in legacy mode, so force the PCI class into legacy
345 * mode as well. The same fixup must be done to the class-code property in
346 * the IDE node /pci@80000000/ide@C,1
347 */
348static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide)
349{
350 u8 progif;
351 struct pci_dev *viaisa;
352
353 if (!machine_is(chrp) || _chrp_type != _CHRP_Pegasos)
354 return;
355 if (viaide->irq != 14)
356 return;
357
358 viaisa = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
359 if (!viaisa)
360 return;
361 printk("Fixing VIA IDE, force legacy mode on '%s'\n", viaide->dev.bus_id);
362
363 pci_read_config_byte(viaide, PCI_CLASS_PROG, &progif);
364 pci_write_config_byte(viaide, PCI_CLASS_PROG, progif & ~0x5);
365 viaide->class &= ~0x5;
366
367 pci_dev_put(viaisa);
368}
369DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, chrp_pci_fixup_vt8231_ata);
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 373de4c063db..59306261f5b2 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -32,13 +32,11 @@
32#include <linux/seq_file.h> 32#include <linux/seq_file.h>
33#include <linux/root_dev.h> 33#include <linux/root_dev.h>
34#include <linux/initrd.h> 34#include <linux/initrd.h>
35#include <linux/module.h>
36#include <linux/timer.h> 35#include <linux/timer.h>
37 36
38#include <asm/io.h> 37#include <asm/io.h>
39#include <asm/pgtable.h> 38#include <asm/pgtable.h>
40#include <asm/prom.h> 39#include <asm/prom.h>
41#include <asm/gg2.h>
42#include <asm/pci-bridge.h> 40#include <asm/pci-bridge.h>
43#include <asm/dma.h> 41#include <asm/dma.h>
44#include <asm/machdep.h> 42#include <asm/machdep.h>
@@ -52,6 +50,7 @@
52#include <asm/xmon.h> 50#include <asm/xmon.h>
53 51
54#include "chrp.h" 52#include "chrp.h"
53#include "gg2.h"
55 54
56void rtas_indicator_progress(char *, unsigned short); 55void rtas_indicator_progress(char *, unsigned short);
57 56
@@ -291,16 +290,6 @@ void __init chrp_setup_arch(void)
291 ppc_md.set_rtc_time = rtas_set_rtc_time; 290 ppc_md.set_rtc_time = rtas_set_rtc_time;
292 } 291 }
293 292
294#ifdef CONFIG_BLK_DEV_INITRD
295 /* this is fine for chrp */
296 initrd_below_start_ok = 1;
297
298 if (initrd_start)
299 ROOT_DEV = Root_RAM0;
300 else
301#endif
302 ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */
303
304 /* On pegasos, enable the L2 cache if not already done by OF */ 293 /* On pegasos, enable the L2 cache if not already done by OF */
305 pegasos_set_l2cr(); 294 pegasos_set_l2cr();
306 295
diff --git a/arch/powerpc/platforms/chrp/smp.c b/arch/powerpc/platforms/chrp/smp.c
index 3ea0eb78568e..10a4a4d063b6 100644
--- a/arch/powerpc/platforms/chrp/smp.c
+++ b/arch/powerpc/platforms/chrp/smp.c
@@ -26,10 +26,8 @@
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/prom.h> 27#include <asm/prom.h>
28#include <asm/smp.h> 28#include <asm/smp.h>
29#include <asm/residual.h>
30#include <asm/time.h> 29#include <asm/time.h>
31#include <asm/machdep.h> 30#include <asm/machdep.h>
32#include <asm/smp.h>
33#include <asm/mpic.h> 31#include <asm/mpic.h>
34#include <asm/rtas.h> 32#include <asm/rtas.h>
35 33
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 2d12f77e46bc..8924095a7928 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -1,9 +1,10 @@
1choice 1config EMBEDDED6xx
2 prompt "Machine Type" 2 bool "Embedded 6xx/7xx/7xxx-based boards"
3 depends on EMBEDDED6xx 3 depends on PPC32 && BROKEN_ON_SMP && PPC_MULTIPLATFORM
4 4
5config LINKSTATION 5config LINKSTATION
6 bool "Linkstation / Kurobox(HG) from Buffalo" 6 bool "Linkstation / Kurobox(HG) from Buffalo"
7 depends on EMBEDDED6xx
7 select MPIC 8 select MPIC
8 select FSL_SOC 9 select FSL_SOC
9 select PPC_UDBG_16550 if SERIAL_8250 10 select PPC_UDBG_16550 if SERIAL_8250
@@ -17,15 +18,18 @@ config LINKSTATION
17 18
18config MPC7448HPC2 19config MPC7448HPC2
19 bool "Freescale MPC7448HPC2(Taiga)" 20 bool "Freescale MPC7448HPC2(Taiga)"
21 depends on EMBEDDED6xx
20 select TSI108_BRIDGE 22 select TSI108_BRIDGE
21 select DEFAULT_UIMAGE 23 select DEFAULT_UIMAGE
22 select PPC_UDBG_16550 24 select PPC_UDBG_16550
25 select WANT_DEVICE_TREE
23 help 26 help
24 Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga) 27 Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
25 platform 28 platform
26 29
27config PPC_HOLLY 30config PPC_HOLLY
28 bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)" 31 bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)"
32 depends on EMBEDDED6xx
29 select TSI108_BRIDGE 33 select TSI108_BRIDGE
30 select PPC_UDBG_16550 34 select PPC_UDBG_16550
31 select WANT_DEVICE_TREE 35 select WANT_DEVICE_TREE
@@ -35,12 +39,12 @@ config PPC_HOLLY
35 39
36config PPC_PRPMC2800 40config PPC_PRPMC2800
37 bool "Motorola-PrPMC2800" 41 bool "Motorola-PrPMC2800"
42 depends on EMBEDDED6xx
38 select MV64X60 43 select MV64X60
39 select NOT_COHERENT_CACHE 44 select NOT_COHERENT_CACHE
40 select WANT_DEVICE_TREE 45 select WANT_DEVICE_TREE
41 help 46 help
42 This option enables support for the Motorola PrPMC2800 board 47 This option enables support for the Motorola PrPMC2800 board
43endchoice
44 48
45config TSI108_BRIDGE 49config TSI108_BRIDGE
46 bool 50 bool
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
index 6292e36dc577..b6de2b5223dd 100644
--- a/arch/powerpc/platforms/embedded6xx/holly.c
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -113,23 +113,11 @@ static void holly_remap_bridge(void)
113 113
114static void __init holly_setup_arch(void) 114static void __init holly_setup_arch(void)
115{ 115{
116 struct device_node *cpu;
117 struct device_node *np; 116 struct device_node *np;
118 117
119 if (ppc_md.progress) 118 if (ppc_md.progress)
120 ppc_md.progress("holly_setup_arch():set_bridge", 0); 119 ppc_md.progress("holly_setup_arch():set_bridge", 0);
121 120
122 cpu = of_find_node_by_type(NULL, "cpu");
123 if (cpu) {
124 const unsigned int *fp;
125
126 fp = of_get_property(cpu, "clock-frequency", NULL);
127 if (fp)
128 loops_per_jiffy = *fp / HZ;
129 else
130 loops_per_jiffy = 50000000 / HZ;
131 of_node_put(cpu);
132 }
133 tsi108_csr_vir_base = get_vir_csrbase(); 121 tsi108_csr_vir_base = get_vir_csrbase();
134 122
135 /* setup PCI host bridge */ 123 /* setup PCI host bridge */
@@ -147,7 +135,7 @@ static void __init holly_setup_arch(void)
147} 135}
148 136
149/* 137/*
150 * Interrupt setup and service. Interrrupts on the holly come 138 * Interrupt setup and service. Interrupts on the holly come
151 * from the four external INT pins, PCI interrupts are routed via 139 * from the four external INT pins, PCI interrupts are routed via
152 * PCI interrupt control registers, it generates internal IRQ23 140 * PCI interrupt control registers, it generates internal IRQ23
153 * 141 *
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
index bd5ca58345a1..eb5d74e26fe9 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -11,16 +11,16 @@
11 */ 11 */
12 12
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/initrd.h> 14#include <linux/initrd.h>
16#include <linux/mtd/physmap.h> 15#include <linux/mtd/physmap.h>
17 16
18#include <asm/time.h> 17#include <asm/time.h>
19#include <asm/prom.h> 18#include <asm/prom.h>
20#include <asm/mpic.h> 19#include <asm/mpic.h>
21#include <asm/mpc10x.h>
22#include <asm/pci-bridge.h> 20#include <asm/pci-bridge.h>
23 21
22#include "mpc10x.h"
23
24static struct mtd_partition linkstation_physmap_partitions[] = { 24static struct mtd_partition linkstation_physmap_partitions[] = {
25 { 25 {
26 .name = "mtd_firmimg", 26 .name = "mtd_firmimg",
@@ -91,7 +91,7 @@ static void __init linkstation_setup_arch(void)
91#endif 91#endif
92 92
93 /* Lookup PCI host bridges */ 93 /* Lookup PCI host bridges */
94 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 94 for_each_compatible_node(np, "pci", "mpc10x-pci")
95 linkstation_add_bridge(np); 95 linkstation_add_bridge(np);
96 96
97 printk(KERN_INFO "BUFFALO Network Attached Storage Series\n"); 97 printk(KERN_INFO "BUFFALO Network Attached Storage Series\n");
@@ -99,7 +99,7 @@ static void __init linkstation_setup_arch(void)
99} 99}
100 100
101/* 101/*
102 * Interrupt setup and service. Interrrupts on the linkstation come 102 * Interrupt setup and service. Interrupts on the linkstation come
103 * from the four PCI slots plus onboard 8241 devices: I2C, DUART. 103 * from the four PCI slots plus onboard 8241 devices: I2C, DUART.
104 */ 104 */
105static void __init linkstation_init_IRQ(void) 105static void __init linkstation_init_IRQ(void)
diff --git a/arch/powerpc/platforms/embedded6xx/ls_uart.c b/arch/powerpc/platforms/embedded6xx/ls_uart.c
index d0bee9f19e4e..c99264cedda5 100644
--- a/arch/powerpc/platforms/embedded6xx/ls_uart.c
+++ b/arch/powerpc/platforms/embedded6xx/ls_uart.c
@@ -1,14 +1,25 @@
1/*
2 * AVR power-management chip interface for the Buffalo Linkstation /
3 * Kurobox Platform.
4 *
5 * Author: 2006 (c) G. Liakhovetski
6 * g.liakhovetski@gmx.de
7 *
8 * This file is licensed under the terms of the GNU General Public License
9 * version 2. This program is licensed "as is" without any warranty of
10 * any kind, whether express or implied.
11 */
1#include <linux/workqueue.h> 12#include <linux/workqueue.h>
2#include <linux/string.h> 13#include <linux/string.h>
3#include <linux/delay.h> 14#include <linux/delay.h>
4#include <linux/serial_reg.h> 15#include <linux/serial_reg.h>
5#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
6#include <asm/io.h> 17#include <asm/io.h>
7#include <asm/mpc10x.h>
8#include <asm/ppc_sys.h>
9#include <asm/prom.h> 18#include <asm/prom.h>
10#include <asm/termbits.h> 19#include <asm/termbits.h>
11 20
21#include "mpc10x.h"
22
12static void __iomem *avr_addr; 23static void __iomem *avr_addr;
13static unsigned long avr_clock; 24static unsigned long avr_clock;
14 25
@@ -106,6 +117,9 @@ static int __init ls_uarts_init(void)
106 phys_addr_t phys_addr; 117 phys_addr_t phys_addr;
107 int len; 118 int len;
108 119
120 if (!machine_is(linkstation))
121 return 0;
122
109 avr = of_find_node_by_path("/soc10x/serial@80004500"); 123 avr = of_find_node_by_path("/soc10x/serial@80004500");
110 if (!avr) 124 if (!avr)
111 return -EINVAL; 125 return -EINVAL;
diff --git a/arch/powerpc/platforms/embedded6xx/mpc10x.h b/arch/powerpc/platforms/embedded6xx/mpc10x.h
new file mode 100644
index 000000000000..b30a6a3b5bd2
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/mpc10x.h
@@ -0,0 +1,180 @@
1/*
2 * Common routines for the Motorola SPS MPC106/8240/107 Host bridge/Mem
3 * ctlr/EPIC/etc.
4 *
5 * Author: Mark A. Greer
6 * mgreer@mvista.com
7 *
8 * 2001 (c) MontaVista, Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
12 */
13#ifndef __PPC_KERNEL_MPC10X_H
14#define __PPC_KERNEL_MPC10X_H
15
16#include <linux/pci_ids.h>
17#include <asm/pci-bridge.h>
18
19/*
20 * The values here don't completely map everything but should work in most
21 * cases.
22 *
23 * MAP A (PReP Map)
24 * Processor: 0x80000000 - 0x807fffff -> PCI I/O: 0x00000000 - 0x007fffff
25 * Processor: 0xc0000000 - 0xdfffffff -> PCI MEM: 0x00000000 - 0x1fffffff
26 * PCI MEM: 0x80000000 -> Processor System Memory: 0x00000000
27 * EUMB mapped to: ioremap_base - 0x00100000 (ioremap_base - 1 MB)
28 *
29 * MAP B (CHRP Map)
30 * Processor: 0xfe000000 - 0xfebfffff -> PCI I/O: 0x00000000 - 0x00bfffff
31 * Processor: 0x80000000 - 0xbfffffff -> PCI MEM: 0x80000000 - 0xbfffffff
32 * PCI MEM: 0x00000000 -> Processor System Memory: 0x00000000
33 * EUMB mapped to: ioremap_base - 0x00100000 (ioremap_base - 1 MB)
34 */
35
36/*
37 * Define the vendor/device IDs for the various bridges--should be added to
38 * <linux/pci_ids.h>
39 */
40#define MPC10X_BRIDGE_106 ((PCI_DEVICE_ID_MOTOROLA_MPC106 << 16) | \
41 PCI_VENDOR_ID_MOTOROLA)
42#define MPC10X_BRIDGE_8240 ((0x0003 << 16) | PCI_VENDOR_ID_MOTOROLA)
43#define MPC10X_BRIDGE_107 ((0x0004 << 16) | PCI_VENDOR_ID_MOTOROLA)
44#define MPC10X_BRIDGE_8245 ((0x0006 << 16) | PCI_VENDOR_ID_MOTOROLA)
45
46/* Define the type of map to use */
47#define MPC10X_MEM_MAP_A 1
48#define MPC10X_MEM_MAP_B 2
49
50/* Map A (PReP Map) Defines */
51#define MPC10X_MAPA_CNFG_ADDR 0x80000cf8
52#define MPC10X_MAPA_CNFG_DATA 0x80000cfc
53
54#define MPC10X_MAPA_ISA_IO_BASE 0x80000000
55#define MPC10X_MAPA_ISA_MEM_BASE 0xc0000000
56#define MPC10X_MAPA_DRAM_OFFSET 0x80000000
57
58#define MPC10X_MAPA_PCI_INTACK_ADDR 0xbffffff0
59#define MPC10X_MAPA_PCI_IO_START 0x00000000
60#define MPC10X_MAPA_PCI_IO_END (0x00800000 - 1)
61#define MPC10X_MAPA_PCI_MEM_START 0x00000000
62#define MPC10X_MAPA_PCI_MEM_END (0x20000000 - 1)
63
64#define MPC10X_MAPA_PCI_MEM_OFFSET (MPC10X_MAPA_ISA_MEM_BASE - \
65 MPC10X_MAPA_PCI_MEM_START)
66
67/* Map B (CHRP Map) Defines */
68#define MPC10X_MAPB_CNFG_ADDR 0xfec00000
69#define MPC10X_MAPB_CNFG_DATA 0xfee00000
70
71#define MPC10X_MAPB_ISA_IO_BASE 0xfe000000
72#define MPC10X_MAPB_ISA_MEM_BASE 0x80000000
73#define MPC10X_MAPB_DRAM_OFFSET 0x00000000
74
75#define MPC10X_MAPB_PCI_INTACK_ADDR 0xfef00000
76#define MPC10X_MAPB_PCI_IO_START 0x00000000
77#define MPC10X_MAPB_PCI_IO_END (0x00c00000 - 1)
78#define MPC10X_MAPB_PCI_MEM_START 0x80000000
79#define MPC10X_MAPB_PCI_MEM_END (0xc0000000 - 1)
80
81#define MPC10X_MAPB_PCI_MEM_OFFSET (MPC10X_MAPB_ISA_MEM_BASE - \
82 MPC10X_MAPB_PCI_MEM_START)
83
84/* Set hose members to values appropriate for the mem map used */
85#define MPC10X_SETUP_HOSE(hose, map) { \
86 (hose)->pci_mem_offset = MPC10X_MAP##map##_PCI_MEM_OFFSET; \
87 (hose)->io_space.start = MPC10X_MAP##map##_PCI_IO_START; \
88 (hose)->io_space.end = MPC10X_MAP##map##_PCI_IO_END; \
89 (hose)->mem_space.start = MPC10X_MAP##map##_PCI_MEM_START; \
90 (hose)->mem_space.end = MPC10X_MAP##map##_PCI_MEM_END; \
91 (hose)->io_base_virt = (void *)MPC10X_MAP##map##_ISA_IO_BASE; \
92}
93
94
95/* Miscellaneous Configuration register offsets */
96#define MPC10X_CFG_PIR_REG 0x09
97#define MPC10X_CFG_PIR_HOST_BRIDGE 0x00
98#define MPC10X_CFG_PIR_AGENT 0x01
99
100#define MPC10X_CFG_EUMBBAR 0x78
101
102#define MPC10X_CFG_PICR1_REG 0xa8
103#define MPC10X_CFG_PICR1_ADDR_MAP_MASK 0x00010000
104#define MPC10X_CFG_PICR1_ADDR_MAP_A 0x00010000
105#define MPC10X_CFG_PICR1_ADDR_MAP_B 0x00000000
106#define MPC10X_CFG_PICR1_SPEC_PCI_RD 0x00000004
107#define MPC10X_CFG_PICR1_ST_GATH_EN 0x00000040
108
109#define MPC10X_CFG_PICR2_REG 0xac
110#define MPC10X_CFG_PICR2_COPYBACK_OPT 0x00000001
111
112#define MPC10X_CFG_MAPB_OPTIONS_REG 0xe0
113#define MPC10X_CFG_MAPB_OPTIONS_CFAE 0x80 /* CPU_FD_ALIAS_EN */
114#define MPC10X_CFG_MAPB_OPTIONS_PFAE 0x40 /* PCI_FD_ALIAS_EN */
115#define MPC10X_CFG_MAPB_OPTIONS_DR 0x20 /* DLL_RESET */
116#define MPC10X_CFG_MAPB_OPTIONS_PCICH 0x08 /* PCI_COMPATIBILITY_HOLE */
117#define MPC10X_CFG_MAPB_OPTIONS_PROCCH 0x04 /* PROC_COMPATIBILITY_HOLE */
118
119/* Define offsets for the memory controller registers in the config space */
120#define MPC10X_MCTLR_MEM_START_1 0x80 /* Banks 0-3 */
121#define MPC10X_MCTLR_MEM_START_2 0x84 /* Banks 4-7 */
122#define MPC10X_MCTLR_EXT_MEM_START_1 0x88 /* Banks 0-3 */
123#define MPC10X_MCTLR_EXT_MEM_START_2 0x8c /* Banks 4-7 */
124
125#define MPC10X_MCTLR_MEM_END_1 0x90 /* Banks 0-3 */
126#define MPC10X_MCTLR_MEM_END_2 0x94 /* Banks 4-7 */
127#define MPC10X_MCTLR_EXT_MEM_END_1 0x98 /* Banks 0-3 */
128#define MPC10X_MCTLR_EXT_MEM_END_2 0x9c /* Banks 4-7 */
129
130#define MPC10X_MCTLR_MEM_BANK_ENABLES 0xa0
131
132/* Define some offset in the EUMB */
133#define MPC10X_EUMB_SIZE 0x00100000 /* Total EUMB size (1MB) */
134
135#define MPC10X_EUMB_MU_OFFSET 0x00000000 /* Msg Unit reg offset */
136#define MPC10X_EUMB_MU_SIZE 0x00001000 /* Msg Unit reg size */
137#define MPC10X_EUMB_DMA_OFFSET 0x00001000 /* DMA Unit reg offset */
138#define MPC10X_EUMB_DMA_SIZE 0x00001000 /* DMA Unit reg size */
139#define MPC10X_EUMB_ATU_OFFSET 0x00002000 /* Addr xlate reg offset */
140#define MPC10X_EUMB_ATU_SIZE 0x00001000 /* Addr xlate reg size */
141#define MPC10X_EUMB_I2C_OFFSET 0x00003000 /* I2C Unit reg offset */
142#define MPC10X_EUMB_I2C_SIZE 0x00001000 /* I2C Unit reg size */
143#define MPC10X_EUMB_DUART_OFFSET 0x00004000 /* DUART Unit reg offset (8245) */
144#define MPC10X_EUMB_DUART_SIZE 0x00001000 /* DUART Unit reg size (8245) */
145#define MPC10X_EUMB_EPIC_OFFSET 0x00040000 /* EPIC offset in EUMB */
146#define MPC10X_EUMB_EPIC_SIZE 0x00030000 /* EPIC size */
147#define MPC10X_EUMB_PM_OFFSET 0x000fe000 /* Performance Monitor reg offset (8245) */
148#define MPC10X_EUMB_PM_SIZE 0x00001000 /* Performance Monitor reg size (8245) */
149#define MPC10X_EUMB_WP_OFFSET 0x000ff000 /* Data path diagnostic, watchpoint reg offset */
150#define MPC10X_EUMB_WP_SIZE 0x00001000 /* Data path diagnostic, watchpoint reg size */
151
152/*
153 * Define some recommended places to put the EUMB regs.
154 * For both maps, recommend putting the EUMB from 0xeff00000 to 0xefffffff.
155 */
156extern unsigned long ioremap_base;
157#define MPC10X_MAPA_EUMB_BASE (ioremap_base - MPC10X_EUMB_SIZE)
158#define MPC10X_MAPB_EUMB_BASE MPC10X_MAPA_EUMB_BASE
159
160enum ppc_sys_devices {
161 MPC10X_IIC1,
162 MPC10X_DMA0,
163 MPC10X_DMA1,
164 MPC10X_UART0,
165 MPC10X_UART1,
166 NUM_PPC_SYS_DEVS,
167};
168
169int mpc10x_bridge_init(struct pci_controller *hose,
170 uint current_map,
171 uint new_map,
172 uint phys_eumb_base);
173unsigned long mpc10x_get_mem_size(uint mem_map);
174int mpc10x_enable_store_gathering(struct pci_controller *hose);
175int mpc10x_disable_store_gathering(struct pci_controller *hose);
176
177/* For MPC107 boards that use the built-in openpic */
178void mpc10x_set_openpic(void);
179
180#endif /* __PPC_KERNEL_MPC10X_H */
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index 1e3cc69487b5..a2c04b9d42b1 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -40,7 +40,6 @@
40#include <asm/pci-bridge.h> 40#include <asm/pci-bridge.h>
41#include <asm/reg.h> 41#include <asm/reg.h>
42#include <mm/mmu_decl.h> 42#include <mm/mmu_decl.h>
43#include "mpc7448_hpc2.h"
44#include <asm/tsi108_pci.h> 43#include <asm/tsi108_pci.h>
45#include <asm/tsi108_irq.h> 44#include <asm/tsi108_irq.h>
46#include <asm/mpic.h> 45#include <asm/mpic.h>
@@ -75,7 +74,7 @@ static void __init mpc7448_hpc2_setup_arch(void)
75 74
76 /* setup PCI host bridge */ 75 /* setup PCI host bridge */
77#ifdef CONFIG_PCI 76#ifdef CONFIG_PCI
78 for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 77 for_each_compatible_node(np, "pci", "tsi108-pci")
79 tsi108_setup_pci(np, MPC7448HPC2_PCI_CFG_PHYS, 0); 78 tsi108_setup_pci(np, MPC7448HPC2_PCI_CFG_PHYS, 0);
80 79
81 ppc_md.pci_exclude_device = mpc7448_hpc2_exclude_device; 80 ppc_md.pci_exclude_device = mpc7448_hpc2_exclude_device;
@@ -91,7 +90,7 @@ static void __init mpc7448_hpc2_setup_arch(void)
91} 90}
92 91
93/* 92/*
94 * Interrupt setup and service. Interrrupts on the mpc7448_hpc2 come 93 * Interrupt setup and service. Interrupts on the mpc7448_hpc2 come
95 * from the four external INT pins, PCI interrupts are routed via 94 * from the four external INT pins, PCI interrupts are routed via
96 * PCI interrupt control registers, it generates internal IRQ23 95 * PCI interrupt control registers, it generates internal IRQ23
97 * 96 *
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h
deleted file mode 100644
index f7e0e0c7f8d8..000000000000
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * mpc7448_hpc2.h
3 *
4 * Definitions for Freescale MPC7448_HPC2 platform
5 *
6 * Author: Jacob Pan
7 * jacob.pan@freescale.com
8 * Maintainer: Roy Zang <roy.zang@freescale.com>
9 *
10 * 2006 (c) Freescale Semiconductor, Inc. This file is licensed under
11 * the terms of the GNU General Public License version 2. This program
12 * is licensed "as is" without any warranty of any kind, whether express
13 * or implied.
14 */
15
16#ifndef __PPC_PLATFORMS_MPC7448_HPC2_H
17#define __PPC_PLATFORMS_MPC7448_HPC2_H
18
19#include <asm/ppcboot.h>
20
21#endif /* __PPC_PLATFORMS_MPC7448_HPC2_H */
diff --git a/arch/powerpc/platforms/embedded6xx/prpmc2800.c b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
index 53420951dc53..e484cac75095 100644
--- a/arch/powerpc/platforms/embedded6xx/prpmc2800.c
+++ b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
@@ -44,7 +44,6 @@ static void __init prpmc2800_setup_arch(void)
44 struct device_node *np; 44 struct device_node *np;
45 phys_addr_t paddr; 45 phys_addr_t paddr;
46 const unsigned int *reg; 46 const unsigned int *reg;
47 const unsigned int *prop;
48 47
49 /* 48 /*
50 * ioremap mpp and gpp registers in case they are later 49 * ioremap mpp and gpp registers in case they are later
@@ -62,12 +61,6 @@ static void __init prpmc2800_setup_arch(void)
62 of_node_put(np); 61 of_node_put(np);
63 mv64x60_gpp_reg_base = ioremap(paddr, reg[1]); 62 mv64x60_gpp_reg_base = ioremap(paddr, reg[1]);
64 63
65 np = of_find_node_by_type(NULL, "cpu");
66 prop = of_get_property(np, "clock-frequency", NULL);
67 if (prop)
68 loops_per_jiffy = *prop / HZ;
69 of_node_put(np);
70
71#ifdef CONFIG_PCI 64#ifdef CONFIG_PCI
72 mv64x60_pci_init(); 65 mv64x60_pci_init();
73#endif 66#endif
@@ -158,6 +151,7 @@ define_machine(prpmc2800){
158 .name = prpmc2800_platform_name, 151 .name = prpmc2800_platform_name,
159 .probe = prpmc2800_probe, 152 .probe = prpmc2800_probe,
160 .setup_arch = prpmc2800_setup_arch, 153 .setup_arch = prpmc2800_setup_arch,
154 .init_early = mv64x60_init_early,
161 .show_cpuinfo = prpmc2800_show_cpuinfo, 155 .show_cpuinfo = prpmc2800_show_cpuinfo,
162 .init_IRQ = mv64x60_init_irq, 156 .init_IRQ = mv64x60_init_irq,
163 .get_irq = mv64x60_get_irq, 157 .get_irq = mv64x60_get_irq,
diff --git a/arch/powerpc/platforms/iseries/Makefile b/arch/powerpc/platforms/iseries/Makefile
index 13ac3015d91c..a65f1b44abf8 100644
--- a/arch/powerpc/platforms/iseries/Makefile
+++ b/arch/powerpc/platforms/iseries/Makefile
@@ -2,11 +2,12 @@ EXTRA_CFLAGS += -mno-minimal-toc
2 2
3extra-y += dt.o 3extra-y += dt.o
4 4
5obj-y += exception.o
5obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt_mod.o mf.o lpevents.o \ 6obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt_mod.o mf.o lpevents.o \
6 hvcall.o proc.o htab.o iommu.o misc.o irq.o 7 hvcall.o proc.o htab.o iommu.o misc.o irq.o
7obj-$(CONFIG_PCI) += pci.o vpdinfo.o 8obj-$(CONFIG_PCI) += pci.o vpdinfo.o
8obj-$(CONFIG_SMP) += smp.o 9obj-$(CONFIG_SMP) += smp.o
9obj-$(CONFIG_VIOPATH) += viopath.o 10obj-$(CONFIG_VIOPATH) += viopath.o vio.o
10obj-$(CONFIG_MODULES) += ksyms.o 11obj-$(CONFIG_MODULES) += ksyms.o
11 12
12quiet_cmd_dt_strings = DT_STR $@ 13quiet_cmd_dt_strings = DT_STR $@
diff --git a/arch/powerpc/platforms/iseries/dt.c b/arch/powerpc/platforms/iseries/dt.c
index 9e8a334a518a..4543c4bc3a56 100644
--- a/arch/powerpc/platforms/iseries/dt.c
+++ b/arch/powerpc/platforms/iseries/dt.c
@@ -72,8 +72,6 @@ static char __initdata device_type_cpu[] = "cpu";
72static char __initdata device_type_memory[] = "memory"; 72static char __initdata device_type_memory[] = "memory";
73static char __initdata device_type_serial[] = "serial"; 73static char __initdata device_type_serial[] = "serial";
74static char __initdata device_type_network[] = "network"; 74static char __initdata device_type_network[] = "network";
75static char __initdata device_type_block[] = "block";
76static char __initdata device_type_byte[] = "byte";
77static char __initdata device_type_pci[] = "pci"; 75static char __initdata device_type_pci[] = "pci";
78static char __initdata device_type_vdevice[] = "vdevice"; 76static char __initdata device_type_vdevice[] = "vdevice";
79static char __initdata device_type_vscsi[] = "vscsi"; 77static char __initdata device_type_vscsi[] = "vscsi";
@@ -375,21 +373,6 @@ static void __init dt_vdevices(struct iseries_flat_dt *dt)
375 373
376 dt_end_node(dt); 374 dt_end_node(dt);
377 } 375 }
378 reg += HVMAXARCHITECTEDVIRTUALLANS;
379
380 for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++)
381 dt_do_vdevice(dt, "viodasd", reg, i, device_type_block,
382 "IBM,iSeries-viodasd", 1);
383 reg += HVMAXARCHITECTEDVIRTUALDISKS;
384
385 for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++)
386 dt_do_vdevice(dt, "viocd", reg, i, device_type_block,
387 "IBM,iSeries-viocd", 1);
388 reg += HVMAXARCHITECTEDVIRTUALCDROMS;
389
390 for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++)
391 dt_do_vdevice(dt, "viotape", reg, i, device_type_byte,
392 "IBM,iSeries-viotape", 1);
393 376
394 dt_end_node(dt); 377 dt_end_node(dt);
395} 378}
diff --git a/arch/powerpc/platforms/iseries/exception.S b/arch/powerpc/platforms/iseries/exception.S
new file mode 100644
index 000000000000..5381038f0881
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/exception.S
@@ -0,0 +1,251 @@
1/*
2 * Low level routines for legacy iSeries support.
3 *
4 * Extracted from head_64.S
5 *
6 * PowerPC version
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 *
9 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
10 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
11 * Adapted for Power Macintosh by Paul Mackerras.
12 * Low-level exception handlers and MMU support
13 * rewritten by Paul Mackerras.
14 * Copyright (C) 1996 Paul Mackerras.
15 *
16 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
17 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com
18 *
19 * This file contains the low-level support and setup for the
20 * PowerPC-64 platform, including trap and interrupt dispatch.
21 *
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * as published by the Free Software Foundation; either version
25 * 2 of the License, or (at your option) any later version.
26 */
27
28#include <asm/reg.h>
29#include <asm/ppc_asm.h>
30#include <asm/asm-offsets.h>
31#include <asm/thread_info.h>
32#include <asm/ptrace.h>
33#include <asm/cputable.h>
34
35#include "exception.h"
36
37 .text
38
39 .globl system_reset_iSeries
40system_reset_iSeries:
41 mfspr r13,SPRN_SPRG3 /* Get paca address */
42 mfmsr r24
43 ori r24,r24,MSR_RI
44 mtmsrd r24 /* RI on */
45 lhz r24,PACAPACAINDEX(r13) /* Get processor # */
46 cmpwi 0,r24,0 /* Are we processor 0? */
47 bne 1f
48 b .__start_initialization_iSeries /* Start up the first processor */
491: mfspr r4,SPRN_CTRLF
50 li r5,CTRL_RUNLATCH /* Turn off the run light */
51 andc r4,r4,r5
52 mtspr SPRN_CTRLT,r4
53
541:
55 HMT_LOW
56#ifdef CONFIG_SMP
57 lbz r23,PACAPROCSTART(r13) /* Test if this processor
58 * should start */
59 sync
60 LOAD_REG_IMMEDIATE(r3,current_set)
61 sldi r28,r24,3 /* get current_set[cpu#] */
62 ldx r3,r3,r28
63 addi r1,r3,THREAD_SIZE
64 subi r1,r1,STACK_FRAME_OVERHEAD
65
66 cmpwi 0,r23,0
67 beq iSeries_secondary_smp_loop /* Loop until told to go */
68 b __secondary_start /* Loop until told to go */
69iSeries_secondary_smp_loop:
70 /* Let the Hypervisor know we are alive */
71 /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
72 lis r3,0x8002
73 rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */
74#else /* CONFIG_SMP */
75 /* Yield the processor. This is required for non-SMP kernels
76 which are running on multi-threaded machines. */
77 lis r3,0x8000
78 rldicr r3,r3,32,15 /* r3 = (r3 << 32) & 0xffff000000000000 */
79 addi r3,r3,18 /* r3 = 0x8000000000000012 which is "yield" */
80 li r4,0 /* "yield timed" */
81 li r5,-1 /* "yield forever" */
82#endif /* CONFIG_SMP */
83 li r0,-1 /* r0=-1 indicates a Hypervisor call */
84 sc /* Invoke the hypervisor via a system call */
85 mfspr r13,SPRN_SPRG3 /* Put r13 back ???? */
86 b 1b /* If SMP not configured, secondaries
87 * loop forever */
88
89/*** ISeries-LPAR interrupt handlers ***/
90
91 STD_EXCEPTION_ISERIES(machine_check, PACA_EXMC)
92
93 .globl data_access_iSeries
94data_access_iSeries:
95 mtspr SPRN_SPRG1,r13
96BEGIN_FTR_SECTION
97 mtspr SPRN_SPRG2,r12
98 mfspr r13,SPRN_DAR
99 mfspr r12,SPRN_DSISR
100 srdi r13,r13,60
101 rlwimi r13,r12,16,0x20
102 mfcr r12
103 cmpwi r13,0x2c
104 beq .do_stab_bolted_iSeries
105 mtcrf 0x80,r12
106 mfspr r12,SPRN_SPRG2
107END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
108 EXCEPTION_PROLOG_1(PACA_EXGEN)
109 EXCEPTION_PROLOG_ISERIES_1
110 b data_access_common
111
112.do_stab_bolted_iSeries:
113 mtcrf 0x80,r12
114 mfspr r12,SPRN_SPRG2
115 EXCEPTION_PROLOG_1(PACA_EXSLB)
116 EXCEPTION_PROLOG_ISERIES_1
117 b .do_stab_bolted
118
119 .globl data_access_slb_iSeries
120data_access_slb_iSeries:
121 mtspr SPRN_SPRG1,r13 /* save r13 */
122 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
123 std r3,PACA_EXSLB+EX_R3(r13)
124 mfspr r3,SPRN_DAR
125 std r9,PACA_EXSLB+EX_R9(r13)
126 mfcr r9
127#ifdef __DISABLED__
128 cmpdi r3,0
129 bge slb_miss_user_iseries
130#endif
131 std r10,PACA_EXSLB+EX_R10(r13)
132 std r11,PACA_EXSLB+EX_R11(r13)
133 std r12,PACA_EXSLB+EX_R12(r13)
134 mfspr r10,SPRN_SPRG1
135 std r10,PACA_EXSLB+EX_R13(r13)
136 ld r12,PACALPPACAPTR(r13)
137 ld r12,LPPACASRR1(r12)
138 b .slb_miss_realmode
139
140 STD_EXCEPTION_ISERIES(instruction_access, PACA_EXGEN)
141
142 .globl instruction_access_slb_iSeries
143instruction_access_slb_iSeries:
144 mtspr SPRN_SPRG1,r13 /* save r13 */
145 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
146 std r3,PACA_EXSLB+EX_R3(r13)
147 ld r3,PACALPPACAPTR(r13)
148 ld r3,LPPACASRR0(r3) /* get SRR0 value */
149 std r9,PACA_EXSLB+EX_R9(r13)
150 mfcr r9
151#ifdef __DISABLED__
152 cmpdi r3,0
153 bge slb_miss_user_iseries
154#endif
155 std r10,PACA_EXSLB+EX_R10(r13)
156 std r11,PACA_EXSLB+EX_R11(r13)
157 std r12,PACA_EXSLB+EX_R12(r13)
158 mfspr r10,SPRN_SPRG1
159 std r10,PACA_EXSLB+EX_R13(r13)
160 ld r12,PACALPPACAPTR(r13)
161 ld r12,LPPACASRR1(r12)
162 b .slb_miss_realmode
163
164#ifdef __DISABLED__
165slb_miss_user_iseries:
166 std r10,PACA_EXGEN+EX_R10(r13)
167 std r11,PACA_EXGEN+EX_R11(r13)
168 std r12,PACA_EXGEN+EX_R12(r13)
169 mfspr r10,SPRG1
170 ld r11,PACA_EXSLB+EX_R9(r13)
171 ld r12,PACA_EXSLB+EX_R3(r13)
172 std r10,PACA_EXGEN+EX_R13(r13)
173 std r11,PACA_EXGEN+EX_R9(r13)
174 std r12,PACA_EXGEN+EX_R3(r13)
175 EXCEPTION_PROLOG_ISERIES_1
176 b slb_miss_user_common
177#endif
178
179 MASKABLE_EXCEPTION_ISERIES(hardware_interrupt)
180 STD_EXCEPTION_ISERIES(alignment, PACA_EXGEN)
181 STD_EXCEPTION_ISERIES(program_check, PACA_EXGEN)
182 STD_EXCEPTION_ISERIES(fp_unavailable, PACA_EXGEN)
183 MASKABLE_EXCEPTION_ISERIES(decrementer)
184 STD_EXCEPTION_ISERIES(trap_0a, PACA_EXGEN)
185 STD_EXCEPTION_ISERIES(trap_0b, PACA_EXGEN)
186
187 .globl system_call_iSeries
188system_call_iSeries:
189 mr r9,r13
190 mfspr r13,SPRN_SPRG3
191 EXCEPTION_PROLOG_ISERIES_1
192 b system_call_common
193
194 STD_EXCEPTION_ISERIES(single_step, PACA_EXGEN)
195 STD_EXCEPTION_ISERIES(trap_0e, PACA_EXGEN)
196 STD_EXCEPTION_ISERIES(performance_monitor, PACA_EXGEN)
197
198decrementer_iSeries_masked:
199 /* We may not have a valid TOC pointer in here. */
200 li r11,1
201 ld r12,PACALPPACAPTR(r13)
202 stb r11,LPPACADECRINT(r12)
203 LOAD_REG_IMMEDIATE(r12, tb_ticks_per_jiffy)
204 lwz r12,0(r12)
205 mtspr SPRN_DEC,r12
206 /* fall through */
207
208hardware_interrupt_iSeries_masked:
209 mtcrf 0x80,r9 /* Restore regs */
210 ld r12,PACALPPACAPTR(r13)
211 ld r11,LPPACASRR0(r12)
212 ld r12,LPPACASRR1(r12)
213 mtspr SPRN_SRR0,r11
214 mtspr SPRN_SRR1,r12
215 ld r9,PACA_EXGEN+EX_R9(r13)
216 ld r10,PACA_EXGEN+EX_R10(r13)
217 ld r11,PACA_EXGEN+EX_R11(r13)
218 ld r12,PACA_EXGEN+EX_R12(r13)
219 ld r13,PACA_EXGEN+EX_R13(r13)
220 rfid
221 b . /* prevent speculative execution */
222
223_INIT_STATIC(__start_initialization_iSeries)
224 /* Clear out the BSS */
225 LOAD_REG_IMMEDIATE(r11,__bss_stop)
226 LOAD_REG_IMMEDIATE(r8,__bss_start)
227 sub r11,r11,r8 /* bss size */
228 addi r11,r11,7 /* round up to an even double word */
229 rldicl. r11,r11,61,3 /* shift right by 3 */
230 beq 4f
231 addi r8,r8,-8
232 li r0,0
233 mtctr r11 /* zero this many doublewords */
2343: stdu r0,8(r8)
235 bdnz 3b
2364:
237 LOAD_REG_IMMEDIATE(r1,init_thread_union)
238 addi r1,r1,THREAD_SIZE
239 li r0,0
240 stdu r0,-STACK_FRAME_OVERHEAD(r1)
241
242 LOAD_REG_IMMEDIATE(r2,__toc_start)
243 addi r2,r2,0x4000
244 addi r2,r2,0x4000
245
246 bl .iSeries_early_setup
247 bl .early_setup
248
249 /* relocation is on at this point */
250
251 b .start_here_common
diff --git a/arch/powerpc/platforms/iseries/exception.h b/arch/powerpc/platforms/iseries/exception.h
new file mode 100644
index 000000000000..ced45a8fa1aa
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/exception.h
@@ -0,0 +1,58 @@
1#ifndef _ASM_POWERPC_ISERIES_EXCEPTION_H
2#define _ASM_POWERPC_ISERIES_EXCEPTION_H
3/*
4 * Extracted from head_64.S
5 *
6 * PowerPC version
7 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
8 *
9 * Rewritten by Cort Dougan (cort@cs.nmt.edu) for PReP
10 * Copyright (C) 1996 Cort Dougan <cort@cs.nmt.edu>
11 * Adapted for Power Macintosh by Paul Mackerras.
12 * Low-level exception handlers and MMU support
13 * rewritten by Paul Mackerras.
14 * Copyright (C) 1996 Paul Mackerras.
15 *
16 * Adapted for 64bit PowerPC by Dave Engebretsen, Peter Bergner, and
17 * Mike Corrigan {engebret|bergner|mikejc}@us.ibm.com
18 *
19 * This file contains the low-level support and setup for the
20 * PowerPC-64 platform, including trap and interrupt dispatch.
21 *
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * as published by the Free Software Foundation; either version
25 * 2 of the License, or (at your option) any later version.
26 */
27#include <asm/exception.h>
28
29#define EXCEPTION_PROLOG_ISERIES_1 \
30 mfmsr r10; \
31 ld r12,PACALPPACAPTR(r13); \
32 ld r11,LPPACASRR0(r12); \
33 ld r12,LPPACASRR1(r12); \
34 ori r10,r10,MSR_RI; \
35 mtmsrd r10,1
36
37#define STD_EXCEPTION_ISERIES(label, area) \
38 .globl label##_iSeries; \
39label##_iSeries: \
40 HMT_MEDIUM; \
41 mtspr SPRN_SPRG1,r13; /* save r13 */ \
42 EXCEPTION_PROLOG_1(area); \
43 EXCEPTION_PROLOG_ISERIES_1; \
44 b label##_common
45
46#define MASKABLE_EXCEPTION_ISERIES(label) \
47 .globl label##_iSeries; \
48label##_iSeries: \
49 HMT_MEDIUM; \
50 mtspr SPRN_SPRG1,r13; /* save r13 */ \
51 EXCEPTION_PROLOG_1(PACA_EXGEN); \
52 lbz r10,PACASOFTIRQEN(r13); \
53 cmpwi 0,r10,0; \
54 beq- label##_iSeries_masked; \
55 EXCEPTION_PROLOG_ISERIES_1; \
56 b label##_common; \
57
58#endif /* _ASM_POWERPC_ISERIES_EXCEPTION_H */
diff --git a/arch/powerpc/platforms/iseries/htab.c b/arch/powerpc/platforms/iseries/htab.c
index b4e2c7a038e1..15a7097e5dd7 100644
--- a/arch/powerpc/platforms/iseries/htab.c
+++ b/arch/powerpc/platforms/iseries/htab.c
@@ -86,7 +86,8 @@ long iSeries_hpte_insert(unsigned long hpte_group, unsigned long va,
86 } 86 }
87 87
88 88
89 lhpte.v = hpte_encode_v(va, MMU_PAGE_4K) | vflags | HPTE_V_VALID; 89 lhpte.v = hpte_encode_v(va, MMU_PAGE_4K, MMU_SEGSIZE_256M) |
90 vflags | HPTE_V_VALID;
90 lhpte.r = hpte_encode_r(phys_to_abs(pa), MMU_PAGE_4K) | rflags; 91 lhpte.r = hpte_encode_r(phys_to_abs(pa), MMU_PAGE_4K) | rflags;
91 92
92 /* Now fill in the actual HPTE */ 93 /* Now fill in the actual HPTE */
@@ -142,7 +143,7 @@ static long iSeries_hpte_remove(unsigned long hpte_group)
142 * bits 61..63 : PP2,PP1,PP0 143 * bits 61..63 : PP2,PP1,PP0
143 */ 144 */
144static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp, 145static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
145 unsigned long va, int psize, int local) 146 unsigned long va, int psize, int ssize, int local)
146{ 147{
147 struct hash_pte hpte; 148 struct hash_pte hpte;
148 unsigned long want_v; 149 unsigned long want_v;
@@ -150,7 +151,7 @@ static long iSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
150 iSeries_hlock(slot); 151 iSeries_hlock(slot);
151 152
152 HvCallHpt_get(&hpte, slot); 153 HvCallHpt_get(&hpte, slot);
153 want_v = hpte_encode_v(va, MMU_PAGE_4K); 154 want_v = hpte_encode_v(va, MMU_PAGE_4K, MMU_SEGSIZE_256M);
154 155
155 if (HPTE_V_COMPARE(hpte.v, want_v) && (hpte.v & HPTE_V_VALID)) { 156 if (HPTE_V_COMPARE(hpte.v, want_v) && (hpte.v & HPTE_V_VALID)) {
156 /* 157 /*
@@ -205,14 +206,14 @@ static long iSeries_hpte_find(unsigned long vpn)
205 * No need to lock here because we should be the only user. 206 * No need to lock here because we should be the only user.
206 */ 207 */
207static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea, 208static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
208 int psize) 209 int psize, int ssize)
209{ 210{
210 unsigned long vsid,va,vpn; 211 unsigned long vsid,va,vpn;
211 long slot; 212 long slot;
212 213
213 BUG_ON(psize != MMU_PAGE_4K); 214 BUG_ON(psize != MMU_PAGE_4K);
214 215
215 vsid = get_kernel_vsid(ea); 216 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M);
216 va = (vsid << 28) | (ea & 0x0fffffff); 217 va = (vsid << 28) | (ea & 0x0fffffff);
217 vpn = va >> HW_PAGE_SHIFT; 218 vpn = va >> HW_PAGE_SHIFT;
218 slot = iSeries_hpte_find(vpn); 219 slot = iSeries_hpte_find(vpn);
@@ -222,7 +223,7 @@ static void iSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
222} 223}
223 224
224static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va, 225static void iSeries_hpte_invalidate(unsigned long slot, unsigned long va,
225 int psize, int local) 226 int psize, int ssize, int local)
226{ 227{
227 unsigned long hpte_v; 228 unsigned long hpte_v;
228 unsigned long avpn = va >> 23; 229 unsigned long avpn = va >> 23;
diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c
index 3b6a9666c2c0..49e9c664ea89 100644
--- a/arch/powerpc/platforms/iseries/iommu.c
+++ b/arch/powerpc/platforms/iseries/iommu.c
@@ -28,14 +28,17 @@
28#include <linux/dma-mapping.h> 28#include <linux/dma-mapping.h>
29#include <linux/list.h> 29#include <linux/list.h>
30#include <linux/pci.h> 30#include <linux/pci.h>
31#include <linux/module.h>
31 32
32#include <asm/iommu.h> 33#include <asm/iommu.h>
34#include <asm/vio.h>
33#include <asm/tce.h> 35#include <asm/tce.h>
34#include <asm/machdep.h> 36#include <asm/machdep.h>
35#include <asm/abs_addr.h> 37#include <asm/abs_addr.h>
36#include <asm/prom.h> 38#include <asm/prom.h>
37#include <asm/pci-bridge.h> 39#include <asm/pci-bridge.h>
38#include <asm/iseries/hv_call_xm.h> 40#include <asm/iseries/hv_call_xm.h>
41#include <asm/iseries/hv_call_event.h>
39#include <asm/iseries/iommu.h> 42#include <asm/iseries/iommu.h>
40 43
41static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages, 44static void tce_build_iSeries(struct iommu_table *tbl, long index, long npages,
@@ -189,6 +192,55 @@ void iommu_devnode_init_iSeries(struct pci_dev *pdev, struct device_node *dn)
189} 192}
190#endif 193#endif
191 194
195static struct iommu_table veth_iommu_table;
196static struct iommu_table vio_iommu_table;
197
198void *iseries_hv_alloc(size_t size, dma_addr_t *dma_handle, gfp_t flag)
199{
200 return iommu_alloc_coherent(&vio_iommu_table, size, dma_handle,
201 DMA_32BIT_MASK, flag, -1);
202}
203EXPORT_SYMBOL_GPL(iseries_hv_alloc);
204
205void iseries_hv_free(size_t size, void *vaddr, dma_addr_t dma_handle)
206{
207 iommu_free_coherent(&vio_iommu_table, size, vaddr, dma_handle);
208}
209EXPORT_SYMBOL_GPL(iseries_hv_free);
210
211dma_addr_t iseries_hv_map(void *vaddr, size_t size,
212 enum dma_data_direction direction)
213{
214 return iommu_map_single(&vio_iommu_table, vaddr, size,
215 DMA_32BIT_MASK, direction);
216}
217
218void iseries_hv_unmap(dma_addr_t dma_handle, size_t size,
219 enum dma_data_direction direction)
220{
221 iommu_unmap_single(&vio_iommu_table, dma_handle, size, direction);
222}
223
224void __init iommu_vio_init(void)
225{
226 iommu_table_getparms_iSeries(255, 0, 0xff, &veth_iommu_table);
227 veth_iommu_table.it_size /= 2;
228 vio_iommu_table = veth_iommu_table;
229 vio_iommu_table.it_offset += veth_iommu_table.it_size;
230
231 if (!iommu_init_table(&veth_iommu_table, -1))
232 printk("Virtual Bus VETH TCE table failed.\n");
233 if (!iommu_init_table(&vio_iommu_table, -1))
234 printk("Virtual Bus VIO TCE table failed.\n");
235}
236
237struct iommu_table *vio_build_iommu_table_iseries(struct vio_dev *dev)
238{
239 if (strcmp(dev->type, "network") == 0)
240 return &veth_iommu_table;
241 return &vio_iommu_table;
242}
243
192void iommu_init_early_iSeries(void) 244void iommu_init_early_iSeries(void)
193{ 245{
194 ppc_md.tce_build = tce_build_iSeries; 246 ppc_md.tce_build = tce_build_iSeries;
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 63b33675848b..701d9297c207 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -346,8 +346,15 @@ static int iseries_irq_host_map(struct irq_host *h, unsigned int virq,
346 return 0; 346 return 0;
347} 347}
348 348
349static int iseries_irq_host_match(struct irq_host *h, struct device_node *np)
350{
351 /* Match all */
352 return 1;
353}
354
349static struct irq_host_ops iseries_irq_host_ops = { 355static struct irq_host_ops iseries_irq_host_ops = {
350 .map = iseries_irq_host_map, 356 .map = iseries_irq_host_map,
357 .match = iseries_irq_host_match,
351}; 358};
352 359
353/* 360/*
@@ -369,7 +376,8 @@ void __init iSeries_init_IRQ(void)
369 /* Create irq host. No need for a revmap since HV will give us 376 /* Create irq host. No need for a revmap since HV will give us
370 * back our virtual irq number 377 * back our virtual irq number
371 */ 378 */
372 host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, &iseries_irq_host_ops, 0); 379 host = irq_alloc_host(NULL, IRQ_HOST_MAP_NOMAP, 0,
380 &iseries_irq_host_ops, 0);
373 BUG_ON(host == NULL); 381 BUG_ON(host == NULL);
374 irq_set_default_host(host); 382 irq_set_default_host(host);
375 383
diff --git a/arch/powerpc/platforms/iseries/it_lp_naca.h b/arch/powerpc/platforms/iseries/it_lp_naca.h
index 9bbf58986819..cf6dcf6ef07b 100644
--- a/arch/powerpc/platforms/iseries/it_lp_naca.h
+++ b/arch/powerpc/platforms/iseries/it_lp_naca.h
@@ -60,7 +60,7 @@ struct ItLpNaca {
60 u8 xRsvd2_0[128]; // Reserved x00-x7F 60 u8 xRsvd2_0[128]; // Reserved x00-x7F
61 61
62// CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators 62// CACHE_LINE_3-6 0x0100 - 0x02FF Contains LP Queue indicators
63// NB: Padding required to keep xInterrruptHdlr at x300 which is required 63// NB: Padding required to keep xInterruptHdlr at x300 which is required
64// for v4r4 PLIC. 64// for v4r4 PLIC.
65 u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F 65 u8 xOldLpQueue[128]; // LP Queue needed for v4r4 100-17F
66 u8 xRsvd3_0[384]; // Reserved 180-2FF 66 u8 xRsvd3_0[384]; // Reserved 180-2FF
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index b1187d95e3b2..c0f2433bc16e 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -39,9 +39,9 @@
39#include <asm/paca.h> 39#include <asm/paca.h>
40#include <asm/abs_addr.h> 40#include <asm/abs_addr.h>
41#include <asm/firmware.h> 41#include <asm/firmware.h>
42#include <asm/iseries/vio.h>
43#include <asm/iseries/mf.h> 42#include <asm/iseries/mf.h>
44#include <asm/iseries/hv_lp_config.h> 43#include <asm/iseries/hv_lp_config.h>
44#include <asm/iseries/hv_lp_event.h>
45#include <asm/iseries/it_lp_queue.h> 45#include <asm/iseries/it_lp_queue.h>
46 46
47#include "setup.h" 47#include "setup.h"
@@ -870,8 +870,7 @@ static int proc_mf_dump_cmdline(char *page, char **start, off_t off,
870 if ((off + count) > 256) 870 if ((off + count) > 256)
871 count = 256 - off; 871 count = 256 - off;
872 872
873 dma_addr = dma_map_single(iSeries_vio_dev, page, off + count, 873 dma_addr = iseries_hv_map(page, off + count, DMA_FROM_DEVICE);
874 DMA_FROM_DEVICE);
875 if (dma_mapping_error(dma_addr)) 874 if (dma_mapping_error(dma_addr))
876 return -ENOMEM; 875 return -ENOMEM;
877 memset(page, 0, off + count); 876 memset(page, 0, off + count);
@@ -883,8 +882,7 @@ static int proc_mf_dump_cmdline(char *page, char **start, off_t off,
883 vsp_cmd.sub_data.kern.length = off + count; 882 vsp_cmd.sub_data.kern.length = off + count;
884 mb(); 883 mb();
885 rc = signal_vsp_instruction(&vsp_cmd); 884 rc = signal_vsp_instruction(&vsp_cmd);
886 dma_unmap_single(iSeries_vio_dev, dma_addr, off + count, 885 iseries_hv_unmap(dma_addr, off + count, DMA_FROM_DEVICE);
887 DMA_FROM_DEVICE);
888 if (rc) 886 if (rc)
889 return rc; 887 return rc;
890 if (vsp_cmd.result_code != 0) 888 if (vsp_cmd.result_code != 0)
@@ -919,8 +917,7 @@ static int mf_getVmlinuxChunk(char *buffer, int *size, int offset, u64 side)
919 int len = *size; 917 int len = *size;
920 dma_addr_t dma_addr; 918 dma_addr_t dma_addr;
921 919
922 dma_addr = dma_map_single(iSeries_vio_dev, buffer, len, 920 dma_addr = iseries_hv_map(buffer, len, DMA_FROM_DEVICE);
923 DMA_FROM_DEVICE);
924 memset(buffer, 0, len); 921 memset(buffer, 0, len);
925 memset(&vsp_cmd, 0, sizeof(vsp_cmd)); 922 memset(&vsp_cmd, 0, sizeof(vsp_cmd));
926 vsp_cmd.cmd = 32; 923 vsp_cmd.cmd = 32;
@@ -938,7 +935,7 @@ static int mf_getVmlinuxChunk(char *buffer, int *size, int offset, u64 side)
938 rc = -ENOMEM; 935 rc = -ENOMEM;
939 } 936 }
940 937
941 dma_unmap_single(iSeries_vio_dev, dma_addr, len, DMA_FROM_DEVICE); 938 iseries_hv_unmap(dma_addr, len, DMA_FROM_DEVICE);
942 939
943 return rc; 940 return rc;
944} 941}
@@ -1149,8 +1146,7 @@ static int proc_mf_change_cmdline(struct file *file, const char __user *buffer,
1149 goto out; 1146 goto out;
1150 1147
1151 dma_addr = 0; 1148 dma_addr = 0;
1152 page = dma_alloc_coherent(iSeries_vio_dev, count, &dma_addr, 1149 page = iseries_hv_alloc(count, &dma_addr, GFP_ATOMIC);
1153 GFP_ATOMIC);
1154 ret = -ENOMEM; 1150 ret = -ENOMEM;
1155 if (page == NULL) 1151 if (page == NULL)
1156 goto out; 1152 goto out;
@@ -1170,7 +1166,7 @@ static int proc_mf_change_cmdline(struct file *file, const char __user *buffer,
1170 ret = count; 1166 ret = count;
1171 1167
1172out_free: 1168out_free:
1173 dma_free_coherent(iSeries_vio_dev, count, page, dma_addr); 1169 iseries_hv_free(count, page, dma_addr);
1174out: 1170out:
1175 return ret; 1171 return ret;
1176} 1172}
@@ -1190,8 +1186,7 @@ static ssize_t proc_mf_change_vmlinux(struct file *file,
1190 goto out; 1186 goto out;
1191 1187
1192 dma_addr = 0; 1188 dma_addr = 0;
1193 page = dma_alloc_coherent(iSeries_vio_dev, count, &dma_addr, 1189 page = iseries_hv_alloc(count, &dma_addr, GFP_ATOMIC);
1194 GFP_ATOMIC);
1195 rc = -ENOMEM; 1190 rc = -ENOMEM;
1196 if (page == NULL) { 1191 if (page == NULL) {
1197 printk(KERN_ERR "mf.c: couldn't allocate memory to set vmlinux chunk\n"); 1192 printk(KERN_ERR "mf.c: couldn't allocate memory to set vmlinux chunk\n");
@@ -1219,7 +1214,7 @@ static ssize_t proc_mf_change_vmlinux(struct file *file,
1219 *ppos += count; 1214 *ppos += count;
1220 rc = count; 1215 rc = count;
1221out_free: 1216out_free:
1222 dma_free_coherent(iSeries_vio_dev, count, page, dma_addr); 1217 iseries_hv_free(count, page, dma_addr);
1223out: 1218out:
1224 return rc; 1219 return rc;
1225} 1220}
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 13a8b1908ded..37ae07ee54a9 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -26,6 +26,8 @@
26#include <linux/major.h> 26#include <linux/major.h>
27#include <linux/root_dev.h> 27#include <linux/root_dev.h>
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/hrtimer.h>
30#include <linux/tick.h>
29 31
30#include <asm/processor.h> 32#include <asm/processor.h>
31#include <asm/machdep.h> 33#include <asm/machdep.h>
@@ -41,7 +43,6 @@
41#include <asm/time.h> 43#include <asm/time.h>
42#include <asm/paca.h> 44#include <asm/paca.h>
43#include <asm/cache.h> 45#include <asm/cache.h>
44#include <asm/sections.h>
45#include <asm/abs_addr.h> 46#include <asm/abs_addr.h>
46#include <asm/iseries/hv_lp_config.h> 47#include <asm/iseries/hv_lp_config.h>
47#include <asm/iseries/hv_call_event.h> 48#include <asm/iseries/hv_call_event.h>
@@ -562,6 +563,7 @@ static void yield_shared_processor(void)
562static void iseries_shared_idle(void) 563static void iseries_shared_idle(void)
563{ 564{
564 while (1) { 565 while (1) {
566 tick_nohz_stop_sched_tick();
565 while (!need_resched() && !hvlpevent_is_pending()) { 567 while (!need_resched() && !hvlpevent_is_pending()) {
566 local_irq_disable(); 568 local_irq_disable();
567 ppc64_runlatch_off(); 569 ppc64_runlatch_off();
@@ -575,6 +577,7 @@ static void iseries_shared_idle(void)
575 } 577 }
576 578
577 ppc64_runlatch_on(); 579 ppc64_runlatch_on();
580 tick_nohz_restart_sched_tick();
578 581
579 if (hvlpevent_is_pending()) 582 if (hvlpevent_is_pending())
580 process_iSeries_events(); 583 process_iSeries_events();
@@ -590,6 +593,7 @@ static void iseries_dedicated_idle(void)
590 set_thread_flag(TIF_POLLING_NRFLAG); 593 set_thread_flag(TIF_POLLING_NRFLAG);
591 594
592 while (1) { 595 while (1) {
596 tick_nohz_stop_sched_tick();
593 if (!need_resched()) { 597 if (!need_resched()) {
594 while (!need_resched()) { 598 while (!need_resched()) {
595 ppc64_runlatch_off(); 599 ppc64_runlatch_off();
@@ -606,6 +610,7 @@ static void iseries_dedicated_idle(void)
606 } 610 }
607 611
608 ppc64_runlatch_on(); 612 ppc64_runlatch_on();
613 tick_nohz_restart_sched_tick();
609 preempt_enable_no_resched(); 614 preempt_enable_no_resched();
610 schedule(); 615 schedule();
611 preempt_disable(); 616 preempt_disable();
diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
new file mode 100644
index 000000000000..910b00b4703e
--- /dev/null
+++ b/arch/powerpc/platforms/iseries/vio.c
@@ -0,0 +1,553 @@
1/*
2 * Legacy iSeries specific vio initialisation
3 * that needs to be built in (not a module).
4 *
5 * © Copyright 2007 IBM Corporation
6 * Author: Stephen Rothwell
7 * Some parts collected from various other files
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#include <linux/of.h>
24#include <linux/init.h>
25#include <linux/gfp.h>
26#include <linux/completion.h>
27#include <linux/proc_fs.h>
28#include <linux/module.h>
29
30#include <asm/firmware.h>
31#include <asm/vio.h>
32#include <asm/iseries/vio.h>
33#include <asm/iseries/iommu.h>
34#include <asm/iseries/hv_types.h>
35#include <asm/iseries/hv_lp_event.h>
36
37#define FIRST_VTY 0
38#define NUM_VTYS 1
39#define FIRST_VSCSI (FIRST_VTY + NUM_VTYS)
40#define NUM_VSCSIS 1
41#define FIRST_VLAN (FIRST_VSCSI + NUM_VSCSIS)
42#define NUM_VLANS HVMAXARCHITECTEDVIRTUALLANS
43#define FIRST_VIODASD (FIRST_VLAN + NUM_VLANS)
44#define NUM_VIODASDS HVMAXARCHITECTEDVIRTUALDISKS
45#define FIRST_VIOCD (FIRST_VIODASD + NUM_VIODASDS)
46#define NUM_VIOCDS HVMAXARCHITECTEDVIRTUALCDROMS
47#define FIRST_VIOTAPE (FIRST_VIOCD + NUM_VIOCDS)
48#define NUM_VIOTAPES HVMAXARCHITECTEDVIRTUALTAPES
49
50struct vio_waitevent {
51 struct completion com;
52 int rc;
53 u16 sub_result;
54};
55
56struct vio_resource {
57 char rsrcname[10];
58 char type[4];
59 char model[3];
60};
61
62static struct property *new_property(const char *name, int length,
63 const void *value)
64{
65 struct property *np = kzalloc(sizeof(*np) + strlen(name) + 1 + length,
66 GFP_KERNEL);
67
68 if (!np)
69 return NULL;
70 np->name = (char *)(np + 1);
71 np->value = np->name + strlen(name) + 1;
72 strcpy(np->name, name);
73 memcpy(np->value, value, length);
74 np->length = length;
75 return np;
76}
77
78static void __init free_property(struct property *np)
79{
80 kfree(np);
81}
82
83static struct device_node *new_node(const char *path,
84 struct device_node *parent)
85{
86 struct device_node *np = kzalloc(sizeof(*np), GFP_KERNEL);
87
88 if (!np)
89 return NULL;
90 np->full_name = kmalloc(strlen(path) + 1, GFP_KERNEL);
91 if (!np->full_name) {
92 kfree(np);
93 return NULL;
94 }
95 strcpy(np->full_name, path);
96 of_node_set_flag(np, OF_DYNAMIC);
97 kref_init(&np->kref);
98 np->parent = of_node_get(parent);
99 return np;
100}
101
102static void free_node(struct device_node *np)
103{
104 struct property *next;
105 struct property *prop;
106
107 next = np->properties;
108 while (next) {
109 prop = next;
110 next = prop->next;
111 free_property(prop);
112 }
113 of_node_put(np->parent);
114 kfree(np->full_name);
115 kfree(np);
116}
117
118static int add_string_property(struct device_node *np, const char *name,
119 const char *value)
120{
121 struct property *nprop = new_property(name, strlen(value) + 1, value);
122
123 if (!nprop)
124 return 0;
125 prom_add_property(np, nprop);
126 return 1;
127}
128
129static int add_raw_property(struct device_node *np, const char *name,
130 int length, const void *value)
131{
132 struct property *nprop = new_property(name, length, value);
133
134 if (!nprop)
135 return 0;
136 prom_add_property(np, nprop);
137 return 1;
138}
139
140static struct device_node *do_device_node(struct device_node *parent,
141 const char *name, u32 reg, u32 unit, const char *type,
142 const char *compat, struct vio_resource *res)
143{
144 struct device_node *np;
145 char path[32];
146
147 snprintf(path, sizeof(path), "/vdevice/%s@%08x", name, reg);
148 np = new_node(path, parent);
149 if (!np)
150 return NULL;
151 if (!add_string_property(np, "name", name) ||
152 !add_string_property(np, "device_type", type) ||
153 !add_string_property(np, "compatible", compat) ||
154 !add_raw_property(np, "reg", sizeof(reg), &reg) ||
155 !add_raw_property(np, "linux,unit_address",
156 sizeof(unit), &unit)) {
157 goto node_free;
158 }
159 if (res) {
160 if (!add_raw_property(np, "linux,vio_rsrcname",
161 sizeof(res->rsrcname), res->rsrcname) ||
162 !add_raw_property(np, "linux,vio_type",
163 sizeof(res->type), res->type) ||
164 !add_raw_property(np, "linux,vio_model",
165 sizeof(res->model), res->model))
166 goto node_free;
167 }
168 np->name = of_get_property(np, "name", NULL);
169 np->type = of_get_property(np, "device_type", NULL);
170 of_attach_node(np);
171#ifdef CONFIG_PROC_DEVICETREE
172 if (parent->pde) {
173 struct proc_dir_entry *ent;
174
175 ent = proc_mkdir(strrchr(np->full_name, '/') + 1, parent->pde);
176 if (ent)
177 proc_device_tree_add_node(np, ent);
178 }
179#endif
180 return np;
181
182 node_free:
183 free_node(np);
184 return NULL;
185}
186
187/*
188 * This is here so that we can dynamically add viodasd
189 * devices without exposing all the above infrastructure.
190 */
191struct vio_dev *vio_create_viodasd(u32 unit)
192{
193 struct device_node *vio_root;
194 struct device_node *np;
195 struct vio_dev *vdev = NULL;
196
197 vio_root = of_find_node_by_path("/vdevice");
198 if (!vio_root)
199 return NULL;
200 np = do_device_node(vio_root, "viodasd", FIRST_VIODASD + unit, unit,
201 "block", "IBM,iSeries-viodasd", NULL);
202 of_node_put(vio_root);
203 if (np) {
204 vdev = vio_register_device_node(np);
205 if (!vdev)
206 free_node(np);
207 }
208 return vdev;
209}
210EXPORT_SYMBOL_GPL(vio_create_viodasd);
211
212static void __init handle_block_event(struct HvLpEvent *event)
213{
214 struct vioblocklpevent *bevent = (struct vioblocklpevent *)event;
215 struct vio_waitevent *pwe;
216
217 if (event == NULL)
218 /* Notification that a partition went away! */
219 return;
220 /* First, we should NEVER get an int here...only acks */
221 if (hvlpevent_is_int(event)) {
222 printk(KERN_WARNING "handle_viod_request: "
223 "Yikes! got an int in viodasd event handler!\n");
224 if (hvlpevent_need_ack(event)) {
225 event->xRc = HvLpEvent_Rc_InvalidSubtype;
226 HvCallEvent_ackLpEvent(event);
227 }
228 return;
229 }
230
231 switch (event->xSubtype & VIOMINOR_SUBTYPE_MASK) {
232 case vioblockopen:
233 /*
234 * Handle a response to an open request. We get all the
235 * disk information in the response, so update it. The
236 * correlation token contains a pointer to a waitevent
237 * structure that has a completion in it. update the
238 * return code in the waitevent structure and post the
239 * completion to wake up the guy who sent the request
240 */
241 pwe = (struct vio_waitevent *)event->xCorrelationToken;
242 pwe->rc = event->xRc;
243 pwe->sub_result = bevent->sub_result;
244 complete(&pwe->com);
245 break;
246 case vioblockclose:
247 break;
248 default:
249 printk(KERN_WARNING "handle_viod_request: unexpected subtype!");
250 if (hvlpevent_need_ack(event)) {
251 event->xRc = HvLpEvent_Rc_InvalidSubtype;
252 HvCallEvent_ackLpEvent(event);
253 }
254 }
255}
256
257static void __init probe_disk(struct device_node *vio_root, u32 unit)
258{
259 HvLpEvent_Rc hvrc;
260 struct vio_waitevent we;
261 u16 flags = 0;
262
263retry:
264 init_completion(&we.com);
265
266 /* Send the open event to OS/400 */
267 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
268 HvLpEvent_Type_VirtualIo,
269 viomajorsubtype_blockio | vioblockopen,
270 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
271 viopath_sourceinst(viopath_hostLp),
272 viopath_targetinst(viopath_hostLp),
273 (u64)(unsigned long)&we, VIOVERSION << 16,
274 ((u64)unit << 48) | ((u64)flags<< 32),
275 0, 0, 0);
276 if (hvrc != 0) {
277 printk(KERN_WARNING "probe_disk: bad rc on HV open %d\n",
278 (int)hvrc);
279 return;
280 }
281
282 wait_for_completion(&we.com);
283
284 if (we.rc != 0) {
285 if (flags != 0)
286 return;
287 /* try again with read only flag set */
288 flags = vioblockflags_ro;
289 goto retry;
290 }
291
292 /* Send the close event to OS/400. We DON'T expect a response */
293 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
294 HvLpEvent_Type_VirtualIo,
295 viomajorsubtype_blockio | vioblockclose,
296 HvLpEvent_AckInd_NoAck, HvLpEvent_AckType_ImmediateAck,
297 viopath_sourceinst(viopath_hostLp),
298 viopath_targetinst(viopath_hostLp),
299 0, VIOVERSION << 16,
300 ((u64)unit << 48) | ((u64)flags << 32),
301 0, 0, 0);
302 if (hvrc != 0) {
303 printk(KERN_WARNING "probe_disk: "
304 "bad rc sending event to OS/400 %d\n", (int)hvrc);
305 return;
306 }
307
308 do_device_node(vio_root, "viodasd", FIRST_VIODASD + unit, unit,
309 "block", "IBM,iSeries-viodasd", NULL);
310}
311
312static void __init get_viodasd_info(struct device_node *vio_root)
313{
314 int rc;
315 u32 unit;
316
317 rc = viopath_open(viopath_hostLp, viomajorsubtype_blockio, 2);
318 if (rc) {
319 printk(KERN_WARNING "get_viodasd_info: "
320 "error opening path to host partition %d\n",
321 viopath_hostLp);
322 return;
323 }
324
325 /* Initialize our request handler */
326 vio_setHandler(viomajorsubtype_blockio, handle_block_event);
327
328 for (unit = 0; unit < HVMAXARCHITECTEDVIRTUALDISKS; unit++)
329 probe_disk(vio_root, unit);
330
331 vio_clearHandler(viomajorsubtype_blockio);
332 viopath_close(viopath_hostLp, viomajorsubtype_blockio, 2);
333}
334
335static void __init handle_cd_event(struct HvLpEvent *event)
336{
337 struct viocdlpevent *bevent;
338 struct vio_waitevent *pwe;
339
340 if (!event)
341 /* Notification that a partition went away! */
342 return;
343
344 /* First, we should NEVER get an int here...only acks */
345 if (hvlpevent_is_int(event)) {
346 printk(KERN_WARNING "handle_cd_event: got an unexpected int\n");
347 if (hvlpevent_need_ack(event)) {
348 event->xRc = HvLpEvent_Rc_InvalidSubtype;
349 HvCallEvent_ackLpEvent(event);
350 }
351 return;
352 }
353
354 bevent = (struct viocdlpevent *)event;
355
356 switch (event->xSubtype & VIOMINOR_SUBTYPE_MASK) {
357 case viocdgetinfo:
358 pwe = (struct vio_waitevent *)event->xCorrelationToken;
359 pwe->rc = event->xRc;
360 pwe->sub_result = bevent->sub_result;
361 complete(&pwe->com);
362 break;
363
364 default:
365 printk(KERN_WARNING "handle_cd_event: "
366 "message with unexpected subtype %0x04X!\n",
367 event->xSubtype & VIOMINOR_SUBTYPE_MASK);
368 if (hvlpevent_need_ack(event)) {
369 event->xRc = HvLpEvent_Rc_InvalidSubtype;
370 HvCallEvent_ackLpEvent(event);
371 }
372 }
373}
374
375static void __init get_viocd_info(struct device_node *vio_root)
376{
377 HvLpEvent_Rc hvrc;
378 u32 unit;
379 struct vio_waitevent we;
380 struct vio_resource *unitinfo;
381 dma_addr_t unitinfo_dmaaddr;
382 int ret;
383
384 ret = viopath_open(viopath_hostLp, viomajorsubtype_cdio, 2);
385 if (ret) {
386 printk(KERN_WARNING
387 "get_viocd_info: error opening path to host partition %d\n",
388 viopath_hostLp);
389 return;
390 }
391
392 /* Initialize our request handler */
393 vio_setHandler(viomajorsubtype_cdio, handle_cd_event);
394
395 unitinfo = iseries_hv_alloc(
396 sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS,
397 &unitinfo_dmaaddr, GFP_ATOMIC);
398 if (!unitinfo) {
399 printk(KERN_WARNING
400 "get_viocd_info: error allocating unitinfo\n");
401 goto clear_handler;
402 }
403
404 memset(unitinfo, 0, sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS);
405
406 init_completion(&we.com);
407
408 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
409 HvLpEvent_Type_VirtualIo,
410 viomajorsubtype_cdio | viocdgetinfo,
411 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
412 viopath_sourceinst(viopath_hostLp),
413 viopath_targetinst(viopath_hostLp),
414 (u64)&we, VIOVERSION << 16, unitinfo_dmaaddr, 0,
415 sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS, 0);
416 if (hvrc != HvLpEvent_Rc_Good) {
417 printk(KERN_WARNING
418 "get_viocd_info: cdrom error sending event. rc %d\n",
419 (int)hvrc);
420 goto hv_free;
421 }
422
423 wait_for_completion(&we.com);
424
425 if (we.rc) {
426 printk(KERN_WARNING "get_viocd_info: bad rc %d:0x%04X\n",
427 we.rc, we.sub_result);
428 goto hv_free;
429 }
430
431 for (unit = 0; (unit < HVMAXARCHITECTEDVIRTUALCDROMS) &&
432 unitinfo[unit].rsrcname[0]; unit++) {
433 if (!do_device_node(vio_root, "viocd", FIRST_VIOCD + unit, unit,
434 "block", "IBM,iSeries-viocd", &unitinfo[unit]))
435 break;
436 }
437
438 hv_free:
439 iseries_hv_free(sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALCDROMS,
440 unitinfo, unitinfo_dmaaddr);
441 clear_handler:
442 vio_clearHandler(viomajorsubtype_cdio);
443 viopath_close(viopath_hostLp, viomajorsubtype_cdio, 2);
444}
445
446/* Handle interrupt events for tape */
447static void __init handle_tape_event(struct HvLpEvent *event)
448{
449 struct vio_waitevent *we;
450 struct viotapelpevent *tevent = (struct viotapelpevent *)event;
451
452 if (event == NULL)
453 /* Notification that a partition went away! */
454 return;
455
456 we = (struct vio_waitevent *)event->xCorrelationToken;
457 switch (event->xSubtype & VIOMINOR_SUBTYPE_MASK) {
458 case viotapegetinfo:
459 we->rc = tevent->sub_type_result;
460 complete(&we->com);
461 break;
462 default:
463 printk(KERN_WARNING "handle_tape_event: weird ack\n");
464 }
465}
466
467static void __init get_viotape_info(struct device_node *vio_root)
468{
469 HvLpEvent_Rc hvrc;
470 u32 unit;
471 struct vio_resource *unitinfo;
472 dma_addr_t unitinfo_dmaaddr;
473 size_t len = sizeof(*unitinfo) * HVMAXARCHITECTEDVIRTUALTAPES;
474 struct vio_waitevent we;
475 int ret;
476
477 ret = viopath_open(viopath_hostLp, viomajorsubtype_tape, 2);
478 if (ret) {
479 printk(KERN_WARNING "get_viotape_info: "
480 "error on viopath_open to hostlp %d\n", ret);
481 return;
482 }
483
484 vio_setHandler(viomajorsubtype_tape, handle_tape_event);
485
486 unitinfo = iseries_hv_alloc(len, &unitinfo_dmaaddr, GFP_ATOMIC);
487 if (!unitinfo)
488 goto clear_handler;
489
490 memset(unitinfo, 0, len);
491
492 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
493 HvLpEvent_Type_VirtualIo,
494 viomajorsubtype_tape | viotapegetinfo,
495 HvLpEvent_AckInd_DoAck, HvLpEvent_AckType_ImmediateAck,
496 viopath_sourceinst(viopath_hostLp),
497 viopath_targetinst(viopath_hostLp),
498 (u64)(unsigned long)&we, VIOVERSION << 16,
499 unitinfo_dmaaddr, len, 0, 0);
500 if (hvrc != HvLpEvent_Rc_Good) {
501 printk(KERN_WARNING "get_viotape_info: hv error on op %d\n",
502 (int)hvrc);
503 goto hv_free;
504 }
505
506 wait_for_completion(&we.com);
507
508 for (unit = 0; (unit < HVMAXARCHITECTEDVIRTUALTAPES) &&
509 unitinfo[unit].rsrcname[0]; unit++) {
510 if (!do_device_node(vio_root, "viotape", FIRST_VIOTAPE + unit,
511 unit, "byte", "IBM,iSeries-viotape",
512 &unitinfo[unit]))
513 break;
514 }
515
516 hv_free:
517 iseries_hv_free(len, unitinfo, unitinfo_dmaaddr);
518 clear_handler:
519 vio_clearHandler(viomajorsubtype_tape);
520 viopath_close(viopath_hostLp, viomajorsubtype_tape, 2);
521}
522
523static int __init iseries_vio_init(void)
524{
525 struct device_node *vio_root;
526
527 if (!firmware_has_feature(FW_FEATURE_ISERIES))
528 return -ENODEV;
529
530 iommu_vio_init();
531
532 vio_root = of_find_node_by_path("/vdevice");
533 if (!vio_root)
534 return -ENODEV;
535
536 if (viopath_hostLp == HvLpIndexInvalid) {
537 vio_set_hostlp();
538 /* If we don't have a host, bail out */
539 if (viopath_hostLp == HvLpIndexInvalid)
540 goto put_node;
541 }
542
543 get_viodasd_info(vio_root);
544 get_viocd_info(vio_root);
545 get_viotape_info(vio_root);
546
547 return 0;
548
549 put_node:
550 of_node_put(vio_root);
551 return -ENODEV;
552}
553arch_initcall(iseries_vio_init);
diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 6a0060a5f2ec..df23331eb25c 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -124,8 +124,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
124 if (!buf) 124 if (!buf)
125 return 0; 125 return 0;
126 126
127 handle = dma_map_single(iSeries_vio_dev, buf, HW_PAGE_SIZE, 127 handle = iseries_hv_map(buf, HW_PAGE_SIZE, DMA_FROM_DEVICE);
128 DMA_FROM_DEVICE);
129 128
130 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp, 129 hvrc = HvCallEvent_signalLpEventFast(viopath_hostLp,
131 HvLpEvent_Type_VirtualIo, 130 HvLpEvent_Type_VirtualIo,
@@ -146,8 +145,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
146 buf[HW_PAGE_SIZE-1] = '\0'; 145 buf[HW_PAGE_SIZE-1] = '\0';
147 seq_printf(m, "%s", buf); 146 seq_printf(m, "%s", buf);
148 147
149 dma_unmap_single(iSeries_vio_dev, handle, HW_PAGE_SIZE, 148 iseries_hv_unmap(handle, HW_PAGE_SIZE, DMA_FROM_DEVICE);
150 DMA_FROM_DEVICE);
151 kfree(buf); 149 kfree(buf);
152 150
153 seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap); 151 seq_printf(m, "AVAILABLE_VETH=%x\n", vlanMap);
@@ -596,7 +594,7 @@ int viopath_close(HvLpIndex remoteLp, int subtype, int numReq)
596 numOpen += viopathStatus[remoteLp].users[i]; 594 numOpen += viopathStatus[remoteLp].users[i];
597 595
598 if ((viopathStatus[remoteLp].isOpen) && (numOpen == 0)) { 596 if ((viopathStatus[remoteLp].isOpen) && (numOpen == 0)) {
599 printk(VIOPATH_KERN_INFO "closing connection to partition %d", 597 printk(VIOPATH_KERN_INFO "closing connection to partition %d\n",
600 remoteLp); 598 remoteLp);
601 599
602 HvCallEvent_closeLpEventPath(remoteLp, 600 HvCallEvent_closeLpEventPath(remoteLp,
diff --git a/arch/powerpc/platforms/maple/pci.c b/arch/powerpc/platforms/maple/pci.c
index 2542403288f9..771ed0cf29a5 100644
--- a/arch/powerpc/platforms/maple/pci.c
+++ b/arch/powerpc/platforms/maple/pci.c
@@ -169,15 +169,12 @@ static int u3_agp_write_config(struct pci_bus *bus, unsigned int devfn,
169 switch (len) { 169 switch (len) {
170 case 1: 170 case 1:
171 out_8(addr, val); 171 out_8(addr, val);
172 (void) in_8(addr);
173 break; 172 break;
174 case 2: 173 case 2:
175 out_le16(addr, val); 174 out_le16(addr, val);
176 (void) in_le16(addr);
177 break; 175 break;
178 default: 176 default:
179 out_le32(addr, val); 177 out_le32(addr, val);
180 (void) in_le32(addr);
181 break; 178 break;
182 } 179 }
183 return PCIBIOS_SUCCESSFUL; 180 return PCIBIOS_SUCCESSFUL;
@@ -185,8 +182,8 @@ static int u3_agp_write_config(struct pci_bus *bus, unsigned int devfn,
185 182
186static struct pci_ops u3_agp_pci_ops = 183static struct pci_ops u3_agp_pci_ops =
187{ 184{
188 u3_agp_read_config, 185 .read = u3_agp_read_config,
189 u3_agp_write_config 186 .write = u3_agp_write_config,
190}; 187};
191 188
192static unsigned long u3_ht_cfa0(u8 devfn, u8 off) 189static unsigned long u3_ht_cfa0(u8 devfn, u8 off)
@@ -268,15 +265,12 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
268 switch (len) { 265 switch (len) {
269 case 1: 266 case 1:
270 out_8(addr, val); 267 out_8(addr, val);
271 (void) in_8(addr);
272 break; 268 break;
273 case 2: 269 case 2:
274 out_le16(addr, val); 270 out_le16(addr, val);
275 (void) in_le16(addr);
276 break; 271 break;
277 default: 272 default:
278 out_le32(addr, val); 273 out_le32(addr, val);
279 (void) in_le32(addr);
280 break; 274 break;
281 } 275 }
282 return PCIBIOS_SUCCESSFUL; 276 return PCIBIOS_SUCCESSFUL;
@@ -284,8 +278,8 @@ static int u3_ht_write_config(struct pci_bus *bus, unsigned int devfn,
284 278
285static struct pci_ops u3_ht_pci_ops = 279static struct pci_ops u3_ht_pci_ops =
286{ 280{
287 u3_ht_read_config, 281 .read = u3_ht_read_config,
288 u3_ht_write_config 282 .write = u3_ht_write_config,
289}; 283};
290 284
291static unsigned int u4_pcie_cfa0(unsigned int devfn, unsigned int off) 285static unsigned int u4_pcie_cfa0(unsigned int devfn, unsigned int off)
@@ -376,15 +370,12 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
376 switch (len) { 370 switch (len) {
377 case 1: 371 case 1:
378 out_8(addr, val); 372 out_8(addr, val);
379 (void) in_8(addr);
380 break; 373 break;
381 case 2: 374 case 2:
382 out_le16(addr, val); 375 out_le16(addr, val);
383 (void) in_le16(addr);
384 break; 376 break;
385 default: 377 default:
386 out_le32(addr, val); 378 out_le32(addr, val);
387 (void) in_le32(addr);
388 break; 379 break;
389 } 380 }
390 return PCIBIOS_SUCCESSFUL; 381 return PCIBIOS_SUCCESSFUL;
@@ -392,8 +383,8 @@ static int u4_pcie_write_config(struct pci_bus *bus, unsigned int devfn,
392 383
393static struct pci_ops u4_pcie_pci_ops = 384static struct pci_ops u4_pcie_pci_ops =
394{ 385{
395 u4_pcie_read_config, 386 .read = u4_pcie_read_config,
396 u4_pcie_write_config 387 .write = u4_pcie_write_config,
397}; 388};
398 389
399static void __init setup_u3_agp(struct pci_controller* hose) 390static void __init setup_u3_agp(struct pci_controller* hose)
diff --git a/arch/powerpc/platforms/pasemi/Kconfig b/arch/powerpc/platforms/pasemi/Kconfig
index 95cd90fd81c7..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
@@ -18,6 +19,16 @@ config PPC_PASEMI_IOMMU
18 help 19 help
19 IOMMU support for PA6T-1682M 20 IOMMU support for PA6T-1682M
20 21
22config PPC_PASEMI_IOMMU_DMA_FORCE
23 bool "Force DMA engine to use IOMMU"
24 depends on PPC_PASEMI_IOMMU
25 help
26 This option forces the use of the IOMMU also for the
27 DMA engine. Otherwise the kernel will use it only when
28 running under a hypervisor.
29
30 If in doubt, say "N".
31
21config PPC_PASEMI_MDIO 32config PPC_PASEMI_MDIO
22 depends on PHYLIB 33 depends on PHYLIB
23 tristate "MDIO support via GPIO" 34 tristate "MDIO support via GPIO"
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 9014d55c717b..9916a0f3e431 100644
--- a/arch/powerpc/platforms/pasemi/iommu.c
+++ b/arch/powerpc/platforms/pasemi/iommu.c
@@ -25,6 +25,7 @@
25#include <asm/iommu.h> 25#include <asm/iommu.h>
26#include <asm/machdep.h> 26#include <asm/machdep.h>
27#include <asm/abs_addr.h> 27#include <asm/abs_addr.h>
28#include <asm/firmware.h>
28 29
29 30
30#define IOBMAP_PAGE_SHIFT 12 31#define IOBMAP_PAGE_SHIFT 12
@@ -175,19 +176,23 @@ static void pci_dma_dev_setup_pasemi(struct pci_dev *dev)
175{ 176{
176 pr_debug("pci_dma_dev_setup, dev %p (%s)\n", dev, pci_name(dev)); 177 pr_debug("pci_dma_dev_setup, dev %p (%s)\n", dev, pci_name(dev));
177 178
178 /* DMA device is untranslated, but all other PCI-e goes through 179#if !defined(CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE)
179 * the IOMMU 180 /* For non-LPAR environment, don't translate anything for the DMA
181 * engine. The exception to this is if the user has enabled
182 * CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE at build time.
180 */ 183 */
181 if (dev->vendor == 0x1959 && dev->device == 0xa007) 184 if (dev->vendor == 0x1959 && dev->device == 0xa007 &&
185 !firmware_has_feature(FW_FEATURE_LPAR))
182 dev->dev.archdata.dma_ops = &dma_direct_ops; 186 dev->dev.archdata.dma_ops = &dma_direct_ops;
183 else 187#endif
184 dev->dev.archdata.dma_data = &iommu_table_iobmap; 188
189 dev->dev.archdata.dma_data = &iommu_table_iobmap;
185} 190}
186 191
187static void pci_dma_bus_setup_null(struct pci_bus *b) { } 192static void pci_dma_bus_setup_null(struct pci_bus *b) { }
188static void pci_dma_dev_setup_null(struct pci_dev *d) { } 193static void pci_dma_dev_setup_null(struct pci_dev *d) { }
189 194
190int iob_init(struct device_node *dn) 195int __init iob_init(struct device_node *dn)
191{ 196{
192 unsigned long tmp; 197 unsigned long tmp;
193 u32 regword; 198 u32 regword;
@@ -233,7 +238,7 @@ int iob_init(struct device_node *dn)
233 238
234 239
235/* These are called very early. */ 240/* These are called very early. */
236void iommu_init_early_pasemi(void) 241void __init iommu_init_early_pasemi(void)
237{ 242{
238 int iommu_off; 243 int iommu_off;
239 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..5eaf3e3f4b8b 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -117,7 +117,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
117 transfered = 0; 117 transfered = 0;
118 bio_for_each_segment(vec, bio, idx) { 118 bio_for_each_segment(vec, bio, idx) {
119 if (unlikely(phys_mem + vec->bv_len > phys_end)) { 119 if (unlikely(phys_mem + vec->bv_len > phys_end)) {
120 bio_io_error(bio, bio->bi_size); 120 bio_io_error(bio);
121 rc = -ERANGE; 121 rc = -ERANGE;
122 break; 122 break;
123 } 123 }
@@ -131,7 +131,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
131 phys_mem += vec->bv_len; 131 phys_mem += vec->bv_len;
132 transfered += vec->bv_len; 132 transfered += vec->bv_len;
133 } 133 }
134 bio_endio(bio, transfered, 0); 134 bio_endio(bio, 0);
135 135
136 return rc; 136 return rc;
137} 137}
@@ -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/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 62391fb1f61f..ac61cf43a7d9 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -547,8 +547,7 @@ static void __cpuinit appldata_online_cpu(int cpu)
547 spin_unlock(&appldata_timer_lock); 547 spin_unlock(&appldata_timer_lock);
548} 548}
549 549
550static void 550static void __cpuinit appldata_offline_cpu(int cpu)
551appldata_offline_cpu(int cpu)
552{ 551{
553 del_virt_timer(&per_cpu(appldata_timer, cpu)); 552 del_virt_timer(&per_cpu(appldata_timer, cpu));
554 if (atomic_dec_and_test(&appldata_expire_count)) { 553 if (atomic_dec_and_test(&appldata_expire_count)) {
@@ -560,9 +559,9 @@ appldata_offline_cpu(int cpu)
560 spin_unlock(&appldata_timer_lock); 559 spin_unlock(&appldata_timer_lock);
561} 560}
562 561
563static int __cpuinit 562static int __cpuinit appldata_cpu_notify(struct notifier_block *self,
564appldata_cpu_notify(struct notifier_block *self, 563 unsigned long action,
565 unsigned long action, void *hcpu) 564 void *hcpu)
566{ 565{
567 switch (action) { 566 switch (action) {
568 case CPU_ONLINE: 567 case CPU_ONLINE:
@@ -608,63 +607,15 @@ static int __init appldata_init(void)
608 register_hotcpu_notifier(&appldata_nb); 607 register_hotcpu_notifier(&appldata_nb);
609 608
610 appldata_sysctl_header = register_sysctl_table(appldata_dir_table); 609 appldata_sysctl_header = register_sysctl_table(appldata_dir_table);
611#ifdef MODULE
612 appldata_dir_table[0].de->owner = THIS_MODULE;
613 appldata_table[0].de->owner = THIS_MODULE;
614 appldata_table[1].de->owner = THIS_MODULE;
615#endif
616 610
617 P_DEBUG("Base interface initialized.\n"); 611 P_DEBUG("Base interface initialized.\n");
618 return 0; 612 return 0;
619} 613}
620 614
621/* 615__initcall(appldata_init);
622 * appldata_exit()
623 *
624 * stop timer, unregister /proc entries
625 */
626static void __exit appldata_exit(void)
627{
628 struct list_head *lh;
629 struct appldata_ops *ops;
630 int rc, i;
631 616
632 P_DEBUG("Unloading module ...\n");
633 /*
634 * ops list should be empty, but just in case something went wrong...
635 */
636 spin_lock(&appldata_ops_lock);
637 list_for_each(lh, &appldata_ops_list) {
638 ops = list_entry(lh, struct appldata_ops, list);
639 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
640 (unsigned long) ops->data, ops->size,
641 ops->mod_lvl);
642 if (rc != 0) {
643 P_ERROR("STOP DIAG 0xDC for %s failed, "
644 "return code: %d\n", ops->name, rc);
645 }
646 }
647 spin_unlock(&appldata_ops_lock);
648
649 for_each_online_cpu(i)
650 appldata_offline_cpu(i);
651
652 appldata_timer_active = 0;
653
654 unregister_sysctl_table(appldata_sysctl_header);
655
656 destroy_workqueue(appldata_wq);
657 P_DEBUG("... module unloaded!\n");
658}
659/**************************** init / exit <END> ******************************/ 617/**************************** init / exit <END> ******************************/
660 618
661
662module_init(appldata_init);
663module_exit(appldata_exit);
664MODULE_LICENSE("GPL");
665MODULE_AUTHOR("Gerald Schaefer");
666MODULE_DESCRIPTION("Linux-VM Monitor Stream, base infrastructure");
667
668EXPORT_SYMBOL_GPL(appldata_register_ops); 619EXPORT_SYMBOL_GPL(appldata_register_ops);
669EXPORT_SYMBOL_GPL(appldata_unregister_ops); 620EXPORT_SYMBOL_GPL(appldata_unregister_ops);
670EXPORT_SYMBOL_GPL(appldata_diag); 621EXPORT_SYMBOL_GPL(appldata_diag);
diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c
index 2180ac105b05..6c1815a47714 100644
--- a/arch/s390/appldata/appldata_net_sum.c
+++ b/arch/s390/appldata/appldata_net_sum.c
@@ -16,6 +16,7 @@
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/kernel_stat.h> 17#include <linux/kernel_stat.h>
18#include <linux/netdevice.h> 18#include <linux/netdevice.h>
19#include <net/net_namespace.h>
19 20
20#include "appldata.h" 21#include "appldata.h"
21 22
@@ -107,7 +108,7 @@ static void appldata_get_net_sum_data(void *data)
107 tx_dropped = 0; 108 tx_dropped = 0;
108 collisions = 0; 109 collisions = 0;
109 read_lock(&dev_base_lock); 110 read_lock(&dev_base_lock);
110 for_each_netdev(dev) { 111 for_each_netdev(&init_net, dev) {
111 stats = dev->get_stats(dev); 112 stats = dev->get_stats(dev);
112 rx_packets += stats->rx_packets; 113 rx_packets += stats->rx_packets;
113 tx_packets += stats->tx_packets; 114 tx_packets += stats->tx_packets;
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c
index 3660ca6a3306..512669691ad0 100644
--- a/arch/s390/crypto/aes_s390.c
+++ b/arch/s390/crypto/aes_s390.c
@@ -7,7 +7,7 @@
7 * Copyright IBM Corp. 2005,2007 7 * Copyright IBM Corp. 2005,2007
8 * Author(s): Jan Glauber (jang@de.ibm.com) 8 * Author(s): Jan Glauber (jang@de.ibm.com)
9 * 9 *
10 * Derived from "crypto/aes.c" 10 * Derived from "crypto/aes_generic.c"
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify it 12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the Free 13 * under the terms of the GNU General Public License as published by the Free
diff --git a/arch/s390/crypto/sha1_s390.c b/arch/s390/crypto/sha1_s390.c
index af4460ec381f..5a834f6578ab 100644
--- a/arch/s390/crypto/sha1_s390.c
+++ b/arch/s390/crypto/sha1_s390.c
@@ -12,7 +12,7 @@
12 * Author(s): Thomas Spatzier 12 * Author(s): Thomas Spatzier
13 * Jan Glauber (jan.glauber@de.ibm.com) 13 * Jan Glauber (jan.glauber@de.ibm.com)
14 * 14 *
15 * Derived from "crypto/sha1.c" 15 * Derived from "crypto/sha1_generic.c"
16 * Copyright (c) Alan Smithee. 16 * Copyright (c) Alan Smithee.
17 * Copyright (c) Andrew McDonald <andrew@mcdonald.org.uk> 17 * Copyright (c) Andrew McDonald <andrew@mcdonald.org.uk>
18 * Copyright (c) Jean-Francois Dive <jef@linuxbe.org> 18 * Copyright (c) Jean-Francois Dive <jef@linuxbe.org>
@@ -26,12 +26,10 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/crypto.h> 28#include <linux/crypto.h>
29#include <crypto/sha.h>
29 30
30#include "crypt_s390.h" 31#include "crypt_s390.h"
31 32
32#define SHA1_DIGEST_SIZE 20
33#define SHA1_BLOCK_SIZE 64
34
35struct s390_sha1_ctx { 33struct s390_sha1_ctx {
36 u64 count; /* message length */ 34 u64 count; /* message length */
37 u32 state[5]; 35 u32 state[5];
@@ -42,11 +40,11 @@ static void sha1_init(struct crypto_tfm *tfm)
42{ 40{
43 struct s390_sha1_ctx *sctx = crypto_tfm_ctx(tfm); 41 struct s390_sha1_ctx *sctx = crypto_tfm_ctx(tfm);
44 42
45 sctx->state[0] = 0x67452301; 43 sctx->state[0] = SHA1_H0;
46 sctx->state[1] = 0xEFCDAB89; 44 sctx->state[1] = SHA1_H1;
47 sctx->state[2] = 0x98BADCFE; 45 sctx->state[2] = SHA1_H2;
48 sctx->state[3] = 0x10325476; 46 sctx->state[3] = SHA1_H3;
49 sctx->state[4] = 0xC3D2E1F0; 47 sctx->state[4] = SHA1_H4;
50 sctx->count = 0; 48 sctx->count = 0;
51} 49}
52 50
diff --git a/arch/s390/crypto/sha256_s390.c b/arch/s390/crypto/sha256_s390.c
index 2ced3330bce0..ccf8633c4f65 100644
--- a/arch/s390/crypto/sha256_s390.c
+++ b/arch/s390/crypto/sha256_s390.c
@@ -7,7 +7,7 @@
7 * Copyright IBM Corp. 2005,2007 7 * Copyright IBM Corp. 2005,2007
8 * Author(s): Jan Glauber (jang@de.ibm.com) 8 * Author(s): Jan Glauber (jang@de.ibm.com)
9 * 9 *
10 * Derived from "crypto/sha256.c" 10 * Derived from "crypto/sha256_generic.c"
11 * and "arch/s390/crypto/sha1_s390.c" 11 * and "arch/s390/crypto/sha1_s390.c"
12 * 12 *
13 * This program is free software; you can redistribute it and/or modify it 13 * This program is free software; you can redistribute it and/or modify it
@@ -19,12 +19,10 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/crypto.h> 21#include <linux/crypto.h>
22#include <crypto/sha.h>
22 23
23#include "crypt_s390.h" 24#include "crypt_s390.h"
24 25
25#define SHA256_DIGEST_SIZE 32
26#define SHA256_BLOCK_SIZE 64
27
28struct s390_sha256_ctx { 26struct s390_sha256_ctx {
29 u64 count; /* message length */ 27 u64 count; /* message length */
30 u32 state[8]; 28 u32 state[8];
@@ -35,14 +33,14 @@ static void sha256_init(struct crypto_tfm *tfm)
35{ 33{
36 struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm); 34 struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm);
37 35
38 sctx->state[0] = 0x6a09e667; 36 sctx->state[0] = SHA256_H0;
39 sctx->state[1] = 0xbb67ae85; 37 sctx->state[1] = SHA256_H1;
40 sctx->state[2] = 0x3c6ef372; 38 sctx->state[2] = SHA256_H2;
41 sctx->state[3] = 0xa54ff53a; 39 sctx->state[3] = SHA256_H3;
42 sctx->state[4] = 0x510e527f; 40 sctx->state[4] = SHA256_H4;
43 sctx->state[5] = 0x9b05688c; 41 sctx->state[5] = SHA256_H5;
44 sctx->state[6] = 0x1f83d9ab; 42 sctx->state[6] = SHA256_H6;
45 sctx->state[7] = 0x5be0cd19; 43 sctx->state[7] = SHA256_H7;
46 sctx->count = 0; 44 sctx->count = 0;
47} 45}
48 46
diff --git a/arch/s390/kernel/audit.c b/arch/s390/kernel/audit.c
index d1c76fe10f29..f4932c22ebe4 100644
--- a/arch/s390/kernel/audit.c
+++ b/arch/s390/kernel/audit.c
@@ -2,6 +2,7 @@
2#include <linux/types.h> 2#include <linux/types.h>
3#include <linux/audit.h> 3#include <linux/audit.h>
4#include <asm/unistd.h> 4#include <asm/unistd.h>
5#include "audit.h"
5 6
6static unsigned dir_class[] = { 7static unsigned dir_class[] = {
7#include <asm-generic/audit_dir_write.h> 8#include <asm-generic/audit_dir_write.h>
@@ -40,7 +41,6 @@ int audit_classify_arch(int arch)
40int audit_classify_syscall(int abi, unsigned syscall) 41int audit_classify_syscall(int abi, unsigned syscall)
41{ 42{
42#ifdef CONFIG_COMPAT 43#ifdef CONFIG_COMPAT
43 extern int s390_classify_syscall(unsigned);
44 if (abi == AUDIT_ARCH_S390) 44 if (abi == AUDIT_ARCH_S390)
45 return s390_classify_syscall(syscall); 45 return s390_classify_syscall(syscall);
46#endif 46#endif
@@ -61,11 +61,6 @@ int audit_classify_syscall(int abi, unsigned syscall)
61static int __init audit_classes_init(void) 61static int __init audit_classes_init(void)
62{ 62{
63#ifdef CONFIG_COMPAT 63#ifdef CONFIG_COMPAT
64 extern __u32 s390_dir_class[];
65 extern __u32 s390_write_class[];
66 extern __u32 s390_read_class[];
67 extern __u32 s390_chattr_class[];
68 extern __u32 s390_signal_class[];
69 audit_register_class(AUDIT_CLASS_WRITE_32, s390_write_class); 64 audit_register_class(AUDIT_CLASS_WRITE_32, s390_write_class);
70 audit_register_class(AUDIT_CLASS_READ_32, s390_read_class); 65 audit_register_class(AUDIT_CLASS_READ_32, s390_read_class);
71 audit_register_class(AUDIT_CLASS_DIR_WRITE_32, s390_dir_class); 66 audit_register_class(AUDIT_CLASS_DIR_WRITE_32, s390_dir_class);
diff --git a/arch/s390/kernel/audit.h b/arch/s390/kernel/audit.h
new file mode 100644
index 000000000000..12b56f4b5a73
--- /dev/null
+++ b/arch/s390/kernel/audit.h
@@ -0,0 +1,15 @@
1#ifndef __ARCH_S390_KERNEL_AUDIT_H
2#define __ARCH_S390_KERNEL_AUDIT_H
3
4#include <linux/types.h>
5
6#ifdef CONFIG_COMPAT
7extern int s390_classify_syscall(unsigned);
8extern __u32 s390_dir_class[];
9extern __u32 s390_write_class[];
10extern __u32 s390_read_class[];
11extern __u32 s390_chattr_class[];
12extern __u32 s390_signal_class[];
13#endif /* CONFIG_COMPAT */
14
15#endif /* __ARCH_S390_KERNEL_AUDIT_H */
diff --git a/arch/s390/kernel/compat_audit.c b/arch/s390/kernel/compat_audit.c
index 0569f5126e49..d6487bf879e5 100644
--- a/arch/s390/kernel/compat_audit.c
+++ b/arch/s390/kernel/compat_audit.c
@@ -1,5 +1,6 @@
1#undef __s390x__ 1#undef __s390x__
2#include <asm/unistd.h> 2#include <asm/unistd.h>
3#include "audit.h"
3 4
4unsigned s390_dir_class[] = { 5unsigned s390_dir_class[] = {
5#include <asm-generic/audit_dir_write.h> 6#include <asm-generic/audit_dir_write.h>
diff --git a/arch/s390/kernel/cpcmd.c b/arch/s390/kernel/cpcmd.c
index 6c89f30c8e31..d8c1131e0815 100644
--- a/arch/s390/kernel/cpcmd.c
+++ b/arch/s390/kernel/cpcmd.c
@@ -2,7 +2,7 @@
2 * arch/s390/kernel/cpcmd.c 2 * arch/s390/kernel/cpcmd.c
3 * 3 *
4 * S390 version 4 * S390 version
5 * Copyright (C) 1999,2005 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Copyright IBM Corp. 1999,2007
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), 6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
7 * Christian Borntraeger (cborntra@de.ibm.com), 7 * Christian Borntraeger (cborntra@de.ibm.com),
8 */ 8 */
@@ -21,6 +21,49 @@
21static DEFINE_SPINLOCK(cpcmd_lock); 21static DEFINE_SPINLOCK(cpcmd_lock);
22static char cpcmd_buf[241]; 22static char cpcmd_buf[241];
23 23
24static int diag8_noresponse(int cmdlen)
25{
26 register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf;
27 register unsigned long reg3 asm ("3") = cmdlen;
28
29 asm volatile(
30#ifndef CONFIG_64BIT
31 " diag %1,%0,0x8\n"
32#else /* CONFIG_64BIT */
33 " sam31\n"
34 " diag %1,%0,0x8\n"
35 " sam64\n"
36#endif /* CONFIG_64BIT */
37 : "+d" (reg3) : "d" (reg2) : "cc");
38 return reg3;
39}
40
41static int diag8_response(int cmdlen, char *response, int *rlen)
42{
43 register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf;
44 register unsigned long reg3 asm ("3") = (addr_t) response;
45 register unsigned long reg4 asm ("4") = cmdlen | 0x40000000L;
46 register unsigned long reg5 asm ("5") = *rlen;
47
48 asm volatile(
49#ifndef CONFIG_64BIT
50 " diag %2,%0,0x8\n"
51 " brc 8,1f\n"
52 " ar %1,%4\n"
53#else /* CONFIG_64BIT */
54 " sam31\n"
55 " diag %2,%0,0x8\n"
56 " sam64\n"
57 " brc 8,1f\n"
58 " agr %1,%4\n"
59#endif /* CONFIG_64BIT */
60 "1:\n"
61 : "+d" (reg4), "+d" (reg5)
62 : "d" (reg2), "d" (reg3), "d" (*rlen) : "cc");
63 *rlen = reg5;
64 return reg4;
65}
66
24/* 67/*
25 * __cpcmd has some restrictions over cpcmd 68 * __cpcmd has some restrictions over cpcmd
26 * - the response buffer must reside below 2GB (if any) 69 * - the response buffer must reside below 2GB (if any)
@@ -28,59 +71,27 @@ static char cpcmd_buf[241];
28 */ 71 */
29int __cpcmd(const char *cmd, char *response, int rlen, int *response_code) 72int __cpcmd(const char *cmd, char *response, int rlen, int *response_code)
30{ 73{
31 unsigned cmdlen; 74 int cmdlen;
32 int return_code, return_len; 75 int rc;
76 int response_len;
33 77
34 cmdlen = strlen(cmd); 78 cmdlen = strlen(cmd);
35 BUG_ON(cmdlen > 240); 79 BUG_ON(cmdlen > 240);
36 memcpy(cpcmd_buf, cmd, cmdlen); 80 memcpy(cpcmd_buf, cmd, cmdlen);
37 ASCEBC(cpcmd_buf, cmdlen); 81 ASCEBC(cpcmd_buf, cmdlen);
38 82
39 if (response != NULL && rlen > 0) { 83 if (response) {
40 register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf;
41 register unsigned long reg3 asm ("3") = (addr_t) response;
42 register unsigned long reg4 asm ("4") = cmdlen | 0x40000000L;
43 register unsigned long reg5 asm ("5") = rlen;
44
45 memset(response, 0, rlen); 84 memset(response, 0, rlen);
46 asm volatile( 85 response_len = rlen;
47#ifndef CONFIG_64BIT 86 rc = diag8_response(cmdlen, response, &rlen);
48 " diag %2,%0,0x8\n" 87 EBCASC(response, response_len);
49 " brc 8,1f\n"
50 " ar %1,%4\n"
51#else /* CONFIG_64BIT */
52 " sam31\n"
53 " diag %2,%0,0x8\n"
54 " sam64\n"
55 " brc 8,1f\n"
56 " agr %1,%4\n"
57#endif /* CONFIG_64BIT */
58 "1:\n"
59 : "+d" (reg4), "+d" (reg5)
60 : "d" (reg2), "d" (reg3), "d" (rlen) : "cc");
61 return_code = (int) reg4;
62 return_len = (int) reg5;
63 EBCASC(response, rlen);
64 } else { 88 } else {
65 register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; 89 rc = diag8_noresponse(cmdlen);
66 register unsigned long reg3 asm ("3") = cmdlen;
67 return_len = 0;
68 asm volatile(
69#ifndef CONFIG_64BIT
70 " diag %1,%0,0x8\n"
71#else /* CONFIG_64BIT */
72 " sam31\n"
73 " diag %1,%0,0x8\n"
74 " sam64\n"
75#endif /* CONFIG_64BIT */
76 : "+d" (reg3) : "d" (reg2) : "cc");
77 return_code = (int) reg3;
78 } 90 }
79 if (response_code != NULL) 91 if (response_code)
80 *response_code = return_code; 92 *response_code = rc;
81 return return_len; 93 return rlen;
82} 94}
83
84EXPORT_SYMBOL(__cpcmd); 95EXPORT_SYMBOL(__cpcmd);
85 96
86int cpcmd(const char *cmd, char *response, int rlen, int *response_code) 97int cpcmd(const char *cmd, char *response, int rlen, int *response_code)
@@ -109,5 +120,4 @@ int cpcmd(const char *cmd, char *response, int rlen, int *response_code)
109 } 120 }
110 return len; 121 return len;
111} 122}
112
113EXPORT_SYMBOL(cpcmd); 123EXPORT_SYMBOL(cpcmd);
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
index 50d2235df732..c14a336f6300 100644
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -1162,6 +1162,7 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr)
1162 unsigned int value; 1162 unsigned int value;
1163 char separator; 1163 char separator;
1164 char *ptr; 1164 char *ptr;
1165 int i;
1165 1166
1166 ptr = buffer; 1167 ptr = buffer;
1167 insn = find_insn(code); 1168 insn = find_insn(code);
@@ -1169,7 +1170,8 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr)
1169 ptr += sprintf(ptr, "%.5s\t", insn->name); 1170 ptr += sprintf(ptr, "%.5s\t", insn->name);
1170 /* Extract the operands. */ 1171 /* Extract the operands. */
1171 separator = 0; 1172 separator = 0;
1172 for (ops = formats[insn->format] + 1; *ops != 0; ops++) { 1173 for (ops = formats[insn->format] + 1, i = 0;
1174 *ops != 0 && i < 6; ops++, i++) {
1173 operand = operands + *ops; 1175 operand = operands + *ops;
1174 value = extract_operand(code, operand); 1176 value = extract_operand(code, operand);
1175 if ((operand->flags & OPERAND_INDEX) && value == 0) 1177 if ((operand->flags & OPERAND_INDEX) && value == 0)
@@ -1241,7 +1243,6 @@ void show_code(struct pt_regs *regs)
1241 } 1243 }
1242 /* Find a starting point for the disassembly. */ 1244 /* Find a starting point for the disassembly. */
1243 while (start < 32) { 1245 while (start < 32) {
1244 hops = 0;
1245 for (i = 0, hops = 0; start + i < 32 && hops < 3; hops++) { 1246 for (i = 0, hops = 0; start + i < 32 && hops < 3; hops++) {
1246 if (!find_insn(code + start + i)) 1247 if (!find_insn(code + start + i))
1247 break; 1248 break;
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 8b8f136d9cc7..66b51901c87d 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -735,10 +735,10 @@ void do_reipl(void)
735 case REIPL_METHOD_CCW_VM: 735 case REIPL_METHOD_CCW_VM:
736 reipl_get_ascii_loadparm(loadparm); 736 reipl_get_ascii_loadparm(loadparm);
737 if (strlen(loadparm) == 0) 737 if (strlen(loadparm) == 0)
738 sprintf(buf, "IPL %X", 738 sprintf(buf, "IPL %X CLEAR",
739 reipl_block_ccw->ipl_info.ccw.devno); 739 reipl_block_ccw->ipl_info.ccw.devno);
740 else 740 else
741 sprintf(buf, "IPL %X LOADPARM '%s'", 741 sprintf(buf, "IPL %X CLEAR LOADPARM '%s'",
742 reipl_block_ccw->ipl_info.ccw.devno, loadparm); 742 reipl_block_ccw->ipl_info.ccw.devno, loadparm);
743 __cpcmd(buf, NULL, 0, NULL); 743 __cpcmd(buf, NULL, 0, NULL);
744 break; 744 break;
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
index 8f0cbca31203..c36d8123ca14 100644
--- a/arch/s390/kernel/irq.c
+++ b/arch/s390/kernel/irq.c
@@ -95,7 +95,6 @@ asmlinkage void do_softirq(void)
95 95
96 local_irq_restore(flags); 96 local_irq_restore(flags);
97} 97}
98EXPORT_SYMBOL(do_softirq);
99 98
100void init_irq_proc(void) 99void init_irq_proc(void)
101{ 100{
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index b4622a3889b0..849120e3e28a 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -2,6 +2,7 @@
2 * Written by Martin Schwidefsky (schwidefsky@de.ibm.com) 2 * Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
3 */ 3 */
4 4
5#include <asm/page.h>
5#include <asm-generic/vmlinux.lds.h> 6#include <asm-generic/vmlinux.lds.h>
6 7
7#ifndef CONFIG_64BIT 8#ifndef CONFIG_64BIT
@@ -18,121 +19,142 @@ jiffies = jiffies_64;
18 19
19SECTIONS 20SECTIONS
20{ 21{
21 . = 0x00000000; 22 . = 0x00000000;
22 _text = .; /* Text and read-only data */ 23 .text : {
23 .text : { 24 _text = .; /* Text and read-only data */
24 *(.text.head) 25 *(.text.head)
25 TEXT_TEXT 26 TEXT_TEXT
26 SCHED_TEXT 27 SCHED_TEXT
27 LOCK_TEXT 28 LOCK_TEXT
28 KPROBES_TEXT 29 KPROBES_TEXT
29 *(.fixup) 30 *(.fixup)
30 *(.gnu.warning) 31 *(.gnu.warning)
31 } = 0x0700 32 } = 0x0700
32 33
33 _etext = .; /* End of text section */ 34 _etext = .; /* End of text section */
34 35
35 RODATA 36 RODATA
36 37
37#ifdef CONFIG_SHARED_KERNEL 38#ifdef CONFIG_SHARED_KERNEL
38 . = ALIGN(1048576); /* VM shared segments are 1MB aligned */ 39 . = ALIGN(0x100000); /* VM shared segments are 1MB aligned */
39#endif 40#endif
40 41
41 . = ALIGN(4096); 42 . = ALIGN(PAGE_SIZE);
42 _eshared = .; /* End of shareable data */ 43 _eshared = .; /* End of shareable data */
43 44
44 . = ALIGN(16); /* Exception table */ 45 . = ALIGN(16); /* Exception table */
45 __start___ex_table = .; 46 __ex_table : {
46 __ex_table : { *(__ex_table) } 47 __start___ex_table = .;
47 __stop___ex_table = .; 48 *(__ex_table)
48 49 __stop___ex_table = .;
49 NOTES 50 }
50 51
51 BUG_TABLE 52 NOTES
52 53 BUG_TABLE
53 .data : { /* Data */ 54
54 DATA_DATA 55 .data : { /* Data */
55 CONSTRUCTORS 56 DATA_DATA
56 } 57 CONSTRUCTORS
57 58 }
58 . = ALIGN(4096); 59
59 __nosave_begin = .; 60 . = ALIGN(PAGE_SIZE);
60 .data_nosave : { *(.data.nosave) } 61 .data_nosave : {
61 . = ALIGN(4096); 62 __nosave_begin = .;
62 __nosave_end = .; 63 *(.data.nosave)
63 64 }
64 . = ALIGN(4096); 65 . = ALIGN(PAGE_SIZE);
65 .data.page_aligned : { *(.data.idt) } 66 __nosave_end = .;
66 67
67 . = ALIGN(256); 68 . = ALIGN(PAGE_SIZE);
68 .data.cacheline_aligned : { *(.data.cacheline_aligned) } 69 .data.page_aligned : {
69 70 *(.data.idt)
70 . = ALIGN(256); 71 }
71 .data.read_mostly : { *(.data.read_mostly) } 72
72 _edata = .; /* End of data section */ 73 . = ALIGN(0x100);
73 74 .data.cacheline_aligned : {
74 . = ALIGN(8192); /* init_task */ 75 *(.data.cacheline_aligned)
75 .data.init_task : { *(.data.init_task) } 76 }
76 77
77 /* will be freed after init */ 78 . = ALIGN(0x100);
78 . = ALIGN(4096); /* Init code and data */ 79 .data.read_mostly : {
79 __init_begin = .; 80 *(.data.read_mostly)
80 .init.text : { 81 }
81 _sinittext = .; 82 _edata = .; /* End of data section */
82 *(.init.text) 83
83 _einittext = .; 84 . = ALIGN(2 * PAGE_SIZE); /* init_task */
84 } 85 .data.init_task : {
85 /* 86 *(.data.init_task)
86 * .exit.text is discarded at runtime, not link time, 87 }
87 * to deal with references from __bug_table 88
88 */ 89 /* will be freed after init */
89 .exit.text : { *(.exit.text) } 90 . = ALIGN(PAGE_SIZE); /* Init code and data */
90 91 __init_begin = .;
91 .init.data : { *(.init.data) } 92 .init.text : {
92 . = ALIGN(256); 93 _sinittext = .;
93 __setup_start = .; 94 *(.init.text)
94 .init.setup : { *(.init.setup) } 95 _einittext = .;
95 __setup_end = .; 96 }
96 __initcall_start = .; 97 /*
97 .initcall.init : { 98 * .exit.text is discarded at runtime, not link time,
98 INITCALLS 99 * to deal with references from __bug_table
99 } 100 */
100 __initcall_end = .; 101 .exit.text : {
101 __con_initcall_start = .; 102 *(.exit.text)
102 .con_initcall.init : { *(.con_initcall.init) } 103 }
103 __con_initcall_end = .; 104
104 SECURITY_INIT 105 .init.data : {
106 *(.init.data)
107 }
108 . = ALIGN(0x100);
109 .init.setup : {
110 __setup_start = .;
111 *(.init.setup)
112 __setup_end = .;
113 }
114 .initcall.init : {
115 __initcall_start = .;
116 INITCALLS
117 __initcall_end = .;
118 }
119
120 .con_initcall.init : {
121 __con_initcall_start = .;
122 *(.con_initcall.init)
123 __con_initcall_end = .;
124 }
125 SECURITY_INIT
105 126
106#ifdef CONFIG_BLK_DEV_INITRD 127#ifdef CONFIG_BLK_DEV_INITRD
107 . = ALIGN(256); 128 . = ALIGN(0x100);
108 __initramfs_start = .; 129 .init.ramfs : {
109 .init.ramfs : { *(.init.initramfs) } 130 __initramfs_start = .;
110 . = ALIGN(2); 131 *(.init.ramfs)
111 __initramfs_end = .; 132 . = ALIGN(2);
133 __initramfs_end = .;
134 }
112#endif 135#endif
113 PERCPU(4096) 136
114 . = ALIGN(4096); 137 PERCPU(PAGE_SIZE)
115 __init_end = .; 138 . = ALIGN(PAGE_SIZE);
116 /* freed after init ends here */ 139 __init_end = .; /* freed after init ends here */
117 140
118 __bss_start = .; /* BSS */ 141 /* BSS */
119 .bss : { *(.bss) } 142 .bss : {
120 . = ALIGN(2); 143 __bss_start = .;
121 __bss_stop = .; 144 *(.bss)
122 145 . = ALIGN(2);
123 _end = . ; 146 __bss_stop = .;
124 147 }
125 /* Sections to be discarded */ 148
126 /DISCARD/ : { 149 _end = . ;
127 *(.exit.data) *(.exitcall.exit) 150
128 } 151 /* Sections to be discarded */
129 152 /DISCARD/ : {
130 /* Stabs debugging sections. */ 153 *(.exit.data)
131 .stab 0 : { *(.stab) } 154 *(.exitcall.exit)
132 .stabstr 0 : { *(.stabstr) } 155 }
133 .stab.excl 0 : { *(.stab.excl) } 156
134 .stab.exclstr 0 : { *(.stab.exclstr) } 157 /* Debugging sections. */
135 .stab.index 0 : { *(.stab.index) } 158 STABS_DEBUG
136 .stab.indexstr 0 : { *(.stab.indexstr) } 159 DWARF_DEBUG
137 .comment 0 : { *(.comment) }
138} 160}
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 54055194e9af..4c1ac341ec80 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -468,7 +468,7 @@ typedef struct {
468 __u64 refselmk; 468 __u64 refselmk;
469 __u64 refcmpmk; 469 __u64 refcmpmk;
470 __u64 reserved; 470 __u64 reserved;
471} __attribute__ ((packed)) pfault_refbk_t; 471} __attribute__ ((packed, aligned(8))) pfault_refbk_t;
472 472
473int pfault_init(void) 473int pfault_init(void)
474{ 474{
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 03404987528d..4b49d03ffbd2 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -245,7 +245,6 @@ asmlinkage void do_softirq(void)
245 245
246 local_irq_restore(flags); 246 local_irq_restore(flags);
247} 247}
248EXPORT_SYMBOL(do_softirq);
249#endif 248#endif
250 249
251void __init init_IRQ(void) 250void __init init_IRQ(void)
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c
index 2f61c4b12596..c76bfbb7da08 100644
--- a/arch/sparc64/kernel/pci_common.c
+++ b/arch/sparc64/kernel/pci_common.c
@@ -264,7 +264,7 @@ static int sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
264 unsigned int func = PCI_FUNC(devfn); 264 unsigned int func = PCI_FUNC(devfn);
265 unsigned long ret; 265 unsigned long ret;
266 266
267 if (bus_dev == pbm->pci_bus && devfn == 0x00) 267 if (!bus && devfn == 0x00)
268 return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where, 268 return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
269 size, value); 269 size, value);
270 if (config_out_of_range(pbm, bus, devfn, where)) { 270 if (config_out_of_range(pbm, bus, devfn, where)) {
@@ -300,7 +300,7 @@ static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
300 unsigned int func = PCI_FUNC(devfn); 300 unsigned int func = PCI_FUNC(devfn);
301 unsigned long ret; 301 unsigned long ret;
302 302
303 if (bus_dev == pbm->pci_bus && devfn == 0x00) 303 if (!bus && devfn == 0x00)
304 return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where, 304 return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
305 size, value); 305 size, value);
306 if (config_out_of_range(pbm, bus, devfn, where)) { 306 if (config_out_of_range(pbm, bus, devfn, where)) {
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c
index 0614dff63d7c..a246e962e5a7 100644
--- a/arch/sparc64/kernel/prom.c
+++ b/arch/sparc64/kernel/prom.c
@@ -1046,7 +1046,8 @@ static void __init irq_trans_init(struct device_node *dp)
1046 if (!strcmp(dp->name, "fhc") && 1046 if (!strcmp(dp->name, "fhc") &&
1047 !strcmp(dp->parent->name, "central")) 1047 !strcmp(dp->parent->name, "central"))
1048 return central_irq_trans_init(dp); 1048 return central_irq_trans_init(dp);
1049 if (!strcmp(dp->name, "virtual-devices")) 1049 if (!strcmp(dp->name, "virtual-devices") ||
1050 !strcmp(dp->name, "niu"))
1050 return sun4v_vdev_irq_trans_init(dp); 1051 return sun4v_vdev_irq_trans_init(dp);
1051} 1052}
1052 1053
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index b84c49e3697c..c73b7a48b036 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -353,6 +353,8 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu)
353 int timeout, ret; 353 int timeout, ret;
354 354
355 p = fork_idle(cpu); 355 p = fork_idle(cpu);
356 if (IS_ERR(p))
357 return PTR_ERR(p);
356 callin_flag = 0; 358 callin_flag = 0;
357 cpu_new_thread = task_thread_info(p); 359 cpu_new_thread = task_thread_info(p);
358 360
diff --git a/arch/sparc64/kernel/vio.c b/arch/sparc64/kernel/vio.c
index 1550ac5673da..0c1ee619d814 100644
--- a/arch/sparc64/kernel/vio.c
+++ b/arch/sparc64/kernel/vio.c
@@ -292,7 +292,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
292 } 292 }
293 vdev->dp = dp; 293 vdev->dp = dp;
294 294
295 printk(KERN_ERR "VIO: Adding device %s\n", vdev->dev.bus_id); 295 printk(KERN_INFO "VIO: Adding device %s\n", vdev->dev.bus_id);
296 296
297 err = device_register(&vdev->dev); 297 err = device_register(&vdev->dev);
298 if (err) { 298 if (err) {
@@ -342,8 +342,33 @@ static struct mdesc_notifier_client vio_device_notifier = {
342 .node_name = "virtual-device-port", 342 .node_name = "virtual-device-port",
343}; 343};
344 344
345/* We are only interested in domain service ports under the
346 * "domain-services" node. On control nodes there is another port
347 * under "openboot" that we should not mess with as aparently that is
348 * reserved exclusively for OBP use.
349 */
350static void vio_add_ds(struct mdesc_handle *hp, u64 node)
351{
352 int found;
353 u64 a;
354
355 found = 0;
356 mdesc_for_each_arc(a, hp, node, MDESC_ARC_TYPE_BACK) {
357 u64 target = mdesc_arc_target(hp, a);
358 const char *name = mdesc_node_name(hp, target);
359
360 if (!strcmp(name, "domain-services")) {
361 found = 1;
362 break;
363 }
364 }
365
366 if (found)
367 (void) vio_create_one(hp, node, &root_vdev->dev);
368}
369
345static struct mdesc_notifier_client vio_ds_notifier = { 370static struct mdesc_notifier_client vio_ds_notifier = {
346 .add = vio_add, 371 .add = vio_add_ds,
347 .remove = vio_remove, 372 .remove = vio_remove,
348 .node_name = "domain-services-port", 373 .node_name = "domain-services-port",
349}; 374};
diff --git a/arch/sparc64/lib/NGmemcpy.S b/arch/sparc64/lib/NGmemcpy.S
index 605cb3f09900..96a14caf6966 100644
--- a/arch/sparc64/lib/NGmemcpy.S
+++ b/arch/sparc64/lib/NGmemcpy.S
@@ -321,11 +321,11 @@ FUNC_NAME: /* %i0=dst, %i1=src, %i2=len */
321 andn %i2, 0xf, %i4 321 andn %i2, 0xf, %i4
322 and %i2, 0xf, %i2 322 and %i2, 0xf, %i2
3231: subcc %i4, 0x10, %i4 3231: subcc %i4, 0x10, %i4
324 EX_LD(LOAD(ldx, %i1, %i5)) 324 EX_LD(LOAD(ldx, %i1, %o4))
325 add %i1, 0x08, %i1 325 add %i1, 0x08, %i1
326 EX_LD(LOAD(ldx, %i1, %g1)) 326 EX_LD(LOAD(ldx, %i1, %g1))
327 sub %i1, 0x08, %i1 327 sub %i1, 0x08, %i1
328 EX_ST(STORE(stx, %i5, %i1 + %i3)) 328 EX_ST(STORE(stx, %o4, %i1 + %i3))
329 add %i1, 0x8, %i1 329 add %i1, 0x8, %i1
330 EX_ST(STORE(stx, %g1, %i1 + %i3)) 330 EX_ST(STORE(stx, %g1, %i1 + %i3))
331 bgu,pt %XCC, 1b 331 bgu,pt %XCC, 1b
@@ -334,8 +334,8 @@ FUNC_NAME: /* %i0=dst, %i1=src, %i2=len */
334 be,pt %XCC, 1f 334 be,pt %XCC, 1f
335 nop 335 nop
336 sub %i2, 0x8, %i2 336 sub %i2, 0x8, %i2
337 EX_LD(LOAD(ldx, %i1, %i5)) 337 EX_LD(LOAD(ldx, %i1, %o4))
338 EX_ST(STORE(stx, %i5, %i1 + %i3)) 338 EX_ST(STORE(stx, %o4, %i1 + %i3))
339 add %i1, 0x8, %i1 339 add %i1, 0x8, %i1
3401: andcc %i2, 0x4, %g0 3401: andcc %i2, 0x4, %g0
341 be,pt %XCC, 1f 341 be,pt %XCC, 1f
diff --git a/arch/sparc64/solaris/ioctl.c b/arch/sparc64/solaris/ioctl.c
index 18352a498628..8ad10a6d993b 100644
--- a/arch/sparc64/solaris/ioctl.c
+++ b/arch/sparc64/solaris/ioctl.c
@@ -28,6 +28,7 @@
28#include <linux/compat.h> 28#include <linux/compat.h>
29 29
30#include <net/sock.h> 30#include <net/sock.h>
31#include <net/net_namespace.h>
31 32
32#include <asm/uaccess.h> 33#include <asm/uaccess.h>
33#include <asm/termios.h> 34#include <asm/termios.h>
@@ -686,7 +687,7 @@ static inline int solaris_i(unsigned int fd, unsigned int cmd, u32 arg)
686 int i = 0; 687 int i = 0;
687 688
688 read_lock_bh(&dev_base_lock); 689 read_lock_bh(&dev_base_lock);
689 for_each_netdev(d) 690 for_each_netdev(&init_net, d)
690 i++; 691 i++;
691 read_unlock_bh(&dev_base_lock); 692 read_unlock_bh(&dev_base_lock);
692 693
diff --git a/arch/um/sys-i386/sys_call_table.S b/arch/um/sys-i386/sys_call_table.S
index 2497554b7b95..12d4148dba39 100644
--- a/arch/um/sys-i386/sys_call_table.S
+++ b/arch/um/sys-i386/sys_call_table.S
@@ -9,4 +9,4 @@
9 9
10#define old_mmap old_mmap_i386 10#define old_mmap old_mmap_i386
11 11
12#include "../../i386/kernel/syscall_table.S" 12#include "../../x86/kernel/syscall_table_32.S"
diff --git a/arch/um/sys-x86_64/syscall_table.c b/arch/um/sys-x86_64/syscall_table.c
index 5133988d3610..71b2ae4ad5de 100644
--- a/arch/um/sys-x86_64/syscall_table.c
+++ b/arch/um/sys-x86_64/syscall_table.c
@@ -36,7 +36,7 @@
36 36
37#define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; 37#define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ;
38#undef _ASM_X86_64_UNISTD_H_ 38#undef _ASM_X86_64_UNISTD_H_
39#include <asm-x86_64/unistd.h> 39#include <asm-x86/unistd_64.h>
40 40
41#undef __SYSCALL 41#undef __SYSCALL
42#define __SYSCALL(nr, sym) [ nr ] = sym, 42#define __SYSCALL(nr, sym) [ nr ] = sym,
@@ -49,5 +49,5 @@ extern void sys_ni_syscall(void);
49sys_call_ptr_t sys_call_table[UM_NR_syscall_max+1] __cacheline_aligned = { 49sys_call_ptr_t sys_call_table[UM_NR_syscall_max+1] __cacheline_aligned = {
50 /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ 50 /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */
51 [0 ... UM_NR_syscall_max] = &sys_ni_syscall, 51 [0 ... UM_NR_syscall_max] = &sys_ni_syscall,
52#include <asm-x86_64/unistd.h> 52#include <asm-x86/unistd_64.h>
53}; 53};
diff --git a/arch/i386/boot/.gitignore b/arch/x86/boot/.gitignore
index 18465143cfa2..18465143cfa2 100644
--- a/arch/i386/boot/.gitignore
+++ b/arch/x86/boot/.gitignore
diff --git a/arch/i386/boot/Makefile b/arch/x86/boot/Makefile
index 93386a4e40b4..cb1035f2b7e9 100644
--- a/arch/i386/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -1,5 +1,5 @@
1# 1#
2# arch/i386/boot/Makefile 2# arch/x86/boot/Makefile
3# 3#
4# This file is subject to the terms and conditions of the GNU General Public 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 5# License. See the file "COPYING" in the main directory of this archive
diff --git a/arch/i386/boot/a20.c b/arch/x86/boot/a20.c
index 31348d054fca..31348d054fca 100644
--- a/arch/i386/boot/a20.c
+++ b/arch/x86/boot/a20.c
diff --git a/arch/i386/boot/apm.c b/arch/x86/boot/apm.c
index eab50c55a3a5..eab50c55a3a5 100644
--- a/arch/i386/boot/apm.c
+++ b/arch/x86/boot/apm.c
diff --git a/arch/i386/boot/bitops.h b/arch/x86/boot/bitops.h
index 8dcc8dc7db88..8dcc8dc7db88 100644
--- a/arch/i386/boot/bitops.h
+++ b/arch/x86/boot/bitops.h
diff --git a/arch/i386/boot/boot.h b/arch/x86/boot/boot.h
index 20bab9431acb..20bab9431acb 100644
--- a/arch/i386/boot/boot.h
+++ b/arch/x86/boot/boot.h
diff --git a/arch/i386/boot/cmdline.c b/arch/x86/boot/cmdline.c
index 34bb778c4357..34bb778c4357 100644
--- a/arch/i386/boot/cmdline.c
+++ b/arch/x86/boot/cmdline.c
diff --git a/arch/i386/boot/code16gcc.h b/arch/x86/boot/code16gcc.h
index d93e48010b61..d93e48010b61 100644
--- a/arch/i386/boot/code16gcc.h
+++ b/arch/x86/boot/code16gcc.h
diff --git a/arch/i386/boot/compressed/.gitignore b/arch/x86/boot/compressed/.gitignore
index be0ed065249b..be0ed065249b 100644
--- a/arch/i386/boot/compressed/.gitignore
+++ b/arch/x86/boot/compressed/.gitignore
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
new file mode 100644
index 000000000000..52c1db854520
--- /dev/null
+++ b/arch/x86/boot/compressed/Makefile
@@ -0,0 +1,5 @@
1ifeq ($(CONFIG_X86_32),y)
2include ${srctree}/arch/x86/boot/compressed/Makefile_32
3else
4include ${srctree}/arch/x86/boot/compressed/Makefile_64
5endif
diff --git a/arch/i386/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile_32
index 189fa1dbefcc..22613c652d22 100644
--- a/arch/i386/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile_32
@@ -1,10 +1,10 @@
1# 1#
2# linux/arch/i386/boot/compressed/Makefile 2# linux/arch/x86/boot/compressed/Makefile
3# 3#
4# create a compressed vmlinux image from the original vmlinux 4# create a compressed vmlinux image from the original vmlinux
5# 5#
6 6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o \ 7targets := vmlinux vmlinux.bin vmlinux.bin.gz head_32.o misc_32.o piggy.o \
8 vmlinux.bin.all vmlinux.relocs 8 vmlinux.bin.all vmlinux.relocs
9EXTRA_AFLAGS := -traditional 9EXTRA_AFLAGS := -traditional
10 10
@@ -17,7 +17,7 @@ CFLAGS := -m32 -D__KERNEL__ $(LINUX_INCLUDE) -O2 \
17 $(call cc-option,-fno-stack-protector) 17 $(call cc-option,-fno-stack-protector)
18LDFLAGS := -m elf_i386 18LDFLAGS := -m elf_i386
19 19
20$(obj)/vmlinux: $(src)/vmlinux.lds $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE 20$(obj)/vmlinux: $(src)/vmlinux_32.lds $(obj)/head_32.o $(obj)/misc_32.o $(obj)/piggy.o FORCE
21 $(call if_changed,ld) 21 $(call if_changed,ld)
22 @: 22 @:
23 23
@@ -46,5 +46,5 @@ endif
46 46
47LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T 47LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
48 48
49$(obj)/piggy.o: $(src)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE 49$(obj)/piggy.o: $(src)/vmlinux_32.scr $(obj)/vmlinux.bin.gz FORCE
50 $(call if_changed,ld) 50 $(call if_changed,ld)
diff --git a/arch/x86_64/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile_64
index 877c0bdbbc67..dc6b3380cc45 100644
--- a/arch/x86_64/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile_64
@@ -1,10 +1,10 @@
1# 1#
2# linux/arch/x86_64/boot/compressed/Makefile 2# linux/arch/x86/boot/compressed/Makefile
3# 3#
4# create a compressed vmlinux image from the original vmlinux 4# create a compressed vmlinux image from the original vmlinux
5# 5#
6 6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o 7targets := vmlinux vmlinux.bin vmlinux.bin.gz head_64.o misc_64.o piggy.o
8 8
9CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2 \ 9CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2 \
10 -fno-strict-aliasing -fPIC -mcmodel=small \ 10 -fno-strict-aliasing -fPIC -mcmodel=small \
@@ -14,7 +14,7 @@ AFLAGS := $(CFLAGS) -D__ASSEMBLY__
14LDFLAGS := -m elf_x86_64 14LDFLAGS := -m elf_x86_64
15 15
16LDFLAGS_vmlinux := -T 16LDFLAGS_vmlinux := -T
17$(obj)/vmlinux: $(src)/vmlinux.lds $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE 17$(obj)/vmlinux: $(src)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o $(obj)/piggy.o FORCE
18 $(call if_changed,ld) 18 $(call if_changed,ld)
19 @: 19 @:
20 20
@@ -26,5 +26,5 @@ $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
26 26
27LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T 27LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T
28 28
29$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE 29$(obj)/piggy.o: $(obj)/vmlinux_64.scr $(obj)/vmlinux.bin.gz FORCE
30 $(call if_changed,ld) 30 $(call if_changed,ld)
diff --git a/arch/i386/boot/compressed/head.S b/arch/x86/boot/compressed/head_32.S
index f35ea2237522..f35ea2237522 100644
--- a/arch/i386/boot/compressed/head.S
+++ b/arch/x86/boot/compressed/head_32.S
diff --git a/arch/x86_64/boot/compressed/head.S b/arch/x86/boot/compressed/head_64.S
index 9fd8030cc54f..49467640751f 100644
--- a/arch/x86_64/boot/compressed/head.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -174,7 +174,7 @@ no_longmode:
174 hlt 174 hlt
175 jmp 1b 175 jmp 1b
176 176
177#include "../../kernel/verify_cpu.S" 177#include "../../kernel/verify_cpu_64.S"
178 178
179 /* Be careful here startup_64 needs to be at a predictable 179 /* Be careful here startup_64 needs to be at a predictable
180 * address so I can export it in an ELF header. Bootloaders 180 * address so I can export it in an ELF header. Bootloaders
diff --git a/arch/i386/boot/compressed/misc.c b/arch/x86/boot/compressed/misc_32.c
index b28505c544c9..b28505c544c9 100644
--- a/arch/i386/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc_32.c
diff --git a/arch/x86_64/boot/compressed/misc.c b/arch/x86/boot/compressed/misc_64.c
index f932b0e89096..f932b0e89096 100644
--- a/arch/x86_64/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc_64.c
diff --git a/arch/i386/boot/compressed/relocs.c b/arch/x86/boot/compressed/relocs.c
index 2d77ee728f92..2d77ee728f92 100644
--- a/arch/i386/boot/compressed/relocs.c
+++ b/arch/x86/boot/compressed/relocs.c
diff --git a/arch/i386/boot/compressed/vmlinux.lds b/arch/x86/boot/compressed/vmlinux_32.lds
index cc4854f6c6c1..cc4854f6c6c1 100644
--- a/arch/i386/boot/compressed/vmlinux.lds
+++ b/arch/x86/boot/compressed/vmlinux_32.lds
diff --git a/arch/i386/boot/compressed/vmlinux.scr b/arch/x86/boot/compressed/vmlinux_32.scr
index 707a88f7f29e..707a88f7f29e 100644
--- a/arch/i386/boot/compressed/vmlinux.scr
+++ b/arch/x86/boot/compressed/vmlinux_32.scr
diff --git a/arch/x86_64/boot/compressed/vmlinux.lds b/arch/x86/boot/compressed/vmlinux_64.lds
index 94c13e557fb4..94c13e557fb4 100644
--- a/arch/x86_64/boot/compressed/vmlinux.lds
+++ b/arch/x86/boot/compressed/vmlinux_64.lds
diff --git a/arch/x86_64/boot/compressed/vmlinux.scr b/arch/x86/boot/compressed/vmlinux_64.scr
index bd1429ce193e..bd1429ce193e 100644
--- a/arch/x86_64/boot/compressed/vmlinux.scr
+++ b/arch/x86/boot/compressed/vmlinux_64.scr
diff --git a/arch/i386/boot/copy.S b/arch/x86/boot/copy.S
index ef127e56a3cf..ef127e56a3cf 100644
--- a/arch/i386/boot/copy.S
+++ b/arch/x86/boot/copy.S
diff --git a/arch/i386/boot/cpu.c b/arch/x86/boot/cpu.c
index 2a5c32da5852..2a5c32da5852 100644
--- a/arch/i386/boot/cpu.c
+++ b/arch/x86/boot/cpu.c
diff --git a/arch/i386/boot/cpucheck.c b/arch/x86/boot/cpucheck.c
index e655a89c5510..e655a89c5510 100644
--- a/arch/i386/boot/cpucheck.c
+++ b/arch/x86/boot/cpucheck.c
diff --git a/arch/i386/boot/edd.c b/arch/x86/boot/edd.c
index bd138e442ec2..bd138e442ec2 100644
--- a/arch/i386/boot/edd.c
+++ b/arch/x86/boot/edd.c
diff --git a/arch/i386/boot/header.S b/arch/x86/boot/header.S
index f3140e596d40..f3140e596d40 100644
--- a/arch/i386/boot/header.S
+++ b/arch/x86/boot/header.S
diff --git a/arch/i386/boot/install.sh b/arch/x86/boot/install.sh
index 88d77761d01b..88d77761d01b 100644
--- a/arch/i386/boot/install.sh
+++ b/arch/x86/boot/install.sh
diff --git a/arch/i386/boot/main.c b/arch/x86/boot/main.c
index 0eeef3989a17..0eeef3989a17 100644
--- a/arch/i386/boot/main.c
+++ b/arch/x86/boot/main.c
diff --git a/arch/i386/boot/mca.c b/arch/x86/boot/mca.c
index 68222f2d4b67..68222f2d4b67 100644
--- a/arch/i386/boot/mca.c
+++ b/arch/x86/boot/mca.c
diff --git a/arch/i386/boot/memory.c b/arch/x86/boot/memory.c
index 378353956b5d..378353956b5d 100644
--- a/arch/i386/boot/memory.c
+++ b/arch/x86/boot/memory.c
diff --git a/arch/i386/boot/mtools.conf.in b/arch/x86/boot/mtools.conf.in
index efd6d2490c1d..efd6d2490c1d 100644
--- a/arch/i386/boot/mtools.conf.in
+++ b/arch/x86/boot/mtools.conf.in
diff --git a/arch/i386/boot/pm.c b/arch/x86/boot/pm.c
index 09fb342cc62e..09fb342cc62e 100644
--- a/arch/i386/boot/pm.c
+++ b/arch/x86/boot/pm.c
diff --git a/arch/i386/boot/pmjump.S b/arch/x86/boot/pmjump.S
index 2e559233725a..2e559233725a 100644
--- a/arch/i386/boot/pmjump.S
+++ b/arch/x86/boot/pmjump.S
diff --git a/arch/i386/boot/printf.c b/arch/x86/boot/printf.c
index 1a09f9309d3c..1a09f9309d3c 100644
--- a/arch/i386/boot/printf.c
+++ b/arch/x86/boot/printf.c
diff --git a/arch/i386/boot/setup.ld b/arch/x86/boot/setup.ld
index df9234b3a5e0..df9234b3a5e0 100644
--- a/arch/i386/boot/setup.ld
+++ b/arch/x86/boot/setup.ld
diff --git a/arch/i386/boot/string.c b/arch/x86/boot/string.c
index 481a22097781..481a22097781 100644
--- a/arch/i386/boot/string.c
+++ b/arch/x86/boot/string.c
diff --git a/arch/i386/boot/tools/.gitignore b/arch/x86/boot/tools/.gitignore
index 378eac25d311..378eac25d311 100644
--- a/arch/i386/boot/tools/.gitignore
+++ b/arch/x86/boot/tools/.gitignore
diff --git a/arch/i386/boot/tools/build.c b/arch/x86/boot/tools/build.c
index b4248740ff0d..b4248740ff0d 100644
--- a/arch/i386/boot/tools/build.c
+++ b/arch/x86/boot/tools/build.c
diff --git a/arch/i386/boot/tty.c b/arch/x86/boot/tty.c
index f3f14bd26371..f3f14bd26371 100644
--- a/arch/i386/boot/tty.c
+++ b/arch/x86/boot/tty.c
diff --git a/arch/i386/boot/version.c b/arch/x86/boot/version.c
index c61462f7d9a7..c61462f7d9a7 100644
--- a/arch/i386/boot/version.c
+++ b/arch/x86/boot/version.c
diff --git a/arch/i386/boot/vesa.h b/arch/x86/boot/vesa.h
index ff5b73cd406f..ff5b73cd406f 100644
--- a/arch/i386/boot/vesa.h
+++ b/arch/x86/boot/vesa.h
diff --git a/arch/i386/boot/video-bios.c b/arch/x86/boot/video-bios.c
index 68e65d95cdfd..68e65d95cdfd 100644
--- a/arch/i386/boot/video-bios.c
+++ b/arch/x86/boot/video-bios.c
diff --git a/arch/i386/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
index 192190710710..192190710710 100644
--- a/arch/i386/boot/video-vesa.c
+++ b/arch/x86/boot/video-vesa.c
diff --git a/arch/i386/boot/video-vga.c b/arch/x86/boot/video-vga.c
index aef02f9ec0c1..aef02f9ec0c1 100644
--- a/arch/i386/boot/video-vga.c
+++ b/arch/x86/boot/video-vga.c
diff --git a/arch/i386/boot/video.c b/arch/x86/boot/video.c
index e4ba897bf9a3..e4ba897bf9a3 100644
--- a/arch/i386/boot/video.c
+++ b/arch/x86/boot/video.c
diff --git a/arch/i386/boot/video.h b/arch/x86/boot/video.h
index b92447d51213..b92447d51213 100644
--- a/arch/i386/boot/video.h
+++ b/arch/x86/boot/video.h
diff --git a/arch/i386/boot/voyager.c b/arch/x86/boot/voyager.c
index 61c8fe0453be..61c8fe0453be 100644
--- a/arch/i386/boot/voyager.c
+++ b/arch/x86/boot/voyager.c
diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile
new file mode 100644
index 000000000000..18dcdc6fb7aa
--- /dev/null
+++ b/arch/x86/crypto/Makefile
@@ -0,0 +1,5 @@
1ifeq ($(CONFIG_X86_32),y)
2include ${srctree}/arch/x86/crypto/Makefile_32
3else
4include ${srctree}/arch/x86/crypto/Makefile_64
5endif
diff --git a/arch/i386/crypto/Makefile b/arch/x86/crypto/Makefile_32
index 3fd19af18e34..2d873a2388ed 100644
--- a/arch/i386/crypto/Makefile
+++ b/arch/x86/crypto/Makefile_32
@@ -1,5 +1,5 @@
1# 1#
2# i386/crypto/Makefile 2# x86/crypto/Makefile
3# 3#
4# Arch-specific CryptoAPI modules. 4# Arch-specific CryptoAPI modules.
5# 5#
@@ -7,6 +7,6 @@
7obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o 7obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o
8obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o 8obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o
9 9
10aes-i586-y := aes-i586-asm.o aes.o 10aes-i586-y := aes-i586-asm_32.o aes_32.o
11twofish-i586-y := twofish-i586-asm.o twofish.o 11twofish-i586-y := twofish-i586-asm_32.o twofish_32.o
12 12
diff --git a/arch/x86_64/crypto/Makefile b/arch/x86/crypto/Makefile_64
index 15b538a8b7f7..b40896276e93 100644
--- a/arch/x86_64/crypto/Makefile
+++ b/arch/x86/crypto/Makefile_64
@@ -1,5 +1,5 @@
1# 1#
2# x86_64/crypto/Makefile 2# x86/crypto/Makefile
3# 3#
4# Arch-specific CryptoAPI modules. 4# Arch-specific CryptoAPI modules.
5# 5#
@@ -7,6 +7,6 @@
7obj-$(CONFIG_CRYPTO_AES_X86_64) += aes-x86_64.o 7obj-$(CONFIG_CRYPTO_AES_X86_64) += aes-x86_64.o
8obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o 8obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o
9 9
10aes-x86_64-y := aes-x86_64-asm.o aes.o 10aes-x86_64-y := aes-x86_64-asm_64.o aes_64.o
11twofish-x86_64-y := twofish-x86_64-asm.o twofish.o 11twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_64.o
12 12
diff --git a/arch/i386/crypto/aes-i586-asm.S b/arch/x86/crypto/aes-i586-asm_32.S
index f942f0c8f630..f942f0c8f630 100644
--- a/arch/i386/crypto/aes-i586-asm.S
+++ b/arch/x86/crypto/aes-i586-asm_32.S
diff --git a/arch/x86_64/crypto/aes-x86_64-asm.S b/arch/x86/crypto/aes-x86_64-asm_64.S
index 26b40de4d0b0..26b40de4d0b0 100644
--- a/arch/x86_64/crypto/aes-x86_64-asm.S
+++ b/arch/x86/crypto/aes-x86_64-asm_64.S
diff --git a/arch/i386/crypto/aes.c b/arch/x86/crypto/aes_32.c
index 49aad9397f10..49aad9397f10 100644
--- a/arch/i386/crypto/aes.c
+++ b/arch/x86/crypto/aes_32.c
diff --git a/arch/x86_64/crypto/aes.c b/arch/x86/crypto/aes_64.c
index 5cdb13ea5cc2..5cdb13ea5cc2 100644
--- a/arch/x86_64/crypto/aes.c
+++ b/arch/x86/crypto/aes_64.c
diff --git a/arch/i386/crypto/twofish-i586-asm.S b/arch/x86/crypto/twofish-i586-asm_32.S
index 39b98ed2c1b9..39b98ed2c1b9 100644
--- a/arch/i386/crypto/twofish-i586-asm.S
+++ b/arch/x86/crypto/twofish-i586-asm_32.S
diff --git a/arch/x86_64/crypto/twofish-x86_64-asm.S b/arch/x86/crypto/twofish-x86_64-asm_64.S
index 35974a586615..35974a586615 100644
--- a/arch/x86_64/crypto/twofish-x86_64-asm.S
+++ b/arch/x86/crypto/twofish-x86_64-asm_64.S
diff --git a/arch/i386/crypto/twofish.c b/arch/x86/crypto/twofish_32.c
index e3004dfe9c7a..e3004dfe9c7a 100644
--- a/arch/i386/crypto/twofish.c
+++ b/arch/x86/crypto/twofish_32.c
diff --git a/arch/x86_64/crypto/twofish.c b/arch/x86/crypto/twofish_64.c
index 182d91d5cfb9..182d91d5cfb9 100644
--- a/arch/x86_64/crypto/twofish.c
+++ b/arch/x86/crypto/twofish_64.c
diff --git a/arch/x86_64/ia32/Makefile b/arch/x86/ia32/Makefile
index cdae36435e21..cdae36435e21 100644
--- a/arch/x86_64/ia32/Makefile
+++ b/arch/x86/ia32/Makefile
diff --git a/arch/x86_64/ia32/audit.c b/arch/x86/ia32/audit.c
index 8850fe40ea34..91b7b5922dfa 100644
--- a/arch/x86_64/ia32/audit.c
+++ b/arch/x86/ia32/audit.c
@@ -1,4 +1,4 @@
1#include <asm-i386/unistd.h> 1#include <asm/unistd_32.h>
2 2
3unsigned ia32_dir_class[] = { 3unsigned ia32_dir_class[] = {
4#include <asm-generic/audit_dir_write.h> 4#include <asm-generic/audit_dir_write.h>
diff --git a/arch/x86_64/ia32/fpu32.c b/arch/x86/ia32/fpu32.c
index 2c8209a3605a..2c8209a3605a 100644
--- a/arch/x86_64/ia32/fpu32.c
+++ b/arch/x86/ia32/fpu32.c
diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
index 08781370256d..08781370256d 100644
--- a/arch/x86_64/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86/ia32/ia32_binfmt.c
index dffd2ac72747..dffd2ac72747 100644
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86/ia32/ia32_binfmt.c
diff --git a/arch/x86_64/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index 6ea19c25f90d..6ea19c25f90d 100644
--- a/arch/x86_64/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 18b231810908..18b231810908 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
diff --git a/arch/x86_64/ia32/ipc32.c b/arch/x86/ia32/ipc32.c
index 369151dc3213..2e1869ec4db4 100644
--- a/arch/x86_64/ia32/ipc32.c
+++ b/arch/x86/ia32/ipc32.c
@@ -9,7 +9,7 @@
9#include <linux/ipc.h> 9#include <linux/ipc.h>
10#include <linux/compat.h> 10#include <linux/compat.h>
11 11
12#include <asm-i386/ipc.h> 12#include <asm/ipc.h>
13 13
14asmlinkage long 14asmlinkage long
15sys32_ipc(u32 call, int first, int second, int third, 15sys32_ipc(u32 call, int first, int second, int third,
diff --git a/arch/x86_64/ia32/mmap32.c b/arch/x86/ia32/mmap32.c
index e4b84b4a417a..e4b84b4a417a 100644
--- a/arch/x86_64/ia32/mmap32.c
+++ b/arch/x86/ia32/mmap32.c
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86/ia32/ptrace32.c
index 4a233ad6269c..4a233ad6269c 100644
--- a/arch/x86_64/ia32/ptrace32.c
+++ b/arch/x86/ia32/ptrace32.c
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index bee96d614432..bee96d614432 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86/ia32/syscall32.c
index 15013bac181c..15013bac181c 100644
--- a/arch/x86_64/ia32/syscall32.c
+++ b/arch/x86/ia32/syscall32.c
diff --git a/arch/x86_64/ia32/syscall32_syscall.S b/arch/x86/ia32/syscall32_syscall.S
index 8f8271bdf135..933f0f08b1cf 100644
--- a/arch/x86_64/ia32/syscall32_syscall.S
+++ b/arch/x86/ia32/syscall32_syscall.S
@@ -6,12 +6,12 @@
6 .globl syscall32_syscall_end 6 .globl syscall32_syscall_end
7 7
8syscall32_syscall: 8syscall32_syscall:
9 .incbin "arch/x86_64/ia32/vsyscall-syscall.so" 9 .incbin "arch/x86/ia32/vsyscall-syscall.so"
10syscall32_syscall_end: 10syscall32_syscall_end:
11 11
12 .globl syscall32_sysenter 12 .globl syscall32_sysenter
13 .globl syscall32_sysenter_end 13 .globl syscall32_sysenter_end
14 14
15syscall32_sysenter: 15syscall32_sysenter:
16 .incbin "arch/x86_64/ia32/vsyscall-sysenter.so" 16 .incbin "arch/x86/ia32/vsyscall-sysenter.so"
17syscall32_sysenter_end: 17syscall32_sysenter_end:
diff --git a/arch/x86_64/ia32/tls32.c b/arch/x86/ia32/tls32.c
index 1cc4340de3ca..1cc4340de3ca 100644
--- a/arch/x86_64/ia32/tls32.c
+++ b/arch/x86/ia32/tls32.c
diff --git a/arch/x86_64/ia32/vsyscall-sigreturn.S b/arch/x86/ia32/vsyscall-sigreturn.S
index 1384367cdbe1..b383be00baec 100644
--- a/arch/x86_64/ia32/vsyscall-sigreturn.S
+++ b/arch/x86/ia32/vsyscall-sigreturn.S
@@ -139,5 +139,5 @@ __kernel_rt_sigreturn:
139 .align 4 139 .align 4
140.LENDFDE3: 140.LENDFDE3:
141 141
142#include "../../i386/kernel/vsyscall-note.S" 142#include "../../x86/kernel/vsyscall-note_32.S"
143 143
diff --git a/arch/x86_64/ia32/vsyscall-syscall.S b/arch/x86/ia32/vsyscall-syscall.S
index cf9ef678de3e..cf9ef678de3e 100644
--- a/arch/x86_64/ia32/vsyscall-syscall.S
+++ b/arch/x86/ia32/vsyscall-syscall.S
diff --git a/arch/x86_64/ia32/vsyscall-sysenter.S b/arch/x86/ia32/vsyscall-sysenter.S
index ae056e553d13..ae056e553d13 100644
--- a/arch/x86_64/ia32/vsyscall-sysenter.S
+++ b/arch/x86/ia32/vsyscall-sysenter.S
diff --git a/arch/x86_64/ia32/vsyscall.lds b/arch/x86/ia32/vsyscall.lds
index 1dc86ff5bcb9..1dc86ff5bcb9 100644
--- a/arch/x86_64/ia32/vsyscall.lds
+++ b/arch/x86/ia32/vsyscall.lds
diff --git a/arch/i386/kernel/.gitignore b/arch/x86/kernel/.gitignore
index 40836ad9079c..40836ad9079c 100644
--- a/arch/i386/kernel/.gitignore
+++ b/arch/x86/kernel/.gitignore
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
new file mode 100644
index 000000000000..45855c97923e
--- /dev/null
+++ b/arch/x86/kernel/Makefile
@@ -0,0 +1,5 @@
1ifeq ($(CONFIG_X86_32),y)
2include ${srctree}/arch/x86/kernel/Makefile_32
3else
4include ${srctree}/arch/x86/kernel/Makefile_64
5endif
diff --git a/arch/x86/kernel/Makefile_32 b/arch/x86/kernel/Makefile_32
new file mode 100644
index 000000000000..7ff02063b858
--- /dev/null
+++ b/arch/x86/kernel/Makefile_32
@@ -0,0 +1,86 @@
1#
2# Makefile for the linux kernel.
3#
4
5extra-y := head_32.o init_task_32.o vmlinux.lds
6
7obj-y := process_32.o signal_32.o entry_32.o traps_32.o irq_32.o \
8 ptrace_32.o time_32.o ioport_32.o ldt_32.o setup_32.o i8259_32.o sys_i386_32.o \
9 pci-dma_32.o i386_ksyms_32.o i387_32.o bootflag.o e820_32.o\
10 quirks.o i8237.o topology.o alternative.o i8253.o tsc_32.o
11
12obj-$(CONFIG_STACKTRACE) += stacktrace.o
13obj-y += cpu/
14obj-y += acpi/
15obj-$(CONFIG_X86_BIOS_REBOOT) += reboot_32.o
16obj-$(CONFIG_MCA) += mca_32.o
17obj-$(CONFIG_X86_MSR) += msr.o
18obj-$(CONFIG_X86_CPUID) += cpuid.o
19obj-$(CONFIG_MICROCODE) += microcode.o
20obj-$(CONFIG_APM) += apm_32.o
21obj-$(CONFIG_X86_SMP) += smp_32.o smpboot_32.o tsc_sync.o
22obj-$(CONFIG_SMP) += smpcommon_32.o
23obj-$(CONFIG_X86_TRAMPOLINE) += trampoline_32.o
24obj-$(CONFIG_X86_MPPARSE) += mpparse_32.o
25obj-$(CONFIG_X86_LOCAL_APIC) += apic_32.o nmi_32.o
26obj-$(CONFIG_X86_IO_APIC) += io_apic_32.o
27obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o
28obj-$(CONFIG_KEXEC) += machine_kexec_32.o relocate_kernel_32.o crash_32.o
29obj-$(CONFIG_CRASH_DUMP) += crash_dump_32.o
30obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
31obj-$(CONFIG_X86_SUMMIT_NUMA) += summit_32.o
32obj-$(CONFIG_KPROBES) += kprobes_32.o
33obj-$(CONFIG_MODULES) += module_32.o
34obj-y += sysenter_32.o vsyscall_32.o
35obj-$(CONFIG_ACPI_SRAT) += srat_32.o
36obj-$(CONFIG_EFI) += efi_32.o efi_stub_32.o
37obj-$(CONFIG_DOUBLEFAULT) += doublefault_32.o
38obj-$(CONFIG_VM86) += vm86_32.o
39obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
40obj-$(CONFIG_HPET_TIMER) += hpet.o
41obj-$(CONFIG_K8_NB) += k8.o
42obj-$(CONFIG_MGEODE_LX) += geode_32.o mfgpt_32.o
43
44obj-$(CONFIG_VMI) += vmi_32.o vmiclock_32.o
45obj-$(CONFIG_PARAVIRT) += paravirt_32.o
46obj-y += pcspeaker.o
47
48obj-$(CONFIG_SCx200) += scx200_32.o
49
50# vsyscall_32.o contains the vsyscall DSO images as __initdata.
51# We must build both images before we can assemble it.
52# Note: kbuild does not track this dependency due to usage of .incbin
53$(obj)/vsyscall_32.o: $(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter_32.so
54targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
55targets += vsyscall-note_32.o vsyscall_32.lds
56
57# The DSO images are built using a special linker script.
58quiet_cmd_syscall = SYSCALL $@
59 cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
60 -Wl,-T,$(filter-out FORCE,$^) -o $@
61
62export CPPFLAGS_vsyscall_32.lds += -P -C -U$(ARCH)
63
64vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
65 $(call ld-option, -Wl$(comma)--hash-style=sysv)
66SYSCFLAGS_vsyscall-sysenter_32.so = $(vsyscall-flags)
67SYSCFLAGS_vsyscall-int80_32.so = $(vsyscall-flags)
68
69$(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter_32.so: \
70$(obj)/vsyscall-%.so: $(src)/vsyscall_32.lds \
71 $(obj)/vsyscall-%.o $(obj)/vsyscall-note_32.o FORCE
72 $(call if_changed,syscall)
73
74# We also create a special relocatable object that should mirror the symbol
75# table and layout of the linked DSO. With ld -R we can then refer to
76# these symbols in the kernel code rather than hand-coded addresses.
77extra-y += vsyscall-syms.o
78$(obj)/built-in.o: $(obj)/vsyscall-syms.o
79$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
80
81SYSCFLAGS_vsyscall-syms.o = -r
82$(obj)/vsyscall-syms.o: $(src)/vsyscall_32.lds \
83 $(obj)/vsyscall-sysenter_32.o $(obj)/vsyscall-note_32.o FORCE
84 $(call if_changed,syscall)
85
86
diff --git a/arch/x86/kernel/Makefile_64 b/arch/x86/kernel/Makefile_64
new file mode 100644
index 000000000000..43da66213a47
--- /dev/null
+++ b/arch/x86/kernel/Makefile_64
@@ -0,0 +1,54 @@
1#
2# Makefile for the linux kernel.
3#
4
5extra-y := head_64.o head64.o init_task_64.o vmlinux.lds
6EXTRA_AFLAGS := -traditional
7obj-y := process_64.o signal_64.o entry_64.o traps_64.o irq_64.o \
8 ptrace_64.o time_64.o ioport_64.o ldt_64.o setup_64.o i8259_64.o sys_x86_64.o \
9 x8664_ksyms_64.o i387_64.o syscall_64.o vsyscall_64.o \
10 setup64.o bootflag.o e820_64.o reboot_64.o quirks.o i8237.o \
11 pci-dma_64.o pci-nommu_64.o alternative.o hpet.o tsc_64.o bugs_64.o \
12 perfctr-watchdog.o i8253.o
13
14obj-$(CONFIG_STACKTRACE) += stacktrace.o
15obj-$(CONFIG_X86_MCE) += mce_64.o therm_throt.o
16obj-$(CONFIG_X86_MCE_INTEL) += mce_intel_64.o
17obj-$(CONFIG_X86_MCE_AMD) += mce_amd_64.o
18obj-$(CONFIG_MTRR) += cpu/mtrr/
19obj-$(CONFIG_ACPI) += acpi/
20obj-$(CONFIG_X86_MSR) += msr.o
21obj-$(CONFIG_MICROCODE) += microcode.o
22obj-$(CONFIG_X86_CPUID) += cpuid.o
23obj-$(CONFIG_SMP) += smp_64.o smpboot_64.o trampoline_64.o tsc_sync.o
24obj-y += apic_64.o nmi_64.o
25obj-y += io_apic_64.o mpparse_64.o genapic_64.o genapic_flat_64.o
26obj-$(CONFIG_KEXEC) += machine_kexec_64.o relocate_kernel_64.o crash_64.o
27obj-$(CONFIG_CRASH_DUMP) += crash_dump_64.o
28obj-$(CONFIG_PM) += suspend_64.o
29obj-$(CONFIG_HIBERNATION) += suspend_asm_64.o
30obj-$(CONFIG_CPU_FREQ) += cpu/cpufreq/
31obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
32obj-$(CONFIG_IOMMU) += pci-gart_64.o aperture_64.o
33obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary_64.o tce_64.o
34obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o
35obj-$(CONFIG_KPROBES) += kprobes_64.o
36obj-$(CONFIG_X86_PM_TIMER) += pmtimer_64.o
37obj-$(CONFIG_X86_VSMP) += vsmp_64.o
38obj-$(CONFIG_K8_NB) += k8.o
39obj-$(CONFIG_AUDIT) += audit_64.o
40
41obj-$(CONFIG_MODULES) += module_64.o
42obj-$(CONFIG_PCI) += early-quirks_64.o
43
44obj-y += topology.o
45obj-y += intel_cacheinfo.o
46obj-y += addon_cpuid_features.o
47obj-y += pcspeaker.o
48
49CFLAGS_vsyscall_64.o := $(PROFILING) -g0
50
51therm_throt-y += cpu/mcheck/therm_throt.o
52intel_cacheinfo-y += cpu/intel_cacheinfo.o
53addon_cpuid_features-y += cpu/addon_cpuid_features.o
54perfctr-watchdog-y += cpu/perfctr-watchdog.o
diff --git a/arch/x86/kernel/acpi/Makefile b/arch/x86/kernel/acpi/Makefile
new file mode 100644
index 000000000000..3d5671939542
--- /dev/null
+++ b/arch/x86/kernel/acpi/Makefile
@@ -0,0 +1,5 @@
1ifeq ($(CONFIG_X86_32),y)
2include ${srctree}/arch/x86/kernel/acpi/Makefile_32
3else
4include ${srctree}/arch/x86/kernel/acpi/Makefile_64
5endif
diff --git a/arch/i386/kernel/acpi/Makefile b/arch/x86/kernel/acpi/Makefile_32
index 7f7be01f44e6..a4852a2e9190 100644
--- a/arch/i386/kernel/acpi/Makefile
+++ b/arch/x86/kernel/acpi/Makefile_32
@@ -1,8 +1,8 @@
1obj-$(CONFIG_ACPI) += boot.o 1obj-$(CONFIG_ACPI) += boot.o
2ifneq ($(CONFIG_PCI),) 2ifneq ($(CONFIG_PCI),)
3obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o 3obj-$(CONFIG_X86_IO_APIC) += earlyquirk_32.o
4endif 4endif
5obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o 5obj-$(CONFIG_ACPI_SLEEP) += sleep_32.o wakeup_32.o
6 6
7ifneq ($(CONFIG_ACPI_PROCESSOR),) 7ifneq ($(CONFIG_ACPI_PROCESSOR),)
8obj-y += cstate.o processor.o 8obj-y += cstate.o processor.o
diff --git a/arch/x86/kernel/acpi/Makefile_64 b/arch/x86/kernel/acpi/Makefile_64
new file mode 100644
index 000000000000..629425bc002d
--- /dev/null
+++ b/arch/x86/kernel/acpi/Makefile_64
@@ -0,0 +1,7 @@
1obj-y := boot.o
2obj-$(CONFIG_ACPI_SLEEP) += sleep_64.o wakeup_64.o
3
4ifneq ($(CONFIG_ACPI_PROCESSOR),)
5obj-y += processor.o cstate.o
6endif
7
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index cacdd883bf2b..afd2afe9102d 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -907,7 +907,7 @@ static void __init acpi_process_madt(void)
907 907
908#ifdef __i386__ 908#ifdef __i386__
909 909
910static int __init disable_acpi_irq(struct dmi_system_id *d) 910static int __init disable_acpi_irq(const struct dmi_system_id *d)
911{ 911{
912 if (!acpi_force) { 912 if (!acpi_force) {
913 printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n", 913 printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n",
@@ -917,7 +917,7 @@ static int __init disable_acpi_irq(struct dmi_system_id *d)
917 return 0; 917 return 0;
918} 918}
919 919
920static int __init disable_acpi_pci(struct dmi_system_id *d) 920static int __init disable_acpi_pci(const struct dmi_system_id *d)
921{ 921{
922 if (!acpi_force) { 922 if (!acpi_force) {
923 printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n", 923 printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n",
@@ -927,7 +927,7 @@ static int __init disable_acpi_pci(struct dmi_system_id *d)
927 return 0; 927 return 0;
928} 928}
929 929
930static int __init dmi_disable_acpi(struct dmi_system_id *d) 930static int __init dmi_disable_acpi(const struct dmi_system_id *d)
931{ 931{
932 if (!acpi_force) { 932 if (!acpi_force) {
933 printk(KERN_NOTICE "%s detected: acpi off\n", d->ident); 933 printk(KERN_NOTICE "%s detected: acpi off\n", d->ident);
@@ -942,7 +942,7 @@ static int __init dmi_disable_acpi(struct dmi_system_id *d)
942/* 942/*
943 * Limit ACPI to CPU enumeration for HT 943 * Limit ACPI to CPU enumeration for HT
944 */ 944 */
945static int __init force_acpi_ht(struct dmi_system_id *d) 945static int __init force_acpi_ht(const struct dmi_system_id *d)
946{ 946{
947 if (!acpi_force) { 947 if (!acpi_force) {
948 printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", 948 printk(KERN_NOTICE "%s detected: force use of acpi=ht\n",
diff --git a/arch/i386/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index 2d39f55d29a8..2d39f55d29a8 100644
--- a/arch/i386/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/x86/kernel/acpi/earlyquirk_32.c
index 23f78efc577d..23f78efc577d 100644
--- a/arch/i386/kernel/acpi/earlyquirk.c
+++ b/arch/x86/kernel/acpi/earlyquirk_32.c
diff --git a/arch/i386/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c
index b54fded49834..b54fded49834 100644
--- a/arch/i386/kernel/acpi/processor.c
+++ b/arch/x86/kernel/acpi/processor.c
diff --git a/arch/i386/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep_32.c
index c42b5ab49deb..10699489cfe7 100644
--- a/arch/i386/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep_32.c
@@ -84,7 +84,7 @@ __setup("acpi_sleep=", acpi_sleep_setup);
84 84
85/* Ouch, we want to delete this. We already have better version in userspace, in 85/* Ouch, we want to delete this. We already have better version in userspace, in
86 s2ram from suspend.sf.net project */ 86 s2ram from suspend.sf.net project */
87static __init int reset_videomode_after_s3(struct dmi_system_id *d) 87static __init int reset_videomode_after_s3(const struct dmi_system_id *d)
88{ 88{
89 acpi_realmode_flags |= 2; 89 acpi_realmode_flags |= 2;
90 return 0; 90 return 0;
diff --git a/arch/x86_64/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep_64.c
index 79475d237071..79475d237071 100644
--- a/arch/x86_64/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep_64.c
diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/x86/kernel/acpi/wakeup_32.S
index f22ba8534d26..f22ba8534d26 100644
--- a/arch/i386/kernel/acpi/wakeup.S
+++ b/arch/x86/kernel/acpi/wakeup_32.S
diff --git a/arch/x86_64/kernel/acpi/wakeup.S b/arch/x86/kernel/acpi/wakeup_64.S
index a06f2bcabef9..8b4357e1efe0 100644
--- a/arch/x86_64/kernel/acpi/wakeup.S
+++ b/arch/x86/kernel/acpi/wakeup_64.S
@@ -269,7 +269,7 @@ no_longmode:
269 movb $0xbc,%al ; outb %al,$0x80 269 movb $0xbc,%al ; outb %al,$0x80
270 jmp no_longmode 270 jmp no_longmode
271 271
272#include "../verify_cpu.S" 272#include "../verify_cpu_64.S"
273 273
274/* This code uses an extended set of video mode numbers. These include: 274/* This code uses an extended set of video mode numbers. These include:
275 * Aliases for standard modes 275 * Aliases for standard modes
diff --git a/arch/i386/kernel/alternative.c b/arch/x86/kernel/alternative.c
index bd72d94e713e..bd72d94e713e 100644
--- a/arch/i386/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
diff --git a/arch/x86_64/kernel/aperture.c b/arch/x86/kernel/aperture_64.c
index 8f681cae7bf7..8f681cae7bf7 100644
--- a/arch/x86_64/kernel/aperture.c
+++ b/arch/x86/kernel/aperture_64.c
diff --git a/arch/i386/kernel/apic.c b/arch/x86/kernel/apic_32.c
index 3d67ae18d762..3d67ae18d762 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/x86/kernel/apic_32.c
diff --git a/arch/x86_64/kernel/apic.c b/arch/x86/kernel/apic_64.c
index 925758dbca0c..395928de28ea 100644
--- a/arch/x86_64/kernel/apic.c
+++ b/arch/x86/kernel/apic_64.c
@@ -25,6 +25,7 @@
25#include <linux/sysdev.h> 25#include <linux/sysdev.h>
26#include <linux/module.h> 26#include <linux/module.h>
27#include <linux/ioport.h> 27#include <linux/ioport.h>
28#include <linux/clockchips.h>
28 29
29#include <asm/atomic.h> 30#include <asm/atomic.h>
30#include <asm/smp.h> 31#include <asm/smp.h>
@@ -39,12 +40,9 @@
39#include <asm/hpet.h> 40#include <asm/hpet.h>
40#include <asm/apic.h> 41#include <asm/apic.h>
41 42
42int apic_mapped;
43int apic_verbosity; 43int apic_verbosity;
44int apic_runs_main_timer; 44int disable_apic_timer __cpuinitdata;
45int apic_calibrate_pmtmr __initdata; 45static int apic_calibrate_pmtmr __initdata;
46
47int disable_apic_timer __initdata;
48 46
49/* Local APIC timer works in C2? */ 47/* Local APIC timer works in C2? */
50int local_apic_timer_c2_ok; 48int local_apic_timer_c2_ok;
@@ -56,14 +54,78 @@ static struct resource lapic_resource = {
56 .flags = IORESOURCE_MEM | IORESOURCE_BUSY, 54 .flags = IORESOURCE_MEM | IORESOURCE_BUSY,
57}; 55};
58 56
57static unsigned int calibration_result;
58
59static int lapic_next_event(unsigned long delta,
60 struct clock_event_device *evt);
61static void lapic_timer_setup(enum clock_event_mode mode,
62 struct clock_event_device *evt);
63
64static void lapic_timer_broadcast(cpumask_t mask);
65
66static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen);
67
68static struct clock_event_device lapic_clockevent = {
69 .name = "lapic",
70 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT
71 | CLOCK_EVT_FEAT_C3STOP | CLOCK_EVT_FEAT_DUMMY,
72 .shift = 32,
73 .set_mode = lapic_timer_setup,
74 .set_next_event = lapic_next_event,
75 .broadcast = lapic_timer_broadcast,
76 .rating = 100,
77 .irq = -1,
78};
79static DEFINE_PER_CPU(struct clock_event_device, lapic_events);
80
81static int lapic_next_event(unsigned long delta,
82 struct clock_event_device *evt)
83{
84 apic_write(APIC_TMICT, delta);
85 return 0;
86}
87
88static void lapic_timer_setup(enum clock_event_mode mode,
89 struct clock_event_device *evt)
90{
91 unsigned long flags;
92 unsigned int v;
93
94 /* Lapic used as dummy for broadcast ? */
95 if (evt->features & CLOCK_EVT_FEAT_DUMMY)
96 return;
97
98 local_irq_save(flags);
99
100 switch (mode) {
101 case CLOCK_EVT_MODE_PERIODIC:
102 case CLOCK_EVT_MODE_ONESHOT:
103 __setup_APIC_LVTT(calibration_result,
104 mode != CLOCK_EVT_MODE_PERIODIC, 1);
105 break;
106 case CLOCK_EVT_MODE_UNUSED:
107 case CLOCK_EVT_MODE_SHUTDOWN:
108 v = apic_read(APIC_LVTT);
109 v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR);
110 apic_write(APIC_LVTT, v);
111 break;
112 case CLOCK_EVT_MODE_RESUME:
113 /* Nothing to do here */
114 break;
115 }
116
117 local_irq_restore(flags);
118}
119
59/* 120/*
60 * cpu_mask that denotes the CPUs that needs timer interrupt coming in as 121 * Local APIC timer broadcast function
61 * IPIs in place of local APIC timers
62 */ 122 */
63static cpumask_t timer_interrupt_broadcast_ipi_mask; 123static void lapic_timer_broadcast(cpumask_t mask)
64 124{
65/* Using APIC to generate smp_local_timer_interrupt? */ 125#ifdef CONFIG_SMP
66int using_apic_timer __read_mostly = 0; 126 send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
127#endif
128}
67 129
68static void apic_pm_activate(void); 130static void apic_pm_activate(void);
69 131
@@ -184,7 +246,10 @@ void disconnect_bsp_APIC(int virt_wire_setup)
184 apic_write(APIC_SPIV, value); 246 apic_write(APIC_SPIV, value);
185 247
186 if (!virt_wire_setup) { 248 if (!virt_wire_setup) {
187 /* For LVT0 make it edge triggered, active high, external and enabled */ 249 /*
250 * For LVT0 make it edge triggered, active high,
251 * external and enabled
252 */
188 value = apic_read(APIC_LVT0); 253 value = apic_read(APIC_LVT0);
189 value &= ~(APIC_MODE_MASK | APIC_SEND_PENDING | 254 value &= ~(APIC_MODE_MASK | APIC_SEND_PENDING |
190 APIC_INPUT_POLARITY | APIC_LVT_REMOTE_IRR | 255 APIC_INPUT_POLARITY | APIC_LVT_REMOTE_IRR |
@@ -420,10 +485,12 @@ void __cpuinit setup_local_APIC (void)
420 value = apic_read(APIC_LVT0) & APIC_LVT_MASKED; 485 value = apic_read(APIC_LVT0) & APIC_LVT_MASKED;
421 if (!smp_processor_id() && !value) { 486 if (!smp_processor_id() && !value) {
422 value = APIC_DM_EXTINT; 487 value = APIC_DM_EXTINT;
423 apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n", smp_processor_id()); 488 apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n",
489 smp_processor_id());
424 } else { 490 } else {
425 value = APIC_DM_EXTINT | APIC_LVT_MASKED; 491 value = APIC_DM_EXTINT | APIC_LVT_MASKED;
426 apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n", smp_processor_id()); 492 apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n",
493 smp_processor_id());
427 } 494 }
428 apic_write(APIC_LVT0, value); 495 apic_write(APIC_LVT0, value);
429 496
@@ -706,8 +773,8 @@ void __init init_apic_mappings(void)
706 apic_phys = mp_lapic_addr; 773 apic_phys = mp_lapic_addr;
707 774
708 set_fixmap_nocache(FIX_APIC_BASE, apic_phys); 775 set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
709 apic_mapped = 1; 776 apic_printk(APIC_VERBOSE, "mapped APIC to %16lx (%16lx)\n",
710 apic_printk(APIC_VERBOSE,"mapped APIC to %16lx (%16lx)\n", APIC_BASE, apic_phys); 777 APIC_BASE, apic_phys);
711 778
712 /* Put local APIC into the resource map. */ 779 /* Put local APIC into the resource map. */
713 lapic_resource.start = apic_phys; 780 lapic_resource.start = apic_phys;
@@ -730,12 +797,14 @@ void __init init_apic_mappings(void)
730 if (smp_found_config) { 797 if (smp_found_config) {
731 ioapic_phys = mp_ioapics[i].mpc_apicaddr; 798 ioapic_phys = mp_ioapics[i].mpc_apicaddr;
732 } else { 799 } else {
733 ioapic_phys = (unsigned long) alloc_bootmem_pages(PAGE_SIZE); 800 ioapic_phys = (unsigned long)
801 alloc_bootmem_pages(PAGE_SIZE);
734 ioapic_phys = __pa(ioapic_phys); 802 ioapic_phys = __pa(ioapic_phys);
735 } 803 }
736 set_fixmap_nocache(idx, ioapic_phys); 804 set_fixmap_nocache(idx, ioapic_phys);
737 apic_printk(APIC_VERBOSE,"mapped IOAPIC to %016lx (%016lx)\n", 805 apic_printk(APIC_VERBOSE,
738 __fix_to_virt(idx), ioapic_phys); 806 "mapped IOAPIC to %016lx (%016lx)\n",
807 __fix_to_virt(idx), ioapic_phys);
739 idx++; 808 idx++;
740 809
741 if (ioapic_res != NULL) { 810 if (ioapic_res != NULL) {
@@ -758,16 +827,14 @@ void __init init_apic_mappings(void)
758 * P5 APIC double write bug. 827 * P5 APIC double write bug.
759 */ 828 */
760 829
761#define APIC_DIVISOR 16 830static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
762
763static void __setup_APIC_LVTT(unsigned int clocks)
764{ 831{
765 unsigned int lvtt_value, tmp_value; 832 unsigned int lvtt_value, tmp_value;
766 int cpu = smp_processor_id();
767 833
768 lvtt_value = APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR; 834 lvtt_value = LOCAL_TIMER_VECTOR;
769 835 if (!oneshot)
770 if (cpu_isset(cpu, timer_interrupt_broadcast_ipi_mask)) 836 lvtt_value |= APIC_LVT_TIMER_PERIODIC;
837 if (!irqen)
771 lvtt_value |= APIC_LVT_MASKED; 838 lvtt_value |= APIC_LVT_MASKED;
772 839
773 apic_write(APIC_LVTT, lvtt_value); 840 apic_write(APIC_LVTT, lvtt_value);
@@ -780,44 +847,18 @@ static void __setup_APIC_LVTT(unsigned int clocks)
780 & ~(APIC_TDR_DIV_1 | APIC_TDR_DIV_TMBASE)) 847 & ~(APIC_TDR_DIV_1 | APIC_TDR_DIV_TMBASE))
781 | APIC_TDR_DIV_16); 848 | APIC_TDR_DIV_16);
782 849
783 apic_write(APIC_TMICT, clocks/APIC_DIVISOR); 850 if (!oneshot)
851 apic_write(APIC_TMICT, clocks);
784} 852}
785 853
786static void setup_APIC_timer(unsigned int clocks) 854static void setup_APIC_timer(void)
787{ 855{
788 unsigned long flags; 856 struct clock_event_device *levt = &__get_cpu_var(lapic_events);
789 857
790 local_irq_save(flags); 858 memcpy(levt, &lapic_clockevent, sizeof(*levt));
859 levt->cpumask = cpumask_of_cpu(smp_processor_id());
791 860
792 /* wait for irq slice */ 861 clockevents_register_device(levt);
793 if (hpet_address && hpet_use_timer) {
794 u32 trigger = hpet_readl(HPET_T0_CMP);
795 while (hpet_readl(HPET_T0_CMP) == trigger)
796 /* do nothing */ ;
797 } else {
798 int c1, c2;
799 outb_p(0x00, 0x43);
800 c2 = inb_p(0x40);
801 c2 |= inb_p(0x40) << 8;
802 do {
803 c1 = c2;
804 outb_p(0x00, 0x43);
805 c2 = inb_p(0x40);
806 c2 |= inb_p(0x40) << 8;
807 } while (c2 - c1 < 300);
808 }
809 __setup_APIC_LVTT(clocks);
810 /* Turn off PIT interrupt if we use APIC timer as main timer.
811 Only works with the PM timer right now
812 TBD fix it for HPET too. */
813 if ((pmtmr_ioport != 0) &&
814 smp_processor_id() == boot_cpu_id &&
815 apic_runs_main_timer == 1 &&
816 !cpu_isset(boot_cpu_id, timer_interrupt_broadcast_ipi_mask)) {
817 stop_timer_interrupt();
818 apic_runs_main_timer++;
819 }
820 local_irq_restore(flags);
821} 862}
822 863
823/* 864/*
@@ -835,17 +876,22 @@ static void setup_APIC_timer(unsigned int clocks)
835 876
836#define TICK_COUNT 100000000 877#define TICK_COUNT 100000000
837 878
838static int __init calibrate_APIC_clock(void) 879static void __init calibrate_APIC_clock(void)
839{ 880{
840 unsigned apic, apic_start; 881 unsigned apic, apic_start;
841 unsigned long tsc, tsc_start; 882 unsigned long tsc, tsc_start;
842 int result; 883 int result;
884
885 local_irq_disable();
886
843 /* 887 /*
844 * Put whatever arbitrary (but long enough) timeout 888 * Put whatever arbitrary (but long enough) timeout
845 * value into the APIC clock, we just want to get the 889 * value into the APIC clock, we just want to get the
846 * counter running for calibration. 890 * counter running for calibration.
891 *
892 * No interrupt enable !
847 */ 893 */
848 __setup_APIC_LVTT(4000000000); 894 __setup_APIC_LVTT(250000000, 0, 0);
849 895
850 apic_start = apic_read(APIC_TMCCT); 896 apic_start = apic_read(APIC_TMCCT);
851#ifdef CONFIG_X86_PM_TIMER 897#ifdef CONFIG_X86_PM_TIMER
@@ -867,123 +913,62 @@ static int __init calibrate_APIC_clock(void)
867 result = (apic_start - apic) * 1000L * tsc_khz / 913 result = (apic_start - apic) * 1000L * tsc_khz /
868 (tsc - tsc_start); 914 (tsc - tsc_start);
869 } 915 }
870 printk("result %d\n", result);
871 916
917 local_irq_enable();
918
919 printk(KERN_DEBUG "APIC timer calibration result %d\n", result);
872 920
873 printk(KERN_INFO "Detected %d.%03d MHz APIC timer.\n", 921 printk(KERN_INFO "Detected %d.%03d MHz APIC timer.\n",
874 result / 1000 / 1000, result / 1000 % 1000); 922 result / 1000 / 1000, result / 1000 % 1000);
875 923
876 return result * APIC_DIVISOR / HZ; 924 /* Calculate the scaled math multiplication factor */
877} 925 lapic_clockevent.mult = div_sc(result, NSEC_PER_SEC, 32);
926 lapic_clockevent.max_delta_ns =
927 clockevent_delta2ns(0x7FFFFF, &lapic_clockevent);
928 lapic_clockevent.min_delta_ns =
929 clockevent_delta2ns(0xF, &lapic_clockevent);
878 930
879static unsigned int calibration_result; 931 calibration_result = result / HZ;
932}
880 933
881void __init setup_boot_APIC_clock (void) 934void __init setup_boot_APIC_clock (void)
882{ 935{
936 /*
937 * The local apic timer can be disabled via the kernel commandline.
938 * Register the lapic timer as a dummy clock event source on SMP
939 * systems, so the broadcast mechanism is used. On UP systems simply
940 * ignore it.
941 */
883 if (disable_apic_timer) { 942 if (disable_apic_timer) {
884 printk(KERN_INFO "Disabling APIC timer\n"); 943 printk(KERN_INFO "Disabling APIC timer\n");
944 /* No broadcast on UP ! */
945 if (num_possible_cpus() > 1)
946 setup_APIC_timer();
885 return; 947 return;
886 } 948 }
887 949
888 printk(KERN_INFO "Using local APIC timer interrupts.\n"); 950 printk(KERN_INFO "Using local APIC timer interrupts.\n");
889 using_apic_timer = 1; 951 calibrate_APIC_clock();
890
891 local_irq_disable();
892 952
893 calibration_result = calibrate_APIC_clock();
894 /* 953 /*
895 * Now set up the timer for real. 954 * If nmi_watchdog is set to IO_APIC, we need the
955 * PIT/HPET going. Otherwise register lapic as a dummy
956 * device.
896 */ 957 */
897 setup_APIC_timer(calibration_result); 958 if (nmi_watchdog != NMI_IO_APIC)
959 lapic_clockevent.features &= ~CLOCK_EVT_FEAT_DUMMY;
960 else
961 printk(KERN_WARNING "APIC timer registered as dummy,"
962 " due to nmi_watchdog=1!\n");
898 963
899 local_irq_enable(); 964 setup_APIC_timer();
900} 965}
901 966
902void __cpuinit setup_secondary_APIC_clock(void) 967void __cpuinit setup_secondary_APIC_clock(void)
903{ 968{
904 local_irq_disable(); /* FIXME: Do we need this? --RR */ 969 setup_APIC_timer();
905 setup_APIC_timer(calibration_result);
906 local_irq_enable();
907} 970}
908 971
909void disable_APIC_timer(void)
910{
911 if (using_apic_timer) {
912 unsigned long v;
913
914 v = apic_read(APIC_LVTT);
915 /*
916 * When an illegal vector value (0-15) is written to an LVT
917 * entry and delivery mode is Fixed, the APIC may signal an
918 * illegal vector error, with out regard to whether the mask
919 * bit is set or whether an interrupt is actually seen on input.
920 *
921 * Boot sequence might call this function when the LVTT has
922 * '0' vector value. So make sure vector field is set to
923 * valid value.
924 */
925 v |= (APIC_LVT_MASKED | LOCAL_TIMER_VECTOR);
926 apic_write(APIC_LVTT, v);
927 }
928}
929
930void enable_APIC_timer(void)
931{
932 int cpu = smp_processor_id();
933
934 if (using_apic_timer &&
935 !cpu_isset(cpu, timer_interrupt_broadcast_ipi_mask)) {
936 unsigned long v;
937
938 v = apic_read(APIC_LVTT);
939 apic_write(APIC_LVTT, v & ~APIC_LVT_MASKED);
940 }
941}
942
943void switch_APIC_timer_to_ipi(void *cpumask)
944{
945 cpumask_t mask = *(cpumask_t *)cpumask;
946 int cpu = smp_processor_id();
947
948 if (cpu_isset(cpu, mask) &&
949 !cpu_isset(cpu, timer_interrupt_broadcast_ipi_mask)) {
950 disable_APIC_timer();
951 cpu_set(cpu, timer_interrupt_broadcast_ipi_mask);
952 }
953}
954EXPORT_SYMBOL(switch_APIC_timer_to_ipi);
955
956void smp_send_timer_broadcast_ipi(void)
957{
958 int cpu = smp_processor_id();
959 cpumask_t mask;
960
961 cpus_and(mask, cpu_online_map, timer_interrupt_broadcast_ipi_mask);
962
963 if (cpu_isset(cpu, mask)) {
964 cpu_clear(cpu, mask);
965 add_pda(apic_timer_irqs, 1);
966 smp_local_timer_interrupt();
967 }
968
969 if (!cpus_empty(mask)) {
970 send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
971 }
972}
973
974void switch_ipi_to_APIC_timer(void *cpumask)
975{
976 cpumask_t mask = *(cpumask_t *)cpumask;
977 int cpu = smp_processor_id();
978
979 if (cpu_isset(cpu, mask) &&
980 cpu_isset(cpu, timer_interrupt_broadcast_ipi_mask)) {
981 cpu_clear(cpu, timer_interrupt_broadcast_ipi_mask);
982 enable_APIC_timer();
983 }
984}
985EXPORT_SYMBOL(switch_ipi_to_APIC_timer);
986
987int setup_profiling_timer(unsigned int multiplier) 972int setup_profiling_timer(unsigned int multiplier)
988{ 973{
989 return -EINVAL; 974 return -EINVAL;
@@ -997,8 +982,6 @@ void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector,
997 apic_write(reg, v); 982 apic_write(reg, v);
998} 983}
999 984
1000#undef APIC_DIVISOR
1001
1002/* 985/*
1003 * Local timer interrupt handler. It does both profiling and 986 * Local timer interrupt handler. It does both profiling and
1004 * process statistics/rescheduling. 987 * process statistics/rescheduling.
@@ -1011,22 +994,34 @@ void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector,
1011 994
1012void smp_local_timer_interrupt(void) 995void smp_local_timer_interrupt(void)
1013{ 996{
1014 profile_tick(CPU_PROFILING); 997 int cpu = smp_processor_id();
1015#ifdef CONFIG_SMP 998 struct clock_event_device *evt = &per_cpu(lapic_events, cpu);
1016 update_process_times(user_mode(get_irq_regs())); 999
1017#endif
1018 if (apic_runs_main_timer > 1 && smp_processor_id() == boot_cpu_id)
1019 main_timer_handler();
1020 /* 1000 /*
1021 * We take the 'long' return path, and there every subsystem 1001 * Normally we should not be here till LAPIC has been initialized but
1022 * grabs the appropriate locks (kernel lock/ irq lock). 1002 * in some cases like kdump, its possible that there is a pending LAPIC
1003 * timer interrupt from previous kernel's context and is delivered in
1004 * new kernel the moment interrupts are enabled.
1023 * 1005 *
1024 * We might want to decouple profiling from the 'long path', 1006 * Interrupts are enabled early and LAPIC is setup much later, hence
1025 * and do the profiling totally in assembly. 1007 * its possible that when we get here evt->event_handler is NULL.
1026 * 1008 * Check for event_handler being NULL and discard the interrupt as
1027 * Currently this isn't too much of an issue (performance wise), 1009 * spurious.
1028 * we can take more than 100K local irqs per second on a 100 MHz P5. 1010 */
1011 if (!evt->event_handler) {
1012 printk(KERN_WARNING
1013 "Spurious LAPIC timer interrupt on cpu %d\n", cpu);
1014 /* Switch it off */
1015 lapic_timer_setup(CLOCK_EVT_MODE_SHUTDOWN, evt);
1016 return;
1017 }
1018
1019 /*
1020 * the NMI deadlock-detector uses this.
1029 */ 1021 */
1022 add_pda(apic_timer_irqs, 1);
1023
1024 evt->event_handler(evt);
1030} 1025}
1031 1026
1032/* 1027/*
@@ -1042,11 +1037,6 @@ void smp_apic_timer_interrupt(struct pt_regs *regs)
1042 struct pt_regs *old_regs = set_irq_regs(regs); 1037 struct pt_regs *old_regs = set_irq_regs(regs);
1043 1038
1044 /* 1039 /*
1045 * the NMI deadlock-detector uses this.
1046 */
1047 add_pda(apic_timer_irqs, 1);
1048
1049 /*
1050 * NOTE! We'd better ACK the irq immediately, 1040 * NOTE! We'd better ACK the irq immediately,
1051 * because timer handling can be slow. 1041 * because timer handling can be slow.
1052 */ 1042 */
@@ -1225,29 +1215,13 @@ static __init int setup_noapictimer(char *str)
1225 disable_apic_timer = 1; 1215 disable_apic_timer = 1;
1226 return 1; 1216 return 1;
1227} 1217}
1228 1218__setup("noapictimer", setup_noapictimer);
1229static __init int setup_apicmaintimer(char *str)
1230{
1231 apic_runs_main_timer = 1;
1232 nohpet = 1;
1233 return 1;
1234}
1235__setup("apicmaintimer", setup_apicmaintimer);
1236
1237static __init int setup_noapicmaintimer(char *str)
1238{
1239 apic_runs_main_timer = -1;
1240 return 1;
1241}
1242__setup("noapicmaintimer", setup_noapicmaintimer);
1243 1219
1244static __init int setup_apicpmtimer(char *s) 1220static __init int setup_apicpmtimer(char *s)
1245{ 1221{
1246 apic_calibrate_pmtmr = 1; 1222 apic_calibrate_pmtmr = 1;
1247 notsc_setup(NULL); 1223 notsc_setup(NULL);
1248 return setup_apicmaintimer(NULL); 1224 return 0;
1249} 1225}
1250__setup("apicpmtimer", setup_apicpmtimer); 1226__setup("apicpmtimer", setup_apicpmtimer);
1251 1227
1252__setup("noapictimer", setup_noapictimer);
1253
diff --git a/arch/i386/kernel/apm.c b/arch/x86/kernel/apm_32.c
index f02a8aca826b..32f2365c26ed 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/x86/kernel/apm_32.c
@@ -1869,7 +1869,7 @@ static struct miscdevice apm_device = {
1869 1869
1870 1870
1871/* Simple "print if true" callback */ 1871/* Simple "print if true" callback */
1872static int __init print_if_true(struct dmi_system_id *d) 1872static int __init print_if_true(const struct dmi_system_id *d)
1873{ 1873{
1874 printk("%s\n", d->ident); 1874 printk("%s\n", d->ident);
1875 return 0; 1875 return 0;
@@ -1879,14 +1879,14 @@ static int __init print_if_true(struct dmi_system_id *d)
1879 * Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it was 1879 * Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it was
1880 * disabled before the suspend. Linux used to get terribly confused by that. 1880 * disabled before the suspend. Linux used to get terribly confused by that.
1881 */ 1881 */
1882static int __init broken_ps2_resume(struct dmi_system_id *d) 1882static int __init broken_ps2_resume(const struct dmi_system_id *d)
1883{ 1883{
1884 printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround hopefully not needed.\n", d->ident); 1884 printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround hopefully not needed.\n", d->ident);
1885 return 0; 1885 return 0;
1886} 1886}
1887 1887
1888/* Some bioses have a broken protected mode poweroff and need to use realmode */ 1888/* Some bioses have a broken protected mode poweroff and need to use realmode */
1889static int __init set_realmode_power_off(struct dmi_system_id *d) 1889static int __init set_realmode_power_off(const struct dmi_system_id *d)
1890{ 1890{
1891 if (apm_info.realmode_power_off == 0) { 1891 if (apm_info.realmode_power_off == 0) {
1892 apm_info.realmode_power_off = 1; 1892 apm_info.realmode_power_off = 1;
@@ -1896,7 +1896,7 @@ static int __init set_realmode_power_off(struct dmi_system_id *d)
1896} 1896}
1897 1897
1898/* Some laptops require interrupts to be enabled during APM calls */ 1898/* Some laptops require interrupts to be enabled during APM calls */
1899static int __init set_apm_ints(struct dmi_system_id *d) 1899static int __init set_apm_ints(const struct dmi_system_id *d)
1900{ 1900{
1901 if (apm_info.allow_ints == 0) { 1901 if (apm_info.allow_ints == 0) {
1902 apm_info.allow_ints = 1; 1902 apm_info.allow_ints = 1;
@@ -1906,7 +1906,7 @@ static int __init set_apm_ints(struct dmi_system_id *d)
1906} 1906}
1907 1907
1908/* Some APM bioses corrupt memory or just plain do not work */ 1908/* Some APM bioses corrupt memory or just plain do not work */
1909static int __init apm_is_horked(struct dmi_system_id *d) 1909static int __init apm_is_horked(const struct dmi_system_id *d)
1910{ 1910{
1911 if (apm_info.disabled == 0) { 1911 if (apm_info.disabled == 0) {
1912 apm_info.disabled = 1; 1912 apm_info.disabled = 1;
@@ -1915,7 +1915,7 @@ static int __init apm_is_horked(struct dmi_system_id *d)
1915 return 0; 1915 return 0;
1916} 1916}
1917 1917
1918static int __init apm_is_horked_d850md(struct dmi_system_id *d) 1918static int __init apm_is_horked_d850md(const struct dmi_system_id *d)
1919{ 1919{
1920 if (apm_info.disabled == 0) { 1920 if (apm_info.disabled == 0) {
1921 apm_info.disabled = 1; 1921 apm_info.disabled = 1;
@@ -1927,7 +1927,7 @@ static int __init apm_is_horked_d850md(struct dmi_system_id *d)
1927} 1927}
1928 1928
1929/* Some APM bioses hang on APM idle calls */ 1929/* Some APM bioses hang on APM idle calls */
1930static int __init apm_likes_to_melt(struct dmi_system_id *d) 1930static int __init apm_likes_to_melt(const struct dmi_system_id *d)
1931{ 1931{
1932 if (apm_info.forbid_idle == 0) { 1932 if (apm_info.forbid_idle == 0) {
1933 apm_info.forbid_idle = 1; 1933 apm_info.forbid_idle = 1;
@@ -1951,7 +1951,7 @@ static int __init apm_likes_to_melt(struct dmi_system_id *d)
1951 * Phoenix A04 08/24/2000 is known bad (Dell Inspiron 5000e) 1951 * Phoenix A04 08/24/2000 is known bad (Dell Inspiron 5000e)
1952 * Phoenix A07 09/29/2000 is known good (Dell Inspiron 5000) 1952 * Phoenix A07 09/29/2000 is known good (Dell Inspiron 5000)
1953 */ 1953 */
1954static int __init broken_apm_power(struct dmi_system_id *d) 1954static int __init broken_apm_power(const struct dmi_system_id *d)
1955{ 1955{
1956 apm_info.get_power_status_broken = 1; 1956 apm_info.get_power_status_broken = 1;
1957 printk(KERN_WARNING "BIOS strings suggest APM bugs, disabling power status reporting.\n"); 1957 printk(KERN_WARNING "BIOS strings suggest APM bugs, disabling power status reporting.\n");
@@ -1962,7 +1962,7 @@ static int __init broken_apm_power(struct dmi_system_id *d)
1962 * This bios swaps the APM minute reporting bytes over (Many sony laptops 1962 * This bios swaps the APM minute reporting bytes over (Many sony laptops
1963 * have this problem). 1963 * have this problem).
1964 */ 1964 */
1965static int __init swab_apm_power_in_minutes(struct dmi_system_id *d) 1965static int __init swab_apm_power_in_minutes(const struct dmi_system_id *d)
1966{ 1966{
1967 apm_info.get_power_status_swabinminutes = 1; 1967 apm_info.get_power_status_swabinminutes = 1;
1968 printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n"); 1968 printk(KERN_WARNING "BIOS strings suggest APM reports battery life in minutes and wrong byte order.\n");
diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
new file mode 100644
index 000000000000..cfa82c899f47
--- /dev/null
+++ b/arch/x86/kernel/asm-offsets.c
@@ -0,0 +1,5 @@
1#ifdef CONFIG_X86_32
2# include "asm-offsets_32.c"
3#else
4# include "asm-offsets_64.c"
5#endif
diff --git a/arch/i386/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets_32.c
index 7288ac88d746..8029742c0fc1 100644
--- a/arch/i386/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -10,7 +10,7 @@
10#include <linux/personality.h> 10#include <linux/personality.h>
11#include <linux/suspend.h> 11#include <linux/suspend.h>
12#include <asm/ucontext.h> 12#include <asm/ucontext.h>
13#include "sigframe.h" 13#include "sigframe_32.h"
14#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/fixmap.h> 15#include <asm/fixmap.h>
16#include <asm/processor.h> 16#include <asm/processor.h>
diff --git a/arch/x86_64/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets_64.c
index 778953bc636c..778953bc636c 100644
--- a/arch/x86_64/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets_64.c
diff --git a/arch/x86_64/kernel/audit.c b/arch/x86/kernel/audit_64.c
index 06d3e5a14d9d..06d3e5a14d9d 100644
--- a/arch/x86_64/kernel/audit.c
+++ b/arch/x86/kernel/audit_64.c
diff --git a/arch/i386/kernel/bootflag.c b/arch/x86/kernel/bootflag.c
index 0b9860530a6b..0b9860530a6b 100644
--- a/arch/i386/kernel/bootflag.c
+++ b/arch/x86/kernel/bootflag.c
diff --git a/arch/x86_64/kernel/bugs.c b/arch/x86/kernel/bugs_64.c
index 4e5e9d364d63..4e5e9d364d63 100644
--- a/arch/x86_64/kernel/bugs.c
+++ b/arch/x86/kernel/bugs_64.c
diff --git a/arch/i386/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index 778396c78d65..778396c78d65 100644
--- a/arch/i386/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
diff --git a/arch/i386/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c
index 3e91d3ee26ec..3e91d3ee26ec 100644
--- a/arch/i386/kernel/cpu/addon_cpuid_features.c
+++ b/arch/x86/kernel/cpu/addon_cpuid_features.c
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index dcf6bbb1c7c0..dcf6bbb1c7c0 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
diff --git a/arch/i386/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 59266f03d1cd..59266f03d1cd 100644
--- a/arch/i386/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
diff --git a/arch/i386/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c
index 473eac883c7b..473eac883c7b 100644
--- a/arch/i386/kernel/cpu/centaur.c
+++ b/arch/x86/kernel/cpu/centaur.c
diff --git a/arch/i386/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index d506201d397c..d506201d397c 100644
--- a/arch/i386/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
diff --git a/arch/i386/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
index 2f6432cef6ff..2f6432cef6ff 100644
--- a/arch/i386/kernel/cpu/cpu.h
+++ b/arch/x86/kernel/cpu/cpu.h
diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/x86/kernel/cpu/cpufreq/Kconfig
index d8c6f132dc7a..d8c6f132dc7a 100644
--- a/arch/i386/kernel/cpu/cpufreq/Kconfig
+++ b/arch/x86/kernel/cpu/cpufreq/Kconfig
diff --git a/arch/i386/kernel/cpu/cpufreq/Makefile b/arch/x86/kernel/cpu/cpufreq/Makefile
index 560f7760dae5..560f7760dae5 100644
--- a/arch/i386/kernel/cpu/cpufreq/Makefile
+++ b/arch/x86/kernel/cpu/cpufreq/Makefile
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index 42115b609f63..ffd01e5dcb52 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -533,13 +533,13 @@ static int __init acpi_cpufreq_early_init(void)
533 */ 533 */
534static int bios_with_sw_any_bug; 534static int bios_with_sw_any_bug;
535 535
536static int sw_any_bug_found(struct dmi_system_id *d) 536static int sw_any_bug_found(const struct dmi_system_id *d)
537{ 537{
538 bios_with_sw_any_bug = 1; 538 bios_with_sw_any_bug = 1;
539 return 0; 539 return 0;
540} 540}
541 541
542static struct dmi_system_id sw_any_bug_dmi_table[] = { 542static const struct dmi_system_id sw_any_bug_dmi_table[] = {
543 { 543 {
544 .callback = sw_any_bug_found, 544 .callback = sw_any_bug_found,
545 .ident = "Supermicro Server X6DLP", 545 .ident = "Supermicro Server X6DLP",
diff --git a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
index 32f0bda3fc95..32f0bda3fc95 100644
--- a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c
+++ b/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c
diff --git a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c b/arch/x86/kernel/cpu/cpufreq/e_powersaver.c
index c11baaf9f2b4..c11baaf9f2b4 100644
--- a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c
+++ b/arch/x86/kernel/cpu/cpufreq/e_powersaver.c
diff --git a/arch/i386/kernel/cpu/cpufreq/elanfreq.c b/arch/x86/kernel/cpu/cpufreq/elanfreq.c
index 1e7ae7dafcf6..1e7ae7dafcf6 100644
--- a/arch/i386/kernel/cpu/cpufreq/elanfreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/elanfreq.c
diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
index ed2bda127c44..ed2bda127c44 100644
--- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/x86/kernel/cpu/cpufreq/longhaul.c
index a2fbfd912a08..5045f5d583c8 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/x86/kernel/cpu/cpufreq/longhaul.c
@@ -76,6 +76,7 @@ static unsigned int longhaul_index;
76/* Module parameters */ 76/* Module parameters */
77static int scale_voltage; 77static int scale_voltage;
78static int disable_acpi_c3; 78static int disable_acpi_c3;
79static int revid_errata;
79 80
80#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg) 81#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg)
81 82
@@ -168,7 +169,10 @@ static void do_powersaver(int cx_address, unsigned int clock_ratio_index,
168 169
169 rdmsrl(MSR_VIA_LONGHAUL, longhaul.val); 170 rdmsrl(MSR_VIA_LONGHAUL, longhaul.val);
170 /* Setup new frequency */ 171 /* Setup new frequency */
171 longhaul.bits.RevisionKey = longhaul.bits.RevisionID; 172 if (!revid_errata)
173 longhaul.bits.RevisionKey = longhaul.bits.RevisionID;
174 else
175 longhaul.bits.RevisionKey = 0;
172 longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf; 176 longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf;
173 longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4; 177 longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;
174 /* Setup new voltage */ 178 /* Setup new voltage */
@@ -272,7 +276,7 @@ static void longhaul_setstate(unsigned int table_index)
272 276
273 dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", 277 dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n",
274 fsb, mult/10, mult%10, print_speed(speed/1000)); 278 fsb, mult/10, mult%10, print_speed(speed/1000));
275 279retry_loop:
276 preempt_disable(); 280 preempt_disable();
277 local_irq_save(flags); 281 local_irq_save(flags);
278 282
@@ -344,6 +348,47 @@ static void longhaul_setstate(unsigned int table_index)
344 preempt_enable(); 348 preempt_enable();
345 349
346 freqs.new = calc_speed(longhaul_get_cpu_mult()); 350 freqs.new = calc_speed(longhaul_get_cpu_mult());
351 /* Check if requested frequency is set. */
352 if (unlikely(freqs.new != speed)) {
353 printk(KERN_INFO PFX "Failed to set requested frequency!\n");
354 /* Revision ID = 1 but processor is expecting revision key
355 * equal to 0. Jumpers at the bottom of processor will change
356 * multiplier and FSB, but will not change bits in Longhaul
357 * MSR nor enable voltage scaling. */
358 if (!revid_errata) {
359 printk(KERN_INFO PFX "Enabling \"Ignore Revision ID\" "
360 "option.\n");
361 revid_errata = 1;
362 msleep(200);
363 goto retry_loop;
364 }
365 /* Why ACPI C3 sometimes doesn't work is a mystery for me.
366 * But it does happen. Processor is entering ACPI C3 state,
367 * but it doesn't change frequency. I tried poking various
368 * bits in northbridge registers, but without success. */
369 if (longhaul_flags & USE_ACPI_C3) {
370 printk(KERN_INFO PFX "Disabling ACPI C3 support.\n");
371 longhaul_flags &= ~USE_ACPI_C3;
372 if (revid_errata) {
373 printk(KERN_INFO PFX "Disabling \"Ignore "
374 "Revision ID\" option.\n");
375 revid_errata = 0;
376 }
377 msleep(200);
378 goto retry_loop;
379 }
380 /* This shouldn't happen. Longhaul ver. 2 was reported not
381 * working on processors without voltage scaling, but with
382 * RevID = 1. RevID errata will make things right. Just
383 * to be 100% sure. */
384 if (longhaul_version == TYPE_LONGHAUL_V2) {
385 printk(KERN_INFO PFX "Switching to Longhaul ver. 1\n");
386 longhaul_version = TYPE_LONGHAUL_V1;
387 msleep(200);
388 goto retry_loop;
389 }
390 }
391 /* Report true CPU frequency */
347 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 392 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
348 393
349 if (!bm_timeout) 394 if (!bm_timeout)
@@ -959,11 +1004,20 @@ static void __exit longhaul_exit(void)
959 kfree(longhaul_table); 1004 kfree(longhaul_table);
960} 1005}
961 1006
1007/* Even if BIOS is exporting ACPI C3 state, and it is used
1008 * with success when CPU is idle, this state doesn't
1009 * trigger frequency transition in some cases. */
962module_param (disable_acpi_c3, int, 0644); 1010module_param (disable_acpi_c3, int, 0644);
963MODULE_PARM_DESC(disable_acpi_c3, "Don't use ACPI C3 support"); 1011MODULE_PARM_DESC(disable_acpi_c3, "Don't use ACPI C3 support");
964 1012/* Change CPU voltage with frequency. Very usefull to save
1013 * power, but most VIA C3 processors aren't supporting it. */
965module_param (scale_voltage, int, 0644); 1014module_param (scale_voltage, int, 0644);
966MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor"); 1015MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor");
1016/* Force revision key to 0 for processors which doesn't
1017 * support voltage scaling, but are introducing itself as
1018 * such. */
1019module_param(revid_errata, int, 0644);
1020MODULE_PARM_DESC(revid_errata, "Ignore CPU Revision ID");
967 1021
968MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>"); 1022MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>");
969MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors."); 1023MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors.");
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.h b/arch/x86/kernel/cpu/cpufreq/longhaul.h
index 4fcc320997df..4fcc320997df 100644
--- a/arch/i386/kernel/cpu/cpufreq/longhaul.h
+++ b/arch/x86/kernel/cpu/cpufreq/longhaul.h
diff --git a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/x86/kernel/cpu/cpufreq/longrun.c
index b2689514295a..b2689514295a 100644
--- a/arch/i386/kernel/cpu/cpufreq/longrun.c
+++ b/arch/x86/kernel/cpu/cpufreq/longrun.c
diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
index 8eb414b906d2..8eb414b906d2 100644
--- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c b/arch/x86/kernel/cpu/cpufreq/powernow-k6.c
index 6d0285339317..6d0285339317 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k6.c
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
index 7decd6a50ffa..7decd6a50ffa 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.h b/arch/x86/kernel/cpu/cpufreq/powernow-k7.h
index f8a63b3664e3..f8a63b3664e3 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.h
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.h
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index b273b69cfddf..b273b69cfddf 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
index b06c812208ca..b06c812208ca 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
diff --git a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
index d9f3e90a7ae0..d9f3e90a7ae0 100644
--- a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c
+++ b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
index 811d47438546..811d47438546 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
index 36685e8f7be1..36685e8f7be1 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
index b1acc8ce3167..b1acc8ce3167 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.h
index b11bcc608cac..b11bcc608cac 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.h
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
index f2b5a621d27b..f2b5a621d27b 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c
diff --git a/arch/i386/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c
index 122d2d75aa9f..122d2d75aa9f 100644
--- a/arch/i386/kernel/cpu/cyrix.c
+++ b/arch/x86/kernel/cpu/cyrix.c
diff --git a/arch/i386/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index dc4e08147b1f..dc4e08147b1f 100644
--- a/arch/i386/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index db6c25aa5776..db6c25aa5776 100644
--- a/arch/i386/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
diff --git a/arch/i386/kernel/cpu/mcheck/Makefile b/arch/x86/kernel/cpu/mcheck/Makefile
index f1ebe1c1c17a..f1ebe1c1c17a 100644
--- a/arch/i386/kernel/cpu/mcheck/Makefile
+++ b/arch/x86/kernel/cpu/mcheck/Makefile
diff --git a/arch/i386/kernel/cpu/mcheck/k7.c b/arch/x86/kernel/cpu/mcheck/k7.c
index eef63e3630c2..eef63e3630c2 100644
--- a/arch/i386/kernel/cpu/mcheck/k7.c
+++ b/arch/x86/kernel/cpu/mcheck/k7.c
diff --git a/arch/i386/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 34c781eddee4..34c781eddee4 100644
--- a/arch/i386/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
diff --git a/arch/i386/kernel/cpu/mcheck/mce.h b/arch/x86/kernel/cpu/mcheck/mce.h
index 81fb6e2d35f3..81fb6e2d35f3 100644
--- a/arch/i386/kernel/cpu/mcheck/mce.h
+++ b/arch/x86/kernel/cpu/mcheck/mce.h
diff --git a/arch/i386/kernel/cpu/mcheck/non-fatal.c b/arch/x86/kernel/cpu/mcheck/non-fatal.c
index bf39409b3838..bf39409b3838 100644
--- a/arch/i386/kernel/cpu/mcheck/non-fatal.c
+++ b/arch/x86/kernel/cpu/mcheck/non-fatal.c
diff --git a/arch/i386/kernel/cpu/mcheck/p4.c b/arch/x86/kernel/cpu/mcheck/p4.c
index 1509edfb2313..1509edfb2313 100644
--- a/arch/i386/kernel/cpu/mcheck/p4.c
+++ b/arch/x86/kernel/cpu/mcheck/p4.c
diff --git a/arch/i386/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mcheck/p5.c
index 94bc43d950cf..94bc43d950cf 100644
--- a/arch/i386/kernel/cpu/mcheck/p5.c
+++ b/arch/x86/kernel/cpu/mcheck/p5.c
diff --git a/arch/i386/kernel/cpu/mcheck/p6.c b/arch/x86/kernel/cpu/mcheck/p6.c
index deeae42ce199..deeae42ce199 100644
--- a/arch/i386/kernel/cpu/mcheck/p6.c
+++ b/arch/x86/kernel/cpu/mcheck/p6.c
diff --git a/arch/i386/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 1203dc5ab87a..1203dc5ab87a 100644
--- a/arch/i386/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
diff --git a/arch/i386/kernel/cpu/mcheck/winchip.c b/arch/x86/kernel/cpu/mcheck/winchip.c
index 9e424b6c293d..9e424b6c293d 100644
--- a/arch/i386/kernel/cpu/mcheck/winchip.c
+++ b/arch/x86/kernel/cpu/mcheck/winchip.c
diff --git a/arch/i386/kernel/cpu/mtrr/Makefile b/arch/x86/kernel/cpu/mtrr/Makefile
index 191fc0533649..191fc0533649 100644
--- a/arch/i386/kernel/cpu/mtrr/Makefile
+++ b/arch/x86/kernel/cpu/mtrr/Makefile
diff --git a/arch/i386/kernel/cpu/mtrr/amd.c b/arch/x86/kernel/cpu/mtrr/amd.c
index 0949cdbf848a..0949cdbf848a 100644
--- a/arch/i386/kernel/cpu/mtrr/amd.c
+++ b/arch/x86/kernel/cpu/mtrr/amd.c
diff --git a/arch/i386/kernel/cpu/mtrr/centaur.c b/arch/x86/kernel/cpu/mtrr/centaur.c
index cb9aa3a7a7ab..cb9aa3a7a7ab 100644
--- a/arch/i386/kernel/cpu/mtrr/centaur.c
+++ b/arch/x86/kernel/cpu/mtrr/centaur.c
diff --git a/arch/i386/kernel/cpu/mtrr/cyrix.c b/arch/x86/kernel/cpu/mtrr/cyrix.c
index 2287d4863a8a..2287d4863a8a 100644
--- a/arch/i386/kernel/cpu/mtrr/cyrix.c
+++ b/arch/x86/kernel/cpu/mtrr/cyrix.c
diff --git a/arch/i386/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 56f64e34829f..56f64e34829f 100644
--- a/arch/i386/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
diff --git a/arch/i386/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c
index c7d8f1756745..c7d8f1756745 100644
--- a/arch/i386/kernel/cpu/mtrr/if.c
+++ b/arch/x86/kernel/cpu/mtrr/if.c
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index c48b6fea5ab4..c48b6fea5ab4 100644
--- a/arch/i386/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
diff --git a/arch/i386/kernel/cpu/mtrr/mtrr.h b/arch/x86/kernel/cpu/mtrr/mtrr.h
index 289dfe6030e3..289dfe6030e3 100644
--- a/arch/i386/kernel/cpu/mtrr/mtrr.h
+++ b/arch/x86/kernel/cpu/mtrr/mtrr.h
diff --git a/arch/i386/kernel/cpu/mtrr/state.c b/arch/x86/kernel/cpu/mtrr/state.c
index c9014ca4a575..49e20c2afcdf 100644
--- a/arch/i386/kernel/cpu/mtrr/state.c
+++ b/arch/x86/kernel/cpu/mtrr/state.c
@@ -3,7 +3,7 @@
3#include <asm/io.h> 3#include <asm/io.h>
4#include <asm/mtrr.h> 4#include <asm/mtrr.h>
5#include <asm/msr.h> 5#include <asm/msr.h>
6#include <asm-i386/processor-cyrix.h> 6#include <asm/processor-cyrix.h>
7#include "mtrr.h" 7#include "mtrr.h"
8 8
9 9
diff --git a/arch/i386/kernel/cpu/nexgen.c b/arch/x86/kernel/cpu/nexgen.c
index 961fbe1a748f..961fbe1a748f 100644
--- a/arch/i386/kernel/cpu/nexgen.c
+++ b/arch/x86/kernel/cpu/nexgen.c
diff --git a/arch/i386/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c
index 93fecd4b03de..93fecd4b03de 100644
--- a/arch/i386/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
index 1e31b6caffb1..1e31b6caffb1 100644
--- a/arch/i386/kernel/cpu/proc.c
+++ b/arch/x86/kernel/cpu/proc.c
diff --git a/arch/i386/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c
index 200fb3f9ebfb..200fb3f9ebfb 100644
--- a/arch/i386/kernel/cpu/transmeta.c
+++ b/arch/x86/kernel/cpu/transmeta.c
diff --git a/arch/i386/kernel/cpu/umc.c b/arch/x86/kernel/cpu/umc.c
index a7a4e75bdcd7..a7a4e75bdcd7 100644
--- a/arch/i386/kernel/cpu/umc.c
+++ b/arch/x86/kernel/cpu/umc.c
diff --git a/arch/x86_64/kernel/cpufreq/Kconfig b/arch/x86/kernel/cpufreq/Kconfig
index a3fd51926cbd..a3fd51926cbd 100644
--- a/arch/x86_64/kernel/cpufreq/Kconfig
+++ b/arch/x86/kernel/cpufreq/Kconfig
diff --git a/arch/i386/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 5c2faa10e9fa..5c2faa10e9fa 100644
--- a/arch/i386/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
diff --git a/arch/i386/kernel/crash.c b/arch/x86/kernel/crash_32.c
index 53589d1b1a05..53589d1b1a05 100644
--- a/arch/i386/kernel/crash.c
+++ b/arch/x86/kernel/crash_32.c
diff --git a/arch/x86_64/kernel/crash.c b/arch/x86/kernel/crash_64.c
index 13432a1ae904..13432a1ae904 100644
--- a/arch/x86_64/kernel/crash.c
+++ b/arch/x86/kernel/crash_64.c
diff --git a/arch/i386/kernel/crash_dump.c b/arch/x86/kernel/crash_dump_32.c
index 3f532df488bc..3f532df488bc 100644
--- a/arch/i386/kernel/crash_dump.c
+++ b/arch/x86/kernel/crash_dump_32.c
diff --git a/arch/x86_64/kernel/crash_dump.c b/arch/x86/kernel/crash_dump_64.c
index 942deac4d43a..942deac4d43a 100644
--- a/arch/x86_64/kernel/crash_dump.c
+++ b/arch/x86/kernel/crash_dump_64.c
diff --git a/arch/i386/kernel/doublefault.c b/arch/x86/kernel/doublefault_32.c
index 40978af630e7..40978af630e7 100644
--- a/arch/i386/kernel/doublefault.c
+++ b/arch/x86/kernel/doublefault_32.c
diff --git a/arch/i386/kernel/e820.c b/arch/x86/kernel/e820_32.c
index 3c86b979a40a..3c86b979a40a 100644
--- a/arch/i386/kernel/e820.c
+++ b/arch/x86/kernel/e820_32.c
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86/kernel/e820_64.c
index 0f4d5e209e9b..0f4d5e209e9b 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86/kernel/e820_64.c
diff --git a/arch/x86_64/kernel/early-quirks.c b/arch/x86/kernel/early-quirks_64.c
index 13aa4fd728f3..13aa4fd728f3 100644
--- a/arch/x86_64/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks_64.c
diff --git a/arch/x86_64/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index fd9aff3f3890..fd9aff3f3890 100644
--- a/arch/x86_64/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
diff --git a/arch/i386/kernel/efi.c b/arch/x86/kernel/efi_32.c
index 2452c6fbe992..2452c6fbe992 100644
--- a/arch/i386/kernel/efi.c
+++ b/arch/x86/kernel/efi_32.c
diff --git a/arch/i386/kernel/efi_stub.S b/arch/x86/kernel/efi_stub_32.S
index ef00bb77d7e4..ef00bb77d7e4 100644
--- a/arch/i386/kernel/efi_stub.S
+++ b/arch/x86/kernel/efi_stub_32.S
diff --git a/arch/i386/kernel/entry.S b/arch/x86/kernel/entry_32.S
index a714d6b43506..290b7bc82da3 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/x86/kernel/entry_32.S
@@ -1107,6 +1107,6 @@ ENDPROC(xen_failsafe_callback)
1107#endif /* CONFIG_XEN */ 1107#endif /* CONFIG_XEN */
1108 1108
1109.section .rodata,"a" 1109.section .rodata,"a"
1110#include "syscall_table.S" 1110#include "syscall_table_32.S"
1111 1111
1112syscall_table_size=(.-sys_call_table) 1112syscall_table_size=(.-sys_call_table)
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86/kernel/entry_64.S
index 1d232e5f5658..1d232e5f5658 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86/kernel/entry_64.S
diff --git a/arch/x86_64/kernel/genapic.c b/arch/x86/kernel/genapic_64.c
index 47496a40e84f..47496a40e84f 100644
--- a/arch/x86_64/kernel/genapic.c
+++ b/arch/x86/kernel/genapic_64.c
diff --git a/arch/x86_64/kernel/genapic_flat.c b/arch/x86/kernel/genapic_flat_64.c
index ecb01eefdd27..ecb01eefdd27 100644
--- a/arch/x86_64/kernel/genapic_flat.c
+++ b/arch/x86/kernel/genapic_flat_64.c
diff --git a/arch/i386/kernel/geode.c b/arch/x86/kernel/geode_32.c
index 41e8aec4c61d..f12d8c5d9809 100644
--- a/arch/i386/kernel/geode.c
+++ b/arch/x86/kernel/geode_32.c
@@ -145,10 +145,14 @@ EXPORT_SYMBOL_GPL(geode_gpio_setup_event);
145 145
146static int __init geode_southbridge_init(void) 146static int __init geode_southbridge_init(void)
147{ 147{
148 int timers;
149
148 if (!is_geode()) 150 if (!is_geode())
149 return -ENODEV; 151 return -ENODEV;
150 152
151 init_lbars(); 153 init_lbars();
154 timers = geode_mfgpt_detect();
155 printk(KERN_INFO "geode: %d MFGPT timers available.\n", timers);
152 return 0; 156 return 0;
153} 157}
154 158
diff --git a/arch/x86_64/kernel/head64.c b/arch/x86/kernel/head64.c
index 6c34bdd22e26..6c34bdd22e26 100644
--- a/arch/x86_64/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
diff --git a/arch/i386/kernel/head.S b/arch/x86/kernel/head_32.S
index 8f0382161c91..9150ca9b5f80 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/x86/kernel/head_32.S
@@ -537,7 +537,7 @@ fault_msg:
537 .ascii "Int %d: CR2 %p err %p EIP %p CS %p flags %p\n" 537 .ascii "Int %d: CR2 %p err %p EIP %p CS %p flags %p\n"
538 .asciz "Stack: %p %p %p %p %p %p %p %p\n" 538 .asciz "Stack: %p %p %p %p %p %p %p %p\n"
539 539
540#include "../xen/xen-head.S" 540#include "../../x86/xen/xen-head.S"
541 541
542/* 542/*
543 * The IDT and GDT 'descriptors' are a strange 48-bit object 543 * The IDT and GDT 'descriptors' are a strange 48-bit object
diff --git a/arch/x86_64/kernel/head.S b/arch/x86/kernel/head_64.S
index b6167fe3330e..b6167fe3330e 100644
--- a/arch/x86_64/kernel/head.S
+++ b/arch/x86/kernel/head_64.S
diff --git a/arch/i386/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 533d4932bc79..f8367074da0d 100644
--- a/arch/i386/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -1,5 +1,6 @@
1#include <linux/clocksource.h> 1#include <linux/clocksource.h>
2#include <linux/clockchips.h> 2#include <linux/clockchips.h>
3#include <linux/delay.h>
3#include <linux/errno.h> 4#include <linux/errno.h>
4#include <linux/hpet.h> 5#include <linux/hpet.h>
5#include <linux/init.h> 6#include <linux/init.h>
@@ -7,11 +8,11 @@
7#include <linux/pm.h> 8#include <linux/pm.h>
8#include <linux/delay.h> 9#include <linux/delay.h>
9 10
11#include <asm/fixmap.h>
10#include <asm/hpet.h> 12#include <asm/hpet.h>
13#include <asm/i8253.h>
11#include <asm/io.h> 14#include <asm/io.h>
12 15
13extern struct clock_event_device *global_clock_event;
14
15#define HPET_MASK CLOCKSOURCE_MASK(32) 16#define HPET_MASK CLOCKSOURCE_MASK(32)
16#define HPET_SHIFT 22 17#define HPET_SHIFT 22
17 18
@@ -22,9 +23,9 @@ extern struct clock_event_device *global_clock_event;
22 * HPET address is set in acpi/boot.c, when an ACPI entry exists 23 * HPET address is set in acpi/boot.c, when an ACPI entry exists
23 */ 24 */
24unsigned long hpet_address; 25unsigned long hpet_address;
25static void __iomem * hpet_virt_address; 26static void __iomem *hpet_virt_address;
26 27
27static inline unsigned long hpet_readl(unsigned long a) 28unsigned long hpet_readl(unsigned long a)
28{ 29{
29 return readl(hpet_virt_address + a); 30 return readl(hpet_virt_address + a);
30} 31}
@@ -34,6 +35,36 @@ static inline void hpet_writel(unsigned long d, unsigned long a)
34 writel(d, hpet_virt_address + a); 35 writel(d, hpet_virt_address + a);
35} 36}
36 37
38#ifdef CONFIG_X86_64
39
40#include <asm/pgtable.h>
41
42static inline void hpet_set_mapping(void)
43{
44 set_fixmap_nocache(FIX_HPET_BASE, hpet_address);
45 __set_fixmap(VSYSCALL_HPET, hpet_address, PAGE_KERNEL_VSYSCALL_NOCACHE);
46 hpet_virt_address = (void __iomem *)fix_to_virt(FIX_HPET_BASE);
47}
48
49static inline void hpet_clear_mapping(void)
50{
51 hpet_virt_address = NULL;
52}
53
54#else
55
56static inline void hpet_set_mapping(void)
57{
58 hpet_virt_address = ioremap_nocache(hpet_address, HPET_MMAP_SIZE);
59}
60
61static inline void hpet_clear_mapping(void)
62{
63 iounmap(hpet_virt_address);
64 hpet_virt_address = NULL;
65}
66#endif
67
37/* 68/*
38 * HPET command line enable / disable 69 * HPET command line enable / disable
39 */ 70 */
@@ -49,6 +80,13 @@ static int __init hpet_setup(char* str)
49} 80}
50__setup("hpet=", hpet_setup); 81__setup("hpet=", hpet_setup);
51 82
83static int __init disable_hpet(char *str)
84{
85 boot_hpet_disable = 1;
86 return 1;
87}
88__setup("nohpet", disable_hpet);
89
52static inline int is_hpet_capable(void) 90static inline int is_hpet_capable(void)
53{ 91{
54 return (!boot_hpet_disable && hpet_address); 92 return (!boot_hpet_disable && hpet_address);
@@ -83,7 +121,7 @@ static void hpet_reserve_platform_timers(unsigned long id)
83 121
84 memset(&hd, 0, sizeof (hd)); 122 memset(&hd, 0, sizeof (hd));
85 hd.hd_phys_address = hpet_address; 123 hd.hd_phys_address = hpet_address;
86 hd.hd_address = hpet_virt_address; 124 hd.hd_address = hpet;
87 hd.hd_nirqs = nrtimers; 125 hd.hd_nirqs = nrtimers;
88 hd.hd_flags = HPET_DATA_PLATFORM; 126 hd.hd_flags = HPET_DATA_PLATFORM;
89 hpet_reserve_timer(&hd, 0); 127 hpet_reserve_timer(&hd, 0);
@@ -111,9 +149,9 @@ static void hpet_reserve_platform_timers(unsigned long id) { }
111 */ 149 */
112static unsigned long hpet_period; 150static unsigned long hpet_period;
113 151
114static void hpet_set_mode(enum clock_event_mode mode, 152static void hpet_legacy_set_mode(enum clock_event_mode mode,
115 struct clock_event_device *evt); 153 struct clock_event_device *evt);
116static int hpet_next_event(unsigned long delta, 154static int hpet_legacy_next_event(unsigned long delta,
117 struct clock_event_device *evt); 155 struct clock_event_device *evt);
118 156
119/* 157/*
@@ -122,10 +160,11 @@ static int hpet_next_event(unsigned long delta,
122static struct clock_event_device hpet_clockevent = { 160static struct clock_event_device hpet_clockevent = {
123 .name = "hpet", 161 .name = "hpet",
124 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 162 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
125 .set_mode = hpet_set_mode, 163 .set_mode = hpet_legacy_set_mode,
126 .set_next_event = hpet_next_event, 164 .set_next_event = hpet_legacy_next_event,
127 .shift = 32, 165 .shift = 32,
128 .irq = 0, 166 .irq = 0,
167 .rating = 50,
129}; 168};
130 169
131static void hpet_start_counter(void) 170static void hpet_start_counter(void)
@@ -140,7 +179,18 @@ static void hpet_start_counter(void)
140 hpet_writel(cfg, HPET_CFG); 179 hpet_writel(cfg, HPET_CFG);
141} 180}
142 181
143static void hpet_enable_int(void) 182static void hpet_resume_device(void)
183{
184 force_hpet_resume();
185}
186
187static void hpet_restart_counter(void)
188{
189 hpet_resume_device();
190 hpet_start_counter();
191}
192
193static void hpet_enable_legacy_int(void)
144{ 194{
145 unsigned long cfg = hpet_readl(HPET_CFG); 195 unsigned long cfg = hpet_readl(HPET_CFG);
146 196
@@ -149,7 +199,39 @@ static void hpet_enable_int(void)
149 hpet_legacy_int_enabled = 1; 199 hpet_legacy_int_enabled = 1;
150} 200}
151 201
152static void hpet_set_mode(enum clock_event_mode mode, 202static void hpet_legacy_clockevent_register(void)
203{
204 uint64_t hpet_freq;
205
206 /* Start HPET legacy interrupts */
207 hpet_enable_legacy_int();
208
209 /*
210 * The period is a femto seconds value. We need to calculate the
211 * scaled math multiplication factor for nanosecond to hpet tick
212 * conversion.
213 */
214 hpet_freq = 1000000000000000ULL;
215 do_div(hpet_freq, hpet_period);
216 hpet_clockevent.mult = div_sc((unsigned long) hpet_freq,
217 NSEC_PER_SEC, 32);
218 /* Calculate the min / max delta */
219 hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF,
220 &hpet_clockevent);
221 hpet_clockevent.min_delta_ns = clockevent_delta2ns(0x30,
222 &hpet_clockevent);
223
224 /*
225 * Start hpet with the boot cpu mask and make it
226 * global after the IO_APIC has been initialized.
227 */
228 hpet_clockevent.cpumask = cpumask_of_cpu(smp_processor_id());
229 clockevents_register_device(&hpet_clockevent);
230 global_clock_event = &hpet_clockevent;
231 printk(KERN_DEBUG "hpet clockevent registered\n");
232}
233
234static void hpet_legacy_set_mode(enum clock_event_mode mode,
153 struct clock_event_device *evt) 235 struct clock_event_device *evt)
154{ 236{
155 unsigned long cfg, cmp, now; 237 unsigned long cfg, cmp, now;
@@ -190,12 +272,12 @@ static void hpet_set_mode(enum clock_event_mode mode,
190 break; 272 break;
191 273
192 case CLOCK_EVT_MODE_RESUME: 274 case CLOCK_EVT_MODE_RESUME:
193 hpet_enable_int(); 275 hpet_enable_legacy_int();
194 break; 276 break;
195 } 277 }
196} 278}
197 279
198static int hpet_next_event(unsigned long delta, 280static int hpet_legacy_next_event(unsigned long delta,
199 struct clock_event_device *evt) 281 struct clock_event_device *evt)
200{ 282{
201 unsigned long cnt; 283 unsigned long cnt;
@@ -215,6 +297,13 @@ static cycle_t read_hpet(void)
215 return (cycle_t)hpet_readl(HPET_COUNTER); 297 return (cycle_t)hpet_readl(HPET_COUNTER);
216} 298}
217 299
300#ifdef CONFIG_X86_64
301static cycle_t __vsyscall_fn vread_hpet(void)
302{
303 return readl((const void __iomem *)fix_to_virt(VSYSCALL_HPET) + 0xf0);
304}
305#endif
306
218static struct clocksource clocksource_hpet = { 307static struct clocksource clocksource_hpet = {
219 .name = "hpet", 308 .name = "hpet",
220 .rating = 250, 309 .rating = 250,
@@ -222,61 +311,17 @@ static struct clocksource clocksource_hpet = {
222 .mask = HPET_MASK, 311 .mask = HPET_MASK,
223 .shift = HPET_SHIFT, 312 .shift = HPET_SHIFT,
224 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 313 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
225 .resume = hpet_start_counter, 314 .resume = hpet_restart_counter,
315#ifdef CONFIG_X86_64
316 .vread = vread_hpet,
317#endif
226}; 318};
227 319
228/* 320static int hpet_clocksource_register(void)
229 * Try to setup the HPET timer
230 */
231int __init hpet_enable(void)
232{ 321{
233 unsigned long id;
234 uint64_t hpet_freq;
235 u64 tmp, start, now; 322 u64 tmp, start, now;
236 cycle_t t1; 323 cycle_t t1;
237 324
238 if (!is_hpet_capable())
239 return 0;
240
241 hpet_virt_address = ioremap_nocache(hpet_address, HPET_MMAP_SIZE);
242
243 /*
244 * Read the period and check for a sane value:
245 */
246 hpet_period = hpet_readl(HPET_PERIOD);
247 if (hpet_period < HPET_MIN_PERIOD || hpet_period > HPET_MAX_PERIOD)
248 goto out_nohpet;
249
250 /*
251 * The period is a femto seconds value. We need to calculate the
252 * scaled math multiplication factor for nanosecond to hpet tick
253 * conversion.
254 */
255 hpet_freq = 1000000000000000ULL;
256 do_div(hpet_freq, hpet_period);
257 hpet_clockevent.mult = div_sc((unsigned long) hpet_freq,
258 NSEC_PER_SEC, 32);
259 /* Calculate the min / max delta */
260 hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFFFFFF,
261 &hpet_clockevent);
262 hpet_clockevent.min_delta_ns = clockevent_delta2ns(0x30,
263 &hpet_clockevent);
264
265 /*
266 * Read the HPET ID register to retrieve the IRQ routing
267 * information and the number of channels
268 */
269 id = hpet_readl(HPET_ID);
270
271#ifdef CONFIG_HPET_EMULATE_RTC
272 /*
273 * The legacy routing mode needs at least two channels, tick timer
274 * and the rtc emulation channel.
275 */
276 if (!(id & HPET_ID_NUMBER))
277 goto out_nohpet;
278#endif
279
280 /* Start the counter */ 325 /* Start the counter */
281 hpet_start_counter(); 326 hpet_start_counter();
282 327
@@ -298,7 +343,7 @@ int __init hpet_enable(void)
298 if (t1 == read_hpet()) { 343 if (t1 == read_hpet()) {
299 printk(KERN_WARNING 344 printk(KERN_WARNING
300 "HPET counter not counting. HPET disabled\n"); 345 "HPET counter not counting. HPET disabled\n");
301 goto out_nohpet; 346 return -ENODEV;
302 } 347 }
303 348
304 /* Initialize and register HPET clocksource 349 /* Initialize and register HPET clocksource
@@ -319,27 +364,84 @@ int __init hpet_enable(void)
319 364
320 clocksource_register(&clocksource_hpet); 365 clocksource_register(&clocksource_hpet);
321 366
367 return 0;
368}
369
370/*
371 * Try to setup the HPET timer
372 */
373int __init hpet_enable(void)
374{
375 unsigned long id;
376
377 if (!is_hpet_capable())
378 return 0;
379
380 hpet_set_mapping();
381
382 /*
383 * Read the period and check for a sane value:
384 */
385 hpet_period = hpet_readl(HPET_PERIOD);
386 if (hpet_period < HPET_MIN_PERIOD || hpet_period > HPET_MAX_PERIOD)
387 goto out_nohpet;
388
389 /*
390 * Read the HPET ID register to retrieve the IRQ routing
391 * information and the number of channels
392 */
393 id = hpet_readl(HPET_ID);
394
395#ifdef CONFIG_HPET_EMULATE_RTC
396 /*
397 * The legacy routing mode needs at least two channels, tick timer
398 * and the rtc emulation channel.
399 */
400 if (!(id & HPET_ID_NUMBER))
401 goto out_nohpet;
402#endif
403
404 if (hpet_clocksource_register())
405 goto out_nohpet;
406
322 if (id & HPET_ID_LEGSUP) { 407 if (id & HPET_ID_LEGSUP) {
323 hpet_enable_int(); 408 hpet_legacy_clockevent_register();
324 hpet_reserve_platform_timers(id);
325 /*
326 * Start hpet with the boot cpu mask and make it
327 * global after the IO_APIC has been initialized.
328 */
329 hpet_clockevent.cpumask = cpumask_of_cpu(smp_processor_id());
330 clockevents_register_device(&hpet_clockevent);
331 global_clock_event = &hpet_clockevent;
332 return 1; 409 return 1;
333 } 410 }
334 return 0; 411 return 0;
335 412
336out_nohpet: 413out_nohpet:
337 iounmap(hpet_virt_address); 414 hpet_clear_mapping();
338 hpet_virt_address = NULL;
339 boot_hpet_disable = 1; 415 boot_hpet_disable = 1;
340 return 0; 416 return 0;
341} 417}
342 418
419/*
420 * Needs to be late, as the reserve_timer code calls kalloc !
421 *
422 * Not a problem on i386 as hpet_enable is called from late_time_init,
423 * but on x86_64 it is necessary !
424 */
425static __init int hpet_late_init(void)
426{
427 if (boot_hpet_disable)
428 return -ENODEV;
429
430 if (!hpet_address) {
431 if (!force_hpet_address)
432 return -ENODEV;
433
434 hpet_address = force_hpet_address;
435 hpet_enable();
436 if (!hpet_virt_address)
437 return -ENODEV;
438 }
439
440 hpet_reserve_platform_timers(hpet_readl(HPET_ID));
441
442 return 0;
443}
444fs_initcall(hpet_late_init);
343 445
344#ifdef CONFIG_HPET_EMULATE_RTC 446#ifdef CONFIG_HPET_EMULATE_RTC
345 447
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/x86/kernel/i386_ksyms_32.c
index e3d4b73bfdb0..e3d4b73bfdb0 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/x86/kernel/i386_ksyms_32.c
diff --git a/arch/i386/kernel/i387.c b/arch/x86/kernel/i387_32.c
index 665847281ed2..665847281ed2 100644
--- a/arch/i386/kernel/i387.c
+++ b/arch/x86/kernel/i387_32.c
diff --git a/arch/x86_64/kernel/i387.c b/arch/x86/kernel/i387_64.c
index 1d58c13bc6bc..1d58c13bc6bc 100644
--- a/arch/x86_64/kernel/i387.c
+++ b/arch/x86/kernel/i387_64.c
diff --git a/arch/i386/kernel/i8237.c b/arch/x86/kernel/i8237.c
index 6f508e8d7c57..6f508e8d7c57 100644
--- a/arch/i386/kernel/i8237.c
+++ b/arch/x86/kernel/i8237.c
diff --git a/arch/i386/kernel/i8253.c b/arch/x86/kernel/i8253.c
index 6d839f2f1b1a..ac15e4cbd9c1 100644
--- a/arch/i386/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -13,7 +13,6 @@
13#include <asm/delay.h> 13#include <asm/delay.h>
14#include <asm/i8253.h> 14#include <asm/i8253.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/timer.h>
17 16
18DEFINE_SPINLOCK(i8253_lock); 17DEFINE_SPINLOCK(i8253_lock);
19EXPORT_SYMBOL(i8253_lock); 18EXPORT_SYMBOL(i8253_lock);
@@ -120,6 +119,7 @@ void __init setup_pit_timer(void)
120 global_clock_event = &pit_clockevent; 119 global_clock_event = &pit_clockevent;
121} 120}
122 121
122#ifndef CONFIG_X86_64
123/* 123/*
124 * Since the PIT overflows every tick, its not very useful 124 * Since the PIT overflows every tick, its not very useful
125 * to just read by itself. So use jiffies to emulate a free 125 * to just read by itself. So use jiffies to emulate a free
@@ -204,3 +204,5 @@ static int __init init_pit_clocksource(void)
204 return clocksource_register(&clocksource_pit); 204 return clocksource_register(&clocksource_pit);
205} 205}
206arch_initcall(init_pit_clocksource); 206arch_initcall(init_pit_clocksource);
207
208#endif
diff --git a/arch/i386/kernel/i8259.c b/arch/x86/kernel/i8259_32.c
index 0499cbe9871a..679bb33acbf1 100644
--- a/arch/i386/kernel/i8259.c
+++ b/arch/x86/kernel/i8259_32.c
@@ -10,7 +10,6 @@
10#include <linux/sysdev.h> 10#include <linux/sysdev.h>
11#include <linux/bitops.h> 11#include <linux/bitops.h>
12 12
13#include <asm/8253pit.h>
14#include <asm/atomic.h> 13#include <asm/atomic.h>
15#include <asm/system.h> 14#include <asm/system.h>
16#include <asm/io.h> 15#include <asm/io.h>
diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86/kernel/i8259_64.c
index 948cae646099..eb72976cc13c 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86/kernel/i8259_64.c
@@ -444,46 +444,6 @@ void __init init_ISA_irqs (void)
444 } 444 }
445} 445}
446 446
447static void setup_timer_hardware(void)
448{
449 outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */
450 udelay(10);
451 outb_p(LATCH & 0xff , 0x40); /* LSB */
452 udelay(10);
453 outb(LATCH >> 8 , 0x40); /* MSB */
454}
455
456static int timer_resume(struct sys_device *dev)
457{
458 setup_timer_hardware();
459 return 0;
460}
461
462void i8254_timer_resume(void)
463{
464 setup_timer_hardware();
465}
466
467static struct sysdev_class timer_sysclass = {
468 set_kset_name("timer_pit"),
469 .resume = timer_resume,
470};
471
472static struct sys_device device_timer = {
473 .id = 0,
474 .cls = &timer_sysclass,
475};
476
477static int __init init_timer_sysfs(void)
478{
479 int error = sysdev_class_register(&timer_sysclass);
480 if (!error)
481 error = sysdev_register(&device_timer);
482 return error;
483}
484
485device_initcall(init_timer_sysfs);
486
487void __init init_IRQ(void) 447void __init init_IRQ(void)
488{ 448{
489 int i; 449 int i;
@@ -533,12 +493,6 @@ void __init init_IRQ(void)
533 set_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); 493 set_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
534 set_intr_gate(ERROR_APIC_VECTOR, error_interrupt); 494 set_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
535 495
536 /*
537 * Set the clock to HZ Hz, we already have a valid
538 * vector now:
539 */
540 setup_timer_hardware();
541
542 if (!acpi_ioapic) 496 if (!acpi_ioapic)
543 setup_irq(2, &irq2); 497 setup_irq(2, &irq2);
544} 498}
diff --git a/arch/i386/kernel/init_task.c b/arch/x86/kernel/init_task_32.c
index d26fc063a760..d26fc063a760 100644
--- a/arch/i386/kernel/init_task.c
+++ b/arch/x86/kernel/init_task_32.c
diff --git a/arch/x86_64/kernel/init_task.c b/arch/x86/kernel/init_task_64.c
index 4ff33d4f8551..4ff33d4f8551 100644
--- a/arch/x86_64/kernel/init_task.c
+++ b/arch/x86/kernel/init_task_64.c
diff --git a/arch/i386/kernel/io_apic.c b/arch/x86/kernel/io_apic_32.c
index e2f4a1c68547..e2f4a1c68547 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic_32.c
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86/kernel/io_apic_64.c
index 966fa1062491..966fa1062491 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic_64.c
diff --git a/arch/i386/kernel/ioport.c b/arch/x86/kernel/ioport_32.c
index 3d310a946d76..3d310a946d76 100644
--- a/arch/i386/kernel/ioport.c
+++ b/arch/x86/kernel/ioport_32.c
diff --git a/arch/x86_64/kernel/ioport.c b/arch/x86/kernel/ioport_64.c
index 653efa30b0f4..653efa30b0f4 100644
--- a/arch/x86_64/kernel/ioport.c
+++ b/arch/x86/kernel/ioport_64.c
diff --git a/arch/i386/kernel/irq.c b/arch/x86/kernel/irq_32.c
index dd2b97fc00b2..4f681bcdb1fc 100644
--- a/arch/i386/kernel/irq.c
+++ b/arch/x86/kernel/irq_32.c
@@ -231,8 +231,6 @@ asmlinkage void do_softirq(void)
231 231
232 local_irq_restore(flags); 232 local_irq_restore(flags);
233} 233}
234
235EXPORT_SYMBOL(do_softirq);
236#endif 234#endif
237 235
238/* 236/*
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86/kernel/irq_64.c
index 39cb3fa83ebb..bd11e42b22bf 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86/kernel/irq_64.c
@@ -210,4 +210,3 @@ asmlinkage void do_softirq(void)
210 } 210 }
211 local_irq_restore(flags); 211 local_irq_restore(flags);
212} 212}
213EXPORT_SYMBOL(do_softirq);
diff --git a/arch/x86_64/kernel/k8.c b/arch/x86/kernel/k8.c
index 7377ccb21335..7377ccb21335 100644
--- a/arch/x86_64/kernel/k8.c
+++ b/arch/x86/kernel/k8.c
diff --git a/arch/i386/kernel/kprobes.c b/arch/x86/kernel/kprobes_32.c
index 448a50b1324c..448a50b1324c 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes_32.c
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86/kernel/kprobes_64.c
index a30e004682e2..a30e004682e2 100644
--- a/arch/x86_64/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes_64.c
diff --git a/arch/i386/kernel/ldt.c b/arch/x86/kernel/ldt_32.c
index e0b2d17f4f10..e0b2d17f4f10 100644
--- a/arch/i386/kernel/ldt.c
+++ b/arch/x86/kernel/ldt_32.c
diff --git a/arch/x86_64/kernel/ldt.c b/arch/x86/kernel/ldt_64.c
index bc9ffd5c19cc..bc9ffd5c19cc 100644
--- a/arch/x86_64/kernel/ldt.c
+++ b/arch/x86/kernel/ldt_64.c
diff --git a/arch/i386/kernel/machine_kexec.c b/arch/x86/kernel/machine_kexec_32.c
index 91966bafb3dc..91966bafb3dc 100644
--- a/arch/i386/kernel/machine_kexec.c
+++ b/arch/x86/kernel/machine_kexec_32.c
diff --git a/arch/x86_64/kernel/machine_kexec.c b/arch/x86/kernel/machine_kexec_64.c
index c3a554703672..c3a554703672 100644
--- a/arch/x86_64/kernel/machine_kexec.c
+++ b/arch/x86/kernel/machine_kexec_64.c
diff --git a/arch/i386/kernel/mca.c b/arch/x86/kernel/mca_32.c
index b83672b89527..b83672b89527 100644
--- a/arch/i386/kernel/mca.c
+++ b/arch/x86/kernel/mca_32.c
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86/kernel/mce_64.c
index a66d607f5b92..a66d607f5b92 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86/kernel/mce_64.c
diff --git a/arch/x86_64/kernel/mce_amd.c b/arch/x86/kernel/mce_amd_64.c
index 2f8a7f18b0fe..2f8a7f18b0fe 100644
--- a/arch/x86_64/kernel/mce_amd.c
+++ b/arch/x86/kernel/mce_amd_64.c
diff --git a/arch/x86_64/kernel/mce_intel.c b/arch/x86/kernel/mce_intel_64.c
index 6551505d8a2c..6551505d8a2c 100644
--- a/arch/x86_64/kernel/mce_intel.c
+++ b/arch/x86/kernel/mce_intel_64.c
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
new file mode 100644
index 000000000000..0ab680f2d9db
--- /dev/null
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -0,0 +1,362 @@
1/*
2 * Driver/API for AMD Geode Multi-Function General Purpose Timers (MFGPT)
3 *
4 * Copyright (C) 2006, Advanced Micro Devices, Inc.
5 * Copyright (C) 2007, Andres Salomon <dilinger@debian.org>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU General Public License
9 * as published by the Free Software Foundation.
10 *
11 * The MFGPTs are documented in AMD Geode CS5536 Companion Device Data Book.
12 */
13
14/*
15 * We are using the 32Khz input clock - its the only one that has the
16 * ranges we find desirable. The following table lists the suitable
17 * divisors and the associated hz, minimum interval
18 * and the maximum interval:
19 *
20 * Divisor Hz Min Delta (S) Max Delta (S)
21 * 1 32000 .0005 2.048
22 * 2 16000 .001 4.096
23 * 4 8000 .002 8.192
24 * 8 4000 .004 16.384
25 * 16 2000 .008 32.768
26 * 32 1000 .016 65.536
27 * 64 500 .032 131.072
28 * 128 250 .064 262.144
29 * 256 125 .128 524.288
30 */
31
32#include <linux/kernel.h>
33#include <linux/interrupt.h>
34#include <linux/module.h>
35#include <asm/geode.h>
36
37#define F_AVAIL 0x01
38
39static struct mfgpt_timer_t {
40 int flags;
41 struct module *owner;
42} mfgpt_timers[MFGPT_MAX_TIMERS];
43
44/* Selected from the table above */
45
46#define MFGPT_DIVISOR 16
47#define MFGPT_SCALE 4 /* divisor = 2^(scale) */
48#define MFGPT_HZ (32000 / MFGPT_DIVISOR)
49#define MFGPT_PERIODIC (MFGPT_HZ / HZ)
50
51#ifdef CONFIG_GEODE_MFGPT_TIMER
52static int __init mfgpt_timer_setup(void);
53#else
54#define mfgpt_timer_setup() (0)
55#endif
56
57/* Allow for disabling of MFGPTs */
58static int disable;
59static int __init mfgpt_disable(char *s)
60{
61 disable = 1;
62 return 1;
63}
64__setup("nomfgpt", mfgpt_disable);
65
66/*
67 * Check whether any MFGPTs are available for the kernel to use. In most
68 * cases, firmware that uses AMD's VSA code will claim all timers during
69 * bootup; we certainly don't want to take them if they're already in use.
70 * In other cases (such as with VSAless OpenFirmware), the system firmware
71 * leaves timers available for us to use.
72 */
73int __init geode_mfgpt_detect(void)
74{
75 int count = 0, i;
76 u16 val;
77
78 if (disable) {
79 printk(KERN_INFO "geode-mfgpt: Skipping MFGPT setup\n");
80 return 0;
81 }
82
83 for (i = 0; i < MFGPT_MAX_TIMERS; i++) {
84 val = geode_mfgpt_read(i, MFGPT_REG_SETUP);
85 if (!(val & MFGPT_SETUP_SETUP)) {
86 mfgpt_timers[i].flags = F_AVAIL;
87 count++;
88 }
89 }
90
91 /* set up clock event device, if desired */
92 i = mfgpt_timer_setup();
93
94 return count;
95}
96
97int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable)
98{
99 u32 msr, mask, value, dummy;
100 int shift = (cmp == MFGPT_CMP1) ? 0 : 8;
101
102 if (timer < 0 || timer >= MFGPT_MAX_TIMERS)
103 return -EIO;
104
105 /*
106 * The register maps for these are described in sections 6.17.1.x of
107 * the AMD Geode CS5536 Companion Device Data Book.
108 */
109 switch (event) {
110 case MFGPT_EVENT_RESET:
111 /*
112 * XXX: According to the docs, we cannot reset timers above
113 * 6; that is, resets for 7 and 8 will be ignored. Is this
114 * a problem? -dilinger
115 */
116 msr = MFGPT_NR_MSR;
117 mask = 1 << (timer + 24);
118 break;
119
120 case MFGPT_EVENT_NMI:
121 msr = MFGPT_NR_MSR;
122 mask = 1 << (timer + shift);
123 break;
124
125 case MFGPT_EVENT_IRQ:
126 msr = MFGPT_IRQ_MSR;
127 mask = 1 << (timer + shift);
128 break;
129
130 default:
131 return -EIO;
132 }
133
134 rdmsr(msr, value, dummy);
135
136 if (enable)
137 value |= mask;
138 else
139 value &= ~mask;
140
141 wrmsr(msr, value, dummy);
142 return 0;
143}
144
145int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable)
146{
147 u32 val, dummy;
148 int offset;
149
150 if (timer < 0 || timer >= MFGPT_MAX_TIMERS)
151 return -EIO;
152
153 if (geode_mfgpt_toggle_event(timer, cmp, MFGPT_EVENT_IRQ, enable))
154 return -EIO;
155
156 rdmsr(MSR_PIC_ZSEL_LOW, val, dummy);
157
158 offset = (timer % 4) * 4;
159
160 val &= ~((0xF << offset) | (0xF << (offset + 16)));
161
162 if (enable) {
163 val |= (irq & 0x0F) << (offset);
164 val |= (irq & 0x0F) << (offset + 16);
165 }
166
167 wrmsr(MSR_PIC_ZSEL_LOW, val, dummy);
168 return 0;
169}
170
171static int mfgpt_get(int timer, struct module *owner)
172{
173 mfgpt_timers[timer].flags &= ~F_AVAIL;
174 mfgpt_timers[timer].owner = owner;
175 printk(KERN_INFO "geode-mfgpt: Registered timer %d\n", timer);
176 return timer;
177}
178
179int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner)
180{
181 int i;
182
183 if (!geode_get_dev_base(GEODE_DEV_MFGPT))
184 return -ENODEV;
185 if (timer >= MFGPT_MAX_TIMERS)
186 return -EIO;
187
188 if (timer < 0) {
189 /* Try to find an available timer */
190 for (i = 0; i < MFGPT_MAX_TIMERS; i++) {
191 if (mfgpt_timers[i].flags & F_AVAIL)
192 return mfgpt_get(i, owner);
193
194 if (i == 5 && domain == MFGPT_DOMAIN_WORKING)
195 break;
196 }
197 } else {
198 /* If they requested a specific timer, try to honor that */
199 if (mfgpt_timers[timer].flags & F_AVAIL)
200 return mfgpt_get(timer, owner);
201 }
202
203 /* No timers available - too bad */
204 return -1;
205}
206
207
208#ifdef CONFIG_GEODE_MFGPT_TIMER
209
210/*
211 * The MFPGT timers on the CS5536 provide us with suitable timers to use
212 * as clock event sources - not as good as a HPET or APIC, but certainly
213 * better then the PIT. This isn't a general purpose MFGPT driver, but
214 * a simplified one designed specifically to act as a clock event source.
215 * For full details about the MFGPT, please consult the CS5536 data sheet.
216 */
217
218#include <linux/clocksource.h>
219#include <linux/clockchips.h>
220
221static unsigned int mfgpt_tick_mode = CLOCK_EVT_MODE_SHUTDOWN;
222static u16 mfgpt_event_clock;
223
224static int irq = 7;
225static int __init mfgpt_setup(char *str)
226{
227 get_option(&str, &irq);
228 return 1;
229}
230__setup("mfgpt_irq=", mfgpt_setup);
231
232static inline void mfgpt_disable_timer(u16 clock)
233{
234 u16 val = geode_mfgpt_read(clock, MFGPT_REG_SETUP);
235 geode_mfgpt_write(clock, MFGPT_REG_SETUP, val & ~MFGPT_SETUP_CNTEN);
236}
237
238static int mfgpt_next_event(unsigned long, struct clock_event_device *);
239static void mfgpt_set_mode(enum clock_event_mode, struct clock_event_device *);
240
241static struct clock_event_device mfgpt_clockevent = {
242 .name = "mfgpt-timer",
243 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
244 .set_mode = mfgpt_set_mode,
245 .set_next_event = mfgpt_next_event,
246 .rating = 250,
247 .cpumask = CPU_MASK_ALL,
248 .shift = 32
249};
250
251static inline void mfgpt_start_timer(u16 clock, u16 delta)
252{
253 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_CMP2, (u16) delta);
254 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0);
255
256 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP,
257 MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2);
258}
259
260static void mfgpt_set_mode(enum clock_event_mode mode,
261 struct clock_event_device *evt)
262{
263 mfgpt_disable_timer(mfgpt_event_clock);
264
265 if (mode == CLOCK_EVT_MODE_PERIODIC)
266 mfgpt_start_timer(mfgpt_event_clock, MFGPT_PERIODIC);
267
268 mfgpt_tick_mode = mode;
269}
270
271static int mfgpt_next_event(unsigned long delta, struct clock_event_device *evt)
272{
273 mfgpt_start_timer(mfgpt_event_clock, delta);
274 return 0;
275}
276
277/* Assume (foolishly?), that this interrupt was due to our tick */
278
279static irqreturn_t mfgpt_tick(int irq, void *dev_id)
280{
281 if (mfgpt_tick_mode == CLOCK_EVT_MODE_SHUTDOWN)
282 return IRQ_HANDLED;
283
284 /* Turn off the clock */
285 mfgpt_disable_timer(mfgpt_event_clock);
286
287 /* Clear the counter */
288 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0);
289
290 /* Restart the clock in periodic mode */
291
292 if (mfgpt_tick_mode == CLOCK_EVT_MODE_PERIODIC) {
293 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP,
294 MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2);
295 }
296
297 mfgpt_clockevent.event_handler(&mfgpt_clockevent);
298 return IRQ_HANDLED;
299}
300
301static struct irqaction mfgptirq = {
302 .handler = mfgpt_tick,
303 .flags = IRQF_DISABLED | IRQF_NOBALANCING,
304 .mask = CPU_MASK_NONE,
305 .name = "mfgpt-timer"
306};
307
308static int __init mfgpt_timer_setup(void)
309{
310 int timer, ret;
311 u16 val;
312
313 timer = geode_mfgpt_alloc_timer(MFGPT_TIMER_ANY, MFGPT_DOMAIN_WORKING,
314 THIS_MODULE);
315 if (timer < 0) {
316 printk(KERN_ERR
317 "mfgpt-timer: Could not allocate a MFPGT timer\n");
318 return -ENODEV;
319 }
320
321 mfgpt_event_clock = timer;
322 /* Set the clock scale and enable the event mode for CMP2 */
323 val = MFGPT_SCALE | (3 << 8);
324
325 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
326
327 /* Set up the IRQ on the MFGPT side */
328 if (geode_mfgpt_setup_irq(mfgpt_event_clock, MFGPT_CMP2, irq)) {
329 printk(KERN_ERR "mfgpt-timer: Could not set up IRQ %d\n", irq);
330 return -EIO;
331 }
332
333 /* And register it with the kernel */
334 ret = setup_irq(irq, &mfgptirq);
335
336 if (ret) {
337 printk(KERN_ERR
338 "mfgpt-timer: Unable to set up the interrupt.\n");
339 goto err;
340 }
341
342 /* Set up the clock event */
343 mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, 32);
344 mfgpt_clockevent.min_delta_ns = clockevent_delta2ns(0xF,
345 &mfgpt_clockevent);
346 mfgpt_clockevent.max_delta_ns = clockevent_delta2ns(0xFFFE,
347 &mfgpt_clockevent);
348
349 printk(KERN_INFO
350 "mfgpt-timer: registering the MFGT timer as a clock event.\n");
351 clockevents_register_device(&mfgpt_clockevent);
352
353 return 0;
354
355err:
356 geode_mfgpt_release_irq(mfgpt_event_clock, MFGPT_CMP2, irq);
357 printk(KERN_ERR
358 "mfgpt-timer: Unable to set up the MFGPT clock source\n");
359 return -EIO;
360}
361
362#endif
diff --git a/arch/i386/kernel/microcode.c b/arch/x86/kernel/microcode.c
index 09cf78110358..09cf78110358 100644
--- a/arch/i386/kernel/microcode.c
+++ b/arch/x86/kernel/microcode.c
diff --git a/arch/i386/kernel/module.c b/arch/x86/kernel/module_32.c
index 3db0a5442eb1..3db0a5442eb1 100644
--- a/arch/i386/kernel/module.c
+++ b/arch/x86/kernel/module_32.c
diff --git a/arch/x86_64/kernel/module.c b/arch/x86/kernel/module_64.c
index a888e67f5874..a888e67f5874 100644
--- a/arch/x86_64/kernel/module.c
+++ b/arch/x86/kernel/module_64.c
diff --git a/arch/i386/kernel/mpparse.c b/arch/x86/kernel/mpparse_32.c
index 13abb4ebfb79..13abb4ebfb79 100644
--- a/arch/i386/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse_32.c
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86/kernel/mpparse_64.c
index 8bf0ca03ac8e..8bf0ca03ac8e 100644
--- a/arch/x86_64/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse_64.c
diff --git a/arch/i386/kernel/msr.c b/arch/x86/kernel/msr.c
index 0c1069b8d638..0c1069b8d638 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
diff --git a/arch/i386/kernel/nmi.c b/arch/x86/kernel/nmi_32.c
index c7227e2180f8..95d3fc203cf7 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/x86/kernel/nmi_32.c
@@ -353,7 +353,8 @@ __kprobes int nmi_watchdog_tick(struct pt_regs * regs, unsigned reason)
353 * Take the local apic timer and PIT/HPET into account. We don't 353 * Take the local apic timer and PIT/HPET into account. We don't
354 * know which one is active, when we have highres/dyntick on 354 * know which one is active, when we have highres/dyntick on
355 */ 355 */
356 sum = per_cpu(irq_stat, cpu).apic_timer_irqs + kstat_cpu(cpu).irqs[0]; 356 sum = per_cpu(irq_stat, cpu).apic_timer_irqs +
357 per_cpu(irq_stat, cpu).irq0_irqs;
357 358
358 /* if the none of the timers isn't firing, this cpu isn't doing much */ 359 /* if the none of the timers isn't firing, this cpu isn't doing much */
359 if (!touched && last_irq_sums[cpu] == sum) { 360 if (!touched && last_irq_sums[cpu] == sum) {
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86/kernel/nmi_64.c
index 0ec6d2ddb931..e60ac0da5283 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86/kernel/nmi_64.c
@@ -329,7 +329,7 @@ int __kprobes nmi_watchdog_tick(struct pt_regs * regs, unsigned reason)
329 touched = 1; 329 touched = 1;
330 } 330 }
331 331
332 sum = read_pda(apic_timer_irqs); 332 sum = read_pda(apic_timer_irqs) + read_pda(irq0_irqs);
333 if (__get_cpu_var(nmi_touch)) { 333 if (__get_cpu_var(nmi_touch)) {
334 __get_cpu_var(nmi_touch) = 0; 334 __get_cpu_var(nmi_touch) = 0;
335 touched = 1; 335 touched = 1;
diff --git a/arch/i386/kernel/numaq.c b/arch/x86/kernel/numaq_32.c
index 9000d82c6dc0..9000d82c6dc0 100644
--- a/arch/i386/kernel/numaq.c
+++ b/arch/x86/kernel/numaq_32.c
diff --git a/arch/i386/kernel/paravirt.c b/arch/x86/kernel/paravirt_32.c
index 739cfb207dd7..739cfb207dd7 100644
--- a/arch/i386/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt_32.c
diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86/kernel/pci-calgary_64.c
index 71da01e73f03..71da01e73f03 100644
--- a/arch/x86_64/kernel/pci-calgary.c
+++ b/arch/x86/kernel/pci-calgary_64.c
diff --git a/arch/i386/kernel/pci-dma.c b/arch/x86/kernel/pci-dma_32.c
index 048f09b62553..048f09b62553 100644
--- a/arch/i386/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma_32.c
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86/kernel/pci-dma_64.c
index 29711445c818..29711445c818 100644
--- a/arch/x86_64/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma_64.c
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86/kernel/pci-gart_64.c
index 4918c575d582..4918c575d582 100644
--- a/arch/x86_64/kernel/pci-gart.c
+++ b/arch/x86/kernel/pci-gart_64.c
diff --git a/arch/x86_64/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu_64.c
index 2a34c6c025a9..2a34c6c025a9 100644
--- a/arch/x86_64/kernel/pci-nommu.c
+++ b/arch/x86/kernel/pci-nommu_64.c
diff --git a/arch/x86_64/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb_64.c
index b2f405ea7c85..b2f405ea7c85 100644
--- a/arch/x86_64/kernel/pci-swiotlb.c
+++ b/arch/x86/kernel/pci-swiotlb_64.c
diff --git a/arch/i386/kernel/pcspeaker.c b/arch/x86/kernel/pcspeaker.c
index bc1f2d3ea277..bc1f2d3ea277 100644
--- a/arch/i386/kernel/pcspeaker.c
+++ b/arch/x86/kernel/pcspeaker.c
diff --git a/arch/x86_64/kernel/pmtimer.c b/arch/x86/kernel/pmtimer_64.c
index ae8f91214f15..ae8f91214f15 100644
--- a/arch/x86_64/kernel/pmtimer.c
+++ b/arch/x86/kernel/pmtimer_64.c
diff --git a/arch/i386/kernel/process.c b/arch/x86/kernel/process_32.c
index 84664710b784..84664710b784 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/x86/kernel/process_32.c
diff --git a/arch/x86_64/kernel/process.c b/arch/x86/kernel/process_64.c
index 98956555450b..6f9dbbe65eef 100644
--- a/arch/x86_64/kernel/process.c
+++ b/arch/x86/kernel/process_64.c
@@ -38,6 +38,7 @@
38#include <linux/notifier.h> 38#include <linux/notifier.h>
39#include <linux/kprobes.h> 39#include <linux/kprobes.h>
40#include <linux/kdebug.h> 40#include <linux/kdebug.h>
41#include <linux/tick.h>
41 42
42#include <asm/uaccess.h> 43#include <asm/uaccess.h>
43#include <asm/pgtable.h> 44#include <asm/pgtable.h>
@@ -208,6 +209,8 @@ void cpu_idle (void)
208 if (__get_cpu_var(cpu_idle_state)) 209 if (__get_cpu_var(cpu_idle_state))
209 __get_cpu_var(cpu_idle_state) = 0; 210 __get_cpu_var(cpu_idle_state) = 0;
210 211
212 tick_nohz_stop_sched_tick();
213
211 rmb(); 214 rmb();
212 idle = pm_idle; 215 idle = pm_idle;
213 if (!idle) 216 if (!idle)
@@ -228,6 +231,7 @@ void cpu_idle (void)
228 __exit_idle(); 231 __exit_idle();
229 } 232 }
230 233
234 tick_nohz_restart_sched_tick();
231 preempt_enable_no_resched(); 235 preempt_enable_no_resched();
232 schedule(); 236 schedule();
233 preempt_disable(); 237 preempt_disable();
diff --git a/arch/i386/kernel/ptrace.c b/arch/x86/kernel/ptrace_32.c
index 7c1b92522e95..7c1b92522e95 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace_32.c
diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86/kernel/ptrace_64.c
index eea3702427b4..eea3702427b4 100644
--- a/arch/x86_64/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace_64.c
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
new file mode 100644
index 000000000000..d769e204f942
--- /dev/null
+++ b/arch/x86/kernel/quirks.c
@@ -0,0 +1,254 @@
1/*
2 * This file contains work-arounds for x86 and x86_64 platform bugs.
3 */
4#include <linux/pci.h>
5#include <linux/irq.h>
6
7#include <asm/hpet.h>
8
9#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI)
10
11static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
12{
13 u8 config, rev;
14 u32 word;
15
16 /* BIOS may enable hardware IRQ balancing for
17 * E7520/E7320/E7525(revision ID 0x9 and below)
18 * based platforms.
19 * Disable SW irqbalance/affinity on those platforms.
20 */
21 pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev);
22 if (rev > 0x9)
23 return;
24
25 /* enable access to config space*/
26 pci_read_config_byte(dev, 0xf4, &config);
27 pci_write_config_byte(dev, 0xf4, config|0x2);
28
29 /* read xTPR register */
30 raw_pci_ops->read(0, 0, 0x40, 0x4c, 2, &word);
31
32 if (!(word & (1 << 13))) {
33 printk(KERN_INFO "Intel E7520/7320/7525 detected. "
34 "Disabling irq balancing and affinity\n");
35#ifdef CONFIG_IRQBALANCE
36 irqbalance_disable("");
37#endif
38 noirqdebug_setup("");
39#ifdef CONFIG_PROC_FS
40 no_irq_affinity = 1;
41#endif
42 }
43
44 /* put back the original value for config space*/
45 if (!(config & 0x2))
46 pci_write_config_byte(dev, 0xf4, config);
47}
48DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7320_MCH, quirk_intel_irqbalance);
49DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7525_MCH, quirk_intel_irqbalance);
50DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_E7520_MCH, quirk_intel_irqbalance);
51#endif
52
53#if defined(CONFIG_HPET_TIMER)
54unsigned long force_hpet_address;
55
56static enum {
57 NONE_FORCE_HPET_RESUME,
58 OLD_ICH_FORCE_HPET_RESUME,
59 ICH_FORCE_HPET_RESUME
60} force_hpet_resume_type;
61
62static void __iomem *rcba_base;
63
64static void ich_force_hpet_resume(void)
65{
66 u32 val;
67
68 if (!force_hpet_address)
69 return;
70
71 if (rcba_base == NULL)
72 BUG();
73
74 /* read the Function Disable register, dword mode only */
75 val = readl(rcba_base + 0x3404);
76 if (!(val & 0x80)) {
77 /* HPET disabled in HPTC. Trying to enable */
78 writel(val | 0x80, rcba_base + 0x3404);
79 }
80
81 val = readl(rcba_base + 0x3404);
82 if (!(val & 0x80))
83 BUG();
84 else
85 printk(KERN_DEBUG "Force enabled HPET at resume\n");
86
87 return;
88}
89
90static void ich_force_enable_hpet(struct pci_dev *dev)
91{
92 u32 val;
93 u32 uninitialized_var(rcba);
94 int err = 0;
95
96 if (hpet_address || force_hpet_address)
97 return;
98
99 pci_read_config_dword(dev, 0xF0, &rcba);
100 rcba &= 0xFFFFC000;
101 if (rcba == 0) {
102 printk(KERN_DEBUG "RCBA disabled. Cannot force enable HPET\n");
103 return;
104 }
105
106 /* use bits 31:14, 16 kB aligned */
107 rcba_base = ioremap_nocache(rcba, 0x4000);
108 if (rcba_base == NULL) {
109 printk(KERN_DEBUG "ioremap failed. Cannot force enable HPET\n");
110 return;
111 }
112
113 /* read the Function Disable register, dword mode only */
114 val = readl(rcba_base + 0x3404);
115
116 if (val & 0x80) {
117 /* HPET is enabled in HPTC. Just not reported by BIOS */
118 val = val & 0x3;
119 force_hpet_address = 0xFED00000 | (val << 12);
120 printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n",
121 force_hpet_address);
122 iounmap(rcba_base);
123 return;
124 }
125
126 /* HPET disabled in HPTC. Trying to enable */
127 writel(val | 0x80, rcba_base + 0x3404);
128
129 val = readl(rcba_base + 0x3404);
130 if (!(val & 0x80)) {
131 err = 1;
132 } else {
133 val = val & 0x3;
134 force_hpet_address = 0xFED00000 | (val << 12);
135 }
136
137 if (err) {
138 force_hpet_address = 0;
139 iounmap(rcba_base);
140 printk(KERN_DEBUG "Failed to force enable HPET\n");
141 } else {
142 force_hpet_resume_type = ICH_FORCE_HPET_RESUME;
143 printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n",
144 force_hpet_address);
145 }
146}
147
148DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB2_0,
149 ich_force_enable_hpet);
150DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1,
151 ich_force_enable_hpet);
152DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0,
153 ich_force_enable_hpet);
154DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1,
155 ich_force_enable_hpet);
156DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31,
157 ich_force_enable_hpet);
158DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_1,
159 ich_force_enable_hpet);
160
161
162static struct pci_dev *cached_dev;
163
164static void old_ich_force_hpet_resume(void)
165{
166 u32 val;
167 u32 uninitialized_var(gen_cntl);
168
169 if (!force_hpet_address || !cached_dev)
170 return;
171
172 pci_read_config_dword(cached_dev, 0xD0, &gen_cntl);
173 gen_cntl &= (~(0x7 << 15));
174 gen_cntl |= (0x4 << 15);
175
176 pci_write_config_dword(cached_dev, 0xD0, gen_cntl);
177 pci_read_config_dword(cached_dev, 0xD0, &gen_cntl);
178 val = gen_cntl >> 15;
179 val &= 0x7;
180 if (val == 0x4)
181 printk(KERN_DEBUG "Force enabled HPET at resume\n");
182 else
183 BUG();
184}
185
186static void old_ich_force_enable_hpet(struct pci_dev *dev)
187{
188 u32 val;
189 u32 uninitialized_var(gen_cntl);
190
191 if (hpet_address || force_hpet_address)
192 return;
193
194 pci_read_config_dword(dev, 0xD0, &gen_cntl);
195 /*
196 * Bit 17 is HPET enable bit.
197 * Bit 16:15 control the HPET base address.
198 */
199 val = gen_cntl >> 15;
200 val &= 0x7;
201 if (val & 0x4) {
202 val &= 0x3;
203 force_hpet_address = 0xFED00000 | (val << 12);
204 printk(KERN_DEBUG "HPET at base address 0x%lx\n",
205 force_hpet_address);
206 return;
207 }
208
209 /*
210 * HPET is disabled. Trying enabling at FED00000 and check
211 * whether it sticks
212 */
213 gen_cntl &= (~(0x7 << 15));
214 gen_cntl |= (0x4 << 15);
215 pci_write_config_dword(dev, 0xD0, gen_cntl);
216
217 pci_read_config_dword(dev, 0xD0, &gen_cntl);
218
219 val = gen_cntl >> 15;
220 val &= 0x7;
221 if (val & 0x4) {
222 /* HPET is enabled in HPTC. Just not reported by BIOS */
223 val &= 0x3;
224 force_hpet_address = 0xFED00000 | (val << 12);
225 printk(KERN_DEBUG "Force enabled HPET at base address 0x%lx\n",
226 force_hpet_address);
227 cached_dev = dev;
228 force_hpet_resume_type = OLD_ICH_FORCE_HPET_RESUME;
229 return;
230 }
231
232 printk(KERN_DEBUG "Failed to force enable HPET\n");
233}
234
235DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0,
236 old_ich_force_enable_hpet);
237DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_12,
238 old_ich_force_enable_hpet);
239
240void force_hpet_resume(void)
241{
242 switch (force_hpet_resume_type) {
243 case ICH_FORCE_HPET_RESUME:
244 return ich_force_hpet_resume();
245
246 case OLD_ICH_FORCE_HPET_RESUME:
247 return old_ich_force_hpet_resume();
248
249 default:
250 break;
251 }
252}
253
254#endif
diff --git a/arch/i386/kernel/reboot.c b/arch/x86/kernel/reboot_32.c
index 0d796248866c..b37ed226830a 100644
--- a/arch/i386/kernel/reboot.c
+++ b/arch/x86/kernel/reboot_32.c
@@ -79,7 +79,7 @@ __setup("reboot=", reboot_setup);
79/* 79/*
80 * Some machines require the "reboot=b" commandline option, this quirk makes that automatic. 80 * Some machines require the "reboot=b" commandline option, this quirk makes that automatic.
81 */ 81 */
82static int __init set_bios_reboot(struct dmi_system_id *d) 82static int __init set_bios_reboot(const struct dmi_system_id *d)
83{ 83{
84 if (!reboot_thru_bios) { 84 if (!reboot_thru_bios) {
85 reboot_thru_bios = 1; 85 reboot_thru_bios = 1;
diff --git a/arch/x86_64/kernel/reboot.c b/arch/x86/kernel/reboot_64.c
index 368db2b9c5ac..368db2b9c5ac 100644
--- a/arch/x86_64/kernel/reboot.c
+++ b/arch/x86/kernel/reboot_64.c
diff --git a/arch/i386/kernel/reboot_fixups.c b/arch/x86/kernel/reboot_fixups_32.c
index 03e1cce58f49..03e1cce58f49 100644
--- a/arch/i386/kernel/reboot_fixups.c
+++ b/arch/x86/kernel/reboot_fixups_32.c
diff --git a/arch/i386/kernel/relocate_kernel.S b/arch/x86/kernel/relocate_kernel_32.S
index f151d6fae462..f151d6fae462 100644
--- a/arch/i386/kernel/relocate_kernel.S
+++ b/arch/x86/kernel/relocate_kernel_32.S
diff --git a/arch/x86_64/kernel/relocate_kernel.S b/arch/x86/kernel/relocate_kernel_64.S
index 14e95872c6a3..14e95872c6a3 100644
--- a/arch/x86_64/kernel/relocate_kernel.S
+++ b/arch/x86/kernel/relocate_kernel_64.S
diff --git a/arch/i386/kernel/scx200.c b/arch/x86/kernel/scx200_32.c
index c7d3df23f589..c7d3df23f589 100644
--- a/arch/i386/kernel/scx200.c
+++ b/arch/x86/kernel/scx200_32.c
diff --git a/arch/x86_64/kernel/setup64.c b/arch/x86/kernel/setup64.c
index 1200aaac403e..1200aaac403e 100644
--- a/arch/x86_64/kernel/setup64.c
+++ b/arch/x86/kernel/setup64.c
diff --git a/arch/i386/kernel/setup.c b/arch/x86/kernel/setup_32.c
index d474cd639bcb..d474cd639bcb 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/x86/kernel/setup_32.c
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86/kernel/setup_64.c
index af838f6b0b7f..32054bf5ba40 100644
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86/kernel/setup_64.c
@@ -546,6 +546,37 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c)
546#endif 546#endif
547} 547}
548 548
549#define ENABLE_C1E_MASK 0x18000000
550#define CPUID_PROCESSOR_SIGNATURE 1
551#define CPUID_XFAM 0x0ff00000
552#define CPUID_XFAM_K8 0x00000000
553#define CPUID_XFAM_10H 0x00100000
554#define CPUID_XFAM_11H 0x00200000
555#define CPUID_XMOD 0x000f0000
556#define CPUID_XMOD_REV_F 0x00040000
557
558/* AMD systems with C1E don't have a working lAPIC timer. Check for that. */
559static __cpuinit int amd_apic_timer_broken(void)
560{
561 u32 lo, hi;
562 u32 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE);
563 switch (eax & CPUID_XFAM) {
564 case CPUID_XFAM_K8:
565 if ((eax & CPUID_XMOD) < CPUID_XMOD_REV_F)
566 break;
567 case CPUID_XFAM_10H:
568 case CPUID_XFAM_11H:
569 rdmsr(MSR_K8_ENABLE_C1E, lo, hi);
570 if (lo & ENABLE_C1E_MASK)
571 return 1;
572 break;
573 default:
574 /* err on the side of caution */
575 return 1;
576 }
577 return 0;
578}
579
549static void __cpuinit init_amd(struct cpuinfo_x86 *c) 580static void __cpuinit init_amd(struct cpuinfo_x86 *c)
550{ 581{
551 unsigned level; 582 unsigned level;
@@ -617,6 +648,9 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
617 /* Family 10 doesn't support C states in MWAIT so don't use it */ 648 /* Family 10 doesn't support C states in MWAIT so don't use it */
618 if (c->x86 == 0x10 && !force_mwait) 649 if (c->x86 == 0x10 && !force_mwait)
619 clear_bit(X86_FEATURE_MWAIT, &c->x86_capability); 650 clear_bit(X86_FEATURE_MWAIT, &c->x86_capability);
651
652 if (amd_apic_timer_broken())
653 disable_apic_timer = 1;
620} 654}
621 655
622static void __cpuinit detect_ht(struct cpuinfo_x86 *c) 656static void __cpuinit detect_ht(struct cpuinfo_x86 *c)
diff --git a/arch/i386/kernel/sigframe.h b/arch/x86/kernel/sigframe_32.h
index 0b2221711dad..0b2221711dad 100644
--- a/arch/i386/kernel/sigframe.h
+++ b/arch/x86/kernel/sigframe_32.h
diff --git a/arch/i386/kernel/signal.c b/arch/x86/kernel/signal_32.c
index f5dd85656c18..c03570f7fe8e 100644
--- a/arch/i386/kernel/signal.c
+++ b/arch/x86/kernel/signal_32.c
@@ -25,7 +25,7 @@
25#include <asm/ucontext.h> 25#include <asm/ucontext.h>
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/i387.h> 27#include <asm/i387.h>
28#include "sigframe.h" 28#include "sigframe_32.h"
29 29
30#define DEBUG_SIG 0 30#define DEBUG_SIG 0
31 31
diff --git a/arch/x86_64/kernel/signal.c b/arch/x86/kernel/signal_64.c
index 739175b01e06..739175b01e06 100644
--- a/arch/x86_64/kernel/signal.c
+++ b/arch/x86/kernel/signal_64.c
diff --git a/arch/i386/kernel/smp.c b/arch/x86/kernel/smp_32.c
index 2d35d8502029..2d35d8502029 100644
--- a/arch/i386/kernel/smp.c
+++ b/arch/x86/kernel/smp_32.c
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86/kernel/smp_64.c
index df4a82812adb..df4a82812adb 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86/kernel/smp_64.c
diff --git a/arch/i386/kernel/smpboot.c b/arch/x86/kernel/smpboot_32.c
index e4f61d1c6248..e4f61d1c6248 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot_32.c
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86/kernel/smpboot_64.c
index 32f50783edc8..57ccf7cb6b91 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -223,8 +223,6 @@ void __cpuinit smp_callin(void)
223 local_irq_disable(); 223 local_irq_disable();
224 Dprintk("Stack at about %p\n",&cpuid); 224 Dprintk("Stack at about %p\n",&cpuid);
225 225
226 disable_APIC_timer();
227
228 /* 226 /*
229 * Save our processor parameters 227 * Save our processor parameters
230 */ 228 */
@@ -348,8 +346,6 @@ void __cpuinit start_secondary(void)
348 enable_8259A_irq(0); 346 enable_8259A_irq(0);
349 } 347 }
350 348
351 enable_APIC_timer();
352
353 /* 349 /*
354 * The sibling maps must be set before turing the online map on for 350 * The sibling maps must be set before turing the online map on for
355 * this cpu 351 * this cpu
diff --git a/arch/i386/kernel/smpcommon.c b/arch/x86/kernel/smpcommon_32.c
index bbfe85a0f699..bbfe85a0f699 100644
--- a/arch/i386/kernel/smpcommon.c
+++ b/arch/x86/kernel/smpcommon_32.c
diff --git a/arch/i386/kernel/srat.c b/arch/x86/kernel/srat_32.c
index 2a8713ec0f9a..2a8713ec0f9a 100644
--- a/arch/i386/kernel/srat.c
+++ b/arch/x86/kernel/srat_32.c
diff --git a/arch/x86_64/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c
index cb9109113584..cb9109113584 100644
--- a/arch/x86_64/kernel/stacktrace.c
+++ b/arch/x86/kernel/stacktrace.c
diff --git a/arch/i386/kernel/summit.c b/arch/x86/kernel/summit_32.c
index d0e01a3acf35..d0e01a3acf35 100644
--- a/arch/i386/kernel/summit.c
+++ b/arch/x86/kernel/summit_32.c
diff --git a/arch/x86_64/kernel/suspend.c b/arch/x86/kernel/suspend_64.c
index 573c0a6e0ac6..573c0a6e0ac6 100644
--- a/arch/x86_64/kernel/suspend.c
+++ b/arch/x86/kernel/suspend_64.c
diff --git a/arch/x86_64/kernel/suspend_asm.S b/arch/x86/kernel/suspend_asm_64.S
index 16d183f67bc1..16d183f67bc1 100644
--- a/arch/x86_64/kernel/suspend_asm.S
+++ b/arch/x86/kernel/suspend_asm_64.S
diff --git a/arch/i386/kernel/sys_i386.c b/arch/x86/kernel/sys_i386_32.c
index 42147304de88..42147304de88 100644
--- a/arch/i386/kernel/sys_i386.c
+++ b/arch/x86/kernel/sys_i386_32.c
diff --git a/arch/x86_64/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index 4770b7a2052c..4770b7a2052c 100644
--- a/arch/x86_64/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
diff --git a/arch/x86_64/kernel/syscall.c b/arch/x86/kernel/syscall_64.c
index 63d592c276cc..9d498c2f8eea 100644
--- a/arch/x86_64/kernel/syscall.c
+++ b/arch/x86/kernel/syscall_64.c
@@ -9,7 +9,7 @@
9 9
10#define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; 10#define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ;
11#undef _ASM_X86_64_UNISTD_H_ 11#undef _ASM_X86_64_UNISTD_H_
12#include <asm-x86_64/unistd.h> 12#include <asm/unistd_64.h>
13 13
14#undef __SYSCALL 14#undef __SYSCALL
15#define __SYSCALL(nr, sym) [ nr ] = sym, 15#define __SYSCALL(nr, sym) [ nr ] = sym,
@@ -22,5 +22,5 @@ extern void sys_ni_syscall(void);
22const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = { 22const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
23 /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ 23 /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */
24 [0 ... __NR_syscall_max] = &sys_ni_syscall, 24 [0 ... __NR_syscall_max] = &sys_ni_syscall,
25#include <asm-x86_64/unistd.h> 25#include <asm/unistd_64.h>
26}; 26};
diff --git a/arch/i386/kernel/syscall_table.S b/arch/x86/kernel/syscall_table_32.S
index 8344c70adf61..8344c70adf61 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/x86/kernel/syscall_table_32.S
diff --git a/arch/i386/kernel/sysenter.c b/arch/x86/kernel/sysenter_32.c
index 4eb2e408764f..4eb2e408764f 100644
--- a/arch/i386/kernel/sysenter.c
+++ b/arch/x86/kernel/sysenter_32.c
diff --git a/arch/x86_64/kernel/tce.c b/arch/x86/kernel/tce_64.c
index e3f2569b2c44..e3f2569b2c44 100644
--- a/arch/x86_64/kernel/tce.c
+++ b/arch/x86/kernel/tce_64.c
diff --git a/arch/i386/kernel/time.c b/arch/x86/kernel/time_32.c
index 19a6c678d02e..56dadfc2f41c 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/x86/kernel/time_32.c
@@ -157,6 +157,9 @@ EXPORT_SYMBOL(profile_pc);
157 */ 157 */
158irqreturn_t timer_interrupt(int irq, void *dev_id) 158irqreturn_t timer_interrupt(int irq, void *dev_id)
159{ 159{
160 /* Keep nmi watchdog up to date */
161 per_cpu(irq_stat, smp_processor_id()).irq0_irqs++;
162
160#ifdef CONFIG_X86_IO_APIC 163#ifdef CONFIG_X86_IO_APIC
161 if (timer_ack) { 164 if (timer_ack) {
162 /* 165 /*
diff --git a/arch/x86_64/kernel/time.c b/arch/x86/kernel/time_64.c
index 6d48a4e826d9..e0134d6c88da 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86/kernel/time_64.c
@@ -28,11 +28,12 @@
28#include <linux/cpu.h> 28#include <linux/cpu.h>
29#include <linux/kallsyms.h> 29#include <linux/kallsyms.h>
30#include <linux/acpi.h> 30#include <linux/acpi.h>
31#include <linux/clockchips.h>
32
31#ifdef CONFIG_ACPI 33#ifdef CONFIG_ACPI
32#include <acpi/achware.h> /* for PM timer frequency */ 34#include <acpi/achware.h> /* for PM timer frequency */
33#include <acpi/acpi_bus.h> 35#include <acpi/acpi_bus.h>
34#endif 36#endif
35#include <asm/8253pit.h>
36#include <asm/i8253.h> 37#include <asm/i8253.h>
37#include <asm/pgtable.h> 38#include <asm/pgtable.h>
38#include <asm/vsyscall.h> 39#include <asm/vsyscall.h>
@@ -47,12 +48,8 @@
47#include <asm/nmi.h> 48#include <asm/nmi.h>
48#include <asm/vgtod.h> 49#include <asm/vgtod.h>
49 50
50static char *timename = NULL;
51
52DEFINE_SPINLOCK(rtc_lock); 51DEFINE_SPINLOCK(rtc_lock);
53EXPORT_SYMBOL(rtc_lock); 52EXPORT_SYMBOL(rtc_lock);
54DEFINE_SPINLOCK(i8253_lock);
55EXPORT_SYMBOL(i8253_lock);
56 53
57volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES; 54volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES;
58 55
@@ -153,45 +150,12 @@ int update_persistent_clock(struct timespec now)
153 return set_rtc_mmss(now.tv_sec); 150 return set_rtc_mmss(now.tv_sec);
154} 151}
155 152
156void main_timer_handler(void) 153static irqreturn_t timer_event_interrupt(int irq, void *dev_id)
157{ 154{
158/* 155 add_pda(irq0_irqs, 1);
159 * Here we are in the timer irq handler. We have irqs locally disabled (so we
160 * don't need spin_lock_irqsave()) but we don't know if the timer_bh is running
161 * on the other CPU, so we need a lock. We also need to lock the vsyscall
162 * variables, because both do_timer() and us change them -arca+vojtech
163 */
164
165 write_seqlock(&xtime_lock);
166 156
167/* 157 global_clock_event->event_handler(global_clock_event);
168 * Do the timer stuff.
169 */
170
171 do_timer(1);
172#ifndef CONFIG_SMP
173 update_process_times(user_mode(get_irq_regs()));
174#endif
175 158
176/*
177 * In the SMP case we use the local APIC timer interrupt to do the profiling,
178 * except when we simulate SMP mode on a uniprocessor system, in that case we
179 * have to call the local interrupt handler.
180 */
181
182 if (!using_apic_timer)
183 smp_local_timer_interrupt();
184
185 write_sequnlock(&xtime_lock);
186}
187
188static irqreturn_t timer_interrupt(int irq, void *dev_id)
189{
190 if (apic_runs_main_timer > 1)
191 return IRQ_HANDLED;
192 main_timer_handler();
193 if (using_apic_timer)
194 smp_send_timer_broadcast_ipi();
195 return IRQ_HANDLED; 159 return IRQ_HANDLED;
196} 160}
197 161
@@ -292,97 +256,21 @@ static unsigned int __init tsc_calibrate_cpu_khz(void)
292 return pmc_now * tsc_khz / (tsc_now - tsc_start); 256 return pmc_now * tsc_khz / (tsc_now - tsc_start);
293} 257}
294 258
295/*
296 * pit_calibrate_tsc() uses the speaker output (channel 2) of
297 * the PIT. This is better than using the timer interrupt output,
298 * because we can read the value of the speaker with just one inb(),
299 * where we need three i/o operations for the interrupt channel.
300 * We count how many ticks the TSC does in 50 ms.
301 */
302
303static unsigned int __init pit_calibrate_tsc(void)
304{
305 unsigned long start, end;
306 unsigned long flags;
307
308 spin_lock_irqsave(&i8253_lock, flags);
309
310 outb((inb(0x61) & ~0x02) | 0x01, 0x61);
311
312 outb(0xb0, 0x43);
313 outb((PIT_TICK_RATE / (1000 / 50)) & 0xff, 0x42);
314 outb((PIT_TICK_RATE / (1000 / 50)) >> 8, 0x42);
315 start = get_cycles_sync();
316 while ((inb(0x61) & 0x20) == 0);
317 end = get_cycles_sync();
318
319 spin_unlock_irqrestore(&i8253_lock, flags);
320
321 return (end - start) / 50;
322}
323
324#define PIT_MODE 0x43
325#define PIT_CH0 0x40
326
327static void __pit_init(int val, u8 mode)
328{
329 unsigned long flags;
330
331 spin_lock_irqsave(&i8253_lock, flags);
332 outb_p(mode, PIT_MODE);
333 outb_p(val & 0xff, PIT_CH0); /* LSB */
334 outb_p(val >> 8, PIT_CH0); /* MSB */
335 spin_unlock_irqrestore(&i8253_lock, flags);
336}
337
338void __init pit_init(void)
339{
340 __pit_init(LATCH, 0x34); /* binary, mode 2, LSB/MSB, ch 0 */
341}
342
343void pit_stop_interrupt(void)
344{
345 __pit_init(0, 0x30); /* mode 0 */
346}
347
348void stop_timer_interrupt(void)
349{
350 char *name;
351 if (hpet_address) {
352 name = "HPET";
353 hpet_timer_stop_set_go(0);
354 } else {
355 name = "PIT";
356 pit_stop_interrupt();
357 }
358 printk(KERN_INFO "timer: %s interrupt stopped.\n", name);
359}
360
361static struct irqaction irq0 = { 259static struct irqaction irq0 = {
362 .handler = timer_interrupt, 260 .handler = timer_event_interrupt,
363 .flags = IRQF_DISABLED | IRQF_IRQPOLL, 261 .flags = IRQF_DISABLED | IRQF_IRQPOLL | IRQF_NOBALANCING,
364 .mask = CPU_MASK_NONE, 262 .mask = CPU_MASK_NONE,
365 .name = "timer" 263 .name = "timer"
366}; 264};
367 265
368void __init time_init(void) 266void __init time_init(void)
369{ 267{
370 if (nohpet) 268 if (!hpet_enable())
371 hpet_address = 0; 269 setup_pit_timer();
372 270
373 if (hpet_arch_init()) 271 setup_irq(0, &irq0);
374 hpet_address = 0;
375 272
376 if (hpet_use_timer) { 273 tsc_calibrate();
377 /* set tick_nsec to use the proper rate for HPET */
378 tick_nsec = TICK_NSEC_HPET;
379 tsc_khz = hpet_calibrate_tsc();
380 timename = "HPET";
381 } else {
382 pit_init();
383 tsc_khz = pit_calibrate_tsc();
384 timename = "PIT";
385 }
386 274
387 cpu_khz = tsc_khz; 275 cpu_khz = tsc_khz;
388 if (cpu_has(&boot_cpu_data, X86_FEATURE_CONSTANT_TSC) && 276 if (cpu_has(&boot_cpu_data, X86_FEATURE_CONSTANT_TSC) &&
@@ -398,50 +286,7 @@ void __init time_init(void)
398 else 286 else
399 vgetcpu_mode = VGETCPU_LSL; 287 vgetcpu_mode = VGETCPU_LSL;
400 288
401 set_cyc2ns_scale(tsc_khz);
402 printk(KERN_INFO "time.c: Detected %d.%03d MHz processor.\n", 289 printk(KERN_INFO "time.c: Detected %d.%03d MHz processor.\n",
403 cpu_khz / 1000, cpu_khz % 1000); 290 cpu_khz / 1000, cpu_khz % 1000);
404 init_tsc_clocksource(); 291 init_tsc_clocksource();
405
406 setup_irq(0, &irq0);
407}
408
409/*
410 * sysfs support for the timer.
411 */
412
413static int timer_suspend(struct sys_device *dev, pm_message_t state)
414{
415 return 0;
416}
417
418static int timer_resume(struct sys_device *dev)
419{
420 if (hpet_address)
421 hpet_reenable();
422 else
423 i8254_timer_resume();
424 return 0;
425} 292}
426
427static struct sysdev_class timer_sysclass = {
428 .resume = timer_resume,
429 .suspend = timer_suspend,
430 set_kset_name("timer"),
431};
432
433/* XXX this sysfs stuff should probably go elsewhere later -john */
434static struct sys_device device_timer = {
435 .id = 0,
436 .cls = &timer_sysclass,
437};
438
439static int time_init_device(void)
440{
441 int error = sysdev_class_register(&timer_sysclass);
442 if (!error)
443 error = sysdev_register(&device_timer);
444 return error;
445}
446
447device_initcall(time_init_device);
diff --git a/arch/i386/kernel/topology.c b/arch/x86/kernel/topology.c
index 45782356a618..45782356a618 100644
--- a/arch/i386/kernel/topology.c
+++ b/arch/x86/kernel/topology.c
diff --git a/arch/i386/kernel/trampoline.S b/arch/x86/kernel/trampoline_32.S
index f62815f8d06a..f62815f8d06a 100644
--- a/arch/i386/kernel/trampoline.S
+++ b/arch/x86/kernel/trampoline_32.S
diff --git a/arch/x86_64/kernel/trampoline.S b/arch/x86/kernel/trampoline_64.S
index e7e2764c461b..607983b0d27b 100644
--- a/arch/x86_64/kernel/trampoline.S
+++ b/arch/x86/kernel/trampoline_64.S
@@ -126,7 +126,7 @@ startup_64:
126no_longmode: 126no_longmode:
127 hlt 127 hlt
128 jmp no_longmode 128 jmp no_longmode
129#include "verify_cpu.S" 129#include "verify_cpu_64.S"
130 130
131 # Careful these need to be in the same 64K segment as the above; 131 # Careful these need to be in the same 64K segment as the above;
132tidt: 132tidt:
diff --git a/arch/i386/kernel/traps.c b/arch/x86/kernel/traps_32.c
index 47b0bef335bd..47b0bef335bd 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/x86/kernel/traps_32.c
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86/kernel/traps_64.c
index 03888420775d..03888420775d 100644
--- a/arch/x86_64/kernel/traps.c
+++ b/arch/x86/kernel/traps_64.c
diff --git a/arch/i386/kernel/tsc.c b/arch/x86/kernel/tsc_32.c
index a39280b4dd3a..3ed0ae8c918d 100644
--- a/arch/i386/kernel/tsc.c
+++ b/arch/x86/kernel/tsc_32.c
@@ -305,7 +305,7 @@ void mark_tsc_unstable(char *reason)
305} 305}
306EXPORT_SYMBOL_GPL(mark_tsc_unstable); 306EXPORT_SYMBOL_GPL(mark_tsc_unstable);
307 307
308static int __init dmi_mark_tsc_unstable(struct dmi_system_id *d) 308static int __init dmi_mark_tsc_unstable(const struct dmi_system_id *d)
309{ 309{
310 printk(KERN_NOTICE "%s detected: marking TSC unstable.\n", 310 printk(KERN_NOTICE "%s detected: marking TSC unstable.\n",
311 d->ident); 311 d->ident);
diff --git a/arch/x86_64/kernel/tsc.c b/arch/x86/kernel/tsc_64.c
index 2a59bde663f2..9f22e542c374 100644
--- a/arch/x86_64/kernel/tsc.c
+++ b/arch/x86/kernel/tsc_64.c
@@ -6,7 +6,9 @@
6#include <linux/time.h> 6#include <linux/time.h>
7#include <linux/acpi.h> 7#include <linux/acpi.h>
8#include <linux/cpufreq.h> 8#include <linux/cpufreq.h>
9#include <linux/acpi_pmtmr.h>
9 10
11#include <asm/hpet.h>
10#include <asm/timex.h> 12#include <asm/timex.h>
11 13
12static int notsc __initdata = 0; 14static int notsc __initdata = 0;
@@ -18,7 +20,7 @@ EXPORT_SYMBOL(tsc_khz);
18 20
19static unsigned int cyc2ns_scale __read_mostly; 21static unsigned int cyc2ns_scale __read_mostly;
20 22
21void set_cyc2ns_scale(unsigned long khz) 23static inline void set_cyc2ns_scale(unsigned long khz)
22{ 24{
23 cyc2ns_scale = (NSEC_PER_MSEC << NS_SCALE) / khz; 25 cyc2ns_scale = (NSEC_PER_MSEC << NS_SCALE) / khz;
24} 26}
@@ -118,6 +120,95 @@ core_initcall(cpufreq_tsc);
118 120
119#endif 121#endif
120 122
123#define MAX_RETRIES 5
124#define SMI_TRESHOLD 50000
125
126/*
127 * Read TSC and the reference counters. Take care of SMI disturbance
128 */
129static unsigned long __init tsc_read_refs(unsigned long *pm,
130 unsigned long *hpet)
131{
132 unsigned long t1, t2;
133 int i;
134
135 for (i = 0; i < MAX_RETRIES; i++) {
136 t1 = get_cycles_sync();
137 if (hpet)
138 *hpet = hpet_readl(HPET_COUNTER) & 0xFFFFFFFF;
139 else
140 *pm = acpi_pm_read_early();
141 t2 = get_cycles_sync();
142 if ((t2 - t1) < SMI_TRESHOLD)
143 return t2;
144 }
145 return ULONG_MAX;
146}
147
148/**
149 * tsc_calibrate - calibrate the tsc on boot
150 */
151void __init tsc_calibrate(void)
152{
153 unsigned long flags, tsc1, tsc2, tr1, tr2, pm1, pm2, hpet1, hpet2;
154 int hpet = is_hpet_enabled();
155
156 local_irq_save(flags);
157
158 tsc1 = tsc_read_refs(&pm1, hpet ? &hpet1 : NULL);
159
160 outb((inb(0x61) & ~0x02) | 0x01, 0x61);
161
162 outb(0xb0, 0x43);
163 outb((CLOCK_TICK_RATE / (1000 / 50)) & 0xff, 0x42);
164 outb((CLOCK_TICK_RATE / (1000 / 50)) >> 8, 0x42);
165 tr1 = get_cycles_sync();
166 while ((inb(0x61) & 0x20) == 0);
167 tr2 = get_cycles_sync();
168
169 tsc2 = tsc_read_refs(&pm2, hpet ? &hpet2 : NULL);
170
171 local_irq_restore(flags);
172
173 /*
174 * Preset the result with the raw and inaccurate PIT
175 * calibration value
176 */
177 tsc_khz = (tr2 - tr1) / 50;
178
179 /* hpet or pmtimer available ? */
180 if (!hpet && !pm1 && !pm2) {
181 printk(KERN_INFO "TSC calibrated against PIT\n");
182 return;
183 }
184
185 /* Check, whether the sampling was disturbed by an SMI */
186 if (tsc1 == ULONG_MAX || tsc2 == ULONG_MAX) {
187 printk(KERN_WARNING "TSC calibration disturbed by SMI, "
188 "using PIT calibration result\n");
189 return;
190 }
191
192 tsc2 = (tsc2 - tsc1) * 1000000L;
193
194 if (hpet) {
195 printk(KERN_INFO "TSC calibrated against HPET\n");
196 if (hpet2 < hpet1)
197 hpet2 += 0x100000000;
198 hpet2 -= hpet1;
199 tsc1 = (hpet2 * hpet_readl(HPET_PERIOD)) / 1000000;
200 } else {
201 printk(KERN_INFO "TSC calibrated against PM_TIMER\n");
202 if (pm2 < pm1)
203 pm2 += ACPI_PM_OVRRUN;
204 pm2 -= pm1;
205 tsc1 = (pm2 * 1000000000) / PMTMR_TICKS_PER_SEC;
206 }
207
208 tsc_khz = tsc2 / tsc1;
209 set_cyc2ns_scale(tsc_khz);
210}
211
121/* 212/*
122 * Make an educated guess if the TSC is trustworthy and synchronized 213 * Make an educated guess if the TSC is trustworthy and synchronized
123 * over all CPUs. 214 * over all CPUs.
diff --git a/arch/x86_64/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c
index 355f5f506c81..355f5f506c81 100644
--- a/arch/x86_64/kernel/tsc_sync.c
+++ b/arch/x86/kernel/tsc_sync.c
diff --git a/arch/x86_64/kernel/verify_cpu.S b/arch/x86/kernel/verify_cpu_64.S
index 45b6f8a975a1..45b6f8a975a1 100644
--- a/arch/x86_64/kernel/verify_cpu.S
+++ b/arch/x86/kernel/verify_cpu_64.S
diff --git a/arch/i386/kernel/vm86.c b/arch/x86/kernel/vm86_32.c
index f2dcd1d27c0a..f2dcd1d27c0a 100644
--- a/arch/i386/kernel/vm86.c
+++ b/arch/x86/kernel/vm86_32.c
diff --git a/arch/i386/kernel/vmi.c b/arch/x86/kernel/vmi_32.c
index 18673e0f193b..18673e0f193b 100644
--- a/arch/i386/kernel/vmi.c
+++ b/arch/x86/kernel/vmi_32.c
diff --git a/arch/i386/kernel/vmiclock.c b/arch/x86/kernel/vmiclock_32.c
index b1b5ab08b26e..b1b5ab08b26e 100644
--- a/arch/i386/kernel/vmiclock.c
+++ b/arch/x86/kernel/vmiclock_32.c
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
new file mode 100644
index 000000000000..849ee611f013
--- /dev/null
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -0,0 +1,5 @@
1#ifdef CONFIG_X86_32
2# include "vmlinux_32.lds.S"
3#else
4# include "vmlinux_64.lds.S"
5#endif
diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux_32.lds.S
index 7d72cce00529..7d72cce00529 100644
--- a/arch/i386/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux_32.lds.S
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux_64.lds.S
index ba8ea97abd21..ba8ea97abd21 100644
--- a/arch/x86_64/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux_64.lds.S
diff --git a/arch/x86_64/kernel/vsmp.c b/arch/x86/kernel/vsmp_64.c
index 414caf0c5f9a..414caf0c5f9a 100644
--- a/arch/x86_64/kernel/vsmp.c
+++ b/arch/x86/kernel/vsmp_64.c
diff --git a/arch/i386/kernel/vsyscall-int80.S b/arch/x86/kernel/vsyscall-int80_32.S
index 530d0525e5e2..103cab6aa7c0 100644
--- a/arch/i386/kernel/vsyscall-int80.S
+++ b/arch/x86/kernel/vsyscall-int80_32.S
@@ -50,4 +50,4 @@ __kernel_vsyscall:
50/* 50/*
51 * Get the common code for the sigreturn entry points. 51 * Get the common code for the sigreturn entry points.
52 */ 52 */
53#include "vsyscall-sigreturn.S" 53#include "vsyscall-sigreturn_32.S"
diff --git a/arch/i386/kernel/vsyscall-note.S b/arch/x86/kernel/vsyscall-note_32.S
index 07c0daf78237..fcf376a37f79 100644
--- a/arch/i386/kernel/vsyscall-note.S
+++ b/arch/x86/kernel/vsyscall-note_32.S
@@ -33,7 +33,7 @@ ELFNOTE_END
33 * at boot time we set VDSO_NOTE_NONEGSEG_BIT if running under Xen. 33 * at boot time we set VDSO_NOTE_NONEGSEG_BIT if running under Xen.
34 */ 34 */
35 35
36#include "../xen/vdso.h" /* Defines VDSO_NOTE_NONEGSEG_BIT. */ 36#include "../../x86/xen/vdso.h" /* Defines VDSO_NOTE_NONEGSEG_BIT. */
37 37
38 .globl VDSO_NOTE_MASK 38 .globl VDSO_NOTE_MASK
39ELFNOTE_START(GNU, 2, "a") 39ELFNOTE_START(GNU, 2, "a")
diff --git a/arch/i386/kernel/vsyscall-sigreturn.S b/arch/x86/kernel/vsyscall-sigreturn_32.S
index a92262f41659..a92262f41659 100644
--- a/arch/i386/kernel/vsyscall-sigreturn.S
+++ b/arch/x86/kernel/vsyscall-sigreturn_32.S
diff --git a/arch/i386/kernel/vsyscall-sysenter.S b/arch/x86/kernel/vsyscall-sysenter_32.S
index 1a36d26e15eb..ed879bf42995 100644
--- a/arch/i386/kernel/vsyscall-sysenter.S
+++ b/arch/x86/kernel/vsyscall-sysenter_32.S
@@ -119,4 +119,4 @@ SYSENTER_RETURN:
119/* 119/*
120 * Get the common code for the sigreturn entry points. 120 * Get the common code for the sigreturn entry points.
121 */ 121 */
122#include "vsyscall-sigreturn.S" 122#include "vsyscall-sigreturn_32.S"
diff --git a/arch/i386/kernel/vsyscall.S b/arch/x86/kernel/vsyscall_32.S
index b403890fe39b..a5ab3dc4fd25 100644
--- a/arch/i386/kernel/vsyscall.S
+++ b/arch/x86/kernel/vsyscall_32.S
@@ -4,12 +4,12 @@ __INITDATA
4 4
5 .globl vsyscall_int80_start, vsyscall_int80_end 5 .globl vsyscall_int80_start, vsyscall_int80_end
6vsyscall_int80_start: 6vsyscall_int80_start:
7 .incbin "arch/i386/kernel/vsyscall-int80.so" 7 .incbin "arch/x86/kernel/vsyscall-int80_32.so"
8vsyscall_int80_end: 8vsyscall_int80_end:
9 9
10 .globl vsyscall_sysenter_start, vsyscall_sysenter_end 10 .globl vsyscall_sysenter_start, vsyscall_sysenter_end
11vsyscall_sysenter_start: 11vsyscall_sysenter_start:
12 .incbin "arch/i386/kernel/vsyscall-sysenter.so" 12 .incbin "arch/x86/kernel/vsyscall-sysenter_32.so"
13vsyscall_sysenter_end: 13vsyscall_sysenter_end:
14 14
15__FINIT 15__FINIT
diff --git a/arch/i386/kernel/vsyscall.lds.S b/arch/x86/kernel/vsyscall_32.lds.S
index 4a8b0ed9b8fb..4a8b0ed9b8fb 100644
--- a/arch/i386/kernel/vsyscall.lds.S
+++ b/arch/x86/kernel/vsyscall_32.lds.S
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86/kernel/vsyscall_64.c
index 06c34949bfdc..06c34949bfdc 100644
--- a/arch/x86_64/kernel/vsyscall.c
+++ b/arch/x86/kernel/vsyscall_64.c
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86/kernel/x8664_ksyms_64.c
index 77c25b307635..77c25b307635 100644
--- a/arch/x86_64/kernel/x8664_ksyms.c
+++ b/arch/x86/kernel/x8664_ksyms_64.c
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
new file mode 100644
index 000000000000..329da276c6f1
--- /dev/null
+++ b/arch/x86/lib/Makefile
@@ -0,0 +1,5 @@
1ifeq ($(CONFIG_X86_32),y)
2include ${srctree}/arch/x86/lib/Makefile_32
3else
4include ${srctree}/arch/x86/lib/Makefile_64
5endif
diff --git a/arch/x86/lib/Makefile_32 b/arch/x86/lib/Makefile_32
new file mode 100644
index 000000000000..98d1f1e2e2ef
--- /dev/null
+++ b/arch/x86/lib/Makefile_32
@@ -0,0 +1,11 @@
1#
2# Makefile for i386-specific library files..
3#
4
5
6lib-y = checksum_32.o delay_32.o usercopy_32.o getuser_32.o putuser_32.o memcpy_32.o strstr_32.o \
7 bitops_32.o semaphore_32.o string_32.o
8
9lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o
10
11obj-$(CONFIG_SMP) += msr-on-cpu.o
diff --git a/arch/x86/lib/Makefile_64 b/arch/x86/lib/Makefile_64
new file mode 100644
index 000000000000..bbabad3c9335
--- /dev/null
+++ b/arch/x86/lib/Makefile_64
@@ -0,0 +1,13 @@
1#
2# Makefile for x86_64-specific library files.
3#
4
5CFLAGS_csum-partial_64.o := -funroll-loops
6
7obj-y := io_64.o iomap_copy_64.o
8obj-$(CONFIG_SMP) += msr-on-cpu.o
9
10lib-y := csum-partial_64.o csum-copy_64.o csum-wrappers_64.o delay_64.o \
11 usercopy_64.o getuser_64.o putuser_64.o \
12 thunk_64.o clear_page_64.o copy_page_64.o bitstr_64.o bitops_64.o
13lib-y += memcpy_64.o memmove_64.o memset_64.o copy_user_64.o rwlock_64.o copy_user_nocache_64.o
diff --git a/arch/i386/lib/bitops.c b/arch/x86/lib/bitops_32.c
index afd0045595d4..afd0045595d4 100644
--- a/arch/i386/lib/bitops.c
+++ b/arch/x86/lib/bitops_32.c
diff --git a/arch/x86_64/lib/bitops.c b/arch/x86/lib/bitops_64.c
index 95b6d9639fba..95b6d9639fba 100644
--- a/arch/x86_64/lib/bitops.c
+++ b/arch/x86/lib/bitops_64.c
diff --git a/arch/x86_64/lib/bitstr.c b/arch/x86/lib/bitstr_64.c
index 24676609a6ac..24676609a6ac 100644
--- a/arch/x86_64/lib/bitstr.c
+++ b/arch/x86/lib/bitstr_64.c
diff --git a/arch/i386/lib/checksum.S b/arch/x86/lib/checksum_32.S
index adbccd0bbb78..adbccd0bbb78 100644
--- a/arch/i386/lib/checksum.S
+++ b/arch/x86/lib/checksum_32.S
diff --git a/arch/x86_64/lib/clear_page.S b/arch/x86/lib/clear_page_64.S
index 9a10a78bb4a4..9a10a78bb4a4 100644
--- a/arch/x86_64/lib/clear_page.S
+++ b/arch/x86/lib/clear_page_64.S
diff --git a/arch/x86_64/lib/copy_page.S b/arch/x86/lib/copy_page_64.S
index 727a5d46d2fc..727a5d46d2fc 100644
--- a/arch/x86_64/lib/copy_page.S
+++ b/arch/x86/lib/copy_page_64.S
diff --git a/arch/x86_64/lib/copy_user.S b/arch/x86/lib/copy_user_64.S
index 70bebd310408..70bebd310408 100644
--- a/arch/x86_64/lib/copy_user.S
+++ b/arch/x86/lib/copy_user_64.S
diff --git a/arch/x86_64/lib/copy_user_nocache.S b/arch/x86/lib/copy_user_nocache_64.S
index 4620efb12f13..4620efb12f13 100644
--- a/arch/x86_64/lib/copy_user_nocache.S
+++ b/arch/x86/lib/copy_user_nocache_64.S
diff --git a/arch/x86_64/lib/csum-copy.S b/arch/x86/lib/csum-copy_64.S
index f0dba36578ea..f0dba36578ea 100644
--- a/arch/x86_64/lib/csum-copy.S
+++ b/arch/x86/lib/csum-copy_64.S
diff --git a/arch/x86_64/lib/csum-partial.c b/arch/x86/lib/csum-partial_64.c
index bc503f506903..bc503f506903 100644
--- a/arch/x86_64/lib/csum-partial.c
+++ b/arch/x86/lib/csum-partial_64.c
diff --git a/arch/x86_64/lib/csum-wrappers.c b/arch/x86/lib/csum-wrappers_64.c
index fd42a4a095fc..fd42a4a095fc 100644
--- a/arch/x86_64/lib/csum-wrappers.c
+++ b/arch/x86/lib/csum-wrappers_64.c
diff --git a/arch/i386/lib/delay.c b/arch/x86/lib/delay_32.c
index f6edb11364df..f6edb11364df 100644
--- a/arch/i386/lib/delay.c
+++ b/arch/x86/lib/delay_32.c
diff --git a/arch/x86_64/lib/delay.c b/arch/x86/lib/delay_64.c
index 2dbebd308347..2dbebd308347 100644
--- a/arch/x86_64/lib/delay.c
+++ b/arch/x86/lib/delay_64.c
diff --git a/arch/i386/lib/getuser.S b/arch/x86/lib/getuser_32.S
index 6d84b53f12a2..6d84b53f12a2 100644
--- a/arch/i386/lib/getuser.S
+++ b/arch/x86/lib/getuser_32.S
diff --git a/arch/x86_64/lib/getuser.S b/arch/x86/lib/getuser_64.S
index 5448876261f8..5448876261f8 100644
--- a/arch/x86_64/lib/getuser.S
+++ b/arch/x86/lib/getuser_64.S
diff --git a/arch/x86_64/lib/io.c b/arch/x86/lib/io_64.c
index 87b4a4e18039..87b4a4e18039 100644
--- a/arch/x86_64/lib/io.c
+++ b/arch/x86/lib/io_64.c
diff --git a/arch/x86_64/lib/iomap_copy.S b/arch/x86/lib/iomap_copy_64.S
index 05a95e713da8..05a95e713da8 100644
--- a/arch/x86_64/lib/iomap_copy.S
+++ b/arch/x86/lib/iomap_copy_64.S
diff --git a/arch/i386/lib/memcpy.c b/arch/x86/lib/memcpy_32.c
index 8ac51b82a632..8ac51b82a632 100644
--- a/arch/i386/lib/memcpy.c
+++ b/arch/x86/lib/memcpy_32.c
diff --git a/arch/x86_64/lib/memcpy.S b/arch/x86/lib/memcpy_64.S
index c22981fa2f3a..c22981fa2f3a 100644
--- a/arch/x86_64/lib/memcpy.S
+++ b/arch/x86/lib/memcpy_64.S
diff --git a/arch/x86_64/lib/memmove.c b/arch/x86/lib/memmove_64.c
index 751ebae8ec42..751ebae8ec42 100644
--- a/arch/x86_64/lib/memmove.c
+++ b/arch/x86/lib/memmove_64.c
diff --git a/arch/x86_64/lib/memset.S b/arch/x86/lib/memset_64.S
index 2c5948116bd2..2c5948116bd2 100644
--- a/arch/x86_64/lib/memset.S
+++ b/arch/x86/lib/memset_64.S
diff --git a/arch/i386/lib/mmx.c b/arch/x86/lib/mmx_32.c
index 28084d2e8dd4..28084d2e8dd4 100644
--- a/arch/i386/lib/mmx.c
+++ b/arch/x86/lib/mmx_32.c
diff --git a/arch/i386/lib/msr-on-cpu.c b/arch/x86/lib/msr-on-cpu.c
index 7767962f25d3..7767962f25d3 100644
--- a/arch/i386/lib/msr-on-cpu.c
+++ b/arch/x86/lib/msr-on-cpu.c
diff --git a/arch/i386/lib/putuser.S b/arch/x86/lib/putuser_32.S
index f58fba109d18..f58fba109d18 100644
--- a/arch/i386/lib/putuser.S
+++ b/arch/x86/lib/putuser_32.S
diff --git a/arch/x86_64/lib/putuser.S b/arch/x86/lib/putuser_64.S
index 4989f5a8fa9b..4989f5a8fa9b 100644
--- a/arch/x86_64/lib/putuser.S
+++ b/arch/x86/lib/putuser_64.S
diff --git a/arch/x86_64/lib/rwlock.S b/arch/x86/lib/rwlock_64.S
index 0cde1f807314..0cde1f807314 100644
--- a/arch/x86_64/lib/rwlock.S
+++ b/arch/x86/lib/rwlock_64.S
diff --git a/arch/i386/lib/semaphore.S b/arch/x86/lib/semaphore_32.S
index c01eb39c0b43..c01eb39c0b43 100644
--- a/arch/i386/lib/semaphore.S
+++ b/arch/x86/lib/semaphore_32.S
diff --git a/arch/i386/lib/string.c b/arch/x86/lib/string_32.c
index 2c773fefa3dd..2c773fefa3dd 100644
--- a/arch/i386/lib/string.c
+++ b/arch/x86/lib/string_32.c
diff --git a/arch/i386/lib/strstr.c b/arch/x86/lib/strstr_32.c
index a3dafbf59dae..a3dafbf59dae 100644
--- a/arch/i386/lib/strstr.c
+++ b/arch/x86/lib/strstr_32.c
diff --git a/arch/x86_64/lib/thunk.S b/arch/x86/lib/thunk_64.S
index 55e586d352d3..55e586d352d3 100644
--- a/arch/x86_64/lib/thunk.S
+++ b/arch/x86/lib/thunk_64.S
diff --git a/arch/i386/lib/usercopy.c b/arch/x86/lib/usercopy_32.c
index 9f38b12b4af1..9f38b12b4af1 100644
--- a/arch/i386/lib/usercopy.c
+++ b/arch/x86/lib/usercopy_32.c
diff --git a/arch/x86_64/lib/usercopy.c b/arch/x86/lib/usercopy_64.c
index 893d43f838cc..893d43f838cc 100644
--- a/arch/x86_64/lib/usercopy.c
+++ b/arch/x86/lib/usercopy_64.c
diff --git a/arch/i386/mach-default/Makefile b/arch/x86/mach-default/Makefile
index 012fe34459e6..012fe34459e6 100644
--- a/arch/i386/mach-default/Makefile
+++ b/arch/x86/mach-default/Makefile
diff --git a/arch/i386/mach-default/setup.c b/arch/x86/mach-default/setup.c
index 7f635c7a2381..7f635c7a2381 100644
--- a/arch/i386/mach-default/setup.c
+++ b/arch/x86/mach-default/setup.c
diff --git a/arch/i386/mach-es7000/Makefile b/arch/x86/mach-es7000/Makefile
index 69dd4da218dc..69dd4da218dc 100644
--- a/arch/i386/mach-es7000/Makefile
+++ b/arch/x86/mach-es7000/Makefile
diff --git a/arch/i386/mach-es7000/es7000.h b/arch/x86/mach-es7000/es7000.h
index c8d5aa132fa0..c8d5aa132fa0 100644
--- a/arch/i386/mach-es7000/es7000.h
+++ b/arch/x86/mach-es7000/es7000.h
diff --git a/arch/i386/mach-es7000/es7000plat.c b/arch/x86/mach-es7000/es7000plat.c
index ab99072d3f9a..ab99072d3f9a 100644
--- a/arch/i386/mach-es7000/es7000plat.c
+++ b/arch/x86/mach-es7000/es7000plat.c
diff --git a/arch/x86/mach-generic/Makefile b/arch/x86/mach-generic/Makefile
new file mode 100644
index 000000000000..19d6d407737b
--- /dev/null
+++ b/arch/x86/mach-generic/Makefile
@@ -0,0 +1,8 @@
1#
2# Makefile for the generic architecture
3#
4
5EXTRA_CFLAGS := -Iarch/x86/kernel
6
7obj-y := probe.o summit.o bigsmp.o es7000.o default.o
8obj-y += ../../x86/mach-es7000/
diff --git a/arch/i386/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 58a477baec30..292a225edabe 100644
--- a/arch/i386/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -21,7 +21,7 @@
21 21
22static int dmi_bigsmp; /* can be set by dmi scanners */ 22static int dmi_bigsmp; /* can be set by dmi scanners */
23 23
24static int hp_ht_bigsmp(struct dmi_system_id *d) 24static int hp_ht_bigsmp(const struct dmi_system_id *d)
25{ 25{
26#ifdef CONFIG_X86_GENERICARCH 26#ifdef CONFIG_X86_GENERICARCH
27 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident); 27 printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
@@ -31,7 +31,7 @@ static int hp_ht_bigsmp(struct dmi_system_id *d)
31} 31}
32 32
33 33
34static struct dmi_system_id bigsmp_dmi_table[] = { 34static const struct dmi_system_id bigsmp_dmi_table[] = {
35 { hp_ht_bigsmp, "HP ProLiant DL760 G2", { 35 { hp_ht_bigsmp, "HP ProLiant DL760 G2", {
36 DMI_MATCH(DMI_BIOS_VENDOR, "HP"), 36 DMI_MATCH(DMI_BIOS_VENDOR, "HP"),
37 DMI_MATCH(DMI_BIOS_VERSION, "P44-"), 37 DMI_MATCH(DMI_BIOS_VERSION, "P44-"),
diff --git a/arch/i386/mach-generic/default.c b/arch/x86/mach-generic/default.c
index 8685208d8512..8685208d8512 100644
--- a/arch/i386/mach-generic/default.c
+++ b/arch/x86/mach-generic/default.c
diff --git a/arch/i386/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 4742626f08c4..4742626f08c4 100644
--- a/arch/i386/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
diff --git a/arch/i386/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
index 74f3da634423..74f3da634423 100644
--- a/arch/i386/mach-generic/probe.c
+++ b/arch/x86/mach-generic/probe.c
diff --git a/arch/i386/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 74883ccb8f73..74883ccb8f73 100644
--- a/arch/i386/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
diff --git a/arch/i386/mach-visws/Makefile b/arch/x86/mach-visws/Makefile
index 835fd96ad768..835fd96ad768 100644
--- a/arch/i386/mach-visws/Makefile
+++ b/arch/x86/mach-visws/Makefile
diff --git a/arch/i386/mach-visws/mpparse.c b/arch/x86/mach-visws/mpparse.c
index f3c74fab8b95..f3c74fab8b95 100644
--- a/arch/i386/mach-visws/mpparse.c
+++ b/arch/x86/mach-visws/mpparse.c
diff --git a/arch/i386/mach-visws/reboot.c b/arch/x86/mach-visws/reboot.c
index 99332abfad42..99332abfad42 100644
--- a/arch/i386/mach-visws/reboot.c
+++ b/arch/x86/mach-visws/reboot.c
diff --git a/arch/i386/mach-visws/setup.c b/arch/x86/mach-visws/setup.c
index 1f81f10e03a0..1f81f10e03a0 100644
--- a/arch/i386/mach-visws/setup.c
+++ b/arch/x86/mach-visws/setup.c
diff --git a/arch/i386/mach-visws/traps.c b/arch/x86/mach-visws/traps.c
index 843b67acf43b..843b67acf43b 100644
--- a/arch/i386/mach-visws/traps.c
+++ b/arch/x86/mach-visws/traps.c
diff --git a/arch/i386/mach-visws/visws_apic.c b/arch/x86/mach-visws/visws_apic.c
index 710faf71a650..710faf71a650 100644
--- a/arch/i386/mach-visws/visws_apic.c
+++ b/arch/x86/mach-visws/visws_apic.c
diff --git a/arch/i386/mach-voyager/Makefile b/arch/x86/mach-voyager/Makefile
index 33b74cf0dd22..15c250b371d3 100644
--- a/arch/i386/mach-voyager/Makefile
+++ b/arch/x86/mach-voyager/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5EXTRA_CFLAGS := -Iarch/i386/kernel 5EXTRA_CFLAGS := -Iarch/x86/kernel
6obj-y := setup.o voyager_basic.o voyager_thread.o 6obj-y := setup.o voyager_basic.o voyager_thread.o
7 7
8obj-$(CONFIG_SMP) += voyager_smp.o voyager_cat.o 8obj-$(CONFIG_SMP) += voyager_smp.o voyager_cat.o
diff --git a/arch/i386/mach-voyager/setup.c b/arch/x86/mach-voyager/setup.c
index 2b55694e6400..2b55694e6400 100644
--- a/arch/i386/mach-voyager/setup.c
+++ b/arch/x86/mach-voyager/setup.c
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/x86/mach-voyager/voyager_basic.c
index 9b77b39b71a6..9b77b39b71a6 100644
--- a/arch/i386/mach-voyager/voyager_basic.c
+++ b/arch/x86/mach-voyager/voyager_basic.c
diff --git a/arch/i386/mach-voyager/voyager_cat.c b/arch/x86/mach-voyager/voyager_cat.c
index 26a2d4c54b68..26a2d4c54b68 100644
--- a/arch/i386/mach-voyager/voyager_cat.c
+++ b/arch/x86/mach-voyager/voyager_cat.c
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c
index b87f8548e75a..b87f8548e75a 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/x86/mach-voyager/voyager_smp.c
diff --git a/arch/i386/mach-voyager/voyager_thread.c b/arch/x86/mach-voyager/voyager_thread.c
index f9d595338159..f9d595338159 100644
--- a/arch/i386/mach-voyager/voyager_thread.c
+++ b/arch/x86/mach-voyager/voyager_thread.c
diff --git a/arch/i386/math-emu/Makefile b/arch/x86/math-emu/Makefile
index 9c943fa6ce6b..9c943fa6ce6b 100644
--- a/arch/i386/math-emu/Makefile
+++ b/arch/x86/math-emu/Makefile
diff --git a/arch/i386/math-emu/README b/arch/x86/math-emu/README
index e6235491d6eb..e6235491d6eb 100644
--- a/arch/i386/math-emu/README
+++ b/arch/x86/math-emu/README
diff --git a/arch/i386/math-emu/control_w.h b/arch/x86/math-emu/control_w.h
index ae2274dbd305..ae2274dbd305 100644
--- a/arch/i386/math-emu/control_w.h
+++ b/arch/x86/math-emu/control_w.h
diff --git a/arch/i386/math-emu/div_Xsig.S b/arch/x86/math-emu/div_Xsig.S
index f77ba3058b31..f77ba3058b31 100644
--- a/arch/i386/math-emu/div_Xsig.S
+++ b/arch/x86/math-emu/div_Xsig.S
diff --git a/arch/i386/math-emu/div_small.S b/arch/x86/math-emu/div_small.S
index 47099628fa4c..47099628fa4c 100644
--- a/arch/i386/math-emu/div_small.S
+++ b/arch/x86/math-emu/div_small.S
diff --git a/arch/i386/math-emu/errors.c b/arch/x86/math-emu/errors.c
index a1b0d22f6978..a1b0d22f6978 100644
--- a/arch/i386/math-emu/errors.c
+++ b/arch/x86/math-emu/errors.c
diff --git a/arch/i386/math-emu/exception.h b/arch/x86/math-emu/exception.h
index b463f21a811e..b463f21a811e 100644
--- a/arch/i386/math-emu/exception.h
+++ b/arch/x86/math-emu/exception.h
diff --git a/arch/i386/math-emu/fpu_arith.c b/arch/x86/math-emu/fpu_arith.c
index 6972dec01af6..6972dec01af6 100644
--- a/arch/i386/math-emu/fpu_arith.c
+++ b/arch/x86/math-emu/fpu_arith.c
diff --git a/arch/i386/math-emu/fpu_asm.h b/arch/x86/math-emu/fpu_asm.h
index 9ba12416df12..9ba12416df12 100644
--- a/arch/i386/math-emu/fpu_asm.h
+++ b/arch/x86/math-emu/fpu_asm.h
diff --git a/arch/i386/math-emu/fpu_aux.c b/arch/x86/math-emu/fpu_aux.c
index 20886cfb9f76..20886cfb9f76 100644
--- a/arch/i386/math-emu/fpu_aux.c
+++ b/arch/x86/math-emu/fpu_aux.c
diff --git a/arch/i386/math-emu/fpu_emu.h b/arch/x86/math-emu/fpu_emu.h
index 65120f523853..65120f523853 100644
--- a/arch/i386/math-emu/fpu_emu.h
+++ b/arch/x86/math-emu/fpu_emu.h
diff --git a/arch/i386/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c
index 1853524c8b57..1853524c8b57 100644
--- a/arch/i386/math-emu/fpu_entry.c
+++ b/arch/x86/math-emu/fpu_entry.c
diff --git a/arch/i386/math-emu/fpu_etc.c b/arch/x86/math-emu/fpu_etc.c
index e3b5d465587f..e3b5d465587f 100644
--- a/arch/i386/math-emu/fpu_etc.c
+++ b/arch/x86/math-emu/fpu_etc.c
diff --git a/arch/i386/math-emu/fpu_proto.h b/arch/x86/math-emu/fpu_proto.h
index 37a8a7fe7e2b..37a8a7fe7e2b 100644
--- a/arch/i386/math-emu/fpu_proto.h
+++ b/arch/x86/math-emu/fpu_proto.h
diff --git a/arch/i386/math-emu/fpu_system.h b/arch/x86/math-emu/fpu_system.h
index a3ae28c49ddd..a3ae28c49ddd 100644
--- a/arch/i386/math-emu/fpu_system.h
+++ b/arch/x86/math-emu/fpu_system.h
diff --git a/arch/i386/math-emu/fpu_tags.c b/arch/x86/math-emu/fpu_tags.c
index cb436fe20e4c..cb436fe20e4c 100644
--- a/arch/i386/math-emu/fpu_tags.c
+++ b/arch/x86/math-emu/fpu_tags.c
diff --git a/arch/i386/math-emu/fpu_trig.c b/arch/x86/math-emu/fpu_trig.c
index 403cbde1d425..403cbde1d425 100644
--- a/arch/i386/math-emu/fpu_trig.c
+++ b/arch/x86/math-emu/fpu_trig.c
diff --git a/arch/i386/math-emu/get_address.c b/arch/x86/math-emu/get_address.c
index 2e2c51a8bd3a..2e2c51a8bd3a 100644
--- a/arch/i386/math-emu/get_address.c
+++ b/arch/x86/math-emu/get_address.c
diff --git a/arch/i386/math-emu/load_store.c b/arch/x86/math-emu/load_store.c
index eebd6fb1c8a8..eebd6fb1c8a8 100644
--- a/arch/i386/math-emu/load_store.c
+++ b/arch/x86/math-emu/load_store.c
diff --git a/arch/i386/math-emu/mul_Xsig.S b/arch/x86/math-emu/mul_Xsig.S
index 717785a53eb4..717785a53eb4 100644
--- a/arch/i386/math-emu/mul_Xsig.S
+++ b/arch/x86/math-emu/mul_Xsig.S
diff --git a/arch/i386/math-emu/poly.h b/arch/x86/math-emu/poly.h
index 4db798114923..4db798114923 100644
--- a/arch/i386/math-emu/poly.h
+++ b/arch/x86/math-emu/poly.h
diff --git a/arch/i386/math-emu/poly_2xm1.c b/arch/x86/math-emu/poly_2xm1.c
index 9766ad5e9743..9766ad5e9743 100644
--- a/arch/i386/math-emu/poly_2xm1.c
+++ b/arch/x86/math-emu/poly_2xm1.c
diff --git a/arch/i386/math-emu/poly_atan.c b/arch/x86/math-emu/poly_atan.c
index 82f702952f69..82f702952f69 100644
--- a/arch/i386/math-emu/poly_atan.c
+++ b/arch/x86/math-emu/poly_atan.c
diff --git a/arch/i386/math-emu/poly_l2.c b/arch/x86/math-emu/poly_l2.c
index dd00e1d5b074..dd00e1d5b074 100644
--- a/arch/i386/math-emu/poly_l2.c
+++ b/arch/x86/math-emu/poly_l2.c
diff --git a/arch/i386/math-emu/poly_sin.c b/arch/x86/math-emu/poly_sin.c
index a36313fb06f1..a36313fb06f1 100644
--- a/arch/i386/math-emu/poly_sin.c
+++ b/arch/x86/math-emu/poly_sin.c
diff --git a/arch/i386/math-emu/poly_tan.c b/arch/x86/math-emu/poly_tan.c
index 8df3e03b6e6f..8df3e03b6e6f 100644
--- a/arch/i386/math-emu/poly_tan.c
+++ b/arch/x86/math-emu/poly_tan.c
diff --git a/arch/i386/math-emu/polynom_Xsig.S b/arch/x86/math-emu/polynom_Xsig.S
index 17315c89ff3d..17315c89ff3d 100644
--- a/arch/i386/math-emu/polynom_Xsig.S
+++ b/arch/x86/math-emu/polynom_Xsig.S
diff --git a/arch/i386/math-emu/reg_add_sub.c b/arch/x86/math-emu/reg_add_sub.c
index 7cd3b37ac084..7cd3b37ac084 100644
--- a/arch/i386/math-emu/reg_add_sub.c
+++ b/arch/x86/math-emu/reg_add_sub.c
diff --git a/arch/i386/math-emu/reg_compare.c b/arch/x86/math-emu/reg_compare.c
index f37c5b5a35ad..f37c5b5a35ad 100644
--- a/arch/i386/math-emu/reg_compare.c
+++ b/arch/x86/math-emu/reg_compare.c
diff --git a/arch/i386/math-emu/reg_constant.c b/arch/x86/math-emu/reg_constant.c
index a85015801969..a85015801969 100644
--- a/arch/i386/math-emu/reg_constant.c
+++ b/arch/x86/math-emu/reg_constant.c
diff --git a/arch/i386/math-emu/reg_constant.h b/arch/x86/math-emu/reg_constant.h
index 1bffaec3a134..1bffaec3a134 100644
--- a/arch/i386/math-emu/reg_constant.h
+++ b/arch/x86/math-emu/reg_constant.h
diff --git a/arch/i386/math-emu/reg_convert.c b/arch/x86/math-emu/reg_convert.c
index 45a258752703..45a258752703 100644
--- a/arch/i386/math-emu/reg_convert.c
+++ b/arch/x86/math-emu/reg_convert.c
diff --git a/arch/i386/math-emu/reg_divide.c b/arch/x86/math-emu/reg_divide.c
index 5cee7ff920d9..5cee7ff920d9 100644
--- a/arch/i386/math-emu/reg_divide.c
+++ b/arch/x86/math-emu/reg_divide.c
diff --git a/arch/i386/math-emu/reg_ld_str.c b/arch/x86/math-emu/reg_ld_str.c
index e976caef6498..e976caef6498 100644
--- a/arch/i386/math-emu/reg_ld_str.c
+++ b/arch/x86/math-emu/reg_ld_str.c
diff --git a/arch/i386/math-emu/reg_mul.c b/arch/x86/math-emu/reg_mul.c
index 40f50b61bc67..40f50b61bc67 100644
--- a/arch/i386/math-emu/reg_mul.c
+++ b/arch/x86/math-emu/reg_mul.c
diff --git a/arch/i386/math-emu/reg_norm.S b/arch/x86/math-emu/reg_norm.S
index 8b6352efceef..8b6352efceef 100644
--- a/arch/i386/math-emu/reg_norm.S
+++ b/arch/x86/math-emu/reg_norm.S
diff --git a/arch/i386/math-emu/reg_round.S b/arch/x86/math-emu/reg_round.S
index d1d4e48b4f67..d1d4e48b4f67 100644
--- a/arch/i386/math-emu/reg_round.S
+++ b/arch/x86/math-emu/reg_round.S
diff --git a/arch/i386/math-emu/reg_u_add.S b/arch/x86/math-emu/reg_u_add.S
index 47c4c2434d85..47c4c2434d85 100644
--- a/arch/i386/math-emu/reg_u_add.S
+++ b/arch/x86/math-emu/reg_u_add.S
diff --git a/arch/i386/math-emu/reg_u_div.S b/arch/x86/math-emu/reg_u_div.S
index cc00654b6f9a..cc00654b6f9a 100644
--- a/arch/i386/math-emu/reg_u_div.S
+++ b/arch/x86/math-emu/reg_u_div.S
diff --git a/arch/i386/math-emu/reg_u_mul.S b/arch/x86/math-emu/reg_u_mul.S
index 973f12af97df..973f12af97df 100644
--- a/arch/i386/math-emu/reg_u_mul.S
+++ b/arch/x86/math-emu/reg_u_mul.S
diff --git a/arch/i386/math-emu/reg_u_sub.S b/arch/x86/math-emu/reg_u_sub.S
index 1b6c24801d22..1b6c24801d22 100644
--- a/arch/i386/math-emu/reg_u_sub.S
+++ b/arch/x86/math-emu/reg_u_sub.S
diff --git a/arch/i386/math-emu/round_Xsig.S b/arch/x86/math-emu/round_Xsig.S
index bbe0e87718e4..bbe0e87718e4 100644
--- a/arch/i386/math-emu/round_Xsig.S
+++ b/arch/x86/math-emu/round_Xsig.S
diff --git a/arch/i386/math-emu/shr_Xsig.S b/arch/x86/math-emu/shr_Xsig.S
index 31cdd118e918..31cdd118e918 100644
--- a/arch/i386/math-emu/shr_Xsig.S
+++ b/arch/x86/math-emu/shr_Xsig.S
diff --git a/arch/i386/math-emu/status_w.h b/arch/x86/math-emu/status_w.h
index 59e73302aa60..59e73302aa60 100644
--- a/arch/i386/math-emu/status_w.h
+++ b/arch/x86/math-emu/status_w.h
diff --git a/arch/i386/math-emu/version.h b/arch/x86/math-emu/version.h
index a0d73a1d2b67..a0d73a1d2b67 100644
--- a/arch/i386/math-emu/version.h
+++ b/arch/x86/math-emu/version.h
diff --git a/arch/i386/math-emu/wm_shrx.S b/arch/x86/math-emu/wm_shrx.S
index 518428317985..518428317985 100644
--- a/arch/i386/math-emu/wm_shrx.S
+++ b/arch/x86/math-emu/wm_shrx.S
diff --git a/arch/i386/math-emu/wm_sqrt.S b/arch/x86/math-emu/wm_sqrt.S
index d258f59564e1..d258f59564e1 100644
--- a/arch/i386/math-emu/wm_sqrt.S
+++ b/arch/x86/math-emu/wm_sqrt.S
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
new file mode 100644
index 000000000000..983291096848
--- /dev/null
+++ b/arch/x86/mm/Makefile
@@ -0,0 +1,5 @@
1ifeq ($(CONFIG_X86_32),y)
2include ${srctree}/arch/x86/mm/Makefile_32
3else
4include ${srctree}/arch/x86/mm/Makefile_64
5endif
diff --git a/arch/x86/mm/Makefile_32 b/arch/x86/mm/Makefile_32
new file mode 100644
index 000000000000..362b4ad082de
--- /dev/null
+++ b/arch/x86/mm/Makefile_32
@@ -0,0 +1,10 @@
1#
2# Makefile for the linux i386-specific parts of the memory manager.
3#
4
5obj-y := init_32.o pgtable_32.o fault_32.o ioremap_32.o extable_32.o pageattr_32.o mmap_32.o
6
7obj-$(CONFIG_NUMA) += discontig_32.o
8obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
9obj-$(CONFIG_HIGHMEM) += highmem_32.o
10obj-$(CONFIG_BOOT_IOREMAP) += boot_ioremap_32.o
diff --git a/arch/x86/mm/Makefile_64 b/arch/x86/mm/Makefile_64
new file mode 100644
index 000000000000..6bcb47945b87
--- /dev/null
+++ b/arch/x86/mm/Makefile_64
@@ -0,0 +1,10 @@
1#
2# Makefile for the linux x86_64-specific parts of the memory manager.
3#
4
5obj-y := init_64.o fault_64.o ioremap_64.o extable_64.o pageattr_64.o mmap_64.o
6obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
7obj-$(CONFIG_NUMA) += numa_64.o
8obj-$(CONFIG_K8_NUMA) += k8topology_64.o
9obj-$(CONFIG_ACPI_NUMA) += srat_64.o
10
diff --git a/arch/i386/mm/boot_ioremap.c b/arch/x86/mm/boot_ioremap_32.c
index 4de95a17a7d4..4de95a17a7d4 100644
--- a/arch/i386/mm/boot_ioremap.c
+++ b/arch/x86/mm/boot_ioremap_32.c
diff --git a/arch/i386/mm/discontig.c b/arch/x86/mm/discontig_32.c
index 860e912a3fbb..860e912a3fbb 100644
--- a/arch/i386/mm/discontig.c
+++ b/arch/x86/mm/discontig_32.c
diff --git a/arch/i386/mm/extable.c b/arch/x86/mm/extable_32.c
index 0ce4f22a2635..0ce4f22a2635 100644
--- a/arch/i386/mm/extable.c
+++ b/arch/x86/mm/extable_32.c
diff --git a/arch/x86_64/mm/extable.c b/arch/x86/mm/extable_64.c
index 79ac6e7100af..79ac6e7100af 100644
--- a/arch/x86_64/mm/extable.c
+++ b/arch/x86/mm/extable_64.c
diff --git a/arch/i386/mm/fault.c b/arch/x86/mm/fault_32.c
index fcb38e7f3543..fcb38e7f3543 100644
--- a/arch/i386/mm/fault.c
+++ b/arch/x86/mm/fault_32.c
diff --git a/arch/x86_64/mm/fault.c b/arch/x86/mm/fault_64.c
index 54816adb8e93..54816adb8e93 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86/mm/fault_64.c
diff --git a/arch/i386/mm/highmem.c b/arch/x86/mm/highmem_32.c
index 1c3bf95f7356..1c3bf95f7356 100644
--- a/arch/i386/mm/highmem.c
+++ b/arch/x86/mm/highmem_32.c
diff --git a/arch/i386/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 6c06d9c0488e..6c06d9c0488e 100644
--- a/arch/i386/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
diff --git a/arch/i386/mm/init.c b/arch/x86/mm/init_32.c
index 730a5b177b1f..730a5b177b1f 100644
--- a/arch/i386/mm/init.c
+++ b/arch/x86/mm/init_32.c
diff --git a/arch/x86_64/mm/init.c b/arch/x86/mm/init_64.c
index 458893b376f8..458893b376f8 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86/mm/init_64.c
diff --git a/arch/i386/mm/ioremap.c b/arch/x86/mm/ioremap_32.c
index 0b278315d737..0b278315d737 100644
--- a/arch/i386/mm/ioremap.c
+++ b/arch/x86/mm/ioremap_32.c
diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86/mm/ioremap_64.c
index 6cac90aa5032..6cac90aa5032 100644
--- a/arch/x86_64/mm/ioremap.c
+++ b/arch/x86/mm/ioremap_64.c
diff --git a/arch/x86_64/mm/k8topology.c b/arch/x86/mm/k8topology_64.c
index a96006f7ae0c..a96006f7ae0c 100644
--- a/arch/x86_64/mm/k8topology.c
+++ b/arch/x86/mm/k8topology_64.c
diff --git a/arch/i386/mm/mmap.c b/arch/x86/mm/mmap_32.c
index 552e08473755..552e08473755 100644
--- a/arch/i386/mm/mmap.c
+++ b/arch/x86/mm/mmap_32.c
diff --git a/arch/x86_64/mm/mmap.c b/arch/x86/mm/mmap_64.c
index 80bba0dc000e..80bba0dc000e 100644
--- a/arch/x86_64/mm/mmap.c
+++ b/arch/x86/mm/mmap_64.c
diff --git a/arch/x86_64/mm/numa.c b/arch/x86/mm/numa_64.c
index 6da235522269..6da235522269 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86/mm/numa_64.c
diff --git a/arch/i386/mm/pageattr.c b/arch/x86/mm/pageattr_32.c
index 4241a74d16c8..4241a74d16c8 100644
--- a/arch/i386/mm/pageattr.c
+++ b/arch/x86/mm/pageattr_32.c
diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86/mm/pageattr_64.c
index 10b9809ce821..10b9809ce821 100644
--- a/arch/x86_64/mm/pageattr.c
+++ b/arch/x86/mm/pageattr_64.c
diff --git a/arch/i386/mm/pgtable.c b/arch/x86/mm/pgtable_32.c
index 01437c46baae..01437c46baae 100644
--- a/arch/i386/mm/pgtable.c
+++ b/arch/x86/mm/pgtable_32.c
diff --git a/arch/x86_64/mm/srat.c b/arch/x86/mm/srat_64.c
index acdf03e19146..acdf03e19146 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86/mm/srat_64.c
diff --git a/arch/i386/oprofile/Kconfig b/arch/x86/oprofile/Kconfig
index d8a84088471a..d8a84088471a 100644
--- a/arch/i386/oprofile/Kconfig
+++ b/arch/x86/oprofile/Kconfig
diff --git a/arch/i386/oprofile/Makefile b/arch/x86/oprofile/Makefile
index 30f3eb366667..30f3eb366667 100644
--- a/arch/i386/oprofile/Makefile
+++ b/arch/x86/oprofile/Makefile
diff --git a/arch/i386/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c
index c049ce414f01..c049ce414f01 100644
--- a/arch/i386/oprofile/backtrace.c
+++ b/arch/x86/oprofile/backtrace.c
diff --git a/arch/i386/oprofile/init.c b/arch/x86/oprofile/init.c
index 5341d481d92f..5341d481d92f 100644
--- a/arch/i386/oprofile/init.c
+++ b/arch/x86/oprofile/init.c
diff --git a/arch/i386/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 11b7a51566a8..11b7a51566a8 100644
--- a/arch/i386/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
diff --git a/arch/i386/oprofile/nmi_timer_int.c b/arch/x86/oprofile/nmi_timer_int.c
index 1418e36ae7ab..1418e36ae7ab 100644
--- a/arch/i386/oprofile/nmi_timer_int.c
+++ b/arch/x86/oprofile/nmi_timer_int.c
diff --git a/arch/i386/oprofile/op_counter.h b/arch/x86/oprofile/op_counter.h
index 2880b15c4675..2880b15c4675 100644
--- a/arch/i386/oprofile/op_counter.h
+++ b/arch/x86/oprofile/op_counter.h
diff --git a/arch/i386/oprofile/op_model_athlon.c b/arch/x86/oprofile/op_model_athlon.c
index 3057a19e4641..3057a19e4641 100644
--- a/arch/i386/oprofile/op_model_athlon.c
+++ b/arch/x86/oprofile/op_model_athlon.c
diff --git a/arch/i386/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c
index 47925927b12f..47925927b12f 100644
--- a/arch/i386/oprofile/op_model_p4.c
+++ b/arch/x86/oprofile/op_model_p4.c
diff --git a/arch/i386/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
index c554f52cb808..c554f52cb808 100644
--- a/arch/i386/oprofile/op_model_ppro.c
+++ b/arch/x86/oprofile/op_model_ppro.c
diff --git a/arch/i386/oprofile/op_x86_model.h b/arch/x86/oprofile/op_x86_model.h
index abb1aa95b979..abb1aa95b979 100644
--- a/arch/i386/oprofile/op_x86_model.h
+++ b/arch/x86/oprofile/op_x86_model.h
diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile
new file mode 100644
index 000000000000..c5c8e485fc44
--- /dev/null
+++ b/arch/x86/pci/Makefile
@@ -0,0 +1,5 @@
1ifeq ($(CONFIG_X86_32),y)
2include ${srctree}/arch/x86/pci/Makefile_32
3else
4include ${srctree}/arch/x86/pci/Makefile_64
5endif
diff --git a/arch/i386/pci/Makefile b/arch/x86/pci/Makefile_32
index 44650e03308b..cdd6828b5abb 100644
--- a/arch/i386/pci/Makefile
+++ b/arch/x86/pci/Makefile_32
@@ -1,7 +1,7 @@
1obj-y := i386.o init.o 1obj-y := i386.o init.o
2 2
3obj-$(CONFIG_PCI_BIOS) += pcbios.o 3obj-$(CONFIG_PCI_BIOS) += pcbios.o
4obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o mmconfig-shared.o 4obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_32.o direct.o mmconfig-shared.o
5obj-$(CONFIG_PCI_DIRECT) += direct.o 5obj-$(CONFIG_PCI_DIRECT) += direct.o
6 6
7pci-y := fixup.o 7pci-y := fixup.o
diff --git a/arch/x86/pci/Makefile_64 b/arch/x86/pci/Makefile_64
new file mode 100644
index 000000000000..7d8c467bf143
--- /dev/null
+++ b/arch/x86/pci/Makefile_64
@@ -0,0 +1,17 @@
1#
2# Makefile for X86_64 specific PCI routines
3#
4# Reuse the i386 PCI subsystem
5#
6EXTRA_CFLAGS += -Iarch/x86/pci
7
8obj-y := i386.o
9obj-$(CONFIG_PCI_DIRECT)+= direct.o
10obj-y += fixup.o init.o
11obj-$(CONFIG_ACPI) += acpi.o
12obj-y += legacy.o irq.o common.o early.o
13# mmconfig has a 64bit special
14obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_64.o direct.o mmconfig-shared.o
15
16obj-$(CONFIG_NUMA) += k8-bus_64.o
17
diff --git a/arch/i386/pci/acpi.c b/arch/x86/pci/acpi.c
index bc8a44bddaa7..bc8a44bddaa7 100644
--- a/arch/i386/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
diff --git a/arch/i386/pci/common.c b/arch/x86/pci/common.c
index ebc6f3c66340..07d5223442bf 100644
--- a/arch/i386/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -123,7 +123,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *b)
123 * on the kernel command line (which was parsed earlier). 123 * on the kernel command line (which was parsed earlier).
124 */ 124 */
125 125
126static int __devinit set_bf_sort(struct dmi_system_id *d) 126static int __devinit set_bf_sort(const struct dmi_system_id *d)
127{ 127{
128 if (pci_bf_sort == pci_bf_sort_default) { 128 if (pci_bf_sort == pci_bf_sort_default) {
129 pci_bf_sort = pci_dmi_bf; 129 pci_bf_sort = pci_dmi_bf;
@@ -136,7 +136,7 @@ static int __devinit set_bf_sort(struct dmi_system_id *d)
136 * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus) 136 * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
137 */ 137 */
138#ifdef __i386__ 138#ifdef __i386__
139static int __devinit assign_all_busses(struct dmi_system_id *d) 139static int __devinit assign_all_busses(const struct dmi_system_id *d)
140{ 140{
141 pci_probe |= PCI_ASSIGN_ALL_BUSSES; 141 pci_probe |= PCI_ASSIGN_ALL_BUSSES;
142 printk(KERN_INFO "%s detected: enabling PCI bus# renumbering" 142 printk(KERN_INFO "%s detected: enabling PCI bus# renumbering"
diff --git a/arch/i386/pci/direct.c b/arch/x86/pci/direct.c
index 431c9a51b157..431c9a51b157 100644
--- a/arch/i386/pci/direct.c
+++ b/arch/x86/pci/direct.c
diff --git a/arch/i386/pci/early.c b/arch/x86/pci/early.c
index 42df4b6606df..42df4b6606df 100644
--- a/arch/i386/pci/early.c
+++ b/arch/x86/pci/early.c
diff --git a/arch/i386/pci/fixup.c b/arch/x86/pci/fixup.c
index c82cbf4c7226..c82cbf4c7226 100644
--- a/arch/i386/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
diff --git a/arch/i386/pci/i386.c b/arch/x86/pci/i386.c
index bcd2f94b732c..bcd2f94b732c 100644
--- a/arch/i386/pci/i386.c
+++ b/arch/x86/pci/i386.c
diff --git a/arch/i386/pci/init.c b/arch/x86/pci/init.c
index 3de9f9ba2da6..3de9f9ba2da6 100644
--- a/arch/i386/pci/init.c
+++ b/arch/x86/pci/init.c
diff --git a/arch/i386/pci/irq.c b/arch/x86/pci/irq.c
index 8434f2323b87..d98c6b096f8e 100644
--- a/arch/i386/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -1010,7 +1010,7 @@ static void __init pcibios_fixup_irqs(void)
1010 * Work around broken HP Pavilion Notebooks which assign USB to 1010 * Work around broken HP Pavilion Notebooks which assign USB to
1011 * IRQ 9 even though it is actually wired to IRQ 11 1011 * IRQ 9 even though it is actually wired to IRQ 11
1012 */ 1012 */
1013static int __init fix_broken_hp_bios_irq9(struct dmi_system_id *d) 1013static int __init fix_broken_hp_bios_irq9(const struct dmi_system_id *d)
1014{ 1014{
1015 if (!broken_hp_bios_irq9) { 1015 if (!broken_hp_bios_irq9) {
1016 broken_hp_bios_irq9 = 1; 1016 broken_hp_bios_irq9 = 1;
@@ -1023,7 +1023,7 @@ static int __init fix_broken_hp_bios_irq9(struct dmi_system_id *d)
1023 * Work around broken Acer TravelMate 360 Notebooks which assign 1023 * Work around broken Acer TravelMate 360 Notebooks which assign
1024 * Cardbus to IRQ 11 even though it is actually wired to IRQ 10 1024 * Cardbus to IRQ 11 even though it is actually wired to IRQ 10
1025 */ 1025 */
1026static int __init fix_acer_tm360_irqrouting(struct dmi_system_id *d) 1026static int __init fix_acer_tm360_irqrouting(const struct dmi_system_id *d)
1027{ 1027{
1028 if (!acer_tm360_irqrouting) { 1028 if (!acer_tm360_irqrouting) {
1029 acer_tm360_irqrouting = 1; 1029 acer_tm360_irqrouting = 1;
diff --git a/arch/x86_64/pci/k8-bus.c b/arch/x86/pci/k8-bus_64.c
index 9cc813e29706..9cc813e29706 100644
--- a/arch/x86_64/pci/k8-bus.c
+++ b/arch/x86/pci/k8-bus_64.c
diff --git a/arch/i386/pci/legacy.c b/arch/x86/pci/legacy.c
index 5565d7016b75..5565d7016b75 100644
--- a/arch/i386/pci/legacy.c
+++ b/arch/x86/pci/legacy.c
diff --git a/arch/i386/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 4df637e34f81..4df637e34f81 100644
--- a/arch/i386/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
diff --git a/arch/i386/pci/mmconfig.c b/arch/x86/pci/mmconfig_32.c
index 1bf5816d34c8..1bf5816d34c8 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/x86/pci/mmconfig_32.c
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86/pci/mmconfig_64.c
index 4095e4d66a1d..4095e4d66a1d 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86/pci/mmconfig_64.c
diff --git a/arch/i386/pci/numa.c b/arch/x86/pci/numa.c
index f5f165f69e0c..f5f165f69e0c 100644
--- a/arch/i386/pci/numa.c
+++ b/arch/x86/pci/numa.c
diff --git a/arch/i386/pci/pcbios.c b/arch/x86/pci/pcbios.c
index 10ac8c316c46..10ac8c316c46 100644
--- a/arch/i386/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
diff --git a/arch/i386/pci/pci.h b/arch/x86/pci/pci.h
index 8c66f275756f..8c66f275756f 100644
--- a/arch/i386/pci/pci.h
+++ b/arch/x86/pci/pci.h
diff --git a/arch/i386/pci/visws.c b/arch/x86/pci/visws.c
index 8ecb1c722594..8ecb1c722594 100644
--- a/arch/i386/pci/visws.c
+++ b/arch/x86/pci/visws.c
diff --git a/arch/i386/power/Makefile b/arch/x86/power/Makefile
index d764ec950065..d764ec950065 100644
--- a/arch/i386/power/Makefile
+++ b/arch/x86/power/Makefile
diff --git a/arch/i386/power/cpu.c b/arch/x86/power/cpu.c
index 998fd3ec0d68..998fd3ec0d68 100644
--- a/arch/i386/power/cpu.c
+++ b/arch/x86/power/cpu.c
diff --git a/arch/i386/power/suspend.c b/arch/x86/power/suspend.c
index a0020b913f31..a0020b913f31 100644
--- a/arch/i386/power/suspend.c
+++ b/arch/x86/power/suspend.c
diff --git a/arch/i386/power/swsusp.S b/arch/x86/power/swsusp.S
index 53662e05b393..53662e05b393 100644
--- a/arch/i386/power/swsusp.S
+++ b/arch/x86/power/swsusp.S
diff --git a/arch/x86_64/vdso/.gitignore b/arch/x86/vdso/.gitignore
index f8b69d84238e..f8b69d84238e 100644
--- a/arch/x86_64/vdso/.gitignore
+++ b/arch/x86/vdso/.gitignore
diff --git a/arch/x86_64/vdso/Makefile b/arch/x86/vdso/Makefile
index 8d03de029d9b..8d03de029d9b 100644
--- a/arch/x86_64/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
diff --git a/arch/x86_64/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c
index 5b54cdfb2b07..5b54cdfb2b07 100644
--- a/arch/x86_64/vdso/vclock_gettime.c
+++ b/arch/x86/vdso/vclock_gettime.c
diff --git a/arch/x86_64/vdso/vdso-note.S b/arch/x86/vdso/vdso-note.S
index 79a071e4357e..79a071e4357e 100644
--- a/arch/x86_64/vdso/vdso-note.S
+++ b/arch/x86/vdso/vdso-note.S
diff --git a/arch/x86_64/vdso/vdso-start.S b/arch/x86/vdso/vdso-start.S
index 2dc2cdb84d67..2dc2cdb84d67 100644
--- a/arch/x86_64/vdso/vdso-start.S
+++ b/arch/x86/vdso/vdso-start.S
diff --git a/arch/x86/vdso/vdso.S b/arch/x86/vdso/vdso.S
new file mode 100644
index 000000000000..4b1620a1529e
--- /dev/null
+++ b/arch/x86/vdso/vdso.S
@@ -0,0 +1,2 @@
1 .section ".vdso","a"
2 .incbin "arch/x86/vdso/vdso.so"
diff --git a/arch/x86_64/vdso/vdso.lds.S b/arch/x86/vdso/vdso.lds.S
index b9a60e665d08..b9a60e665d08 100644
--- a/arch/x86_64/vdso/vdso.lds.S
+++ b/arch/x86/vdso/vdso.lds.S
diff --git a/arch/x86_64/vdso/vextern.h b/arch/x86/vdso/vextern.h
index 1683ba2ae3e8..1683ba2ae3e8 100644
--- a/arch/x86_64/vdso/vextern.h
+++ b/arch/x86/vdso/vextern.h
diff --git a/arch/x86_64/vdso/vgetcpu.c b/arch/x86/vdso/vgetcpu.c
index 91f6e85d0fc2..91f6e85d0fc2 100644
--- a/arch/x86_64/vdso/vgetcpu.c
+++ b/arch/x86/vdso/vgetcpu.c
diff --git a/arch/x86_64/vdso/vma.c b/arch/x86/vdso/vma.c
index ff9333e5fb08..ff9333e5fb08 100644
--- a/arch/x86_64/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
diff --git a/arch/x86_64/vdso/voffset.h b/arch/x86/vdso/voffset.h
index 4af67c79085f..4af67c79085f 100644
--- a/arch/x86_64/vdso/voffset.h
+++ b/arch/x86/vdso/voffset.h
diff --git a/arch/x86_64/vdso/vvar.c b/arch/x86/vdso/vvar.c
index 6fc22219a472..6fc22219a472 100644
--- a/arch/x86_64/vdso/vvar.c
+++ b/arch/x86/vdso/vvar.c
diff --git a/arch/i386/video/Makefile b/arch/x86/video/Makefile
index 2c447c94adcc..2c447c94adcc 100644
--- a/arch/i386/video/Makefile
+++ b/arch/x86/video/Makefile
diff --git a/arch/i386/video/fbdev.c b/arch/x86/video/fbdev.c
index 48fb38d7d2c0..48fb38d7d2c0 100644
--- a/arch/i386/video/fbdev.c
+++ b/arch/x86/video/fbdev.c
diff --git a/arch/i386/xen/Kconfig b/arch/x86/xen/Kconfig
index 9df99e1885a4..9df99e1885a4 100644
--- a/arch/i386/xen/Kconfig
+++ b/arch/x86/xen/Kconfig
diff --git a/arch/i386/xen/Makefile b/arch/x86/xen/Makefile
index 343df246bd3e..343df246bd3e 100644
--- a/arch/i386/xen/Makefile
+++ b/arch/x86/xen/Makefile
diff --git a/arch/i386/xen/enlighten.c b/arch/x86/xen/enlighten.c
index f01bfcd4bdee..f01bfcd4bdee 100644
--- a/arch/i386/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
diff --git a/arch/i386/xen/events.c b/arch/x86/xen/events.c
index da1b173547a1..da1b173547a1 100644
--- a/arch/i386/xen/events.c
+++ b/arch/x86/xen/events.c
diff --git a/arch/i386/xen/features.c b/arch/x86/xen/features.c
index 0707714e40d6..0707714e40d6 100644
--- a/arch/i386/xen/features.c
+++ b/arch/x86/xen/features.c
diff --git a/arch/i386/xen/manage.c b/arch/x86/xen/manage.c
index aa7af9e6abc0..aa7af9e6abc0 100644
--- a/arch/i386/xen/manage.c
+++ b/arch/x86/xen/manage.c
diff --git a/arch/i386/xen/mmu.c b/arch/x86/xen/mmu.c
index 874db0cd1d2a..874db0cd1d2a 100644
--- a/arch/i386/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
diff --git a/arch/i386/xen/mmu.h b/arch/x86/xen/mmu.h
index c9ff27f3ac3a..c9ff27f3ac3a 100644
--- a/arch/i386/xen/mmu.h
+++ b/arch/x86/xen/mmu.h
diff --git a/arch/i386/xen/multicalls.c b/arch/x86/xen/multicalls.c
index c837e8e463db..c837e8e463db 100644
--- a/arch/i386/xen/multicalls.c
+++ b/arch/x86/xen/multicalls.c
diff --git a/arch/i386/xen/multicalls.h b/arch/x86/xen/multicalls.h
index e6f7530b156c..e6f7530b156c 100644
--- a/arch/i386/xen/multicalls.h
+++ b/arch/x86/xen/multicalls.h
diff --git a/arch/i386/xen/setup.c b/arch/x86/xen/setup.c
index f84e77226646..f84e77226646 100644
--- a/arch/i386/xen/setup.c
+++ b/arch/x86/xen/setup.c
diff --git a/arch/i386/xen/smp.c b/arch/x86/xen/smp.c
index 557b8e24706a..557b8e24706a 100644
--- a/arch/i386/xen/smp.c
+++ b/arch/x86/xen/smp.c
diff --git a/arch/i386/xen/time.c b/arch/x86/xen/time.c
index dfd6db69ead5..dfd6db69ead5 100644
--- a/arch/i386/xen/time.c
+++ b/arch/x86/xen/time.c
diff --git a/arch/i386/xen/vdso.h b/arch/x86/xen/vdso.h
index 861fedfe5230..861fedfe5230 100644
--- a/arch/i386/xen/vdso.h
+++ b/arch/x86/xen/vdso.h
diff --git a/arch/i386/xen/xen-asm.S b/arch/x86/xen/xen-asm.S
index 1a43b60c0c62..1a43b60c0c62 100644
--- a/arch/i386/xen/xen-asm.S
+++ b/arch/x86/xen/xen-asm.S
diff --git a/arch/i386/xen/xen-head.S b/arch/x86/xen/xen-head.S
index f8d6937db2ec..f8d6937db2ec 100644
--- a/arch/i386/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
diff --git a/arch/i386/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index b9aaea45f07f..b9aaea45f07f 100644
--- a/arch/i386/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index b4d9089a6a06..eb80f5aca54e 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -36,6 +36,18 @@ config GENERIC_CMOS_UPDATE
36 bool 36 bool
37 default y 37 default y
38 38
39config CLOCKSOURCE_WATCHDOG
40 bool
41 default y
42
43config GENERIC_CLOCKEVENTS
44 bool
45 default y
46
47config GENERIC_CLOCKEVENTS_BROADCAST
48 bool
49 default y
50
39config ZONE_DMA32 51config ZONE_DMA32
40 bool 52 bool
41 default y 53 default y
@@ -130,6 +142,8 @@ source "init/Kconfig"
130 142
131menu "Processor type and features" 143menu "Processor type and features"
132 144
145source "kernel/time/Kconfig"
146
133choice 147choice
134 prompt "Subarchitecture Type" 148 prompt "Subarchitecture Type"
135 default X86_PC 149 default X86_PC
@@ -704,7 +718,7 @@ source kernel/power/Kconfig
704 718
705source "drivers/acpi/Kconfig" 719source "drivers/acpi/Kconfig"
706 720
707source "arch/x86_64/kernel/cpufreq/Kconfig" 721source "arch/x86/kernel/cpufreq/Kconfig"
708 722
709endmenu 723endmenu
710 724
@@ -778,7 +792,7 @@ source fs/Kconfig
778menu "Instrumentation Support" 792menu "Instrumentation Support"
779 depends on EXPERIMENTAL 793 depends on EXPERIMENTAL
780 794
781source "arch/x86_64/oprofile/Kconfig" 795source "arch/x86/oprofile/Kconfig"
782 796
783config KPROBES 797config KPROBES
784 bool "Kprobes" 798 bool "Kprobes"
diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile
index b024e4a86895..8bffb94c71b5 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86_64/Makefile
@@ -21,6 +21,9 @@
21# 21#
22# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $ 22# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $
23 23
24# Fill in SRCARCH
25SRCARCH := x86
26
24LDFLAGS := -m elf_x86_64 27LDFLAGS := -m elf_x86_64
25OBJCOPYFLAGS := -O binary -R .note -R .comment -S 28OBJCOPYFLAGS := -O binary -R .note -R .comment -S
26LDFLAGS_vmlinux := 29LDFLAGS_vmlinux :=
@@ -71,18 +74,18 @@ CFLAGS += $(cflags-y)
71CFLAGS_KERNEL += $(cflags-kernel-y) 74CFLAGS_KERNEL += $(cflags-kernel-y)
72AFLAGS += -m64 75AFLAGS += -m64
73 76
74head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o 77head-y := arch/x86/kernel/head_64.o arch/x86/kernel/head64.o arch/x86/kernel/init_task_64.o
75 78
76libs-y += arch/x86_64/lib/ 79libs-y += arch/x86/lib/
77core-y += arch/x86_64/kernel/ \ 80core-y += arch/x86/kernel/ \
78 arch/x86_64/mm/ \ 81 arch/x86/mm/ \
79 arch/x86_64/crypto/ \ 82 arch/x86/crypto/ \
80 arch/x86_64/vdso/ 83 arch/x86/vdso/
81core-$(CONFIG_IA32_EMULATION) += arch/x86_64/ia32/ 84core-$(CONFIG_IA32_EMULATION) += arch/x86/ia32/
82drivers-$(CONFIG_PCI) += arch/x86_64/pci/ 85drivers-$(CONFIG_PCI) += arch/x86/pci/
83drivers-$(CONFIG_OPROFILE) += arch/x86_64/oprofile/ 86drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/
84 87
85boot := arch/x86_64/boot 88boot := arch/x86/boot
86 89
87PHONY += bzImage bzlilo install archmrproper \ 90PHONY += bzImage bzlilo install archmrproper \
88 fdimage fdimage144 fdimage288 isoimage archclean 91 fdimage fdimage144 fdimage288 isoimage archclean
@@ -90,10 +93,12 @@ PHONY += bzImage bzlilo install archmrproper \
90#Default target when executing "make" 93#Default target when executing "make"
91all: bzImage 94all: bzImage
92 95
93BOOTIMAGE := arch/x86_64/boot/bzImage 96BOOTIMAGE := arch/x86/boot/bzImage
94KBUILD_IMAGE := $(BOOTIMAGE) 97KBUILD_IMAGE := $(BOOTIMAGE)
95 98
96bzImage: vmlinux 99bzImage: vmlinux
100 $(Q)mkdir -p $(objtree)/arch/x86_64/boot
101 $(Q)ln -fsn $(objtree)/arch/x86/boot/bzImage $(objtree)/arch/x86_64/boot/bzImage
97 $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE) 102 $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE)
98 103
99bzlilo: vmlinux 104bzlilo: vmlinux
@@ -109,6 +114,7 @@ install:
109 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 114 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
110 115
111archclean: 116archclean:
117 $(Q)rm -rf $(objtree)/arch/x86_64/boot
112 $(Q)$(MAKE) $(clean)=$(boot) 118 $(Q)$(MAKE) $(clean)=$(boot)
113 119
114define archhelp 120define archhelp
diff --git a/arch/x86_64/boot/.gitignore b/arch/x86_64/boot/.gitignore
deleted file mode 100644
index 18465143cfa2..000000000000
--- a/arch/x86_64/boot/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
1bootsect
2bzImage
3setup
4setup.bin
5setup.elf
diff --git a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile
deleted file mode 100644
index 67096389de1f..000000000000
--- a/arch/x86_64/boot/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
1#
2# arch/x86_64/boot/Makefile
3#
4# The actual boot code is shared with i386 including the Makefile.
5# So tell kbuild that we fetch the code from i386 and include the
6# Makefile from i386 too.
7
8src := arch/i386/boot
9include $(src)/Makefile
diff --git a/arch/x86_64/boot/tools/.gitignore b/arch/x86_64/boot/tools/.gitignore
deleted file mode 100644
index 378eac25d311..000000000000
--- a/arch/x86_64/boot/tools/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
1build
diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
deleted file mode 100644
index ff5d8c9b96d9..000000000000
--- a/arch/x86_64/kernel/Makefile
+++ /dev/null
@@ -1,63 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4
5extra-y := head.o head64.o init_task.o vmlinux.lds
6EXTRA_AFLAGS := -traditional
7obj-y := process.o signal.o entry.o traps.o irq.o \
8 ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
9 x8664_ksyms.o i387.o syscall.o vsyscall.o \
10 setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
11 pci-dma.o pci-nommu.o alternative.o hpet.o tsc.o bugs.o \
12 perfctr-watchdog.o
13
14obj-$(CONFIG_STACKTRACE) += stacktrace.o
15obj-$(CONFIG_X86_MCE) += mce.o therm_throt.o
16obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
17obj-$(CONFIG_X86_MCE_AMD) += mce_amd.o
18obj-$(CONFIG_MTRR) += ../../i386/kernel/cpu/mtrr/
19obj-$(CONFIG_ACPI) += acpi/
20obj-$(CONFIG_X86_MSR) += msr.o
21obj-$(CONFIG_MICROCODE) += microcode.o
22obj-$(CONFIG_X86_CPUID) += cpuid.o
23obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o tsc_sync.o
24obj-y += apic.o nmi.o
25obj-y += io_apic.o mpparse.o genapic.o genapic_flat.o
26obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o
27obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
28obj-$(CONFIG_PM) += suspend.o
29obj-$(CONFIG_HIBERNATION) += suspend_asm.o
30obj-$(CONFIG_CPU_FREQ) += cpufreq/
31obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
32obj-$(CONFIG_IOMMU) += pci-gart.o aperture.o
33obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary.o tce.o
34obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o
35obj-$(CONFIG_KPROBES) += kprobes.o
36obj-$(CONFIG_X86_PM_TIMER) += pmtimer.o
37obj-$(CONFIG_X86_VSMP) += vsmp.o
38obj-$(CONFIG_K8_NB) += k8.o
39obj-$(CONFIG_AUDIT) += audit.o
40
41obj-$(CONFIG_MODULES) += module.o
42obj-$(CONFIG_PCI) += early-quirks.o
43
44obj-y += topology.o
45obj-y += intel_cacheinfo.o
46obj-y += addon_cpuid_features.o
47obj-y += pcspeaker.o
48
49CFLAGS_vsyscall.o := $(PROFILING) -g0
50
51therm_throt-y += ../../i386/kernel/cpu/mcheck/therm_throt.o
52bootflag-y += ../../i386/kernel/bootflag.o
53cpuid-$(subst m,y,$(CONFIG_X86_CPUID)) += ../../i386/kernel/cpuid.o
54topology-y += ../../i386/kernel/topology.o
55microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o
56intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o
57addon_cpuid_features-y += ../../i386/kernel/cpu/addon_cpuid_features.o
58quirks-y += ../../i386/kernel/quirks.o
59i8237-y += ../../i386/kernel/i8237.o
60msr-$(subst m,y,$(CONFIG_X86_MSR)) += ../../i386/kernel/msr.o
61alternative-y += ../../i386/kernel/alternative.o
62pcspeaker-y += ../../i386/kernel/pcspeaker.o
63perfctr-watchdog-y += ../../i386/kernel/cpu/perfctr-watchdog.o
diff --git a/arch/x86_64/kernel/acpi/Makefile b/arch/x86_64/kernel/acpi/Makefile
deleted file mode 100644
index 080b9963f1bc..000000000000
--- a/arch/x86_64/kernel/acpi/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
1obj-y := boot.o
2boot-y := ../../../i386/kernel/acpi/boot.o
3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
4
5ifneq ($(CONFIG_ACPI_PROCESSOR),)
6obj-y += processor.o
7processor-y := ../../../i386/kernel/acpi/processor.o ../../../i386/kernel/acpi/cstate.o
8endif
9
diff --git a/arch/x86_64/kernel/cpufreq/Makefile b/arch/x86_64/kernel/cpufreq/Makefile
deleted file mode 100644
index 753ce1dd418e..000000000000
--- a/arch/x86_64/kernel/cpufreq/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
1#
2# Reuse the i386 cpufreq drivers
3#
4
5SRCDIR := ../../../i386/kernel/cpu/cpufreq
6
7obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
8obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o
9obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o
10obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o
11obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o
12
13powernow-k8-objs := ${SRCDIR}/powernow-k8.o
14speedstep-centrino-objs := ${SRCDIR}/speedstep-centrino.o
15acpi-cpufreq-objs := ${SRCDIR}/acpi-cpufreq.o
16p4-clockmod-objs := ${SRCDIR}/p4-clockmod.o
17speedstep-lib-objs := ${SRCDIR}/speedstep-lib.o
diff --git a/arch/x86_64/kernel/hpet.c b/arch/x86_64/kernel/hpet.c
deleted file mode 100644
index e2d1b912e154..000000000000
--- a/arch/x86_64/kernel/hpet.c
+++ /dev/null
@@ -1,493 +0,0 @@
1#include <linux/kernel.h>
2#include <linux/sched.h>
3#include <linux/init.h>
4#include <linux/mc146818rtc.h>
5#include <linux/time.h>
6#include <linux/clocksource.h>
7#include <linux/ioport.h>
8#include <linux/acpi.h>
9#include <linux/hpet.h>
10#include <asm/pgtable.h>
11#include <asm/vsyscall.h>
12#include <asm/timex.h>
13#include <asm/hpet.h>
14
15#define HPET_MASK 0xFFFFFFFF
16#define HPET_SHIFT 22
17
18/* FSEC = 10^-15 NSEC = 10^-9 */
19#define FSEC_PER_NSEC 1000000
20
21int nohpet __initdata;
22
23unsigned long hpet_address;
24unsigned long hpet_period; /* fsecs / HPET clock */
25unsigned long hpet_tick; /* HPET clocks / interrupt */
26
27int hpet_use_timer; /* Use counter of hpet for time keeping,
28 * otherwise PIT
29 */
30
31#ifdef CONFIG_HPET
32static __init int late_hpet_init(void)
33{
34 struct hpet_data hd;
35 unsigned int ntimer;
36
37 if (!hpet_address)
38 return 0;
39
40 memset(&hd, 0, sizeof(hd));
41
42 ntimer = hpet_readl(HPET_ID);
43 ntimer = (ntimer & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT;
44 ntimer++;
45
46 /*
47 * Register with driver.
48 * Timer0 and Timer1 is used by platform.
49 */
50 hd.hd_phys_address = hpet_address;
51 hd.hd_address = (void __iomem *)fix_to_virt(FIX_HPET_BASE);
52 hd.hd_nirqs = ntimer;
53 hd.hd_flags = HPET_DATA_PLATFORM;
54 hpet_reserve_timer(&hd, 0);
55#ifdef CONFIG_HPET_EMULATE_RTC
56 hpet_reserve_timer(&hd, 1);
57#endif
58 hd.hd_irq[0] = HPET_LEGACY_8254;
59 hd.hd_irq[1] = HPET_LEGACY_RTC;
60 if (ntimer > 2) {
61 struct hpet *hpet;
62 struct hpet_timer *timer;
63 int i;
64
65 hpet = (struct hpet *) fix_to_virt(FIX_HPET_BASE);
66 timer = &hpet->hpet_timers[2];
67 for (i = 2; i < ntimer; timer++, i++)
68 hd.hd_irq[i] = (timer->hpet_config &
69 Tn_INT_ROUTE_CNF_MASK) >>
70 Tn_INT_ROUTE_CNF_SHIFT;
71
72 }
73
74 hpet_alloc(&hd);
75 return 0;
76}
77fs_initcall(late_hpet_init);
78#endif
79
80int hpet_timer_stop_set_go(unsigned long tick)
81{
82 unsigned int cfg;
83
84/*
85 * Stop the timers and reset the main counter.
86 */
87
88 cfg = hpet_readl(HPET_CFG);
89 cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);
90 hpet_writel(cfg, HPET_CFG);
91 hpet_writel(0, HPET_COUNTER);
92 hpet_writel(0, HPET_COUNTER + 4);
93
94/*
95 * Set up timer 0, as periodic with first interrupt to happen at hpet_tick,
96 * and period also hpet_tick.
97 */
98 if (hpet_use_timer) {
99 hpet_writel(HPET_TN_ENABLE | HPET_TN_PERIODIC | HPET_TN_SETVAL |
100 HPET_TN_32BIT, HPET_T0_CFG);
101 hpet_writel(hpet_tick, HPET_T0_CMP); /* next interrupt */
102 hpet_writel(hpet_tick, HPET_T0_CMP); /* period */
103 cfg |= HPET_CFG_LEGACY;
104 }
105/*
106 * Go!
107 */
108
109 cfg |= HPET_CFG_ENABLE;
110 hpet_writel(cfg, HPET_CFG);
111
112 return 0;
113}
114
115static cycle_t read_hpet(void)
116{
117 return (cycle_t)hpet_readl(HPET_COUNTER);
118}
119
120static cycle_t __vsyscall_fn vread_hpet(void)
121{
122 return readl((void __iomem *)fix_to_virt(VSYSCALL_HPET) + 0xf0);
123}
124
125struct clocksource clocksource_hpet = {
126 .name = "hpet",
127 .rating = 250,
128 .read = read_hpet,
129 .mask = (cycle_t)HPET_MASK,
130 .mult = 0, /* set below */
131 .shift = HPET_SHIFT,
132 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
133 .vread = vread_hpet,
134};
135
136int __init hpet_arch_init(void)
137{
138 unsigned int id;
139 u64 tmp;
140
141 if (!hpet_address)
142 return -1;
143 set_fixmap_nocache(FIX_HPET_BASE, hpet_address);
144 __set_fixmap(VSYSCALL_HPET, hpet_address, PAGE_KERNEL_VSYSCALL_NOCACHE);
145
146/*
147 * Read the period, compute tick and quotient.
148 */
149
150 id = hpet_readl(HPET_ID);
151
152 if (!(id & HPET_ID_VENDOR) || !(id & HPET_ID_NUMBER))
153 return -1;
154
155 hpet_period = hpet_readl(HPET_PERIOD);
156 if (hpet_period < 100000 || hpet_period > 100000000)
157 return -1;
158
159 hpet_tick = (FSEC_PER_TICK + hpet_period / 2) / hpet_period;
160
161 hpet_use_timer = (id & HPET_ID_LEGSUP);
162
163 /*
164 * hpet period is in femto seconds per cycle
165 * so we need to convert this to ns/cyc units
166 * aproximated by mult/2^shift
167 *
168 * fsec/cyc * 1nsec/1000000fsec = nsec/cyc = mult/2^shift
169 * fsec/cyc * 1ns/1000000fsec * 2^shift = mult
170 * fsec/cyc * 2^shift * 1nsec/1000000fsec = mult
171 * (fsec/cyc << shift)/1000000 = mult
172 * (hpet_period << shift)/FSEC_PER_NSEC = mult
173 */
174 tmp = (u64)hpet_period << HPET_SHIFT;
175 do_div(tmp, FSEC_PER_NSEC);
176 clocksource_hpet.mult = (u32)tmp;
177 clocksource_register(&clocksource_hpet);
178
179 return hpet_timer_stop_set_go(hpet_tick);
180}
181
182int hpet_reenable(void)
183{
184 return hpet_timer_stop_set_go(hpet_tick);
185}
186
187/*
188 * calibrate_tsc() calibrates the processor TSC in a very simple way, comparing
189 * it to the HPET timer of known frequency.
190 */
191
192#define TICK_COUNT 100000000
193#define SMI_THRESHOLD 50000
194#define MAX_TRIES 5
195
196/*
197 * Some platforms take periodic SMI interrupts with 5ms duration. Make sure none
198 * occurs between the reads of the hpet & TSC.
199 */
200static void __init read_hpet_tsc(int *hpet, int *tsc)
201{
202 int tsc1, tsc2, hpet1, i;
203
204 for (i = 0; i < MAX_TRIES; i++) {
205 tsc1 = get_cycles_sync();
206 hpet1 = hpet_readl(HPET_COUNTER);
207 tsc2 = get_cycles_sync();
208 if ((tsc2 - tsc1) < SMI_THRESHOLD)
209 break;
210 }
211 *hpet = hpet1;
212 *tsc = tsc2;
213}
214
215unsigned int __init hpet_calibrate_tsc(void)
216{
217 int tsc_start, hpet_start;
218 int tsc_now, hpet_now;
219 unsigned long flags;
220
221 local_irq_save(flags);
222
223 read_hpet_tsc(&hpet_start, &tsc_start);
224
225 do {
226 local_irq_disable();
227 read_hpet_tsc(&hpet_now, &tsc_now);
228 local_irq_restore(flags);
229 } while ((tsc_now - tsc_start) < TICK_COUNT &&
230 (hpet_now - hpet_start) < TICK_COUNT);
231
232 return (tsc_now - tsc_start) * 1000000000L
233 / ((hpet_now - hpet_start) * hpet_period / 1000);
234}
235
236#ifdef CONFIG_HPET_EMULATE_RTC
237/* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET
238 * is enabled, we support RTC interrupt functionality in software.
239 * RTC has 3 kinds of interrupts:
240 * 1) Update Interrupt - generate an interrupt, every sec, when RTC clock
241 * is updated
242 * 2) Alarm Interrupt - generate an interrupt at a specific time of day
243 * 3) Periodic Interrupt - generate periodic interrupt, with frequencies
244 * 2Hz-8192Hz (2Hz-64Hz for non-root user) (all freqs in powers of 2)
245 * (1) and (2) above are implemented using polling at a frequency of
246 * 64 Hz. The exact frequency is a tradeoff between accuracy and interrupt
247 * overhead. (DEFAULT_RTC_INT_FREQ)
248 * For (3), we use interrupts at 64Hz or user specified periodic
249 * frequency, whichever is higher.
250 */
251#include <linux/rtc.h>
252
253#define DEFAULT_RTC_INT_FREQ 64
254#define RTC_NUM_INTS 1
255
256static unsigned long UIE_on;
257static unsigned long prev_update_sec;
258
259static unsigned long AIE_on;
260static struct rtc_time alarm_time;
261
262static unsigned long PIE_on;
263static unsigned long PIE_freq = DEFAULT_RTC_INT_FREQ;
264static unsigned long PIE_count;
265
266static unsigned long hpet_rtc_int_freq; /* RTC interrupt frequency */
267static unsigned int hpet_t1_cmp; /* cached comparator register */
268
269int is_hpet_enabled(void)
270{
271 return hpet_address != 0;
272}
273
274/*
275 * Timer 1 for RTC, we do not use periodic interrupt feature,
276 * even if HPET supports periodic interrupts on Timer 1.
277 * The reason being, to set up a periodic interrupt in HPET, we need to
278 * stop the main counter. And if we do that everytime someone diables/enables
279 * RTC, we will have adverse effect on main kernel timer running on Timer 0.
280 * So, for the time being, simulate the periodic interrupt in software.
281 *
282 * hpet_rtc_timer_init() is called for the first time and during subsequent
283 * interuppts reinit happens through hpet_rtc_timer_reinit().
284 */
285int hpet_rtc_timer_init(void)
286{
287 unsigned int cfg, cnt;
288 unsigned long flags;
289
290 if (!is_hpet_enabled())
291 return 0;
292 /*
293 * Set the counter 1 and enable the interrupts.
294 */
295 if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
296 hpet_rtc_int_freq = PIE_freq;
297 else
298 hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
299
300 local_irq_save(flags);
301
302 cnt = hpet_readl(HPET_COUNTER);
303 cnt += ((hpet_tick*HZ)/hpet_rtc_int_freq);
304 hpet_writel(cnt, HPET_T1_CMP);
305 hpet_t1_cmp = cnt;
306
307 cfg = hpet_readl(HPET_T1_CFG);
308 cfg &= ~HPET_TN_PERIODIC;
309 cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
310 hpet_writel(cfg, HPET_T1_CFG);
311
312 local_irq_restore(flags);
313
314 return 1;
315}
316
317static void hpet_rtc_timer_reinit(void)
318{
319 unsigned int cfg, cnt, ticks_per_int, lost_ints;
320
321 if (unlikely(!(PIE_on | AIE_on | UIE_on))) {
322 cfg = hpet_readl(HPET_T1_CFG);
323 cfg &= ~HPET_TN_ENABLE;
324 hpet_writel(cfg, HPET_T1_CFG);
325 return;
326 }
327
328 if (PIE_on && (PIE_freq > DEFAULT_RTC_INT_FREQ))
329 hpet_rtc_int_freq = PIE_freq;
330 else
331 hpet_rtc_int_freq = DEFAULT_RTC_INT_FREQ;
332
333 /* It is more accurate to use the comparator value than current count.*/
334 ticks_per_int = hpet_tick * HZ / hpet_rtc_int_freq;
335 hpet_t1_cmp += ticks_per_int;
336 hpet_writel(hpet_t1_cmp, HPET_T1_CMP);
337
338 /*
339 * If the interrupt handler was delayed too long, the write above tries
340 * to schedule the next interrupt in the past and the hardware would
341 * not interrupt until the counter had wrapped around.
342 * So we have to check that the comparator wasn't set to a past time.
343 */
344 cnt = hpet_readl(HPET_COUNTER);
345 if (unlikely((int)(cnt - hpet_t1_cmp) > 0)) {
346 lost_ints = (cnt - hpet_t1_cmp) / ticks_per_int + 1;
347 /* Make sure that, even with the time needed to execute
348 * this code, the next scheduled interrupt has been moved
349 * back to the future: */
350 lost_ints++;
351
352 hpet_t1_cmp += lost_ints * ticks_per_int;
353 hpet_writel(hpet_t1_cmp, HPET_T1_CMP);
354
355 if (PIE_on)
356 PIE_count += lost_ints;
357
358 if (printk_ratelimit())
359 printk(KERN_WARNING "rtc: lost some interrupts at %ldHz.\n",
360 hpet_rtc_int_freq);
361 }
362}
363
364/*
365 * The functions below are called from rtc driver.
366 * Return 0 if HPET is not being used.
367 * Otherwise do the necessary changes and return 1.
368 */
369int hpet_mask_rtc_irq_bit(unsigned long bit_mask)
370{
371 if (!is_hpet_enabled())
372 return 0;
373
374 if (bit_mask & RTC_UIE)
375 UIE_on = 0;
376 if (bit_mask & RTC_PIE)
377 PIE_on = 0;
378 if (bit_mask & RTC_AIE)
379 AIE_on = 0;
380
381 return 1;
382}
383
384int hpet_set_rtc_irq_bit(unsigned long bit_mask)
385{
386 int timer_init_reqd = 0;
387
388 if (!is_hpet_enabled())
389 return 0;
390
391 if (!(PIE_on | AIE_on | UIE_on))
392 timer_init_reqd = 1;
393
394 if (bit_mask & RTC_UIE) {
395 UIE_on = 1;
396 }
397 if (bit_mask & RTC_PIE) {
398 PIE_on = 1;
399 PIE_count = 0;
400 }
401 if (bit_mask & RTC_AIE) {
402 AIE_on = 1;
403 }
404
405 if (timer_init_reqd)
406 hpet_rtc_timer_init();
407
408 return 1;
409}
410
411int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec)
412{
413 if (!is_hpet_enabled())
414 return 0;
415
416 alarm_time.tm_hour = hrs;
417 alarm_time.tm_min = min;
418 alarm_time.tm_sec = sec;
419
420 return 1;
421}
422
423int hpet_set_periodic_freq(unsigned long freq)
424{
425 if (!is_hpet_enabled())
426 return 0;
427
428 PIE_freq = freq;
429 PIE_count = 0;
430
431 return 1;
432}
433
434int hpet_rtc_dropped_irq(void)
435{
436 if (!is_hpet_enabled())
437 return 0;
438
439 return 1;
440}
441
442irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
443{
444 struct rtc_time curr_time;
445 unsigned long rtc_int_flag = 0;
446 int call_rtc_interrupt = 0;
447
448 hpet_rtc_timer_reinit();
449
450 if (UIE_on | AIE_on) {
451 rtc_get_rtc_time(&curr_time);
452 }
453 if (UIE_on) {
454 if (curr_time.tm_sec != prev_update_sec) {
455 /* Set update int info, call real rtc int routine */
456 call_rtc_interrupt = 1;
457 rtc_int_flag = RTC_UF;
458 prev_update_sec = curr_time.tm_sec;
459 }
460 }
461 if (PIE_on) {
462 PIE_count++;
463 if (PIE_count >= hpet_rtc_int_freq/PIE_freq) {
464 /* Set periodic int info, call real rtc int routine */
465 call_rtc_interrupt = 1;
466 rtc_int_flag |= RTC_PF;
467 PIE_count = 0;
468 }
469 }
470 if (AIE_on) {
471 if ((curr_time.tm_sec == alarm_time.tm_sec) &&
472 (curr_time.tm_min == alarm_time.tm_min) &&
473 (curr_time.tm_hour == alarm_time.tm_hour)) {
474 /* Set alarm int info, call real rtc int routine */
475 call_rtc_interrupt = 1;
476 rtc_int_flag |= RTC_AF;
477 }
478 }
479 if (call_rtc_interrupt) {
480 rtc_int_flag |= (RTC_IRQF | (RTC_NUM_INTS << 8));
481 rtc_interrupt(rtc_int_flag, dev_id);
482 }
483 return IRQ_HANDLED;
484}
485#endif
486
487static int __init nohpet_setup(char *s)
488{
489 nohpet = 1;
490 return 1;
491}
492
493__setup("nohpet", nohpet_setup);
diff --git a/arch/x86_64/lib/Makefile b/arch/x86_64/lib/Makefile
deleted file mode 100644
index c94327178398..000000000000
--- a/arch/x86_64/lib/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
1#
2# Makefile for x86_64-specific library files.
3#
4
5CFLAGS_csum-partial.o := -funroll-loops
6
7obj-y := io.o iomap_copy.o
8obj-$(CONFIG_SMP) += msr-on-cpu.o
9
10lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \
11 usercopy.o getuser.o putuser.o \
12 thunk.o clear_page.o copy_page.o bitstr.o bitops.o
13lib-y += memcpy.o memmove.o memset.o copy_user.o rwlock.o copy_user_nocache.o
diff --git a/arch/x86_64/lib/msr-on-cpu.c b/arch/x86_64/lib/msr-on-cpu.c
deleted file mode 100644
index 47e0ec47c376..000000000000
--- a/arch/x86_64/lib/msr-on-cpu.c
+++ /dev/null
@@ -1 +0,0 @@
1#include "../../i386/lib/msr-on-cpu.c"
diff --git a/arch/x86_64/mm/Makefile b/arch/x86_64/mm/Makefile
deleted file mode 100644
index d25ac86fe27a..000000000000
--- a/arch/x86_64/mm/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
1#
2# Makefile for the linux x86_64-specific parts of the memory manager.
3#
4
5obj-y := init.o fault.o ioremap.o extable.o pageattr.o mmap.o
6obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
7obj-$(CONFIG_NUMA) += numa.o
8obj-$(CONFIG_K8_NUMA) += k8topology.o
9obj-$(CONFIG_ACPI_NUMA) += srat.o
10
11hugetlbpage-y = ../../i386/mm/hugetlbpage.o
diff --git a/arch/x86_64/oprofile/Kconfig b/arch/x86_64/oprofile/Kconfig
deleted file mode 100644
index d8a84088471a..000000000000
--- a/arch/x86_64/oprofile/Kconfig
+++ /dev/null
@@ -1,17 +0,0 @@
1config PROFILING
2 bool "Profiling support (EXPERIMENTAL)"
3 help
4 Say Y here to enable the extended profiling support mechanisms used
5 by profilers such as OProfile.
6
7
8config OPROFILE
9 tristate "OProfile system profiling (EXPERIMENTAL)"
10 depends on PROFILING
11 help
12 OProfile is a profiling system capable of profiling the
13 whole system, include the kernel, kernel modules, libraries,
14 and applications.
15
16 If unsure, say N.
17
diff --git a/arch/x86_64/oprofile/Makefile b/arch/x86_64/oprofile/Makefile
deleted file mode 100644
index 6be32683e1bc..000000000000
--- a/arch/x86_64/oprofile/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
1#
2# oprofile for x86-64.
3# Just reuse the one from i386.
4#
5
6obj-$(CONFIG_OPROFILE) += oprofile.o
7
8DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
9 oprof.o cpu_buffer.o buffer_sync.o \
10 event_buffer.o oprofile_files.o \
11 oprofilefs.o oprofile_stats.o \
12 timer_int.o )
13
14OPROFILE-y := init.o backtrace.o
15OPROFILE-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o op_model_p4.o \
16 op_model_ppro.o
17OPROFILE-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o
18
19oprofile-y = $(DRIVER_OBJS) $(addprefix ../../i386/oprofile/, $(OPROFILE-y))
diff --git a/arch/x86_64/pci/Makefile b/arch/x86_64/pci/Makefile
deleted file mode 100644
index c9eddc8859c0..000000000000
--- a/arch/x86_64/pci/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
1#
2# Makefile for X86_64 specific PCI routines
3#
4# Reuse the i386 PCI subsystem
5#
6EXTRA_CFLAGS += -Iarch/i386/pci
7
8obj-y := i386.o
9obj-$(CONFIG_PCI_DIRECT)+= direct.o
10obj-y += fixup.o init.o
11obj-$(CONFIG_ACPI) += acpi.o
12obj-y += legacy.o irq.o common.o early.o
13# mmconfig has a 64bit special
14obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o mmconfig-shared.o
15
16obj-$(CONFIG_NUMA) += k8-bus.o
17
18direct-y += ../../i386/pci/direct.o
19acpi-y += ../../i386/pci/acpi.o
20legacy-y += ../../i386/pci/legacy.o
21irq-y += ../../i386/pci/irq.o
22common-y += ../../i386/pci/common.o
23fixup-y += ../../i386/pci/fixup.o
24i386-y += ../../i386/pci/i386.o
25init-y += ../../i386/pci/init.o
26early-y += ../../i386/pci/early.o
27mmconfig-shared-y += ../../i386/pci/mmconfig-shared.o
diff --git a/arch/x86_64/vdso/vdso.S b/arch/x86_64/vdso/vdso.S
deleted file mode 100644
index 92e80c1972a7..000000000000
--- a/arch/x86_64/vdso/vdso.S
+++ /dev/null
@@ -1,2 +0,0 @@
1 .section ".vdso","a"
2 .incbin "arch/x86_64/vdso/vdso.so"